window.thumbnails = new Object();
												thumbnails[3422119] = new thumbnail(3422119,'209160','Crocosmia','Crocosmia_thumb.jpg',130, 130,1,'photo_3422119.html');
												thumbnails[3422131] = new thumbnail(3422131,'209160','Cuckoo Flower','Cuckoo_flower_thumb.jpg',130, 130,1,'photo_3422131.html');
												thumbnails[3422135] = new thumbnail(3422135,'209160','Daffodil','Daffodill_thumb.jpg',130, 130,1,'photo_3422135.html');
												thumbnails[3422142] = new thumbnail(3422142,'209160','Daisies','Daisies1_thumb.jpg',130, 130,1,'photo_3422142.html');
												thumbnails[3422145] = new thumbnail(3422145,'209160','Wild Iris','Iris_thumb.jpg',130, 130,1,'photo_3422145.html');
												thumbnails[3422148] = new thumbnail(3422148,'209160','Primroses','Primroses_thumb.jpg',130, 130,1,'photo_3422148.html');
												thumbnails[3422150] = new thumbnail(3422150,'209160','Field Scabius','Scabius_thumb.jpg',130, 130,1,'photo_3422150.html');
												thumbnails[3422152] = new thumbnail(3422152,'209160','Sea Campion','Sea_Campion_thumb.jpg',130, 130,1,'photo_3422152.html');
												thumbnails[3422155] = new thumbnail(3422155,'209160','Thistle','Thistle1_thumb.jpg',130, 130,1,'photo_3422155.html');
												thumbnails[3422157] = new thumbnail(3422157,'209160','Thrift','Thrift1_thumb.jpg',130, 130,1,'photo_3422157.html');
												thumbnails[3463940] = new thumbnail(3463940,'211745','Glen Affric, Highland','Affric_thumb.jpg',130, 81,1,'photo_3463940.html');
												thumbnails[3463943] = new thumbnail(3463943,'211745','Standing Stones at Brodgar, Orkney','Brogar_thumb.jpg',130, 81,1,'photo_3463943.html');
												thumbnails[3463944] = new thumbnail(3463944,'211745','Bay on the west side of Eriskay','Eriskay_thumb.jpg',130, 81,1,'photo_3463944.html');
												thumbnails[3463947] = new thumbnail(3463947,'211745','Glamaig and Carn Dearg, Isle of Skye','Glamaig_thumb.jpg',130, 81,1,'photo_3463947.html');
												thumbnails[3463950] = new thumbnail(3463950,'211745','Lerwick Harbour, Shetland','Lerwick Harbour_thumb.jpg',130, 81,1,'photo_3463950.html');
												thumbnails[3463951] = new thumbnail(3463951,'211745','Loch Chon, Trossachs','Loch Chon_thumb.jpg',130, 81,1,'photo_3463951.html');
												thumbnails[3463953] = new thumbnail(3463953,'211745','Slioch, northwest Highlands','Slioch_thumb.jpg',130, 81,1,'photo_3463953.html');
												thumbnails[3463957] = new thumbnail(3463957,'211745','The Storr, Isle of Skye','Storr_thumb.jpg',130, 81,1,'photo_3463957.html');
												thumbnails[3463965] = new thumbnail(3463965,'211745','Sumburgh, Shetland','Sumburgh_thumb.jpg',130, 81,1,'photo_3463965.html');
												thumbnails[3463968] = new thumbnail(3463968,'211745','Near Duncansclett, Shetland','Tombolo_thumb.jpg',130, 81,1,'photo_3463968.html');
												thumbnails[3463997] = new thumbnail(3463997,'211744','Near Armadale','Armadale_thumb.jpg',130, 81,1,'photo_3463997.html');
												thumbnails[3463998] = new thumbnail(3463998,'211744','Anchorage near Strollamus','Boats Scalpay_thumb.jpg',130, 81,1,'photo_3463998.html');
												thumbnails[3464000] = new thumbnail(3464000,'211744','Glamaig and Carn Dearg','Glamaig1_thumb.jpg',130, 81,1,'photo_3464000.html');
												thumbnails[3464001] = new thumbnail(3464001,'211744','Glen Sligachan','Glen_Sligachan1_thumb.jpg',130, 81,1,'photo_3464001.html');
												thumbnails[3464002] = new thumbnail(3464002,'211744','Isle of Harris from Duntulm','Harris_thumb.jpg',130, 81,1,'photo_3464002.html');
												thumbnails[3464003] = new thumbnail(3464003,'211744','Kilbride Grazings','Kilbride_thumb.jpg',130, 81,1,'photo_3464003.html');
												thumbnails[3464004] = new thumbnail(3464004,'211744','Loch Bracadale','Loch Bracadale_thumb.jpg',130, 81,1,'photo_3464004.html');
												thumbnails[3464007] = new thumbnail(3464007,'211744','Loch Fada & the Storr','Loch Fada_thumb.jpg',130, 81,1,'photo_3464007.html');
												thumbnails[3464008] = new thumbnail(3464008,'211744','Sgurr nan Gillean','Sgurr nan Gillean_thumb.jpg',130, 81,1,'photo_3464008.html');
												thumbnails[3464009] = new thumbnail(3464009,'211744','The Trotternish Ridge','Trotternish Ridge_thumb.jpg',130, 81,1,'photo_3464009.html');
												thumbnails[3475296] = new thumbnail(3475296,'209160','Buy Flowers Cards','Flowers Box_thumb.jpg',130, 81,1,'photo_3475296.html');
												thumbnails[3475299] = new thumbnail(3475299,'211745','Buy Highlands & Islands Cards','Hi Box_thumb.jpg',130, 81,1,'photo_3475299.html');
												thumbnails[3475302] = new thumbnail(3475302,'211744','Buy Isle of Skye Cards','Skye Box_thumb.jpg',130, 81,1,'photo_3475302.html');
												thumbnails[3487395] = new thumbnail(3487395,'213270','After work','After work_thumb.jpg',130, 81,1,'photo_3487395.html');
												thumbnails[3487397] = new thumbnail(3487397,'213270','Being boulder','Being Boulder_thumb.jpg',130, 81,1,'photo_3487397.html');
												thumbnails[3487398] = new thumbnail(3487398,'213270','Networking','Networking_thumb.jpg',130, 81,1,'photo_3487398.html');
												thumbnails[3487399] = new thumbnail(3487399,'213270','Pot shot','Pot Shot_thumb.jpg',130, 81,1,'photo_3487399.html');
												thumbnails[3487400] = new thumbnail(3487400,'213270','Ring tones','Ring tones_thumb.jpg',130, 81,1,'photo_3487400.html');
												thumbnails[3487401] = new thumbnail(3487401,'213270','Rock stars','Rocks_thumb.jpg',130, 81,1,'photo_3487401.html');
												thumbnails[3487402] = new thumbnail(3487402,'213270','See wall','See Wall_thumb.jpg',130, 81,1,'photo_3487402.html');
												thumbnails[3487405] = new thumbnail(3487405,'213270','Shell suits','Shell suits_thumb.jpg',130, 81,1,'photo_3487405.html');
												thumbnails[3487406] = new thumbnail(3487406,'213270','Smash hit','Smash hit_thumb.jpg',130, 81,1,'photo_3487406.html');
												thumbnails[3487408] = new thumbnail(3487408,'213270','Taking a break','Taking a break_thumb.jpg',130, 81,1,'photo_3487408.html');
												thumbnails[3488032] = new thumbnail(3488032,'213270','Buy Different Perspectives Cards','Diff Box_thumb.jpg',130, 81,1,'photo_3488032.html');
												thumbnails[3955151] = new thumbnail(3955151,'239573','\"Head to Head\"','Head_to_Head_thumb.jpg',130, 130,1,'photo_3955151.html');
												thumbnails[3955154] = new thumbnail(3955154,'239573','Field Scabius','Field_Scabius_thumb.jpg',130, 130,1,'photo_3955154.html');
												thumbnails[3955192] = new thumbnail(3955192,'239573','Yellow Flag Iris','Yellow_Flag_Iris_thumb.jpg',130, 130,1,'photo_3955192.html');
												thumbnails[3955196] = new thumbnail(3955196,'239573','Glen Sligachan, Isle of Skye','Glen_Sligachan2_thumb.jpg',130, 81,1,'photo_3955196.html');
												thumbnails[3955221] = new thumbnail(3955221,'239573','The Old Harbour, Lerwick, Shetland','Lerwick_Harbour1_thumb.jpg',130, 81,1,'photo_3955221.html');
												thumbnails[3955226] = new thumbnail(3955226,'239573','Loch Bracadale, Isle of Skye','Loch_Bracadale1_thumb.jpg',130, 81,1,'photo_3955226.html');
												thumbnails[3955229] = new thumbnail(3955229,'239573','\"Rock Stars\"','Rock_Stars_thumb.jpg',130, 81,1,'photo_3955229.html');
												thumbnails[3955232] = new thumbnail(3955232,'239573','\"Shell Suits\"','Shell_Suits1_thumb.jpg',130, 81,1,'photo_3955232.html');
												thumbnails[3955239] = new thumbnail(3955239,'239573','Sumburgh, Shetland','Sumburgh1_thumb.jpg',130, 81,1,'photo_3955239.html');
												thumbnails[3955332] = new thumbnail(3955332,'239573','Neist Point, Isle of Skye','Neist_Light_ps_thumb.jpg',130, 81,1,'photo_3955332.html');
												thumbnails[3967735] = new thumbnail(3967735,'239573','Buy Cards and Support Children in Colombia','IMC_Box_1_thumb.jpg',130, 80,1,'photo_3967735.html');
												thumbnails[6687490] = new thumbnail(6687490,'365003','Achnahaird Bay','Achnahaird-Beach_thumb.jpg',130, 97,1,'photo_6687490.html');
												thumbnails[6688867] = new thumbnail(6688867,'365003','Neist Point, Isle of Skye','Neist-Light_thumb.jpg',130, 96,1,'photo_6688867.html');
												thumbnails[6688922] = new thumbnail(6688922,'365003','Loch Leathan and The Storr','Storr-Lochs_thumb.jpg',130, 97,1,'photo_6688922.html');
												thumbnails[6689904] = new thumbnail(6689904,'365003','Scots Pine by Loch Maree','Scots-pine_thumb.jpg',130, 96,1,'photo_6689904.html');
												thumbnails[6688931] = new thumbnail(6688931,'365003','Greshornish Woodland','Sycamore-Greshornish_thumb.jpg',130, 184,1,'photo_6688931.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[209160] = new gallery(209160,'3422131','Flower Cards','gallery',[3422119,3422131,3422135,3422142,3422145,3422148,3422150,3422152,3422155,3422157,3475296],0, 0, '', 'gallery_209160.html',0,0);
				  					galleries[211744] = new gallery(211744,'3464004','Isle of Skye Cards','gallery',[3463997,3463998,3464000,3464001,3464002,3464003,3464004,3464007,3464008,3464009,3475302],0, 0, '', 'gallery_211744.html',0,0);
				  					galleries[211745] = new gallery(211745,'3463947','Highlands and Islands Cards','gallery',[3463940,3463943,3463944,3463947,3463950,3463951,3463953,3463957,3463965,3463968,3475299],0, 0, '', 'gallery_211745.html',0,0);
				  					galleries[213270] = new gallery(213270,'3487405','Different Perspectives Cards','gallery',[3487395,3487397,3487398,3487399,3487400,3487401,3487402,3487405,3487406,3487408,3488032],0, 0, '', 'gallery_213270.html',0,0);
				  					galleries[239573] = new gallery(239573,'3955332','Supporting Children in Colombia Cards','gallery',[3955151,3955154,3955192,3955196,3955221,3955226,3955229,3955232,3955239,3955332,3967735],0, 0, '', 'gallery_239573.html',0,0);
				  					galleries[365003] = new gallery(365003,'6689904,6688931,6688922,6688867,6687490','Prints','gallery',[6687490,6688867,6688922,6689904,6688931],0, 0, '', 'gallery_365003.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '6689904,6688922,3955332,3487405,3487399,3464000,3463998,3463957,3463950,3463940,3422145,3422131';
imageSets[2] = '3955332,3487405,3464004,3463947,3422131';
imageSets[3] = '6689904,6688931,6688922,6688867,6687490,3967735,3955332,3955239,3955232,3955229,3955226,3955221,3955196,3955192,3955154,3955151,3488032,3487408,3487406,3487405,3487402,3487401,3487400,3487399,3487398,3487397,3487395,3475302,3475299,3475296,3464009,3464008,3464007,3464004,3464003,3464002,3464001,3464000,3463998,3463997,3463968,3463965,3463957,3463953,3463951,3463950,3463947,3463944,3463943,3463940';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/martinplowman/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/martinplowman/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/martinplowman/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/martinplowman/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/martinplowman/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/martinplowman/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/martinplowman/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/martinplowman/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/martinplowman/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/martinplowman/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/martinplowman/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/martinplowman/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/martinplowman/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/martinplowman/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/martinplowman/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/martinplowman/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/martinplowman/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/martinplowman/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/martinplowman/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/martinplowman/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/martinplowman/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/martinplowman/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 = 'Martin Plowman - Pictures from Scotland: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
	    var options = {photoinfominwidth:200};	    		options.photoinfoadjacent = 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 = 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>';
	}
					
	temp = temp + this.fnGetPaymentInfo();
				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>Buy now using PayPal:</p>';
				temp = temp + '<p class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> &pound;' + (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="updateCartValue(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';
				
		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 + '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm">';
	temp = temp + '	<input type="hidden" name="item_option" value="' + item_option + '">';
	temp = temp + '	<input type="hidden" name="site" value="MARTINPLOWMAN">';
		temp = temp + '	<input type="hidden" name="item_number" value="'+ this.id +'">';
			temp = temp + '	<input type="hidden" name="quantity" value="1">';
								temp = temp + '	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\'\;" onmouseout="this.className=\'button\'\;" type="Button">';
			temp = temp + '	<input value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button" onclick="javascript:window.location=\'cart.html\'">';
	temp = temp + '</form>';
		temp = temp + '<div class="clearing">&nbsp;</div>';
	temp = temp + '<div id="confirmContainer">';
	temp = temp + '<div id="paymentConfirm">Item added to cart</div>';
	temp = temp + '</div>';
			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;
	}
}

		

