window.thumbnails = {};
															thumbnails[8642481] = clik.newPhoto({"id":8642481,"src":"_DSC2590_thumb.jpg","galleries_id":407721,"server_id":5,"link":"photo_8642481.html","width":130,"caption":"THE RHUBARB EXPRESS","height":86});
															thumbnails[9033955] = clik.newPhoto({"id":9033955,"src":"20111125_1567web_thumb.jpg","galleries_id":407721,"server_id":5,"link":"photo_9033955.html","width":130,"caption":"WESTGATE, WAKEFIELD","height":130});
															thumbnails[5988817] = clik.newPhoto({"id":5988817,"src":"Bridlington1_thumb.jpg","galleries_id":337053,"server_id":5,"link":"photo_5988817.html","width":130,"caption":"A GRAND DAY OUT","height":130});
															thumbnails[5988823] = clik.newPhoto({"id":5988823,"src":"_DSC0872_thumb.jpg","galleries_id":337052,"server_id":5,"link":"photo_5988823.html","width":130,"caption":"STAITHES FROM PENNY NAB","height":130});
															thumbnails[5988828] = clik.newPhoto({"id":5988828,"src":"_DSC0871_thumb.jpg","galleries_id":337052,"server_id":5,"link":"photo_5988828.html","width":130,"caption":"THE LONG CLIMB","height":130});
															thumbnails[5988829] = clik.newPhoto({"id":5988829,"src":"_DSC0867_thumb.jpg","galleries_id":337052,"server_id":5,"link":"photo_5988829.html","width":130,"caption":"STAITHES FROM COWBAR NAB","height":130});
															thumbnails[5988839] = clik.newPhoto({"id":5988839,"src":"_DSC0863_thumb.jpg","galleries_id":337053,"server_id":5,"link":"photo_5988839.html","width":130,"caption":"DONKEY RIDES ON SCARBOROUGH BEACH","height":130});
															thumbnails[5988844] = clik.newPhoto({"id":5988844,"src":"_DSC0861_thumb.jpg","galleries_id":337052,"server_id":5,"link":"photo_5988844.html","width":130,"caption":"THE HARBOUR, STAITHES","height":130});
															thumbnails[5988845] = clik.newPhoto({"id":5988845,"src":"_DSC0859_thumb.jpg","galleries_id":337052,"server_id":5,"link":"photo_5988845.html","width":130,"caption":"RED ROOVES 1","height":130});
															thumbnails[5988846] = clik.newPhoto({"id":5988846,"src":"026_thumb.jpg","galleries_id":315278,"server_id":5,"link":"photo_5988846.html","width":130,"caption":"THE PRIORY, LINDISFARNE","height":60});
															thumbnails[5988847] = clik.newPhoto({"id":5988847,"src":"_DSC0866_thumb.jpg","galleries_id":315277,"server_id":5,"link":"photo_5988847.html","width":130,"caption":"FOREST FLAME","height":382});
															thumbnails[6017359] = clik.newPhoto({"id":6017359,"src":"_DSC0862_thumb.jpg","galleries_id":337053,"server_id":5,"link":"photo_6017359.html","width":130,"caption":"WHEN DID IT START TO GO WRONG?","height":130});
															thumbnails[5988871] = clik.newPhoto({"id":5988871,"src":"2_thumb.jpg","galleries_id":337053,"server_id":5,"link":"photo_5988871.html","width":130,"caption":"STRAWBERRY FIELDS","height":130});
															thumbnails[5988949] = clik.newPhoto({"id":5988949,"src":"henry-street_thumb.jpg","galleries_id":337053,"server_id":5,"link":"photo_5988949.html","width":130,"caption":"THE CORNER SHOP","height":130});
															thumbnails[6045675] = clik.newPhoto({"id":6045675,"src":"_DSC1504_thumb.jpg","galleries_id":337052,"server_id":5,"link":"photo_6045675.html","width":130,"caption":"199 STEPS DOWN INTO WHITBY TOWN","height":130});
															thumbnails[6045678] = clik.newPhoto({"id":6045678,"src":"_DSC1506_thumb.jpg","galleries_id":337052,"server_id":5,"link":"photo_6045678.html","width":130,"caption":"VIEW FROM JUST BELOW WHITBY WHALEBONES","height":130});
															thumbnails[6045679] = clik.newPhoto({"id":6045679,"src":"_DSC1510_thumb.jpg","galleries_id":337052,"server_id":5,"link":"photo_6045679.html","width":130,"caption":"LOOKING BACK TOWARDS THE RIVER, WHITBY","height":130});
															thumbnails[6045681] = clik.newPhoto({"id":6045681,"src":"_DSC1512_thumb.jpg","galleries_id":337052,"server_id":5,"link":"photo_6045681.html","width":130,"caption":"A VIEW FROM THE SWING BRIDGE, WHITBY","height":130});
															thumbnails[6218151] = clik.newPhoto({"id":6218151,"src":"_DSC2429s_thumb.jpg","galleries_id":337052,"server_id":5,"link":"photo_6218151.html","width":130,"caption":"CHURCH STREET, WHITBY","height":130});
															thumbnails[6381739] = clik.newPhoto({"id":6381739,"src":"_DSC2521-web_thumb.jpg","galleries_id":337052,"server_id":5,"link":"photo_6381739.html","width":130,"caption":"199 STEPS WHITBY","height":130});
															thumbnails[7265820] = clik.newPhoto({"id":7265820,"src":"006_thumb.jpg","galleries_id":337052,"server_id":5,"link":"photo_7265820.html","width":130,"caption":"RED ROOVES 2","height":130});
															thumbnails[7265821] = clik.newPhoto({"id":7265821,"src":"013_thumb.jpg","galleries_id":337052,"server_id":5,"link":"photo_7265821.html","width":130,"caption":"CHURCH STREET, WHITBY","height":130});
															thumbnails[7266024] = clik.newPhoto({"id":7266024,"src":"030_thumb.jpg","galleries_id":337052,"server_id":5,"link":"photo_7266024.html","width":130,"caption":"THE BAY HOTEL, ROBIN HOOD'S BAY","height":130});
															thumbnails[7266029] = clik.newPhoto({"id":7266029,"src":"031_thumb.jpg","galleries_id":337052,"server_id":5,"link":"photo_7266029.html","width":130,"caption":"LOOKING TOWARDS THE SWING BRIDGE, WHITBY","height":130});
															thumbnails[7266031] = clik.newPhoto({"id":7266031,"src":"033_thumb.jpg","galleries_id":337052,"server_id":5,"link":"photo_7266031.html","width":130,"caption":"THE LONG CLIMB","height":130});
															thumbnails[9033946] = clik.newPhoto({"id":9033946,"src":"20111110_1570web_thumb.jpg","galleries_id":337052,"server_id":5,"link":"photo_9033946.html","width":130,"caption":"ABBEY STEPS CAFE LOOKING TOWARDS THE WHALEBONES, WHITBY","height":131});
															thumbnails[9033953] = clik.newPhoto({"id":9033953,"src":"20120113_2372web_thumb.jpg","galleries_id":337052,"server_id":5,"link":"photo_9033953.html","width":130,"caption":"CHURCH STREET, WHITBY","height":130});
															thumbnails[6218039] = clik.newPhoto({"id":6218039,"src":"_DSC2433_thumb.jpg","galleries_id":337052,"server_id":5,"link":"photo_6218039.html","width":130,"caption":"STAITHES HARBOUR","height":311});
															thumbnails[5988820] = clik.newPhoto({"id":5988820,"src":"_DSC1030_thumb.jpg","galleries_id":337052,"server_id":5,"link":"photo_5988820.html","width":130,"caption":"199 STEPS FROM CHURCH STREET, WHITBY","height":308});
															thumbnails[5988834] = clik.newPhoto({"id":5988834,"src":"_DSC0865_thumb.jpg","galleries_id":337052,"server_id":5,"link":"photo_5988834.html","width":130,"caption":"ROBIN HOOD'S BAY","height":283});
															thumbnails[5988836] = clik.newPhoto({"id":5988836,"src":"_DSC0864_thumb.jpg","galleries_id":337052,"server_id":5,"link":"photo_5988836.html","width":130,"caption":"WHITBY ABBEY FROM JUST BELOW THE WHALEBONES","height":284});
															thumbnails[7265812] = clik.newPhoto({"id":7265812,"src":"003-2_thumb.jpg","galleries_id":337052,"server_id":5,"link":"photo_7265812.html","width":130,"caption":"SANDGATE, WHITBY","height":301});
															thumbnails[7265817] = clik.newPhoto({"id":7265817,"src":"028_thumb.jpg","galleries_id":337052,"server_id":5,"link":"photo_7265817.html","width":130,"caption":"CHURCH SREET LEADING UP TO 199 STEPS, WHITBY","height":286});
															thumbnails[7265819] = clik.newPhoto({"id":7265819,"src":"029_thumb.jpg","galleries_id":337052,"server_id":5,"link":"photo_7265819.html","width":130,"caption":"MARKET PLACE LOOKING TOWARDS SANDGATE, WHITBY","height":308});
															thumbnails[9033948] = clik.newPhoto({"id":9033948,"src":"20111111_1569-web_thumb.jpg","galleries_id":337052,"server_id":5,"link":"photo_9033948.html","width":130,"caption":"MARKET PLACE LOOKING TOWARDS CHURCH STREET, WHITBY","height":306});
															thumbnails[9033950] = clik.newPhoto({"id":9033950,"src":"20120113_2371web_thumb.jpg","galleries_id":337052,"server_id":5,"link":"photo_9033950.html","width":130,"caption":"ROBIN HOOD'S BAY STREET","height":299});
															thumbnails[7266035] = clik.newPhoto({"id":7266035,"src":"159_thumb.jpg","galleries_id":315277,"server_id":5,"link":"photo_7266035.html","width":130,"caption":"LAKELAND REFLECTIONS","height":130});
															thumbnails[7481931] = clik.newPhoto({"id":7481931,"src":"_DSC3403_thumb.jpg","galleries_id":407721,"server_id":5,"link":"photo_7481931.html","width":130,"caption":"CHANTRY CHAPEL AND THE HEPWORTH WAKEFIELD","height":130});
															thumbnails[7481936] = clik.newPhoto({"id":7481936,"src":"500x500-web_thumb.jpg","galleries_id":407721,"server_id":5,"link":"photo_7481936.html","width":130,"caption":"THE HEPWORTH WAKEFIELD","height":130});
															thumbnails[8246469] = clik.newPhoto({"id":8246469,"src":"_DSC0350-sharpend_thumb.jpg","galleries_id":407721,"server_id":5,"link":"photo_8246469.html","width":130,"caption":"THE BOATHOUSE, NEWMILLERDAM, WAKEFIELD","height":62});
															thumbnails[8778957] = clik.newPhoto({"id":8778957,"src":"Chantry-chapel-r_thumb.png","galleries_id":407721,"server_id":5,"link":"photo_8778957.html","width":130,"caption":"CHANTRY CHAPEL, WAKEFIELD","height":130});
															thumbnails[8779002] = clik.newPhoto({"id":8779002,"src":"Coal_Mining_Musem_thumb.png","galleries_id":407721,"server_id":5,"link":"photo_8779002.html","width":130,"caption":"NATIONAL COAL MINING MUSEUM FOR ENGLAND","height":130});
															thumbnails[8779010] = clik.newPhoto({"id":8779010,"src":"Hepworth-Wakefield_thumb.png","galleries_id":407721,"server_id":5,"link":"photo_8779010.html","width":130,"caption":"THE HEPWORTH WAKEFIELD","height":130});
															thumbnails[8779014] = clik.newPhoto({"id":8779014,"src":"Sandal-Castile-_thumb.png","galleries_id":407721,"server_id":5,"link":"photo_8779014.html","width":130,"caption":"SANDAL CASTLE, WAKEFIELD","height":130});
															thumbnails[8779016] = clik.newPhoto({"id":8779016,"src":"Wakefield-Cathedral_thumb.png","galleries_id":407721,"server_id":5,"link":"photo_8779016.html","width":130,"caption":"WAKEFIELD CATHEDRAL","height":131});
															thumbnails[8246467] = clik.newPhoto({"id":8246467,"src":"_DSC0348-unsharp_thumb.jpg","galleries_id":407721,"server_id":5,"link":"photo_8246467.html","width":130,"caption":"BREAD STREET LOOKING TOWARDS THE CATHEDRAL","height":267});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[407721] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"WAKEFIELD","link":"gallery_407721.html","maxRecords":0.0,"photoIDs":[8642481.0,9033955.0,7481931.0,7481936.0,8246469.0,8778957.0,8779002.0,8779010.0,8779014.0,8779016.0,8246467.0],"skipIndex":0,"section_code":"gallery","featured_images":"9033955,8779016,8779014,8779010,8779002,8778957,8642481,8246469,8246467,7481936","id":407721,"singleSection":false});				  						galleries[337053] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"YORKSHIRE LIFE","link":"gallery_337053.html","maxRecords":0.0,"photoIDs":[5988817.0,5988839.0,6017359.0,5988871.0,5988949.0],"skipIndex":0,"section_code":"gallery","featured_images":"6017359,5988949,5988871,5988839,5988817","id":337053,"singleSection":false});				  						galleries[337052] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"YORKSHIRE COAST","link":"gallery_337052.html","maxRecords":0.0,"photoIDs":[5988823.0,5988828.0,5988829.0,5988844.0,5988845.0,6045675.0,6045678.0,6045679.0,6045681.0,6218151.0,6381739.0,7265820.0,7265821.0,7266024.0,7266029.0,7266031.0,9033946.0,9033953.0,6218039.0,5988820.0,5988834.0,5988836.0,7265812.0,7265817.0,7265819.0,9033948.0,9033950.0],"skipIndex":0,"section_code":"gallery","featured_images":"9033953,9033950,9033948,9033946,7266031,7266029,7266024,7265821,7265820,7265819","id":337052,"singleSection":false});				  						galleries[315277] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"ABSTRACT","link":"gallery_315277.html","maxRecords":0.0,"photoIDs":[5988847.0,7266035.0],"skipIndex":0,"section_code":"gallery","featured_images":"7266035,5988847","id":315277,"singleSection":false});				  						galleries[315278] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"SEASCAPES","link":"gallery_315278.html","maxRecords":0.0,"photoIDs":[5988846.0],"skipIndex":0,"section_code":"gallery","featured_images":5988846.0,"id":315278,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '9033955,9033953,9033950,9033948,9033946,8779016,8779014,8779010,8779002,8778957,8642481,8246469,8246467,7481936,7481931,7266035,7266031,7266029,7266024,7265821,7265820,7265819,7265817,7265812,6381739,6218151,6218039,6045681,6045679,6045678,6045675,6017359,5988949,5988871,5988847,5988846,5988845,5988844,5988839,5988836,5988834,5988829,5988828,5988823,5988820,5988817';
imageSets[3] = '9033955,9033953,9033950,9033948,9033946,8779016,8779014,8779010,8779002,8778957,8642481,8246469,8246467,7481936,7481931,7266035,7266031,7266029,7266024,7265821,7265820,7265819,7265817,7265812,6381739,6218151,6218039,6045681,6045679,6045678,6045675,6017359,5988949,5988871,5988847,5988846,5988845,5988844,5988839,5988836,5988834,5988829,5988828,5988823,5988820,5988817';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/artylady/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/artylady/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/artylady/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/artylady/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/artylady/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/artylady/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/artylady/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/artylady/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/artylady/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/artylady/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/artylady/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/artylady/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/artylady/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/artylady/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/artylady/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/artylady/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/artylady/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/artylady/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/artylady/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/artylady/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/artylady/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/artylady/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/artylady/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/artylady/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/artylady/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/artylady/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/artylady/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 || photos || {})[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 = 'LGart: ' + 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 !== '') {
			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;
	}
}

			

