window.thumbnails = {};
															thumbnails[6473499] = clik.newPhoto({"id":6473499,"src":"DSCF5054_buket_72dpi_thumb.JPG","galleries_id":356759,"server_id":5,"link":"photo_6473499.html","width":130,"caption":" Weed Flowers\/ ukrudts buket. Anno 2010. .Price:Dkr: 3000,-;£: 328,-; Euro: 400,-","height":176});
															thumbnails[6473697] = clik.newPhoto({"id":6473697,"src":"DSCF5102_opstilling_72_dpi_thumb.JPG","galleries_id":356760,"server_id":5,"link":"photo_6473697.html","width":130,"caption":"Stil-life:flowers and bunch og grapes in glas bowl\/ Stilleben: blomster og vindrueklase i glasskål.. Anno 2010. Pastel on paper.<br>\r\nSize: 31 x 38 cm.<br>\r\nPrice Dkr 2500;£274; Euro: 333","height":160});
															thumbnails[6473750] = clik.newPhoto({"id":6473750,"src":"DSCF5236slaebestedet72dpi_thumb.JPG","galleries_id":356755,"server_id":5,"link":"photo_6473750.html","width":130,"caption":"Landing  Sct Hans gade Faaborg\/ Slæbestedet ved Sct Hansgade Faaborg. Anno 2010.Pastel on paper<br>\r\nSize: 42 x 30 cm. Private<br>\r\n","height":93});
															thumbnails[6510758] = clik.newPhoto({"id":6510758,"src":"interior_thumb.jpg","galleries_id":357943,"server_id":5,"link":"photo_6510758.html","width":130,"caption":"Interior\/ Interiør: Anno 2010.Pastel on paper: Size: 42 x29,5 cm. Price:Dkr 2500,-;£ 274,- Euro 333,- .","height":185});
															thumbnails[6510447] = clik.newPhoto({"id":6510447,"src":"Still_life_with_grapes_thumb.JPG","galleries_id":356760,"server_id":5,"link":"photo_6510447.html","width":130,"caption":"Geranium and grapes; Pelargonie og druer.Anno 2010. Size 31x 38 cm. Private","height":185});
															thumbnails[6510579] = clik.newPhoto({"id":6510579,"src":"Still_life_nb_3_thumb.JPG","galleries_id":356759,"server_id":5,"link":"photo_6510579.html","width":130,"caption":"Weeds \/Ukrudtsbuket, Anno 2010. Pastel on velour.Size:47x34 cm.<br>\r\nPrice:Dkr 3000,-;£328,-;Euro 400,-.","height":174});
															thumbnails[6510626] = clik.newPhoto({"id":6510626,"src":"Pipstorn_dysse_thumb.JPG","galleries_id":356755,"server_id":5,"link":"photo_6510626.html","width":130,"caption":" Dolmen\/Langdysse. Anno2010. Pastel on paper. Size: 40 x28cm. <br>\r\nPrice:Dkr 1500,-;£ 164,-.Euro 200,-.","height":183});
															thumbnails[6510604] = clik.newPhoto({"id":6510604,"src":"Still_life_nb_2_thumb.JPG","galleries_id":356759,"server_id":5,"link":"photo_6510604.html","width":130,"caption":"Weeds\/ Ukrudtsbuket,Anno2010. Pastel on velour. Size: 45 x34 cm.<br>\r\nPrice: Dkr1500,-;£164,-Euro200,-","height":182});
															thumbnails[6473629] = clik.newPhoto({"id":6473629,"src":"DSCF5070_markbuket_72dpi_thumb_FA6D035E-24E8-5EC4-4F3D5655F9C3956E.JPG","galleries_id":356759,"server_id":5,"link":"photo_6473629.html","width":130,"caption":"Weed Flowers\/ Ukrudtsbuket. Anno 2010.Pastel on paper with acr ylic priming. Size: 28,5 x40. cm.Private.","height":187});
															thumbnails[6473671] = clik.newPhoto({"id":6473671,"src":"DSCF5079_kirken_Faaborg_72dpi_thumb.JPG","galleries_id":356755,"server_id":5,"link":"photo_6473671.html","width":130,"caption":"Old tree close to the Church in Faaborg\/ Gammelt trae  ved kirken i Faaborg.<br>\r\nAnno 2010. Pastel on paper .Size:41 x 29 cm.<br>\r\nPrice: Dkr:  3500,-£:383,- Euro: 466,-","height":188});
															thumbnails[6473692] = clik.newPhoto({"id":6473692,"src":"DSCF5096_opstilling_72_dpi_thumb.JPG","galleries_id":356760,"server_id":5,"link":"photo_6473692.html","width":130,"caption":"Still-life with little flowers and a decanter\/ Stillleben med små blomster og karaffel. Anno 2010.Pastel on paper.Size:41 x28 cm.<br>\r\nPrice: Dkr 2500,-;£274,- Euro: 333,-.","height":183});
															thumbnails[6473464] = clik.newPhoto({"id":6473464,"src":"DSCF5044hyld_72dpi_thumb.JPG","galleries_id":356759,"server_id":5,"link":"photo_6473464.html","width":130,"caption":"Elder bush in blossom\/ Blomstrende hyldebusk. Anno 2010.Pastel on Canvas. <br>\r\nSize: 40 x 30 cm. Private","height":174});
															thumbnails[6473689] = clik.newPhoto({"id":6473689,"src":"DSCF5094_kirken_Faaborg_72dpi_thumb.JPG","galleries_id":356755,"server_id":5,"link":"photo_6473689.html","width":130,"caption":"The back of the Church in Faaborg\/ Bagsiden af Faaborg kirke.Anno 2010. Pastel on paper.Size:41 x 39 cm .<br>\r\nPrice: Dkr:2500,- ; £274,-; Euro: 333,-.","height":181});
															thumbnails[6473705] = clik.newPhoto({"id":6473705,"src":"DSCF5104_opstilling_72_dpiJPG_thumb.jpg","galleries_id":356760,"server_id":5,"link":"photo_6473705.html","width":130,"caption":"Stil-life:grapes ,glas of vine ,decanter with vine\/ Stilleben: vindruer, vinglas og vinkaraffel.Anno  2010. Pastel on paper. Size:30 X 40 cm. <br>\r\nPrice:Dkr 2500;£274;Euro 333.","height":176});
															thumbnails[6473522] = clik.newPhoto({"id":6473522,"src":"DSCF5064_aakander_72dpi_thumb.JPG","galleries_id":356755,"server_id":5,"link":"photo_6473522.html","width":130,"caption":"Waterlillies\/ Åkander.Anno 2010. Pastel on paper.Size: 28 x 39 cm. Prize: Dkr: 2500;- £: 274;- Euro: 333;-","height":93});
															thumbnails[6473678] = clik.newPhoto({"id":6473678,"src":"DSCF5083opstilling_72_dpi_thumb.JPG","galleries_id":356760,"server_id":5,"link":"photo_6473678.html","width":130,"caption":"Still- life: drapery with appels\/ Stilleben: draperi med æbler. anno 2010.Pastel on verlour paper.<br>\r\nSize: 28 x18,5 cm.<br>\r\nPrice: Dkr 2000,-;£ 219; Euro 266,-","height":186});
															thumbnails[6473525] = clik.newPhoto({"id":6473525,"src":"DSCF5067aakander_72dpi_thumb.JPG","galleries_id":356755,"server_id":5,"link":"photo_6473525.html","width":130,"caption":"Waterlillies\/ Åkander. Anno 2010.Pastel on paper.Size: 28 x 40 cm.<br>\r\nPrice: Dkr 2500,-;£274,-; Euro 333,-.","height":90});
															thumbnails[6473684] = clik.newPhoto({"id":6473684,"src":"DSCF5089_opstilling_72dpi_thumb.JPG","galleries_id":356760,"server_id":5,"link":"photo_6473684.html","width":130,"caption":"Stil -life with candle ,lillies and animal skull\/ Stilleben med stearinlys, liljer og dyrekranium.Anno.2010.Pastel on paper.Size:42 x 31 cm. <br>\r\nPrice: Dkr 3500;£ 383;Euro 466","height":176});
															thumbnails[6510668] = clik.newPhoto({"id":6510668,"src":"Pelargonie_thumb.JPG","galleries_id":356759,"server_id":5,"link":"photo_6510668.html","width":130,"caption":"Geranium\/Pelargonie:Anno 2010. Pastel on canvas: Size: 24 x 18 cm. Private.","height":173});
															thumbnails[6473662] = clik.newPhoto({"id":6473662,"src":"DSCF5077_norremarken_72dpi_thumb.JPG","galleries_id":356755,"server_id":5,"link":"photo_6473662.html","width":130,"caption":"Landskabe near Svanninge\/ Landskab ved Svanninge. Anno 2010. Pastel on paper .Size: 41 x 28 cm.<br>\r\nPrize: Dkr: 2500,-; £:274,-; Euro: 333,-.","height":92});
															thumbnails[6473639] = clik.newPhoto({"id":6473639,"src":"DSCF5074_ved_nakkeboelle_thumb.JPG","galleries_id":356755,"server_id":5,"link":"photo_6473639.html","width":130,"caption":"Whithethorn  near Nakkeboelle \/ Hvidtjoern naer Nakkeboelle.Anno 2010.Pastel on paper Size:29 x 40  cm.<br>\r\nPrize: Dkr 2500,-; £ 274,-;Euro 333,-.","height":92});
															thumbnails[6473739] = clik.newPhoto({"id":6473739,"src":"DSCF5049pelagonie_crop72dpi_thumb.JPG","galleries_id":356759,"server_id":5,"link":"photo_6473739.html","width":130,"caption":"Geranium\/Pelargonie. Anno 2010.Pastel on canvas. <br>\r\nSize: 70 x 43,5 cm<br>\r\nPrivate","height":205});
															thumbnails[6473452] = clik.newPhoto({"id":6473452,"src":"DSCF5042lilier_72dpi_thumb.JPG","galleries_id":356759,"server_id":5,"link":"photo_6473452.html","width":130,"caption":"Lillies\/ Liljer Anno 2010. Pastel on velour.  Size :28 x 34 cm. Pris Dkr. 2500, - ;<br>\r\n£:274,- ; Euro:333,- .","height":108});
															thumbnails[6473507] = clik.newPhoto({"id":6473507,"src":"DSCF5058_mod_dyreborg72dpi_thumb.JPG","galleries_id":356755,"server_id":5,"link":"photo_6473507.html","width":130,"caption":"View to dyreborg  from Faaborg\/Udsiogt til Dyreborg fra Faaborg.Anno 2010. Pastel on paper. Size: 29 x 38 cm.<br>\r\nPrice: Dkr: 2500,- ; £:274,-; Euro: 333,-","height":97});
															thumbnails[6473712] = clik.newPhoto({"id":6473712,"src":"DSCF5110_fra_dyreborg_mod_faaborg_72_dpi_thumb.JPG","galleries_id":356755,"server_id":5,"link":"photo_6473712.html","width":130,"caption":"View to Faaborg\/ Udsigt mod Faaborg. Anno 2010.Pastel on paper.Size: 30 x 38 cm.<br>\r\nPrice:Dkr 2500,-;£ 274,- Euro : 333,- ","height":104});
															thumbnails[6510681] = clik.newPhoto({"id":6510681,"src":"Olive_thumb.JPG","galleries_id":356759,"server_id":5,"link":"photo_6510681.html","width":130,"caption":"Olivetree\/Oliventræ. Anno 2010. Pastel on velour.Size:47 x35 cm. <br>\r\nPrice:Dkr 2000,-;£219,-; Euro: 266,-.","height":174});
															thumbnails[6473722] = clik.newPhoto({"id":6473722,"src":"DSCF5112_stranden_dyreborg_72_dpi_thumb.JPG","galleries_id":356755,"server_id":5,"link":"photo_6473722.html","width":130,"caption":"View to Dyreborg\/Udsigt mod Dyreborg. Anno 2010. Pastel on paper. Size:25 x 38 cm <br>\r\nPrice: Dkr: 2500,- £ 274,- ; Euro 333,-","height":106});
															thumbnails[6473834] = clik.newPhoto({"id":6473834,"src":"DSCF5251regnfan72dpi_thumb.JPG","galleries_id":356695,"server_id":5,"link":"photo_6473834.html","width":130,"caption":"Tansy\/Rejnfan.Anno 2002. Hard ground and etching.<br>\r\nSize with little paspartout:30 x 21cm.(See also the motive taken closer on the other foto.)<br>\r\nPrice:Dkr 1500,-;£164;Euro 200.","height":168});
															thumbnails[6473837] = clik.newPhoto({"id":6473837,"src":"DSCF5251regnfan_crop_72dpiJPG_thumb.jpg","galleries_id":356695,"server_id":5,"link":"photo_6473837.html","width":130,"caption":"Tansy\/Rejnfan. Anno 2002.Hard ground and etching.Size ,with litle paspartout: 30 x21 cm.( Motive close)<br>\r\n","height":173});
															thumbnails[6473769] = clik.newPhoto({"id":6473769,"src":"DSCF5241trae72dpi_thumb.JPG","galleries_id":356695,"server_id":5,"link":"photo_6473769.html","width":130,"caption":"Tree\/ Træ. Anno 2005. Hard ground and etching.Size 24x34 cm. <br>\r\nPrize; Dkr.1500,;£164,-Euro 200,-","height":166});
															thumbnails[6473778] = clik.newPhoto({"id":6473778,"src":"DSCF5245blade72dpiJPG_thumb.jpg","galleries_id":356695,"server_id":5,"link":"photo_6473778.html","width":130,"caption":"Chestnut\/ Kastanie.Anno 2005.Hard ground and etching,Size:49 x34 cm( see also the motive taken closeon the other foto)<br>\r\nPrice:Dkr 2000,-£219,-;Euro266,-","height":170});
															thumbnails[6473772] = clik.newPhoto({"id":6473772,"src":"DSCF5243blade_crop_72dpiJPG_thumb.jpg","galleries_id":356695,"server_id":5,"link":"photo_6473772.html","width":130,"caption":"Chestnut\/Kastanie.Anno2005. Hard ground and etching. Size:49 x 34 cm ( Motive  close )<br>\r\n","height":173});
															thumbnails[6473762] = clik.newPhoto({"id":6473762,"src":"DSCF5240insekt2_72dpi_thumb.JPG","galleries_id":356695,"server_id":5,"link":"photo_6473762.html","width":130,"caption":"Small insekt\/ Natsværmer. Anno 2005. Hard ground and etching,Size:27 x25 cm. ( see also the motive close  on other foto) <br>\r\nPrice for both insect motives ( Are sold together)Dkr : 5000,-;£ 548-;Euro 666. ","height":147});
															thumbnails[6510851] = clik.newPhoto({"id":6510851,"src":"Insect_nb_2_thumb.JPG","galleries_id":356695,"server_id":5,"link":"photo_6510851.html","width":130,"caption":"Little insect\/ Natsværmer.  Anno 2005. Hard ground and etching.<br>\r\nClose up.","height":95});
															thumbnails[6473760] = clik.newPhoto({"id":6473760,"src":"DSCF5239insekt_m_pas_partout72dpiJPG_thumb.jpg","galleries_id":356695,"server_id":5,"link":"photo_6473760.html","width":130,"caption":"Little insect\/ Natsværmer. Anno2005.Hard ground and etching.Size 27x 25 cm( se also motive  close on other foto).<br>\r\nPrice for both insect motives  (Are sold together ) Dkr 5000,-; £548,-Euro 666,-","height":137});
															thumbnails[6510859] = clik.newPhoto({"id":6510859,"src":"Insect_nb_1_thumb.JPG","galleries_id":356695,"server_id":5,"link":"photo_6510859.html","width":130,"caption":"Little insect\/ Natsværmer: anno 2005.Hard ground and etching. Close up.","height":182});
															thumbnails[6473841] = clik.newPhoto({"id":6473841,"src":"DSCF5252dandy_lions_72dpi_thumb.JPG","galleries_id":356695,"server_id":5,"link":"photo_6473841.html","width":130,"caption":"Dandelion\/Mælkebøtte. Anno 2001. Hard ground and etching.Size: 30 x 21 cm.<br>\r\nPrice: Dkr 1500;£164;Euro 200","height":183});
															thumbnails[6484843] = clik.newPhoto({"id":6484843,"src":"DSCF5252maelkebotter_crop_72dpi_thumb.JPG","galleries_id":356695,"server_id":5,"link":"photo_6484843.html","width":130,"caption":"Dandelion\/ Mælkebøtter, Anno 2005.Hard ground and etching.size30 x 21 cm. Motive close","height":191});
															thumbnails[6473811] = clik.newPhoto({"id":6473811,"src":"DSCF5247spiral72dpi_thumb.JPG","galleries_id":356695,"server_id":5,"link":"photo_6473811.html","width":130,"caption":"Without title\/ Uden titel. Anno 2005.Hard ground and etching. Size:50x 34 cm.(See also motive close)<br>\r\nPrice: Dkr 3500,-£383,- Euro 466,-","height":93});
															thumbnails[6473782] = clik.newPhoto({"id":6473782,"src":"DSCF5247_spiral_close_up72_dpi_thumb.JPG","galleries_id":356695,"server_id":5,"link":"photo_6473782.html","width":130,"caption":"Without title\/ Uden titel. Anno 2005. Hard gróund  and etching .Motive  close.","height":79});
															thumbnails[6484844] = clik.newPhoto({"id":6484844,"src":"DSCF5253mille72dpiJPG_thumb.jpg","galleries_id":356695,"server_id":5,"link":"photo_6484844.html","width":130,"caption":"Black cat\/ Sort kat. Anno2005.Monografi.Size:14 x 20 cm.<br>\r\nPrice: Dkr 1000,-; £ 109,- Euro133,-","height":93});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[356759] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Blomster\/Flowers","link":"gallery_356759.html","maxRecords":0.0,"photoIDs":[6473499.0,6510579.0,6510604.0,6473629.0,6473464.0,6510668.0,6473739.0,6473452.0,6510681.0],"skipIndex":0,"section_code":"gallery","featured_images":"6510681,6510668,6510604,6510579,6473739,6473629,6473499,6473464,6473452","id":356759,"singleSection":false});				  						galleries[356755] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Natur\/Nature","link":"gallery_356755.html","maxRecords":0.0,"photoIDs":[6473750.0,6510626.0,6473671.0,6473689.0,6473522.0,6473525.0,6473662.0,6473639.0,6473507.0,6473712.0,6473722.0],"skipIndex":0,"section_code":"gallery","featured_images":"6510626,6473750,6473722,6473712,6473689,6473671,6473662,6473639,6473525,6473522,6473507","id":356755,"singleSection":false});				  						galleries[356760] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Stilleben\/ Still-life","link":"gallery_356760.html","maxRecords":0.0,"photoIDs":[6473697.0,6510447.0,6473692.0,6473705.0,6473678.0,6473684.0],"skipIndex":0,"section_code":"gallery","featured_images":"6510447,6473705,6473697,6473692,6473684,6473678","id":356760,"singleSection":false});				  						galleries[356695] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Etching\/ Engraving\/ Grafik","link":"section425384.html","maxRecords":0.0,"photoIDs":[6473834.0,6473837.0,6473769.0,6473778.0,6473772.0,6473762.0,6510851.0,6473760.0,6510859.0,6473841.0,6484843.0,6473811.0,6473782.0,6484844.0],"skipIndex":0,"section_code":"section425384","featured_images":"6510859,6510851,6473841,6473837,6473834,6473811,6473782,6473778,6473772,6473769,6473762,6473760","id":356695,"singleSection":false});				  						galleries[357943] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Interior\/ Interioer","link":"gallery_357943.html","maxRecords":0.0,"photoIDs":[6510758.0],"skipIndex":0,"section_code":"gallery","featured_images":6510758.0,"id":357943,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '6510758,6473834,6473750,6473697,6473499,6510626,6510579,6510447,6510604,6473837,6473692,6473671,6473629,6473705,6473689,6473464,6473678,6473522,6510668,6473772,6473684,6473525,6510851,6473662,6473739,6473639,6473760,6473507,6473452,6510859,6510681,6473712,6473841,6473722,6473782';
imageSets[2] = '6510758,6473834,6473750,6473697,6473499,6510626,6510579,6510447,6510604,6473837,6473692,6473671,6473629,6473769,6473705,6473689,6473464,6473778,6473678,6473522,6510668,6473772,6473684,6473525,6510851,6473762,6473662,6473739,6473639,6473760,6473507,6473452,6510859,6510681,6473712,6473841,6473722,6473811,6473782';
imageSets[3] = '6510859,6510851,6510758,6510681,6510668,6510626,6510604,6510579,6510447,6484844,6484843,6473841,6473837,6473834,6473811,6473782,6473778,6473772,6473769,6473762,6473760,6473750,6473739,6473722,6473712,6473705,6473697,6473692,6473689,6473684,6473678,6473671,6473662,6473639,6473629,6473525,6473522,6473507,6473499,6473464,6473452';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/bentep/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/bentep/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/bentep/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/bentep/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/bentep/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/bentep/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/bentep/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/bentep/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/bentep/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/bentep/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/bentep/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/bentep/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/bentep/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/bentep/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/bentep/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/bentep/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/bentep/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/bentep/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/bentep/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/bentep/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/bentep/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/bentep/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/bentep/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/bentep/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/bentep/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/bentep/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/bentep/images';
		break;
	}
		return val;
}

/***************************************************************************
* img = reference to image object in which to show image                   *
***************************************************************************/
function showHomeImage(img) {
	imageID = randomListVal('');
	if (!basic) {
		img.src = photos[imageID].src;
		img.width = photos[imageID].width;
		img.height = photos[imageID].height;
		img.parentNode.title = img.alt = photos[imageID].caption;
	} else {
		newImage = new Image(photos[imageID].width,photos[imageID].height);
		newImage.src = photos[imageID].src;
		document.images[img.name] = newImage;
		
	}
}

function getHomeImageLink(imageID) {
  	var href='', photo = (backgrounds || photos || {})[imageID];
	if(photo){
		if (photo && photo.galleries_id != '') {
  			href = photo.fnGalleryLink();
  		}
  		  		else {
  				href += 'gallery.html';
  	  		}
	}
    return href;
}

/***************************************************************************
* Show a random image on home page from featured images                    *
***************************************************************************/
function showHomeImageInline(el, image_sets_id, href) {
	
	var css = {}, imageID,
	    imageSetsId = 1;
	if(image_sets_id){
		imageSetsId = image_sets_id;
	}
	imageID = randomListVal(imageSets[imageSetsId]);
	if (href == null && 'gallery' != '') {
					href = getHomeImageLink(imageID);
	}
	
	updateImage({nextPhoto: backgrounds[imageID], img:el.find('img')[0],
                $photo:el, $title:$('#homeimageTitleContainer'), $detail:$('#homeimageDetailsContainer'),                speed:0, href:href, css:css, onAfter: function(){                  this.closest('.contentsection').doManualAlign({				    inner: 'img',				    crop: 'a'				  });                }              });
}

/***************************************************************************
* Set 'img' to be a new image given its photo() object                     *
***************************************************************************/
function updateImage (options) {
	var defaults = {nextPhoto:'',field:'',img:'',$photo:'',$title:'',$detail:'',$detailContainer:'',
                    updateDocumentTitle:false,speed:0,href:false,css:false,updateHash:false,onAfter:null,onBefore:null},
		op = $.extend({},defaults,options),
		html = '', temp = '',
		photoId = op.nextPhoto.id,
		photoCaption = ''+op.nextPhoto.caption,
		photoSrc = op.nextPhoto.src;
	
	if (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
	}
		
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'Posseltart: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		if (op.$photo.length > 0) {
		html = $('<img/>',{
			'class': 'mainphoto photo',
			src: photoSrc,
			id: 'mainPic',
			name: 'mainPic',
			width: op.nextPhoto.width,
			height: op.nextPhoto.height,
			alt: photoCaption,
			css: op.css || {}
		});
		if (op.href) {
			if (op.href.match(/<a/)) {
				html = $(op.href).append(html);
			} else {
				html = $('<a/>', {
					href: op.href,
					title: photoCaption
				}).append(html);
			}
		} else {
			html = $('<a/>', {
				title: photoCaption
			}).append(html);
		}
		if (op.speed == 0) {			op.$photo.html(html);			if (op.onBefore) {			  	op.onBefore.apply(op.$photo);			}			if (op.onAfter) {			  	op.onAfter.apply(op.$photo);			}		} else {			op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){  				if (op.onAfter) {				  	op.onAfter.apply(this);				}				clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));			}, op.onBefore);
		}	}
    if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
        if (!op.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.photo_ref != '') {
		temp += '<div class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</div>';
	}
		if (this.takendate != '') {
		
		temp += '<div class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</div>';
	}
	
	if (this.location != '') {
		
		temp += '<div class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</div>';
	}
				
				if (temp != '') {
		temp += '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp += '<p>Order this print:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> ' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
		else {
		
	}
	if (this.item_price !== '') {
			temp += '<div class="clearing">&nbsp;</div>';
	}
	return temp;};

/***************************************************************************
* Pick a photo at random from the featured images of a gallery.            *
* Gallery_id = id of gallery to choose,                                    *
* img = reference to html image in                                         *
* which to show image                                                      *
***************************************************************************/
function showGalleryImage(gallery_id, img, updateLink) {
	
	if(img){
		if (location.hash.match('galleries_id=' + gallery_id) && (imageID = location.hash.match('.*photos_id=(.+)$'))) {
		  	imageID = imageID[1];
		} else {
		  	imageID = randomListVal(galleries[gallery_id].featured_images);
		}
		
		if (imageID != 0) {
			img.src = thumbnails[imageID].src;
			img.width = thumbnails[imageID].width;
			img.height = thumbnails[imageID].height;
			img.alt = galleries[gallery_id].title;
			if (updateLink) {
				$(img).parent().attr({					title: galleries[gallery_id].title				}).filter(function(){return this.href;}).attr({					href: thumbnails[imageID].fnGalleryLink(gallery_id)				});
			}
		}
	}
}

/***************************************************************************
* If we have dynamic HTML, replace the galleries link with a list that     *
* doesn't include thecurrent gallery                                       *
***************************************************************************/
function showGalleries(gallery_id) {
		
	
	if (!basic) {
		temp = '';
		for (i = 0; i < galleries.length; i++) {
						
			
			if (galleries[i].id != gallery_id) {
								
				if (temp != '') {
					temp += ' | ';
				}
								temp += '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
							}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

		

