window.thumbnails = new Object();
												thumbnails[1877378] = new thumbnail(1877378,'121838','Britta at Contrast in Glasgow.<br>\r\nMake-up by Fiona Cross','DSCF60911_thumb.jpg',130, 195,15,'photo_1877378.html');
												thumbnails[1877399] = new thumbnail(1877399,'121839','Britta at Bent-Brae in Scotland','DSCF37931_thumb.jpg',130, 87,15,'photo_1877399.html');
												thumbnails[1877409] = new thumbnail(1877409,'121840','Britta on Fuerteventura','DSCF17821_thumb.jpg',130, 195,15,'photo_1877409.html');
												thumbnails[1877417] = new thumbnail(1877417,'121774','Kitty & Mel Rook at MFN','DSCF14871_thumb.jpg',130, 195,15,'photo_1877417.html');
												thumbnails[1877434] = new thumbnail(1877434,'135243','Kitty at MFN','DSCF14131_thumb.jpg',130, 195,15,'photo_1877434.html');
												thumbnails[1877497] = new thumbnail(1877497,'121772','Lucy at Ariane','DSCF30691_thumb.jpg',130, 87,15,'photo_1877497.html');
												thumbnails[1877503] = new thumbnail(1877503,'121771','Mel Rook at MFN','DSCF07491_thumb.jpg',130, 195,15,'photo_1877503.html');
												thumbnails[1877513] = new thumbnail(1877513,'121837','Mel Rook & Kitty at MFN','DSCF12191_thumb.jpg',130, 87,15,'photo_1877513.html');
												thumbnails[1877522] = new thumbnail(1877522,'121767','Emma at MFN','DSCF01731_thumb.jpg',130, 195,15,'photo_1877522.html');
												thumbnails[1877536] = new thumbnail(1877536,'121768','Victoria at West End','DSCF14351_thumb.jpg',130, 87,15,'photo_1877536.html');
												thumbnails[1877546] = new thumbnail(1877546,'123875','Amy at West End','DSCF12211_thumb.jpg',130, 87,15,'photo_1877546.html');
												thumbnails[1877556] = new thumbnail(1877556,'123876','Natalee at Bent-Brae','DSCF16491_thumb.jpg',130, 87,15,'photo_1877556.html');
												thumbnails[1877405] = new thumbnail(1877405,'121839','Britta and sunset on Zakynthos','DSCF87772_thumb.jpg',130, 194,15,'photo_1877405.html');
												thumbnails[1877412] = new thumbnail(1877412,'121840','Britta on Zakynthos','DSCF89381_thumb.jpg',130, 195,15,'photo_1877412.html');
												thumbnails[1877423] = new thumbnail(1877423,'121774','Ariel at West End','DSCF73801_thumb.jpg',130, 87,15,'photo_1877423.html');
												thumbnails[1877436] = new thumbnail(1877436,'135243','Kitty at West End','DSCF26242_thumb.jpg',130, 195,15,'photo_1877436.html');
												thumbnails[1877495] = new thumbnail(1877495,'121772','Lucy at Contrast in Glasgow','DSCF11421_thumb.jpg',130, 87,15,'photo_1877495.html');
												thumbnails[1877510] = new thumbnail(1877510,'121771','Mel Rook at Worksop','DSCF31191_thumb.jpg',130, 87,15,'photo_1877510.html');
												thumbnails[1877515] = new thumbnail(1877515,'121837','Britta & Mel Rook at West End','DSCF35091_thumb.jpg',130, 87,15,'photo_1877515.html');
												thumbnails[1877533] = new thumbnail(1877533,'121767','Judith at Worksop','DSCF55701_thumb.jpg',130, 87,15,'photo_1877533.html');
												thumbnails[1877539] = new thumbnail(1877539,'121768','Joceline at West End','DSCF40771_thumb.jpg',130, 195,15,'photo_1877539.html');
												thumbnails[1877548] = new thumbnail(1877548,'123875','Charly','DSCF46271_thumb.jpg',130, 195,15,'photo_1877548.html');
												thumbnails[1877565] = new thumbnail(1877565,'123876','Joceline at West End','DSCF71161_thumb.jpg',130, 195,15,'photo_1877565.html');
												thumbnails[1877354] = new thumbnail(1877354,'121838','Britta on Fuerteventura','DSCF12241_thumb.jpg',130, 195,15,'photo_1877354.html');
												thumbnails[1877402] = new thumbnail(1877402,'121839','Britta at West End','DSCF86691_thumb.jpg',130, 87,15,'photo_1877402.html');
												thumbnails[1877410] = new thumbnail(1877410,'121840','Britta at Contrast in Glasgow','DSCF62231_thumb.jpg',130, 195,15,'photo_1877410.html');
												thumbnails[1877441] = new thumbnail(1877441,'135243','Kitty at Take1 in Fife','DSCF92851_thumb.jpg',130, 195,15,'photo_1877441.html');
												thumbnails[1877500] = new thumbnail(1877500,'121772','Lucy at West End','DSCF40271_thumb.jpg',130, 87,15,'photo_1877500.html');
												thumbnails[1877506] = new thumbnail(1877506,'121771','Mel Rook at Worksop','DSCF20771_thumb.jpg',130, 195,15,'photo_1877506.html');
												thumbnails[1877518] = new thumbnail(1877518,'121837','KJ & Kitty in the pool at Treswell','DSCF52531_thumb.jpg',130, 87,15,'photo_1877518.html');
												thumbnails[1877529] = new thumbnail(1877529,'121767','Hollie at Worksop','DSCF18701_thumb.jpg',130, 195,15,'photo_1877529.html');
												thumbnails[1877553] = new thumbnail(1877553,'123875','Sammie B at West End','DSCF73931_thumb.jpg',130, 87,15,'photo_1877553.html');
												thumbnails[1877566] = new thumbnail(1877566,'123876','Sammie B at West End','DSCF71371_thumb.jpg',130, 195,15,'photo_1877566.html');
												thumbnails[1969786] = new thumbnail(1969786,'121774','Charly at Take1 in Fife','DSCF2180_thumb.JPG',130, 194,15,'photo_1969786.html');
												thumbnails[1877400] = new thumbnail(1877400,'121839','Britta at Take1 in Fife','DSCF70311_thumb.jpg',130, 195,15,'photo_1877400.html');
												thumbnails[1877426] = new thumbnail(1877426,'121774','Ariel at West End','DSCF80401_thumb.jpg',130, 81,15,'photo_1877426.html');
												thumbnails[1877437] = new thumbnail(1877437,'135243','Kitty at West End','DSCF38661_thumb.jpg',130, 195,15,'photo_1877437.html');
												thumbnails[1877494] = new thumbnail(1877494,'121772','Lucy at Contrast in Glasgow','DSCF08491_thumb.jpg',130, 195,15,'photo_1877494.html');
												thumbnails[1877507] = new thumbnail(1877507,'121771','Mel Rook at Worksop','DSCF25381_thumb.jpg',130, 87,15,'photo_1877507.html');
												thumbnails[1877517] = new thumbnail(1877517,'121837','Mel Rook & Britta','DSCF36811_thumb.jpg',130, 80,15,'photo_1877517.html');
												thumbnails[1877526] = new thumbnail(1877526,'121767','Stacey in the pool at Treswell','DSCF11271_thumb.jpg',130, 195,15,'photo_1877526.html');
												thumbnails[1877541] = new thumbnail(1877541,'121768','Sammie B at West End','DSCF68231_thumb.jpg',130, 195,15,'photo_1877541.html');
												thumbnails[1877549] = new thumbnail(1877549,'123875','Gemma Louise','DSCF56611_thumb.jpg',130, 206,15,'photo_1877549.html');
												thumbnails[1877557] = new thumbnail(1877557,'123876','Amy at West End','DSCF24321_thumb.jpg',130, 195,15,'photo_1877557.html');
												thumbnails[1877383] = new thumbnail(1877383,'121838','Britta at Take1 in Fife','DSCF78061_thumb.jpg',130, 195,15,'photo_1877383.html');
												thumbnails[1877394] = new thumbnail(1877394,'121839','Britta on Fuerteventura','DSCF00606_thumb.JPG',130, 87,15,'photo_1877394.html');
												thumbnails[1877414] = new thumbnail(1877414,'121840','Britta at West End','DSCF92361_thumb.jpg',130, 197,15,'photo_1877414.html');
												thumbnails[1877420] = new thumbnail(1877420,'121774','Sammie B & Ariel','DSCF49241_thumb.jpg',130, 195,15,'photo_1877420.html');
												thumbnails[1877439] = new thumbnail(1877439,'135243','Kitty at MFN','DSCF72051_thumb.jpg',130, 195,15,'photo_1877439.html');
												thumbnails[1877498] = new thumbnail(1877498,'121772','Lucy at Ariane','DSCF35701_thumb.jpg',130, 87,15,'photo_1877498.html');
												thumbnails[1877505] = new thumbnail(1877505,'121771','Mel Rook at MFN','DSCF09561_thumb.jpg',130, 195,15,'photo_1877505.html');
												thumbnails[1877521] = new thumbnail(1877521,'121837','Mel & Kitty on the Harley at MFN','DSCF56251_thumb.jpg',130, 192,15,'photo_1877521.html');
												thumbnails[1877531] = new thumbnail(1877531,'121767','Mel at MFN ','DSCF55171_thumb.jpg',130, 195,15,'photo_1877531.html');
												thumbnails[1877537] = new thumbnail(1877537,'121768','Charly at Take1 in Fife','DSCF26111_thumb.jpg',130, 87,15,'photo_1877537.html');
												thumbnails[1877551] = new thumbnail(1877551,'123875','Joceline','DSCF72271_thumb.jpg',130, 195,15,'photo_1877551.html');
												thumbnails[1877560] = new thumbnail(1877560,'123876','Joceline at West End','DSCF41411_thumb.jpg',130, 195,15,'photo_1877560.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[121838] = new gallery(121838,'1877378','Britta Benedetto 1','gallery',[1877378,1877354,1877383],0, 0, '121749', 'gallery_121838.html',0,0);
				  					galleries[121839] = new gallery(121839,'1877405','Britta Benedetto 2','gallery',[1877399,1877405,1877402,1877400,1877394],0, 0, '121749', 'gallery_121839.html',0,0);
				  					galleries[121840] = new gallery(121840,'1877409','Britta Benedetto 3','gallery',[1877409,1877412,1877410,1877414],0, 0, '121749', 'gallery_121840.html',0,0);
				  					galleries[121749] = new gallery(121749,'1877409,1877405,1877378','Britta Benedetto','gallery',[],0, 0, '', 'gallery_121749.html',0,0);
				  					galleries[135243] = new gallery(135243,'1877434','Kitty','gallery',[1877434,1877436,1877441,1877437,1877439],0, 0, '', 'gallery_135243.html',0,0);
				  					galleries[121772] = new gallery(121772,'1877498,1877497','Lucy','gallery',[1877497,1877495,1877500,1877494,1877498],0, 0, '', 'gallery_121772.html',0,0);
				  					galleries[121771] = new gallery(121771,'1877506','Mel Rook','gallery',[1877503,1877510,1877506,1877507,1877505],0, 0, '', 'gallery_121771.html',0,0);
				  					galleries[121774] = new gallery(121774,'1877417','Fetish/Bondage','gallery',[1877417,1877423,1969786,1877426,1877420],0, 0, '', 'gallery_121774.html',0,0);
				  					galleries[121837] = new gallery(121837,'1877513','Multi-girl','gallery',[1877513,1877515,1877518,1877517,1877521],0, 0, '', 'gallery_121837.html',0,0);
				  					galleries[121767] = new gallery(121767,'1877533,1877531,1877529,1877526,1877522','Newcomers','gallery',[1877522,1877533,1877529,1877526,1877531],0, 0, '', 'gallery_121767.html',0,0);
				  					galleries[121768] = new gallery(121768,'1877539','Nude','gallery',[1877536,1877539,1877541,1877537],0, 0, '', 'gallery_121768.html',0,0);
				  					galleries[121836] = new gallery(121836,'1877566,1877548','Miscellaneous Galleries','gallery',[],0, 0, '', 'gallery_121836.html',0,0);
				  					galleries[123875] = new gallery(123875,'1877548','Miscellaneous Gallery 1','gallery',[1877546,1877548,1877553,1877549,1877551],0, 0, '121836', 'gallery_123875.html',0,0);
				  					galleries[123876] = new gallery(123876,'1877566','Miscellaneous Gallery  2','gallery',[1877556,1877565,1877566,1877557,1877560],0, 0, '121836', 'gallery_123876.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '1877409,1877405,1877378';
imageSets[2] = '1877566,1877548,1877539,1877513,1877506,1877498,1877497,1877434,1877417,1877409,1877405,1877378';
imageSets[3] = '1969786,1877566,1877565,1877560,1877557,1877556,1877553,1877551,1877549,1877548,1877546,1877541,1877539,1877537,1877536,1877533,1877531,1877529,1877526,1877522,1877521,1877518,1877517,1877515,1877513,1877510,1877507,1877506,1877505,1877503,1877500,1877498,1877497,1877495,1877494,1877441,1877439,1877437,1877436,1877434,1877426,1877423,1877420,1877417,1877414,1877412,1877410,1877409,1877405,1877402';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/Keith_P/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/Keith_P/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/Keith_P/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/Keith_P/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/Keith_P/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/Keith_P/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/Keith_P/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/Keith_P/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/Keith_P/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/Keith_P/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/Keith_P/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/Keith_P/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/Keith_P/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/Keith_P/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/Keith_P/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/Keith_P/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/Keith_P/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/Keith_P/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/Keith_P/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/Keith_P/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/Keith_P/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/Keith_P/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:'',
                    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 (!basic) {
    if (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
    }
				
    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));		  $('body').trigger('clikUpdate');		}, op.onBefore);
      }    }
    	if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'Keith Packer Photography: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
	    var options = {};	    	      	      resizePhotoInfo(options);
        if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(backgrounds);
  	    } else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(photos);
  	    }
	    });
    }
        if (!op.speed) {      clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));      $('body').trigger('clikUpdate');    }        
    return html;			}
	else {
				
		window.location = 'photo_' + nextPhoto.id + '.html';
	}
		
}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array){
  if (typeof(array) !== 'object') {
    array = photos;
  }
	if($('#paymentConfirm').length > 0){
		$('#paymentConfirm').hide();
		$('#paymentAddButton')
		.unbind()
		.click(function(){
						form = document.getElementById('paymentForm');
			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').text('Item added to cart').show();}
				else{
					$('#paymentConfirm').text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm').text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}
/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp = temp +  '<p id="imageDescription">' + this.description + '</p>';
	}
		if (this.photo_ref != '') {
		temp = temp + '<p class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</p>';
	}
		if (this.takendate != '') {
				
		temp = temp + '<p class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</p>';
	}
	
	if (this.location != '') {
				
		temp = temp + '<p class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</p>';
	}
	
	if (this.photographer != '') {
				
		temp = temp + '<p class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</p>';
	}
					
				if (temp != '') {
		temp = temp + '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp = temp + '<p>Order this print:</p>';
				temp = temp + '<p class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> ' + (this.item_price).toFixed(2) + '</p>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
	else if (this.payment_groups_id !== '') {
		temp = temp + '<p>Buy this print online:</p>';
				temp = temp + '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
											temp = temp + '<select class="paymentlink" name="payment_options_id" onchange="updateItemValues(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
				
		temp = temp + getPaymentOptions(this.payment_groups_id);
		temp = temp + '</select>';
		temp = 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 = 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({            href: thumbnails[imageID].fnGalleryLink(gallery_id),            title: galleries[gallery_id].title          });
        }
							}
										}
}

/***************************************************************************
* 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 + ' | ';
				}
				temp = temp + '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
			}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

