window.thumbnails = new Object();
												thumbnails[4941768] = new thumbnail(4941768,'279770','Poundbury 1','pound1_thumb.jpg',130, 86,18,'photo_4941768.html');
												thumbnails[4941779] = new thumbnail(4941779,'279770','Poundbury 2','pound2_thumb.jpg',130, 86,18,'photo_4941779.html');
												thumbnails[4941786] = new thumbnail(4941786,'279770','Poundbury 3','pound3_thumb.jpg',130, 86,18,'photo_4941786.html');
												thumbnails[4941789] = new thumbnail(4941789,'279770','Poundbury 8','pound8_thumb.jpg',130, 86,18,'photo_4941789.html');
												thumbnails[4941791] = new thumbnail(4941791,'279770','Poundbury 12','pound12_thumb.jpg',130, 86,18,'photo_4941791.html');
												thumbnails[4941793] = new thumbnail(4941793,'279770','Figures on the beach','figuresbeach_thumb.jpg',130, 86,18,'photo_4941793.html');
												thumbnails[4941799] = new thumbnail(4941799,'279770','Fish bar','fishbar_thumb.jpg',130, 86,18,'photo_4941799.html');
												thumbnails[4941873] = new thumbnail(4941873,'279771','Colston almshouses','Colstonalms_thumb.jpg',130, 86,18,'photo_4941873.html');
												thumbnails[4941887] = new thumbnail(4941887,'279771','Christmas steps','xmassteps_thumb.jpg',130, 86,18,'photo_4941887.html');
												thumbnails[4941946] = new thumbnail(4941946,'279771','Saint Michael\'s Hill','stmikehill1_thumb.jpg',130, 85,18,'photo_4941946.html');
												thumbnails[4941956] = new thumbnail(4941956,'279771','Colston Street','colstonstreet1_thumb.jpg',130, 86,18,'photo_4941956.html');
												thumbnails[4941963] = new thumbnail(4941963,'279771','Gothic','gothic_thumb.jpg',130, 130,18,'photo_4941963.html');
												thumbnails[4941968] = new thumbnail(4941968,'279771','Bristol box','parterre_thumb.jpg',130, 130,18,'photo_4941968.html');
												thumbnails[4941972] = new thumbnail(4941972,'279771','Red light','redlight_thumb.jpg',130, 130,18,'photo_4941972.html');
												thumbnails[4941975] = new thumbnail(4941975,'279771','View from a bridge','viewbridge_thumb.jpg',130, 92,18,'photo_4941975.html');
												thumbnails[4942470] = new thumbnail(4942470,'281129','Tulip','orangetulip_thumb.jpg',130, 130,18,'photo_4942470.html');
												thumbnails[4949683] = new thumbnail(4949683,'281129','Backlit poopy','backlitpop_thumb.jpg',130, 91,18,'photo_4949683.html');
												thumbnails[4949690] = new thumbnail(4949690,'281129','Castle combe 1','cascombe1_thumb.jpg',130, 130,18,'photo_4949690.html');
												thumbnails[4949692] = new thumbnail(4949692,'281129','Castle combe 2','cascombe2_thumb.jpg',130, 130,18,'photo_4949692.html');
												thumbnails[4949736] = new thumbnail(4949736,'279771','Bath snow','bathsnow_thumb.jpg',130, 130,18,'photo_4949736.html');
												thumbnails[4949741] = new thumbnail(4949741,'279771','Bicycle','bicycle_thumb.jpg',130, 130,18,'photo_4949741.html');
												thumbnails[4955468] = new thumbnail(4955468,'281129','Steps and stone balls','stepsandstone_thumb.jpg',130, 130,18,'photo_4955468.html');
												thumbnails[4955473] = new thumbnail(4955473,'281129','Gate','gate1_thumb.jpg',130, 130,18,'photo_4955473.html');
												thumbnails[4942144] = new thumbnail(4942144,'281129','Surfer','surfer_thumb.jpg',130, 130,18,'photo_4942144.html');
												thumbnails[4968270] = new thumbnail(4968270,'281576','Autumn leaf','autumnleaf1_thumb.jpg',130, 130,18,'photo_4968270.html');
												thumbnails[4968281] = new thumbnail(4968281,'281576','Tulips','tulips1_thumb.jpg',130, 130,18,'photo_4968281.html');
												thumbnails[4968285] = new thumbnail(4968285,'281576','Poppy and cornflower','popcorn1_thumb.jpg',130, 130,18,'photo_4968285.html');
												thumbnails[4968293] = new thumbnail(4968293,'281576','Fritillaries','frit1_thumb.jpg',130, 130,18,'photo_4968293.html');
												thumbnails[4942165] = new thumbnail(4942165,'281129','Gower chapel','gowerchapel_thumb.jpg',130, 130,18,'photo_4942165.html');
												thumbnails[4968297] = new thumbnail(4968297,'281576','Astrantia and chives','astrantiachives1_thumb.jpg',130, 130,18,'photo_4968297.html');
												thumbnails[4942171] = new thumbnail(4942171,'281129','Wells 1','wells1_thumb.jpg',130, 130,18,'photo_4942171.html');
												thumbnails[4968305] = new thumbnail(4968305,'281576','Purple beech','purplebeech1_thumb.jpg',130, 130,18,'photo_4968305.html');
												thumbnails[4942179] = new thumbnail(4942179,'281129','Wells balloon','wellsbaloon_thumb.jpg',130, 130,18,'photo_4942179.html');
												thumbnails[4968309] = new thumbnail(4968309,'281576','2 cows','2cows1_thumb.jpg',130, 130,18,'photo_4968309.html');
												thumbnails[4941811] = new thumbnail(4941811,'279770','Lyme Regis','lymeregis_thumb.jpg',130, 86,18,'photo_4941811.html');
												thumbnails[4942191] = new thumbnail(4942191,'281129','Yacht','yacht_thumb.jpg',130, 130,18,'photo_4942191.html');
												thumbnails[4968315] = new thumbnail(4968315,'281576','Jetty','jetty11_thumb.jpg',130, 130,18,'photo_4968315.html');
												thumbnails[4941807] = new thumbnail(4941807,'279770','Lyme Regis beach','lymebeach_thumb.jpg',130, 130,18,'photo_4941807.html');
												thumbnails[4942215] = new thumbnail(4942215,'281129','Lady in red hat','redhat_thumb.jpg',130, 130,18,'photo_4942215.html');
												thumbnails[4968320] = new thumbnail(4968320,'281576','Raspberry ripple','raspberry_thumb.jpg',130, 87,18,'photo_4968320.html');
												thumbnails[4942157] = new thumbnail(4942157,'281129','Beer boats','beerboats_thumb.jpg',130, 86,18,'photo_4942157.html');
												thumbnails[4955475] = new thumbnail(4955475,'279770','Fishing on the cobb','fishonthecobb_thumb.jpg',130, 94,18,'photo_4955475.html');
												thumbnails[4968323] = new thumbnail(4968323,'281576','Magnolia 1','magnolia11_thumb.jpg',130, 86,18,'photo_4968323.html');
												thumbnails[4942161] = new thumbnail(4942161,'281129','Bike race','bikerace_thumb.jpg',130, 86,18,'photo_4942161.html');
												thumbnails[4949740] = new thumbnail(4949740,'279771','Bath view','bathview_thumb.jpg',130, 86,18,'photo_4949740.html');
												thumbnails[4955478] = new thumbnail(4955478,'279770','Free house','freehouse_thumb.jpg',130, 86,18,'photo_4955478.html');
												thumbnails[4968340] = new thumbnail(4968340,'281576','Purple poppy','purplepop1_thumb.jpg',130, 87,18,'photo_4968340.html');
												thumbnails[4941814] = new thumbnail(4941814,'279770','West bay','westbay_thumb.jpg',130, 59,18,'photo_4941814.html');
												thumbnails[4942163] = new thumbnail(4942163,'281129','Gold','gold_thumb.jpg',130, 86,18,'photo_4942163.html');
												thumbnails[4968345] = new thumbnail(4968345,'281576','Magnolia 2','mag21_thumb.jpg',130, 87,18,'photo_4968345.html');
												thumbnails[4942221] = new thumbnail(4942221,'281129','Boat crew','boatcrew_thumb.jpg',130, 88,18,'photo_4942221.html');
												thumbnails[4968456] = new thumbnail(4968456,'281576','Blue iris','blueiris2_thumb.jpg',130, 87,18,'photo_4968456.html');
												thumbnails[4942228] = new thumbnail(4942228,'281129','Surfers','surf2_thumb.jpg',130, 86,18,'photo_4942228.html');
												thumbnails[4968351] = new thumbnail(4968351,'281576','Greenwich snow','onthedowns1_thumb.jpg',130, 87,18,'photo_4968351.html');
												thumbnails[4942265] = new thumbnail(4942265,'281129','2 blokes','2blokes_thumb.jpg',130, 88,18,'photo_4942265.html');
												thumbnails[4968360] = new thumbnail(4968360,'281576','Lone tree','lonetree2_thumb.jpg',130, 87,18,'photo_4968360.html');
												thumbnails[4942138] = new thumbnail(4942138,'281129','Leeks','leeks_thumb.jpg',86, 130,18,'photo_4942138.html');
												thumbnails[4968367] = new thumbnail(4968367,'281576','Antibes sunrise','antibessunset_thumb.jpg',130, 87,18,'photo_4968367.html');
												thumbnails[4942472] = new thumbnail(4942472,'281129','Hornbeams','hornbeams_thumb.jpg',92, 130,18,'photo_4942472.html');
												thumbnails[4968375] = new thumbnail(4968375,'281576','Russian church','russianchurch1_thumb.jpg',91, 130,18,'photo_4968375.html');
												thumbnails[4968379] = new thumbnail(4968379,'281576','Horizon 1','stormysea1_thumb.jpg',130, 87,18,'photo_4968379.html');
												thumbnails[4968398] = new thumbnail(4968398,'281576','Shelter','shelter1_thumb.jpg',130, 87,18,'photo_4968398.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[279771] = new gallery(279771,'4949741,4949740,4949736,4941975,4941972,4941968,4941963,4941956,4941946,4941887','Bristol and Bath','gallery',[4941873,4941887,4941946,4941956,4941963,4941968,4941972,4941975,4949736,4949741,4949740],0, 1, '', 'gallery_279771.html',0,0);
				  					galleries[279770] = new gallery(279770,'4955478,4955475,4941814,4941811,4941807,4941799,4941793,4941791,4941789,4941786','Dorset','gallery',[4941768,4941779,4941786,4941789,4941791,4941793,4941799,4941811,4941807,4955475,4955478,4941814],0, 1, '', 'gallery_279770.html',0,0);
				  					galleries[281129] = new gallery(281129,'4955473,4955468,4949692,4949690,4949683,4942472,4942470,4942265,4942228,4942221','Miscellany','gallery',[4942470,4949683,4949690,4949692,4955468,4955473,4942144,4942165,4942171,4942179,4942191,4942215,4942157,4942161,4942163,4942221,4942228,4942265,4942138,4942472],0, 1, '', 'gallery_281129.html',0,0);
				  					galleries[281576] = new gallery(281576,'4968456,4968398,4968379,4968375,4968367,4968360,4968351,4968345,4968340,4968323','Open editions','gallery',[4968270,4968281,4968285,4968293,4968297,4968305,4968309,4968315,4968320,4968323,4968340,4968345,4968456,4968351,4968360,4968367,4968375,4968379,4968398],0, 1, '', 'gallery_281576.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '4968456,4968398,4968379,4968375,4968367,4968360,4968351,4968345,4968340,4968323,4968320,4968315,4968309,4968305,4968297,4968293,4968285,4968281,4968270,4955478,4955475,4955473,4955468,4949741,4949740,4949736,4949692,4949690,4949683,4942472,4942470,4942265,4942228,4942221,4942215,4942191,4942179,4942171,4942165,4942163,4942161,4942157,4942144,4942138,4941975,4941972,4941968,4941963,4941956,4941946';
imageSets[3] = '4968456,4968398,4968379,4968375,4968367,4968360,4968351,4968345,4968340,4968323,4968320,4968315,4968309,4968305,4968297,4968293,4968285,4968281,4968270,4955478,4955475,4955473,4955468,4949741,4949740,4949736,4949692,4949690,4949683,4942472,4942470,4942265,4942228,4942221,4942215,4942191,4942179,4942171,4942165,4942163,4942161,4942157,4942144,4942138,4941975,4941972,4941968,4941963,4941956,4941946';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/rowani/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/rowani/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/rowani/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/rowani/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/rowani/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/rowani/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/rowani/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/rowani/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/rowani/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/rowani/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/rowani/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/rowani/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/rowani/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/rowani/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/rowani/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/rowani/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/rowani/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/rowani/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/rowani/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/rowani/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/rowani/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/rowani/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 = 'Rowan Isaac Gallery: ' + 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="updateCartValue(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';
				
		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">';
	temp = temp + '	<input type="hidden" name="item_option" value="' + item_option + '">';
	temp = temp + '	<input type="hidden" name="site" value="ROWANI">';
		temp = temp + '	<input type="hidden" name="item_number" value="'+ this.id +'">';
			temp = temp + '	<input type="hidden" name="quantity" value="1">';
								temp = temp + '	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\'\;" onmouseout="this.className=\'button\'\;" type="Button">';
			temp = 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 = temp + '</form>';
		temp = temp + '<div class="clearing">&nbsp;</div>';
	temp = temp + '<div id="confirmContainer">';
	temp = temp + '<div id="paymentConfirm">Item added to cart</div>';
	temp = temp + '</div>';
			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;
	}
}

			

