var onMenu;
var timeOn = null;
var menuActive = 0;
function showLayer(menu) {
  if (timeOn != null) {
    clearTimeout(timeOn);
    if (onMenu != menu) {
      closeMenu(onMenu);
    }
  }
  onMenu = menu;
  overButton = setTimeout("reallyShow('"+menu+"')",100);
}
function reallyShow(menu) {
  MM_showHideLayers(menu+'menu','','show');
}
function btnTimer() {
 if (overButton > 0) {
   clearTimeout(overButton);
 }
 timeOn = setTimeout("btnOut()", 1000);
}
function btnOut() {
  if (menuActive == 0) {
    MM_showHideLayers(onMenu+'menu','','hide');
  }
}
function subOver() {
  clearTimeout(timeOn);
  menuActive = 1;
}
function subOut(menu) {
 menuActive = 0;
 timeOn = setTimeout("closeMenu('"+menu+"')", 200);
}
function closeMenu(menu) {
  MM_showHideLayers(menu+'menu','','hide');
}
function MM_showHideLayers() {
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  if(document.getElementById){
    for (i=0; i<(args.length-2); i+=3){ 
      obj=tmt_findObj(args[i]);
      v=args[i+2];
      v=(v=='show')?'visible':(v='hide')?'hidden':v;
	  if(obj) {
	    obj.style.left=findPosX(document[onMenu])-(obj.offsetWidth-document[onMenu].offsetWidth);  
	    obj.style.visibility=v;
	  }
	}
  } else {
    for (i=0; i<(args.length-2); i+=3) 
      if ((obj=MM_findObj(args[i]))!=null) { 
        v=args[i+2];
        if (obj.style) {
          obj=obj.style; 
          v=(v=='show')?'visible':(v='hide')?'hidden':v;
        }
	    obj.left = findPosX(document[onMenu])-4; 	    
        obj.visibility=v;
      }
  }
}
function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.string(p+1)].document; n=n.string(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}
function tmt_findObj(n) {
	var x,t; if((n.indexOf("?"))>0&&parent.frames.length){t=n.split("?");
	x=eval("parent.frames['"+t[1]+"'].document.getElementById('"+t[0]+"')");
	}else{x=document.getElementById(n)}return x;
}
function findPosX(object) {
  var curleft = 0;
  if (object.offsetParent) {
    while (object.offsetParent) {
      curleft += object.offsetLeft
      object = object.offsetParent;
    }
  } else if (object.x)
    curleft += object.x;
  return curleft;
  
}
function reloadWindow() {
  if (navigator.appName == 'Netscape') {
    window.location.reload();
  }
}
function edxMOver(item,menu) {
  item.style.backgroundColor="#ffffff";
  item.style.cursor="pointer";
  subOver(menu)
}
function edxMOut(item,menu) {
  item.style.backgroundColor="#ffc222";
  subOut(menu)
}
function edxMOverNoLink(menu) {
  subOver(menu)
}
function edxMOutNoLink(menu) {
  subOut(menu)
}
function edxMOverHeading(item,menu) {
  item.style.backgroundColor="#ff9700";
  item.style.cursor="pointer";
  subOver(menu)
}
function edxMOutHeading(item,menu) {
  item.style.backgroundColor="#faa427";
  subOut(menu)
}
function itemParentClick(item) {
  window.location=item.childNodes[0].href;
}
