// exit out of external frameset
if (parent.location != this.location) {
  parent.location.href = this.location.href
  }

// drop menu script for IE
startList = function() {
 if (document.all&&document.getElementById) {
  navRoot = document.getElementById("menus");
  for (i=0; i<navRoot.childNodes.length; i++) {
   node = navRoot.childNodes[i];
   if (node.nodeName=="LI") {
    node.onmouseover=function() {
     this.className+=" over";
     hideSelect(true);
    }
    node.onmouseout=function() {
     this.className=this.className.replace(" over", "");
     hideSelect(false);
    }
    if (node.lastChild.nodeName=="UL") {
     parentID = node.id;
     node.lastChild.onmouseover=function() {
      parentID.className+=" over";
      hideSelect(true);
     }
     node.lastChild.onmouseout=function() {
      parentID.className=node.className.replace(" over", "");
      hideSelect(false);
     }
    }
   }
  }
 }
}
window.onload=startList;

// hide items (<select> form elements primarily) from drop menus 
// so they will not show through the menus
function hideSelect(isOn) {
  if(navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4) {
    if (document.all.hideselect != null) {
      divs = document.all.hideselect;
      if (divs.length != null) {
        for (i = 0; i < divs.length; i++) {
          divs[i].style.visibility = isOn ? "hidden" : "visible";
        }
      }
      else {
        divs.style.visibility = isOn ? "hidden" : "visible";
      }
    }
    if (document.getElementsByTagName("select") != null) {
      divs = document.getElementsByTagName("select");
      if (divs.length != null) {
        for (i = 0; i < divs.length; i++) {
          divs[i].style.visibility = isOn ? "hidden" : "visible";
        }
      }
      else {
        divs.style.visibility = isOn ? "hidden" : "visible";
      }
    }
  }
}

// jump menu script for Home page Regional and Company menus
function goSelect(form,formName) {
  if (formName) {
    setcookie('DEmenu',formName,730);
    setcookie('DEutility',form.menu.options[form.menu.selectedIndex].value,730);
  }
  if (form.menu.selectedIndex != 0) {
    document.location.href = form.menu.options[form.menu.selectedIndex].value;
  } else {
    showMsg = document.getElementById(formName + "Prompt");
    showMsg.style.display = "block";
    return false;
  }
}

// cookie scripts for Home page Regional menus
function getexpirydate(nodays) {
	var UTCstring;
	Today = new Date();
	nomilli=Date.parse(Today);
	Today.setTime(nomilli+nodays*24*60*60*1000);
	UTCstring = Today.toUTCString();
	return UTCstring;
}
function setcookie(name,value,duration) {
	cookiestring=name+"="+escape(value)+";EXPIRES="+getexpirydate(duration);
	document.cookie=cookiestring;
}

//Loading Images v3.0
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}