window.thumbnails = {};
															thumbnails[8012442] = clik.newPhoto({"id":8012442,"src":"DSC_0132_thumb.jpg","galleries_id":430461,"server_id":32,"link":"photo_8012442.html","width":160,"caption":"Where have you been?","height":107});
															thumbnails[8798537] = clik.newPhoto({"id":8798537,"src":"Boat-and-Boathouse2011mono_thumb.jpg","galleries_id":463177,"server_id":32,"link":"photo_8798537.html","width":160,"caption":"ROWING BOAT AND BOAT HOUSE","height":239});
															thumbnails[8798587] = clik.newPhoto({"id":8798587,"src":"Boat-and-Boathouse2011w_thumb.jpg","galleries_id":463185,"server_id":32,"link":"photo_8798587.html","width":160,"caption":"","height":239});
															thumbnails[8798888] = clik.newPhoto({"id":8798888,"src":"Abstract-1w_thumb.jpg","galleries_id":463207,"server_id":32,"link":"photo_8798888.html","width":160,"caption":"MEGALITH","height":106});
															thumbnails[8798949] = clik.newPhoto({"id":8798949,"src":"Beach1w_thumb.jpg","galleries_id":463213,"server_id":32,"link":"photo_8798949.html","width":160,"caption":"WALKING THE DOG!","height":106});
															thumbnails[8838900] = clik.newPhoto({"id":8838900,"src":"Dereliction-Towerw_BECC435E-24E8-5EC4-4F9713E718F8AAAF_thumb.jpg","galleries_id":464941,"server_id":32,"link":"photo_8838900.html","width":160,"caption":"","height":241});
															thumbnails[8856610] = clik.newPhoto({"id":8856610,"src":"Alone_copy1_thumb.jpg","galleries_id":465679,"server_id":32,"link":"photo_8856610.html","width":160,"caption":"","height":241});
															thumbnails[8798540] = clik.newPhoto({"id":8798540,"src":"Boathousemistcol2011monow_thumb.jpg","galleries_id":463177,"server_id":32,"link":"photo_8798540.html","width":160,"caption":"DYLAN'S BOATHOUSE IN THE EARLY MORNING MIST","height":239});
															thumbnails[8798595] = clik.newPhoto({"id":8798595,"src":"Boathousemistcol2011w_thumb.jpg","galleries_id":463185,"server_id":32,"link":"photo_8798595.html","width":160,"caption":"WARM DAWN SUNLIGHT TINGES THE BOAT HOUSE SHROUDED IN MIST","height":239});
															thumbnails[8798897] = clik.newPhoto({"id":8798897,"src":"Abstract2w_thumb.jpg","galleries_id":463207,"server_id":32,"link":"photo_8798897.html","width":160,"caption":"CAVE?","height":106});
															thumbnails[8798954] = clik.newPhoto({"id":8798954,"src":"Seascape1w_thumb.jpg","galleries_id":463213,"server_id":32,"link":"photo_8798954.html","width":160,"caption":"STORMY SKY OVER GOWER AND WORMS HEAD","height":106});
															thumbnails[8838904] = clik.newPhoto({"id":8838904,"src":"Dereliction-lean-tow_BEDB3A3A-24E8-5EC4-4F58419102503726_thumb.jpg","galleries_id":464941,"server_id":32,"link":"photo_8838904.html","width":160,"caption":"","height":241});
															thumbnails[8856650] = clik.newPhoto({"id":8856650,"src":"DSC_0448_thumb.jpg","galleries_id":465679,"server_id":32,"link":"photo_8856650.html","width":160,"caption":"","height":241});
															thumbnails[8798565] = clik.newPhoto({"id":8798565,"src":"LAUGHARNE-CASTLE-1w_thumb.jpg","galleries_id":463177,"server_id":32,"link":"photo_8798565.html","width":160,"caption":"DRAMATIC RUINS","height":239});
															thumbnails[8798614] = clik.newPhoto({"id":8798614,"src":"BOAT-HOUSE-1PRINTED-ON-EPP_thumb.jpg","galleries_id":463185,"server_id":32,"link":"photo_8798614.html","width":160,"caption":"BOAT HOUSE WITH THE TIDE IN","height":239});
															thumbnails[8798905] = clik.newPhoto({"id":8798905,"src":"Abstract3w_thumb.jpg","galleries_id":463207,"server_id":32,"link":"photo_8798905.html","width":160,"caption":"SUN","height":106});
															thumbnails[8798958] = clik.newPhoto({"id":8798958,"src":"Sky1w_thumb.jpg","galleries_id":463213,"server_id":32,"link":"photo_8798958.html","width":160,"caption":"CONTRAIL ALLEY","height":106});
															thumbnails[8838906] = clik.newPhoto({"id":8838906,"src":"Dereliction-doorw_BEE6CA0E-24E8-5EC4-4F5064E9141E796D_thumb.jpg","galleries_id":464941,"server_id":32,"link":"photo_8838906.html","width":160,"caption":"","height":241});
															thumbnails[8856651] = clik.newPhoto({"id":8856651,"src":"DSC_04611_thumb.jpg","galleries_id":465679,"server_id":32,"link":"photo_8856651.html","width":160,"caption":"","height":241});
															thumbnails[8856653] = clik.newPhoto({"id":8856653,"src":"DSC_04691_thumb.jpg","galleries_id":465679,"server_id":32,"link":"photo_8856653.html","width":160,"caption":"","height":241});
															thumbnails[8798557] = clik.newPhoto({"id":8798557,"src":"Castle1col2011monow_thumb.jpg","galleries_id":463177,"server_id":32,"link":"photo_8798557.html","width":160,"caption":"RAIN CLOUDS OVER LAUGHARNE CASTLE","height":107});
															thumbnails[8798670] = clik.newPhoto({"id":8798670,"src":"BOAT-HOUSE-2-PRINTED-ON-EPP_thumb.jpg","galleries_id":463185,"server_id":32,"link":"photo_8798670.html","width":160,"caption":"BOAT HOUSE, HIGH TIDE","height":239});
															thumbnails[8798926] = clik.newPhoto({"id":8798926,"src":"Abstract5w_thumb.jpg","galleries_id":463207,"server_id":32,"link":"photo_8798926.html","width":160,"caption":"","height":241});
															thumbnails[8798965] = clik.newPhoto({"id":8798965,"src":"The-Birds1w_thumb.jpg","galleries_id":463213,"server_id":32,"link":"photo_8798965.html","width":160,"caption":"THE BIRDS!","height":106});
															thumbnails[8838909] = clik.newPhoto({"id":8838909,"src":"Dereliction-not-quitew_BEF4B685-24E8-5EC4-4FDF4524C3FA0070_thumb.jpg","galleries_id":464941,"server_id":32,"link":"photo_8838909.html","width":160,"caption":"NOT QUITE DERELICT...","height":241});
															thumbnails[8856654] = clik.newPhoto({"id":8856654,"src":"DSC_04761_thumb.jpg","galleries_id":465679,"server_id":32,"link":"photo_8856654.html","width":160,"caption":"","height":241});
															thumbnails[8798552] = clik.newPhoto({"id":8798552,"src":"Castle2mon2011w1_thumb.jpg","galleries_id":463177,"server_id":32,"link":"photo_8798552.html","width":160,"caption":"LAUGHARNE CASTLE","height":109});
															thumbnails[8798678] = clik.newPhoto({"id":8798678,"src":"BOATS-IN-THE-MIST-PRINTED_thumb.jpg","galleries_id":463185,"server_id":32,"link":"photo_8798678.html","width":160,"caption":"MORNING MIST OVER THE ESTUARY,LAUGHARNE","height":107});
															thumbnails[8798940] = clik.newPhoto({"id":8798940,"src":"Abstract7w_thumb.jpg","galleries_id":463207,"server_id":32,"link":"photo_8798940.html","width":160,"caption":"LIGHTS ON THE HORIZON","height":106});
															thumbnails[8838914] = clik.newPhoto({"id":8838914,"src":"Pigeon-Windoww_BF006678-24E8-5EC4-4FCA52BBD1ED2559_thumb.jpg","galleries_id":464941,"server_id":32,"link":"photo_8838914.html","width":160,"caption":"","height":241});
															thumbnails[8839600] = clik.newPhoto({"id":8839600,"src":"The-Birds-2w_C354F3D5-24E8-5EC4-4F0666AF58C28EF8_thumb.jpg","galleries_id":463213,"server_id":32,"link":"photo_8839600.html","width":160,"caption":"","height":107});
															thumbnails[8856656] = clik.newPhoto({"id":8856656,"src":"Sit-Down1_thumb.jpg","galleries_id":465679,"server_id":32,"link":"photo_8856656.html","width":160,"caption":"","height":241});
															thumbnails[8798605] = clik.newPhoto({"id":8798605,"src":"boatsw_thumb.jpg","galleries_id":463177,"server_id":32,"link":"photo_8798605.html","width":160,"caption":"BOATS, LOW TIDE AND SIR JOHN'S HILL","height":107});
															thumbnails[8798714] = clik.newPhoto({"id":8798714,"src":"BOATHOUSE-3-PRINTED-ON-EPP_thumb.jpg","galleries_id":463185,"server_id":32,"link":"photo_8798714.html","width":160,"caption":"BOAT HOUSE, LOW TIDE.","height":107});
															thumbnails[8838915] = clik.newPhoto({"id":8838915,"src":"Old-Pumpw_BF0F1AC0-24E8-5EC4-4F6D99CBB705875D_thumb.jpg","galleries_id":464941,"server_id":32,"link":"photo_8838915.html","width":160,"caption":"","height":239});
															thumbnails[8838917] = clik.newPhoto({"id":8838917,"src":"Dereliction1pigeon-and-ghostw_BF1A6FAE-24E8-5EC4-4FD73106D7072B11_thumb.jpg","galleries_id":464941,"server_id":32,"link":"photo_8838917.html","width":160,"caption":"","height":106});
															thumbnails[8838919] = clik.newPhoto({"id":8838919,"src":"Dereliction2-why-botherw_BF258F01-24E8-5EC4-4FE9B2E5FF413966_thumb.jpg","galleries_id":464941,"server_id":32,"link":"photo_8838919.html","width":160,"caption":"WHAT ARE THEY PROTECTING?","height":106});
															thumbnails[8838920] = clik.newPhoto({"id":8838920,"src":"Dereliction-Squarew_BF2FE797-24E8-5EC4-4F4CEB03245D1ADB_thumb.jpg","galleries_id":464941,"server_id":32,"link":"photo_8838920.html","width":160,"caption":"","height":167});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[463185] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"LAUGHARNE COLOUR PRINTS","link":"section331038_463185.html","maxRecords":0.0,"photoIDs":[8798587.0,8798595.0,8798614.0,8798670.0,8798678.0,8798714.0],"skipIndex":0,"section_code":"section331038","featured_images":"8798714,8798678,8798670,8798614,8798595,8798587","id":463185,"singleSection":false});				  						galleries[463177] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"LAUGHARNE MONOCHROME PRINTS","link":"section331038_463177.html","maxRecords":0.0,"photoIDs":[8798537.0,8798540.0,8798565.0,8798557.0,8798552.0,8798605.0],"skipIndex":0,"section_code":"section331038","featured_images":"8798605,8798565,8798557,8798552,8798540,8798537","id":463177,"singleSection":false});				  						galleries[463207] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"ABSTRACTIONS AND OTHER DISTRACTIONS","link":"section331038_463207.html","maxRecords":0.0,"photoIDs":[8798888.0,8798897.0,8798905.0,8798926.0,8798940.0],"skipIndex":0,"section_code":"section331038","featured_images":"8798940,8798926,8798905,8798897,8798888","id":463207,"singleSection":false});				  						galleries[464941] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"DERELICTION","link":"section331038_464941.html","maxRecords":0.0,"photoIDs":[8838900.0,8838904.0,8838906.0,8838909.0,8838914.0,8838915.0,8838917.0,8838919.0,8838920.0],"skipIndex":0,"section_code":"section331038","featured_images":"8838920,8838919,8838917,8838915,8838914,8838909,8838906,8838904,8838900","id":464941,"singleSection":false});				  						galleries[463213] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"LAND AND WATER","link":"section331038_463213.html","maxRecords":0.0,"photoIDs":[8798949.0,8798954.0,8798958.0,8798965.0,8839600.0],"skipIndex":0,"section_code":"section331038","featured_images":"8839600,8798965,8798958,8798954,8798949","id":463213,"singleSection":false});				  						galleries[465679] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"PORTRAITS","link":"section331038_465679.html","maxRecords":0.0,"photoIDs":[8856610.0,8856650.0,8856651.0,8856653.0,8856654.0,8856656.0],"skipIndex":0,"section_code":"section331038","featured_images":"8856656,8856654,8856653,8856651,8856650,8856610","id":465679,"singleSection":false});				  						galleries[430461] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"LIMITED EDITIONS","link":"section331038_430461.html","maxRecords":0.0,"photoIDs":[8012442.0],"skipIndex":0,"section_code":"section331038","featured_images":8012442.0,"id":430461,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8856656,8856654,8856653,8856651,8856650,8856610,8839600,8838920,8838919,8838917,8838915,8838914,8838909,8838906,8838904,8838900,8798965,8798958,8798954,8798949,8798940,8798926,8798905,8798897,8798888,8798714,8798678,8798670,8798614,8798605,8798595,8798587,8798565,8798557,8798552,8798540,8798537,8012442';
imageSets[3] = '8856656,8856654,8856653,8856651,8856650,8856610,8839600,8838920,8838919,8838917,8838915,8838914,8838909,8838906,8838904,8838900,8798965,8798958,8798954,8798949,8798940,8798926,8798905,8798897,8798888,8798714,8798678,8798670,8798614,8798605,8798595,8798587,8798565,8798557,8798552,8798540,8798537,8012442';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/kevlatham/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/kevlatham/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/kevlatham/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/kevlatham/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/kevlatham/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/kevlatham/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/kevlatham/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/kevlatham/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/kevlatham/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/kevlatham/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/kevlatham/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/kevlatham/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/kevlatham/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/kevlatham/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/kevlatham/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/kevlatham/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/kevlatham/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/kevlatham/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/kevlatham/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/kevlatham/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/kevlatham/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/kevlatham/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/kevlatham/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/kevlatham/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/kevlatham/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/kevlatham/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/kevlatham/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 += 'section331038.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 && 'section331038' != '') {
					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 = 'Kevin Latham 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="updateCartValue($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';
		
		temp += getPaymentOptions(this.payment_groups_id);
		temp += '</select>';
		temp += '</form>';
				var item_option  = paymentGroups[this.payment_groups_id].options[0];
		if(paymentOptions[item_option]){
			var item_name  = paymentOptions[item_option].payment_option;
			var amount =  paymentOptions[item_option].price;
		}
			}
		else {
		
	}
	if (this.item_price !== '' || this.payment_groups_id !== '') {
											temp += '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm">';
			temp += '	<input type="hidden" name="item_option" value="' + item_option + '">';
			temp += '	<input type="hidden" name="site" value="KEVLATHAM">';
			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;
	}
}

			

