window.thumbnails = new Object();
												thumbnails[6681427] = new thumbnail(6681427,'364951','Red In The Clouds','_MG_2031_thumb.jpg',130, 195,1,'							photo_6681427.html');
												thumbnails[6681431] = new thumbnail(6681431,'364951','Eyes Of An Angel','Eyes_Of_A_Angel_thumb.jpg',130, 177,1,'							photo_6681431.html');
												thumbnails[6681433] = new thumbnail(6681433,'364951','Fingers','Fingers_thumb.jpg',130, 92,1,'							photo_6681433.html');
												thumbnails[6681676] = new thumbnail(6681676,'364951','The Vampire Wife','_MG_5710sharpened_thumb.jpg',130, 198,1,'							photo_6681676.html');
												thumbnails[6681756] = new thumbnail(6681756,'364951','Alone In The Dark','_MG_5658c_thumb.jpg',130, 199,1,'							photo_6681756.html');
												thumbnails[6763453] = new thumbnail(6763453,'364951','Bloodlust','_MG_2838b_thumb.jpg',130, 87,1,'							photo_6763453.html');
												thumbnails[6763455] = new thumbnail(6763455,'364951','Eye of the Vampires','_MG_2866b_thumb.jpg',130, 87,1,'							photo_6763455.html');
												thumbnails[985537] = new thumbnail(985537,'73856','','IMG_16751_thumb.jpg',130, 92,1,'							photo_985537.html');
												thumbnails[983726] = new thumbnail(983726,'73856','','web-size-x-3-k-bike-2_thumb.jpg',130, 68,1,'							photo_983726.html');
												thumbnails[6682102] = new thumbnail(6682102,'73856','','_MG_8705_thumb.jpg',130, 195,1,'							photo_6682102.html');
												thumbnails[3402803] = new thumbnail(3402803,'73859','Nine Arches Bridge, Thrapston','_MG_1380_thumb.jpg',130, 87,1,'							photo_3402803.html');
												thumbnails[1649350] = new thumbnail(1649350,'73859','Rivers Edge, Thrapston','_MG_4594_RAW_DxO_web_thumb.jpg',130, 87,1,'							photo_1649350.html');
												thumbnails[1649348] = new thumbnail(1649348,'73859','Thrapston Lakes','IMG_2333_thumb.jpg',130, 185,1,'							photo_1649348.html');
												thumbnails[1649349] = new thumbnail(1649349,'73859','River Nene at Thrapston','IMG_2342_thumb.jpg',130, 91,1,'							photo_1649349.html');
												thumbnails[985570] = new thumbnail(985570,'73859','St Louis Arch','IMG_2017a_thumb.jpg',130, 92,1,'							photo_985570.html');
												thumbnails[985531] = new thumbnail(985531,'73859','Southern Ireland','IMG_16721_thumb.jpg',130, 92,1,'							photo_985531.html');
												thumbnails[985533] = new thumbnail(985533,'73859','Southern Ireland','IMG_14841_thumb.jpg',130, 92,1,'							photo_985533.html');
												thumbnails[985534] = new thumbnail(985534,'73859','Southern Ireland','IMG_1686_thumb.jpg',130, 92,1,'							photo_985534.html');
												thumbnails[983582] = new thumbnail(983582,'73859','One of the many island in the Maldives taken from a seaplane','IMG_1151_thumb.jpg',130, 87,1,'							photo_983582.html');
												thumbnails[983590] = new thumbnail(983590,'73859','Sunset in the Maldives','IMG_1454_thumb.jpg',130, 87,1,'							photo_983590.html');
												thumbnails[6682113] = new thumbnail(6682113,'73859','Scotland Rainbow','_MG_4946_thumb.jpg',130, 87,1,'							photo_6682113.html');
												thumbnails[6682114] = new thumbnail(6682114,'73859','Lumber in Scottish Wood','_MG_5066_thumb.jpg',130, 87,1,'							photo_6682114.html');
												thumbnails[6924574] = new thumbnail(6924574,'73859','Yorkshire Dales','_MG_4415_thumb.jpg',130, 87,1,'							photo_6924574.html');
												thumbnails[7001589] = new thumbnail(7001589,'73859','Yorkshire Dales','_MG_4432BW_thumb.jpg',130, 87,1,'							photo_7001589.html');
												thumbnails[7001592] = new thumbnail(7001592,'73859','Lone Tree in the Yorkshire Dales','_MG_4468_thumb.jpg',130, 195,1,'							photo_7001592.html');
												thumbnails[7264950] = new thumbnail(7264950,'73859','Thrapston Frost December 2010','_MG_6377_thumb.jpg',130, 195,1,'							photo_7264950.html');
												thumbnails[7264954] = new thumbnail(7264954,'73859','','_MG_6461_thumb.jpg',130, 195,1,'							photo_7264954.html');
												thumbnails[7264958] = new thumbnail(7264958,'73859','Thrapston Frost December 2010','_MG_6485_thumb.jpg',130, 195,1,'							photo_7264958.html');
												thumbnails[2585031] = new thumbnail(2585031,'73847','','_MG_3739_1_thumb.jpg',130, 195,1,'							photo_2585031.html');
												thumbnails[1917380] = new thumbnail(1917380,'73847','','_MG_6379_thumb.jpg',130, 195,1,'							photo_1917380.html');
												thumbnails[1917383] = new thumbnail(1917383,'73847','','_MG_6392_thumb.jpg',130, 195,1,'							photo_1917383.html');
												thumbnails[1282641] = new thumbnail(1282641,'73848','','IMG_1313-out-of-frame_thumb.jpg',130, 92,1,'							photo_1282641.html');
												thumbnails[1571454] = new thumbnail(1571454,'73847','','_MG_3159_thumb.jpg',130, 195,1,'							photo_1571454.html');
												thumbnails[6681496] = new thumbnail(6681496,'73845','','Image_5941_thumb.jpg',130, 195,1,'							photo_6681496.html');
												thumbnails[6681508] = new thumbnail(6681508,'73845','','IMG_4284-web_thumb.jpg',130, 195,1,'							photo_6681508.html');
												thumbnails[6681583] = new thumbnail(6681583,'73845','','IMG_8558_thumb.jpg',130, 195,1,'							photo_6681583.html');
												thumbnails[6681855] = new thumbnail(6681855,'73845','','_MG_6901_thumb.jpg',130, 195,1,'							photo_6681855.html');
												thumbnails[6682065] = new thumbnail(6682065,'73845','','_MG_1451b_thumb.jpg',130, 199,1,'							photo_6682065.html');
												thumbnails[6682120] = new thumbnail(6682120,'73847','','_MG_7613_thumb.jpg',130, 87,1,'							photo_6682120.html');
												thumbnails[6682127] = new thumbnail(6682127,'73847','','_MG_1425a_thumb.jpg',130, 195,1,'							photo_6682127.html');
												thumbnails[6682128] = new thumbnail(6682128,'73847','','_MG_1475a_thumb.jpg',130, 87,1,'							photo_6682128.html');
												thumbnails[6763513] = new thumbnail(6763513,'73845','Miu','_MG_3054BW_thumb.jpg',130, 195,1,'							photo_6763513.html');
												thumbnails[6892202] = new thumbnail(6892202,'73845','','_MG_3640_thumb.jpg',130, 87,1,'							photo_6892202.html');
												thumbnails[6950618] = new thumbnail(6950618,'73845','Mask','_MG_4822_thumb.jpg',130, 87,1,'							photo_6950618.html');
												thumbnails[6681618] = new thumbnail(6681618,'364964','In A London Cab','_MG_2676b_thumb.jpg',130, 199,1,'							photo_6681618.html');
												thumbnails[6681664] = new thumbnail(6681664,'364964','Caught In A Web','_MG_8994a_thumb.jpg',130, 87,1,'							photo_6681664.html');
												thumbnails[6681670] = new thumbnail(6681670,'364964','Desolation with Beauty','_MG_4543_thumb.jpg',130, 87,1,'							photo_6681670.html');
												thumbnails[6681688] = new thumbnail(6681688,'364964','Drunk','_MG_7988a_thumb.jpg',130, 86,1,'							photo_6681688.html');
												thumbnails[6681736] = new thumbnail(6681736,'364964','Spider Lady','_MG_7128c_thumb.jpg',130, 86,1,'							photo_6681736.html');
												thumbnails[6681904] = new thumbnail(6681904,'364964','Ripples in the lake','Ripples_thumb.jpg',130, 195,1,'							photo_6681904.html');
												thumbnails[6681906] = new thumbnail(6681906,'364964','Contemplation','_MG_2371_thumb.jpg',130, 94,1,'							photo_6681906.html');
												thumbnails[6681938] = new thumbnail(6681938,'364964','Dawn at the Lake','_MG_9233a_thumb.jpg',130, 87,1,'							photo_6681938.html');
												thumbnails[6681944] = new thumbnail(6681944,'364964','Claw','_MG_7597_thumb.jpg',130, 195,1,'							photo_6681944.html');
												thumbnails[6681955] = new thumbnail(6681955,'364964','Gunfight at Laredo','_MG_2285_thumb.jpg',130, 87,1,'							photo_6681955.html');
												thumbnails[6737234] = new thumbnail(6737234,'364964','Conversation','_MG_2328_thumb.jpg',130, 195,1,'							photo_6737234.html');
												thumbnails[6892193] = new thumbnail(6892193,'364964','Sweeney Todd','_MG_4217_thumb.jpg',130, 195,1,'							photo_6892193.html');
												thumbnails[1391743] = new thumbnail(1391743,'364953','Honeymoon in Maldives','IMG_1313-out-of-frame1_thumb.jpg',130, 92,1,'							photo_1391743.html');
												thumbnails[6682069] = new thumbnail(6682069,'364953','','_MG_7787_thumb.jpg',130, 87,1,'							photo_6682069.html');
												thumbnails[6682071] = new thumbnail(6682071,'364953','','_MG_7801_thumb.jpg',130, 87,1,'							photo_6682071.html');
												thumbnails[6682072] = new thumbnail(6682072,'364953','','_MG_7808_thumb.jpg',130, 195,1,'							photo_6682072.html');
												thumbnails[6682075] = new thumbnail(6682075,'364953','','_MG_7986_thumb.jpg',130, 87,1,'							photo_6682075.html');
												thumbnails[6682076] = new thumbnail(6682076,'364953','','_MG_8104_thumb.jpg',130, 87,1,'							photo_6682076.html');
												thumbnails[6682078] = new thumbnail(6682078,'364953','','_MG_8456_thumb.jpg',130, 195,1,'							photo_6682078.html');
												thumbnails[6682079] = new thumbnail(6682079,'364953','','_MG_8464_thumb.jpg',130, 87,1,'							photo_6682079.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[364951] = new gallery(364951,'6763455,6763453,6681756,6681676,6681433,6681431,6681427','Digital Art','section434736',[6681427,6681431,6681433,6681676,6681756,6763453,6763455],0, 1, '', '																																																																																																																																	section434736.html',0,0);
				  					galleries[73847] = new gallery(73847,'6682128,6682127,6682120,2585031,1917383,1917380,1571454','Family','section104862',[2585031,1917380,1917383,1571454,6682120,6682127,6682128],0, 1, '', '																																																																																																							section104862_73847.html',0,0);
				  					galleries[73848] = new gallery(73848,'1282641','Formal','section104862',[1282641],0, 1, '', '																																																																																																							section104862_73848.html',0,0);
				  					galleries[73856] = new gallery(73856,'6682102,985537,983726','Harley Davidson','section104883',[985537,983726,6682102],0, 1, '', '																																																																																																																																	section104883.html',0,0);
				  					galleries[73845] = new gallery(73845,'6950618,6892202,6763513,6682065,6681855,6681583,6681508,6681496','Individual','section104862',[6681496,6681508,6681583,6681855,6682065,6763513,6892202,6950618],0, 1, '', '																																																																																																							section104862_73845.html',0,0);
				  					galleries[73859] = new gallery(73859,'7264958,7264954,7264950,7001592,7001589,6924574,6682114,6682113,3402803,1649350','Landscapes','section104887',[3402803,1649350,1649348,1649349,985570,985531,985533,985534,983582,983590,6682113,6682114,6924574,7001589,7001592,7264950,7264954,7264958],0, 1, '', '																																																																																																																																	section104887.html',0,0);
				  					galleries[364964] = new gallery(364964,'6892193,6737234,6681955,6681944,6681938,6681906,6681904,6681736,6681688,6681670','Private Projects','section434739',[6681618,6681664,6681670,6681688,6681736,6681904,6681906,6681938,6681944,6681955,6737234,6892193],0, 1, '', '																																																																																																																																	section434739.html',0,0);
				  					galleries[364953] = new gallery(364953,'6682079,6682078,6682076,6682075,6682072,6682071,6682069,1391743','Weddings','section434738',[1391743,6682069,6682071,6682072,6682075,6682076,6682078,6682079],0, 1, '', '																																																																																																																																	section434738.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '2585031,1917383,1917380,1391743,1282641';
imageSets[3] = '7264958,7264954,7264950,7001592,7001589,6950618,6924574,6892202,6892193,6763513,6763455,6763453,6737234,6682128,6682127,6682120,6682114,6682113,6682102,6682079,6682078,6682076,6682075,6682072,6682071,6682069,6682065,6681955,6681944,6681938,6681906,6681904,6681855,6681756,6681736,6681688,6681676,6681670,6681664,6681618,6681583,6681508,6681496,6681433,6681431,6681427,3402803,2585031,1917383,1917380';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/timrosier/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/timrosier/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/timrosier/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/timrosier/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://www.clikchurch.com/timrosier/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/timrosier/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/timrosier/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/timrosier/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/timrosier/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/timrosier/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/timrosier/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/timrosier/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/timrosier/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/timrosier/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/timrosier/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/timrosier/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/timrosier/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/timrosier/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/timrosier/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/timrosier/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/timrosier/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/timrosier/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 += 'section434736.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 && 'section434736' != '') {
					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));		}, 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 = 'Tim Rosier 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));    }        
    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>Tim Rosier </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;
	}
}

		

