window.thumbnails = {};
															thumbnails[7136353] = clik.newPhoto({"id":7136353,"src":"20101123-20101123-_MG_02831_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":195});
															thumbnails[7382940] = clik.newPhoto({"id":7382940,"src":"Bev_mono_3_adjusted_1_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":192});
															thumbnails[8344250] = clik.newPhoto({"id":8344250,"src":"20110817-Group_no_shadow-2_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":184});
															thumbnails[6775393] = clik.newPhoto({"id":6775393,"src":"20090830-_MG_0880_thumb.jpg","galleries_id":368097,"server_id":32,"link":"photo_6775393.html","width":130,"caption":"Square stud earrings","height":87});
															thumbnails[6803421] = clik.newPhoto({"id":6803421,"src":"20100822-_MG_2211_thumb.jpg","galleries_id":369834,"server_id":32,"link":"photo_6803421.html","width":130,"caption":"Silver and diamond ring","height":87});
															thumbnails[6803746] = clik.newPhoto({"id":6803746,"src":"20081209-_M3F7969_thumb.jpg","galleries_id":369629,"server_id":32,"link":"photo_6803746.html","width":130,"caption":"Wave bracelet","height":87});
															thumbnails[6803901] = clik.newPhoto({"id":6803901,"src":"20090829-_MG_0803_thumb.jpg","galleries_id":369629,"server_id":32,"link":"photo_6803901.html","width":130,"caption":"'Reverse' bangle","height":87});
															thumbnails[6803959] = clik.newPhoto({"id":6803959,"src":"20090830-_MG_0887_thumb.jpg","galleries_id":368097,"server_id":32,"link":"photo_6803959.html","width":130,"caption":"Round stud earrings","height":87});
															thumbnails[6803980] = clik.newPhoto({"id":6803980,"src":"20090830-_MG_0897_thumb.jpg","galleries_id":368097,"server_id":32,"link":"photo_6803980.html","width":130,"caption":"Stainless steel fabric and silver earrings","height":87});
															thumbnails[6804100] = clik.newPhoto({"id":6804100,"src":"20100910-_MG_9568_thumb.jpg","galleries_id":369834,"server_id":32,"link":"photo_6804100.html","width":130,"caption":"Flower cluster ring","height":87});
															thumbnails[6804112] = clik.newPhoto({"id":6804112,"src":"20100910-_MG_9545_thumb.jpg","galleries_id":369834,"server_id":32,"link":"photo_6804112.html","width":130,"caption":"Flower cluster ring - image 2","height":87});
															thumbnails[6804224] = clik.newPhoto({"id":6804224,"src":"_M3F6001_thumb.jpg","galleries_id":369632,"server_id":32,"link":"photo_6804224.html","width":130,"caption":"Picasso Jasper and oxidised silver necklace","height":131});
															thumbnails[6804329] = clik.newPhoto({"id":6804329,"src":"20090830-_MG_0931_thumb.jpg","galleries_id":368097,"server_id":32,"link":"photo_6804329.html","width":130,"caption":"Bird earrings","height":87});
															thumbnails[6809329] = clik.newPhoto({"id":6809329,"src":"20100725-20100725-_MG_1945_thumb.jpg","galleries_id":369833,"server_id":32,"link":"photo_6809329.html","width":130,"caption":"Tube rings with 'light conducting perspex' inserts","height":87});
															thumbnails[6850459] = clik.newPhoto({"id":6850459,"src":"20101003-_MG_9797_thumb.jpg","galleries_id":369832,"server_id":32,"link":"photo_6850459.html","width":130,"caption":"Wave brooch","height":87});
															thumbnails[6851260] = clik.newPhoto({"id":6851260,"src":"20101003-_MG_9862_thumb.jpg","galleries_id":369629,"server_id":32,"link":"photo_6851260.html","width":130,"caption":"Spiral silver bangle with a hallmarked silver charm","height":87});
															thumbnails[8344314] = clik.newPhoto({"id":8344314,"src":"20110822-Mobius_Bangle_thumb.jpg","galleries_id":369629,"server_id":32,"link":"photo_8344314.html","width":130,"caption":"","height":163});
															thumbnails[8344317] = clik.newPhoto({"id":8344317,"src":"20110822-Waves_Bracelet_thumb.jpg","galleries_id":369629,"server_id":32,"link":"photo_8344317.html","width":130,"caption":"","height":163});
															thumbnails[8344312] = clik.newPhoto({"id":8344312,"src":"20110822-Leaf_Earrings_thumb.jpg","galleries_id":368097,"server_id":32,"link":"photo_8344312.html","width":130,"caption":"","height":163});
															thumbnails[8344316] = clik.newPhoto({"id":8344316,"src":"20110822-Spirals_Pendant_thumb.jpg","galleries_id":369831,"server_id":32,"link":"photo_8344316.html","width":130,"caption":"","height":163});
															thumbnails[8344309] = clik.newPhoto({"id":8344309,"src":"20110822-Circles_Pendant_thumb.jpg","galleries_id":369831,"server_id":32,"link":"photo_8344309.html","width":130,"caption":"","height":163});
															thumbnails[8344313] = clik.newPhoto({"id":8344313,"src":"20110822-Leaf_Pendant_thumb.jpg","galleries_id":369831,"server_id":32,"link":"photo_8344313.html","width":130,"caption":"","height":163});
															thumbnails[8344310] = clik.newPhoto({"id":8344310,"src":"20110822-DNA_Pendant_thumb.jpg","galleries_id":369831,"server_id":32,"link":"photo_8344310.html","width":130,"caption":"","height":163});
															thumbnails[6804263] = clik.newPhoto({"id":6804263,"src":"20090830-_MG_0921_thumb.jpg","galleries_id":369831,"server_id":32,"link":"photo_6804263.html","width":130,"caption":"Triform silver pendant","height":87});
															thumbnails[6850475] = clik.newPhoto({"id":6850475,"src":"20101003-_MG_9808_thumb.jpg","galleries_id":368096,"server_id":32,"link":"photo_6850475.html","width":130,"caption":"Examples of some of the earscrew fittings available","height":87});
															thumbnails[6804556] = clik.newPhoto({"id":6804556,"src":"20090830-_MG_0936_thumb.jpg","galleries_id":369831,"server_id":32,"link":"photo_6804556.html","width":130,"caption":"Triform pendant","height":87});
															thumbnails[6803982] = clik.newPhoto({"id":6803982,"src":"20090830-_MG_0903_thumb.jpg","galleries_id":369831,"server_id":32,"link":"photo_6803982.html","width":130,"caption":"Cast pendants","height":87});
															thumbnails[6798818] = clik.newPhoto({"id":6798818,"src":"20100725-_MG_1934-3_thumb.jpg","galleries_id":369831,"server_id":32,"link":"photo_6798818.html","width":130,"caption":"Wave and Leaf pendants","height":87});
															thumbnails[6850435] = clik.newPhoto({"id":6850435,"src":"_MG_9896_thumb.jpg","galleries_id":369831,"server_id":32,"link":"photo_6850435.html","width":130,"caption":"'Triform' pendants: plain and textured silver with pure gold foil","height":87});
															thumbnails[6802832] = clik.newPhoto({"id":6802832,"src":"_MG_1944_thumb.jpg","galleries_id":368096,"server_id":32,"link":"photo_6802832.html","width":130,"caption":"Relief, Patterned and Plain and Hoop earrings for unpierced ears.","height":87});
															thumbnails[6851250] = clik.newPhoto({"id":6851250,"src":"20101003-_MG_9838_thumb.jpg","galleries_id":368096,"server_id":32,"link":"photo_6851250.html","width":130,"caption":"Pyramid earrings","height":87});
															thumbnails[7136381] = clik.newPhoto({"id":7136381,"src":"20101123-20101123-_MG_0273_thumb.jpg","galleries_id":369629,"server_id":32,"link":"photo_7136381.html","width":130,"caption":"Mobius bangles","height":87});
															thumbnails[7136393] = clik.newPhoto({"id":7136393,"src":"20101123-20101123-_MG_0280_thumb.jpg","galleries_id":369832,"server_id":32,"link":"photo_7136393.html","width":130,"caption":"Circles brooches","height":87});
															thumbnails[6856175] = clik.newPhoto({"id":6856175,"src":"20101003-_MG_9891_thumb.jpg","galleries_id":368096,"server_id":32,"link":"photo_6856175.html","width":130,"caption":"Cushioned square earrings","height":87});
															thumbnails[6850486] = clik.newPhoto({"id":6850486,"src":"20101003-_MG_9819_thumb.jpg","galleries_id":368096,"server_id":32,"link":"photo_6850486.html","width":130,"caption":"Silver flower on a square background","height":87});
															thumbnails[7136348] = clik.newPhoto({"id":7136348,"src":"20101123-20101123-_MG_0283_thumb.jpg","galleries_id":369831,"server_id":32,"link":"photo_7136348.html","width":130,"caption":"Circles Pendants","height":195});
															thumbnails[6804562] = clik.newPhoto({"id":6804562,"src":"20090830-_MG_0910_thumb.jpg","galleries_id":368096,"server_id":32,"link":"photo_6804562.html","width":130,"caption":"Delta and Diamond earrings","height":87});
															thumbnails[6850481] = clik.newPhoto({"id":6850481,"src":"20101003-_MG_9814_thumb.jpg","galleries_id":368096,"server_id":32,"link":"photo_6850481.html","width":130,"caption":"A Celtic influence for these studs finished with a freshwater pearl","height":87});
															thumbnails[7136534] = clik.newPhoto({"id":7136534,"src":"20101123-20101123-_MG_0298_thumb.jpg","galleries_id":369831,"server_id":32,"link":"photo_7136534.html","width":130,"caption":"DNA pendant","height":195});
															thumbnails[6851256] = clik.newPhoto({"id":6851256,"src":"20101003-_MG_9846_thumb.jpg","galleries_id":368096,"server_id":32,"link":"photo_6851256.html","width":130,"caption":"'Relief' earstuds","height":87});
															thumbnails[6850490] = clik.newPhoto({"id":6850490,"src":"20101003-_MG_9830_thumb.jpg","galleries_id":368096,"server_id":32,"link":"photo_6850490.html","width":130,"caption":"Four leafed clover earrings","height":87});
															thumbnails[6850464] = clik.newPhoto({"id":6850464,"src":"20101003-_MG_9801_thumb.jpg","galleries_id":368096,"server_id":32,"link":"photo_6850464.html","width":130,"caption":"Wave earrings on a complementary earscrew fitting","height":87});
															thumbnails[7136300] = clik.newPhoto({"id":7136300,"src":"20101123-20101123-_MG_0325_thumb.jpg","galleries_id":368096,"server_id":32,"link":"photo_7136300.html","width":130,"caption":"Leaf and Flower earrings","height":87});
															thumbnails[7136293] = clik.newPhoto({"id":7136293,"src":"20101123-20101123-_MG_0287_thumb.jpg","galleries_id":368096,"server_id":32,"link":"photo_7136293.html","width":130,"caption":"Circles Earrings","height":87});
															thumbnails[7136308] = clik.newPhoto({"id":7136308,"src":"20101123-20101123-_MG_0307_thumb.jpg","galleries_id":368096,"server_id":32,"link":"photo_7136308.html","width":130,"caption":"DNA earrings","height":87});
															thumbnails[7136324] = clik.newPhoto({"id":7136324,"src":"20101123-20101123-_MG_03342_thumb.jpg","galleries_id":368096,"server_id":32,"link":"photo_7136324.html","width":130,"caption":"Waves and Spirals earrings","height":87});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[368096] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Earrings for unpierced ears","link":"gallery_368096.html","maxRecords":0.0,"photoIDs":[6850475.0,6802832.0,6851250.0,6856175.0,6850486.0,6804562.0,6850481.0,6851256.0,6850490.0,6850464.0,7136300.0,7136293.0,7136308.0,7136324.0],"skipIndex":0,"section_code":"gallery","featured_images":"7136324,7136308,7136300,7136293,6856175,6851256,6851250,6850490,6850486,6850481","id":368096,"singleSection":false});				  						galleries[369831] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Pendants","link":"gallery_369831.html","maxRecords":0.0,"photoIDs":[8344316.0,8344309.0,8344313.0,8344310.0,6804263.0,6804556.0,6803982.0,6798818.0,6850435.0,7136348.0,7136534.0],"skipIndex":0,"section_code":"gallery","featured_images":8344309.0,"id":369831,"singleSection":false});				  						galleries[369629] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Bangles and bracelets","link":"gallery_369629.html","maxRecords":0.0,"photoIDs":[6803746.0,6803901.0,6851260.0,8344314.0,8344317.0,7136381.0],"skipIndex":0,"section_code":"gallery","featured_images":8344317.0,"id":369629,"singleSection":false});				  						galleries[368097] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Earrings for pierced ears","link":"gallery_368097.html","maxRecords":0.0,"photoIDs":[6775393.0,6803959.0,6803980.0,6804329.0,8344312.0],"skipIndex":0,"section_code":"gallery","featured_images":8344312.0,"id":368097,"singleSection":false});				  						galleries[369632] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Necklaces","link":"gallery_369632.html","maxRecords":0.0,"photoIDs":[6804224.0],"skipIndex":0,"section_code":"gallery","featured_images":6804224.0,"id":369632,"singleSection":false});				  						galleries[369832] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Brooches","link":"gallery_369832.html","maxRecords":0.0,"photoIDs":[6850459.0,7136393.0],"skipIndex":0,"section_code":"gallery","featured_images":"7136393,6850459","id":369832,"singleSection":false});				  						galleries[369833] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Rings","link":"gallery_369833.html","maxRecords":0.0,"photoIDs":[6809329.0],"skipIndex":0,"section_code":"gallery","featured_images":6809329.0,"id":369833,"singleSection":false});				  						galleries[369834] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Commissions","link":"gallery_369834.html","maxRecords":0.0,"photoIDs":[6803421.0,6804100.0,6804112.0],"skipIndex":0,"section_code":"gallery","featured_images":"6804112,6804100,6803421","id":369834,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8344250';
imageSets[2] = '8344317,8344312,8344309';
imageSets[3] = '8344317,8344316,8344314,8344313,8344312,8344310,8344309,8344250,7382940,7136534,7136393,7136381,7136353,7136348,7136324,7136308,7136300,7136293,6856175,6851260,6851256,6851250,6850490,6850486,6850481,6850475,6850464,6850459,6850435,6809329,6804562,6804556,6804329,6804263,6804224,6804112,6804100,6803982,6803980,6803959,6803901,6803746,6803421,6802832,6798818,6775393';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/bevbartlett/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/bevbartlett/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/bevbartlett/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/bevbartlett/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/bevbartlett/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/bevbartlett/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/bevbartlett/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/bevbartlett/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/bevbartlett/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/bevbartlett/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/bevbartlett/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/bevbartlett/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/bevbartlett/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/bevbartlett/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/bevbartlett/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/bevbartlett/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/bevbartlett/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/bevbartlett/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/bevbartlett/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/bevbartlett/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/bevbartlett/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/bevbartlett/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/bevbartlett/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/bevbartlett/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/bevbartlett/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/bevbartlett/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/bevbartlett/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 = 'Beverly Bartlett Handmade Jewellery: ' + 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;
	}
}

			

