window.thumbnails = new Object();
												thumbnails[791980] = new thumbnail(791980,'','','AU0294MANLY2_024_thumb.jpg',130, 187,1,'#');
												thumbnails[791994] = new thumbnail(791994,'','','AU0294MANLY3_003_thumb.jpg',130, 177,1,'#');
												thumbnails[820438] = new thumbnail(820438,'','','AU0294MANLY3_005_thumb.jpg',130, 135,1,'#');
												thumbnails[820441] = new thumbnail(820441,'','','AU0294MANLY3_036_thumb.jpg',130, 181,1,'#');
												thumbnails[820443] = new thumbnail(820443,'',' ','AU0294MANLY3_006_thumb.jpg',130, 100,1,'#');
												thumbnails[1771339] = new thumbnail(1771339,'','','AU0294MANLY1_035_thumb.jpg',130, 110,1,'#');
												thumbnails[5742487] = new thumbnail(5742487,'','','agriculture_thumb.jpg',130, 21,1,'#');
												thumbnails[5742488] = new thumbnail(5742488,'','','beach_thumb.jpg',130, 21,1,'#');
												thumbnails[5742490] = new thumbnail(5742490,'','','turkey_thumb.jpg',130, 21,1,'#');
												thumbnails[5742491] = new thumbnail(5742491,'','','nature_thumb.jpg',130, 21,1,'#');
												thumbnails[5742495] = new thumbnail(5742495,'','','italy_thumb.jpg',130, 21,1,'#');
												thumbnails[5750301] = new thumbnail(5750301,'','','market_thumb.jpg',130, 21,1,'#');
												thumbnails[5757529] = new thumbnail(5757529,'','','shutterstock_logo_thumb.JPG',130, 31,1,'#');
												thumbnails[5757998] = new thumbnail(5757998,'','','istock_logo_thumb.jpg',130, 31,1,'#');
												thumbnails[5758083] = new thumbnail(5758083,'','','demotix_logo_thumb.jpg',130, 31,1,'#');
												thumbnails[5805125] = new thumbnail(5805125,'','','agriculture_sm_thumb.jpg',130, 21,1,'#');
												thumbnails[5805127] = new thumbnail(5805127,'','','beach_sm_thumb.jpg',130, 21,1,'#');
												thumbnails[5805129] = new thumbnail(5805129,'','','italy_sm_thumb.jpg',130, 21,1,'#');
												thumbnails[5805130] = new thumbnail(5805130,'','','market_sm_thumb.jpg',130, 21,1,'#');
												thumbnails[5805131] = new thumbnail(5805131,'','','nature_sm_thumb.jpg',130, 21,1,'#');
												thumbnails[5805132] = new thumbnail(5805132,'','','turkey_sm_thumb.jpg',130, 21,1,'#');
												thumbnails[7125803] = new thumbnail(7125803,'','france banner large','france_thumb.jpg',130, 21,1,'#');
												thumbnails[7125811] = new thumbnail(7125811,'','france banner small','france_sm_thumb.jpg',130, 21,1,'#');
												thumbnails[7126039] = new thumbnail(7126039,'','mexico banner large','mexico_thumb.jpg',130, 21,1,'#');
												thumbnails[7126041] = new thumbnail(7126041,'','mexico banner small','mexico_sm_thumb.jpg',130, 21,1,'#');
												thumbnails[6494847] = new thumbnail(6494847,'346005','Jacques et Omelette','DE0810KOBL2_034_thumb.jpg',72, 100,1,'photo_6494847.html');
												thumbnails[6494843] = new thumbnail(6494843,'346005','Monsieur Culbuto','DE0810KOBL1_059_thumb.jpg',130, 93,1,'photo_6494843.html');
												thumbnails[6235268] = new thumbnail(6235268,'346005','Parade in Florence','IT0709TUSC11_087_thumb.jpg',75, 100,1,'photo_6235268.html');
												thumbnails[6214511] = new thumbnail(6214511,'346005','Witches (Hexen)','DE0210MZ2_210-01_thumb.jpg',119, 100,1,'photo_6214511.html');
												thumbnails[6214519] = new thumbnail(6214519,'346015','Girls and boys playing','ES0508BIL3_203-022_thumb.jpg',130, 92,1,'photo_6214519.html');
												thumbnails[6214601] = new thumbnail(6214601,'348006','Tuscany at sunrise','IT0409TUSC2_013_thumb.jpg',130, 87,1,'photo_6214601.html');
												thumbnails[6235142] = new thumbnail(6235142,'346005','Hexen (Witches)','DE0210MZ2_175_thumb.jpg',72, 100,1,'photo_6235142.html');
												thumbnails[6235255] = new thumbnail(6235255,'346015','Man feeding pigeons in city square','ES1007BCN4_028-01_thumb.jpg',130, 89,1,'photo_6235255.html');
												thumbnails[6235261] = new thumbnail(6235261,'348006','Italian waiters ','IT0409GARD1_065-01_thumb.jpg',84, 100,1,'photo_6235261.html');
												thumbnails[6235263] = new thumbnail(6235263,'346015','Three men reading newspapers','IT0806SARD_006_thumb.jpg',130, 94,1,'photo_6235263.html');
												thumbnails[6235272] = new thumbnail(6235272,'348008','Man sunbathing in Boat','PT0807PORTUGAL2_330_thumb.jpg',81, 100,1,'photo_6235272.html');
												thumbnails[6258913] = new thumbnail(6258913,'346015','Playing Boule','ES1007BCN2_092-02_thumb.jpg',130, 76,1,'photo_6258913.html');
												thumbnails[6258999] = new thumbnail(6258999,'348007','Man with donkey','TR0409TURK2_074_thumb.jpg',130, 87,1,'photo_6258999.html');
												thumbnails[6259078] = new thumbnail(6259078,'348007','Men playing backgammon','TR0409TURK14_061_thumb.jpg',130, 87,1,'photo_6259078.html');
												thumbnails[6259119] = new thumbnail(6259119,'346015','Men sitting on bench','DE0806WWALD_009-02_thumb.jpg',130, 125,1,'photo_6259119.html');
												thumbnails[6259126] = new thumbnail(6259126,'348006','Washing day','IT0608SIC1_142-01_thumb.jpg',69, 100,1,'photo_6259126.html');
												thumbnails[6259163] = new thumbnail(6259163,'348008','Regensburg before sunrise','DE0908DETOUR1_113-03_thumb.jpg',130, 103,1,'photo_6259163.html');
												thumbnails[6259166] = new thumbnail(6259166,'348008','Storm over Lake Geneva','CH1108SCHW2_144-01_thumb.jpg',130, 87,1,'photo_6259166.html');
												thumbnails[6259291] = new thumbnail(6259291,'348007','Cobbler on cigarette break','TR0409TURK14_093_thumb.jpg',130, 195,1,'photo_6259291.html');
												thumbnails[6260684] = new thumbnail(6260684,'348008','Youth and bicycle','PT0106LISBON_059-01_thumb.jpg',128, 100,1,'photo_6260684.html');
												thumbnails[6260742] = new thumbnail(6260742,'348006','Temple of Concord, Agrigento','IT0608SIC6_080-02_thumb.jpg',130, 92,1,'photo_6260742.html');
												thumbnails[6266915] = new thumbnail(6266915,'348006','Farm among ploughed fields','IT1009TUSC4_028_thumb.jpg',130, 87,1,'photo_6266915.html');
												thumbnails[6267075] = new thumbnail(6267075,'348006','Beehives in corner of sunflower field ','IT0709TUSC5_013_thumb.jpg',130, 88,1,'photo_6267075.html');
												thumbnails[6268608] = new thumbnail(6268608,'346005','Parade in Florence','IT0709TUSC11_108-01_thumb.jpg',75, 100,1,'photo_6268608.html');
												thumbnails[6268613] = new thumbnail(6268613,'348006','Italian Streetscene','IT0709TUSC10_118-02_thumb.jpg',130, 87,1,'photo_6268613.html');
												thumbnails[6268616] = new thumbnail(6268616,'348007','Bicycle race approaching','TR0409TURK4_230_thumb.jpg',130, 87,1,'photo_6268616.html');
												thumbnails[6268658] = new thumbnail(6268658,'348007','Repairing fishing nets','TR0409TURK9_168_thumb.jpg',130, 87,1,'photo_6268658.html');
												thumbnails[6268773] = new thumbnail(6268773,'348011','Traffic chaos','IN0609BAN1_181_thumb.jpg',130, 87,1,'photo_6268773.html');
												thumbnails[6268780] = new thumbnail(6268780,'348011','Local women in a market','IN0609BAN1_238_thumb.jpg',130, 87,1,'photo_6268780.html');
												thumbnails[6268786] = new thumbnail(6268786,'348011','Indian vegetable market','IN0609BAN2_058_thumb.jpg',130, 87,1,'photo_6268786.html');
												thumbnails[6268790] = new thumbnail(6268790,'348011','Bangalore traffic','IN0609BAN2_094_thumb.jpg',130, 86,1,'photo_6268790.html');
												thumbnails[6268796] = new thumbnail(6268796,'348011','Tailor at work','IN0609BAN2_164_thumb.jpg',130, 90,1,'photo_6268796.html');
												thumbnails[6268805] = new thumbnail(6268805,'348008','English seaside ','GB0706BOSHAM_002_thumb.jpg',130, 87,1,'photo_6268805.html');
												thumbnails[6268813] = new thumbnail(6268813,'348008','Belgian seaside','BE0406KNOKKE_037_thumb.jpg',130, 83,1,'photo_6268813.html');
												thumbnails[6268941] = new thumbnail(6268941,'348006','Working the salt lakes','IT0608SIC8_190-01_thumb.jpg',130, 89,1,'photo_6268941.html');
												thumbnails[6276972] = new thumbnail(6276972,'348007','Cobbler at work','TR0409TURK13_110_thumb.jpg',67, 100,1,'photo_6276972.html');
												thumbnails[6469073] = new thumbnail(6469073,'346005','Brabants fietsharmonisch Orkest','DE0809KOBL1_150_1_thumb.jpg',130, 78,1,'photo_6469073.html');
												thumbnails[6469079] = new thumbnail(6469079,'348008','Street vendor','MX0710Mex4_035_thumb.jpg',130, 87,1,'photo_6469079.html');
												thumbnails[6997446] = new thumbnail(6997446,'379201','At the market','BL1010BAL2_104_thumb.jpg',130, 87,1,'photo_6997446.html');
												thumbnails[6997471] = new thumbnail(6997471,'379201','At the market','BL1010BAL5_008_thumb.jpg',130, 87,1,'photo_6997471.html');
												thumbnails[6997485] = new thumbnail(6997485,'379201','Filling petrol cans ','BL1010BAL5_043_thumb.jpg',130, 88,1,'photo_6997485.html');
												thumbnails[6997491] = new thumbnail(6997491,'379201','Carpentry','BL1010BAL5_052_thumb.jpg',130, 88,1,'photo_6997491.html');
												thumbnails[6997496] = new thumbnail(6997496,'379201','Metalworkers','BL1010BAL8_068_thumb.jpg',130, 87,1,'photo_6997496.html');
												thumbnails[6997500] = new thumbnail(6997500,'379201','Dynamo repairman','BL1010BAL8_092_thumb.jpg',130, 87,1,'photo_6997500.html');
												thumbnails[6997505] = new thumbnail(6997505,'379201','Fish salesmen','BL1010BAL9_117_thumb.jpg',130, 87,1,'photo_6997505.html');
												thumbnails[6997515] = new thumbnail(6997515,'379201','Tailoring','BL1010BAL9_195_thumb.jpg',130, 86,1,'photo_6997515.html');
												thumbnails[6997521] = new thumbnail(6997521,'379201','At the hairdressers','BL1010BAL9_305-01_thumb.jpg',130, 88,1,'photo_6997521.html');
												thumbnails[7896655] = new thumbnail(7896655,'425988','','PH0411PH1_060_thumb.jpg',130, 96,1,'photo_7896655.html');
												thumbnails[7896657] = new thumbnail(7896657,'425988','','PH0411PH1_127_thumb.jpg',130, 92,1,'photo_7896657.html');
												thumbnails[7896660] = new thumbnail(7896660,'425988','','PH0411PH10_056_thumb.jpg',130, 87,1,'photo_7896660.html');
												thumbnails[7896661] = new thumbnail(7896661,'425988','','PH0411PH10_083_thumb.jpg',130, 87,1,'photo_7896661.html');
												thumbnails[7896662] = new thumbnail(7896662,'425988','','PH0411PH12_005_thumb.jpg',130, 86,1,'photo_7896662.html');
												thumbnails[7896683] = new thumbnail(7896683,'425988','','PH0411PH16_168_thumb.jpg',130, 87,1,'photo_7896683.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[379201] = new gallery(379201,'6997521,6997505,6997500,6997496,6997491,6997485,6997471,6997446','Bali','gallery',[6997446,6997471,6997485,6997491,6997496,6997500,6997505,6997515,6997521],0, 0, '346004', 'gallery_379201.html',0,0);
				  					galleries[425988] = new gallery(425988,'7896683,7896662,7896661,7896660,7896657,7896655','Philippines','gallery',[7896655,7896657,7896660,7896661,7896662,7896683],0, 0, '346004', 'gallery_425988.html',0,0);
				  					galleries[346004] = new gallery(346004,'6997521,6997505,6997500,6997496,6997491,6997485,6997471,6997446,6268941,6268805,6268796,6268790,6268786,6268773,6268658,6266915,6260742,6260684,6259078,6258999,6214601','Travel','gallery',[],0, 0, '', 'gallery_346004.html',0,0);
				  					galleries[346005] = new gallery(346005,'6494843,6214511','Events','gallery',[6494847,6494843,6235268,6214511,6235142,6268608,6469073],0, 0, '', 'gallery_346005.html',0,0);
				  					galleries[346015] = new gallery(346015,'6258913,6235263,6235255,6214519','Urban','gallery',[6214519,6235255,6235263,6258913,6259119],0, 0, '', 'gallery_346015.html',0,0);
				  					galleries[348006] = new gallery(348006,'6268941,6266915,6260742,6214601','Italy','gallery',[6214601,6235261,6259126,6260742,6266915,6267075,6268613,6268941],0, 0, '346004', 'gallery_348006.html',0,0);
				  					galleries[348007] = new gallery(348007,'6268658,6259078,6258999','Turkey','gallery',[6258999,6259078,6259291,6268616,6268658,6276972],0, 0, '346004', 'gallery_348007.html',0,0);
				  					galleries[348011] = new gallery(348011,'6268796,6268790,6268786,6268773','India','gallery',[6268773,6268780,6268786,6268790,6268796],0, 0, '346004', 'gallery_348011.html',0,0);
				  					galleries[348008] = new gallery(348008,'6268805,6260684','Travel various','gallery',[6235272,6259163,6259166,6260684,6268805,6268813,6469079],0, 0, '346004', 'gallery_348008.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '6997521,6997505,6997446,6268941,6268773,6260742,6260684,6235263,6235255,6214601,6214511';
imageSets[2] = '6997521,6997505,6997500,6997496,6997491,6997485,6997471,6997446,6494843,6268941,6268805,6268796,6268790,6268786,6268773,6268658,6266915,6260742,6260684,6259078,6258999,6258913,6235263,6235255,6214601,6214519,6214511';
imageSets[3] = '7896683,7896662,7896661,7896660,7896657,7896655,7126041,7126039,7125811,7125803,6997521,6997515,6997505,6997500,6997496,6997491,6997485,6997471,6997446,6494847,6494843,6469079,6469073,6276972,6268941,6268813,6268805,6268796,6268790,6268786,6268780,6268773,6268658,6268616,6268613,6268608,6267075,6266915,6260742,6260684,6259291,6259166,6259163,6259126,6259119,6259078,6258999,6258913,6235272,6235268';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/tibbotts/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/tibbotts/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/tibbotts/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/tibbotts/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/tibbotts/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/tibbotts/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/tibbotts/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/tibbotts/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/tibbotts/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/tibbotts/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/tibbotts/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/tibbotts/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/tibbotts/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/tibbotts/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/tibbotts/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/tibbotts/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/tibbotts/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/tibbotts/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/tibbotts/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/tibbotts/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/tibbotts/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/tibbotts/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 = 'Alan Tibbotts 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 == undefined) {
    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>  </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;
	}
}

			

