window.thumbnails = {};
															thumbnails[2230953] = clik.newPhoto({"id":2230953,"src":"Bendrick12_thumb.jpg","galleries_id":143581,"server_id":5,"link":"photo_2230953.html","width":130,"caption":"Bendrick Gower","height":111});
															thumbnails[2230956] = clik.newPhoto({"id":2230956,"src":"Bendrick2_thumb.jpg","galleries_id":143581,"server_id":5,"link":"photo_2230956.html","width":130,"caption":"Bendrick 2. Gower","height":154});
															thumbnails[2230964] = clik.newPhoto({"id":2230964,"src":"Boathouse+ writing shed_thumb.jpg","galleries_id":143581,"server_id":5,"link":"photo_2230964.html","width":130,"caption":"Dylan Thomas' Boathouse and Writing Shed","height":103});
															thumbnails[2230965] = clik.newPhoto({"id":2230965,"src":"Bracelet Bay 2_thumb.jpg","galleries_id":143581,"server_id":5,"link":"photo_2230965.html","width":130,"caption":"Bracelet Bay Gower","height":101});
															thumbnails[2230967] = clik.newPhoto({"id":2230967,"src":"Bracelet Bay2_thumb.jpg","galleries_id":143581,"server_id":5,"link":"photo_2230967.html","width":130,"caption":"Bracelet bay 2. Gower","height":100});
															thumbnails[2230970] = clik.newPhoto({"id":2230970,"src":"Carew castle_thumb.jpg","galleries_id":147006,"server_id":5,"link":"photo_2230970.html","width":130,"caption":"Carew Castle. Pembroke","height":104});
															thumbnails[2230971] = clik.newPhoto({"id":2230971,"src":"Great Tor_thumb.jpg","galleries_id":143581,"server_id":5,"link":"photo_2230971.html","width":130,"caption":"Great Tor. Gower","height":107});
															thumbnails[2230972] = clik.newPhoto({"id":2230972,"src":"Helvetia2_thumb.jpg","galleries_id":143581,"server_id":5,"link":"photo_2230972.html","width":130,"caption":"Helvetia, Rhossili Gower","height":102});
															thumbnails[2230973] = clik.newPhoto({"id":2230973,"src":"Hunts Bay 2_thumb.jpg","galleries_id":143581,"server_id":5,"link":"photo_2230973.html","width":130,"caption":"Hunts Bay 1. Gower","height":101});
															thumbnails[2230974] = clik.newPhoto({"id":2230974,"src":"Hunts bay_thumb.jpg","galleries_id":143581,"server_id":5,"link":"photo_2230974.html","width":130,"caption":"Hunts Bay 2. Gower","height":103});
															thumbnails[2230976] = clik.newPhoto({"id":2230976,"src":"Ilston Church_thumb.jpg","galleries_id":147006,"server_id":5,"link":"photo_2230976.html","width":130,"caption":"Ilston Church. Gower","height":110});
															thumbnails[2230977] = clik.newPhoto({"id":2230977,"src":"Kidwelly castle_thumb.jpg","galleries_id":147006,"server_id":5,"link":"photo_2230977.html","width":130,"caption":"Kidwelly Castle. Carmarthenshire","height":111});
															thumbnails[2230978] = clik.newPhoto({"id":2230978,"src":"Neath Abbey_thumb.jpg","galleries_id":147006,"server_id":5,"link":"photo_2230978.html","width":130,"caption":"Neath Abbey","height":107});
															thumbnails[2230981] = clik.newPhoto({"id":2230981,"src":"Neath River_thumb.jpg","galleries_id":147014,"server_id":5,"link":"photo_2230981.html","width":130,"caption":"River Neath 1","height":109});
															thumbnails[2230983] = clik.newPhoto({"id":2230983,"src":"Neath River2_thumb.jpg","galleries_id":147014,"server_id":5,"link":"photo_2230983.html","width":130,"caption":"River Neath 2","height":107});
															thumbnails[2230984] = clik.newPhoto({"id":2230984,"src":"Neath River3_thumb.jpg","galleries_id":147014,"server_id":5,"link":"photo_2230984.html","width":130,"caption":"River Neath 3","height":106});
															thumbnails[2230985] = clik.newPhoto({"id":2230985,"src":"Nicholaston Burrows_thumb.jpg","galleries_id":143581,"server_id":5,"link":"photo_2230985.html","width":130,"caption":"Nicholaston Burrows. Gower","height":105});
															thumbnails[2230987] = clik.newPhoto({"id":2230987,"src":"Oxwich Castle_thumb.jpg","galleries_id":147006,"server_id":5,"link":"photo_2230987.html","width":130,"caption":"Oxwich Castle. Gower","height":97});
															thumbnails[2230988] = clik.newPhoto({"id":2230988,"src":"Pennard Castle 1_thumb.jpg","galleries_id":147006,"server_id":5,"link":"photo_2230988.html","width":130,"caption":"Pennard Castle. Gower","height":102});
															thumbnails[2230991] = clik.newPhoto({"id":2230991,"src":"Pennard Castle2_thumb.jpg","galleries_id":147006,"server_id":5,"link":"photo_2230991.html","width":130,"caption":"Pennard Castle 2. Gower","height":149});
															thumbnails[2230992] = clik.newPhoto({"id":2230992,"src":"Pobbles Bay2_thumb.jpg","galleries_id":143581,"server_id":5,"link":"photo_2230992.html","width":130,"caption":"Pobbles Bay 1. Gower","height":129});
															thumbnails[2230995] = clik.newPhoto({"id":2230995,"src":"Pobbles Bay21_thumb.jpg","galleries_id":143581,"server_id":5,"link":"photo_2230995.html","width":130,"caption":"Pobbles Bay 2. Gower","height":103});
															thumbnails[2230996] = clik.newPhoto({"id":2230996,"src":"Pwll Du 2_thumb.jpg","galleries_id":143581,"server_id":5,"link":"photo_2230996.html","width":130,"caption":"Pwll Du Bay 1. Gower","height":108});
															thumbnails[2230998] = clik.newPhoto({"id":2230998,"src":"Pwll Du River_thumb.jpg","galleries_id":143581,"server_id":5,"link":"photo_2230998.html","width":130,"caption":"Pwll Du Bay 2. Gower","height":103});
															thumbnails[2230999] = clik.newPhoto({"id":2230999,"src":"Pwll Du_thumb.jpg","galleries_id":143581,"server_id":5,"link":"photo_2230999.html","width":130,"caption":"Pwll Du Bay 3. Gower","height":143});
															thumbnails[2231001] = clik.newPhoto({"id":2231001,"src":"Pwll Du3_thumb.jpg","galleries_id":143581,"server_id":5,"link":"photo_2231001.html","width":130,"caption":"Pwll Du Bay 4. Gower","height":153});
															thumbnails[2231003] = clik.newPhoto({"id":2231003,"src":"Three Cliffs 2_thumb.jpg","galleries_id":143581,"server_id":5,"link":"photo_2231003.html","width":130,"caption":"Three Cliffs 1. Gower","height":105});
															thumbnails[2231004] = clik.newPhoto({"id":2231004,"src":"Three Cliffs1_thumb.jpg","galleries_id":143581,"server_id":5,"link":"photo_2231004.html","width":130,"caption":"Three Cliffs 2. Gower","height":165});
															thumbnails[2231006] = clik.newPhoto({"id":2231006,"src":"Weobley Castle_thumb.jpg","galleries_id":147006,"server_id":5,"link":"photo_2231006.html","width":130,"caption":"Weobley Castle. Gower","height":97});
															thumbnails[2231008] = clik.newPhoto({"id":2231008,"src":"Whiteford Lighthouse_thumb.jpg","galleries_id":143581,"server_id":5,"link":"photo_2231008.html","width":130,"caption":"Whiteford Lighthouse. Gower","height":109});
															thumbnails[2231010] = clik.newPhoto({"id":2231010,"src":"Whiteford2_thumb.jpg","galleries_id":143581,"server_id":5,"link":"photo_2231010.html","width":130,"caption":"Whiteford. Gower","height":102});
															thumbnails[2231011] = clik.newPhoto({"id":2231011,"src":"Worms Head_thumb.jpg","galleries_id":143581,"server_id":5,"link":"photo_2231011.html","width":130,"caption":"Worms Head. Gower","height":103});
															thumbnails[2609899] = clik.newPhoto({"id":2609899,"src":"Rotherslade_thumb.jpg","galleries_id":143581,"server_id":5,"link":"photo_2609899.html","width":130,"caption":"Rotherslade, Gower","height":103});
															thumbnails[2761062] = clik.newPhoto({"id":2761062,"src":"Rotherslade2_thumb.jpg","galleries_id":143581,"server_id":5,"link":"photo_2761062.html","width":130,"caption":"Rotherslade2. Gower","height":103});
															thumbnails[2761081] = clik.newPhoto({"id":2761081,"src":"Mumbles Head_thumb.jpg","galleries_id":143581,"server_id":5,"link":"photo_2761081.html","width":130,"caption":"Mumbles Head. Gower","height":103});
															thumbnails[3763997] = clik.newPhoto({"id":3763997,"src":"Whiteford3_thumb.jpg","galleries_id":143581,"server_id":5,"link":"photo_3763997.html","width":130,"caption":"Whiteford lighthouse Gower","height":153});
															thumbnails[3764002] = clik.newPhoto({"id":3764002,"src":"Whiteford4_thumb.jpg","galleries_id":143581,"server_id":5,"link":"photo_3764002.html","width":130,"caption":"Whiteford silhouette Gower","height":156});
															thumbnails[4316661] = clik.newPhoto({"id":4316661,"src":"Heatherslade_thumb.jpg","galleries_id":143581,"server_id":5,"link":"photo_4316661.html","width":130,"caption":"Heatherslade Bay, Gower","height":104});
															thumbnails[4316666] = clik.newPhoto({"id":4316666,"src":"heatherslade2_thumb.jpg","galleries_id":143581,"server_id":5,"link":"photo_4316666.html","width":130,"caption":"Heatherslade Bay2, Gower","height":157});
															thumbnails[6194539] = clik.newPhoto({"id":6194539,"src":"Bishopston_valley_thumb.jpg","galleries_id":147014,"server_id":5,"link":"photo_6194539.html","width":130,"caption":"Bishopston Valley, Gower","height":162});
															thumbnails[6194541] = clik.newPhoto({"id":6194541,"src":"Mewslade_thumb.jpg","galleries_id":143581,"server_id":5,"link":"photo_6194541.html","width":130,"caption":"Mewslade, Gower","height":103});
															thumbnails[6194544] = clik.newPhoto({"id":6194544,"src":"Rockpool_thumb.jpg","galleries_id":143581,"server_id":5,"link":"photo_6194544.html","width":130,"caption":"Rockpool, Gower","height":103});
															thumbnails[6195111] = clik.newPhoto({"id":6195111,"src":"Boathouse_thumb.jpg","galleries_id":143581,"server_id":5,"link":"photo_6195111.html","width":130,"caption":"Dylan Thomas' Boathouse","height":164});
															thumbnails[6195114] = clik.newPhoto({"id":6195114,"src":"Guethary2_thumb.jpg","galleries_id":143581,"server_id":5,"link":"photo_6195114.html","width":130,"caption":"Guethary, S.W.France","height":101});
															thumbnails[6238740] = clik.newPhoto({"id":6238740,"src":"Helvetia2_7F2CD9A3-1EC9-D45B-1CFB1E1AFD268F55_thumb.jpg","galleries_id":143581,"server_id":5,"link":"photo_6238740.html","width":130,"caption":"Helvetia2, Rhossili Gower","height":97});
															thumbnails[6472219] = clik.newPhoto({"id":6472219,"src":"Mewslade21_thumb.jpg","galleries_id":143581,"server_id":5,"link":"photo_6472219.html","width":130,"caption":"Mewslade2 Gower","height":103});
															thumbnails[8223066] = clik.newPhoto({"id":8223066,"src":"Old_Port_1_thumb.jpg","galleries_id":143581,"server_id":35,"link":"photo_8223066.html","width":130,"caption":"Old Port 1, Biarritz","height":102});
															thumbnails[8223072] = clik.newPhoto({"id":8223072,"src":"Old_port_2_thumb.jpg","galleries_id":143581,"server_id":35,"link":"photo_8223072.html","width":130,"caption":"Old Port 2 Biarritz","height":160});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[147006] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Castles and Churches","link":"gallery_147006.html","maxRecords":0.0,"photoIDs":[2230970.0,2230976.0,2230977.0,2230978.0,2230987.0,2230988.0,2230991.0,2231006.0],"skipIndex":0,"section_code":"gallery","featured_images":"2231006,2230991,2230988,2230987,2230978,2230977,2230976,2230970","id":147006,"singleSection":false});				  						galleries[147014] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Landscapes","link":"gallery_147014.html","maxRecords":0.0,"photoIDs":[2230981.0,2230983.0,2230984.0,6194539.0],"skipIndex":0,"section_code":"gallery","featured_images":"6194539,2230984,2230983,2230981","id":147014,"singleSection":false});				  						galleries[143581] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Seascapes","link":"gallery_143581.html","maxRecords":0.0,"photoIDs":[2230953.0,2230956.0,2230964.0,2230965.0,2230967.0,2230971.0,2230972.0,2230973.0,2230974.0,2230985.0,2230992.0,2230995.0,2230996.0,2230998.0,2230999.0,2231001.0,2231003.0,2231004.0,2231008.0,2231010.0,2231011.0,2609899.0,2761062.0,2761081.0,3763997.0,3764002.0,4316661.0,4316666.0,6194541.0,6194544.0,6195111.0,6195114.0,6238740.0,6472219.0,8223066.0,8223072.0],"skipIndex":0,"section_code":"gallery","featured_images":"8223072,8223066,6472219,6238740,6195114,6195111,6194544,6194541,4316666,4316661","id":143581,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '6195111';
imageSets[3] = '8223072,8223066,6472219,6238740,6195114,6195111,6194544,6194541,6194539,4316666,4316661,3764002,3763997,2761081,2761062,2609899,2231011,2231010,2231008,2231006,2231004,2231003,2231001,2230999,2230998,2230996,2230995,2230992,2230991,2230988,2230987,2230985,2230984,2230983,2230981,2230978,2230977,2230976,2230974,2230973,2230972,2230971,2230970,2230967,2230965,2230964,2230956,2230953';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/clivejenkins/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'www.clikpic.com/clivejenkins/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/clivejenkins/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/clivejenkins/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/clivejenkins/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/clivejenkins/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/clivejenkins/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/clivejenkins/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/clivejenkins/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/clivejenkins/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/clivejenkins/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/clivejenkins/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/clivejenkins/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/clivejenkins/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/clivejenkins/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/clivejenkins/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/clivejenkins/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/clivejenkins/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/clivejenkins/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/clivejenkins/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/clivejenkins/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/clivejenkins/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/clivejenkins/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/clivejenkins/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/clivejenkins/images';
		break;
	}
		return val;
}

/***************************************************************************
* img = reference to image object in which to show image                   *
***************************************************************************/
function showHomeImage(img) {
	imageID = randomListVal('');
	if (!basic) {
		img.src = photos[imageID].src;
		img.width = photos[imageID].width;
		img.height = photos[imageID].height;
		img.parentNode.title = img.alt = photos[imageID].caption;
	} else {
		newImage = new Image(photos[imageID].width,photos[imageID].height);
		newImage.src = photos[imageID].src;
		document.images[img.name] = newImage;
		
	}
}

function getHomeImageLink(imageID) {
  	var href='', photo = backgrounds && backgrounds[imageID];
	if(photo){
		if (photo && photo.galleries_id != '') {
  			href = photo.fnGalleryLink();
  		}
  		  		else {
  				href += 'gallery.html';
  	  		}
	}
    return href;
}

/***************************************************************************
* Show a random image on home page from featured images                    *
***************************************************************************/
function showHomeImageInline(el, image_sets_id, href) {
	
	var css = {}, imageID,
	    imageSetsId = 1;
	if(image_sets_id){
		imageSetsId = image_sets_id;
	}
	imageID = randomListVal(imageSets[imageSetsId]);
	if (href == null && 'gallery' != '') {
					href = getHomeImageLink(imageID);
	}
	
	updateImage({nextPhoto: backgrounds[imageID], img:el.find('img')[0],
                $photo:el, $title:$('#homeimageTitleContainer'), $detail:$('#homeimageDetailsContainer'),                speed:0, href:href, css:css, onAfter: function(){                  this.closest('.contentsection').doManualAlign({				    inner: 'img',				    crop: 'a'				  });                }              });
}

/***************************************************************************
* Set 'img' to be a new image given its photo() object                     *
***************************************************************************/
function updateImage (options) {
	var defaults = {nextPhoto:'',field:'',img:'',$photo:'',$title:'',$detail:'',$detailContainer:'',
                    updateDocumentTitle:false,speed:0,href:false,css:false,updateHash:false,onAfter:null,onBefore:null},
		op = $.extend({},defaults,options),
		html = '', temp = '',
		photoId = op.nextPhoto.id,
		photoCaption = ''+op.nextPhoto.caption,
		photoSrc = op.nextPhoto.src;
	
	if (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
	}
		
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'Clive Jenkins Photography: ' + 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="updateItemValues($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
		
		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" 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="clive.jenkins@talk21.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="clive.jenkins@talk21.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;
	}
}

			

