window.thumbnails = {};
															thumbnails[7444752] = clik.newPhoto({"id":7444752,"src":"Copyright-AnneLyburn_01_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL01","height":194});
															thumbnails[7444758] = clik.newPhoto({"id":7444758,"src":"Copyright-AnneLyburn_02_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL02","height":87});
															thumbnails[7444760] = clik.newPhoto({"id":7444760,"src":"Copyright-AnneLyburn_03_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL03","height":194});
															thumbnails[7444761] = clik.newPhoto({"id":7444761,"src":"Copyright-AnneLyburn_04_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL04","height":194});
															thumbnails[7444763] = clik.newPhoto({"id":7444763,"src":"Copyright-AnneLyburn_05_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL05","height":87});
															thumbnails[7444764] = clik.newPhoto({"id":7444764,"src":"Copyright-AnneLyburn_06_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL06","height":87});
															thumbnails[7444769] = clik.newPhoto({"id":7444769,"src":"Copyright-AnneLyburn_07_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL07","height":87});
															thumbnails[7444770] = clik.newPhoto({"id":7444770,"src":"Copyright-AnneLyburn_08_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL08","height":194});
															thumbnails[7444771] = clik.newPhoto({"id":7444771,"src":"Copyright-AnneLyburn_09_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL09","height":194});
															thumbnails[7444773] = clik.newPhoto({"id":7444773,"src":"Copyright-AnneLyburn_10_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL10","height":194});
															thumbnails[7444774] = clik.newPhoto({"id":7444774,"src":"Copyright-AnneLyburn_11_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL11","height":194});
															thumbnails[7444775] = clik.newPhoto({"id":7444775,"src":"Copyright-AnneLyburn_12_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL12","height":194});
															thumbnails[7444777] = clik.newPhoto({"id":7444777,"src":"Copyright-AnneLyburn_13_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL13","height":194});
															thumbnails[7444779] = clik.newPhoto({"id":7444779,"src":"Copyright-AnneLyburn_14_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL14","height":194});
															thumbnails[7444780] = clik.newPhoto({"id":7444780,"src":"Copyright-AnneLyburn_15_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL15","height":194});
															thumbnails[7444782] = clik.newPhoto({"id":7444782,"src":"Copyright-AnneLyburn_16_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL16","height":194});
															thumbnails[7444784] = clik.newPhoto({"id":7444784,"src":"Copyright-AnneLyburn_17_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL17","height":194});
															thumbnails[7444785] = clik.newPhoto({"id":7444785,"src":"Copyright-AnneLyburn_18_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL18","height":194});
															thumbnails[7444786] = clik.newPhoto({"id":7444786,"src":"Copyright-AnneLyburn_19_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL19","height":194});
															thumbnails[7444787] = clik.newPhoto({"id":7444787,"src":"Copyright-AnneLyburn_20_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL20","height":194});
															thumbnails[7444790] = clik.newPhoto({"id":7444790,"src":"Copyright-AnneLyburn_21_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL21","height":194});
															thumbnails[7444791] = clik.newPhoto({"id":7444791,"src":"Copyright-AnneLyburn_22_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL22","height":194});
															thumbnails[7444792] = clik.newPhoto({"id":7444792,"src":"Copyright-AnneLyburn_23_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL23","height":194});
															thumbnails[7444795] = clik.newPhoto({"id":7444795,"src":"Copyright-AnneLyburn_24_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL24","height":194});
															thumbnails[7444796] = clik.newPhoto({"id":7444796,"src":"Copyright-AnneLyburn_25_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL25","height":194});
															thumbnails[7444797] = clik.newPhoto({"id":7444797,"src":"Copyright-AnneLyburn_26_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL26","height":194});
															thumbnails[7444800] = clik.newPhoto({"id":7444800,"src":"Copyright-AnneLyburn_27_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL27","height":194});
															thumbnails[7444801] = clik.newPhoto({"id":7444801,"src":"Copyright-AnneLyburn_28_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL28","height":194});
															thumbnails[7444802] = clik.newPhoto({"id":7444802,"src":"Copyright-AnneLyburn_29_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL29","height":194});
															thumbnails[7444804] = clik.newPhoto({"id":7444804,"src":"Copyright-AnneLyburn_30_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL30","height":194});
															thumbnails[7444806] = clik.newPhoto({"id":7444806,"src":"Copyright-AnneLyburn_31_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL31","height":87});
															thumbnails[7444807] = clik.newPhoto({"id":7444807,"src":"Copyright-AnneLyburn_32_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL32","height":87});
															thumbnails[7444898] = clik.newPhoto({"id":7444898,"src":"CopyrightAnneLyburn_01_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL33","height":87});
															thumbnails[7444899] = clik.newPhoto({"id":7444899,"src":"CopyrightAnneLyburn_02_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL34","height":194});
															thumbnails[7444900] = clik.newPhoto({"id":7444900,"src":"CopyrightAnneLyburn_03_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL35","height":87});
															thumbnails[7444901] = clik.newPhoto({"id":7444901,"src":"CopyrightAnneLyburn_04_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL36","height":194});
															thumbnails[7444903] = clik.newPhoto({"id":7444903,"src":"CopyrightAnneLyburn_05_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL37","height":194});
															thumbnails[7444904] = clik.newPhoto({"id":7444904,"src":"CopyrightAnneLyburn_06_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL38","height":194});
															thumbnails[7444905] = clik.newPhoto({"id":7444905,"src":"CopyrightAnneLyburn_07_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"AL39","height":194});
															thumbnails[8147991] = clik.newPhoto({"id":8147991,"src":"AnneLyburn_60KC_thumb.jpg","galleries_id":394769,"server_id":15,"link":"photo_8147991.html","width":130,"caption":"","height":198});
															thumbnails[8147993] = clik.newPhoto({"id":8147993,"src":"AnneLyburn_79_thumb.jpg","galleries_id":394769,"server_id":15,"link":"photo_8147993.html","width":130,"caption":"","height":85});
															thumbnails[8147994] = clik.newPhoto({"id":8147994,"src":"AnneLyburn_KC_thumb.jpg","galleries_id":394769,"server_id":15,"link":"photo_8147994.html","width":130,"caption":"","height":85});
															thumbnails[8147995] = clik.newPhoto({"id":8147995,"src":"AnneLyburn_0645_thumb.jpg","galleries_id":394705,"server_id":15,"link":"photo_8147995.html","width":130,"caption":"","height":194});
															thumbnails[7296582] = clik.newPhoto({"id":7296582,"src":"CopyrightAnneLyburnAL0352_thumb.jpg","galleries_id":394705,"server_id":15,"link":"photo_7296582.html","width":130,"caption":"","height":163});
															thumbnails[7296732] = clik.newPhoto({"id":7296732,"src":"0190edit_thumb.jpg","galleries_id":394769,"server_id":15,"link":"photo_7296732.html","width":130,"caption":"","height":87});
															thumbnails[7567981] = clik.newPhoto({"id":7567981,"src":"CopyrightAnneLyburn00451_thumb.jpg","galleries_id":394709,"server_id":15,"link":"photo_7567981.html","width":130,"caption":"","height":87});
															thumbnails[7296745] = clik.newPhoto({"id":7296745,"src":"CopyrightAnneLyburn-0015_thumb.jpg","galleries_id":394769,"server_id":15,"link":"photo_7296745.html","width":130,"caption":"","height":87});
															thumbnails[7296594] = clik.newPhoto({"id":7296594,"src":"CopyrightAnneLyburn06482_thumb.jpg","galleries_id":394705,"server_id":15,"link":"photo_7296594.html","width":130,"caption":"","height":194});
															thumbnails[7296734] = clik.newPhoto({"id":7296734,"src":"CopyrightAnneLyburn-0096_thumb.jpg","galleries_id":394769,"server_id":15,"link":"photo_7296734.html","width":130,"caption":"","height":87});
															thumbnails[7567982] = clik.newPhoto({"id":7567982,"src":"CopyrightAnneLyburn02121_thumb.jpg","galleries_id":394709,"server_id":15,"link":"photo_7567982.html","width":130,"caption":"","height":87});
															thumbnails[7296583] = clik.newPhoto({"id":7296583,"src":"CopyrightAnneLyburn06821_thumb.jpg","galleries_id":394705,"server_id":15,"link":"photo_7296583.html","width":130,"caption":"","height":194});
															thumbnails[7296738] = clik.newPhoto({"id":7296738,"src":"CopyrightAnneLyburn-0162_thumb.jpg","galleries_id":394769,"server_id":15,"link":"photo_7296738.html","width":130,"caption":"","height":194});
															thumbnails[7567984] = clik.newPhoto({"id":7567984,"src":"CopyrightAnneLyburn01881_thumb.jpg","galleries_id":394709,"server_id":15,"link":"photo_7567984.html","width":130,"caption":"","height":182});
															thumbnails[7296587] = clik.newPhoto({"id":7296587,"src":"CopyrightAnneLyburnAL151_thumb.jpg","galleries_id":394705,"server_id":15,"link":"photo_7296587.html","width":130,"caption":"","height":130});
															thumbnails[7296739] = clik.newPhoto({"id":7296739,"src":"CopyrightAnneLyburn-AL19_thumb.jpg","galleries_id":394769,"server_id":15,"link":"photo_7296739.html","width":130,"caption":"","height":97});
															thumbnails[7296769] = clik.newPhoto({"id":7296769,"src":"CopyrightAnneLyburn-0217_thumb.jpg","galleries_id":394709,"server_id":15,"link":"photo_7296769.html","width":130,"caption":"","height":182});
															thumbnails[7296588] = clik.newPhoto({"id":7296588,"src":"CopyrightAnneLyburnAL171_thumb.jpg","galleries_id":394705,"server_id":15,"link":"photo_7296588.html","width":130,"caption":"","height":182});
															thumbnails[7296740] = clik.newPhoto({"id":7296740,"src":"DSC_0052_thumb.jpg","galleries_id":394769,"server_id":15,"link":"photo_7296740.html","width":130,"caption":"","height":194});
															thumbnails[7296591] = clik.newPhoto({"id":7296591,"src":"CopyrightAnneLyburnAL05841_thumb.jpg","galleries_id":394705,"server_id":15,"link":"photo_7296591.html","width":130,"caption":"","height":88});
															thumbnails[7296741] = clik.newPhoto({"id":7296741,"src":"CopyrightAnneLyburn-0101_thumb.jpg","galleries_id":394769,"server_id":15,"link":"photo_7296741.html","width":130,"caption":"","height":163});
															thumbnails[7296634] = clik.newPhoto({"id":7296634,"src":"CopyrightAnneLyburn1001_thumb.jpg","galleries_id":394705,"server_id":15,"link":"photo_7296634.html","width":130,"caption":"","height":194});
															thumbnails[7296621] = clik.newPhoto({"id":7296621,"src":"CopyrightAnneLyburnAL21_thumb.jpg","galleries_id":394705,"server_id":15,"link":"photo_7296621.html","width":130,"caption":"","height":87});
															thumbnails[7296742] = clik.newPhoto({"id":7296742,"src":"CopyrightAnneLyburn-0147_thumb.jpg","galleries_id":394769,"server_id":15,"link":"photo_7296742.html","width":130,"caption":"","height":87});
															thumbnails[7296622] = clik.newPhoto({"id":7296622,"src":"CopyrightAnneLyburnAL11_thumb.jpg","galleries_id":394705,"server_id":15,"link":"photo_7296622.html","width":130,"caption":"","height":194});
															thumbnails[7296743] = clik.newPhoto({"id":7296743,"src":"CopyrightAnneLyburn-AL91_thumb.jpg","galleries_id":394769,"server_id":15,"link":"photo_7296743.html","width":130,"caption":"","height":87});
															thumbnails[7296748] = clik.newPhoto({"id":7296748,"src":"CopyrightAnneLyburn-0128_thumb.jpg","galleries_id":394769,"server_id":15,"link":"photo_7296748.html","width":130,"caption":"","height":87});
															thumbnails[7296635] = clik.newPhoto({"id":7296635,"src":"CopyrightAnneLyburn181_thumb.jpg","galleries_id":394705,"server_id":15,"link":"photo_7296635.html","width":130,"caption":"","height":195});
															thumbnails[7296744] = clik.newPhoto({"id":7296744,"src":"CopyrightAnneLyburn-0169_thumb.jpg","galleries_id":394769,"server_id":15,"link":"photo_7296744.html","width":130,"caption":"","height":87});
															thumbnails[7296637] = clik.newPhoto({"id":7296637,"src":"CopyrightAnneLyburn191_thumb.jpg","galleries_id":394705,"server_id":15,"link":"photo_7296637.html","width":130,"caption":"","height":195});
															thumbnails[7296638] = clik.newPhoto({"id":7296638,"src":"CopyrightAnneLyburn02003_thumb.jpg","galleries_id":394705,"server_id":15,"link":"photo_7296638.html","width":130,"caption":"","height":194});
															thumbnails[7296749] = clik.newPhoto({"id":7296749,"src":"CopyrightAnneLyburn-0201_thumb.jpg","galleries_id":394769,"server_id":15,"link":"photo_7296749.html","width":130,"caption":"","height":194});
															thumbnails[7296639] = clik.newPhoto({"id":7296639,"src":"CopyrightAnneLyburnAL0041_thumb.jpg","galleries_id":394705,"server_id":15,"link":"photo_7296639.html","width":130,"caption":"","height":194});
															thumbnails[7296747] = clik.newPhoto({"id":7296747,"src":"CopyrightAnneLyburn-63_thumb.jpg","galleries_id":394769,"server_id":15,"link":"photo_7296747.html","width":130,"caption":"","height":163});
															thumbnails[7567978] = clik.newPhoto({"id":7567978,"src":"CopyrightAnneLyburn-05021_thumb.jpg","galleries_id":394705,"server_id":15,"link":"photo_7567978.html","width":130,"caption":"","height":194});
															thumbnails[7688149] = clik.newPhoto({"id":7688149,"src":"ALyburn005Copyright_thumb.jpg","galleries_id":394705,"server_id":15,"link":"photo_7688149.html","width":130,"caption":"","height":195});
															thumbnails[7688151] = clik.newPhoto({"id":7688151,"src":"ALyburn0043Copyright_thumb.jpg","galleries_id":394769,"server_id":15,"link":"photo_7688151.html","width":130,"caption":"","height":87});
															thumbnails[7688150] = clik.newPhoto({"id":7688150,"src":"ALyburn259Copyright_thumb.jpg","galleries_id":394705,"server_id":15,"link":"photo_7688150.html","width":130,"caption":"","height":87});
															thumbnails[7688152] = clik.newPhoto({"id":7688152,"src":"ALyburn0050Copyright_thumb.jpg","galleries_id":394769,"server_id":15,"link":"photo_7688152.html","width":130,"caption":"","height":194});
															thumbnails[7688153] = clik.newPhoto({"id":7688153,"src":"ALyburn2499Copyright_thumb.jpg","galleries_id":394769,"server_id":15,"link":"photo_7688153.html","width":130,"caption":"","height":86});
															thumbnails[7688154] = clik.newPhoto({"id":7688154,"src":"ALyburn2600bCopyright_thumb.jpg","galleries_id":394769,"server_id":15,"link":"photo_7688154.html","width":130,"caption":"","height":196});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[394705] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Portraits","link":"gallery_394705.html","maxRecords":0.0,"photoIDs":[8147995.0,7296582.0,7296594.0,7296583.0,7296587.0,7296588.0,7296591.0,7296634.0,7296621.0,7296622.0,7296635.0,7296637.0,7296638.0,7296639.0,7567978.0,7688149.0,7688150.0],"skipIndex":0,"section_code":"gallery","featured_images":"8147995,7296583","id":394705,"singleSection":false});				  						galleries[394769] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Weddings","link":"gallery_394769.html","maxRecords":0.0,"photoIDs":[8147991.0,8147993.0,8147994.0,7296732.0,7296745.0,7296734.0,7296738.0,7296739.0,7296740.0,7296741.0,7296742.0,7296743.0,7296748.0,7296744.0,7296749.0,7296747.0,7688151.0,7688152.0,7688153.0,7688154.0],"skipIndex":0,"section_code":"gallery","featured_images":"7688154,7296744","id":394769,"singleSection":false});				  						galleries[394709] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Engagement Shoot","link":"gallery_394709.html","maxRecords":0.0,"photoIDs":[7567981.0,7567982.0,7567984.0,7296769.0],"skipIndex":0,"section_code":"gallery","featured_images":"7567984,7567981","id":394709,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '7296734,7296638';
imageSets[2] = '8147995,7567981,7567984,7296583,7296744,7688154,7444792';
imageSets[3] = '7296745';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/annelyburn/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/annelyburn/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/annelyburn/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/annelyburn/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/annelyburn/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/annelyburn/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/annelyburn/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/annelyburn/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/annelyburn/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/annelyburn/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/annelyburn/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/annelyburn/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/annelyburn/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/annelyburn/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/annelyburn/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/annelyburn/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/annelyburn/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/annelyburn/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/annelyburn/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/annelyburn/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/annelyburn/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/annelyburn/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/annelyburn/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/annelyburn/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/annelyburn/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/annelyburn/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/annelyburn/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 = 'Anne Lyburn 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.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>';
	}
				
	temp += this.fnGetPaymentInfo();
				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>Buy now using PayPal:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> &pound;' + (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.payment_groups_id !== '') {
		temp += '<p>Buy this print online:</p>';
				temp += '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
		 									temp += '<select class="paymentlink" name="payment_options_id" onchange="updateCartValue($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';
		
		temp += getPaymentOptions(this.payment_groups_id);
		temp += '</select>';
		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 += '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm">';
			temp += '	<input type="hidden" name="item_option" value="' + item_option + '">';
			temp += '	<input type="hidden" name="site" value="ANNELYBURN">';
			temp += '	<input type="hidden" name="item_number" value="'+ this.id +'">';
			temp += '	<input type="hidden" name="quantity" value="1">';
						temp += '	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\'\;" onmouseout="this.className=\'button\'\;" type="Button">';
							temp += '	<input value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button" onclick="javascript:window.location=\'cart.html\'">';
			temp += '</form>';
						temp += '<div class="clearing">&nbsp;</div>';
			temp += '<div id="confirmContainer">';
			temp += '<div id="paymentConfirm">Item added to cart</div>';
			temp += '</div>';
			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;
	}
}

			

