window.thumbnails = {};
															thumbnails[2609334] = clik.newPhoto({"id":2609334,"src":"skylight_thumb.jpg","galleries_id":165364,"server_id":32,"link":"photo_2609334.html","width":130,"caption":"Butterfly roof hatch in saloon","height":98});
															thumbnails[2609585] = clik.newPhoto({"id":2609585,"src":"chartTable1_thumb.jpg","galleries_id":165364,"server_id":32,"link":"photo_2609585.html","width":130,"caption":"Control station and companionway ladder","height":98});
															thumbnails[2613472] = clik.newPhoto({"id":2613472,"src":"Picture 033_thumb.jpg","galleries_id":166484,"server_id":32,"link":"photo_2613472.html","width":130,"caption":"Starboard tack","height":98});
															thumbnails[2622818] = clik.newPhoto({"id":2622818,"src":"127_2769_thumb.JPG","galleries_id":166484,"server_id":32,"link":"photo_2622818.html","width":130,"caption":"All colour & canvas flying. Toucando goes like the wind - note the slight bow down aspect due to the sail area.","height":87});
															thumbnails[2622820] = clik.newPhoto({"id":2622820,"src":"DSC BTS2005-06-05DSCN0139_thumb.JPG","galleries_id":166484,"server_id":32,"link":"photo_2622820.html","width":130,"caption":"","height":173});
															thumbnails[2622822] = clik.newPhoto({"id":2622822,"src":"John Dean  toucando 057_thumb.jpg","galleries_id":166484,"server_id":32,"link":"photo_2622822.html","width":130,"caption":"","height":173});
															thumbnails[2622824] = clik.newPhoto({"id":2622824,"src":"John Dean  toucando 058_thumb.jpg","galleries_id":166484,"server_id":32,"link":"photo_2622824.html","width":130,"caption":"","height":173});
															thumbnails[2622826] = clik.newPhoto({"id":2622826,"src":"Picture 034_thumb.jpg","galleries_id":166484,"server_id":32,"link":"photo_2622826.html","width":130,"caption":"","height":93});
															thumbnails[2622828] = clik.newPhoto({"id":2622828,"src":"Toucando 22_thumb.jpg","galleries_id":166484,"server_id":32,"link":"photo_2622828.html","width":130,"caption":"","height":119});
															thumbnails[2622831] = clik.newPhoto({"id":2622831,"src":"John Dean  toucando 035_thumb.jpg","galleries_id":166477,"server_id":32,"link":"photo_2622831.html","width":130,"caption":"Toucando is craned out of the 'Tennis Court' where she was born.","height":173});
															thumbnails[2622833] = clik.newPhoto({"id":2622833,"src":"John Dean  toucando 039_thumb.jpg","galleries_id":166477,"server_id":32,"link":"photo_2622833.html","width":130,"caption":"On the back of a low-loader leaving Brackenhurst with her first glimpse of the sea with Ireland's Eye in the background.","height":98});
															thumbnails[2622836] = clik.newPhoto({"id":2622836,"src":"John Dean  toucando 046_thumb.jpg","galleries_id":166477,"server_id":32,"link":"photo_2622836.html","width":130,"caption":"Passing the Abbey Tavern on the way to the sea.<br>\r\nGood opportunity to see the underwater section.","height":98});
															thumbnails[2622837] = clik.newPhoto({"id":2622837,"src":"John Dean  toucando 052_thumb.jpg","galleries_id":166477,"server_id":32,"link":"photo_2622837.html","width":130,"caption":"Finally going to get wet.","height":98});
															thumbnails[2622838] = clik.newPhoto({"id":2622838,"src":"John Dean  toucando 055_thumb.jpg","galleries_id":166477,"server_id":32,"link":"photo_2622838.html","width":130,"caption":"Stepping the mast.","height":98});
															thumbnails[2622840] = clik.newPhoto({"id":2622840,"src":"launching toucando 009_thumb.jpg","galleries_id":166477,"server_id":32,"link":"photo_2622840.html","width":130,"caption":"The slow trip to the harbour.","height":98});
															thumbnails[2622842] = clik.newPhoto({"id":2622842,"src":"John Dean  toucando 021_thumb.jpg","galleries_id":165364,"server_id":32,"link":"photo_2622842.html","width":130,"caption":"All interior surfaces and furniture comprise a variety of hardwoods","height":126});
															thumbnails[2622844] = clik.newPhoto({"id":2622844,"src":"John Dean  toucando 025_thumb.jpg","galleries_id":165364,"server_id":32,"link":"photo_2622844.html","width":130,"caption":"","height":98});
															thumbnails[2622846] = clik.newPhoto({"id":2622846,"src":"John Dean  toucando 033_thumb.jpg","galleries_id":165364,"server_id":32,"link":"photo_2622846.html","width":130,"caption":"","height":98});
															thumbnails[2622848] = clik.newPhoto({"id":2622848,"src":"John Dean  toucando 029_thumb.jpg","galleries_id":165364,"server_id":32,"link":"photo_2622848.html","width":130,"caption":"Chart table","height":98});
															thumbnails[2622849] = clik.newPhoto({"id":2622849,"src":"Copy of John Dean  toucando 001_thumb.jpg","galleries_id":165365,"server_id":32,"link":"photo_2622849.html","width":130,"caption":"Deck-house<br>\r\nSolid Burmese Teak with double overlap jointed edge drilled between portholes for drifts.","height":98});
															thumbnails[2622851] = clik.newPhoto({"id":2622851,"src":"John Dean  toucando 002_thumb.jpg","galleries_id":165365,"server_id":32,"link":"photo_2622851.html","width":130,"caption":"Deck stepped mast with stainless steel pin-rail.<br>\r\nThere is no galvanised steel on Toucando but the stainless steel has been bead blasted for period finish\/ patina.","height":98});
															thumbnails[2622852] = clik.newPhoto({"id":2622852,"src":"John Dean  toucando 003_thumb.jpg","galleries_id":165365,"server_id":32,"link":"photo_2622852.html","width":130,"caption":"Bronze fore-hatch<br>\r\nBowsprit 18 feet long, hollow made of yellow pine. ","height":98});
															thumbnails[2622853] = clik.newPhoto({"id":2622853,"src":"John Dean  toucando 004_thumb.jpg","galleries_id":165365,"server_id":32,"link":"photo_2622853.html","width":130,"caption":"Novel Dorade type Butterfly Hatch<br>\r\n(Designed by Bud Mackintosh)<br>\r\n<br>\r\nHandmade in Teak with polycarbonate panels and brass tube tube protection.<br>\r\n<br>\r\n","height":98});
															thumbnails[2622855] = clik.newPhoto({"id":2622855,"src":"John Dean  toucando 006_thumb.jpg","galleries_id":165365,"server_id":32,"link":"photo_2622855.html","width":130,"caption":"Foredeck strengthened to take the capstan and 18 ft bowsprit.","height":173});
															thumbnails[2622858] = clik.newPhoto({"id":2622858,"src":"John Dean  toucando 007_thumb.jpg","galleries_id":165365,"server_id":32,"link":"photo_2622858.html","width":130,"caption":"Cockpit","height":98});
															thumbnails[2625089] = clik.newPhoto({"id":2625089,"src":"IMG_0109_thumb.jpg","galleries_id":166581,"server_id":32,"link":"photo_2625089.html","width":130,"caption":"","height":98});
															thumbnails[2625090] = clik.newPhoto({"id":2625090,"src":"IMG_0110_thumb.jpg","galleries_id":166581,"server_id":32,"link":"photo_2625090.html","width":130,"caption":"","height":98});
															thumbnails[2625091] = clik.newPhoto({"id":2625091,"src":"launching toucando 005_thumb.jpg","galleries_id":166581,"server_id":32,"link":"photo_2625091.html","width":130,"caption":"","height":98});
															thumbnails[2625093] = clik.newPhoto({"id":2625093,"src":"2cando Brass Hatch_thumb.jpg","galleries_id":166581,"server_id":32,"link":"photo_2625093.html","width":130,"caption":"Fore cabin hatch","height":98});
															thumbnails[2625195] = clik.newPhoto({"id":2625195,"src":"John Dean  toucando 014_thumb.jpg","galleries_id":165364,"server_id":32,"link":"photo_2625195.html","width":130,"caption":"Lombardini 48 hp engine","height":98});
															thumbnails[2625216] = clik.newPhoto({"id":2625216,"src":"John Dean  toucando 015_thumb.jpg","galleries_id":165364,"server_id":32,"link":"photo_2625216.html","width":130,"caption":"Hanging clothes locker in forecabin","height":173});
															thumbnails[2625217] = clik.newPhoto({"id":2625217,"src":"John Dean  toucando 0141_thumb.jpg","galleries_id":165364,"server_id":32,"link":"photo_2625217.html","width":130,"caption":"4 cylinder diesel engine gives 48 BHP. <br>\r\nMake & model is Lombardini LDW 2004M","height":98});
															thumbnails[2625219] = clik.newPhoto({"id":2625219,"src":"John Dean  toucando 019_thumb.jpg","galleries_id":165364,"server_id":32,"link":"photo_2625219.html","width":130,"caption":"Port berths and trawler specification diesel heating stove","height":157});
															thumbnails[2625220] = clik.newPhoto({"id":2625220,"src":"John Dean  toucando 020_thumb.jpg","galleries_id":165364,"server_id":32,"link":"photo_2625220.html","width":130,"caption":"Control centre (though not the chart table).","height":98});
															thumbnails[2625221] = clik.newPhoto({"id":2625221,"src":"John Dean  toucando 028_thumb.jpg","galleries_id":165364,"server_id":32,"link":"photo_2625221.html","width":130,"caption":"The brass\/ bronze portholes are antique items sourced at Beaulieu Boat Jumble.","height":98});
															thumbnails[2625222] = clik.newPhoto({"id":2625222,"src":"John Dean  toucando 0251_thumb.jpg","galleries_id":165364,"server_id":32,"link":"photo_2625222.html","width":130,"caption":"Double fore-cabin is the height of luxury & comfort.","height":98});
															thumbnails[2625249] = clik.newPhoto({"id":2625249,"src":"John Dean  toucando 0331_thumb.jpg","galleries_id":165364,"server_id":32,"link":"photo_2625249.html","width":130,"caption":"Main saloon has over 6' standing room.<br>\r\nThe Reflex cabin heater runs on diesel and gets the interior cosy on even the most icy cold day.","height":98});
															thumbnails[2625256] = clik.newPhoto({"id":2625256,"src":"John Dean  toucando 018_thumb.jpg","galleries_id":165364,"server_id":32,"link":"photo_2625256.html","width":130,"caption":"Upper starboard berth","height":98});
															thumbnails[2625258] = clik.newPhoto({"id":2625258,"src":"2cando Bowsprit_thumb.jpg","galleries_id":166581,"server_id":32,"link":"photo_2625258.html","width":130,"caption":"","height":98});
															thumbnails[2625260] = clik.newPhoto({"id":2625260,"src":"2cando cabin_thumb.jpg","galleries_id":166581,"server_id":32,"link":"photo_2625260.html","width":130,"caption":"","height":98});
															thumbnails[2625485] = clik.newPhoto({"id":2625485,"src":"John Dean  toucando 005_thumb.jpg","galleries_id":165365,"server_id":32,"link":"photo_2625485.html","width":130,"caption":"Mast and pin rail","height":98});
															thumbnails[2625487] = clik.newPhoto({"id":2625487,"src":"John Dean  toucando 0031_thumb.jpg","galleries_id":165365,"server_id":32,"link":"photo_2625487.html","width":130,"caption":"","height":98});
															thumbnails[2625489] = clik.newPhoto({"id":2625489,"src":"John Dean  toucando 0061_thumb.jpg","galleries_id":165365,"server_id":32,"link":"photo_2625489.html","width":130,"caption":"","height":173});
															thumbnails[2625610] = clik.newPhoto({"id":2625610,"src":"99589868_thumb.ETyR1Rgy.jpg","galleries_id":166484,"server_id":32,"link":"photo_2625610.html","width":130,"caption":"","height":198});
															thumbnails[2625611] = clik.newPhoto({"id":2625611,"src":"99589886_thumb.tHBopSYy.jpg","galleries_id":166484,"server_id":32,"link":"photo_2625611.html","width":130,"caption":"","height":199});
															thumbnails[2625612] = clik.newPhoto({"id":2625612,"src":"99589899_thumb.2y8fQNO0.jpg","galleries_id":166484,"server_id":32,"link":"photo_2625612.html","width":130,"caption":"","height":148});
															thumbnails[2625613] = clik.newPhoto({"id":2625613,"src":"59103119733_0_ALB_thumb.jpg","galleries_id":166484,"server_id":32,"link":"photo_2625613.html","width":130,"caption":"","height":163});
															thumbnails[2625614] = clik.newPhoto({"id":2625614,"src":"99247279733_0_ALB_thumb.jpg","galleries_id":166484,"server_id":32,"link":"photo_2625614.html","width":130,"caption":"Toucando in festive mood","height":86});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[166484] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Sailing","link":"gallery_166484.html","maxRecords":0.0,"photoIDs":[2613472.0,2622818.0,2622820.0,2622822.0,2622824.0,2622826.0,2622828.0,2625610.0,2625611.0,2625612.0,2625613.0,2625614.0],"skipIndex":0,"section_code":"gallery","featured_images":"2625614,2625613,2625612,2625611,2625610,2622828,2622826,2622824,2622822,2622820","id":166484,"singleSection":false});				  						galleries[165364] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Below Decks","link":"gallery_165364.html","maxRecords":0.0,"photoIDs":[2609334.0,2609585.0,2622842.0,2622844.0,2622846.0,2622848.0,2625195.0,2625216.0,2625217.0,2625219.0,2625220.0,2625221.0,2625222.0,2625249.0,2625256.0],"skipIndex":0,"section_code":"gallery","featured_images":2609585.0,"id":165364,"singleSection":false});				  						galleries[165365] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"On Deck","link":"gallery_165365.html","maxRecords":0.0,"photoIDs":[2622849.0,2622851.0,2622852.0,2622853.0,2622855.0,2622858.0,2625485.0,2625487.0,2625489.0],"skipIndex":0,"section_code":"gallery","featured_images":2622851.0,"id":165365,"singleSection":false});				  						galleries[166581] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"The Build","link":"gallery_166581.html","maxRecords":0.0,"photoIDs":[2625089.0,2625090.0,2625091.0,2625093.0,2625258.0,2625260.0],"skipIndex":0,"section_code":"gallery","featured_images":"2625260,2625258,2625093,2625091,2625090,2625089","id":166581,"singleSection":false});				  						galleries[166477] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"The Launch","link":"gallery_166477.html","maxRecords":0.0,"photoIDs":[2622831.0,2622833.0,2622836.0,2622837.0,2622838.0,2622840.0],"skipIndex":0,"section_code":"gallery","featured_images":2622837.0,"id":166477,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '2622842,2622826,2613472';
imageSets[2] = '2622851,2622837,2609585';
imageSets[3] = '2625614,2625613,2625612,2625611,2625610,2625489,2625487,2625485,2625260,2625258,2625256,2625249,2625222,2625221,2625220,2625219,2625217,2625216,2625195,2625093,2625091,2625090,2625089,2622858,2622855,2622853,2622852,2622851,2622849,2622848,2622846,2622844,2622842,2622840,2622838,2622837,2622836,2622833,2622831,2622828,2622826,2622824,2622822,2622820,2622818,2613472,2609585,2609334';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/barry/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/barry/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/barry/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/barry/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/barry/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/barry/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/barry/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/barry/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/barry/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/barry/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/barry/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/barry/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/barry/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/barry/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/barry/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/barry/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/barry/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/barry/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/barry/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/barry/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/barry/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/barry/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/barry/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/barry/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/barry/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:'',$detailContainer:'',
                    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 (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
	}
		
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'TOUCANDO: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		if (op.$photo.length > 0) {
		html = $('<img/>',{
			'class': 'mainphoto photo',
			src: photoSrc,
			id: 'mainPic',
			name: 'mainPic',
			width: op.nextPhoto.width,
			height: op.nextPhoto.height,
			alt: photoCaption,
			css: op.css || {}
		});
		if (op.href) {
			if (op.href.match(/<a/)) {
				html = $(op.href).append(html);
			} else {
				html = $('<a/>', {
					href: op.href,
					title: photoCaption
				}).append(html);
			}
		} else {
			html = $('<a/>', {
				title: photoCaption
			}).append(html);
		}
		if (op.speed == 0) {			op.$photo.html(html);			if (op.onBefore) {			  	op.onBefore.apply(op.$photo);			}			if (op.onAfter) {			  	op.onAfter.apply(op.$photo);			}		} else {			op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){  				if (op.onAfter) {				  	op.onAfter.apply(this);				}				clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));			}, op.onBefore);
		}	}
    if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
        if (!op.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			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', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.photo_ref != '') {
		temp += '<div class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</div>';
	}
		if (this.takendate != '') {
		
		temp += '<div class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</div>';
	}
	
	if (this.location != '') {
		
		temp += '<div class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</div>';
	}
				
				if (temp != '') {
		temp += '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp += '<p>Order this print:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> ' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
		else {
		
	}
	if (this.item_price !== '' || this.payment_groups_id !== '') {
			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({					title: galleries[gallery_id].title				}).filter(function(){return this.href;}).attr({					href: thumbnails[imageID].fnGalleryLink(gallery_id)				});
			}
		}
	}
}

/***************************************************************************
* 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 += '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
							}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

