window.thumbnails = {};
															thumbnails[4090949] = clik.newPhoto({"id":4090949,"src":"HPS_logo_web_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":130});
															thumbnails[4091751] = clik.newPhoto({"id":4091751,"src":"Piece_Hall_EXHIBITION_1_copy_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":94,"caption":"","height":130});
															thumbnails[6259165] = clik.newPhoto({"id":6259165,"src":"Halifax_Photographic336505_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":92,"caption":"","height":130});
															thumbnails[7038082] = clik.newPhoto({"id":7038082,"src":"10_copy_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":92});
															thumbnails[8060899] = clik.newPhoto({"id":8060899,"src":"Saltaire_United_Reformed_Church_Monochrome__1_copy_filtered_copy_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":84,"caption":"","height":130});
															thumbnails[4114807] = clik.newPhoto({"id":4114807,"src":"5_spot_burnet_moth_thumb.jpg","galleries_id":246616,"server_id":15,"link":"photo_4114807.html","width":89,"caption":"5 Spot Burnet Moth","height":130});
															thumbnails[4114822] = clik.newPhoto({"id":4114822,"src":"Egret_thumb.jpg","galleries_id":246616,"server_id":15,"link":"photo_4114822.html","width":130,"caption":"Egret","height":87});
															thumbnails[4114832] = clik.newPhoto({"id":4114832,"src":"Florida_Sunrise_thumb.jpg","galleries_id":246616,"server_id":15,"link":"photo_4114832.html","width":130,"caption":"Florida Sunrise","height":87});
															thumbnails[4114842] = clik.newPhoto({"id":4114842,"src":"Great_Blue_Heron_thumb.jpg","galleries_id":246616,"server_id":15,"link":"photo_4114842.html","width":130,"caption":"Great Blue Heron","height":87});
															thumbnails[4114852] = clik.newPhoto({"id":4114852,"src":"Meerkat_on_Guard_thumb.jpg","galleries_id":246616,"server_id":15,"link":"photo_4114852.html","width":102,"caption":"Meerkat on Guard","height":130});
															thumbnails[4114866] = clik.newPhoto({"id":4114866,"src":"Rose_thumb.jpg","galleries_id":246616,"server_id":15,"link":"photo_4114866.html","width":97,"caption":"Rose","height":130});
															thumbnails[4114890] = clik.newPhoto({"id":4114890,"src":"Sunrise_at_Fairburn_Ings_thumb.jpg","galleries_id":246616,"server_id":15,"link":"photo_4114890.html","width":102,"caption":"Sunrise at Fairburn Ings","height":130});
															thumbnails[4115293] = clik.newPhoto({"id":4115293,"src":"a_thumb.jpg","galleries_id":242044,"server_id":15,"link":"photo_4115293.html","width":130,"caption":"Embleton Bay Reflections","height":86});
															thumbnails[4115305] = clik.newPhoto({"id":4115305,"src":"b_thumb.jpg","galleries_id":242044,"server_id":15,"link":"photo_4115305.html","width":130,"caption":"Break of a Winter's Day,  Bamburgh","height":86});
															thumbnails[4115311] = clik.newPhoto({"id":4115311,"src":"c_thumb.jpg","galleries_id":242044,"server_id":15,"link":"photo_4115311.html","width":130,"caption":"Gibson Mill Reflections","height":85});
															thumbnails[4116026] = clik.newPhoto({"id":4116026,"src":"5_copy_thumb.jpg","galleries_id":242044,"server_id":15,"link":"photo_4116026.html","width":130,"caption":"Clearing Rain , Beadnell Harbour Northumberland","height":86});
															thumbnails[4116028] = clik.newPhoto({"id":4116028,"src":"6_copy_thumb.jpg","galleries_id":242044,"server_id":15,"link":"photo_4116028.html","width":86,"caption":"The Old Ship's Lifeboat, Lindisfarne","height":130});
															thumbnails[4119076] = clik.newPhoto({"id":4119076,"src":"3West_Pier_Light_Whitby_at_Dawn_PLH_thumb.jpg","galleries_id":242044,"server_id":15,"link":"photo_4119076.html","width":130,"caption":"West Pier Light, Whitby at Dawn","height":86});
															thumbnails[4120095] = clik.newPhoto({"id":4120095,"src":"172_copy_filtered_copy_thumb.jpg","galleries_id":242044,"server_id":15,"link":"photo_4120095.html","width":130,"caption":"Boulder Beach, Dunstanburgh","height":86});
															thumbnails[4121929] = clik.newPhoto({"id":4121929,"src":"DSC_2466_copy_filtered_copy_thumb.jpg","galleries_id":242044,"server_id":15,"link":"photo_4121929.html","width":130,"caption":"Look It's Here Somewhere","height":86});
															thumbnails[4197722] = clik.newPhoto({"id":4197722,"src":"IMG_7055_edited_small_for_HPC_Site_edited-100kb_copy_copy_thumb.jpg","galleries_id":249525,"server_id":15,"link":"photo_4197722.html","width":100,"caption":"Feather","height":130});
															thumbnails[4199148] = clik.newPhoto({"id":4199148,"src":"Saltwick_Nab_3_filtered_copy_thumb.jpg","galleries_id":242044,"server_id":15,"link":"photo_4199148.html","width":130,"caption":"Saltwick Bay , Evening Light at Low Tide.","height":84});
															thumbnails[4208326] = clik.newPhoto({"id":4208326,"src":"Wast_Water_Reflections_edited-1_copy_thumb.jpg","galleries_id":249525,"server_id":15,"link":"photo_4208326.html","width":130,"caption":"Wastwater  Reflections","height":98});
															thumbnails[4208499] = clik.newPhoto({"id":4208499,"src":"Periguin_Falcon_Malham_Cove_copy_thumb.jpg","galleries_id":249525,"server_id":15,"link":"photo_4208499.html","width":93,"caption":"Peregrine Falcon, Malham Cove","height":130});
															thumbnails[4208514] = clik.newPhoto({"id":4208514,"src":"Fountains_Abbey_Sun_Flash_copy_thumb.jpg","galleries_id":249525,"server_id":15,"link":"photo_4208514.html","width":87,"caption":"Fountains Abbey, Sun Flash","height":130});
															thumbnails[4217787] = clik.newPhoto({"id":4217787,"src":"DSC_4312_copy_filtered_copy_thumb.jpg","galleries_id":242044,"server_id":15,"link":"photo_4217787.html","width":130,"caption":"Whitby Harbour Lights","height":86});
															thumbnails[4660023] = clik.newPhoto({"id":4660023,"src":"Parched__Mongolia_thumb.jpg","galleries_id":249525,"server_id":15,"link":"photo_4660023.html","width":87,"caption":"Parched, Mongolia","height":130});
															thumbnails[4660028] = clik.newPhoto({"id":4660028,"src":"Reflections__Altai_Mountains_Russia_thumb.jpg","galleries_id":249525,"server_id":15,"link":"photo_4660028.html","width":87,"caption":"Reflections, Altai Mountains. Russia","height":130});
															thumbnails[4662758] = clik.newPhoto({"id":4662758,"src":"Homework_at_the_Mongolian_Orphanage_thumb.jpg","galleries_id":249525,"server_id":15,"link":"photo_4662758.html","width":104,"caption":"Homework at the Mongolian Orphanage","height":130});
															thumbnails[4677476] = clik.newPhoto({"id":4677476,"src":"TS_1_thumb.jpg","galleries_id":269397,"server_id":15,"link":"photo_4677476.html","width":91,"caption":"Orchid","height":130});
															thumbnails[4677480] = clik.newPhoto({"id":4677480,"src":"TS_2_thumb.jpg","galleries_id":269397,"server_id":15,"link":"photo_4677480.html","width":90,"caption":"Black Box","height":130});
															thumbnails[4677482] = clik.newPhoto({"id":4677482,"src":"TS_3_thumb.jpg","galleries_id":269397,"server_id":15,"link":"photo_4677482.html","width":92,"caption":"Poppy","height":130});
															thumbnails[4677486] = clik.newPhoto({"id":4677486,"src":"TS_4_thumb.jpg","galleries_id":269397,"server_id":15,"link":"photo_4677486.html","width":87,"caption":"Moulin Rouge","height":130});
															thumbnails[4677489] = clik.newPhoto({"id":4677489,"src":"TS_5_thumb.jpg","galleries_id":269397,"server_id":15,"link":"photo_4677489.html","width":88,"caption":"Reflecting on Schubert","height":130});
															thumbnails[4677494] = clik.newPhoto({"id":4677494,"src":"TS_6_thumb.jpg","galleries_id":269397,"server_id":15,"link":"photo_4677494.html","width":92,"caption":"Field of Gold","height":130});
															thumbnails[4779042] = clik.newPhoto({"id":4779042,"src":"1Daisy_COC_copy_thumb.jpg","galleries_id":273595,"server_id":15,"link":"photo_4779042.html","width":130,"caption":"Daisy","height":88});
															thumbnails[4779043] = clik.newPhoto({"id":4779043,"src":"1Wainhouse_at_Dusk_COC_copy_thumb.jpg","galleries_id":273595,"server_id":15,"link":"photo_4779043.html","width":130,"caption":"Wainhouse at Dusk","height":94});
															thumbnails[4779044] = clik.newPhoto({"id":4779044,"src":"2Golden_Sunburst__COC__copy_thumb.jpg","galleries_id":273595,"server_id":15,"link":"photo_4779044.html","width":94,"caption":"Golden Sunburst","height":130});
															thumbnails[4779045] = clik.newPhoto({"id":4779045,"src":"Couple_copy_thumb.jpg","galleries_id":273595,"server_id":15,"link":"photo_4779045.html","width":130,"caption":"Couple","height":87});
															thumbnails[4779046] = clik.newPhoto({"id":4779046,"src":"Poppy_copy_thumb.jpg","galleries_id":273595,"server_id":15,"link":"photo_4779046.html","width":130,"caption":"Poppy","height":103});
															thumbnails[4899090] = clik.newPhoto({"id":4899090,"src":"a_1_thumb.jpg","galleries_id":279218,"server_id":15,"link":"photo_4899090.html","width":130,"caption":"","height":40});
															thumbnails[4899095] = clik.newPhoto({"id":4899095,"src":"a1_thumb.jpg","galleries_id":279218,"server_id":15,"link":"photo_4899095.html","width":87,"caption":"","height":130});
															thumbnails[4899097] = clik.newPhoto({"id":4899097,"src":"a2_thumb.jpg","galleries_id":279218,"server_id":15,"link":"photo_4899097.html","width":130,"caption":"","height":41});
															thumbnails[4899099] = clik.newPhoto({"id":4899099,"src":"a3_thumb.jpg","galleries_id":279218,"server_id":15,"link":"photo_4899099.html","width":87,"caption":"","height":130});
															thumbnails[4899101] = clik.newPhoto({"id":4899101,"src":"a4_thumb.jpg","galleries_id":279218,"server_id":15,"link":"photo_4899101.html","width":130,"caption":"","height":130});
															thumbnails[4899104] = clik.newPhoto({"id":4899104,"src":"a6_thumb.jpg","galleries_id":279218,"server_id":15,"link":"photo_4899104.html","width":88,"caption":"","height":130});
															thumbnails[4899106] = clik.newPhoto({"id":4899106,"src":"a7_thumb.jpg","galleries_id":279218,"server_id":15,"link":"photo_4899106.html","width":87,"caption":"","height":130});
															thumbnails[4899112] = clik.newPhoto({"id":4899112,"src":"a8_thumb.jpg","galleries_id":279218,"server_id":15,"link":"photo_4899112.html","width":130,"caption":"","height":87});
															thumbnails[4899115] = clik.newPhoto({"id":4899115,"src":"a9_thumb.jpg","galleries_id":279218,"server_id":15,"link":"photo_4899115.html","width":98,"caption":"","height":130});
															thumbnails[4899117] = clik.newPhoto({"id":4899117,"src":"a10_thumb.jpg","galleries_id":279218,"server_id":15,"link":"photo_4899117.html","width":130,"caption":"","height":130});
															thumbnails[4947391] = clik.newPhoto({"id":4947391,"src":"Apple_Blossom_for_print_copy_copy_thumb.jpg","galleries_id":281375,"server_id":15,"link":"photo_4947391.html","width":130,"caption":"Apple Blossom","height":91});
															thumbnails[4947427] = clik.newPhoto({"id":4947427,"src":"Sombre_Reflections_-_print_copy_thumb.jpg","galleries_id":281375,"server_id":15,"link":"photo_4947427.html","width":130,"caption":"Ullswater","height":91});
															thumbnails[4947429] = clik.newPhoto({"id":4947429,"src":"Undecided_British_weather_-_print_copy_thumb.jpg","galleries_id":281375,"server_id":15,"link":"photo_4947429.html","width":130,"caption":"Towards Dawlish from Teignmouth, Devon","height":91});
															thumbnails[5171445] = clik.newPhoto({"id":5171445,"src":"blades-of-glory_thumb.jpg","galleries_id":291995,"server_id":15,"link":"photo_5171445.html","width":87,"caption":"Blades of Glory","height":130});
															thumbnails[5171470] = clik.newPhoto({"id":5171470,"src":"boathouse_thumb.jpg","galleries_id":291995,"server_id":15,"link":"photo_5171470.html","width":130,"caption":"The Boat House, Shibden Park","height":76});
															thumbnails[5171695] = clik.newPhoto({"id":5171695,"src":"enchantedwood_thumb.jpg","galleries_id":291995,"server_id":15,"link":"photo_5171695.html","width":130,"caption":"The Enchanted Wood","height":74});
															thumbnails[5171696] = clik.newPhoto({"id":5171696,"src":"jaffa-port_thumb.jpg","galleries_id":291995,"server_id":15,"link":"photo_5171696.html","width":130,"caption":"The Port of Jaffa","height":83});
															thumbnails[5171697] = clik.newPhoto({"id":5171697,"src":"leavesandtress_thumb.jpg","galleries_id":291995,"server_id":15,"link":"photo_5171697.html","width":88,"caption":"Leaves and Trees","height":130});
															thumbnails[5171701] = clik.newPhoto({"id":5171701,"src":"newdaisy_thumb.jpg","galleries_id":291995,"server_id":15,"link":"photo_5171701.html","width":130,"caption":"A  New Daisy","height":88});
															thumbnails[5171704] = clik.newPhoto({"id":5171704,"src":"piecehall-wide-lower-bw_thumb.jpg","galleries_id":291995,"server_id":15,"link":"photo_5171704.html","width":130,"caption":"The Piece Hall,Halifax","height":85});
															thumbnails[5171710] = clik.newPhoto({"id":5171710,"src":"pollen-hunting_thumb.jpg","galleries_id":291995,"server_id":15,"link":"photo_5171710.html","width":130,"caption":"Pollen Hunting","height":122});
															thumbnails[5171713] = clik.newPhoto({"id":5171713,"src":"thesolitarychurch_thumb.jpg","galleries_id":291995,"server_id":15,"link":"photo_5171713.html","width":87,"caption":"The Solitary Church","height":130});
															thumbnails[5171760] = clik.newPhoto({"id":5171760,"src":"timepiece_thumb.jpg","galleries_id":291995,"server_id":15,"link":"photo_5171760.html","width":130,"caption":"Time Piece","height":90});
															thumbnails[5450676] = clik.newPhoto({"id":5450676,"src":"1Buff-tailed_Bumblebee_PJM_copy_thumb.jpg","galleries_id":281375,"server_id":15,"link":"photo_5450676.html","width":98,"caption":"Buff Tailed Bumblebee","height":130});
															thumbnails[5450684] = clik.newPhoto({"id":5450684,"src":"3Poppy_PJM_copy_thumb.jpg","galleries_id":281375,"server_id":15,"link":"photo_5450684.html","width":130,"caption":"Poppy","height":130});
															thumbnails[5450690] = clik.newPhoto({"id":5450690,"src":"4_What_pictures_can_you_see_PJM_copy_thumb.jpg","galleries_id":281375,"server_id":15,"link":"photo_5450690.html","width":130,"caption":"What Pictures Can You See?","height":94});
															thumbnails[5450697] = clik.newPhoto({"id":5450697,"src":"6_Slipper_Orchid_PJM_copy_thumb.jpg","galleries_id":281375,"server_id":15,"link":"photo_5450697.html","width":130,"caption":"Slipper Orchid","height":120});
															thumbnails[5450783] = clik.newPhoto({"id":5450783,"src":"5_Geum_PJM_copy_thumb.jpg","galleries_id":281375,"server_id":15,"link":"photo_5450783.html","width":93,"caption":"Geum","height":130});
															thumbnails[4114795] = clik.newPhoto({"id":4114795,"src":"Ducklings_thumb.jpg","galleries_id":246616,"server_id":15,"link":"photo_4114795.html","width":130,"caption":"Ducklings ","height":87});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[242044] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Philip Haigh","link":"gallery_242044.html","maxRecords":0.0,"photoIDs":[4115293.0,4115305.0,4115311.0,4116026.0,4116028.0,4119076.0,4120095.0,4121929.0,4199148.0,4217787.0],"skipIndex":0,"section_code":"gallery","featured_images":4199148.0,"id":242044,"singleSection":false});				  						galleries[246616] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Janet Dewhirst","link":"gallery_246616.html","maxRecords":0.0,"photoIDs":[4114807.0,4114822.0,4114832.0,4114842.0,4114852.0,4114866.0,4114890.0,4114795.0],"skipIndex":0,"section_code":"gallery","featured_images":"4114890,4114866,4114852,4114842,4114832,4114822,4114807,4114795","id":246616,"singleSection":false});				  						galleries[249525] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Simon Dixon","link":"gallery_249525.html","maxRecords":0.0,"photoIDs":[4197722.0,4208326.0,4208499.0,4208514.0,4660023.0,4660028.0,4662758.0],"skipIndex":0,"section_code":"gallery","featured_images":"4208326,4197722","id":249525,"singleSection":false});				  						galleries[269397] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Tony Sheeky","link":"gallery_269397.html","maxRecords":0.0,"photoIDs":[4677476.0,4677480.0,4677482.0,4677486.0,4677489.0,4677494.0],"skipIndex":0,"section_code":"gallery","featured_images":"4677494,4677489,4677486,4677482,4677480,4677476","id":269397,"singleSection":false});				  						galleries[273595] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Chris O'Connor","link":"gallery_273595.html","maxRecords":0.0,"photoIDs":[4779042.0,4779043.0,4779044.0,4779045.0,4779046.0],"skipIndex":0,"section_code":"gallery","featured_images":"4779046,4779045,4779044,4779043,4779042","id":273595,"singleSection":false});				  						galleries[279218] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Stephen Gilling","link":"gallery_279218.html","maxRecords":0.0,"photoIDs":[4899090.0,4899095.0,4899097.0,4899099.0,4899101.0,4899104.0,4899106.0,4899112.0,4899115.0,4899117.0],"skipIndex":0,"section_code":"gallery","featured_images":4899099.0,"id":279218,"singleSection":false});				  						galleries[281375] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Patricia Morley","link":"gallery_281375.html","maxRecords":0.0,"photoIDs":[4947391.0,4947427.0,4947429.0,5450676.0,5450684.0,5450690.0,5450697.0,5450783.0],"skipIndex":0,"section_code":"gallery","featured_images":4947391.0,"id":281375,"singleSection":false});				  						galleries[291995] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Craig Johnston ","link":"gallery_291995.html","maxRecords":0.0,"photoIDs":[5171445.0,5171470.0,5171695.0,5171696.0,5171697.0,5171701.0,5171704.0,5171710.0,5171713.0,5171760.0],"skipIndex":0,"section_code":"gallery","featured_images":5171695.0,"id":291995,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '5450697,5450690,5450684,5171760,5171710,5171704,5171701,5171696,5171695,5171470,4947429,4947427,4947391,4899117,4899112,4899101,4899097,4899090,4779046,4779045,4779043,4779042,4217787,4208326,4199148,4121929,4120095,4119076,4116026,4115311,4115305,4115293,4114842,4114832,4114822,4114795';
imageSets[2] = '5171695,4947391,4899099,4208326,4199148,4197722';
imageSets[3] = '5450697,5450690,5450684,5450676,5171760,5171713,5171710,5171704,5171701,5171697,5171696,5171695,5171470,5171445,4947429,4947427,4947391,4899117,4899115,4899112,4899106,4899104,4899101,4899099,4899097,4899095,4899090,4779046,4779045,4779044,4779043,4779042,4677494,4677489,4677486,4677482,4677480,4677476,4662758,4660028,4660023,4217787,4208514,4208499,4208326,4199148,4197722,4121929,4120095,4119076,4116028,4116026,4115311,4115305,4115293,4114890,4114866,4114852,4114842,4114832,4114822,4114807,4091751,4090949,4114795';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/phil99/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/phil99/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/phil99/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/phil99/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/phil99/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/phil99/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/phil99/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/phil99/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/phil99/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/phil99/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/phil99/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/phil99/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/phil99/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/phil99/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/phil99/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/phil99/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/phil99/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/phil99/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/phil99/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/phil99/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/phil99/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/phil99/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/phil99/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/phil99/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/phil99/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/phil99/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/phil99/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 = 'HALIFAX PHOTOGRAPHIC SOCIETY: ' + 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;
	}
}

			

