window.thumbnails = new Object();
												thumbnails[4019184] = new thumbnail(4019184,'','','0003_thumb.jpg',130, 195,18,'															#');
												thumbnails[1255450] = new thumbnail(1255450,'89359','','00111_thumb.jpg',130, 80,18,'																			photo_1255450.html');
												thumbnails[1255456] = new thumbnail(1255456,'89359','','0034_thumb.jpg',130, 210,18,'																			photo_1255456.html');
												thumbnails[1255459] = new thumbnail(1255459,'89359','','0042_thumb.jpg',130, 99,18,'																			photo_1255459.html');
												thumbnails[1255461] = new thumbnail(1255461,'89359','','0053_thumb.jpg',130, 195,18,'																			photo_1255461.html');
												thumbnails[1255462] = new thumbnail(1255462,'89359','','0064_thumb.jpg',130, 87,18,'																			photo_1255462.html');
												thumbnails[1255463] = new thumbnail(1255463,'89359','','0072_thumb.jpg',130, 87,18,'																			photo_1255463.html');
												thumbnails[1255464] = new thumbnail(1255464,'89359','','0078_thumb.jpg',130, 150,18,'																			photo_1255464.html');
												thumbnails[1255466] = new thumbnail(1255466,'89359','','0116_thumb.jpg',130, 95,18,'																			photo_1255466.html');
												thumbnails[1255467] = new thumbnail(1255467,'89359','','0123_thumb.jpg',130, 87,18,'																			photo_1255467.html');
												thumbnails[1255496] = new thumbnail(1255496,'89353','','IMG_0693_thumb.jpg',130, 205,18,'																			photo_1255496.html');
												thumbnails[1255497] = new thumbnail(1255497,'89353','','IMG_5916_thumb.jpg',130, 195,18,'																			photo_1255497.html');
												thumbnails[1255499] = new thumbnail(1255499,'89353','','IMG_0768_thumb.jpg',130, 202,18,'																			photo_1255499.html');
												thumbnails[1255500] = new thumbnail(1255500,'89353','','IMG_5924_thumb.jpg',130, 195,18,'																			photo_1255500.html');
												thumbnails[1255503] = new thumbnail(1255503,'89353','','IMG_5967_thumb.jpg',130, 162,18,'																			photo_1255503.html');
												thumbnails[1255504] = new thumbnail(1255504,'89353','','IMG_5975_thumb.jpg',130, 195,18,'																			photo_1255504.html');
												thumbnails[1255506] = new thumbnail(1255506,'89353','','IMG_6020_thumb.jpg',130, 82,18,'																			photo_1255506.html');
												thumbnails[1255510] = new thumbnail(1255510,'89359','','Picture 007_thumb.jpg',130, 173,18,'																			photo_1255510.html');
												thumbnails[1255512] = new thumbnail(1255512,'89359','','Picture 013_thumb.jpg',130, 98,18,'																			photo_1255512.html');
												thumbnails[1255513] = new thumbnail(1255513,'89359','','Picture 015_thumb.jpg',130, 173,18,'																			photo_1255513.html');
												thumbnails[1255514] = new thumbnail(1255514,'89359','','Picture 020_thumb.jpg',130, 195,18,'																			photo_1255514.html');
												thumbnails[1255515] = new thumbnail(1255515,'89359','','Picture 070_thumb.jpg',130, 173,18,'																			photo_1255515.html');
												thumbnails[1255522] = new thumbnail(1255522,'89357','','Picture 001_thumb.jpg',130, 173,18,'																			photo_1255522.html');
												thumbnails[1255523] = new thumbnail(1255523,'89357','','Picture 003_thumb.jpg',130, 173,18,'																			photo_1255523.html');
												thumbnails[1255524] = new thumbnail(1255524,'89353','','Picture 006_thumb.jpg',130, 173,18,'																			photo_1255524.html');
												thumbnails[1255525] = new thumbnail(1255525,'89353','','Picture 008_thumb.jpg',130, 98,18,'																			photo_1255525.html');
												thumbnails[1255526] = new thumbnail(1255526,'89353','','Picture 012_thumb.jpg',130, 173,18,'																			photo_1255526.html');
												thumbnails[1255527] = new thumbnail(1255527,'89353','','Picture 0201_thumb.jpg',130, 98,18,'																			photo_1255527.html');
												thumbnails[1255528] = new thumbnail(1255528,'89353','','Picture 024_thumb.jpg',130, 98,18,'																			photo_1255528.html');
												thumbnails[1255529] = new thumbnail(1255529,'89353','','Picture 030_thumb.jpg',130, 98,18,'																			photo_1255529.html');
												thumbnails[1255531] = new thumbnail(1255531,'89353','','100_2319_thumb.jpg',130, 173,18,'																			photo_1255531.html');
												thumbnails[1255532] = new thumbnail(1255532,'89353','','100_2320_thumb.jpg',130, 173,18,'																			photo_1255532.html');
												thumbnails[1255533] = new thumbnail(1255533,'89353','','100_2350_thumb.jpg',130, 173,18,'																			photo_1255533.html');
												thumbnails[1255534] = new thumbnail(1255534,'89353','','100_2322_thumb.jpg',130, 173,18,'																			photo_1255534.html');
												thumbnails[1255535] = new thumbnail(1255535,'89353','','100_2360_thumb.jpg',130, 98,18,'																			photo_1255535.html');
												thumbnails[1255537] = new thumbnail(1255537,'89353','','100_2355_thumb.jpg',130, 173,18,'																			photo_1255537.html');
												thumbnails[1255540] = new thumbnail(1255540,'89353','','IMG_1539_thumb.jpg',130, 195,18,'																			photo_1255540.html');
												thumbnails[1259883] = new thumbnail(1259883,'89353','','0051_thumb.jpg',130, 104,18,'																			photo_1259883.html');
												thumbnails[4019185] = new thumbnail(4019185,'89353','','0006_thumb.jpg',130, 194,18,'																			photo_4019185.html');
												thumbnails[4019188] = new thumbnail(4019188,'89353','','0011_thumb.jpg',130, 98,18,'																			photo_4019188.html');
												thumbnails[4019189] = new thumbnail(4019189,'89353','','0014_thumb.jpg',130, 197,18,'																			photo_4019189.html');
												thumbnails[4019191] = new thumbnail(4019191,'89353','','0021_thumb.jpg',130, 195,18,'																			photo_4019191.html');
												thumbnails[4019192] = new thumbnail(4019192,'89353','','0033_thumb.jpg',130, 173,18,'																			photo_4019192.html');
												thumbnails[4019193] = new thumbnail(4019193,'89353','','0058_thumb.jpg',130, 195,18,'																			photo_4019193.html');
												thumbnails[4019194] = new thumbnail(4019194,'88668','','0070_thumb.jpg',130, 87,18,'																			photo_4019194.html');
												thumbnails[4019195] = new thumbnail(4019195,'88668','','0094_thumb.jpg',130, 160,18,'																			photo_4019195.html');
												thumbnails[4019196] = new thumbnail(4019196,'88668','','0101_thumb.jpg',130, 87,18,'																			photo_4019196.html');
												thumbnails[4019198] = new thumbnail(4019198,'88668','','0112_thumb.jpg',130, 195,18,'																			photo_4019198.html');
												thumbnails[4019200] = new thumbnail(4019200,'88668','','0121_thumb.jpg',130, 104,18,'																			photo_4019200.html');
												thumbnails[4019201] = new thumbnail(4019201,'88668','','0129_thumb.jpg',130, 117,18,'																			photo_4019201.html');
												thumbnails[4019204] = new thumbnail(4019204,'88668','','135_thumb.jpg',130, 68,18,'																			photo_4019204.html');
												thumbnails[4019205] = new thumbnail(4019205,'88668','','140_thumb.jpg',130, 163,18,'																			photo_4019205.html');
												thumbnails[4019206] = new thumbnail(4019206,'88668','','0147_thumb.jpg',130, 163,18,'																			photo_4019206.html');
												thumbnails[4019207] = new thumbnail(4019207,'88668','','153_thumb.jpg',130, 117,18,'																			photo_4019207.html');
												thumbnails[4019209] = new thumbnail(4019209,'88668','','0185_thumb.jpg',130, 173,18,'																			photo_4019209.html');
												thumbnails[4019210] = new thumbnail(4019210,'88668','','0187_thumb.jpg',130, 173,18,'																			photo_4019210.html');
												thumbnails[4019211] = new thumbnail(4019211,'88668','','0218_thumb.jpg',130, 173,18,'																			photo_4019211.html');
												thumbnails[4019213] = new thumbnail(4019213,'88668','','0220_thumb.jpg',130, 94,18,'																			photo_4019213.html');
												thumbnails[4019214] = new thumbnail(4019214,'88668','','IMG_1819_thumb.jpg',130, 108,18,'																			photo_4019214.html');
												thumbnails[4019215] = new thumbnail(4019215,'88668','','IMG_1831_thumb.jpg',130, 188,18,'																			photo_4019215.html');
												thumbnails[4019218] = new thumbnail(4019218,'88668','','IMG_1840_thumb.jpg',130, 183,18,'																			photo_4019218.html');
												thumbnails[4019221] = new thumbnail(4019221,'88668','','IMG_1841_thumb.jpg',130, 97,18,'																			photo_4019221.html');
												thumbnails[4019222] = new thumbnail(4019222,'88668','','IMG_2070_thumb.jpg',130, 90,18,'																			photo_4019222.html');
												thumbnails[4019223] = new thumbnail(4019223,'88668','','IMG_2810_thumb.jpg',130, 98,18,'																			photo_4019223.html');
												thumbnails[1460718] = new thumbnail(1460718,'89494','','IMG_8272_21_thumb.jpg',130, 195,18,'																			photo_1460718.html');
												thumbnails[1460726] = new thumbnail(1460726,'89494','','IMG_8457_thumb.jpg',130, 195,18,'																			photo_1460726.html');
												thumbnails[1460728] = new thumbnail(1460728,'89494','','IMG_0280BW_thumb.jpg',130, 182,18,'																			photo_1460728.html');
												thumbnails[1460723] = new thumbnail(1460723,'89494','','IMG_8362SEP_thumb.jpg',130, 61,18,'																			photo_1460723.html');
												thumbnails[1460725] = new thumbnail(1460725,'89494','','IMG_9917bw_thumb.jpg',130, 67,18,'																			photo_1460725.html');
												thumbnails[1460720] = new thumbnail(1460720,'89494','','IMG_8190_22_thumb.jpg',130, 93,18,'																			photo_1460720.html');
												thumbnails[1460722] = new thumbnail(1460722,'89494','','IMG_8306BW_thumb.jpg',130, 89,18,'																			photo_1460722.html');
												thumbnails[1460727] = new thumbnail(1460727,'89494','','IMG_0224bwcol_thumb.jpg',130, 83,18,'																			photo_1460727.html');
												thumbnails[1255436] = new thumbnail(1255436,'89494','','IMG_8365_thumb.jpg',130, 75,18,'																			photo_1255436.html');
												thumbnails[2079762] = new thumbnail(2079762,'89494','','IMG_0856web_thumb.jpg',130, 90,18,'																			photo_2079762.html');
												thumbnails[2071499] = new thumbnail(2071499,'138409','','IMG_1815web_thumb.jpg',130, 158,18,'																			photo_2071499.html');
												thumbnails[2071500] = new thumbnail(2071500,'138409','','IMG_1879web_thumb.jpg',130, 144,18,'																			photo_2071500.html');
												thumbnails[2075374] = new thumbnail(2075374,'138409','','IMG_0558web_thumb.jpg',130, 91,18,'																			photo_2075374.html');
												thumbnails[4020768] = new thumbnail(4020768,'242664','','B71large_thumb.jpg',130, 182,18,'																			photo_4020768.html');
												thumbnails[1855103] = new thumbnail(1855103,'124868','','IMG_0131_thumb.jpg',130, 87,18,'																			photo_1855103.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[124868] = new gallery(124868,'1855103','Commercial','section163155',[1855103],0, 0, '', '																																																																																																																																	section163155.html',0,0);
				  					galleries[88668] = new gallery(88668,'4019223,4019222,4019221,4019218,4019215,4019214,4019213,4019211,4019210,4019209','Gallery 1','gallery',[4019194,4019195,4019196,4019198,4019200,4019201,4019204,4019205,4019206,4019207,4019209,4019210,4019211,4019213,4019214,4019215,4019218,4019221,4019222,4019223],0, 0, '', '																																																																																																							gallery_88668.html',0,0);
				  					galleries[138409] = new gallery(138409,'2075374,2071500,2071499','Pets','section178875',[2071499,2071500,2075374],0, 0, '', '																																																																																																																																	section178875.html',0,0);
				  					galleries[89494] = new gallery(89494,'2079762,1460728,1460727,1460726,1460725,1460723,1460722,1460720,1460718,1255436','Portrait','section121956',[1460718,1460726,1460728,1460723,1460725,1460720,1460722,1460727,1255436,2079762],0, 0, '', '																																																																																																																																	section121956.html',0,0);
				  					galleries[89353] = new gallery(89353,'4019193,4019192,4019191,4019189,4019188,4019185,1259883,1255540,1255537,1255535','Gallery 2','gallery',[1255496,1255497,1255499,1255500,1255503,1255504,1255506,1255524,1255525,1255526,1255527,1255528,1255529,1255531,1255532,1255533,1255534,1255535,1255537,1255540,1259883,4019185,4019188,4019189,4019191,4019192,4019193],0, 0, '', '																																																																																																							gallery_89353.html',0,0);
				  					galleries[89357] = new gallery(89357,'1255523,1255522','Gallery 3','gallery',[1255522,1255523],0, 0, '', '																																																																																																							gallery_89357.html',0,0);
				  					galleries[89359] = new gallery(89359,'1255515,1255514,1255513,1255512,1255510,1255467,1255466,1255464,1255463,1255462','Gallery 4','gallery',[1255450,1255456,1255459,1255461,1255462,1255463,1255464,1255466,1255467,1255510,1255512,1255513,1255514,1255515],0, 0, '', '																																																																																																							gallery_89359.html',0,0);
				  					galleries[242664] = new gallery(242664,'4020768','Schools','section294915',[4020768],0, 0, '', '																																																																																																																																	section294915.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '4019185';
imageSets[3] = '4020768,4019223,4019222,4019221,4019218,4019215,4019214,4019213,4019211,4019210,4019209,4019207,4019206,4019205,4019204,4019201,4019200,4019198,4019196,4019195,4019194,4019193,4019192,4019191,4019189,4019188,4019185,4019184,2079762,2075374,2071500,2071499,1855103,1460728,1460727,1460726,1460725,1460723,1460722,1460720,1460718,1259883,1255540,1255537,1255535,1255534,1255533,1255532,1255531,1255529';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/nickb007/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/nickb007/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/nickb007/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/nickb007/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/nickb007/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/nickb007/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/nickb007/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/nickb007/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/nickb007/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/nickb007/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/nickb007/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/nickb007/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/nickb007/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/nickb007/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/nickb007/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/nickb007/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/nickb007/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/nickb007/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/nickb007/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/nickb007/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/nickb007/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/nickb007/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 = 'Gautrey-Brawn 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));    }        
    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>';
	}
					
				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>Order this print:</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 + '<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;
	}
}

		

