window.thumbnails = {};
															thumbnails[4304767] = clik.newPhoto({"id":4304767,"src":"cp-legs_thumb.jpg","galleries_id":247012,"server_id":15,"link":"photo_4304767.html","width":92,"caption":"\" Studies \" 2009","height":130});
															thumbnails[4309957] = clik.newPhoto({"id":4309957,"src":"cp-twisted_thumb.jpg","galleries_id":247011,"server_id":15,"link":"photo_4309957.html","width":92,"caption":"stratum 1","height":130});
															thumbnails[4309962] = clik.newPhoto({"id":4309962,"src":"cp-twisty_thumb.jpg","galleries_id":247011,"server_id":15,"link":"photo_4309962.html","width":92,"caption":"stratum 2","height":130});
															thumbnails[4309967] = clik.newPhoto({"id":4309967,"src":"cp-cross-section-white_thumb.jpg","galleries_id":247011,"server_id":15,"link":"photo_4309967.html","width":94,"caption":"stratum 3","height":130});
															thumbnails[4309975] = clik.newPhoto({"id":4309975,"src":"cp-bark_thumb.jpg","galleries_id":247011,"server_id":15,"link":"photo_4309975.html","width":92,"caption":"stratum 4","height":130});
															thumbnails[4309984] = clik.newPhoto({"id":4309984,"src":"cp-kiss_thumb.jpg","galleries_id":247011,"server_id":15,"link":"photo_4309984.html","width":130,"caption":"stratum 5","height":130});
															thumbnails[4310007] = clik.newPhoto({"id":4310007,"src":"cp-cs_thumb.jpg","galleries_id":247011,"server_id":15,"link":"photo_4310007.html","width":130,"caption":"stratum 6","height":130});
															thumbnails[4310760] = clik.newPhoto({"id":4310760,"src":"cp-wood_thumb.jpg","galleries_id":247011,"server_id":15,"link":"photo_4310760.html","width":130,"caption":"stratum 7","height":130});
															thumbnails[4310767] = clik.newPhoto({"id":4310767,"src":"cp-squareish_thumb.jpg","galleries_id":247011,"server_id":15,"link":"photo_4310767.html","width":130,"caption":"stratum 8","height":130});
															thumbnails[4311955] = clik.newPhoto({"id":4311955,"src":"cp-red_thumb.jpg","galleries_id":247011,"server_id":15,"link":"photo_4311955.html","width":130,"caption":"stratum 9","height":92});
															thumbnails[4311959] = clik.newPhoto({"id":4311959,"src":"cp-cross-sec_thumb.jpg","galleries_id":247011,"server_id":15,"link":"photo_4311959.html","width":130,"caption":"stratum 10","height":92});
															thumbnails[4311990] = clik.newPhoto({"id":4311990,"src":"cp-cs-hor_thumb.jpg","galleries_id":247011,"server_id":15,"link":"photo_4311990.html","width":130,"caption":"stratum 11","height":92});
															thumbnails[4312180] = clik.newPhoto({"id":4312180,"src":"cp-cs-red_thumb.jpg","galleries_id":247011,"server_id":15,"link":"photo_4312180.html","width":130,"caption":"stratum 12","height":92});
															thumbnails[4339977] = clik.newPhoto({"id":4339977,"src":"cp-shoe_thumb.jpg","galleries_id":247011,"server_id":15,"link":"photo_4339977.html","width":93,"caption":"'segment' series  2007-2008","height":130});
															thumbnails[4339982] = clik.newPhoto({"id":4339982,"src":"cp-vase_thumb.jpg","galleries_id":247011,"server_id":15,"link":"photo_4339982.html","width":92,"caption":"'segment' series  2007-2008","height":130});
															thumbnails[4340024] = clik.newPhoto({"id":4340024,"src":"cp-vasescan1a_thumb.jpg","galleries_id":247011,"server_id":15,"link":"photo_4340024.html","width":92,"caption":"'segment' series  2007-2008","height":130});
															thumbnails[4340032] = clik.newPhoto({"id":4340032,"src":"vasescan01_thumb.jpg","galleries_id":247011,"server_id":15,"link":"photo_4340032.html","width":92,"caption":"'segment 'series  2007-2008","height":130});
															thumbnails[4687179] = clik.newPhoto({"id":4687179,"src":"mantel-1st_thumb.jpg","galleries_id":247437,"server_id":15,"link":"photo_4687179.html","width":92,"caption":"friday","height":130});
															thumbnails[4687225] = clik.newPhoto({"id":4687225,"src":"cp-mantel22_thumb.jpg","galleries_id":247437,"server_id":15,"link":"photo_4687225.html","width":92,"caption":"saturday","height":130});
															thumbnails[4687234] = clik.newPhoto({"id":4687234,"src":"cp-mantel32_thumb.jpg","galleries_id":247437,"server_id":15,"link":"photo_4687234.html","width":92,"caption":"sunday","height":130});
															thumbnails[4732031] = clik.newPhoto({"id":4732031,"src":"pol-tran-shoes2_thumb.jpg","galleries_id":324208,"server_id":15,"link":"photo_4732031.html","width":101,"caption":"'memory holder' series 2009","height":130});
															thumbnails[4732045] = clik.newPhoto({"id":4732045,"src":"polaroid-lef-lift1_thumb.jpg","galleries_id":324208,"server_id":15,"link":"photo_4732045.html","width":92,"caption":"Ghost Trees  2009","height":130});
															thumbnails[4732048] = clik.newPhoto({"id":4732048,"src":"cp-leaf2_thumb.jpg","galleries_id":324208,"server_id":15,"link":"photo_4732048.html","width":130,"caption":"Witley Court, Worcestershire  2009","height":90});
															thumbnails[4732050] = clik.newPhoto({"id":4732050,"src":"pol-city2a1_thumb.jpg","galleries_id":324208,"server_id":15,"link":"photo_4732050.html","width":130,"caption":"Canary Wharf, London  2009","height":92});
															thumbnails[4732232] = clik.newPhoto({"id":4732232,"src":"cp-pol-sanchez3_thumb.jpg","galleries_id":324208,"server_id":15,"link":"photo_4732232.html","width":130,"caption":"'still-life' in the style of juan sanchez cotan","height":103});
															thumbnails[4732234] = clik.newPhoto({"id":4732234,"src":"cp-book-still-life3_thumb.jpg","galleries_id":324208,"server_id":15,"link":"photo_4732234.html","width":130,"caption":"\"Nanna's A Tale of Two Cites\" 2009","height":103});
															thumbnails[4732249] = clik.newPhoto({"id":4732249,"src":"cp-still-life-3_thumb.jpg","galleries_id":324208,"server_id":15,"link":"photo_4732249.html","width":130,"caption":"'Departed ' 2009","height":103});
															thumbnails[4777866] = clik.newPhoto({"id":4777866,"src":"pol-building_thumb.jpg","galleries_id":324208,"server_id":15,"link":"photo_4777866.html","width":130,"caption":"Canary Wharf,  London  2009","height":118});
															thumbnails[4914129] = clik.newPhoto({"id":4914129,"src":"fluid_thumb.jpg","galleries_id":247011,"server_id":15,"link":"photo_4914129.html","width":94,"caption":"\" Flow \"  2009","height":130});
															thumbnails[4914131] = clik.newPhoto({"id":4914131,"src":"Untitled-10_thumb.jpg","galleries_id":247011,"server_id":15,"link":"photo_4914131.html","width":94,"caption":"\" Flow \"  2009","height":130});
															thumbnails[4964137] = clik.newPhoto({"id":4964137,"src":"telephone1_thumb.jpg","galleries_id":324208,"server_id":15,"link":"photo_4964137.html","width":130,"caption":"","height":129});
															thumbnails[5008942] = clik.newPhoto({"id":5008942,"src":"four_thumb.jpg","galleries_id":247011,"server_id":15,"link":"photo_5008942.html","width":130,"caption":"  ' before '      2008 - 2009","height":92});
															thumbnails[5008984] = clik.newPhoto({"id":5008984,"src":"bars-and-leaves_thumb.jpg","galleries_id":247011,"server_id":15,"link":"photo_5008984.html","width":130,"caption":"'after'    2008 - 2009","height":92});
															thumbnails[5724873] = clik.newPhoto({"id":5724873,"src":"90-polaroidcropsquare_thumb.jpg","galleries_id":324208,"server_id":15,"link":"photo_5724873.html","width":130,"caption":"\"Out\" 2010","height":130});
															thumbnails[5724885] = clik.newPhoto({"id":5724885,"src":"landscape-square_thumb.jpg","galleries_id":324208,"server_id":15,"link":"photo_5724885.html","width":130,"caption":"\"Out\" 2010","height":130});
															thumbnails[5724955] = clik.newPhoto({"id":5724955,"src":"alien-landscapesquare_thumb.jpg","galleries_id":324208,"server_id":15,"link":"photo_5724955.html","width":130,"caption":"'out' 2010","height":129});
															thumbnails[5725001] = clik.newPhoto({"id":5725001,"src":"bare-treesquare_thumb.jpg","galleries_id":324208,"server_id":15,"link":"photo_5725001.html","width":130,"caption":"'out' 2010","height":130});
															thumbnails[5725009] = clik.newPhoto({"id":5725009,"src":"landscape2square_thumb.jpg","galleries_id":324208,"server_id":15,"link":"photo_5725009.html","width":130,"caption":"'out' 2010","height":130});
															thumbnails[5725013] = clik.newPhoto({"id":5725013,"src":"blue-tree-square_thumb.jpg","galleries_id":324208,"server_id":15,"link":"photo_5725013.html","width":130,"caption":"'out' 2010","height":130});
															thumbnails[5729061] = clik.newPhoto({"id":5729061,"src":"vdb-hand-coloured-2cp_thumb.jpg","galleries_id":247012,"server_id":15,"link":"photo_5729061.html","width":92,"caption":"\" Studies \" 2009","height":130});
															thumbnails[5729071] = clik.newPhoto({"id":5729071,"src":"squares-and-stripescp_thumb.jpg","galleries_id":247012,"server_id":15,"link":"photo_5729071.html","width":107,"caption":"\"Studies \" 2009","height":130});
															thumbnails[5729074] = clik.newPhoto({"id":5729074,"src":"stripe-legcp_thumb.jpg","galleries_id":247012,"server_id":15,"link":"photo_5729074.html","width":103,"caption":"\" Studies \" 2009","height":130});
															thumbnails[5731597] = clik.newPhoto({"id":5731597,"src":"stripey-2cp_thumb.jpg","galleries_id":247012,"server_id":15,"link":"photo_5731597.html","width":107,"caption":"\" Studies \" 2009","height":130});
															thumbnails[5731601] = clik.newPhoto({"id":5731601,"src":"legs-and-mac-cp_thumb.jpg","galleries_id":247012,"server_id":15,"link":"photo_5731601.html","width":107,"caption":"\" Studies \" 2009","height":130});
															thumbnails[5731602] = clik.newPhoto({"id":5731602,"src":"hand-col-legscp_thumb.jpg","galleries_id":247012,"server_id":15,"link":"photo_5731602.html","width":88,"caption":"\" Studies \" 2009","height":130});
															thumbnails[5731623] = clik.newPhoto({"id":5731623,"src":"face16_thumb.jpg","galleries_id":400099,"server_id":15,"link":"photo_5731623.html","width":115,"caption":"Tissue Paper Portraits 2010","height":130});
															thumbnails[5731652] = clik.newPhoto({"id":5731652,"src":"face7cp_thumb.jpg","galleries_id":400099,"server_id":15,"link":"photo_5731652.html","width":114,"caption":"Tissue Paper Portraits 2010","height":130});
															thumbnails[5731654] = clik.newPhoto({"id":5731654,"src":"tissuepaper3cropcp_thumb.jpg","galleries_id":400099,"server_id":15,"link":"photo_5731654.html","width":114,"caption":"Tissue Paper Portraits 2010","height":130});
															thumbnails[5731702] = clik.newPhoto({"id":5731702,"src":"rat1feb_thumb.jpg","galleries_id":247437,"server_id":15,"link":"photo_5731702.html","width":130,"caption":"Catkill series 2009","height":86});
															thumbnails[5731708] = clik.newPhoto({"id":5731708,"src":"catkill-2_thumb.jpg","galleries_id":247437,"server_id":15,"link":"photo_5731708.html","width":130,"caption":"Catkill series 2009","height":86});
															thumbnails[5731713] = clik.newPhoto({"id":5731713,"src":"rat-inside2_thumb.jpg","galleries_id":247437,"server_id":15,"link":"photo_5731713.html","width":130,"caption":"Catkill series 2009","height":86});
															thumbnails[5731714] = clik.newPhoto({"id":5731714,"src":"rat-in-grass_thumb.jpg","galleries_id":247437,"server_id":15,"link":"photo_5731714.html","width":130,"caption":"Catkill series 2009","height":86});
															thumbnails[5731715] = clik.newPhoto({"id":5731715,"src":"rat3_thumb.jpg","galleries_id":247437,"server_id":15,"link":"photo_5731715.html","width":130,"caption":"Catkill series 2009","height":86});
															thumbnails[6233333] = clik.newPhoto({"id":6233333,"src":"bigskyweb_thumb.jpg","galleries_id":400089,"server_id":15,"link":"photo_6233333.html","width":130,"caption":"Landscape in Blue  2010","height":130});
															thumbnails[6287161] = clik.newPhoto({"id":6287161,"src":"sky_thumb.jpg","galleries_id":400089,"server_id":15,"link":"photo_6287161.html","width":128,"caption":"Landscape in Blue  2010","height":130});
															thumbnails[6303005] = clik.newPhoto({"id":6303005,"src":"tea-toned-cyano-feet-crop_thumb.jpg","galleries_id":247012,"server_id":15,"link":"photo_6303005.html","width":130,"caption":"\"Growing Up \"  2010  size 6","height":109});
															thumbnails[6303022] = clik.newPhoto({"id":6303022,"src":"luke-feet-feb10_thumb.jpg","galleries_id":247012,"server_id":15,"link":"photo_6303022.html","width":130,"caption":"\"Growing Up \"  2010 ","height":55});
															thumbnails[6305536] = clik.newPhoto({"id":6305536,"src":"2-x-feet_thumb.jpg","galleries_id":247012,"server_id":15,"link":"photo_6305536.html","width":130,"caption":"\"Growing Up \"  2010  Age 12 3\/4","height":53});
															thumbnails[6325873] = clik.newPhoto({"id":6325873,"src":"playstation-toes_thumb.jpg","galleries_id":247012,"server_id":15,"link":"photo_6325873.html","width":130,"caption":"\"Growing Up \"  2010  Playstation Toes","height":54});
															thumbnails[6353764] = clik.newPhoto({"id":6353764,"src":"the-birthday-party_thumb.jpg","galleries_id":247437,"server_id":15,"link":"photo_6353764.html","width":105,"caption":"\"The Birthday Party - Waiting\" 2009","height":130});
															thumbnails[6353842] = clik.newPhoto({"id":6353842,"src":"the-birthday-party-waiting_thumb.jpg","galleries_id":247437,"server_id":15,"link":"photo_6353842.html","width":105,"caption":"\"The Birthday Party - Waiting\" 2009","height":130});
															thumbnails[6353855] = clik.newPhoto({"id":6353855,"src":"the-birthday-party--waiting_thumb.jpg","galleries_id":247437,"server_id":15,"link":"photo_6353855.html","width":103,"caption":"\"The Birthday Party - Waiting\" 2009","height":130});
															thumbnails[6354583] = clik.newPhoto({"id":6354583,"src":"the-b-day-party-chair_thumb.jpg","galleries_id":247437,"server_id":15,"link":"photo_6354583.html","width":104,"caption":"\"The Birthday Party - Waiting\" 2009","height":130});
															thumbnails[6862272] = clik.newPhoto({"id":6862272,"src":"chaos_thumb.jpg","galleries_id":324208,"server_id":15,"link":"photo_6862272.html","width":99,"caption":"'Chaos' 2010","height":130});
															thumbnails[6862285] = clik.newPhoto({"id":6862285,"src":"chaos-os_thumb.jpg","galleries_id":324208,"server_id":15,"link":"photo_6862285.html","width":130,"caption":"'Chaos' 2010","height":99});
															thumbnails[6862287] = clik.newPhoto({"id":6862287,"src":"chaos2-os_thumb.jpg","galleries_id":324208,"server_id":15,"link":"photo_6862287.html","width":130,"caption":"'Chaos' 2010","height":100});
															thumbnails[7390525] = clik.newPhoto({"id":7390525,"src":"sh-treeslight_thumb.jpg","galleries_id":400089,"server_id":15,"link":"photo_7390525.html","width":130,"caption":"Landscape in Blue  2010","height":112});
															thumbnails[7390526] = clik.newPhoto({"id":7390526,"src":"sp2_thumb.jpg","galleries_id":400089,"server_id":15,"link":"photo_7390526.html","width":130,"caption":"Landscape in Blue  2010","height":123});
															thumbnails[7390533] = clik.newPhoto({"id":7390533,"src":"swansland2_thumb.jpg","galleries_id":400089,"server_id":15,"link":"photo_7390533.html","width":128,"caption":"Landscape in Blue  2010","height":130});
															thumbnails[7390546] = clik.newPhoto({"id":7390546,"src":"tpaper-portraits_thumb.jpg","galleries_id":400099,"server_id":15,"link":"photo_7390546.html","width":94,"caption":"Tissue Paper Portraits 2010","height":130});
															thumbnails[7390547] = clik.newPhoto({"id":7390547,"src":"LPE-2010_thumb.jpg","galleries_id":400099,"server_id":15,"link":"photo_7390547.html","width":130,"caption":"Tissue Paper Portraits 2010","height":129});
															thumbnails[7398563] = clik.newPhoto({"id":7398563,"src":"millennium-point2_thumb.jpg","galleries_id":398135,"server_id":15,"link":"photo_7398563.html","width":130,"caption":"Blueprint Birmingham 2010","height":92});
															thumbnails[7398568] = clik.newPhoto({"id":7398568,"src":"woodmans-pub2_thumb.jpg","galleries_id":398135,"server_id":15,"link":"photo_7398568.html","width":130,"caption":"Blueprint Birmingham 2010","height":95});
															thumbnails[7398782] = clik.newPhoto({"id":7398782,"src":"car-park-towards-millennium-p2_thumb.jpg","galleries_id":398135,"server_id":15,"link":"photo_7398782.html","width":130,"caption":"Blueprint Birmingham 2010","height":92});
															thumbnails[7398783] = clik.newPhoto({"id":7398783,"src":"untitled2a_thumb.jpg","galleries_id":398135,"server_id":15,"link":"photo_7398783.html","width":130,"caption":"Blueprint Birmingham 2010","height":92});
															thumbnails[7398786] = clik.newPhoto({"id":7398786,"src":"belmont-works2_thumb.jpg","galleries_id":398135,"server_id":15,"link":"photo_7398786.html","width":130,"caption":"Blueprint Birmingham 2010","height":92});
															thumbnails[7398787] = clik.newPhoto({"id":7398787,"src":"lock-keepers-cottage2_thumb.jpg","galleries_id":398135,"server_id":15,"link":"photo_7398787.html","width":130,"caption":"Blueprint Birmingham 2010","height":92});
															thumbnails[7398794] = clik.newPhoto({"id":7398794,"src":"view-of-moby-dicks-and-belmont2_thumb.jpg","galleries_id":398135,"server_id":15,"link":"photo_7398794.html","width":130,"caption":"Blueprint Birmingham 2010","height":92});
															thumbnails[7398803] = clik.newPhoto({"id":7398803,"src":"untitled1_thumb.jpg","galleries_id":398135,"server_id":15,"link":"photo_7398803.html","width":130,"caption":"Blueprint Birmingham 2010","height":92});
															thumbnails[7420051] = clik.newPhoto({"id":7420051,"src":"curzon-street-station_thumb.jpg","galleries_id":398135,"server_id":15,"link":"photo_7420051.html","width":130,"caption":"Blueprint Birmingham 2010","height":83});
															thumbnails[7420053] = clik.newPhoto({"id":7420053,"src":"block-I-and--m_thumb.jpg","galleries_id":398135,"server_id":15,"link":"photo_7420053.html","width":130,"caption":"Blueprint Birmingham 2010","height":86});
															thumbnails[7504814] = clik.newPhoto({"id":7504814,"src":"reflection_thumb.jpg","galleries_id":400089,"server_id":15,"link":"photo_7504814.html","width":84,"caption":"Landscape in Blue  2010","height":130});
															thumbnails[7542954] = clik.newPhoto({"id":7542954,"src":"goth-2other-side1_thumb.jpg","galleries_id":400099,"server_id":15,"link":"photo_7542954.html","width":94,"caption":"Tissue Paper Portraits 2010","height":130});
															thumbnails[7542956] = clik.newPhoto({"id":7542956,"src":"me-tp_thumb.jpg","galleries_id":400099,"server_id":15,"link":"photo_7542956.html","width":78,"caption":"Tissue Paper Portraits 2010","height":130});
															thumbnails[7544383] = clik.newPhoto({"id":7544383,"src":"reflections-wales-_thumb.jpg","galleries_id":400089,"server_id":15,"link":"photo_7544383.html","width":84,"caption":"Landscape in Blue  2010","height":130});
															thumbnails[7607673] = clik.newPhoto({"id":7607673,"src":"sue_thumb.jpg","galleries_id":400099,"server_id":15,"link":"photo_7607673.html","width":93,"caption":"Tissue Paper Portraits 2010","height":130});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[398135] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Blueprint  Birmingham","link":"gallery_398135.html","maxRecords":0.0,"photoIDs":[7398563.0,7398568.0,7398782.0,7398783.0,7398786.0,7398787.0,7398794.0,7398803.0,7420051.0,7420053.0],"skipIndex":0,"section_code":"gallery","featured_images":7398563.0,"id":398135,"singleSection":false});				  						galleries[400089] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"landscape in blue","link":"gallery_400089.html","maxRecords":0.0,"photoIDs":[6233333.0,6287161.0,7390525.0,7390526.0,7390533.0,7504814.0,7544383.0],"skipIndex":0,"section_code":"gallery","featured_images":6233333.0,"id":400089,"singleSection":false});				  						galleries[400099] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Tissue Paper Portraits","link":"gallery_400099.html","maxRecords":0.0,"photoIDs":[5731623.0,5731652.0,5731654.0,7390546.0,7390547.0,7542954.0,7542956.0,7607673.0],"skipIndex":0,"section_code":"gallery","featured_images":5731623.0,"id":400099,"singleSection":false});				  						galleries[247437] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"series","link":"gallery_247437.html","maxRecords":0.0,"photoIDs":[4687179.0,4687225.0,4687234.0,5731702.0,5731708.0,5731713.0,5731714.0,5731715.0,6353764.0,6353842.0,6353855.0,6354583.0],"skipIndex":0,"section_code":"gallery","featured_images":6353764.0,"id":247437,"singleSection":false});				  						galleries[247011] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"scannergrams","link":"gallery_247011.html","maxRecords":0.0,"photoIDs":[4309957.0,4309962.0,4309967.0,4309975.0,4309984.0,4310007.0,4310760.0,4310767.0,4311955.0,4311959.0,4311990.0,4312180.0,4339977.0,4339982.0,4340024.0,4340032.0,4914129.0,4914131.0,5008942.0,5008984.0],"skipIndex":0,"section_code":"gallery","featured_images":4310760.0,"id":247011,"singleSection":false});				  						galleries[247012] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"alternative processes","link":"gallery_247012.html","maxRecords":0.0,"photoIDs":[4304767.0,5729061.0,5729071.0,5729074.0,5731597.0,5731601.0,5731602.0,6303005.0,6303022.0,6305536.0,6325873.0],"skipIndex":0,"section_code":"gallery","featured_images":5729071.0,"id":247012,"singleSection":false});				  						galleries[324208] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"polaroid","link":"gallery_324208.html","maxRecords":0.0,"photoIDs":[4732031.0,4732045.0,4732048.0,4732050.0,4732232.0,4732234.0,4732249.0,4777866.0,4964137.0,5724873.0,5724885.0,5724955.0,5725001.0,5725009.0,5725013.0,6862272.0,6862285.0,6862287.0],"skipIndex":0,"section_code":"gallery","featured_images":5725001.0,"id":324208,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '4311959,4310767';
imageSets[2] = '7398563,6353764,6233333,5731623,5729071,5725001,4310760';
imageSets[3] = '5725013';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/sianaldridge/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/sianaldridge/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/sianaldridge/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/sianaldridge/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/sianaldridge/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/sianaldridge/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/sianaldridge/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/sianaldridge/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/sianaldridge/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/sianaldridge/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/sianaldridge/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/sianaldridge/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/sianaldridge/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/sianaldridge/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/sianaldridge/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/sianaldridge/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/sianaldridge/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/sianaldridge/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/sianaldridge/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/sianaldridge/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/sianaldridge/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/sianaldridge/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/sianaldridge/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/sianaldridge/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/sianaldridge/images';
		break;
	}
		return val;
}

/***************************************************************************
* img = reference to image object in which to show image                   *
***************************************************************************/
function showHomeImage(img) {
	imageID = randomListVal('');
	if (!basic) {
		img.src = photos[imageID].src;
		img.width = photos[imageID].width;
		img.height = photos[imageID].height;
		img.parentNode.title = img.alt = photos[imageID].caption;
	} else {
		newImage = new Image(photos[imageID].width,photos[imageID].height);
		newImage.src = photos[imageID].src;
		document.images[img.name] = newImage;
		
	}
}

function getHomeImageLink(imageID) {
  	var href='', photo = backgrounds && backgrounds[imageID];
	if(photo){
		if (photo && photo.galleries_id != '') {
  			href = photo.fnGalleryLink();
  		}
  		  		else {
  				href += 'gallery.html';
  	  		}
	}
    return href;
}

/***************************************************************************
* Show a random image on home page from featured images                    *
***************************************************************************/
function showHomeImageInline(el, image_sets_id, href) {
	
	var css = {}, imageID,
	    imageSetsId = 1;
	if(image_sets_id){
		imageSetsId = image_sets_id;
	}
	imageID = randomListVal(imageSets[imageSetsId]);
	if (href == null && 'gallery' != '') {
					href = getHomeImageLink(imageID);
	}
	
	updateImage({nextPhoto: backgrounds[imageID], img:el.find('img')[0],
                $photo:el, $title:$('#homeimageTitleContainer'), $detail:$('#homeimageDetailsContainer'),                speed:0, href:href, css:css, onAfter: function(){                  this.closest('.contentsection').doManualAlign({				    inner: 'img',				    crop: 'a'				  });                }              });
}

/***************************************************************************
* Set 'img' to be a new image given its photo() object                     *
***************************************************************************/
function updateImage (options) {
	var defaults = {nextPhoto:'',field:'',img:'',$photo:'',$title:'',$detail:'',$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 = 'Siān Aldridge 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> &pound;' + (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.payment_groups_id !== '') {
		temp += '<p>Buy this print online:</p>';
				temp += '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
											temp += '<select class="paymentlink" name="payment_options_id" onchange="updateItemValues($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
		
		temp += getPaymentOptions(this.payment_groups_id);
		temp += '</select>';
		temp += '</form>';
				var item_option  = paymentGroups[this.payment_groups_id].options[0];
		if(paymentOptions[item_option]){
			var item_name  = paymentOptions[item_option].payment_option;
			var amount =  paymentOptions[item_option].price;
		}
			}
	else {
		
	}
	if (this.item_price !== '' || this.payment_groups_id !== '') {
																		temp += '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
			temp += '<input type="hidden" name="item_name" value="'+item_name+'">';
			ref = '';
			if(this.photo_ref != ''){
				ref = this.photo_ref+' - '+this.caption;
			}
			else{
				ref = this.id+' - '+this.caption;
			}
			price = amount;								temp += '<input type="hidden" name="cmd" value="_cart">';
					temp += '<input type="hidden" name="business" value="sianaldridge@blueyonder.co.uk">';
					temp += '<input type="hidden" name="currency_code" value="GBP">';
					temp += '<input type="hidden" name="add" value="1">';
													temp += '<input type="hidden" name="amount" value="'+amount+'">';
					temp += '<input type="hidden" name="item_number" value="'+ref+'">';
													temp += '<input type=\"Submit\" value=\"Add to cart\" id=\"paymentAddButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
										temp += '</form>';
										temp += '<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
				temp += '<input type="hidden" name="cmd" value="_cart">';
				temp += '<input type="hidden" name="business" value="sianaldridge@blueyonder.co.uk">';
				temp += '<input type="hidden" name="display" value="1">';
				temp += '<input type=\"Submit\" value=\"View cart\" id=\"paymentViewButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
				temp += '</form>';
						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;
	}
}

			

