	var dir = location.href.substring(0,location.href.lastIndexOf('/')+1);
	var thefile = location.href.substring(dir.length,location.href.length+1);
	imagedir = "../images";

	if(document.images){
		reston 		= new Image(); reston.src= imagedir + "/b-rest-on.gif";
		restoff 	= new Image(); restoff.src= imagedir + "/b-rest-off.gif";
	   	
	 }
	 
function showMenu( fn ){
//*******************************************************************************
//	map fn parm to actual PDF name and display
//******************************************************************************* 		
 
 fn = "../download/" + fn;
 
 window.open(fn + ".pdf", "newwin", "width=800,height=760,scrollbars=yes,status=yes,resizable=yes");
 
}

function flipImg(imgNam,imgTyp,onoff){
//*******************************************************************************
//	Do the mouse over image flipping.
//******************************************************************************* 		
  	if(document.images){ 	
 		document.images[imgNam].src=eval(imgTyp+onoff+'.src');
  	}
}

function hoursWindow() {
//*******************************************************************************
//	Display a popup window 
//*******************************************************************************
	window.open("hours.html", "newwin", "width=420,height=760,scrollbars=yes,status=yes,resizable=yes");
} 

function setCookie(c_name,value,expiredays)
//*******************************************************************************
//	SET COOKIE  from http://www.w3schools.com/js/js_cookies.asp
//*******************************************************************************
{
	var exdate=new Date()
	exdate.setDate(exdate.getDate()+expiredays)
	document.cookie=c_name+ "=" +escape(value)+
	((expiredays==null) ? "" : ";expires="+exdate.toGMTString())
}

function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=")
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1 
    c_end=document.cookie.indexOf(";",c_start)
    if (c_end==-1) c_end=document.cookie.length
    return unescape(document.cookie.substring(c_start,c_end))
    } 
  }
return ""
} 

function get_random(pcount) {
    var ranNum= Math.round(Math.random()* pcount);
    return ranNum;
}	    

function NewWindow(mypage, myname, w, h, scroll) {
//*******************************************************************************
// Open new window
// <a href="page" onclick="NewWindow(this.href,'name','390','310','no');return false">link</a>
//*******************************************************************************	
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable,location'
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

 function spaceTrim(InString) {
//*******************************************************************************
// Trim leading and trailing spaces of form input fields
//*******************************************************************************
	var LoopCtrl=true;
	while (LoopCtrl) {
		if (InString.indexOf("  ") != -1) {
			Temp = InString.substring(0, InString.indexOf("  "))
			InString = Temp + InString.substring(InString.indexOf("  ")+1, 
				InString.length)
		} else
			LoopCtrl = false;
	}
	if (InString.substring(0, 1) == " ")
		InString = InString.substring(1, InString.length)
	if (InString.substring (InString.length-1) == " ")
		InString = InString.substring(0, InString.length-1)
	return (InString)
}


//* flag 0 = visible  1 = invisible  	//invi(0, "common");   //0 = make visible  1=make invisible	
function invi(flag, obj)
{
//	if (!DHTML) return;
	var x = new getObj(obj);
	x.style.visibility = (flag) ? 'hidden' : 'visible'
}	

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];
  }
} 