window.thumbnails = new Object();
												thumbnails[5969957] = new thumbnail(5969957,'309675','','_MG_6496pmz_thumb.jpg',130, 195,15,'photo_5969957.html');
												thumbnails[3964814] = new thumbnail(3964814,'239611','Guardian Angel','GuardianAngel2_thumb.jpg',130, 130,15,'photo_3964814.html');
												thumbnails[3965698] = new thumbnail(3965698,'239612','Old Farm Days','OldFarmDays1_thumb.jpg',130, 87,15,'photo_3965698.html');
												thumbnails[4270186] = new thumbnail(4270186,'239612','Red Dawn','_MG_4193redsunrise_thumb.jpg',130, 87,15,'photo_4270186.html');
												thumbnails[5472699] = new thumbnail(5472699,'309703','The Bicycle Shed','_MG_5393_thumb.jpg',130, 87,15,'photo_5472699.html');
												thumbnails[3970660] = new thumbnail(3970660,'239612','Hazy Glade','0320hazyglade_thumb.jpg',130, 87,15,'photo_3970660.html');
												thumbnails[3965131] = new thumbnail(3965131,'239611','Meander out to Sea','MeanderOutToSea5_thumb.jpg',130, 130,15,'photo_3965131.html');
												thumbnails[4270200] = new thumbnail(4270200,'239612','Steel Grey','_MG_4165pettgreyyell300s_thumb.jpg',130, 87,15,'photo_4270200.html');
												thumbnails[5472703] = new thumbnail(5472703,'309703','End of a Hard Day','_MG_5342_thumb.jpg',130, 87,15,'photo_5472703.html');
												thumbnails[5940572] = new thumbnail(5940572,'309675','','_MG_6583nails1_thumb.jpg',130, 87,15,'photo_5940572.html');
												thumbnails[3962416] = new thumbnail(3962416,'239612','Droplets','Droplets2_thumb.jpg',130, 87,15,'photo_3962416.html');
												thumbnails[3962430] = new thumbnail(3962430,'239611','Ebb and Flow','EbbandFlow1_thumb.jpg',130, 130,15,'photo_3962430.html');
												thumbnails[4270202] = new thumbnail(4270202,'239612','Splash','_MG_3002splash300s_thumb.jpg',130, 87,15,'photo_4270202.html');
												thumbnails[4273625] = new thumbnail(4273625,'239612','Domes','IMG_2138-2dome300_thumb.jpg',130, 87,15,'photo_4273625.html');
												thumbnails[5472708] = new thumbnail(5472708,'309703','Furrows','_MG_5420_thumb.jpg',130, 87,15,'photo_5472708.html');
												thumbnails[4270695] = new thumbnail(4270695,'239612','Poppies and Bee','_MG_3741poppies300sdesat_thumb.jpg',130, 87,15,'photo_4270695.html');
												thumbnails[3962432] = new thumbnail(3962432,'239611','Sands of Time','SandsofTime2_thumb.jpg',130, 130,15,'photo_3962432.html');
												thumbnails[4270214] = new thumbnail(4270214,'239612','Stormy Shelter','IMG_5574lone-shed300_thumb.jpg',130, 87,15,'photo_4270214.html');
												thumbnails[5472712] = new thumbnail(5472712,'309703','Tractor','_MG_5458hpfx_thumb.jpg',130, 87,15,'photo_5472712.html');
												thumbnails[5472751] = new thumbnail(5472751,'309703','Milk Urns','_MG_6384_thumb.jpg',130, 195,15,'photo_5472751.html');
												thumbnails[7683855] = new thumbnail(7683855,'309675','','_MG_1378pop_thumb.jpg',130, 87,15,'photo_7683855.html');
												thumbnails[5472758] = new thumbnail(5472758,'309703','The Haybarn','_MG_5379fxr_thumb.jpg',130, 195,15,'photo_5472758.html');
												thumbnails[5472763] = new thumbnail(5472763,'309703','Take Flight','_MG_5620_thumb.jpg',130, 195,15,'photo_5472763.html');
												thumbnails[3962424] = new thumbnail(3962424,'239612','Rainy Day','RainyDay1_thumb.jpg',130, 130,15,'photo_3962424.html');
												thumbnails[3965319] = new thumbnail(3965319,'239611','Mists of Time','7791lit-Editstandalone_thumb.jpg',130, 130,15,'photo_3965319.html');
												thumbnails[5505716] = new thumbnail(5505716,'309675','','_MG_9360_thumb.jpg',130, 87,15,'photo_5505716.html');
												thumbnails[3982182] = new thumbnail(3982182,'239612','Top of the Hill','windmill1631_thumb.jpg',130, 130,15,'photo_3982182.html');
												thumbnails[6154629] = new thumbnail(6154629,'309675','','_MG_00581_thumb.jpg',130, 195,15,'photo_6154629.html');
												thumbnails[4273790] = new thumbnail(4273790,'239612','Cuckmere Valley','Cuckmere300_thumb.jpg',130, 87,15,'photo_4273790.html');
												thumbnails[5472726] = new thumbnail(5472726,'309703','Three Trees','_MG_5650chnls_thumb.jpg',130, 87,15,'photo_5472726.html');
												thumbnails[3965089] = new thumbnail(3965089,'239611','Little Soldiers','LittleSoldiers2_thumb.jpg',130, 130,15,'photo_3965089.html');
												thumbnails[3965248] = new thumbnail(3965248,'239611','Standing Alone','Standingalonelit_thumb.jpg',130, 130,15,'photo_3965248.html');
												thumbnails[5472428] = new thumbnail(5472428,'309675','','IMG_Mo-Howdee4016a2_thumb.jpg',130, 130,15,'photo_5472428.html');
												thumbnails[5472729] = new thumbnail(5472729,'309703','Gnarled','_MG_5682_thumb.jpg',130, 87,15,'photo_5472729.html');
												thumbnails[5969943] = new thumbnail(5969943,'309675','','_MG_6876mz_thumb.jpg',130, 87,15,'photo_5969943.html');
												thumbnails[3962444] = new thumbnail(3962444,'239611','Storm Clouds','StormClouds1_thumb.jpg',130, 130,15,'photo_3962444.html');
												thumbnails[4362106] = new thumbnail(4362106,'239612','Warm Glow','_MG_2982biglog_thumb.jpg',130, 87,15,'photo_4362106.html');
												thumbnails[7683867] = new thumbnail(7683867,'309675','','finn3-1_thumb.jpg',130, 130,15,'photo_7683867.html');
												thumbnails[6154635] = new thumbnail(6154635,'309675','','_MG_0023glow_thumb.jpg',130, 195,15,'photo_6154635.html');
												thumbnails[3964957] = new thumbnail(3964957,'239611','Independence','Independence4_thumb.jpg',130, 130,15,'photo_3964957.html');
												thumbnails[4567630] = new thumbnail(4567630,'239612','The Lighthouse','_MG_5634lighthouse1_thumb.jpg',130, 87,15,'photo_4567630.html');
												thumbnails[5599382] = new thumbnail(5599382,'309703','coppicing','_MG_9500_thumb.jpg',130, 87,15,'photo_5599382.html');
												thumbnails[5940426] = new thumbnail(5940426,'309675','','_MG_6891eve_thumb.jpg',130, 195,15,'photo_5940426.html');
												thumbnails[6154601] = new thumbnail(6154601,'309675','','_MG_0125bw_thumb.jpg',130, 195,15,'photo_6154601.html');
												thumbnails[4567732] = new thumbnail(4567732,'239612','Haybales','_MG_5470big_thumb.jpg',130, 68,15,'photo_4567732.html');
												thumbnails[5504722] = new thumbnail(5504722,'309675','','_MG_9202-3_thumb.jpg',130, 87,15,'photo_5504722.html');
												thumbnails[5970282] = new thumbnail(5970282,'309675','','_MG_6865mz22_thumb.jpg',130, 87,15,'photo_5970282.html');
												thumbnails[6154643] = new thumbnail(6154643,'309675','','_MG_0052_thumb.jpg',130, 87,15,'photo_6154643.html');
												thumbnails[3971085] = new thumbnail(3971085,'239611','Simple Pleasures','4302barney_thumb.jpg',130, 130,15,'photo_3971085.html');
												thumbnails[4625748] = new thumbnail(4625748,'239612','Lazy Summer Afternoons','_MG_5627fx2web1_thumb.jpg',130, 87,15,'photo_4625748.html');
												thumbnails[5599387] = new thumbnail(5599387,'309703','warm breath','_MG_9844-1_thumb.jpg',130, 87,15,'photo_5599387.html');
												thumbnails[3965842] = new thumbnail(3965842,'239611','Lone Shed','IMG_5574lone-shedfxlit_thumb.jpg',130, 130,15,'photo_3965842.html');
												thumbnails[3965791] = new thumbnail(3965791,'239611','Lighthouse','IMG_4371lighthouse-1_thumb.jpg',130, 130,15,'photo_3965791.html');
												thumbnails[5599552] = new thumbnail(5599552,'309703','Potato crop','_MG_6361-2_thumb.jpg',130, 183,15,'photo_5599552.html');
												thumbnails[5599554] = new thumbnail(5599554,'309703','Helping hand','_MG_6422_thumb.jpg',130, 87,15,'photo_5599554.html');
												thumbnails[4270275] = new thumbnail(4270275,'239611','Barren','IMG_5582redfx300_thumb.jpg',130, 87,15,'photo_4270275.html');
												thumbnails[5820707] = new thumbnail(5820707,'309703','Shearing','_MG_1989cweb1_thumb.jpg',130, 87,15,'photo_5820707.html');
												thumbnails[6154552] = new thumbnail(6154552,'309675','','_MG_0141_thumb.jpg',130, 195,15,'photo_6154552.html');
												thumbnails[4567791] = new thumbnail(4567791,'239612','Harbour Arm','_MG_4821-1lite5_thumb.jpg',130, 87,15,'photo_4567791.html');
												thumbnails[4567931] = new thumbnail(4567931,'239612','Bulverhythe','_MG_4239-3_thumb.jpg',130, 87,15,'photo_4567931.html');
												thumbnails[5691991] = new thumbnail(5691991,'309703','Potato Crop','_MG_5120pc2_thumb.jpg',130, 87,15,'photo_5691991.html');
												thumbnails[4276467] = new thumbnail(4276467,'239611','Brighton Pier','_MG_8278brightonpier300-L_thumb.jpg',130, 87,15,'photo_4276467.html');
												thumbnails[4275887] = new thumbnail(4275887,'239611','8 Ball','8ball-300_50581_thumb.jpg',130, 87,15,'photo_4275887.html');
												thumbnails[5691994] = new thumbnail(5691994,'309703','Open Door','_MG_9764od2_thumb.jpg',130, 87,15,'photo_5691994.html');
												thumbnails[5840441] = new thumbnail(5840441,'309703','checkin\'','_MG_1834-2bweb_thumb.jpg',130, 87,15,'photo_5840441.html');
												thumbnails[5840444] = new thumbnail(5840444,'309703','marking the pairs','_MG_3250web_thumb.jpg',130, 87,15,'photo_5840444.html');
												thumbnails[5692026] = new thumbnail(5692026,'309703','Sundown','_MG_5646sd_thumb.jpg',130, 87,15,'photo_5692026.html');
												thumbnails[5692199] = new thumbnail(5692199,'309703','Bertie','_MG_7685-1_thumb.jpg',130, 87,15,'photo_5692199.html');
												thumbnails[5692266] = new thumbnail(5692266,'309703','Clean Bedding','_MG_1442_thumb.jpg',130, 87,15,'photo_5692266.html');
												thumbnails[5970346] = new thumbnail(5970346,'309675','','_MG_6526z_thumb.jpg',130, 130,15,'photo_5970346.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[239611] = new gallery(239611,'3965319','Coastal Monochrome','gallery',[3964814,3965131,3962430,3962432,3965319,3965089,3965248,3962444,3964957,3971085,3965842,3965791,4270275,4276467,4275887],0, 0, '', 'gallery_239611.html',0,0);
				  					galleries[239612] = new gallery(239612,'4270186,3982182','Landscape','gallery',[3965698,4270186,3970660,4270200,3962416,4270202,4273625,4270695,4270214,3962424,3982182,4273790,4362106,4567630,4567732,4625748,4567791,4567931],0, 0, '', 'gallery_239612.html',0,0);
				  					galleries[309675] = new gallery(309675,'7683867,7683855,6154643,6154635,6154629,6154601,6154552,5970346,5970282,5969957','Portraits','gallery',[5969957,5940572,7683855,5505716,6154629,5472428,5969943,7683867,6154635,5940426,6154601,5504722,5970282,6154643,6154552,5970346],0, 0, '', 'gallery_309675.html',0,0);
				  					galleries[309703] = new gallery(309703,'5840444,5840441,5820707,5692266,5692199,5692026,5691994,5691991,5599554,5599552','Farm','gallery',[5472699,5472703,5472708,5472712,5472751,5472758,5472763,5472726,5472729,5599382,5599387,5599552,5599554,5820707,5691991,5691994,5840441,5840444,5692026,5692199,5692266],0, 0, '', 'gallery_309703.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '3965248';
imageSets[2] = '4270186,3982182,3965319';
imageSets[3] = '7683867,7683855,6154643,6154635,6154629,6154601,6154552,5970346,5970282,5969957,5969943,5940572,5940426,5840444,5840441,5820707,5692266,5692199,5692026,5691994,5691991,5599554,5599552,5599387,5599382,5505716,5504722,5472763,5472758,5472751,5472729,5472726,5472712,5472708,5472703,5472699,5472428,4625748,4567931,4567791,4567732,4567630,4362106,4276467,4275887,4273790,4273625,4270695,4270275,4270214';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/karenr/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/karenr/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/karenr/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/karenr/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/karenr/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/karenr/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/karenr/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/karenr/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/karenr/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/karenr/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/karenr/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/karenr/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/karenr/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/karenr/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/karenr/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/karenr/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/karenr/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/karenr/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/karenr/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/karenr/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/karenr/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/karenr/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 = 'Karen Rooney LRPS Photography: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
	    var options = {};	    	      	      resizePhotoInfo(options);
        if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(backgrounds);
  	    } else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(photos);
  	    }
	    });
    }
        if (!op.speed) {      clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));      $('body').trigger('clikUpdate');    }        
    return html;			}
	else {
				
		window.location = 'photo_' + nextPhoto.id + '.html';
	}
		
}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array){
  if (typeof(array) !== 'object') {
    array = photos;
  }
	if($('#paymentConfirm').length > 0){
		$('#paymentConfirm').hide();
		$('#paymentAddButton')
		.unbind()
		.click(function(){
						form = document.getElementById('paymentForm');
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm').text('Item added to cart').show();}
				else{
					$('#paymentConfirm').text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm').text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}
/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp = temp +  '<p id="imageDescription">' + this.description + '</p>';
	}
		if (this.photo_ref != '') {
		temp = temp + '<p class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</p>';
	}
		if (this.takendate != '') {
				
		temp = temp + '<p class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</p>';
	}
	
	if (this.location != '') {
				
		temp = temp + '<p class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</p>';
	}
	
	if (this.photographer != '') {
				
		temp = temp + '<p class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</p>';
	}
					
				if (temp != '') {
		temp = temp + '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp = temp + '<p>Order this print:</p>';
				temp = temp + '<p class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> ' + (this.item_price).toFixed(2) + '</p>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
	else if (this.payment_groups_id !== '') {
		temp = temp + '<p>Buy this print online:</p>';
				temp = temp + '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
											temp = temp + '<select class="paymentlink" name="payment_options_id" onchange="updateItemValues(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
				
		temp = temp + getPaymentOptions(this.payment_groups_id);
		temp = temp + '</select>';
		temp = temp + '</form>';
				var item_option  = paymentGroups[this.payment_groups_id].options[0];
		if(paymentOptions[item_option]){
			var item_name  = paymentOptions[item_option].payment_option;
			var amount =  paymentOptions[item_option].price;
		}
			}
	else {
				
	}
	if (this.item_price !== '' || this.payment_groups_id !== '') {
			temp = temp + '<div class="clearing">&nbsp;</div>';
	}
	return temp;};

/***************************************************************************
* Pick a photo at random from the featured images of a gallery.            *
* Gallery_id = id of gallery to choose,                                    *
* img = reference to html image in                                         *
* which to show image                                                      *
***************************************************************************/
function showGalleryImage(gallery_id, img, updateLink) {
		
	if(img){
	      if (location.hash.match('galleries_id=' + gallery_id) && (imageID = location.hash.match('.*photos_id=(.+)$'))) {
        imageID = imageID[1];
      } else {
			  imageID = randomListVal(galleries[gallery_id].featured_images);
      }
							
			if (imageID != 0) {
				img.src = thumbnails[imageID].src;
				img.width = thumbnails[imageID].width;
				img.height = thumbnails[imageID].height;
				img.alt = galleries[gallery_id].title;
        if (updateLink) {
          $(img).parent().attr({            href: thumbnails[imageID].fnGalleryLink(gallery_id),            title: galleries[gallery_id].title          });
        }
							}
										}
}

/***************************************************************************
* If we have dynamic HTML, replace the galleries link with a list that     *
* doesn't include thecurrent gallery                                       *
***************************************************************************/
function showGalleries(gallery_id) {
		
	
	if (!basic) {
		temp = '';
		for (i = 0; i < galleries.length; i++) {
						
			
			if (galleries[i].id != gallery_id) {
								
				if (temp != '') {
					temp = temp + ' | ';
				}
				temp = temp + '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
			}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

