window.thumbnails = {};
															thumbnails[8491743] = clik.newPhoto({"id":8491743,"src":"IMG_4118_0693b_1_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":100,"caption":"","height":100});
															thumbnails[8181157] = clik.newPhoto({"id":8181157,"src":"DSC_0126_0214byc_thumb.jpg","galleries_id":207153,"server_id":1,"link":"photo_8181157.html","width":100,"caption":"","height":100});
															thumbnails[8181175] = clik.newPhoto({"id":8181175,"src":"DSC_0099_0190dyc_thumb.jpg","galleries_id":207153,"server_id":1,"link":"photo_8181175.html","width":100,"caption":"","height":100});
															thumbnails[8181178] = clik.newPhoto({"id":8181178,"src":"DSC_0032_0276b_TxtLovelyOvlyc_thumb.jpg","galleries_id":207153,"server_id":1,"link":"photo_8181178.html","width":100,"caption":"","height":100});
															thumbnails[8181179] = clik.newPhoto({"id":8181179,"src":"DSC_0075_0312_txtWRMRcEdge_thumb.jpg","galleries_id":207153,"server_id":1,"link":"photo_8181179.html","width":100,"caption":"","height":100});
															thumbnails[8181181] = clik.newPhoto({"id":8181181,"src":"DSC_0025_0270d_WrmrTSbSLb_thumb.jpg","galleries_id":207153,"server_id":1,"link":"photo_8181181.html","width":100,"caption":"","height":100});
															thumbnails[8181213] = clik.newPhoto({"id":8181213,"src":"DSC_0027_0357_LovelyOvlyc_thumb.jpg","galleries_id":207153,"server_id":1,"link":"photo_8181213.html","width":100,"caption":"","height":100});
															thumbnails[8181214] = clik.newPhoto({"id":8181214,"src":"DSC_0083_0318_LovelyVigSLcWrmr_thumb.jpg","galleries_id":207153,"server_id":1,"link":"photo_8181214.html","width":100,"caption":"","height":100});
															thumbnails[8181104] = clik.newPhoto({"id":8181104,"src":"DSC_0015_0115_Lovely55SFMidTonesb1_thumb.jpg","galleries_id":207153,"server_id":1,"link":"photo_8181104.html","width":100,"caption":"","height":100});
															thumbnails[8181108] = clik.newPhoto({"id":8181108,"src":"DSC_0048_0418_Lovely55SFSL50_thumb.jpg","galleries_id":207153,"server_id":1,"link":"photo_8181108.html","width":100,"caption":"","height":100});
															thumbnails[8181105] = clik.newPhoto({"id":8181105,"src":"DSC_0020_0390_SF60ZingLovely551_thumb.jpg","galleries_id":207153,"server_id":1,"link":"photo_8181105.html","width":100,"caption":"","height":100});
															thumbnails[8181109] = clik.newPhoto({"id":8181109,"src":"DSC_0054_0153_SFEB60LovelyMidTones_thumb.jpg","galleries_id":207153,"server_id":1,"link":"photo_8181109.html","width":100,"caption":"","height":100});
															thumbnails[8181106] = clik.newPhoto({"id":8181106,"src":"DSC_0027_0126_Lovely45SLSFb_thumb.jpg","galleries_id":207153,"server_id":1,"link":"photo_8181106.html","width":100,"caption":"","height":100});
															thumbnails[8181110] = clik.newPhoto({"id":8181110,"src":"DSC_0060_0159_SF45ZingLovelyMidTones_thumb.jpg","galleries_id":207153,"server_id":1,"link":"photo_8181110.html","width":100,"caption":"","height":100});
															thumbnails[8181176] = clik.newPhoto({"id":8181176,"src":"DSC_0167_0230_FCc_thumb.jpg","galleries_id":207153,"server_id":1,"link":"photo_8181176.html","width":100,"caption":"","height":100});
															thumbnails[8157278] = clik.newPhoto({"id":8157278,"src":"ROBINSON_A_23_thumb.jpg","galleries_id":207153,"server_id":1,"link":"photo_8157278.html","width":100,"caption":"","height":100});
															thumbnails[3397849] = clik.newPhoto({"id":3397849,"src":"31_Bouquet_20224_thumb.jpg","galleries_id":207153,"server_id":1,"link":"photo_3397849.html","width":100,"caption":"","height":100});
															thumbnails[3390067] = clik.newPhoto({"id":3390067,"src":"35_MakeupBW3_1937_thumb.jpg","galleries_id":207153,"server_id":1,"link":"photo_3390067.html","width":100,"caption":"","height":100});
															thumbnails[3399622] = clik.newPhoto({"id":3399622,"src":"5_Dresses_20802_thumb.jpg","galleries_id":207153,"server_id":1,"link":"photo_3399622.html","width":100,"caption":"","height":100});
															thumbnails[3399710] = clik.newPhoto({"id":3399710,"src":"GettingDressedBW_1875_thumb.jpg","galleries_id":207153,"server_id":1,"link":"photo_3399710.html","width":100,"caption":"","height":100});
															thumbnails[3399629] = clik.newPhoto({"id":3399629,"src":"13_Dresses_20852_thumb.jpg","galleries_id":207153,"server_id":1,"link":"photo_3399629.html","width":100,"caption":"","height":100});
															thumbnails[3399474] = clik.newPhoto({"id":3399474,"src":"DSC_0227_10531_thumb.jpg","galleries_id":207153,"server_id":1,"link":"photo_3399474.html","width":100,"caption":"","height":100});
															thumbnails[3399475] = clik.newPhoto({"id":3399475,"src":"44_Rings_19442_thumb.jpg","galleries_id":207153,"server_id":1,"link":"photo_3399475.html","width":100,"caption":"","height":100});
															thumbnails[3399505] = clik.newPhoto({"id":3399505,"src":"14_GettingDressed_18981_thumb.jpg","galleries_id":207153,"server_id":1,"link":"photo_3399505.html","width":100,"caption":"","height":100});
															thumbnails[3399712] = clik.newPhoto({"id":3399712,"src":"DSC_00943_thumb.jpg","galleries_id":207153,"server_id":1,"link":"photo_3399712.html","width":100,"caption":"","height":100});
															thumbnails[3399506] = clik.newPhoto({"id":3399506,"src":"B&W_01502_thumb.jpg","galleries_id":207153,"server_id":1,"link":"photo_3399506.html","width":100,"caption":"","height":100});
															thumbnails[3399970] = clik.newPhoto({"id":3399970,"src":"DSC_0234_1060b1_thumb.jpg","galleries_id":207153,"server_id":1,"link":"photo_3399970.html","width":100,"caption":"","height":100});
															thumbnails[3397852] = clik.newPhoto({"id":3397852,"src":"DSC_01673_thumb.jpg","galleries_id":207153,"server_id":1,"link":"photo_3397852.html","width":100,"caption":"","height":100});
															thumbnails[3440377] = clik.newPhoto({"id":3440377,"src":"DSC_0303_11281_thumb.jpg","galleries_id":207153,"server_id":1,"link":"photo_3440377.html","width":100,"caption":"","height":100});
															thumbnails[3440375] = clik.newPhoto({"id":3440375,"src":"DSC_02781_thumb.jpg","galleries_id":207153,"server_id":1,"link":"photo_3440375.html","width":100,"caption":"","height":100});
															thumbnails[3399973] = clik.newPhoto({"id":3399973,"src":"DSC_0267_0391_thumb.jpg","galleries_id":207153,"server_id":1,"link":"photo_3399973.html","width":100,"caption":"","height":100});
															thumbnails[3399974] = clik.newPhoto({"id":3399974,"src":"DSC_03691_thumb.jpg","galleries_id":207153,"server_id":1,"link":"photo_3399974.html","width":100,"caption":"","height":100});
															thumbnails[3399718] = clik.newPhoto({"id":3399718,"src":"Group_1986_thumb.jpg","galleries_id":207153,"server_id":1,"link":"photo_3399718.html","width":100,"caption":"","height":100});
															thumbnails[3399716] = clik.newPhoto({"id":3399716,"src":"B&W_00433_thumb.jpg","galleries_id":207153,"server_id":1,"link":"photo_3399716.html","width":100,"caption":"","height":100});
															thumbnails[3440439] = clik.newPhoto({"id":3440439,"src":"detailsBack of dress2_thumb.jpg","galleries_id":207153,"server_id":1,"link":"photo_3440439.html","width":100,"caption":"","height":100});
															thumbnails[8537100] = clik.newPhoto({"id":8537100,"src":"Storyboards2_Above3_thumb.jpg","galleries_id":176462,"server_id":1,"link":"photo_8537100.html","width":100,"caption":"","height":103});
															thumbnails[8157810] = clik.newPhoto({"id":8157810,"src":"DSC_0058_0032cbdr_thumb.jpg","galleries_id":176462,"server_id":1,"link":"photo_8157810.html","width":100,"caption":"","height":108});
															thumbnails[7573345] = clik.newPhoto({"id":7573345,"src":"ClintBWPortraitBDR_thumb.jpg","galleries_id":176462,"server_id":1,"link":"photo_7573345.html","width":100,"caption":"","height":100});
															thumbnails[5453731] = clik.newPhoto({"id":5453731,"src":"IndoorsBeauChair_thumb.jpg","galleries_id":176462,"server_id":1,"link":"photo_5453731.html","width":100,"caption":"","height":100});
															thumbnails[3591618] = clik.newPhoto({"id":3591618,"src":"KirstenFaceMural_bdr_thumb.jpg","galleries_id":176462,"server_id":1,"link":"photo_3591618.html","width":100,"caption":"","height":100});
															thumbnails[7573376] = clik.newPhoto({"id":7573376,"src":"AmandaZebra_thumb.jpg","galleries_id":176462,"server_id":1,"link":"photo_7573376.html","width":100,"caption":"","height":100});
															thumbnails[3591620] = clik.newPhoto({"id":3591620,"src":"KirstenColouredCirclesLookAway_bdr_thumb.jpg","galleries_id":176462,"server_id":1,"link":"photo_3591620.html","width":100,"caption":"","height":100});
															thumbnails[3439785] = clik.newPhoto({"id":3439785,"src":"DSC_0163_0992_thumb.jpg","galleries_id":176462,"server_id":1,"link":"photo_3439785.html","width":100,"caption":"","height":100});
															thumbnails[3484762] = clik.newPhoto({"id":3484762,"src":"Jamie_Fringe_bdr_thumb.jpg","galleries_id":176462,"server_id":1,"link":"photo_3484762.html","width":100,"caption":"","height":100});
															thumbnails[5453719] = clik.newPhoto({"id":5453719,"src":"DoorwayBeauEyesBWBDRWhite2_0997_thumb.jpg","galleries_id":176462,"server_id":1,"link":"photo_5453719.html","width":100,"caption":"","height":100});
															thumbnails[5453726] = clik.newPhoto({"id":5453726,"src":"DoorwayNedBDRWhite_1001_thumb.jpg","galleries_id":176462,"server_id":1,"link":"photo_5453726.html","width":100,"caption":"","height":100});
															thumbnails[5453729] = clik.newPhoto({"id":5453729,"src":"IndoorsAlbieEyeBWBDRWhite_1081_thumb.jpg","galleries_id":176462,"server_id":1,"link":"photo_5453729.html","width":100,"caption":"","height":100});
															thumbnails[3591621] = clik.newPhoto({"id":3591621,"src":"KirstenBlueRoofCloser_bdr_thumb.jpg","galleries_id":176462,"server_id":1,"link":"photo_3591621.html","width":100,"caption":"","height":100});
															thumbnails[3421125] = clik.newPhoto({"id":3421125,"src":"Amanda_BlueGlass_ContrastyBDR_thumb.jpg","galleries_id":176462,"server_id":1,"link":"photo_3421125.html","width":100,"caption":"","height":100});
															thumbnails[3424741] = clik.newPhoto({"id":3424741,"src":"Marie_BlueGlassLaugh_ContrastyBDR_thumb.jpg","galleries_id":176462,"server_id":1,"link":"photo_3424741.html","width":100,"caption":"","height":100});
															thumbnails[3439788] = clik.newPhoto({"id":3439788,"src":"DSC_0143_0972b2_thumb.jpg","galleries_id":176462,"server_id":1,"link":"photo_3439788.html","width":100,"caption":"","height":100});
															thumbnails[9089630] = clik.newPhoto({"id":9089630,"src":"A_Frosty_Find_I_2_thumb.jpg","galleries_id":128813,"server_id":1,"link":"photo_9089630.html","width":100,"caption":"","height":100});
															thumbnails[9089631] = clik.newPhoto({"id":9089631,"src":"A_Frosty_Find_II_1_thumb.jpg","galleries_id":128813,"server_id":1,"link":"photo_9089631.html","width":100,"caption":"","height":100});
															thumbnails[9089632] = clik.newPhoto({"id":9089632,"src":"A_Frosty_Find_III_2_thumb.jpg","galleries_id":128813,"server_id":1,"link":"photo_9089632.html","width":100,"caption":"","height":100});
															thumbnails[9089634] = clik.newPhoto({"id":9089634,"src":"A_Frosty_Find_IV_1_thumb.jpg","galleries_id":128813,"server_id":1,"link":"photo_9089634.html","width":100,"caption":"","height":100});
															thumbnails[9089637] = clik.newPhoto({"id":9089637,"src":"Urban_Orb_Green_Box_1_thumb.jpg","galleries_id":128813,"server_id":1,"link":"photo_9089637.html","width":100,"caption":"","height":100});
															thumbnails[9089638] = clik.newPhoto({"id":9089638,"src":"Urban_Orb_Blue_Crates_1_thumb.jpg","galleries_id":128813,"server_id":1,"link":"photo_9089638.html","width":100,"caption":"","height":100});
															thumbnails[9089549] = clik.newPhoto({"id":9089549,"src":"Antonia_Wozencraft-01-Lowland_Peat_Bog_III_1_thumb.jpg","galleries_id":128813,"server_id":1,"link":"photo_9089549.html","width":100,"caption":"","height":100});
															thumbnails[9089565] = clik.newPhoto({"id":9089565,"src":"Antonia_Wozencraft-002-Scooter_Legs_1_thumb.jpg","galleries_id":128813,"server_id":1,"link":"photo_9089565.html","width":100,"caption":"","height":100});
															thumbnails[9089579] = clik.newPhoto({"id":9089579,"src":"Antonia_Wozencraft-03-Heading_Home_Sun_After_The_Rain_1_thumb.jpg","galleries_id":128813,"server_id":1,"link":"photo_9089579.html","width":100,"caption":"","height":100});
															thumbnails[9089582] = clik.newPhoto({"id":9089582,"src":"Antonia_Wozencraft-04-To_The_Woods_1_thumb.jpg","galleries_id":128813,"server_id":1,"link":"photo_9089582.html","width":100,"caption":"","height":100});
															thumbnails[9089584] = clik.newPhoto({"id":9089584,"src":"Antonia_Wozencraft-05-Bus_Stop_Lean_To_1_thumb.jpg","galleries_id":128813,"server_id":1,"link":"photo_9089584.html","width":100,"caption":"","height":100});
															thumbnails[8350692] = clik.newPhoto({"id":8350692,"src":"IMG_3546_0350_thumb.jpg","galleries_id":128813,"server_id":1,"link":"photo_8350692.html","width":100,"caption":"","height":100});
															thumbnails[8492490] = clik.newPhoto({"id":8492490,"src":"IMG_4005_0704_thumb.jpg","galleries_id":128813,"server_id":1,"link":"photo_8492490.html","width":100,"caption":"","height":100});
															thumbnails[8605856] = clik.newPhoto({"id":8605856,"src":"CatWoman_thumb.jpg","galleries_id":128813,"server_id":1,"link":"photo_8605856.html","width":100,"caption":"","height":100});
															thumbnails[8492561] = clik.newPhoto({"id":8492561,"src":"IMG_4002_0717_thumb.jpg","galleries_id":128813,"server_id":1,"link":"photo_8492561.html","width":100,"caption":"","height":100});
															thumbnails[8492562] = clik.newPhoto({"id":8492562,"src":"IMG_4012_0696_thumb.jpg","galleries_id":128813,"server_id":1,"link":"photo_8492562.html","width":100,"caption":"","height":100});
															thumbnails[9089643] = clik.newPhoto({"id":9089643,"src":"2011_street_15_thumb.jpg","galleries_id":128813,"server_id":1,"link":"photo_9089643.html","width":100,"caption":"","height":100});
															thumbnails[8175555] = clik.newPhoto({"id":8175555,"src":"IMG_2571_0539b_thumb.jpg","galleries_id":128813,"server_id":1,"link":"photo_8175555.html","width":100,"caption":"","height":100});
															thumbnails[8350685] = clik.newPhoto({"id":8350685,"src":"IMG_3545_0349_thumb.jpg","galleries_id":128813,"server_id":1,"link":"photo_8350685.html","width":100,"caption":"","height":100});
															thumbnails[8175528] = clik.newPhoto({"id":8175528,"src":"IMG_1745_0114_thumb.jpg","galleries_id":128813,"server_id":1,"link":"photo_8175528.html","width":100,"caption":"","height":100});
															thumbnails[8608500] = clik.newPhoto({"id":8608500,"src":"NetCurtainV_thumb.jpg","galleries_id":128813,"server_id":1,"link":"photo_8608500.html","width":100,"caption":"","height":100});
															thumbnails[8608485] = clik.newPhoto({"id":8608485,"src":"ArnosValeWarMemorial_thumb.jpg","galleries_id":128813,"server_id":1,"link":"photo_8608485.html","width":100,"caption":"","height":100});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[207153] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"wedding","link":"section541808_207153.html","maxRecords":0.0,"photoIDs":[8181157.0,8181175.0,8181178.0,8181179.0,8181181.0,8181213.0,8181214.0,8181104.0,8181108.0,8181105.0,8181109.0,8181106.0,8181110.0,8181176.0,8157278.0,3397849.0,3390067.0,3399622.0,3399710.0,3399629.0,3399474.0,3399475.0,3399505.0,3399712.0,3399506.0,3399970.0,3397852.0,3440377.0,3440375.0,3399973.0,3399974.0,3399718.0,3399716.0,3440439.0],"skipIndex":0,"section_code":"section541808","featured_images":8181157.0,"id":207153,"singleSection":false});				  						galleries[176462] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"portraits","link":"section541808_176462.html","maxRecords":0.0,"photoIDs":[8537100.0,8157810.0,7573345.0,5453731.0,3591618.0,7573376.0,3591620.0,3439785.0,3484762.0,5453719.0,5453726.0,5453729.0,3591621.0,3421125.0,3424741.0,3439788.0],"skipIndex":0,"section_code":"section541808","featured_images":7573376.0,"id":176462,"singleSection":false});				  						galleries[128813] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"mobile photography","link":"gallery.html","maxRecords":0.0,"photoIDs":[9089630.0,9089631.0,9089632.0,9089634.0,9089637.0,9089638.0,9089549.0,9089565.0,9089579.0,9089582.0,9089584.0,8350692.0,8492490.0,8605856.0,8492561.0,8492562.0,9089643.0,8175555.0,8350685.0,8175528.0,8608500.0,8608485.0],"skipIndex":0,"section_code":"gallery","featured_images":"9089643,9089638,9089637,9089634,9089632,9089631,9089630,9089584,9089582,9089579","id":128813,"singleSection":true});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[245220] = '8537100';
imageSets[243767] = '8181157,8181175,8181178,8181179,8181181,8181213,8181214,8181104,8181108,8181105,8181109,8181106,8181110,8181176';
imageSets[245007] = '8491743';
imageSets[1] = '8181157,8181178,8181104,8157810,7573345';
imageSets[2] = '8181157,7573376';
imageSets[3] = '9089643,9089638,9089637,9089634,9089632,9089631,9089630,9089584,9089582,9089579,9089565,9089549,8608500,8608485,8605856,8537100,8492562,8492561,8492490,8491743,8350692,8350685,8181214,8181213,8181181,8181179,8181178,8181176,8181175,8181157,8181110,8181109,8181108,8181106,8181105,8181104,8175555,8175528,8157810,8157278,7573376,7573345,5453731,5453729,5453726,5453719,3591621,3591620,3591618,3484762';
imageSets[243750] = '9089630,9089631,9089632,9089634,9089637,9089638,9089549,9089565,9089579,9089582,9089584,8350692,8492490,8605856,8492561,8492562,9089643,8175555,8350685,8175528,8608500,8608485';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/AWozencraftuk/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/AWozencraftuk/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/AWozencraftuk/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/AWozencraftuk/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/AWozencraftuk/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/AWozencraftuk/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/AWozencraftuk/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/AWozencraftuk/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/AWozencraftuk/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/AWozencraftuk/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/AWozencraftuk/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/AWozencraftuk/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/AWozencraftuk/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/AWozencraftuk/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/AWozencraftuk/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/AWozencraftuk/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/AWozencraftuk/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/AWozencraftuk/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/AWozencraftuk/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/AWozencraftuk/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/AWozencraftuk/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/AWozencraftuk/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/AWozencraftuk/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/AWozencraftuk/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/AWozencraftuk/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/AWozencraftuk/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/AWozencraftuk/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 += 'section541808.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 && 'section541808' != '') {
					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 = 'Antonia Wozencraft 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;
	}
}

			

