window.thumbnails = {};
															thumbnails[5531561] = clik.newPhoto({"id":5531561,"src":"2joneslook_thumb.jpg","galleries_id":286294,"server_id":18,"link":"photo_5531561.html","width":130,"caption":"Look Left Look Right","height":87});
															thumbnails[5531564] = clik.newPhoto({"id":5531564,"src":"4jonesread1_thumb.jpg","galleries_id":286294,"server_id":18,"link":"photo_5531564.html","width":130,"caption":"Read It","height":89});
															thumbnails[5531821] = clik.newPhoto({"id":5531821,"src":"_Ragazza_Web_thumb.jpg","galleries_id":79331,"server_id":18,"link":"photo_5531821.html","width":130,"caption":"La Ragazza di Sangue e Latte","height":130});
															thumbnails[5531880] = clik.newPhoto({"id":5531880,"src":"Croquet_Web_thumb.jpg","galleries_id":79331,"server_id":18,"link":"photo_5531880.html","width":130,"caption":"The Queen's Croquet Ground","height":130});
															thumbnails[5531883] = clik.newPhoto({"id":5531883,"src":"Cockeral_Web_thumb.jpg","galleries_id":79331,"server_id":18,"link":"photo_5531883.html","width":130,"caption":"Reclining Cockeral","height":130});
															thumbnails[5531893] = clik.newPhoto({"id":5531893,"src":"Lola_Legs_Web_thumb.jpg","galleries_id":79331,"server_id":18,"link":"photo_5531893.html","width":130,"caption":"Musical Statue","height":131});
															thumbnails[5531902] = clik.newPhoto({"id":5531902,"src":"Red_Shoes_Web_thumb.jpg","galleries_id":79331,"server_id":18,"link":"photo_5531902.html","width":130,"caption":"Red Hot Shoes","height":130});
															thumbnails[5531904] = clik.newPhoto({"id":5531904,"src":"Lamb_Web_thumb.jpg","galleries_id":79331,"server_id":18,"link":"photo_5531904.html","width":130,"caption":"Lamb","height":131});
															thumbnails[5531906] = clik.newPhoto({"id":5531906,"src":"Tarts_Web_thumb.jpg","galleries_id":79331,"server_id":18,"link":"photo_5531906.html","width":130,"caption":"Who Stole the Tarts?","height":129});
															thumbnails[5531908] = clik.newPhoto({"id":5531908,"src":"Beast_Web_thumb.jpg","galleries_id":79331,"server_id":18,"link":"photo_5531908.html","width":130,"caption":"Beauty and the Beast","height":130});
															thumbnails[5531926] = clik.newPhoto({"id":5531926,"src":"3joneskeep1_thumb.jpg","galleries_id":286294,"server_id":18,"link":"photo_5531926.html","width":130,"caption":"Keep Still","height":86});
															thumbnails[5537189] = clik.newPhoto({"id":5537189,"src":"Cowboy_F0A672C3-1D09-001F-99861E319CB97F13_thumb.jpg","galleries_id":374593,"server_id":18,"link":"photo_5537189.html","width":130,"caption":"Cowboy","height":130});
															thumbnails[5537217] = clik.newPhoto({"id":5537217,"src":"ButterflyW3_thumb.jpg","galleries_id":374593,"server_id":18,"link":"photo_5537217.html","width":130,"caption":"Butterfly","height":130});
															thumbnails[5537227] = clik.newPhoto({"id":5537227,"src":"PeterPanW3_thumb.jpg","galleries_id":374593,"server_id":18,"link":"photo_5537227.html","width":130,"caption":"Peter Pan","height":130});
															thumbnails[5537232] = clik.newPhoto({"id":5537232,"src":"FairyW3_thumb.jpg","galleries_id":374593,"server_id":18,"link":"photo_5537232.html","width":130,"caption":"Fairy","height":130});
															thumbnails[5537236] = clik.newPhoto({"id":5537236,"src":"PrincessW3_thumb.jpg","galleries_id":374593,"server_id":18,"link":"photo_5537236.html","width":130,"caption":"Princess","height":130});
															thumbnails[5537241] = clik.newPhoto({"id":5537241,"src":"Princess_GenovieveW3_thumb.jpg","galleries_id":374593,"server_id":18,"link":"photo_5537241.html","width":130,"caption":"Princess Genovieve","height":130});
															thumbnails[5537252] = clik.newPhoto({"id":5537252,"src":"MouskateerW3_thumb.jpg","galleries_id":374593,"server_id":18,"link":"photo_5537252.html","width":130,"caption":"Mouskateer","height":130});
															thumbnails[5537257] = clik.newPhoto({"id":5537257,"src":"SnowWhiteW_thumb.jpg","galleries_id":374593,"server_id":18,"link":"photo_5537257.html","width":130,"caption":"Snow White","height":130});
															thumbnails[5675568] = clik.newPhoto({"id":5675568,"src":"double_feathers_thumb.jpg","galleries_id":321568,"server_id":18,"link":"photo_5675568.html","width":130,"caption":"Feathers of the Scarlet Macaw","height":87});
															thumbnails[5675570] = clik.newPhoto({"id":5675570,"src":"Apples_Forest_thumb.jpg","galleries_id":321568,"server_id":18,"link":"photo_5675570.html","width":130,"caption":"Wood sprites made a sound like the wind whispering through the leaves when they talked","height":87});
															thumbnails[5675573] = clik.newPhoto({"id":5675573,"src":"Crayfish_thumb.jpg","galleries_id":321568,"server_id":18,"link":"photo_5675573.html","width":130,"caption":"Captured","height":87});
															thumbnails[5675579] = clik.newPhoto({"id":5675579,"src":"Image_D_thumb.jpg","galleries_id":321568,"server_id":18,"link":"photo_5675579.html","width":130,"caption":"The pretty china doll that went everywhere with her","height":87});
															thumbnails[5675586] = clik.newPhoto({"id":5675586,"src":"Spider_thumb.jpg","galleries_id":321568,"server_id":18,"link":"photo_5675586.html","width":130,"caption":"She disappeared in a rainbow swirl of water droplets","height":87});
															thumbnails[5675593] = clik.newPhoto({"id":5675593,"src":"Image_B_thumb.jpg","galleries_id":321568,"server_id":18,"link":"photo_5675593.html","width":130,"caption":"Can you spare some apples for a poor hungry soul?","height":87});
															thumbnails[6062921] = clik.newPhoto({"id":6062921,"src":"Close_your_eyes_thumb.jpg","galleries_id":286294,"server_id":18,"link":"photo_6062921.html","width":130,"caption":"Close Your Eyes","height":85});
															thumbnails[6084492] = clik.newPhoto({"id":6084492,"src":"Stand_up_straight_thumb.jpg","galleries_id":286294,"server_id":18,"link":"photo_6084492.html","width":130,"caption":"Stand Up Straight","height":90});
															thumbnails[7167114] = clik.newPhoto({"id":7167114,"src":"Stop-Crying_thumb.jpg","galleries_id":286294,"server_id":18,"link":"photo_7167114.html","width":130,"caption":"Stop Crying","height":88});
															thumbnails[7454845] = clik.newPhoto({"id":7454845,"src":"Rose_low_res_thumb.jpg","galleries_id":321568,"server_id":18,"link":"photo_7454845.html","width":130,"caption":"How am I going to capture a bird like that?","height":87});
															thumbnails[7454884] = clik.newPhoto({"id":7454884,"src":"fish_on_sand_low_res_thumb.jpg","galleries_id":321568,"server_id":18,"link":"photo_7454884.html","width":130,"caption":"The sun had started smiling upon the earth","height":87});
															thumbnails[8307047] = clik.newPhoto({"id":8307047,"src":"05See_Naples_and_Die_thumb.jpg","galleries_id":441856,"server_id":18,"link":"photo_8307047.html","width":130,"caption":"","height":86});
															thumbnails[8307048] = clik.newPhoto({"id":8307048,"src":"07See_Naples_and_Die_thumb.jpg","galleries_id":441856,"server_id":18,"link":"photo_8307048.html","width":130,"caption":"","height":196});
															thumbnails[8307051] = clik.newPhoto({"id":8307051,"src":"11See_Naples_and_Die_thumb.jpg","galleries_id":441856,"server_id":18,"link":"photo_8307051.html","width":130,"caption":"","height":195});
															thumbnails[8307052] = clik.newPhoto({"id":8307052,"src":"12See_Naples_and_Die_thumb.jpg","galleries_id":441856,"server_id":18,"link":"photo_8307052.html","width":130,"caption":"","height":87});
															thumbnails[8307053] = clik.newPhoto({"id":8307053,"src":"13See_Naples_and_Die_thumb.jpg","galleries_id":441856,"server_id":18,"link":"photo_8307053.html","width":130,"caption":"","height":87});
															thumbnails[8307055] = clik.newPhoto({"id":8307055,"src":"14See_Naples_and_Die_thumb.jpg","galleries_id":441856,"server_id":18,"link":"photo_8307055.html","width":130,"caption":"","height":195});
															thumbnails[5531565] = clik.newPhoto({"id":5531565,"src":"6jonesstop_thumb.jpg","galleries_id":286294,"server_id":18,"link":"photo_5531565.html","width":130,"caption":"Stop Now","height":89});
															thumbnails[8306984] = clik.newPhoto({"id":8306984,"src":"009See_Naples_and_Die_series_thumb.jpg","galleries_id":441856,"server_id":18,"link":"photo_8306984.html","width":130,"caption":"","height":86});
															thumbnails[8925925] = clik.newPhoto({"id":8925925,"src":"Venus_2_thumb.jpg","galleries_id":448582,"server_id":18,"link":"photo_8925925.html","width":130,"caption":"","height":87});
															thumbnails[6226429] = clik.newPhoto({"id":6226429,"src":"Open_up1_thumb.jpg","galleries_id":286294,"server_id":18,"link":"photo_6226429.html","width":130,"caption":"Open Your Mouth","height":88});
															thumbnails[8306985] = clik.newPhoto({"id":8306985,"src":"015See_Naples_and_Die_series_thumb.jpg","galleries_id":441856,"server_id":18,"link":"photo_8306985.html","width":130,"caption":"","height":88});
															thumbnails[8925924] = clik.newPhoto({"id":8925924,"src":"Venus_1_thumb.jpg","galleries_id":448582,"server_id":18,"link":"photo_8925924.html","width":130,"caption":"","height":87});
															thumbnails[8306986] = clik.newPhoto({"id":8306986,"src":"023See_Naples_and_Die_series_thumb.jpg","galleries_id":441856,"server_id":18,"link":"photo_8306986.html","width":130,"caption":"","height":86});
															thumbnails[8307049] = clik.newPhoto({"id":8307049,"src":"09See_Naples_and_Die_thumb.jpg","galleries_id":441856,"server_id":18,"link":"photo_8307049.html","width":130,"caption":"","height":90});
															thumbnails[8306989] = clik.newPhoto({"id":8306989,"src":"001See_Naples_and_Die_series_thumb.jpg","galleries_id":441856,"server_id":18,"link":"photo_8306989.html","width":130,"caption":"","height":191});
															thumbnails[8307045] = clik.newPhoto({"id":8307045,"src":"02See_Naples_and_Die_thumb.jpg","galleries_id":441856,"server_id":18,"link":"photo_8307045.html","width":130,"caption":"","height":195});
															thumbnails[8307046] = clik.newPhoto({"id":8307046,"src":"03See_Naples_and_Die_thumb.jpg","galleries_id":441856,"server_id":18,"link":"photo_8307046.html","width":130,"caption":"","height":194});
															thumbnails[8307050] = clik.newPhoto({"id":8307050,"src":"10See_Naples_and_Die_thumb.jpg","galleries_id":441856,"server_id":18,"link":"photo_8307050.html","width":130,"caption":"","height":192});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[448582] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"The Venus Effect 2011","link":"gallery_448582.html","maxRecords":0.0,"photoIDs":[8925925.0,8925924.0],"skipIndex":0,"section_code":"gallery","featured_images":"8925925,8925924","id":448582,"singleSection":false});				  						galleries[286294] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"CALL YOURSELF A MOTHER 2009\/10","link":"gallery_286294.html","maxRecords":0.0,"photoIDs":[5531561.0,5531564.0,5531926.0,6062921.0,6084492.0,7167114.0,5531565.0,6226429.0],"skipIndex":0,"section_code":"gallery","featured_images":7167114.0,"id":286294,"singleSection":false});				  						galleries[321568] = clik.newGallery({"parentGallery":418766,"usePopups":false,"title":"A Pocketful of Magic 2009","link":"gallery_321568.html","maxRecords":0.0,"photoIDs":[5675568.0,5675570.0,5675573.0,5675579.0,5675586.0,5675593.0,7454845.0,7454884.0],"skipIndex":0,"section_code":"gallery","featured_images":"7454884,7454845,5675593,5675586,5675579,5675573,5675570,5675568","id":321568,"singleSection":false});				  						galleries[374593] = clik.newGallery({"parentGallery":418766,"usePopups":false,"title":"Dream World 2008","link":"gallery_374593.html","maxRecords":0.0,"photoIDs":[5537189.0,5537217.0,5537227.0,5537232.0,5537236.0,5537241.0,5537252.0,5537257.0],"skipIndex":0,"section_code":"gallery","featured_images":"5537257,5537252,5537241,5537236,5537232,5537227,5537217,5537189","id":374593,"singleSection":false});				  						galleries[79331] = clik.newGallery({"parentGallery":418766,"usePopups":false,"title":"Once Upon a Time 2007","link":"gallery_79331.html","maxRecords":0.0,"photoIDs":[5531821.0,5531880.0,5531883.0,5531893.0,5531902.0,5531904.0,5531906.0,5531908.0],"skipIndex":0,"section_code":"gallery","featured_images":"5531902,5531821","id":79331,"singleSection":false});				  						galleries[441856] = clik.newGallery({"parentGallery":418766,"usePopups":false,"title":"See Naples and Die 2006","link":"gallery_441856.html","maxRecords":0.0,"photoIDs":[8307047.0,8307048.0,8307051.0,8307052.0,8307053.0,8307055.0,8306984.0,8306985.0,8306986.0,8307049.0,8306989.0,8307045.0,8307046.0,8307050.0],"skipIndex":0,"section_code":"gallery","featured_images":"8307055,8307053,8307052,8307051,8307050,8307049,8307048,8307047,8307046,8307045","id":441856,"singleSection":false});				  						galleries[418766] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Earlier Works & Commissions","link":"gallery_418766.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":"5531902,5531821","id":418766,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '5531926,5531561,6226429';
imageSets[2] = '7167114,5531902,5531821';
imageSets[3] = '8925925,8925924,8307055,8307053,8307052,8307051,8307050,8307049,8307048,8307047,8307046,8307045,8306989,8306986,8306985,8306984,7454884,7454845,7167114,6226429,6084492,6062921,5675593,5675586,5675579,5675573,5675570,5675568,5537257,5537252,5537241,5537236,5537232,5537227,5537217,5537189,5531926,5531908,5531906,5531904,5531902,5531893,5531883,5531880,5531821,5531565,5531564,5531561';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/hesterjones/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/hesterjones/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/hesterjones/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/hesterjones/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/hesterjones/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/hesterjones/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/hesterjones/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/hesterjones/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/hesterjones/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/hesterjones/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/hesterjones/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/hesterjones/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/hesterjones/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/hesterjones/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/hesterjones/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/hesterjones/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/hesterjones/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/hesterjones/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/hesterjones/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/hesterjones/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/hesterjones/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/hesterjones/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/hesterjones/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/hesterjones/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/hesterjones/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/hesterjones/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/hesterjones/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 = 'Hester Jones Photographic Artist: ' + 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;
	}
}

			

