startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}
window.onload=startList;




function DivSetVisible(state)
  {
   var DivRef = document.getElementById('PopupDiv');
   var IfrRef = document.getElementById('DivShim');
   if(state)
   {
    DivRef.style.display = "block";
    IfrRef.style.width = DivRef.offsetWidth;
    IfrRef.style.height = DivRef.offsetHeight;
    IfrRef.style.top = DivRef.style.top;
    IfrRef.style.left = DivRef.style.left;
    IfrRef.style.zIndex = DivRef.style.zIndex - 1;
    IfrRef.style.display = "block";
   }
   else
   {
    DivRef.style.display = "none";
    IfrRef.style.display = "none";
   }
  }



function Div2SetVisible(state)
  {
   var DivRef = document.getElementById('PopupDiv2');
   var IfrRef = document.getElementById('DivShim2');
   if(state)
   {
    DivRef.style.display = "block";
    IfrRef.style.width = DivRef.offsetWidth;
    IfrRef.style.height = DivRef.offsetHeight;
    IfrRef.style.top = DivRef.style.top;
    IfrRef.style.left = DivRef.style.left;
    IfrRef.style.zIndex = DivRef.style.zIndex - 1;
    IfrRef.style.display = "block";
   }
   else
   {
    DivRef.style.display = "none";
    IfrRef.style.display = "none";
   }
  }



var newwindow;
function newwin(url)
{
	newwindow=window.open(url,'name','left=40,top=40,toolbar=1,location=1,scrollbars=1,resizable=1,height=500,width=700');
	if (window.focus) {newwindow.focus()}
}




function trim(str)
{
   return str.replace(/^\s*|\s*$/g,"");
}




function askwlplvalidate() {
emailaddr=askwlpl.emailaddr.value;
phone=askwlpl.phonenum.value;
emailaddr=trim(emailaddr);
phone=trim(phone);


if (emailaddr=='' && phone=='') {
alert('Please enter either an email address or a phone number so that a librarian can respond to your inquiry.');
event.returnValue=false;
}
}



function reqmatvalidate() {
emailaddr=reqmat.emailaddr.value;
phonenum=reqmat.phonenum.value;
realname=reqmat.realname.value;
libcard=reqmat.libcard.value;
emailaddr=trim(emailaddr);
phonenum=trim(phonenum);
realname=trim(realname);
libcard=trim(libcard);

if (emailaddr=='' && phonenum=='' && realname=='' && libcard=='') {
//	alert('oops');
	
	var godlg = confirm("You have not provided any contact information (email address, phone number, name, or library card number).\n\n" + 
	"Without any of this information, a library staff member will not be able to contact you regarding your request.\n\n" +
	"Are you sure you want to submit your request without providing any contact information?");
	if (godlg == true) {
		event.returnValue=true;
	} else {
		event.returnValue=false;
	}
}

}

