window.thumbnails = {};
															thumbnails[1394953] = clik.newPhoto({"id":1394953,"src":"Landscape2_thumb.jpg","galleries_id":392845,"server_id":18,"link":"photo_1394953.html","width":130,"caption":"","height":98});
															thumbnails[1395107] = clik.newPhoto({"id":1395107,"src":"Landcsape3_thumb.jpg","galleries_id":392845,"server_id":18,"link":"photo_1395107.html","width":130,"caption":"","height":100});
															thumbnails[4828331] = clik.newPhoto({"id":4828331,"src":"Butterflies_09_010_thumb.jpg","galleries_id":303724,"server_id":18,"link":"photo_4828331.html","width":130,"caption":"Jane Griffiths-Jones Studio's  ","height":87});
															thumbnails[4828455] = clik.newPhoto({"id":4828455,"src":"Butterflies_09_355_thumb.jpg","galleries_id":375401,"server_id":18,"link":"photo_4828455.html","width":130,"caption":"","height":87});
															thumbnails[5383497] = clik.newPhoto({"id":5383497,"src":"art_students_2010_lydia_thumb.jpg","galleries_id":303724,"server_id":18,"link":"photo_5383497.html","width":130,"caption":"Lydia Kate Griffiths age 14yrs","height":127});
															thumbnails[5383509] = clik.newPhoto({"id":5383509,"src":"art_students_work_cara_cat_thumb.jpg","galleries_id":303724,"server_id":18,"link":"photo_5383509.html","width":130,"caption":"Cara Elizabeth Davies age 15yrs","height":155});
															thumbnails[5383567] = clik.newPhoto({"id":5383567,"src":"art_students_work_MENAI_thumb.jpg","galleries_id":303724,"server_id":18,"link":"photo_5383567.html","width":130,"caption":"Menai Parry age 14yrs","height":85});
															thumbnails[5388298] = clik.newPhoto({"id":5388298,"src":"RED_STRIPY_WELLIES_thumb.jpg","galleries_id":375401,"server_id":18,"link":"photo_5388298.html","width":130,"caption":"","height":150});
															thumbnails[6374451] = clik.newPhoto({"id":6374451,"src":"STUDENT_PHOTO_thumb.jpg","galleries_id":366097,"server_id":18,"link":"photo_6374451.html","width":130,"caption":"","height":87});
															thumbnails[6555199] = clik.newPhoto({"id":6555199,"src":"Curious_Cat_1_thumb.jpg","galleries_id":367519,"server_id":18,"link":"photo_6555199.html","width":130,"caption":"","height":93});
															thumbnails[6688400] = clik.newPhoto({"id":6688400,"src":"paint_brush_376_thumb.jpg","galleries_id":303724,"server_id":18,"link":"photo_6688400.html","width":130,"caption":"","height":87});
															thumbnails[6688407] = clik.newPhoto({"id":6688407,"src":"Gwil_Bril_clik_thumb.jpg","galleries_id":367519,"server_id":18,"link":"photo_6688407.html","width":130,"caption":"","height":194});
															thumbnails[6688411] = clik.newPhoto({"id":6688411,"src":"a_journey_around_my_studio_flowers_076_thumb.jpg","galleries_id":303724,"server_id":18,"link":"photo_6688411.html","width":130,"caption":"","height":87});
															thumbnails[6707359] = clik.newPhoto({"id":6707359,"src":"FOX_SITTING_thumb.jpg","galleries_id":427034,"server_id":18,"link":"photo_6707359.html","width":130,"caption":"","height":134});
															thumbnails[6707716] = clik.newPhoto({"id":6707716,"src":"paint_brush_410_thumb.jpg","galleries_id":366097,"server_id":18,"link":"photo_6707716.html","width":130,"caption":"","height":87});
															thumbnails[6707718] = clik.newPhoto({"id":6707718,"src":"paint_brush_333_thumb.jpg","galleries_id":366097,"server_id":18,"link":"photo_6707718.html","width":130,"caption":"","height":87});
															thumbnails[6707722] = clik.newPhoto({"id":6707722,"src":"The_studio_fireplace_portfolio_thumb.jpg","galleries_id":366097,"server_id":18,"link":"photo_6707722.html","width":130,"caption":"","height":157});
															thumbnails[6707724] = clik.newPhoto({"id":6707724,"src":"Studio_1_thumb.jpg","galleries_id":366097,"server_id":18,"link":"photo_6707724.html","width":130,"caption":"","height":195});
															thumbnails[6707734] = clik.newPhoto({"id":6707734,"src":"studio_2_thumb.jpg","galleries_id":303724,"server_id":18,"link":"photo_6707734.html","width":130,"caption":"","height":195});
															thumbnails[6707744] = clik.newPhoto({"id":6707744,"src":"the_studio_upstairs_3rd_May_honey_thumb.jpg","galleries_id":366097,"server_id":18,"link":"photo_6707744.html","width":130,"caption":"","height":87});
															thumbnails[6707797] = clik.newPhoto({"id":6707797,"src":"THE_STUDIO_DOOR_thumb.jpg","galleries_id":366097,"server_id":18,"link":"photo_6707797.html","width":130,"caption":"","height":196});
															thumbnails[7037700] = clik.newPhoto({"id":7037700,"src":"HARVEY_BLACK_AND_WHITE_thumb.jpg","galleries_id":375401,"server_id":18,"link":"photo_7037700.html","width":130,"caption":"","height":107});
															thumbnails[7037770] = clik.newPhoto({"id":7037770,"src":"artists_spring_website_thumb.jpg","galleries_id":375401,"server_id":18,"link":"photo_7037770.html","width":130,"caption":"","height":187});
															thumbnails[7128745] = clik.newPhoto({"id":7128745,"src":"cat_under_blanket_thumb.jpg","galleries_id":375401,"server_id":18,"link":"photo_7128745.html","width":130,"caption":"","height":87});
															thumbnails[7255532] = clik.newPhoto({"id":7255532,"src":"lilly_a_thumb.jpg","galleries_id":375401,"server_id":18,"link":"photo_7255532.html","width":130,"caption":"","height":195});
															thumbnails[7464113] = clik.newPhoto({"id":7464113,"src":"little_chicky_watercolour_thumb.jpg","galleries_id":367519,"server_id":18,"link":"photo_7464113.html","width":130,"caption":"","height":119});
															thumbnails[7464709] = clik.newPhoto({"id":7464709,"src":"welsh_country_cover_butterfly_thumb.jpg","galleries_id":375401,"server_id":18,"link":"photo_7464709.html","width":130,"caption":"","height":86});
															thumbnails[7471266] = clik.newPhoto({"id":7471266,"src":"Panda_playing_watercolour_3_thumb.jpg","galleries_id":367519,"server_id":18,"link":"photo_7471266.html","width":130,"caption":"","height":173});
															thumbnails[7496138] = clik.newPhoto({"id":7496138,"src":"Penguin_and_Chick_1_thumb.jpg","galleries_id":367519,"server_id":18,"link":"photo_7496138.html","width":130,"caption":"","height":179});
															thumbnails[7496196] = clik.newPhoto({"id":7496196,"src":"puppy_with_crown_watercolour_thumb.jpg","galleries_id":367519,"server_id":18,"link":"photo_7496196.html","width":130,"caption":"","height":76});
															thumbnails[7496248] = clik.newPhoto({"id":7496248,"src":"GERMAN_WAR_PLANE_thumb.jpg","galleries_id":427034,"server_id":18,"link":"photo_7496248.html","width":130,"caption":"","height":106});
															thumbnails[7496264] = clik.newPhoto({"id":7496264,"src":"sad_old_cow_jac_thumb.jpg","galleries_id":367519,"server_id":18,"link":"photo_7496264.html","width":130,"caption":"","height":161});
															thumbnails[7498721] = clik.newPhoto({"id":7498721,"src":"cyprus_hut_thumb.jpg","galleries_id":392845,"server_id":18,"link":"photo_7498721.html","width":130,"caption":"","height":129});
															thumbnails[7498762] = clik.newPhoto({"id":7498762,"src":"Elephant_1_thumb.jpg","galleries_id":367519,"server_id":18,"link":"photo_7498762.html","width":130,"caption":"","height":172});
															thumbnails[7498799] = clik.newPhoto({"id":7498799,"src":"robin_on_bath_thumb.jpg","galleries_id":375401,"server_id":18,"link":"photo_7498799.html","width":130,"caption":"","height":87});
															thumbnails[7498804] = clik.newPhoto({"id":7498804,"src":"HAY_thumb.jpg","galleries_id":375401,"server_id":18,"link":"photo_7498804.html","width":130,"caption":"","height":196});
															thumbnails[7507318] = clik.newPhoto({"id":7507318,"src":"goosey_looking_at_the_moon_illustration_card_2_thumb.jpg","galleries_id":367519,"server_id":18,"link":"photo_7507318.html","width":130,"caption":"","height":87});
															thumbnails[7538212] = clik.newPhoto({"id":7538212,"src":"frog_close_thumb.jpg","galleries_id":375401,"server_id":18,"link":"photo_7538212.html","width":130,"caption":"","height":85});
															thumbnails[7538265] = clik.newPhoto({"id":7538265,"src":"LILLY_thumb.jpg","galleries_id":375401,"server_id":18,"link":"photo_7538265.html","width":130,"caption":"","height":87});
															thumbnails[7538420] = clik.newPhoto({"id":7538420,"src":"dove_thumb.jpg","galleries_id":375401,"server_id":18,"link":"photo_7538420.html","width":130,"caption":"","height":87});
															thumbnails[7538529] = clik.newPhoto({"id":7538529,"src":"tiggy_thumb.jpg","galleries_id":375401,"server_id":18,"link":"photo_7538529.html","width":130,"caption":"","height":87});
															thumbnails[7639877] = clik.newPhoto({"id":7639877,"src":"piglet_in_the_mud1_thumb.jpg","galleries_id":367519,"server_id":18,"link":"photo_7639877.html","width":130,"caption":"","height":154});
															thumbnails[7917080] = clik.newPhoto({"id":7917080,"src":"snowdonia_054_thumb.jpg","galleries_id":392845,"server_id":18,"link":"photo_7917080.html","width":130,"caption":"","height":87});
															thumbnails[7973407] = clik.newPhoto({"id":7973407,"src":"teeth1_thumb.jpg","galleries_id":375401,"server_id":18,"link":"photo_7973407.html","width":130,"caption":"","height":116});
															thumbnails[7973412] = clik.newPhoto({"id":7973412,"src":"view_4_thumb.jpg","galleries_id":366097,"server_id":18,"link":"photo_7973412.html","width":130,"caption":"","height":195});
															thumbnails[7973417] = clik.newPhoto({"id":7973417,"src":"view_6_thumb.jpg","galleries_id":366097,"server_id":18,"link":"photo_7973417.html","width":130,"caption":"","height":87});
															thumbnails[7973423] = clik.newPhoto({"id":7973423,"src":"view_7_thumb.jpg","galleries_id":366097,"server_id":18,"link":"photo_7973423.html","width":130,"caption":"","height":87});
															thumbnails[7973425] = clik.newPhoto({"id":7973425,"src":"view_8_thumb.jpg","galleries_id":366097,"server_id":18,"link":"photo_7973425.html","width":130,"caption":"","height":195});
															thumbnails[7973444] = clik.newPhoto({"id":7973444,"src":"BUCK1_thumb.jpg","galleries_id":367519,"server_id":18,"link":"photo_7973444.html","width":130,"caption":"","height":174});
															thumbnails[7973469] = clik.newPhoto({"id":7973469,"src":"the_studio_upstairs_3rd_May_10_308_thumb.jpg","galleries_id":366097,"server_id":18,"link":"photo_7973469.html","width":130,"caption":"","height":87});
															thumbnails[7974249] = clik.newPhoto({"id":7974249,"src":"Kittens_Lavender_and_Ladybirds_thumb.jpg","galleries_id":367519,"server_id":18,"link":"photo_7974249.html","width":130,"caption":"","height":88});
															thumbnails[7974360] = clik.newPhoto({"id":7974360,"src":"penmaen_mawr_1_thumb.jpg","galleries_id":392845,"server_id":18,"link":"photo_7974360.html","width":130,"caption":"","height":129});
															thumbnails[7974377] = clik.newPhoto({"id":7974377,"src":"geese_2_thumb.jpg","galleries_id":367519,"server_id":18,"link":"photo_7974377.html","width":130,"caption":"","height":172});
															thumbnails[7974378] = clik.newPhoto({"id":7974378,"src":"barn_owl_1_thumb.jpg","galleries_id":367519,"server_id":18,"link":"photo_7974378.html","width":130,"caption":"","height":169});
															thumbnails[7974379] = clik.newPhoto({"id":7974379,"src":"Apple_1_thumb.jpg","galleries_id":367519,"server_id":18,"link":"photo_7974379.html","width":130,"caption":"","height":123});
															thumbnails[7974380] = clik.newPhoto({"id":7974380,"src":"Grans_tired_thumb.jpg","galleries_id":367519,"server_id":18,"link":"photo_7974380.html","width":130,"caption":"","height":179});
															thumbnails[7974381] = clik.newPhoto({"id":7974381,"src":"Dinbych_1_thumb.jpg","galleries_id":392845,"server_id":18,"link":"photo_7974381.html","width":130,"caption":"","height":133});
															thumbnails[7974394] = clik.newPhoto({"id":7974394,"src":"sky_1_thumb.jpg","galleries_id":375401,"server_id":18,"link":"photo_7974394.html","width":130,"caption":"","height":87});
															thumbnails[7974441] = clik.newPhoto({"id":7974441,"src":"PINK_SHOES_thumb.jpg","galleries_id":367519,"server_id":18,"link":"photo_7974441.html","width":130,"caption":"","height":180});
															thumbnails[7974442] = clik.newPhoto({"id":7974442,"src":"purple_shoes_1_thumb.jpg","galleries_id":367519,"server_id":18,"link":"photo_7974442.html","width":130,"caption":"","height":183});
															thumbnails[9084545] = clik.newPhoto({"id":9084545,"src":"Pug_Wearing_Pearls-_Plas_Newydd_2012_small_1_thumb.jpg","galleries_id":427034,"server_id":18,"link":"photo_9084545.html","width":130,"caption":"","height":108});
															thumbnails[9084661] = clik.newPhoto({"id":9084661,"src":"The_Tree_House-_Plas_Newydd_2012_small_2_thumb.jpg","galleries_id":427034,"server_id":18,"link":"photo_9084661.html","width":130,"caption":"","height":93});
															thumbnails[9084729] = clik.newPhoto({"id":9084729,"src":"cat_under_blanket_1_thumb.jpg","galleries_id":427034,"server_id":37,"link":"photo_9084729.html","width":130,"caption":"","height":87});
															thumbnails[1751320] = clik.newPhoto({"id":1751320,"src":"PAINTING OF AN APPLE_thumb.jpg","galleries_id":367519,"server_id":18,"link":"photo_1751320.html","width":130,"caption":"","height":193});
															thumbnails[3934201] = clik.newPhoto({"id":3934201,"src":"SNOWDON_CARD_1_thumb.jpg","galleries_id":392845,"server_id":18,"link":"photo_3934201.html","width":130,"caption":"Snowdonia","height":92});
															thumbnails[4828337] = clik.newPhoto({"id":4828337,"src":"Butterflies_09_006_thumb.jpg","galleries_id":366097,"server_id":18,"link":"photo_4828337.html","width":130,"caption":"Jane Griffiths-Jones Home & Stable Studios ","height":87});
															thumbnails[5456069] = clik.newPhoto({"id":5456069,"src":"lydias_artwork_2_thumb.jpg","galleries_id":303724,"server_id":18,"link":"photo_5456069.html","width":130,"caption":"Lydia Kate Griffiths age 14","height":164});
															thumbnails[5456205] = clik.newPhoto({"id":5456205,"src":"caras_work_thumb.jpg","galleries_id":303724,"server_id":18,"link":"photo_5456205.html","width":130,"caption":"Cara Elizabeth Davies age 15","height":186});
															thumbnails[5456182] = clik.newPhoto({"id":5456182,"src":"rhiannas_work_thumb.jpg","galleries_id":303724,"server_id":18,"link":"photo_5456182.html","width":130,"caption":"Rhianna Parry age 12","height":187});
															thumbnails[5456048] = clik.newPhoto({"id":5456048,"src":"menais_work_thumb.jpg","galleries_id":303724,"server_id":18,"link":"photo_5456048.html","width":130,"caption":"Menai Parry age 14","height":96});
															thumbnails[1751262] = clik.newPhoto({"id":1751262,"src":"Cinderella's broom_thumb.jpg","galleries_id":427034,"server_id":18,"link":"photo_1751262.html","width":130,"caption":"","height":185});
															thumbnails[5456041] = clik.newPhoto({"id":5456041,"src":"alaw_1_thumb.jpg","galleries_id":303724,"server_id":18,"link":"photo_5456041.html","width":130,"caption":"Alaw Williams age 10","height":49});
															thumbnails[5383564] = clik.newPhoto({"id":5383564,"src":"ART_STUDENTS_CARRIE_ANNE1_thumb.jpg","galleries_id":303724,"server_id":18,"link":"photo_5383564.html","width":130,"caption":"Carrie Anne Wheatley age 16yrs","height":88});
															thumbnails[5383505] = clik.newPhoto({"id":5383505,"src":"art_students_work_Cara_2009_thumb.jpg","galleries_id":303724,"server_id":18,"link":"photo_5383505.html","width":130,"caption":"Cara Elizabeth Davies age 15yrs","height":87});
															thumbnails[7200865] = clik.newPhoto({"id":7200865,"src":"roger_pics_300dpi_thumb.jpg","galleries_id":404703,"server_id":18,"link":"photo_7200865.html","width":130,"caption":"","height":87});
															thumbnails[5383495] = clik.newPhoto({"id":5383495,"src":"art_students_2010_llinos_3_thumb.jpg","galleries_id":303724,"server_id":18,"link":"photo_5383495.html","width":130,"caption":"Llinos Ann Williams age 15yrs","height":195});
															thumbnails[5383501] = clik.newPhoto({"id":5383501,"src":"art_students_work_2010_llinos_thumb.jpg","galleries_id":303724,"server_id":18,"link":"photo_5383501.html","width":130,"caption":"Llinos Ann Williams age 15yrs","height":191});
															thumbnails[5456029] = clik.newPhoto({"id":5456029,"src":"alaws_work_2_thumb.jpg","galleries_id":303724,"server_id":18,"link":"photo_5456029.html","width":130,"caption":"Alaw Williams age 10","height":52});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[427034] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Black and White Illustrations","link":"gallery_427034.html","maxRecords":0.0,"photoIDs":[6707359.0,7496248.0,9084545.0,9084661.0,9084729.0,1751262.0],"skipIndex":0,"section_code":"gallery","featured_images":"9084729,9084661,9084545,7496248,6707359,1751262","id":427034,"singleSection":false});				  						galleries[367519] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Illustrations","link":"gallery_367519.html","maxRecords":0.0,"photoIDs":[6555199.0,6688407.0,7464113.0,7471266.0,7496138.0,7496196.0,7496264.0,7498762.0,7507318.0,7639877.0,7973444.0,7974249.0,7974377.0,7974378.0,7974379.0,7974380.0,7974441.0,7974442.0,1751320.0],"skipIndex":0,"section_code":"gallery","featured_images":"7974442,7974441,7974380,7974379,7974378,7974377,7974249,7973444,7639877,7507318","id":367519,"singleSection":false});				  						galleries[404703] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Jane Griffiths-Jones","link":"gallery_404703.html","maxRecords":0.0,"photoIDs":[7200865.0],"skipIndex":0,"section_code":"gallery","featured_images":7200865.0,"id":404703,"singleSection":false});				  						galleries[392845] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Landscapes","link":"gallery_392845.html","maxRecords":0.0,"photoIDs":[1394953.0,1395107.0,7498721.0,7917080.0,7974360.0,7974381.0,3934201.0],"skipIndex":0,"section_code":"gallery","featured_images":"3934201,1395107","id":392845,"singleSection":false});				  						galleries[375401] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"PHOTOGRAPHY","link":"gallery_375401.html","maxRecords":0.0,"photoIDs":[4828455.0,5388298.0,7037700.0,7037770.0,7128745.0,7255532.0,7464709.0,7498799.0,7498804.0,7538212.0,7538265.0,7538420.0,7538529.0,7973407.0,7974394.0],"skipIndex":0,"section_code":"gallery","featured_images":"7974394,7973407,7538529,7538420,7538265,7538212,7498804,7498799,7464709,7255532","id":375401,"singleSection":false});				  						galleries[303724] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"STUDENTS GALLERY","link":"gallery_303724.html","maxRecords":0.0,"photoIDs":[4828331.0,5383497.0,5383509.0,5383567.0,6688400.0,6688411.0,6707734.0,5456069.0,5456205.0,5456182.0,5456048.0,5456041.0,5383564.0,5383505.0,5383495.0,5383501.0,5456029.0],"skipIndex":0,"section_code":"gallery","featured_images":"5456182,5456041","id":303724,"singleSection":false});				  						galleries[366097] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"The Studio","link":"gallery_366097.html","maxRecords":0.0,"photoIDs":[6374451.0,6707716.0,6707718.0,6707722.0,6707724.0,6707744.0,6707797.0,7973412.0,7973417.0,7973423.0,7973425.0,7973469.0,4828337.0],"skipIndex":0,"section_code":"gallery","featured_images":"7973469,7973425,7973423,7973417,7973412,6707797,6707744,6707724,6707722,6707718","id":366097,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '9084729,9084661,9084545,7974377,7507318,7471266,7464113,7128745,6555199';
imageSets[2] = '1395107,3934201,5456182,5456041';
imageSets[3] = '9084729,9084661,9084545,7974442,7974441,7974394,7974381,7974380,7974379,7974378,7974377,7974360,7974249,7973469,7973444,7973425,7973423,7973417,7973412,7973407,7917080,7639877,7538529,7538420,7538265,7538212,7507318,7498804,7498799,7498762,7498721,7496264,7496248,7496196,7496138,7471266,7464709,7464113,7255532,7200865,7128745,7037770,7037700,6707797,6707744,6707734,6707724,6707722,6707718,6707716';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/JaneJones/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/JaneJones/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/JaneJones/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/JaneJones/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/JaneJones/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/JaneJones/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/JaneJones/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/JaneJones/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/JaneJones/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/JaneJones/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/JaneJones/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/JaneJones/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/JaneJones/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/JaneJones/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/JaneJones/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/JaneJones/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/JaneJones/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/JaneJones/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/JaneJones/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/JaneJones/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/JaneJones/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/JaneJones/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/JaneJones/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/JaneJones/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/JaneJones/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/JaneJones/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/JaneJones/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 = 'JANE GRIFFITHS-JONES BA(Hons): ' + 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;
	}
}

			

