window.thumbnails = {};
															thumbnails[7249852] = clik.newPhoto({"id":7249852,"src":"DSC_0258_2_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_7249852.html","width":130,"caption":"Frosty Leaves","height":95});
															thumbnails[7249878] = clik.newPhoto({"id":7249878,"src":"6321_brian_blinkhorn_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_7249878.html","width":130,"caption":"Sprouts in Snow","height":86});
															thumbnails[7249887] = clik.newPhoto({"id":7249887,"src":"first_snow_-_P_Higgins_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_7249887.html","width":130,"caption":"First Snow","height":86});
															thumbnails[7249893] = clik.newPhoto({"id":7249893,"src":"IMG_6879_-_P_wan_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_7249893.html","width":130,"caption":"","height":96});
															thumbnails[7249897] = clik.newPhoto({"id":7249897,"src":"My_Christmas_Message_T_Crossland_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_7249897.html","width":130,"caption":"Christmas Message","height":87});
															thumbnails[7249900] = clik.newPhoto({"id":7249900,"src":"PSwan1_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_7249900.html","width":130,"caption":"Dales Sunset","height":87});
															thumbnails[7249906] = clik.newPhoto({"id":7249906,"src":"Season_Reason_-_D_Heather_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_7249906.html","width":130,"caption":"Season Reason","height":98});
															thumbnails[7249909] = clik.newPhoto({"id":7249909,"src":"snow_field_-_P_Higgins_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_7249909.html","width":130,"caption":"Snowfield","height":92});
															thumbnails[5997501] = clik.newPhoto({"id":5997501,"src":"Tree_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_5997501.html","width":130,"caption":"Tree","height":98});
															thumbnails[5997503] = clik.newPhoto({"id":5997503,"src":"river_sceen_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_5997503.html","width":130,"caption":"River Sceen","height":87});
															thumbnails[5997505] = clik.newPhoto({"id":5997505,"src":"Langcliffe_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_5997505.html","width":130,"caption":"Langcliff","height":87});
															thumbnails[5997507] = clik.newPhoto({"id":5997507,"src":"Beech_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_5997507.html","width":130,"caption":"Beech","height":86});
															thumbnails[5997510] = clik.newPhoto({"id":5997510,"src":"Barden_moor_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_5997510.html","width":130,"caption":"Barden Moor","height":87});
															thumbnails[5412304] = clik.newPhoto({"id":5412304,"src":"gill_rhys_highlandcows_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_5412304.html","width":130,"caption":"Winter grazing. Ingscar, Malham","height":87});
															thumbnails[5535793] = clik.newPhoto({"id":5535793,"src":"6_world_trade_ctr_thumb.jpg","galleries_id":305784,"server_id":5,"link":"photo_5535793.html","width":130,"caption":"^ World Trade Centre","height":195});
															thumbnails[5535810] = clik.newPhoto({"id":5535810,"src":"davidh_Mist_21_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_5535810.html","width":130,"caption":"Mist in The Dales","height":87});
															thumbnails[5535837] = clik.newPhoto({"id":5535837,"src":"gig_church_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_5535837.html","width":130,"caption":"Giggleswick Church","height":94});
															thumbnails[5535840] = clik.newPhoto({"id":5535840,"src":"icicles21_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_5535840.html","width":130,"caption":"Icicles","height":173});
															thumbnails[5535845] = clik.newPhoto({"id":5535845,"src":"manhatten_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_5535845.html","width":130,"caption":"Manhatten, New York","height":87});
															thumbnails[5535850] = clik.newPhoto({"id":5535850,"src":"misty_morning-windermere1_thumb.jpg","galleries_id":305784,"server_id":5,"link":"photo_5535850.html","width":130,"caption":"Misty Morning, Windermere","height":196});
															thumbnails[5535859] = clik.newPhoto({"id":5535859,"src":"Quintissential_Settle_0061_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_5535859.html","width":130,"caption":"Quintissential Settle ","height":173});
															thumbnails[5535865] = clik.newPhoto({"id":5535865,"src":"sea_sunset_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_5535865.html","width":130,"caption":"Suffolk Sea Sunset","height":87});
															thumbnails[5535873] = clik.newPhoto({"id":5535873,"src":"tarn_howe1_thumb.jpg","galleries_id":305784,"server_id":5,"link":"photo_5535873.html","width":130,"caption":"Tarn Howe","height":87});
															thumbnails[5535887] = clik.newPhoto({"id":5535887,"src":"winter_sunrise_1_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_5535887.html","width":130,"caption":"Winter Sunrise","height":85});
															thumbnails[5535891] = clik.newPhoto({"id":5535891,"src":"morning_mist1_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_5535891.html","width":130,"caption":"Morning Mist","height":43});
															thumbnails[5617781] = clik.newPhoto({"id":5617781,"src":"M_Smith_Survivors_thumb.jpg","galleries_id":305784,"server_id":5,"link":"photo_5617781.html","width":130,"caption":"Survivors","height":96});
															thumbnails[5617784] = clik.newPhoto({"id":5617784,"src":"M_Smith_Trees_Horton_in_Ribblesdale_thumb.jpg","galleries_id":305784,"server_id":5,"link":"photo_5617784.html","width":130,"caption":"Trees","height":80});
															thumbnails[5617794] = clik.newPhoto({"id":5617794,"src":"R_Smith_From_Thorns_thumb.jpg","galleries_id":305784,"server_id":5,"link":"photo_5617794.html","width":130,"caption":"From Thorns","height":173});
															thumbnails[5617797] = clik.newPhoto({"id":5617797,"src":"R_Smith_Pen-y-ghent_thumb.jpg","galleries_id":305784,"server_id":5,"link":"photo_5617797.html","width":130,"caption":"Pen-y ghent","height":194});
															thumbnails[5617799] = clik.newPhoto({"id":5617799,"src":"R_Smith_Thames_Clyde_Express_thumb.jpg","galleries_id":305784,"server_id":5,"link":"photo_5617799.html","width":130,"caption":"Thames Clyde Express","height":130});
															thumbnails[5617803] = clik.newPhoto({"id":5617803,"src":"R_Smith_Tree-abstract_thumb.jpg","galleries_id":305784,"server_id":5,"link":"photo_5617803.html","width":130,"caption":"Tees - Abstract","height":194});
															thumbnails[5617804] = clik.newPhoto({"id":5617804,"src":"M_Smith_Abandoned_thumb.jpg","galleries_id":305784,"server_id":5,"link":"photo_5617804.html","width":130,"caption":"Abandoned","height":95});
															thumbnails[5617807] = clik.newPhoto({"id":5617807,"src":"M_Smith_Foxgloves_thumb.jpg","galleries_id":305784,"server_id":5,"link":"photo_5617807.html","width":130,"caption":"Foxgloves","height":194});
															thumbnails[5837197] = clik.newPhoto({"id":5837197,"src":"chairs_thumb.jpg","galleries_id":305784,"server_id":5,"link":"photo_5837197.html","width":130,"caption":"Chairs","height":196});
															thumbnails[5837204] = clik.newPhoto({"id":5837204,"src":"Water-1_thumb.jpg","galleries_id":305784,"server_id":5,"link":"photo_5837204.html","width":130,"caption":"Water","height":86});
															thumbnails[5837212] = clik.newPhoto({"id":5837212,"src":"Water-2_thumb.jpg","galleries_id":305784,"server_id":5,"link":"photo_5837212.html","width":130,"caption":"Water 2","height":130});
															thumbnails[5837235] = clik.newPhoto({"id":5837235,"src":"LachlanDouglas_firetwirling_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_5837235.html","width":130,"caption":"Fire Twirling","height":98});
															thumbnails[5837241] = clik.newPhoto({"id":5837241,"src":"LachlanDouglas_scar_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_5837241.html","width":130,"caption":"Scar","height":195});
															thumbnails[5837245] = clik.newPhoto({"id":5837245,"src":"LachlanDouglas_swarm_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_5837245.html","width":130,"caption":"Swarm","height":87});
															thumbnails[5837249] = clik.newPhoto({"id":5837249,"src":"LachlanDouglas_whiplash_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_5837249.html","width":130,"caption":"Whiplash","height":195});
															thumbnails[5861745] = clik.newPhoto({"id":5861745,"src":"duck_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_5861745.html","width":130,"caption":"Duck","height":98});
															thumbnails[5861750] = clik.newPhoto({"id":5861750,"src":"ducks-in-a-row_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_5861750.html","width":130,"caption":"Ducks in a row","height":33});
															thumbnails[5861751] = clik.newPhoto({"id":5861751,"src":"Emu_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_5861751.html","width":130,"caption":"Emu","height":173});
															thumbnails[5861753] = clik.newPhoto({"id":5861753,"src":"GreatTit_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_5861753.html","width":130,"caption":"Great Tit","height":130});
															thumbnails[5861754] = clik.newPhoto({"id":5861754,"src":"Heron_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_5861754.html","width":130,"caption":"Heron","height":87});
															thumbnails[5861755] = clik.newPhoto({"id":5861755,"src":"male_chaffinch_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_5861755.html","width":130,"caption":"Male Chaffinch","height":110});
															thumbnails[5861809] = clik.newPhoto({"id":5861809,"src":"Squirrel_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_5861809.html","width":130,"caption":"Squirrel","height":163});
															thumbnails[5861846] = clik.newPhoto({"id":5861846,"src":"yellowhammer_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_5861846.html","width":130,"caption":"Yellow Hammer","height":104});
															thumbnails[6930505] = clik.newPhoto({"id":6930505,"src":"_MG_3870_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_6930505.html","width":130,"caption":"Teton Sunrise","height":90});
															thumbnails[6930509] = clik.newPhoto({"id":6930509,"src":"02_T_DILGER-Ribblehead-viaduct_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_6930509.html","width":130,"caption":"Ribblehaed","height":61});
															thumbnails[6930515] = clik.newPhoto({"id":6930515,"src":"06_JC_SMITH-5690mallerstang1sep10jcsthumb_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_6930515.html","width":130,"caption":"steam","height":89});
															thumbnails[6930532] = clik.newPhoto({"id":6930532,"src":"18_T_DILGER-Leander_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_6930532.html","width":130,"caption":"Leander","height":86});
															thumbnails[6937945] = clik.newPhoto({"id":6937945,"src":"23_CF_-_Helwith_Bridge_Steam-Christine_Flitcroft1_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_6937945.html","width":130,"caption":"Helwith Bridge Steam","height":85});
															thumbnails[6937949] = clik.newPhoto({"id":6937949,"src":"BrianB_0256_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_6937949.html","width":130,"caption":"Moon","height":99});
															thumbnails[6937955] = clik.newPhoto({"id":6937955,"src":"DSC_0144NEF_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_6937955.html","width":130,"caption":"Hong Kong Dusk","height":87});
															thumbnails[6937957] = clik.newPhoto({"id":6937957,"src":"howard-perfidia2-copy_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_6937957.html","width":130,"caption":"Caving","height":98});
															thumbnails[6937959] = clik.newPhoto({"id":6937959,"src":"IMG_0265ed_Small_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_6937959.html","width":130,"caption":"fun fair","height":84});
															thumbnails[6937991] = clik.newPhoto({"id":6937991,"src":"Inner_Harbour_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_6937991.html","width":130,"caption":"Inner Harbour","height":105});
															thumbnails[6938001] = clik.newPhoto({"id":6938001,"src":"Monopod_pedestrian_em_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_6938001.html","width":130,"caption":"monopod pedstrian!","height":91});
															thumbnails[6938003] = clik.newPhoto({"id":6938003,"src":"Moon_thumb.JPG","galleries_id":305783,"server_id":5,"link":"photo_6938003.html","width":130,"caption":"Moon","height":195});
															thumbnails[6938020] = clik.newPhoto({"id":6938020,"src":"PH-evening_beech_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_6938020.html","width":130,"caption":"Evening Beach","height":58});
															thumbnails[6938059] = clik.newPhoto({"id":6938059,"src":"raw_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_6938059.html","width":130,"caption":"Settle by night","height":86});
															thumbnails[6269091] = clik.newPhoto({"id":6269091,"src":"Christine_Flitcroft_The_Lowry_Centre_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_6269091.html","width":130,"caption":"Lowery Centre","height":98});
															thumbnails[6269098] = clik.newPhoto({"id":6269098,"src":"Dave_Crutchley_Pines_em_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_6269098.html","width":130,"caption":"Pines","height":184});
															thumbnails[6269102] = clik.newPhoto({"id":6269102,"src":"Eileen_Bamford_Ext_3_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_6269102.html","width":130,"caption":"Ext 3","height":120});
															thumbnails[6269108] = clik.newPhoto({"id":6269108,"src":"Frank_Higginson_Chair_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_6269108.html","width":130,"caption":"Chair","height":203});
															thumbnails[7342673] = clik.newPhoto({"id":7342673,"src":"Basket_Resolution_-_Dave_Lewis_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_7342673.html","width":130,"caption":"Basket Resolution","height":130});
															thumbnails[7342676] = clik.newPhoto({"id":7342676,"src":"crystal3ps_-_Jane_C_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_7342676.html","width":130,"caption":"crystal","height":188});
															thumbnails[7375781] = clik.newPhoto({"id":7375781,"src":"guess_-_brian_b_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_7375781.html","width":130,"caption":"Guess","height":204});
															thumbnails[7375791] = clik.newPhoto({"id":7375791,"src":"IMG_5185_copyCatrigg_Force_-_Phil_Simnett_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_7375791.html","width":130,"caption":"Catrigg Force","height":87});
															thumbnails[7375792] = clik.newPhoto({"id":7375792,"src":"IMG_5269_copy_Ice_and_Mist_-_Phil_Simnett_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_7375792.html","width":130,"caption":"Ice and Mist","height":87});
															thumbnails[7375810] = clik.newPhoto({"id":7375810,"src":"Resolution_Intent_-_Christine_flitcroft1_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_7375810.html","width":130,"caption":"Resolution Intent","height":95});
															thumbnails[7459548] = clik.newPhoto({"id":7459548,"src":"34067claphamMoorBack10feb11_jcs_thumb_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_7459548.html","width":130,"caption":"Clapham Moor","height":88});
															thumbnails[7459549] = clik.newPhoto({"id":7459549,"src":"AJCrossland-Brugges-movement_1_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_7459549.html","width":130,"caption":"Brugge","height":87});
															thumbnails[7459551] = clik.newPhoto({"id":7459551,"src":"DPS_FebGallery_IMG_7485_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_7459551.html","width":130,"caption":"Car","height":91});
															thumbnails[7459553] = clik.newPhoto({"id":7459553,"src":"Eagle_Owl_-__David_Harrop_thumb.jpg","galleries_id":305783,"server_id":5,"link":"photo_7459553.html","width":130,"caption":"Eagle Owl","height":60});
															thumbnails[7459558] = clik.newPhoto({"id":7459558,"src":"PMatthew47RRR_thumb.JPG","galleries_id":305783,"server_id":5,"link":"photo_7459558.html","width":130,"caption":"Ski","height":93});
															thumbnails[7459563] = clik.newPhoto({"id":7459563,"src":"Stainforth86R_thumb.JPG","galleries_id":305783,"server_id":5,"link":"photo_7459563.html","width":130,"caption":"Stainforth","height":93});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[375856] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"LATEST GALLERY ADDITIONS","link":"gallery_375856.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":"","id":375856,"singleSection":false});				  						galleries[305783] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Members Photographs","link":"gallery_305783.html","maxRecords":0.0,"photoIDs":[7249852.0,7249878.0,7249887.0,7249893.0,7249897.0,7249900.0,7249906.0,7249909.0,5997501.0,5997503.0,5997505.0,5997507.0,5997510.0,5412304.0,5535810.0,5535837.0,5535840.0,5535845.0,5535859.0,5535865.0,5535887.0,5535891.0,5837235.0,5837241.0,5837245.0,5837249.0,5861745.0,5861750.0,5861751.0,5861753.0,5861754.0,5861755.0,5861809.0,5861846.0,6930505.0,6930509.0,6930515.0,6930532.0,6937945.0,6937949.0,6937955.0,6937957.0,6937959.0,6937991.0,6938001.0,6938003.0,6938020.0,6938059.0,6269091.0,6269098.0,6269102.0,6269108.0,7342673.0,7342676.0,7375781.0,7375791.0,7375792.0,7375810.0,7459548.0,7459549.0,7459551.0,7459553.0,7459558.0,7459563.0],"skipIndex":0,"section_code":"gallery","featured_images":"7459563,7459558,7459553,7459551,7459549,7459548,7375810,7375792,7375791,7375781,7342676,7342673,7249909,7249906,7249900,7249897,7249893,7249887,7249878,7249852,6938059,6938020,6938003,6938001,6937991,6937959,6937957,6937955,6937949,6937945,6930532,6930515,6930509,6930505,6269108,6269102,6269098,6269091,5997510,5997507,5997505,5997503,5997501,5861846,5861809,5861755,5861754,5861753,5861751,5861750,5861745,5837249,5837245,5837241,5837235,5535891,5535887,5535865,5535859,5535845,5535840,5535837,5535810,5412304","id":305783,"singleSection":false});				  						galleries[305784] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Exhibition preview","link":"gallery_305784.html","maxRecords":0.0,"photoIDs":[5535793.0,5535850.0,5535873.0,5617781.0,5617784.0,5617794.0,5617797.0,5617799.0,5617803.0,5617804.0,5617807.0,5837197.0,5837204.0,5837212.0],"skipIndex":0,"section_code":"gallery","featured_images":"5837212,5837204,5837197,5617807,5617804,5617803,5617799,5617797,5617794,5617784,5617781,5535873,5535850,5535793","id":305784,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '7249900,7249893,7249852,6930515,5535859,5535840,5535837,5535810,7342676,7375810,7375791,7375781,7459563,7459553';
imageSets[2] = '7249909,7249906,7249900,7249897,7249893,7249887,7249878,7249852,6938059,6938020,6938003,6938001,6937991,6937959,6937957,6937955,6937949,6937945,6930532,6930515,6930509,6930505,5997510,5997507,5997505,5997503,5997501,5861846,5861809,5861755,5861754,5861753,5861751,5861750,5861745,5837249,5837245,5837241,5837235,5837212,5837204,5837197,5617807,5617804,5617803,5617799,5617797,5617794,5617784,5617781,5535891,5535887,5535873,5535865,5535859,5535850,5535845,5535840,5535837,5535810,5535793,5412304,6269108,6269102,6269098,6269091,7342676,7342673,7375810,7375792,7375791,7375781,7459563,7459558,7459553,7459551,7459549,7459548';
imageSets[3] = '7249900,7249893,7249852,6930515,5535859,5535840,5535837,5535810,7342676,7342673,7375810,7375792,7375791,7375781,7459563,7459558,7459553,7459551,7459549,7459548';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/spgadmin/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/spgadmin/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/spgadmin/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/spgadmin/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/spgadmin/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/spgadmin/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/spgadmin/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/spgadmin/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/spgadmin/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/spgadmin/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/spgadmin/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/spgadmin/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/spgadmin/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/spgadmin/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/spgadmin/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/spgadmin/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/spgadmin/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/spgadmin/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/spgadmin/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/spgadmin/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/spgadmin/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/spgadmin/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/spgadmin/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/spgadmin/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/spgadmin/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/spgadmin/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/spgadmin/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 = 'Settle Photographic Group';
			    }
        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;
	}
}

			

