window.thumbnails = {};
															thumbnails[1056929] = clik.newPhoto({"id":1056929,"src":"front7_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Paul Priestley","height":176});
															thumbnails[8532029] = clik.newPhoto({"id":8532029,"src":"logocou_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Paul Priestley art courses","height":27});
															thumbnails[8532120] = clik.newPhoto({"id":8532120,"src":"logomailsm_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Artist in School","height":43});
															thumbnails[8532173] = clik.newPhoto({"id":8532173,"src":"DSC_0051_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Figures","height":222});
															thumbnails[8532214] = clik.newPhoto({"id":8532214,"src":"DSC_0055_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Figure","height":261});
															thumbnails[8565145] = clik.newPhoto({"id":8565145,"src":"meldulsmall_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Melissa and Dulcie portrait","height":164});
															thumbnails[8573474] = clik.newPhoto({"id":8573474,"src":"front73_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Paul Priestley","height":141});
															thumbnails[8715781] = clik.newPhoto({"id":8715781,"src":"blog1_thumb_DAD0F7AF-1EC9-DFB6-09DFBCA20BFD9EBB.jpg","galleries_id":"","server_id":1,"link":"#","width":100,"caption":"My Blog","height":30});
															thumbnails[8839790] = clik.newPhoto({"id":8839790,"src":"lottiesmall_C757A924-24E8-5EC4-4FB0880E79204C32_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Painting: Contented","height":104});
															thumbnails[8839855] = clik.newPhoto({"id":8839855,"src":"china_girls_small_C752F24E-24E8-5EC4-4FA9E1DEA543F3C8_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Painting: China Girls","height":104});
															thumbnails[8840208] = clik.newPhoto({"id":8840208,"src":"Carolsmall_C76DE948-24E8-5EC4-4F9C7460CCFEB60B_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Painting: I need to play this cool","height":104});
															thumbnails[8840215] = clik.newPhoto({"id":8840215,"src":"Hmmsmall_C78373EF-24E8-5EC4-4FDA57C35CB53808_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Painting: Hmm, he's nice","height":104});
															thumbnails[8932626] = clik.newPhoto({"id":8932626,"src":"myblog_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":26});
															thumbnails[1030450] = clik.newPhoto({"id":1030450,"src":"bircher2_thumb.jpg","galleries_id":76291,"server_id":1,"link":"photo_1030450.html","width":130,"caption":"Pond at Bircher","height":108});
															thumbnails[1030454] = clik.newPhoto({"id":1030454,"src":"Redtree_thumb.jpg","galleries_id":76291,"server_id":1,"link":"photo_1030454.html","width":130,"caption":"Red Tree","height":101});
															thumbnails[1030456] = clik.newPhoto({"id":1030456,"src":"Snowdrops_thumb.jpg","galleries_id":76291,"server_id":1,"link":"photo_1030456.html","width":130,"caption":"Snowdrops","height":102});
															thumbnails[8531936] = clik.newPhoto({"id":8531936,"src":"appleand_vase_thumb.jpg","galleries_id":76888,"server_id":1,"link":"photo_8531936.html","width":130,"caption":"Apple with Vases","height":163});
															thumbnails[8724313] = clik.newPhoto({"id":8724313,"src":"china_girls_thumb.jpg","galleries_id":76886,"server_id":1,"link":"photo_8724313.html","width":130,"caption":"Painting: 'China Girls'","height":102});
															thumbnails[8838930] = clik.newPhoto({"id":8838930,"src":"lottie_BFBAAF15-24E8-5EC4-4FE0C3A84B49CE2C_thumb.jpg","galleries_id":76886,"server_id":1,"link":"photo_8838930.html","width":130,"caption":"Painting: Contented","height":104});
															thumbnails[8531450] = clik.newPhoto({"id":8531450,"src":"meldul_thumb.jpg","galleries_id":76886,"server_id":1,"link":"photo_8531450.html","width":130,"caption":"Melissa and Dulcie","height":164});
															thumbnails[8531931] = clik.newPhoto({"id":8531931,"src":"cauldon_thumb.jpg","galleries_id":76888,"server_id":1,"link":"photo_8531931.html","width":130,"caption":"Cauldon Vase with Onion and Lilies","height":165});
															thumbnails[8531941] = clik.newPhoto({"id":8531941,"src":"paintpepper_thumb.jpg","galleries_id":76888,"server_id":1,"link":"photo_8531941.html","width":130,"caption":"Paint my Pepper","height":160});
															thumbnails[8531939] = clik.newPhoto({"id":8531939,"src":"Doulton_thumb.jpg","galleries_id":76888,"server_id":1,"link":"photo_8531939.html","width":130,"caption":"Doulton Vase with Flower","height":162});
															thumbnails[8531947] = clik.newPhoto({"id":8531947,"src":"mushroom_thumb.jpg","galleries_id":76888,"server_id":1,"link":"photo_8531947.html","width":130,"caption":"Falling Mushrooms","height":161});
															thumbnails[8531964] = clik.newPhoto({"id":8531964,"src":"bow_thumb.jpg","galleries_id":76888,"server_id":1,"link":"photo_8531964.html","width":130,"caption":"Bow Vase with Pears","height":162});
															thumbnails[1029745] = clik.newPhoto({"id":1029745,"src":"bircherwood_thumb.jpg","galleries_id":76291,"server_id":1,"link":"photo_1029745.html","width":130,"caption":"Painting: 'Bircher Common'","height":108});
															thumbnails[6828649] = clik.newPhoto({"id":6828649,"src":"cow1_thumb.jpg","galleries_id":76889,"server_id":1,"link":"photo_6828649.html","width":130,"caption":"This is not a Garden","height":164});
															thumbnails[8531488] = clik.newPhoto({"id":8531488,"src":"DSC_0007_thumb.jpg","galleries_id":76886,"server_id":1,"link":"photo_8531488.html","width":130,"caption":"Get Me Out of Here","height":103});
															thumbnails[8570649] = clik.newPhoto({"id":8570649,"src":"darwinpost_thumb.jpg","galleries_id":453053,"server_id":1,"link":"photo_8570649.html","width":130,"caption":"I can be what ever you want me to be","height":98});
															thumbnails[8531571] = clik.newPhoto({"id":8531571,"src":"DSC_0255_thumb.jpg","galleries_id":76886,"server_id":1,"link":"photo_8531571.html","width":130,"caption":"I Need to Play this Cool","height":103});
															thumbnails[8531580] = clik.newPhoto({"id":8531580,"src":"DSC_0009_thumb.jpg","galleries_id":76886,"server_id":1,"link":"photo_8531580.html","width":130,"caption":"'Hmm, I wish'","height":104});
															thumbnails[8531582] = clik.newPhoto({"id":8531582,"src":"DSC_0025_thumb.jpg","galleries_id":76886,"server_id":1,"link":"photo_8531582.html","width":130,"caption":"I've Heard it all Before","height":104});
															thumbnails[6828655] = clik.newPhoto({"id":6828655,"src":"Sheeps_world_thumb.jpg","galleries_id":76889,"server_id":1,"link":"photo_6828655.html","width":130,"caption":"Sheep's World","height":165});
															thumbnails[8570682] = clik.newPhoto({"id":8570682,"src":"Ladymadonna_thumb.jpg","galleries_id":453053,"server_id":1,"link":"photo_8570682.html","width":130,"caption":"Lady Madonna","height":130});
															thumbnails[6828652] = clik.newPhoto({"id":6828652,"src":"I_got_ambition_thumb.jpg","galleries_id":76889,"server_id":1,"link":"photo_6828652.html","width":130,"caption":"I've got Ambition","height":165});
															thumbnails[8570697] = clik.newPhoto({"id":8570697,"src":"Madonnachild_thumb.jpg","galleries_id":453053,"server_id":1,"link":"photo_8570697.html","width":130,"caption":"Madonna and Child","height":132});
															thumbnails[6832366] = clik.newPhoto({"id":6832366,"src":"Iwonder_thumb.jpg","galleries_id":76886,"server_id":1,"link":"photo_6832366.html","width":130,"caption":"I wonder","height":86});
															thumbnails[8556607] = clik.newPhoto({"id":8556607,"src":"stellar_thumb.jpg","galleries_id":76889,"server_id":1,"link":"photo_8556607.html","width":130,"caption":"White Tabby","height":128});
															thumbnails[8570776] = clik.newPhoto({"id":8570776,"src":"leohouse_thumb.jpg","galleries_id":76291,"server_id":1,"link":"photo_8570776.html","width":130,"caption":"House in Leominster","height":152});
															thumbnails[6828788] = clik.newPhoto({"id":6828788,"src":"Isthat_thumb.jpg","galleries_id":76886,"server_id":1,"link":"photo_6828788.html","width":130,"caption":"Is that the Doorbell?","height":164});
															thumbnails[6828773] = clik.newPhoto({"id":6828773,"src":"How_to_win_thumb.jpg","galleries_id":76886,"server_id":1,"link":"photo_6828773.html","width":130,"caption":"How to win at Monogamy","height":101});
															thumbnails[6828825] = clik.newPhoto({"id":6828825,"src":"Phantom_thumb.jpg","galleries_id":76886,"server_id":1,"link":"photo_6828825.html","width":130,"caption":"Phantom Lovers","height":164});
															thumbnails[1398244] = clik.newPhoto({"id":1398244,"src":"girlpostf_thumb.jpg","galleries_id":453053,"server_id":1,"link":"photo_1398244.html","width":130,"caption":"'Bridget Sighs'","height":105});
															thumbnails[8565768] = clik.newPhoto({"id":8565768,"src":"afternoontea_thumb.jpg","galleries_id":76886,"server_id":1,"link":"photo_8565768.html","width":130,"caption":"So Forgetful","height":107});
															thumbnails[8565774] = clik.newPhoto({"id":8565774,"src":"telephone_thumb.jpg","galleries_id":76886,"server_id":1,"link":"photo_8565774.html","width":130,"caption":"Painting: 'She's not Answering'","height":107});
															thumbnails[8570711] = clik.newPhoto({"id":8570711,"src":"arwen_thumb.jpg","galleries_id":76886,"server_id":1,"link":"photo_8570711.html","width":130,"caption":"Arwen","height":129});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[76886] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Portraits and Figures","link":"gallery_76886.html","maxRecords":0.0,"photoIDs":[8724313.0,8838930.0,8531450.0,8531488.0,8531571.0,8531580.0,8531582.0,6832366.0,6828788.0,6828773.0,6828825.0,8565768.0,8565774.0,8570711.0],"skipIndex":0,"section_code":"gallery","featured_images":"8838930,8724313,8570711,8565774,8565768,8531582,8531580,8531571,8531488,8531450","id":76886,"singleSection":false});				  						galleries[76291] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Landscapes","link":"gallery_76291.html","maxRecords":0.0,"photoIDs":[1030450.0,1030454.0,1030456.0,1029745.0,8570776.0],"skipIndex":0,"section_code":"gallery","featured_images":"8570776,1030456,1030454,1030450,1029745","id":76291,"singleSection":false});				  						galleries[76888] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Still Life Paintings","link":"gallery_76888.html","maxRecords":0.0,"photoIDs":[8531936.0,8531931.0,8531941.0,8531939.0,8531947.0,8531964.0],"skipIndex":0,"section_code":"gallery","featured_images":"8531964,8531947,8531941,8531939,8531936,8531931","id":76888,"singleSection":false});				  						galleries[76889] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Animals","link":"gallery_76889.html","maxRecords":0.0,"photoIDs":[6828649.0,6828655.0,6828652.0,8556607.0],"skipIndex":0,"section_code":"gallery","featured_images":"8556607,6828655,6828652,6828649","id":76889,"singleSection":false});				  						galleries[453053] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Other Subjects","link":"gallery_453053.html","maxRecords":0.0,"photoIDs":[8570649.0,8570682.0,8570697.0,1398244.0],"skipIndex":0,"section_code":"gallery","featured_images":"8570697,8570682,8570649,1398244","id":453053,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8840215,8840208,8839855,8839790';
imageSets[3] = '8565768';
imageSets[245466] = '1029745,8531580,8565774';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/paulpriestley/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/paulpriestley/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/paulpriestley/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/paulpriestley/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/paulpriestley/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/paulpriestley/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/paulpriestley/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/paulpriestley/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/paulpriestley/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/paulpriestley/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/paulpriestley/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/paulpriestley/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/paulpriestley/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/paulpriestley/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/paulpriestley/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/paulpriestley/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/paulpriestley/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/paulpriestley/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/paulpriestley/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/paulpriestley/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/paulpriestley/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/paulpriestley/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/paulpriestley/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/paulpriestley/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/paulpriestley/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/paulpriestley/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/paulpriestley/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 = 'Paul Priestley: Portrait and Landscape Painter: ' + 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>Medium : </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>Size of Work : </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Price : </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.item_price !== '') {
											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="PAULPRIESTLEY">';
			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;
	}
}

			

