window.thumbnails = {};
															thumbnails[9041961] = clik.newPhoto({"id":9041961,"src":"FWP_6325_thumb.jpg","galleries_id":55722,"server_id":18,"link":"photo_9041961.html","width":130,"caption":"Bristol's harbourside","height":86});
															thumbnails[9038078] = clik.newPhoto({"id":9038078,"src":"FWP_6107_thumb.jpg","galleries_id":55722,"server_id":18,"link":"photo_9038078.html","width":130,"caption":"Clifton suspension bridge","height":87});
															thumbnails[9038084] = clik.newPhoto({"id":9038084,"src":"FWP_5848_thumb.jpg","galleries_id":55722,"server_id":18,"link":"photo_9038084.html","width":130,"caption":"Clifton suspension bridge","height":87});
															thumbnails[9038519] = clik.newPhoto({"id":9038519,"src":"FWP_5924_thumb.jpg","galleries_id":55722,"server_id":18,"link":"photo_9038519.html","width":130,"caption":"Clifton suspension bridge","height":87});
															thumbnails[9038559] = clik.newPhoto({"id":9038559,"src":"FWP_6242_thumb.jpg","galleries_id":55722,"server_id":18,"link":"photo_9038559.html","width":130,"caption":"Chew valley lake","height":86});
															thumbnails[9038074] = clik.newPhoto({"id":9038074,"src":"FWP_5759.nef_thumb.jpg","galleries_id":55722,"server_id":18,"link":"photo_9038074.html","width":130,"caption":"Clifton suspension bridge","height":87});
															thumbnails[9041973] = clik.newPhoto({"id":9041973,"src":"FWP_6333_thumb.jpg","galleries_id":55722,"server_id":18,"link":"photo_9041973.html","width":130,"caption":"Millenium square","height":88});
															thumbnails[9042077] = clik.newPhoto({"id":9042077,"src":"FWP_5978_thumb.jpg","galleries_id":55722,"server_id":18,"link":"photo_9042077.html","width":130,"caption":"Keynsham countryside","height":86});
															thumbnails[9043166] = clik.newPhoto({"id":9043166,"src":"DSC_3945_thumb.jpg","galleries_id":55722,"server_id":18,"link":"photo_9043166.html","width":130,"caption":"Bathurst parade","height":88});
															thumbnails[9043915] = clik.newPhoto({"id":9043915,"src":"DSC_1263_thumb.jpg","galleries_id":55665,"server_id":18,"link":"photo_9043915.html","width":130,"caption":"Grey squirrel","height":90});
															thumbnails[9043930] = clik.newPhoto({"id":9043930,"src":"FWP_4832_thumb.jpg","galleries_id":55722,"server_id":18,"link":"photo_9043930.html","width":130,"caption":"View of cumberland basin","height":85});
															thumbnails[9044143] = clik.newPhoto({"id":9044143,"src":"DSC_7655_thumb.jpg","galleries_id":55722,"server_id":18,"link":"photo_9044143.html","width":130,"caption":"The Lizard","height":86});
															thumbnails[9044179] = clik.newPhoto({"id":9044179,"src":"FWP_5624_thumb.jpg","galleries_id":55665,"server_id":18,"link":"photo_9044179.html","width":130,"caption":"Sheep","height":89});
															thumbnails[9044997] = clik.newPhoto({"id":9044997,"src":"DSC_0854_thumb.jpg","galleries_id":364820,"server_id":18,"link":"photo_9044997.html","width":130,"caption":"The group","height":85});
															thumbnails[9045049] = clik.newPhoto({"id":9045049,"src":"DSC_2806_thumb.jpg","galleries_id":55665,"server_id":18,"link":"photo_9045049.html","width":130,"caption":"Salt marsh pony","height":86});
															thumbnails[9045079] = clik.newPhoto({"id":9045079,"src":"DSC_3828_thumb.jpg","galleries_id":55722,"server_id":18,"link":"photo_9045079.html","width":130,"caption":"Priors wood","height":87});
															thumbnails[9058599] = clik.newPhoto({"id":9058599,"src":"DSC_2453_thumb.jpg","galleries_id":55722,"server_id":18,"link":"photo_9058599.html","width":130,"caption":"Padstow","height":87});
															thumbnails[9058609] = clik.newPhoto({"id":9058609,"src":"DSC_3793_thumb.jpg","galleries_id":55722,"server_id":18,"link":"photo_9058609.html","width":130,"caption":"Temple quay","height":87});
															thumbnails[9058676] = clik.newPhoto({"id":9058676,"src":"DSC_2461_thumb.jpg","galleries_id":55722,"server_id":18,"link":"photo_9058676.html","width":130,"caption":"Newquay","height":87});
															thumbnails[9058707] = clik.newPhoto({"id":9058707,"src":"DSC_5441_thumb.jpg","galleries_id":365010,"server_id":18,"link":"photo_9058707.html","width":130,"caption":"Derelict tractor","height":86});
															thumbnails[9058750] = clik.newPhoto({"id":9058750,"src":"DSC_4557_thumb.jpg","galleries_id":365010,"server_id":18,"link":"photo_9058750.html","width":130,"caption":"Sea worthy ?","height":87});
															thumbnails[9094841] = clik.newPhoto({"id":9094841,"src":"FWP_64442.jpg","galleries_id":55722,"server_id":37,"link":"photo_9094841.html","width":130,"caption":"Welsh back","height":90});
															thumbnails[9043156] = clik.newPhoto({"id":9043156,"src":"DSC_3037_thumb.jpg","galleries_id":365010,"server_id":18,"link":"photo_9043156.html","width":87,"caption":"Arnos vale angel","height":130});
															thumbnails[9043192] = clik.newPhoto({"id":9043192,"src":"DSC_7134_thumb.jpg","galleries_id":365010,"server_id":18,"link":"photo_9043192.html","width":86,"caption":"Bristol international balloon fiesta","height":130});
															thumbnails[9043955] = clik.newPhoto({"id":9043955,"src":"DSC_4004_thumb.jpg","galleries_id":365010,"server_id":18,"link":"photo_9043955.html","width":86,"caption":"Derelict warehouse","height":130});
															thumbnails[9045028] = clik.newPhoto({"id":9045028,"src":"DSC_0011_thumb.jpg","galleries_id":55665,"server_id":18,"link":"photo_9045028.html","width":90,"caption":"Red deer","height":130});
															thumbnails[9045013] = clik.newPhoto({"id":9045013,"src":"FWP_5051_thumb.jpg","galleries_id":364820,"server_id":18,"link":"photo_9045013.html","width":86,"caption":"Lucas","height":130});
															thumbnails[9058720] = clik.newPhoto({"id":9058720,"src":"DSC_2210_thumb.jpg","galleries_id":55665,"server_id":18,"link":"photo_9058720.html","width":86,"caption":"Red deer","height":130});
															thumbnails[9059632] = clik.newPhoto({"id":9059632,"src":"DSC_3116_thumb.jpg","galleries_id":365010,"server_id":18,"link":"photo_9059632.html","width":86,"caption":"St Nicholas market","height":130});
															thumbnails[9059710] = clik.newPhoto({"id":9059710,"src":"DSC_0041_thumb.jpg","galleries_id":55722,"server_id":18,"link":"photo_9059710.html","width":85,"caption":"Clifton suspension bridge","height":130});
															thumbnails[9059730] = clik.newPhoto({"id":9059730,"src":"DSC_0410_thumb.jpg","galleries_id":55722,"server_id":18,"link":"photo_9059730.html","width":87,"caption":"Portloe","height":130});
															thumbnails[9059867] = clik.newPhoto({"id":9059867,"src":"DSC_1118_thumb.jpg","galleries_id":55722,"server_id":18,"link":"photo_9059867.html","width":87,"caption":"Pink thrift","height":130});
															thumbnails[9059895] = clik.newPhoto({"id":9059895,"src":"DSC_1197_thumb.jpg","galleries_id":364820,"server_id":18,"link":"photo_9059895.html","width":92,"caption":"Wedding","height":130});
															thumbnails[9077229] = clik.newPhoto({"id":9077229,"src":"DSC_2071_thumb.jpg","galleries_id":365010,"server_id":18,"link":"photo_9077229.html","width":83,"caption":"Arnos vale angel","height":130});
															thumbnails[9077891] = clik.newPhoto({"id":9077891,"src":"FWP_5502_thumb.jpg","galleries_id":55665,"server_id":18,"link":"photo_9077891.html","width":91,"caption":"Horse","height":130});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[55722] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"UK Landscapes & Architecture.","link":"gallery_55722.html","maxRecords":0.0,"photoIDs":[9041961.0,9038078.0,9038084.0,9038519.0,9038559.0,9038074.0,9041973.0,9042077.0,9043166.0,9043930.0,9044143.0,9045079.0,9058599.0,9058609.0,9058676.0,9094841.0,9059710.0,9059730.0,9059867.0],"skipIndex":0,"section_code":"gallery","featured_images":9038078.0,"id":55722,"singleSection":false});				  						galleries[55665] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Animals and birds.","link":"gallery_55665.html","maxRecords":0.0,"photoIDs":[9043915.0,9044179.0,9045049.0,9045028.0,9058720.0,9077891.0],"skipIndex":0,"section_code":"gallery","featured_images":9043915.0,"id":55665,"singleSection":false});				  						galleries[364820] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Portrait.","link":"gallery_364820.html","maxRecords":0.0,"photoIDs":[9044997.0,9045013.0,9059895.0],"skipIndex":0,"section_code":"gallery","featured_images":9045013.0,"id":364820,"singleSection":false});				  						galleries[365010] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Miscellaneous.","link":"gallery_365010.html","maxRecords":0.0,"photoIDs":[9058707.0,9058750.0,9043156.0,9043192.0,9043955.0,9059632.0,9077229.0],"skipIndex":0,"section_code":"gallery","featured_images":9058750.0,"id":365010,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '9038078,9038084,9038559,9041973,9043915,9045049';
imageSets[2] = '9038078,9043915,9058750,9045013';
imageSets[3] = '9094841,9077891,9077229,9059895,9059867,9059730,9059710,9059632,9058750,9058720,9058707,9058676,9058609,9058599,9045079,9045049,9045028,9045013,9044997,9044179,9044143,9043955,9043930,9043915,9043192,9043166,9043156,9042077,9041973,9041961,9038559,9038519,9038084,9038078,9038074';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/brwestfc/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/brwestfc/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/brwestfc/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/brwestfc/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/brwestfc/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/brwestfc/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/brwestfc/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/brwestfc/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/brwestfc/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/brwestfc/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/brwestfc/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/brwestfc/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/brwestfc/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/brwestfc/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/brwestfc/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/brwestfc/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/brwestfc/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/brwestfc/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/brwestfc/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/brwestfc/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/brwestfc/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/brwestfc/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/brwestfc/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/brwestfc/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/brwestfc/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/brwestfc/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/brwestfc/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 = 'Focus West Photography: ' + 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>';
	}
				
	temp += this.fnGetPaymentInfo();
				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>Buy now using PayPal:</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.payment_groups_id !== '') {
		temp += '<p>Buy this print online:</p>';
				temp += '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
		 									temp += '<select class="paymentlink" name="payment_options_id" onchange="updateCartValue($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';
		
		temp += getPaymentOptions(this.payment_groups_id);
		temp += '</select>';
		temp += '</form>';
				var item_option  = paymentGroups[this.payment_groups_id].options[0];
		if(paymentOptions[item_option]){
			var item_name  = paymentOptions[item_option].payment_option;
			var amount =  paymentOptions[item_option].price;
		}
			}
		else {
		
	}
	if (this.item_price !== '' || this.payment_groups_id !== '') {
											temp += '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm">';
			temp += '	<input type="hidden" name="item_option" value="' + item_option + '">';
			temp += '	<input type="hidden" name="site" value="BRWESTFC">';
			temp += '	<input type="hidden" name="item_number" value="'+ this.id +'">';
			temp += '	<input type="hidden" name="quantity" value="1">';
						temp += '	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\'\;" onmouseout="this.className=\'button\'\;" type="Button">';
							temp += '	<input value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button" onclick="javascript:window.location=\'cart.html\'">';
			temp += '</form>';
						temp += '<div class="clearing">&nbsp;</div>';
			temp += '<div id="confirmContainer">';
			temp += '<div id="paymentConfirm">Item added to cart</div>';
			temp += '</div>';
			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;
	}
}

			

