window.thumbnails = new Object();
												thumbnails[1573609] = new thumbnail(1573609,'107575','','acHazel&AlanA204b_thumb.jpg',130, 88,1,'																			photo_1573609.html');
												thumbnails[1573686] = new thumbnail(1573686,'107587','','ABHazel&AlanA33_thumb.jpg',130, 194,1,'																			photo_1573686.html');
												thumbnails[1573950] = new thumbnail(1573950,'107589','','Anna&GrahamA0050_thumb.jpg',130, 87,1,'																			photo_1573950.html');
												thumbnails[1574010] = new thumbnail(1574010,'107591','','aHazel&AlanB21_thumb.jpg',130, 87,1,'																			photo_1574010.html');
												thumbnails[1573621] = new thumbnail(1573621,'107575','','aEmma&James0607A121_thumb.jpg',130, 197,1,'																			photo_1573621.html');
												thumbnails[1573687] = new thumbnail(1573687,'107587','','ACDimageB30(2)_thumb.jpg',130, 174,1,'																			photo_1573687.html');
												thumbnails[1573952] = new thumbnail(1573952,'107589','','Blissxa_thumb.jpg',130, 92,1,'																			photo_1573952.html');
												thumbnails[1574011] = new thumbnail(1574011,'107591','','Anna&GrahamA0094_thumb.jpg',130, 87,1,'																			photo_1574011.html');
												thumbnails[1573689] = new thumbnail(1573689,'107587','','Amy&Simon1204A17_thumb.jpg',130, 159,1,'																			photo_1573689.html');
												thumbnails[1573964] = new thumbnail(1573964,'107589','','Blissxb_thumb.jpg',130, 204,1,'																			photo_1573964.html');
												thumbnails[1573973] = new thumbnail(1573973,'107575','','Linzee&Tobie0905A14_thumb.jpg',130, 130,1,'																			photo_1573973.html');
												thumbnails[1574013] = new thumbnail(1574013,'107591','','Batty3_thumb.jpg',130, 98,1,'																			photo_1574013.html');
												thumbnails[1574346] = new thumbnail(1574346,'107575','','RoswaldAE3_thumb.jpg',130, 97,1,'																			photo_1574346.html');
												thumbnails[1573622] = new thumbnail(1573622,'107575','','Claire&AlexB101_thumb.jpg',130, 174,1,'																			photo_1573622.html');
												thumbnails[1573690] = new thumbnail(1573690,'107587','','Amy&Simonb-w17(2)_thumb.jpg',130, 93,1,'																			photo_1573690.html');
												thumbnails[1573965] = new thumbnail(1573965,'107589','','buchanan4_thumb.jpg',130, 130,1,'																			photo_1573965.html');
												thumbnails[1574014] = new thumbnail(1574014,'107591','','Becky&ChrisL3_thumb.jpg',130, 99,1,'																			photo_1574014.html');
												thumbnails[1573624] = new thumbnail(1573624,'107575','','H&PA1411_thumb.jpg',130, 87,1,'																			photo_1573624.html');
												thumbnails[1573692] = new thumbnail(1573692,'107587','','Claire&AlexA145_thumb.jpg',130, 173,1,'																			photo_1573692.html');
												thumbnails[1573966] = new thumbnail(1573966,'107589','','H&PA144_thumb.jpg',130, 87,1,'																			photo_1573966.html');
												thumbnails[1577628] = new thumbnail(1577628,'107591','','Beth&DavidL43(a)_thumb.jpg',130, 97,1,'																			photo_1577628.html');
												thumbnails[1573627] = new thumbnail(1573627,'107575','','haClaire&AlexA1591_thumb.jpg',130, 98,1,'																			photo_1573627.html');
												thumbnails[1573693] = new thumbnail(1573693,'107587','','Claire&AlexC14_thumb.jpg',130, 173,1,'																			photo_1573693.html');
												thumbnails[1573968] = new thumbnail(1573968,'107589','','Jenny&Tudor0605AA1_thumb.jpg',130, 110,1,'																			photo_1573968.html');
												thumbnails[1577631] = new thumbnail(1577631,'107591','','Blissxx_thumb.jpg',130, 93,1,'																			photo_1577631.html');
												thumbnails[1573628] = new thumbnail(1573628,'107575','','Hazel&AlanA1031_thumb.jpg',130, 87,1,'																			photo_1573628.html');
												thumbnails[1573694] = new thumbnail(1573694,'107587','','H&PA59a_thumb.jpg',130, 87,1,'																			photo_1573694.html');
												thumbnails[1573970] = new thumbnail(1573970,'107589','','Jo&ScottA107_thumb.jpg',130, 87,1,'																			photo_1573970.html');
												thumbnails[1577777] = new thumbnail(1577777,'107591','','CalvertC28a1_thumb.jpg',130, 79,1,'																			photo_1577777.html');
												thumbnails[1573645] = new thumbnail(1573645,'107575','','lACDimageA15(2)1_thumb.jpg',130, 174,1,'																			photo_1573645.html');
												thumbnails[1573696] = new thumbnail(1573696,'107587','','Hannah&Paul0707A166_thumb.jpg',130, 133,1,'																			photo_1573696.html');
												thumbnails[1573971] = new thumbnail(1573971,'107589','','K&PC6_thumb.jpg',130, 187,1,'																			photo_1573971.html');
												thumbnails[1577635] = new thumbnail(1577635,'107591','','H&PA102_thumb.jpg',130, 87,1,'																			photo_1577635.html');
												thumbnails[1573646] = new thumbnail(1573646,'107575','','Liz&MilesA561_thumb.jpg',130, 98,1,'																			photo_1573646.html');
												thumbnails[1573699] = new thumbnail(1573699,'107587','','Hazel&AlanA71_thumb.jpg',130, 87,1,'																			photo_1573699.html');
												thumbnails[1577638] = new thumbnail(1577638,'107591','','Hazel&AlanA147_thumb.jpg',130, 194,1,'																			photo_1577638.html');
												thumbnails[1573647] = new thumbnail(1573647,'107575','','Lucy&Charles0705AA81_thumb.jpg',130, 105,1,'																			photo_1573647.html');
												thumbnails[1573700] = new thumbnail(1573700,'107587','','Karen&RichardA124_thumb.jpg',130, 106,1,'																			photo_1573700.html');
												thumbnails[1573974] = new thumbnail(1573974,'107589','','NickHalton&Gillbw2608-04_thumb.jpg',130, 196,1,'																			photo_1573974.html');
												thumbnails[1577642] = new thumbnail(1577642,'107591','','Jayne&Peter0605A17_thumb.jpg',130, 130,1,'																			photo_1577642.html');
												thumbnails[1573648] = new thumbnail(1573648,'107575','','Lucy&Charlesxx1_thumb.jpg',130, 192,1,'																			photo_1573648.html');
												thumbnails[1573702] = new thumbnail(1573702,'107587','','lACDimageA79(2)_thumb.jpg',130, 97,1,'																			photo_1573702.html');
												thumbnails[1573982] = new thumbnail(1573982,'107589','','NickRos_thumb.jpg',130, 84,1,'																			photo_1573982.html');
												thumbnails[1577643] = new thumbnail(1577643,'107591','','Joanne&Paul1405AA10_thumb.jpg',130, 132,1,'																			photo_1577643.html');
												thumbnails[1573649] = new thumbnail(1573649,'107575','','NinaandSammyLS201_thumb.jpg',130, 96,1,'																			photo_1573649.html');
												thumbnails[1573987] = new thumbnail(1573987,'107589','','Nikki&John0705A3_thumb.jpg',130, 130,1,'																			photo_1573987.html');
												thumbnails[1574347] = new thumbnail(1574347,'107587','','LaurajezC321_thumb.jpg',130, 196,1,'																			photo_1574347.html');
												thumbnails[1577646] = new thumbnail(1577646,'107591','','Joanne&Paul1405D14_thumb.jpg',130, 153,1,'																			photo_1577646.html');
												thumbnails[1573650] = new thumbnail(1573650,'107575','','pACDimageA129(2)1_thumb.jpg',130, 97,1,'																			photo_1573650.html');
												thumbnails[1573704] = new thumbnail(1573704,'107587','','Lisa&Paul0905A9_thumb.jpg',130, 130,1,'																			photo_1573704.html');
												thumbnails[1573989] = new thumbnail(1573989,'107589','','NinaandSammyLF82_thumb.jpg',130, 130,1,'																			photo_1573989.html');
												thumbnails[1577647] = new thumbnail(1577647,'107591','','Kerry&Aaron09-04B11_thumb.jpg',130, 86,1,'																			photo_1577647.html');
												thumbnails[1573610] = new thumbnail(1573610,'107575','','qLiz&MilesA99_thumb.jpg',130, 98,1,'																			photo_1573610.html');
												thumbnails[1573705] = new thumbnail(1573705,'107587','','Liz&MilesA91_thumb.jpg',130, 174,1,'																			photo_1573705.html');
												thumbnails[1573991] = new thumbnail(1573991,'107589','','Sally&GrahamB14_thumb.jpg',130, 174,1,'																			photo_1573991.html');
												thumbnails[1577648] = new thumbnail(1577648,'107591','','Lucy&Charles0705A1_thumb.jpg',130, 132,1,'																			photo_1577648.html');
												thumbnails[1573652] = new thumbnail(1573652,'107575','','Ros&Nick0700_thumb.jpg',130, 136,1,'																			photo_1573652.html');
												thumbnails[1573706] = new thumbnail(1573706,'107587','','Liz&MilesB132a_thumb.jpg',130, 98,1,'																			photo_1573706.html');
												thumbnails[1573993] = new thumbnail(1573993,'107589','','Stacey&Simon0804B10a_thumb.jpg',130, 93,1,'																			photo_1573993.html');
												thumbnails[1577649] = new thumbnail(1577649,'107591','','Sam&BenA40_thumb.jpg',130, 170,1,'																			photo_1577649.html');
												thumbnails[1573620] = new thumbnail(1573620,'107575','','aeLucy&Charles0705C7a1_thumb.jpg',130, 85,1,'																			photo_1573620.html');
												thumbnails[1573708] = new thumbnail(1573708,'107587','','Sally&Peter040613aaa_thumb.jpg',130, 100,1,'																			photo_1573708.html');
												thumbnails[1573994] = new thumbnail(1573994,'107589','','T&FA60_thumb.jpg',130, 98,1,'																			photo_1573994.html');
												thumbnails[1577651] = new thumbnail(1577651,'107591','','Sam&BenA111_thumb.jpg',130, 98,1,'																			photo_1577651.html');
												thumbnails[1573654] = new thumbnail(1573654,'107575','','Sam&Anthony0805D11_thumb.jpg',130, 95,1,'																			photo_1573654.html');
												thumbnails[1573707] = new thumbnail(1573707,'107587','','Miriam&Spencer1004A15_thumb.jpg',130, 130,1,'																			photo_1573707.html');
												thumbnails[1573995] = new thumbnail(1573995,'107589','','T&FA131_thumb.jpg',130, 140,1,'																			photo_1573995.html');
												thumbnails[1577653] = new thumbnail(1577653,'107591','','WEDDBE_thumb.jpg',130, 197,1,'																			photo_1577653.html');
												thumbnails[1573655] = new thumbnail(1573655,'107575','','Sam&BenA109_thumb.jpg',130, 98,1,'																			photo_1573655.html');
												thumbnails[1573709] = new thumbnail(1573709,'107587','','Smales-Bishop2_thumb.jpg',130, 131,1,'																			photo_1573709.html');
												thumbnails[1573996] = new thumbnail(1573996,'107589','','Zoe&Ben0706C5_thumb.jpg',130, 133,1,'																			photo_1573996.html');
												thumbnails[1577654] = new thumbnail(1577654,'107591','','Zoe&Ben0706A17_thumb.jpg',130, 105,1,'																			photo_1577654.html');
												thumbnails[1573619] = new thumbnail(1573619,'107575','','wRosnick_thumb.jpg',130, 192,1,'																			photo_1573619.html');
												thumbnails[1573711] = new thumbnail(1573711,'107587','','WEDDH_thumb.jpg',130, 59,1,'																			photo_1573711.html');
												thumbnails[1577723] = new thumbnail(1577723,'107838','','ChrisJagger1_thumb.jpg',130, 132,1,'																			photo_1577723.html');
												thumbnails[1577742] = new thumbnail(1577742,'107839','','AKenGarland_thumb.jpg',130, 131,1,'																			photo_1577742.html');
												thumbnails[1577706] = new thumbnail(1577706,'107837','','AlainResnais&SabineAzema_thumb.jpg',130, 135,1,'																			photo_1577706.html');
												thumbnails[1577724] = new thumbnail(1577724,'107838','','DH6_thumb.jpg',130, 131,1,'																			photo_1577724.html');
												thumbnails[1577743] = new thumbnail(1577743,'107839','','JaneAsher_thumb.jpg',130, 198,1,'																			photo_1577743.html');
												thumbnails[1577707] = new thumbnail(1577707,'107837','','AlanBennett_thumb.jpg',130, 158,1,'																			photo_1577707.html');
												thumbnails[1577725] = new thumbnail(1577725,'107838','','EmmaLloyd(2a)_thumb.jpg',130, 134,1,'																			photo_1577725.html');
												thumbnails[1577744] = new thumbnail(1577744,'107839','','JaoLucyN3_thumb.jpg',130, 147,1,'																			photo_1577744.html');
												thumbnails[1577708] = new thumbnail(1577708,'107837','','Anne2_thumb.jpg',130, 131,1,'																			photo_1577708.html');
												thumbnails[1577726] = new thumbnail(1577726,'107838','','GarethHale&TimVincent_thumb.jpg',130, 128,1,'																			photo_1577726.html');
												thumbnails[1577746] = new thumbnail(1577746,'107839','','JHA50bw_thumb.jpg',130, 162,1,'																			photo_1577746.html');
												thumbnails[1577709] = new thumbnail(1577709,'107837','','JeffBanks_thumb.jpg',130, 131,1,'																			photo_1577709.html');
												thumbnails[1577727] = new thumbnail(1577727,'107838','','GarethTudorPrice2_thumb.jpg',130, 133,1,'																			photo_1577727.html');
												thumbnails[1577747] = new thumbnail(1577747,'107839','','Joanna_thumb.jpg',130, 93,1,'																			photo_1577747.html');
												thumbnails[1577711] = new thumbnail(1577711,'107837','','JohnGodber(3a)_thumb.jpg',130, 132,1,'																			photo_1577711.html');
												thumbnails[1577729] = new thumbnail(1577729,'107838','','GlennTilbrook2_thumb.jpg',130, 131,1,'																			photo_1577729.html');
												thumbnails[1577748] = new thumbnail(1577748,'107839','','Julia2_thumb.jpg',130, 149,1,'																			photo_1577748.html');
												thumbnails[1577712] = new thumbnail(1577712,'107837','','KateAdie_thumb.jpg',130, 136,1,'																			photo_1577712.html');
												thumbnails[1577730] = new thumbnail(1577730,'107838','','JohnSunderland(2)_thumb.jpg',130, 130,1,'																			photo_1577730.html');
												thumbnails[1577749] = new thumbnail(1577749,'107839','','KaneCunningham_thumb.jpg',130, 132,1,'																			photo_1577749.html');
												thumbnails[1577713] = new thumbnail(1577713,'107837','','MichaelJohnsonMJ2_thumb.jpg',130, 89,1,'																			photo_1577713.html');
												thumbnails[1577750] = new thumbnail(1577750,'107839','','MarkKatz_thumb.jpg',130, 131,1,'																			photo_1577750.html');
												thumbnails[1586105] = new thumbnail(1586105,'107838','','JuddHirsch2_thumb.jpg',130, 130,1,'																			photo_1586105.html');
												thumbnails[1577714] = new thumbnail(1577714,'107837','','PatSchleger2_thumb.jpg',130, 128,1,'																			photo_1577714.html');
												thumbnails[1577733] = new thumbnail(1577733,'107838','','kAlexBliss_thumb.jpg',130, 198,1,'																			photo_1577733.html');
												thumbnails[1577751] = new thumbnail(1577751,'107839','','Mo_thumb.jpg',130, 109,1,'																			photo_1577751.html');
												thumbnails[1577715] = new thumbnail(1577715,'107837','','Peter Blake1409-2_thumb.jpg',130, 132,1,'																			photo_1577715.html');
												thumbnails[1577734] = new thumbnail(1577734,'107838','','sA&MG_thumb.jpg',130, 130,1,'																			photo_1577734.html');
												thumbnails[1577752] = new thumbnail(1577752,'107839','','RichardFowler3_thumb.jpg',130, 130,1,'																			photo_1577752.html');
												thumbnails[1577717] = new thumbnail(1577717,'107837','','Rebecca_thumb.jpg',130, 132,1,'																			photo_1577717.html');
												thumbnails[1577753] = new thumbnail(1577753,'107839','','Rita&Tony2_thumb.jpg',130, 113,1,'																			photo_1577753.html');
												thumbnails[1586163] = new thumbnail(1586163,'107838','','sAlanAyckbourn(2)1_thumb.jpg',130, 192,1,'																			photo_1586163.html');
												thumbnails[1577718] = new thumbnail(1577718,'107837','','Rhona&JohnMcMeekin_thumb.jpg',130, 87,1,'																			photo_1577718.html');
												thumbnails[1577738] = new thumbnail(1577738,'107838','','WB89_thumb.jpg',130, 132,1,'																			photo_1577738.html');
												thumbnails[1577774] = new thumbnail(1577774,'107839','','SirChristopherFrayling91_thumb.jpg',130, 154,1,'																			photo_1577774.html');
												thumbnails[1577720] = new thumbnail(1577720,'107837','','RoyBarraclough_thumb.jpg',130, 130,1,'																			photo_1577720.html');
												thumbnails[1577740] = new thumbnail(1577740,'107838','','WB94_thumb.jpg',130, 139,1,'																			photo_1577740.html');
												thumbnails[1577755] = new thumbnail(1577755,'107839','','WB14_thumb.jpg',130, 129,1,'																			photo_1577755.html');
												thumbnails[1577721] = new thumbnail(1577721,'107837','','StephenHitchins_thumb.jpg',130, 133,1,'																			photo_1577721.html');
												thumbnails[1577741] = new thumbnail(1577741,'107838','','WrecklessEricxcol_thumb.jpg',130, 128,1,'																			photo_1577741.html');
												thumbnails[1577756] = new thumbnail(1577756,'107839','','WB101_thumb.jpg',130, 129,1,'																			photo_1577756.html');
												thumbnails[1577722] = new thumbnail(1577722,'107837','','StevePhillips_thumb.jpg',130, 131,1,'																			photo_1577722.html');
												thumbnails[1577757] = new thumbnail(1577757,'107839','','XJanBeeBrownathome_thumb.jpg',130, 134,1,'																			photo_1577757.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[107575] = new gallery(107575,'1573610','gallery 1','gallery',[1573609,1573621,1573973,1574346,1573622,1573624,1573627,1573628,1573645,1573646,1573647,1573648,1573649,1573650,1573610,1573652,1573620,1573654,1573655,1573619],0, 0, '', '																																																																																																							gallery_107575.html',0,0);
				  					galleries[107837] = new gallery(107837,'1577722,1577721,1577720,1577718,1577717,1577715,1577714,1577713,1577712,1577711','potraits 1','section142463',[1577706,1577707,1577708,1577709,1577711,1577712,1577713,1577714,1577715,1577717,1577718,1577720,1577721,1577722],0, 0, '', '																																																																																																							section142463_107837.html',0,0);
				  					galleries[107587] = new gallery(107587,'1574347,1573711,1573709,1573708,1573707,1573706,1573705,1573704,1573702,1573700','gallery 2','gallery',[1573686,1573687,1573689,1573690,1573692,1573693,1573694,1573696,1573699,1573700,1573702,1574347,1573704,1573705,1573706,1573708,1573707,1573709,1573711],0, 0, '', '																																																																																																							gallery_107587.html',0,0);
				  					galleries[107838] = new gallery(107838,'1586163,1586105,1577741,1577740,1577738,1577734,1577733,1577730,1577729,1577727','portraits 2','section142463',[1577723,1577724,1577725,1577726,1577727,1577729,1577730,1586105,1577733,1577734,1586163,1577738,1577740,1577741],0, 0, '', '																																																																																																							section142463_107838.html',0,0);
				  					galleries[107589] = new gallery(107589,'1573996,1573995,1573994,1573993,1573991,1573989,1573987,1573982,1573974,1573971','gallery 3','gallery',[1573950,1573952,1573964,1573965,1573966,1573968,1573970,1573971,1573974,1573982,1573987,1573989,1573991,1573993,1573994,1573995,1573996],0, 0, '', '																																																																																																							gallery_107589.html',0,0);
				  					galleries[107839] = new gallery(107839,'1577774,1577757,1577756,1577755,1577753,1577752,1577751,1577750,1577749,1577748','portraits 3','section142463',[1577742,1577743,1577744,1577746,1577747,1577748,1577749,1577750,1577751,1577752,1577753,1577774,1577755,1577756,1577757],0, 0, '', '																																																																																																							section142463_107839.html',0,0);
				  					galleries[107591] = new gallery(107591,'1577777,1577654,1577653,1577651,1577649,1577648,1577647,1577646,1577643,1577642','gallery 4','gallery',[1574010,1574011,1574013,1574014,1577628,1577631,1577777,1577635,1577638,1577642,1577643,1577646,1577647,1577648,1577649,1577651,1577653,1577654],0, 0, '', '																																																																																																							gallery_107591.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '1586105,1577749,1577742,1577726,1577720,1577715,1577713,1577712,1577708,1574347,1574346,1574014,1573702,1573652,1573648,1573646,1573628,1573627,1573620,1573609';
imageSets[2] = '1573610';
imageSets[3] = '1586163,1586105,1577777,1577774,1577757,1577756,1577755,1577753,1577752,1577751,1577750,1577749,1577748,1577747,1577746,1577744,1577743,1577742,1577741,1577740,1577738,1577734,1577733,1577730,1577729,1577727,1577726,1577725,1577724,1577723,1577722,1577721,1577720,1577718,1577717,1577715,1577714,1577713,1577712,1577711,1577709,1577708,1577707,1577706,1577654,1577653,1577651,1577649,1577648,1577647';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/adriangatie/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/adriangatie/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/adriangatie/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/adriangatie/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/adriangatie/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/adriangatie/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/adriangatie/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/adriangatie/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/adriangatie/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/adriangatie/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/adriangatie/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/adriangatie/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/adriangatie/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/adriangatie/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/adriangatie/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/adriangatie/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/adriangatie/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/adriangatie/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/adriangatie/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/adriangatie/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/adriangatie/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/adriangatie/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 && backgrounds[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:'',
                    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 (!basic) {
    if (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
    }
				
    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.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'AGP Wedding & Portrait Photography: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
	    var options = {};	    	      	      resizePhotoInfo(options);
        if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(backgrounds);
  	    } else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(photos);
  	    }
	    });
    }
        if (!op.speed) {      clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));    }        
    return html;			}
	else {
				
		window.location = 'photo_' + nextPhoto.id + '.html';
	}
		
}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array){
  if (typeof(array) !== 'object') {
    array = photos;
  }
	if($('#paymentConfirm').length > 0){
		$('#paymentConfirm').hide();
		$('#paymentAddButton')
		.unbind()
		.click(function(){
						form = document.getElementById('paymentForm');
			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').text('Item added to cart').show();}
				else{
					$('#paymentConfirm').text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm').text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}
/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp = temp +  '<p id="imageDescription">' + this.description + '</p>';
	}
		if (this.photo_ref != '') {
		temp = temp + '<p class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</p>';
	}
		if (this.takendate != '') {
				
		temp = temp + '<p class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</p>';
	}
	
	if (this.location != '') {
				
		temp = temp + '<p class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</p>';
	}
	
	if (this.photographer != '') {
				
		temp = temp + '<p class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</p>';
	}
					
				if (temp != '') {
		temp = temp + '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp = temp + '<p>Order this print:</p>';
				temp = temp + '<p class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> 							' + (this.item_price).toFixed(2) + '</p>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
	else if (this.payment_groups_id !== '') {
		temp = temp + '<p>Buy this print online:</p>';
				temp = temp + '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
											temp = temp + '<select class="paymentlink" name="payment_options_id" onchange="updateItemValues(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
				
		temp = temp + getPaymentOptions(this.payment_groups_id);
		temp = temp + '</select>';
		temp = temp + '</form>';
				var item_option  = paymentGroups[this.payment_groups_id].options[0];
		if(paymentOptions[item_option]){
			var item_name  = paymentOptions[item_option].payment_option;
			var amount =  paymentOptions[item_option].price;
		}
			}
	else {
				
	}
	if (this.item_price !== '' || this.payment_groups_id !== '') {
			temp = 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({            href: thumbnails[imageID].fnGalleryLink(gallery_id),            title: galleries[gallery_id].title          });
        }
							}
										}
}

/***************************************************************************
* 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 + ' | ';
				}
				temp = temp + '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
			}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

