window.thumbnails = {};
															thumbnails[6295383] = clik.newPhoto({"id":6295383,"src":"triptych_thumb.jpg","galleries_id":679,"server_id":18,"link":"photo_6295383.html","width":130,"caption":"Triptych for Salthouse","height":192});
															thumbnails[147377] = clik.newPhoto({"id":147377,"src":"Seaside Series1_thumb.jpg","galleries_id":679,"server_id":18,"link":"photo_147377.html","width":130,"caption":"The Seaside Series","height":62});
															thumbnails[147380] = clik.newPhoto({"id":147380,"src":"Seaside Series-Autumn2_thumb.jpg","galleries_id":679,"server_id":18,"link":"photo_147380.html","width":130,"caption":"Autumn - from Seaside series","height":108});
															thumbnails[147381] = clik.newPhoto({"id":147381,"src":"Seaside Series-Easter 12-43-02_thumb.jpg","galleries_id":679,"server_id":18,"link":"photo_147381.html","width":130,"caption":"Easter - from the Seaside series","height":128});
															thumbnails[147382] = clik.newPhoto({"id":147382,"src":"Seaside Series-Spring_thumb.jpg.jpg","galleries_id":679,"server_id":18,"link":"photo_147382.html","width":130,"caption":"Spring - from the Seaside series","height":193});
															thumbnails[147384] = clik.newPhoto({"id":147384,"src":"Seaside Series-Winter_thumb.jpg","galleries_id":679,"server_id":18,"link":"photo_147384.html","width":130,"caption":"Winter - from Seaside series","height":193});
															thumbnails[147385] = clik.newPhoto({"id":147385,"src":"Seasie Series-Summer_thumb.jpg","galleries_id":679,"server_id":18,"link":"photo_147385.html","width":130,"caption":"Summer - from Seaside series","height":123});
															thumbnails[147386] = clik.newPhoto({"id":147386,"src":"splash_thumb.jpg","galleries_id":679,"server_id":18,"link":"photo_147386.html","width":130,"caption":"Splash","height":87});
															thumbnails[147391] = clik.newPhoto({"id":147391,"src":"Dog in the Playground_thumb.jpg","galleries_id":679,"server_id":18,"link":"photo_147391.html","width":130,"caption":"Dog in the Playground","height":131});
															thumbnails[147392] = clik.newPhoto({"id":147392,"src":"games children play_thumb.jpg","galleries_id":679,"server_id":18,"link":"photo_147392.html","width":130,"caption":"Games Children Play","height":322});
															thumbnails[147395] = clik.newPhoto({"id":147395,"src":"grandmothers footsteps_thumb.jpg","galleries_id":679,"server_id":18,"link":"photo_147395.html","width":130,"caption":"Grandmother's Footsteps","height":103});
															thumbnails[147405] = clik.newPhoto({"id":147405,"src":"Behind the Curtains_thumb.jpg","galleries_id":12202,"server_id":18,"link":"photo_147405.html","width":130,"caption":"Behind the Curtains","height":73});
															thumbnails[147406] = clik.newPhoto({"id":147406,"src":"Family IV_thumb.jpg","galleries_id":12202,"server_id":18,"link":"photo_147406.html","width":130,"caption":"Family. ","height":139});
															thumbnails[147407] = clik.newPhoto({"id":147407,"src":"Family Portrait_thumb.jpg","galleries_id":12202,"server_id":18,"link":"photo_147407.html","width":130,"caption":"Collection of the Artist.","height":91});
															thumbnails[147408] = clik.newPhoto({"id":147408,"src":"Jump_thumb.jpg","galleries_id":12202,"server_id":18,"link":"photo_147408.html","width":130,"caption":"Jump.","height":95});
															thumbnails[147409] = clik.newPhoto({"id":147409,"src":"Visitors_thumb.jpg","galleries_id":12202,"server_id":18,"link":"photo_147409.html","width":130,"caption":"Visitors.","height":98});
															thumbnails[147410] = clik.newPhoto({"id":147410,"src":"Reunion_thumb.jpg","galleries_id":12202,"server_id":18,"link":"photo_147410.html","width":130,"caption":"Reunion","height":112});
															thumbnails[147411] = clik.newPhoto({"id":147411,"src":"monoprint_thumb.jpg","galleries_id":12202,"server_id":18,"link":"photo_147411.html","width":130,"caption":"Untitled","height":159});
															thumbnails[147412] = clik.newPhoto({"id":147412,"src":"Family Snap I_thumb.jpg","galleries_id":12202,"server_id":18,"link":"photo_147412.html","width":130,"caption":"Family Snap","height":187});
															thumbnails[147414] = clik.newPhoto({"id":147414,"src":"Journey_thumb.jpg","galleries_id":12202,"server_id":18,"link":"photo_147414.html","width":130,"caption":"The Journey ","height":138});
															thumbnails[147415] = clik.newPhoto({"id":147415,"src":"Journey 2_thumb.jpg","galleries_id":12202,"server_id":18,"link":"photo_147415.html","width":130,"caption":"from The Journey","height":144});
															thumbnails[147417] = clik.newPhoto({"id":147417,"src":"Left Luggage_thumb.jpg","galleries_id":11825,"server_id":18,"link":"photo_147417.html","width":130,"caption":"Left Luggage","height":140});
															thumbnails[147418] = clik.newPhoto({"id":147418,"src":"Left Luggage (detail)_thumb.jpg","galleries_id":11825,"server_id":18,"link":"photo_147418.html","width":130,"caption":"Left Luggage","height":98});
															thumbnails[147422] = clik.newPhoto({"id":147422,"src":"Lanterns2_thumb.jpg","galleries_id":11825,"server_id":18,"link":"photo_147422.html","width":130,"caption":"Lanterns","height":272});
															thumbnails[147426] = clik.newPhoto({"id":147426,"src":"Lanterns_thumb.jpg","galleries_id":11825,"server_id":18,"link":"photo_147426.html","width":130,"caption":"Lanterns encased","height":54});
															thumbnails[147427] = clik.newPhoto({"id":147427,"src":"MirrorCradle_thumb.jpg","galleries_id":11825,"server_id":18,"link":"photo_147427.html","width":130,"caption":"Mirror Cradle","height":153});
															thumbnails[147429] = clik.newPhoto({"id":147429,"src":"Walk-in Album (detail)_thumb.jpg","galleries_id":11825,"server_id":18,"link":"photo_147429.html","width":130,"caption":"Walk-in Album","height":87});
															thumbnails[147433] = clik.newPhoto({"id":147433,"src":"Honeymoon_thumb.jpg","galleries_id":13669,"server_id":18,"link":"photo_147433.html","width":130,"caption":"Honeymoon","height":173});
															thumbnails[147435] = clik.newPhoto({"id":147435,"src":"Running_thumb.jpg","galleries_id":13669,"server_id":18,"link":"photo_147435.html","width":130,"caption":"Running","height":175});
															thumbnails[148274] = clik.newPhoto({"id":148274,"src":"behind the curtains1_thumb.jpg","galleries_id":12202,"server_id":18,"link":"photo_148274.html","width":130,"caption":"Behind the Curtains<br>\r\n","height":149});
															thumbnails[148275] = clik.newPhoto({"id":148275,"src":"boy with a hoop_thumb.jpg","galleries_id":12202,"server_id":18,"link":"photo_148275.html","width":130,"caption":"Boy with a Hoop","height":120});
															thumbnails[148283] = clik.newPhoto({"id":148283,"src":"memory field_thumb.jpg","galleries_id":11825,"server_id":18,"link":"photo_148283.html","width":130,"caption":"Memory Field","height":61});
															thumbnails[148285] = clik.newPhoto({"id":148285,"src":"Memory Field detail_thumb.jpg","galleries_id":11825,"server_id":18,"link":"photo_148285.html","width":130,"caption":"Memory Field","height":182});
															thumbnails[148286] = clik.newPhoto({"id":148286,"src":"memoryfield_thumb.jpg","galleries_id":11825,"server_id":18,"link":"photo_148286.html","width":130,"caption":"Memory Field (detail)","height":155});
															thumbnails[149517] = clik.newPhoto({"id":149517,"src":"grandma's house_thumb.jpg","galleries_id":13669,"server_id":18,"link":"photo_149517.html","width":130,"caption":"Grandma's House","height":97});
															thumbnails[339534] = clik.newPhoto({"id":339534,"src":"walking pictures_thumb.jpg","galleries_id":13669,"server_id":18,"link":"photo_339534.html","width":130,"caption":"walking pictures","height":98});
															thumbnails[3021153] = clik.newPhoto({"id":3021153,"src":"anchors_thumb.jpg","galleries_id":11825,"server_id":18,"link":"photo_3021153.html","width":130,"caption":"Anchor Field","height":98});
															thumbnails[3021156] = clik.newPhoto({"id":3021156,"src":"above them in the air_thumb....jpg","galleries_id":11825,"server_id":18,"link":"photo_3021156.html","width":130,"caption":"Above them in the air...","height":111});
															thumbnails[3025165] = clik.newPhoto({"id":3025165,"src":"trip around the boat_thumb.jpg","galleries_id":11825,"server_id":18,"link":"photo_3025165.html","width":130,"caption":"trips around the boat....","height":154});
															thumbnails[3025179] = clik.newPhoto({"id":3025179,"src":"trip detail_thumb.jpg","galleries_id":679,"server_id":18,"link":"photo_3025179.html","width":130,"caption":"detail from 'trips around the boat' ","height":130});
															thumbnails[3025197] = clik.newPhoto({"id":3025197,"src":"trip detail3_thumb.jpg","galleries_id":679,"server_id":18,"link":"photo_3025197.html","width":130,"caption":"detail from 'trips around the boat'","height":126});
															thumbnails[3025202] = clik.newPhoto({"id":3025202,"src":"trip detail4_thumb.jpg","galleries_id":679,"server_id":18,"link":"photo_3025202.html","width":130,"caption":"detail from 'trips around the boat'","height":130});
															thumbnails[3025238] = clik.newPhoto({"id":3025238,"src":"trip detail5_thumb.jpg","galleries_id":679,"server_id":18,"link":"photo_3025238.html","width":130,"caption":"detail from 'trips around the boat'","height":128});
															thumbnails[3025241] = clik.newPhoto({"id":3025241,"src":"trip detail6_thumb.jpg","galleries_id":679,"server_id":18,"link":"photo_3025241.html","width":130,"caption":"detail from 'trips around the boat'","height":130});
															thumbnails[3025246] = clik.newPhoto({"id":3025246,"src":"trip detail7_thumb.jpg","galleries_id":679,"server_id":18,"link":"photo_3025246.html","width":130,"caption":"detail from 'trips around the boat'","height":129});
															thumbnails[3025251] = clik.newPhoto({"id":3025251,"src":"trip detail8_thumb.jpg","galleries_id":679,"server_id":18,"link":"photo_3025251.html","width":130,"caption":"detail of 'trips around the boat'","height":130});
															thumbnails[3025347] = clik.newPhoto({"id":3025347,"src":"trip detail81_thumb.jpg","galleries_id":679,"server_id":18,"link":"photo_3025347.html","width":130,"caption":"detail from 'trips around the boat'","height":125});
															thumbnails[3025489] = clik.newPhoto({"id":3025489,"src":" diary_thumb.jpg","galleries_id":12202,"server_id":2,"link":"photo_3025489.html","width":130,"caption":"Anchor Diary","height":107});
															thumbnails[3025496] = clik.newPhoto({"id":3025496,"src":"anchor diary_thumb.jpg","galleries_id":12202,"server_id":18,"link":"photo_3025496.html","width":130,"caption":"Anchor Diary","height":98});
															thumbnails[4164293] = clik.newPhoto({"id":4164293,"src":"retrieval_system_thumb.jpg","galleries_id":13669,"server_id":18,"link":"photo_4164293.html","width":130,"caption":"Retrieval System","height":116});
															thumbnails[4164325] = clik.newPhoto({"id":4164325,"src":"smallmemories_thumb.jpg","galleries_id":13669,"server_id":18,"link":"photo_4164325.html","width":130,"caption":"Small Memories ","height":173});
															thumbnails[4165406] = clik.newPhoto({"id":4165406,"src":"fragments3_thumb.jpg","galleries_id":679,"server_id":18,"link":"photo_4165406.html","width":130,"caption":"Fragment","height":172});
															thumbnails[4900611] = clik.newPhoto({"id":4900611,"src":"knitting_for_baby_thumb.jpg","galleries_id":13669,"server_id":18,"link":"photo_4900611.html","width":130,"caption":"knitting for baby","height":92});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[13669] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Other media","link":"gallery_13669.html","maxRecords":0.0,"photoIDs":[147433.0,147435.0,149517.0,339534.0,4164293.0,4164325.0,4900611.0],"skipIndex":0,"section_code":"gallery","featured_images":147433.0,"id":13669,"singleSection":false});				  						galleries[679] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Work on Lead","link":"gallery_679.html","maxRecords":0.0,"photoIDs":[6295383.0,147377.0,147380.0,147381.0,147382.0,147384.0,147385.0,147386.0,147391.0,147392.0,147395.0,3025179.0,3025197.0,3025202.0,3025238.0,3025241.0,3025246.0,3025251.0,3025347.0,4165406.0],"skipIndex":0,"section_code":"gallery","featured_images":147381.0,"id":679,"singleSection":false});				  						galleries[11825] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Installations","link":"gallery_11825.html","maxRecords":0.0,"photoIDs":[147417.0,147418.0,147422.0,147426.0,147427.0,147429.0,148283.0,148285.0,148286.0,3021153.0,3021156.0,3025165.0],"skipIndex":0,"section_code":"gallery","featured_images":"3025165,3021156,3021153,148286,148285,148283,147429,147427,147426,147422","id":11825,"singleSection":false});				  						galleries[12202] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"work on paper","link":"gallery_12202.html","maxRecords":0.0,"photoIDs":[147405.0,147406.0,147407.0,147408.0,147409.0,147410.0,147411.0,147412.0,147414.0,147415.0,148274.0,148275.0,3025489.0,3025496.0],"skipIndex":0,"section_code":"gallery","featured_images":"3025496,3025489,148275,148274,147415,147414,147412,147411,147410,147409","id":12202,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '4164293,147435,147433,147429,147407,147381';
imageSets[2] = '147433,147381';
imageSets[3] = '6295383,4900611,4165406,4164325,4164293,3025496,3025489,3025347,3025251,3025246,3025241,3025238,3025202,3025197,3025179,3025165,3021156,3021153,339534,149517,148286,148285,148283,148275,148274,147435,147433,147429,147427,147426,147422,147418,147417,147415,147414,147412,147411,147410,147409,147408,147407,147406,147405,147395,147392,147391,147386,147385,147384,147382';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/lizpeer/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/lizpeer/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/lizpeer/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/lizpeer/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/lizpeer/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/lizpeer/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/lizpeer/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/lizpeer/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/lizpeer/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/lizpeer/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/lizpeer/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/lizpeer/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/lizpeer/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/lizpeer/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/lizpeer/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/lizpeer/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/lizpeer/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/lizpeer/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/lizpeer/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/lizpeer/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/lizpeer/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/lizpeer/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/lizpeer/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/lizpeer/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/lizpeer/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 = 'Elizabeth Peer - Artist - Printmaker: ' + 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 !== '' || 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({					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;
	}
}

		

