window.thumbnails = {};
															thumbnails[1741286] = clik.newPhoto({"id":1741286,"src":"artworks8 sally grant, 'Expectant' ws3_thumb.jpg","galleries_id":116907,"server_id":15,"link":"photo_1741286.html","width":130,"caption":"","height":188});
															thumbnails[1741290] = clik.newPhoto({"id":1741290,"src":"CNV00010 ws3_thumb.jpg","galleries_id":116983,"server_id":15,"link":"photo_1741290.html","width":130,"caption":"","height":194});
															thumbnails[1741293] = clik.newPhoto({"id":1741293,"src":"CNV00011 ws3_thumb.jpg","galleries_id":116972,"server_id":15,"link":"photo_1741293.html","width":130,"caption":"","height":194});
															thumbnails[1741334] = clik.newPhoto({"id":1741334,"src":"DSCN2171 ws3_thumb.jpg","galleries_id":116976,"server_id":15,"link":"photo_1741334.html","width":130,"caption":"","height":188});
															thumbnails[1741336] = clik.newPhoto({"id":1741336,"src":"momentview2 ws3_thumb.jpg","galleries_id":116978,"server_id":15,"link":"photo_1741336.html","width":130,"caption":"","height":220});
															thumbnails[1741340] = clik.newPhoto({"id":1741340,"src":"small half figure ws3_thumb.jpg","galleries_id":116990,"server_id":15,"link":"photo_1741340.html","width":130,"caption":"","height":167});
															thumbnails[1741343] = clik.newPhoto({"id":1741343,"src":"standing still2 ws3_thumb.jpg","galleries_id":116982,"server_id":15,"link":"photo_1741343.html","width":130,"caption":"","height":173});
															thumbnails[1749412] = clik.newPhoto({"id":1749412,"src":"DSCN1998 ws3_thumb.jpg","galleries_id":116974,"server_id":15,"link":"photo_1749412.html","width":130,"caption":"","height":195});
															thumbnails[2101445] = clik.newPhoto({"id":2101445,"src":"'night' - ws3_thumb.jpg","galleries_id":140049,"server_id":15,"link":"photo_2101445.html","width":130,"caption":"","height":173});
															thumbnails[2101458] = clik.newPhoto({"id":2101458,"src":"seated woman front view ws3_thumb.jpg","galleries_id":140050,"server_id":15,"link":"photo_2101458.html","width":130,"caption":"","height":94});
															thumbnails[2101465] = clik.newPhoto({"id":2101465,"src":"space2 ws3_thumb.jpg","galleries_id":140052,"server_id":15,"link":"photo_2101465.html","width":130,"caption":"","height":195});
															thumbnails[2101469] = clik.newPhoto({"id":2101469,"src":"space7 ws3_thumb.jpg","galleries_id":140052,"server_id":15,"link":"photo_2101469.html","width":130,"caption":"","height":180});
															thumbnails[2742773] = clik.newPhoto({"id":2742773,"src":"daydreamer_thumb.jpg","galleries_id":172304,"server_id":15,"link":"photo_2742773.html","width":130,"caption":"","height":195});
															thumbnails[2742832] = clik.newPhoto({"id":2742832,"src":"girl2_thumb.jpg","galleries_id":172313,"server_id":15,"link":"photo_2742832.html","width":130,"caption":"","height":173});
															thumbnails[2742841] = clik.newPhoto({"id":2742841,"src":"waiting4_thumb.jpg","galleries_id":172314,"server_id":15,"link":"photo_2742841.html","width":130,"caption":"","height":180});
															thumbnails[2742882] = clik.newPhoto({"id":2742882,"src":"waiting 2_thumb.jpg","galleries_id":172314,"server_id":15,"link":"photo_2742882.html","width":130,"caption":"","height":180});
															thumbnails[2742890] = clik.newPhoto({"id":2742890,"src":"music rephoto3_thumb.jpg","galleries_id":172317,"server_id":15,"link":"photo_2742890.html","width":130,"caption":"","height":87});
															thumbnails[2742900] = clik.newPhoto({"id":2742900,"src":"standing woman side_thumb.jpg","galleries_id":116981,"server_id":15,"link":"photo_2742900.html","width":130,"caption":"","height":180});
															thumbnails[2743118] = clik.newPhoto({"id":2743118,"src":"mother and child 6_thumb.jpg","galleries_id":172333,"server_id":15,"link":"photo_2743118.html","width":130,"caption":"","height":180});
															thumbnails[5480431] = clik.newPhoto({"id":5480431,"src":"Remembering_Head-min_thumb.jpg","galleries_id":310112,"server_id":15,"link":"photo_5480431.html","width":130,"caption":"","height":196});
															thumbnails[5480444] = clik.newPhoto({"id":5480444,"src":"DSCN3240_thumb.jpg","galleries_id":310116,"server_id":15,"link":"photo_5480444.html","width":130,"caption":"","height":180});
															thumbnails[5480447] = clik.newPhoto({"id":5480447,"src":"DSCN3241_thumb.jpg","galleries_id":310116,"server_id":15,"link":"photo_5480447.html","width":130,"caption":"","height":180});
															thumbnails[5480504] = clik.newPhoto({"id":5480504,"src":"DSCN3225_thumb.jpg","galleries_id":310118,"server_id":15,"link":"photo_5480504.html","width":130,"caption":"","height":87});
															thumbnails[7496790] = clik.newPhoto({"id":7496790,"src":"landscape-figure1_600x398_thumb.jpg","galleries_id":406952,"server_id":15,"link":"photo_7496790.html","width":130,"caption":"","height":86});
															thumbnails[7505947] = clik.newPhoto({"id":7505947,"src":"single_hand_customsize_thumb.jpg","galleries_id":406940,"server_id":15,"link":"photo_7505947.html","width":130,"caption":"","height":87});
															thumbnails[7506151] = clik.newPhoto({"id":7506151,"src":"girl_bronze_2_thumb.jpg","galleries_id":172313,"server_id":15,"link":"photo_7506151.html","width":160,"caption":"","height":213});
															thumbnails[8169031] = clik.newPhoto({"id":8169031,"src":"crouching_man_front_thumb.jpg","galleries_id":436362,"server_id":15,"link":"photo_8169031.html","width":160,"caption":"Crouching Man","height":168});
															thumbnails[8169043] = clik.newPhoto({"id":8169043,"src":"DSC00081_thumb.JPG","galleries_id":436363,"server_id":15,"link":"photo_8169043.html","width":160,"caption":"","height":58});
															thumbnails[8169048] = clik.newPhoto({"id":8169048,"src":"DSC00203_2_thumb.jpg","galleries_id":436364,"server_id":15,"link":"photo_8169048.html","width":160,"caption":"","height":198});
															thumbnails[5480441] = clik.newPhoto({"id":5480441,"src":"study_of_hands_2_thumb.jpg","galleries_id":310114,"server_id":15,"link":"photo_5480441.html","width":130,"caption":"","height":163});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[116976] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Angel","link":"gallery_116976.html","maxRecords":0.0,"photoIDs":[1741334.0],"skipIndex":0,"section_code":"gallery","featured_images":1741334.0,"id":116976,"singleSection":false});				  						galleries[436363] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Beach Figure","link":"gallery_436363.html","maxRecords":0.0,"photoIDs":[8169043.0],"skipIndex":0,"section_code":"gallery","featured_images":8169043.0,"id":436363,"singleSection":false});				  						galleries[436362] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Crouching Man","link":"gallery_436362.html","maxRecords":0.0,"photoIDs":[8169031.0],"skipIndex":0,"section_code":"gallery","featured_images":8169031.0,"id":436362,"singleSection":false});				  						galleries[116974] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Dreaming Figure","link":"gallery_116974.html","maxRecords":0.0,"photoIDs":[1749412.0],"skipIndex":0,"section_code":"gallery","featured_images":1749412.0,"id":116974,"singleSection":false});				  						galleries[116907] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Expectant","link":"gallery_116907.html","maxRecords":0.0,"photoIDs":[1741286.0],"skipIndex":0,"section_code":"gallery","featured_images":1741286.0,"id":116907,"singleSection":false});				  						galleries[436364] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Floating Head","link":"gallery_436364.html","maxRecords":0.0,"photoIDs":[8169048.0],"skipIndex":0,"section_code":"gallery","featured_images":8169048.0,"id":436364,"singleSection":false});				  						galleries[172313] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Girl","link":"gallery_172313.html","maxRecords":0.0,"photoIDs":[2742832.0,7506151.0],"skipIndex":0,"section_code":"gallery","featured_images":"7506151,2742832","id":172313,"singleSection":false});				  						galleries[406940] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Hand Study","link":"gallery_406940.html","maxRecords":0.0,"photoIDs":[7505947.0],"skipIndex":0,"section_code":"gallery","featured_images":7505947.0,"id":406940,"singleSection":false});				  						galleries[406952] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Landscape figure","link":"gallery_406952.html","maxRecords":0.0,"photoIDs":[7496790.0],"skipIndex":0,"section_code":"gallery","featured_images":7496790.0,"id":406952,"singleSection":false});				  						galleries[116978] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Moment","link":"gallery_116978.html","maxRecords":0.0,"photoIDs":[1741336.0],"skipIndex":0,"section_code":"gallery","featured_images":1741336.0,"id":116978,"singleSection":false});				  						galleries[172333] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Mother and Child","link":"gallery_172333.html","maxRecords":0.0,"photoIDs":[2743118.0],"skipIndex":0,"section_code":"gallery","featured_images":2743118.0,"id":172333,"singleSection":false});				  						galleries[172317] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Music","link":"gallery_172317.html","maxRecords":0.0,"photoIDs":[2742890.0],"skipIndex":0,"section_code":"gallery","featured_images":2742890.0,"id":172317,"singleSection":false});				  						galleries[140049] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Night","link":"gallery_140049.html","maxRecords":0.0,"photoIDs":[2101445.0],"skipIndex":0,"section_code":"gallery","featured_images":2101445.0,"id":140049,"singleSection":false});				  						galleries[310112] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Remembering Head","link":"gallery_310112.html","maxRecords":0.0,"photoIDs":[5480431.0],"skipIndex":0,"section_code":"gallery","featured_images":5480431.0,"id":310112,"singleSection":false});				  						galleries[140050] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Seated Woman","link":"gallery_140050.html","maxRecords":0.0,"photoIDs":[2101458.0],"skipIndex":0,"section_code":"gallery","featured_images":2101458.0,"id":140050,"singleSection":false});				  						galleries[116981] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Standing Figure","link":"gallery_116981.html","maxRecords":0.0,"photoIDs":[2742900.0],"skipIndex":0,"section_code":"gallery","featured_images":2742900.0,"id":116981,"singleSection":false});				  						galleries[116982] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Standing Still","link":"gallery_116982.html","maxRecords":0.0,"photoIDs":[1741343.0],"skipIndex":0,"section_code":"gallery","featured_images":1741343.0,"id":116982,"singleSection":false});				  						galleries[116983] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Stretch","link":"gallery_116983.html","maxRecords":0.0,"photoIDs":[1741290.0],"skipIndex":0,"section_code":"gallery","featured_images":1741290.0,"id":116983,"singleSection":false});				  						galleries[116972] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Sunbather","link":"gallery_116972.html","maxRecords":0.0,"photoIDs":[1741293.0],"skipIndex":0,"section_code":"gallery","featured_images":1741293.0,"id":116972,"singleSection":false});				  						galleries[116990] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Thinking Man","link":"gallery_116990.html","maxRecords":0.0,"photoIDs":[1741340.0],"skipIndex":0,"section_code":"gallery","featured_images":1741340.0,"id":116990,"singleSection":false});				  						galleries[172314] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Waiting","link":"gallery_172314.html","maxRecords":0.0,"photoIDs":[2742841.0,2742882.0],"skipIndex":0,"section_code":"gallery","featured_images":2742841.0,"id":172314,"singleSection":false});				  						galleries[140052] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Whispering Head ","link":"gallery_140052.html","maxRecords":0.0,"photoIDs":[2101465.0,2101469.0],"skipIndex":0,"section_code":"gallery","featured_images":"2101469,2101465","id":140052,"singleSection":false});				  						galleries[172304] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Daydreamer","link":"gallery_172304.html","maxRecords":0.0,"photoIDs":[2742773.0],"skipIndex":0,"section_code":"gallery","featured_images":2742773.0,"id":172304,"singleSection":false});				  						galleries[310114] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Study of Hands","link":"gallery_310114.html","maxRecords":0.0,"photoIDs":[5480441.0],"skipIndex":0,"section_code":"gallery","featured_images":5480441.0,"id":310114,"singleSection":false});				  						galleries[310116] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Turn the Other Cheek","link":"gallery_310116.html","maxRecords":0.0,"photoIDs":[5480444.0,5480447.0],"skipIndex":0,"section_code":"gallery","featured_images":"5480447,5480444","id":310116,"singleSection":false});				  						galleries[310118] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Sleeping Head","link":"gallery_310118.html","maxRecords":0.0,"photoIDs":[5480504.0],"skipIndex":0,"section_code":"gallery","featured_images":5480504.0,"id":310118,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8169048,8169043,8169031,7506151,7505947,7496790,5480431,2742890,2742832,2101469,2101465,2101445,1741340,1741334,1741293,1741290';
imageSets[2] = '7506151,7505947,7496790,5480431,2742890,2742841,2742832,2101469,2101465,2101458,2101445,1741343,1741340,1741334,1741293,1741290,1741286';
imageSets[3] = '7496790,5480504,5480447,5480444,5480431,2743118,2742900,2742890,2742882,2742841,2742832,2742773,2101469,2101465,2101458,2101445,1749412,1741343,1741340,1741336,1741334,1741293,1741290,1741286,5480441';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/sallygrant/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/sallygrant/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/sallygrant/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/sallygrant/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/sallygrant/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/sallygrant/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/sallygrant/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/sallygrant/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/sallygrant/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/sallygrant/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/sallygrant/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/sallygrant/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/sallygrant/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/sallygrant/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/sallygrant/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/sallygrant/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/sallygrant/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/sallygrant/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/sallygrant/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/sallygrant/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/sallygrant/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/sallygrant/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/sallygrant/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/sallygrant/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/sallygrant/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/sallygrant/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/sallygrant/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 = 'Sally Grant Sculpture: ' + 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;
	}
}

			

