window.thumbnails = {};
															thumbnails[1399998] = clik.newPhoto({"id":1399998,"src":"11_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":195});
															thumbnails[1363674] = clik.newPhoto({"id":1363674,"src":"IMG_0087_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Fish & Chips","height":195});
															thumbnails[1608414] = clik.newPhoto({"id":1608414,"src":"IMG_0062_thumb.CR2.jpg","galleries_id":109510,"server_id":1,"link":"photo_1608414.html","width":130,"caption":"Civil Partnerships","height":195});
															thumbnails[1669809] = clik.newPhoto({"id":1669809,"src":"pa08_120x50_72d_thumb.jpg","galleries_id":109510,"server_id":1,"link":"photo_1669809.html","width":130,"caption":"","height":54});
															thumbnails[3270777] = clik.newPhoto({"id":3270777,"src":"Tara & Neil BW_035_thumb.JPG","galleries_id":91427,"server_id":1,"link":"photo_3270777.html","width":130,"caption":"","height":87});
															thumbnails[3270784] = clik.newPhoto({"id":3270784,"src":"Tara & Niel_074_thumb.JPG","galleries_id":91427,"server_id":1,"link":"photo_3270784.html","width":130,"caption":"","height":195});
															thumbnails[3270791] = clik.newPhoto({"id":3270791,"src":"Tara & Niel_123_thumb.JPG","galleries_id":91427,"server_id":1,"link":"photo_3270791.html","width":130,"caption":"","height":195});
															thumbnails[3270795] = clik.newPhoto({"id":3270795,"src":"Tara & Niel_095_thumb.JPG","galleries_id":91427,"server_id":1,"link":"photo_3270795.html","width":130,"caption":"","height":195});
															thumbnails[8103258] = clik.newPhoto({"id":8103258,"src":"IMG_0191_thumb.JPG","galleries_id":91427,"server_id":1,"link":"photo_8103258.html","width":130,"caption":"","height":87});
															thumbnails[1400001] = clik.newPhoto({"id":1400001,"src":"13_thumb.jpg","galleries_id":91427,"server_id":1,"link":"photo_1400001.html","width":130,"caption":"","height":87});
															thumbnails[3270742] = clik.newPhoto({"id":3270742,"src":"AA_192_thumb.JPG","galleries_id":91427,"server_id":1,"link":"photo_3270742.html","width":130,"caption":"","height":195});
															thumbnails[1295147] = clik.newPhoto({"id":1295147,"src":"IMG_0053_thumb.JPG","galleries_id":91427,"server_id":1,"link":"photo_1295147.html","width":130,"caption":"","height":87});
															thumbnails[2656116] = clik.newPhoto({"id":2656116,"src":"IMG_0273_thumb.JPG","galleries_id":91427,"server_id":1,"link":"photo_2656116.html","width":130,"caption":"","height":87});
															thumbnails[1509736] = clik.newPhoto({"id":1509736,"src":"IMG_0127_1_thumb.jpg","galleries_id":91427,"server_id":1,"link":"photo_1509736.html","width":130,"caption":"","height":87});
															thumbnails[1297299] = clik.newPhoto({"id":1297299,"src":"IMG_0054_thumb.jpg","galleries_id":91427,"server_id":1,"link":"photo_1297299.html","width":130,"caption":"","height":87});
															thumbnails[1400002] = clik.newPhoto({"id":1400002,"src":"6_thumb.jpg","galleries_id":91427,"server_id":1,"link":"photo_1400002.html","width":130,"caption":"","height":195});
															thumbnails[1509738] = clik.newPhoto({"id":1509738,"src":"IMG_0175_1_thumb.jpg","galleries_id":91427,"server_id":1,"link":"photo_1509738.html","width":130,"caption":"","height":87});
															thumbnails[1348101] = clik.newPhoto({"id":1348101,"src":"IMG_0042_1_thumb.jpg","galleries_id":91427,"server_id":1,"link":"photo_1348101.html","width":130,"caption":"","height":87});
															thumbnails[1509739] = clik.newPhoto({"id":1509739,"src":"IMG_0181_1_thumb.jpg","galleries_id":91427,"server_id":1,"link":"photo_1509739.html","width":130,"caption":"","height":87});
															thumbnails[1509740] = clik.newPhoto({"id":1509740,"src":"IMG_0191_1_thumb.jpg","galleries_id":91427,"server_id":1,"link":"photo_1509740.html","width":130,"caption":"","height":87});
															thumbnails[1348098] = clik.newPhoto({"id":1348098,"src":"IMG_0008_thumb.jpg","galleries_id":91427,"server_id":1,"link":"photo_1348098.html","width":130,"caption":"","height":179});
															thumbnails[1412589] = clik.newPhoto({"id":1412589,"src":"68_thumb.jpg","galleries_id":98055,"server_id":1,"link":"photo_1412589.html","width":130,"caption":"","height":89});
															thumbnails[1509722] = clik.newPhoto({"id":1509722,"src":"IMG_0035_1_thumb.jpg","galleries_id":91427,"server_id":1,"link":"photo_1509722.html","width":130,"caption":"","height":195});
															thumbnails[2656117] = clik.newPhoto({"id":2656117,"src":"Hannah & Neil Disk 1_032_thumb.JPG","galleries_id":91427,"server_id":1,"link":"photo_2656117.html","width":130,"caption":"","height":195});
															thumbnails[2656118] = clik.newPhoto({"id":2656118,"src":"IMG_0043_thumb.JPG","galleries_id":91427,"server_id":1,"link":"photo_2656118.html","width":130,"caption":"","height":195});
															thumbnails[2656119] = clik.newPhoto({"id":2656119,"src":"IMG_0054_1_thumb.JPG","galleries_id":91427,"server_id":1,"link":"photo_2656119.html","width":130,"caption":"","height":195});
															thumbnails[2656121] = clik.newPhoto({"id":2656121,"src":"IMG_0068_thumb.JPG","galleries_id":91427,"server_id":1,"link":"photo_2656121.html","width":130,"caption":"","height":195});
															thumbnails[1411071] = clik.newPhoto({"id":1411071,"src":"4_thumb.jpg","galleries_id":91427,"server_id":1,"link":"photo_1411071.html","width":130,"caption":"","height":195});
															thumbnails[1411084] = clik.newPhoto({"id":1411084,"src":"48_thumb.jpg","galleries_id":91427,"server_id":1,"link":"photo_1411084.html","width":130,"caption":"","height":195});
															thumbnails[1297340] = clik.newPhoto({"id":1297340,"src":"IMG_0097_thumb.jpg","galleries_id":109510,"server_id":1,"link":"photo_1297340.html","width":130,"caption":"","height":195});
															thumbnails[1509723] = clik.newPhoto({"id":1509723,"src":"IMG_0067_1_thumb.jpg","galleries_id":91427,"server_id":1,"link":"photo_1509723.html","width":130,"caption":"","height":195});
															thumbnails[1509737] = clik.newPhoto({"id":1509737,"src":"IMG_0165_1_thumb.jpg","galleries_id":91427,"server_id":1,"link":"photo_1509737.html","width":130,"caption":"","height":195});
															thumbnails[1297341] = clik.newPhoto({"id":1297341,"src":"IMG_0098_thumb.jpg","galleries_id":91427,"server_id":1,"link":"photo_1297341.html","width":130,"caption":"","height":195});
															thumbnails[1411082] = clik.newPhoto({"id":1411082,"src":"44_thumb.jpg","galleries_id":91427,"server_id":1,"link":"photo_1411082.html","width":130,"caption":"","height":195});
															thumbnails[1509725] = clik.newPhoto({"id":1509725,"src":"IMG_0103_1_thumb.jpg","galleries_id":91427,"server_id":1,"link":"photo_1509725.html","width":130,"caption":"","height":195});
															thumbnails[1411411] = clik.newPhoto({"id":1411411,"src":"24_thumb.jpg","galleries_id":98055,"server_id":1,"link":"photo_1411411.html","width":130,"caption":"","height":89});
															thumbnails[1412581] = clik.newPhoto({"id":1412581,"src":"58_thumb.jpg","galleries_id":98055,"server_id":1,"link":"photo_1412581.html","width":130,"caption":"","height":89});
															thumbnails[1412584] = clik.newPhoto({"id":1412584,"src":"60_thumb.jpg","galleries_id":98055,"server_id":1,"link":"photo_1412584.html","width":130,"caption":"","height":89});
															thumbnails[1412586] = clik.newPhoto({"id":1412586,"src":"621_thumb.jpg","galleries_id":98055,"server_id":1,"link":"photo_1412586.html","width":130,"caption":"","height":89});
															thumbnails[8118362] = clik.newPhoto({"id":8118362,"src":"_MG_0002_thumb.JPG","galleries_id":91970,"server_id":1,"link":"photo_8118362.html","width":130,"caption":"","height":195});
															thumbnails[8118363] = clik.newPhoto({"id":8118363,"src":"_MG_0059_thumb.JPG","galleries_id":91970,"server_id":1,"link":"photo_8118363.html","width":130,"caption":"","height":195});
															thumbnails[8118364] = clik.newPhoto({"id":8118364,"src":"_MG_0004_thumb.JPG","galleries_id":91970,"server_id":1,"link":"photo_8118364.html","width":130,"caption":"","height":163});
															thumbnails[8118365] = clik.newPhoto({"id":8118365,"src":"_MG_0020_thumb.JPG","galleries_id":91970,"server_id":1,"link":"photo_8118365.html","width":130,"caption":"","height":156});
															thumbnails[8118366] = clik.newPhoto({"id":8118366,"src":"_MG_0028_thumb.JPG","galleries_id":91970,"server_id":1,"link":"photo_8118366.html","width":130,"caption":"","height":156});
															thumbnails[8118367] = clik.newPhoto({"id":8118367,"src":"EJ_028_thumb.JPG","galleries_id":91970,"server_id":1,"link":"photo_8118367.html","width":130,"caption":"","height":148});
															thumbnails[8118368] = clik.newPhoto({"id":8118368,"src":"EJ_151_thumb.JPG","galleries_id":91970,"server_id":1,"link":"photo_8118368.html","width":130,"caption":"","height":156});
															thumbnails[2656110] = clik.newPhoto({"id":2656110,"src":"_MG_3338_thumb.JPG","galleries_id":91970,"server_id":1,"link":"photo_2656110.html","width":130,"caption":"","height":195});
															thumbnails[2656111] = clik.newPhoto({"id":2656111,"src":"_MG_3344_thumb.JPG","galleries_id":91970,"server_id":1,"link":"photo_2656111.html","width":130,"caption":"","height":202});
															thumbnails[2656113] = clik.newPhoto({"id":2656113,"src":"_MG_3272_thumb.JPG","galleries_id":91970,"server_id":1,"link":"photo_2656113.html","width":130,"caption":"","height":87});
															thumbnails[1297808] = clik.newPhoto({"id":1297808,"src":"IMG_00241_thumb.jpg","galleries_id":91970,"server_id":1,"link":"photo_1297808.html","width":130,"caption":"","height":195});
															thumbnails[1443435] = clik.newPhoto({"id":1443435,"src":"IMG_0032_1Portrait cmyk_thumb.jpg","galleries_id":91970,"server_id":1,"link":"photo_1443435.html","width":130,"caption":"","height":195});
															thumbnails[1445248] = clik.newPhoto({"id":1445248,"src":"123_thumb.jpg","galleries_id":99958,"server_id":1,"link":"photo_1445248.html","width":130,"caption":"","height":89});
															thumbnails[1297819] = clik.newPhoto({"id":1297819,"src":"_MG_5625_thumb.jpg","galleries_id":91970,"server_id":1,"link":"photo_1297819.html","width":130,"caption":"","height":195});
															thumbnails[1297820] = clik.newPhoto({"id":1297820,"src":"_MG_5626_thumb.jpg","galleries_id":91970,"server_id":1,"link":"photo_1297820.html","width":130,"caption":"","height":195});
															thumbnails[8103212] = clik.newPhoto({"id":8103212,"src":"Creeksy_Place_thumb.JPG","galleries_id":433843,"server_id":1,"link":"photo_8103212.html","width":130,"caption":"Creeksy Place","height":87});
															thumbnails[8103218] = clik.newPhoto({"id":8103218,"src":"Dove_Barn_Groton_thumb.JPG","galleries_id":433843,"server_id":1,"link":"photo_8103218.html","width":130,"caption":"","height":195});
															thumbnails[8118306] = clik.newPhoto({"id":8118306,"src":"Abbots_Barn_thumb.JPG","galleries_id":433843,"server_id":1,"link":"photo_8118306.html","width":130,"caption":"Abbots Barn","height":195});
															thumbnails[8118307] = clik.newPhoto({"id":8118307,"src":"Alison__James_075_thumb.JPG","galleries_id":433843,"server_id":1,"link":"photo_8118307.html","width":130,"caption":"","height":195});
															thumbnails[8118310] = clik.newPhoto({"id":8118310,"src":"Colchester_Arts_Centre_thumb.JPG","galleries_id":433843,"server_id":1,"link":"photo_8118310.html","width":130,"caption":"Colchester Arts center","height":195});
															thumbnails[8118313] = clik.newPhoto({"id":8118313,"src":"Barn_Great_Tey_thumb.JPG","galleries_id":433843,"server_id":1,"link":"photo_8118313.html","width":130,"caption":"Great Tey","height":87});
															thumbnails[8118314] = clik.newPhoto({"id":8118314,"src":"Gosfield_Hall_thumb.JPG","galleries_id":433843,"server_id":1,"link":"photo_8118314.html","width":130,"caption":"Gosfield","height":195});
															thumbnails[8118316] = clik.newPhoto({"id":8118316,"src":"Frinton_Golf_Club_thumb.JPG","galleries_id":433843,"server_id":1,"link":"photo_8118316.html","width":130,"caption":"frinton Golf Club","height":89});
															thumbnails[8118317] = clik.newPhoto({"id":8118317,"src":"Hedingham_thumb.JPG","galleries_id":433843,"server_id":1,"link":"photo_8118317.html","width":130,"caption":"Hedingham castle","height":195});
															thumbnails[8118319] = clik.newPhoto({"id":8118319,"src":"IMG_0181_1_18050332-1D09-001F-9923FA99D4C283F8_thumb.JPG","galleries_id":433843,"server_id":1,"link":"photo_8118319.html","width":130,"caption":"","height":87});
															thumbnails[8118320] = clik.newPhoto({"id":8118320,"src":"Milsoms_thumb.JPG","galleries_id":433843,"server_id":1,"link":"photo_8118320.html","width":130,"caption":"Milsoms","height":87});
															thumbnails[8118323] = clik.newPhoto({"id":8118323,"src":"Priory_Hall_Sudbury_thumb.JPG","galleries_id":433843,"server_id":1,"link":"photo_8118323.html","width":130,"caption":"Priory Hall","height":87});
															thumbnails[8118325] = clik.newPhoto({"id":8118325,"src":"Talbouth_2_thumb.JPG","galleries_id":433843,"server_id":1,"link":"photo_8118325.html","width":130,"caption":"Talbouth","height":87});
															thumbnails[8118329] = clik.newPhoto({"id":8118329,"src":"_MG_3252_thumb.JPG","galleries_id":434458,"server_id":1,"link":"photo_8118329.html","width":130,"caption":"","height":195});
															thumbnails[8118330] = clik.newPhoto({"id":8118330,"src":"20080620_0046_thumb.JPG","galleries_id":434458,"server_id":1,"link":"photo_8118330.html","width":130,"caption":"","height":195});
															thumbnails[8118331] = clik.newPhoto({"id":8118331,"src":"20090126_0184_lamb_thumb.JPG","galleries_id":434458,"server_id":1,"link":"photo_8118331.html","width":130,"caption":"","height":194});
															thumbnails[8118332] = clik.newPhoto({"id":8118332,"src":"20090217_0295_watercress_thumb.JPG","galleries_id":434458,"server_id":1,"link":"photo_8118332.html","width":130,"caption":"","height":182});
															thumbnails[8118333] = clik.newPhoto({"id":8118333,"src":"20090217_0309_curried_lamb_chop_thumb.JPG","galleries_id":434458,"server_id":1,"link":"photo_8118333.html","width":130,"caption":"","height":182});
															thumbnails[8118335] = clik.newPhoto({"id":8118335,"src":"EYHO_Crown_Point_22_01_2008_028_thumb.JPG","galleries_id":434458,"server_id":1,"link":"photo_8118335.html","width":130,"caption":"","height":195});
															thumbnails[8118337] = clik.newPhoto({"id":8118337,"src":"IMG_0001_thumb.JPG","galleries_id":434458,"server_id":1,"link":"photo_8118337.html","width":130,"caption":"","height":195});
															thumbnails[8118338] = clik.newPhoto({"id":8118338,"src":"IMG_0003_thumb.JPG","galleries_id":434458,"server_id":1,"link":"photo_8118338.html","width":130,"caption":"","height":195});
															thumbnails[8118339] = clik.newPhoto({"id":8118339,"src":"IMG_0005_thumb.JPG","galleries_id":434458,"server_id":1,"link":"photo_8118339.html","width":130,"caption":"","height":195});
															thumbnails[8118341] = clik.newPhoto({"id":8118341,"src":"IMG_0015_thumb.JPG","galleries_id":434458,"server_id":1,"link":"photo_8118341.html","width":130,"caption":"","height":195});
															thumbnails[8118343] = clik.newPhoto({"id":8118343,"src":"IMG_0020_1_thumb.JPG","galleries_id":434458,"server_id":1,"link":"photo_8118343.html","width":130,"caption":"","height":195});
															thumbnails[8118345] = clik.newPhoto({"id":8118345,"src":"IMG_0027_thumb.JPG","galleries_id":434458,"server_id":1,"link":"photo_8118345.html","width":130,"caption":"","height":87});
															thumbnails[8118346] = clik.newPhoto({"id":8118346,"src":"IMG_0057_thumb.JPG","galleries_id":434458,"server_id":1,"link":"photo_8118346.html","width":130,"caption":"","height":182});
															thumbnails[8118348] = clik.newPhoto({"id":8118348,"src":"Meccure_113_thumb.JPG","galleries_id":434458,"server_id":1,"link":"photo_8118348.html","width":130,"caption":"","height":195});
															thumbnails[8118349] = clik.newPhoto({"id":8118349,"src":"Meccure_134_thumb.JPG","galleries_id":434458,"server_id":1,"link":"photo_8118349.html","width":130,"caption":"","height":195});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[434458] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Food","link":"section521933.html","maxRecords":0.0,"photoIDs":[8118329.0,8118330.0,8118331.0,8118332.0,8118333.0,8118335.0,8118337.0,8118338.0,8118339.0,8118341.0,8118343.0,8118345.0,8118346.0,8118348.0,8118349.0],"skipIndex":0,"section_code":"section521933","featured_images":8118330.0,"id":434458,"singleSection":true});				  						galleries[91970] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Lifestyle","link":"section122597_91970.html","maxRecords":0.0,"photoIDs":[8118362.0,8118363.0,8118364.0,8118365.0,8118366.0,8118367.0,8118368.0,2656110.0,2656111.0,2656113.0,1297808.0,1443435.0,1297819.0,1297820.0],"skipIndex":0,"section_code":"section122597","featured_images":"8118365,2656113,2656111,2656110,1297808","id":91970,"singleSection":false});				  						galleries[99958] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Portrait Books","link":"section122597_99958.html","maxRecords":0.0,"photoIDs":[1445248.0],"skipIndex":0,"section_code":"section122597","featured_images":1445248.0,"id":99958,"singleSection":false});				  						galleries[433843] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Venus","link":"section521176.html","maxRecords":0.0,"photoIDs":[8103212.0,8103218.0,8118306.0,8118307.0,8118310.0,8118313.0,8118314.0,8118316.0,8118317.0,8118319.0,8118320.0,8118323.0,8118325.0],"skipIndex":0,"section_code":"section521176","featured_images":"8118306,8103218","id":433843,"singleSection":true});				  						galleries[98055] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Wedding Design","link":"section122596_98055.html","maxRecords":0.0,"photoIDs":[1412589.0,1411411.0,1412581.0,1412584.0,1412586.0],"skipIndex":0,"section_code":"section122596","featured_images":1412584.0,"id":98055,"singleSection":false});				  						galleries[91427] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Weddings","link":"section122596_91427.html","maxRecords":0.0,"photoIDs":[3270777.0,3270784.0,3270791.0,3270795.0,8103258.0,1400001.0,3270742.0,1295147.0,2656116.0,1509736.0,1297299.0,1400002.0,1509738.0,1348101.0,1509739.0,1509740.0,1348098.0,1509722.0,2656117.0,2656118.0,2656119.0,2656121.0,1411071.0,1411084.0,1509723.0,1509737.0,1297341.0,1411082.0,1509725.0],"skipIndex":0,"section_code":"section122596","featured_images":"3270795,3270791,3270784,3270777,2656118,2656116,1400002,1295147","id":91427,"singleSection":false});				  						galleries[109510] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Civil Partnerships","link":"section122596_109510.html","maxRecords":0.0,"photoIDs":[1608414.0,1669809.0,1297340.0],"skipIndex":0,"section_code":"section122596","featured_images":"1669809,1608414,1297340","id":109510,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8118365,8103258,8103212,3270795,3270791,3270784,3270777,1400001,2656116,1295147,1509736,1509738,1348101,1509739,1509722,1412589,2656118,1509737,1509723,1297341,1509725';
imageSets[2] = '8118365,8118330,8118306,8103218,3270795,3270791,3270784,3270777,2656110,1399998,2656116,2656111,1295147,2656113,1400002,1363674,2656118,1297808,1412584';
imageSets[3] = '8118365';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/shaun/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/shaun/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/shaun/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/shaun/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/shaun/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/shaun/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/shaun/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/shaun/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/shaun/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/shaun/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/shaun/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/shaun/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/shaun/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/shaun/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/shaun/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/shaun/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/shaun/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/shaun/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/shaun/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/shaun/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/shaun/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/shaun/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/shaun/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/shaun/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/shaun/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/shaun/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/shaun/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 += 'section122596.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 && 'section122596' != '') {
					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 = 'Shaun Haigh Photography: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		if (op.$photo.length > 0) {
		html = $('<img/>',{
			'class': 'mainphoto photo',
			src: photoSrc,
			id: 'mainPic',
			name: 'mainPic',
			width: op.nextPhoto.width,
			height: op.nextPhoto.height,
			alt: photoCaption,
			css: op.css || {}
		});
		if (op.href) {
			if (op.href.match(/<a/)) {
				html = $(op.href).append(html);
			} else {
				html = $('<a/>', {
					href: op.href,
					title: photoCaption
				}).append(html);
			}
		} else {
			html = $('<a/>', {
				title: photoCaption
			}).append(html);
		}
		if (op.speed == 0) {			op.$photo.html(html);			if (op.onBefore) {			  	op.onBefore.apply(op.$photo);			}			if (op.onAfter) {			  	op.onAfter.apply(op.$photo);			}		} else {			op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){  				if (op.onAfter) {				  	op.onAfter.apply(this);				}				clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));			}, op.onBefore);
		}	}
    if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
        if (!op.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.photo_ref != '') {
		temp += '<div class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</div>';
	}
		if (this.takendate != '') {
		
		temp += '<div class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</div>';
	}
	
	if (this.location != '') {
		
		temp += '<div class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</div>';
	}
				
				if (temp != '') {
		temp += '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp += '<p>Order this print:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> ' + (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;
	}
}

			

