window.thumbnails = {};
															thumbnails[6213998] = clik.newPhoto({"id":6213998,"src":"Me_300_dpi_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":157});
															thumbnails[6236914] = clik.newPhoto({"id":6236914,"src":"dadhomepg_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"My wonderful Dad. Pastel.","height":167});
															thumbnails[8480864] = clik.newPhoto({"id":8480864,"src":"clic_pic_thumb.jpg","galleries_id":346403,"server_id":5,"link":"photo_8480864.html","width":130,"caption":"Snow Leopard. Pastel. Sold.","height":184});
															thumbnails[8492816] = clik.newPhoto({"id":8492816,"src":"Bull_resized_for_clik_pic_thumb.jpg","galleries_id":346404,"server_id":5,"link":"photo_8492816.html","width":130,"caption":"A Highland Bull in Acrylic. Sold.","height":97});
															thumbnails[8492967] = clik.newPhoto({"id":8492967,"src":"giraffe_resized_for_clik_pic_thumb.jpg","galleries_id":346403,"server_id":5,"link":"photo_8492967.html","width":130,"caption":"A Long Look. Acrylic on canvas. Sold.","height":272});
															thumbnails[8480854] = clik.newPhoto({"id":8480854,"src":"clik_pic_thumb.jpg","galleries_id":346401,"server_id":5,"link":"photo_8480854.html","width":130,"caption":"Triumph. A proud and beautiful horse. ","height":197});
															thumbnails[8492874] = clik.newPhoto({"id":8492874,"src":"plough_horses_resized_clik_pic_thumb.jpg","galleries_id":346401,"server_id":5,"link":"photo_8492874.html","width":130,"caption":"Two Dorset plough horses. Acrylic on Canvas.","height":174});
															thumbnails[7552826] = clik.newPhoto({"id":7552826,"src":"for_clicpic_thumb.jpg","galleries_id":346401,"server_id":5,"link":"photo_7552826.html","width":130,"caption":"My horse on the cover of \"Paint\".","height":183});
															thumbnails[6383384] = clik.newPhoto({"id":6383384,"src":"Cat_for_clic_pic_thumb.jpg","galleries_id":346388,"server_id":5,"link":"photo_6383384.html","width":130,"caption":"Cat by a window. Pastel and acrylic. SOLD. Prints available.","height":178});
															thumbnails[7515471] = clik.newPhoto({"id":7515471,"src":"P1010786_-_Copy_thumb.JPG","galleries_id":346387,"server_id":5,"link":"photo_7515471.html","width":130,"caption":"Elkie. Our much missed dog. Pastel.","height":182});
															thumbnails[7515451] = clik.newPhoto({"id":7515451,"src":"P1010737_-_Copy_thumb.JPG","galleries_id":346387,"server_id":5,"link":"photo_7515451.html","width":130,"caption":"Jay. A commission. Pastel.","height":179});
															thumbnails[7515461] = clik.newPhoto({"id":7515461,"src":"P1010706_-_Copy_thumb.JPG","galleries_id":346387,"server_id":5,"link":"photo_7515461.html","width":130,"caption":"Cocoa and Bounty. A commission. Pastel.","height":98});
															thumbnails[7515478] = clik.newPhoto({"id":7515478,"src":"P1010793_-_Copy_thumb.JPG","galleries_id":346403,"server_id":5,"link":"photo_7515478.html","width":130,"caption":"White Wolf. Pastel.","height":97});
															thumbnails[7515482] = clik.newPhoto({"id":7515482,"src":"P10106321_thumb.JPG","galleries_id":346403,"server_id":5,"link":"photo_7515482.html","width":130,"caption":"Tiger Drinking. Acrylic on canvas. Sold.","height":106});
															thumbnails[7515556] = clik.newPhoto({"id":7515556,"src":"P1010791_-_Copy_thumb.JPG","galleries_id":346387,"server_id":5,"link":"photo_7515556.html","width":130,"caption":"What was that! Pastel.","height":173});
															thumbnails[6948939] = clik.newPhoto({"id":6948939,"src":"056_-_Copy_thumb.JPG","galleries_id":346388,"server_id":5,"link":"photo_6948939.html","width":130,"caption":"Cleo. A commission.Pastel.","height":161});
															thumbnails[6948957] = clik.newPhoto({"id":6948957,"src":"P1010627_thumb.JPG","galleries_id":346388,"server_id":5,"link":"photo_6948957.html","width":130,"caption":"Buffy. A commission for Nat. Pastel.","height":198});
															thumbnails[6949058] = clik.newPhoto({"id":6949058,"src":"Pippin_finished_thumb.JPG","galleries_id":346387,"server_id":5,"link":"photo_6949058.html","width":130,"caption":"Pippin. A commission. Pastel.","height":175});
															thumbnails[6950036] = clik.newPhoto({"id":6950036,"src":"P10104671_thumb.JPG","galleries_id":346388,"server_id":5,"link":"photo_6950036.html","width":130,"caption":"Enzo. Commission. Pastel.","height":88});
															thumbnails[6213951] = clik.newPhoto({"id":6213951,"src":"adrienne_002_thumb.JPG","galleries_id":346387,"server_id":5,"link":"photo_6213951.html","width":130,"caption":"Maisie Millie and Rollo. A commission for Adrienne and Jeremy","height":94});
															thumbnails[6213954] = clik.newPhoto({"id":6213954,"src":"Art_for_forum_001_thumb.JPG","galleries_id":346387,"server_id":5,"link":"photo_6213954.html","width":130,"caption":"Take the plunge.  Acrylic. SOLD","height":101});
															thumbnails[6213958] = clik.newPhoto({"id":6213958,"src":"Artwork_003_thumb.JPG","galleries_id":346387,"server_id":5,"link":"photo_6213958.html","width":130,"caption":"Looking Out. Pastel.","height":174});
															thumbnails[6213965] = clik.newPhoto({"id":6213965,"src":"Ass_Horse_003_thumb.JPG","galleries_id":346401,"server_id":5,"link":"photo_6213965.html","width":130,"caption":"Freedom. Pastel and acrylic. SOLD. Prints available ","height":181});
															thumbnails[6213967] = clik.newPhoto({"id":6213967,"src":"Assignment_4_005_thumb.JPG","galleries_id":346401,"server_id":5,"link":"photo_6213967.html","width":130,"caption":"Two Amigos. Pastel.","height":94});
															thumbnails[6213968] = clik.newPhoto({"id":6213968,"src":"autumn_topaz_001_thumb.JPG","galleries_id":346387,"server_id":5,"link":"photo_6213968.html","width":130,"caption":"Autumn Gold. Pastel.","height":173});
															thumbnails[6213973] = clik.newPhoto({"id":6213973,"src":"best_GSD_thumb.JPG","galleries_id":346387,"server_id":5,"link":"photo_6213973.html","width":130,"caption":"German Shepherd. Pastel","height":194});
															thumbnails[6213975] = clik.newPhoto({"id":6213975,"src":"best_xmas_dogs_thumb.JPG","galleries_id":346387,"server_id":5,"link":"photo_6213975.html","width":130,"caption":"Snow Dogs. Pastel.","height":143});
															thumbnails[6213977] = clik.newPhoto({"id":6213977,"src":"Chestnut_arab_in_pastel_018_thumb.JPG","galleries_id":346401,"server_id":5,"link":"photo_6213977.html","width":130,"caption":"Fire. Pastel.","height":110});
															thumbnails[6213979] = clik.newPhoto({"id":6213979,"src":"dad_resized_thumb.jpg","galleries_id":346405,"server_id":5,"link":"photo_6213979.html","width":130,"caption":"My Dad and our dog Jenny. Pastel.","height":167});
															thumbnails[6213980] = clik.newPhoto({"id":6213980,"src":"heavy_horse_thumb.JPG","galleries_id":346401,"server_id":5,"link":"photo_6213980.html","width":130,"caption":"Heavy Horse. Pastel. Sold. Prints and cards available.","height":173});
															thumbnails[6213983] = clik.newPhoto({"id":6213983,"src":"Jasper_finished_004_thumb.JPG","galleries_id":346388,"server_id":5,"link":"photo_6213983.html","width":130,"caption":"Jasper. Commission. Pastel.","height":89});
															thumbnails[6213984] = clik.newPhoto({"id":6213984,"src":"macaws_003_thumb.JPG","galleries_id":346403,"server_id":5,"link":"photo_6213984.html","width":130,"caption":"Blue and Gold Macaws. Pastel. Sold.","height":181});
															thumbnails[6213986] = clik.newPhoto({"id":6213986,"src":"Mina_4_002_thumb.JPG","galleries_id":346388,"server_id":5,"link":"photo_6213986.html","width":130,"caption":"Mina. Commission. Pastel.","height":85});
															thumbnails[6213989] = clik.newPhoto({"id":6213989,"src":"OSWOAS_002_thumb.JPG","galleries_id":346404,"server_id":5,"link":"photo_6213989.html","width":130,"caption":"Jasmine. Pastel.","height":181});
															thumbnails[6214050] = clik.newPhoto({"id":6214050,"src":"pastel_guild_entry_2_thumb.jpg","galleries_id":346387,"server_id":5,"link":"photo_6214050.html","width":130,"caption":"Beauty Sleep. Pastel.","height":105});
															thumbnails[6214065] = clik.newPhoto({"id":6214065,"src":"spring_chickens_003_thumb.jpg","galleries_id":346404,"server_id":5,"link":"photo_6214065.html","width":130,"caption":"Spring Chickens. Pastel.  SOLD","height":91});
															thumbnails[6214068] = clik.newPhoto({"id":6214068,"src":"Topaz_3_003_thumb.JPG","galleries_id":346387,"server_id":5,"link":"photo_6214068.html","width":130,"caption":"Topaz. Pastel.","height":173});
															thumbnails[6221740] = clik.newPhoto({"id":6221740,"src":"sally_and_pep_thumb.jpg","galleries_id":346387,"server_id":5,"link":"photo_6221740.html","width":130,"caption":"Sally and Pepsi. Pastel.","height":98});
															thumbnails[6383338] = clik.newPhoto({"id":6383338,"src":"Clic_pic_cow_thumb.jpg","galleries_id":346404,"server_id":5,"link":"photo_6383338.html","width":130,"caption":"Pamphill Cow, in acrylic.","height":167});
															thumbnails[6383430] = clik.newPhoto({"id":6383430,"src":"Horse_eye_clik_pic_thumb.jpg","galleries_id":346401,"server_id":5,"link":"photo_6383430.html","width":130,"caption":"Arab Horse in Acrylic","height":92});
															thumbnails[6949091] = clik.newPhoto({"id":6949091,"src":"P1020448_thumb.JPG","galleries_id":346403,"server_id":5,"link":"photo_6949091.html","width":130,"caption":"Sika Deer at Arne. Pastel. Sold","height":96});
															thumbnails[6949093] = clik.newPhoto({"id":6949093,"src":"P1010448_thumb.JPG","galleries_id":346404,"server_id":5,"link":"photo_6949093.html","width":130,"caption":"Autumn harvest. Pastel.","height":95});
															thumbnails[8493154] = clik.newPhoto({"id":8493154,"src":"Jasmine_resized_clikpic_thumb.jpg","galleries_id":346404,"server_id":5,"link":"photo_8493154.html","width":130,"caption":"Jasmine, our oldest hen. Acrylic on canvas.","height":129});
															thumbnails[8492781] = clik.newPhoto({"id":8492781,"src":"steves_cats_final_resized_clic_pic_thumb.jpg","galleries_id":346388,"server_id":5,"link":"photo_8492781.html","width":130,"caption":"A commission of two lovely cats. Pastel","height":174});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[346387] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Dogs","link":"gallery_346387.html","maxRecords":0.0,"photoIDs":[7515471.0,7515451.0,7515461.0,7515556.0,6949058.0,6213951.0,6213954.0,6213958.0,6213968.0,6213973.0,6213975.0,6214050.0,6214068.0,6221740.0],"skipIndex":0,"section_code":"gallery","featured_images":"7515471,7515451,6949058,6214068,6213973,6213951","id":346387,"singleSection":false});				  						galleries[346388] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Cats","link":"gallery_346388.html","maxRecords":0.0,"photoIDs":[6383384.0,6948939.0,6948957.0,6950036.0,6213983.0,6213986.0,8492781.0],"skipIndex":0,"section_code":"gallery","featured_images":"8492781,6948957,6948939,6383384","id":346388,"singleSection":false});				  						galleries[346401] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Horses","link":"gallery_346401.html","maxRecords":0.0,"photoIDs":[8480854.0,8492874.0,7552826.0,6213965.0,6213967.0,6213977.0,6213980.0,6383430.0],"skipIndex":0,"section_code":"gallery","featured_images":"8492874,8480854,6213980,6213965","id":346401,"singleSection":false});				  						galleries[346403] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Wildlife","link":"gallery_346403.html","maxRecords":0.0,"photoIDs":[8480864.0,8492967.0,7515478.0,7515482.0,6213984.0,6949091.0],"skipIndex":0,"section_code":"gallery","featured_images":"8492967,8480864,7515482,7515478,6949091","id":346403,"singleSection":false});				  						galleries[346404] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Other Animals","link":"gallery_346404.html","maxRecords":0.0,"photoIDs":[8492816.0,6213989.0,6214065.0,6383338.0,6949093.0,8493154.0],"skipIndex":0,"section_code":"gallery","featured_images":"8493154,8492816,6949093,6213989","id":346404,"singleSection":false});				  						galleries[346405] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"People Portraits.","link":"gallery_346405.html","maxRecords":0.0,"photoIDs":[6213979.0],"skipIndex":0,"section_code":"gallery","featured_images":6213979.0,"id":346405,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8480854,6383384';
imageSets[2] = '8493154,8492967,8492874,8492816,8480864,8480854,7515482,7515478,7515471,7515451,6949093,6949091,6949058,6948957,6948939,6383384,6236914,6214068,6213989,6213980,6213979,6213973,6213965,6213951,8492781';
imageSets[3] = '8493154,8492967,8492874,8492816,7515482,7515478,7515461,6949058,6948957,6948939,6236914,6214068,6214065,6214050,6213989,6213986,6213984,6213983,6213980,6213979,6213975,6213973,6213968,6213954,6213951,8492781';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/trishpet/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/trishpet/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/trishpet/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/trishpet/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/trishpet/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/trishpet/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/trishpet/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/trishpet/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/trishpet/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/trishpet/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/trishpet/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/trishpet/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/trishpet/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/trishpet/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/trishpet/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/trishpet/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/trishpet/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/trishpet/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/trishpet/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/trishpet/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/trishpet/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/trishpet/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/trishpet/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/trishpet/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/trishpet/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 = 'Trishpet Portraits: ' + 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;
	}
}

			

