window.thumbnails = new Object();
												thumbnails[7869091] = new thumbnail(7869091,'424695','','RJE00641_thumb.jpg',130, 87,18,'photo_7869091.html');
												thumbnails[7869092] = new thumbnail(7869092,'424695','','RJE0190_thumb.jpg',130, 195,18,'photo_7869092.html');
												thumbnails[7869094] = new thumbnail(7869094,'424695','','RJE0198_thumb.jpg',130, 195,18,'photo_7869094.html');
												thumbnails[7869097] = new thumbnail(7869097,'424695','','RJE0201_thumb.jpg',130, 87,18,'photo_7869097.html');
												thumbnails[7869099] = new thumbnail(7869099,'424695','','RJE0209_thumb.jpg',130, 87,18,'photo_7869099.html');
												thumbnails[7869100] = new thumbnail(7869100,'424695','','RJE0212_thumb.jpg',130, 87,18,'photo_7869100.html');
												thumbnails[7869101] = new thumbnail(7869101,'424695','','RJE0228_thumb.jpg',130, 87,18,'photo_7869101.html');
												thumbnails[7869104] = new thumbnail(7869104,'424695','','RJE0242_thumb.jpg',130, 195,18,'photo_7869104.html');
												thumbnails[7869105] = new thumbnail(7869105,'424695','','RJE0251_thumb.jpg',130, 195,18,'photo_7869105.html');
												thumbnails[7869110] = new thumbnail(7869110,'424695','','RJE0254_thumb.jpg',130, 195,18,'photo_7869110.html');
												thumbnails[7869112] = new thumbnail(7869112,'424695','','RJE0287_thumb.jpg',130, 195,18,'photo_7869112.html');
												thumbnails[7869126] = new thumbnail(7869126,'424695','','RJE0413_thumb.jpg',130, 195,18,'photo_7869126.html');
												thumbnails[7869696] = new thumbnail(7869696,'424755','','GJ0032_thumb.jpg',130, 87,18,'photo_7869696.html');
												thumbnails[7869699] = new thumbnail(7869699,'424755','','GJ0105_thumb.jpg',130, 195,18,'photo_7869699.html');
												thumbnails[7869711] = new thumbnail(7869711,'424755','','GJ0143_thumb.jpg',130, 87,18,'photo_7869711.html');
												thumbnails[7869712] = new thumbnail(7869712,'424755','','GJ0149_thumb.jpg',130, 195,18,'photo_7869712.html');
												thumbnails[7869713] = new thumbnail(7869713,'424755','','GJ0157_thumb.jpg',130, 87,18,'photo_7869713.html');
												thumbnails[7869714] = new thumbnail(7869714,'424755','','GJ0163_thumb.jpg',130, 195,18,'photo_7869714.html');
												thumbnails[7869715] = new thumbnail(7869715,'424755','','GJ0206_thumb.jpg',130, 195,18,'photo_7869715.html');
												thumbnails[7869716] = new thumbnail(7869716,'424755','','GJ0227_thumb.jpg',130, 195,18,'photo_7869716.html');
												thumbnails[7869717] = new thumbnail(7869717,'424755','','GJ0243_thumb.jpg',130, 90,18,'photo_7869717.html');
												thumbnails[7869718] = new thumbnail(7869718,'424755','','GJ0318_thumb.jpg',130, 87,18,'photo_7869718.html');
												thumbnails[7869719] = new thumbnail(7869719,'424755','','GJ0336_thumb.jpg',130, 87,18,'photo_7869719.html');
												thumbnails[7869721] = new thumbnail(7869721,'424755','','GJ0387_thumb.jpg',130, 195,18,'photo_7869721.html');
												thumbnails[7869739] = new thumbnail(7869739,'424755','','GJ0390_thumb.jpg',130, 195,18,'photo_7869739.html');
												thumbnails[7869754] = new thumbnail(7869754,'424755','','GJ0392_thumb.jpg',130, 195,18,'photo_7869754.html');
												thumbnails[7869757] = new thumbnail(7869757,'424755','','GJ0439_thumb.jpg',130, 195,18,'photo_7869757.html');
												thumbnails[7869758] = new thumbnail(7869758,'424755','','GJ0555_thumb.jpg',130, 195,18,'photo_7869758.html');
												thumbnails[7869759] = new thumbnail(7869759,'424760','','RNK071_thumb.jpg',130, 195,18,'photo_7869759.html');
												thumbnails[7869760] = new thumbnail(7869760,'424760','','RNK077_thumb.jpg',130, 195,18,'photo_7869760.html');
												thumbnails[7869761] = new thumbnail(7869761,'424760','','RNK080_thumb.jpg',130, 195,18,'photo_7869761.html');
												thumbnails[7869776] = new thumbnail(7869776,'424760','','RNK113_thumb.jpg',130, 195,18,'photo_7869776.html');
												thumbnails[7869791] = new thumbnail(7869791,'424760','','RNK126_thumb.jpg',130, 195,18,'photo_7869791.html');
												thumbnails[7869792] = new thumbnail(7869792,'424760','','RNK136_thumb.jpg',130, 195,18,'photo_7869792.html');
												thumbnails[7869794] = new thumbnail(7869794,'424760','','RNK146_thumb.jpg',130, 195,18,'photo_7869794.html');
												thumbnails[7869795] = new thumbnail(7869795,'424760','','RNK147_thumb.jpg',130, 87,18,'photo_7869795.html');
												thumbnails[7869797] = new thumbnail(7869797,'424760','','RNK167_thumb.jpg',130, 195,18,'photo_7869797.html');
												thumbnails[7869798] = new thumbnail(7869798,'424760','','RNK189_thumb.jpg',130, 195,18,'photo_7869798.html');
												thumbnails[7869799] = new thumbnail(7869799,'424760','','RNK214_thumb.jpg',130, 195,18,'photo_7869799.html');
												thumbnails[7869800] = new thumbnail(7869800,'424760','','RNK234_thumb.jpg',130, 87,18,'photo_7869800.html');
												thumbnails[7869801] = new thumbnail(7869801,'424760','','RNK300_thumb.jpg',130, 195,18,'photo_7869801.html');
												thumbnails[7869802] = new thumbnail(7869802,'424760','','RNK319_thumb.jpg',130, 195,18,'photo_7869802.html');
												thumbnails[7869803] = new thumbnail(7869803,'424760','','RNK325_thumb.jpg',130, 195,18,'photo_7869803.html');
												thumbnails[7869804] = new thumbnail(7869804,'424760','','RNK331_thumb.jpg',130, 87,18,'photo_7869804.html');
												thumbnails[7869805] = new thumbnail(7869805,'424760','','RNK373_thumb.jpg',130, 195,18,'photo_7869805.html');
												thumbnails[7869806] = new thumbnail(7869806,'424760','','RNK456_thumb.jpg',130, 195,18,'photo_7869806.html');
												thumbnails[7869808] = new thumbnail(7869808,'424762','','SRF0012_thumb.jpg',130, 195,18,'photo_7869808.html');
												thumbnails[7869809] = new thumbnail(7869809,'424762','','SRF0017_thumb.jpg',130, 195,18,'photo_7869809.html');
												thumbnails[7869810] = new thumbnail(7869810,'424762','','SRF0018_thumb.jpg',130, 87,18,'photo_7869810.html');
												thumbnails[7869811] = new thumbnail(7869811,'424762','','SRF0020_thumb.jpg',130, 195,18,'photo_7869811.html');
												thumbnails[7869812] = new thumbnail(7869812,'424762','','SRF0041_thumb.jpg',130, 195,18,'photo_7869812.html');
												thumbnails[7869814] = new thumbnail(7869814,'424762','','SRF0047_thumb.jpg',130, 195,18,'photo_7869814.html');
												thumbnails[7869815] = new thumbnail(7869815,'424762','','SRF0063_thumb.jpg',130, 87,18,'photo_7869815.html');
												thumbnails[7869816] = new thumbnail(7869816,'424762','','SRF0069_thumb.jpg',130, 195,18,'photo_7869816.html');
												thumbnails[7869817] = new thumbnail(7869817,'424762','','SRF0073_thumb.jpg',130, 195,18,'photo_7869817.html');
												thumbnails[7869818] = new thumbnail(7869818,'424762','','SRF0079_thumb.jpg',130, 195,18,'photo_7869818.html');
												thumbnails[7869819] = new thumbnail(7869819,'424762','','SRF0087_thumb.jpg',130, 195,18,'photo_7869819.html');
												thumbnails[7869820] = new thumbnail(7869820,'424762','','SRF0096_thumb.jpg',130, 195,18,'photo_7869820.html');
												thumbnails[7869821] = new thumbnail(7869821,'424762','','SRF0103_thumb.jpg',130, 87,18,'photo_7869821.html');
												thumbnails[7869822] = new thumbnail(7869822,'424762','','SRF0114A_thumb.jpg',130, 195,18,'photo_7869822.html');
												thumbnails[7869824] = new thumbnail(7869824,'424762','','SRF0128A_thumb.jpg',130, 87,18,'photo_7869824.html');
												thumbnails[7869830] = new thumbnail(7869830,'424762','','SRF0157_thumb.jpg',130, 195,18,'photo_7869830.html');
												thumbnails[7869831] = new thumbnail(7869831,'424762','','SRF0177A_thumb.jpg',130, 87,18,'photo_7869831.html');
												thumbnails[7869832] = new thumbnail(7869832,'424762','','SRF0285_thumb.jpg',130, 195,18,'photo_7869832.html');
												thumbnails[7869834] = new thumbnail(7869834,'424762','','SRF0368_thumb.jpg',130, 195,18,'photo_7869834.html');
												thumbnails[7869836] = new thumbnail(7869836,'424762','','SRF0374_thumb.jpg',130, 87,18,'photo_7869836.html');
												thumbnails[364238] = new thumbnail(364238,'29985','','GD0006AJPG_thumb.jpg',130, 184,18,'photo_364238.html');
												thumbnails[3118981] = new thumbnail(3118981,'29987','','NJ7C1750JPG_thumb.jpg',130, 195,18,'photo_3118981.html');
												thumbnails[3119295] = new thumbnail(3119295,'29990','','NKD0042JPG_thumb.jpg',130, 87,18,'photo_3119295.html');
												thumbnails[3119344] = new thumbnail(3119344,'29988','','SK0040JPG_thumb.jpg',130, 195,18,'photo_3119344.html');
												thumbnails[364240] = new thumbnail(364240,'29985','','GD0014AJPG_thumb.jpg',130, 87,18,'photo_364240.html');
												thumbnails[3118984] = new thumbnail(3118984,'29987','','NJ7C1794JPG_thumb.jpg',130, 195,18,'photo_3118984.html');
												thumbnails[3119297] = new thumbnail(3119297,'29990','','NKD0050JPG_thumb.jpg',130, 195,18,'photo_3119297.html');
												thumbnails[3119347] = new thumbnail(3119347,'29988','','SK0064CSJPG_thumb.jpg',130, 195,18,'photo_3119347.html');
												thumbnails[364242] = new thumbnail(364242,'29985','','GD0079AJPG_thumb.jpg',130, 184,18,'photo_364242.html');
												thumbnails[3118987] = new thumbnail(3118987,'29987','','NJ7C1796JPG_thumb.jpg',130, 195,18,'photo_3118987.html');
												thumbnails[3119299] = new thumbnail(3119299,'29990','','NKD0052JPG_thumb.jpg',130, 87,18,'photo_3119299.html');
												thumbnails[3119355] = new thumbnail(3119355,'29988','','SK0078JPG_thumb.jpg',130, 195,18,'photo_3119355.html');
												thumbnails[364244] = new thumbnail(364244,'29985','','GD0089AJPG_thumb.jpg',130, 184,18,'photo_364244.html');
												thumbnails[3118989] = new thumbnail(3118989,'29987','','NJ7C1798JPG_thumb.jpg',130, 195,18,'photo_3118989.html');
												thumbnails[3119301] = new thumbnail(3119301,'29990','','NKD0081JPG_thumb.jpg',130, 87,18,'photo_3119301.html');
												thumbnails[3119356] = new thumbnail(3119356,'29988','','SK0087JPG_thumb.jpg',130, 195,18,'photo_3119356.html');
												thumbnails[364246] = new thumbnail(364246,'29985','','GD0098JPG_thumb.jpg',130, 195,18,'photo_364246.html');
												thumbnails[3118991] = new thumbnail(3118991,'29987','','NJ7C1799JPG_thumb.jpg',130, 195,18,'photo_3118991.html');
												thumbnails[3119303] = new thumbnail(3119303,'29990','','NKD0089JPG_thumb.jpg',130, 173,18,'photo_3119303.html');
												thumbnails[3119361] = new thumbnail(3119361,'29988','','SK0106JPG_thumb.jpg',130, 87,18,'photo_3119361.html');
												thumbnails[364248] = new thumbnail(364248,'29985','','GD0122JPG_thumb.jpg',130, 195,18,'photo_364248.html');
												thumbnails[3118994] = new thumbnail(3118994,'29987','','NJ7C1813JPG_thumb.jpg',130, 87,18,'photo_3118994.html');
												thumbnails[3119305] = new thumbnail(3119305,'29990','','NKD0106JPG_thumb.jpg',130, 195,18,'photo_3119305.html');
												thumbnails[3119364] = new thumbnail(3119364,'29988','','SK0116JPG_thumb.jpg',130, 195,18,'photo_3119364.html');
												thumbnails[364250] = new thumbnail(364250,'29985','','GD0133JPG_thumb.jpg',130, 87,18,'photo_364250.html');
												thumbnails[3118997] = new thumbnail(3118997,'29987','','NJ7C1821JPG_thumb.jpg',130, 87,18,'photo_3118997.html');
												thumbnails[3119308] = new thumbnail(3119308,'29990','','NKD0111JPG_thumb.jpg',130, 195,18,'photo_3119308.html');
												thumbnails[3119370] = new thumbnail(3119370,'29988','','SK0135JPG_thumb.jpg',130, 87,18,'photo_3119370.html');
												thumbnails[364251] = new thumbnail(364251,'29985','','GD0145AJPG_thumb.jpg',130, 184,18,'photo_364251.html');
												thumbnails[3118999] = new thumbnail(3118999,'29987','','NJ7C1822JPG_thumb.jpg',130, 87,18,'photo_3118999.html');
												thumbnails[3119312] = new thumbnail(3119312,'29990','','NKD0118JPG_thumb.jpg',130, 87,18,'photo_3119312.html');
												thumbnails[3119374] = new thumbnail(3119374,'29988','','SK0148JPG_thumb.jpg',130, 195,18,'photo_3119374.html');
												thumbnails[364252] = new thumbnail(364252,'29985','','GD0165JPG_thumb.jpg',130, 195,18,'photo_364252.html');
												thumbnails[3119001] = new thumbnail(3119001,'29987','','NJ7C1823JPG_thumb.jpg',130, 195,18,'photo_3119001.html');
												thumbnails[3119315] = new thumbnail(3119315,'29990','','NKD0125JPG_thumb.jpg',130, 87,18,'photo_3119315.html');
												thumbnails[3119396] = new thumbnail(3119396,'29988','','SK0163JPG_thumb.jpg',130, 87,18,'photo_3119396.html');
												thumbnails[364253] = new thumbnail(364253,'29985','','GD0200JPG_thumb.jpg',130, 87,18,'photo_364253.html');
												thumbnails[3119004] = new thumbnail(3119004,'29987','','NJ7C1843JPG_thumb.jpg',130, 195,18,'photo_3119004.html');
												thumbnails[3119316] = new thumbnail(3119316,'29990','','NKD0132JPG_thumb.jpg',130, 87,18,'photo_3119316.html');
												thumbnails[3119398] = new thumbnail(3119398,'29988','','SK0172JPG_thumb.jpg',130, 92,18,'photo_3119398.html');
												thumbnails[364255] = new thumbnail(364255,'29985','','GD0212JPG_thumb.jpg',130, 87,18,'photo_364255.html');
												thumbnails[3119005] = new thumbnail(3119005,'29987','','NJ7C1862JPG_thumb.jpg',130, 87,18,'photo_3119005.html');
												thumbnails[3119320] = new thumbnail(3119320,'29990','','NKD0160JPG_thumb.jpg',130, 195,18,'photo_3119320.html');
												thumbnails[3119400] = new thumbnail(3119400,'29988','','SK0201JPG_thumb.jpg',130, 65,18,'photo_3119400.html');
												thumbnails[364256] = new thumbnail(364256,'29985','','GD0236JPG_thumb.jpg',130, 195,18,'photo_364256.html');
												thumbnails[3119006] = new thumbnail(3119006,'29987','','NJ7C1879JPG_thumb.jpg',130, 195,18,'photo_3119006.html');
												thumbnails[3119321] = new thumbnail(3119321,'29990','','NKD0172JPG_thumb.jpg',130, 87,18,'photo_3119321.html');
												thumbnails[3119410] = new thumbnail(3119410,'29988','','SK0209JPG_thumb.jpg',130, 195,18,'photo_3119410.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[424695] = new gallery(424695,'7869126,7869112,7869110,7869105,7869104,7869101,7869100,7869099,7869097,7869094','BECKY & JOHN','gallery',[7869091,7869092,7869094,7869097,7869099,7869100,7869101,7869104,7869105,7869110,7869112,7869126],0, 0, '', 'gallery_424695.html',0,0);
				  					galleries[29985] = new gallery(29985,'364256,364255,364253,364252,364251,364250,364248,364246,364244,364242','GAIL & DAMIAN','gallery',[364238,364240,364242,364244,364246,364248,364250,364251,364252,364253,364255,364256],0, 0, '', 'gallery_29985.html',0,0);
				  					galleries[424755] = new gallery(424755,'7869758,7869757,7869754,7869739,7869721,7869719,7869718,7869717,7869716,7869715','GEMMA & JON','gallery',[7869696,7869699,7869711,7869712,7869713,7869714,7869715,7869716,7869717,7869718,7869719,7869721,7869739,7869754,7869757,7869758],0, 0, '', 'gallery_424755.html',0,0);
				  					galleries[29987] = new gallery(29987,'3119006,3119005,3119004,3119001,3118999,3118997,3118994,3118991,3118989,3118987','LIZ & IAN','gallery',[3118981,3118984,3118987,3118989,3118991,3118994,3118997,3118999,3119001,3119004,3119005,3119006],0, 0, '', 'gallery_29987.html',0,0);
				  					galleries[29990] = new gallery(29990,'3119321,3119320,3119316,3119315,3119312,3119308,3119305,3119303,3119301,3119299','NATALIE & KEVIN','gallery',[3119295,3119297,3119299,3119301,3119303,3119305,3119308,3119312,3119315,3119316,3119320,3119321],0, 0, '', 'gallery_29990.html',0,0);
				  					galleries[424760] = new gallery(424760,'7869806,7869805,7869804,7869803,7869802,7869801,7869800,7869799,7869798,7869797','NATASHA & RICHARD','gallery',[7869759,7869760,7869761,7869776,7869791,7869792,7869794,7869795,7869797,7869798,7869799,7869800,7869801,7869802,7869803,7869804,7869805,7869806],0, 0, '', 'gallery_424760.html',0,0);
				  					galleries[424762] = new gallery(424762,'7869836,7869834,7869832,7869831,7869830,7869824,7869822,7869821,7869820,7869819','SARAH & ROB','gallery',[7869808,7869809,7869810,7869811,7869812,7869814,7869815,7869816,7869817,7869818,7869819,7869820,7869821,7869822,7869824,7869830,7869831,7869832,7869834,7869836],0, 0, '', 'gallery_424762.html',0,0);
				  					galleries[29988] = new gallery(29988,'3119410,3119400,3119398,3119396,3119374,3119370,3119364,3119361,3119356,3119355','SHARON & KENNETH','gallery',[3119344,3119347,3119355,3119356,3119361,3119364,3119370,3119374,3119396,3119398,3119400,3119410],0, 0, '', 'gallery_29988.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '7869836,7869834,7869832,7869831,7869830,7869824,7869822,7869821,7869820,7869819,7869818,7869817,7869816,7869815,7869814,7869812,7869811,7869810,7869809,7869808,7869806,7869805,7869804,7869803,7869802,7869801,7869800,7869799,7869798,7869797,7869795,7869794,7869792,7869791,7869776,7869761,7869760,7869759,7869758,7869757,7869754,7869739,7869721,7869719,7869718,7869717,7869716,7869715,7869714,7869713';
imageSets[3] = '7869836,7869834,7869832,7869831,7869830,7869824,7869822,7869821,7869820,7869819,7869818,7869817,7869816,7869815,7869814,7869812,7869811,7869810,7869809,7869808,7869806,7869805,7869804,7869803,7869802,7869801,7869800,7869799,7869798,7869797,7869795,7869794,7869792,7869791,7869776,7869761,7869760,7869759,7869758,7869757,7869754,7869739,7869721,7869719,7869718,7869717,7869716,7869715,7869714,7869713';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/ewphotos/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/ewphotos/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/ewphotos/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/ewphotos/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/ewphotos/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/ewphotos/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/ewphotos/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/ewphotos/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/ewphotos/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/ewphotos/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/ewphotos/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/ewphotos/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/ewphotos/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/ewphotos/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/ewphotos/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/ewphotos/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/ewphotos/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/ewphotos/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/ewphotos/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/ewphotos/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/ewphotos/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/ewphotos/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:'',
                    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 (!basic) {
    if (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
    }
				
    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));		  $('body').trigger('clikUpdate');		}, op.onBefore);
      }    }
    	if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'East To West Photography: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
	    var options = {};	    	      	      resizePhotoInfo(options);
        if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(backgrounds);
  	    } else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(photos);
  	    }
	    });
    }
        if (!op.speed) {      clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));      $('body').trigger('clikUpdate');    }        
    return html;			}
	else {
				
		window.location = 'photo_' + nextPhoto.id + '.html';
	}
		
}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array){
  if (typeof(array) !== 'object') {
    array = photos;
  }
	if($('#paymentConfirm').length > 0){
		$('#paymentConfirm').hide();
		$('#paymentAddButton')
		.unbind()
		.click(function(){
						form = document.getElementById('paymentForm');
			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').text('Item added to cart').show();}
				else{
					$('#paymentConfirm').text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm').text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}
/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp = temp +  '<p id="imageDescription">' + this.description + '</p>';
	}
		if (this.photo_ref != '') {
		temp = temp + '<p class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</p>';
	}
		if (this.takendate != '') {
				
		temp = temp + '<p class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</p>';
	}
	
	if (this.location != '') {
				
		temp = temp + '<p class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</p>';
	}
	
	if (this.photographer != '') {
				
		temp = temp + '<p class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</p>';
	}
					
				if (temp != '') {
		temp = temp + '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp = temp + '<p>Order this print:</p>';
				temp = temp + '<p class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> ' + (this.item_price).toFixed(2) + '</p>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
	else if (this.payment_groups_id !== '') {
		temp = temp + '<p>Buy this print online:</p>';
				temp = temp + '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
											temp = temp + '<select class="paymentlink" name="payment_options_id" onchange="updateItemValues(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
				
		temp = temp + getPaymentOptions(this.payment_groups_id);
		temp = temp + '</select>';
		temp = temp + '</form>';
				var item_option  = paymentGroups[this.payment_groups_id].options[0];
		if(paymentOptions[item_option]){
			var item_name  = paymentOptions[item_option].payment_option;
			var amount =  paymentOptions[item_option].price;
		}
			}
	else {
				
	}
	if (this.item_price !== '' || this.payment_groups_id !== '') {
			temp = 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({            href: thumbnails[imageID].fnGalleryLink(gallery_id),            title: galleries[gallery_id].title          });
        }
							}
										}
}

/***************************************************************************
* 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 + ' | ';
				}
				temp = temp + '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
			}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

