window.thumbnails = {};
															thumbnails[5685322] = clik.newPhoto({"id":5685322,"src":"Puellae_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Puellae by Jo Pryor","height":106});
															thumbnails[5637456] = clik.newPhoto({"id":5637456,"src":"makerel_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Mackerel by Rosie Burns","height":90});
															thumbnails[5625591] = clik.newPhoto({"id":5625591,"src":"NDA_logo_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"North Devon Arts Logo","height":42});
															thumbnails[5625605] = clik.newPhoto({"id":5625605,"src":"britishartslogo_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"British Arts Logo","height":66});
															thumbnails[5626128] = clik.newPhoto({"id":5626128,"src":"northdevonuk_thumb.gif","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"North Devon UK","height":29});
															thumbnails[5578165] = clik.newPhoto({"id":5578165,"src":"dragonfly2_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"by Lani Shepherd","height":98});
															thumbnails[5453969] = clik.newPhoto({"id":5453969,"src":"DSCF1170-1_Large_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"by Tony Williams","height":99});
															thumbnails[5432281] = clik.newPhoto({"id":5432281,"src":"beach_huts1_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Beach huts by Janet Jopson","height":132});
															thumbnails[5432295] = clik.newPhoto({"id":5432295,"src":"the_willow_final_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"The Willow by Sarah Woolfenden","height":69});
															thumbnails[5405690] = clik.newPhoto({"id":5405690,"src":"Gallery39logo_colour_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"The Art Coop Logo","height":166});
															thumbnails[4865367] = clik.newPhoto({"id":4865367,"src":"Jenny_Crow_debris_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Crow Debris by Jenny Smy","height":96});
															thumbnails[4865474] = clik.newPhoto({"id":4865474,"src":"Alison_Nicholson_011_photo_by_Dave_Green1_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Pink collage","height":190});
															thumbnails[5438096] = clik.newPhoto({"id":5438096,"src":"Peace_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Peace by Sarah Woolfenden","height":128});
															thumbnails[5593764] = clik.newPhoto({"id":5593764,"src":"member_NDA_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Member of North Devon Arts","height":42});
															thumbnails[5750812] = clik.newPhoto({"id":5750812,"src":"cosmos_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Cosmos by Janet Jopson","height":103});
															thumbnails[6529398] = clik.newPhoto({"id":6529398,"src":"hot_chocolate_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Hot Chocolate by Alison Nicholson","height":168});
															thumbnails[6529409] = clik.newPhoto({"id":6529409,"src":"large_seascape_black_white_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Seascape by Alison Nicholson","height":107});
															thumbnails[6554275] = clik.newPhoto({"id":6554275,"src":"MyLogo2917_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"SueJewelleryLogo","height":101});
															thumbnails[7403092] = clik.newPhoto({"id":7403092,"src":"tim_Linda_Alison_Ruth1_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Alison Nicholson at her Museum Open","height":98});
															thumbnails[4864604] = clik.newPhoto({"id":4864604,"src":"JL_hydranglacecap_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Flower","height":86});
															thumbnails[7080895] = clik.newPhoto({"id":7080895,"src":"Blue_beach_scene_thumb.jpg","galleries_id":328372,"server_id":18,"link":"photo_7080895.html","width":130,"caption":"Blue beach scene fused glass panel 15x11cm","height":173});
															thumbnails[6393942] = clik.newPhoto({"id":6393942,"src":"flowerhanger1_thumb.jpg","galleries_id":328372,"server_id":18,"link":"photo_6393942.html","width":130,"caption":"Fused glass flower hanger ","height":173});
															thumbnails[5922704] = clik.newPhoto({"id":5922704,"src":"poppies_airbrush_thumb.jpg","galleries_id":277507,"server_id":18,"link":"photo_5922704.html","width":130,"caption":"Poppies airbrush by Simone Hunt","height":127});
															thumbnails[5922705] = clik.newPhoto({"id":5922705,"src":"_river_taw_thumb.jpg","galleries_id":277507,"server_id":18,"link":"photo_5922705.html","width":130,"caption":"River Taw by Simone Hunt","height":109});
															thumbnails[5922706] = clik.newPhoto({"id":5922706,"src":"Smudge_Tool_thumb.jpg","galleries_id":277507,"server_id":18,"link":"photo_5922706.html","width":130,"caption":"Smudge tool by Simone Hunt","height":98});
															thumbnails[5922707] = clik.newPhoto({"id":5922707,"src":"AFTER_THE_STORM_FINAL_thumb.jpg","galleries_id":277507,"server_id":18,"link":"photo_5922707.html","width":130,"caption":"After the storm by Simone Hunt","height":130});
															thumbnails[5922708] = clik.newPhoto({"id":5922708,"src":"the_quay_5_thumb.jpg","galleries_id":277507,"server_id":18,"link":"photo_5922708.html","width":130,"caption":"The quay by Simone Hunt","height":114});
															thumbnails[5922709] = clik.newPhoto({"id":5922709,"src":"Lilac_thumb.jpg","galleries_id":277507,"server_id":18,"link":"photo_5922709.html","width":130,"caption":"Lilac by Simone Hunt","height":104});
															thumbnails[5922710] = clik.newPhoto({"id":5922710,"src":"airbrush_orange_sky_thumb.jpg","galleries_id":277507,"server_id":18,"link":"photo_5922710.html","width":130,"caption":"Orange sky by Simone Hunt","height":129});
															thumbnails[4865413] = clik.newPhoto({"id":4865413,"src":"Bron_-_embroidered_brooches_thumb.jpg","galleries_id":328430,"server_id":18,"link":"photo_4865413.html","width":130,"caption":"'Brooches' by Bron Harris","height":98});
															thumbnails[4865417] = clik.newPhoto({"id":4865417,"src":"Bron_button_bracelet_thumb.jpg","galleries_id":328430,"server_id":18,"link":"photo_4865417.html","width":130,"caption":"Button bracelet by Bron Harris","height":173});
															thumbnails[5807030] = clik.newPhoto({"id":5807030,"src":"Inside_shop1_thumb.jpg","galleries_id":328797,"server_id":18,"link":"photo_5807030.html","width":130,"caption":"Inside Gallery","height":135});
															thumbnails[7456184] = clik.newPhoto({"id":7456184,"src":"Galleryceramics_thumb.JPG","galleries_id":328797,"server_id":18,"link":"photo_7456184.html","width":130,"caption":"Gallery ceramics","height":108});
															thumbnails[7496379] = clik.newPhoto({"id":7496379,"src":"Button_jewellery_1051_thumb.JPG","galleries_id":328430,"server_id":18,"link":"photo_7496379.html","width":130,"caption":"Green and pink button bracelet","height":98});
															thumbnails[7496394] = clik.newPhoto({"id":7496394,"src":"Button_jewellery_1531_thumb.JPG","galleries_id":328430,"server_id":18,"link":"photo_7496394.html","width":130,"caption":"Pink and blue button bracelet","height":162});
															thumbnails[7496401] = clik.newPhoto({"id":7496401,"src":"Button_jewellery_2241_thumb.JPG","galleries_id":328430,"server_id":18,"link":"photo_7496401.html","width":130,"caption":"Silver button necklace","height":173});
															thumbnails[8335511] = clik.newPhoto({"id":8335511,"src":"keyring1_thumb.JPG","galleries_id":328372,"server_id":18,"link":"photo_8335511.html","width":130,"caption":"Fused glass key ring","height":159});
															thumbnails[8335527] = clik.newPhoto({"id":8335527,"src":"waterscape_thumb.JPG","galleries_id":328372,"server_id":18,"link":"photo_8335527.html","width":130,"caption":"Waterscape","height":177});
															thumbnails[8335544] = clik.newPhoto({"id":8335544,"src":"DaVinciFocal1_thumb.JPG","galleries_id":328372,"server_id":18,"link":"photo_8335544.html","width":130,"caption":"Large Focal Bead","height":102});
															thumbnails[8335547] = clik.newPhoto({"id":8335547,"src":"LargeMurriniFocal1_thumb.JPG","galleries_id":328372,"server_id":18,"link":"photo_8335547.html","width":130,"caption":"Large Focal glass bead","height":173});
															thumbnails[8335738] = clik.newPhoto({"id":8335738,"src":"blue_dish_thumb.JPG","galleries_id":328372,"server_id":18,"link":"photo_8335738.html","width":130,"caption":"Square blue dish","height":98});
															thumbnails[8335741] = clik.newPhoto({"id":8335741,"src":"Largebluedish1_thumb.jpg","galleries_id":328372,"server_id":18,"link":"photo_8335741.html","width":130,"caption":"Large blue fused glass square dish","height":118});
															thumbnails[8346642] = clik.newPhoto({"id":8346642,"src":"2_Florence_downpour_thumb.jpg","galleries_id":441240,"server_id":18,"link":"photo_8346642.html","width":130,"caption":"Florence Downpour","height":86});
															thumbnails[8346652] = clik.newPhoto({"id":8346652,"src":"6_Similan_islands_beach_swing_thumb.jpg","galleries_id":441240,"server_id":18,"link":"photo_8346652.html","width":130,"caption":"","height":196});
															thumbnails[8346674] = clik.newPhoto({"id":8346674,"src":"7_Malta_street_view_thumb.jpg","galleries_id":441240,"server_id":18,"link":"photo_8346674.html","width":130,"caption":"Malta street view","height":196});
															thumbnails[8346702] = clik.newPhoto({"id":8346702,"src":"9c_Barnstaple_Pannier_Market_thumb.jpg","galleries_id":441240,"server_id":18,"link":"photo_8346702.html","width":130,"caption":"Barnstaple Pannier Market","height":86});
															thumbnails[4913926] = clik.newPhoto({"id":4913926,"src":"Please_let_me_sleep_thumb.jpg","galleries_id":277508,"server_id":18,"link":"photo_4913926.html","width":130,"caption":"'Please Let me sleep' by Ian Hudson","height":95});
															thumbnails[4889174] = clik.newPhoto({"id":4889174,"src":"dome_fountain_aqua_w_P1010002_thumb.jpg","galleries_id":328352,"server_id":18,"link":"photo_4889174.html","width":130,"caption":"Ceramic Dome Fountain by Helen Bailes","height":125});
															thumbnails[7456214] = clik.newPhoto({"id":7456214,"src":"hareobics_thumb.JPG","galleries_id":328797,"server_id":18,"link":"photo_7456214.html","width":130,"caption":"Hareobics","height":172});
															thumbnails[4889175] = clik.newPhoto({"id":4889175,"src":"light_holders__w_jpeg_thumb.jpg","galleries_id":328352,"server_id":18,"link":"photo_4889175.html","width":130,"caption":"Ceramic Light Holders by Helen Bailes","height":85});
															thumbnails[4864655] = clik.newPhoto({"id":4864655,"src":"Ian_Hudson_Boats_thumb.JPG","galleries_id":277508,"server_id":18,"link":"photo_4864655.html","width":130,"caption":"'Boats' by Ian Hudson","height":94});
															thumbnails[7456216] = clik.newPhoto({"id":7456216,"src":"Gallerywindow1_thumb.JPG","galleries_id":328797,"server_id":18,"link":"photo_7456216.html","width":130,"caption":"Gallery window","height":173});
															thumbnails[4864624] = clik.newPhoto({"id":4864624,"src":"Gallery14_Helen_Bailes12_thumb.JPG","galleries_id":328352,"server_id":18,"link":"photo_4864624.html","width":130,"caption":"Ceramic flower bowl by Helen Bailes","height":134});
															thumbnails[4864657] = clik.newPhoto({"id":4864657,"src":"Ian_Hudson_Jo_thumb.JPG","galleries_id":277508,"server_id":18,"link":"photo_4864657.html","width":130,"caption":"'Jo' by Ian Hudson","height":93});
															thumbnails[4865509] = clik.newPhoto({"id":4865509,"src":"outside_G39_1_thumb.jpg","galleries_id":328797,"server_id":18,"link":"photo_4865509.html","width":130,"caption":"The Gallery front window","height":111});
															thumbnails[4864658] = clik.newPhoto({"id":4864658,"src":"Ian_Hudson_Appledore_thumb.JPG","galleries_id":277508,"server_id":18,"link":"photo_4864658.html","width":130,"caption":"'Appledore' by Ian Hudson","height":95});
															thumbnails[4865519] = clik.newPhoto({"id":4865519,"src":"helenbailes-textural2_thumb.gif","galleries_id":328352,"server_id":18,"link":"photo_4865519.html","width":130,"caption":"Ceramic tall vase by Helen Bailes","height":130});
															thumbnails[7456250] = clik.newPhoto({"id":7456250,"src":"Gallerywall_thumb.JPG","galleries_id":328797,"server_id":18,"link":"photo_7456250.html","width":130,"caption":"Gallery wall art","height":102});
															thumbnails[4913942] = clik.newPhoto({"id":4913942,"src":"Meadfoot___Torbay_thumb.jpg","galleries_id":277508,"server_id":18,"link":"photo_4913942.html","width":130,"caption":"'Meadfoot, Torbay' by Ian Hudson","height":95});
															thumbnails[7456294] = clik.newPhoto({"id":7456294,"src":"GalleryWallJoPryor_thumb.JPG","galleries_id":328797,"server_id":18,"link":"photo_7456294.html","width":130,"caption":"Gallery wall","height":181});
															thumbnails[7456322] = clik.newPhoto({"id":7456322,"src":"DSC02911_thumb.JPG","galleries_id":328797,"server_id":18,"link":"photo_7456322.html","width":130,"caption":"Fused glass by Sue Martin","height":98});
															thumbnails[7456351] = clik.newPhoto({"id":7456351,"src":"Gallerytable_thumb.JPG","galleries_id":328797,"server_id":18,"link":"photo_7456351.html","width":130,"caption":"Colourful nuno felt scarves by Sue Martin","height":194});
															thumbnails[4864623] = clik.newPhoto({"id":4864623,"src":"Sue_Martin_-_glass_thumb.JPG","galleries_id":328372,"server_id":18,"link":"photo_4864623.html","width":130,"caption":"Green fused glass hangers","height":98});
															thumbnails[4865594] = clik.newPhoto({"id":4865594,"src":"bluedish_copy_thumb.jpg","galleries_id":328372,"server_id":18,"link":"photo_4865594.html","width":130,"caption":"Fused glass blue dish ","height":82});
															thumbnails[5058865] = clik.newPhoto({"id":5058865,"src":"Shades_of_Blue_thumb.JPG","galleries_id":328372,"server_id":18,"link":"photo_5058865.html","width":130,"caption":"'Shades of Blue' fused glass hanging panel £120 ","height":135});
															thumbnails[4864572] = clik.newPhoto({"id":4864572,"src":"Across_the_valley_G39_thumb.jpg","galleries_id":328371,"server_id":18,"link":"photo_4864572.html","width":130,"caption":"'Across The Valley' by Ailsa Addicott","height":98});
															thumbnails[4864580] = clik.newPhoto({"id":4864580,"src":"The_Beach__G39_thumb.jpg","galleries_id":328371,"server_id":18,"link":"photo_4864580.html","width":130,"caption":"'The Beach' by Ailsa Addicott","height":130});
															thumbnails[4864590] = clik.newPhoto({"id":4864590,"src":"The_Hedgerow_for_G39Ailsa_thumb.jpg","galleries_id":328371,"server_id":18,"link":"photo_4864590.html","width":130,"caption":"'The Hedgerow' by Ailsa Addicott","height":93});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[328797] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery","link":"section393518_328797.html","maxRecords":0.0,"photoIDs":[5807030.0,7456184.0,7456214.0,7456216.0,4865509.0,7456250.0,7456294.0,7456322.0,7456351.0],"skipIndex":0,"section_code":"section393518","featured_images":"7456351,7456322,7456294,7456250,7456216,7456214,7456184,4865509","id":328797,"singleSection":false});				  						galleries[328372] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Sue Martin -fused & flameworked glass art","link":"section393518_328372.html","maxRecords":0.0,"photoIDs":[7080895.0,6393942.0,8335511.0,8335527.0,8335544.0,8335547.0,8335738.0,8335741.0,4864623.0,4865594.0,5058865.0],"skipIndex":0,"section_code":"section393518","featured_images":"7080895,6393942,5058865,4865594,4864623","id":328372,"singleSection":false});				  						galleries[328352] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Helen Bailes - porcelain ceramics","link":"section393518_328352.html","maxRecords":0.0,"photoIDs":[4889174.0,4889175.0,4864624.0,4865519.0],"skipIndex":0,"section_code":"section393518","featured_images":"4889175,4889174","id":328352,"singleSection":false});				  						galleries[328371] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Ailsa Addicott - acrylic & watercolour painting","link":"section393518_328371.html","maxRecords":0.0,"photoIDs":[4864572.0,4864580.0,4864590.0],"skipIndex":0,"section_code":"section393518","featured_images":"4864590,4864580,4864572","id":328371,"singleSection":false});				  						galleries[328430] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Bron Harris - buttonwork","link":"section393518_328430.html","maxRecords":0.0,"photoIDs":[4865413.0,4865417.0,7496379.0,7496394.0,7496401.0],"skipIndex":0,"section_code":"section393518","featured_images":"7496394,7496379,4865413","id":328430,"singleSection":false});				  						galleries[277507] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Simone Hunt- watercolour & oil painting","link":"section393518_277507.html","maxRecords":0.0,"photoIDs":[5922704.0,5922705.0,5922706.0,5922707.0,5922708.0,5922709.0,5922710.0],"skipIndex":0,"section_code":"section393518","featured_images":"5922710,5922709,5922708,5922707,5922706,5922705,5922704","id":277507,"singleSection":false});				  						galleries[277508] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Ian Hudson - watercolour painting","link":"section393518_277508.html","maxRecords":0.0,"photoIDs":[4913926.0,4864655.0,4864657.0,4864658.0,4913942.0],"skipIndex":0,"section_code":"section393518","featured_images":"4913942,4913926,4864655","id":277508,"singleSection":false});				  						galleries[441240] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Markus MacGill","link":"section393518_441240.html","maxRecords":0.0,"photoIDs":[8346642.0,8346652.0,8346674.0,8346702.0],"skipIndex":0,"section_code":"section393518","featured_images":"8346702,8346674,8346652,8346642","id":441240,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[244403] = '8346702,8346674,8346652,8346642';
imageSets[237796] = '8335741,8335738,7080895,6393942,4864623,4865594,5058865';
imageSets[1] = '8346702,8346674,8346652,8346642,8335741,8335738,8335547,8335544,8335527,8335511,7496394,7496379,7456184,6393942,4865413,4865367,7456214,4913926,4889174,7456216,4889175,4864655,4865509,4864624,7456250,7456294,4913942,7456322,7456351,4865594,5058865,4864580';
imageSets[2] = '7496394,7496379,7456184,7080895,6393942,4865413,7456214,4913926,4889174,7456216,4889175,4864655,4865509,7456250,7456294,4913942,7456322,7456351,4864623,4865594,5058865';
imageSets[3] = '8346702,8346674,8346652,8346642,8335741,8335738,8335547,8335544,8335527,8335511,7496401,7496394,7496379,7456351,7456322,7456294,7456250,7456216,7456214,7456184,7403092,7080895,6554275,6529409,6529398,6393942,5922710,5922709,5922708,5922707,5922706,5922705,5922704,5807030,5750812,5685322,5637456,5626128,5625605,5625591,5593764,5578165,5453969,5438096,5432295,5432281,5405690,5058865,4913942,4913926';
imageSets[238008] = '7496394,7496379';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/gallery39/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/gallery39/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/gallery39/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/gallery39/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/gallery39/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/gallery39/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/gallery39/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/gallery39/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/gallery39/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/gallery39/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/gallery39/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/gallery39/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/gallery39/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/gallery39/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/gallery39/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/gallery39/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/gallery39/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/gallery39/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/gallery39/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/gallery39/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/gallery39/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/gallery39/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/gallery39/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/gallery39/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/gallery39/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/gallery39/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/gallery39/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 += 'section393518.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 && 'section393518' != '') {
					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 = 'The Art Coop at Gallery 39: ' + 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;
	}
}

			

