window.thumbnails = {};
															thumbnails[567173] = clik.newPhoto({"id":567173,"src":"omg0346_thumb.jpg","galleries_id":43699,"server_id":18,"link":"photo_567173.html","width":130,"caption":"One arm golf Tynemouth","height":87});
															thumbnails[568258] = clik.newPhoto({"id":568258,"src":"P9_thumb.jpg","galleries_id":43898,"server_id":18,"link":"photo_568258.html","width":130,"caption":"Wedding(reportage)","height":139});
															thumbnails[575772] = clik.newPhoto({"id":575772,"src":"E0197_thumb.jpg","galleries_id":44392,"server_id":18,"link":"photo_575772.html","width":130,"caption":"I see the light.","height":87});
															thumbnails[1306499] = clik.newPhoto({"id":1306499,"src":"250807 BLUESTARVCURZONASHTON0033W_thumb.jpg","galleries_id":43699,"server_id":18,"link":"photo_1306499.html","width":130,"caption":"Newcastle Bluestar vs curzon ashton 002","height":173});
															thumbnails[1492167] = clik.newPhoto({"id":1492167,"src":"Football_thumb.jpg","galleries_id":43699,"server_id":18,"link":"photo_1492167.html","width":130,"caption":"Local football","height":168});
															thumbnails[1492168] = clik.newPhoto({"id":1492168,"src":"rugby_thumb.jpg","galleries_id":43699,"server_id":18,"link":"photo_1492168.html","width":130,"caption":"Tynedale rugby","height":92});
															thumbnails[1492171] = clik.newPhoto({"id":1492171,"src":"black horse 02_thumb.jpg","galleries_id":44392,"server_id":18,"link":"photo_1492171.html","width":130,"caption":"press","height":195});
															thumbnails[1640219] = clik.newPhoto({"id":1640219,"src":"waterside_thumb.jpg","galleries_id":43856,"server_id":18,"link":"photo_1640219.html","width":130,"caption":"The waterside Knaresborough","height":87});
															thumbnails[1734350] = clik.newPhoto({"id":1734350,"src":"_J0S5955W_thumb.jpg","galleries_id":44392,"server_id":18,"link":"photo_1734350.html","width":130,"caption":"Widow twanky gets a new bra","height":215});
															thumbnails[1744923] = clik.newPhoto({"id":1744923,"src":"hoppingsW_thumb.jpg","galleries_id":44392,"server_id":18,"link":"photo_1744923.html","width":130,"caption":"Wet hoppings again!","height":89});
															thumbnails[1944620] = clik.newPhoto({"id":1944620,"src":"IC1902Roth001B_thumb.jpg","galleries_id":43856,"server_id":18,"link":"photo_1944620.html","width":130,"caption":"Winter frost","height":86});
															thumbnails[2126792] = clik.newPhoto({"id":2126792,"src":"150308ncraces003_thumb.jpg","galleries_id":43699,"server_id":18,"link":"photo_2126792.html","width":130,"caption":"Horse racing","height":86});
															thumbnails[2847625] = clik.newPhoto({"id":2847625,"src":"PN08_princess_royal_008_thumb.jpg","galleries_id":44392,"server_id":18,"link":"photo_2847625.html","width":130,"caption":"Watching them watching you.","height":100});
															thumbnails[2847626] = clik.newPhoto({"id":2847626,"src":"PN08_princess_royal_014_thumb.jpg","galleries_id":44392,"server_id":18,"link":"photo_2847626.html","width":130,"caption":"The Princess Royal opens freeman's quay Durham","height":104});
															thumbnails[3056014] = clik.newPhoto({"id":3056014,"src":"005W_thumb.jpg","galleries_id":43898,"server_id":18,"link":"photo_3056014.html","width":130,"caption":"wedding 02","height":195});
															thumbnails[4331951] = clik.newPhoto({"id":4331951,"src":"chaser_thumb.jpg","galleries_id":44391,"server_id":18,"link":"photo_4331951.html","width":130,"caption":"Four spot broad bodied chaser","height":87});
															thumbnails[4331952] = clik.newPhoto({"id":4331952,"src":"Kingfisher001_thumb.jpg","galleries_id":44391,"server_id":18,"link":"photo_4331952.html","width":130,"caption":"Juvenile kingfisher with fish","height":87});
															thumbnails[4737689] = clik.newPhoto({"id":4737689,"src":"Sand_martin02_thumb.jpg","galleries_id":44391,"server_id":18,"link":"photo_4737689.html","width":130,"caption":"Sand martin 02","height":87});
															thumbnails[5025309] = clik.newPhoto({"id":5025309,"src":"_IFF0091A_thumb.jpg","galleries_id":43856,"server_id":18,"link":"photo_5025309.html","width":130,"caption":"Ullswater Cumbria","height":86});
															thumbnails[5025316] = clik.newPhoto({"id":5025316,"src":"_IFF0095A_thumb.jpg","galleries_id":43856,"server_id":18,"link":"photo_5025316.html","width":130,"caption":"Ullswater Cumbria","height":86});
															thumbnails[5025320] = clik.newPhoto({"id":5025320,"src":"_IFF0125A_thumb.jpg","galleries_id":43856,"server_id":18,"link":"photo_5025320.html","width":130,"caption":"Boats at Keswick Cumbria","height":87});
															thumbnails[5187323] = clik.newPhoto({"id":5187323,"src":"E10p_thumb.jpg","galleries_id":43898,"server_id":18,"link":"photo_5187323.html","width":130,"caption":"","height":87});
															thumbnails[5187359] = clik.newPhoto({"id":5187359,"src":"ICF_49541_thumb.jpg","galleries_id":43898,"server_id":18,"link":"photo_5187359.html","width":130,"caption":"","height":195});
															thumbnails[5846438] = clik.newPhoto({"id":5846438,"src":"_IFF0115A_thumb.jpg","galleries_id":43856,"server_id":18,"link":"photo_5846438.html","width":130,"caption":"Derwent Water","height":86});
															thumbnails[5846442] = clik.newPhoto({"id":5846442,"src":"ICF_5076A_thumb.jpg","galleries_id":43898,"server_id":18,"link":"photo_5846442.html","width":130,"caption":"Eyes","height":87});
															thumbnails[5846446] = clik.newPhoto({"id":5846446,"src":"ICF_5108A_thumb.jpg","galleries_id":43898,"server_id":18,"link":"photo_5846446.html","width":130,"caption":"","height":196});
															thumbnails[6668504] = clik.newPhoto({"id":6668504,"src":"ICF_4845HI_thumb.jpg","galleries_id":43856,"server_id":18,"link":"photo_6668504.html","width":130,"caption":"Holy Island Castle","height":87});
															thumbnails[6668524] = clik.newPhoto({"id":6668524,"src":"dog_flyball_02jpg_thumb.jpg","galleries_id":43699,"server_id":18,"link":"photo_6668524.html","width":130,"caption":"Dog Flyball","height":87});
															thumbnails[6668533] = clik.newPhoto({"id":6668533,"src":"ICF_4893HI_thumb.jpg","galleries_id":43856,"server_id":18,"link":"photo_6668533.html","width":130,"caption":"Holy Island Castle 2","height":195});
															thumbnails[6668549] = clik.newPhoto({"id":6668549,"src":"Nuthatch_05jpg_thumb.jpg","galleries_id":44391,"server_id":18,"link":"photo_6668549.html","width":130,"caption":"Nuthatch","height":195});
															thumbnails[6903860] = clik.newPhoto({"id":6903860,"src":"DS7_5503_thumb.jpg","galleries_id":43898,"server_id":18,"link":"photo_6903860.html","width":130,"caption":"","height":87});
															thumbnails[6903864] = clik.newPhoto({"id":6903864,"src":"DS7_5558_thumb.jpg","galleries_id":43898,"server_id":18,"link":"photo_6903864.html","width":130,"caption":"","height":87});
															thumbnails[6903866] = clik.newPhoto({"id":6903866,"src":"DS7_5605_thumb.jpg","galleries_id":43898,"server_id":18,"link":"photo_6903866.html","width":130,"caption":"","height":195});
															thumbnails[7728014] = clik.newPhoto({"id":7728014,"src":"Ullswater_thumb.jpg","galleries_id":43856,"server_id":18,"link":"photo_7728014.html","width":130,"caption":"Ullswater","height":86});
															thumbnails[7728047] = clik.newPhoto({"id":7728047,"src":"DSC_0005_003_thumb.jpg","galleries_id":43856,"server_id":18,"link":"photo_7728047.html","width":130,"caption":"Aire of force","height":196});
															thumbnails[7927706] = clik.newPhoto({"id":7927706,"src":"Bee_on_Flower_thumb.jpg","galleries_id":44391,"server_id":18,"link":"photo_7927706.html","width":130,"caption":"","height":195});
															thumbnails[7927708] = clik.newPhoto({"id":7927708,"src":"RSq__thumb.jpg","galleries_id":44391,"server_id":18,"link":"photo_7927708.html","width":130,"caption":"","height":87});
															thumbnails[8171898] = clik.newPhoto({"id":8171898,"src":"Gannets_07_thumb.jpg","galleries_id":44391,"server_id":18,"link":"photo_8171898.html","width":130,"caption":"Gannets at Bempton Cliffs","height":87});
															thumbnails[8171900] = clik.newPhoto({"id":8171900,"src":"Gannet_05_thumb.jpg","galleries_id":44391,"server_id":18,"link":"photo_8171900.html","width":130,"caption":"Gannets at Bempton Cliffs 2","height":87});
															thumbnails[8171902] = clik.newPhoto({"id":8171902,"src":"As-Otter_thumb.jpg","galleries_id":44391,"server_id":18,"link":"photo_8171902.html","width":130,"caption":"Asian Otter","height":87});
															thumbnails[8455883] = clik.newPhoto({"id":8455883,"src":"Millie_291_thumb.JPG","galleries_id":44392,"server_id":18,"link":"photo_8455883.html","width":130,"caption":"I'll get you.","height":86});
															thumbnails[8969426] = clik.newPhoto({"id":8969426,"src":"DS2_0999_thumb.jpg","galleries_id":43699,"server_id":18,"link":"photo_8969426.html","width":130,"caption":"Josh Beaumont touches down for Durham Uni.","height":86});
															thumbnails[8969434] = clik.newPhoto({"id":8969434,"src":"Road_to_Ennerdale_thumb.jpg","galleries_id":43856,"server_id":18,"link":"photo_8969434.html","width":130,"caption":"","height":87});
															thumbnails[8969444] = clik.newPhoto({"id":8969444,"src":"willow_tit_06_thumb.jpg","galleries_id":44391,"server_id":18,"link":"photo_8969444.html","width":130,"caption":"","height":87});
															thumbnails[8969447] = clik.newPhoto({"id":8969447,"src":"Thorp-abr-02_thumb.jpg","galleries_id":43856,"server_id":18,"link":"photo_8969447.html","width":130,"caption":"","height":86});
															thumbnails[9117124] = clik.newPhoto({"id":9117124,"src":"Kingfisher14_1_thumb.jpg","galleries_id":44391,"server_id":18,"link":"photo_9117124.html","width":130,"caption":"","height":195});
															thumbnails[9117132] = clik.newPhoto({"id":9117132,"src":"GSW_17_thumb.jpg","galleries_id":44391,"server_id":18,"link":"photo_9117132.html","width":130,"caption":"","height":195});
															thumbnails[9117147] = clik.newPhoto({"id":9117147,"src":"Sparrowhawk_with_kill._1_thumb.jpg","galleries_id":44391,"server_id":18,"link":"photo_9117147.html","width":130,"caption":"","height":87});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[43699] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Sport","link":"gallery_43699.html","maxRecords":0.0,"photoIDs":[567173.0,1306499.0,1492167.0,1492168.0,2126792.0,6668524.0,8969426.0],"skipIndex":0,"section_code":"gallery","featured_images":6668524.0,"id":43699,"singleSection":false});				  						galleries[44391] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Wildlife","link":"gallery_44391.html","maxRecords":0.0,"photoIDs":[4331951.0,4331952.0,4737689.0,6668549.0,7927706.0,7927708.0,8171898.0,8171900.0,8171902.0,8969444.0,9117124.0,9117132.0,9117147.0],"skipIndex":0,"section_code":"gallery","featured_images":9117124.0,"id":44391,"singleSection":false});				  						galleries[43856] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Landscapes","link":"gallery_43856.html","maxRecords":0.0,"photoIDs":[1640219.0,1944620.0,5025309.0,5025316.0,5025320.0,5846438.0,6668504.0,6668533.0,7728014.0,7728047.0,8969434.0,8969447.0],"skipIndex":0,"section_code":"gallery","featured_images":"8969447,8969434,7728047,7728014,6668533,6668504,5846438,5025320,5025316,5025309","id":43856,"singleSection":false});				  						galleries[43898] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"People","link":"gallery_43898.html","maxRecords":0.0,"photoIDs":[568258.0,3056014.0,5187323.0,5187359.0,5846442.0,5846446.0,6903860.0,6903864.0,6903866.0],"skipIndex":0,"section_code":"gallery","featured_images":"6903866,6903864,6903860,5846446,5846442,5187359,5187323,3056014,568258","id":43898,"singleSection":false});				  						galleries[44392] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Press & the rest","link":"gallery_44392.html","maxRecords":0.0,"photoIDs":[575772.0,1492171.0,1734350.0,1744923.0,2847625.0,2847626.0,8455883.0],"skipIndex":0,"section_code":"gallery","featured_images":2847625.0,"id":44392,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '9117124,8455883,7927706,7728047,7728014,6903866,6668533,5846442,5187323,1744923';
imageSets[2] = '9117124,6668524,2847625';
imageSets[3] = '6668533,6668524,5846442,5187323,5025320,3056014,2126792,1306499,575772';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/iclyne/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/iclyne/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/iclyne/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/iclyne/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/iclyne/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/iclyne/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/iclyne/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/iclyne/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/iclyne/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/iclyne/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/iclyne/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/iclyne/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/iclyne/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/iclyne/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/iclyne/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/iclyne/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/iclyne/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/iclyne/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/iclyne/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/iclyne/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/iclyne/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/iclyne/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/iclyne/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/iclyne/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/iclyne/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/iclyne/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/iclyne/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 = 'Iain Clyne 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.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="iclyne@blueyonder.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="iclyne@blueyonder.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;
	}
}

			

