window.thumbnails = {};
															thumbnails[1986355] = clik.newPhoto({"id":1986355,"src":"Grass-Legs_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":103});
															thumbnails[8534074] = clik.newPhoto({"id":8534074,"src":"melbu50_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":130});
															thumbnails[2757882] = clik.newPhoto({"id":2757882,"src":"Sticks_thumb.web.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":85});
															thumbnails[2762131] = clik.newPhoto({"id":2762131,"src":"Derude-derinde_thumb.web.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":130});
															thumbnails[2762133] = clik.newPhoto({"id":2762133,"src":"Det-der-nu_thumb.web.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":130});
															thumbnails[2762141] = clik.newPhoto({"id":2762141,"src":"Fuglen-hang-fra-taget-(jeg-floej-heller-ikke)_thumb.web..jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":130});
															thumbnails[2762137] = clik.newPhoto({"id":2762137,"src":"Spor_i_sten_thumb.web.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":130});
															thumbnails[2757805] = clik.newPhoto({"id":2757805,"src":"treaer_thumb.web.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":130});
															thumbnails[2757785] = clik.newPhoto({"id":2757785,"src":"box_thumb.web.new.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":130});
															thumbnails[2757783] = clik.newPhoto({"id":2757783,"src":"wc_thumb.web.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":130});
															thumbnails[2757786] = clik.newPhoto({"id":2757786,"src":"forest_thumb.web.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":130});
															thumbnails[3684077] = clik.newPhoto({"id":3684077,"src":"mugweb_thumb.jpg","galleries_id":224822,"server_id":18,"link":"photo_3684077.html","width":130,"caption":"","height":130});
															thumbnails[7129918] = clik.newPhoto({"id":7129918,"src":"darkcastle1TH.jpg","galleries_id":385557,"server_id":18,"link":"photo_7129918.html","width":130,"caption":"","height":130});
															thumbnails[2757876] = clik.newPhoto({"id":2757876,"src":"powerstationweb_thumb.jpg","galleries_id":129557,"server_id":18,"link":"photo_2757876.html","width":130,"caption":"","height":92});
															thumbnails[3679351] = clik.newPhoto({"id":3679351,"src":"It-took-time1web_thumb.jpg","galleries_id":224822,"server_id":18,"link":"photo_3679351.html","width":130,"caption":"","height":130});
															thumbnails[7130026] = clik.newPhoto({"id":7130026,"src":"darkcastle3_thumb.jpg","galleries_id":385557,"server_id":18,"link":"photo_7130026.html","width":130,"caption":"","height":130});
															thumbnails[7130030] = clik.newPhoto({"id":7130030,"src":"darkcastle5_thumb.jpg","galleries_id":385557,"server_id":18,"link":"photo_7130030.html","width":130,"caption":"","height":130});
															thumbnails[2757872] = clik.newPhoto({"id":2757872,"src":"musroomsweb_thumb.jpg","galleries_id":129557,"server_id":18,"link":"photo_2757872.html","width":130,"caption":"","height":92});
															thumbnails[3679353] = clik.newPhoto({"id":3679353,"src":"it-took-time2web_thumb.jpg","galleries_id":224822,"server_id":18,"link":"photo_3679353.html","width":130,"caption":"","height":130});
															thumbnails[7129983] = clik.newPhoto({"id":7129983,"src":"darkcastle2TH.jpg","galleries_id":385557,"server_id":18,"link":"photo_7129983.html","width":130,"caption":"","height":130});
															thumbnails[7130097] = clik.newPhoto({"id":7130097,"src":"doublewoble_thumb.jpg","galleries_id":385557,"server_id":18,"link":"photo_7130097.html","width":130,"caption":"","height":130});
															thumbnails[3554915] = clik.newPhoto({"id":3554915,"src":"3pavillionweb_thumb.jpg","galleries_id":129557,"server_id":18,"link":"photo_3554915.html","width":130,"caption":"","height":130});
															thumbnails[7130126] = clik.newPhoto({"id":7130126,"src":"eksperiment2_thumb.jpg","galleries_id":385557,"server_id":18,"link":"photo_7130126.html","width":130,"caption":"","height":130});
															thumbnails[7130131] = clik.newPhoto({"id":7130131,"src":"experiment1TH.jpg","galleries_id":385557,"server_id":18,"link":"photo_7130131.html","width":130,"caption":"","height":130});
															thumbnails[2757863] = clik.newPhoto({"id":2757863,"src":"cupcake_2web_thumb.jpg","galleries_id":129557,"server_id":18,"link":"photo_2757863.html","width":130,"caption":"","height":92});
															thumbnails[3679355] = clik.newPhoto({"id":3679355,"src":"it-took-time4web_thumb.jpg","galleries_id":224822,"server_id":18,"link":"photo_3679355.html","width":130,"caption":"","height":130});
															thumbnails[7130187] = clik.newPhoto({"id":7130187,"src":"fjell_thumb.jpg","galleries_id":385557,"server_id":18,"link":"photo_7130187.html","width":130,"caption":"","height":130});
															thumbnails[7130230] = clik.newPhoto({"id":7130230,"src":"snoblindTH.jpg","galleries_id":385557,"server_id":18,"link":"photo_7130230.html","width":130,"caption":"","height":130});
															thumbnails[1986066] = clik.newPhoto({"id":1986066,"src":"ship1_thumb.jpg","galleries_id":129557,"server_id":18,"link":"photo_1986066.html","width":130,"caption":"","height":130});
															thumbnails[3679284] = clik.newPhoto({"id":3679284,"src":"it-took-time6web_thumb.jpg","galleries_id":224822,"server_id":18,"link":"photo_3679284.html","width":130,"caption":"","height":130});
															thumbnails[7130235] = clik.newPhoto({"id":7130235,"src":"snoblinddetalj_thumb.jpg","galleries_id":385557,"server_id":18,"link":"photo_7130235.html","width":130,"caption":"","height":130});
															thumbnails[7130193] = clik.newPhoto({"id":7130193,"src":"flymetothemoon_thumb.jpg","galleries_id":385557,"server_id":18,"link":"photo_7130193.html","width":130,"caption":"","height":130});
															thumbnails[2336367] = clik.newPhoto({"id":2336367,"src":"eath_thumb.jpg","galleries_id":129557,"server_id":18,"link":"photo_2336367.html","width":127,"caption":"","height":130});
															thumbnails[7130212] = clik.newPhoto({"id":7130212,"src":"krater_thumb.jpg","galleries_id":385557,"server_id":18,"link":"photo_7130212.html","width":130,"caption":"","height":130});
															thumbnails[7129879] = clik.newPhoto({"id":7129879,"src":"3Dmountain_thumb.jpg","galleries_id":385557,"server_id":18,"link":"photo_7129879.html","width":130,"caption":"","height":130});
															thumbnails[7130226] = clik.newPhoto({"id":7130226,"src":"Panorama2_thumb.jpg","galleries_id":385557,"server_id":18,"link":"photo_7130226.html","width":130,"caption":"","height":130});
															thumbnails[7130903] = clik.newPhoto({"id":7130903,"src":"showwiev1_thumb.jpg","galleries_id":385557,"server_id":18,"link":"photo_7130903.html","width":130,"caption":"","height":130});
															thumbnails[3691824] = clik.newPhoto({"id":3691824,"src":"sticks_no3web_thumb.jpg","galleries_id":129557,"server_id":18,"link":"photo_3691824.html","width":130,"caption":"","height":110});
															thumbnails[7130223] = clik.newPhoto({"id":7130223,"src":"oversikt1_thumb.jpg","galleries_id":385557,"server_id":18,"link":"photo_7130223.html","width":130,"caption":"","height":130});
															thumbnails[3679283] = clik.newPhoto({"id":3679283,"src":"Bathing_Jetty2web_thumb.jpg","galleries_id":129557,"server_id":18,"link":"photo_3679283.html","width":130,"caption":"","height":91});
															thumbnails[3679369] = clik.newPhoto({"id":3679369,"src":"it-took-time7web_thumb.jpg","galleries_id":224822,"server_id":18,"link":"photo_3679369.html","width":130,"caption":"","height":130});
															thumbnails[3679275] = clik.newPhoto({"id":3679275,"src":"walking_womanweb_thumb.jpg","galleries_id":129557,"server_id":18,"link":"photo_3679275.html","width":130,"caption":"","height":91});
															thumbnails[3679359] = clik.newPhoto({"id":3679359,"src":"it-took-time8web_thumb.jpg","galleries_id":224822,"server_id":18,"link":"photo_3679359.html","width":130,"caption":"","height":130});
															thumbnails[3684146] = clik.newPhoto({"id":3684146,"src":"it-took-time5web_thumb.jpg","galleries_id":224822,"server_id":18,"link":"photo_3684146.html","width":130,"caption":"","height":130});
															thumbnails[3679279] = clik.newPhoto({"id":3679279,"src":"tugboatweb_thumb.jpg","galleries_id":129557,"server_id":18,"link":"photo_3679279.html","width":130,"caption":"","height":93});
															thumbnails[3691739] = clik.newPhoto({"id":3691739,"src":"gatewayweb_thumb.jpg","galleries_id":129557,"server_id":18,"link":"photo_3691739.html","width":130,"caption":"","height":95});
															thumbnails[3679280] = clik.newPhoto({"id":3679280,"src":"spirweb_thumb.jpg","galleries_id":129557,"server_id":18,"link":"photo_3679280.html","width":130,"caption":"","height":95});
															thumbnails[3679462] = clik.newPhoto({"id":3679462,"src":"showview.galway_1_thumb.jpg","galleries_id":224822,"server_id":18,"link":"photo_3679462.html","width":130,"caption":"","height":130});
															thumbnails[2758025] = clik.newPhoto({"id":2758025,"src":"mug.web_thumb.jpg","galleries_id":224822,"server_id":18,"link":"photo_2758025.html","width":130,"caption":"","height":130});
															thumbnails[3554783] = clik.newPhoto({"id":3554783,"src":"6grey_days1web_thumb.jpg","galleries_id":129557,"server_id":18,"link":"photo_3554783.html","width":130,"caption":"","height":129});
															thumbnails[3684303] = clik.newPhoto({"id":3684303,"src":"tipi.web_thumb.jpg","galleries_id":224822,"server_id":18,"link":"photo_3684303.html","width":130,"caption":"","height":130});
															thumbnails[3684310] = clik.newPhoto({"id":3684310,"src":"dragons.web_thumb.jpg","galleries_id":224822,"server_id":18,"link":"photo_3684310.html","width":130,"caption":"","height":130});
															thumbnails[1986359] = clik.newPhoto({"id":1986359,"src":"shed.web_thumb.jpg","galleries_id":224822,"server_id":18,"link":"photo_1986359.html","width":130,"caption":"","height":130});
															thumbnails[3554786] = clik.newPhoto({"id":3554786,"src":"7grey_days2web_thumb.jpg","galleries_id":129557,"server_id":18,"link":"photo_3554786.html","width":130,"caption":"","height":129});
															thumbnails[3689202] = clik.newPhoto({"id":3689202,"src":"dragons.shed.web_thumb.jpg","galleries_id":224822,"server_id":18,"link":"photo_3689202.html","width":130,"caption":"","height":130});
															thumbnails[3554793] = clik.newPhoto({"id":3554793,"src":"8grey_days3web_thumb.jpg","galleries_id":129557,"server_id":18,"link":"photo_3554793.html","width":130,"caption":"","height":130});
															thumbnails[3689208] = clik.newPhoto({"id":3689208,"src":"postcard_web_thumb.jpg","galleries_id":224822,"server_id":18,"link":"photo_3689208.html","width":130,"caption":"","height":130});
															thumbnails[8532968] = clik.newPhoto({"id":8532968,"src":"melbu40_thumb.jpg","galleries_id":449483,"server_id":18,"link":"photo_8532968.html","width":130,"caption":"","height":130});
															thumbnails[8532906] = clik.newPhoto({"id":8532906,"src":"melbu7_thumb.jpg","galleries_id":449483,"server_id":18,"link":"photo_8532906.html","width":130,"caption":"","height":130});
															thumbnails[8532867] = clik.newPhoto({"id":8532867,"src":"melbu1_thumb.jpg","galleries_id":449483,"server_id":18,"link":"photo_8532867.html","width":130,"caption":"","height":130});
															thumbnails[8532873] = clik.newPhoto({"id":8532873,"src":"melbu3_thumb.jpg","galleries_id":449483,"server_id":18,"link":"photo_8532873.html","width":130,"caption":"","height":130});
															thumbnails[8532869] = clik.newPhoto({"id":8532869,"src":"melbu2_thumb.jpg","galleries_id":449483,"server_id":18,"link":"photo_8532869.html","width":130,"caption":"","height":130});
															thumbnails[8532905] = clik.newPhoto({"id":8532905,"src":"melbu14_B1232DAB-1EC9-D45B-1CE155C4ACFB6171_thumb.jpg","galleries_id":449483,"server_id":18,"link":"photo_8532905.html","width":130,"caption":"","height":130});
															thumbnails[8532901] = clik.newPhoto({"id":8532901,"src":"melbu5_thumb.jpg","galleries_id":449483,"server_id":18,"link":"photo_8532901.html","width":130,"caption":"","height":127});
															thumbnails[8532910] = clik.newPhoto({"id":8532910,"src":"melbu9_thumb.jpg","galleries_id":449483,"server_id":18,"link":"photo_8532910.html","width":130,"caption":"","height":127});
															thumbnails[8532887] = clik.newPhoto({"id":8532887,"src":"melbu25.2_thumb.jpg","galleries_id":449483,"server_id":18,"link":"photo_8532887.html","width":130,"caption":"","height":130});
															thumbnails[8532908] = clik.newPhoto({"id":8532908,"src":"melbu8_thumb.jpg","galleries_id":449483,"server_id":18,"link":"photo_8532908.html","width":130,"caption":"","height":130});
															thumbnails[8532914] = clik.newPhoto({"id":8532914,"src":"melbu29_thumb.jpg","galleries_id":449483,"server_id":18,"link":"photo_8532914.html","width":130,"caption":"","height":130});
															thumbnails[8532911] = clik.newPhoto({"id":8532911,"src":"melbu10_thumb.jpg","galleries_id":449483,"server_id":18,"link":"photo_8532911.html","width":130,"caption":"","height":130});
															thumbnails[8532925] = clik.newPhoto({"id":8532925,"src":"melbu15_thumb.jpg","galleries_id":449483,"server_id":18,"link":"photo_8532925.html","width":130,"caption":"","height":127});
															thumbnails[8532923] = clik.newPhoto({"id":8532923,"src":"melbu14_thumb.jpg","galleries_id":449483,"server_id":18,"link":"photo_8532923.html","width":130,"caption":"","height":130});
															thumbnails[8532917] = clik.newPhoto({"id":8532917,"src":"melbu12_thumb.jpg","galleries_id":449483,"server_id":18,"link":"photo_8532917.html","width":130,"caption":"","height":130});
															thumbnails[8532920] = clik.newPhoto({"id":8532920,"src":"melbu13_thumb.jpg","galleries_id":449483,"server_id":18,"link":"photo_8532920.html","width":130,"caption":"","height":130});
															thumbnails[8532927] = clik.newPhoto({"id":8532927,"src":"melbu17_thumb.jpg","galleries_id":449483,"server_id":18,"link":"photo_8532927.html","width":130,"caption":"","height":130});
															thumbnails[8532955] = clik.newPhoto({"id":8532955,"src":"melbu20_thumb.jpg","galleries_id":449483,"server_id":18,"link":"photo_8532955.html","width":130,"caption":"","height":130});
															thumbnails[8532935] = clik.newPhoto({"id":8532935,"src":"melbu18_thumb.jpg","galleries_id":449483,"server_id":18,"link":"photo_8532935.html","width":130,"caption":"","height":130});
															thumbnails[8532960] = clik.newPhoto({"id":8532960,"src":"melbu37_thumb.jpg","galleries_id":449483,"server_id":18,"link":"photo_8532960.html","width":130,"caption":"","height":130});
															thumbnails[8534075] = clik.newPhoto({"id":8534075,"src":"melbu52_thumb.jpg","galleries_id":449483,"server_id":18,"link":"photo_8534075.html","width":130,"caption":"","height":130});
															thumbnails[8534076] = clik.newPhoto({"id":8534076,"src":"melbu54_thumb.jpg","galleries_id":449483,"server_id":18,"link":"photo_8534076.html","width":130,"caption":"","height":130});
															thumbnails[8534077] = clik.newPhoto({"id":8534077,"src":"melbu55_thumb.jpg","galleries_id":449483,"server_id":18,"link":"photo_8534077.html","width":128,"caption":"","height":130});
															thumbnails[8532966] = clik.newPhoto({"id":8532966,"src":"melbu39_thumb.jpg","galleries_id":449483,"server_id":18,"link":"photo_8532966.html","width":130,"caption":"","height":130});
															thumbnails[8534078] = clik.newPhoto({"id":8534078,"src":"melbu56_thumb.jpg","galleries_id":449483,"server_id":18,"link":"photo_8534078.html","width":130,"caption":"","height":130});
															thumbnails[5361050] = clik.newPhoto({"id":5361050,"src":"Osloshow_view3web_thumb.jpg","galleries_id":301808,"server_id":18,"link":"photo_5361050.html","width":130,"caption":"","height":130});
															thumbnails[5361058] = clik.newPhoto({"id":5361058,"src":"Osloshowdrawingweb_thumb.jpg","galleries_id":301808,"server_id":18,"link":"photo_5361058.html","width":130,"caption":"","height":130});
															thumbnails[5361073] = clik.newPhoto({"id":5361073,"src":"Osloshowgeldrawingweb_thumb.jpg","galleries_id":301808,"server_id":18,"link":"photo_5361073.html","width":129,"caption":"","height":130});
															thumbnails[5361026] = clik.newPhoto({"id":5361026,"src":"Osloshow_intosomethingrealweb_thumb.jpg","galleries_id":301808,"server_id":18,"link":"photo_5361026.html","width":130,"caption":"","height":130});
															thumbnails[5361042] = clik.newPhoto({"id":5361042,"src":"Osloshow_view2web_thumb.jpg","galleries_id":301808,"server_id":18,"link":"photo_5361042.html","width":130,"caption":"","height":130});
															thumbnails[5361037] = clik.newPhoto({"id":5361037,"src":"osloshow_view1web_thumb.jpg","galleries_id":301808,"server_id":18,"link":"photo_5361037.html","width":130,"caption":"","height":130});
															thumbnails[8540005] = clik.newPhoto({"id":8540005,"src":"melbu57_thumb.jpg","galleries_id":449483,"server_id":18,"link":"photo_8540005.html","width":130,"caption":"","height":130});
															thumbnails[5361025] = clik.newPhoto({"id":5361025,"src":"Osloshow_Columbus2web_thumb.jpg","galleries_id":301808,"server_id":18,"link":"photo_5361025.html","width":130,"caption":"","height":130});
															thumbnails[5361022] = clik.newPhoto({"id":5361022,"src":"Osloshow_closeupBOXweb_thumb.jpg","galleries_id":301808,"server_id":18,"link":"photo_5361022.html","width":130,"caption":"","height":130});
															thumbnails[5361028] = clik.newPhoto({"id":5361028,"src":"Osloshow_PeepShowweb_thumb.jpg","galleries_id":301808,"server_id":18,"link":"photo_5361028.html","width":130,"caption":"","height":130});
															thumbnails[5361080] = clik.newPhoto({"id":5361080,"src":"stillcoming-soonweb_thumb.jpg","galleries_id":301808,"server_id":18,"link":"photo_5361080.html","width":130,"caption":"","height":130});
															thumbnails[5361024] = clik.newPhoto({"id":5361024,"src":"Osloshow_Columbusweb_thumb.jpg","galleries_id":301808,"server_id":18,"link":"photo_5361024.html","width":130,"caption":"","height":130});
															thumbnails[5361030] = clik.newPhoto({"id":5361030,"src":"Osloshow_picsviewweb_thumb.jpg","galleries_id":301808,"server_id":18,"link":"photo_5361030.html","width":130,"caption":"","height":130});
															thumbnails[5361018] = clik.newPhoto({"id":5361018,"src":"DKT2lilleweb_thumb.jpg","galleries_id":301808,"server_id":18,"link":"photo_5361018.html","width":130,"caption":"","height":130});
															thumbnails[5361021] = clik.newPhoto({"id":5361021,"src":"DKT4lilleweb_thumb.jpg","galleries_id":301808,"server_id":18,"link":"photo_5361021.html","width":130,"caption":"","height":130});
															thumbnails[5361020] = clik.newPhoto({"id":5361020,"src":"DKT3lilleweb_thumb.jpg","galleries_id":301808,"server_id":18,"link":"photo_5361020.html","width":130,"caption":"","height":130});
															thumbnails[5360983] = clik.newPhoto({"id":5360983,"src":"DKT1lilleweb_thumb.jpg","galleries_id":301808,"server_id":18,"link":"photo_5360983.html","width":130,"caption":"","height":130});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[449483] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"P. R. 4. TECHNOLOGIE, JOIE DE VIVRE! B.B.B.","link":"gallery_449483.html","maxRecords":0.0,"photoIDs":[8532968.0,8532906.0,8532867.0,8532873.0,8532869.0,8532905.0,8532901.0,8532910.0,8532887.0,8532908.0,8532914.0,8532911.0,8532925.0,8532923.0,8532917.0,8532920.0,8532927.0,8532955.0,8532935.0,8532960.0,8534075.0,8534076.0,8534077.0,8532966.0,8534078.0,8540005.0],"skipIndex":0,"section_code":"gallery","featured_images":"8534075,8532873,8532869,8532867","id":449483,"singleSection":false});				  						galleries[385557] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Possible Realities 3 - DARK CASTLE","link":"gallery_385557.html","maxRecords":0.0,"photoIDs":[7129918.0,7130026.0,7130030.0,7129983.0,7130097.0,7130126.0,7130131.0,7130187.0,7130230.0,7130235.0,7130193.0,7130212.0,7129879.0,7130226.0,7130903.0,7130223.0],"skipIndex":0,"section_code":"gallery","featured_images":"7130187,7130097","id":385557,"singleSection":false});				  						galleries[301808] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Possible Realities","link":"gallery_301808.html","maxRecords":0.0,"photoIDs":[5361050.0,5361058.0,5361073.0,5361026.0,5361042.0,5361037.0,5361025.0,5361022.0,5361028.0,5361080.0,5361024.0,5361030.0,5361018.0,5361021.0,5361020.0,5360983.0],"skipIndex":0,"section_code":"gallery","featured_images":"5361073,5361026","id":301808,"singleSection":false});				  						galleries[129557] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Selected work","link":"gallery_129557.html","maxRecords":0.0,"photoIDs":[2757876.0,2757872.0,3554915.0,2757863.0,1986066.0,2336367.0,3691824.0,3679283.0,3679275.0,3679279.0,3691739.0,3679280.0,3554783.0,3554786.0,3554793.0],"skipIndex":0,"section_code":"gallery","featured_images":1986066.0,"id":129557,"singleSection":false});				  						galleries[224822] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"substitute","link":"gallery_224822.html","maxRecords":0.0,"photoIDs":[3684077.0,3679351.0,3679353.0,3679355.0,3679284.0,3679369.0,3679359.0,3684146.0,3679462.0,2758025.0,3684303.0,3684310.0,1986359.0,3689202.0,3689208.0],"skipIndex":0,"section_code":"gallery","featured_images":"3684303,3684077,3679359","id":224822,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[242413] = '1986355,2757876,3554915,7130131,2336367,3691824';
imageSets[245208] = '8532968,8532906,8532867,8532873,8532869,8532905,8532901,8532910,8532887,8532908,8532914,8532911,8532925,8532923,8532917,8532920,8532927,8532955,8532935,8532960,8534076,8534077,8534078,8532966,8540005';
imageSets[1] = '7130030,7129983,7130126,3554915,7130131,7129879,3679283,8532873,8534075,5361073,5361026,5361021,5360983';
imageSets[2] = '3684077,7130097,7130187,1986066,3679359,3684303,2762131,2762137,8532867,8532873,8532869,8534075,5361073,5361026';
imageSets[3] = '7129918,3684077,7130026,7130030,7129983,7130097,7130126,7130131,7130187,7130230,7130235,7130193,7130212,7129879,7130226,7130903,7130223,3691824,3679369,3684146';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/ditte_knus/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/ditte_knus/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/ditte_knus/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/ditte_knus/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/ditte_knus/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/ditte_knus/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/ditte_knus/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/ditte_knus/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/ditte_knus/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/ditte_knus/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/ditte_knus/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/ditte_knus/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/ditte_knus/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/ditte_knus/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/ditte_knus/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/ditte_knus/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/ditte_knus/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/ditte_knus/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/ditte_knus/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/ditte_knus/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/ditte_knus/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/ditte_knus/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/ditte_knus/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/ditte_knus/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/ditte_knus/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/ditte_knus/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/ditte_knus/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 = 'Ditte Knus Tønnesen';
			    }
        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;
	}
}

			

