window.thumbnails = new Object();
												thumbnails[5919043] = new thumbnail(5919043,'334033','','Mistyshroud_thumb.jpg',130, 86,5,'photo_5919043.html');
												thumbnails[5921767] = new thumbnail(5921767,'334033','','A_view_from_a_Dartmoor_Tor_thumb.jpg',130, 74,5,'photo_5921767.html');
												thumbnails[5921838] = new thumbnail(5921838,'334033','','One-Eastbourne-morning_thumb.jpg',130, 86,5,'photo_5921838.html');
												thumbnails[5921844] = new thumbnail(5921844,'334033','','Winchelsea2_thumb.jpg',130, 86,5,'photo_5921844.html');
												thumbnails[5921875] = new thumbnail(5921875,'334033','','Winter_river_rapids_thumb.jpg',130, 87,5,'photo_5921875.html');
												thumbnails[5921883] = new thumbnail(5921883,'334033','','Up_up_and_away_thumb.jpg',130, 85,5,'photo_5921883.html');
												thumbnails[5921895] = new thumbnail(5921895,'334033','','Canary_Wharf_form_Greenwich_thumb.jpg',130, 86,5,'photo_5921895.html');
												thumbnails[5921906] = new thumbnail(5921906,'334033','','Down_river_thumb.jpg',130, 86,5,'photo_5921906.html');
												thumbnails[5921938] = new thumbnail(5921938,'334033','','Sunrise_over_Bodiam_thumb.jpg',130, 86,5,'photo_5921938.html');
												thumbnails[5921946] = new thumbnail(5921946,'334033','','Rugged_Dartmoor_thumb.jpg',130, 86,5,'photo_5921946.html');
												thumbnails[5921960] = new thumbnail(5921960,'334034','','Alltogerthernow_thumb.jpg',130, 85,5,'photo_5921960.html');
												thumbnails[5921970] = new thumbnail(5921970,'334034','','Fallow_Deer_thumb.jpg',130, 88,5,'photo_5921970.html');
												thumbnails[5921974] = new thumbnail(5921974,'334034','','Grey_Seal_thumb.jpg',130, 86,5,'photo_5921974.html');
												thumbnails[5921981] = new thumbnail(5921981,'334034','','Sweet_innocenece_thumb.jpg',130, 130,5,'photo_5921981.html');
												thumbnails[5921989] = new thumbnail(5921989,'334034','','Lil_ducky_thumb.jpg',130, 88,5,'photo_5921989.html');
												thumbnails[5921995] = new thumbnail(5921995,'334034','','poppysheep_thumb.jpg',130, 84,5,'photo_5921995.html');
												thumbnails[5921999] = new thumbnail(5921999,'334034','','Forever_Young_thumb.jpg',130, 97,5,'photo_5921999.html');
												thumbnails[5922008] = new thumbnail(5922008,'334034','','No_title_thumb.jpg',130, 87,5,'photo_5922008.html');
												thumbnails[5922012] = new thumbnail(5922012,'334034','','Dave_16_crop_thumb.jpg',130, 85,5,'photo_5922012.html');
												thumbnails[5922017] = new thumbnail(5922017,'334034','','Peek_a_boo_thumb.jpg',130, 172,5,'photo_5922017.html');
												thumbnails[5922036] = new thumbnail(5922036,'334217','','Youre_not_welcome_here_thumb.jpg',130, 112,5,'photo_5922036.html');
												thumbnails[5922038] = new thumbnail(5922038,'334217','','Trash_TV_thumb.jpg',130, 86,5,'photo_5922038.html');
												thumbnails[5922050] = new thumbnail(5922050,'334217','','Which_way_first_thumb.jpg',130, 86,5,'photo_5922050.html');
												thumbnails[5922053] = new thumbnail(5922053,'334217','','Snub_n_Mishfit_decayed_thumb.jpg',130, 89,5,'photo_5922053.html');
												thumbnails[5922058] = new thumbnail(5922058,'334217','','A_picture_of_sorrow_thumb.jpg',130, 86,5,'photo_5922058.html');
												thumbnails[5922064] = new thumbnail(5922064,'334217','','Drawn_toward_the_light_thumb.jpg',130, 88,5,'photo_5922064.html');
												thumbnails[5922070] = new thumbnail(5922070,'334217','','Liars_room_thumb.jpg',130, 86,5,'photo_5922070.html');
												thumbnails[5922089] = new thumbnail(5922089,'334217','','Mystery_staicase_thumb.jpg',130, 191,5,'photo_5922089.html');
												thumbnails[5922481] = new thumbnail(5922481,'334247','','70s_Dream_thumb.jpg',130, 182,5,'photo_5922481.html');
												thumbnails[5922482] = new thumbnail(5922482,'334034','','1969_in_the_sunshine_thumb.jpg',130, 86,5,'photo_5922482.html');
												thumbnails[5922483] = new thumbnail(5922483,'334247','','Bluebell_impressions_thumb.jpg',130, 89,5,'photo_5922483.html');
												thumbnails[5922484] = new thumbnail(5922484,'334034','','The_bitter_end_thumb.jpg',130, 88,5,'photo_5922484.html');
												thumbnails[5922485] = new thumbnail(5922485,'334247','','Its_all_me_thumb.jpg',130, 182,5,'photo_5922485.html');
												thumbnails[5922486] = new thumbnail(5922486,'334034','','Joy_of_Spring_thumb.jpg',130, 86,5,'photo_5922486.html');
												thumbnails[5922487] = new thumbnail(5922487,'334247','','Shadow_dweller_thumb.jpg',130, 196,5,'photo_5922487.html');
												thumbnails[5922488] = new thumbnail(5922488,'334247','','60s_Holiday_memories_thumb.jpg',130, 86,5,'photo_5922488.html');
												thumbnails[5922489] = new thumbnail(5922489,'334034','','Faded_pre-madonna_thumb.jpg',130, 86,5,'photo_5922489.html');
												thumbnails[5922490] = new thumbnail(5922490,'334247','','Seaside_memories_thumb.jpg',130, 65,5,'photo_5922490.html');
												thumbnails[5922494] = new thumbnail(5922494,'334217','','668_Neighbor_of_the_Beast_thumb.jpg',130, 88,5,'photo_5922494.html');
												thumbnails[5922496] = new thumbnail(5922496,'334217','','Behind_every_door_thumb.jpg',130, 87,5,'photo_5922496.html');
												thumbnails[5922500] = new thumbnail(5922500,'334217','','In_memoriam_thumb.jpg',130, 86,5,'photo_5922500.html');
												thumbnails[5922508] = new thumbnail(5922508,'334217','','Forgotten_box_of_creativity_thumb.jpg',130, 86,5,'photo_5922508.html');
												thumbnails[5922510] = new thumbnail(5922510,'334033','','After_hours_thumb.jpg',130, 86,5,'photo_5922510.html');
												thumbnails[5922512] = new thumbnail(5922512,'334033','','Scotney_detail_enhanced_thumb.jpg',130, 86,5,'photo_5922512.html');
												thumbnails[5922523] = new thumbnail(5922523,'334033','','Rock_and_Pool_thumb.jpg',130, 86,5,'photo_5922523.html');
												thumbnails[5922525] = new thumbnail(5922525,'334033','','Warm_view_on_a_cold_morning_thumb.jpg',130, 61,5,'photo_5922525.html');
												thumbnails[5922527] = new thumbnail(5922527,'334033','','Moon_lit_night_thumb.jpg',130, 185,5,'photo_5922527.html');
												thumbnails[5922531] = new thumbnail(5922531,'334034','','Sumatran_Tiger_thumb.jpg',130, 86,5,'photo_5922531.html');
												thumbnails[5922532] = new thumbnail(5922532,'334034','','Bluebell_Bunny_thumb.jpg',130, 86,5,'photo_5922532.html');
												thumbnails[5922533] = new thumbnail(5922533,'334034','','Ive_been_spotted_thumb.jpg',130, 86,5,'photo_5922533.html');
												thumbnails[5922535] = new thumbnail(5922535,'334034','','Sleepy_head_thumb.jpg',130, 86,5,'photo_5922535.html');
												thumbnails[5922537] = new thumbnail(5922537,'334034','','Mute_swan_cygnet_thumb.jpg',130, 189,5,'photo_5922537.html');
												thumbnails[5922547] = new thumbnail(5922547,'334217','','Autumn_leaf_on_a_derelict_floor_thumb.jpg',130, 86,5,'photo_5922547.html');
												thumbnails[5922550] = new thumbnail(5922550,'334034','','Daisydream_thumb.jpg',130, 196,5,'photo_5922550.html');
												thumbnails[5922551] = new thumbnail(5922551,'334247','','Filthy-passion-Edit-2_thumb.jpg',130, 130,5,'photo_5922551.html');
												thumbnails[5922552] = new thumbnail(5922552,'334247','','New_Rose_thumb.jpg',130, 86,5,'photo_5922552.html');
												thumbnails[6272322] = new thumbnail(6272322,'334033','','Moody-Marshland_thumb.jpg',130, 86,5,'photo_6272322.html');
												thumbnails[6272324] = new thumbnail(6272324,'334217','','Abandoned-Morris-1800_thumb.jpg',130, 86,5,'photo_6272324.html');
												thumbnails[6272327] = new thumbnail(6272327,'334217','','Backalley-beauty_thumb.jpg',130, 86,5,'photo_6272327.html');
												thumbnails[6272329] = new thumbnail(6272329,'334217','','Detritus-lane_thumb.jpg',130, 86,5,'photo_6272329.html');
												thumbnails[6272334] = new thumbnail(6272334,'334217','','Left-behind_thumb.jpg',130, 124,5,'photo_6272334.html');
												thumbnails[6272340] = new thumbnail(6272340,'334033','','Bilinggapsunset_thumb.jpg',130, 86,5,'photo_6272340.html');
												thumbnails[6272345] = new thumbnail(6272345,'334033','','Time_to_go_home_thumb.jpg',130, 193,5,'photo_6272345.html');
												thumbnails[6272347] = new thumbnail(6272347,'334033','','Beautiful_Bodiam_thumb.jpg',130, 86,5,'photo_6272347.html');
												thumbnails[6272350] = new thumbnail(6272350,'334033','','Bodiam-morn_thumb.jpg',130, 195,5,'photo_6272350.html');
												thumbnails[6272366] = new thumbnail(6272366,'334247','','Autumnfalls_thumb.jpg',130, 86,5,'photo_6272366.html');
												thumbnails[6272368] = new thumbnail(6272368,'334247','','Ballon_shapes_thumb.jpg',130, 88,5,'photo_6272368.html');
												thumbnails[6272371] = new thumbnail(6272371,'334247','','watercolours_thumb.jpg',130, 92,5,'photo_6272371.html');
												thumbnails[6272373] = new thumbnail(6272373,'334247','','Discarded_doccuments_thumb.jpg',130, 86,5,'photo_6272373.html');
												thumbnails[6903456] = new thumbnail(6903456,'334217','','Grime-ophone_thumb.jpg',130, 86,5,'photo_6903456.html');
												thumbnails[6903462] = new thumbnail(6903462,'334217','','We-are-one_thumb.jpg',130, 94,5,'photo_6903462.html');
												thumbnails[6903473] = new thumbnail(6903473,'334217','','No-longer-cosy_thumb.jpg',130, 86,5,'photo_6903473.html');
												thumbnails[7185680] = new thumbnail(7185680,'388286','','Winter-Robin_thumb.jpg',130, 95,5,'photo_7185680.html');
												thumbnails[7185691] = new thumbnail(7185691,'388286','','Window-impressions_thumb.jpg',130, 195,5,'photo_7185691.html');
												thumbnails[7185832] = new thumbnail(7185832,'388286','','Rainy-flower_thumb.jpg',130, 122,5,'photo_7185832.html');
												thumbnails[7186022] = new thumbnail(7186022,'388286','','A-winter-strol-in-the-park_thumb.jpg',130, 86,5,'photo_7186022.html');
												thumbnails[7186029] = new thumbnail(7186029,'388286','','Winter-berries_thumb.jpg',130, 174,5,'photo_7186029.html');
												thumbnails[7186050] = new thumbnail(7186050,'388286','','Robin-red-breast_thumb.jpg',130, 86,5,'photo_7186050.html');
												thumbnails[7186080] = new thumbnail(7186080,'388286','','Come-closer_thumb.jpg',130, 102,5,'photo_7186080.html');
												thumbnails[7186205] = new thumbnail(7186205,'388286','','Park-snofa_thumb.jpg',130, 86,5,'photo_7186205.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[334033] = new gallery(334033,'6272350,6272347,6272345,6272340,6272322,5922527,5922525,5922523,5922512,5922510','Scenic','gallery',[5919043,5921767,5921838,5921844,5921875,5921883,5921895,5921906,5921938,5921946,5922510,5922512,5922523,5922525,5922527,6272322,6272340,6272345,6272347,6272350],0, 1, '', 'gallery_334033.html',0,0);
				  					galleries[334034] = new gallery(334034,'5922550,5922537,5922535,5922533,5922532,5922531,5922489,5922486,5922484,5922482','Nature','gallery',[5921960,5921970,5921974,5921981,5921989,5921995,5921999,5922008,5922012,5922017,5922482,5922484,5922486,5922489,5922531,5922532,5922533,5922535,5922537,5922550],0, 1, '', 'gallery_334034.html',0,0);
				  					galleries[334217] = new gallery(334217,'6903473,6903462,6903456,6272334,6272329,6272327,6272324,5922547,5922508,5922500','Urbex','gallery',[5922036,5922038,5922050,5922053,5922058,5922064,5922070,5922089,5922494,5922496,5922500,5922508,5922547,6272324,6272327,6272329,6272334,6903456,6903462,6903473],0, 1, '', 'gallery_334217.html',0,0);
				  					galleries[334247] = new gallery(334247,'6272373,6272371,6272368,6272366,5922552,5922551,5922490,5922488,5922487,5922485','Creative','gallery',[5922481,5922483,5922485,5922487,5922488,5922490,5922551,5922552,6272366,6272368,6272371,6272373],0, 1, '', 'gallery_334247.html',0,0);
				  					galleries[388286] = new gallery(388286,'7186205,7186080,7186050,7186029,7186022,7185832,7185691,7185680','Selective focus','gallery',[7185680,7185691,7185832,7186022,7186029,7186050,7186080,7186205],0, 1, '', 'gallery_388286.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '7186050,7185832,6903473,6903462,6903456,6272327,5921974,5921838,5919043';
imageSets[3] = '7186205,7186080,7186050,7186029,7186022,7185832,7185691,7185680,6903473,6903462,6903456,6272373,6272371,6272368,6272366,6272350,6272347,6272345,6272340,6272334,6272329,6272327,6272324,6272322,5922552,5922551,5922550,5922547,5922537,5922535,5922533,5922532,5922531,5922527,5922525,5922523,5922512,5922510,5922508,5922500,5922496,5922494,5922490,5922489,5922488,5922487,5922486,5922485,5922484,5922483';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/Lensflaredave/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/Lensflaredave/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/Lensflaredave/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/Lensflaredave/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/Lensflaredave/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/Lensflaredave/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/Lensflaredave/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/Lensflaredave/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/Lensflaredave/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/Lensflaredave/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/Lensflaredave/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/Lensflaredave/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/Lensflaredave/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/Lensflaredave/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/Lensflaredave/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/Lensflaredave/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/Lensflaredave/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/Lensflaredave/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/Lensflaredave/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/Lensflaredave/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/Lensflaredave/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/Lensflaredave/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 = 'DaveWares Photography: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
	    var options = {photoinfominwidth:200};	    		options.photoinfoadjacent = true;			      		      options.centre = true;	          	        	      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;
	}
}

			

