window.thumbnails = {};
															thumbnails[8852946] = clik.newPhoto({"id":8852946,"src":"RN_Service_copy_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_8852946.html","width":130,"caption":"Foundations","height":130});
															thumbnails[7946768] = clik.newPhoto({"id":7946768,"src":"Good_Company_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_7946768.html","width":130,"caption":"'Good Company'","height":163});
															thumbnails[9097788] = clik.newPhoto({"id":9097788,"src":"Life_Savers_Christchurch_1_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_9097788.html","width":130,"caption":"Our Future Life Savers","height":91});
															thumbnails[7350572] = clik.newPhoto({"id":7350572,"src":"Robin_in_Meraid_Garden_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_7350572.html","width":130,"caption":"Robin in Meraid Garden","height":105});
															thumbnails[7350968] = clik.newPhoto({"id":7350968,"src":"Daffs_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_7350968.html","width":130,"caption":"Spring Daffodils","height":106});
															thumbnails[7351039] = clik.newPhoto({"id":7351039,"src":"Negative_to_Positive_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_7351039.html","width":130,"caption":"Negative to Positive","height":90});
															thumbnails[7946905] = clik.newPhoto({"id":7946905,"src":"Mud_Kite_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_7946905.html","width":130,"caption":"","height":87});
															thumbnails[7352083] = clik.newPhoto({"id":7352083,"src":"Lily_BW_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_7352083.html","width":130,"caption":"Lily","height":130});
															thumbnails[7351300] = clik.newPhoto({"id":7351300,"src":"Confusion_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_7351300.html","width":130,"caption":"Confusion - Snow Play","height":74});
															thumbnails[7351326] = clik.newPhoto({"id":7351326,"src":"Discard_Waste_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_7351326.html","width":130,"caption":"End Discard Waste.","height":78});
															thumbnails[7351982] = clik.newPhoto({"id":7351982,"src":"Black_House_Mudeford_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_7351982.html","width":130,"caption":"The 'Black House' Mudeford","height":65});
															thumbnails[7351983] = clik.newPhoto({"id":7351983,"src":"Winter_Mudeford_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_7351983.html","width":130,"caption":"Winter Scene Mudeford","height":63});
															thumbnails[8382401] = clik.newPhoto({"id":8382401,"src":"Her_Day1..._thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_8382401.html","width":130,"caption":"Blessed on Her Day.","height":94});
															thumbnails[7352089] = clik.newPhoto({"id":7352089,"src":"Star_Gazer_Lily_copy_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_7352089.html","width":130,"caption":"Stargazer","height":108});
															thumbnails[7727249] = clik.newPhoto({"id":7727249,"src":"Phishers_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_7727249.html","width":130,"caption":"Phishers o' Men","height":94});
															thumbnails[8567376] = clik.newPhoto({"id":8567376,"src":"The_Rise_-_Mudeford_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_8567376.html","width":130,"caption":"Sun Up - Mudeford","height":87});
															thumbnails[8382413] = clik.newPhoto({"id":8382413,"src":"Swanning_-_Mudeford_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_8382413.html","width":130,"caption":"Swanning around at Mudeford","height":84});
															thumbnails[8567490] = clik.newPhoto({"id":8567490,"src":"Hot_Beach_edited-2_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_8567490.html","width":130,"caption":"Hot Highcliffe Beach","height":130});
															thumbnails[9038198] = clik.newPhoto({"id":9038198,"src":"Cafe_to_Mac_2012_thumb_E093A79B-24E8-5EC4-4FFEB070F93D9868.jpg","galleries_id":397782,"server_id":1,"link":"photo_9038198.html","width":130,"caption":"Fan-Tastic","height":108});
															thumbnails[8650209] = clik.newPhoto({"id":8650209,"src":"Robin_Return_edited-11_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_8650209.html","width":130,"caption":"The Return of Robin","height":103});
															thumbnails[8937958] = clik.newPhoto({"id":8937958,"src":"Grass_Art_-_Sun_Hat__Pin_edited-2_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_8937958.html","width":130,"caption":"Grass Sun Hat & Hopper Pin","height":192});
															thumbnails[7350455] = clik.newPhoto({"id":7350455,"src":"Jaws__Friars_Cliff_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_7350455.html","width":130,"caption":"Jaws at Friars Cliff","height":114});
															thumbnails[8702398] = clik.newPhoto({"id":8702398,"src":"Heron__Woodland_edited-1_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_8702398.html","width":130,"caption":"Heron & Woodland pool","height":86});
															thumbnails[7487945] = clik.newPhoto({"id":7487945,"src":"A1_The_Rill_Dale_Bottom_Lake_District_Keswick_UK_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_7487945.html","width":130,"caption":"Dale Bottom","height":88});
															thumbnails[8730770] = clik.newPhoto({"id":8730770,"src":"Time_Passeges_edited-1_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_8730770.html","width":130,"caption":"'Time Passeges'","height":112});
															thumbnails[7497012] = clik.newPhoto({"id":7497012,"src":"Nevis_Lower_Falls_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_7497012.html","width":130,"caption":"Nevis Lower Falls","height":157});
															thumbnails[8764056] = clik.newPhoto({"id":8764056,"src":"Early_Catch_edited-2_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_8764056.html","width":130,"caption":"Mudeford Early Catch","height":79});
															thumbnails[7497031] = clik.newPhoto({"id":7497031,"src":"Plockton_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_7497031.html","width":130,"caption":"Plockton Village","height":85});
															thumbnails[7497067] = clik.newPhoto({"id":7497067,"src":"Sango_Bay_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_7497067.html","width":130,"caption":"Sango Bay","height":72});
															thumbnails[8988689] = clik.newPhoto({"id":8988689,"src":"Mudeford_Servant_2012_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_8988689.html","width":130,"caption":"Mudeford Servant - 2012","height":75});
															thumbnails[9043514] = clik.newPhoto({"id":9043514,"src":"Steve__Friends_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_9043514.html","width":130,"caption":"Cheque Presentation.","height":64});
															thumbnails[7539141] = clik.newPhoto({"id":7539141,"src":"Wind__Wings_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_7539141.html","width":130,"caption":"Wind & Wings","height":88});
															thumbnails[8834600] = clik.newPhoto({"id":8834600,"src":"Broken_Morning_8D531DAB-1EC9-D45B-1C5EA349BCEFA859_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_8834600.html","width":130,"caption":"Broken Morning","height":104});
															thumbnails[8844032] = clik.newPhoto({"id":8844032,"src":"Pony_Pose_edited-1_F4C02469-1E4F-37DC-71C45F781E5569BE_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_8844032.html","width":130,"caption":"Pony Pose","height":130});
															thumbnails[8844118] = clik.newPhoto({"id":8844118,"src":"You_Again_edited-3_F5945D81-1E4F-37DC-71EAB4B3148ACBAE_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_8844118.html","width":130,"caption":"'You Again!","height":112});
															thumbnails[7813902] = clik.newPhoto({"id":7813902,"src":"Sympathy_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_7813902.html","width":130,"caption":"Sympathy","height":163});
															thumbnails[8880253] = clik.newPhoto({"id":8880253,"src":"Dewc._2_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_8880253.html","width":130,"caption":"Survey at the 'Needles'","height":86});
															thumbnails[8964425] = clik.newPhoto({"id":8964425,"src":"seabrrok_-_Thanks_-_Seal_edited-1_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_8964425.html","width":130,"caption":"Christchurch Seabrook Seals.","height":89});
															thumbnails[7352078] = clik.newPhoto({"id":7352078,"src":"Guide_Lights_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_7352078.html","width":130,"caption":"Guide Lights","height":389});
															thumbnails[9038310] = clik.newPhoto({"id":9038310,"src":"DNY_Swim_7_edited-4_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_9038310.html","width":130,"caption":"Olympic Torch Bearer - Christchurch","height":160});
															thumbnails[9038312] = clik.newPhoto({"id":9038312,"src":"Wet_Wet_2012_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_9038312.html","width":130,"caption":"A very Wet Day - Up & Down","height":44});
															thumbnails[9038315] = clik.newPhoto({"id":9038315,"src":"First_Swim_2012_edited-3_thumb.jpg","galleries_id":397782,"server_id":1,"link":"photo_9038315.html","width":130,"caption":"The big splash New Years Day 2012.","height":43});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[397782] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery Eclectic","link":"section454139.html","maxRecords":0.0,"photoIDs":[8852946.0,7946768.0,9097788.0,7350572.0,7350968.0,7351039.0,7946905.0,7352083.0,7351300.0,7351326.0,7351982.0,7351983.0,8382401.0,7352089.0,7727249.0,8567376.0,8382413.0,8567490.0,9038198.0,8650209.0,8937958.0,7350455.0,8702398.0,7487945.0,8730770.0,7497012.0,8764056.0,7497031.0,7497067.0,8988689.0,9043514.0,7539141.0,8834600.0,8844032.0,8844118.0,7813902.0,8880253.0,8964425.0,7352078.0,9038310.0,9038312.0,9038315.0],"skipIndex":0,"section_code":"section454139","featured_images":"9097788,9043514,9038315,9038312,9038310,9038198,8988689,8964425,8937958,8880253","id":397782,"singleSection":true});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '9097788,9043514,9038315,9038312,9038310,9038198,8988689,8964425,8937958,8880253,8852946,8844118,8844032,8834600,8764056,8730770,8702398,8650209,8567490,8567376,8382413,8382401,7946905,7946768,7813902,7727249,7539141,7497067,7497031,7497012,7487945,7352089,7352083,7352078,7351983,7351982,7351326,7351300,7351039,7350968,7350572,7350455';
imageSets[3] = '9097788,9043514,9038315,9038312,9038310,9038198,8988689,8964425,8937958,8880253,8852946,8844118,8844032,8834600,8764056,8730770,8702398,8650209,8567490,8567376,8382413,8382401,7946905,7946768,7813902,7727249,7539141,7497067,7497031,7497012,7487945,7352089,7352083,7352078,7351983,7351982,7351326,7351300,7351039,7350968,7350572,7350455';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/PicTec/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/PicTec/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/PicTec/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/PicTec/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/PicTec/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/PicTec/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/PicTec/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/PicTec/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/PicTec/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/PicTec/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/PicTec/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/PicTec/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/PicTec/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/PicTec/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/PicTec/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/PicTec/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/PicTec/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/PicTec/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/PicTec/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/PicTec/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/PicTec/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/PicTec/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/PicTec/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/PicTec/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/PicTec/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/PicTec/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/PicTec/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 += 'section454139.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 && 'section454139' != '') {
					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 = 'PicTec - Eclectic - Journalistic Art   : ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		if (op.$photo.length > 0) {
		html = $('<img/>',{
			'class': 'mainphoto photo',
			src: photoSrc,
			id: 'mainPic',
			name: 'mainPic',
			width: op.nextPhoto.width,
			height: op.nextPhoto.height,
			alt: photoCaption,
			css: op.css || {}
		});
		if (op.href) {
			if (op.href.match(/<a/)) {
				html = $(op.href).append(html);
			} else {
				html = $('<a/>', {
					href: op.href,
					title: photoCaption
				}).append(html);
			}
		} else {
			html = $('<a/>', {
				title: photoCaption
			}).append(html);
		}
		if (op.speed == 0) {			op.$photo.html(html);			if (op.onBefore) {			  	op.onBefore.apply(op.$photo);			}			if (op.onAfter) {			  	op.onAfter.apply(op.$photo);			}		} else {			op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){  				if (op.onAfter) {				  	op.onAfter.apply(this);				}				clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));			}, op.onBefore);
		}	}
    if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
        if (!op.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.photo_ref != '') {
		temp += '<div class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</div>';
	}
		if (this.takendate != '') {
		
		temp += '<div class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</div>';
	}
	
	if (this.location != '') {
		
		temp += '<div class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Artist/Photographer </strong>' + this.photographer + '</div>';
	}
				
				if (temp != '') {
		temp += '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp += '<p>Order this print:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> &pound;' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
		else {
		
	}
	if (this.item_price !== '') {
																		temp += '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
			temp += '<input type="hidden" name="item_name" value="'+item_name+'">';
			ref = '';
			if(this.photo_ref != ''){
				ref = this.photo_ref+' - '+this.caption;
			}
			else{
				ref = this.id+' - '+this.caption;
			}
			price = amount;								temp += '<input type="hidden" name="cmd" value="_cart">';
					temp += '<input type="hidden" name="business" value="PicTec@ymail.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="PicTec@ymail.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;
	}
}

			

