window.thumbnails = new Object();
												thumbnails[4307357] = new thumbnail(4307357,'253917','Cromer Sunset','IMG_0099_thumb.jpg',130, 173,18,'photo_4307357.html');
												thumbnails[4191186] = new thumbnail(4191186,'52297','Alnwick Gardens plant covered walkway','IMG_1978_thumb.jpg',130, 98,18,'photo_4191186.html');
												thumbnails[4191210] = new thumbnail(4191210,'52297','Bamburgh Castle North East England','IMG_2116_thumb.jpg',130, 84,18,'photo_4191210.html');
												thumbnails[4191213] = new thumbnail(4191213,'52297','Bamburgh Castle North East England','IMG_2117_thumb.jpg',130, 78,18,'photo_4191213.html');
												thumbnails[2790363] = new thumbnail(2790363,'52297','Saltburn Victorian Pier','IMG_0685bw_thumb.jpg',130, 97,18,'photo_2790363.html');
												thumbnails[1318026] = new thumbnail(1318026,'52297','Saltburn Victorian gardens','DSC01759_thumb.jpg',130, 87,18,'photo_1318026.html');
												thumbnails[1318034] = new thumbnail(1318034,'52297','Saltburn Victorian Gardens','DSC01763_thumb.jpg',130, 194,18,'photo_1318034.html');
												thumbnails[1318043] = new thumbnail(1318043,'52297','Saltburn Victorian Pier','DSC01791_thumb.jpg',130, 87,18,'photo_1318043.html');
												thumbnails[1318046] = new thumbnail(1318046,'52297','Saltburn water powered cliff lift','DSC01799_thumb.jpg',130, 194,18,'photo_1318046.html');
												thumbnails[931909] = new thumbnail(931909,'52297','Carlton Bank part of the Cleveland Way','cleve way big_thumb.jpg',130, 87,18,'photo_931909.html');
												thumbnails[683653] = new thumbnail(683653,'52297','Durham Cathedral from the River Wear England','NELand2Big_thumb.jpg',130, 87,18,'photo_683653.html');
												thumbnails[683673] = new thumbnail(683673,'52297','Carlton Bank/Cleveland Way North York Moors National Park England','NELand4Big_thumb.jpg',130, 87,18,'photo_683673.html');
												thumbnails[2262657] = new thumbnail(2262657,'148736','Sunset across San Antonio Bay Ibiza','IMG_0561a_thumb.jpg',130, 173,18,'photo_2262657.html');
												thumbnails[680958] = new thumbnail(680958,'51553','Close up of 50 pence coin showing running legs','coin1big_thumb.jpg',130, 86,18,'photo_680958.html');
												thumbnails[680995] = new thumbnail(680995,'51605','Close-up of goose head','Goose1Big_thumb.jpg',130, 194,18,'photo_680995.html');
												thumbnails[681078] = new thumbnail(681078,'52100','Scene from the set of the movie Atonement','dunkirk5big_thumb.jpg',130, 194,18,'photo_681078.html');
												thumbnails[760974] = new thumbnail(760974,'58864','Knaresborough North East England. Home of Mother Shiptons Cave','watercolour-big_thumb.jpg',130, 195,18,'photo_760974.html');
												thumbnails[2262717] = new thumbnail(2262717,'148736','Sunset across San Antonio Bay Ibiza','IMG_0548a_thumb.jpg',130, 98,18,'photo_2262717.html');
												thumbnails[680966] = new thumbnail(680966,'51553','Collection of Small UK Coins','coin3big_thumb.jpg',130, 86,18,'photo_680966.html');
												thumbnails[681001] = new thumbnail(681001,'51605','Goose drinking from muddy puddle','Goose5Big_thumb.jpg',130, 87,18,'photo_681001.html');
												thumbnails[681081] = new thumbnail(681081,'52100','Scene from the set of the movie Atonement','dunkirk3big_thumb.jpg',130, 194,18,'photo_681081.html');
												thumbnails[2262727] = new thumbnail(2262727,'148736','Sunset across San Antonio Bay Ibiza','IMG_0549a_thumb.jpg',130, 173,18,'photo_2262727.html');
												thumbnails[676928] = new thumbnail(676928,'51553','Stil Life - Marbles','marble1big_thumb.jpg',130, 107,18,'photo_676928.html');
												thumbnails[676967] = new thumbnail(676967,'51605','Painted Lady butterfly feeding','butterfly10big_thumb.jpg',130, 195,18,'photo_676967.html');
												thumbnails[681085] = new thumbnail(681085,'52100','Scene from the set of the movie Atonement','dunkirk4big1_thumb.jpg',130, 194,18,'photo_681085.html');
												thumbnails[7888094] = new thumbnail(7888094,'148736','Sunset across San Antonio Bay Ibiza','IMG_1620_thumb.jpg',130, 173,18,'photo_7888094.html');
												thumbnails[2262742] = new thumbnail(2262742,'148736','Sunset across San Antonio Bay Ibiza','IMG_0561a1_thumb.jpg',130, 173,18,'photo_2262742.html');
												thumbnails[676934] = new thumbnail(676934,'51553','Still Life - Marbles','marble3big_thumb.jpg',130, 86,18,'photo_676934.html');
												thumbnails[676964] = new thumbnail(676964,'51605','Painted Lady butterfly<br>\r\n<br>\r\n','butterfly6big_thumb.jpg',130, 86,18,'photo_676964.html');
												thumbnails[681170] = new thumbnail(681170,'52100','Scene from the set of the movie Atonement','EXP00058_thumb.jpg',130, 194,18,'photo_681170.html');
												thumbnails[2262799] = new thumbnail(2262799,'148736','Summer Seascape of Ibiza coastline','IMG_0535a_thumb.jpg',130, 98,18,'photo_2262799.html');
												thumbnails[681026] = new thumbnail(681026,'51553','Close up of colourful map pins','mappinbig3_thumb.jpg',130, 86,18,'photo_681026.html');
												thumbnails[681174] = new thumbnail(681174,'52100','Scene from the set of the movie Atonement','EXP00062_thumb.jpg',130, 194,18,'photo_681174.html');
												thumbnails[676943] = new thumbnail(676943,'51553','Keyboard and Sheet Music','keybbig_thumb.jpg',130, 86,18,'photo_676943.html');
												thumbnails[681179] = new thumbnail(681179,'52100','Scene from the set of the movie Atonement','EXP00068_thumb.jpg',130, 194,18,'photo_681179.html');
												thumbnails[681183] = new thumbnail(681183,'52100','Scene from the set of the movie Atonement','EXP00069_thumb.jpg',130, 194,18,'photo_681183.html');
												thumbnails[705869] = new thumbnail(705869,'51553','Close up Colourful Pencils','coloured-pencil1_thumb.jpg',130, 87,18,'photo_705869.html');
												thumbnails[681168] = new thumbnail(681168,'52100','Scene from the set of the movie Atonement','EXP00053_thumb.jpg',130, 87,18,'photo_681168.html');
												thumbnails[705881] = new thumbnail(705881,'51553','Close up Colourful Pencils','coloured-pencil2_thumb.jpg',130, 87,18,'photo_705881.html');
												thumbnails[681094] = new thumbnail(681094,'52100','Scene from the set of the movie Atonement','dunkirk2big_thumb.jpg',130, 87,18,'photo_681094.html');
												thumbnails[705884] = new thumbnail(705884,'51553','Close up Colourful Pencils','coloured-pencil3_thumb.jpg',130, 87,18,'photo_705884.html');
												thumbnails[1759349] = new thumbnail(1759349,'58864','\'Orange through a crystal Ball\'','ACircle big 1_thumb.jpg',130, 130,18,'photo_1759349.html');
												thumbnails[1759355] = new thumbnail(1759355,'58864','Map Pins - Digital Art','ACircle big 3_thumb.jpg',130, 131,18,'photo_1759355.html');
												thumbnails[1759362] = new thumbnail(1759362,'58864','Map Pins - Digital Art','ACircle big 4_thumb.jpg',130, 130,18,'photo_1759362.html');
												thumbnails[1759374] = new thumbnail(1759374,'58864','Whitby Harbour through a crystal ball','ACircle big 5_thumb.jpg',130, 131,18,'photo_1759374.html');
												thumbnails[1759386] = new thumbnail(1759386,'58864','Saltburn Pier through a crystal ball','ACircle big 6_thumb.jpg',130, 130,18,'photo_1759386.html');
												thumbnails[2790301] = new thumbnail(2790301,'58864','Whitby Pier North East England','EXP00105_thumb.jpg',130, 85,18,'photo_2790301.html');
												thumbnails[2790353] = new thumbnail(2790353,'58864','Whitby Harbour North East England','EXP00113_thumb.jpg',130, 87,18,'photo_2790353.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[253917] = new gallery(253917,'4307357','Norfolk','gallery',[4307357],0, 0, '52099', 'gallery_253917.html',0,0);
				  					galleries[52100] = new gallery(52100,'681183,681179,681174,681170,681168,681094,681085,681081,681078','Atonement Movie Set','gallery',[681078,681081,681085,681170,681174,681179,681183,681168,681094],0, 0, '52099', 'gallery_52100.html',0,0);
				  					galleries[51553] = new gallery(51553,'705884,705881,705869,681026,680966,680958,676943,676934,676928','Still Life','gallery',[680958,680966,676928,676934,681026,676943,705869,705881,705884],0, 0, '', 'gallery_51553.html',0,0);
				  					galleries[52297] = new gallery(52297,'4191213,4191210,4191186,2790363,1318046,1318043,1318034,1318026,931909,683673,683653','North East England','gallery',[4191186,4191210,4191213,2790363,1318026,1318034,1318043,1318046,931909,683653,683673],0, 0, '52099', 'gallery_52297.html',0,0);
				  					galleries[51605] = new gallery(51605,'681001,680995,676967,676964','Wildlife & Nature','gallery',[680995,681001,676967,676964],0, 0, '', 'gallery_51605.html',0,0);
				  					galleries[52099] = new gallery(52099,'7888094,4307357,4191213,4191210,4191186,2790363,2262799,2262742,2262727,2262717,2262657,1318046,1318043,1318034,1318026,931909,683673,683653,681183,681179,681174,681170,681168,681094,681085,681081,681078','Landscape','gallery',[],0, 0, '', 'gallery_52099.html',0,0);
				  					galleries[148736] = new gallery(148736,'7888094,2262799,2262742,2262727,2262717,2262657','Landscapes Abroad','gallery',[2262657,2262717,2262727,7888094,2262742,2262799],0, 0, '52099', 'gallery_148736.html',0,0);
				  					galleries[58864] = new gallery(58864,'2790353,2790301,1759386,1759374,1759362,1759355,1759349,760974','Digitally Enhanced','gallery',[760974,1759349,1759355,1759362,1759374,1759386,2790301,2790353],0, 0, '', 'gallery_58864.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '7888094,4307357,4191213,4191210,4191186,2790363,2790353,2790301,2262799,2262742,2262727,2262717,2262657,1759386,1759374,1759362,1759355,1759349,1318046,1318043,1318034,1318026,931909,760974,705884,705881,705869,683673,683653,681183,681179,681174,681170,681168,681094,681085,681081,681078,681026,681001,680995,680966,680958,676967,676964,676943,676934,676928';
imageSets[2] = '7888094,4307357,4191213,4191210,4191186,2790363,2790353,2790301,2262799,2262742,2262727,2262717,2262657,1759386,1759374,1759362,1759355,1759349,1318046,1318043,1318034,1318026,931909,760974,705884,705881,705869,683673,683653,681183,681179,681174,681170,681168,681094,681085,681081,681078,681026,681001,680995,680966,680958,676967,676964,676943,676934,676928';
imageSets[3] = '7888094';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/lanean/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/lanean/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/lanean/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/lanean/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/lanean/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/lanean/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/lanean/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/lanean/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/lanean/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/lanean/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/lanean/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/lanean/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/lanean/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/lanean/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/lanean/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/lanean/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/lanean/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/lanean/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/lanean/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/lanean/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/lanean/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/lanean/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 = 'Andrew Lane 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>';
	}
					
	temp = temp + this.fnGetPaymentInfo();
				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>Buy now using PayPal:</p>';
				temp = temp + '<p class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> &pound;' + (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 + '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
	temp = temp + '<input type="hidden" name="item_name" value="'+item_name+'">';
								ref = '';
				if(this.photo_ref != ''){
					ref = this.photo_ref+' - '+this.caption;
				}
				else{
					ref = this.id+' - '+this.caption;
				}
				price = amount;					temp = temp + '<input type="hidden" name="cmd" value="_cart">';
	temp = temp + '<input type="hidden" name="business" value="info@alanephotographic.co.uk">';
	temp = temp + '<input type="hidden" name="currency_code" value="GBP">';
	temp = temp + '<input type="hidden" name="add" value="1">';
					temp = temp + '<input type="hidden" name="amount" value="'+amount+'">';
	temp = temp + '<input type="hidden" name="item_number" value="'+ref+'">';
					temp = temp + '<input type=\"Submit\" value=\"Add to cart\" id=\"paymentAddButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
									temp = temp + '</form>';
								temp = temp + '<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
	temp = temp + '<input type="hidden" name="cmd" value="_cart">';
	temp = temp + '<input type="hidden" name="business" value="info@alanephotographic.co.uk">';
	temp = temp + '<input type="hidden" name="display" value="1">';
	temp = temp + '<input type=\"Submit\" value=\"View cart\" id=\"paymentViewButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
	temp = temp + '</form>';
							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;
	}
}

			

