window.thumbnails = {};
															thumbnails[6365468] = clik.newPhoto({"id":6365468,"src":"Sarah_R_Key_2010_Exhibition_shot_-_Archaeology_of_Warrens__Other_Habitats_Tarpey_Gallery_thumb.jpg","galleries_id":367225,"server_id":15,"link":"photo_6365468.html","width":130,"caption":"","height":86});
															thumbnails[6365489] = clik.newPhoto({"id":6365489,"src":"tarpey_show_2_thumb.jpg","galleries_id":367225,"server_id":15,"link":"photo_6365489.html","width":130,"caption":"","height":87});
															thumbnails[6570483] = clik.newPhoto({"id":6570483,"src":"studio_image_for_web_thumb.jpg","galleries_id":235071,"server_id":15,"link":"photo_6570483.html","width":130,"caption":"Studio 2010","height":97});
															thumbnails[7299164] = clik.newPhoto({"id":7299164,"src":"Everything_In_Its_Right_Place_2010_160x130cms_thumb.jpg","galleries_id":367224,"server_id":15,"link":"photo_7299164.html","width":130,"caption":"Everything in its right place, 2010, 160x130cms. PRIVATE COLLECTION","height":161});
															thumbnails[7299191] = clik.newPhoto({"id":7299191,"src":"becoming_roman_thumb.jpg","galleries_id":367224,"server_id":15,"link":"photo_7299191.html","width":130,"caption":"Becoming Roman, 2010, acrylic on canvas, 60x46cms","height":175});
															thumbnails[7299198] = clik.newPhoto({"id":7299198,"src":"henris_big_day_thumb.jpg","galleries_id":367224,"server_id":15,"link":"photo_7299198.html","width":130,"caption":"Henri's Big Day, 2010, acrylic on canvas, 60x46cms","height":159});
															thumbnails[7299218] = clik.newPhoto({"id":7299218,"src":"We_Ride_Tonight_2010_160x130_thumb.jpg","galleries_id":367224,"server_id":15,"link":"photo_7299218.html","width":130,"caption":"We Ride Tonight, 2010, acrylic on canvas, 160x130cms PRIVATE COLLECTION","height":160});
															thumbnails[7299262] = clik.newPhoto({"id":7299262,"src":"keeper_of_secrets_thumb.jpg","galleries_id":367224,"server_id":15,"link":"photo_7299262.html","width":130,"caption":"Keeper of Secrets, 2010, acrylic on canvas, 90x60cms","height":197});
															thumbnails[7299268] = clik.newPhoto({"id":7299268,"src":"the_bow_motif1_thumb.jpg","galleries_id":367224,"server_id":15,"link":"photo_7299268.html","width":130,"caption":"The Bow Motif, 2010, acrylic on canvas, 90x60cms","height":196});
															thumbnails[7299328] = clik.newPhoto({"id":7299328,"src":"a_woven_dream_for_feargus_thumb.jpg","galleries_id":367224,"server_id":15,"link":"photo_7299328.html","width":130,"caption":"A Woven Dream for Feargus, 2010, acrylic on canvas, 80x60cms. PRIVATE COLLECTION. ","height":97});
															thumbnails[7299386] = clik.newPhoto({"id":7299386,"src":"the_physiology_of_the_blessed_thumb.jpg","galleries_id":367224,"server_id":15,"link":"photo_7299386.html","width":130,"caption":"The Physiology of the Blessed, 2010, acrylic on canvas, 80x60cms","height":98});
															thumbnails[7299401] = clik.newPhoto({"id":7299401,"src":"to_imagine_the_life_of_other_forms_thumb.jpg","galleries_id":367224,"server_id":15,"link":"photo_7299401.html","width":130,"caption":"To imagine the Life of Other Forms, 2010, acrylic on canvas, 56x46cms","height":106});
															thumbnails[7299407] = clik.newPhoto({"id":7299407,"src":"detail_Black_Swan_thumb.jpg","galleries_id":367224,"server_id":15,"link":"photo_7299407.html","width":130,"caption":"Black Swan Patch, detail","height":196});
															thumbnails[7299411] = clik.newPhoto({"id":7299411,"src":"No_Time_To_Analyse_2010_160x130cms_thumb.jpg","galleries_id":367224,"server_id":15,"link":"photo_7299411.html","width":130,"caption":"No Time to Analyse, 2010, acrylic on canvas, 160x130cms","height":160});
															thumbnails[7299762] = clik.newPhoto({"id":7299762,"src":"a_mental_state_web_thumb.jpg","galleries_id":367224,"server_id":15,"link":"photo_7299762.html","width":130,"caption":"A Mental State of Something (Like Little Memories), 2010, 151x122cms, acrylic on canvas","height":162});
															thumbnails[7299803] = clik.newPhoto({"id":7299803,"src":"if_we_were_boys_web_thumb.jpg","galleries_id":367224,"server_id":15,"link":"photo_7299803.html","width":130,"caption":"If We Were Boys, 2010, acrylic on canvas, 122x91cms","height":173});
															thumbnails[7299817] = clik.newPhoto({"id":7299817,"src":"how_to_disappear_part_1_web_thumb.jpg","galleries_id":394899,"server_id":15,"link":"photo_7299817.html","width":130,"caption":"How to disappear completely Part 1, 2009, acrylic on canvas, 151x122cms","height":163});
															thumbnails[7299830] = clik.newPhoto({"id":7299830,"src":"detail_2_how_to_disappear_part_2_web_thumb.jpg","galleries_id":394899,"server_id":15,"link":"photo_7299830.html","width":130,"caption":"how to disappear completely, part 2, detail ","height":196});
															thumbnails[7299837] = clik.newPhoto({"id":7299837,"src":"detail_how_to_disappear_part_2_web_thumb.jpg","galleries_id":394899,"server_id":15,"link":"photo_7299837.html","width":130,"caption":"how to disappear completely, part 2, detail 2","height":196});
															thumbnails[7299859] = clik.newPhoto({"id":7299859,"src":"Black_Swan_Patch_2010_160x1301_thumb.jpg","galleries_id":367224,"server_id":15,"link":"photo_7299859.html","width":130,"caption":"Black Swan Patch, 2010, acrylic on canvas, 160x130cms. PRIVATE COLLECTION.","height":160});
															thumbnails[7481834] = clik.newPhoto({"id":7481834,"src":"312.OUR_LIPS_ARE_SEALED_thumb.jpg","galleries_id":367224,"server_id":15,"link":"photo_7481834.html","width":130,"caption":"Our lips are sealed, 2010, acrylic on canvas, 80x60cms","height":96});
															thumbnails[7481905] = clik.newPhoto({"id":7481905,"src":"still_like_when_a_pin_drops_web_thumb.jpg","galleries_id":405610,"server_id":15,"link":"photo_7481905.html","width":130,"caption":"Still Like When a Pin Drops, acrylic on canvas, 56x46cms. PRIVATE COLLECTION.","height":161});
															thumbnails[7481912] = clik.newPhoto({"id":7481912,"src":"one_of_the_furys_web_thumb.jpg","galleries_id":405610,"server_id":15,"link":"photo_7481912.html","width":130,"caption":"One of the Furys, acrylic on canvas, 56x46cms","height":162});
															thumbnails[7481914] = clik.newPhoto({"id":7481914,"src":"No_Such_Dignity_web_thumb.jpg","galleries_id":405610,"server_id":15,"link":"photo_7481914.html","width":130,"caption":"No Such Dignity, acrylic on canvas, 56x46cms. PRIVATE COLLECTION.","height":163});
															thumbnails[7481917] = clik.newPhoto({"id":7481917,"src":"the_return_of_jib_baker_web_thumb.jpg","galleries_id":405610,"server_id":15,"link":"photo_7481917.html","width":130,"caption":"The Return of Jib Baker, acrylic on canvas, 56x46cms","height":171});
															thumbnails[7584578] = clik.newPhoto({"id":7584578,"src":"The_Insignia_WEB_20101_thumb.jpg","galleries_id":367224,"server_id":15,"link":"photo_7584578.html","width":130,"caption":"The Insignia, 2010, 120x95cms, acrylic on canvas. PRIVATE COLLECTION","height":163});
															thumbnails[7584602] = clik.newPhoto({"id":7584602,"src":"RELUCTANCE_WEB1_thumb.jpg","galleries_id":405610,"server_id":15,"link":"photo_7584602.html","width":130,"caption":"Reluctance in the boy, 2011, acrylic on canvas, 101x76cms. PRIVATE COLLECTION.","height":174});
															thumbnails[7584606] = clik.newPhoto({"id":7584606,"src":"Waiting_on_a_Special_HandshakeWEB1_thumb.jpg","galleries_id":405610,"server_id":15,"link":"photo_7584606.html","width":130,"caption":"Waiting on a special handshake, 2011, acrylic on canvas, 101x76cms. PRIVATE COLLECTION.","height":175});
															thumbnails[7601368] = clik.newPhoto({"id":7601368,"src":"WEBBlack_stump_lodge_thumb.jpg","galleries_id":405610,"server_id":15,"link":"photo_7601368.html","width":130,"caption":"Black Stump Lodge, 2011, acrylic on canvas, 75x60cm","height":165});
															thumbnails[7601377] = clik.newPhoto({"id":7601377,"src":"WEBTragedy_at_the_dwelling_thumb.jpg","galleries_id":405610,"server_id":15,"link":"photo_7601377.html","width":130,"caption":"Tragedy at the Dwelling, 2011, acrylic on canvas, 75x60cm. PRIVATE COLLECTION.","height":163});
															thumbnails[7894006] = clik.newPhoto({"id":7894006,"src":"webdetail2_thumb.jpg","galleries_id":405610,"server_id":15,"link":"photo_7894006.html","width":130,"caption":"A Feeling For Ghosts, Detail","height":195});
															thumbnails[7894011] = clik.newPhoto({"id":7894011,"src":"web_detail1_thumb.jpg","galleries_id":405610,"server_id":15,"link":"photo_7894011.html","width":130,"caption":"a Feeling For Ghosts, Detail 2","height":104});
															thumbnails[7898306] = clik.newPhoto({"id":7898306,"src":"web_A_Feeling_For_Ghosts1_thumb.jpg","galleries_id":405610,"server_id":15,"link":"photo_7898306.html","width":130,"caption":"A Feeling For Ghosts, 221 x 181 cm, 2011, acrylic on canvas","height":88});
															thumbnails[8579276] = clik.newPhoto({"id":8579276,"src":"web_WITH_YOUR_FINGERS_YOU_CAN_TOUCH_ME_thumb.jpg","galleries_id":367224,"server_id":15,"link":"photo_8579276.html","width":130,"caption":"With Your Fingers You Can Touch Me, 2010, acrylic on canvas, 160 x 130cms","height":162});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[367225] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Exhibitions","link":"gallery_367225.html","maxRecords":0.0,"photoIDs":[6365468.0,6365489.0],"skipIndex":0,"section_code":"gallery","featured_images":6365489.0,"id":367225,"singleSection":false});				  						galleries[367224] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Paintings 2010 ","link":"gallery_367224.html","maxRecords":0.0,"photoIDs":[7299164.0,7299191.0,7299198.0,7299218.0,7299262.0,7299268.0,7299328.0,7299386.0,7299401.0,7299407.0,7299411.0,7299762.0,7299803.0,7299859.0,7481834.0,7584578.0,8579276.0],"skipIndex":0,"section_code":"gallery","featured_images":7299191.0,"id":367224,"singleSection":false});				  						galleries[405610] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Paintings 2011","link":"gallery_405610.html","maxRecords":0.0,"photoIDs":[7481905.0,7481912.0,7481914.0,7481917.0,7584602.0,7584606.0,7601368.0,7601377.0,7894006.0,7894011.0,7898306.0],"skipIndex":0,"section_code":"gallery","featured_images":"7898306,7894011,7894006,7601377,7601368,7584606,7584602,7481917,7481914,7481912","id":405610,"singleSection":false});				  						galleries[394899] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Previously","link":"gallery_394899.html","maxRecords":0.0,"photoIDs":[7299817.0,7299830.0,7299837.0],"skipIndex":0,"section_code":"gallery","featured_images":7299837.0,"id":394899,"singleSection":false});				  						galleries[235071] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Studio","link":"gallery_235071.html","maxRecords":0.0,"photoIDs":[6570483.0],"skipIndex":0,"section_code":"gallery","featured_images":6570483.0,"id":235071,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '7299164';
imageSets[2] = '7299837,7299191,6570483,6365489';
imageSets[3] = '8579276,7898306,7894011,7894006,7601377,7601368,7584606,7584602,7584578,7481917,7481914,7481912,7481905,7481834,7299859,7299837,7299830,7299817,7299803,7299762,7299411,7299407,7299401,7299386,7299328,7299268,7299262,7299218,7299198,7299191,7299164,6570483,6365489,6365468';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/davidmanley/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/davidmanley/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/davidmanley/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/davidmanley/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/davidmanley/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/davidmanley/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/davidmanley/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/davidmanley/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/davidmanley/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/davidmanley/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/davidmanley/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/davidmanley/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/davidmanley/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/davidmanley/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/davidmanley/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/davidmanley/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/davidmanley/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/davidmanley/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/davidmanley/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/davidmanley/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/davidmanley/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/davidmanley/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/davidmanley/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/davidmanley/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/davidmanley/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/davidmanley/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/davidmanley/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 = 'Sarah R Key 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;
	}
}

			

