window.thumbnails = new Object();
												thumbnails[7971187] = new thumbnail(7971187,'','FishTail','FishTailWeb_thumb.jpg',130, 87,18,'#');
												thumbnails[7971188] = new thumbnail(7971188,'','TheLongWalk','TheLongWalkWeb_thumb.jpg',130, 195,18,'#');
												thumbnails[7971189] = new thumbnail(7971189,'','Thirst','ThirstWeb_thumb.jpg',130, 87,18,'#');
												thumbnails[2574604] = new thumbnail(2574604,'163961','Divers entering Chac Mool Cenote','Diving_Cenotes_thumb.jpg',130, 87,18,'photo_2574604.html');
												thumbnails[2574607] = new thumbnail(2574607,'163961','Light entering Chac Mool Cenote','Diving_In_Light_thumb.jpg',130, 87,18,'photo_2574607.html');
												thumbnails[2574610] = new thumbnail(2574610,'163961','Divers in Chac Mool Cenote','Diving_Cenotes2_thumb.jpg',130, 87,18,'photo_2574610.html');
												thumbnails[2574613] = new thumbnail(2574613,'163961','Snorkeler at Chac Mool Cenote','This_One_thumb.jpg',130, 87,18,'photo_2574613.html');
												thumbnails[2574623] = new thumbnail(2574623,'163961','Diver in Kukulkan Cenote','Diver_Passage_thumb.jpg',130, 87,18,'photo_2574623.html');
												thumbnails[2574633] = new thumbnail(2574633,'163961','Surface Light at Kukulkan Cenote','Cenotes_Opening_thumb.jpg',130, 87,18,'photo_2574633.html');
												thumbnails[2940278] = new thumbnail(2940278,'163959','Freediver','FreeDiverWeb_thumb.jpg',130, 86,18,'photo_2940278.html');
												thumbnails[2569749] = new thumbnail(2569749,'13363','Sunrise at Pez Maya','Pez Maya_Early Light1_thumb.jpg',130, 87,18,'photo_2569749.html');
												thumbnails[2574593] = new thumbnail(2574593,'13661','Red Rose','Red_Red Rose_thumb.jpg',130, 86,18,'photo_2574593.html');
												thumbnails[2574644] = new thumbnail(2574644,'13663','Royal Tern','Bird_thumb.jpg',130, 87,18,'photo_2574644.html');
												thumbnails[7555446] = new thumbnail(7555446,'163961','Blue Light','BlueLight_1_D9E9D9CC-24E8-5EC4-4FBF102FC0216F43_thumb.jpg',130, 87,18,'photo_7555446.html');
												thumbnails[2940341] = new thumbnail(2940341,'13663','Peacock Display','PeacockFinal_thumb.jpg',130, 84,18,'photo_2940341.html');
												thumbnails[2570041] = new thumbnail(2570041,'13363','Sunset at Kilchurn Castle','Scottish_Castle_thumb.jpg',130, 86,18,'photo_2570041.html');
												thumbnails[2574567] = new thumbnail(2574567,'13661','Gerbera Daisy','Bright Red_Flower_thumb.jpg',130, 87,18,'photo_2574567.html');
												thumbnails[2574640] = new thumbnail(2574640,'13663','Iguana Pose','Lizard_thumb.jpg',130, 87,18,'photo_2574640.html');
												thumbnails[2576715] = new thumbnail(2576715,'163959','Floating Leaf','Water_Light_Leaf_thumb.jpg',130, 86,18,'photo_2576715.html');
												thumbnails[7555447] = new thumbnail(7555447,'163961','Inner Space','CaveDiver(sharper)_D9E9DE11-24E8-5EC4-4FAD6BB16EA86E30_thumb.jpg',130, 87,18,'photo_7555447.html');
												thumbnails[2574573] = new thumbnail(2574573,'13661','Tulip','Poppy_Flower_thumb.jpg',130, 90,18,'photo_2574573.html');
												thumbnails[2574641] = new thumbnail(2574641,'13663','Iguana ','Lizard2_thumb.jpg',130, 87,18,'photo_2574641.html');
												thumbnails[2574535] = new thumbnail(2574535,'163959','Norwegian Passage','Norwegian_Passage_thumb.jpg',130, 195,18,'photo_2574535.html');
												thumbnails[2574578] = new thumbnail(2574578,'13661','Water Droplet on Petal','Waterdrop_Flower_thumb.jpg',130, 85,18,'photo_2574578.html');
												thumbnails[2574643] = new thumbnail(2574643,'13663','Lizard on Wall','Lizard_Camoflage_thumb.jpg',130, 208,18,'photo_2574643.html');
												thumbnails[2574591] = new thumbnail(2574591,'13661','Pink Lilly','Pink_Flower_thumb.jpg',130, 86,18,'photo_2574591.html');
												thumbnails[2574647] = new thumbnail(2574647,'13663','Peacock','Peacock_thumb.jpg',130, 198,18,'photo_2574647.html');
												thumbnails[2940276] = new thumbnail(2940276,'13363','Green Fields','greenfieldsWEB2_thumb.jpg',130, 86,18,'photo_2940276.html');
												thumbnails[2570061] = new thumbnail(2570061,'13363','Waterfall','Sgwd Ye Eira_Falls_thumb.jpg',130, 86,18,'photo_2570061.html');
												thumbnails[2574542] = new thumbnail(2574542,'163959','Palm Tree','Palm_Pez Maya_thumb.jpg',130, 195,18,'photo_2574542.html');
												thumbnails[2574576] = new thumbnail(2574576,'13661','Astromeria','Purple_Flower_thumb.jpg',130, 85,18,'photo_2574576.html');
												thumbnails[2570073] = new thumbnail(2570073,'13363','Water and Rocks','Sgwd Ye Eira_Brecons_thumb.jpg',130, 86,18,'photo_2570073.html');
												thumbnails[2574543] = new thumbnail(2574543,'163959','Palm Trees','Palms_Pez Maya_thumb.jpg',130, 195,18,'photo_2574543.html');
												thumbnails[2574557] = new thumbnail(2574557,'13661','Green Buds','Buds_Closeup_thumb.jpg',130, 84,18,'photo_2574557.html');
												thumbnails[2599854] = new thumbnail(2599854,'13661','Light and Leaves','leaflightFinal4_thumb.jpg',130, 86,18,'photo_2599854.html');
												thumbnails[2940295] = new thumbnail(2940295,'13363','Seashore','BlackWhiteFinal_thumb.jpg',130, 86,18,'photo_2940295.html');
												thumbnails[2569930] = new thumbnail(2569930,'13363','Mountain Village','Norwegian_Village_thumb.jpg',130, 87,18,'photo_2569930.html');
												thumbnails[2574556] = new thumbnail(2574556,'13661','Leaf Structure','Leaf_Detail_thumb.jpg',130, 87,18,'photo_2574556.html');
												thumbnails[2574563] = new thumbnail(2574563,'13661','Flower Bud','Bulb_Flower_thumb.jpg',130, 177,18,'photo_2574563.html');
												thumbnails[2576697] = new thumbnail(2576697,'13661','Water Droplets on Kaffir Lime Leaf','Green_Drops_thumb.jpg',130, 191,18,'photo_2576697.html');
												thumbnails[2940317] = new thumbnail(2940317,'13363','Whipsidery Beach','BeachFrameFinal_thumb.jpg',130, 85,18,'photo_2940317.html');
												thumbnails[2569995] = new thumbnail(2569995,'13363','Golitha Falls','Golitha_Falls_thumb.jpg',130, 185,18,'photo_2569995.html');
												thumbnails[2940285] = new thumbnail(2940285,'163961','Blue Water Silhouette','BlueWaterWeb_thumb.jpg',130, 195,18,'photo_2940285.html');
												thumbnails[2570160] = new thumbnail(2570160,'13363','Flowing Water','Lynmouth_Devon_thumb.jpg',130, 196,18,'photo_2570160.html');
												thumbnails[2570157] = new thumbnail(2570157,'13363','Waterfall over the Baie des Anges','Parc Du Chateau_thumb.jpg',130, 197,18,'photo_2570157.html');
												thumbnails[2570071] = new thumbnail(2570071,'13363','Englands Highest Waterfall','Canonteign_Falls_thumb.jpg',130, 192,18,'photo_2570071.html');
												thumbnails[2946740] = new thumbnail(2946740,'13363','Sgwd Y Pannwr Waterfall','WaterfallSampleFinal2_thumb.jpg',130, 195,18,'photo_2946740.html');
												thumbnails[2599825] = new thumbnail(2599825,'13363','Green Forest','greenForest_thumb.jpg',130, 199,18,'photo_2599825.html');
												thumbnails[2599837] = new thumbnail(2599837,'13363','New Forest Tree','GreenTree1_thumb.jpg',130, 200,18,'photo_2599837.html');
												thumbnails[2569939] = new thumbnail(2569939,'13363','Caribbean Beach  ','Pez Maya_Carribean Sea_thumb.jpg',130, 195,18,'photo_2569939.html');
												thumbnails[2940359] = new thumbnail(2940359,'13363','Driftwood','WoodCol2_thumb.jpg',130, 195,18,'photo_2940359.html');
												thumbnails[2569952] = new thumbnail(2569952,'13363','Dawn through Palm Leaves','Pez Maya_Sunrise_thumb.jpg',130, 195,18,'photo_2569952.html');
												thumbnails[2570034] = new thumbnail(2570034,'13363','Monaco at Night','Monaco_Steps_thumb.jpg',130, 198,18,'photo_2570034.html');
												thumbnails[2570044] = new thumbnail(2570044,'13363','Restaurant Atmosphere','Restaurant_Atmosphere_thumb.jpg',130, 194,18,'photo_2570044.html');
												thumbnails[2570019] = new thumbnail(2570019,'13363','Lighthouse ','Portland_Bill_thumb.jpg',130, 192,18,'photo_2570019.html');
												thumbnails[2570017] = new thumbnail(2570017,'13363','Window to Blue Skies','Kimmeridge_Keyhole_thumb.jpg',130, 183,18,'photo_2570017.html');
												thumbnails[2570053] = new thumbnail(2570053,'13363','Silhouette of Clavell Tower','Kimmeridge_Tower_thumb.jpg',130, 192,18,'photo_2570053.html');
												thumbnails[2570000] = new thumbnail(2570000,'13363','Highland Path','Highland_Path_thumb.jpg',130, 197,18,'photo_2570000.html');
												thumbnails[2570036] = new thumbnail(2570036,'13363','Sunset at Perranporth Beach','Perranporth_Beach_thumb.jpg',130, 196,18,'photo_2570036.html');
												thumbnails[2570026] = new thumbnail(2570026,'13363','Blue Waters','Loch Blue_Scotland_thumb.jpg',130, 196,18,'photo_2570026.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[163961] = new gallery(163961,'2574633','Underwater','gallery',[2574604,2574607,2574610,2574613,2574623,2574633,7555446,7555447,2940285],0, 0, '', 'gallery_163961.html',0,0);
				  					galleries[13363] = new gallery(13363,'2569749','Landscape','gallery',[2569749,2570041,2940276,2570061,2570073,2940295,2569930,2940317,2569995,2570160,2570157,2570071,2946740,2599825,2599837,2569939,2940359,2569952,2570034,2570044,2570019,2570017,2570053,2570000,2570036,2570026],0, 0, '', 'gallery_13363.html',0,0);
				  					galleries[13661] = new gallery(13661,'2574567','Flowers','gallery',[2574593,2574567,2574573,2574578,2574591,2574576,2574557,2599854,2574556,2574563,2576697],0, 0, '', 'gallery_13661.html',0,0);
				  					galleries[13663] = new gallery(13663,'2574644','Wildlife','gallery',[2574644,2940341,2574640,2574641,2574643,2574647],0, 0, '', 'gallery_13663.html',0,0);
				  					galleries[163959] = new gallery(163959,'2940278,2576715,2574543,2574542,2574535','Black & White','gallery',[2940278,2576715,2574535,2574542,2574543],0, 0, '', 'gallery_163959.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '2940278,2576715,2574644,2574633,2574613,2574567,2570073,2570061,2570041,2569749';
imageSets[2] = '2574644,2574633,2574567,2569749';
imageSets[3] = '7971189,7971188,7971187,7555447,7555446,2946740,2940359,2940341,2940317,2940295,2940285,2940278,2940276,2599854,2599837,2599825,2576715,2576697,2574647,2574644,2574643,2574641,2574640,2574633,2574623,2574613,2574610,2574607,2574604,2574593,2574591,2574578,2574576,2574573,2574567,2574563,2574557,2574556,2574543,2574542,2574535,2570160,2570157,2570073,2570071,2570061,2570053,2570044,2570041,2570036';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/frankie/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/frankie/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/frankie/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/frankie/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/frankie/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/frankie/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/frankie/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/frankie/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/frankie/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/frankie/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/frankie/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/frankie/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/frankie/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/frankie/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/frankie/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/frankie/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/frankie/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/frankie/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/frankie/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/frankie/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/frankie/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/frankie/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 = 'Tim Taylor 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>';
	}
					
	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="FRANKIE">';
		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;
	}
}

			

