window.thumbnails = {};
															thumbnails[3169991] = clik.newPhoto({"id":3169991,"src":"wed-price-logo2_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":98});
															thumbnails[5335468] = clik.newPhoto({"id":5335468,"src":"Price_Guide_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":107});
															thumbnails[5333400] = clik.newPhoto({"id":5333400,"src":"_DSC0145_thumb.jpg","galleries_id":300357,"server_id":1,"link":"photo_5333400.html","width":130,"caption":"Wedding Bouquet","height":194});
															thumbnails[5333407] = clik.newPhoto({"id":5333407,"src":"Camb1_thumb.jpg","galleries_id":70775,"server_id":1,"link":"photo_5333407.html","width":130,"caption":"Cambridge in the Mist","height":87});
															thumbnails[5333412] = clik.newPhoto({"id":5333412,"src":"blossom_blue_thumb.jpg","galleries_id":70782,"server_id":1,"link":"photo_5333412.html","width":130,"caption":"Blossom Blues","height":87});
															thumbnails[5333418] = clik.newPhoto({"id":5333418,"src":"JJG_0064_thumb.jpg","galleries_id":71031,"server_id":1,"link":"photo_5333418.html","width":130,"caption":"Tranquility ","height":87});
															thumbnails[5333428] = clik.newPhoto({"id":5333428,"src":"JJG_0105_thumb.jpg","galleries_id":300357,"server_id":1,"link":"photo_5333428.html","width":130,"caption":"Instructions","height":194});
															thumbnails[5333436] = clik.newPhoto({"id":5333436,"src":"JJG_MarkSarah-133_bw_thumb.jpg","galleries_id":300357,"server_id":1,"link":"photo_5333436.html","width":130,"caption":"Mark & Sarah ","height":194});
															thumbnails[5333444] = clik.newPhoto({"id":5333444,"src":"DSC_0034_thumb.jpg","galleries_id":300357,"server_id":1,"link":"photo_5333444.html","width":130,"caption":"Getting Ready","height":195});
															thumbnails[5334933] = clik.newPhoto({"id":5334933,"src":"DSC_0319_thumb.jpg","galleries_id":70782,"server_id":1,"link":"photo_5334933.html","width":130,"caption":"Ladybird","height":87});
															thumbnails[5334934] = clik.newPhoto({"id":5334934,"src":"DSC_0311_thumb.jpg","galleries_id":70782,"server_id":1,"link":"photo_5334934.html","width":130,"caption":"Lady Bird & Nettle","height":195});
															thumbnails[5334935] = clik.newPhoto({"id":5334935,"src":"DSC_0293_thumb.jpg","galleries_id":70782,"server_id":1,"link":"photo_5334935.html","width":130,"caption":"Opening Dandelion","height":87});
															thumbnails[5334941] = clik.newPhoto({"id":5334941,"src":"DSC_0141_copy_5_thumb.jpg","galleries_id":70782,"server_id":1,"link":"photo_5334941.html","width":130,"caption":"All that Remains","height":86});
															thumbnails[5334944] = clik.newPhoto({"id":5334944,"src":"DSC_0034_with_text_thumb.jpg","galleries_id":70782,"server_id":1,"link":"photo_5334944.html","width":130,"caption":"Betula pendula","height":87});
															thumbnails[5334950] = clik.newPhoto({"id":5334950,"src":"JJG_0102textured_thumb.jpg","galleries_id":70782,"server_id":1,"link":"photo_5334950.html","width":130,"caption":"Flower Cup","height":87});
															thumbnails[5334953] = clik.newPhoto({"id":5334953,"src":"JJG_0035_thumb.jpg","galleries_id":70782,"server_id":1,"link":"photo_5334953.html","width":130,"caption":"Purity in White","height":181});
															thumbnails[5334956] = clik.newPhoto({"id":5334956,"src":"DSC_0021_copy_thumb.jpg","galleries_id":70782,"server_id":1,"link":"photo_5334956.html","width":130,"caption":"Water Drops","height":87});
															thumbnails[5334957] = clik.newPhoto({"id":5334957,"src":"DSC_0015_copy_thumb.jpg","galleries_id":70782,"server_id":1,"link":"photo_5334957.html","width":130,"caption":"Droplets on Leaf","height":178});
															thumbnails[5334958] = clik.newPhoto({"id":5334958,"src":"DSC_0004_thumb.jpg","galleries_id":70782,"server_id":1,"link":"photo_5334958.html","width":130,"caption":"Sky Bubbles","height":87});
															thumbnails[5334961] = clik.newPhoto({"id":5334961,"src":"tint_pink_thumb.jpg","galleries_id":70782,"server_id":1,"link":"photo_5334961.html","width":130,"caption":"Tint Pink!","height":87});
															thumbnails[5334962] = clik.newPhoto({"id":5334962,"src":"DSC_0201_thumb.jpg","galleries_id":70782,"server_id":1,"link":"photo_5334962.html","width":130,"caption":"Inachis io","height":87});
															thumbnails[5334963] = clik.newPhoto({"id":5334963,"src":"DSC_0372_thumb.jpg","galleries_id":70782,"server_id":1,"link":"photo_5334963.html","width":130,"caption":"Dandelion Seeds","height":87});
															thumbnails[5334965] = clik.newPhoto({"id":5334965,"src":"dypy_3_logo_thumb.jpg","galleries_id":300357,"server_id":1,"link":"photo_5334965.html","width":130,"caption":"The Wait","height":130});
															thumbnails[5334967] = clik.newPhoto({"id":5334967,"src":"JJG_MarkSarah-139_thumb.jpg","galleries_id":300357,"server_id":1,"link":"photo_5334967.html","width":130,"caption":"Mark & Sarah, First Dance","height":194});
															thumbnails[5334969] = clik.newPhoto({"id":5334969,"src":"JJG_MarkSarah-114_thumb.jpg","galleries_id":300357,"server_id":1,"link":"photo_5334969.html","width":130,"caption":"Mark & Sarah, Group","height":87});
															thumbnails[5334970] = clik.newPhoto({"id":5334970,"src":"JJG_MarkSarah-97_thumb.jpg","galleries_id":300357,"server_id":1,"link":"photo_5334970.html","width":130,"caption":"Jazz Hands!","height":87});
															thumbnails[5334975] = clik.newPhoto({"id":5334975,"src":"JJG_MarkSarah-83_bw_thumb.jpg","galleries_id":300357,"server_id":1,"link":"photo_5334975.html","width":130,"caption":"Mark & Sarah, Making Entrance ","height":195});
															thumbnails[5334979] = clik.newPhoto({"id":5334979,"src":"JJG_MarkSarah-81_thumb.jpg","galleries_id":300357,"server_id":1,"link":"photo_5334979.html","width":130,"caption":"Mark & Sarah, Gate Entrance","height":194});
															thumbnails[5334981] = clik.newPhoto({"id":5334981,"src":"JJG_MarkSarah-48_-_colour_pop_thumb.jpg","galleries_id":300357,"server_id":1,"link":"photo_5334981.html","width":130,"caption":"Bridesmaids Bouquets","height":194});
															thumbnails[5334983] = clik.newPhoto({"id":5334983,"src":"DSC_0213_thumb.jpg","galleries_id":300357,"server_id":1,"link":"photo_5334983.html","width":130,"caption":"Love of Swings","height":197});
															thumbnails[5334986] = clik.newPhoto({"id":5334986,"src":"DSC_0181_thumb.jpg","galleries_id":300357,"server_id":1,"link":"photo_5334986.html","width":130,"caption":"Speech Nerves ","height":195});
															thumbnails[5334989] = clik.newPhoto({"id":5334989,"src":"JJG_0011_thumb.jpg","galleries_id":300357,"server_id":1,"link":"photo_5334989.html","width":130,"caption":"Pink Bouquet","height":194});
															thumbnails[5334992] = clik.newPhoto({"id":5334992,"src":"JJG_0170_thumb.jpg","galleries_id":300357,"server_id":1,"link":"photo_5334992.html","width":130,"caption":"The Signature, Bouquet ","height":194});
															thumbnails[5334993] = clik.newPhoto({"id":5334993,"src":"JJG_0127_BW_thumb.jpg","galleries_id":300357,"server_id":1,"link":"photo_5334993.html","width":130,"caption":"Dave & Anna","height":194});
															thumbnails[5334995] = clik.newPhoto({"id":5334995,"src":"JJG_0092_thumb.jpg","galleries_id":300357,"server_id":1,"link":"photo_5334995.html","width":130,"caption":"Ready for Action","height":87});
															thumbnails[5334997] = clik.newPhoto({"id":5334997,"src":"JJG_0247_thumb.jpg","galleries_id":300357,"server_id":1,"link":"photo_5334997.html","width":130,"caption":"Chameleon Dance Floor","height":87});
															thumbnails[5334998] = clik.newPhoto({"id":5334998,"src":"JJG2_0156_thumb.jpg","galleries_id":300357,"server_id":1,"link":"photo_5334998.html","width":130,"caption":"Gary & Lindsay, Group","height":87});
															thumbnails[5335000] = clik.newPhoto({"id":5335000,"src":"JJG2_0057_thumb.jpg","galleries_id":300357,"server_id":1,"link":"photo_5335000.html","width":130,"caption":"Gary & Lindsay, Limo ","height":87});
															thumbnails[5335002] = clik.newPhoto({"id":5335002,"src":"JJG2_0028_thumb.jpg","galleries_id":300357,"server_id":1,"link":"photo_5335002.html","width":130,"caption":"The Signing","height":194});
															thumbnails[5335005] = clik.newPhoto({"id":5335005,"src":"rhianadam_dancesmile_thumb.jpg","galleries_id":300357,"server_id":1,"link":"photo_5335005.html","width":130,"caption":"Rhian & Adam, First Dance","height":95});
															thumbnails[5335006] = clik.newPhoto({"id":5335006,"src":"adam_embarrased_thumb.jpg","galleries_id":300357,"server_id":1,"link":"photo_5335006.html","width":130,"caption":"Speech Embarrassment ","height":87});
															thumbnails[5335007] = clik.newPhoto({"id":5335007,"src":"bridesmaid_bouquet_thumb.jpg","galleries_id":300357,"server_id":1,"link":"photo_5335007.html","width":130,"caption":"Bridesmaid Bouquet, Purple","height":87});
															thumbnails[5335009] = clik.newPhoto({"id":5335009,"src":"rhianadam_church_thumb.jpg","galleries_id":300357,"server_id":1,"link":"photo_5335009.html","width":130,"caption":"Rhian & Adam","height":199});
															thumbnails[5335012] = clik.newPhoto({"id":5335012,"src":"DSC_0002_thumb.jpg","galleries_id":300357,"server_id":1,"link":"photo_5335012.html","width":130,"caption":"Rings","height":97});
															thumbnails[5335013] = clik.newPhoto({"id":5335013,"src":"_DSC0057_copy_thumb.jpg","galleries_id":300357,"server_id":1,"link":"photo_5335013.html","width":130,"caption":"Claire & Dean","height":88});
															thumbnails[5335015] = clik.newPhoto({"id":5335015,"src":"DSC_01300005_thumb.jpg","galleries_id":300357,"server_id":1,"link":"photo_5335015.html","width":130,"caption":"Gareth & Claire","height":195});
															thumbnails[5335051] = clik.newPhoto({"id":5335051,"src":"DSC_00980004_thumb.jpg","galleries_id":300357,"server_id":1,"link":"photo_5335051.html","width":130,"caption":"Bride's Bouquet","height":195});
															thumbnails[5335105] = clik.newPhoto({"id":5335105,"src":"DSC_00590002_thumb.jpg","galleries_id":300357,"server_id":1,"link":"photo_5335105.html","width":130,"caption":"Happy Clapper","height":87});
															thumbnails[5335107] = clik.newPhoto({"id":5335107,"src":"DSC_00560003_thumb.jpg","galleries_id":300357,"server_id":1,"link":"photo_5335107.html","width":130,"caption":"Together","height":195});
															thumbnails[5335113] = clik.newPhoto({"id":5335113,"src":"DSC_00370001_thumb.jpg","galleries_id":300357,"server_id":1,"link":"photo_5335113.html","width":130,"caption":"Father & Bride","height":87});
															thumbnails[5335150] = clik.newPhoto({"id":5335150,"src":"DSC_00270006_thumb.jpg","galleries_id":300357,"server_id":1,"link":"photo_5335150.html","width":130,"caption":"Button Holes","height":87});
															thumbnails[5335178] = clik.newPhoto({"id":5335178,"src":"_DSC0128_thumb.jpg","galleries_id":300357,"server_id":1,"link":"photo_5335178.html","width":130,"caption":"Anthony & Christine, Signing","height":87});
															thumbnails[5335208] = clik.newPhoto({"id":5335208,"src":"_DSC0108_thumb.jpg","galleries_id":300357,"server_id":1,"link":"photo_5335208.html","width":130,"caption":"Flowing Dress","height":87});
															thumbnails[5335250] = clik.newPhoto({"id":5335250,"src":"Scotland__2006_0560001_thumb.jpg","galleries_id":70775,"server_id":1,"link":"photo_5335250.html","width":130,"caption":"Number 3","height":87});
															thumbnails[5335253] = clik.newPhoto({"id":5335253,"src":"DSC_0198_thumb.jpg","galleries_id":70775,"server_id":1,"link":"photo_5335253.html","width":130,"caption":"Hail Storm","height":87});
															thumbnails[5335258] = clik.newPhoto({"id":5335258,"src":"DSC_0483_thumb.jpg","galleries_id":70775,"server_id":1,"link":"photo_5335258.html","width":130,"caption":"Untouched","height":195});
															thumbnails[5335298] = clik.newPhoto({"id":5335298,"src":"DSC_0180_thumb.jpg","galleries_id":70775,"server_id":1,"link":"photo_5335298.html","width":130,"caption":"Woburn Woodland Walk","height":130});
															thumbnails[5335304] = clik.newPhoto({"id":5335304,"src":"JJG_0011_copy_thumb.jpg","galleries_id":70775,"server_id":1,"link":"photo_5335304.html","width":130,"caption":"One Windy Day","height":194});
															thumbnails[5335308] = clik.newPhoto({"id":5335308,"src":"DSC_0021_thumb.jpg","galleries_id":70775,"server_id":1,"link":"photo_5335308.html","width":130,"caption":"Autumn Red Vine","height":195});
															thumbnails[5335314] = clik.newPhoto({"id":5335314,"src":"Field_Tiltshift_thumb.jpg","galleries_id":70775,"server_id":1,"link":"photo_5335314.html","width":130,"caption":"Shillington Field (T\/S)","height":130});
															thumbnails[5335318] = clik.newPhoto({"id":5335318,"src":"DSC_0046_copy_thumb.jpg","galleries_id":70775,"server_id":1,"link":"photo_5335318.html","width":130,"caption":"Hoppys Folly","height":62});
															thumbnails[5335322] = clik.newPhoto({"id":5335322,"src":"DSC_0047_thumb.jpg","galleries_id":70775,"server_id":1,"link":"photo_5335322.html","width":130,"caption":"Piper Wait","height":180});
															thumbnails[5335324] = clik.newPhoto({"id":5335324,"src":"DSC_0017_copy_thumb.jpg","galleries_id":70775,"server_id":1,"link":"photo_5335324.html","width":130,"caption":"No Name","height":163});
															thumbnails[5335325] = clik.newPhoto({"id":5335325,"src":"_DSC0076_thumb.jpg","galleries_id":70775,"server_id":1,"link":"photo_5335325.html","width":130,"caption":"Long Walk Home","height":87});
															thumbnails[5335329] = clik.newPhoto({"id":5335329,"src":"_DSC0005_thumb.jpg","galleries_id":70775,"server_id":1,"link":"photo_5335329.html","width":130,"caption":"Tram-Lines","height":194});
															thumbnails[5335331] = clik.newPhoto({"id":5335331,"src":"_DSC0113_bw_thumb.jpg","galleries_id":70775,"server_id":1,"link":"photo_5335331.html","width":130,"caption":"The Bishop","height":93});
															thumbnails[5335333] = clik.newPhoto({"id":5335333,"src":"DSC_0031_thumb.jpg","galleries_id":70775,"server_id":1,"link":"photo_5335333.html","width":130,"caption":"Fishing Boats","height":68});
															thumbnails[5335334] = clik.newPhoto({"id":5335334,"src":"DSC_00090001_thumb.jpg","galleries_id":70775,"server_id":1,"link":"photo_5335334.html","width":130,"caption":"Hounds","height":87});
															thumbnails[5335336] = clik.newPhoto({"id":5335336,"src":"DSC_0004_copy_thumb.jpg","galleries_id":70775,"server_id":1,"link":"photo_5335336.html","width":130,"caption":"Meppershall Water Tower","height":87});
															thumbnails[5335340] = clik.newPhoto({"id":5335340,"src":"DSC_0184_remember_thumb.jpg","galleries_id":70775,"server_id":1,"link":"photo_5335340.html","width":130,"caption":"Remember","height":87});
															thumbnails[5335343] = clik.newPhoto({"id":5335343,"src":"WithornSky_thumb.jpg","galleries_id":70775,"server_id":1,"link":"photo_5335343.html","width":130,"caption":"Isle of Whithorn, Bay","height":87});
															thumbnails[5335351] = clik.newPhoto({"id":5335351,"src":"Opening_thumb.jpg","galleries_id":71031,"server_id":1,"link":"photo_5335351.html","width":130,"caption":"The Opening","height":130});
															thumbnails[5335355] = clik.newPhoto({"id":5335355,"src":"canterburyhdr2_thumb.jpg","galleries_id":71031,"server_id":1,"link":"photo_5335355.html","width":130,"caption":"Canterbury Interior ","height":194});
															thumbnails[5335410] = clik.newPhoto({"id":5335410,"src":"DSC_0068_thumb.jpg","galleries_id":71031,"server_id":1,"link":"photo_5335410.html","width":130,"caption":"Norwich Cathedral ","height":195});
															thumbnails[5335412] = clik.newPhoto({"id":5335412,"src":"DSC_00210001_thumb.jpg","galleries_id":71031,"server_id":1,"link":"photo_5335412.html","width":130,"caption":"Arches","height":163});
															thumbnails[5335415] = clik.newPhoto({"id":5335415,"src":"DSC_0721_thumb.jpg","galleries_id":71031,"server_id":1,"link":"photo_5335415.html","width":130,"caption":"The Blue Door","height":87});
															thumbnails[5335423] = clik.newPhoto({"id":5335423,"src":"DSC_0045_copy_thumb.jpg","galleries_id":70775,"server_id":1,"link":"photo_5335423.html","width":130,"caption":"Paul & Bridie","height":104});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[70775] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Landscape","link":"gallery_70775.html","maxRecords":0.0,"photoIDs":[5333407.0,5335250.0,5335253.0,5335258.0,5335298.0,5335304.0,5335308.0,5335314.0,5335318.0,5335322.0,5335324.0,5335325.0,5335329.0,5335331.0,5335333.0,5335334.0,5335336.0,5335340.0,5335343.0,5335423.0],"skipIndex":0,"section_code":"gallery","featured_images":"5335423,5335343,5335340,5335336,5335334,5335333,5335331,5335329,5335325,5335324","id":70775,"singleSection":false});				  						galleries[70782] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Macro","link":"gallery_70782.html","maxRecords":0.0,"photoIDs":[5333412.0,5334933.0,5334934.0,5334935.0,5334941.0,5334944.0,5334950.0,5334953.0,5334956.0,5334957.0,5334958.0,5334961.0,5334962.0,5334963.0],"skipIndex":0,"section_code":"gallery","featured_images":"5334963,5334962,5334961,5334958,5334957,5334956,5334953,5334950,5334944,5334941","id":70782,"singleSection":false});				  						galleries[71031] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Architecture","link":"gallery_71031.html","maxRecords":0.0,"photoIDs":[5333418.0,5335351.0,5335355.0,5335410.0,5335412.0,5335415.0],"skipIndex":0,"section_code":"gallery","featured_images":"5335415,5335412,5335410,5335355,5335351,5333418","id":71031,"singleSection":false});				  						galleries[300357] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Wedding","link":"gallery_300357.html","maxRecords":0.0,"photoIDs":[5333400.0,5333428.0,5333436.0,5333444.0,5334965.0,5334967.0,5334969.0,5334970.0,5334975.0,5334979.0,5334981.0,5334983.0,5334986.0,5334989.0,5334992.0,5334993.0,5334995.0,5334997.0,5334998.0,5335000.0,5335002.0,5335005.0,5335006.0,5335007.0,5335009.0,5335012.0,5335013.0,5335015.0,5335051.0,5335105.0,5335107.0,5335113.0,5335150.0,5335178.0,5335208.0],"skipIndex":0,"section_code":"gallery","featured_images":"5335208,5335178,5335150,5335113,5335107,5335105,5335051,5335015,5335013,5335012","id":300357,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '5335468,5335423,5335415,5335412,5335410,5335355,5335351,5335343,5335340,5335336,5335334,5335333,5335331,5335329,5335325,5335324,5335322,5335318,5335314,5335308,5335304,5335298,5335258,5335253,5335250,5335208,5335178,5335150,5335113,5335107,5335105,5335051,5335015,5335013,5335012,5335009,5335007,5335006,5335005,5335002,5335000,5334998,5334997,5334995,5334993,5334992,5334989,5334986,5334983,5334981';
imageSets[3] = '3169991';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/JJGainsford/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/JJGainsford/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/JJGainsford/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/JJGainsford/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/JJGainsford/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/JJGainsford/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/JJGainsford/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/JJGainsford/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/JJGainsford/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/JJGainsford/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/JJGainsford/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/JJGainsford/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/JJGainsford/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/JJGainsford/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/JJGainsford/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/JJGainsford/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/JJGainsford/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/JJGainsford/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/JJGainsford/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/JJGainsford/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/JJGainsford/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/JJGainsford/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/JJGainsford/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/JJGainsford/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/JJGainsford/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/JJGainsford/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 && backgrounds[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 = 'JJG 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 !== '' || this.payment_groups_id !== '') {
			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;
	}
}

			

