window.thumbnails = {};
															thumbnails[9060196] = clik.newPhoto({"id":9060196,"src":"168944_1723537482690_1065942769_1926930_2971321_n_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":114});
															thumbnails[9060243] = clik.newPhoto({"id":9060243,"src":"167034_1677236645198_1065942769_1848213_399109_n_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":145});
															thumbnails[845125] = clik.newPhoto({"id":845125,"src":"2007 06 30 112 copyjpg_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_845125.html","width":130,"caption":"","height":87});
															thumbnails[845195] = clik.newPhoto({"id":845195,"src":"2007 06 03 091jpg_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_845195.html","width":130,"caption":"The deed done!","height":87});
															thumbnails[845197] = clik.newPhoto({"id":845197,"src":"lifestyle portraits 007_thumb.jpg","galleries_id":65163,"server_id":18,"link":"photo_845197.html","width":130,"caption":"Lovely Abi","height":173});
															thumbnails[845199] = clik.newPhoto({"id":845199,"src":"2007 06 03 179jpg_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_845199.html","width":130,"caption":"","height":87});
															thumbnails[845203] = clik.newPhoto({"id":845203,"src":"Picture 339 copyjpg_thumb.jpg","galleries_id":65163,"server_id":18,"link":"photo_845203.html","width":130,"caption":"","height":216});
															thumbnails[845205] = clik.newPhoto({"id":845205,"src":"lifestyle portraits 012_thumb.jpg","galleries_id":65163,"server_id":18,"link":"photo_845205.html","width":130,"caption":"Water babe","height":97});
															thumbnails[845206] = clik.newPhoto({"id":845206,"src":"lifestyle portraits 033_thumb.jpg","galleries_id":65163,"server_id":18,"link":"photo_845206.html","width":130,"caption":"Moody Lucy!","height":194});
															thumbnails[845330] = clik.newPhoto({"id":845330,"src":"lifestyle portraits 011_thumb.jpg","galleries_id":65163,"server_id":18,"link":"photo_845330.html","width":130,"caption":"Tiny toes","height":97});
															thumbnails[845332] = clik.newPhoto({"id":845332,"src":"2007 06 30 017 copyjpg_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_845332.html","width":130,"caption":"","height":96});
															thumbnails[847666] = clik.newPhoto({"id":847666,"src":"_DSC0131 copyjpg_thumb.jpg","galleries_id":65163,"server_id":18,"link":"photo_847666.html","width":130,"caption":"","height":194});
															thumbnails[847669] = clik.newPhoto({"id":847669,"src":"lifestyle portraits 029_thumb.jpg","galleries_id":65163,"server_id":18,"link":"photo_847669.html","width":130,"caption":"Cheeky monkey","height":87});
															thumbnails[847672] = clik.newPhoto({"id":847672,"src":"Picture 341 copyjpg_thumb.jpg","galleries_id":65163,"server_id":18,"link":"photo_847672.html","width":130,"caption":"","height":194});
															thumbnails[854136] = clik.newPhoto({"id":854136,"src":"_DSC0168 copyjpg_thumb.jpg","galleries_id":65163,"server_id":18,"link":"photo_854136.html","width":130,"caption":"","height":194});
															thumbnails[854137] = clik.newPhoto({"id":854137,"src":"lifestyle portraits 035_thumb.jpg","galleries_id":65163,"server_id":18,"link":"photo_854137.html","width":130,"caption":"Russia with laughs!","height":87});
															thumbnails[854145] = clik.newPhoto({"id":854145,"src":"2007 06 30 026 copy2 copyjpg_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_854145.html","width":130,"caption":"","height":130});
															thumbnails[867434] = clik.newPhoto({"id":867434,"src":"2007 06 30 120 copyjpg_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_867434.html","width":130,"caption":"","height":194});
															thumbnails[867439] = clik.newPhoto({"id":867439,"src":"copy 3 copyjpg_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_867439.html","width":130,"caption":"","height":194});
															thumbnails[929326] = clik.newPhoto({"id":929326,"src":"radha and john 059jpg_thumb.jpg","galleries_id":65163,"server_id":18,"link":"photo_929326.html","width":130,"caption":"Trendy couple","height":194});
															thumbnails[929333] = clik.newPhoto({"id":929333,"src":"radha and john 081jpg_thumb.jpg","galleries_id":65163,"server_id":18,"link":"photo_929333.html","width":130,"caption":"A kiss!","height":87});
															thumbnails[1086972] = clik.newPhoto({"id":1086972,"src":"2007 05 28 007 copyjpg_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_1086972.html","width":130,"caption":"","height":233});
															thumbnails[1087005] = clik.newPhoto({"id":1087005,"src":"2007 05 28 013jpg_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_1087005.html","width":130,"caption":"","height":194});
															thumbnails[1087024] = clik.newPhoto({"id":1087024,"src":"2007 06 03 200jpg_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_1087024.html","width":130,"caption":"","height":87});
															thumbnails[1087158] = clik.newPhoto({"id":1087158,"src":"2007 05 28 036jpg_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_1087158.html","width":130,"caption":"","height":194});
															thumbnails[1087165] = clik.newPhoto({"id":1087165,"src":"2007 05 28 096jpg_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_1087165.html","width":130,"caption":"","height":194});
															thumbnails[1087167] = clik.newPhoto({"id":1087167,"src":"2007 05 28 030jpg2_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_1087167.html","width":130,"caption":"","height":194});
															thumbnails[1087168] = clik.newPhoto({"id":1087168,"src":"2007 05 28 101jpg_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_1087168.html","width":130,"caption":"","height":87});
															thumbnails[1087178] = clik.newPhoto({"id":1087178,"src":"2007 05 28 167jpg_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_1087178.html","width":130,"caption":"","height":194});
															thumbnails[1087181] = clik.newPhoto({"id":1087181,"src":"2007 06 03 027jpg_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_1087181.html","width":130,"caption":"","height":194});
															thumbnails[1087183] = clik.newPhoto({"id":1087183,"src":"2007 06 03 055jpg_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_1087183.html","width":130,"caption":"","height":194});
															thumbnails[1087197] = clik.newPhoto({"id":1087197,"src":"2007 06 03 096jpg_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_1087197.html","width":130,"caption":"","height":87});
															thumbnails[1087234] = clik.newPhoto({"id":1087234,"src":"2007 06 03 109jpg_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_1087234.html","width":130,"caption":"","height":194});
															thumbnails[1087261] = clik.newPhoto({"id":1087261,"src":"2007 06 03 183jpg_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_1087261.html","width":130,"caption":"","height":194});
															thumbnails[1087274] = clik.newPhoto({"id":1087274,"src":"2007 06 03 189jpg_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_1087274.html","width":130,"caption":"","height":87});
															thumbnails[1165905] = clik.newPhoto({"id":1165905,"src":"2007 06 30 123 copy 2jpg_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_1165905.html","width":130,"caption":"","height":87});
															thumbnails[1410541] = clik.newPhoto({"id":1410541,"src":"11 Aug 2007 033 copyjpg_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_1410541.html","width":130,"caption":"","height":194});
															thumbnails[1410542] = clik.newPhoto({"id":1410542,"src":"11 Aug 2007 051jpg_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_1410542.html","width":130,"caption":"","height":194});
															thumbnails[1410544] = clik.newPhoto({"id":1410544,"src":"11 Aug 2007 061 copyjpg_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_1410544.html","width":130,"caption":"","height":194});
															thumbnails[1410545] = clik.newPhoto({"id":1410545,"src":"2007 06 30 001 copyjpg_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_1410545.html","width":130,"caption":"","height":194});
															thumbnails[1410546] = clik.newPhoto({"id":1410546,"src":"2007 08 01 104jpg_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_1410546.html","width":130,"caption":"","height":87});
															thumbnails[1410547] = clik.newPhoto({"id":1410547,"src":"2007 08 01 148jpg_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_1410547.html","width":130,"caption":"","height":183});
															thumbnails[1410548] = clik.newPhoto({"id":1410548,"src":"2007 08 01 151jpg_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_1410548.html","width":130,"caption":"","height":87});
															thumbnails[1410550] = clik.newPhoto({"id":1410550,"src":"2007 08 01 206jpg_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_1410550.html","width":130,"caption":"","height":194});
															thumbnails[1410551] = clik.newPhoto({"id":1410551,"src":"2007 08 01 232jpg_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_1410551.html","width":130,"caption":"","height":194});
															thumbnails[1410606] = clik.newPhoto({"id":1410606,"src":"21 Aug 2007 030 copyjpg_thumb.jpg","galleries_id":65163,"server_id":18,"link":"photo_1410606.html","width":130,"caption":"","height":87});
															thumbnails[1411787] = clik.newPhoto({"id":1411787,"src":"038 copyjpg_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_1411787.html","width":130,"caption":"","height":201});
															thumbnails[1411789] = clik.newPhoto({"id":1411789,"src":"08 Sep 2007 106jpg_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_1411789.html","width":130,"caption":"","height":194});
															thumbnails[1411792] = clik.newPhoto({"id":1411792,"src":"039jpg_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_1411792.html","width":130,"caption":"","height":87});
															thumbnails[1411794] = clik.newPhoto({"id":1411794,"src":"21 Aug 2007 032jpg_thumb.jpg","galleries_id":65163,"server_id":18,"link":"photo_1411794.html","width":130,"caption":"","height":194});
															thumbnails[1411796] = clik.newPhoto({"id":1411796,"src":"21 Aug 2007 044 copyjpg_thumb.jpg","galleries_id":65163,"server_id":18,"link":"photo_1411796.html","width":130,"caption":"","height":84});
															thumbnails[1411798] = clik.newPhoto({"id":1411798,"src":"21 Aug 2007 057 copyjpg_thumb.jpg","galleries_id":65163,"server_id":18,"link":"photo_1411798.html","width":130,"caption":"","height":194});
															thumbnails[1827362] = clik.newPhoto({"id":1827362,"src":"2007 07 18 064JPG_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_1827362.html","width":130,"caption":"The Little Details...","height":194});
															thumbnails[1827363] = clik.newPhoto({"id":1827363,"src":"2007 07 18 100JPG_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_1827363.html","width":130,"caption":"The Groom's last dance!!","height":87});
															thumbnails[2074273] = clik.newPhoto({"id":2074273,"src":"_DSC0018 copy001_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_2074273.html","width":130,"caption":"A Windy Day for it!!","height":83});
															thumbnails[2074290] = clik.newPhoto({"id":2074290,"src":"_DSC1996 copy_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_2074290.html","width":130,"caption":"Order of Service","height":87});
															thumbnails[2074301] = clik.newPhoto({"id":2074301,"src":"_DSC2018 copy1_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_2074301.html","width":130,"caption":"Confetti!","height":87});
															thumbnails[2074328] = clik.newPhoto({"id":2074328,"src":"_DSC0038 copy_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_2074328.html","width":130,"caption":"Bride's Flowers","height":194});
															thumbnails[2074337] = clik.newPhoto({"id":2074337,"src":"_DSC0069_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_2074337.html","width":130,"caption":"The Ceremony's about to start!","height":87});
															thumbnails[2585635] = clik.newPhoto({"id":2585635,"src":"_DSC4625JPG_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_2585635.html","width":130,"caption":"Thats my wife!","height":194});
															thumbnails[2585636] = clik.newPhoto({"id":2585636,"src":"_DSC4772JPG_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_2585636.html","width":130,"caption":"","height":194});
															thumbnails[2585649] = clik.newPhoto({"id":2585649,"src":"_DSC4741JPG_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_2585649.html","width":130,"caption":"Italian Villa - Wedding Breakfast","height":87});
															thumbnails[2585654] = clik.newPhoto({"id":2585654,"src":"_DSC3252JPG_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_2585654.html","width":130,"caption":"Don't lose them!!","height":87});
															thumbnails[2585659] = clik.newPhoto({"id":2585659,"src":"_DSC3353JPG_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_2585659.html","width":130,"caption":"A walk in the Golf course...Four!!","height":87});
															thumbnails[2585660] = clik.newPhoto({"id":2585660,"src":"_DSC2736JPG_thumb.jpg","galleries_id":65163,"server_id":18,"link":"photo_2585660.html","width":130,"caption":"","height":87});
															thumbnails[2585667] = clik.newPhoto({"id":2585667,"src":"_DSC3148JPG_thumb.jpg","galleries_id":65163,"server_id":18,"link":"photo_2585667.html","width":130,"caption":"","height":87});
															thumbnails[2585669] = clik.newPhoto({"id":2585669,"src":"_DSC3016JPG_thumb.jpg","galleries_id":65163,"server_id":18,"link":"photo_2585669.html","width":130,"caption":"","height":194});
															thumbnails[2585671] = clik.newPhoto({"id":2585671,"src":"BECKY 30-5-09-38JPG_thumb.jpg","galleries_id":65163,"server_id":18,"link":"photo_2585671.html","width":130,"caption":"","height":94});
															thumbnails[2585672] = clik.newPhoto({"id":2585672,"src":"_DSC3636 copyJPG_thumb.jpg","galleries_id":65163,"server_id":18,"link":"photo_2585672.html","width":130,"caption":"","height":87});
															thumbnails[3029168] = clik.newPhoto({"id":3029168,"src":"DSC_0506_thumb.jpg","galleries_id":186304,"server_id":18,"link":"photo_3029168.html","width":130,"caption":"The Bump","height":130});
															thumbnails[3029175] = clik.newPhoto({"id":3029175,"src":"DSC_0533 copy_thumb.jpg","galleries_id":186304,"server_id":18,"link":"photo_3029175.html","width":130,"caption":"Pretty in pink","height":196});
															thumbnails[3029184] = clik.newPhoto({"id":3029184,"src":"DSC_0512-2_thumb.jpg","galleries_id":186304,"server_id":18,"link":"photo_3029184.html","width":130,"caption":"","height":217});
															thumbnails[3029188] = clik.newPhoto({"id":3029188,"src":"DSC_0550_thumb.jpg","galleries_id":186304,"server_id":18,"link":"photo_3029188.html","width":130,"caption":"","height":196});
															thumbnails[3072173] = clik.newPhoto({"id":3072173,"src":"DSC_0627-3_thumb.jpg","galleries_id":186304,"server_id":18,"link":"photo_3072173.html","width":130,"caption":"Lilly Rose ","height":93});
															thumbnails[3072175] = clik.newPhoto({"id":3072175,"src":"DSC_0599_thumb.jpg","galleries_id":186304,"server_id":18,"link":"photo_3072175.html","width":130,"caption":"","height":86});
															thumbnails[3072177] = clik.newPhoto({"id":3072177,"src":"DSC_0635-2_thumb.jpg","galleries_id":186304,"server_id":18,"link":"photo_3072177.html","width":130,"caption":"Proud Dad!","height":130});
															thumbnails[8425167] = clik.newPhoto({"id":8425167,"src":"GemmaRyan_-376_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_8425167.html","width":130,"caption":"Romantic few moments","height":74});
															thumbnails[8425181] = clik.newPhoto({"id":8425181,"src":"NWP_2647_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_8425181.html","width":130,"caption":"Flowers","height":195});
															thumbnails[8425246] = clik.newPhoto({"id":8425246,"src":"NWP_2668_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_8425246.html","width":130,"caption":"Here come the girls...","height":86});
															thumbnails[8425250] = clik.newPhoto({"id":8425250,"src":"NWP_5886_thumb.jpg","galleries_id":80164,"server_id":18,"link":"photo_8425250.html","width":130,"caption":"Under the pier","height":224});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[80164] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Weddings","link":"gallery_80164.html","maxRecords":0.0,"photoIDs":[845125.0,845195.0,845199.0,845332.0,854145.0,867434.0,867439.0,1086972.0,1087005.0,1087024.0,1087158.0,1087165.0,1087167.0,1087168.0,1087178.0,1087181.0,1087183.0,1087197.0,1087234.0,1087261.0,1087274.0,1165905.0,1410541.0,1410542.0,1410544.0,1410545.0,1410546.0,1410547.0,1410548.0,1410550.0,1410551.0,1411787.0,1411789.0,1411792.0,1827362.0,1827363.0,2074273.0,2074290.0,2074301.0,2074328.0,2074337.0,2585635.0,2585636.0,2585649.0,2585654.0,2585659.0,8425167.0,8425181.0,8425246.0,8425250.0],"skipIndex":0,"section_code":"gallery","featured_images":"1827363,1411792,1410544,1165905,867439","id":80164,"singleSection":false});				  						galleries[65163] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Lifestyle Portraits","link":"gallery_65163.html","maxRecords":0.0,"photoIDs":[845197.0,845203.0,845205.0,845206.0,845330.0,847666.0,847669.0,847672.0,854136.0,854137.0,929326.0,929333.0,1410606.0,1411794.0,1411796.0,1411798.0,2585660.0,2585667.0,2585669.0,2585671.0,2585672.0],"skipIndex":0,"section_code":"gallery","featured_images":1411794.0,"id":65163,"singleSection":false});				  						galleries[186304] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Bump2baby","link":"gallery_186304.html","maxRecords":0.0,"photoIDs":[3029168.0,3029175.0,3029184.0,3029188.0,3072173.0,3072175.0,3072177.0],"skipIndex":0,"section_code":"gallery","featured_images":3072173.0,"id":186304,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '3029188,3029175,2585667,2585660,2585636,2585635,1827363,1411794,1411792,1410544,1165905,1087261,1087197,1087178,1087168,1087167,1086972,867439,854136,845206,845205,845203,845197';
imageSets[2] = '3072173,1827363,1411794,1411792,1410544,1165905,867439';
imageSets[3] = '2074337,2074273';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/nwestlake/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/nwestlake/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/nwestlake/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/nwestlake/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/nwestlake/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/nwestlake/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/nwestlake/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/nwestlake/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/nwestlake/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/nwestlake/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/nwestlake/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/nwestlake/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/nwestlake/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/nwestlake/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/nwestlake/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/nwestlake/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/nwestlake/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/nwestlake/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/nwestlake/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/nwestlake/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/nwestlake/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/nwestlake/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/nwestlake/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/nwestlake/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/nwestlake/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/nwestlake/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/nwestlake/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 = 'Nickie Westlake 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;
	}
}

			

