window.thumbnails = new Object();
												thumbnails[2284668] = new thumbnail(2284668,'','','Mainwithcap1_thumb.jpg',130, 130,1,'#');
												thumbnails[5011877] = new thumbnail(5011877,'','','Chilli_Exclamation_thumb.jpg',130, 130,1,'#');
												thumbnails[882505] = new thumbnail(882505,'','FLOODED HALL','FloodedHall1.jpg',130, 130,1,'#');
												thumbnails[1512890] = new thumbnail(1512890,'','FRANCOUZSKA ULICE','10-graffiti(60mb)1.jpg',130, 130,1,'#');
												thumbnails[2025198] = new thumbnail(2025198,'','M.G.D.','Mainwithcap_thumb.jpg',130, 130,1,'#');
												thumbnails[882533] = new thumbnail(882533,'','PLEASE DON\'T OBSTRUCT','Disturb1.jpg',130, 130,1,'#');
												thumbnails[882715] = new thumbnail(882715,'','SELF PORTRAIT','Portrait1.jpg',130, 130,2,'#');
												thumbnails[882725] = new thumbnail(882725,'','WINE','Wine2.jpg',130, 130,1,'#');
												thumbnails[2055910] = new thumbnail(2055910,'','COMMUNAL POOL','snow_bench_thumb.jpg',130, 130,1,'#');
												thumbnails[882507] = new thumbnail(882507,'','EXIT','Exit1.jpg',130, 130,1,'#');
												thumbnails[882626] = new thumbnail(882626,'','AVON DESCENT FINISH','AvonDescent1.jpg',130, 130,1,'#');
												thumbnails[2047333] = new thumbnail(2047333,'','HAVE YOU SEEN LOVE','a4_hysl_500_thumb.jpg',130, 130,1,'#');
												thumbnails[882506] = new thumbnail(882506,'','FISH & CHIPS','Fishnchips1.jpg',130, 130,2,'#');
												thumbnails[882524] = new thumbnail(882524,'','HOME','Home1.jpg',130, 130,2,'#');
												thumbnails[2025261] = new thumbnail(2025261,'','TUNNEL','TRANNY0020_thumb.jpg',130, 130,1,'#');
												thumbnails[2047326] = new thumbnail(2047326,'','JESS','image_4_jess2_thumb.jpg',130, 130,1,'#');
												thumbnails[882712] = new thumbnail(882712,'','STUMP','Stump2.jpg',130, 130,1,'#');
												thumbnails[882627] = new thumbnail(882627,'','TAKE TO THE STAGE','TakeStage1.jpg',130, 130,1,'#');
												thumbnails[882687] = new thumbnail(882687,'','BINS','Bins1.jpg',130, 130,1,'#');
												thumbnails[2070288] = new thumbnail(2070288,'','CLEANER','18_thumb.jpg',130, 130,1,'#');
												thumbnails[882628] = new thumbnail(882628,'','THUMBS UP','ThumsUp2.jpg',130, 130,1,'#');
												thumbnails[882664] = new thumbnail(882664,'','THAI VILLAGE WOMAN','Villagelady1.jpg',130, 130,2,'#');
												thumbnails[882698] = new thumbnail(882698,'','LEEDERVILLE','Leederville1.jpg',130, 130,1,'#');
												thumbnails[2055915] = new thumbnail(2055915,'','RED PLAY EQUIPMENT','snow_red_thumb.jpg',130, 130,1,'#');
												thumbnails[882697] = new thumbnail(882697,'','LA PLAGE','LaPlage1.jpg',130, 130,1,'#');
												thumbnails[2025179] = new thumbnail(2025179,'','JEM & RUSS','_MG_6671_thumb.jpg',130, 130,1,'#');
												thumbnails[885166] = new thumbnail(885166,'','GAS FIRE','Fire1.jpg',130, 130,2,'#');
												thumbnails[2025231] = new thumbnail(2025231,'','PUNK COUPLE','TRANNY0007_thumb.jpg',130, 130,1,'#');
												thumbnails[882612] = new thumbnail(882612,'','AMY','Amy1.jpg',130, 130,1,'#');
												thumbnails[882700] = new thumbnail(882700,'','2 ARROWS','Murder1.jpg',130, 130,1,'#');
												thumbnails[1309721] = new thumbnail(1309721,'','LOWRI','LOWRI2.jpg',130, 130,1,'#');
												thumbnails[882682] = new thumbnail(882682,'','BUNKER BAY','BunkerBay2.jpg',130, 130,2,'#');
												thumbnails[1512885] = new thumbnail(1512885,'394721','PARIS','10-aerialview(60mb)1.jpg',130, 130,1,'photo_1512885.html');
												thumbnails[2025275] = new thumbnail(2025275,'394721','THAMES RIVER','THAMES_thumb.jpg',130, 130,1,'photo_2025275.html');
												thumbnails[4073544] = new thumbnail(4073544,'394728','MEN SELLING FISH','mensellingfish_thumb.jpg',130, 130,1,'photo_4073544.html');
												thumbnails[4077577] = new thumbnail(4077577,'394728','WOMAN & DOG','womananddog_thumb.jpg',130, 130,1,'photo_4077577.html');
												thumbnails[4125600] = new thumbnail(4125600,'394728','GIL','Gil_thumb.jpg',130, 130,1,'photo_4125600.html');
												thumbnails[5084974] = new thumbnail(5084974,'394728','JOSIE','Josie_Trout_thumb.jpg',130, 130,1,'photo_5084974.html');
												thumbnails[5128213] = new thumbnail(5128213,'394722','PATRICK','PAT_11_thumb.jpg',130, 130,1,'photo_5128213.html');
												thumbnails[5569852] = new thumbnail(5569852,'394728','MATT','Matt_01_thumb.jpg',130, 130,1,'photo_5569852.html');
												thumbnails[5706193] = new thumbnail(5706193,'394722','Cereal on the Common','ParkBench_500px_thumb.jpg',130, 130,1,'photo_5706193.html');
												thumbnails[7276161] = new thumbnail(7276161,'394722','GONE FISHING','GoneFishing500px_thumb.JPG',130, 130,1,'photo_7276161.html');
												thumbnails[1568723] = new thumbnail(1568723,'394728','END OF SHIFT','EARLSFIELD1.jpg',130, 130,1,'photo_1568723.html');
												thumbnails[3174583] = new thumbnail(3174583,'394728','TWO SKINT','SKINT_thumb.jpg',130, 130,1,'photo_3174583.html');
												thumbnails[5799214] = new thumbnail(5799214,'394722','Singin\' in London','Linds_Road_thumb.jpg',130, 130,1,'photo_5799214.html');
												thumbnails[882694] = new thumbnail(882694,'394721','GLASS WALL','GlassWall_thumb.jpg',130, 128,1,'photo_882694.html');
												thumbnails[1273038] = new thumbnail(1273038,'394721','HI','HI1.jpg',130, 130,1,'photo_1273038.html');
												thumbnails[2025256] = new thumbnail(2025256,'394721','KEINER MAG UNS','TRANNY0017_thumb.jpg',130, 130,1,'photo_2025256.html');
												thumbnails[882623] = new thumbnail(882623,'394728','PROTEST RALLY','Protest1.jpg',130, 130,1,'photo_882623.html');
												thumbnails[882701] = new thumbnail(882701,'394721','OVERPASS','Overpass1.jpg',130, 130,2,'photo_882701.html');
												thumbnails[1512883] = new thumbnail(1512883,'394728','RELEASE','9-loneman(60mb)1.jpg',130, 130,1,'photo_1512883.html');
												thumbnails[2025187] = new thumbnail(2025187,'394721','MAN IN FOG','1106_0454_thumb.jpg',130, 130,1,'photo_2025187.html');
												thumbnails[2025205] = new thumbnail(2025205,'394721','FUNNY IN LOVE','TRANNY0006_thumb.jpg',130, 130,1,'photo_2025205.html');
												thumbnails[2025235] = new thumbnail(2025235,'394721','ABOVE THE SUSHI BAR','Sushi_thumb.jpg',130, 130,1,'photo_2025235.html');
												thumbnails[882531] = new thumbnail(882531,'394721','FACE','Face1.jpg',130, 130,1,'photo_882531.html');
												thumbnails[882717] = new thumbnail(882717,'394728','NICK','Nick1.jpg',130, 130,2,'photo_882717.html');
												thumbnails[2025250] = new thumbnail(2025250,'394721','YELLOW BENCH','TRANNY0014_thumb.jpg',130, 130,1,'photo_2025250.html');
												thumbnails[2070149] = new thumbnail(2070149,'394728','MR. MOBILE','MrMobile_thumb.jpg',130, 130,1,'photo_2070149.html');
												thumbnails[7004738] = new thumbnail(7004738,'394728','STREET PHOTOGRAPHER','Canned_Soup_thumb.jpg',130, 130,1,'photo_7004738.html');
												thumbnails[2047329] = new thumbnail(2047329,'394728','MAL','a4_mal_thumb.jpg',130, 130,1,'photo_2047329.html');
												thumbnails[882714] = new thumbnail(882714,'394728','PAUL','Paul1.jpg',130, 130,2,'photo_882714.html');
												thumbnails[2055892] = new thumbnail(2055892,'394721','RED IS AN OVER RATED COLOUR','red_overrated_thumb.jpg',130, 130,1,'photo_2055892.html');
												thumbnails[882514] = new thumbnail(882514,'394721','TREE ST.','TreeSt1.jpg',130, 130,1,'photo_882514.html');
												thumbnails[1512868] = new thumbnail(1512868,'394728','TRY HARDER','1-tryharder(60mb)1.jpg',130, 130,1,'photo_1512868.html');
												thumbnails[1512877] = new thumbnail(1512877,'394721','IMPORTANT - YOU AND ME','4-meandyou(60mb)1.jpg',130, 130,1,'photo_1512877.html');
												thumbnails[2736269] = new thumbnail(2736269,'394721','Wait Here','Wait Red1_thumb.jpg',130, 130,1,'photo_2736269.html');
												thumbnails[882706] = new thumbnail(882706,'394721','RUNNERS','Runners1_thumb_thumb.jpg',130, 130,1,'photo_882706.html');
												thumbnails[2025178] = new thumbnail(2025178,'394728','BEGGAR','3-begger(60mb)_thumb.jpg',130, 130,1,'photo_2025178.html');
												thumbnails[882509] = new thumbnail(882509,'394728','CLIVE','CliveOfVauxhall1.jpg',130, 130,1,'photo_882509.html');
												thumbnails[882512] = new thumbnail(882512,'394721','SNOW DOG','SnowDog1.jpg',130, 130,1,'photo_882512.html');
												thumbnails[882696] = new thumbnail(882696,'394721','POST','LampPost1.jpg',130, 130,1,'photo_882696.html');
												thumbnails[882719] = new thumbnail(882719,'394728','CLIVE','Clive1.jpg',130, 130,2,'photo_882719.html');
												thumbnails[2056029] = new thumbnail(2056029,'394728','COMMUTERS','LB_FOG_thumb.jpg',130, 130,1,'photo_2056029.html');
												thumbnails[3227748] = new thumbnail(3227748,'394728','Curious','Brighton_thumb.jpg',130, 130,1,'photo_3227748.html');
												thumbnails[882686] = new thumbnail(882686,'394721','BALLOON','Balloon3.jpg',130, 130,1,'photo_882686.html');
												thumbnails[2120366] = new thumbnail(2120366,'394721','LOVERS','Lovers_thumb.jpg',130, 130,1,'photo_2120366.html');
												thumbnails[882703] = new thumbnail(882703,'394728','PUB MAN','PubMan1.jpg',130, 130,1,'photo_882703.html');
												thumbnails[2025264] = new thumbnail(2025264,'394728','CLAYRE','TRANNY0021_thumb.jpg',130, 130,1,'photo_2025264.html');
												thumbnails[4231475] = new thumbnail(4231475,'149985','','Liptons-Berry2_thumb.jpg',130, 130,1,'photo_4231475.html');
												thumbnails[4377619] = new thumbnail(4377619,'150022','','Spec01_thumb.jpg',130, 130,1,'photo_4377619.html');
												thumbnails[5128222] = new thumbnail(5128222,'149984','','PAT_2_thumb.jpg',130, 130,1,'photo_5128222.html');
												thumbnails[5926209] = new thumbnail(5926209,'150239','','HD_Dec_Choc_2_thumb.jpg',130, 130,1,'photo_5926209.html');
												thumbnails[4231472] = new thumbnail(4231472,'149985','','Liptons-Berry_thumb.jpg',130, 130,1,'photo_4231472.html');
												thumbnails[4377624] = new thumbnail(4377624,'150022','','Spec02_thumb.jpg',130, 130,1,'photo_4377624.html');
												thumbnails[5128224] = new thumbnail(5128224,'149984','','PAT_3_thumb.jpg',130, 130,1,'photo_5128224.html');
												thumbnails[5926198] = new thumbnail(5926198,'150239','','HD_Dec_Choc_thumb.jpg',130, 130,1,'photo_5926198.html');
												thumbnails[5128225] = new thumbnail(5128225,'149984','','PAT_4_thumb.jpg',130, 130,1,'photo_5128225.html');
												thumbnails[5128137] = new thumbnail(5128137,'149984','','PAT_1_thumb.jpg',130, 130,1,'photo_5128137.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[149984] = new gallery(149984,'5128137','Patrick','section192082',[5128222,5128224,5128225,5128137],0, 0, '', 'section192082_149984.html',0,0);
				  					galleries[149985] = new gallery(149985,'4231472','Tea Cup','section192082',[4231475,4231472],0, 0, '', 'section192082_149985.html',0,0);
				  					galleries[394728] = new gallery(394728,'3174583','People','gallery',[4073544,4077577,4125600,5084974,5569852,1568723,3174583,882623,1512883,882717,2070149,7004738,2047329,882714,1512868,2025178,882509,882719,2056029,3227748,882703,2025264],0, 0, '', 'gallery_394728.html',0,0);
				  					galleries[150022] = new gallery(150022,'4377624','Häagen-Dazs','section192082',[4377619,4377624],0, 0, '', 'section192082_150022.html',0,0);
				  					galleries[394721] = new gallery(394721,'2025256','Place','gallery',[1512885,2025275,882694,1273038,2025256,882701,2025187,2025205,2025235,882531,2025250,2055892,882514,1512877,2736269,882706,882512,882696,882686,2120366],0, 0, '', 'gallery_394721.html',0,0);
				  					galleries[394722] = new gallery(394722,'7276161,5799214,5706193,5128213','Create','gallery',[5128213,5706193,7276161,5799214],0, 0, '', 'gallery_394722.html',0,0);
				  					galleries[150239] = new gallery(150239,'5926198','Product','section192082',[5926209,5926198],0, 0, '', 'section192082_150239.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '7276161,5799214,5706193,5128137,5084974,4077577,4073544,3174583,2025250,2025187,1568723,882623';
imageSets[2] = '5926198,5128137,4377624,4231472,3174583,2284668,2025256';
imageSets[3] = '7276161,7004738,5926209,5926198,5799214,5706193,5569852,5128225,5128224,5128222,5128213,5128137,5084974,5011877,4377624,4377619,4231475,4231472,4125600,4077577,4073544,3227748,3174583,2736269,2284668,2120366,2070288,2070149,2056029,2055915,2055910,2055892,2047333,2047329,2047326,2025275,2025264,2025261,2025256,2025250,2025235,2025231,2025205,2025198,2025187,2025179,2025178,1568723,1512890,1512885';
imageSets[108635] = '5128137';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/rowanbutler/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/rowanbutler/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/rowanbutler/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/rowanbutler/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/rowanbutler/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/rowanbutler/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/rowanbutler/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/rowanbutler/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/rowanbutler/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/rowanbutler/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/rowanbutler/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/rowanbutler/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/rowanbutler/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/rowanbutler/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/rowanbutler/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/rowanbutler/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/rowanbutler/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/rowanbutler/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/rowanbutler/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/rowanbutler/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/rowanbutler/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/rowanbutler/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 = 'Rowan Butler 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>';
	}
					
				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;
	}
}

			

