window.thumbnails = new Object();
												thumbnails[5419467] = new thumbnail(5419467,'82068','','278_thumb.jpg',130, 195,1,'							photo_5419467.html');
												thumbnails[5419469] = new thumbnail(5419469,'82068','','331_thumb.jpg',130, 87,1,'							photo_5419469.html');
												thumbnails[5419466] = new thumbnail(5419466,'82068','','253_thumb.jpg',130, 195,1,'							photo_5419466.html');
												thumbnails[5419473] = new thumbnail(5419473,'82068','','407_thumb.jpg',130, 87,1,'							photo_5419473.html');
												thumbnails[5419455] = new thumbnail(5419455,'82068','','052_thumb.jpg',130, 87,1,'							photo_5419455.html');
												thumbnails[1124066] = new thumbnail(1124066,'82068','','137_thumb.jpg',130, 195,1,'							photo_1124066.html');
												thumbnails[5419468] = new thumbnail(5419468,'82068','','280_thumb.jpg',130, 87,1,'							photo_5419468.html');
												thumbnails[1124074] = new thumbnail(1124074,'82068','','142_thumb.JPG',130, 195,1,'							photo_1124074.html');
												thumbnails[5419464] = new thumbnail(5419464,'82068','','234_thumb.jpg',130, 195,1,'							photo_5419464.html');
												thumbnails[1123944] = new thumbnail(1123944,'82068','','117_thumb.JPG',130, 87,1,'							photo_1123944.html');
												thumbnails[5419459] = new thumbnail(5419459,'82068','','131_thumb.jpg',130, 87,1,'							photo_5419459.html');
												thumbnails[5419456] = new thumbnail(5419456,'82068','','075_thumb.jpg',130, 87,1,'							photo_5419456.html');
												thumbnails[5419461] = new thumbnail(5419461,'82068','','162_thumb.jpg',130, 195,1,'							photo_5419461.html');
												thumbnails[1123924] = new thumbnail(1123924,'82068','','107_thumb.JPG',130, 87,1,'							photo_1123924.html');
												thumbnails[1124013] = new thumbnail(1124013,'82068','','125_thumb.JPG',130, 87,1,'							photo_1124013.html');
												thumbnails[1123913] = new thumbnail(1123913,'82068','','102_thumb.JPG',130, 87,1,'							photo_1123913.html');
												thumbnails[5419460] = new thumbnail(5419460,'82068','','148_thumb.jpg',130, 87,1,'							photo_5419460.html');
												thumbnails[1123938] = new thumbnail(1123938,'82068','','113_thumb.JPG',130, 195,1,'							photo_1123938.html');
												thumbnails[1124067] = new thumbnail(1124067,'82068','','138_thumb.JPG',130, 87,1,'							photo_1124067.html');
												thumbnails[5419457] = new thumbnail(5419457,'82068','','101_thumb.jpg',130, 195,1,'							photo_5419457.html');
												thumbnails[1123943] = new thumbnail(1123943,'82068','','116_thumb.JPG',130, 87,1,'							photo_1123943.html');
												thumbnails[5419458] = new thumbnail(5419458,'82068','','109_thumb.jpg',130, 87,1,'							photo_5419458.html');
												thumbnails[1124060] = new thumbnail(1124060,'82068','','133_thumb.JPG',130, 87,1,'							photo_1124060.html');
												thumbnails[5419462] = new thumbnail(5419462,'82068','','181_thumb.jpg',130, 87,1,'							photo_5419462.html');
												thumbnails[5419465] = new thumbnail(5419465,'82068','','241_thumb.jpg',130, 195,1,'							photo_5419465.html');
												thumbnails[1123927] = new thumbnail(1123927,'82068','','108_thumb.JPG',130, 87,1,'							photo_1123927.html');
												thumbnails[5419463] = new thumbnail(5419463,'82068','','194_thumb.jpg',130, 87,1,'							photo_5419463.html');
												thumbnails[1124079] = new thumbnail(1124079,'82068','','145_thumb.JPG',130, 87,1,'							photo_1124079.html');
												thumbnails[5419470] = new thumbnail(5419470,'82068','','349_thumb.jpg',130, 195,1,'							photo_5419470.html');
												thumbnails[5419471] = new thumbnail(5419471,'82068','','354_thumb.jpg',130, 195,1,'							photo_5419471.html');
												thumbnails[5419472] = new thumbnail(5419472,'82068','','396_thumb.jpg',130, 87,1,'							photo_5419472.html');
												thumbnails[5419474] = new thumbnail(5419474,'82068','','472_thumb.jpg',130, 195,1,'							photo_5419474.html');
												thumbnails[1124075] = new thumbnail(1124075,'82068','','143_thumb.JPG',130, 87,1,'							photo_1124075.html');
												thumbnails[5419475] = new thumbnail(5419475,'82068','','536_thumb.jpg',130, 195,1,'							photo_5419475.html');
												thumbnails[1123948] = new thumbnail(1123948,'82068','','119_thumb.JPG',130, 195,1,'							photo_1123948.html');
												thumbnails[5225940] = new thumbnail(5225940,'294726','','IMG_3045_thumb.jpg',130, 87,1,'							photo_5225940.html');
												thumbnails[5226005] = new thumbnail(5226005,'294726','','IMG_8889_thumb.jpg',130, 195,1,'							photo_5226005.html');
												thumbnails[5225998] = new thumbnail(5225998,'294726','','IMG_3162_thumb.jpg',130, 87,1,'							photo_5225998.html');
												thumbnails[5225938] = new thumbnail(5225938,'294726','','662_thumb.jpg',130, 195,1,'							photo_5225938.html');
												thumbnails[5225996] = new thumbnail(5225996,'294726','','IMG_3105_thumb.jpg',130, 195,1,'							photo_5225996.html');
												thumbnails[5414803] = new thumbnail(5414803,'294726','','IMG_8509_thumb.jpg',130, 87,1,'							photo_5414803.html');
												thumbnails[5416670] = new thumbnail(5416670,'306090','','Group_Shot_2_Finished_to_Print_thumb.jpg',130, 87,1,'							photo_5416670.html');
												thumbnails[5225939] = new thumbnail(5225939,'294726','','IMG_3015_thumb.jpg',130, 178,1,'							photo_5225939.html');
												thumbnails[5225997] = new thumbnail(5225997,'294726','','IMG_3123_thumb.jpg',130, 87,1,'							photo_5225997.html');
												thumbnails[5414804] = new thumbnail(5414804,'294726','','IMG_8511_thumb.jpg',130, 195,1,'							photo_5414804.html');
												thumbnails[5416681] = new thumbnail(5416681,'306090','','IMG_5930_thumb.jpg',130, 195,1,'							photo_5416681.html');
												thumbnails[5416683] = new thumbnail(5416683,'306090','','IMG_5958_thumb.jpg',130, 87,1,'							photo_5416683.html');
												thumbnails[5416672] = new thumbnail(5416672,'306090','','IMG_5761_thumb.jpg',130, 195,1,'							photo_5416672.html');
												thumbnails[5416676] = new thumbnail(5416676,'306090','','IMG_5917_thumb.jpg',130, 195,1,'							photo_5416676.html');
												thumbnails[5225893] = new thumbnail(5225893,'294726','','6192_thumb.jpg',130, 195,1,'							photo_5225893.html');
												thumbnails[5414805] = new thumbnail(5414805,'294726','','IMG_8517_thumb.jpg',130, 87,1,'							photo_5414805.html');
												thumbnails[5416674] = new thumbnail(5416674,'306090','','IMG_5795_thumb.jpg',130, 195,1,'							photo_5416674.html');
												thumbnails[5416673] = new thumbnail(5416673,'306090','','IMG_5767_thumb.jpg',130, 195,1,'							photo_5416673.html');
												thumbnails[5225941] = new thumbnail(5225941,'294726','','IMG_3046_thumb.jpg',130, 87,1,'							photo_5225941.html');
												thumbnails[5225999] = new thumbnail(5225999,'294726','','IMG_3231_thumb.jpg',130, 87,1,'							photo_5225999.html');
												thumbnails[5414806] = new thumbnail(5414806,'294726','','IMG_8532_thumb.jpg',130, 87,1,'							photo_5414806.html');
												thumbnails[5416677] = new thumbnail(5416677,'306090','','IMG_5919_thumb.jpg',130, 195,1,'							photo_5416677.html');
												thumbnails[5416671] = new thumbnail(5416671,'306090','','IMG_5759_thumb.jpg',130, 195,1,'							photo_5416671.html');
												thumbnails[5225895] = new thumbnail(5225895,'294726','','6271_thumb.jpg',130, 195,1,'							photo_5225895.html');
												thumbnails[5225942] = new thumbnail(5225942,'294726','','IMG_3049_thumb.jpg',130, 87,1,'							photo_5225942.html');
												thumbnails[5226000] = new thumbnail(5226000,'294726','','IMG_3242_thumb.jpg',130, 195,1,'							photo_5226000.html');
												thumbnails[5414807] = new thumbnail(5414807,'294726','','IMG_8578_thumb.jpg',130, 87,1,'							photo_5414807.html');
												thumbnails[5416684] = new thumbnail(5416684,'306090','','IMG_5960_thumb.jpg',130, 195,1,'							photo_5416684.html');
												thumbnails[5226001] = new thumbnail(5226001,'294726','','IMG_3248_thumb.jpg',130, 87,1,'							photo_5226001.html');
												thumbnails[5416675] = new thumbnail(5416675,'306090','','IMG_5799_thumb.jpg',130, 195,1,'							photo_5416675.html');
												thumbnails[5225897] = new thumbnail(5225897,'294726','','6561_thumb.jpg',130, 87,1,'							photo_5225897.html');
												thumbnails[5226002] = new thumbnail(5226002,'294726','','IMG_3304_thumb.jpg',130, 87,1,'							photo_5226002.html');
												thumbnails[5226003] = new thumbnail(5226003,'294726','','IMG_3321_thumb.jpg',130, 87,1,'							photo_5226003.html');
												thumbnails[5414808] = new thumbnail(5414808,'294726','','IMG_8611_thumb.jpg',130, 87,1,'							photo_5414808.html');
												thumbnails[5225899] = new thumbnail(5225899,'294726','','6601_thumb.jpg',130, 195,1,'							photo_5225899.html');
												thumbnails[5226004] = new thumbnail(5226004,'294726','','IMG_8571_thumb.jpg',130, 195,1,'							photo_5226004.html');
												thumbnails[5414809] = new thumbnail(5414809,'294726','','IMG_8636_thumb.jpg',130, 87,1,'							photo_5414809.html');
												thumbnails[5414810] = new thumbnail(5414810,'294726','','IMG_8660_thumb.jpg',130, 87,1,'							photo_5414810.html');
												thumbnails[5414811] = new thumbnail(5414811,'294726','','IMG_8720_thumb.jpg',130, 87,1,'							photo_5414811.html');
												thumbnails[5416680] = new thumbnail(5416680,'306090','','IMG_5926_thumb.jpg',130, 87,1,'							photo_5416680.html');
												thumbnails[5225902] = new thumbnail(5225902,'294726','','_MG_52812_thumb.jpg',130, 87,1,'							photo_5225902.html');
												thumbnails[5414812] = new thumbnail(5414812,'294726','','IMG_8722_thumb.jpg',130, 87,1,'							photo_5414812.html');
												thumbnails[5414813] = new thumbnail(5414813,'294726','','IMG_8723_thumb.jpg',130, 87,1,'							photo_5414813.html');
												thumbnails[5414814] = new thumbnail(5414814,'294726','','IMG_8747_thumb.jpg',130, 87,1,'							photo_5414814.html');
												thumbnails[5414815] = new thumbnail(5414815,'294726','','IMG_8757_thumb.jpg',130, 87,1,'							photo_5414815.html');
												thumbnails[5414816] = new thumbnail(5414816,'294726','','IMG_8776_thumb.jpg',130, 87,1,'							photo_5414816.html');
												thumbnails[5414818] = new thumbnail(5414818,'294726','','IMG_8780_thumb.jpg',130, 87,1,'							photo_5414818.html');
												thumbnails[5414819] = new thumbnail(5414819,'294726','','IMG_8787_thumb.jpg',130, 195,1,'							photo_5414819.html');
												thumbnails[5414820] = new thumbnail(5414820,'294726','','IMG_8858_thumb.jpg',130, 87,1,'							photo_5414820.html');
												thumbnails[5416838] = new thumbnail(5416838,'306090','','2_6746BFB8-2219-B5B5-4C185FC0EDB50A54_thumb.jpg',130, 195,1,'							photo_5416838.html');
												thumbnails[5416839] = new thumbnail(5416839,'306090','','20_6746C219-2219-B5B5-4CCEBE304E2E573A_thumb.jpg',130, 195,1,'							photo_5416839.html');
												thumbnails[5416840] = new thumbnail(5416840,'306090','','23_6746C48A-2219-B5B5-4C1A26179CADC0C2_thumb.jpg',130, 195,1,'							photo_5416840.html');
												thumbnails[5416841] = new thumbnail(5416841,'306090','','26_6746C6EB-2219-B5B5-4C3A44EC2A05A332_thumb.jpg',130, 195,1,'							photo_5416841.html');
												thumbnails[5416843] = new thumbnail(5416843,'306090','','35_6746CBBE-2219-B5B5-4C21B361B5C42901_thumb.jpg',130, 195,1,'							photo_5416843.html');
												thumbnails[5416845] = new thumbnail(5416845,'306090','','36_thumb.jpg',130, 195,1,'							photo_5416845.html');
												thumbnails[5416846] = new thumbnail(5416846,'306090','','4_6746D10D-2219-B5B5-4C85CA3C3B257938_thumb.jpg',130, 195,1,'							photo_5416846.html');
												thumbnails[5420139] = new thumbnail(5420139,'306295','','All_the_Cohen_Amit_Children_10in_x_8in_thumb.jpg',130, 163,1,'							photo_5420139.html');
												thumbnails[5420141] = new thumbnail(5420141,'306295','','Kids_Lying_Down_on_Floor_Cropped_BW_thumb.jpg',130, 48,1,'							photo_5420141.html');
												thumbnails[5420143] = new thumbnail(5420143,'306295','','_MG_6710_BW_GM_Warm_1_Snappy__thumb.jpg',130, 195,1,'							photo_5420143.html');
												thumbnails[5420142] = new thumbnail(5420142,'306295','','_MG_6656_Sunglow_2_thumb.jpg',130, 87,1,'							photo_5420142.html');
												thumbnails[5420140] = new thumbnail(5420140,'306295','','Amit_Family_Edited_thumb.jpg',130, 87,1,'							photo_5420140.html');
												thumbnails[1122528] = new thumbnail(1122528,'81949','','001 (2)_thumb.JPG',130, 87,1,'							photo_1122528.html');
												thumbnails[1122529] = new thumbnail(1122529,'81949','','002 (2)_thumb.JPG',130, 87,1,'							photo_1122529.html');
												thumbnails[1122531] = new thumbnail(1122531,'81949','','003 (2)_thumb.JPG',130, 87,1,'							photo_1122531.html');
												thumbnails[1122533] = new thumbnail(1122533,'81949','','004 (2)_thumb.JPG',130, 87,1,'							photo_1122533.html');
												thumbnails[1122534] = new thumbnail(1122534,'81949','','005 (2)_thumb.JPG',130, 79,1,'							photo_1122534.html');
												thumbnails[1122535] = new thumbnail(1122535,'81949','','007 (2)_thumb.JPG',130, 166,1,'							photo_1122535.html');
												thumbnails[1122536] = new thumbnail(1122536,'81949','','008 (2)_thumb.JPG',130, 155,1,'							photo_1122536.html');
												thumbnails[1122537] = new thumbnail(1122537,'81949','','009 (2)_thumb.JPG',130, 87,1,'							photo_1122537.html');
												thumbnails[1122539] = new thumbnail(1122539,'81949','','010 (2)_thumb.JPG',130, 81,1,'							photo_1122539.html');
												thumbnails[1122541] = new thumbnail(1122541,'81949','','011 (2)_thumb.JPG',130, 87,1,'							photo_1122541.html');
												thumbnails[1122544] = new thumbnail(1122544,'81949','','012 (2)_thumb.JPG',130, 195,1,'							photo_1122544.html');
												thumbnails[1122546] = new thumbnail(1122546,'81949','','013 (2)_thumb.JPG',130, 72,1,'							photo_1122546.html');
												thumbnails[1122548] = new thumbnail(1122548,'81949','','014 (2)_thumb.JPG',130, 87,1,'							photo_1122548.html');
												thumbnails[1122593] = new thumbnail(1122593,'81949','','016 (2)_thumb.JPG',130, 87,1,'							photo_1122593.html');
												thumbnails[1122596] = new thumbnail(1122596,'81949','','017 (2)_thumb.jpg',130, 93,1,'							photo_1122596.html');
												thumbnails[1122599] = new thumbnail(1122599,'81949','','018 (2)_thumb.JPG',130, 87,1,'							photo_1122599.html');
												thumbnails[1122604] = new thumbnail(1122604,'81949','','019 (2)_thumb.JPG',130, 87,1,'							photo_1122604.html');
												thumbnails[1122607] = new thumbnail(1122607,'81949','','020 (2)_thumb.JPG',130, 87,1,'							photo_1122607.html');
												thumbnails[1122609] = new thumbnail(1122609,'81949','','021 (2)_thumb.JPG',130, 87,1,'							photo_1122609.html');
												thumbnails[1122613] = new thumbnail(1122613,'81949','','022 (2)_thumb.JPG',130, 87,1,'							photo_1122613.html');
												thumbnails[1122615] = new thumbnail(1122615,'81949','','023 (2)_thumb.JPG',130, 87,1,'							photo_1122615.html');
												thumbnails[1122616] = new thumbnail(1122616,'81949','','024 (2)_thumb.JPG',130, 195,1,'							photo_1122616.html');
												thumbnails[1122617] = new thumbnail(1122617,'81949','','025 (2)_thumb.JPG',130, 79,1,'							photo_1122617.html');
												thumbnails[1122619] = new thumbnail(1122619,'81949','','026 (2)_thumb.JPG',130, 87,1,'							photo_1122619.html');
												thumbnails[1122621] = new thumbnail(1122621,'81949','','027 (2)_thumb.JPG',130, 87,1,'							photo_1122621.html');
												thumbnails[1122625] = new thumbnail(1122625,'81949','','028 (2)_thumb.JPG',130, 87,1,'							photo_1122625.html');
												thumbnails[1122627] = new thumbnail(1122627,'81949','','029 (2)_thumb.JPG',130, 87,1,'							photo_1122627.html');
												thumbnails[1122629] = new thumbnail(1122629,'81949','','030 (2)_thumb.JPG',130, 195,1,'							photo_1122629.html');
												thumbnails[1122631] = new thumbnail(1122631,'81949','','031 (2)_thumb.JPG',130, 195,1,'							photo_1122631.html');
												thumbnails[1122633] = new thumbnail(1122633,'81949','','032 (2)_thumb.JPG',130, 195,1,'							photo_1122633.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[294726] = new gallery(294726,'5414820,5414819,5414818,5414816,5414815,5414814,5414813,5414812,5414811,5414810','Black Tie / Charity Ball ','section352512',[5225940,5226005,5225998,5225938,5225996,5414803,5225939,5225997,5414804,5225893,5414805,5225941,5225999,5414806,5225895,5225942,5226000,5414807,5226001,5225897,5226002,5226003,5414808,5225899,5226004,5414809,5414810,5414811,5225902,5414812,5414813,5414814,5414815,5414816,5414818,5414819,5414820],0, 0, '', '																																																																																																							section352512_294726.html',0,0);
				  					galleries[81949] = new gallery(81949,'1122633,1122631,1122629,1122627,1122625,1122621,1122619,1122617,1122616,1122615','F1 Monaco 2006','section113846',[1122528,1122529,1122531,1122533,1122534,1122535,1122536,1122537,1122539,1122541,1122544,1122546,1122548,1122593,1122596,1122599,1122604,1122607,1122609,1122613,1122615,1122616,1122617,1122619,1122621,1122625,1122627,1122629,1122631,1122633],0, 0, '', '																																																																																																																																	section113846.html',0,1);
				  					galleries[306295] = new gallery(306295,'5420143,5420139','Portraits','section366638',[5420139,5420141,5420143,5420142,5420140],0, 0, '', '																																																																																																																																	section366638.html',0,1);
				  					galleries[306090] = new gallery(306090,'5416846,5416845,5416843,5416841,5416840,5416839,5416838,5416684,5416683,5416681','School / Grad Prom','section352512',[5416670,5416681,5416683,5416672,5416676,5416674,5416673,5416677,5416671,5416684,5416675,5416680,5416838,5416839,5416840,5416841,5416843,5416845,5416846],0, 0, '', '																																																																																																							section352512_306090.html',0,0);
				  					galleries[82068] = new gallery(82068,'5419474,5419471,5419470,5419469,5419468,5419464','Wedding Photography Images ','gallery',[5419467,5419469,5419466,5419473,5419455,1124066,5419468,1124074,5419464,1123944,5419459,5419456,5419461,1123924,1124013,1123913,5419460,1123938,1124067,5419457,1123943,5419458,1124060,5419462,5419465,1123927,5419463,1124079,5419470,5419471,5419472,5419474,1124075,5419475,1123948],0, 1, '', '																																																																																																																																	gallery.html',0,1);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[42166] = '5419475,5419474,5419473,5419472,5419471,5419470,5419469,5419468,5419467,5419466,5419465,5419464,5419463,5419462,5419461,5419460,5419459,5419458,5419457,5419456,5419455,1124066,1124060,1123948,1123913';
imageSets[1] = '5420139,5419473,5419471,5419469,5419467,5419464,5419462,5419455,1124074';
imageSets[2] = '5420143,5420139,5419474,5419471,5419470,5419469,5419468,5419464';
imageSets[3] = '5420143,5420142,5420141,5420140,5420139,5419475,5419474,5419473,5419472,5419471,5419470,5419469,5419468,5419467,5419466,5419465,5419464,5419463,5419462,5419461,5419460,5419459,5419458,5419457,5419456,5419455,5416846,5416845,5416843,5416841,5416840,5416839,5416838,5416684,5416683,5416681,5416680,5416677,5416676,5416675,5416674,5416673,5416672,5416671,5416670,5414820,5414819,5414818,5414816,5414815';
imageSets[234374] = '5420143,5420142,5420141,5420140,5420139';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/Dean/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/Dean/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/Dean/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/Dean/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://www.clikchurch.com/Dean/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/Dean/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/Dean/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/Dean/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/Dean/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/Dean/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/Dean/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/Dean/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/Dean/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/Dean/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/Dean/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/Dean/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/Dean/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/Dean/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/Dean/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/Dean/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/Dean/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 = 'Dean Edwards Photography: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
	    var options = {photoinfominwidth:200};	    		options.photoinfoadjacent = true;			      	      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.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>';
	}
					
	temp = temp + this.fnGetPaymentInfo();
				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>Buy now using PayPal:</p>';
				temp = temp + '<p class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> 				&pound;' + (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 + '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
	temp = temp + '<input type="hidden" name="item_name" value="'+item_name+'">';
								ref = '';
				if(this.photo_ref != ''){
					ref = this.photo_ref+' - '+this.caption;
				}
				else{
					ref = this.id+' - '+this.caption;
				}
				price = amount;					temp = temp + '<input type="hidden" name="cmd" value="_cart">';
	temp = temp + '<input type="hidden" name="business" value="deanedwards@ukonline.co.uk">';
	temp = temp + '<input type="hidden" name="currency_code" value="GBP">';
	temp = temp + '<input type="hidden" name="add" value="1">';
					temp = temp + '<input type="hidden" name="amount" value="'+amount+'">';
	temp = temp + '<input type="hidden" name="item_number" value="'+ref+'">';
					temp = temp + '<input type=\"Submit\" value=\"Add to cart\" id=\"paymentAddButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
									temp = temp + '</form>';
								temp = temp + '<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
	temp = temp + '<input type="hidden" name="cmd" value="_cart">';
	temp = temp + '<input type="hidden" name="business" value="deanedwards@ukonline.co.uk">';
	temp = temp + '<input type="hidden" name="display" value="1">';
	temp = temp + '<input type=\"Submit\" value=\"View cart\" id=\"paymentViewButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
	temp = temp + '</form>';
							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;
	}
}

			

