window.thumbnails = new Object();
												thumbnails[2207423] = new thumbnail(2207423,'145812','','3_6962_1_thumb.JPG',120, 80,18,'																			photo_2207423.html');
												thumbnails[2207427] = new thumbnail(2207427,'145812','','3_6963_1_thumb.JPG',120, 80,18,'																			photo_2207427.html');
												thumbnails[2207428] = new thumbnail(2207428,'145812','','3_6967_1_thumb.JPG',120, 80,18,'																			photo_2207428.html');
												thumbnails[2207430] = new thumbnail(2207430,'145812','','3_6973_1_thumb.JPG',120, 80,18,'																			photo_2207430.html');
												thumbnails[2207447] = new thumbnail(2207447,'145812','','3_7044_1_thumb.JPG',120, 80,18,'																			photo_2207447.html');
												thumbnails[2207484] = new thumbnail(2207484,'145812','','3_7052_1_thumb.JPG',120, 80,18,'																			photo_2207484.html');
												thumbnails[2207486] = new thumbnail(2207486,'145812','','3_7060_1_thumb.JPG',120, 80,18,'																			photo_2207486.html');
												thumbnails[2207488] = new thumbnail(2207488,'145812','','3_7107_1_thumb.JPG',120, 80,18,'																			photo_2207488.html');
												thumbnails[2207490] = new thumbnail(2207490,'145812','','3_7200_1_thumb.JPG',120, 80,18,'																			photo_2207490.html');
												thumbnails[2207493] = new thumbnail(2207493,'145812','','3_7205_1_thumb.JPG',120, 80,18,'																			photo_2207493.html');
												thumbnails[2207494] = new thumbnail(2207494,'145812','','3_7265_1_thumb.JPG',120, 80,18,'																			photo_2207494.html');
												thumbnails[2207496] = new thumbnail(2207496,'145812','','3_7287_1_thumb.JPG',120, 80,18,'																			photo_2207496.html');
												thumbnails[2207498] = new thumbnail(2207498,'145812','','3_7293_11_thumb.JPG',120, 80,18,'																			photo_2207498.html');
												thumbnails[2207499] = new thumbnail(2207499,'145812','','3_7600_1_thumb.JPG',120, 80,18,'																			photo_2207499.html');
												thumbnails[2207500] = new thumbnail(2207500,'145812','','3_7604_1_thumb.JPG',120, 80,18,'																			photo_2207500.html');
												thumbnails[2207501] = new thumbnail(2207501,'145812','','3_7612_1_thumb.JPG',120, 80,18,'																			photo_2207501.html');
												thumbnails[2207503] = new thumbnail(2207503,'145812','','3_7620_1_thumb.JPG',120, 80,18,'																			photo_2207503.html');
												thumbnails[2207505] = new thumbnail(2207505,'145812','','3_7635_1_thumb.JPG',120, 80,18,'																			photo_2207505.html');
												thumbnails[2207511] = new thumbnail(2207511,'145812','','3_7654_1_thumb.JPG',120, 80,18,'																			photo_2207511.html');
												thumbnails[2207512] = new thumbnail(2207512,'145812','','3_7659_1_thumb.JPG',120, 80,18,'																			photo_2207512.html');
												thumbnails[2207514] = new thumbnail(2207514,'145812','','3_7751_1_thumb.JPG',120, 80,18,'																			photo_2207514.html');
												thumbnails[2207516] = new thumbnail(2207516,'145812','','3_7786_1_thumb.JPG',120, 80,18,'																			photo_2207516.html');
												thumbnails[2207517] = new thumbnail(2207517,'145812','','3_7848_1_thumb.JPG',120, 80,18,'																			photo_2207517.html');
												thumbnails[2207520] = new thumbnail(2207520,'145812','','3_7975_1_thumb.JPG',120, 80,18,'																			photo_2207520.html');
												thumbnails[2207524] = new thumbnail(2207524,'145812','','3_7986_1_thumb.JPG',120, 80,18,'																			photo_2207524.html');
												thumbnails[2207525] = new thumbnail(2207525,'145812','','3_8016_1_thumb.JPG',120, 80,18,'																			photo_2207525.html');
												thumbnails[2844559] = new thumbnail(2844559,'177154','','4_7430_1_thumb.JPG',120, 80,18,'																			photo_2844559.html');
												thumbnails[2844565] = new thumbnail(2844565,'177154','','4_7629_1_thumb.JPG',120, 80,18,'																			photo_2844565.html');
												thumbnails[2844566] = new thumbnail(2844566,'177154','','4_7654_1_thumb.JPG',120, 80,18,'																			photo_2844566.html');
												thumbnails[2844573] = new thumbnail(2844573,'177154','','4_7676_1_thumb.JPG',120, 80,18,'																			photo_2844573.html');
												thumbnails[2844579] = new thumbnail(2844579,'177154','','4_7698_1_thumb.JPG',120, 80,18,'																			photo_2844579.html');
												thumbnails[2844582] = new thumbnail(2844582,'177154','','4_7782_1_thumb.JPG',120, 80,18,'																			photo_2844582.html');
												thumbnails[2844583] = new thumbnail(2844583,'177154','','4_7791_1_thumb.JPG',120, 80,18,'																			photo_2844583.html');
												thumbnails[2844589] = new thumbnail(2844589,'177154','','4_7823_1_thumb.JPG',120, 80,18,'																			photo_2844589.html');
												thumbnails[2844591] = new thumbnail(2844591,'177154','','4_7948_1_thumb.JPG',120, 80,18,'																			photo_2844591.html');
												thumbnails[2844615] = new thumbnail(2844615,'177154','','4_8186_1_thumb.JPG',120, 80,18,'																			photo_2844615.html');
												thumbnails[2844621] = new thumbnail(2844621,'177154','','4_8190_1_thumb.JPG',120, 80,18,'																			photo_2844621.html');
												thumbnails[2844622] = new thumbnail(2844622,'177154','','4_8197_1_thumb.JPG',120, 80,18,'																			photo_2844622.html');
												thumbnails[2844627] = new thumbnail(2844627,'177154','','4_8372_1_thumb.JPG',120, 80,18,'																			photo_2844627.html');
												thumbnails[2844630] = new thumbnail(2844630,'177154','','4_8378_1_thumb.JPG',120, 80,18,'																			photo_2844630.html');
												thumbnails[4764478] = new thumbnail(4764478,'272895','','6_2301_1_thumb.JPG',53, 80,18,'																			photo_4764478.html');
												thumbnails[4764479] = new thumbnail(4764479,'272895','','6_2312_1_thumb.JPG',53, 80,18,'																			photo_4764479.html');
												thumbnails[4764480] = new thumbnail(4764480,'272895','','6_2315_1_thumb.JPG',53, 80,18,'																			photo_4764480.html');
												thumbnails[4764481] = new thumbnail(4764481,'272895','','6_2715_1_thumb.JPG',120, 80,18,'																			photo_4764481.html');
												thumbnails[4764482] = new thumbnail(4764482,'272895','','6_2737_1_thumb.JPG',120, 80,18,'																			photo_4764482.html');
												thumbnails[4764483] = new thumbnail(4764483,'272895','','6_2741_1_thumb.JPG',120, 80,18,'																			photo_4764483.html');
												thumbnails[4764507] = new thumbnail(4764507,'272895','','6_2785_1_thumb.JPG',53, 80,18,'																			photo_4764507.html');
												thumbnails[4764539] = new thumbnail(4764539,'272895','','6_2879_1_thumb.JPG',120, 80,18,'																			photo_4764539.html');
												thumbnails[4764540] = new thumbnail(4764540,'272895','','6_2888_1_thumb.JPG',120, 80,18,'																			photo_4764540.html');
												thumbnails[4764541] = new thumbnail(4764541,'272895','','6_2971_1_thumb.JPG',120, 80,18,'																			photo_4764541.html');
												thumbnails[4764542] = new thumbnail(4764542,'272895','','6_2988_1_thumb.JPG',120, 80,18,'																			photo_4764542.html');
												thumbnails[4764544] = new thumbnail(4764544,'272895','','6_3042_1_thumb.JPG',120, 80,18,'																			photo_4764544.html');
												thumbnails[4764546] = new thumbnail(4764546,'272895','','6_3048_1_thumb.JPG',120, 80,18,'																			photo_4764546.html');
												thumbnails[4764549] = new thumbnail(4764549,'272895','','6_3143_1_thumb.JPG',120, 80,18,'																			photo_4764549.html');
												thumbnails[4764552] = new thumbnail(4764552,'272895','','6_3147_1_thumb.JPG',120, 80,18,'																			photo_4764552.html');
												thumbnails[7416095] = new thumbnail(7416095,'401845','Tandem Exit','8_0477_11_thumb.JPG',120, 80,18,'																			photo_7416095.html');
												thumbnails[7416083] = new thumbnail(7416083,'401845','Static Line Student','3_2723_21_thumb.JPG',120, 80,18,'																			photo_7416083.html');
												thumbnails[7416098] = new thumbnail(7416098,'401845','AFF Exit','7_96511_thumb.JPG',120, 80,18,'																			photo_7416098.html');
												thumbnails[5500210] = new thumbnail(5500210,'311398','','5D_01375_R_thumb.JPG',120, 80,18,'																			photo_5500210.html');
												thumbnails[5500300] = new thumbnail(5500300,'311407','','3_1861_1_12_thumb.JPG',53, 80,18,'																			photo_5500300.html');
												thumbnails[7416077] = new thumbnail(7416077,'401845','Tandem Freefall','8_7607_1_thumb.JPG',120, 80,18,'																			photo_7416077.html');
												thumbnails[7416099] = new thumbnail(7416099,'401845','Level 1 Skydive','8_6032_11_thumb.JPG',120, 80,18,'																			photo_7416099.html');
												thumbnails[545258] = new thumbnail(545258,'42205','','IMG_8783_thumb.JPG',130, 87,18,'																			photo_545258.html');
												thumbnails[5500212] = new thumbnail(5500212,'311398','','5D_01415_R_thumb.JPG',120, 80,18,'																			photo_5500212.html');
												thumbnails[5500296] = new thumbnail(5500296,'311407','','3_1532_12_thumb.JPG',53, 80,18,'																			photo_5500296.html');
												thumbnails[556480] = new thumbnail(556480,'42205','','IMG_8876_thumb.JPG',130, 87,18,'																			photo_556480.html');
												thumbnails[1451420] = new thumbnail(1451420,'99765','','ASChall07_0010_thumb.JPG',120, 80,18,'																			photo_1451420.html');
												thumbnails[5500213] = new thumbnail(5500213,'311398','','5D_00689_1_thumb.JPG',120, 80,18,'																			photo_5500213.html');
												thumbnails[5500303] = new thumbnail(5500303,'311407','','3_1924_12_thumb.JPG',53, 80,18,'																			photo_5500303.html');
												thumbnails[7416088] = new thumbnail(7416088,'401845','Soft Tandem Landing','7_60291_thumb.JPG',53, 80,18,'																			photo_7416088.html');
												thumbnails[545307] = new thumbnail(545307,'42205','','IMG_8928_thumb.JPG',130, 87,18,'																			photo_545307.html');
												thumbnails[5500214] = new thumbnail(5500214,'311398','','5D_01347_R_thumb.JPG',53, 80,18,'																			photo_5500214.html');
												thumbnails[5500263] = new thumbnail(5500263,'311407','','5D_01031_R_thumb.jpg',120, 80,18,'																			photo_5500263.html');
												thumbnails[556481] = new thumbnail(556481,'42205','','IMG_9044_thumb.JPG',130, 87,18,'																			photo_556481.html');
												thumbnails[1451422] = new thumbnail(1451422,'99765','','ASChall07_0012_thumb.JPG',120, 80,18,'																			photo_1451422.html');
												thumbnails[5500215] = new thumbnail(5500215,'311398','','5D_01396_R_thumb.JPG',53, 80,18,'																			photo_5500215.html');
												thumbnails[5500307] = new thumbnail(5500307,'311407','','3_1546_11_thumb.JPG',120, 80,18,'																			photo_5500307.html');
												thumbnails[545327] = new thumbnail(545327,'42205','','IMG_9293_thumb.jpg',130, 87,18,'																			photo_545327.html');
												thumbnails[1451423] = new thumbnail(1451423,'99765','','ASChall07_0015_thumb.JPG',120, 80,18,'																			photo_1451423.html');
												thumbnails[5500218] = new thumbnail(5500218,'311398','','5D_01412_R_thumb.JPG',53, 80,18,'																			photo_5500218.html');
												thumbnails[5500308] = new thumbnail(5500308,'311407','','3_1563_11_thumb.JPG',120, 80,18,'																			photo_5500308.html');
												thumbnails[556482] = new thumbnail(556482,'42205','','IMG_9265_thumb.JPG',130, 87,18,'																			photo_556482.html');
												thumbnails[5500310] = new thumbnail(5500310,'311407','','3_9682_R1_thumb.jpg',53, 80,18,'																			photo_5500310.html');
												thumbnails[545324] = new thumbnail(545324,'42205','','IMG_9088_thumb.JPG',53, 80,18,'																			photo_545324.html');
												thumbnails[1451425] = new thumbnail(1451425,'99765','','ASChall07_0020_thumb.JPG',120, 80,18,'																			photo_1451425.html');
												thumbnails[1451426] = new thumbnail(1451426,'99765','','ASChall07_0022_thumb.JPG',120, 80,18,'																			photo_1451426.html');
												thumbnails[5500316] = new thumbnail(5500316,'311407','','5_9462_R1_thumb.jpg',53, 80,18,'																			photo_5500316.html');
												thumbnails[5500324] = new thumbnail(5500324,'311407','','5_9772_R1_thumb.jpg',53, 80,18,'																			photo_5500324.html');
												thumbnails[545321] = new thumbnail(545321,'42205','','IMG_8951_thumb.jpg',130, 87,18,'																			photo_545321.html');
												thumbnails[545329] = new thumbnail(545329,'42205','World Record!','IMG_9474_1_thumb.jpg',130, 87,18,'																			photo_545329.html');
												thumbnails[1451428] = new thumbnail(1451428,'99765','','ASChall07_0024_thumb.JPG',120, 80,18,'																			photo_1451428.html');
												thumbnails[5500333] = new thumbnail(5500333,'311407','','3_1934_11_thumb.JPG',120, 80,18,'																			photo_5500333.html');
												thumbnails[5500539] = new thumbnail(5500539,'42347','','1_4328_thumb.JPG',120, 80,18,'																			photo_5500539.html');
												thumbnails[5500541] = new thumbnail(5500541,'42347','','1_6447_thumb.JPG',120, 80,18,'																			photo_5500541.html');
												thumbnails[5500336] = new thumbnail(5500336,'311407','','5_9245_11_thumb.JPG',120, 80,18,'																			photo_5500336.html');
												thumbnails[5500576] = new thumbnail(5500576,'42347','','1_9310_thumb.JPG',120, 80,18,'																			photo_5500576.html');
												thumbnails[5500553] = new thumbnail(5500553,'42347','','1_3808_1_thumb.JPG',53, 80,18,'																			photo_5500553.html');
												thumbnails[1451430] = new thumbnail(1451430,'99765','','ASChall07_0026_thumb.JPG',120, 80,18,'																			photo_1451430.html');
												thumbnails[5500339] = new thumbnail(5500339,'311407','','5_9598_R1_thumb.jpg',120, 80,18,'																			photo_5500339.html');
												thumbnails[5500564] = new thumbnail(5500564,'42347','','4_4791_1_thumb.JPG',53, 80,18,'																			photo_5500564.html');
												thumbnails[5500569] = new thumbnail(5500569,'42347','','6_2137_1_thumb.JPG',53, 80,18,'																			photo_5500569.html');
												thumbnails[5500574] = new thumbnail(5500574,'42347','','1_8415_thumb.JPG',120, 80,18,'																			photo_5500574.html');
												thumbnails[5500550] = new thumbnail(5500550,'42347','','1_6834_1_thumb.JPG',120, 80,18,'																			photo_5500550.html');
												thumbnails[5500577] = new thumbnail(5500577,'42347','','2_9258_1_thumb.JPG',120, 80,18,'																			photo_5500577.html');
												thumbnails[1451432] = new thumbnail(1451432,'99765','','ASChall07_0029_thumb.JPG',120, 80,18,'																			photo_1451432.html');
												thumbnails[5500579] = new thumbnail(5500579,'42347','','6_4986_1_thumb.JPG',53, 80,18,'																			photo_5500579.html');
												thumbnails[5500582] = new thumbnail(5500582,'42347','','0019_thumb.jpg',53, 80,18,'																			photo_5500582.html');
												thumbnails[5500583] = new thumbnail(5500583,'42347','','IMG_1505a_thumb.jpg',53, 80,18,'																			photo_5500583.html');
												thumbnails[5500586] = new thumbnail(5500586,'42347','','3_0885_1_thumb.jpg',120, 80,18,'																			photo_5500586.html');
												thumbnails[5500589] = new thumbnail(5500589,'42347','','5_9971_1_thumb.JPG',120, 80,18,'																			photo_5500589.html');
												thumbnails[5500591] = new thumbnail(5500591,'42347','','5D_00509_R_thumb.JPG',120, 80,18,'																			photo_5500591.html');
												thumbnails[5500593] = new thumbnail(5500593,'42347','','5D_00565_R_thumb.JPG',120, 80,18,'																			photo_5500593.html');
												thumbnails[5500595] = new thumbnail(5500595,'42347','','6_2107_1_thumb.JPG',120, 80,18,'																			photo_5500595.html');
												thumbnails[5500596] = new thumbnail(5500596,'42347','','IMG_5478_1_thumb.JPG',120, 80,18,'																			photo_5500596.html');
												thumbnails[7416000] = new thumbnail(7416000,'42347','','5D_03209_thumb.JPG',53, 80,18,'																			photo_7416000.html');
												thumbnails[7416006] = new thumbnail(7416006,'42347','','5D_045601_thumb.JPG',53, 80,18,'																			photo_7416006.html');
												thumbnails[7416007] = new thumbnail(7416007,'42347','','5D_07218_thumb.JPG',120, 80,18,'																			photo_7416007.html');
												thumbnails[7416002] = new thumbnail(7416002,'42347','','5D_04310_thumb.JPG',120, 80,18,'																			photo_7416002.html');
												thumbnails[7416011] = new thumbnail(7416011,'42347','','5D_071521_thumb.JPG',120, 80,18,'																			photo_7416011.html');
												thumbnails[7416004] = new thumbnail(7416004,'42347','','5D_04582_thumb.JPG',120, 80,18,'																			photo_7416004.html');
												thumbnails[7416012] = new thumbnail(7416012,'42347','','5D_048191_thumb.JPG',120, 80,18,'																			photo_7416012.html');
												thumbnails[7416014] = new thumbnail(7416014,'42347','','5D_048771_thumb.jpg',120, 80,18,'																			photo_7416014.html');
												thumbnails[7416015] = new thumbnail(7416015,'42347','','5D_065391_thumb.JPG',120, 80,18,'																			photo_7416015.html');
												thumbnails[7416018] = new thumbnail(7416018,'42347','','5D_071431_thumb.JPG',120, 80,18,'																			photo_7416018.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[42347] = new gallery(42347,'5500595','Favourites','gallery',[5500539,5500541,5500576,5500553,5500564,5500569,5500574,5500550,5500577,5500579,5500582,5500583,5500586,5500589,5500591,5500593,5500595,5500596,7416000,7416006,7416007,7416002,7416011,7416004,7416012,7416014,7416015,7416018],0, 1, '311401', '																																																																																																							gallery_42347.html',0,0);
				  					galleries[42205] = new gallery(42205,'545329,545307','World Team 2006','gallery',[545258,556480,545307,556481,545327,556482,545324,545321,545329],0, 1, '311401', '																																																																																																							gallery_42205.html',0,0);
				  					galleries[401845] = new gallery(401845,'7416099,7416098,7416095,7416088,7416083,7416077','Learning to Skydive!','gallery',[7416095,7416083,7416098,7416077,7416099,7416088],0, 1, '311401', '																																																																																																							gallery_401845.html',0,0);
				  					galleries[311401] = new gallery(311401,'5500595,4764541,2844583,2207490,1451426,545329,545307','Skydiving','gallery',[],0, 1, '', '																																																																																																							gallery_311401.html',0,0);
				  					galleries[99765] = new gallery(99765,'1451426','Ampuriabrava Airspeed Challenge 2007','gallery',[1451420,1451422,1451423,1451425,1451426,1451428,1451430,1451432],0, 1, '311401', '																																																																																																							gallery_99765.html',0,0);
				  					galleries[145812] = new gallery(145812,'2207490','Langar Boogie 1, 2008','gallery',[2207423,2207427,2207428,2207430,2207447,2207484,2207486,2207488,2207490,2207493,2207494,2207496,2207498,2207499,2207500,2207501,2207503,2207505,2207511,2207512,2207514,2207516,2207517,2207520,2207524,2207525],0, 1, '311401', '																																																																																																							gallery_145812.html',0,0);
				  					galleries[177154] = new gallery(177154,'2844583','Langar Boogie 2, 2008','gallery',[2844559,2844565,2844566,2844573,2844579,2844582,2844583,2844589,2844591,2844615,2844621,2844622,2844627,2844630],0, 1, '311401', '																																																																																																							gallery_177154.html',0,0);
				  					galleries[272895] = new gallery(272895,'4764541','Langar Boogie 2 - 2009','gallery',[4764478,4764479,4764480,4764481,4764482,4764483,4764507,4764539,4764540,4764541,4764542,4764544,4764546,4764549,4764552],0, 1, '311401', '																																																																																																							gallery_272895.html',0,0);
				  					galleries[311398] = new gallery(311398,'5500212','Buildings and architecture','gallery',[5500210,5500212,5500213,5500214,5500215,5500218],0, 1, '', '																																																																																																							gallery_311398.html',0,0);
				  					galleries[311407] = new gallery(311407,'5500333','Animals','gallery',[5500300,5500296,5500303,5500263,5500307,5500308,5500310,5500316,5500324,5500333,5500336,5500339],0, 1, '', '																																																																																																							gallery_311407.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '5500593';
imageSets[2] = '5500595,5500333,5500212,4764541,2844583,2207490,1451426,545329,545307';
imageSets[3] = '5500586';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/garywainwright/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/garywainwright/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/garywainwright/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/garywainwright/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/garywainwright/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/garywainwright/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/garywainwright/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/garywainwright/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/garywainwright/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/garywainwright/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/garywainwright/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/garywainwright/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/garywainwright/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/garywainwright/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/garywainwright/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/garywainwright/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/garywainwright/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/garywainwright/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/garywainwright/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/garywainwright/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/garywainwright/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/garywainwright/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 = 'gary wainwright 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;
	}
}

			

