
var menuids=["sidebarmenu1"] //Enter id(s) of UL menus, separated by commas

function buildsubmenus(){
for (var i=0; i<menuids.length; i++){
  var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul") //get all the ul's inside each menu on the page
    for (var t=0; t<ultags.length; t++){
      ultags[t].parentNode.getElementsByTagName("a")[0].className+=" subfolderstyle"
if (ultags[t].parentNode.parentNode.id==menuids[i]) //if this is a first level submenu
ultags[t].style.left=ultags[t].parentNode.offsetWidth+"px" //dynamically position first level submenus to be width of main menu item
else //else if this is a sub level submenu (ul)
  ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px" //position menu to the right of menu item that activated it
   ultags[t].parentNode.onmouseover=function(e){
    //            hideAll();
   this.getElementsByTagName("ul")[0].isMouseOver=true;
   this.getElementsByTagName("ul")[0].style.display="block"
   //   hideAllOther(this);
if (this.getElementsByTagName("span")[0]) {this.getElementsByTagName("span")[0].filters.alpha.opacity = "100"};}
if(this.toref)
window.clearTimeout(this.toref);

ultags[t].parentNode.onmouseout=function(){
var saveref=this.getElementsByTagName("ul")[0];
saveref.isMouseOver=false;
if(this.toref)
window.clearTimeout(this.toref);
 
this.toref=window.setTimeout(function(e){
 
if(!saveref.isMouseOver)
saveref.style.display="none"
},290);
if (this.getElementsByTagName("span")[0]) {this.getElementsByTagName("span")[0].filters.alpha.opacity = "0"};}
}
for (var t=ultags.length-1; t>-1; t--){ 
  //loop through all sub menus again, and use "display:none" to hide menus (to prevent possible page scrollbars
ultags[t].style.visibility="visible"
ultags[t].style.display="none"
}
}
}

if (window.addEventListener)
   window.addEventListener("load", buildsubmenus, false)
else if (window.attachEvent)
   window.attachEvent("onload", buildsubmenus)

//anylink.js


function validate()
{
  if(document.search.word.value=='')
    {
      return false;
    }
  else
    {
      return true;
    }
}

function PopUrls(url, scroll)
{
var top;
var left;
var st;
var iScreenW;
var iScreenH;

    if(window.screen){
       iScreenW = screen.availWidth;
       iScreenH = screen.availHeight;
    }

   if(iScreenW == 640){
      top = 0;
      left = 0;
   }
   else {
     top =  ((iScreenW - 640)/2);      
     left = ((iScreenH - 400)/2);
   } 
   st = null; 
   st = "WIDTH=640, HEIGHT=400, BORDER=0, RESIZE=NO, MAXIMIZE=YES, MINIMIZE=YES, DIRECTORIES=NO, LOCATION=0, SCROLLBARS=YES, SCROLLING=YES, ";
   st = st + "TOP=" + top + ", LEFT=" + left;
   newwindow = window.open(url, "Company", st);
   if(window.focus) {newwindow.focus();}
/*   if(newwindow){
      newwindow.close();
   }   */
}  
function CloseNewWindows()
{
   if (newwindow){
       newwindow.Close();
       newwindow = null;
   }    
} 
    
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);
}
