window.thumbnails = {};
															thumbnails[3275503] = clik.newPhoto({"id":3275503,"src":"Low Tide Helford_thumb.jpg","galleries_id":199489,"server_id":15,"link":"photo_3275503.html","width":130,"caption":"Low Tide, Helford","height":108});
															thumbnails[3286395] = clik.newPhoto({"id":3286395,"src":"Autumn Squash_thumb.jpg","galleries_id":199704,"server_id":15,"link":"photo_3286395.html","width":130,"caption":"Winter Squash","height":108});
															thumbnails[3389213] = clik.newPhoto({"id":3389213,"src":"IMG_37681_thumb.jpg","galleries_id":199704,"server_id":15,"link":"photo_3389213.html","width":130,"caption":"Golden Squash","height":129});
															thumbnails[3389224] = clik.newPhoto({"id":3389224,"src":"Cornish Farm Evening Light-IMG_3770_thumb.jpg","galleries_id":199489,"server_id":15,"link":"photo_3389224.html","width":130,"caption":"Cornish Farm Evening Light","height":95});
															thumbnails[3389278] = clik.newPhoto({"id":3389278,"src":"Flowerpots and Squash-IMG_3773_thumb.jpg","galleries_id":199704,"server_id":15,"link":"photo_3389278.html","width":130,"caption":"Flowerpots and Squash","height":129});
															thumbnails[3389298] = clik.newPhoto({"id":3389298,"src":"Spring Flowers-IMG_3775_thumb.jpg","galleries_id":199704,"server_id":15,"link":"photo_3389298.html","width":130,"caption":"Spring Flowers","height":130});
															thumbnails[3389302] = clik.newPhoto({"id":3389302,"src":"Copper Kettle with Dahlias-IMG_3776_thumb.jpg","galleries_id":199704,"server_id":15,"link":"photo_3389302.html","width":130,"caption":"Copper Kettle with Dahlias","height":116});
															thumbnails[3389344] = clik.newPhoto({"id":3389344,"src":"Spanish Courtyard-IMG_3780_thumb.jpg","galleries_id":199489,"server_id":15,"link":"photo_3389344.html","width":130,"caption":"Spanish Courtyard","height":115});
															thumbnails[3389356] = clik.newPhoto({"id":3389356,"src":"IMG_3783_thumb.jpg","galleries_id":199489,"server_id":15,"link":"photo_3389356.html","width":130,"caption":"Breezy Day, Porlock Weir","height":65});
															thumbnails[3389378] = clik.newPhoto({"id":3389378,"src":"Bramley Apples-IMG_3784_thumb.jpg","galleries_id":199704,"server_id":15,"link":"photo_3389378.html","width":130,"caption":"Bramley Apples","height":103});
															thumbnails[3389390] = clik.newPhoto({"id":3389390,"src":"IMG_3786_thumb.jpg","galleries_id":199704,"server_id":15,"link":"photo_3389390.html","width":130,"caption":"China with Pink Ribbons","height":129});
															thumbnails[3389398] = clik.newPhoto({"id":3389398,"src":"End of Season 1-IMG_3787_thumb.jpg","galleries_id":199704,"server_id":15,"link":"photo_3389398.html","width":130,"caption":"End of Season 1","height":128});
															thumbnails[3389401] = clik.newPhoto({"id":3389401,"src":"Teatime Reggata-IMG_3788_thumb.jpg","galleries_id":199704,"server_id":15,"link":"photo_3389401.html","width":130,"caption":"Teatime Reggata","height":119});
															thumbnails[3389404] = clik.newPhoto({"id":3389404,"src":"IMG_3789_thumb.jpg","galleries_id":199489,"server_id":15,"link":"photo_3389404.html","width":130,"caption":"Cadgwith Cove Cottages","height":50});
															thumbnails[3389427] = clik.newPhoto({"id":3389427,"src":"Washing Day, Porlock Weir-IMG_3790_thumb.jpg","galleries_id":199489,"server_id":15,"link":"photo_3389427.html","width":130,"caption":"Washing Day, Porlock Weir","height":64});
															thumbnails[3389434] = clik.newPhoto({"id":3389434,"src":"IMG_3792_thumb.jpg","galleries_id":199489,"server_id":15,"link":"photo_3389434.html","width":130,"caption":"Fishermans Courtyard","height":130});
															thumbnails[3389464] = clik.newPhoto({"id":3389464,"src":"Flowerpots and Ranunculus-IMG_3794_thumb.jpg","galleries_id":199704,"server_id":15,"link":"photo_3389464.html","width":130,"caption":"Flowerpots and Ranunculus","height":116});
															thumbnails[3389955] = clik.newPhoto({"id":3389955,"src":"IMG_3800_thumb.jpg","galleries_id":199704,"server_id":15,"link":"photo_3389955.html","width":130,"caption":"Still Life with Bread","height":102});
															thumbnails[3390018] = clik.newPhoto({"id":3390018,"src":"Quinces and terracotta jug_thumb.jpg","galleries_id":199704,"server_id":15,"link":"photo_3390018.html","width":130,"caption":"Quinces and a Terracotta Jug","height":97});
															thumbnails[3468644] = clik.newPhoto({"id":3468644,"src":"Autumn Squash1_thumb.jpg","galleries_id":199705,"server_id":15,"link":"photo_3468644.html","width":128,"caption":"Autumn Squash","height":130});
															thumbnails[3468645] = clik.newPhoto({"id":3468645,"src":"Pansy pots, oil, 12x16-small_thumb.jpg","galleries_id":199705,"server_id":15,"link":"photo_3468645.html","width":130,"caption":"Pansy pots","height":97});
															thumbnails[3468647] = clik.newPhoto({"id":3468647,"src":"Teatime Regatta_thumb.jpg","galleries_id":199705,"server_id":15,"link":"photo_3468647.html","width":130,"caption":"Teatime Regatta","height":120});
															thumbnails[3468648] = clik.newPhoto({"id":3468648,"src":"The Farmhouse, St Anthony-small_thumb.jpg","galleries_id":199705,"server_id":15,"link":"photo_3468648.html","width":130,"caption":"The Farmhouse, St Anthony","height":114});
															thumbnails[3488244] = clik.newPhoto({"id":3488244,"src":"The Last Pink Geranium_thumb.jpg","galleries_id":199705,"server_id":15,"link":"photo_3488244.html","width":102,"caption":"The Last Pink Geranium","height":130});
															thumbnails[9000457] = clik.newPhoto({"id":9000457,"src":"1a_thumb.png","galleries_id":199489,"server_id":15,"link":"photo_9000457.html","width":129,"caption":"Zennor","height":130});
															thumbnails[9000459] = clik.newPhoto({"id":9000459,"src":"2a_thumb.png","galleries_id":199489,"server_id":15,"link":"photo_9000459.html","width":127,"caption":"Path to the cove","height":130});
															thumbnails[9000465] = clik.newPhoto({"id":9000465,"src":"3a_thumb.png","galleries_id":199704,"server_id":15,"link":"photo_9000465.html","width":130,"caption":"Spring flowers with Spode cup","height":129});
															thumbnails[9000467] = clik.newPhoto({"id":9000467,"src":"4a_thumb.png","galleries_id":199704,"server_id":15,"link":"photo_9000467.html","width":120,"caption":"Green apples and plumbs","height":130});
															thumbnails[9000469] = clik.newPhoto({"id":9000469,"src":"5a_thumb.png","galleries_id":199489,"server_id":15,"link":"photo_9000469.html","width":128,"caption":"High and dry","height":130});
															thumbnails[9000470] = clik.newPhoto({"id":9000470,"src":"6a_thumb.png","galleries_id":199704,"server_id":15,"link":"photo_9000470.html","width":130,"caption":"China with pink ribbons","height":130});
															thumbnails[9000472] = clik.newPhoto({"id":9000472,"src":"7a_thumb.png","galleries_id":199704,"server_id":15,"link":"photo_9000472.html","width":122,"caption":"Caprice with blue ribbons","height":130});
															thumbnails[9000627] = clik.newPhoto({"id":9000627,"src":"8a_thumb.png","galleries_id":199489,"server_id":15,"link":"photo_9000627.html","width":130,"caption":"Quite canal, Venice","height":124});
															thumbnails[9000641] = clik.newPhoto({"id":9000641,"src":"9a_thumb.png","galleries_id":199704,"server_id":15,"link":"photo_9000641.html","width":129,"caption":"White tulips","height":130});
															thumbnails[9000650] = clik.newPhoto({"id":9000650,"src":"10a_thumb.png","galleries_id":199704,"server_id":15,"link":"photo_9000650.html","width":130,"caption":"Nuts medlars and a gourd","height":107});
															thumbnails[9000656] = clik.newPhoto({"id":9000656,"src":"11a_thumb.png","galleries_id":199704,"server_id":15,"link":"photo_9000656.html","width":130,"caption":"Autumn chutney","height":113});
															thumbnails[9000740] = clik.newPhoto({"id":9000740,"src":"12a_thumb.png","galleries_id":199489,"server_id":15,"link":"photo_9000740.html","width":130,"caption":"High summer","height":95});
															thumbnails[9000743] = clik.newPhoto({"id":9000743,"src":"13a_thumb.png","galleries_id":199704,"server_id":15,"link":"photo_9000743.html","width":127,"caption":"Fragile","height":130});
															thumbnails[9000767] = clik.newPhoto({"id":9000767,"src":"14a_thumb.png","galleries_id":199704,"server_id":15,"link":"photo_9000767.html","width":130,"caption":"Bread and walnuts","height":95});
															thumbnails[9001004] = clik.newPhoto({"id":9001004,"src":"15a_thumb.png","galleries_id":199704,"server_id":15,"link":"photo_9001004.html","width":130,"caption":"Tea bread and jam","height":97});
															thumbnails[9001011] = clik.newPhoto({"id":9001011,"src":"16a_thumb.png","galleries_id":199489,"server_id":15,"link":"photo_9001011.html","width":130,"caption":"Quite moorings","height":108});
															thumbnails[9001103] = clik.newPhoto({"id":9001103,"src":"17a_thumb.png","galleries_id":199704,"server_id":15,"link":"photo_9001103.html","width":130,"caption":"Delft jug with bread and oil","height":105});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[199489] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Landscapes","link":"gallery_199489.html","maxRecords":0.0,"photoIDs":[3275503.0,3389224.0,3389344.0,3389356.0,3389404.0,3389427.0,3389434.0,9000457.0,9000459.0,9000469.0,9000627.0,9000740.0,9001011.0],"skipIndex":0,"section_code":"gallery","featured_images":"9001011,9000740,9000627,9000469,9000459,9000457,3389434,3389427,3389404,3389356","id":199489,"singleSection":false});				  						galleries[199704] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Still Life","link":"gallery_199704.html","maxRecords":0.0,"photoIDs":[3286395.0,3389213.0,3389278.0,3389298.0,3389302.0,3389378.0,3389390.0,3389398.0,3389401.0,3389464.0,3389955.0,3390018.0,9000465.0,9000467.0,9000470.0,9000472.0,9000641.0,9000650.0,9000656.0,9000743.0,9000767.0,9001004.0,9001103.0],"skipIndex":0,"section_code":"gallery","featured_images":"9001103,9001004,9000767,9000743,9000656,9000650,9000641,9000472,9000470,9000467","id":199704,"singleSection":false});				  						galleries[199705] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Limited edition gicleé prints","link":"gallery_199705.html","maxRecords":0.0,"photoIDs":[3468644.0,3468645.0,3468647.0,3468648.0,3488244.0],"skipIndex":0,"section_code":"gallery","featured_images":"3488244,3468648,3468647,3468645,3468644","id":199705,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '3389398';
imageSets[3] = '9001103,9001011,9001004,9000767,9000743,9000740,9000656,9000650,9000641,9000627,9000472,9000470,9000469,9000467,9000465,9000459,9000457,3488244,3468648,3468647,3468645,3468644,3390018,3389955,3389464,3389434,3389427,3389404,3389401,3389398,3389390,3389378,3389356,3389344,3389302,3389298,3389278,3389224,3389213,3286395,3275503';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/jennysutton/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/jennysutton/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/jennysutton/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/jennysutton/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/jennysutton/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/jennysutton/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/jennysutton/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/jennysutton/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/jennysutton/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/jennysutton/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/jennysutton/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/jennysutton/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/jennysutton/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/jennysutton/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/jennysutton/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/jennysutton/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/jennysutton/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/jennysutton/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/jennysutton/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/jennysutton/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/jennysutton/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/jennysutton/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/jennysutton/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/jennysutton/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/jennysutton/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/jennysutton/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/jennysutton/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 = 'Jenny Sutton Fine Art: ' + 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="info@jennysutton-fineart.co.uk">';
					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="info@jennysutton-fineart.co.uk">';
				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;
	}
}

			

