window.thumbnails = new Object();
												thumbnails[791755] = new thumbnail(791755,'','Iain carving','Iain_carving_thumb.JPG',130, 98,15,'#');
												thumbnails[6996741] = new thumbnail(6996741,'','Acanthus carving','Acanthus_thumb.JPG',130, 173,15,'#');
												thumbnails[6996746] = new thumbnail(6996746,'','Jackie Carpenter, headstone detail.','Carpenter_detail_thumb.JPG',130, 70,15,'#');
												thumbnails[6996832] = new thumbnail(6996832,'','St Anne\'s house sign','St_Annes_thumb.jpg',130, 99,15,'#');
												thumbnails[7001225] = new thumbnail(7001225,'','Flame detail','Flame_detail1_thumb.JPG',130, 97,15,'#');
												thumbnails[7070163] = new thumbnail(7070163,'','Trajan','trajansmallwhite2_thumb.jpg',130, 83,15,'#');
												thumbnails[4371140] = new thumbnail(4371140,'','Mogg_detail','Mogg_detail_thumb.jpg',130, 173,15,'#');
												thumbnails[803142] = new thumbnail(803142,'','Bat Finial','Bat_Finial_thumb.jpg',130, 187,15,'#');
												thumbnails[803110] = new thumbnail(803110,'','Buried','Buried1_thumb.JPG',130, 173,15,'#');
												thumbnails[804756] = new thumbnail(804756,'','Angela_Appleby','Angela_Appleby21_thumb.jpg',130, 173,15,'#');
												thumbnails[804777] = new thumbnail(804777,'','Harry_Oldham','Harry_Oldham_detail1_thumb.jpg',130, 98,15,'#');
												thumbnails[804778] = new thumbnail(804778,'','Harry_Oldham','Harry_Oldham1_thumb.jpg',130, 194,15,'#');
												thumbnails[804788] = new thumbnail(804788,'','Keith_Spencer','Keith_Spencer1_thumb.jpg',130, 191,15,'#');
												thumbnails[804789] = new thumbnail(804789,'','Keith_Spencer_detail','Kieth_Spencer_detail1_thumb.jpg',130, 93,15,'#');
												thumbnails[804704] = new thumbnail(804704,'61466','Angela Appleby','Angela_Appleby_thumb.jpg',130, 173,15,'photo_804704.html');
												thumbnails[7001342] = new thumbnail(7001342,'61466','Harry Bishop','Bishop_thumb.JPG',130, 177,15,'photo_7001342.html');
												thumbnails[2756758] = new thumbnail(2756758,'61466','Jackie_Carpenter','Jackie_Carpenter_thumb.jpg',130, 173,15,'photo_2756758.html');
												thumbnails[2756749] = new thumbnail(2756749,'61466','Francis_De_Salis','Francis_de_Salis_thumb.jpg',130, 173,15,'photo_2756749.html');
												thumbnails[4371170] = new thumbnail(4371170,'61466','Dave_Mogg','Mogg_thumb.jpg',130, 173,15,'photo_4371170.html');
												thumbnails[7001216] = new thumbnail(7001216,'61466','Cowburn2','Cowburn_16A1225C-24E8-5EC4-4F17809B161894E0_thumb.jpg',130, 173,15,'photo_7001216.html');
												thumbnails[7001232] = new thumbnail(7001232,'61466','Mooney drawing','Mooney_drawing_thumb.jpg',130, 183,15,'photo_7001232.html');
												thumbnails[6996805] = new thumbnail(6996805,'61466','Still Born memorial','Mooney_thumb.JPG',130, 180,15,'photo_6996805.html');
												thumbnails[7001245] = new thumbnail(7001245,'61466','Mayhew2','Mayhew_16B0A6C3-24E8-5EC4-4FBAC9AFFBE8D00C_thumb.jpg',130, 193,15,'photo_7001245.html');
												thumbnails[7001223] = new thumbnail(7001223,'61466','Dore drawing','Dore_drawing_thumb.jpg',130, 179,15,'photo_7001223.html');
												thumbnails[7001343] = new thumbnail(7001343,'61466','Gordon Dore','Gordon_Dore1_thumb.JPG',130, 175,15,'photo_7001343.html');
												thumbnails[6996795] = new thumbnail(6996795,'61466','Gordon Dore, reverse detail','Gordon_Dore_Reverse_Detail_thumb.jpg',130, 97,15,'photo_6996795.html');
												thumbnails[6996747] = new thumbnail(6996747,'61466','Celtic Cross Carving','Celtic_Cross_thumb.JPG',130, 132,15,'photo_6996747.html');
												thumbnails[2756759] = new thumbnail(2756759,'61466','Julian_Miles','Julian_Miles_thumb.jpg',130, 173,15,'photo_2756759.html');
												thumbnails[804774] = new thumbnail(804774,'61466','Freya_&_Ellen','Freya_&_Ellen_Pearcey1_thumb.jpg',130, 173,15,'photo_804774.html');
												thumbnails[804791] = new thumbnail(804791,'61466','Mark_Randall','Mark_Randall1_thumb.jpg',130, 173,15,'photo_804791.html');
												thumbnails[804779] = new thumbnail(804779,'61466','Iain_North','Iain_North1_thumb.jpg',130, 93,15,'photo_804779.html');
												thumbnails[7001228] = new thumbnail(7001228,'61466','Keane','Keane_thumb.JPG',130, 97,15,'photo_7001228.html');
												thumbnails[7001221] = new thumbnail(7001221,'61466','Diprose','Diprose_thumb.JPG',130, 99,15,'photo_7001221.html');
												thumbnails[4371119] = new thumbnail(4371119,'61466','Dads','Dads_thumb.jpg',130, 98,15,'photo_4371119.html');
												thumbnails[6996804] = new thumbnail(6996804,'61466','Hawkins','Hawkins_thumb.JPG',130, 97,15,'photo_6996804.html');
												thumbnails[6996743] = new thumbnail(6996743,'61537','Bramley House','Bramley_House_thumb.jpg',130, 65,15,'photo_6996743.html');
												thumbnails[804174] = new thumbnail(804174,'61537','Three Pines','House_Name_thumb.jpg',130, 86,15,'photo_804174.html');
												thumbnails[6996835] = new thumbnail(6996835,'61537','The Tallet','The_Tallet_thumb.JPG',130, 99,15,'photo_6996835.html');
												thumbnails[7058143] = new thumbnail(7058143,'61537','Clevelys','Clevelys_thumb.jpg',130, 61,15,'photo_7058143.html');
												thumbnails[6996839] = new thumbnail(6996839,'61537','Warleigh Point','Warleigh_Point_thumb.JPG',130, 94,15,'photo_6996839.html');
												thumbnails[2785288] = new thumbnail(2785288,'61537','Date_Stone','Date_Stone_thumb.jpg',130, 96,15,'photo_2785288.html');
												thumbnails[7368531] = new thumbnail(7368531,'379135','Love Cube. A Valentines Day gift','Love.L_thumb.jpg',130, 133,15,'photo_7368531.html');
												thumbnails[7368534] = new thumbnail(7368534,'379135','Love Cube. A Valentines Day gift','Love.O.Alabaster_thumb.jpg',130, 129,15,'photo_7368534.html');
												thumbnails[7368536] = new thumbnail(7368536,'379135','Love Cube. A Valentines Day gift','Love.V.Alabaster_thumb.jpg',130, 130,15,'photo_7368536.html');
												thumbnails[7368215] = new thumbnail(7368215,'379135','Love Cube. A Valentines Day gift','Love.E.Alabaster_thumb.jpg',130, 132,15,'photo_7368215.html');
												thumbnails[7368139] = new thumbnail(7368139,'379135','A valentines day commission ','Lias_thumb.jpg',130, 100,15,'photo_7368139.html');
												thumbnails[7368192] = new thumbnail(7368192,'379135','Valentines day gift','SI_thumb.jpg',130, 132,15,'photo_7368192.html');
												thumbnails[6996792] = new thumbnail(6996792,'379135','G & K','GK_thumb.JPG',130, 173,15,'photo_6996792.html');
												thumbnails[7001422] = new thumbnail(7001422,'379135','2000 years','2000_years_thumb.jpg',130, 130,15,'photo_7001422.html');
												thumbnails[6996836] = new thumbnail(6996836,'379135','To Have and to Hold','To_Have__to_Hold_thumb.jpg',130, 96,15,'photo_6996836.html');
												thumbnails[4371135] = new thumbnail(4371135,'379135','Grace','Grace_thumb.jpg',130, 179,15,'photo_4371135.html');
												thumbnails[2756757] = new thumbnail(2756757,'379135','Birth stone','God_has_heard_thumb.jpg',130, 98,15,'photo_2756757.html');
												thumbnails[7001229] = new thumbnail(7001229,'379135','Marnie','Marnie_thumb.JPG',130, 102,15,'photo_7001229.html');
												thumbnails[791900] = new thumbnail(791900,'379135','valentine Gift','valentine_thumb.jpg',130, 129,15,'photo_791900.html');
												thumbnails[804148] = new thumbnail(804148,'379135','Birthday','Birthday_thumb.jpg',130, 98,15,'photo_804148.html');
												thumbnails[804171] = new thumbnail(804171,'379135','Poetry Award','Poetry_Award_thumb.jpg',130, 149,15,'photo_804171.html');
												thumbnails[1295342] = new thumbnail(1295342,'382647','Light My Path','Light_My_Path_thumb.jpg',130, 173,15,'photo_1295342.html');
												thumbnails[7001226] = new thumbnail(7001226,'382647','Flame Design','Flame_drawing_thumb.jpg',130, 179,15,'photo_7001226.html');
												thumbnails[4371123] = new thumbnail(4371123,'382647','Flame','Flame_thumb.jpg',130, 173,15,'photo_4371123.html');
												thumbnails[6996788] = new thumbnail(6996788,'382647','Flame detail','Flame_Detail_thumb.jpg',130, 173,15,'photo_6996788.html');
												thumbnails[7068009] = new thumbnail(7068009,'382647','The Fallen, detail','The_Fallen_3_copy_thumb.jpg',130, 195,15,'photo_7068009.html');
												thumbnails[3135825] = new thumbnail(3135825,'382647','The Fallen','The_Fallen_thumb.jpg',130, 87,15,'photo_3135825.html');
												thumbnails[6996808] = new thumbnail(6996808,'382647','Mottisfont Abbey Bear','Mottisfont_Bear_thumb.jpg',130, 113,15,'photo_6996808.html');
												thumbnails[6996823] = new thumbnail(6996823,'382647','New Head for Pan','Pan_thumb.jpg',130, 200,15,'photo_6996823.html');
												thumbnails[6996751] = new thumbnail(6996751,'382647','Five Arrows relief','Five_Arrows_Relief_thumb.JPG',130, 124,15,'photo_6996751.html');
												thumbnails[6996748] = new thumbnail(6996748,'382647','Five Arrows Relief, Cherub detail','Chereb_thumb.JPG',130, 173,15,'photo_6996748.html');
												thumbnails[6996833] = new thumbnail(6996833,'382647','Corinthian Capital, detail','Stowe_Cap_thumb.jpg',130, 173,15,'photo_6996833.html');
												thumbnails[6996750] = new thumbnail(6996750,'382647','Dauntsey\'s Bat','Dauntseys_Bat_thumb.JPG',130, 187,15,'photo_6996750.html');
												thumbnails[7368199] = new thumbnail(7368199,'379149','Hope. Purbeck stone','Hope.H.Purbeck_thumb.jpg',130, 131,15,'photo_7368199.html');
												thumbnails[7368212] = new thumbnail(7368212,'379149','Hope. Purbeck stone','Hope.O.Purbeck_thumb.jpg',130, 123,15,'photo_7368212.html');
												thumbnails[7368553] = new thumbnail(7368553,'379149','Hope. Purbeck stone','Hope.P.Purbeck1_thumb.jpg',130, 130,15,'photo_7368553.html');
												thumbnails[7368539] = new thumbnail(7368539,'379149','Hope. Purbeck stone','Hope.E.Purbeck_thumb.jpg',130, 130,15,'photo_7368539.html');
												thumbnails[2784199] = new thumbnail(2784199,'63537','River_Underground','River_Underground_thumb.jpg',130, 93,15,'photo_2784199.html');
												thumbnails[4371087] = new thumbnail(4371087,'256855','Art ','Art_thumb.jpg',130, 96,15,'photo_4371087.html');
												thumbnails[4371176] = new thumbnail(4371176,'379149','Gift','Word_Sculpture_1_thumb.jpg',130, 114,15,'photo_4371176.html');
												thumbnails[7058134] = new thumbnail(7058134,'256855','Drawn','Drawn_thumb.jpg',130, 161,15,'photo_7058134.html');
												thumbnails[2784149] = new thumbnail(2784149,'63537','River_Underground.2','River_Underground_thumb.2.jpg',130, 98,15,'photo_2784149.html');
												thumbnails[4371174] = new thumbnail(4371174,'256855','Walk The Line','Walk_The_Line_thumb.jpg',130, 173,15,'photo_4371174.html');
												thumbnails[6996830] = new thumbnail(6996830,'379149','Velo/love','Small_Velo_thumb.JPG',130, 121,15,'photo_6996830.html');
												thumbnails[2784197] = new thumbnail(2784197,'63537','River_Underground.3','River_underground_thumb.3.jpg',130, 98,15,'photo_2784197.html');
												thumbnails[6996837] = new thumbnail(6996837,'379149','Large Velo/Love','Velo_Love__thumb.JPG',130, 129,15,'photo_6996837.html');
												thumbnails[4371137] = new thumbnail(4371137,'256855','Light Stone Word','Light_Stone_Word_thumb.jpg',130, 42,15,'photo_4371137.html');
												thumbnails[2784202] = new thumbnail(2784202,'63537','Somerset_Cup','Somerset_Cup1_thumb.jpg',130, 98,15,'photo_2784202.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[382647] = new gallery(382647,'7068009,7001226,6996833,6996823,6996808,6996788,6996751,6996750,6996748,4371123','larger commissions','section455150',[1295342,7001226,4371123,6996788,7068009,3135825,6996808,6996823,6996751,6996748,6996833,6996750],0, 1, '', 'section455150.html',0,1);
				  					galleries[256855] = new gallery(256855,'7058134,4371174,4371137,4371087','Word Sculpture','section92113',[4371087,7058134,4371174,4371137],0, 1, '', 'section92113_256855.html',0,0);
				  					galleries[379149] = new gallery(379149,'7368553,7368539,7368212,7368199,6996837,6996830,4371176','Four Letter words - Being Human ','section92113',[7368199,7368212,7368553,7368539,4371176,6996830,6996837],0, 1, '', 'section92113_379149.html',0,0);
				  					galleries[379135] = new gallery(379135,'7368536,7368534,7368531,7368215,7368192,7368139,7001422,7001229,6996836,6996792','gifts','section451111',[7368531,7368534,7368536,7368215,7368139,7368192,6996792,7001422,6996836,4371135,2756757,7001229,791900,804148,804171],0, 1, '', 'section451111.html',0,1);
				  					galleries[61537] = new gallery(61537,'7058143,6996839,6996835,6996743,2785288,804174','House Signs','section89399',[6996743,804174,6996835,7058143,6996839,2785288],0, 1, '', 'section89399.html',0,1);
				  					galleries[61466] = new gallery(61466,'7001343,7001342,7001245,7001232,7001228,7001223,7001221,7001216,6996805,6996804','Memorials','gallery',[804704,7001342,2756758,2756749,4371170,7001216,7001232,6996805,7001245,7001223,7001343,6996795,6996747,2756759,804774,804791,804779,7001228,7001221,4371119,6996804],0, 1, '', 'gallery.html',0,1);
				  					galleries[63537] = new gallery(63537,'2784202,2784199,2784197,2784149','Radford Landscapes','section92113',[2784199,2784149,2784197,2784202],0, 1, '', 'section92113_63537.html',0,0);
				  					galleries[398863] = new gallery(398863,'','Valentines day','section475200',[],0, 1, '', 'section475200.html',0,1);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '7001343,7001245,7001228,7001225,7001216,6996839,6996837,6996835,6996805,6996795,6996792,6996743,4371135,4371123,4371119,2756758,2756757,2756749,804779,804704,791755';
imageSets[3] = '6996792';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/iaincotton/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/iaincotton/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/iaincotton/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/iaincotton/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/iaincotton/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/iaincotton/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/iaincotton/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/iaincotton/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/iaincotton/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/iaincotton/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/iaincotton/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/iaincotton/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/iaincotton/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/iaincotton/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/iaincotton/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/iaincotton/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/iaincotton/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/iaincotton/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/iaincotton/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/iaincotton/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/iaincotton/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/iaincotton/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 = 'IAIN COTTON      making stones speak  : ' + 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>';
	}
					
				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> ' + (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;
	}
}

			

