window.thumbnails = new Object();
												thumbnails[138609] = new thumbnail(138609,'','','Kenneth Leech copy200_thumb.jpg',130, 108,15,'							photo_138609.html');
												thumbnails[125425] = new thumbnail(125425,'11027','Fell Farm','PG Fell Farm 2_thumb.jpg',130, 111,15,'							photo_125425.html');
												thumbnails[125426] = new thumbnail(125426,'11027','August Storm','PG August Storm1_thumb.jpg',130, 111,15,'							photo_125426.html');
												thumbnails[125428] = new thumbnail(125428,'11027','Beacon Hill','PG Beacon Hill1_thumb.jpg',130, 111,15,'							photo_125428.html');
												thumbnails[125430] = new thumbnail(125430,'11027','Harvest Cottage','PG Harvest Cottage_thumb.jpg',130, 111,15,'							photo_125430.html');
												thumbnails[125432] = new thumbnail(125432,'11027','Harvest Moon','PG Harvest Moon copy_thumb.jpg',130, 111,15,'							photo_125432.html');
												thumbnails[125435] = new thumbnail(125435,'11027','Headland','PG Headland_thumb.jpg',130, 111,15,'							photo_125435.html');
												thumbnails[125437] = new thumbnail(125437,'11027','Meadow Lane ','PG Meadow Lane1_thumb.jpg',130, 111,15,'							photo_125437.html');
												thumbnails[125473] = new thumbnail(125473,'11027','New Moon','PG New Moon_thumb.jpg',130, 111,15,'							photo_125473.html');
												thumbnails[125475] = new thumbnail(125475,'11027','Tern','PG Tern copy_thumb.jpg',130, 111,15,'							photo_125475.html');
												thumbnails[125477] = new thumbnail(125477,'11027','Tree Ridge','PG Tree Ridge copy_thumb.jpg',130, 111,15,'							photo_125477.html');
												thumbnails[125480] = new thumbnail(125480,'11027','Valley Church','PG Valley Church_thumb.jpg',130, 111,15,'							photo_125480.html');
												thumbnails[125482] = new thumbnail(125482,'11027','Winter Fields','PG Winter Fields_thumb.jpg',130, 111,15,'							photo_125482.html');
												thumbnails[125485] = new thumbnail(125485,'11027','Winter Sunset','PG Winter Sunset_thumb.jpg',130, 111,15,'							photo_125485.html');
												thumbnails[125514] = new thumbnail(125514,'11593','August Fields','SP August Fields_thumb.jpg',130, 100,15,'							photo_125514.html');
												thumbnails[125515] = new thumbnail(125515,'11593','Autumn Glade','SP Autum Glade_thumb.jpg',130, 100,15,'							photo_125515.html');
												thumbnails[125516] = new thumbnail(125516,'11593','Autumn Leaves','SP Autumn Leaves_thumb.jpg',130, 100,15,'							photo_125516.html');
												thumbnails[125517] = new thumbnail(125517,'11593','Bluebell Wood','SP Bluebell Wood_thumb.jpg',130, 100,15,'							photo_125517.html');
												thumbnails[125518] = new thumbnail(125518,'11593','Bridle Way','SP Bridle Way_thumb.jpg',130, 100,15,'							photo_125518.html');
												thumbnails[125519] = new thumbnail(125519,'11593','Calm Inlet','SP Calm Inlet_thumb.jpg',130, 100,15,'							photo_125519.html');
												thumbnails[125520] = new thumbnail(125520,'11593','Cumbrian Valley','SP Cumbrian Valley_thumb.jpg',130, 100,15,'							photo_125520.html');
												thumbnails[125522] = new thumbnail(125522,'11593','Estuary Cottage','SP Estuary Cottage_thumb.jpg',130, 100,15,'							photo_125522.html');
												thumbnails[125531] = new thumbnail(125531,'11593','Eden Vale','SP Eden Vale1_thumb.jpg',130, 100,15,'							photo_125531.html');
												thumbnails[125532] = new thumbnail(125532,'11593','Evening Sky','SP Evening Sky_thumb.jpg',130, 100,15,'							photo_125532.html');
												thumbnails[125533] = new thumbnail(125533,'11593','Fir Island','SP Fir lsland_thumb.jpg',130, 100,15,'							photo_125533.html');
												thumbnails[125534] = new thumbnail(125534,'11593','Flaxen Way','SP Flaxen Way_thumb.jpg',130, 100,15,'							photo_125534.html');
												thumbnails[125535] = new thumbnail(125535,'11593','Forest Edge','SP Forest Edge_thumb.jpg',130, 100,15,'							photo_125535.html');
												thumbnails[125536] = new thumbnail(125536,'11593','Harvest Moon','SP Harvest Moon_thumb.jpg',130, 100,15,'							photo_125536.html');
												thumbnails[125537] = new thumbnail(125537,'11593','Holme Wood','SP Holmewood_thumb.jpg',130, 100,15,'							photo_125537.html');
												thumbnails[125538] = new thumbnail(125538,'11597','Low Water','SP Low Water_thumb.jpg',130, 100,15,'							photo_125538.html');
												thumbnails[125539] = new thumbnail(125539,'11597','May Fields','SP May Fields_thumb.jpg',130, 100,15,'							photo_125539.html');
												thumbnails[130712] = new thumbnail(130712,'11597','Meadow Bank','SP Meadow Bank_thumb.jpg',130, 100,15,'							photo_130712.html');
												thumbnails[130713] = new thumbnail(130713,'11597','Morning Light','SP Morning Light_thumb.jpg',130, 100,15,'							photo_130713.html');
												thumbnails[130714] = new thumbnail(130714,'11597','Poppies','SP Poppies_thumb.jpg',130, 100,15,'							photo_130714.html');
												thumbnails[130718] = new thumbnail(130718,'11597','Poppy Field','SP Poppy Field_thumb.jpg',130, 100,15,'							photo_130718.html');
												thumbnails[130720] = new thumbnail(130720,'11597','Summer Haze','SP Summer Haze_thumb.jpg',130, 100,15,'							photo_130720.html');
												thumbnails[130721] = new thumbnail(130721,'11597','Summer Walk','SP Summer Walk_thumb.jpg',130, 100,15,'							photo_130721.html');
												thumbnails[130722] = new thumbnail(130722,'11597','Water Margin','SP Water Margin_thumb.jpg',130, 100,15,'							photo_130722.html');
												thumbnails[130725] = new thumbnail(130725,'11597','West Meadow','SP West Meadow_thumb.jpg',130, 100,15,'							photo_130725.html');
												thumbnails[130732] = new thumbnail(130732,'11597','Willow Bank','SP Willow Bank_thumb.jpg',130, 100,15,'							photo_130732.html');
												thumbnails[130738] = new thumbnail(130738,'11597','Winter Walk','SP Winter Walk_thumb.jpg',130, 100,15,'							photo_130738.html');
												thumbnails[125542] = new thumbnail(125542,'11594','Approaching Storm','AbG Approaching Storm_thumb.jpg',130, 111,15,'							photo_125542.html');
												thumbnails[125548] = new thumbnail(125548,'11594','Beach Pool','AbG Beach Pool_thumb.jpg',130, 111,15,'							photo_125548.html');
												thumbnails[125554] = new thumbnail(125554,'11594','Bracken Ridge','AbG Bracken Ridge_thumb.jpg',130, 111,15,'							photo_125554.html');
												thumbnails[125558] = new thumbnail(125558,'11594','Ebb Tide','AbG Ebb Tide_thumb.jpg',130, 111,15,'							photo_125558.html');
												thumbnails[125574] = new thumbnail(125574,'11594','Brantwood 1','AbG Forest Light 1_thumb.jpg',130, 111,15,'							photo_125574.html');
												thumbnails[125578] = new thumbnail(125578,'11594','Brantwood 2','AbG Forest Light 2_thumb.jpg',130, 111,15,'							photo_125578.html');
												thumbnails[125591] = new thumbnail(125591,'11594','Brantwood 3','AbG Forest Light 5_thumb.jpg',130, 111,15,'							photo_125591.html');
												thumbnails[125597] = new thumbnail(125597,'11594','Giverny Reflections','AbG Giverny Refections_thumb.jpg',130, 111,15,'							photo_125597.html');
												thumbnails[125600] = new thumbnail(125600,'11594','Giverny','AbG Giverny_thumb.jpg',130, 111,15,'							photo_125600.html');
												thumbnails[125604] = new thumbnail(125604,'11594','January Sunrise','AbG January Sunrise_thumb.jpg',130, 111,15,'							photo_125604.html');
												thumbnails[125611] = new thumbnail(125611,'11594','Moonlight','AbG Moonlight_thumb.jpg',130, 111,15,'							photo_125611.html');
												thumbnails[125616] = new thumbnail(125616,'11594','Northern Lights','AbG Nortern Lights_thumb.jpg',130, 111,15,'							photo_125616.html');
												thumbnails[125618] = new thumbnail(125618,'11594','Pennines','AbG Pennines_thumb.jpg',130, 111,15,'							photo_125618.html');
												thumbnails[156648] = new thumbnail(156648,'11594','Brantwood Garden','AbG Brantwood G_thumb.jpg',130, 111,15,'							photo_156648.html');
												thumbnails[125545] = new thumbnail(125545,'11598','Aurora','AbG Aurora_thumb.jpg',130, 111,15,'							photo_125545.html');
												thumbnails[125564] = new thumbnail(125564,'11598','Estuary Sunset','Abg Estuary Sunset_thumb.jpg',130, 111,15,'							photo_125564.html');
												thumbnails[125571] = new thumbnail(125571,'11598','First Snow','AbG First Snow_thumb.jpg',130, 111,15,'							photo_125571.html');
												thumbnails[125625] = new thumbnail(125625,'11598','Rainbow','AbG Rainbow_thumb.jpg',130, 111,15,'							photo_125625.html');
												thumbnails[125630] = new thumbnail(125630,'11598','Sea Light','AbG Sea Light_thumb.jpg',130, 111,15,'							photo_125630.html');
												thumbnails[130629] = new thumbnail(130629,'11598','Seashore','AbG Seashore_thumb.jpg',130, 111,15,'							photo_130629.html');
												thumbnails[130699] = new thumbnail(130699,'11598','Snow Margin','AbG Snow Margin_thumb.jpg',130, 111,15,'							photo_130699.html');
												thumbnails[130700] = new thumbnail(130700,'11598','Snow Melt','AbG Snow Melt_thumb.jpg',130, 111,15,'							photo_130700.html');
												thumbnails[130701] = new thumbnail(130701,'11598','Snowscape','AbG Snowscape_thumb.jpg',130, 111,15,'							photo_130701.html');
												thumbnails[130702] = new thumbnail(130702,'11598','Spring Time','AbG Spring Time_thumb.jpg',130, 111,15,'							photo_130702.html');
												thumbnails[130703] = new thumbnail(130703,'11598','Sun Clouds','AbG Sun Clouds copy_thumb.jpg',130, 111,15,'							photo_130703.html');
												thumbnails[130706] = new thumbnail(130706,'11598','Sunset','AbG Sunset copy_thumb.jpg',130, 111,15,'							photo_130706.html');
												thumbnails[130710] = new thumbnail(130710,'11598','Tide Mark','AbG Tide Mark_thumb.jpg',130, 111,15,'							photo_130710.html');
												thumbnails[130711] = new thumbnail(130711,'11598','Winter Fields','AbG Winter Feilds copy_thumb.jpg',130, 111,15,'							photo_130711.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[11027] = new gallery(11027,'125482,125473,125437,125435,125426,125425','1 Landscape Prints','gallery',[125425,125426,125428,125430,125432,125435,125437,125473,125475,125477,125480,125482,125485],0, 0, '', '																																																																																																							gallery_11027.html',0,0);
				  					galleries[11593] = new gallery(11593,'125537,125535,125534,125533,125532,125518,125517,125514','2 Screenprints','gallery',[125514,125515,125516,125517,125518,125519,125520,125522,125531,125532,125533,125534,125535,125536,125537],0, 0, '', '																																																																																																							gallery_11593.html',0,0);
				  					galleries[11597] = new gallery(11597,'130738,130725,130722,130718,130714,130712,125539,125538','3 Screenprints','gallery',[125538,125539,130712,130713,130714,130718,130720,130721,130722,130725,130732,130738],0, 0, '', '																																																																																																							gallery_11597.html',0,0);
				  					galleries[11594] = new gallery(11594,'156648,125616,125578,125574,125558,125554,125542','4 Abstract Prints','gallery',[125542,125548,125554,125558,125574,125578,125591,125597,125600,125604,125611,125616,125618,156648],0, 0, '', '																																																																																																							gallery_11594.html',0,0);
				  					galleries[11598] = new gallery(11598,'130711,130710,130706,130702,130701,130699,130629,125630,125625,125571,125564,125545','5 Abstract Prints','gallery',[125545,125564,125571,125625,125630,130629,130699,130700,130701,130702,130703,130706,130710,130711],0, 0, '', '																																																																																																							gallery_11598.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '130722,130714,130711,130706,130701,125630,125616,125604,125591,125571,125564,125558,125542,125535,125534,125533,125532,125517,125514,125482,125473,125437,125435,125432,125426,125425';
imageSets[2] = '156648,130738,130725,130722,130718,130714,130712,130711,130710,130706,130702,130701,130699,130629,125630,125625,125616,125578,125574,125571,125564,125558,125554,125545,125542,125539,125538,125537,125535,125534,125533,125532,125518,125517,125514,125482,125473,125437,125435,125426,125425';
imageSets[3] = '156648,138609,130738,130732,130725,130722,130721,130720,130718,130714,130713,130712,130711,130710,130706,130703,130702,130701,130700,130699,130629,125630,125625,125618,125616,125611,125604,125600,125597,125591,125578,125574,125571,125564,125558,125554,125548,125545,125542,125539,125538,125537,125536,125535,125534,125533,125532,125531,125522,125520';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/kenart/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/kenart/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/kenart/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/kenart/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://www.clikchurch.com/kenart/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/kenart/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/kenart/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/kenart/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/kenart/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/kenart/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/kenart/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/kenart/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/kenart/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/kenart/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/kenart/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/kenart/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/kenart/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/kenart/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/kenart/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/kenart/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/kenart/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:'',
                    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 (!basic) {
    if (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
    }
				
    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.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'Kenneth Leech - Artist and Printmaker: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
	    var options = {photoinfominwidth:200};	    		options.photoinfoadjacent = true;			      	      resizePhotoInfo(options);
        if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(backgrounds);
  	    } else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(photos);
  	    }
	    });
    }
        if (!op.speed) {      clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));    }        
    return html;			}
	else {
				
		window.location = 'photo_' + nextPhoto.id + '.html';
	}
		
}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array){
  if (typeof(array) !== 'object') {
    array = photos;
  }
	if($('#paymentConfirm').length > 0){
		$('#paymentConfirm').hide();
		$('#paymentAddButton')
		.unbind()
		.click(function(){
						form = document.getElementById('paymentForm');
			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').text('Item added to cart').show();}
				else{
					$('#paymentConfirm').text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm').text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}
/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp = temp +  '<p id="imageDescription">' + this.description + '</p>';
	}
		if (this.photo_ref != '') {
		temp = temp + '<p class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</p>';
	}
		if (this.takendate != '') {
				
		temp = temp + '<p class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</p>';
	}
	
	if (this.location != '') {
				
		temp = temp + '<p class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</p>';
	}
	
	if (this.photographer != '') {
				
		temp = temp + '<p class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</p>';
	}
					
	temp = temp + this.fnGetPaymentInfo();
				if (temp != '') {
		temp = temp + '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
																		temp = temp + '<p>Buy now using PayPal:</p>';
				temp = temp + '<p class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> 				&pound;' + (this.item_price).toFixed(2) + '</p>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
	else if (this.payment_groups_id !== '') {
		temp = temp + '<p>Buy this print online:</p>';
				temp = temp + '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
											temp = temp + '<select class="paymentlink" name="payment_options_id" onchange="updateItemValues(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
				
		temp = temp + getPaymentOptions(this.payment_groups_id);
		temp = temp + '</select>';
		temp = 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 = temp + '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
	temp = 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 = temp + '<input type="hidden" name="cmd" value="_cart">';
	temp = temp + '<input type="hidden" name="business" value="kenart@btinternet.com">';
	temp = temp + '<input type="hidden" name="currency_code" value="GBP">';
	temp = temp + '<input type="hidden" name="add" value="1">';
					temp = temp + '<input type="hidden" name="amount" value="'+amount+'">';
	temp = temp + '<input type="hidden" name="item_number" value="'+ref+'">';
					temp = temp + '<input type=\"Submit\" value=\"Add to cart\" id=\"paymentAddButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
									temp = temp + '</form>';
								temp = temp + '<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
	temp = temp + '<input type="hidden" name="cmd" value="_cart">';
	temp = temp + '<input type="hidden" name="business" value="kenart@btinternet.com">';
	temp = temp + '<input type="hidden" name="display" value="1">';
	temp = temp + '<input type=\"Submit\" value=\"View cart\" id=\"paymentViewButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
	temp = temp + '</form>';
							temp = 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({            href: thumbnails[imageID].fnGalleryLink(gallery_id),            title: galleries[gallery_id].title          });
        }
							}
										}
}

/***************************************************************************
* 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 + ' | ';
				}
				temp = temp + '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
			}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

