window.thumbnails = {};
															thumbnails[179048] = clik.newPhoto({"id":179048,"src":"portrait_light_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"'What?'","height":155});
															thumbnails[179067] = clik.newPhoto({"id":179067,"src":"mannequin 007_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Solitude and space","height":130});
															thumbnails[179077] = clik.newPhoto({"id":179077,"src":"La Pierre Percee sml_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"'La Pierre Percée' (pierced rock)","height":160});
															thumbnails[190183] = clik.newPhoto({"id":190183,"src":"mannequin 013_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Waiting","height":195});
															thumbnails[222642] = clik.newPhoto({"id":222642,"src":"thoughtssml_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Decision","height":98});
															thumbnails[335994] = clik.newPhoto({"id":335994,"src":"mannequin 005_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Harvest - belledonne mountains","height":160});
															thumbnails[372257] = clik.newPhoto({"id":372257,"src":"painting 001_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Centre ville, Bourg D'Oisans","height":130});
															thumbnails[372263] = clik.newPhoto({"id":372263,"src":"painting 002_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Bourg D'Oisans cemetary and the Belledonne","height":173});
															thumbnails[416485] = clik.newPhoto({"id":416485,"src":"painting 0011_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"L'eglise de ferréol, Huez","height":160});
															thumbnails[542802] = clik.newPhoto({"id":542802,"src":"belledonne snow_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Belledonne mountains, Les Sables","height":104});
															thumbnails[737056] = clik.newPhoto({"id":737056,"src":"ps revised_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Time-piece","height":195});
															thumbnails[916533] = clik.newPhoto({"id":916533,"src":"dethick churchSML_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Dethick church - dated 14th century","height":130});
															thumbnails[1051328] = clik.newPhoto({"id":1051328,"src":"sycamore small 2_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Small tree study (with Eastwood church on the horizon)","height":163});
															thumbnails[1224438] = clik.newPhoto({"id":1224438,"src":"eglise st theoffrey_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"morning calm","height":247});
															thumbnails[1249982] = clik.newPhoto({"id":1249982,"src":"eglise st theoffrey 3sml_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"eglise, afternoon light","height":157});
															thumbnails[1484995] = clik.newPhoto({"id":1484995,"src":"rmsmall_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"'Rosemary McKie'","height":130});
															thumbnails[1697873] = clik.newPhoto({"id":1697873,"src":"zara complete_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"'Zara'","height":186});
															thumbnails[1818657] = clik.newPhoto({"id":1818657,"src":"genevieve_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Genevieve","height":173});
															thumbnails[2185464] = clik.newPhoto({"id":2185464,"src":"Untitled-1_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Oscar","height":173});
															thumbnails[2239341] = clik.newPhoto({"id":2239341,"src":"rosiesml_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Rosie","height":173});
															thumbnails[2363231] = clik.newPhoto({"id":2363231,"src":"hugosml_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Hugo","height":173});
															thumbnails[2673646] = clik.newPhoto({"id":2673646,"src":"tomsml1_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Tom","height":173});
															thumbnails[2883810] = clik.newPhoto({"id":2883810,"src":"sp9_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"number nine","height":130});
															thumbnails[2911073] = clik.newPhoto({"id":2911073,"src":"sp15_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"number fifteen","height":130});
															thumbnails[3167910] = clik.newPhoto({"id":3167910,"src":"pestle mortarsml_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Brass and wood","height":156});
															thumbnails[3219111] = clik.newPhoto({"id":3219111,"src":"pewtersmler_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Norwegian pewter","height":156});
															thumbnails[3319348] = clik.newPhoto({"id":3319348,"src":"selfportrait jan 2009sml_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"will-power","height":197});
															thumbnails[3326101] = clik.newPhoto({"id":3326101,"src":"china teasml_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"China tea","height":89});
															thumbnails[3326112] = clik.newPhoto({"id":3326112,"src":"begining of beginingsml_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Standing, looking down","height":190});
															thumbnails[3431288] = clik.newPhoto({"id":3431288,"src":"lavalamp daylightsml1_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"lava lamp","height":160});
															thumbnails[3528208] = clik.newPhoto({"id":3528208,"src":"the mask1sml_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"The Mask","height":188});
															thumbnails[3612268] = clik.newPhoto({"id":3612268,"src":"flash8_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Old selfportrait, 2003","height":169});
															thumbnails[3612282] = clik.newPhoto({"id":3612282,"src":"a_thought_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Thought, 2003","height":98});
															thumbnails[3612291] = clik.newPhoto({"id":3612291,"src":"wolf_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Wolf","height":104});
															thumbnails[3612296] = clik.newPhoto({"id":3612296,"src":"born1960died2007sml_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"'1960-2007'","height":109});
															thumbnails[3612362] = clik.newPhoto({"id":3612362,"src":"villard_notre_damesml_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Villard Notre Dame","height":160});
															thumbnails[3612376] = clik.newPhoto({"id":3612376,"src":"l_eglise_des_sablessml_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"L'eglise les sables","height":160});
															thumbnails[3612438] = clik.newPhoto({"id":3612438,"src":"tete_de_chiensml_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Early french landscape 'tete de chien'","height":260});
															thumbnails[3612448] = clik.newPhoto({"id":3612448,"src":"eastwoodsml_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Eastwood \/ Oaktree","height":104});
															thumbnails[3612450] = clik.newPhoto({"id":3612450,"src":"treesml_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Sycamore tree nr Heanor","height":142});
															thumbnails[3612476] = clik.newPhoto({"id":3612476,"src":"photo_003_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"On campaign","height":128});
															thumbnails[3612480] = clik.newPhoto({"id":3612480,"src":"photo_009sml_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"reflection","height":130});
															thumbnails[3613181] = clik.newPhoto({"id":3613181,"src":"selfportrait2008bsml_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"2 days","height":156});
															thumbnails[3613225] = clik.newPhoto({"id":3613225,"src":"journey1_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"View from the A6","height":84});
															thumbnails[3613238] = clik.newPhoto({"id":3613238,"src":"d_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Dream, 2004","height":169});
															thumbnails[3613241] = clik.newPhoto({"id":3613241,"src":"e_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Protection, 2005","height":190});
															thumbnails[3613249] = clik.newPhoto({"id":3613249,"src":"chairlamp_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Chair and lamp, Manchester","height":183});
															thumbnails[4319601] = clik.newPhoto({"id":4319601,"src":"still-life_double-portrait_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Still-life 'Derek and Patricia'","height":93});
															thumbnails[4319670] = clik.newPhoto({"id":4319670,"src":"algrave_oil-sketch_sml_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Algrave Hall, Summer day","height":110});
															thumbnails[4550147] = clik.newPhoto({"id":4550147,"src":"shavesml_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Sink","height":104});
															thumbnails[4556824] = clik.newPhoto({"id":4556824,"src":"kitchengardensml_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"kitchen garden, ","height":162});
															thumbnails[4556834] = clik.newPhoto({"id":4556834,"src":"dyptichsml_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"View overlooking Eastwood, Derbyshire","height":50});
															thumbnails[4700855] = clik.newPhoto({"id":4700855,"src":"impression_skull_2sml_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Impression skull 2","height":157});
															thumbnails[5054998] = clik.newPhoto({"id":5054998,"src":"jean_matayac_sml_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Jean Matayac","height":157});
															thumbnails[5222592] = clik.newPhoto({"id":5222592,"src":"oil_painting_guide-1_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Oil painting Guide - Project 1 'Still-life'","height":189});
															thumbnails[5222869] = clik.newPhoto({"id":5222869,"src":"elvis_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"'Elvis' - Part of a large tryptic commission","height":260});
															thumbnails[5222922] = clik.newPhoto({"id":5222922,"src":"mansun_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"'Marilyn Mansun' - part of a large tryptic commission","height":260});
															thumbnails[5222935] = clik.newPhoto({"id":5222935,"src":"slash_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"'Slash' - part of a large tryptic commission","height":260});
															thumbnails[5266040] = clik.newPhoto({"id":5266040,"src":"hermestheorangesml_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Hermes of orange","height":156});
															thumbnails[5909223] = clik.newPhoto({"id":5909223,"src":"selfportrait_may_2010sml_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Conte on paper","height":184});
															thumbnails[5915542] = clik.newPhoto({"id":5915542,"src":"selfportrait_may_2010_number3sml_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Conte on paper","height":156});
															thumbnails[5919547] = clik.newPhoto({"id":5919547,"src":"l_eglise_pierre_chatel_2sml_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Church Light","height":195});
															thumbnails[5946412] = clik.newPhoto({"id":5946412,"src":"selfportrait_may_2010_number4sml_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Conte on paper","height":183});
															thumbnails[6982813] = clik.newPhoto({"id":6982813,"src":"robin_ap_0809_sml_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Self portrait August '09","height":170});
															thumbnails[6982826] = clik.newPhoto({"id":6982826,"src":"aristoslash_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Aristoslash, 2007","height":65});
															thumbnails[6982866] = clik.newPhoto({"id":6982866,"src":"sarahsmales_sml_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Sarah","height":195});
															thumbnails[3080506] = clik.newPhoto({"id":3080506,"src":"sitesize2sml_thumb.jpg","galleries_id":328234,"server_id":1,"link":"photo_3080506.html","width":130,"caption":"New York Skull","height":201});
															thumbnails[6974352] = clik.newPhoto({"id":6974352,"src":"IMG_1483_thumb.jpg","galleries_id":328234,"server_id":1,"link":"photo_6974352.html","width":130,"caption":"Cast drawing 'St Gerome'","height":173});
															thumbnails[6974353] = clik.newPhoto({"id":6974353,"src":"dan_the_poet_thumb.jpg","galleries_id":328234,"server_id":1,"link":"photo_6974353.html","width":130,"caption":"Dan - 'the poet'","height":173});
															thumbnails[6974355] = clik.newPhoto({"id":6974355,"src":"IMG_1474_thumb.jpg","galleries_id":328234,"server_id":1,"link":"photo_6974355.html","width":130,"caption":"Georgia","height":173});
															thumbnails[6974356] = clik.newPhoto({"id":6974356,"src":"IMG_1485_thumb.jpg","galleries_id":328234,"server_id":1,"link":"photo_6974356.html","width":130,"caption":"Rosie","height":173});
															thumbnails[6984087] = clik.newPhoto({"id":6984087,"src":"hermes_cast_2010sml_thumb.jpg","galleries_id":328234,"server_id":1,"link":"photo_6984087.html","width":130,"caption":"Hermes Cast drawing","height":172});
															thumbnails[7129404] = clik.newPhoto({"id":7129404,"src":"Charcoal_immortalised1sml_thumb.jpg","galleries_id":328234,"server_id":1,"link":"photo_7129404.html","width":130,"caption":"Decision2","height":173});
															thumbnails[7200762] = clik.newPhoto({"id":7200762,"src":"charcoal_SP_dec2010sml_thumb.JPG","galleries_id":328234,"server_id":1,"link":"photo_7200762.html","width":130,"caption":"Stare crisis","height":168});
															thumbnails[7203010] = clik.newPhoto({"id":7203010,"src":"Charcoal_David1sml_thumb.jpg","galleries_id":328234,"server_id":1,"link":"photo_7203010.html","width":130,"caption":"David","height":161});
															thumbnails[7294929] = clik.newPhoto({"id":7294929,"src":"Charcoal_Jean1sml_thumb.jpg","galleries_id":328234,"server_id":1,"link":"photo_7294929.html","width":130,"caption":"Jean","height":165});
															thumbnails[7408561] = clik.newPhoto({"id":7408561,"src":"Charcoal_Manonsml_thumb.jpg","galleries_id":328234,"server_id":1,"link":"photo_7408561.html","width":130,"caption":"Manon","height":173});
															thumbnails[7455878] = clik.newPhoto({"id":7455878,"src":"Charcoal_Patricia_oldersml_thumb.jpg","galleries_id":328234,"server_id":1,"link":"photo_7455878.html","width":130,"caption":"Patricia","height":165});
															thumbnails[7455887] = clik.newPhoto({"id":7455887,"src":"Charcoal_Yaellesml_thumb.JPG","galleries_id":328234,"server_id":1,"link":"photo_7455887.html","width":130,"caption":"Yaelle","height":172});
															thumbnails[7512157] = clik.newPhoto({"id":7512157,"src":"Charcoal_Cesarsml_thumb.jpg","galleries_id":328234,"server_id":1,"link":"photo_7512157.html","width":130,"caption":"Cesar","height":164});
															thumbnails[7617442] = clik.newPhoto({"id":7617442,"src":"Charcoal_Christophesml_thumb.jpg","galleries_id":328234,"server_id":1,"link":"photo_7617442.html","width":130,"caption":"Christophe","height":158});
															thumbnails[7806495] = clik.newPhoto({"id":7806495,"src":"Charcoal_Karine_sml_thumb.jpg","galleries_id":328234,"server_id":1,"link":"photo_7806495.html","width":130,"caption":"Karine","height":173});
															thumbnails[7982677] = clik.newPhoto({"id":7982677,"src":"Charcoal_Karine2sml_thumb.jpg","galleries_id":328234,"server_id":1,"link":"photo_7982677.html","width":130,"caption":"Karine","height":173});
															thumbnails[8067887] = clik.newPhoto({"id":8067887,"src":"Charcoal_Loicsml_thumb.jpg","galleries_id":328234,"server_id":1,"link":"photo_8067887.html","width":130,"caption":"Loic","height":174});
															thumbnails[8140430] = clik.newPhoto({"id":8140430,"src":"Charcoal_Arianasml_thumb.jpg","galleries_id":328234,"server_id":1,"link":"photo_8140430.html","width":130,"caption":"Ariana","height":160});
															thumbnails[8273273] = clik.newPhoto({"id":8273273,"src":"Charcoal_SP1b_thumb.jpg","galleries_id":328234,"server_id":1,"link":"photo_8273273.html","width":130,"caption":"Inbetween","height":163});
															thumbnails[8292973] = clik.newPhoto({"id":8292973,"src":"Charcoal_Yaelle2_thumb.jpg","galleries_id":328234,"server_id":1,"link":"photo_8292973.html","width":130,"caption":"Yaelle","height":170});
															thumbnails[8292976] = clik.newPhoto({"id":8292976,"src":"Charcoal_Guillaume_thumb.jpg","galleries_id":328234,"server_id":1,"link":"photo_8292976.html","width":130,"caption":"Guillaume","height":166});
															thumbnails[8378252] = clik.newPhoto({"id":8378252,"src":"Charcoal_kelseysml_thumb.jpg","galleries_id":328234,"server_id":1,"link":"photo_8378252.html","width":130,"caption":"Kelsie","height":170});
															thumbnails[8525010] = clik.newPhoto({"id":8525010,"src":"Charcoal_Cyril_thumb.jpg","galleries_id":328234,"server_id":1,"link":"photo_8525010.html","width":130,"caption":"Cyril","height":173});
															thumbnails[8525024] = clik.newPhoto({"id":8525024,"src":"Charcoal_Gold_thumb.jpg","galleries_id":328234,"server_id":1,"link":"photo_8525024.html","width":130,"caption":"'Gold'","height":173});
															thumbnails[5596169] = clik.newPhoto({"id":5596169,"src":"preston_montford_gates_sml_thumb.jpg","galleries_id":294574,"server_id":1,"link":"photo_5596169.html","width":130,"caption":"Preston Montford","height":104});
															thumbnails[5596171] = clik.newPhoto({"id":5596171,"src":"preston_montford_farmersfield_sml_thumb.jpg","galleries_id":294574,"server_id":1,"link":"photo_5596171.html","width":130,"caption":"Preston Montford, September field.","height":104});
															thumbnails[5596173] = clik.newPhoto({"id":5596173,"src":"preston_montford_farmersfield2_sml_thumb.jpg","galleries_id":294574,"server_id":1,"link":"photo_5596173.html","width":130,"caption":"Preston Montford, September field, dusk.","height":98});
															thumbnails[5596175] = clik.newPhoto({"id":5596175,"src":"field_trip_thumb.jpg","galleries_id":294574,"server_id":1,"link":"photo_5596175.html","width":130,"caption":"Painting, Preston Montford","height":88});
															thumbnails[5596182] = clik.newPhoto({"id":5596182,"src":"guide1_thumb.jpg","galleries_id":294574,"server_id":1,"link":"photo_5596182.html","width":130,"caption":"Beginners Guide 'Painting in Oils'","height":141});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[294574] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Weekend workshops","link":"section352389.html","maxRecords":0.0,"photoIDs":[5596169.0,5596171.0,5596173.0,5596175.0,5596182.0],"skipIndex":0,"section_code":"section352389","featured_images":"5596182,5596175,5596173,5596171,5596169","id":294574,"singleSection":true});				  						galleries[328234] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Charcoal drawing","link":"gallery.html","maxRecords":0.0,"photoIDs":[3080506.0,6974352.0,6974353.0,6974355.0,6974356.0,6984087.0,7129404.0,7200762.0,7203010.0,7294929.0,7408561.0,7455878.0,7455887.0,7512157.0,7617442.0,7806495.0,7982677.0,8067887.0,8140430.0,8273273.0,8292973.0,8292976.0,8378252.0,8525010.0,8525024.0],"skipIndex":0,"section_code":"gallery","featured_images":"8525024,8525010,8292976,8292973,8273273,8067887,7408561,7294929,6974353,6974352","id":328234,"singleSection":true});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8525024,8525010,8292976,8292973,8273273,8067887,7408561,7294929,6974353,6974352,3528208,3326112,3080506';
imageSets[2] = '8525024,8525010,8292976,8292973,8273273,8067887,7408561,7294929,6974353,6974352,737056';
imageSets[3] = '5266040,4700855';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/robinperko/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/robinperko/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/robinperko/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/robinperko/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/robinperko/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/robinperko/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/robinperko/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/robinperko/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/robinperko/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/robinperko/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/robinperko/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/robinperko/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/robinperko/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/robinperko/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/robinperko/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/robinperko/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/robinperko/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/robinperko/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/robinperko/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/robinperko/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/robinperko/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/robinperko/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/robinperko/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/robinperko/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/robinperko/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/robinperko/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/robinperko/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 = 'robinperko.com: ' + 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>';
	}
				
	temp += this.fnGetPaymentInfo();
				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>Buy now using PayPal:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> &euro;' + (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="rmperko@hotmail.com">';
					temp += '<input type="hidden" name="currency_code" value="EUR">';
					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="rmperko@hotmail.com">';
				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;
	}
}

			

