window.thumbnails = {};
															thumbnails[3098649] = clik.newPhoto({"id":3098649,"src":"DSCF00561_thumb.jpg","galleries_id":403173,"server_id":5,"link":"photo_3098649.html","width":160,"caption":"Patterned bracelets","height":160});
															thumbnails[5696418] = clik.newPhoto({"id":5696418,"src":"CM09_054_lucy_easton-2890_retouched_and_cropped_final_sharp_tighter_crop1_thumb.jpg","galleries_id":403266,"server_id":5,"link":"photo_5696418.html","width":160,"caption":"Oval tube pendant and chain","height":160});
															thumbnails[5696422] = clik.newPhoto({"id":5696422,"src":"CM09_054_Easton-2568_retouched_tighter_crop_sharp123_thumb.jpg","galleries_id":403265,"server_id":5,"link":"photo_5696422.html","width":160,"caption":"Round and oval tube earrings","height":160});
															thumbnails[3099927] = clik.newPhoto({"id":3099927,"src":"er3_thumb.jpg","galleries_id":403265,"server_id":5,"link":"photo_3099927.html","width":160,"caption":"Two toned tube earrings","height":160});
															thumbnails[5696416] = clik.newPhoto({"id":5696416,"src":"neck_thumb.jpg","galleries_id":403266,"server_id":5,"link":"photo_5696416.html","width":160,"caption":"Triangular tube pendant and chain","height":160});
															thumbnails[8716236] = clik.newPhoto({"id":8716236,"src":"square_bracelet_edited-1_thumb.jpg","galleries_id":403173,"server_id":5,"link":"photo_8716236.html","width":160,"caption":"Check cross bracelet","height":160});
															thumbnails[3098625] = clik.newPhoto({"id":3098625,"src":"DSCF0004_1_thumb.jpg","galleries_id":403173,"server_id":5,"link":"photo_3098625.html","width":160,"caption":"Curved pattern necklace","height":160});
															thumbnails[3103780] = clik.newPhoto({"id":3103780,"src":"er9_thumb.jpg","galleries_id":403265,"server_id":5,"link":"photo_3103780.html","width":160,"caption":"Curved block earrings","height":160});
															thumbnails[3534606] = clik.newPhoto({"id":3534606,"src":"CM09_054_lucy_easton-2887_retouched_sharp1_thumb.jpg","galleries_id":403173,"server_id":5,"link":"photo_3534606.html","width":160,"caption":"Spot pattern necklace","height":160});
															thumbnails[7564422] = clik.newPhoto({"id":7564422,"src":"PENDANTS_TUBE_edited-2_thumb.jpg","galleries_id":403266,"server_id":5,"link":"photo_7564422.html","width":160,"caption":"Small round tube pendants","height":160});
															thumbnails[3099932] = clik.newPhoto({"id":3099932,"src":"block_earrings_edited-6_thumb.jpg","galleries_id":403265,"server_id":5,"link":"photo_3099932.html","width":160,"caption":"Block earrings","height":160});
															thumbnails[3100124] = clik.newPhoto({"id":3100124,"src":"block_thumb.jpg","galleries_id":403266,"server_id":5,"link":"photo_3100124.html","width":160,"caption":"Three block necklace","height":160});
															thumbnails[6828089] = clik.newPhoto({"id":6828089,"src":"square_pattern_necklace_edited-2_thumb.jpg","galleries_id":403173,"server_id":5,"link":"photo_6828089.html","width":160,"caption":"Check cross necklace","height":160});
															thumbnails[8170942] = clik.newPhoto({"id":8170942,"src":"gold_chain_edited-1_thumb.jpg","galleries_id":403266,"server_id":5,"link":"photo_8170942.html","width":160,"caption":"Three strand chain","height":160});
															thumbnails[8185250] = clik.newPhoto({"id":8185250,"src":"oval_triangual_er1_thumb.jpg","galleries_id":403265,"server_id":5,"link":"photo_8185250.html","width":160,"caption":"Oval triangular tube earrings","height":160});
															thumbnails[6115300] = clik.newPhoto({"id":6115300,"src":"PAVE_thumb.jpg","galleries_id":403173,"server_id":5,"link":"photo_6115300.html","width":160,"caption":"Pave necklace","height":160});
															thumbnails[7983295] = clik.newPhoto({"id":7983295,"src":"HALF_CIRCLE_NECK_thumb.jpg","galleries_id":403173,"server_id":5,"link":"photo_7983295.html","width":160,"caption":"Half circle pattern necklace","height":160});
															thumbnails[3102823] = clik.newPhoto({"id":3102823,"src":"CM09_054_Easton-2444_retouched_sharp_edited-1_thumb.jpg","galleries_id":403266,"server_id":5,"link":"photo_3102823.html","width":160,"caption":"Block chain","height":160});
															thumbnails[8136334] = clik.newPhoto({"id":8136334,"src":"small_round_pattern_ne_edited-2_thumb.jpg","galleries_id":403173,"server_id":5,"link":"photo_8136334.html","width":160,"caption":"Small circle pattern necklace","height":160});
															thumbnails[8186153] = clik.newPhoto({"id":8186153,"src":"COLOUR_TUBE_ER_thumb.jpg","galleries_id":403265,"server_id":5,"link":"photo_8186153.html","width":160,"caption":"Tube earrings","height":160});
															thumbnails[5696414] = clik.newPhoto({"id":5696414,"src":"CM09_054_Easton-2484_retouched_sharp_edge_burner1_thumb.jpg","galleries_id":403173,"server_id":5,"link":"photo_5696414.html","width":160,"caption":"Patterned pendant and chains","height":160});
															thumbnails[7565541] = clik.newPhoto({"id":7565541,"src":"small_tube_er_1_thumb.jpg","galleries_id":403265,"server_id":5,"link":"photo_7565541.html","width":160,"caption":"","height":160});
															thumbnails[5696409] = clik.newPhoto({"id":5696409,"src":"brooch_edited-1_thumb.jpg","galleries_id":403246,"server_id":5,"link":"photo_5696409.html","width":160,"caption":"Stripe brooch ","height":160});
															thumbnails[5696410] = clik.newPhoto({"id":5696410,"src":"CM09_054_Easton-2403_retouched_sharp_final_no_pins-1_thumb.jpg","galleries_id":403246,"server_id":5,"link":"photo_5696410.html","width":160,"caption":"Layered patterned brooch 2","height":160});
															thumbnails[7497803] = clik.newPhoto({"id":7497803,"src":"DSC_6532_rt_thumb.jpg","galleries_id":403246,"server_id":5,"link":"photo_7497803.html","width":160,"caption":"Pattern ring","height":160});
															thumbnails[7565550] = clik.newPhoto({"id":7565550,"src":"tube_er_small_edited-2_thumb.jpg","galleries_id":403265,"server_id":5,"link":"photo_7565550.html","width":160,"caption":"","height":160});
															thumbnails[5696411] = clik.newPhoto({"id":5696411,"src":"CM09_054_Easton-2415_retouched_sharp_no_pin-1_thumb.jpg","galleries_id":403246,"server_id":5,"link":"photo_5696411.html","width":160,"caption":"Layered patterned brooch 1","height":160});
															thumbnails[7565427] = clik.newPhoto({"id":7565427,"src":"pattern_circle_pendant_edited-1_thumb.jpg","galleries_id":403173,"server_id":5,"link":"photo_7565427.html","width":160,"caption":"Four circle pendant","height":160});
															thumbnails[8185265] = clik.newPhoto({"id":8185265,"src":"square_pendant_with_pearl_edited-2_thumb.jpg","galleries_id":403173,"server_id":5,"link":"photo_8185265.html","width":160,"caption":"Square pattern pendant ","height":160});
															thumbnails[5696417] = clik.newPhoto({"id":5696417,"src":"CM09_054_Easton-2530_retouched_sharp_edge_downer_and_burner1_thumb.jpg","galleries_id":403246,"server_id":5,"link":"photo_5696417.html","width":160,"caption":"Check ring with pearl","height":160});
															thumbnails[5696419] = clik.newPhoto({"id":5696419,"src":"ER1_thumb.jpg","galleries_id":403311,"server_id":5,"link":"photo_5696419.html","width":160,"caption":"Circle earrings with pearls","height":160});
															thumbnails[6897265] = clik.newPhoto({"id":6897265,"src":"er4_thumb.jpg","galleries_id":403311,"server_id":5,"link":"photo_6897265.html","width":160,"caption":"Layered check earrings","height":160});
															thumbnails[3100045] = clik.newPhoto({"id":3100045,"src":"LEASTON4_edited-2_thumb.jpg","galleries_id":403266,"server_id":5,"link":"photo_3100045.html","width":160,"caption":"Curved and angular block necklaces","height":160});
															thumbnails[5696420] = clik.newPhoto({"id":5696420,"src":"ER2_thumb.jpg","galleries_id":403311,"server_id":5,"link":"photo_5696420.html","width":160,"caption":"Layered patterned earrings","height":160});
															thumbnails[3102854] = clik.newPhoto({"id":3102854,"src":"bracelets2_thumb.jpg","galleries_id":403266,"server_id":5,"link":"photo_3102854.html","width":160,"caption":"Angular bracelets","height":160});
															thumbnails[6971427] = clik.newPhoto({"id":6971427,"src":"long_check_earrings_edited-21_thumb.jpg","galleries_id":403311,"server_id":5,"link":"photo_6971427.html","width":160,"caption":"Layered check earrings","height":160});
															thumbnails[3099761] = clik.newPhoto({"id":3099761,"src":"er5_thumb.jpg","galleries_id":403311,"server_id":5,"link":"photo_3099761.html","width":160,"caption":"Multi- patterned earrings","height":160});
															thumbnails[5727859] = clik.newPhoto({"id":5727859,"src":"PATTERNED_EAR_thumb.jpg","galleries_id":403311,"server_id":5,"link":"photo_5727859.html","width":160,"caption":"Patterned earrings","height":160});
															thumbnails[3112455] = clik.newPhoto({"id":3112455,"src":"ER_thumb.jpg","galleries_id":403311,"server_id":5,"link":"photo_3112455.html","width":160,"caption":"Stepped cross stud earrings","height":128});
															thumbnails[6897272] = clik.newPhoto({"id":6897272,"src":"stud_er_check_thumb.jpg","galleries_id":403311,"server_id":5,"link":"photo_6897272.html","width":160,"caption":"Stud check earrings","height":128});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[403311] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Pattern earrings","link":"section481693_403311.html","maxRecords":0.0,"photoIDs":[5696419.0,6897265.0,5696420.0,6971427.0,3099761.0,5727859.0,3112455.0,6897272.0],"skipIndex":0,"section_code":"section481693","featured_images":6971427.0,"id":403311,"singleSection":false});				  						galleries[403173] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Pattern necklaces\/bracelets","link":"section481693_403173.html","maxRecords":0.0,"photoIDs":[3098649.0,8716236.0,3098625.0,3534606.0,6828089.0,6115300.0,7983295.0,8136334.0,5696414.0,7565427.0,8185265.0],"skipIndex":0,"section_code":"section481693","featured_images":"8716236,3098649","id":403173,"singleSection":false});				  						galleries[403266] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Skyline necklaces\/bracelets","link":"section481695_403266.html","maxRecords":0.0,"photoIDs":[5696418.0,5696416.0,7564422.0,3100124.0,8170942.0,3102823.0,3100045.0,3102854.0],"skipIndex":0,"section_code":"section481695","featured_images":"5696418,3100124","id":403266,"singleSection":false});				  						galleries[403265] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Skyline earrings","link":"section481695_403265.html","maxRecords":0.0,"photoIDs":[5696422.0,3099927.0,3103780.0,3099932.0,8185250.0,8186153.0,7565541.0,7565550.0],"skipIndex":0,"section_code":"section481695","featured_images":8186153.0,"id":403265,"singleSection":false});				  						galleries[403246] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Pattern brooches\/rings","link":"section481693_403246.html","maxRecords":0.0,"photoIDs":[5696409.0,5696410.0,7497803.0,5696411.0,5696417.0],"skipIndex":0,"section_code":"section481693","featured_images":7497803.0,"id":403246,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '3098649,6828089,5696409';
imageSets[2] = '5696418,3098649,8716236,3100124,8186153,7497803,6971427';
imageSets[3] = '5696422,5696418,5696416,7564422,3534606,3103780,6828089,7983295,6115300,8136334,3102823,7565541,5696414,7565550,7497803,5696410,5696409,7565427,5696411,5696417,6897265,3102854';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/LUCYEASTON/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/LUCYEASTON/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/LUCYEASTON/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/LUCYEASTON/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/LUCYEASTON/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/LUCYEASTON/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/LUCYEASTON/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/LUCYEASTON/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/LUCYEASTON/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/LUCYEASTON/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/LUCYEASTON/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/LUCYEASTON/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/LUCYEASTON/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/LUCYEASTON/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/LUCYEASTON/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/LUCYEASTON/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/LUCYEASTON/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/LUCYEASTON/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/LUCYEASTON/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/LUCYEASTON/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/LUCYEASTON/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/LUCYEASTON/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/LUCYEASTON/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/LUCYEASTON/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/LUCYEASTON/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/LUCYEASTON/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/LUCYEASTON/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 += 'section481693.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 && 'section481693' != '') {
					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 = 'LUCY EASTON CONTEMPORARY JEWELLERY: ' + 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> &pound;' + (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;
	}
}

			

