// Set up the image files to be used.

function showImage(){
var whichImage = Math.round(Math.random()*7);

if (whichImage == 1)
{ whichImage=14}
else if (whichImage == 0)
{ whichImage=3}
else if (whichImage == 2)
{ whichImage=5}
else if (whichImage == 3)
{ whichImage=1}
else if (whichImage == 4)
{ whichImage=65}
else if (whichImage == 5)
{ whichImage=56}
else 
{whichImage = (whichImage * 10)}

document.write('<BR><center><table width="100%"><tr>');
document.write('<td><a href="trawnish-gallery/page0001.html" target="_self"><img src="trawnish-gallery/thumbs/Image' + whichImage + '_tmbn.jpg" border=0 hspace=5 alt="A selection of images from the Trawnish Gallery, click the image to open the Gallery"></a></td>');
document.write('<td><a href="trawnish-gallery/page0001.html" target="_self"><img src="trawnish-gallery/thumbs/Image' + (whichImage + 1) + '_tmbn.jpg" border=0 hspace=5 alt="A selection of images from the Trawnish Gallery, click the image to open the Gallery"></a></td>');
document.write('<td><a href="trawnish-gallery/page0001.html" target="_self"><img src="trawnish-gallery/thumbs/Image' + (whichImage + 2) + '_tmbn.jpg" border=0 hspace=5 alt="A selection of images from the Trawnish Gallery, click the image to open the Gallery"></a></td>');
document.write('<td><a href="trawnish-gallery/page0001.html" target="_self"><img src="trawnish-gallery/thumbs/Image' + (whichImage + 3) + '_tmbn.jpg" border=0 hspace=5 alt="A selection of images from the Trawnish Gallery, click the image to open the Gallery"></a></td>');
document.write('<td><a href="trawnish-gallery/page0001.html" target="_self"><img src="trawnish-gallery/thumbs/Image' + (whichImage + 4) + '_tmbn.jpg" border=0 hspace=5 alt="A selection of images from the Trawnish Gallery, click the image to open the Gallery"></a></td>');
document.write('</tr></table></center>');

}

function ZoomPic(urlname,setting,widt,hite){
  if (setting=='L'){
    widt2=505
	hite2=390
	win=1
  }
  if (setting=='P'){
    widt2=390
	hite2=505
	win=2
  }
    if (setting=='O'){
    widt2=widt
	hite2=hite
	win=3
  }
  popup2=window.open(urlname,'popup'+win,"Width="+widt2+",Height="+hite2+",statusbar=no,menubar=no,toolbar=no,resizable=no");
  popup2.focus();
}

function changetop(){
var whichPic = Math.round(Math.random()*8);
var whichTop = '';
var titletext = new Array();

titletext[0] = '<BR><BR><BR>Beautiful summer flowers on the steps of Trawnish Lodge';
titletext[1] = '<BR><BR><BR>Trawnish Lodge is a cosy and comfortable cedar-wood cabin set in an area of outstanding natural beauty, and is a truly tranquil retreat';
titletext[2] = '<BR><BR><BR>Trawnish Lodge is a cosy and comfortable cedar-wood cabin set in an area of outstanding natural beauty, with serene and calming surroundings in all seasons';
titletext[3] = '<BR><BR><BR><BR><BR>Trawnish Lodge is a cosy and comfortable cedar-wood cabin set in an area of outstanding natural beauty, and has an amazing 180 degree view all year round';
titletext[4] = '<BR><BR><BR>Trawnish Lodge is set in an area of outstanding natural beauty';
titletext[5] = '<BR><BR><BR><BR>Situated on the shore of the atmospheric Lough McNean, Trawnish Lodge is a tranquil retreat';
titletext[6] = '<BR><BR><BR>The spectacular view from the front porch of Trawnish Lodge on an Autumn evening';
titletext[7] = '<BR><BR><BR><BR><BR>Relax and experience the great fishing of Lough McNean whilst staying at Trawnish Lodge';
titletext[8] = '<BR><BR><BR>Enjoy the tranquil scenery from Trawnish Lodge on the shores of Lough McNean';

if (whichPic==0) {
var whichTop = 'mainpage';
}
else
{
whichTop = 'mainpage'+whichPic;
}
document.getElementById('mainpage').className=whichTop;
document.getElementById('bgtitle').innerHTML=titletext[whichPic];

}

// BOOKMARK

/* Modified to support Opera */
function bookmarksite(title,url){
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}

// SLIDE SCRIPT javascript-better-hideshow-with-slide-effect

			function element(id)
			{
				return document.getElementById(id);
			}
			
			function ToggleDiv(name)
			{
				var el = element(name);
				var cond = ((el.style.display == 'block') || (el.style.display == ''));
				if (cond) 
				{
					el.style.display = 'none';
				}
				else 
				{
					el.style.display = 'block';
				}
			}
			
			function FoldSection(contentsId)
			{
				var contentsElement = element(contentsId);
				if (contentsElement.style.display == 'none')
				{
					TransitionShowNode(contentsElement, 'block');
				}
				else if (contentsElement.style.display == 'block' || contentsElement.style.display == '')
				{
					TransitionHideNode(contentsElement, 'none');
				}
			}

			function SlideElement(elementId, show)
			{
				var slideSpeed = 10;
				var slideTimer = 10;
				
				var contents = element(elementId);
				var contents_inner = element(elementId + "_inner");
				var height = contents.clientHeight;
if (height == 0){
height = contents.offsetHeight;
contents.style.display = 'block';
}

				height = height + (show ? slideSpeed : -slideSpeed);
				
				var rerun = true;
				if (height >= contents_inner.offsetHeight)
				{
					height = contents_inner.offsetHeight;
					rerun = false;
				}
				else if (height <= 1)
				{
					height = 1;
					rerun = false;
				}
				
				contents.style.height = height + 'px';
				var topPos = height - contents_inner.offsetHeight;
				if (topPos > 0)
				{
					topPos = 0;
				}
				contents_inner.style.top = topPos + 'px';
				
				if (rerun)
				{
					setTimeout("SlideElement('" + elementId + "', " + show + ");", slideTimer);
				}
				else
				{
					if (height <= 1)
					{
						contents.style.display = 'none'; 

					}




				}
			}

			function TransitionHideNode(contents, destinationDisplay)
			{
				SlideElement(contents.id, false);

			}

			function TransitionShowNode(contents, destinationDisplay)
			{
				SlideElement(contents.id, true);
			}
