window.thumbnails = {};
															thumbnails[5543694] = clik.newPhoto({"id":5543694,"src":"hyd1_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":130});
															thumbnails[5544085] = clik.newPhoto({"id":5544085,"src":"anemone3_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":310});
															thumbnails[5545482] = clik.newPhoto({"id":5545482,"src":"iris_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":130});
															thumbnails[5548442] = clik.newPhoto({"id":5548442,"src":"semper_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":130});
															thumbnails[5549858] = clik.newPhoto({"id":5549858,"src":"clem1_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":130});
															thumbnails[5550439] = clik.newPhoto({"id":5550439,"src":"deck2_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":130});
															thumbnails[5553563] = clik.newPhoto({"id":5553563,"src":"med-garden2_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":92});
															thumbnails[5553564] = clik.newPhoto({"id":5553564,"src":"planting-plan_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":93});
															thumbnails[5553623] = clik.newPhoto({"id":5553623,"src":"plan-l-shape_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":92});
															thumbnails[5721357] = clik.newPhoto({"id":5721357,"src":"med-garden1_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":92});
															thumbnails[7255053] = clik.newPhoto({"id":7255053,"src":"orgblooms1_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":94});
															thumbnails[5538833] = clik.newPhoto({"id":5538833,"src":"heath1_thumb.jpg","galleries_id":312949,"server_id":5,"link":"photo_5538833.html","width":130,"caption":"","height":110});
															thumbnails[5538949] = clik.newPhoto({"id":5538949,"src":"heath3_thumb.jpg","galleries_id":312949,"server_id":5,"link":"photo_5538949.html","width":130,"caption":"","height":90});
															thumbnails[5538996] = clik.newPhoto({"id":5538996,"src":"hyd3_thumb.jpg","galleries_id":312949,"server_id":5,"link":"photo_5538996.html","width":130,"caption":"","height":87});
															thumbnails[5539010] = clik.newPhoto({"id":5539010,"src":"rose_thumb.jpg","galleries_id":312949,"server_id":5,"link":"photo_5539010.html","width":130,"caption":"","height":130});
															thumbnails[5539019] = clik.newPhoto({"id":5539019,"src":"astra_thumb.jpg","galleries_id":312949,"server_id":5,"link":"photo_5539019.html","width":130,"caption":"","height":87});
															thumbnails[5539022] = clik.newPhoto({"id":5539022,"src":"croc_thumb.jpg","galleries_id":312949,"server_id":5,"link":"photo_5539022.html","width":130,"caption":"","height":130});
															thumbnails[5539025] = clik.newPhoto({"id":5539025,"src":"pegbefore_thumb.jpg","galleries_id":313871,"server_id":5,"link":"photo_5539025.html","width":130,"caption":"","height":96});
															thumbnails[5539030] = clik.newPhoto({"id":5539030,"src":"pegafter_thumb.jpg","galleries_id":313871,"server_id":5,"link":"photo_5539030.html","width":130,"caption":"","height":96});
															thumbnails[5721180] = clik.newPhoto({"id":5721180,"src":"pegplan_thumb.jpg","galleries_id":313871,"server_id":5,"link":"photo_5721180.html","width":130,"caption":"","height":94});
															thumbnails[5721642] = clik.newPhoto({"id":5721642,"src":"kingston-garden-plan_thumb.jpg","galleries_id":324039,"server_id":5,"link":"photo_5721642.html","width":130,"caption":"","height":87});
															thumbnails[5721680] = clik.newPhoto({"id":5721680,"src":"yeovilton21_thumb.jpg","galleries_id":324039,"server_id":5,"link":"photo_5721680.html","width":130,"caption":"","height":165});
															thumbnails[5721682] = clik.newPhoto({"id":5721682,"src":"yeovilton11_thumb.jpg","galleries_id":324039,"server_id":5,"link":"photo_5721682.html","width":130,"caption":"","height":96});
															thumbnails[5526009] = clik.newPhoto({"id":5526009,"src":"alliums1_thumb.jpg","galleries_id":312948,"server_id":5,"link":"photo_5526009.html","width":130,"caption":"","height":87});
															thumbnails[8303675] = clik.newPhoto({"id":8303675,"src":"east1_thumb.jpg","galleries_id":441721,"server_id":5,"link":"photo_8303675.html","width":130,"caption":"","height":87});
															thumbnails[8601373] = clik.newPhoto({"id":8601373,"src":"cornock1_F3B9B8D6-1EC9-D45B-1C14D953C2CC2D16_thumb.jpg","galleries_id":454825,"server_id":5,"link":"photo_8601373.html","width":130,"caption":"","height":93});
															thumbnails[5538625] = clik.newPhoto({"id":5538625,"src":"alliums2_thumb.jpg","galleries_id":312948,"server_id":5,"link":"photo_5538625.html","width":130,"caption":"","height":87});
															thumbnails[8303677] = clik.newPhoto({"id":8303677,"src":"east2_thumb.jpg","galleries_id":441721,"server_id":5,"link":"photo_8303677.html","width":130,"caption":"","height":87});
															thumbnails[8601374] = clik.newPhoto({"id":8601374,"src":"cornock2_thumb.jpg","galleries_id":454825,"server_id":5,"link":"photo_8601374.html","width":130,"caption":"","height":93});
															thumbnails[6419042] = clik.newPhoto({"id":6419042,"src":"yonview2_thumb.jpg","galleries_id":312948,"server_id":5,"link":"photo_6419042.html","width":130,"caption":"","height":87});
															thumbnails[5538818] = clik.newPhoto({"id":5538818,"src":"yonview_thumb.jpg","galleries_id":312948,"server_id":5,"link":"photo_5538818.html","width":130,"caption":"","height":87});
															thumbnails[8303680] = clik.newPhoto({"id":8303680,"src":"east3_thumb.jpg","galleries_id":441721,"server_id":5,"link":"photo_8303680.html","width":130,"caption":"","height":87});
															thumbnails[8601375] = clik.newPhoto({"id":8601375,"src":"cornock3_thumb.jpg","galleries_id":454825,"server_id":5,"link":"photo_8601375.html","width":130,"caption":"","height":93});
															thumbnails[6419043] = clik.newPhoto({"id":6419043,"src":"snow9_thumb.jpg","galleries_id":312948,"server_id":5,"link":"photo_6419043.html","width":130,"caption":"","height":87});
															thumbnails[8303681] = clik.newPhoto({"id":8303681,"src":"east4_thumb.jpg","galleries_id":441721,"server_id":5,"link":"photo_8303681.html","width":130,"caption":"","height":87});
															thumbnails[8601376] = clik.newPhoto({"id":8601376,"src":"cornock4_thumb.jpg","galleries_id":454825,"server_id":5,"link":"photo_8601376.html","width":130,"caption":"","height":93});
															thumbnails[5538805] = clik.newPhoto({"id":5538805,"src":"pop2_thumb.jpg","galleries_id":312948,"server_id":5,"link":"photo_5538805.html","width":130,"caption":"","height":87});
															thumbnails[8303682] = clik.newPhoto({"id":8303682,"src":"east5_thumb.jpg","galleries_id":441721,"server_id":5,"link":"photo_8303682.html","width":130,"caption":"","height":87});
															thumbnails[8601377] = clik.newPhoto({"id":8601377,"src":"cornock5_thumb.jpg","galleries_id":454825,"server_id":5,"link":"photo_8601377.html","width":130,"caption":"","height":93});
															thumbnails[5538782] = clik.newPhoto({"id":5538782,"src":"dahlia_thumb.jpg","galleries_id":312948,"server_id":5,"link":"photo_5538782.html","width":130,"caption":"","height":87});
															thumbnails[5538816] = clik.newPhoto({"id":5538816,"src":"yonder-1_thumb.jpg","galleries_id":312948,"server_id":5,"link":"photo_5538816.html","width":130,"caption":"","height":90});
															thumbnails[8303686] = clik.newPhoto({"id":8303686,"src":"east6_thumb.jpg","galleries_id":441721,"server_id":5,"link":"photo_8303686.html","width":130,"caption":"","height":87});
															thumbnails[8601378] = clik.newPhoto({"id":8601378,"src":"cornock6_thumb.jpg","galleries_id":454825,"server_id":5,"link":"photo_8601378.html","width":130,"caption":"","height":93});
															thumbnails[5538800] = clik.newPhoto({"id":5538800,"src":"hyd2_thumb.jpg","galleries_id":312948,"server_id":5,"link":"photo_5538800.html","width":130,"caption":"","height":87});
															thumbnails[8303701] = clik.newPhoto({"id":8303701,"src":"east7_thumb.jpg","galleries_id":441721,"server_id":5,"link":"photo_8303701.html","width":130,"caption":"","height":87});
															thumbnails[8601379] = clik.newPhoto({"id":8601379,"src":"cornock7_thumb.jpg","galleries_id":454825,"server_id":5,"link":"photo_8601379.html","width":130,"caption":"","height":182});
															thumbnails[6418935] = clik.newPhoto({"id":6418935,"src":"pond-area-3_thumb.jpg","galleries_id":312948,"server_id":5,"link":"photo_6418935.html","width":130,"caption":"","height":87});
															thumbnails[6418938] = clik.newPhoto({"id":6418938,"src":"pond-area-4_thumb.jpg","galleries_id":312948,"server_id":5,"link":"photo_6418938.html","width":130,"caption":"","height":87});
															thumbnails[6419011] = clik.newPhoto({"id":6419011,"src":"yonspring9-copy_thumb.jpg","galleries_id":312948,"server_id":5,"link":"photo_6419011.html","width":130,"caption":"","height":87});
															thumbnails[6419013] = clik.newPhoto({"id":6419013,"src":"yonspring10-copy_thumb.jpg","galleries_id":312948,"server_id":5,"link":"photo_6419013.html","width":130,"caption":"","height":87});
															thumbnails[6419242] = clik.newPhoto({"id":6419242,"src":"yonder67_thumb.jpg","galleries_id":312948,"server_id":5,"link":"photo_6419242.html","width":130,"caption":"","height":87});
															thumbnails[5538811] = clik.newPhoto({"id":5538811,"src":"summerbefore_thumb.jpg","galleries_id":312948,"server_id":5,"link":"photo_5538811.html","width":130,"caption":"","height":86});
															thumbnails[8303717] = clik.newPhoto({"id":8303717,"src":"east8_thumb.jpg","galleries_id":441721,"server_id":5,"link":"photo_8303717.html","width":130,"caption":"","height":87});
															thumbnails[8601380] = clik.newPhoto({"id":8601380,"src":"cornock8_thumb.jpg","galleries_id":454825,"server_id":5,"link":"photo_8601380.html","width":130,"caption":"","height":93});
															thumbnails[5538812] = clik.newPhoto({"id":5538812,"src":"summerafter_thumb.jpg","galleries_id":312948,"server_id":5,"link":"photo_5538812.html","width":130,"caption":"","height":86});
															thumbnails[8303718] = clik.newPhoto({"id":8303718,"src":"east9_thumb.jpg","galleries_id":441721,"server_id":5,"link":"photo_8303718.html","width":130,"caption":"","height":86});
															thumbnails[6419044] = clik.newPhoto({"id":6419044,"src":"yonder43_thumb.jpg","galleries_id":312948,"server_id":5,"link":"photo_6419044.html","width":130,"caption":"","height":87});
															thumbnails[6419071] = clik.newPhoto({"id":6419071,"src":"yonder51_thumb.jpg","galleries_id":312948,"server_id":5,"link":"photo_6419071.html","width":130,"caption":"","height":87});
															thumbnails[6419157] = clik.newPhoto({"id":6419157,"src":"yonder54_thumb.jpg","galleries_id":312948,"server_id":5,"link":"photo_6419157.html","width":130,"caption":"","height":87});
															thumbnails[5538802] = clik.newPhoto({"id":5538802,"src":"pop_thumb.jpg","galleries_id":312948,"server_id":5,"link":"photo_5538802.html","width":130,"caption":"","height":86});
															thumbnails[8303719] = clik.newPhoto({"id":8303719,"src":"east10_thumb.jpg","galleries_id":441721,"server_id":5,"link":"photo_8303719.html","width":130,"caption":"","height":87});
															thumbnails[5538814] = clik.newPhoto({"id":5538814,"src":"ynview3_thumb.jpg","galleries_id":312948,"server_id":5,"link":"photo_5538814.html","width":130,"caption":"","height":87});
															thumbnails[8303720] = clik.newPhoto({"id":8303720,"src":"east11_thumb.jpg","galleries_id":441721,"server_id":5,"link":"photo_8303720.html","width":130,"caption":"","height":87});
															thumbnails[5538807] = clik.newPhoto({"id":5538807,"src":"pop4_thumb.jpg","galleries_id":312948,"server_id":5,"link":"photo_5538807.html","width":130,"caption":"","height":87});
															thumbnails[5538797] = clik.newPhoto({"id":5538797,"src":"eryth_thumb.jpg","galleries_id":312948,"server_id":5,"link":"photo_5538797.html","width":130,"caption":"","height":87});
															thumbnails[5538796] = clik.newPhoto({"id":5538796,"src":"dicentra_thumb.jpg","galleries_id":312948,"server_id":5,"link":"photo_5538796.html","width":130,"caption":"","height":87});
															thumbnails[6420030] = clik.newPhoto({"id":6420030,"src":"ISA652_thumb.jpg","galleries_id":312948,"server_id":5,"link":"photo_6420030.html","width":130,"caption":"","height":87});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[312948] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Yonder Cottage","link":"gallery_312948.html","maxRecords":0.0,"photoIDs":[5526009.0,5538625.0,6419042.0,5538818.0,6419043.0,5538805.0,5538782.0,5538816.0,5538800.0,6418935.0,6418938.0,6419011.0,6419013.0,6419242.0,5538811.0,5538812.0,6419044.0,6419071.0,6419157.0,5538802.0,5538814.0,5538807.0,5538797.0,5538796.0,6420030.0],"skipIndex":0,"section_code":"gallery","featured_images":5538814.0,"id":312948,"singleSection":false});				  						galleries[312949] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"north Bristol garden 1.","link":"gallery_312949.html","maxRecords":0.0,"photoIDs":[5538833.0,5538949.0,5538996.0,5539010.0,5539019.0,5539022.0],"skipIndex":0,"section_code":"gallery","featured_images":"5539022,5539019,5539010,5538996,5538949,5538833","id":312949,"singleSection":false});				  						galleries[313871] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"north Bristol garden 2.","link":"gallery_313871.html","maxRecords":0.0,"photoIDs":[5539025.0,5539030.0,5721180.0],"skipIndex":0,"section_code":"gallery","featured_images":"5721180,5539030,5539025","id":313871,"singleSection":false});				  						galleries[324039] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"London garden","link":"gallery_324039.html","maxRecords":0.0,"photoIDs":[5721642.0,5721680.0,5721682.0],"skipIndex":0,"section_code":"gallery","featured_images":"5721682,5721680,5721642","id":324039,"singleSection":false});				  						galleries[441721] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Walled garden","link":"gallery_441721.html","maxRecords":0.0,"photoIDs":[8303675.0,8303677.0,8303680.0,8303681.0,8303682.0,8303686.0,8303701.0,8303717.0,8303718.0,8303719.0,8303720.0],"skipIndex":0,"section_code":"gallery","featured_images":"8303720,8303719,8303718,8303717,8303701,8303686,8303682,8303681,8303680,8303677","id":441721,"singleSection":false});				  						galleries[454825] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Oldbury-on-Severn","link":"gallery_454825.html","maxRecords":0.0,"photoIDs":[8601373.0,8601374.0,8601375.0,8601376.0,8601377.0,8601378.0,8601379.0,8601380.0],"skipIndex":0,"section_code":"gallery","featured_images":"8601380,8601379,8601378,8601377,8601376,8601375,8601374,8601373","id":454825,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '5526009';
imageSets[2] = '5538814';
imageSets[3] = '5549858';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/gardendesigner/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/gardendesigner/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/gardendesigner/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/gardendesigner/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/gardendesigner/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/gardendesigner/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/gardendesigner/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/gardendesigner/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/gardendesigner/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/gardendesigner/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/gardendesigner/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/gardendesigner/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/gardendesigner/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/gardendesigner/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/gardendesigner/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/gardendesigner/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/gardendesigner/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/gardendesigner/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/gardendesigner/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/gardendesigner/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/gardendesigner/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/gardendesigner/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/gardendesigner/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/gardendesigner/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/gardendesigner/images';
		break;
	}
		return val;
}

/***************************************************************************
* img = reference to image object in which to show image                   *
***************************************************************************/
function showHomeImage(img) {
	imageID = randomListVal('');
	if (!basic) {
		img.src = photos[imageID].src;
		img.width = photos[imageID].width;
		img.height = photos[imageID].height;
		img.parentNode.title = img.alt = photos[imageID].caption;
	} else {
		newImage = new Image(photos[imageID].width,photos[imageID].height);
		newImage.src = photos[imageID].src;
		document.images[img.name] = newImage;
		
	}
}

function getHomeImageLink(imageID) {
  	var href='', photo = backgrounds && backgrounds[imageID];
	if(photo){
		if (photo && photo.galleries_id != '') {
  			href = photo.fnGalleryLink();
  		}
  		  		else {
  				href += 'gallery.html';
  	  		}
	}
    return href;
}

/***************************************************************************
* Show a random image on home page from featured images                    *
***************************************************************************/
function showHomeImageInline(el, image_sets_id, href) {
	
	var css = {}, imageID,
	    imageSetsId = 1;
	if(image_sets_id){
		imageSetsId = image_sets_id;
	}
	imageID = randomListVal(imageSets[imageSetsId]);
	if (href == null && 'gallery' != '') {
					href = getHomeImageLink(imageID);
	}
	
	updateImage({nextPhoto: backgrounds[imageID], img:el.find('img')[0],
                $photo:el, $title:$('#homeimageTitleContainer'), $detail:$('#homeimageDetailsContainer'),                speed:0, href:href, css:css, onAfter: function(){                  this.closest('.contentsection').doManualAlign({				    inner: 'img',				    crop: 'a'				  });                }              });
}

/***************************************************************************
* Set 'img' to be a new image given its photo() object                     *
***************************************************************************/
function updateImage (options) {
	var defaults = {nextPhoto:'',field:'',img:'',$photo:'',$title:'',$detail:'',$detailContainer:'',
                    updateDocumentTitle:false,speed:0,href:false,css:false,updateHash:false,onAfter:null,onBefore:null},
		op = $.extend({},defaults,options),
		html = '', temp = '',
		photoId = op.nextPhoto.id,
		photoCaption = ''+op.nextPhoto.caption,
		photoSrc = op.nextPhoto.src;
	
	if (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
	}
		
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'Yonder Cottage Garden Design: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		if (op.$photo.length > 0) {
		html = $('<img/>',{
			'class': 'mainphoto photo',
			src: photoSrc,
			id: 'mainPic',
			name: 'mainPic',
			width: op.nextPhoto.width,
			height: op.nextPhoto.height,
			alt: photoCaption,
			css: op.css || {}
		});
		if (op.href) {
			if (op.href.match(/<a/)) {
				html = $(op.href).append(html);
			} else {
				html = $('<a/>', {
					href: op.href,
					title: photoCaption
				}).append(html);
			}
		} else {
			html = $('<a/>', {
				title: photoCaption
			}).append(html);
		}
		if (op.speed == 0) {			op.$photo.html(html);			if (op.onBefore) {			  	op.onBefore.apply(op.$photo);			}			if (op.onAfter) {			  	op.onAfter.apply(op.$photo);			}		} else {			op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){  				if (op.onAfter) {				  	op.onAfter.apply(this);				}				clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));			}, op.onBefore);
		}	}
    if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
        if (!op.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.photo_ref != '') {
		temp += '<div class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</div>';
	}
		if (this.takendate != '') {
		
		temp += '<div class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</div>';
	}
	
	if (this.location != '') {
		
		temp += '<div class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</div>';
	}
				
				if (temp != '') {
		temp += '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp += '<p>Order this print:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> ' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
		else {
		
	}
	if (this.item_price !== '' || this.payment_groups_id !== '') {
			temp += '<div class="clearing">&nbsp;</div>';
	}
	return temp;};

/***************************************************************************
* Pick a photo at random from the featured images of a gallery.            *
* Gallery_id = id of gallery to choose,                                    *
* img = reference to html image in                                         *
* which to show image                                                      *
***************************************************************************/
function showGalleryImage(gallery_id, img, updateLink) {
	
	if(img){
		if (location.hash.match('galleries_id=' + gallery_id) && (imageID = location.hash.match('.*photos_id=(.+)$'))) {
		  	imageID = imageID[1];
		} else {
		  	imageID = randomListVal(galleries[gallery_id].featured_images);
		}
		
		if (imageID != 0) {
			img.src = thumbnails[imageID].src;
			img.width = thumbnails[imageID].width;
			img.height = thumbnails[imageID].height;
			img.alt = galleries[gallery_id].title;
			if (updateLink) {
				$(img).parent().attr({					title: galleries[gallery_id].title				}).filter(function(){return this.href;}).attr({					href: thumbnails[imageID].fnGalleryLink(gallery_id)				});
			}
		}
	}
}

/***************************************************************************
* If we have dynamic HTML, replace the galleries link with a list that     *
* doesn't include thecurrent gallery                                       *
***************************************************************************/
function showGalleries(gallery_id) {
		
	
	if (!basic) {
		temp = '';
		for (i = 0; i < galleries.length; i++) {
						
			
			if (galleries[i].id != gallery_id) {
								
				if (temp != '') {
					temp += ' | ';
				}
								temp += '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
							}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

