ns4=(document.layers)?true:false;
ie4=(document.all)?true:false;
ns6=(document.getElementById)?true:false;


function getObj(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}

var menu;
var theTop='';
var old='';

function init(foo)
    {
	menu = new getObj('lmen');
theTop = foo;
old = theTop;
	movemenu();
    }

function movemenu()
    {
	if (window.innerHeight)
	{
    pos = window.pageYOffset
	}
	else if(document.documentElement && document.documentElement.scrollTop)
	{
	pos = document.documentElement.scrollTop
	}
	else if(document.body)
	{
    pos = document.body.scrollTop
	}
	if (pos < theTop) pos = theTop;
	else pos += 18;
	if (pos == old)
	{
    menu.style.top = pos;
	}
	old = pos;
	temp = setTimeout('movemenu()',300);
}

				  // RESIZER

function getWidth(){
alert("current window width is "+document.body.clientWidth);
}
function setWidth(w,h){
if (document.body.clientWidth > w)
window.resizeTo(w,h);
}


				// IMG ROLLOVER

function ion(img)
    {
    document.images[img].src=eval(img+"On.src");
    }

    function ioff(img)
    {
    document.images[img].src=eval(img+"Off.src");
    }

				// SHOW-HIDE

function show(id){
	if(ns4)
    {
	document.layers[id].visibility = "show";
	}
	else if(ie4){
	document.all[id].style.visibility = "visible";
	}
	else if(ns6){
	document.getElementById(id).style.visibility = "visible";
	}
}	
		
function hide(id){
	if(ns4) {
	document.layers[id].visibility = "hide";
	}
	if(ie4){
	document.all[id].style.visibility = "hidden";
	}
	if(ns6){
	document.getElementById(id).style.visibility = "hidden";
	}
}

				// WRITE TO LAYER 

	
function rite(id,fcolor,text){
	var fcolor="<font color="+fcolor+">";
	if(ns4){
		var lyr=document.layers[id].document;
		document.layers[id].visibility="show";
		lyr.open(); 
		lyr.write("<font face=arial size=2><b>"+fcolor+text+"</b></font></font>");
		lyr.close()	} 
	else if(ie4){
		var lyr= document.all[id];
		document.all[id].style.visibility="visible";
		lyr.innerHTML=("<font face=verdana,arial size=2>"+fcolor+text+"</font></font>");
		}	}


				// WRITE TO NEW WINDOW


function popUp(img,text){

var babe = window.open("","momma","width=440,height=440,scrollbars=1,resizable=1");

var html = "<html><head><title>Reef Adventureland Accomodation</title><style>p{font:bold 8pt verdana,helvetica;color:401000;line-height:160%;text-align:left;}</style></head><body background=back/roo3.gif><div align=center><img src="+img+" border=0><br><p>"+text+" &nbsp;<a href=javascript:window.close()>CLOSE</A></p></div></body></html>"

babe.document.open()
babe.document.write(html)
babe.document.close()
} 

				  // NS4 RESIZE-RELOAD

if (ns4)
     {
	 origWidth = innerWidth;
     origHeight = innerHeight;
     }
     function reDo() {
     if (innerWidth != origWidth || innerHeight != origHeight) 
     location.reload();
     }
	if (ns4) onresize = reDo;
