window.thumbnails = {};
															thumbnails[8073639] = clik.newPhoto({"id":8073639,"src":"_MG_4271_thumb.jpg","galleries_id":239724,"server_id":15,"link":"photo_8073639.html","width":130,"caption":"Hoverfly","height":112});
															thumbnails[7382859] = clik.newPhoto({"id":7382859,"src":"black_food_colour-2_thumb.jpg","galleries_id":239995,"server_id":15,"link":"photo_7382859.html","width":130,"caption":"Still Life in water black","height":75});
															thumbnails[7382863] = clik.newPhoto({"id":7382863,"src":"blue_and_pink2-2_thumb.jpg","galleries_id":239995,"server_id":15,"link":"photo_7382863.html","width":130,"caption":"Blue and Pink","height":129});
															thumbnails[7382866] = clik.newPhoto({"id":7382866,"src":"shroom-2_thumb.jpg","galleries_id":239995,"server_id":15,"link":"photo_7382866.html","width":83,"caption":"Shroom","height":130});
															thumbnails[3961570] = clik.newPhoto({"id":3961570,"src":"great_hall_again_-1_thumb.jpg","galleries_id":239717,"server_id":15,"link":"photo_3961570.html","width":130,"caption":"Great Hall and Circle Reading Room High Key","height":87});
															thumbnails[3961659] = clik.newPhoto({"id":3961659,"src":"IMG_4315_thumb.jpg","galleries_id":239717,"server_id":15,"link":"photo_3961659.html","width":130,"caption":"Circle reading room","height":87});
															thumbnails[3961677] = clik.newPhoto({"id":3961677,"src":"scarfs_thumb.jpg","galleries_id":239723,"server_id":15,"link":"photo_3961677.html","width":130,"caption":"Scarfs","height":72});
															thumbnails[3961681] = clik.newPhoto({"id":3961681,"src":"three_is_the_magic_number_thumb.jpg","galleries_id":239717,"server_id":15,"link":"photo_3961681.html","width":130,"caption":"Three arch's","height":59});
															thumbnails[3961478] = clik.newPhoto({"id":3961478,"src":"cone_head_thumb.jpg","galleries_id":239723,"server_id":15,"link":"photo_3961478.html","width":130,"caption":"Cone's","height":88});
															thumbnails[3961514] = clik.newPhoto({"id":3961514,"src":"autumn_colour_thumb.jpg","galleries_id":239995,"server_id":15,"link":"photo_3961514.html","width":130,"caption":"Autumn colour","height":50});
															thumbnails[3961532] = clik.newPhoto({"id":3961532,"src":"IMG_4220_thumb.jpg","galleries_id":239995,"server_id":15,"link":"photo_3961532.html","width":130,"caption":"peppers","height":87});
															thumbnails[4236240] = clik.newPhoto({"id":4236240,"src":"beach_wood_thumb.jpg","galleries_id":239716,"server_id":15,"link":"photo_4236240.html","width":66,"caption":"beach wood","height":130});
															thumbnails[4236251] = clik.newPhoto({"id":4236251,"src":"beach_wood2_thumb.jpg","galleries_id":239716,"server_id":15,"link":"photo_4236251.html","width":96,"caption":"","height":130});
															thumbnails[4236257] = clik.newPhoto({"id":4236257,"src":"rocks_thumb.jpg","galleries_id":239716,"server_id":15,"link":"photo_4236257.html","width":87,"caption":"Rocks","height":130});
															thumbnails[4236264] = clik.newPhoto({"id":4236264,"src":"shot_from_the_surf_thumb.jpg","galleries_id":239716,"server_id":15,"link":"photo_4236264.html","width":87,"caption":"","height":130});
															thumbnails[4236266] = clik.newPhoto({"id":4236266,"src":"crisp_gold_thumb.jpg","galleries_id":239723,"server_id":15,"link":"photo_4236266.html","width":93,"caption":"Crisp gold","height":130});
															thumbnails[4299695] = clik.newPhoto({"id":4299695,"src":"3_blues_sails_thumb.jpg","galleries_id":239716,"server_id":15,"link":"photo_4299695.html","width":87,"caption":"3 Blue Sails","height":130});
															thumbnails[4167317] = clik.newPhoto({"id":4167317,"src":"london_eye3_thumb.jpg","galleries_id":239717,"server_id":15,"link":"photo_4167317.html","width":87,"caption":"london eye","height":130});
															thumbnails[3961387] = clik.newPhoto({"id":3961387,"src":"IMG_7928_thumb.jpg","galleries_id":239716,"server_id":15,"link":"photo_3961387.html","width":130,"caption":"Tracks in wheat","height":102});
															thumbnails[3961418] = clik.newPhoto({"id":3961418,"src":"IMG_79001_thumb.jpg","galleries_id":239724,"server_id":15,"link":"photo_3961418.html","width":121,"caption":"Macro of a purple daisy","height":130});
															thumbnails[3961668] = clik.newPhoto({"id":3961668,"src":"IMG_7754_thumb.jpg","galleries_id":239724,"server_id":15,"link":"photo_3961668.html","width":130,"caption":"Route 66","height":87});
															thumbnails[3967671] = clik.newPhoto({"id":3967671,"src":"rs2000_thumb.jpg","galleries_id":239724,"server_id":15,"link":"photo_3967671.html","width":130,"caption":"RS2000 paint work","height":82});
															thumbnails[3961494] = clik.newPhoto({"id":3961494,"src":"IMG_7319_thumb.jpg","galleries_id":239723,"server_id":15,"link":"photo_3961494.html","width":87,"caption":"yellow bands","height":130});
															thumbnails[3961663] = clik.newPhoto({"id":3961663,"src":"IMG_6792_thumb.jpg","galleries_id":239717,"server_id":15,"link":"photo_3961663.html","width":130,"caption":"London Eye","height":87});
															thumbnails[3961579] = clik.newPhoto({"id":3961579,"src":"IMG_6196_thumb.jpg","galleries_id":239717,"server_id":15,"link":"photo_3961579.html","width":130,"caption":"Circle Reading room","height":87});
															thumbnails[3961726] = clik.newPhoto({"id":3961726,"src":"IMG_5999_thumb.jpg","galleries_id":239723,"server_id":15,"link":"photo_3961726.html","width":87,"caption":"tree Abstract ","height":130});
															thumbnails[3961757] = clik.newPhoto({"id":3961757,"src":"leaf_thumb.jpg","galleries_id":239995,"server_id":15,"link":"photo_3961757.html","width":130,"caption":"Floating","height":73});
															thumbnails[3961858] = clik.newPhoto({"id":3961858,"src":"north_atlantic_beach_2_thumb.jpg","galleries_id":239716,"server_id":15,"link":"photo_3961858.html","width":130,"caption":"North Atlantic Beach","height":87});
															thumbnails[3961860] = clik.newPhoto({"id":3961860,"src":"north_atlantic_beach_3_thumb.jpg","galleries_id":239716,"server_id":15,"link":"photo_3961860.html","width":130,"caption":"North Atlantic beach 2","height":55});
															thumbnails[3961863] = clik.newPhoto({"id":3961863,"src":"north_atlantic_beach_thumb.jpg","galleries_id":239716,"server_id":15,"link":"photo_3961863.html","width":130,"caption":"North Atlantic beach","height":57});
															thumbnails[3961868] = clik.newPhoto({"id":3961868,"src":"Seljalandsfoss_thumb.jpg","galleries_id":239716,"server_id":15,"link":"photo_3961868.html","width":130,"caption":"Seljalandsfoss falls","height":87});
															thumbnails[3961843] = clik.newPhoto({"id":3961843,"src":"geysir_Iceland_thumb.jpg","galleries_id":239716,"server_id":15,"link":"photo_3961843.html","width":130,"caption":"Geysir Iceland","height":87});
															thumbnails[3962223] = clik.newPhoto({"id":3962223,"src":"gerkin_bW_Low_key_thumb.jpg","galleries_id":239717,"server_id":15,"link":"photo_3962223.html","width":87,"caption":"","height":130});
															thumbnails[3962240] = clik.newPhoto({"id":3962240,"src":"red_crain_sepia_thumb.jpg","galleries_id":239716,"server_id":15,"link":"photo_3962240.html","width":130,"caption":"Red crane sepia","height":83});
															thumbnails[3962250] = clik.newPhoto({"id":3962250,"src":"portland_bill_2_thumb.jpg","galleries_id":239716,"server_id":15,"link":"photo_3962250.html","width":130,"caption":"Portland lighthouse ","height":75});
															thumbnails[3962261] = clik.newPhoto({"id":3962261,"src":"doda_bw_thumb.jpg","galleries_id":239724,"server_id":15,"link":"photo_3962261.html","width":130,"caption":"Black and white pressure release valve","height":99});
															thumbnails[4648364] = clik.newPhoto({"id":4648364,"src":"selective_dev_thumb.jpg","galleries_id":239717,"server_id":15,"link":"photo_4648364.html","width":87,"caption":"selective colour","height":130});
															thumbnails[5295988] = clik.newPhoto({"id":5295988,"src":"flores_2-2_thumb.jpg","galleries_id":239716,"server_id":15,"link":"photo_5295988.html","width":130,"caption":"Flores sun set","height":87});
															thumbnails[5296255] = clik.newPhoto({"id":5296255,"src":"sun_set_over_flores-1-2_thumb.jpg","galleries_id":239716,"server_id":15,"link":"photo_5296255.html","width":87,"caption":"Another Sun Set over Flores","height":130});
															thumbnails[5296259] = clik.newPhoto({"id":5296259,"src":"jesus_2-2_thumb.jpg","galleries_id":239995,"server_id":15,"link":"photo_5296259.html","width":87,"caption":"","height":130});
															thumbnails[5569168] = clik.newPhoto({"id":5569168,"src":"IMG_0289_thumb.jpg","galleries_id":239723,"server_id":15,"link":"photo_5569168.html","width":87,"caption":"","height":130});
															thumbnails[6864412] = clik.newPhoto({"id":6864412,"src":"break_disc-2_thumb.jpg","galleries_id":239995,"server_id":15,"link":"photo_6864412.html","width":130,"caption":"break disc","height":87});
															thumbnails[6864414] = clik.newPhoto({"id":6864414,"src":"gears-2_thumb.jpg","galleries_id":239995,"server_id":15,"link":"photo_6864414.html","width":130,"caption":"gears","height":87});
															thumbnails[6864419] = clik.newPhoto({"id":6864419,"src":"wheel_long_exposure-2_thumb.jpg","galleries_id":239723,"server_id":15,"link":"photo_6864419.html","width":130,"caption":"wheel long exposure","height":87});
															thumbnails[7560893] = clik.newPhoto({"id":7560893,"src":"_MG_3889_thumb.jpg","galleries_id":409824,"server_id":15,"link":"photo_7560893.html","width":76,"caption":"Sofia ","height":130});
															thumbnails[7560898] = clik.newPhoto({"id":7560898,"src":"_MG_3894_thumb.jpg","galleries_id":409824,"server_id":15,"link":"photo_7560898.html","width":87,"caption":"Sofia ","height":130});
															thumbnails[7628906] = clik.newPhoto({"id":7628906,"src":"sofia_edit_thumb.jpg","galleries_id":409824,"server_id":15,"link":"photo_7628906.html","width":89,"caption":"Sofia ","height":130});
															thumbnails[7628914] = clik.newPhoto({"id":7628914,"src":"sofia_4_thumb.jpg","galleries_id":409824,"server_id":15,"link":"photo_7628914.html","width":87,"caption":"Sofia ","height":130});
															thumbnails[7808804] = clik.newPhoto({"id":7808804,"src":"_MG_4221-1_thumb.jpg","galleries_id":409824,"server_id":15,"link":"photo_7808804.html","width":87,"caption":"Self portrait","height":130});
															thumbnails[8073647] = clik.newPhoto({"id":8073647,"src":"_MG_4032_thumb.jpg","galleries_id":239724,"server_id":15,"link":"photo_8073647.html","width":130,"caption":"Orange","height":87});
															thumbnails[8073657] = clik.newPhoto({"id":8073657,"src":"_MG_4041_thumb.jpg","galleries_id":239724,"server_id":15,"link":"photo_8073657.html","width":130,"caption":"Red Grapefruit","height":87});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[409824] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Portraits","link":"gallery_409824.html","maxRecords":0.0,"photoIDs":[7560893.0,7560898.0,7628906.0,7628914.0,7808804.0],"skipIndex":0,"section_code":"gallery","featured_images":7560898.0,"id":409824,"singleSection":false});				  						galleries[239995] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Still Life","link":"gallery_239995.html","maxRecords":0.0,"photoIDs":[7382859.0,7382863.0,7382866.0,3961514.0,3961532.0,3961757.0,5296259.0,6864412.0,6864414.0],"skipIndex":0,"section_code":"gallery","featured_images":3961532.0,"id":239995,"singleSection":false});				  						galleries[239723] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Abstract ","link":"gallery_239723.html","maxRecords":0.0,"photoIDs":[3961677.0,3961478.0,4236266.0,3961494.0,3961726.0,5569168.0,6864419.0],"skipIndex":0,"section_code":"gallery","featured_images":"3961726,3961478","id":239723,"singleSection":false});				  						galleries[239724] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Close up and Macro","link":"gallery_239724.html","maxRecords":0.0,"photoIDs":[8073639.0,3961418.0,3961668.0,3967671.0,3962261.0,8073647.0,8073657.0],"skipIndex":0,"section_code":"gallery","featured_images":"3961668,3961418","id":239724,"singleSection":false});				  						galleries[239716] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Landscape \/ Cityscape","link":"gallery_239716.html","maxRecords":0.0,"photoIDs":[4236240.0,4236251.0,4236257.0,4236264.0,4299695.0,3961387.0,3961858.0,3961860.0,3961863.0,3961868.0,3961843.0,3962240.0,3962250.0,5295988.0,5296255.0],"skipIndex":0,"section_code":"gallery","featured_images":"4236251,3961387","id":239716,"singleSection":false});				  						galleries[239717] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Architecture ","link":"gallery_239717.html","maxRecords":0.0,"photoIDs":[3961570.0,3961659.0,3961681.0,4167317.0,3961663.0,3961579.0,3962223.0,4648364.0],"skipIndex":0,"section_code":"gallery","featured_images":3961570.0,"id":239717,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '7560898,7560893,4299695,4236251,4236240,3961668,3961570,3961532,3961418,3961387';
imageSets[2] = '7560898,4236251,3961726,3961668,3961570,3961532,3961478,3961418,3961387';
imageSets[3] = '8073657,8073647,8073639,7808804,7628914,7628906,7560898,7560893,7382866,7382863,7382859,6864419,6864414,6864412,5569168,5296259,5296255,5295988,4648364,4299695,4236266,4236264,4236257,4236251,4236240,4167317,3967671,3962261,3962250,3962240,3962223,3961868,3961863,3961860,3961858,3961843,3961757,3961726,3961681,3961677,3961668,3961663,3961659,3961579,3961570,3961532,3961514,3961494,3961478,3961418';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/beeje25/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/beeje25/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/beeje25/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/beeje25/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/beeje25/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/beeje25/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/beeje25/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/beeje25/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/beeje25/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/beeje25/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/beeje25/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/beeje25/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/beeje25/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/beeje25/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/beeje25/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/beeje25/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/beeje25/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/beeje25/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/beeje25/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/beeje25/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/beeje25/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/beeje25/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/beeje25/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/beeje25/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 = 'Images from the floor: ' + 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.payment_groups_id !== '') {
		temp += '<p>Buy this print online:</p>';
				temp += '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
											temp += '<select class="paymentlink" name="payment_options_id" onchange="updateItemValues($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
		
		temp += getPaymentOptions(this.payment_groups_id);
		temp += '</select>';
		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 += '<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 += '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
							}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

