window.thumbnails = new Object();
												thumbnails[2249451] = new thumbnail(2249451,'','','All-4-12s1_thumb.jpg',130, 130,32,'#');
												thumbnails[7357725] = new thumbnail(7357725,'','','Louise-and-Kevin_MG_3324-copy_thumb.jpg',160, 107,32,'#');
												thumbnails[7357730] = new thumbnail(7357730,'','','Louise-and-Kevin_MG_3325-copy_thumb.jpg',160, 103,32,'#');
												thumbnails[7357736] = new thumbnail(7357736,'','','Louise-and-Kevin_MG_3353-copy_thumb.jpg',160, 107,32,'#');
												thumbnails[7357741] = new thumbnail(7357741,'','','Louise-and-KevinFCDS3147-copy_thumb.jpg',160, 107,32,'#');
												thumbnails[7357745] = new thumbnail(7357745,'','','Louise-and-KevinFCDS3148-copy_thumb.jpg',160, 107,32,'#');
												thumbnails[2129612] = new thumbnail(2129612,'147991',' ','Confetti_thumb.jpg',130, 186,32,'photo_2129612.html');
												thumbnails[2045410] = new thumbnail(2045410,'141571',' ','IMG_1603sunrise_thumb.gif',130, 194,32,'photo_2045410.html');
												thumbnails[2129601] = new thumbnail(2129601,'136684',' ','Barvaria_thumb.gif',130, 191,32,'photo_2129601.html');
												thumbnails[2129603] = new thumbnail(2129603,'136684',' ','Mint-Tins_thumb.gif',130, 87,32,'photo_2129603.html');
												thumbnails[2129605] = new thumbnail(2129605,'136684',' ','Mount-Doooom!_thumb.gif',130, 90,32,'photo_2129605.html');
												thumbnails[2129607] = new thumbnail(2129607,'147990','','IMG_4662-copy_thumb.gif',130, 195,32,'photo_2129607.html');
												thumbnails[2129611] = new thumbnail(2129611,'141572','','IMG_2749-01_thumb.jpg',130, 211,32,'photo_2129611.html');
												thumbnails[2129613] = new thumbnail(2129613,'147990','','IMG_4664-copy-BW-crop_thumb.jpg',130, 216,32,'photo_2129613.html');
												thumbnails[2129617] = new thumbnail(2129617,'147990','','IMG_4663-copy_thumb.gif',130, 195,32,'photo_2129617.html');
												thumbnails[2129618] = new thumbnail(2129618,'141571','','IMG_0184-01Shonah-BW_thumb.gif',130, 177,32,'photo_2129618.html');
												thumbnails[2129619] = new thumbnail(2129619,'141571','','Burka-Eyes-Final_thumb.jpg',130, 195,32,'photo_2129619.html');
												thumbnails[2129621] = new thumbnail(2129621,'141571','','IMG_3836-01adj,level,paint,_thumb.gif',130, 195,32,'photo_2129621.html');
												thumbnails[2129622] = new thumbnail(2129622,'141571','','IMG_3138mod-card1-FINAL_thumb.gif',130, 195,32,'photo_2129622.html');
												thumbnails[2249447] = new thumbnail(2249447,'147991','','IMG_9539-01-copy_thumb.gif',130, 195,32,'photo_2249447.html');
												thumbnails[2249448] = new thumbnail(2249448,'147991','','IMG_9693-01BW-grey-scale-co_thumb.gif',130, 177,32,'photo_2249448.html');
												thumbnails[2249453] = new thumbnail(2249453,'147991','','IMG_9658-01-copy_thumb.jpg',130, 195,32,'photo_2249453.html');
												thumbnails[3165570] = new thumbnail(3165570,'193840',' ','FCDS1156-01_thumb.jpg',130, 183,32,'photo_3165570.html');
												thumbnails[3165571] = new thumbnail(3165571,'193840',' ','FCDS1208-01_thumb.jpg',130, 183,32,'photo_3165571.html');
												thumbnails[4224501] = new thumbnail(4224501,'250561','','Claire-and-Richard-_MG_0109_thumb.jpg',130, 160,32,'photo_4224501.html');
												thumbnails[4224502] = new thumbnail(4224502,'250561','','Claire-and-Richard-_MG_0120_thumb.jpg',130, 195,32,'photo_4224502.html');
												thumbnails[4224504] = new thumbnail(4224504,'250561','','Claire-and-Richard-_MG_0176_thumb.jpg',130, 87,32,'photo_4224504.html');
												thumbnails[4224505] = new thumbnail(4224505,'250561','','Claire-and-Richard-_MG_0199_thumb.jpg',130, 200,32,'photo_4224505.html');
												thumbnails[4644282] = new thumbnail(4644282,'267895','','_MG_0596_thumb.jpg',130, 116,32,'photo_4644282.html');
												thumbnails[4644298] = new thumbnail(4644298,'267895','','_MG_0839-copy_thumb.jpg',130, 203,32,'photo_4644298.html');
												thumbnails[4644299] = new thumbnail(4644299,'267895','','_MG_1019-copy_thumb.jpg',130, 129,32,'photo_4644299.html');
												thumbnails[7357721] = new thumbnail(7357721,'397265','','Louise-and-Kevin_MG_3265-copy_thumb.jpg',160, 107,32,'photo_7357721.html');
												thumbnails[2129620] = new thumbnail(2129620,'141571','','IMG_0187-01_thumb.gif',130, 195,32,'photo_2129620.html');
												thumbnails[4224493] = new thumbnail(4224493,'250561',' ','Claire-and-Richard-_MG_0086_thumb.jpg',130, 195,32,'photo_4224493.html');
												thumbnails[4644285] = new thumbnail(4644285,'267895',' ','_MG_0774-copy_thumb.jpg',130, 195,32,'photo_4644285.html');
												thumbnails[4644289] = new thumbnail(4644289,'267895','','_MG_0797art-pass-copy_thumb.jpg',130, 213,32,'photo_4644289.html');
												thumbnails[7339828] = new thumbnail(7339828,'397265','','Louise_and_Kevin_MG_3117_copy_thumb.jpg',115, 160,32,'photo_7339828.html');
												thumbnails[7339831] = new thumbnail(7339831,'397265','','Louise_and_Kevin_MG_3235_copy_thumb.jpg',113, 160,32,'photo_7339831.html');
												thumbnails[7339833] = new thumbnail(7339833,'397265','','Louise_and_KevinFCDS3161_copy_thumb.jpg',106, 160,32,'photo_7339833.html');
												thumbnails[7339835] = new thumbnail(7339835,'397265','','Louise-and-Kevin_MG_3333bw-copy_thumb.jpg',160, 107,32,'photo_7339835.html');
												thumbnails[7339836] = new thumbnail(7339836,'397265','','Louise-and-Kevin_MG_3586-copy_thumb.jpg',160, 107,32,'photo_7339836.html');
												thumbnails[7339834] = new thumbnail(7339834,'397265','','Louise-and-Kevin_MG_3223-copy_thumb.jpg',160, 116,32,'photo_7339834.html');
												thumbnails[2129609] = new thumbnail(2129609,'141572',' ','J-and-S_thumb.jpg',130, 195,32,'photo_2129609.html');
												thumbnails[7339829] = new thumbnail(7339829,'397265','','Louise_and_Kevin_MG_3175_copy_thumb.jpg',107, 160,32,'photo_7339829.html');
												thumbnails[4644294] = new thumbnail(4644294,'267895','','_MG_0828-copy_thumb.jpg',130, 87,32,'photo_4644294.html');
												thumbnails[2129606] = new thumbnail(2129606,'147990',' ','A-and-L-BW_thumb.gif',130, 90,32,'photo_2129606.html');
												thumbnails[2129616] = new thumbnail(2129616,'141572','','IMG_2850_thumb.jpg',130, 87,32,'photo_2129616.html');
												thumbnails[2249446] = new thumbnail(2249446,'147991','','1---IMG_9445-01-Art-Tester2_thumb.jpg',130, 79,32,'photo_2249446.html');
												thumbnails[2129623] = new thumbnail(2129623,'141571','','Sam-4-tight-crop_thumb.jpg',130, 78,32,'photo_2129623.html');
												thumbnails[7339827] = new thumbnail(7339827,'397265','','Louise_and_Kevin_MG_3011_copy_thumb.jpg',107, 160,32,'photo_7339827.html');
												thumbnails[7339832] = new thumbnail(7339832,'397265','','Louise_and_Kevin_MG_3319_copy_thumb.jpg',115, 160,32,'photo_7339832.html');
												thumbnails[7339823] = new thumbnail(7339823,'397265','','_MG_3600_copy_thumb.jpg',107, 160,32,'photo_7339823.html');
												thumbnails[7339825] = new thumbnail(7339825,'397265','','_MG_3693-copy_thumb.jpg',160, 107,32,'photo_7339825.html');
												thumbnails[4502187] = new thumbnail(4502187,'262204','Storybook Albums','aepoca_inside_thumb.jpg',130, 79,32,'photo_4502187.html');
												thumbnails[4502199] = new thumbnail(4502199,'262204','','381_img_thumb.jpg',130, 146,32,'photo_4502199.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[147990] = new gallery(147990,'2129613,2129607','Audrey and Laurent','gallery',[2129607,2129613,2129617,2129606],0, 1, '147992', 'gallery_147990.html',0,0);
				  					galleries[250561] = new gallery(250561,'4224501,4224493','Claire and Richard','gallery',[4224501,4224502,4224504,4224505,4224493],0, 1, '147992', 'gallery_250561.html',0,0);
				  					galleries[147991] = new gallery(147991,'2249453','Gay and Peter','gallery',[2129612,2249447,2249448,2249453,2249446],0, 1, '147992', 'gallery_147991.html',0,0);
				  					galleries[141571] = new gallery(141571,'2129620,2045410','Portraiture','gallery',[2045410,2129618,2129619,2129621,2129622,2129620,2129623],0, 1, '', 'gallery_141571.html',0,0);
				  					galleries[262204] = new gallery(262204,'4502199,4502187','Products','section316331',[4502187,4502199],0, 0, '', 'section316331.html',0,1);
				  					galleries[141572] = new gallery(141572,'2129609','Susana and Juan','gallery',[2129611,2129609,2129616],0, 1, '147992', 'gallery_141572.html',0,0);
				  					galleries[147992] = new gallery(147992,'7357721,7339836,7339835,7339834,7339833,7339831,7339829,7339828,7339827,7339823,4644289,4644285,4644282,4224501,4224493,2249453,2129613,2129609,2129607','Weddings','gallery',[],0, 1, '', 'gallery_147992.html',0,0);
				  					galleries[267895] = new gallery(267895,'4644289,4644285,4644282','Ben and Ester','gallery',[4644282,4644298,4644299,4644285,4644289,4644294],0, 1, '147992', 'gallery_267895.html',0,0);
				  					galleries[397265] = new gallery(397265,'7357721,7339836,7339835,7339834,7339833,7339831,7339829,7339828,7339827,7339823','Louise and Kevin','gallery',[7357721,7339828,7339831,7339833,7339835,7339836,7339834,7339829,7339827,7339832,7339823,7339825],0, 1, '147992', 'gallery_397265.html',0,0);
				  					galleries[193840] = new gallery(193840,'3165570','Children','gallery',[3165570,3165571],0, 1, '', 'gallery_193840.html',0,0);
				  					galleries[136684] = new gallery(136684,'2129601','Landscapes','gallery',[2129601,2129603,2129605],0, 1, '', 'gallery_136684.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[239099] = '2249446';
imageSets[1] = '7357745,7357741,7357736,7357730,7357725,7357721,7339836,7339835,7339825,4644294,2249446,2129623,2129620,2129607,2129606';
imageSets[2] = '7357745,7357741,7357736,7357730,7357725,7357721,7339836,7339835,7339834,7339833,7339831,7339829,7339828,7339827,7339823,4644289,4644285,4644282,4224501,4224493,3165570,2249453,2129620,2129613,2129609,2129607,2129601,2045410';
imageSets[3] = '7357745,7357741,7357736,7357730,7357725,7357721,7339836,7339835,7339834,7339833,7339832,7339831,7339829,7339828,7339827,7339825,7339823,4644299,4644298,4644294,4644289,4644285,4644282,4502199,4502187,4224505,4224504,4224502,4224501,4224493,3165571,3165570,2249453,2249451,2249448,2249447,2249446,2129623,2129622,2129621,2129620,2129619,2129618,2129617,2129616,2129613,2129612,2129611,2129609,2129607';
imageSets[239118] = '7339836,7339835,7339825,2129623,2129616,2129606';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/tlawrie/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/tlawrie/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/tlawrie/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/tlawrie/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/tlawrie/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/tlawrie/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/tlawrie/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/tlawrie/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/tlawrie/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/tlawrie/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/tlawrie/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/tlawrie/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/tlawrie/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/tlawrie/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/tlawrie/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/tlawrie/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/tlawrie/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/tlawrie/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/tlawrie/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/tlawrie/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/tlawrie/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/tlawrie/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 = 'Espero Photographic: ' + 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 == 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>Tom Lawrie </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="TLAWRIE">';
		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;
	}
}

			

