window.thumbnails = {};
															thumbnails[3327113] = clik.newPhoto({"id":3327113,"src":"1_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"Cortijo Los Arrendajos","height":87});
															thumbnails[3343873] = clik.newPhoto({"id":3343873,"src":"Spain Jan&Helen march 2008 0802_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"Garcia Lorca's Park, Granada","height":97});
															thumbnails[3343903] = clik.newPhoto({"id":3343903,"src":"DSC00351_thumb.JPG","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"Looking Down at Algarinejo","height":97});
															thumbnails[3343952] = clik.newPhoto({"id":3343952,"src":"Spain Jan&Helen march 2008 049_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"Looking up at Montefrio's old church","height":96});
															thumbnails[3355289] = clik.newPhoto({"id":3355289,"src":"location-map copy_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":110});
															thumbnails[8914915] = clik.newPhoto({"id":8914915,"src":"15_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"Autumn fiesta in Montefrio","height":87});
															thumbnails[3331232] = clik.newPhoto({"id":3331232,"src":"101_thumb.jpg","galleries_id":202618,"server_id":15,"link":"photo_3331232.html","width":130,"caption":"Pool fun","height":98});
															thumbnails[3331240] = clik.newPhoto({"id":3331240,"src":"13_thumb.jpg","galleries_id":202619,"server_id":15,"link":"photo_3331240.html","width":130,"caption":"Looking up at the house from the bottom gate","height":98});
															thumbnails[3335258] = clik.newPhoto({"id":3335258,"src":"32_thumb.jpg","galleries_id":202705,"server_id":15,"link":"photo_3335258.html","width":130,"caption":" Iglesia De La Villa","height":94});
															thumbnails[8911901] = clik.newPhoto({"id":8911901,"src":"3_thumb.jpg","galleries_id":202618,"server_id":15,"link":"photo_8911901.html","width":130,"caption":"The terrace","height":87});
															thumbnails[3331235] = clik.newPhoto({"id":3331235,"src":"21_thumb.jpg","galleries_id":202618,"server_id":15,"link":"photo_3331235.html","width":130,"caption":"The terrace with the Chanzas mountains in the background.","height":87});
															thumbnails[3331417] = clik.newPhoto({"id":3331417,"src":"12_thumb.jpg","galleries_id":202619,"server_id":15,"link":"photo_3331417.html","width":130,"caption":"Looking south from the pool   in early summer.","height":98});
															thumbnails[3335259] = clik.newPhoto({"id":3335259,"src":"33_thumb.jpg","galleries_id":202705,"server_id":15,"link":"photo_3335259.html","width":130,"caption":"Montefrio","height":180});
															thumbnails[3791592] = clik.newPhoto({"id":3791592,"src":"DSC00607_thumb.JPG","galleries_id":202618,"server_id":15,"link":"photo_3791592.html","width":130,"caption":" A perfect holiday","height":98});
															thumbnails[3331243] = clik.newPhoto({"id":3331243,"src":"4_thumb.jpg","galleries_id":202618,"server_id":15,"link":"photo_3331243.html","width":130,"caption":"Outdoor table for eating in the shade","height":87});
															thumbnails[3331419] = clik.newPhoto({"id":3331419,"src":"28_thumb.jpg","galleries_id":202619,"server_id":15,"link":"photo_3331419.html","width":130,"caption":"Outside the fence but on Cortijo Los Arrendajos ground.","height":98});
															thumbnails[3336380] = clik.newPhoto({"id":3336380,"src":"36_thumb.JPG","galleries_id":202705,"server_id":15,"link":"photo_3336380.html","width":130,"caption":"La Iglesia de la Encarnacion","height":173});
															thumbnails[3331247] = clik.newPhoto({"id":3331247,"src":"11_thumb.jpg","galleries_id":202618,"server_id":15,"link":"photo_3331247.html","width":130,"caption":"The Sitting Room","height":87});
															thumbnails[3331424] = clik.newPhoto({"id":3331424,"src":"291_thumb.jpg","galleries_id":202619,"server_id":15,"link":"photo_3331424.html","width":130,"caption":"Goats playing on the ruins","height":98});
															thumbnails[3335260] = clik.newPhoto({"id":3335260,"src":"34_thumb.JPG","galleries_id":202705,"server_id":15,"link":"photo_3335260.html","width":130,"caption":"Montefrio","height":173});
															thumbnails[4311885] = clik.newPhoto({"id":4311885,"src":"DSC00776_816_x_612_thumb.jpg","galleries_id":202705,"server_id":15,"link":"photo_4311885.html","width":130,"caption":"Eating out","height":98});
															thumbnails[3331258] = clik.newPhoto({"id":3331258,"src":"12_2BE7C17A-1E4F-37DC-71D0963D5367EB01_thumb.jpg","galleries_id":202618,"server_id":15,"link":"photo_3331258.html","width":130,"caption":"The dining area","height":87});
															thumbnails[3331442] = clik.newPhoto({"id":3331442,"src":"DSC00476_thumb.JPG","galleries_id":202619,"server_id":15,"link":"photo_3331442.html","width":130,"caption":"Grazing ponies","height":98});
															thumbnails[3335262] = clik.newPhoto({"id":3335262,"src":"44_thumb.JPG","galleries_id":202705,"server_id":15,"link":"photo_3335262.html","width":130,"caption":"Rock climbing","height":98});
															thumbnails[8914923] = clik.newPhoto({"id":8914923,"src":"18_thumb.jpg","galleries_id":202705,"server_id":15,"link":"photo_8914923.html","width":130,"caption":"Fiesta de Muestras in Montefrio","height":195});
															thumbnails[8914949] = clik.newPhoto({"id":8914949,"src":"19_thumb.jpg","galleries_id":202705,"server_id":15,"link":"photo_8914949.html","width":130,"caption":"Free tapas!","height":98});
															thumbnails[8927143] = clik.newPhoto({"id":8927143,"src":"15_D193FE74-1EC9-DFB6-09E350AF9D313582_thumb.jpg","galleries_id":202705,"server_id":15,"link":"photo_8927143.html","width":130,"caption":"Autumn Fiesta in Montefrio","height":87});
															thumbnails[9012033] = clik.newPhoto({"id":9012033,"src":"Semana_Santa_in_Montefrio_thumb.jpg","galleries_id":202705,"server_id":15,"link":"photo_9012033.html","width":130,"caption":"Easter Week Procession in Montefrio","height":98});
															thumbnails[3331267] = clik.newPhoto({"id":3331267,"src":"13_F8078BA3-24E8-5EC4-4F5CBC964F79B892_thumb.jpg","galleries_id":202618,"server_id":15,"link":"photo_3331267.html","width":130,"caption":"Looking into the kitchen","height":87});
															thumbnails[3331439] = clik.newPhoto({"id":3331439,"src":"39_thumb.jpg","galleries_id":202619,"server_id":15,"link":"photo_3331439.html","width":130,"caption":"Poppies","height":93});
															thumbnails[3335265] = clik.newPhoto({"id":3335265,"src":"48_thumb.jpg","galleries_id":202705,"server_id":15,"link":"photo_3335265.html","width":130,"caption":"Aquaola Water Park","height":137});
															thumbnails[3331270] = clik.newPhoto({"id":3331270,"src":"14_thumb.jpg","galleries_id":202618,"server_id":15,"link":"photo_3331270.html","width":130,"caption":"The bathroom.","height":195});
															thumbnails[3331415] = clik.newPhoto({"id":3331415,"src":"02_thumb.jpg","galleries_id":202619,"server_id":15,"link":"photo_3331415.html","width":130,"caption":"Cortijo Los Arrendajos","height":98});
															thumbnails[3338936] = clik.newPhoto({"id":3338936,"src":"Sept 2007 097_thumb.jpg","galleries_id":202705,"server_id":15,"link":"photo_3338936.html","width":130,"caption":"The Alhambra Palace, Granada","height":73});
															thumbnails[3335270] = clik.newPhoto({"id":3335270,"src":"521_thumb.jpg","galleries_id":202705,"server_id":15,"link":"photo_3335270.html","width":130,"caption":"Inside the Alhambra","height":98});
															thumbnails[3339439] = clik.newPhoto({"id":3339439,"src":"Spain Jan&Helen march 2008 089_thumb.jpg","galleries_id":202705,"server_id":15,"link":"photo_3339439.html","width":130,"caption":"The Science Park in Granada","height":266});
															thumbnails[5315712] = clik.newPhoto({"id":5315712,"src":"A_street_in_Antequera_thumb.jpg","galleries_id":202705,"server_id":15,"link":"photo_5315712.html","width":130,"caption":"A street in Antequera.","height":98});
															thumbnails[5315737] = clik.newPhoto({"id":5315737,"src":"View_from_Antequera_Castillo_thumb.jpg","galleries_id":202705,"server_id":15,"link":"photo_5315737.html","width":130,"caption":"The Castle at Antequera","height":173});
															thumbnails[5315771] = clik.newPhoto({"id":5315771,"src":"El_Torcal_rock_formation_thumb.jpg","galleries_id":202705,"server_id":15,"link":"photo_5315771.html","width":130,"caption":"El Torcal Natural Park, near Antequera.","height":98});
															thumbnails[3335274] = clik.newPhoto({"id":3335274,"src":"572_thumb.jpg","galleries_id":202705,"server_id":15,"link":"photo_3335274.html","width":130,"caption":"The Donkey Sanctuary","height":98});
															thumbnails[3335280] = clik.newPhoto({"id":3335280,"src":"61_thumb.jpg","galleries_id":202705,"server_id":15,"link":"photo_3335280.html","width":130,"caption":"The Flamingo Lake","height":98});
															thumbnails[3335365] = clik.newPhoto({"id":3335365,"src":"63_thumb.jpg","galleries_id":202705,"server_id":15,"link":"photo_3335365.html","width":130,"caption":"The Lobopark","height":152});
															thumbnails[3335385] = clik.newPhoto({"id":3335385,"src":"Dec 2006 0081_thumb.jpg","galleries_id":202705,"server_id":15,"link":"photo_3335385.html","width":130,"caption":"Sevilla","height":173});
															thumbnails[3335273] = clik.newPhoto({"id":3335273,"src":"Dec 2006 028_thumb.jpg","galleries_id":202705,"server_id":15,"link":"photo_3335273.html","width":130,"caption":"Seville","height":173});
															thumbnails[3335371] = clik.newPhoto({"id":3335371,"src":"Dec 2006 056_thumb.jpg","galleries_id":202705,"server_id":15,"link":"photo_3335371.html","width":130,"caption":"Granada and the Sierra Nevada","height":98});
															thumbnails[9009922] = clik.newPhoto({"id":9009922,"src":"Summer_Fiesta_Sevillana_thumb.jpg","galleries_id":202705,"server_id":15,"link":"photo_9009922.html","width":130,"caption":"Traditional Sevillana dresses","height":95});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[202618] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Accommodation","link":"gallery_202618.html","maxRecords":0.0,"photoIDs":[3331232.0,8911901.0,3331235.0,3791592.0,3331243.0,3331247.0,3331258.0,3331267.0,3331270.0],"skipIndex":0,"section_code":"gallery","featured_images":3331235.0,"id":202618,"singleSection":false});				  						galleries[202619] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Immediate Surroundings","link":"gallery_202619.html","maxRecords":0.0,"photoIDs":[3331240.0,3331417.0,3331419.0,3331424.0,3331442.0,3331439.0,3331415.0],"skipIndex":0,"section_code":"gallery","featured_images":3331240.0,"id":202619,"singleSection":false});				  						galleries[202705] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Local Interests and Activities","link":"gallery_202705.html","maxRecords":0.0,"photoIDs":[3335258.0,3335259.0,3336380.0,3335260.0,4311885.0,3335262.0,8914923.0,8914949.0,8927143.0,9012033.0,3335265.0,3338936.0,3335270.0,3339439.0,5315712.0,5315737.0,5315771.0,3335274.0,3335280.0,3335365.0,3335385.0,3335273.0,3335371.0,9009922.0],"skipIndex":0,"section_code":"gallery","featured_images":3335258.0,"id":202705,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '3327113';
imageSets[2] = '3335258,3331240,3331235';
imageSets[3] = '4311885';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/gbandlmg/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/gbandlmg/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/gbandlmg/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/gbandlmg/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/gbandlmg/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/gbandlmg/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/gbandlmg/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/gbandlmg/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/gbandlmg/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/gbandlmg/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/gbandlmg/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/gbandlmg/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/gbandlmg/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/gbandlmg/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/gbandlmg/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/gbandlmg/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/gbandlmg/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/gbandlmg/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/gbandlmg/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/gbandlmg/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/gbandlmg/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/gbandlmg/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/gbandlmg/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/gbandlmg/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/gbandlmg/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/gbandlmg/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/gbandlmg/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 || photos || {})[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:'',$detailContainer:'',
                    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 (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
	}
		
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'Cortijo Los Arrendajos: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		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.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			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', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.photo_ref != '') {
		temp += '<div class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</div>';
	}
		if (this.takendate != '') {
		
		temp += '<div class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</div>';
	}
	
	if (this.location != '') {
		
		temp += '<div class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</div>';
	}
				
				if (temp != '') {
		temp += '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp += '<p>Order this print:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> ' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
		else {
		
	}
	if (this.item_price !== '') {
			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({					title: galleries[gallery_id].title				}).filter(function(){return this.href;}).attr({					href: thumbnails[imageID].fnGalleryLink(gallery_id)				});
			}
		}
	}
}

/***************************************************************************
* 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 += '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
							}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

