window.thumbnails = {};
															thumbnails[5672791] = clik.newPhoto({"id":5672791,"src":"reculver_web1_thumb.gif","galleries_id":321390,"server_id":32,"link":"photo_5672791.html","width":130,"caption":"","height":87});
															thumbnails[5674102] = clik.newPhoto({"id":5674102,"src":"DSC_3080_thumb.jpg","galleries_id":321390,"server_id":32,"link":"photo_5674102.html","width":130,"caption":"","height":87});
															thumbnails[5674229] = clik.newPhoto({"id":5674229,"src":"DSC_4081_thumb.jpg","galleries_id":321390,"server_id":32,"link":"photo_5674229.html","width":130,"caption":"","height":87});
															thumbnails[5674240] = clik.newPhoto({"id":5674240,"src":"sunny_boat_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_5674240.html","width":130,"caption":"","height":87});
															thumbnails[5683771] = clik.newPhoto({"id":5683771,"src":"best_images_046_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_5683771.html","width":130,"caption":"","height":87});
															thumbnails[5683901] = clik.newPhoto({"id":5683901,"src":"road_2_reculver_105_thumb.jpg","galleries_id":425742,"server_id":32,"link":"photo_5683901.html","width":130,"caption":"","height":87});
															thumbnails[5685341] = clik.newPhoto({"id":5685341,"src":"20070532_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_5685341.html","width":130,"caption":"","height":87});
															thumbnails[5685348] = clik.newPhoto({"id":5685348,"src":"213_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_5685348.html","width":130,"caption":"","height":87});
															thumbnails[5704002] = clik.newPhoto({"id":5704002,"src":"20070396_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_5704002.html","width":130,"caption":"","height":87});
															thumbnails[5704165] = clik.newPhoto({"id":5704165,"src":"DSC_8099_thumb.jpg","galleries_id":425742,"server_id":32,"link":"photo_5704165.html","width":130,"caption":"","height":87});
															thumbnails[5704170] = clik.newPhoto({"id":5704170,"src":"20070053_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_5704170.html","width":130,"caption":"","height":87});
															thumbnails[5704181] = clik.newPhoto({"id":5704181,"src":"20070051_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_5704181.html","width":130,"caption":"","height":87});
															thumbnails[5713956] = clik.newPhoto({"id":5713956,"src":"DSC_7524_thumb.jpg","galleries_id":425742,"server_id":32,"link":"photo_5713956.html","width":130,"caption":"Evening Dip","height":87});
															thumbnails[5713972] = clik.newPhoto({"id":5713972,"src":"DSC_6589_thumb.jpg","galleries_id":425742,"server_id":32,"link":"photo_5713972.html","width":130,"caption":"","height":87});
															thumbnails[5714241] = clik.newPhoto({"id":5714241,"src":"DSC_6084_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_5714241.html","width":130,"caption":"","height":87});
															thumbnails[5781245] = clik.newPhoto({"id":5781245,"src":"20070532_ED51112F-1D09-001F-99F347B8CF941655_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_5781245.html","width":130,"caption":"","height":87});
															thumbnails[5781295] = clik.newPhoto({"id":5781295,"src":"20070056_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_5781295.html","width":130,"caption":"","height":87});
															thumbnails[5898263] = clik.newPhoto({"id":5898263,"src":"20070052_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_5898263.html","width":130,"caption":"","height":87});
															thumbnails[6174215] = clik.newPhoto({"id":6174215,"src":"DSC_8247_thumb.gif","galleries_id":425742,"server_id":32,"link":"photo_6174215.html","width":130,"caption":"At Play","height":87});
															thumbnails[6331858] = clik.newPhoto({"id":6331858,"src":"DSC_3010_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_6331858.html","width":130,"caption":"","height":86});
															thumbnails[6332633] = clik.newPhoto({"id":6332633,"src":"DSC_8427_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_6332633.html","width":130,"caption":"","height":86});
															thumbnails[7884416] = clik.newPhoto({"id":7884416,"src":"P1010574_thumb.jpg","galleries_id":425742,"server_id":32,"link":"photo_7884416.html","width":130,"caption":"","height":87});
															thumbnails[7890576] = clik.newPhoto({"id":7890576,"src":"DSC_8739_thumb.jpg","galleries_id":321390,"server_id":32,"link":"photo_7890576.html","width":150,"caption":"","height":100});
															thumbnails[7890585] = clik.newPhoto({"id":7890585,"src":"DSCF0102_thumb.jpg","galleries_id":427108,"server_id":32,"link":"photo_7890585.html","width":150,"caption":"","height":100});
															thumbnails[7891278] = clik.newPhoto({"id":7891278,"src":"DSC_87391_thumb.jpg","galleries_id":425742,"server_id":32,"link":"photo_7891278.html","width":150,"caption":"","height":100});
															thumbnails[7910915] = clik.newPhoto({"id":7910915,"src":"010_thumb.jpg","galleries_id":425742,"server_id":32,"link":"photo_7910915.html","width":150,"caption":"Skeletal reflections","height":100});
															thumbnails[7910925] = clik.newPhoto({"id":7910925,"src":"finished_1_thumb.jpg","galleries_id":425742,"server_id":32,"link":"photo_7910925.html","width":150,"caption":"","height":100});
															thumbnails[7910930] = clik.newPhoto({"id":7910930,"src":"P1010562_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_7910930.html","width":150,"caption":"","height":100});
															thumbnails[7910937] = clik.newPhoto({"id":7910937,"src":"090_thumb.jpg","galleries_id":425742,"server_id":32,"link":"photo_7910937.html","width":150,"caption":"","height":100});
															thumbnails[7910942] = clik.newPhoto({"id":7910942,"src":"DSC_6918_thumb.JPG","galleries_id":425742,"server_id":32,"link":"photo_7910942.html","width":150,"caption":"","height":100});
															thumbnails[7918173] = clik.newPhoto({"id":7918173,"src":"DSC_3897_thumb.jpg","galleries_id":425742,"server_id":32,"link":"photo_7918173.html","width":150,"caption":"","height":100});
															thumbnails[7918191] = clik.newPhoto({"id":7918191,"src":"20070096_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_7918191.html","width":150,"caption":"","height":100});
															thumbnails[7918345] = clik.newPhoto({"id":7918345,"src":"P1000944res_thumb.jpg","galleries_id":425742,"server_id":32,"link":"photo_7918345.html","width":150,"caption":"","height":86});
															thumbnails[7918643] = clik.newPhoto({"id":7918643,"src":"P1010561res_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_7918643.html","width":150,"caption":"","height":75});
															thumbnails[7918670] = clik.newPhoto({"id":7918670,"src":"042res_thumb.jpg","galleries_id":321390,"server_id":32,"link":"photo_7918670.html","width":150,"caption":"","height":64});
															thumbnails[7918743] = clik.newPhoto({"id":7918743,"src":"DSC_886211res_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_7918743.html","width":150,"caption":"","height":75});
															thumbnails[7919576] = clik.newPhoto({"id":7919576,"src":"DSC_3727res_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_7919576.html","width":150,"caption":"","height":75});
															thumbnails[7919762] = clik.newPhoto({"id":7919762,"src":"botany_bay_print1_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_7919762.html","width":100,"caption":"","height":100});
															thumbnails[7919892] = clik.newPhoto({"id":7919892,"src":"DSC_0038_thumb.jpg","galleries_id":427108,"server_id":32,"link":"photo_7919892.html","width":150,"caption":"","height":75});
															thumbnails[7924625] = clik.newPhoto({"id":7924625,"src":"P1010297res_thumb.jpg","galleries_id":427108,"server_id":32,"link":"photo_7924625.html","width":67,"caption":"","height":100});
															thumbnails[7924629] = clik.newPhoto({"id":7924629,"src":"IMG_4746res_thumb.jpg","galleries_id":425742,"server_id":32,"link":"photo_7924629.html","width":150,"caption":"","height":86});
															thumbnails[7924817] = clik.newPhoto({"id":7924817,"src":"P1010665_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_7924817.html","width":150,"caption":"","height":86});
															thumbnails[7924853] = clik.newPhoto({"id":7924853,"src":"DSCF0025res_thumb.jpg","galleries_id":427108,"server_id":32,"link":"photo_7924853.html","width":150,"caption":"","height":86});
															thumbnails[7924868] = clik.newPhoto({"id":7924868,"src":"DSC00700z_thumb.jpg","galleries_id":427108,"server_id":32,"link":"photo_7924868.html","width":57,"caption":"","height":100});
															thumbnails[7925627] = clik.newPhoto({"id":7925627,"src":"bw_landscape_thumb.jpg","galleries_id":427108,"server_id":32,"link":"photo_7925627.html","width":150,"caption":"","height":86});
															thumbnails[7925734] = clik.newPhoto({"id":7925734,"src":"Copy_of_DSC_7879_thumb.jpg","galleries_id":425742,"server_id":32,"link":"photo_7925734.html","width":150,"caption":"","height":86});
															thumbnails[7925742] = clik.newPhoto({"id":7925742,"src":"IMG_4975ad_thumb.jpg","galleries_id":425742,"server_id":32,"link":"photo_7925742.html","width":150,"caption":"","height":100});
															thumbnails[7969496] = clik.newPhoto({"id":7969496,"src":"IMG_5026_thumb.jpg","galleries_id":425742,"server_id":32,"link":"photo_7969496.html","width":150,"caption":"","height":100});
															thumbnails[7977699] = clik.newPhoto({"id":7977699,"src":"DSC_3911_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_7977699.html","width":150,"caption":"","height":94});
															thumbnails[7977760] = clik.newPhoto({"id":7977760,"src":"DSC_5789_thumb.jpg","galleries_id":321390,"server_id":32,"link":"photo_7977760.html","width":150,"caption":"","height":94});
															thumbnails[7977817] = clik.newPhoto({"id":7977817,"src":"IMG_4948_thumb.jpg","galleries_id":425742,"server_id":32,"link":"photo_7977817.html","width":150,"caption":"","height":100});
															thumbnails[7978537] = clik.newPhoto({"id":7978537,"src":"DSC_4033_thumb.jpg","galleries_id":425742,"server_id":32,"link":"photo_7978537.html","width":150,"caption":"","height":100});
															thumbnails[7978580] = clik.newPhoto({"id":7978580,"src":"storm_broadstairs_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_7978580.html","width":150,"caption":"","height":100});
															thumbnails[8000261] = clik.newPhoto({"id":8000261,"src":"P1010822_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_8000261.html","width":150,"caption":"","height":94});
															thumbnails[8000273] = clik.newPhoto({"id":8000273,"src":"P1010809_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_8000273.html","width":150,"caption":"","height":83});
															thumbnails[8103820] = clik.newPhoto({"id":8103820,"src":"Beach_Sea_and_Sand_resised_thumb.jpg","galleries_id":425742,"server_id":32,"link":"photo_8103820.html","width":140,"caption":"","height":100});
															thumbnails[8105480] = clik.newPhoto({"id":8105480,"src":"DSC_5741_thumb.jpg","galleries_id":321390,"server_id":32,"link":"photo_8105480.html","width":140,"caption":"","height":100});
															thumbnails[8105522] = clik.newPhoto({"id":8105522,"src":"DSC_8256_thumb.jpg","galleries_id":425742,"server_id":32,"link":"photo_8105522.html","width":140,"caption":"","height":100});
															thumbnails[8105527] = clik.newPhoto({"id":8105527,"src":"DSC_82562_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_8105527.html","width":140,"caption":"","height":100});
															thumbnails[8105555] = clik.newPhoto({"id":8105555,"src":"DSC_1237_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_8105555.html","width":71,"caption":"waiting for the drip to fall.","height":100});
															thumbnails[8105559] = clik.newPhoto({"id":8105559,"src":"drtse_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_8105559.html","width":150,"caption":"","height":70});
															thumbnails[8105673] = clik.newPhoto({"id":8105673,"src":"website_025_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_8105673.html","width":140,"caption":"","height":100});
															thumbnails[8218588] = clik.newPhoto({"id":8218588,"src":"DSC_8554res_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_8218588.html","width":160,"caption":"","height":114});
															thumbnails[8218610] = clik.newPhoto({"id":8218610,"src":"IMG_5051res_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_8218610.html","width":160,"caption":"","height":114});
															thumbnails[8218632] = clik.newPhoto({"id":8218632,"src":"P1010453res_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_8218632.html","width":160,"caption":"","height":114});
															thumbnails[8220676] = clik.newPhoto({"id":8220676,"src":"DSC_8423_thumb.jpg","galleries_id":425742,"server_id":32,"link":"photo_8220676.html","width":160,"caption":"","height":107});
															thumbnails[8220784] = clik.newPhoto({"id":8220784,"src":"DSC_3005res_thumb.jpg","galleries_id":425742,"server_id":32,"link":"photo_8220784.html","width":160,"caption":"","height":114});
															thumbnails[8220803] = clik.newPhoto({"id":8220803,"src":"DSC_3003res_thumb.jpg","galleries_id":425742,"server_id":32,"link":"photo_8220803.html","width":160,"caption":"","height":114});
															thumbnails[8220817] = clik.newPhoto({"id":8220817,"src":"P1010453res_770B5CF0-1EC9-D45B-1C049A8A6DA0A45C_thumb.jpg","galleries_id":429055,"server_id":32,"link":"photo_8220817.html","width":160,"caption":"","height":114});
															thumbnails[8297137] = clik.newPhoto({"id":8297137,"src":"P1020955res_thumb.jpg","galleries_id":425742,"server_id":32,"link":"photo_8297137.html","width":160,"caption":"","height":114});
															thumbnails[8335540] = clik.newPhoto({"id":8335540,"src":"P1030218_thumb.jpg","galleries_id":425742,"server_id":32,"link":"photo_8335540.html","width":160,"caption":"","height":114});
															thumbnails[8339546] = clik.newPhoto({"id":8339546,"src":"bw_minnis_2_men_thumb.jpg","galleries_id":425742,"server_id":32,"link":"photo_8339546.html","width":160,"caption":"","height":103});
															thumbnails[8339552] = clik.newPhoto({"id":8339552,"src":"cold_day_thumb.jpg","galleries_id":429055,"server_id":32,"link":"photo_8339552.html","width":160,"caption":"","height":160});
															thumbnails[8339559] = clik.newPhoto({"id":8339559,"src":"Copy_of_200700013_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_8339559.html","width":160,"caption":"","height":114});
															thumbnails[8339562] = clik.newPhoto({"id":8339562,"src":"merlins_boat_bw_20x20_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_8339562.html","width":160,"caption":"","height":160});
															thumbnails[8339581] = clik.newPhoto({"id":8339581,"src":"2007000111_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_8339581.html","width":160,"caption":"","height":114});
															thumbnails[8339585] = clik.newPhoto({"id":8339585,"src":"bw1605_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_8339585.html","width":160,"caption":"","height":103});
															thumbnails[8355931] = clik.newPhoto({"id":8355931,"src":"20070069_0527985C-1EC9-D45B-1C7BE0EE7634CFA1_thumb.jpg","galleries_id":321390,"server_id":32,"link":"photo_8355931.html","width":160,"caption":"","height":224});
															thumbnails[8429017] = clik.newPhoto({"id":8429017,"src":"P1030542res_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_8429017.html","width":160,"caption":"","height":114});
															thumbnails[8482805] = clik.newPhoto({"id":8482805,"src":"P1020800res_thumb.jpg","galleries_id":425742,"server_id":32,"link":"photo_8482805.html","width":160,"caption":"","height":114});
															thumbnails[8482808] = clik.newPhoto({"id":8482808,"src":"P1030542res_79537ADD-24E8-5EC4-4F3D9154A9F36DB4_thumb.jpg","galleries_id":425742,"server_id":32,"link":"photo_8482808.html","width":160,"caption":"","height":114});
															thumbnails[8482817] = clik.newPhoto({"id":8482817,"src":"P1030613res_7958AAD4-24E8-5EC4-4FE27BA6CB55B5E4_thumb.jpg","galleries_id":321504,"server_id":32,"link":"photo_8482817.html","width":160,"caption":"","height":224});
															thumbnails[7884422] = clik.newPhoto({"id":7884422,"src":"P1010526_thumb.jpg","galleries_id":321390,"server_id":32,"link":"photo_7884422.html","width":130,"caption":"","height":195});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[425742] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Minnis Bay","link":"gallery_425742.html","maxRecords":0.0,"photoIDs":[5683901.0,5704165.0,5713956.0,5713972.0,6174215.0,7884416.0,7891278.0,7910915.0,7910925.0,7910937.0,7910942.0,7918173.0,7918345.0,7924629.0,7925734.0,7925742.0,7969496.0,7977817.0,7978537.0,8103820.0,8105522.0,8220676.0,8220784.0,8220803.0,8297137.0,8335540.0,8339546.0,8482805.0,8482808.0],"skipIndex":0,"section_code":"gallery","featured_images":8482805.0,"id":425742,"singleSection":false});				  						galleries[429055] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Other images","link":"gallery_429055.html","maxRecords":0.0,"photoIDs":[8220817.0,8339552.0],"skipIndex":0,"section_code":"gallery","featured_images":"8339552,8220817","id":429055,"singleSection":false});				  						galleries[427108] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Plants and Trees","link":"gallery_427108.html","maxRecords":0.0,"photoIDs":[7890585.0,7919892.0,7924625.0,7924853.0,7924868.0,7925627.0],"skipIndex":0,"section_code":"gallery","featured_images":"7925627,7924868,7924853,7924625,7919892,7890585","id":427108,"singleSection":false});				  						galleries[321390] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Reculver. Kent.","link":"gallery_321390.html","maxRecords":0.0,"photoIDs":[5672791.0,5674102.0,5674229.0,7890576.0,7918670.0,7977760.0,8105480.0,8355931.0,7884422.0],"skipIndex":0,"section_code":"gallery","featured_images":"8355931,8105480,7977760,7918670,7890576,7884422,5674229,5674102,5672791","id":321390,"singleSection":false});				  						galleries[321504] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Thanet Coastline ","link":"gallery_321504.html","maxRecords":0.0,"photoIDs":[5674240.0,5683771.0,5685341.0,5685348.0,5704002.0,5704170.0,5704181.0,5714241.0,5781245.0,5781295.0,5898263.0,6331858.0,6332633.0,7910930.0,7918191.0,7918643.0,7918743.0,7919576.0,7919762.0,7924817.0,7977699.0,7978580.0,8000261.0,8000273.0,8105527.0,8105555.0,8105559.0,8105673.0,8218588.0,8218610.0,8218632.0,8339559.0,8339562.0,8339581.0,8339585.0,8429017.0,8482817.0],"skipIndex":0,"section_code":"gallery","featured_images":7919762.0,"id":321504,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[242506] = '8482817,8482808,7919762';
imageSets[1] = '8482817,8482808,8482805,8339585,8339552,8105527,7978580,7925734,7924853,7924817,7924625,7919892,7919762,7919576,7918643,7918345,7918191,7918173,7910937,7910925,7884416,6332633,6331858,6174215,5898263,5713972,5713956,5704165,5704002,5685348,5683901,5683771,5674240,5672791';
imageSets[2] = '8482805,7919762';
imageSets[3] = '8105522,7919762,7891278';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/davmoll/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/davmoll/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/davmoll/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/davmoll/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/davmoll/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/davmoll/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/davmoll/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/davmoll/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/davmoll/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/davmoll/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/davmoll/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/davmoll/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/davmoll/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/davmoll/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/davmoll/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/davmoll/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/davmoll/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/davmoll/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/davmoll/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/davmoll/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/davmoll/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/davmoll/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/davmoll/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/davmoll/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/davmoll/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/davmoll/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/davmoll/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 || photos || {})[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:'',$detailContainer:'',
                    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 (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
	}
		
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'Dave Molloy Photography. : ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		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.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			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', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.photo_ref != '') {
		temp += '<div class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</div>';
	}
		if (this.takendate != '') {
		
		temp += '<div class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</div>';
	}
	
	if (this.location != '') {
		
		temp += '<div class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</div>';
	}
				
				if (temp != '') {
		temp += '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp += '<p>Order this print:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> ' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
		else {
		
	}
	if (this.item_price !== '' || this.payment_groups_id !== '') {
			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({					title: galleries[gallery_id].title				}).filter(function(){return this.href;}).attr({					href: thumbnails[imageID].fnGalleryLink(gallery_id)				});
			}
		}
	}
}

/***************************************************************************
* 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 += '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
							}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

