window.thumbnails = new Object();
												thumbnails[891581] = new thumbnail(891581,'68374','Thornton Force','P2197894_thumb.jpg',130, 173,18,'photo_891581.html');
												thumbnails[895130] = new thumbnail(895130,'68656','Rydal Mount Gardens','P4111905_thumb.jpg',130, 98,18,'photo_895130.html');
												thumbnails[899894] = new thumbnail(899894,'68760','Ullswater','P4122043_thumb.jpg',130, 173,18,'photo_899894.html');
												thumbnails[900644] = new thumbnail(900644,'68962','Maryport Harbour','maryport harbour_thumb.jpg',130, 98,18,'photo_900644.html');
												thumbnails[900679] = new thumbnail(900679,'68289','St Johns In The Vale','P2177433_thumb.jpg',130, 98,18,'photo_900679.html');
												thumbnails[902979] = new thumbnail(902979,'68289','Walla Crag Tree','treemono1_thumb.jpg',130, 168,18,'photo_902979.html');
												thumbnails[902983] = new thumbnail(902983,'68291','Crummock Reflections','P4021126_thumb.jpg',130, 98,18,'photo_902983.html');
												thumbnails[902986] = new thumbnail(902986,'68291','Crummock Reflections 02','P4021133_thumb.jpg',130, 173,18,'photo_902986.html');
												thumbnails[903374] = new thumbnail(903374,'68374','Beezley Falls','P2197916_thumb.jpg',130, 98,18,'photo_903374.html');
												thumbnails[903376] = new thumbnail(903376,'68760','Ullswater Boathouse portrait','P4122017_thumb.jpg',130, 173,18,'photo_903376.html');
												thumbnails[903377] = new thumbnail(903377,'68760','Ullswater Boats','P4122045_thumb.jpg',130, 103,18,'photo_903377.html');
												thumbnails[903379] = new thumbnail(903379,'68962','Maryport Yacht','maryport yacht_thumb.jpg',130, 176,18,'photo_903379.html');
												thumbnails[938430] = new thumbnail(938430,'68997','Great Gable 001','P4282626_thumb.jpg',130, 98,18,'photo_938430.html');
												thumbnails[960815] = new thumbnail(960815,'68291','Rannerdale Bluebells 001','P5013070_thumb.jpg',130, 173,18,'photo_960815.html');
												thumbnails[971199] = new thumbnail(971199,'68291','Rannerdale Bluebells 005','P5013042_thumb.jpg',130, 98,18,'photo_971199.html');
												thumbnails[972409] = new thumbnail(972409,'68760','Ullswater Boathouse 001','P41220131_thumb.jpg',130, 95,18,'photo_972409.html');
												thumbnails[995607] = new thumbnail(995607,'68289','Storm clouds over Ashness Bridge','P5193410raw_thumb.jpg',130, 98,18,'photo_995607.html');
												thumbnails[995610] = new thumbnail(995610,'68289','Ashness Bridge 002','P5193414raw_thumb.jpg',130, 173,18,'photo_995610.html');
												thumbnails[995622] = new thumbnail(995622,'68289','Ashness Bridge 004','P5193402_thumb.jpg',130, 173,18,'photo_995622.html');
												thumbnails[995795] = new thumbnail(995795,'68291','Rannerdale stream','P5013061_thumb.jpg',130, 173,18,'photo_995795.html');
												thumbnails[1008261] = new thumbnail(1008261,'68760','Ullswater boathouse 002','P4121998_thumb.jpg',130, 98,18,'photo_1008261.html');
												thumbnails[1032947] = new thumbnail(1032947,'77094','Coire An Lochain ','P5313830_thumb.jpg',130, 98,18,'photo_1032947.html');
												thumbnails[1032953] = new thumbnail(1032953,'77094','Loch Morlich 001','P5313878_thumb.jpg',130, 98,18,'photo_1032953.html');
												thumbnails[1032954] = new thumbnail(1032954,'77094','Loch Morlich 002','P5313914_thumb.jpg',130, 98,18,'photo_1032954.html');
												thumbnails[1203014] = new thumbnail(1203014,'68291','Buttermere Pines','P7241128_thumb.jpg',130, 98,18,'photo_1203014.html');
												thumbnails[1230747] = new thumbnail(1230747,'77094','Glenmore Forest 001','P7291219_thumb.jpg',130, 98,18,'photo_1230747.html');
												thumbnails[1230749] = new thumbnail(1230749,'77094','Loch Morlich 003','P7291250_thumb.jpg',130, 98,18,'photo_1230749.html');
												thumbnails[1230752] = new thumbnail(1230752,'77094','Glenmore Forest 002','P7291225r_thumb.jpg',130, 98,18,'photo_1230752.html');
												thumbnails[1294146] = new thumbnail(1294146,'68997','Stepping stones to Kirk Fell','P8211840_thumb.jpg',130, 98,18,'photo_1294146.html');
												thumbnails[1294159] = new thumbnail(1294159,'68997','Lingmell Beck looking onto Great Gable','P8211942_thumb.jpg',130, 173,18,'photo_1294159.html');
												thumbnails[1314128] = new thumbnail(1314128,'68997','sunset on lingmell beck ','P8272045_thumb.jpg',130, 173,18,'photo_1314128.html');
												thumbnails[1314134] = new thumbnail(1314134,'68997','Lingmell beck to Wasdale','P8272096_thumb.jpg',130, 98,18,'photo_1314134.html');
												thumbnails[1314146] = new thumbnail(1314146,'68997','Last light on Great Gable','P8272105raw_thumb.jpg',130, 98,18,'photo_1314146.html');
												thumbnails[1348051] = new thumbnail(1348051,'68997','St Olaf\'s Church','P8211897_thumb.jpg',130, 98,18,'photo_1348051.html');
												thumbnails[1348080] = new thumbnail(1348080,'68997','Lingmell Stones ','P8272032raw_thumb.jpg',130, 173,18,'photo_1348080.html');
												thumbnails[1348096] = new thumbnail(1348096,'68997','Wastwater shore','P8272101raw_thumb.jpg',130, 98,18,'photo_1348096.html');
												thumbnails[1348113] = new thumbnail(1348113,'68997','Scafell Range','P8272102raw_thumb.jpg',130, 98,18,'photo_1348113.html');
												thumbnails[1518459] = new thumbnail(1518459,'68289','Friars Crag & Derwent Water','PA2424792_thumb.jpg',130, 98,18,'photo_1518459.html');
												thumbnails[1518487] = new thumbnail(1518487,'68289','Derwent Mist','PA2423651_thumb.jpg',130, 97,18,'photo_1518487.html');
												thumbnails[1518537] = new thumbnail(1518537,'68289','Derwent Water Island','PA2424341_thumb.jpg',130, 98,18,'photo_1518537.html');
												thumbnails[1518547] = new thumbnail(1518547,'68289','Castlerigg Stone Circle','PA2022351_thumb.jpg',130, 98,18,'photo_1518547.html');
												thumbnails[1518554] = new thumbnail(1518554,'68291','Melbreak & Crummock Water','PA2323481_thumb.jpg',130, 98,18,'photo_1518554.html');
												thumbnails[1518559] = new thumbnail(1518559,'68291','Melbreak & Crummock Water 02','PA2323341_thumb.jpg',130, 173,18,'photo_1518559.html');
												thumbnails[1521456] = new thumbnail(1521456,'77094','Last light on Loch Morlich','P7301457_thumb.jpg',130, 98,18,'photo_1521456.html');
												thumbnails[1521578] = new thumbnail(1521578,'77094','Sunlight on the Cairngorms','P7291237_thumb.jpg',130, 98,18,'photo_1521578.html');
												thumbnails[1521685] = new thumbnail(1521685,'104439','Sunlight On The Cairngorms','111_thumb.jpg',130, 98,18,'photo_1521685.html');
												thumbnails[1521710] = new thumbnail(1521710,'104439','Castlerigg Stone Cricle','PA202235m_thumb.jpg',130, 98,18,'photo_1521710.html');
												thumbnails[1521712] = new thumbnail(1521712,'104439','Crummock Water & Melbreak','PA232344m_thumb.jpg',130, 98,18,'photo_1521712.html');
												thumbnails[1521713] = new thumbnail(1521713,'104439','Derwent Water Island','PA242434m_thumb.jpg',130, 98,18,'photo_1521713.html');
												thumbnails[1521715] = new thumbnail(1521715,'104439','Glenmore forest','P7291227m1_thumb.jpg',130, 173,18,'photo_1521715.html');
												thumbnails[3047596] = new thumbnail(3047596,'73413','Seal','P8242736_thumb.jpg',130, 87,18,'photo_3047596.html');
												thumbnails[3583600] = new thumbnail(3583600,'104439','Eileen Donan Castle','DSCF01591_thumb.jpg',130, 98,18,'photo_3583600.html');
												thumbnails[3583607] = new thumbnail(3583607,'219036','Isle of Skye Port','P8242568_thumb.jpg',130, 98,18,'photo_3583607.html');
												thumbnails[3583613] = new thumbnail(3583613,'219036','Portree','P8242579_thumb.jpg',130, 97,18,'photo_3583613.html');
												thumbnails[3583646] = new thumbnail(3583646,'104439','Skye village','P8242644_thumb.jpg',130, 98,18,'photo_3583646.html');
												thumbnails[3615090] = new thumbnail(3615090,'68289','Castlerigg In Sunlight','PA202278_thumb.jpg',130, 98,18,'photo_3615090.html');
												thumbnails[3615093] = new thumbnail(3615093,'104439','Great Gable','P8211904_thumb.jpg',130, 98,18,'photo_3615093.html');
												thumbnails[3615097] = new thumbnail(3615097,'68997','Gable through the gate','P8211909_thumb.jpg',130, 98,18,'photo_3615097.html');
												thumbnails[3615151] = new thumbnail(3615151,'68289','Catbells Dawn','PA2424152_thumb.jpg',130, 98,18,'photo_3615151.html');
												thumbnails[3615154] = new thumbnail(3615154,'68289','Early morning mist on Derwent Water','PA242397_thumb.jpg',130, 98,18,'photo_3615154.html');
												thumbnails[3615161] = new thumbnail(3615161,'104439','Morning mist','PA242393bw2_thumb.jpg',130, 173,18,'photo_3615161.html');
												thumbnails[8196343] = new thumbnail(8196343,'68760','Ullswater Sunset','P1015498s_thumb.jpg',130, 98,18,'photo_8196343.html');
												thumbnails[8196348] = new thumbnail(8196348,'68760','Brougham Castle','P1015578s_thumb.jpg',130, 98,18,'photo_8196348.html');
												thumbnails[8196353] = new thumbnail(8196353,'68760','Ullswater Steamboat 001','P1016738croppeds_thumb.jpg',130, 92,18,'photo_8196353.html');
												thumbnails[8196355] = new thumbnail(8196355,'68760','Ullswater Steamboat 002','P1016748croppeds_thumb.jpg',130, 92,18,'photo_8196355.html');
												thumbnails[8196359] = new thumbnail(8196359,'68760','Rainbow','P1016162shoppeds_thumb.jpg',130, 184,18,'photo_8196359.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[68656] = new gallery(68656,'895130','Ambleside','gallery',[895130],0, 0, '68285', 'gallery_68656.html',0,0);
				  					galleries[77094] = new gallery(77094,'1521578,1521456,1230752,1230749,1230747,1032954,1032953,1032947','Cairngorms','gallery',[1032947,1032953,1032954,1230747,1230749,1230752,1521456,1521578],0, 0, '77093', 'gallery_77094.html',0,0);
				  					galleries[68962] = new gallery(68962,'903379,900644','Coastal','gallery',[900644,903379],0, 0, '68285', 'gallery_68962.html',0,0);
				  					galleries[68374] = new gallery(68374,'891581','Ingleton Falls','gallery',[891581,903374],0, 0, '68373', 'gallery_68374.html',0,0);
				  					galleries[219036] = new gallery(219036,'3583613,3583607','Isle of Skye','gallery',[3583607,3583613],0, 0, '77093', 'gallery_219036.html',0,0);
				  					galleries[68760] = new gallery(68760,'8196355,8196353,8196343,1008261,972409,903377,903376','Ullswater','gallery',[899894,903376,903377,972409,1008261,8196343,8196348,8196353,8196355,8196359],0, 0, '68285', 'gallery_68760.html',0,0);
				  					galleries[68997] = new gallery(68997,'3615097,1348113,1348096,1348080,1348051,1314146,1314134,1314128,1294159,1294146,938430','Wastwater and Ennerdale','gallery',[938430,1294146,1294159,1314128,1314134,1314146,1348051,1348080,1348096,1348113,3615097],0, 0, '68285', 'gallery_68997.html',0,0);
				  					galleries[68285] = new gallery(68285,'8196355,8196353,8196343,3615151,3615097,1518559,1518554,1518547,1518537,1518487,1518459,1348113,1348096,1348080,1348051,1314146,1314134,1314128,1294159,1294146,1203014,1008261,995622,995610,995607,972409,971199,960815,938430,903379,903377,903376,902986,902983,902979,900679,900644,895130','lake district','gallery',[],0, 0, '', 'gallery_68285.html',0,0);
				  					galleries[77093] = new gallery(77093,'1521578,1521456,1230752,1230749,1230747,1032954,1032953,1032947','Scotland','gallery',[],0, 0, '', 'gallery_77093.html',0,0);
				  					galleries[73413] = new gallery(73413,'3047596','Wildlife','gallery',[3047596],0, 0, '', 'gallery_73413.html',0,0);
				  					galleries[68373] = new gallery(68373,'891581','Yorkshire','gallery',[],0, 0, '', 'gallery_68373.html',0,0);
				  					galleries[104439] = new gallery(104439,'3615093,3583646,3583600,1521715,1521713,1521710,1521685','Monochrome','gallery',[1521685,1521710,1521712,1521713,1521715,3583600,3583646,3615093,3615161],0, 0, '', 'gallery_104439.html',0,0);
				  					galleries[68289] = new gallery(68289,'3615151,1518547,1518537,1518487,1518459,995622,995610,995607,902979,900679','Borrowdale','gallery',[900679,902979,995607,995610,995622,1518459,1518487,1518537,1518547,3615090,3615151,3615154],0, 0, '68285', 'gallery_68289.html',0,0);
				  					galleries[68291] = new gallery(68291,'1518559,1518554,1203014,971199,960815,902986,902983','Crummock and Buttermere','gallery',[902983,902986,960815,971199,995795,1203014,1518554,1518559],0, 0, '68285', 'gallery_68291.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '995607';
imageSets[2] = '8196355,8196353,8196343,3615151,3615097,3615093,3583646,3583600,3047596,1521715,1521713,1521710,1521685,1521578,1521456,1518559,1518554,1518547,1518537,1518487,1518459,1348113,1348096,1348080,1348051,1314146,1314134,1314128,1294159,1294146,1230752,1230749,1230747,1203014,1032954,1032953,1032947,1008261,995622,995610,995607,972409,971199,960815,938430,903379,903377,903376,902986,902983,902979,900679,900644,895130,891581';
imageSets[3] = '3615151,3615097';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/Richard1/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/Richard1/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/Richard1/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/Richard1/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/Richard1/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/Richard1/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/Richard1/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/Richard1/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/Richard1/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/Richard1/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/Richard1/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/Richard1/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/Richard1/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/Richard1/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/Richard1/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/Richard1/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/Richard1/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/Richard1/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/Richard1/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/Richard1/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/Richard1/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/Richard1/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 = 'Travel Adventure 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>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;
	}
}

			

