window.thumbnails = new Object();
												thumbnails[3504028] = new thumbnail(3504028,'','','intro montage_thumb.jpg',130, 49,5,'#');
												thumbnails[2579430] = new thumbnail(2579430,'164169','','_DSC5063 copy_thumb.jpg',130, 195,5,'photo_2579430.html');
												thumbnails[2580001] = new thumbnail(2580001,'164170','','_1JB1046 copy1_thumb.jpg',130, 195,5,'photo_2580001.html');
												thumbnails[2580230] = new thumbnail(2580230,'164171','','DSCF6146 copy_thumb.jpg',130, 194,5,'photo_2580230.html');
												thumbnails[2579432] = new thumbnail(2579432,'164169','','_1JB4654 copy1_thumb.jpg',130, 195,5,'photo_2579432.html');
												thumbnails[2580002] = new thumbnail(2580002,'164170','','_1JB1199 copy1_thumb.jpg',130, 196,5,'photo_2580002.html');
												thumbnails[2580231] = new thumbnail(2580231,'164171','','_1JB0270a copy1_thumb.jpg',130, 195,5,'photo_2580231.html');
												thumbnails[2580003] = new thumbnail(2580003,'164170','','_1JB1865 copy1_thumb.jpg',130, 195,5,'photo_2580003.html');
												thumbnails[2580251] = new thumbnail(2580251,'164171','','DSCF2773 copy_thumb.jpg',130, 196,5,'photo_2580251.html');
												thumbnails[2579437] = new thumbnail(2579437,'164169','','KineFlex-Duo-BRcopy copy copy_thumb.jpg',130, 195,5,'photo_2579437.html');
												thumbnails[2579894] = new thumbnail(2579894,'164172','','_1JB2813 copy1_thumb.jpg',130, 195,5,'photo_2579894.html');
												thumbnails[2580010] = new thumbnail(2580010,'164170','','_1JB5478a copy2_thumb.jpg',130, 168,5,'photo_2580010.html');
												thumbnails[2580263] = new thumbnail(2580263,'164171','','_1JB0340 copy1_thumb.jpg',130, 195,5,'photo_2580263.html');
												thumbnails[3539532] = new thumbnail(3539532,'164170','','Picture_151acopy_thumb.jpg',130, 130,5,'photo_3539532.html');
												thumbnails[2579441] = new thumbnail(2579441,'164169','','DSCF0065_1 copy_thumb.jpg',130, 194,5,'photo_2579441.html');
												thumbnails[2579893] = new thumbnail(2579893,'164172','','_1JB5312a copy1_thumb.jpg',130, 195,5,'photo_2579893.html');
												thumbnails[2580031] = new thumbnail(2580031,'164170','','_1JB5896copy copy1_thumb.jpg',130, 196,5,'photo_2580031.html');
												thumbnails[2580171] = new thumbnail(2580171,'164170','','DSCF6409 copy_thumb.jpg',130, 87,5,'photo_2580171.html');
												thumbnails[2579435] = new thumbnail(2579435,'164169','','Bottle Background copy1_thumb.jpg',130, 184,5,'photo_2579435.html');
												thumbnails[2580034] = new thumbnail(2580034,'164170','','_DSC0428 copy1_thumb.jpg',130, 195,5,'photo_2580034.html');
												thumbnails[2580267] = new thumbnail(2580267,'164171','','_1JB0354a copy_thumb.jpg',130, 195,5,'photo_2580267.html');
												thumbnails[5255927] = new thumbnail(5255927,'164170','','_3JB8633_thumb.jpg',130, 131,5,'photo_5255927.html');
												thumbnails[6594261] = new thumbnail(6594261,'164170','','_3JB1085_copy1_thumb.jpg',130, 162,5,'photo_6594261.html');
												thumbnails[2579446] = new thumbnail(2579446,'164169','','DSCF2926 copy_thumb.jpg',130, 186,5,'photo_2579446.html');
												thumbnails[2580054] = new thumbnail(2580054,'164170','','_DSC0869 copy1_thumb.jpg',130, 195,5,'photo_2580054.html');
												thumbnails[2580268] = new thumbnail(2580268,'164171','','_1JB2685 copy1_thumb.jpg',130, 195,5,'photo_2580268.html');
												thumbnails[3500334] = new thumbnail(3500334,'164169','','Ice copy copy1_thumb.jpg',130, 144,5,'photo_3500334.html');
												thumbnails[2579447] = new thumbnail(2579447,'164169','','DSCF0035copy copy_thumb.jpg',130, 171,5,'photo_2579447.html');
												thumbnails[2580265] = new thumbnail(2580265,'164171','','DSCF3995 backcover copy_thumb.jpg',130, 194,5,'photo_2580265.html');
												thumbnails[2580269] = new thumbnail(2580269,'164171','','_1JB2731bw copy1_thumb.jpg',130, 195,5,'photo_2580269.html');
												thumbnails[2579448] = new thumbnail(2579448,'164169','','DSCF0044_1 copy_thumb.jpg',130, 194,5,'photo_2579448.html');
												thumbnails[2580057] = new thumbnail(2580057,'164170','','_DSC8969a copy1_thumb.jpg',130, 195,5,'photo_2580057.html');
												thumbnails[2580272] = new thumbnail(2580272,'164171','','_1JB3145 copy1_thumb.jpg',130, 195,5,'photo_2580272.html');
												thumbnails[2579449] = new thumbnail(2579449,'164169','','DSCF0019a copy_thumb.jpg',130, 194,5,'photo_2579449.html');
												thumbnails[2580059] = new thumbnail(2580059,'164170','','ALISHA3 copy1_thumb.jpg',130, 225,5,'photo_2580059.html');
												thumbnails[2580061] = new thumbnail(2580061,'164170','','DSC_3489 copy1_thumb.jpg',130, 195,5,'photo_2580061.html');
												thumbnails[2580274] = new thumbnail(2580274,'164171','','_1JB4395 copy1_thumb.jpg',130, 195,5,'photo_2580274.html');
												thumbnails[3504145] = new thumbnail(3504145,'164169','','DSCF0400a copy2_thumb.jpg',130, 130,5,'photo_3504145.html');
												thumbnails[2579451] = new thumbnail(2579451,'164169','','Chiliice12 copy1_thumb.jpg',130, 130,5,'photo_2579451.html');
												thumbnails[2580063] = new thumbnail(2580063,'164170','','DSCF0182 copy_thumb.jpg',130, 212,5,'photo_2580063.html');
												thumbnails[2580275] = new thumbnail(2580275,'164171','','_DSC8776a copy1_thumb.jpg',130, 195,5,'photo_2580275.html');
												thumbnails[2580076] = new thumbnail(2580076,'164170','','DSCF1536 copy_thumb.jpg',130, 190,5,'photo_2580076.html');
												thumbnails[2580277] = new thumbnail(2580277,'164171','','DSC_3466 copy1_thumb.jpg',130, 195,5,'photo_2580277.html');
												thumbnails[3500349] = new thumbnail(3500349,'164170','','_DSC8920bw copy3_thumb.jpg',130, 195,5,'photo_3500349.html');
												thumbnails[2579467] = new thumbnail(2579467,'164169','','DSCF0013 copy_thumb.jpg',130, 194,5,'photo_2579467.html');
												thumbnails[2580089] = new thumbnail(2580089,'164170','','DSCF2552 copy_thumb.jpg',130, 194,5,'photo_2580089.html');
												thumbnails[2580278] = new thumbnail(2580278,'164171','','_2JB3840 copy1_thumb.jpg',130, 195,5,'photo_2580278.html');
												thumbnails[2579468] = new thumbnail(2579468,'164169','','_1JB8419 copy1_thumb.jpg',130, 195,5,'photo_2579468.html');
												thumbnails[2580279] = new thumbnail(2580279,'164171','','DSC_4002 copy_thumb.jpg',130, 195,5,'photo_2580279.html');
												thumbnails[2579472] = new thumbnail(2579472,'164169','','DSCF0861 copy_thumb.jpg',130, 195,5,'photo_2579472.html');
												thumbnails[2580092] = new thumbnail(2580092,'164170','','DSCF2577 copy_thumb.jpg',130, 194,5,'photo_2580092.html');
												thumbnails[2580282] = new thumbnail(2580282,'164171','','_2JB7875 copy1_thumb.jpg',130, 194,5,'photo_2580282.html');
												thumbnails[3539526] = new thumbnail(3539526,'164170','','Picture_081a_thumb.jpg',130, 192,5,'photo_3539526.html');
												thumbnails[2579475] = new thumbnail(2579475,'164169','','_1JB5586a copy1_thumb.jpg',130, 166,5,'photo_2579475.html');
												thumbnails[2580119] = new thumbnail(2580119,'164170','','DSCF3181 copy_thumb.jpg',130, 194,5,'photo_2580119.html');
												thumbnails[2580283] = new thumbnail(2580283,'164171','','DSC_4031 copy_thumb.jpg',130, 195,5,'photo_2580283.html');
												thumbnails[2579477] = new thumbnail(2579477,'164169','','_DSC4220 copy1_thumb.jpg',130, 195,5,'photo_2579477.html');
												thumbnails[2580122] = new thumbnail(2580122,'164170','','DSCF4167 copy_thumb.jpg',130, 196,5,'photo_2580122.html');
												thumbnails[2580284] = new thumbnail(2580284,'164171','','_2JB3030a copy1_thumb.jpg',130, 198,5,'photo_2580284.html');
												thumbnails[2579478] = new thumbnail(2579478,'164169','','customprojects7 copy1_thumb.jpg',130, 194,5,'photo_2579478.html');
												thumbnails[2579483] = new thumbnail(2579483,'164169','','DSCF0041 copy_thumb.jpg',130, 190,5,'photo_2579483.html');
												thumbnails[2580124] = new thumbnail(2580124,'164170','','DSCF2647 copy_thumb.jpg',130, 195,5,'photo_2580124.html');
												thumbnails[2580285] = new thumbnail(2580285,'164171','','DSC_6865 copy_thumb.jpg',130, 195,5,'photo_2580285.html');
												thumbnails[2579481] = new thumbnail(2579481,'164169','','DSCF0392 copy_thumb.jpg',130, 194,5,'photo_2579481.html');
												thumbnails[2580136] = new thumbnail(2580136,'164170','','DSCF4788 copy_thumb.jpg',130, 195,5,'photo_2580136.html');
												thumbnails[2580138] = new thumbnail(2580138,'164170','','DSCF6440 copy_thumb.jpg',130, 194,5,'photo_2580138.html');
												thumbnails[2580288] = new thumbnail(2580288,'164171','','_1JB5235 copy_thumb.jpg',130, 87,5,'photo_2580288.html');
												thumbnails[3500047] = new thumbnail(3500047,'164172','','_1JB8452_thumb.jpg',130, 195,5,'photo_3500047.html');
												thumbnails[2579798] = new thumbnail(2579798,'164169','','_1JB2772d_thumb.jpg',130, 87,5,'photo_2579798.html');
												thumbnails[2580142] = new thumbnail(2580142,'164170','','DSCF7275 copy1_thumb.jpg',130, 194,5,'photo_2580142.html');
												thumbnails[2580289] = new thumbnail(2580289,'164171','','_1JB9586 copy1_thumb.jpg',130, 87,5,'photo_2580289.html');
												thumbnails[2579802] = new thumbnail(2579802,'164169','','_1JB4493bw copy1_thumb.jpg',130, 72,5,'photo_2579802.html');
												thumbnails[2580146] = new thumbnail(2580146,'164170','','DSCF9308 copy_thumb.jpg',130, 186,5,'photo_2580146.html');
												thumbnails[2580293] = new thumbnail(2580293,'164171','','_2JB0863 copy1_thumb.jpg',130, 87,5,'photo_2580293.html');
												thumbnails[2579805] = new thumbnail(2579805,'164169','','_DSC0248b copy1_thumb.jpg',130, 87,5,'photo_2579805.html');
												thumbnails[2580149] = new thumbnail(2580149,'164170','','Stone Centre girls copy_thumb.jpg',130, 173,5,'photo_2580149.html');
												thumbnails[2580295] = new thumbnail(2580295,'164171','','_2JB3051 copy2_thumb.jpg',130, 87,5,'photo_2580295.html');
												thumbnails[2579807] = new thumbnail(2579807,'164169','','_DSC5380 copy1_thumb.jpg',130, 87,5,'photo_2579807.html');
												thumbnails[2580163] = new thumbnail(2580163,'164170','','DSCF0744 copy_thumb.jpg',130, 150,5,'photo_2580163.html');
												thumbnails[2580297] = new thumbnail(2580297,'164171','','_2JB3079 copy2_thumb.jpg',130, 87,5,'photo_2580297.html');
												thumbnails[2579810] = new thumbnail(2579810,'164169','','_DSC9295 copy1_thumb.jpg',130, 87,5,'photo_2579810.html');
												thumbnails[2580165] = new thumbnail(2580165,'164170','','_2JB1024 copy1_thumb.jpg',130, 87,5,'photo_2580165.html');
												thumbnails[2580298] = new thumbnail(2580298,'164171','','_2JB3378 copy1_thumb.jpg',130, 87,5,'photo_2580298.html');
												thumbnails[2579811] = new thumbnail(2579811,'164169','','DSCF0054 copy_thumb.jpg',130, 110,5,'photo_2579811.html');
												thumbnails[2580168] = new thumbnail(2580168,'164170','','DSC_7530 copy_thumb.jpg',130, 87,5,'photo_2580168.html');
												thumbnails[2580322] = new thumbnail(2580322,'164171','','_2JB7916 copy1_thumb.jpg',130, 87,5,'photo_2580322.html');
												thumbnails[5056502] = new thumbnail(5056502,'164169','','_1JB1503a_thumb.jpg',130, 87,5,'photo_5056502.html');
												thumbnails[2579812] = new thumbnail(2579812,'164169','','DSCF3887copy copy_thumb.jpg',130, 87,5,'photo_2579812.html');
												thumbnails[2580323] = new thumbnail(2580323,'164171','','_2JB8361 copy1_thumb.jpg',130, 87,5,'photo_2580323.html');
												thumbnails[3500077] = new thumbnail(3500077,'164170','','_2JB0785_thumb.jpg',130, 87,5,'photo_3500077.html');
												thumbnails[2579816] = new thumbnail(2579816,'164169','','Goodmans Mood CD New copy1_thumb.jpg',130, 87,5,'photo_2579816.html');
												thumbnails[2580195] = new thumbnail(2580195,'164170','','_1JB1355 copy2_thumb.jpg',130, 87,5,'photo_2580195.html');
												thumbnails[2580324] = new thumbnail(2580324,'164171','','_2JB9129 copy1_thumb.jpg',130, 87,5,'photo_2580324.html');
												thumbnails[2579813] = new thumbnail(2579813,'164169','','Goodmans Mood LCD New copy_thumb.jpg',130, 87,5,'photo_2579813.html');
												thumbnails[2580196] = new thumbnail(2580196,'164170','','_1JB4304a copy2_thumb.jpg',130, 135,5,'photo_2580196.html');
												thumbnails[2580327] = new thumbnail(2580327,'164171','','_DSC8764a copy1_thumb.jpg',130, 87,5,'photo_2580327.html');
												thumbnails[2579817] = new thumbnail(2579817,'164169','','Picture 047 copy_thumb.jpg',130, 94,5,'photo_2579817.html');
												thumbnails[2580198] = new thumbnail(2580198,'164170','','DSCF0939copy copy_thumb.jpg',130, 104,5,'photo_2580198.html');
												thumbnails[2580328] = new thumbnail(2580328,'164171','','DSC_3933 copy_thumb.jpg',130, 87,5,'photo_2580328.html');
												thumbnails[2580329] = new thumbnail(2580329,'164171','','DSCF0240retouch copy_thumb.jpg',130, 87,5,'photo_2580329.html');
												thumbnails[3500000] = new thumbnail(3500000,'164170','','_1JB4624_thumb.jpg',130, 87,5,'photo_3500000.html');
												thumbnails[3500117] = new thumbnail(3500117,'164169','','_1JB0339_thumb.jpg',130, 87,5,'photo_3500117.html');
												thumbnails[2580331] = new thumbnail(2580331,'164171','','DSCF1576 copy_thumb.jpg',130, 87,5,'photo_2580331.html');
												thumbnails[3499976] = new thumbnail(3499976,'164169','','Picture 135_thumb.jpg',130, 130,5,'photo_3499976.html');
												thumbnails[3500071] = new thumbnail(3500071,'164170','','_1JB5933_thumb.jpg',130, 83,5,'photo_3500071.html');
												thumbnails[2580333] = new thumbnail(2580333,'164171','','DSCF1703 copy_thumb.jpg',130, 86,5,'photo_2580333.html');
												thumbnails[3499948] = new thumbnail(3499948,'164169','','Picture 391a_thumb.jpg',130, 147,5,'photo_3499948.html');
												thumbnails[2580336] = new thumbnail(2580336,'164171','','DSCF2684 copy_thumb.jpg',130, 79,5,'photo_2580336.html');
												thumbnails[3500127] = new thumbnail(3500127,'164171','','_2JB0836_thumb.jpg',130, 87,5,'photo_3500127.html');
												thumbnails[2579900] = new thumbnail(2579900,'164172','','_1JB3864 copy1_thumb.jpg',130, 195,5,'photo_2579900.html');
												thumbnails[2579903] = new thumbnail(2579903,'164172','','_DSC0714 copy1_thumb.jpg',130, 195,5,'photo_2579903.html');
												thumbnails[2580338] = new thumbnail(2580338,'164171','','_1JB4845a copy1_thumb.jpg',130, 42,5,'photo_2580338.html');
												thumbnails[3500097] = new thumbnail(3500097,'164171','','_1JB1409_thumb.jpg',130, 87,5,'photo_3500097.html');
												thumbnails[2579904] = new thumbnail(2579904,'164172','','_DSC0867 copy1_thumb.jpg',130, 196,5,'photo_2579904.html');
												thumbnails[2579906] = new thumbnail(2579906,'164172','','_1JB1707 copy1_thumb.jpg',130, 195,5,'photo_2579906.html');
												thumbnails[2579907] = new thumbnail(2579907,'164172','','_DSC8508b copy1_thumb.jpg',130, 195,5,'photo_2579907.html');
												thumbnails[2579908] = new thumbnail(2579908,'164172','','DSC_2209 copy1_thumb.jpg',130, 195,5,'photo_2579908.html');
												thumbnails[2579911] = new thumbnail(2579911,'164172','','DSC_3907 copy_thumb.jpg',130, 195,5,'photo_2579911.html');
												thumbnails[2579929] = new thumbnail(2579929,'164172','','DSCF0308_thumb.JPG',130, 194,5,'photo_2579929.html');
												thumbnails[2579445] = new thumbnail(2579445,'164169','','Img0016best copy_thumb.jpg',130, 272,5,'photo_2579445.html');
												thumbnails[2579930] = new thumbnail(2579930,'164172','','DSCF3708b&wa copy_thumb.jpg',130, 195,5,'photo_2579930.html');
												thumbnails[3539535] = new thumbnail(3539535,'164170','','Picture_171bcopy_thumb.jpg',130, 130,5,'photo_3539535.html');
												thumbnails[2579957] = new thumbnail(2579957,'164172','','DSCF6039 copy1_thumb.jpg',130, 87,5,'photo_2579957.html');
												thumbnails[2579959] = new thumbnail(2579959,'164172','','DSCF1646 copy_thumb.jpg',130, 79,5,'photo_2579959.html');
												thumbnails[2579960] = new thumbnail(2579960,'164172','','CyberView-25 copy1_thumb.jpg',130, 85,5,'photo_2579960.html');
												thumbnails[5054344] = new thumbnail(5054344,'164172','','_3JB6826a_thumb.JPG',130, 87,5,'photo_5054344.html');
												thumbnails[5056493] = new thumbnail(5056493,'164169','','set1_thumb.jpg',130, 195,5,'photo_5056493.html');
												thumbnails[2579962] = new thumbnail(2579962,'164172','','_1JB5704a copy1_thumb.jpg',130, 87,5,'photo_2579962.html');
												thumbnails[2579871] = new thumbnail(2579871,'164172','','_1JB3945bw copy1_thumb.jpg',130, 126,5,'photo_2579871.html');
												thumbnails[2579963] = new thumbnail(2579963,'164172','','_2JB0745 copy1_thumb.jpg',130, 87,5,'photo_2579963.html');
												thumbnails[2579869] = new thumbnail(2579869,'164172','','CyberView171_thumb.jpg',130, 147,5,'photo_2579869.html');
												thumbnails[2579965] = new thumbnail(2579965,'164172','','_1JB5037bw Correction copy1_thumb.jpg',130, 87,5,'photo_2579965.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[164171] = new gallery(164171,'2580336,2580333,2580329,2580282,2580265','Places','gallery',[2580230,2580231,2580251,2580263,2580267,2580268,2580265,2580269,2580272,2580274,2580275,2580277,2580278,2580279,2580282,2580283,2580284,2580285,2580288,2580289,2580293,2580295,2580297,2580298,2580322,2580323,2580324,2580327,2580328,2580329,2580331,2580333,2580336,3500127,2580338,3500097],0, 0, '', 'gallery_164171.html',0,0);
				  					galleries[164169] = new gallery(164169,'3504145,2579437','Products','gallery',[2579430,2579432,2579437,2579441,2579435,2579446,3500334,2579447,2579448,2579449,3504145,2579451,2579467,2579468,2579472,2579475,2579477,2579478,2579483,2579481,2579798,2579802,2579805,2579807,2579810,2579811,5056502,2579812,2579816,2579813,2579817,3500117,3499976,3499948,2579445,5056493],0, 0, '', 'gallery_164169.html',0,0);
				  					galleries[164170] = new gallery(164170,'6594261,5255927,3539532,3539526,2580196,2580142,2580138','People','gallery',[2580001,2580002,2580003,2580010,3539532,2580031,2580171,2580034,5255927,6594261,2580054,2580057,2580059,2580061,2580063,2580076,3500349,2580089,2580092,3539526,2580119,2580122,2580124,2580136,2580138,2580142,2580146,2580149,2580163,2580165,2580168,3500077,2580195,2580196,2580198,3500000,3500071,3539535],0, 0, '', 'gallery_164170.html',0,0);
				  					galleries[164172] = new gallery(164172,'2579957,2579903,2579893','Personal Images','gallery',[2579894,2579893,3500047,2579900,2579903,2579904,2579906,2579907,2579908,2579911,2579929,2579930,2579957,2579959,2579960,5054344,2579962,2579871,2579963,2579869,2579965],0, 0, '', 'gallery_164172.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '6594261,5255927,3539535,3539532,3539526,3504145,3500334,3500000,2580282,2580268,2580265,2580196,2580171,2579957,2579911,2579893,2579871,2579813,2579811,2579435';
imageSets[2] = '6594261,5255927,3539532,3539526,3504145,2580336,2580333,2580329,2580282,2580265,2580196,2580142,2580138,2579957,2579903,2579893,2579437';
imageSets[3] = '6594261,5255927,5056502,5056493,5054344,3539535,3539532,3539526,3504145,3504028,3500349,3500334,3500127,3500117,3500097,3500077,3500071,3500047,3500000,3499976,3499948,2580338,2580336,2580333,2580331,2580329,2580328,2580327,2580324,2580323,2580322,2580298,2580297,2580295,2580293,2580289,2580288,2580285,2580284,2580283,2580282,2580279,2580278,2580277,2580275,2580274,2580272,2580269,2580268,2580267';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/jonnyb1/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/jonnyb1/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/jonnyb1/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/jonnyb1/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/jonnyb1/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/jonnyb1/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/jonnyb1/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/jonnyb1/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/jonnyb1/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/jonnyb1/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/jonnyb1/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/jonnyb1/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/jonnyb1/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/jonnyb1/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/jonnyb1/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/jonnyb1/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/jonnyb1/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/jonnyb1/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/jonnyb1/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/jonnyb1/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/jonnyb1/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/jonnyb1/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));		  $('body').trigger('clikUpdate');		}, 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 = 'Jon Banfield 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));      $('body').trigger('clikUpdate');    }        
    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;
	}
}

			

