window.thumbnails = new Object();
												thumbnails[1917871] = new thumbnail(1917871,'','','Rievaulx Abbey 2',130, 86,2,'															#');
												thumbnails[3245588] = new thumbnail(3245588,'73706','Fountains Abbey reflection','Fountains Abbey reflection_thumb.jpg',130, 172,18,'																			photo_3245588.html');
												thumbnails[1917873] = new thumbnail(1917873,'73706','Ana Cross','Ana Cross  _thumb.jpg',130, 92,18,'																			photo_1917873.html');
												thumbnails[1917883] = new thumbnail(1917883,'73706','Rosedale mine ruins','Rosedale mine ruins_thumb.jpg',130, 78,18,'																			photo_1917883.html');
												thumbnails[1917895] = new thumbnail(1917895,'73706','The old railway track, Rosedale','Rosedale Railway_thumb.jpg',130, 94,18,'																			photo_1917895.html');
												thumbnails[3245604] = new thumbnail(3245604,'73706','Mount Grace Priory','Mount Grace Priory_thumb.jpg',130, 182,18,'																			photo_3245604.html');
												thumbnails[3245577] = new thumbnail(3245577,'73706','Ruined cottage','Ruined cottage_thumb.jpg',130, 93,18,'																			photo_3245577.html');
												thumbnails[981570] = new thumbnail(981570,'73709','Aira Force','Aira_Force_thumb.jpg',130, 93,18,'																			photo_981570.html');
												thumbnails[981573] = new thumbnail(981573,'73709','Castle Rigg','Castle_Rigg_thumb.jpg',130, 75,18,'																			photo_981573.html');
												thumbnails[981576] = new thumbnail(981576,'73709','Martindale','Martindale_thumb.jpg',130, 83,18,'																			photo_981576.html');
												thumbnails[981578] = new thumbnail(981578,'73709','Ullswater boathouse','Ullswater_boathouse_thumb.jpg',130, 166,18,'																			photo_981578.html');
												thumbnails[981584] = new thumbnail(981584,'73710','The Harbour','Whitby_harbour_thumb.jpg',130, 132,18,'																			photo_981584.html');
												thumbnails[981585] = new thumbnail(981585,'73710','The Minster','York_Minster_thumb.jpg',130, 158,18,'																			photo_981585.html');
												thumbnails[981588] = new thumbnail(981588,'73710','The Shambles','YorkThe_Shambles_thumb.jpg',130, 132,18,'																			photo_981588.html');
												thumbnails[981590] = new thumbnail(981590,'73710','Blackburn\'s Yard','Blackburns_yard_-_Whitby_thumb.jpg',130, 137,18,'																			photo_981590.html');
												thumbnails[981597] = new thumbnail(981597,'73710','Christmas House','Christmas__House_-_Richmond_thumb.jpg',130, 96,18,'																			photo_981597.html');
												thumbnails[981599] = new thumbnail(981599,'73710','Millgate','MillgateRichmond_thumb.jpg',130, 174,18,'																			photo_981599.html');
												thumbnails[981601] = new thumbnail(981601,'73710','The Barr','The_Bar_Richmond_thumb.jpg',130, 175,18,'																			photo_981601.html');
												thumbnails[981602] = new thumbnail(981602,'73710','Baker\'s Alley','Thirsk_Bakers_Alley_thumb.jpg',130, 139,18,'																			photo_981602.html');
												thumbnails[981604] = new thumbnail(981604,'73710','Finkle Street','Thirsk_Finkle_Street_thumb.jpg',130, 119,18,'																			photo_981604.html');
												thumbnails[981606] = new thumbnail(981606,'73710','Alleyway','Whitby__Alleyway_thumb.jpg',130, 134,18,'																			photo_981606.html');
												thumbnails[981610] = new thumbnail(981610,'73711','Evening low tide','Balekeney_thumb.jpg',130, 216,18,'																			photo_981610.html');
												thumbnails[981611] = new thumbnail(981611,'73711','Low tide','Burnham_Overy_Staithe_thumb.jpg',130, 94,18,'																			photo_981611.html');
												thumbnails[981613] = new thumbnail(981613,'73711','Cley Mill 1','Cley_mill_thumb.jpg',130, 180,18,'																			photo_981613.html');
												thumbnails[981621] = new thumbnail(981621,'73711','Cley Mill 2','Cley_windmill_11234_thumb.jpg',130, 176,18,'																			photo_981621.html');
												thumbnails[981629] = new thumbnail(981629,'73711','High and dry','Past_its_bestBlakeney_thumb.jpg',130, 96,18,'																			photo_981629.html');
												thumbnails[981637] = new thumbnail(981637,'73708','Late Spring snow','Beinn_Eighe_in_snow_thumb.jpg',130, 92,18,'																			photo_981637.html');
												thumbnails[981639] = new thumbnail(981639,'73708','Towards Flowerdale','Flowerdale_thumb.jpg',130, 96,18,'																			photo_981639.html');
												thumbnails[981640] = new thumbnail(981640,'73708','Down the glen','Glen_Torridon_thumb.jpg',130, 95,18,'																			photo_981640.html');
												thumbnails[981647] = new thumbnail(981647,'73708','Beinn Eighe','Scotland_Beinn_Eighe_-_trees_thumb.jpg',130, 98,18,'																			photo_981647.html');
												thumbnails[981648] = new thumbnail(981648,'73708','Storm on the loch','Storm_on_Loch_Torridon_thumb.jpg',130, 96,18,'																			photo_981648.html');
												thumbnails[981650] = new thumbnail(981650,'73706','Walled garden','Helmsley_Walled_Garden_thumb.jpg',130, 183,18,'																			photo_981650.html');
												thumbnails[981685] = new thumbnail(981685,'73706','Rievaulx Abbey','Rievaulx_Abbey_thumb.jpg',130, 179,18,'																			photo_981685.html');
												thumbnails[981687] = new thumbnail(981687,'73706','Staithes','Staithes_1_thumb.jpg',130, 117,18,'																			photo_981687.html');
												thumbnails[981689] = new thumbnail(981689,'73706','Gate in the snow','Sutton_Bank_gate_in_snow_thumb.jpg',130, 118,18,'																			photo_981689.html');
												thumbnails[981693] = new thumbnail(981693,'73706','Whitby harbour 1','Whitby_1_thumb.jpg',130, 96,18,'																			photo_981693.html');
												thumbnails[981695] = new thumbnail(981695,'73706','Bridge at Sowerby','Bridge_at_Sowerby_thumb.jpg',130, 160,18,'																			photo_981695.html');
												thumbnails[981697] = new thumbnail(981697,'73706','Garbutt Wood','Garbutt_Wood_thumb.jpg',130, 82,18,'																			photo_981697.html');
												thumbnails[981698] = new thumbnail(981698,'73706','Weathered groynes','Groynes_-_Sandsensd_thumb.jpg',130, 183,18,'																			photo_981698.html');
												thumbnails[981700] = new thumbnail(981700,'73706','Castle from the walled garden','Helmsley_Castle_bw_thumb.jpg',130, 93,18,'																			photo_981700.html');
												thumbnails[981704] = new thumbnail(981704,'73706','Lighthouse','Lighthouse_-_Whitby_thumb.jpg',130, 223,18,'																			photo_981704.html');
												thumbnails[981709] = new thumbnail(981709,'73706','Nunnington Hall','Nunnington_Hall_thumb.jpg',130, 88,18,'																			photo_981709.html');
												thumbnails[981713] = new thumbnail(981713,'73706','On Rievaulx Moor','On_Rievaulx_Moor_thumb.jpg',130, 95,18,'																			photo_981713.html');
												thumbnails[981715] = new thumbnail(981715,'73706','The nave','Ripon_Cathedral_nave_thumb.jpg',130, 83,18,'																			photo_981715.html');
												thumbnails[981718] = new thumbnail(981718,'73706','Cottage on the sea wall','Runswick_Bay_thumb.jpg',130, 92,18,'																			photo_981718.html');
												thumbnails[981722] = new thumbnail(981722,'73706','Staithes Cobles','Staithes_cobles_thumb.jpg',130, 85,18,'																			photo_981722.html');
												thumbnails[981723] = new thumbnail(981723,'73706','Gate,Cleveland Way','Sutton_Bank_gate_thumb.jpg',130, 76,18,'																			photo_981723.html');
												thumbnails[981725] = new thumbnail(981725,'73706','Whitby Harbour 2','Whitby_2_thumb.jpg',130, 181,18,'																			photo_981725.html');
												thumbnails[981727] = new thumbnail(981727,'73706','Whitby Harbour 3','Whitby_3_thumb.jpg',130, 91,18,'																			photo_981727.html');
												thumbnails[995767] = new thumbnail(995767,'73708','Slioch','Slioch_thumb.jpg',130, 95,18,'																			photo_995767.html');
												thumbnails[995775] = new thumbnail(995775,'73708','Boats at Diabaig','Diabeg_boats_tif_thumb.jpg',130, 147,18,'																			photo_995775.html');
												thumbnails[995780] = new thumbnail(995780,'73706','Winter sunshine','Studley_Royal_thumb.jpg',130, 93,18,'																			photo_995780.html');
												thumbnails[1279782] = new thumbnail(1279782,'73708','Castle Stalker','Castle-Stalker_thumb.gif',130, 86,18,'																			photo_1279782.html');
												thumbnails[1279797] = new thumbnail(1279797,'73708','Gylen Castle','Gylen-Castle_thumb.gif',130, 86,18,'																			photo_1279797.html');
												thumbnails[1279802] = new thumbnail(1279802,'73708','Gylen Castle and Mull','Gylen-Castle-and-Mull_thumb.gif',130, 87,18,'																			photo_1279802.html');
												thumbnails[1279823] = new thumbnail(1279823,'73709','Buttermere','Tree-by-Buttermere_thumb.gif',130, 110,18,'																			photo_1279823.html');
												thumbnails[3772441] = new thumbnail(3772441,'73706','Snow at Sneck Yat','Snow_at_Sneck_Yat1_thumb.jpg',130, 92,18,'																			photo_3772441.html');
												thumbnails[3772475] = new thumbnail(3772475,'73706','Surrender Smelt Mill','Surrender_Smelt_Mill_1_thumb.jpg',130, 89,18,'																			photo_3772475.html');
												thumbnails[3772480] = new thumbnail(3772480,'73706','Windswept trees on the top os Sutton Bank','Trees_on_Sutton_Bank123_thumb.jpg',130, 91,18,'																			photo_3772480.html');
												thumbnails[3772523] = new thumbnail(3772523,'73709','Easedale','Easedale2_thumb.jpg',130, 95,18,'																			photo_3772523.html');
												thumbnails[3772843] = new thumbnail(3772843,'73709','Rowan\'s Ground, Grasmere','Rowans_Ground_Grasmere1_thumb.jpg',130, 86,18,'																			photo_3772843.html');
												thumbnails[4212340] = new thumbnail(4212340,'73706','Treeline in the snow','Tree_line_-_Sutton_Bank1234_thumb.jpg',130, 73,18,'																			photo_4212340.html');
												thumbnails[6633380] = new thumbnail(6633380,'73706','East Pier, Whitby','Harbour_mouth_resize_thumb.jpg',130, 92,18,'																			photo_6633380.html');
												thumbnails[6633384] = new thumbnail(6633384,'73706','Hutton le Hole','Hutton_le_Hole_resize_thumb.jpg',130, 91,18,'																			photo_6633384.html');
												thumbnails[6633386] = new thumbnail(6633386,'73706','Woodland path by Lake Gormire','Path_Gormire_resize_thumb.jpg',130, 186,18,'																			photo_6633386.html');
												thumbnails[6633390] = new thumbnail(6633390,'73706','A temple on Rievaulx Terraces','RievaulxTemple_resize_thumb.jpg',130, 183,18,'																			photo_6633390.html');
												thumbnails[6633422] = new thumbnail(6633422,'73706','Path to Thirkleby','Thirkleby_path_resize_thumb.jpg',130, 100,18,'																			photo_6633422.html');
												thumbnails[6633425] = new thumbnail(6633425,'73706','Whitestone Cliffe','Whitestone_Cliff_bw_resize_thumb.jpg',130, 167,18,'																			photo_6633425.html');
												thumbnails[6633679] = new thumbnail(6633679,'73709','Lake Buttermere','Buttermere_fence_sepia_resize_thumb.jpg',130, 99,18,'																			photo_6633679.html');
												thumbnails[6633687] = new thumbnail(6633687,'73709','Ruin near High Street','High_Street_ruin_resize_thumb.jpg',130, 91,18,'																			photo_6633687.html');
												thumbnails[6634059] = new thumbnail(6634059,'363266','Stream, Aira Force','Aira_resize_thumb.JPG',130, 91,18,'																			photo_6634059.html');
												thumbnails[6634064] = new thumbnail(6634064,'363266','Beach huts at Whitby','Beach_huts_resize_thumb.jpg',130, 89,18,'																			photo_6634064.html');
												thumbnails[6634141] = new thumbnail(6634141,'363266','Crowning glory','Crowning_glory_2_resize_thumb.jpg',130, 186,18,'																			photo_6634141.html');
												thumbnails[6634158] = new thumbnail(6634158,'363266','Golden light','Golden_light_resize_thumb.jpg',130, 89,18,'																			photo_6634158.html');
												thumbnails[6634170] = new thumbnail(6634170,'363266','Swan with cygnet','DSC_5074_resize_thumb.jpg',130, 98,18,'																			photo_6634170.html');
												thumbnails[6634178] = new thumbnail(6634178,'363266','Sir Lamiel','Sir_Lamiel_3JPEG-01_resize_thumb.jpg',130, 74,18,'																			photo_6634178.html');
												thumbnails[6634185] = new thumbnail(6634185,'363266','Sir Nigel Gresley','Sir_N_Gresley_resize_thumb.jpg',130, 91,18,'																			photo_6634185.html');
												thumbnails[6634189] = new thumbnail(6634189,'363266','Tornado','Tornado_Pickering_resize_thumb.jpg',130, 96,18,'																			photo_6634189.html');
												thumbnails[6634203] = new thumbnail(6634203,'363266','Tornado 1st Day','Tornado_resize_thumb.jpg',130, 85,18,'																			photo_6634203.html');
												thumbnails[7441847] = new thumbnail(7441847,'73706','Wainstones 1','Wainstones_1_thumb.jpg',130, 79,18,'																			photo_7441847.html');
												thumbnails[7441864] = new thumbnail(7441864,'73706','Wainstones 2','Wainstones_2_thumb.jpg',130, 156,18,'																			photo_7441864.html');
												thumbnails[7441868] = new thumbnail(7441868,'73706','Wainstones 3','Wainstones_3_thumb.jpg',130, 90,18,'																			photo_7441868.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[363266] = new gallery(363266,'6634203,6634189,6634185,6634178,6634170,6634158,6634141,6634064,6634059','Colour and other','gallery',[6634059,6634064,6634141,6634158,6634170,6634178,6634185,6634189,6634203],0, 0, '', '																																																																																																							gallery_363266.html',0,0);
				  					galleries[73709] = new gallery(73709,'981578','Lake District','gallery',[981570,981573,981576,981578,1279823,3772523,3772843,6633679,6633687],0, 0, '', '																																																																																																							gallery_73709.html',0,0);
				  					galleries[73710] = new gallery(73710,'981590','Night shots','gallery',[981584,981585,981588,981590,981597,981599,981601,981602,981604,981606],0, 0, '', '																																																																																																							gallery_73710.html',0,0);
				  					galleries[73711] = new gallery(73711,'981613','Norfolk','gallery',[981610,981611,981613,981621,981629],0, 0, '', '																																																																																																							gallery_73711.html',0,0);
				  					galleries[73706] = new gallery(73706,'981713','North Yorkshire','gallery',[3245588,1917873,1917883,1917895,3245604,3245577,981650,981685,981687,981689,981693,981695,981697,981698,981700,981704,981709,981713,981715,981718,981722,981723,981725,981727,995780,3772441,3772475,3772480,4212340,6633380,6633384,6633386,6633390,6633422,6633425,7441847,7441864,7441868],0, 0, '', '																																																																																																							gallery_73706.html',0,0);
				  					galleries[73708] = new gallery(73708,'981647','Scotland','gallery',[981637,981639,981640,981647,981648,995767,995775,1279782,1279797,1279802],0, 0, '', '																																																																																																							gallery_73708.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '981713,981647';
imageSets[2] = '981713,981647,981613,981590,981578';
imageSets[3] = '7441868,7441864,7441847,6634203,6634189,6634185,6634178,6634170,6634158,6634141,6634064,6634059,6633687,6633679,6633425,6633422,6633390,6633386,6633384,6633380,4212340,3772843,3772523,3772480,3772475,3772441,3245604,3245588,3245577,1917895,1917883,1917873,1917871,1279823,1279802,1279797,1279782,995780,995775,995767,981727,981725,981723,981722,981718,981715,981713,981709,981704,981700';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/donnesham/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/donnesham/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/donnesham/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/donnesham/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/donnesham/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/donnesham/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/donnesham/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/donnesham/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/donnesham/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/donnesham/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/donnesham/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/donnesham/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/donnesham/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/donnesham/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/donnesham/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/donnesham/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/donnesham/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/donnesham/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/donnesham/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/donnesham/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/donnesham/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/donnesham/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 = 'Donald Nesham Creative Images: ' + 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>';
	}
					
				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;
	}
}

			

