window.thumbnails = new Object();
												thumbnails[7273009] = new thumbnail(7273009,'345373','Guitar Legend Bruce Watson from Big Country','Bruce-BC-Black--White-Jan-2011_thumb.jpg',130, 180,32,'photo_7273009.html');
												thumbnails[6363987] = new thumbnail(6363987,'341200','','004_thumb.jpg',130, 121,32,'photo_6363987.html');
												thumbnails[6813029] = new thumbnail(6813029,'345373','','DSC_5617_thumb.jpg',130, 163,32,'photo_6813029.html');
												thumbnails[6813030] = new thumbnail(6813030,'345373','','DSC_5506_thumb.jpg',130, 144,32,'photo_6813030.html');
												thumbnails[6813033] = new thumbnail(6813033,'345373','','DSC_5741_thumb.jpg',130, 142,32,'photo_6813033.html');
												thumbnails[6813034] = new thumbnail(6813034,'345373','','DSC_5781_thumb.jpg',130, 195,32,'photo_6813034.html');
												thumbnails[6813079] = new thumbnail(6813079,'345373','','DSC_5894_thumb.jpg',130, 154,32,'photo_6813079.html');
												thumbnails[6813083] = new thumbnail(6813083,'345373','','DSC_5865_thumb.jpg',130, 86,32,'photo_6813083.html');
												thumbnails[6813085] = new thumbnail(6813085,'345373','','DSC_6031_thumb.jpg',130, 86,32,'photo_6813085.html');
												thumbnails[6883387] = new thumbnail(6883387,'345374','','Bones-Still-Life_thumb.jpg',130, 84,32,'photo_6883387.html');
												thumbnails[6883390] = new thumbnail(6883390,'345374','','Butterfly-Still-Life_thumb.jpg',130, 86,32,'photo_6883390.html');
												thumbnails[6883467] = new thumbnail(6883467,'345374','','Lens-Still-Life1_thumb.jpg',130, 89,32,'photo_6883467.html');
												thumbnails[6177628] = new thumbnail(6177628,'341199','','2153_thumb.jpg',130, 86,32,'photo_6177628.html');
												thumbnails[6181752] = new thumbnail(6181752,'341200','','Cat_thumb.jpg',130, 101,32,'photo_6181752.html');
												thumbnails[6182341] = new thumbnail(6182341,'345116','','Football-7_thumb.jpg',130, 118,32,'photo_6182341.html');
												thumbnails[6183605] = new thumbnail(6183605,'345373','','Party_thumb.jpg',130, 86,32,'photo_6183605.html');
												thumbnails[6183619] = new thumbnail(6183619,'345374','','Still-Life_thumb.jpg',130, 200,32,'photo_6183619.html');
												thumbnails[6302193] = new thumbnail(6302193,'345118','','Wedding111_thumb.jpg',130, 86,32,'photo_6302193.html');
												thumbnails[6363984] = new thumbnail(6363984,'345117','','Portrait_thumb.jpg',130, 195,32,'photo_6363984.html');
												thumbnails[6364086] = new thumbnail(6364086,'341199','','dockyard3_thumb.jpg',130, 86,32,'photo_6364086.html');
												thumbnails[6181775] = new thumbnail(6181775,'341200','','Dog-1_thumb.jpg',130, 226,32,'photo_6181775.html');
												thumbnails[6182354] = new thumbnail(6182354,'345116','','Football-6_thumb.jpg',130, 128,32,'photo_6182354.html');
												thumbnails[6182681] = new thumbnail(6182681,'341199','','Landscape-2_thumb.jpg',130, 67,32,'photo_6182681.html');
												thumbnails[6183606] = new thumbnail(6183606,'345373','','Party-2_thumb.jpg',130, 186,32,'photo_6183606.html');
												thumbnails[6302194] = new thumbnail(6302194,'345118','','Wedding-13_thumb.jpg',130, 127,32,'photo_6302194.html');
												thumbnails[6363985] = new thumbnail(6363985,'345117','','Portrait-3-_thumb.jpg',130, 167,32,'photo_6363985.html');
												thumbnails[6726000] = new thumbnail(6726000,'345117','','34-2_thumb.jpg',130, 195,32,'photo_6726000.html');
												thumbnails[6181799] = new thumbnail(6181799,'341200','','Dog-3_thumb.jpg',130, 161,32,'photo_6181799.html');
												thumbnails[6182359] = new thumbnail(6182359,'345116','','Football-3_thumb.jpg',130, 127,32,'photo_6182359.html');
												thumbnails[6182691] = new thumbnail(6182691,'341199','','Landscape-3_thumb.jpg',130, 31,32,'photo_6182691.html');
												thumbnails[6302195] = new thumbnail(6302195,'345118','','Wedding-14_thumb.jpg',130, 118,32,'photo_6302195.html');
												thumbnails[6726004] = new thumbnail(6726004,'345117','','36-2_thumb.jpg',130, 195,32,'photo_6726004.html');
												thumbnails[6181870] = new thumbnail(6181870,'341200','','Dog-4_thumb.jpg',130, 159,32,'photo_6181870.html');
												thumbnails[6182624] = new thumbnail(6182624,'345116','','football---5_thumb.jpg',130, 120,32,'photo_6182624.html');
												thumbnails[6302196] = new thumbnail(6302196,'345118','','Wedding-15_thumb.jpg',130, 87,32,'photo_6302196.html');
												thumbnails[6182158] = new thumbnail(6182158,'341200','','Frisbee-2_thumb.jpg',130, 108,32,'photo_6182158.html');
												thumbnails[6182634] = new thumbnail(6182634,'345116','','Football-4_thumb.jpg',130, 60,32,'photo_6182634.html');
												thumbnails[6182697] = new thumbnail(6182697,'341199','','Landscape-5_thumb.jpg',130, 27,32,'photo_6182697.html');
												thumbnails[6182706] = new thumbnail(6182706,'341199','','Landscape-6_thumb.jpg',130, 86,32,'photo_6182706.html');
												thumbnails[6302198] = new thumbnail(6302198,'345118','','Wedding-16_thumb.jpg',130, 98,32,'photo_6302198.html');
												thumbnails[6726009] = new thumbnail(6726009,'345117','','38-2_thumb.jpg',130, 156,32,'photo_6726009.html');
												thumbnails[6181877] = new thumbnail(6181877,'341200','','Frisbee_thumb.jpg',130, 116,32,'photo_6181877.html');
												thumbnails[6182710] = new thumbnail(6182710,'341199','','Landscape-8_thumb.jpg',130, 74,32,'photo_6182710.html');
												thumbnails[6183628] = new thumbnail(6183628,'345116','','Football-1_thumb.jpg',130, 194,32,'photo_6183628.html');
												thumbnails[6726011] = new thumbnail(6726011,'345117','','39-2_thumb.jpg',130, 230,32,'photo_6726011.html');
												thumbnails[6182716] = new thumbnail(6182716,'341199','','Landscape-9_thumb.jpg',130, 84,32,'photo_6182716.html');
												thumbnails[6302200] = new thumbnail(6302200,'345118','','Wedding-17_thumb.jpg',130, 91,32,'photo_6302200.html');
												thumbnails[6363956] = new thumbnail(6363956,'345116','','football-11_thumb.jpg',130, 163,32,'photo_6363956.html');
												thumbnails[6726014] = new thumbnail(6726014,'345117','','42-2_thumb.jpg',130, 182,32,'photo_6726014.html');
												thumbnails[6302204] = new thumbnail(6302204,'345118','','Wedding-18_thumb.jpg',130, 151,32,'photo_6302204.html');
												thumbnails[6363880] = new thumbnail(6363880,'341199','','London_thumb.jpg',130, 172,32,'photo_6363880.html');
												thumbnails[6726015] = new thumbnail(6726015,'345117','','47-2_thumb.jpg',130, 167,32,'photo_6726015.html');
												thumbnails[6302207] = new thumbnail(6302207,'345118','','Wedding-19_thumb.jpg',130, 120,32,'photo_6302207.html');
												thumbnails[6363924] = new thumbnail(6363924,'341199','','london-1_thumb.jpg',130, 225,32,'photo_6363924.html');
												thumbnails[6363964] = new thumbnail(6363964,'345116','','football-10_thumb.jpg',130, 113,32,'photo_6363964.html');
												thumbnails[6726037] = new thumbnail(6726037,'345117','','58-2_thumb.jpg',130, 116,32,'photo_6726037.html');
												thumbnails[6302209] = new thumbnail(6302209,'345118','','Wedding-20_thumb.jpg',130, 177,32,'photo_6302209.html');
												thumbnails[6363926] = new thumbnail(6363926,'341199','','londoneye_thumb.jpg',130, 189,32,'photo_6363926.html');
												thumbnails[6363927] = new thumbnail(6363927,'341199','','london-2_thumb.jpg',130, 195,32,'photo_6363927.html');
												thumbnails[6363965] = new thumbnail(6363965,'345116','','football-21_thumb.jpg',130, 97,32,'photo_6363965.html');
												thumbnails[6726100] = new thumbnail(6726100,'345117','','66-2_thumb.jpg',130, 95,32,'photo_6726100.html');
												thumbnails[6302210] = new thumbnail(6302210,'345118','','Wedding-21_thumb.jpg',130, 106,32,'photo_6302210.html');
												thumbnails[6363967] = new thumbnail(6363967,'345116','','football-141_thumb.jpg',130, 119,32,'photo_6363967.html');
												thumbnails[6726119] = new thumbnail(6726119,'345117','','68-2_thumb.jpg',130, 87,32,'photo_6726119.html');
												thumbnails[6302211] = new thumbnail(6302211,'345118','','Wedding-22_thumb.jpg',130, 152,32,'photo_6302211.html');
												thumbnails[6363969] = new thumbnail(6363969,'345116','','football-13_thumb.jpg',130, 198,32,'photo_6363969.html');
												thumbnails[6726120] = new thumbnail(6726120,'345117','','62-2_thumb.jpg',130, 135,32,'photo_6726120.html');
												thumbnails[6302212] = new thumbnail(6302212,'345118','','Wedding-23_thumb.jpg',130, 77,32,'photo_6302212.html');
												thumbnails[6727028] = new thumbnail(6727028,'345117','','11_thumb.jpg',130, 128,32,'photo_6727028.html');
												thumbnails[6363981] = new thumbnail(6363981,'341200','','Dog-5_thumb.jpg',130, 169,32,'photo_6363981.html');
												thumbnails[6363982] = new thumbnail(6363982,'341200','','Dog-6_thumb.jpg',130, 195,32,'photo_6363982.html');
												thumbnails[6727029] = new thumbnail(6727029,'345117','','12_thumb.jpg',130, 83,32,'photo_6727029.html');
												thumbnails[7389123] = new thumbnail(7389123,'345118','','018_thumb.jpg',130, 130,32,'photo_7389123.html');
												thumbnails[6727032] = new thumbnail(6727032,'345117','','18_thumb.jpg',130, 126,32,'photo_6727032.html');
												thumbnails[7389125] = new thumbnail(7389125,'345118','','022_thumb.jpg',130, 113,32,'photo_7389125.html');
												thumbnails[6727034] = new thumbnail(6727034,'345117','','22sepia_thumb.jpg',130, 171,32,'photo_6727034.html');
												thumbnails[7389127] = new thumbnail(7389127,'345118','','026_thumb.jpg',130, 104,32,'photo_7389127.html');
												thumbnails[7389130] = new thumbnail(7389130,'345118','','039_thumb.jpg',130, 93,32,'photo_7389130.html');
												thumbnails[6727231] = new thumbnail(6727231,'345117','','24_thumb.jpg',130, 110,32,'photo_6727231.html');
												thumbnails[7389132] = new thumbnail(7389132,'345118','','066_thumb.jpg',130, 178,32,'photo_7389132.html');
												thumbnails[7389135] = new thumbnail(7389135,'345118','','080_thumb.jpg',130, 195,32,'photo_7389135.html');
												thumbnails[7389137] = new thumbnail(7389137,'345118','','174_thumb.jpg',130, 91,32,'photo_7389137.html');
												thumbnails[7389139] = new thumbnail(7389139,'345118','','1761_thumb.jpg',130, 86,32,'photo_7389139.html');
												thumbnails[7389140] = new thumbnail(7389140,'345118','','302_thumb.jpg',130, 104,32,'photo_7389140.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[341199] = new gallery(341199,'6364086,6363927,6363926,6363924,6363880,6177628','Landscapes','gallery',[6177628,6364086,6182681,6182691,6182697,6182706,6182710,6182716,6363880,6363924,6363926,6363927],0, 0, '', 'gallery_341199.html',0,0);
				  					galleries[341200] = new gallery(341200,'6363987,6363982,6363981','Animals','gallery',[6363987,6181752,6181775,6181799,6181870,6182158,6181877,6363981,6363982],0, 0, '', 'gallery_341200.html',0,0);
				  					galleries[345116] = new gallery(345116,'6363969,6363965,6363964,6363956,6182341','Sport','gallery',[6182341,6182354,6182359,6182624,6182634,6183628,6363956,6363964,6363965,6363967,6363969],0, 0, '', 'gallery_345116.html',0,0);
				  					galleries[345117] = new gallery(345117,'6726000','Portrait','gallery',[6363984,6363985,6726000,6726004,6726009,6726011,6726014,6726015,6726037,6726100,6726119,6726120,6727028,6727029,6727032,6727034,6727231],0, 0, '', 'gallery_345117.html',0,0);
				  					galleries[345118] = new gallery(345118,'7389140,7389139,7389137,7389135,7389132,7389130,7389127,7389125,7389123,6302212','Wedding','gallery',[6302193,6302194,6302195,6302196,6302198,6302200,6302204,6302207,6302209,6302210,6302211,6302212,7389123,7389125,7389127,7389130,7389132,7389135,7389137,7389139,7389140],0, 0, '', 'gallery_345118.html',0,0);
				  					galleries[345373] = new gallery(345373,'6183606','Party/Functions','gallery',[7273009,6813029,6813030,6813033,6813034,6813079,6813083,6813085,6183605,6183606],0, 0, '', 'gallery_345373.html',0,0);
				  					galleries[345374] = new gallery(345374,'6183619','Still Life & Abstract','gallery',[6883387,6883390,6883467,6183619],0, 0, '', 'gallery_345374.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '7273009';
imageSets[2] = '6726000,6364086,6363987,6363982,6363981,6363969,6363965,6363964,6363956,6363927,6363926,6363924,6363880,6183619,6183606,6182341,6177628';
imageSets[3] = '6883467,6883390,6883387';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/Deltrotter31/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/Deltrotter31/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/Deltrotter31/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/Deltrotter31/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/Deltrotter31/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/Deltrotter31/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/Deltrotter31/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/Deltrotter31/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/Deltrotter31/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/Deltrotter31/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/Deltrotter31/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/Deltrotter31/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/Deltrotter31/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/Deltrotter31/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/Deltrotter31/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/Deltrotter31/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/Deltrotter31/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/Deltrotter31/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/Deltrotter31/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/Deltrotter31/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/Deltrotter31/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/Deltrotter31/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));		  $('body').trigger('clikUpdate');		}, 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 = 'Cowan Photography: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
	    var options = {};	    	      	      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));      $('body').trigger('clikUpdate');    }        
    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="updateCartValue(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';
				
		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">';
	temp = temp + '	<input type="hidden" name="item_option" value="' + item_option + '">';
	temp = temp + '	<input type="hidden" name="site" value="DELTROTTER31">';
		temp = temp + '	<input type="hidden" name="item_number" value="'+ this.id +'">';
			temp = temp + '	<input type="hidden" name="quantity" value="1">';
								temp = temp + '	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\'\;" onmouseout="this.className=\'button\'\;" type="Button">';
			temp = 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 = temp + '</form>';
		temp = temp + '<div class="clearing">&nbsp;</div>';
	temp = temp + '<div id="confirmContainer">';
	temp = temp + '<div id="paymentConfirm">Item added to cart</div>';
	temp = temp + '</div>';
			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;
	}
}

			

