window.thumbnails = new Object();
												thumbnails[7156348] = new thumbnail(7156348,'386795','Cromer Pier Sunset','cromerpiersunset2_thumb.jpg',160, 120,32,'							photo_7156348.html');
												thumbnails[7156753] = new thumbnail(7156753,'386858','Ambleside Falls','amblesidefalls_thumb.jpg',160, 120,32,'							photo_7156753.html');
												thumbnails[7156974] = new thumbnail(7156974,'386807','Rush Out of Manhattan','rushoutofmanhatten1_thumb.jpg',160, 120,32,'							photo_7156974.html');
												thumbnails[7156349] = new thumbnail(7156349,'386795','Happisburgh Dawn','happisburghdawn1_thumb.jpg',160, 120,32,'							photo_7156349.html');
												thumbnails[7156351] = new thumbnail(7156351,'386792','The Sancutary Suite','thesanctuarysuite21_thumb.jpg',160, 120,32,'							photo_7156351.html');
												thumbnails[7156360] = new thumbnail(7156360,'386808','Brooklyn Bridge','brooklynbridgepanoramic1_thumb.jpg',160, 67,32,'							photo_7156360.html');
												thumbnails[7156801] = new thumbnail(7156801,'386806','Ponte Vecchio','pontevecchio_thumb.jpg',160, 120,32,'							photo_7156801.html');
												thumbnails[7156820] = new thumbnail(7156820,'386795','Bluebell Woods','bluebellwoods1_thumb.jpg',160, 120,32,'							photo_7156820.html');
												thumbnails[7156834] = new thumbnail(7156834,'386808','Happisburgh Motion','happisburghmotion1_thumb.jpg',160, 67,32,'							photo_7156834.html');
												thumbnails[7157036] = new thumbnail(7157036,'386877','Sheringham Station','sheringhamstation2_thumb.jpg',160, 120,32,'							photo_7157036.html');
												thumbnails[7156845] = new thumbnail(7156845,'386808','Horsey Windpump','horseywindpumpsunset1_thumb.jpg',160, 67,32,'							photo_7156845.html');
												thumbnails[7156850] = new thumbnail(7156850,'386808','Millennium Bridge','millenniumbrdgepanormaic1_thumb.jpg',160, 67,32,'							photo_7156850.html');
												thumbnails[7156370] = new thumbnail(7156370,'386792','The Sancutary Suite','thesanctuarysuite1_thumb.jpg',160, 120,32,'							photo_7156370.html');
												thumbnails[7156758] = new thumbnail(7156758,'386858','Blea Tarn','bleatarn_thumb.jpg',160, 120,32,'							photo_7156758.html');
												thumbnails[7156897] = new thumbnail(7156897,'386808','Manhattan Skyline','manhattenskyline1_thumb.jpg',160, 67,32,'							photo_7156897.html');
												thumbnails[7157011] = new thumbnail(7157011,'386877','Bintree Mill','bintreemill_thumb.jpg',160, 120,32,'							photo_7157011.html');
												thumbnails[7156766] = new thumbnail(7156766,'386795','Ghostly Brograve','ghostlybrograve1_thumb.jpg',160, 120,32,'							photo_7156766.html');
												thumbnails[7156902] = new thumbnail(7156902,'386808','Felbrigg Hall','felbrigghallpanoramic1_thumb.jpg',160, 67,32,'							photo_7156902.html');
												thumbnails[7156380] = new thumbnail(7156380,'386792','The Sancutary Suite Bathroom','thesanctuarysuitebathroom1_thumb.jpg',160, 120,32,'							photo_7156380.html');
												thumbnails[7156806] = new thumbnail(7156806,'386807','Brooklyn Bridge','brooklynbridge1_thumb.jpg',160, 120,32,'							photo_7156806.html');
												thumbnails[7156966] = new thumbnail(7156966,'386807','Times Square','timessqaure_thumb.jpg',160, 120,32,'							photo_7156966.html');
												thumbnails[7157031] = new thumbnail(7157031,'386877','In Remembrance Of','inremembranceof.._thumb.jpg',160, 120,32,'							photo_7157031.html');
												thumbnails[7156387] = new thumbnail(7156387,'386792','Palazzo Giovanelli Presidential Suite','HotelPalazzoGiovanelli31_thumb.jpg',160, 120,32,'							photo_7156387.html');
												thumbnails[7156946] = new thumbnail(7156946,'386806','Domes of the Basilica of San Marco','DomesoftheBasilicaofSanMarco1_thumb.jpg',160, 120,32,'							photo_7156946.html');
												thumbnails[7157002] = new thumbnail(7157002,'386877','Ghostly Kettlestone Church','ghostlykettlestonechurch_thumb.jpg',130, 200,32,'							photo_7157002.html');
												thumbnails[7156394] = new thumbnail(7156394,'386792','Palazzo Giovanelli Presidential Suite','HotelPalazzoGiovanelli1_thumb.jpg',160, 120,32,'							photo_7156394.html');
												thumbnails[7156812] = new thumbnail(7156812,'386795','Cromer Pier by Night','cromerpierbynight_thumb.jpg',160, 120,32,'							photo_7156812.html');
												thumbnails[7157025] = new thumbnail(7157025,'386877','High Def Flower','highdefflower_thumb.jpg',130, 200,32,'							photo_7157025.html');
												thumbnails[7157080] = new thumbnail(7157080,'386806','View on to the Lagoon from the Rialto Bridge','viewontothelagoonfromtherialtobridge_thumb.jpg',160, 120,32,'							photo_7157080.html');
												thumbnails[7156359] = new thumbnail(7156359,'386795','Cromer Sunset','cromersunset_thumb.jpg',160, 120,32,'							photo_7156359.html');
												thumbnails[7156414] = new thumbnail(7156414,'386792','Palazzo Giovanelli Presidential Suite','HotelPalazzoGiovanelli21_thumb.jpg',160, 120,32,'							photo_7156414.html');
												thumbnails[7156876] = new thumbnail(7156876,'386858','Millennium Bridge by Night','milenniumbridgebynight_thumb.jpg',160, 120,32,'							photo_7156876.html');
												thumbnails[7156953] = new thumbnail(7156953,'386858','Millennium Bridge by Night','Millenniumbridgebynightnewcastle_thumb.jpg',160, 120,32,'							photo_7156953.html');
												thumbnails[7157018] = new thumbnail(7157018,'386877','Forgotten','forgotten_thumb.jpg',130, 200,32,'							photo_7157018.html');
												thumbnails[7156476] = new thumbnail(7156476,'386792','Radisson Edwardian Bloomsbury Street Suite','radissonedwardianbloomsburystreetsuite_thumb.jpg',160, 120,32,'							photo_7156476.html');
												thumbnails[7156484] = new thumbnail(7156484,'386792','Radisson Edwardian Bloomsbury Street Suite','radissonedwardianbloomsburystreetsuitebedroom_thumb.jpg',160, 120,32,'							photo_7156484.html');
												thumbnails[7156489] = new thumbnail(7156489,'386792','Radisson Edwardian Bloomsbury Street Suite','radissonedwardianbloomsburystreetsuite3_thumb.jpg',160, 120,32,'							photo_7156489.html');
												thumbnails[7156420] = new thumbnail(7156420,'386792','Park Plaza Westminster Bridge','parkplazawestminsterbridge31_thumb.jpg',160, 120,32,'							photo_7156420.html');
												thumbnails[7156867] = new thumbnail(7156867,'386795','Felbrigg Hall Grounds','felbrigghallgrounds_thumb.jpg',160, 120,32,'							photo_7156867.html');
												thumbnails[7156978] = new thumbnail(7156978,'386808','New York, New York','newyorknewyork_thumb.jpg',160, 67,32,'							photo_7156978.html');
												thumbnails[7157058] = new thumbnail(7157058,'386877','Sheringham Station','sheringhamstation_thumb.jpg',130, 200,32,'							photo_7157058.html');
												thumbnails[7156461] = new thumbnail(7156461,'386792','Park Plaza Westminster Bridge','parkplazawestminsterbridge21_thumb.jpg',160, 120,32,'							photo_7156461.html');
												thumbnails[7157055] = new thumbnail(7157055,'386877','Ullswater Jetty','ullswaterjetty_thumb.jpg',130, 200,32,'							photo_7157055.html');
												thumbnails[7157072] = new thumbnail(7157072,'386808','View from the Tyne Bridge','viewfromthetynebridge_thumb.jpg',160, 67,32,'							photo_7157072.html');
												thumbnails[7156464] = new thumbnail(7156464,'386792','Park Plaza Westminster Bridge','parkplazawestminsterbridge1_thumb.jpg',160, 120,32,'							photo_7156464.html');
												thumbnails[7157048] = new thumbnail(7157048,'386795','Felbrigg Hall','felbrigghall_thumb.jpg',160, 120,32,'							photo_7157048.html');
												thumbnails[7156466] = new thumbnail(7156466,'386792','Radisson Edwardian Bloomsbury Street Deluxe Room','radissonedwardianbloomsburystreetdeluxeroom_thumb.jpg',160, 120,32,'							photo_7156466.html');
												thumbnails[7157064] = new thumbnail(7157064,'386877','Wells Beach Hut','wellsbeachhut_thumb.jpg',130, 200,32,'							photo_7157064.html');
												thumbnails[7156501] = new thumbnail(7156501,'386792','Hotel Mela Executive Room','hotelmela_thumb.jpg',160, 120,32,'							photo_7156501.html');
												thumbnails[7156518] = new thumbnail(7156518,'386792','Hotel Mela Executive Room','hotelmela3_thumb.jpg',160, 120,32,'							photo_7156518.html');
												thumbnails[7156552] = new thumbnail(7156552,'386792','Hotel Savoia and Jolanda','HotelSavoiaandJolanda2_thumb.jpg',160, 120,32,'							photo_7156552.html');
												thumbnails[7156555] = new thumbnail(7156555,'386792','Hotel Savoia and Jolanda','HotelSavoiaandJolanda_thumb.jpg',160, 120,32,'							photo_7156555.html');
												thumbnails[7156567] = new thumbnail(7156567,'386792','Old Town Square Hotel','oldtownsquarehotel3_thumb.jpg',160, 120,32,'							photo_7156567.html');
												thumbnails[7156575] = new thumbnail(7156575,'386792','Old Town Square Hotel','oldtownsquarehotel_thumb.jpg',160, 120,32,'							photo_7156575.html');
												thumbnails[7156590] = new thumbnail(7156590,'386792','The Cranleigh Hotel Luxury Room','luxuryroomatthecranleigh_thumb.jpg',160, 120,32,'							photo_7156590.html');
												thumbnails[7156598] = new thumbnail(7156598,'386792','The Cranleigh Hotel Luxury Room','luxuryroomatthecranleigh3_thumb.jpg',160, 120,32,'							photo_7156598.html');
												thumbnails[7156608] = new thumbnail(7156608,'386792','Park Plaza County Hall','parkplazacountyhall_thumb.jpg',160, 120,32,'							photo_7156608.html');
												thumbnails[7156648] = new thumbnail(7156648,'386792','Radisson Blu Hotel','radissonbluhotelstanstedjunior_thumb.jpg',160, 120,32,'							photo_7156648.html');
												thumbnails[7156473] = new thumbnail(7156473,'386792','Radisson Blu Hotel','radissonbluhotelstanstedbuisness_thumb.jpg',160, 120,32,'							photo_7156473.html');
												thumbnails[7156624] = new thumbnail(7156624,'386792','Heacham Manor Room 7','room7heachammanorhotel2_thumb.jpg',160, 120,32,'							photo_7156624.html');
												thumbnails[7156628] = new thumbnail(7156628,'386792','Heacham Manor Room 7','room7heachammanorhotel_thumb.jpg',160, 120,32,'							photo_7156628.html');
												thumbnails[7156656] = new thumbnail(7156656,'386792','Heacham Manor Room 10','room10heachammanorhotel_thumb.jpg',160, 120,32,'							photo_7156656.html');
												thumbnails[7156740] = new thumbnail(7156740,'386792','Heacham Manor Room 10','room10heachammanorhotel2_thumb.jpg',160, 120,32,'							photo_7156740.html');
												thumbnails[7156744] = new thumbnail(7156744,'386792','Heacham Manor Resaurant','therestaurantheachammanor_thumb.jpg',160, 120,32,'							photo_7156744.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[386800] = new gallery(386800,'7157080,7157072,7157064,7157058,7157055,7157048,7157036,7157031,7157025,7157018','Landscapes','gallery',[],0, 0, '', '																																																																																																							gallery_386800.html',0,0);
				  					galleries[386795] = new gallery(386795,'7157048,7156867,7156820,7156812,7156766,7156359,7156349,7156348','Norfolk','gallery',[7156348,7156349,7156820,7156766,7156812,7156359,7156867,7157048],0, 0, '386800', '																																																																																																							gallery_386795.html',0,0);
				  					galleries[386858] = new gallery(386858,'7156953,7156876,7156758,7156753','Other UK','gallery',[7156753,7156758,7156876,7156953],0, 0, '386800', '																																																																																																							gallery_386858.html',0,0);
				  					galleries[386792] = new gallery(386792,'7156744,7156740,7156656,7156648,7156628,7156624,7156608,7156598,7156590,7156575','Property/Hotel','gallery',[7156351,7156370,7156380,7156387,7156394,7156414,7156476,7156484,7156489,7156420,7156461,7156464,7156466,7156501,7156518,7156552,7156555,7156567,7156575,7156590,7156598,7156608,7156648,7156473,7156624,7156628,7156656,7156740,7156744],0, 0, '', '																																																																																																							gallery_386792.html',0,0);
				  					galleries[386806] = new gallery(386806,'7157080,7156946,7156801','Europe','gallery',[7156801,7156946,7157080],0, 0, '386800', '																																																																																																							gallery_386806.html',0,0);
				  					galleries[386807] = new gallery(386807,'7156974,7156966,7156806','U.S.A','gallery',[7156974,7156806,7156966],0, 0, '386800', '																																																																																																							gallery_386807.html',0,0);
				  					galleries[386808] = new gallery(386808,'7157072,7156978,7156902,7156897,7156850,7156845,7156834,7156360','Panoramics','gallery',[7156360,7156834,7156845,7156850,7156897,7156902,7156978,7157072],0, 0, '386800', '																																																																																																							gallery_386808.html',0,0);
				  					galleries[386877] = new gallery(386877,'7157064,7157058,7157055,7157036,7157031,7157025,7157018,7157011,7157002','HDR','gallery',[7157036,7157011,7157031,7157002,7157025,7157018,7157058,7157055,7157064],0, 0, '386800', '																																																																																																							gallery_386877.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '7157080,7157072,7157064,7157058,7157055,7157048,7157036,7157031,7157025,7157018,7157011,7157002,7156978,7156974,7156966,7156953,7156946,7156902,7156897,7156876,7156867,7156850,7156845,7156834,7156820,7156812,7156806,7156801,7156766,7156758,7156753,7156744,7156740,7156656,7156648,7156628,7156624,7156608,7156598,7156590,7156575,7156567,7156555,7156552,7156518,7156501,7156489,7156484,7156476,7156473';
imageSets[3] = '7157080,7157072,7157064,7157058,7157055,7157048,7157036,7157031,7157025,7157018,7157011,7157002,7156978,7156974,7156966,7156953,7156946,7156902,7156897,7156876,7156867,7156850,7156845,7156834,7156820,7156812,7156806,7156801,7156766,7156758,7156753,7156744,7156740,7156656,7156648,7156628,7156624,7156608,7156598,7156590,7156575,7156567,7156555,7156552,7156518,7156501,7156489,7156484,7156476,7156473';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/simon83/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/simon83/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/simon83/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/simon83/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://www.clikchurch.com/simon83/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/simon83/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/simon83/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/simon83/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/simon83/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/simon83/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/simon83/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/simon83/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/simon83/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/simon83/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/simon83/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/simon83/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/simon83/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/simon83/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/simon83/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/simon83/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/simon83/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 = 'Simon Fisher 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>';
	}
					
	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>Purchase print</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="SIMON83">';
		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;
	}
}

			

