window.thumbnails = new Object();
												thumbnails[6113678] = new thumbnail(6113678,'342673','New Walk Gallery','newwDSC_1782_thumb.jpg',130, 86,18,'photo_6113678.html');
												thumbnails[6113688] = new thumbnail(6113688,'342673','New Walk Gallery','newwDSC_2820_thumb.jpg',130, 87,18,'photo_6113688.html');
												thumbnails[6113693] = new thumbnail(6113693,'342673','New Walk Gallery','newwDSC_0117_01_thumb.jpg',130, 87,18,'photo_6113693.html');
												thumbnails[6113708] = new thumbnail(6113708,'342673','New Walk Gallery','newwDSC_0013_thumb.jpg',130, 87,18,'photo_6113708.html');
												thumbnails[6113725] = new thumbnail(6113725,'342673','New Walk Gallery','newwDSC_0076_thumb.jpg',130, 87,18,'photo_6113725.html');
												thumbnails[6113733] = new thumbnail(6113733,'342673','New Walk Gallery','newwDSC_0098_thumb.jpg',130, 87,18,'photo_6113733.html');
												thumbnails[6113737] = new thumbnail(6113737,'342673','New Walk Gallery','newwDSC_0201_thumb.jpg',130, 87,18,'photo_6113737.html');
												thumbnails[6113742] = new thumbnail(6113742,'342673','New Walk Gallery','newwDSC_0230_thumb.jpg',130, 87,18,'photo_6113742.html');
												thumbnails[6113749] = new thumbnail(6113749,'342673','New Walk Gallery','newwDSC_0238_thumb.jpg',130, 41,18,'photo_6113749.html');
												thumbnails[4139914] = new thumbnail(4139914,'342673','Portraiture','newwDSC_0126_011_thumb.jpg',130, 87,18,'photo_4139914.html');
												thumbnails[4139918] = new thumbnail(4139918,'342673','Portraiture','newwDSC_0131_01_thumb.jpg',130, 195,18,'photo_4139918.html');
												thumbnails[2553773] = new thumbnail(2553773,'161279','Graffiti','graffiti1_thumb.jpg',130, 61,18,'photo_2553773.html');
												thumbnails[2511814] = new thumbnail(2511814,'161267','Phi Phi Island, Krabi','phiDSC00317_thumb.jpg',130, 98,18,'photo_2511814.html');
												thumbnails[2511867] = new thumbnail(2511867,'161267','Wheat Field','DSC01217_thumb.jpg',130, 93,18,'photo_2511867.html');
												thumbnails[2681392] = new thumbnail(2681392,'161267','City Scape','hollandCNV00005_thumb.jpg',130, 88,18,'photo_2681392.html');
												thumbnails[4817312] = new thumbnail(4817312,'161267','Memory Walk Event','forestDSC00394_thumb.jpg',130, 78,18,'photo_4817312.html');
												thumbnails[2681268] = new thumbnail(2681268,'161270','City Scape','laosDSC_2417_thumb.jpg',130, 87,18,'photo_2681268.html');
												thumbnails[2681209] = new thumbnail(2681209,'161270','City Scape','buddhaDSC_2190_thumb.jpg',130, 195,18,'photo_2681209.html');
												thumbnails[2681509] = new thumbnail(2681509,'161270','City Scape','stupaDSC_2217_thumb.jpg',130, 195,18,'photo_2681509.html');
												thumbnails[2681473] = new thumbnail(2681473,'161270','City Scape','cityDSC_3251_thumb.jpg',130, 86,18,'photo_2681473.html');
												thumbnails[2681464] = new thumbnail(2681464,'161270','City Scape','landDSC_2884_thumb.jpg',130, 196,18,'photo_2681464.html');
												thumbnails[2681480] = new thumbnail(2681480,'161270','City Scape','DSC_2904city_thumb.jpg',130, 86,18,'photo_2681480.html');
												thumbnails[2681444] = new thumbnail(2681444,'161270','City Scape','DSC_2687city_thumb.jpg',130, 86,18,'photo_2681444.html');
												thumbnails[2681196] = new thumbnail(2681196,'161270','City Scape','DSC_1578city_thumb.jpg',130, 86,18,'photo_2681196.html');
												thumbnails[2549369] = new thumbnail(2549369,'161270','City Scape','cityDSC_0648_thumb.jpg',130, 86,18,'photo_2549369.html');
												thumbnails[2681176] = new thumbnail(2681176,'161270','City Scape','DSC_0636city_thumb.jpg',130, 189,18,'photo_2681176.html');
												thumbnails[2632588] = new thumbnail(2632588,'161270','City Scape','DSC_3281city4_thumb.jpg',130, 86,18,'photo_2632588.html');
												thumbnails[2632493] = new thumbnail(2632493,'161270','City Scape','DSC_2945city2_thumb.jpg',130, 91,18,'photo_2632493.html');
												thumbnails[2632499] = new thumbnail(2632499,'161270','City Scape','DSC_2913city3_thumb.jpg',130, 86,18,'photo_2632499.html');
												thumbnails[2632629] = new thumbnail(2632629,'161270','City Scape','DSC_1857city5_thumb.jpg',130, 86,18,'photo_2632629.html');
												thumbnails[2552106] = new thumbnail(2552106,'161277','Flora','mapleDSC_0427_thumb.jpg',130, 87,18,'photo_2552106.html');
												thumbnails[2552099] = new thumbnail(2552099,'161277','Flora','DSC_3165flora2_thumb.jpg',130, 86,18,'photo_2552099.html');
												thumbnails[2552097] = new thumbnail(2552097,'161277','Flora','DSC_3133flora1_thumb.jpg',130, 86,18,'photo_2552097.html');
												thumbnails[2552110] = new thumbnail(2552110,'161277','Flora','DSC_2775flora4_thumb.jpg',130, 86,18,'photo_2552110.html');
												thumbnails[2552115] = new thumbnail(2552115,'161277','Flora','DSC_2598flora5_thumb.jpg',130, 86,18,'photo_2552115.html');
												thumbnails[2552118] = new thumbnail(2552118,'161277','Flora','DSC_2587flora6_thumb.jpg',130, 86,18,'photo_2552118.html');
												thumbnails[2552124] = new thumbnail(2552124,'161277','Flora','DSC_2127flora7_thumb.jpg',130, 95,18,'photo_2552124.html');
												thumbnails[2552127] = new thumbnail(2552127,'161277','Flora','DSC_2087flora8_thumb.jpg',130, 86,18,'photo_2552127.html');
												thumbnails[2646591] = new thumbnail(2646591,'161274','One Passion One Leicester 08','DSC_3304oneleic_thumb.jpg',130, 196,18,'photo_2646591.html');
												thumbnails[2646665] = new thumbnail(2646665,'161274','One Passion One Leicester 08','DSC_3310oneleic_thumb.jpg',130, 86,18,'photo_2646665.html');
												thumbnails[2646668] = new thumbnail(2646668,'161274','One Passion One Leicester','DSC_3321oneleic_thumb.jpg',130, 86,18,'photo_2646668.html');
												thumbnails[2646671] = new thumbnail(2646671,'161274','One Passion One Leicester 08','DSC_3328oneleic_thumb.jpg',130, 86,18,'photo_2646671.html');
												thumbnails[2646675] = new thumbnail(2646675,'161274','One Passion One Leicester 08','DSC_3329oneleic_thumb.jpg',130, 86,18,'photo_2646675.html');
												thumbnails[2646682] = new thumbnail(2646682,'161274','One Passion One Leicester 08','DSC_3337oneleic_thumb.jpg',130, 86,18,'photo_2646682.html');
												thumbnails[2680448] = new thumbnail(2680448,'161274','one passion one Leicester 08','DSC_3344oneleic_thumb.jpg',130, 86,18,'photo_2680448.html');
												thumbnails[2680461] = new thumbnail(2680461,'161274','One Passion One Leicester 08','DSC_3347oneleic_thumb.jpg',130, 86,18,'photo_2680461.html');
												thumbnails[2680482] = new thumbnail(2680482,'161274','One Passion One Leicester 08','DSC_3354oneleic_thumb.jpg',130, 196,18,'photo_2680482.html');
												thumbnails[2680486] = new thumbnail(2680486,'161274','One Passion One Leicester 08','DSC_3369oneleic_thumb.jpg',130, 86,18,'photo_2680486.html');
												thumbnails[2680491] = new thumbnail(2680491,'161274','One Passion One Leicester 08','DSC_3373oneleic_thumb.jpg',130, 86,18,'photo_2680491.html');
												thumbnails[2680493] = new thumbnail(2680493,'161274','One Passion One Leicester 08','DSC_3376oneleic_thumb.jpg',130, 196,18,'photo_2680493.html');
												thumbnails[2680497] = new thumbnail(2680497,'161274','One Passion One Leicester 08','DSC_3378oneleic_thumb.jpg',130, 86,18,'photo_2680497.html');
												thumbnails[2680499] = new thumbnail(2680499,'161274','One Passion One Leicester 08','DSC_3381oneleic_thumb.jpg',130, 86,18,'photo_2680499.html');
												thumbnails[4139698] = new thumbnail(4139698,'161278','Portraiture','DSC_2747cl_thumb.jpg',130, 195,18,'photo_4139698.html');
												thumbnails[4139805] = new thumbnail(4139805,'161278','Portraiture','DSC_2764cl_thumb.jpg',130, 254,18,'photo_4139805.html');
												thumbnails[4139815] = new thumbnail(4139815,'161278','Portraiture','DSC_2765cl_thumb.jpg',130, 196,18,'photo_4139815.html');
												thumbnails[4139904] = new thumbnail(4139904,'161278','Portraiture','DSC_2771cl_thumb.jpg',130, 196,18,'photo_4139904.html');
												thumbnails[2549354] = new thumbnail(2549354,'161278','Portraiture','DSC_3123portrait1_thumb.jpg',130, 86,18,'photo_2549354.html');
												thumbnails[2553906] = new thumbnail(2553906,'161278','Portrait','DSC_2750portrait2_thumb.jpg',130, 86,18,'photo_2553906.html');
												thumbnails[2553913] = new thumbnail(2553913,'161278','Portrait','DSC_2883portrait3_thumb.jpg',130, 86,18,'photo_2553913.html');
												thumbnails[2553919] = new thumbnail(2553919,'161278','Portrait','DSC_3229portrait4_thumb.jpg',130, 86,18,'photo_2553919.html');
												thumbnails[2553960] = new thumbnail(2553960,'161278','Portrait','DSC_3129portrait6_thumb.jpg',130, 196,18,'photo_2553960.html');
												thumbnails[2553976] = new thumbnail(2553976,'161278','portrait','DSC_2762portrait7_thumb.jpg',130, 196,18,'photo_2553976.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[342673] = new gallery(342673,'6113725','New Walk Gallery','section203462',[6113678,6113688,6113693,6113708,6113725,6113733,6113737,6113742,6113749,4139914,4139918],0, 0, '', 'section203462_342673.html',0,0);
				  					galleries[161279] = new gallery(161279,'2553773','Graffiti','section203462',[2553773],0, 0, '', 'section203462_161279.html',0,0);
				  					galleries[161267] = new gallery(161267,'4817312,2681392,2511814','Landscapes','section203462',[2511814,2511867,2681392,4817312],0, 0, '', 'section203462_161267.html',0,0);
				  					galleries[161270] = new gallery(161270,'2681509,2681480,2681473,2681464,2681444,2681268,2681209,2681196,2681176,2632588,2632499,2632493','City Scape - Architecture','section203462',[2681268,2681209,2681509,2681473,2681464,2681480,2681444,2681196,2549369,2681176,2632588,2632493,2632499,2632629],0, 0, '', 'section203462_161270.html',0,0);
				  					galleries[161274] = new gallery(161274,'2680499,2680497,2680493,2680491,2680486,2680482,2680461,2680448,2646682,2646675,2646671,2646668,2646665,2646591','Lifestyle','section203462',[2646591,2646665,2646668,2646671,2646675,2646682,2680448,2680461,2680482,2680486,2680491,2680493,2680497,2680499],0, 0, '', 'section203462_161274.html',0,0);
				  					galleries[161277] = new gallery(161277,'2552127,2552124,2552118,2552115,2552110,2552106,2552099,2552097','Flora','section203462',[2552106,2552099,2552097,2552110,2552115,2552118,2552124,2552127],0, 0, '', 'section203462_161277.html',0,0);
				  					galleries[161278] = new gallery(161278,'4139904,4139815,4139805,4139698,2553976,2553960,2553919,2553913,2553906,2549354','Portraiture','section203462',[4139698,4139805,4139815,4139904,2549354,2553906,2553913,2553919,2553960,2553976],0, 0, '', 'section203462_161278.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '4817312,2681509,2681480,2681473,2681464,2681444,2681392,2681268,2681209,2681196,2681176,2680499,2680497,2680493,2680491,2680486,2680461,2646682,2646675,2646671,2646668,2646665,2646591,2632588,2632499,2632493,2549369,2511867,2511814';
imageSets[2] = '6113725,4817312,2681509,2681480,2681473,2681464,2681444,2681392,2681268,2681209,2681196,2681176,2680499,2680497,2680493,2680491,2680486,2680482,2680461,2680448,2646682,2646675,2646671,2646668,2646665,2646591,2632588,2632499,2632493,2511814';
imageSets[3] = '4817312';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/552gbe/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/552gbe/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/552gbe/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/552gbe/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/552gbe/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/552gbe/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/552gbe/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/552gbe/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/552gbe/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/552gbe/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/552gbe/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/552gbe/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/552gbe/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/552gbe/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/552gbe/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/552gbe/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/552gbe/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/552gbe/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/552gbe/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/552gbe/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/552gbe/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/552gbe/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 += 'section203462.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 && 'section203462' != '') {
					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 = 'GB  Photography: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
	    var options = {photoinfominwidth:200};	    		options.photoinfoadjacent = true;			      		      options.centre = true;	          	        	      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;
	}
}

			

