window.thumbnails = {};
															thumbnails[7770676] = clik.newPhoto({"id":7770676,"src":"Zanny_with_Docklands_painting_400px_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":141,"caption":"","height":160});
															thumbnails[5989206] = clik.newPhoto({"id":5989206,"src":"Beat_the_rush_2_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Beat the Rush II","height":184});
															thumbnails[6880250] = clik.newPhoto({"id":6880250,"src":"Piccadilly_Circus_2b_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Piccadilly Circus II","height":64});
															thumbnails[6880246] = clik.newPhoto({"id":6880246,"src":"Piccadilly_study1_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Piccadilly Circus study I","height":87});
															thumbnails[6215200] = clik.newPhoto({"id":6215200,"src":"London_Olympic_Build_3close_upA_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"London Olympic Build III (close up)","height":90});
															thumbnails[6215201] = clik.newPhoto({"id":6215201,"src":"London_Olympic_Build_3close_upB_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"London Olympic Build III (close up)","height":87});
															thumbnails[5146980] = clik.newPhoto({"id":5146980,"src":"KerouacCover_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":216});
															thumbnails[5146892] = clik.newPhoto({"id":5146892,"src":"SCA1_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Prospectus cover","height":182});
															thumbnails[5147245] = clik.newPhoto({"id":5147245,"src":"SCAphoto1_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Prospectus cover","height":173});
															thumbnails[5388413] = clik.newPhoto({"id":5388413,"src":"Reach_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Reach for the Top","height":184});
															thumbnails[4164880] = clik.newPhoto({"id":4164880,"src":"DADfront_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":48});
															thumbnails[4164885] = clik.newPhoto({"id":4164885,"src":"DADback_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":48});
															thumbnails[5147271] = clik.newPhoto({"id":5147271,"src":"DAD-photo_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":98});
															thumbnails[5146951] = clik.newPhoto({"id":5146951,"src":"Kerouac_poster2_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":92});
															thumbnails[7705907] = clik.newPhoto({"id":7705907,"src":"Albert-Bridge_08_thumb.jpg","galleries_id":416170,"server_id":32,"link":"photo_7705907.html","width":160,"caption":"","height":97});
															thumbnails[7705964] = clik.newPhoto({"id":7705964,"src":"Albert_blue_pink_thumb.jpg","galleries_id":416170,"server_id":32,"link":"photo_7705964.html","width":160,"caption":"","height":118});
															thumbnails[7706019] = clik.newPhoto({"id":7706019,"src":"Central_Bristol_web1_thumb.jpg","galleries_id":416170,"server_id":32,"link":"photo_7706019.html","width":160,"caption":"","height":98});
															thumbnails[7706033] = clik.newPhoto({"id":7706033,"src":"Picadilly_Circus1_thumb.jpg","galleries_id":416168,"server_id":32,"link":"photo_7706033.html","width":160,"caption":"","height":103});
															thumbnails[7706055] = clik.newPhoto({"id":7706055,"src":"London_Olympic_Build_II_web_thumb.jpg","galleries_id":416168,"server_id":32,"link":"photo_7706055.html","width":160,"caption":"","height":114});
															thumbnails[9097195] = clik.newPhoto({"id":9097195,"src":"helmet1a_1_thumb.jpg","galleries_id":480063,"server_id":37,"link":"photo_9097195.html","width":119,"caption":"","height":160});
															thumbnails[8308351] = clik.newPhoto({"id":8308351,"src":"ZannyMellor_SouthbankAtNight_study_I_thumb.jpg","galleries_id":416167,"server_id":32,"link":"photo_8308351.html","width":160,"caption":"","height":119});
															thumbnails[7705413] = clik.newPhoto({"id":7705413,"src":"Zanny_Mellor_London_Docklands1_thumb.jpg","galleries_id":416167,"server_id":32,"link":"photo_7705413.html","width":135,"caption":"","height":160});
															thumbnails[9097915] = clik.newPhoto({"id":9097915,"src":"Sothebys_flyer_photo_web_1_thumb.jpg","galleries_id":416162,"server_id":37,"link":"photo_9097915.html","width":120,"caption":"","height":160});
															thumbnails[7739479] = clik.newPhoto({"id":7739479,"src":"Hilton_reception_web_thumb.jpg","galleries_id":416167,"server_id":32,"link":"photo_7739479.html","width":160,"caption":"","height":160});
															thumbnails[9097222] = clik.newPhoto({"id":9097222,"src":"helmet3a_1_thumb.jpg","galleries_id":480063,"server_id":37,"link":"photo_9097222.html","width":119,"caption":"","height":160});
															thumbnails[9097920] = clik.newPhoto({"id":9097920,"src":"Sothebys_flyer_shot_web_1_thumb.jpg","galleries_id":416162,"server_id":37,"link":"photo_9097920.html","width":118,"caption":"","height":160});
															thumbnails[7705385] = clik.newPhoto({"id":7705385,"src":"Marlborough_2011_thumb.jpg","galleries_id":416167,"server_id":32,"link":"photo_7705385.html","width":160,"caption":"","height":113});
															thumbnails[7705395] = clik.newPhoto({"id":7705395,"src":"Stockbridge_web_thumb.jpg","galleries_id":416168,"server_id":32,"link":"photo_7705395.html","width":160,"caption":"","height":68});
															thumbnails[9097224] = clik.newPhoto({"id":9097224,"src":"helmet2_1_thumb.jpg","galleries_id":480063,"server_id":37,"link":"photo_9097224.html","width":160,"caption":"","height":135});
															thumbnails[9097973] = clik.newPhoto({"id":9097973,"src":"Sothebys_unused_flyer_web_1_thumb.jpg","galleries_id":416162,"server_id":37,"link":"photo_9097973.html","width":100,"caption":"","height":160});
															thumbnails[6543845] = clik.newPhoto({"id":6543845,"src":"Drink_it_up_thumb.jpg","galleries_id":416162,"server_id":32,"link":"photo_6543845.html","width":130,"caption":"","height":184});
															thumbnails[9097357] = clik.newPhoto({"id":9097357,"src":"IMG_3239_thumb.jpg","galleries_id":480063,"server_id":37,"link":"photo_9097357.html","width":107,"caption":"","height":160});
															thumbnails[6215197] = clik.newPhoto({"id":6215197,"src":"London_Olympic_Build_3_thumb.jpg","galleries_id":416168,"server_id":32,"link":"photo_6215197.html","width":130,"caption":"","height":172});
															thumbnails[7684484] = clik.newPhoto({"id":7684484,"src":"Thames_Angle2_thumb.jpg","galleries_id":416162,"server_id":32,"link":"photo_7684484.html","width":113,"caption":"","height":160});
															thumbnails[9097346] = clik.newPhoto({"id":9097346,"src":"Zanny_helmet_1_thumb.jpg","galleries_id":480063,"server_id":37,"link":"photo_9097346.html","width":107,"caption":"","height":160});
															thumbnails[7684485] = clik.newPhoto({"id":7684485,"src":"Love_You_Sun_thumb.jpg","galleries_id":416162,"server_id":32,"link":"photo_7684485.html","width":160,"caption":"","height":112});
															thumbnails[9097365] = clik.newPhoto({"id":9097365,"src":"IMG_3133_edit_a_1_thumb.jpg","galleries_id":480063,"server_id":37,"link":"photo_9097365.html","width":107,"caption":"","height":160});
															thumbnails[5989204] = clik.newPhoto({"id":5989204,"src":"AOI-cycling_thumb.jpg","galleries_id":416162,"server_id":32,"link":"photo_5989204.html","width":130,"caption":"","height":130});
															thumbnails[9097368] = clik.newPhoto({"id":9097368,"src":"IMG_3160a_1_thumb.jpg","galleries_id":480063,"server_id":37,"link":"photo_9097368.html","width":107,"caption":"","height":160});
															thumbnails[6126490] = clik.newPhoto({"id":6126490,"src":"TFL_skyline_thumb.jpg","galleries_id":416162,"server_id":32,"link":"photo_6126490.html","width":130,"caption":"","height":154});
															thumbnails[5945335] = clik.newPhoto({"id":5945335,"src":"Dont_be_a_drip_WEB_thumb.jpg","galleries_id":416162,"server_id":32,"link":"photo_5945335.html","width":130,"caption":"","height":184});
															thumbnails[4833022] = clik.newPhoto({"id":4833022,"src":"Ferry-bridge_thumb.jpg","galleries_id":416170,"server_id":32,"link":"photo_4833022.html","width":130,"caption":"","height":85});
															thumbnails[7701206] = clik.newPhoto({"id":7701206,"src":"TFL2web_thumb.jpg","galleries_id":416162,"server_id":32,"link":"photo_7701206.html","width":160,"caption":"","height":160});
															thumbnails[5079565] = clik.newPhoto({"id":5079565,"src":"Cover_thumb.jpg","galleries_id":416162,"server_id":32,"link":"photo_5079565.html","width":130,"caption":"","height":130});
															thumbnails[5079573] = clik.newPhoto({"id":5079573,"src":"BackCover_thumb.jpg","galleries_id":416162,"server_id":32,"link":"photo_5079573.html","width":130,"caption":"","height":116});
															thumbnails[5388486] = clik.newPhoto({"id":5388486,"src":"PhtoPW_thumb.jpg","galleries_id":416162,"server_id":32,"link":"photo_5388486.html","width":130,"caption":"","height":97});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[416163] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"PAINTING","link":"portfolio_416163.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"portfolio","featured_images":8308351,"id":416163,"singleSection":false});				  						galleries[416167] = clik.newGallery({"parentGallery":416163,"usePopups":false,"title":2011.0,"link":"portfolio_416167.html","maxRecords":0.0,"photoIDs":[8308351.0,7705413.0,7739479.0,7705385.0],"skipIndex":0,"section_code":"portfolio","featured_images":8308351.0,"id":416167,"singleSection":false});				  						galleries[416162] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"ILLUSTRATION","link":"portfolio_416162.html","maxRecords":0.0,"photoIDs":[9097915.0,9097920.0,9097973.0,6543845.0,7684484.0,7684485.0,5989204.0,6126490.0,5945335.0,7701206.0,5079565.0,5079573.0,5388486.0],"skipIndex":0,"section_code":"portfolio","featured_images":5989204.0,"id":416162,"singleSection":false});				  						galleries[416168] = clik.newGallery({"parentGallery":416163,"usePopups":false,"title":2010.0,"link":"portfolio_416168.html","maxRecords":0.0,"photoIDs":[7706033.0,7706055.0,7705395.0,6215197.0],"skipIndex":0,"section_code":"portfolio","featured_images":6215197.0,"id":416168,"singleSection":false});				  						galleries[480063] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"DESIGN","link":"portfolio_480063.html","maxRecords":0.0,"photoIDs":[9097195.0,9097222.0,9097224.0,9097357.0,9097346.0,9097365.0,9097368.0],"skipIndex":0,"section_code":"portfolio","featured_images":9097222.0,"id":480063,"singleSection":false});				  						galleries[416170] = clik.newGallery({"parentGallery":416163,"usePopups":false,"title":"2007-2009","link":"portfolio_416170.html","maxRecords":0.0,"photoIDs":[7705907.0,7705964.0,7706019.0,4833022.0],"skipIndex":0,"section_code":"portfolio","featured_images":7705964.0,"id":416170,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[244415] = '7770676';
imageSets[1] = '7705413';
imageSets[2] = '7705964,8308351,9097222,6215197,5989204';
imageSets[3] = '7701206';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/zmellor/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/zmellor/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/zmellor/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/zmellor/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/zmellor/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/zmellor/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/zmellor/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/zmellor/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/zmellor/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/zmellor/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/zmellor/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/zmellor/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/zmellor/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/zmellor/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/zmellor/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/zmellor/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/zmellor/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/zmellor/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/zmellor/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/zmellor/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/zmellor/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/zmellor/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/zmellor/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/zmellor/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/zmellor/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/zmellor/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/zmellor/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 += 'portfolio.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 && 'portfolio' != '') {
					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 = 'Zanny Mellor: ' + 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> &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.item_price !== '') {
																		temp += '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
			temp += '<input type="hidden" name="item_name" value="'+item_name+'">';
			ref = '';
			if(this.photo_ref != ''){
				ref = this.photo_ref+' - '+this.caption;
			}
			else{
				ref = this.id+' - '+this.caption;
			}
			price = amount;								temp += '<input type="hidden" name="cmd" value="_cart">';
					temp += '<input type="hidden" name="business" value="zannymellor@gmail.com">';
					temp += '<input type="hidden" name="currency_code" value="GBP">';
					temp += '<input type="hidden" name="add" value="1">';
													temp += '<input type="hidden" name="amount" value="'+amount+'">';
					temp += '<input type="hidden" name="item_number" value="'+ref+'">';
													temp += '<input type=\"Submit\" value=\"Add to cart\" id=\"paymentAddButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
										temp += '</form>';
										temp += '<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
				temp += '<input type="hidden" name="cmd" value="_cart">';
				temp += '<input type="hidden" name="business" value="zannymellor@gmail.com">';
				temp += '<input type="hidden" name="display" value="1">';
				temp += '<input type=\"Submit\" value=\"View cart\" id=\"paymentViewButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
				temp += '</form>';
						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;
	}
}

			

