window.thumbnails = {};
															thumbnails[3140303] = clik.newPhoto({"id":3140303,"src":"3kiosks2_thumb.jpg","galleries_id":192410,"server_id":32,"link":"photo_3140303.html","width":130,"caption":"3 Kiosks","height":81});
															thumbnails[3140310] = clik.newPhoto({"id":3140310,"src":"East beach cottages West Bay_thumb.jpg","galleries_id":192410,"server_id":32,"link":"photo_3140310.html","width":130,"caption":"East Beach Cottages","height":80});
															thumbnails[3140311] = clik.newPhoto({"id":3140311,"src":"East beach cottages, West Bay, at sunrise_thumb.jpg","galleries_id":192410,"server_id":32,"link":"photo_3140311.html","width":130,"caption":"East Beach Cottages at sunrise","height":87});
															thumbnails[3140321] = clik.newPhoto({"id":3140321,"src":"Huts at sunrise, Portland_thumb.jpg","galleries_id":192409,"server_id":32,"link":"photo_3140321.html","width":130,"caption":"Huts at sunrise","height":87});
															thumbnails[3140324] = clik.newPhoto({"id":3140324,"src":"Portland Bill Lighthouse at dusk_thumb.jpg","galleries_id":192409,"server_id":32,"link":"photo_3140324.html","width":130,"caption":"Portland Bill Lighthouse at dusk","height":87});
															thumbnails[3140331] = clik.newPhoto({"id":3140331,"src":"Misty sunrise, Symondsbury_thumb.jpg","galleries_id":192410,"server_id":32,"link":"photo_3140331.html","width":130,"caption":"Misty sunrise Symondsbury","height":87});
															thumbnails[3140332] = clik.newPhoto({"id":3140332,"src":"Mist in the trees_thumb.jpg","galleries_id":306972,"server_id":32,"link":"photo_3140332.html","width":130,"caption":"Mist in the trees","height":85});
															thumbnails[3143570] = clik.newPhoto({"id":3143570,"src":"Lindis Pass, South Island_thumb.jpg","galleries_id":192595,"server_id":32,"link":"photo_3143570.html","width":130,"caption":"Lindis Pass, South Island NZ","height":87});
															thumbnails[3143579] = clik.newPhoto({"id":3143579,"src":"Lindis Pass 3, South Island_thumb.jpg","galleries_id":192595,"server_id":32,"link":"photo_3143579.html","width":130,"caption":"Lindis Pass 3 South Island NZ","height":87});
															thumbnails[3143583] = clik.newPhoto({"id":3143583,"src":"Lifebelt Chesil Beach_thumb.jpg","galleries_id":192410,"server_id":32,"link":"photo_3143583.html","width":130,"caption":"Lifebelt Chesil beach","height":86});
															thumbnails[3143588] = clik.newPhoto({"id":3143588,"src":"Fishing on East beach, West Bay_thumb.jpg","galleries_id":192410,"server_id":32,"link":"photo_3143588.html","width":130,"caption":"Fishing on East beach","height":85});
															thumbnails[3143641] = clik.newPhoto({"id":3143641,"src":"Stones of Moreaka 3, South Island_thumb.jpg","galleries_id":192595,"server_id":32,"link":"photo_3143641.html","width":130,"caption":"Stones of Moeraki 3 South Island NZ","height":87});
															thumbnails[3143645] = clik.newPhoto({"id":3143645,"src":"Sunrise, Portland Bill_thumb.jpg","galleries_id":192409,"server_id":32,"link":"photo_3143645.html","width":130,"caption":"Sunrise ","height":87});
															thumbnails[3143656] = clik.newPhoto({"id":3143656,"src":"Ottery St Mary tar barrels 2_thumb.jpg","galleries_id":192604,"server_id":32,"link":"photo_3143656.html","width":130,"caption":"Ottery St Mary burning tar barrels 2","height":87});
															thumbnails[3143810] = clik.newPhoto({"id":3143810,"src":"Ottery St Mary tar barrels 4_thumb.jpg","galleries_id":192604,"server_id":32,"link":"photo_3143810.html","width":130,"caption":"Ottery St Mary burning tar barrels 4","height":87});
															thumbnails[3143814] = clik.newPhoto({"id":3143814,"src":"Mummers at Symondsbury1_thumb.jpg","galleries_id":192604,"server_id":32,"link":"photo_3143814.html","width":130,"caption":"Mummers at Symondsbury","height":87});
															thumbnails[3143822] = clik.newPhoto({"id":3143822,"src":"Mummers 2 at Symondsbury_thumb.jpg","galleries_id":192604,"server_id":32,"link":"photo_3143822.html","width":130,"caption":"Mummers at Symondsbury 2","height":130});
															thumbnails[3143830] = clik.newPhoto({"id":3143830,"src":"Dunstanburgh Castle at dawn_thumb.jpg","galleries_id":192595,"server_id":32,"link":"photo_3143830.html","width":130,"caption":"Dunstanburgh Castle at dawn","height":79});
															thumbnails[3143839] = clik.newPhoto({"id":3143839,"src":"Portland Bill Lighthouse at sunrise_thumb.jpg","galleries_id":192409,"server_id":32,"link":"photo_3143839.html","width":130,"caption":"Portland Bill lighthouse at dawn","height":86});
															thumbnails[3143891] = clik.newPhoto({"id":3143891,"src":"Ottery St Mary Tar barrels_thumb.jpg","galleries_id":192604,"server_id":32,"link":"photo_3143891.html","width":130,"caption":"Ottery St Mary burning tar barrels 1","height":87});
															thumbnails[3143903] = clik.newPhoto({"id":3143903,"src":"Ottery St Mary tar barrels 3_thumb.jpg","galleries_id":192604,"server_id":32,"link":"photo_3143903.html","width":130,"caption":"Ottery St Mary burning tar barrels 3","height":87});
															thumbnails[3143931] = clik.newPhoto({"id":3143931,"src":"Sunrise on East Pier, West Bay_thumb.jpg","galleries_id":192410,"server_id":32,"link":"photo_3143931.html","width":130,"caption":"Sunrise on East Pier","height":61});
															thumbnails[3146780] = clik.newPhoto({"id":3146780,"src":"Akaroa 2, South Island_thumb.jpg","galleries_id":192595,"server_id":32,"link":"photo_3146780.html","width":130,"caption":"Akaroa 2 South Island NZ","height":87});
															thumbnails[3156096] = clik.newPhoto({"id":3156096,"src":"Longhorns 1_thumb.jpg","galleries_id":193412,"server_id":32,"link":"photo_3156096.html","width":130,"caption":"Longhorns 1","height":87});
															thumbnails[3163217] = clik.newPhoto({"id":3163217,"src":"Huts, Portland Bill1_thumb.jpg","galleries_id":192409,"server_id":32,"link":"photo_3163217.html","width":130,"caption":"Huts","height":86});
															thumbnails[3163233] = clik.newPhoto({"id":3163233,"src":"Stones of Moreaka 2, South Island2_thumb.jpg","galleries_id":192595,"server_id":32,"link":"photo_3163233.html","width":130,"caption":"Stones of Moeraki South Island NZ","height":195});
															thumbnails[3163240] = clik.newPhoto({"id":3163240,"src":"Brancaster Staithe, Norfolk, sunset1_thumb.jpg","galleries_id":192595,"server_id":32,"link":"photo_3163240.html","width":130,"caption":"Sunset Brancaster Staithe Norfolk","height":175});
															thumbnails[3163258] = clik.newPhoto({"id":3163258,"src":"Charolais1_thumb.jpg","galleries_id":193412,"server_id":32,"link":"photo_3163258.html","width":130,"caption":"Charolais","height":159});
															thumbnails[3163263] = clik.newPhoto({"id":3163263,"src":"Wave break on volcanic sand1_thumb.jpg","galleries_id":192597,"server_id":32,"link":"photo_3163263.html","width":130,"caption":"Wavebreak on volcanic sand","height":130});
															thumbnails[3163267] = clik.newPhoto({"id":3163267,"src":"Old Lighthouse, Portland Bill1_thumb.jpg","galleries_id":192409,"server_id":32,"link":"photo_3163267.html","width":130,"caption":"Old Lighthouse ","height":87});
															thumbnails[3163282] = clik.newPhoto({"id":3163282,"src":"melplash show1_thumb.jpg","galleries_id":193412,"server_id":32,"link":"photo_3163282.html","width":130,"caption":"Shirehorse ready for the show","height":87});
															thumbnails[3163650] = clik.newPhoto({"id":3163650,"src":"Black Hut, West Bay1_thumb.jpg","galleries_id":192410,"server_id":32,"link":"photo_3163650.html","width":130,"caption":"Black Hut East Pier","height":75});
															thumbnails[5429627] = clik.newPhoto({"id":5429627,"src":"Beach_reflections_thumb.jpg","galleries_id":192595,"server_id":32,"link":"photo_5429627.html","width":130,"caption":"Beach reflections, Pembrokeshire","height":82});
															thumbnails[5431678] = clik.newPhoto({"id":5431678,"src":"Badger_sheep_in_snow_thumb.jpg","galleries_id":193412,"server_id":32,"link":"photo_5431678.html","width":130,"caption":"Badger sheep in snow","height":87});
															thumbnails[5431719] = clik.newPhoto({"id":5431719,"src":"Colmers_Hill_1_thumb.jpg","galleries_id":192410,"server_id":32,"link":"photo_5431719.html","width":130,"caption":"Colmers Hill 1","height":87});
															thumbnails[5431721] = clik.newPhoto({"id":5431721,"src":"Colmers_Hill_2_thumb.jpg","galleries_id":192410,"server_id":32,"link":"photo_5431721.html","width":130,"caption":"Colmers Hill 2","height":78});
															thumbnails[5431723] = clik.newPhoto({"id":5431723,"src":"Islands_in_the_mist_thumb.jpg","galleries_id":192410,"server_id":32,"link":"photo_5431723.html","width":130,"caption":"Islands In the mist","height":87});
															thumbnails[5431886] = clik.newPhoto({"id":5431886,"src":"Mist_over_Symondsbury_thumb.jpg","galleries_id":192410,"server_id":32,"link":"photo_5431886.html","width":130,"caption":"Mist over Symondsbury","height":87});
															thumbnails[5431891] = clik.newPhoto({"id":5431891,"src":"Ransomes_in_Spring_thumb.jpg","galleries_id":306972,"server_id":32,"link":"photo_5431891.html","width":130,"caption":"Ransomes in Spring","height":73});
															thumbnails[5431900] = clik.newPhoto({"id":5431900,"src":"Shadow_of_Colmers_Hill_thumb.jpg","galleries_id":192410,"server_id":32,"link":"photo_5431900.html","width":130,"caption":"Shadow of Colmers Hill","height":87});
															thumbnails[5431904] = clik.newPhoto({"id":5431904,"src":"South_Eggardon_thumb.jpg","galleries_id":306972,"server_id":32,"link":"photo_5431904.html","width":130,"caption":"South Eggardon","height":87});
															thumbnails[5431907] = clik.newPhoto({"id":5431907,"src":"St_Justinians_Lifeboat_station_thumb.jpg","galleries_id":192595,"server_id":32,"link":"photo_5431907.html","width":130,"caption":"St Justinians Lifeboat Station Pembrokeshire","height":87});
															thumbnails[5431911] = clik.newPhoto({"id":5431911,"src":"Stormy_West_Bay_thumb.jpg","galleries_id":192410,"server_id":32,"link":"photo_5431911.html","width":130,"caption":"Stormy West Bay","height":85});
															thumbnails[5431914] = clik.newPhoto({"id":5431914,"src":"Tenby_early_morning_thumb.jpg","galleries_id":192595,"server_id":32,"link":"photo_5431914.html","width":130,"caption":"Tenby early morning","height":87});
															thumbnails[5431917] = clik.newPhoto({"id":5431917,"src":"Tenby_in_evening_light_thumb.jpg","galleries_id":192595,"server_id":32,"link":"photo_5431917.html","width":130,"caption":"Tenby in evening light","height":87});
															thumbnails[5431923] = clik.newPhoto({"id":5431923,"src":"Thorncombe_beacon_in_the_snow_thumb.jpg","galleries_id":192410,"server_id":32,"link":"photo_5431923.html","width":130,"caption":"Thorncombe Beacon in the snow","height":87});
															thumbnails[5432171] = clik.newPhoto({"id":5432171,"src":"Colmers_Hill_4_thumb.jpg","galleries_id":192410,"server_id":32,"link":"photo_5432171.html","width":130,"caption":"Colmers Hill 3","height":87});
															thumbnails[5432175] = clik.newPhoto({"id":5432175,"src":"Colmers_Hill_5_thumb.jpg","galleries_id":192410,"server_id":32,"link":"photo_5432175.html","width":130,"caption":"Colmers Hill 4","height":87});
															thumbnails[8876777] = clik.newPhoto({"id":8876777,"src":"Andy_White_Wave_at_dusk_thumb.jpg","galleries_id":192597,"server_id":32,"link":"photo_8876777.html","width":130,"caption":"Wave at dusk","height":85});
															thumbnails[8876784] = clik.newPhoto({"id":8876784,"src":"Bryce_Canyon_thumb.jpg","galleries_id":192595,"server_id":32,"link":"photo_8876784.html","width":130,"caption":"Bryce Canyon Utah USA","height":87});
															thumbnails[8876786] = clik.newPhoto({"id":8876786,"src":"Cows_in_a_snowstorm_thumb.jpg","galleries_id":192595,"server_id":32,"link":"photo_8876786.html","width":130,"caption":"Cows in a snowstorm Portugal","height":92});
															thumbnails[8876788] = clik.newPhoto({"id":8876788,"src":"Grand_Canyon_thumb.jpg","galleries_id":192595,"server_id":32,"link":"photo_8876788.html","width":130,"caption":"Grand Canyon","height":87});
															thumbnails[8876789] = clik.newPhoto({"id":8876789,"src":"Journey_to_school_American_style_thumb.jpg","galleries_id":192595,"server_id":32,"link":"photo_8876789.html","width":130,"caption":"Journey to school American style","height":87});
															thumbnails[8876794] = clik.newPhoto({"id":8876794,"src":"Quaking_Aspens_thumb.jpg","galleries_id":192595,"server_id":32,"link":"photo_8876794.html","width":130,"caption":"Quaking Aspens Utah USA","height":118});
															thumbnails[8876798] = clik.newPhoto({"id":8876798,"src":"Salt_Lagoons_Provence_thumb.jpg","galleries_id":192595,"server_id":32,"link":"photo_8876798.html","width":130,"caption":"Salt Lagoons Provence","height":84});
															thumbnails[8876804] = clik.newPhoto({"id":8876804,"src":"Sunset_at_Grand_Canyon_thumb.jpg","galleries_id":192595,"server_id":32,"link":"photo_8876804.html","width":130,"caption":"Sunset at Grand Canyon","height":87});
															thumbnails[8876807] = clik.newPhoto({"id":8876807,"src":"Sunset_Monument_Valley_thumb.jpg","galleries_id":192595,"server_id":32,"link":"photo_8876807.html","width":130,"caption":"Sunset Monument Valley","height":63});
															thumbnails[8876810] = clik.newPhoto({"id":8876810,"src":"Ticket_booth_at_dawn_Monument_Valley_thumb.jpg","galleries_id":192595,"server_id":32,"link":"photo_8876810.html","width":130,"caption":"Ticket booth at dawn Monument Valley","height":83});
															thumbnails[8876811] = clik.newPhoto({"id":8876811,"src":"Ticket_booth_Monument_Valley_thumb.jpg","galleries_id":192595,"server_id":32,"link":"photo_8876811.html","width":130,"caption":"Ticket booth at Monument Valley","height":87});
															thumbnails[8876821] = clik.newPhoto({"id":8876821,"src":"Mist_in_the_vales_thumb.jpg","galleries_id":306972,"server_id":32,"link":"photo_8876821.html","width":130,"caption":"Mist in the vales","height":84});
															thumbnails[8876823] = clik.newPhoto({"id":8876823,"src":"Portland_lighthouse_at_night_thumb.jpg","galleries_id":192409,"server_id":32,"link":"photo_8876823.html","width":130,"caption":"Portland Bill Lighthouse at night","height":85});
															thumbnails[8876824] = clik.newPhoto({"id":8876824,"src":"Potato_Field_thumb.jpg","galleries_id":192597,"server_id":32,"link":"photo_8876824.html","width":130,"caption":"Potato field","height":84});
															thumbnails[8876826] = clik.newPhoto({"id":8876826,"src":"Storm_at_Lyme_Regis_thumb.jpg","galleries_id":306972,"server_id":32,"link":"photo_8876826.html","width":130,"caption":"Storm over Lyme Regis","height":87});
															thumbnails[8876828] = clik.newPhoto({"id":8876828,"src":"Sunset_in_the_wood_thumb.jpg","galleries_id":306972,"server_id":32,"link":"photo_8876828.html","width":130,"caption":"Sunset in the wood","height":63});
															thumbnails[8876829] = clik.newPhoto({"id":8876829,"src":"Winter_walk_thumb.jpg","galleries_id":192410,"server_id":32,"link":"photo_8876829.html","width":130,"caption":"Winter walk","height":85});
															thumbnails[8906155] = clik.newPhoto({"id":8906155,"src":"Sunset_in_the_wood_2_thumb.jpg","galleries_id":306972,"server_id":32,"link":"photo_8906155.html","width":130,"caption":"Sunset in the wood 2","height":87});
															thumbnails[8906156] = clik.newPhoto({"id":8906156,"src":"Mist_over_Little_Bredy_cricket_ground_thumb.jpg","galleries_id":306972,"server_id":32,"link":"photo_8906156.html","width":130,"caption":"Mist over Little Bredy Cricket ground","height":66});
															thumbnails[8906157] = clik.newPhoto({"id":8906157,"src":"Longhorn_grazing_in_the_mist_thumb.jpg","galleries_id":193412,"server_id":32,"link":"photo_8906157.html","width":130,"caption":"Longhorn grazing in the mist","height":87});
															thumbnails[8906158] = clik.newPhoto({"id":8906158,"src":"Dawn_Little_Bredy_thumb.jpg","galleries_id":306972,"server_id":32,"link":"photo_8906158.html","width":130,"caption":"Dawn Little Bredy","height":87});
															thumbnails[8906160] = clik.newPhoto({"id":8906160,"src":"Bridport_Market_thumb.jpg","galleries_id":192410,"server_id":32,"link":"photo_8906160.html","width":130,"caption":"Bridport Market","height":87});
															thumbnails[8906162] = clik.newPhoto({"id":8906162,"src":"Bridport_Market_2_thumb.jpg","galleries_id":192410,"server_id":32,"link":"photo_8906162.html","width":130,"caption":"Bridport Market 2","height":175});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[192409] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Portland, Dorset","link":"gallery_192409.html","maxRecords":0.0,"photoIDs":[3140321.0,3140324.0,3143645.0,3143839.0,3163217.0,3163267.0,8876823.0],"skipIndex":0,"section_code":"gallery","featured_images":"8876823,3163267,3163217,3143839,3143645,3140324,3140321","id":192409,"singleSection":false});				  						galleries[192410] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Bridport & West Bay","link":"gallery_192410.html","maxRecords":0.0,"photoIDs":[3140303.0,3140310.0,3140311.0,3140331.0,3143583.0,3143588.0,3143931.0,3163650.0,5431719.0,5431721.0,5431723.0,5431886.0,5431900.0,5431911.0,5431923.0,5432171.0,5432175.0,8876829.0,8906160.0,8906162.0],"skipIndex":0,"section_code":"gallery","featured_images":"8906162,8906160,8876829,5432175,5432171,5431923,5431911,5431900,5431886,5431723","id":192410,"singleSection":false});				  						galleries[192595] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Travel","link":"gallery_192595.html","maxRecords":0.0,"photoIDs":[3143570.0,3143579.0,3143641.0,3143830.0,3146780.0,3163233.0,3163240.0,5429627.0,5431907.0,5431914.0,5431917.0,8876784.0,8876786.0,8876788.0,8876789.0,8876794.0,8876798.0,8876804.0,8876807.0,8876810.0,8876811.0],"skipIndex":0,"section_code":"gallery","featured_images":"8876811,8876810,8876807,8876804,8876798,8876794,8876789,8876788,8876786,8876784","id":192595,"singleSection":false});				  						galleries[192597] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Misc","link":"gallery_192597.html","maxRecords":0.0,"photoIDs":[3163263.0,8876777.0,8876824.0],"skipIndex":0,"section_code":"gallery","featured_images":"8876824,8876777,3163263","id":192597,"singleSection":false});				  						galleries[192604] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Local customs","link":"gallery_192604.html","maxRecords":0.0,"photoIDs":[3143656.0,3143810.0,3143814.0,3143822.0,3143891.0,3143903.0],"skipIndex":0,"section_code":"gallery","featured_images":"3143903,3143891,3143822,3143814,3143810,3143656","id":192604,"singleSection":false});				  						galleries[193412] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Farm animals","link":"gallery_193412.html","maxRecords":0.0,"photoIDs":[3156096.0,3163258.0,3163282.0,5431678.0,8906157.0],"skipIndex":0,"section_code":"gallery","featured_images":"8906157,5431678,3163282,3163258,3156096","id":193412,"singleSection":false});				  						galleries[306972] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Dorset landscapes","link":"gallery_306972.html","maxRecords":0.0,"photoIDs":[3140332.0,5431891.0,5431904.0,8876821.0,8876826.0,8876828.0,8906155.0,8906156.0,8906158.0],"skipIndex":0,"section_code":"gallery","featured_images":"8906158,8906156,8906155,8876828,8876826,8876821,5431904,5431891,3140332","id":306972,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8906162,8906160,8906158,8906157,8906156,8906155,8876829,8876828,8876826,8876824,8876823,8876821,8876811,8876810,8876807,8876804,8876798,8876794,8876789,8876788,8876786,8876784,8876777,5432175,5432171,5431923,5431917,5431914,5431911,5431907,5431904,5431900,5431891,5431886,5431723,5431721,5431719,5431678,5429627,3163650,3163282,3163267,3163263,3163258,3163240,3163233,3163217,3156096,3146780,3143931';
imageSets[3] = '8906162,8906160,8906158,8906157,8906156,8906155,8876829,8876828,8876826,8876824,8876823,8876821,8876811,8876810,8876807,8876804,8876798,8876794,8876789,8876788,8876786,8876784,8876777,5432175,5432171,5431923,5431917,5431914,5431911,5431907,5431904,5431900,5431891,5431886,5431723,5431721,5431719,5431678,5429627,3163650,3163282,3163267,3163263,3163258,3163240,3163233,3163217,3156096,3146780,3143931';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/andyatdownlands/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/andyatdownlands/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/andyatdownlands/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/andyatdownlands/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/andyatdownlands/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/andyatdownlands/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/andyatdownlands/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/andyatdownlands/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/andyatdownlands/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/andyatdownlands/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/andyatdownlands/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/andyatdownlands/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/andyatdownlands/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/andyatdownlands/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/andyatdownlands/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/andyatdownlands/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/andyatdownlands/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/andyatdownlands/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/andyatdownlands/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/andyatdownlands/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/andyatdownlands/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/andyatdownlands/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/andyatdownlands/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/andyatdownlands/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/andyatdownlands/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/andyatdownlands/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/andyatdownlands/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 = 'andywhitephotos.co.uk: ' + 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 !== '') {
			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;
	}
}

			

