//*******************************************
// JavaScript for DHTML pop-up menus
//*******************************************
    var prevMenu ;  
    var thisMenu ;

	function doMenu(e,id,start) {
	    	
//		if (document.all)   
//		   thisMenu = document.all(id);
//		else if (document.getElementById)     
		   thisMenu = document.getElementById(id);
   
		 
    	if (document.all) {       // using document.all to test for IE vs other browsers
		    e = window.event;     // e gives access to the event in all browsers
           button = e.srcElement;  }
  		else	{
			button = e.currentTarget; }

		e.cancelBubble = true;

		var x;
		var y;
		var z;		
		
		prevMenu = thisMenu;    // capture thismenu as "previous" for the hide function
		
        x = getPageOffsetLeft(button);
        y = getPageOffsetTop(button) + button.offsetHeight;
        z = getPageOffsetLeft(button) + button.offsetWidth;
		
// For IE, adjust position.

       if (document.all) {
           x += button.offsetParent.clientLeft;
           y += button.offsetParent.clientTop;
       }		
		
	   if (start == "Left") {		
		   thisMenu.style.left = x + 10; }
		else      {
           thisMenu.style.left = z - 203; }		 
		   
		thisMenu.style.top = y;
		thisMenu.style.display = "block";
    }
	
	
	function hideMenu(e){
		if (prevMenu!=null) 
		prevMenu.style.display = "none";
		
    	if (!e) var e = window.event;     // e gives access to the event in all browsers
        
		if(e !=null)
           e.cancelBubble = true;
	
	}

	function keepMenu(e){
    	if (!e) var e = window.event;     // e gives access to the event in all browsers
		
    	e.cancelBubble = true;
	}
	
	function getPageOffsetLeft(el) {
// Return the x coordinate of an element relative to the page.
      var x;
      x = el.offsetLeft;
      if (el.offsetParent != null)
         x += getPageOffsetLeft(el.offsetParent);
     return x;
}

// Return the y coordinate of an element relative to the page.
function getPageOffsetTop(el) {
     var y;
     y = el.offsetTop;
     if (el.offsetParent != null)
        y += getPageOffsetTop(el.offsetParent);
     return y;
}
	
	document.onmouseover = hideMenu;