window.thumbnails = new Object();
												thumbnails[4735785] = new thumbnail(4735785,'271759','','tidy_hooker_gig_0055_thumb.jpg',130, 86,32,'photo_4735785.html');
												thumbnails[4735797] = new thumbnail(4735797,'271759','','tidy_hooker_gig_0093_thumb.jpg',130, 86,32,'photo_4735797.html');
												thumbnails[4735811] = new thumbnail(4735811,'271759','','tidy_hooker_gig_0156_bw__thumb.jpg',130, 100,32,'photo_4735811.html');
												thumbnails[2346390] = new thumbnail(2346390,'152915','','rhys 4 go snap_thumb.jpg',130, 195,32,'photo_2346390.html');
												thumbnails[2346397] = new thumbnail(2346397,'152915','','rhys and rain 3 for go snap_thumb.jpg',130, 87,32,'photo_2346397.html');
												thumbnails[2346421] = new thumbnail(2346421,'152915','','Erinwebsite3_thumb.jpg',130, 87,32,'photo_2346421.html');
												thumbnails[2351426] = new thumbnail(2351426,'152915','','n866425530_3278331_5073_thumb.jpg',130, 87,32,'photo_2351426.html');
												thumbnails[2351431] = new thumbnail(2351431,'152915','','n866425530_3278325_9755_thumb.jpg',130, 195,32,'photo_2351431.html');
												thumbnails[2352897] = new thumbnail(2352897,'152899','','kirstenforweb1_thumb.jpg',130, 194,32,'photo_2352897.html');
												thumbnails[2635407] = new thumbnail(2635407,'152899','','kimwebsite23_thumb.jpg',130, 195,32,'photo_2635407.html');
												thumbnails[2952527] = new thumbnail(2952527,'152915','','erin and mummy go snap_thumb.jpg',130, 195,32,'photo_2952527.html');
												thumbnails[2952549] = new thumbnail(2952549,'152915','','molly website_thumb.jpg',130, 87,32,'photo_2952549.html');
												thumbnails[3478873] = new thumbnail(3478873,'152899','','website 3_thumb.jpg',130, 194,32,'photo_3478873.html');
												thumbnails[3478876] = new thumbnail(3478876,'152899','','website 1_thumb.jpg',130, 194,32,'photo_3478876.html');
												thumbnails[3733547] = new thumbnail(3733547,'152899','','CD1_9859_thumb.jpg',130, 196,32,'photo_3733547.html');
												thumbnails[3733550] = new thumbnail(3733550,'152899','','CD1_0319_thumb.jpg',130, 207,32,'photo_3733550.html');
												thumbnails[3733561] = new thumbnail(3733561,'152899','','web_1_thumb.jpg',130, 166,32,'photo_3733561.html');
												thumbnails[3733564] = new thumbnail(3733564,'152899','','Mac_shoot_go_snap_thumb.jpg',130, 196,32,'photo_3733564.html');
												thumbnails[3733600] = new thumbnail(3733600,'152899','','CD1_9582_finished_high_key_web_thumb.jpg',130, 91,32,'photo_3733600.html');
												thumbnails[3733603] = new thumbnail(3733603,'152899','','paula_2_thumb.jpg',130, 195,32,'photo_3733603.html');
												thumbnails[4143555] = new thumbnail(4143555,'152915','','DSC_1129_selective_thumb.jpg',86, 130,32,'photo_4143555.html');
												thumbnails[4143566] = new thumbnail(4143566,'152915','','DSC_1333_thumb.jpg',130, 86,32,'photo_4143566.html');
												thumbnails[4143580] = new thumbnail(4143580,'152915','','DSC_1467_thumb.jpg',130, 86,32,'photo_4143580.html');
												thumbnails[4143582] = new thumbnail(4143582,'152915','','DSC_1475_thumb.jpg',130, 80,32,'photo_4143582.html');
												thumbnails[4143585] = new thumbnail(4143585,'152915','','DSC_1488_thumb.jpg',104, 130,32,'photo_4143585.html');
												thumbnails[4143588] = new thumbnail(4143588,'152915','','DSC_1597_thumb.jpg',130, 104,32,'photo_4143588.html');
												thumbnails[4143593] = new thumbnail(4143593,'152915','','DSC_1768_thumb.jpg',86, 130,32,'photo_4143593.html');
												thumbnails[4143605] = new thumbnail(4143605,'152915','','highkey013_thumb.jpg',130, 96,32,'photo_4143605.html');
												thumbnails[4143607] = new thumbnail(4143607,'152915','','highkey020_thumb.jpg',86, 130,32,'photo_4143607.html');
												thumbnails[4227075] = new thumbnail(4227075,'152915','','DSC_1061_border_colour_thumb.jpg',130, 86,32,'photo_4227075.html');
												thumbnails[4227079] = new thumbnail(4227079,'152915','','DSC_1727_thumb.jpg',130, 104,32,'photo_4227079.html');
												thumbnails[4227080] = new thumbnail(4227080,'152915','','DSC_2079_thumb.jpg',130, 130,32,'photo_4227080.html');
												thumbnails[4243138] = new thumbnail(4243138,'152915','','DSC_2027_thumb.jpg',104, 130,32,'photo_4243138.html');
												thumbnails[4243140] = new thumbnail(4243140,'152915','','DSC_2308_-_Copy_4_thumb.jpg',130, 93,32,'photo_4243140.html');
												thumbnails[4243147] = new thumbnail(4243147,'152915','','jump_pano_thumb.jpg',130, 34,32,'photo_4243147.html');
												thumbnails[4255180] = new thumbnail(4255180,'152915','','DSC_0977-highkey_thumb.jpg',86, 130,32,'photo_4255180.html');
												thumbnails[4628477] = new thumbnail(4628477,'267321','','cover_shot_thumb.jpg',87, 130,32,'photo_4628477.html');
												thumbnails[4628479] = new thumbnail(4628479,'267321','','Faint_shoot_20090822_0443_thumb.jpg',87, 130,32,'photo_4628479.html');
												thumbnails[4628869] = new thumbnail(4628869,'267321','','Faint_shoot_20090822_0436crossed_over_thumb.jpg',93, 130,32,'photo_4628869.html');
												thumbnails[4628896] = new thumbnail(4628896,'152899','','CD1_0264_thumb.jpg',130, 87,32,'photo_4628896.html');
												thumbnails[4629380] = new thumbnail(4629380,'152899','','CD1_0229_thumb.jpg',86, 130,32,'photo_4629380.html');
												thumbnails[4629381] = new thumbnail(4629381,'152899','','CD1_9929_thumb.jpg',130, 86,32,'photo_4629381.html');
												thumbnails[4631693] = new thumbnail(4631693,'152899','','CD1_0261_thumb.jpg',86, 130,32,'photo_4631693.html');
												thumbnails[4735807] = new thumbnail(4735807,'271759','','tidy_hooker_gig_0147_thumb.jpg',130, 91,32,'photo_4735807.html');
												thumbnails[4876490] = new thumbnail(4876490,'278221','','wedding053_selective1_thumb.jpg',130, 90,32,'photo_4876490.html');
												thumbnails[4876498] = new thumbnail(4876498,'278221','','wedding075_black_and_white_thumb.jpg',130, 91,32,'photo_4876498.html');
												thumbnails[4876499] = new thumbnail(4876499,'278221','','wedding079_thumb.jpg',86, 130,32,'photo_4876499.html');
												thumbnails[4876501] = new thumbnail(4876501,'278221','','wedding099_thumb.jpg',130, 85,32,'photo_4876501.html');
												thumbnails[4876502] = new thumbnail(4876502,'278221','','wedding115_thumb.jpg',85, 130,32,'photo_4876502.html');
												thumbnails[4876503] = new thumbnail(4876503,'278221','','wedding118_thumb.jpg',84, 130,32,'photo_4876503.html');
												thumbnails[4876510] = new thumbnail(4876510,'278221','','wedding144_black_and_white_thumb.jpg',88, 130,32,'photo_4876510.html');
												thumbnails[4876511] = new thumbnail(4876511,'278221','','wedding162_black_and_white_thumb.jpg',87, 130,32,'photo_4876511.html');
												thumbnails[4876513] = new thumbnail(4876513,'278221','','wedding168_thumb.jpg',86, 130,32,'photo_4876513.html');
												thumbnails[4876535] = new thumbnail(4876535,'278221','','wedding180_thumb.jpg',84, 130,32,'photo_4876535.html');
												thumbnails[4876539] = new thumbnail(4876539,'278221','','wedding187_thumb.jpg',82, 130,32,'photo_4876539.html');
												thumbnails[4876542] = new thumbnail(4876542,'278221','','wedding205_black_and_white_thumb.jpg',96, 130,32,'photo_4876542.html');
												thumbnails[4876543] = new thumbnail(4876543,'278221','','wedding208_thumb.jpg',130, 89,32,'photo_4876543.html');
												thumbnails[4876545] = new thumbnail(4876545,'278221','','wedding230_black_and_white_thumb.jpg',130, 98,32,'photo_4876545.html');
												thumbnails[4876548] = new thumbnail(4876548,'278221','','wedding288_thumb.jpg',130, 85,32,'photo_4876548.html');
												thumbnails[4876549] = new thumbnail(4876549,'278221','','wedding299_black_and_white_thumb.jpg',130, 92,32,'photo_4876549.html');
												thumbnails[4876552] = new thumbnail(4876552,'278221','','wedding308_thumb.jpg',130, 86,32,'photo_4876552.html');
												thumbnails[4876555] = new thumbnail(4876555,'278221','','wedding313_thumb.jpg',130, 86,32,'photo_4876555.html');
												thumbnails[4876557] = new thumbnail(4876557,'278221','','wedding324_thumb.jpg',130, 87,32,'photo_4876557.html');
												thumbnails[4876560] = new thumbnail(4876560,'278221','','wedding570_thumb.jpg',90, 130,32,'photo_4876560.html');
												thumbnails[5131910] = new thumbnail(5131910,'290053','','DSC_5179_thumb.jpg',130, 86,32,'photo_5131910.html');
												thumbnails[5131916] = new thumbnail(5131916,'290053','','wedding063_thumb.jpg',86, 130,32,'photo_5131916.html');
												thumbnails[5131918] = new thumbnail(5131918,'290053','','wedding093_thumb.jpg',130, 86,32,'photo_5131918.html');
												thumbnails[5131924] = new thumbnail(5131924,'290053','','wedding116_thumb.jpg',130, 86,32,'photo_5131924.html');
												thumbnails[5131927] = new thumbnail(5131927,'290053','','wedding160_black_thumb.jpg',130, 86,32,'photo_5131927.html');
												thumbnails[5131929] = new thumbnail(5131929,'290053','','wedding177_thumb.jpg',86, 130,32,'photo_5131929.html');
												thumbnails[5131932] = new thumbnail(5131932,'290053','','wedding179_thumb.jpg',86, 130,32,'photo_5131932.html');
												thumbnails[5131935] = new thumbnail(5131935,'290053','','wedding186_thumb.jpg',86, 130,32,'photo_5131935.html');
												thumbnails[5131989] = new thumbnail(5131989,'290053','','wedding258_black_and_white_thumb.jpg',130, 87,32,'photo_5131989.html');
												thumbnails[5131997] = new thumbnail(5131997,'290053','','wedding198_black_and_white_thumb.jpg',130, 87,32,'photo_5131997.html');
												thumbnails[5132000] = new thumbnail(5132000,'290053','','wedding263_thumb.jpg',130, 86,32,'photo_5132000.html');
												thumbnails[5132001] = new thumbnail(5132001,'290053','','wedding325_thumb.jpg',130, 86,32,'photo_5132001.html');
												thumbnails[5132003] = new thumbnail(5132003,'290053','','wedding300_thumb.jpg',86, 130,32,'photo_5132003.html');
												thumbnails[5132008] = new thumbnail(5132008,'290053','','wedding388_thumb.jpg',86, 130,32,'photo_5132008.html');
												thumbnails[5132010] = new thumbnail(5132010,'290053','','wedding454_thumb.jpg',130, 86,32,'photo_5132010.html');
												thumbnails[5132018] = new thumbnail(5132018,'290053','','wedding674_black_and_white_thumb.jpg',130, 86,32,'photo_5132018.html');
												thumbnails[5132134] = new thumbnail(5132134,'267321','','college_DSC_0977_thumb.jpg',130, 86,32,'photo_5132134.html');
												thumbnails[5132138] = new thumbnail(5132138,'267321','','DSC_0692-2_funky_PP_thumb.jpg',130, 98,32,'photo_5132138.html');
												thumbnails[5132145] = new thumbnail(5132145,'267321','','DSC_1144_funky_thumb.jpg',130, 86,32,'photo_5132145.html');
												thumbnails[5290275] = new thumbnail(5290275,'152915','','DSC_0512_venture_thumb.jpg',104, 130,32,'photo_5290275.html');
												thumbnails[5290276] = new thumbnail(5290276,'152915','','DSC_0542_highkey_thumb.jpg',130, 104,32,'photo_5290276.html');
												thumbnails[5290311] = new thumbnail(5290311,'152915','','DSC_0556_venture_thumb.jpg',104, 130,32,'photo_5290311.html');
												thumbnails[5290316] = new thumbnail(5290316,'152915','','DSC_1868_venture_thumb.jpg',130, 87,32,'photo_5290316.html');
												thumbnails[5290319] = new thumbnail(5290319,'152915','','Jump_1_thumb.jpg',130, 87,32,'photo_5290319.html');
												thumbnails[5552772] = new thumbnail(5552772,'152899','','web_1_FFABC52A-1D09-001F-995B54C89F4A2E12_thumb.jpg',87, 130,32,'photo_5552772.html');
												thumbnails[5552781] = new thumbnail(5552781,'152899','','web2_thumb.jpg',92, 130,32,'photo_5552781.html');
												thumbnails[5552821] = new thumbnail(5552821,'152899','','web6_thumb.jpg',87, 130,32,'photo_5552821.html');
												thumbnails[5552822] = new thumbnail(5552822,'152899','','web7_thumb.jpg',100, 130,32,'photo_5552822.html');
												thumbnails[5616688] = new thumbnail(5616688,'152899','','website_1_thumb.jpg',87, 130,32,'photo_5616688.html');
												thumbnails[5616695] = new thumbnail(5616695,'152899','','website_6_thumb.jpg',130, 87,32,'photo_5616695.html');
												thumbnails[5802694] = new thumbnail(5802694,'271759','','1913-ruby-lounge-24_thumb.jpg',93, 130,32,'photo_5802694.html');
												thumbnails[5802695] = new thumbnail(5802695,'271759','','1913-ruby-lounge-26_thumb.jpg',88, 130,32,'photo_5802695.html');
												thumbnails[5802699] = new thumbnail(5802699,'271759','','1913-ruby-lounge-49_thumb.jpg',95, 130,32,'photo_5802699.html');
												thumbnails[5802703] = new thumbnail(5802703,'271759','','1913-ruby-lounge-81_thumb.jpg',130, 85,32,'photo_5802703.html');
												thumbnails[5802705] = new thumbnail(5802705,'271759','','DSC_3603_thumb.jpg',87, 130,32,'photo_5802705.html');
												thumbnails[5802706] = new thumbnail(5802706,'271759','','DSC_4192_thumb.jpg',130, 83,32,'photo_5802706.html');
												thumbnails[7209386] = new thumbnail(7209386,'389620','','DSC_4531-77_thumb.jpg',130, 87,32,'photo_7209386.html');
												thumbnails[7209387] = new thumbnail(7209387,'389620','','DSC_4537-82_thumb.jpg',130, 87,32,'photo_7209387.html');
												thumbnails[7209388] = new thumbnail(7209388,'389620','','DSC_4551-94jpgblack-and-white_thumb.jpg',130, 85,32,'photo_7209388.html');
												thumbnails[7209389] = new thumbnail(7209389,'389620','','DSC_4558-100jpgblack-and-white_thumb.jpg',130, 87,32,'photo_7209389.html');
												thumbnails[7209390] = new thumbnail(7209390,'389620','','DSC_4570-111_thumb.jpg',87, 130,32,'photo_7209390.html');
												thumbnails[7209392] = new thumbnail(7209392,'389620','','DSC_4601-131_thumb.jpg',130, 87,32,'photo_7209392.html');
												thumbnails[7209393] = new thumbnail(7209393,'389620','','DSC_4648-159jpgblack-and-white_thumb.jpg',89, 130,32,'photo_7209393.html');
												thumbnails[7209395] = new thumbnail(7209395,'389620','','DSC_4694-184_thumb.jpg',130, 87,32,'photo_7209395.html');
												thumbnails[7209398] = new thumbnail(7209398,'389620','','DSC_4812-240_thumb.jpg',130, 87,32,'photo_7209398.html');
												thumbnails[7209400] = new thumbnail(7209400,'389620','','DSC_4935-289_thumb.jpg',130, 87,32,'photo_7209400.html');
												thumbnails[7209402] = new thumbnail(7209402,'389620','','DSC_4963-301jpgblack-and-white_thumb.jpg',130, 87,32,'photo_7209402.html');
												thumbnails[7209403] = new thumbnail(7209403,'389620','','DSC_5038-342jpgblack-and-white_thumb.jpg',87, 130,32,'photo_7209403.html');
												thumbnails[7209405] = new thumbnail(7209405,'389620','','DSC_5052-356_thumb.jpg',130, 87,32,'photo_7209405.html');
												thumbnails[7209406] = new thumbnail(7209406,'389620','','DSC_5099-381jpgblack-and-white_thumb.jpg',130, 87,32,'photo_7209406.html');
												thumbnails[7292323] = new thumbnail(7292323,'271759','','DSC_6518-430_thumb.jpg',87, 130,32,'photo_7292323.html');
												thumbnails[7292327] = new thumbnail(7292327,'394505','','DSC_6135-107_thumb.jpg',130, 87,32,'photo_7292327.html');
												thumbnails[7292332] = new thumbnail(7292332,'394505','','DSC_6255-207_thumb.jpg',130, 87,32,'photo_7292332.html');
												thumbnails[7292383] = new thumbnail(7292383,'271759','','DSC_5602-9_thumb.jpg',130, 87,32,'photo_7292383.html');
												thumbnails[7292393] = new thumbnail(7292393,'152899','','roxie3_thumb.jpg',130, 93,32,'photo_7292393.html');
												thumbnails[7330761] = new thumbnail(7330761,'267321','','DSC_0917-2-funky_thumb.jpg',130, 87,32,'photo_7330761.html');
												thumbnails[7330773] = new thumbnail(7330773,'152915','','DSC_6719-2-venture_thumb.jpg',130, 87,32,'photo_7330773.html');
												thumbnails[7330775] = new thumbnail(7330775,'267321','','DSC_7061-copy-18x12_thumb.jpg',130, 87,32,'photo_7330775.html');
												thumbnails[7330777] = new thumbnail(7330777,'267321','','DSC_7135-copy_thumb.jpg',130, 87,32,'photo_7330777.html');
												thumbnails[7382907] = new thumbnail(7382907,'394505','','film_thumb.jpg',130, 87,32,'photo_7382907.html');
												thumbnails[7612224] = new thumbnail(7612224,'267321','','website_pics_thumb.jpg',130, 83,32,'photo_7612224.html');
												thumbnails[2346386] = new thumbnail(2346386,'152915','','rhys for go snap 1_thumb.jpg',130, 195,32,'photo_2346386.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[278221] = new gallery(278221,'4876557,4876548,4876539','Amy and James wedding','gallery',[4876490,4876498,4876499,4876501,4876502,4876503,4876510,4876511,4876513,4876535,4876539,4876542,4876543,4876545,4876548,4876549,4876552,4876555,4876557,4876560],0, 1, '283213', 'gallery_278221.html',0,0);
				  					galleries[152915] = new gallery(152915,'4227075','Family Portraits','gallery',[2346390,2346397,2346421,2351426,2351431,2952527,2952549,4143555,4143566,4143580,4143582,4143585,4143588,4143593,4143605,4143607,4227075,4227079,4227080,4243138,4243140,4243147,4255180,5290275,5290276,5290311,5290316,5290319,7330773,2346386],0, 1, '328581', 'gallery_152915.html',0,0);
				  					galleries[394505] = new gallery(394505,'7382907','General ','gallery',[7292327,7292332,7382907],0, 1, '', 'gallery_394505.html',0,0);
				  					galleries[267321] = new gallery(267321,'7612224','Location Portraits','gallery',[4628477,4628479,4628869,5132134,5132138,5132145,7330761,7330775,7330777,7612224],0, 1, '328581', 'gallery_267321.html',0,0);
				  					galleries[271759] = new gallery(271759,'7292383,7292323,5802706,5802705,5802703,5802699,5802695,5802694,4735811,4735807','Music photography','gallery',[4735785,4735797,4735811,4735807,5802694,5802695,5802699,5802703,5802705,5802706,7292323,7292383],0, 1, '', 'gallery_271759.html',0,0);
				  					galleries[328581] = new gallery(328581,'7612224,4227075,2352897','Portrait Photography','gallery',[],0, 1, '', 'gallery_328581.html',0,0);
				  					galleries[290053] = new gallery(290053,'5132018,5132010,5132008,5132003,5132001,5132000,5131997,5131989,5131935,5131932','Sally and Keith wedding','gallery',[5131910,5131916,5131918,5131924,5131927,5131929,5131932,5131935,5131989,5131997,5132000,5132001,5132003,5132008,5132010,5132018],0, 1, '283213', 'gallery_290053.html',0,0);
				  					galleries[389620] = new gallery(389620,'7209406,7209405,7209403,7209402,7209400,7209398,7209395,7209393,7209392,7209390','Tristan and Becky','gallery',[7209386,7209387,7209388,7209389,7209390,7209392,7209393,7209395,7209398,7209400,7209402,7209403,7209405,7209406],0, 1, '283213', 'gallery_389620.html',0,0);
				  					galleries[283213] = new gallery(283213,'4876557,4876548,4876539','Wedding Photography','gallery',[],0, 1, '', 'gallery_283213.html',0,0);
				  					galleries[152899] = new gallery(152899,'2352897','Individual studio Portraits','gallery',[2352897,2635407,3478873,3478876,3733547,3733550,3733561,3733564,3733600,3733603,4628896,4629380,4629381,4631693,5552772,5552781,5552821,5552822,5616688,5616695,7292393],0, 1, '328581', 'gallery_152899.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '7612224,7382907,4876557,4876548,4876539,4876490,4227075';
imageSets[2] = '7612224,7382907,4876557,4876548,4876539,4227075,2352897';
imageSets[3] = '7612224,7382907,7330777,7330775,7330773,7330761,7292393,7292383,7292332,7292327,7292323,7209406,7209405,7209403,7209402,7209400,7209398,7209395,7209393,7209392,7209390,7209389,7209388,7209387,7209386,5802706,5802705,5802703,5802699,5802695,5802694,5616695,5616688,5552822,5552821,5552781,5552772,5290319,5290316,5290311,5290276,5290275,5132145,5132138,5132134,5132018,5132010,5132008,5132003,5132001';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/purplepaul/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/purplepaul/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/purplepaul/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/purplepaul/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/purplepaul/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/purplepaul/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/purplepaul/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/purplepaul/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/purplepaul/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/purplepaul/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/purplepaul/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/purplepaul/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/purplepaul/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/purplepaul/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/purplepaul/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/purplepaul/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/purplepaul/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/purplepaul/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/purplepaul/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/purplepaul/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/purplepaul/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/purplepaul/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 = 'Pure Portraits: ' + 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>';
	}
					
	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="worshipbeer@yahoo.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="worshipbeer@yahoo.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;
	}
}

			

