window.thumbnails = {};
															thumbnails[5505838] = clik.newPhoto({"id":5505838,"src":"boats_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"hehe sorry couldn't resist","height":87});
															thumbnails[5515900] = clik.newPhoto({"id":5515900,"src":"grizedale_tree_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":78});
															thumbnails[5515904] = clik.newPhoto({"id":5515904,"src":"stormy_bw_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Old","height":87});
															thumbnails[5515921] = clik.newPhoto({"id":5515921,"src":"windswept_tree_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":87});
															thumbnails[5516088] = clik.newPhoto({"id":5516088,"src":"bluebells2_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":86,"caption":"","height":130});
															thumbnails[5516091] = clik.newPhoto({"id":5516091,"src":"dartmoor_lane_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":96,"caption":"","height":130});
															thumbnails[5575719] = clik.newPhoto({"id":5575719,"src":"melsmooth2_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":87});
															thumbnails[5727264] = clik.newPhoto({"id":5727264,"src":"clouds_2066_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":87,"caption":"","height":130});
															thumbnails[5738365] = clik.newPhoto({"id":5738365,"src":"daffodils_2104_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":87});
															thumbnails[5738366] = clik.newPhoto({"id":5738366,"src":"moody_2127_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":87});
															thumbnails[5738369] = clik.newPhoto({"id":5738369,"src":"pebbles_2110_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":87});
															thumbnails[5738377] = clik.newPhoto({"id":5738377,"src":"tumbling_1706_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":87,"caption":"","height":130});
															thumbnails[5922965] = clik.newPhoto({"id":5922965,"src":"bleak_2575_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Bleak","height":87});
															thumbnails[5658307] = clik.newPhoto({"id":5658307,"src":"catkins_1540_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Catkins","height":87});
															thumbnails[6727460] = clik.newPhoto({"id":6727460,"src":"wisps_4480_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Summer Wisps","height":87});
															thumbnails[5922970] = clik.newPhoto({"id":5922970,"src":"looking_up_2461_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Looking Up","height":87});
															thumbnails[5658308] = clik.newPhoto({"id":5658308,"src":"fungi_1485_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Fungi","height":87});
															thumbnails[5923051] = clik.newPhoto({"id":5923051,"src":"calming_2928_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Calming","height":87});
															thumbnails[5658305] = clik.newPhoto({"id":5658305,"src":"bracket_fungi_1591_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Bracket Fungi","height":87});
															thumbnails[5598373] = clik.newPhoto({"id":5598373,"src":"waterfall_1413_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":87,"caption":"Waterfall","height":130});
															thumbnails[5922972] = clik.newPhoto({"id":5922972,"src":"sprawling_birch_0024_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Sprawling Birch","height":87});
															thumbnails[5772369] = clik.newPhoto({"id":5772369,"src":"lonely_cloud_2300_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Lonely Cloud","height":87});
															thumbnails[5922981] = clik.newPhoto({"id":5922981,"src":"stranded_0156_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Stranded","height":87});
															thumbnails[8982795] = clik.newPhoto({"id":8982795,"src":"Longsleddle_5_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":130});
															thumbnails[5772368] = clik.newPhoto({"id":5772368,"src":"dusk_2295_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":87,"caption":"Dusk through the Trees","height":130});
															thumbnails[5598286] = clik.newPhoto({"id":5598286,"src":"valley_1324_thumb.jpg","galleries_id":315781,"server_id":5,"link":"photo_5598286.html","width":130,"caption":"Kirkstone Pass","height":87});
															thumbnails[5598306] = clik.newPhoto({"id":5598306,"src":"deep_blue_1400_thumb.jpg","galleries_id":311626,"server_id":5,"link":"photo_5598306.html","width":130,"caption":"Jetty on Windermere","height":87});
															thumbnails[7224191] = clik.newPhoto({"id":7224191,"src":"IMG_5965-2_thumb.jpg","galleries_id":390268,"server_id":5,"link":"photo_7224191.html","width":130,"caption":"Greenodd Estuary at Sunrise","height":87});
															thumbnails[7224204] = clik.newPhoto({"id":7224204,"src":"IMG_5805_thumb.jpg","galleries_id":471448,"server_id":5,"link":"photo_7224204.html","width":87,"caption":"Winter Hoar Frost","height":130});
															thumbnails[7239344] = clik.newPhoto({"id":7239344,"src":"Swan_6008_thumb.jpg","galleries_id":391229,"server_id":5,"link":"photo_7239344.html","width":130,"caption":"Swan on Windermere","height":95});
															thumbnails[7421031] = clik.newPhoto({"id":7421031,"src":"Greenodd_Estuary_6157_thumb.jpg","galleries_id":311391,"server_id":5,"link":"photo_7421031.html","width":130,"caption":"Greenodd Estuary","height":87});
															thumbnails[5598279] = clik.newPhoto({"id":5598279,"src":"jetty_1382_thumb.jpg","galleries_id":315781,"server_id":5,"link":"photo_5598279.html","width":130,"caption":"Jetty on Windermere","height":87});
															thumbnails[5598301] = clik.newPhoto({"id":5598301,"src":"autumn_03112007017_thumb.jpg","galleries_id":311626,"server_id":5,"link":"photo_5598301.html","width":130,"caption":"Goosey Foot Tarn","height":87});
															thumbnails[5598371] = clik.newPhoto({"id":5598371,"src":"waves_1380_thumb.jpg","galleries_id":311391,"server_id":5,"link":"photo_5598371.html","width":130,"caption":"Windermere Waves","height":87});
															thumbnails[5598376] = clik.newPhoto({"id":5598376,"src":"herdwick3_thumb.jpg","galleries_id":391229,"server_id":5,"link":"photo_5598376.html","width":130,"caption":"Herdwick Sheep","height":120});
															thumbnails[5923046] = clik.newPhoto({"id":5923046,"src":"heat_2939_thumb.jpg","galleries_id":390268,"server_id":5,"link":"photo_5923046.html","width":130,"caption":"Sunset over Windermere","height":87});
															thumbnails[6727451] = clik.newPhoto({"id":6727451,"src":"hampshire_spring_bluebells_thumb.jpg","galleries_id":471448,"server_id":5,"link":"photo_6727451.html","width":93,"caption":"Spring Bluebells in Hampshire","height":130});
															thumbnails[5598281] = clik.newPhoto({"id":5598281,"src":"moods_1387_thumb.jpg","galleries_id":315781,"server_id":5,"link":"photo_5598281.html","width":130,"caption":"Jetties on Windermere","height":87});
															thumbnails[5598297] = clik.newPhoto({"id":5598297,"src":"tranquillity_0312_thumb.jpg","galleries_id":311626,"server_id":5,"link":"photo_5598297.html","width":130,"caption":"Derwent Water at Dawn","height":87});
															thumbnails[5598364] = clik.newPhoto({"id":5598364,"src":"firey_0970_thumb.jpg","galleries_id":390268,"server_id":5,"link":"photo_5598364.html","width":130,"caption":"Windermere Sunset","height":87});
															thumbnails[5598367] = clik.newPhoto({"id":5598367,"src":"raindrops_0349_thumb.jpg","galleries_id":311391,"server_id":5,"link":"photo_5598367.html","width":130,"caption":"Raindrops","height":87});
															thumbnails[6727449] = clik.newPhoto({"id":6727449,"src":"dartmoor_autumn_lane_thumb.jpg","galleries_id":471448,"server_id":5,"link":"photo_6727449.html","width":98,"caption":"Dartmoor Lane in Autumn","height":130});
															thumbnails[5598293] = clik.newPhoto({"id":5598293,"src":"stormy_0300_thumb.jpg","galleries_id":311626,"server_id":5,"link":"photo_5598293.html","width":130,"caption":"Derwent Water at Dusk","height":87});
															thumbnails[5598343] = clik.newPhoto({"id":5598343,"src":"hazy_0941_thumb.jpg","galleries_id":390268,"server_id":5,"link":"photo_5598343.html","width":130,"caption":"Cockshot Point at Sunset","height":87});
															thumbnails[8957474] = clik.newPhoto({"id":8957474,"src":"Birks_Rapids_9421_thumb.jpg","galleries_id":311391,"server_id":5,"link":"photo_8957474.html","width":87,"caption":"Birks Rapids","height":130});
															thumbnails[5598290] = clik.newPhoto({"id":5598290,"src":"errie_1025_thumb.jpg","galleries_id":311626,"server_id":5,"link":"photo_5598290.html","width":130,"caption":"Windermere","height":87});
															thumbnails[5598309] = clik.newPhoto({"id":5598309,"src":"alone_0954_thumb.jpg","galleries_id":390268,"server_id":5,"link":"photo_5598309.html","width":87,"caption":"Windermere at Sunset","height":130});
															thumbnails[5911353] = clik.newPhoto({"id":5911353,"src":"reflection_mist_0888_thumb.jpg","galleries_id":390268,"server_id":5,"link":"photo_5911353.html","width":87,"caption":"Bowness Mist at Sunset","height":130});
															thumbnails[8957889] = clik.newPhoto({"id":8957889,"src":"taraset_logo_thumb.gif","galleries_id":471460,"server_id":5,"link":"photo_8957889.html","width":130,"caption":"","height":130});
															thumbnails[8982797] = clik.newPhoto({"id":8982797,"src":"Longsleddle_51_thumb.jpg","galleries_id":471460,"server_id":5,"link":"photo_8982797.html","width":130,"caption":"","height":130});
															thumbnails[8982773] = clik.newPhoto({"id":8982773,"src":"Adrian_North_2_thumb.jpg","galleries_id":471460,"server_id":5,"link":"photo_8982773.html","width":130,"caption":"","height":130});
															thumbnails[8982777] = clik.newPhoto({"id":8982777,"src":"Longsleddle_1_thumb.jpg","galleries_id":471460,"server_id":5,"link":"photo_8982777.html","width":130,"caption":"","height":130});
															thumbnails[8982779] = clik.newPhoto({"id":8982779,"src":"Longsleddle_2_thumb.jpg","galleries_id":471460,"server_id":5,"link":"photo_8982779.html","width":130,"caption":"","height":130});
															thumbnails[8982798] = clik.newPhoto({"id":8982798,"src":"Longsleddale_3_thumb.jpg","galleries_id":471460,"server_id":5,"link":"photo_8982798.html","width":130,"caption":"","height":130});
															thumbnails[8982769] = clik.newPhoto({"id":8982769,"src":"Adrian_North_1_thumb.jpg","galleries_id":471460,"server_id":5,"link":"photo_8982769.html","width":130,"caption":"","height":130});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[315781] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Landscapes","link":"gallery_315781.html","maxRecords":0.0,"photoIDs":[5598286.0,5598279.0,5598281.0],"skipIndex":0,"section_code":"gallery","featured_images":5598286.0,"id":315781,"singleSection":false});				  						galleries[471460] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Rugged Trails : 5th January 2012","link":"section572543.html","maxRecords":0.0,"photoIDs":[8957889.0,8982797.0,8982773.0,8982777.0,8982779.0,8982798.0,8982769.0],"skipIndex":0,"section_code":"section572543","featured_images":8982797.0,"id":471460,"singleSection":true});				  						galleries[311626] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Reflections","link":"gallery_311626.html","maxRecords":0.0,"photoIDs":[5598306.0,5598301.0,5598297.0,5598293.0,5598290.0],"skipIndex":0,"section_code":"gallery","featured_images":5598297.0,"id":311626,"singleSection":false});				  						galleries[390268] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Sunrises & Sunsets","link":"gallery_390268.html","maxRecords":0.0,"photoIDs":[7224191.0,5923046.0,5598364.0,5598343.0,5598309.0,5911353.0],"skipIndex":0,"section_code":"gallery","featured_images":7224191.0,"id":390268,"singleSection":false});				  						galleries[311391] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Water","link":"gallery_311391.html","maxRecords":0.0,"photoIDs":[7421031.0,5598371.0,5598367.0,8957474.0],"skipIndex":0,"section_code":"gallery","featured_images":7421031.0,"id":311391,"singleSection":false});				  						galleries[391229] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Creatures","link":"gallery_391229.html","maxRecords":0.0,"photoIDs":[7239344.0,5598376.0],"skipIndex":0,"section_code":"gallery","featured_images":7239344.0,"id":391229,"singleSection":false});				  						galleries[471448] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Changing Seasons","link":"gallery_471448.html","maxRecords":0.0,"photoIDs":[7224204.0,6727451.0,6727449.0],"skipIndex":0,"section_code":"gallery","featured_images":6727451.0,"id":471448,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '7421031';
imageSets[2] = '8982797,7421031,7239344,7224191,6727460,5922965,5658307,5598286,6727451,5598297';
imageSets[3] = '5598376';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/melissarance/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/melissarance/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/melissarance/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/melissarance/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/melissarance/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/melissarance/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/melissarance/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/melissarance/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/melissarance/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/melissarance/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/melissarance/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/melissarance/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/melissarance/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/melissarance/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/melissarance/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/melissarance/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/melissarance/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/melissarance/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/melissarance/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/melissarance/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/melissarance/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/melissarance/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/melissarance/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/melissarance/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/melissarance/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/melissarance/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/melissarance/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 = 'TARASET & Rugged Trails: ' + 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> &pound;' + (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 += '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
			temp += '<input type="hidden" name="item_name" value="'+item_name+'">';
			ref = '';
			if(this.photo_ref != ''){
				ref = this.photo_ref+' - '+this.caption;
			}
			else{
				ref = this.id+' - '+this.caption;
			}
			price = amount;								temp += '<input type="hidden" name="cmd" value="_cart">';
					temp += '<input type="hidden" name="business" value="">';
					temp += '<input type="hidden" name="currency_code" value="GBP">';
					temp += '<input type="hidden" name="add" value="1">';
													temp += '<input type="hidden" name="amount" value="'+amount+'">';
					temp += '<input type="hidden" name="item_number" value="'+ref+'">';
													temp += '<input type=\"Submit\" value=\"Add to cart\" id=\"paymentAddButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
										temp += '</form>';
										temp += '<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
				temp += '<input type="hidden" name="cmd" value="_cart">';
				temp += '<input type="hidden" name="business" value="">';
				temp += '<input type="hidden" name="display" value="1">';
				temp += '<input type=\"Submit\" value=\"View cart\" id=\"paymentViewButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
				temp += '</form>';
						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;
	}
}

			

