window.thumbnails = {};
															thumbnails[5748321] = clik.newPhoto({"id":5748321,"src":"14430005_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":196});
															thumbnails[4448580] = clik.newPhoto({"id":4448580,"src":"c_1_new1_thumb.jpg","galleries_id":260066,"server_id":1,"link":"photo_4448580.html","width":130,"caption":"","height":155});
															thumbnails[4448582] = clik.newPhoto({"id":4448582,"src":"08_thumb.jpg","galleries_id":382383,"server_id":1,"link":"photo_4448582.html","width":130,"caption":"","height":157});
															thumbnails[4448587] = clik.newPhoto({"id":4448587,"src":"09_1_thumb.jpg","galleries_id":382383,"server_id":1,"link":"photo_4448587.html","width":130,"caption":"","height":156});
															thumbnails[4448700] = clik.newPhoto({"id":4448700,"src":"c_4_thumb.jpg","galleries_id":260066,"server_id":1,"link":"photo_4448700.html","width":130,"caption":"","height":155});
															thumbnails[4448589] = clik.newPhoto({"id":4448589,"src":"09_2_thumb.jpg","galleries_id":382383,"server_id":1,"link":"photo_4448589.html","width":130,"caption":"","height":157});
															thumbnails[4448592] = clik.newPhoto({"id":4448592,"src":"10_1_thumb.jpg","galleries_id":382383,"server_id":1,"link":"photo_4448592.html","width":130,"caption":"","height":155});
															thumbnails[4448595] = clik.newPhoto({"id":4448595,"src":"10_2_thumb.jpg","galleries_id":382383,"server_id":1,"link":"photo_4448595.html","width":130,"caption":"","height":158});
															thumbnails[4448633] = clik.newPhoto({"id":4448633,"src":"11_thumb.jpg","galleries_id":382383,"server_id":1,"link":"photo_4448633.html","width":130,"caption":"","height":155});
															thumbnails[4448635] = clik.newPhoto({"id":4448635,"src":"14_thumb.jpg","galleries_id":260066,"server_id":1,"link":"photo_4448635.html","width":130,"caption":"","height":157});
															thumbnails[4448641] = clik.newPhoto({"id":4448641,"src":"15_thumb.jpg","galleries_id":260066,"server_id":1,"link":"photo_4448641.html","width":130,"caption":"","height":157});
															thumbnails[4448654] = clik.newPhoto({"id":4448654,"src":"16_thumb.jpg","galleries_id":260066,"server_id":1,"link":"photo_4448654.html","width":130,"caption":"","height":157});
															thumbnails[4448657] = clik.newPhoto({"id":4448657,"src":"17_thumb.jpg","galleries_id":260066,"server_id":1,"link":"photo_4448657.html","width":130,"caption":"","height":154});
															thumbnails[4448659] = clik.newPhoto({"id":4448659,"src":"18_thumb.jpg","galleries_id":260066,"server_id":1,"link":"photo_4448659.html","width":130,"caption":"","height":157});
															thumbnails[4448694] = clik.newPhoto({"id":4448694,"src":"26_thumb.jpg","galleries_id":260066,"server_id":1,"link":"photo_4448694.html","width":130,"caption":"","height":153});
															thumbnails[4448695] = clik.newPhoto({"id":4448695,"src":"27_thumb.jpg","galleries_id":260066,"server_id":1,"link":"photo_4448695.html","width":130,"caption":"","height":158});
															thumbnails[4448696] = clik.newPhoto({"id":4448696,"src":"28_thumb.jpg","galleries_id":260066,"server_id":1,"link":"photo_4448696.html","width":130,"caption":"","height":155});
															thumbnails[4448699] = clik.newPhoto({"id":4448699,"src":"29_thumb.jpg","galleries_id":260066,"server_id":1,"link":"photo_4448699.html","width":130,"caption":"","height":159});
															thumbnails[4448680] = clik.newPhoto({"id":4448680,"src":"22_2_thumb.jpg","galleries_id":260066,"server_id":1,"link":"photo_4448680.html","width":130,"caption":"","height":156});
															thumbnails[4448692] = clik.newPhoto({"id":4448692,"src":"23_2_thumb.jpg","galleries_id":260066,"server_id":1,"link":"photo_4448692.html","width":130,"caption":"","height":155});
															thumbnails[4449067] = clik.newPhoto({"id":4449067,"src":"72280003_thumb.jpg","galleries_id":382428,"server_id":1,"link":"photo_4449067.html","width":130,"caption":"Nacton #001","height":130});
															thumbnails[4449093] = clik.newPhoto({"id":4449093,"src":"72280004_thumb.jpg","galleries_id":382428,"server_id":1,"link":"photo_4449093.html","width":130,"caption":"Nacton #002","height":130});
															thumbnails[4449096] = clik.newPhoto({"id":4449096,"src":"72280006_thumb.jpg","galleries_id":382428,"server_id":1,"link":"photo_4449096.html","width":130,"caption":"Nacton #003","height":130});
															thumbnails[4449098] = clik.newPhoto({"id":4449098,"src":"72280008_thumb.jpg","galleries_id":382428,"server_id":1,"link":"photo_4449098.html","width":130,"caption":"Nacton #004","height":130});
															thumbnails[4449099] = clik.newPhoto({"id":4449099,"src":"72280009_thumb.jpg","galleries_id":382428,"server_id":1,"link":"photo_4449099.html","width":130,"caption":"Nacton #005","height":130});
															thumbnails[4449101] = clik.newPhoto({"id":4449101,"src":"72280010_thumb.jpg","galleries_id":382428,"server_id":1,"link":"photo_4449101.html","width":130,"caption":"Nacton #006","height":130});
															thumbnails[4449126] = clik.newPhoto({"id":4449126,"src":"78910004_thumb.jpg","galleries_id":382428,"server_id":1,"link":"photo_4449126.html","width":130,"caption":"TateModern #001","height":130});
															thumbnails[4449128] = clik.newPhoto({"id":4449128,"src":"78910010_thumb.jpg","galleries_id":382428,"server_id":1,"link":"photo_4449128.html","width":130,"caption":"Southbank #001","height":130});
															thumbnails[4449151] = clik.newPhoto({"id":4449151,"src":"78910011_thumb.jpg","galleries_id":382428,"server_id":1,"link":"photo_4449151.html","width":130,"caption":"Camden #001","height":130});
															thumbnails[4449153] = clik.newPhoto({"id":4449153,"src":"78920004_thumb.jpg","galleries_id":382428,"server_id":1,"link":"photo_4449153.html","width":130,"caption":"Borough Market #001","height":130});
															thumbnails[4449157] = clik.newPhoto({"id":4449157,"src":"78920008_thumb.jpg","galleries_id":382428,"server_id":1,"link":"photo_4449157.html","width":130,"caption":"Borough Market #002","height":130});
															thumbnails[4449164] = clik.newPhoto({"id":4449164,"src":"78920009_thumb.jpg","galleries_id":382428,"server_id":1,"link":"photo_4449164.html","width":130,"caption":"Borough Market #003","height":130});
															thumbnails[4449167] = clik.newPhoto({"id":4449167,"src":"78920010_thumb.jpg","galleries_id":382428,"server_id":1,"link":"photo_4449167.html","width":130,"caption":"Borough Market #004","height":130});
															thumbnails[4449169] = clik.newPhoto({"id":4449169,"src":"78920011_thumb.jpg","galleries_id":382428,"server_id":1,"link":"photo_4449169.html","width":130,"caption":"Borough Market #005","height":130});
															thumbnails[7149287] = clik.newPhoto({"id":7149287,"src":"P1010002_thumb.jpg","galleries_id":386401,"server_id":1,"link":"photo_7149287.html","width":160,"caption":"mini_clubman","height":160});
															thumbnails[7149295] = clik.newPhoto({"id":7149295,"src":"P1010001_thumb.jpg","galleries_id":386401,"server_id":1,"link":"photo_7149295.html","width":160,"caption":"pub","height":160});
															thumbnails[7149296] = clik.newPhoto({"id":7149296,"src":"P1010005_thumb.jpg","galleries_id":386401,"server_id":1,"link":"photo_7149296.html","width":160,"caption":"water feature","height":160});
															thumbnails[7149300] = clik.newPhoto({"id":7149300,"src":"P1010007_thumb.jpg","galleries_id":386401,"server_id":1,"link":"photo_7149300.html","width":160,"caption":"Christchurch Park","height":160});
															thumbnails[7149303] = clik.newPhoto({"id":7149303,"src":"P1010014_thumb.jpg","galleries_id":386401,"server_id":1,"link":"photo_7149303.html","width":160,"caption":"Ice Pavillion ","height":160});
															thumbnails[7149304] = clik.newPhoto({"id":7149304,"src":"P1010017_thumb.jpg","galleries_id":386401,"server_id":1,"link":"photo_7149304.html","width":160,"caption":"Oak tree","height":160});
															thumbnails[7149306] = clik.newPhoto({"id":7149306,"src":"P1010018_thumb.jpg","galleries_id":386401,"server_id":1,"link":"photo_7149306.html","width":160,"caption":"Line of trees","height":160});
															thumbnails[7149308] = clik.newPhoto({"id":7149308,"src":"P1010019_thumb.jpg","galleries_id":386401,"server_id":1,"link":"photo_7149308.html","width":160,"caption":"Bench","height":160});
															thumbnails[7149312] = clik.newPhoto({"id":7149312,"src":"P1010020_thumb.jpg","galleries_id":386401,"server_id":1,"link":"photo_7149312.html","width":160,"caption":"Tree","height":160});
															thumbnails[7149316] = clik.newPhoto({"id":7149316,"src":"P1010025_thumb.jpg","galleries_id":386401,"server_id":1,"link":"photo_7149316.html","width":160,"caption":"Reflection","height":160});
															thumbnails[7149318] = clik.newPhoto({"id":7149318,"src":"P1010027_thumb.jpg","galleries_id":386401,"server_id":1,"link":"photo_7149318.html","width":160,"caption":"Still","height":160});
															thumbnails[7149321] = clik.newPhoto({"id":7149321,"src":"P1010028_thumb.jpg","galleries_id":386401,"server_id":1,"link":"photo_7149321.html","width":160,"caption":"Bridge","height":160});
															thumbnails[7069897] = clik.newPhoto({"id":7069897,"src":"marching_thumb.jpg","galleries_id":382836,"server_id":1,"link":"photo_7069897.html","width":130,"caption":"","height":46});
															thumbnails[7849526] = clik.newPhoto({"id":7849526,"src":"Picture_1_thumb.jpg","galleries_id":423472,"server_id":1,"link":"photo_7849526.html","width":130,"caption":"","height":97});
															thumbnails[7069898] = clik.newPhoto({"id":7069898,"src":"standing_thumb.jpg","galleries_id":382836,"server_id":1,"link":"photo_7069898.html","width":130,"caption":"","height":46});
															thumbnails[7849533] = clik.newPhoto({"id":7849533,"src":"Picture_2_thumb.jpg","galleries_id":423472,"server_id":1,"link":"photo_7849533.html","width":130,"caption":"","height":98});
															thumbnails[7069899] = clik.newPhoto({"id":7069899,"src":"soldier_line_thumb.jpg","galleries_id":382836,"server_id":1,"link":"photo_7069899.html","width":130,"caption":"","height":46});
															thumbnails[7849562] = clik.newPhoto({"id":7849562,"src":"Picture_3_thumb.jpg","galleries_id":423472,"server_id":1,"link":"photo_7849562.html","width":130,"caption":"","height":98});
															thumbnails[7102407] = clik.newPhoto({"id":7102407,"src":"army_dead_thumb.jpg","galleries_id":382836,"server_id":1,"link":"photo_7102407.html","width":130,"caption":"","height":46});
															thumbnails[7849642] = clik.newPhoto({"id":7849642,"src":"Picture_4_thumb.jpg","galleries_id":423472,"server_id":1,"link":"photo_7849642.html","width":130,"caption":"","height":98});
															thumbnails[7102412] = clik.newPhoto({"id":7102412,"src":"cementry_boxes_thumb.jpg","galleries_id":382836,"server_id":1,"link":"photo_7102412.html","width":130,"caption":"","height":46});
															thumbnails[7849646] = clik.newPhoto({"id":7849646,"src":"Picture_5_thumb.jpg","galleries_id":423472,"server_id":1,"link":"photo_7849646.html","width":130,"caption":"","height":98});
															thumbnails[7102414] = clik.newPhoto({"id":7102414,"src":"cementry_field_thumb.jpg","galleries_id":382836,"server_id":1,"link":"photo_7102414.html","width":130,"caption":"","height":46});
															thumbnails[7102415] = clik.newPhoto({"id":7102415,"src":"pano_cementry_thumb.jpg","galleries_id":382836,"server_id":1,"link":"photo_7102415.html","width":130,"caption":"","height":46});
															thumbnails[7102417] = clik.newPhoto({"id":7102417,"src":"saint_george_thumb.jpg","galleries_id":382836,"server_id":1,"link":"photo_7102417.html","width":130,"caption":"","height":46});
															thumbnails[7102421] = clik.newPhoto({"id":7102421,"src":"soldier_field_thumb.jpg","galleries_id":382836,"server_id":1,"link":"photo_7102421.html","width":130,"caption":"","height":46});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[423472] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"urban decay - cliff brewery","link":"section507880.html","maxRecords":0.0,"photoIDs":[7849526.0,7849533.0,7849562.0,7849642.0,7849646.0],"skipIndex":0,"section_code":"section507880","featured_images":7849533.0,"id":423472,"singleSection":true});				  						galleries[260066] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"another life","link":"section455358.html","maxRecords":0.0,"photoIDs":[4448580.0,4448700.0,4448635.0,4448641.0,4448654.0,4448657.0,4448659.0,4448694.0,4448695.0,4448696.0,4448699.0,4448680.0,4448692.0],"skipIndex":0,"section_code":"section455358","featured_images":"4448700,4448580","id":260066,"singleSection":true});				  						galleries[404149] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Photographer's Coffee Table","link":"section458304.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"section458304","featured_images":"","id":404149,"singleSection":true});				  						galleries[382836] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"prestigious death","link":"section507792.html","maxRecords":0.0,"photoIDs":[7069897.0,7069898.0,7069899.0,7102407.0,7102412.0,7102414.0,7102415.0,7102417.0,7102421.0],"skipIndex":0,"section_code":"section507792","featured_images":7069897.0,"id":382836,"singleSection":true});				  						galleries[382428] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"square","link":"section507782.html","maxRecords":0.0,"photoIDs":[4449067.0,4449093.0,4449096.0,4449098.0,4449099.0,4449101.0,4449126.0,4449128.0,4449151.0,4449153.0,4449157.0,4449164.0,4449167.0,4449169.0],"skipIndex":0,"section_code":"section507782","featured_images":4449096.0,"id":382428,"singleSection":true});				  						galleries[382383] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"urban aftermath","link":"section507764.html","maxRecords":0.0,"photoIDs":[4448582.0,4448587.0,4448589.0,4448592.0,4448595.0,4448633.0],"skipIndex":0,"section_code":"section507764","featured_images":"4448633,4448595,4448592,4448589,4448587,4448582","id":382383,"singleSection":true});				  						galleries[386401] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"winter","link":"section507790.html","maxRecords":0.0,"photoIDs":[7149287.0,7149295.0,7149296.0,7149300.0,7149303.0,7149304.0,7149306.0,7149308.0,7149312.0,7149316.0,7149318.0,7149321.0],"skipIndex":0,"section_code":"section507790","featured_images":7149287.0,"id":386401,"singleSection":true});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '7069897,5748321,7849642,4449151,7149321';
imageSets[2] = '7149287,7069897,4448580,7849533,4448700,4449096';
imageSets[3] = '7849646,7849642,7849562,7849533,7849526,7149321,7149318,7149316,7149312,7149308,7149306,7149304,7149303,7149300,7149296,7149295,7149287,7102421,7102417,7102415,7102414,7102412,7102407,7069899,7069898,7069897,5748321,4449169,4449167,4449164,4449157,4449153,4449151,4449128,4449126,4449101,4449099,4449098,4449096,4449093,4449067,4448700,4448699,4448696,4448695,4448694,4448692,4448680,4448659,4448657';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/eyende/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/eyende/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/eyende/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/eyende/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/eyende/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/eyende/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/eyende/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/eyende/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/eyende/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/eyende/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/eyende/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/eyende/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/eyende/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/eyende/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/eyende/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/eyende/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/eyende/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/eyende/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/eyende/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/eyende/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/eyende/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/eyende/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/eyende/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/eyende/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/eyende/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/eyende/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/eyende/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 += 'section507764.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 && 'section507764' != '') {
					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 = 'eyende.com: ' + 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>';
	}
				
	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="EYENDE">';
			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;
	}
}

			

