
function handleOut(elname) {
// hides all popups, parameter is the div name
// function called on onmouseout of hyperlink parameter

d = document.getElementById(elname) ;
d.style.left = "-2650px";
num = elname.substr(3,1);
ImgRestore('nav' + num);
}
function setLyr(obj1,lyr)
{
   	obj = document.getElementById (obj1) ;
	var newX = findPosX(obj);
	var newY = findPosY(obj);
	
	var x = document.getElementById(lyr);	
	
	var finy = 0;
	var finx = 0;	
	   finx = newX + 0;
	   finy = newY + 35;         	
    if (obj.parentNode.className !== "active")
    {
        //alert(obj.parentNode);
	    obj.parentNode.className = "active";	    
	}
	
	//set final position
	 x.style.top =  finy + 'px';
	 x.style.left = finx + 'px';

	
	 
}
function findPosX(obj)
  { //recursively searches through dom to get x postion
    var curleft = 0;
    if(obj.offsetParent)
        while(1) 
        {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.x)
        curleft += obj.x;
    return curleft;
  }

  function findPosY(obj)
  {//recursively searches through dom to get y postion
    var curtop = 0;
    if(obj.offsetParent)
        while(1)
        {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.y)
        curtop += obj.y;
    return curtop;
  }
  function ImgRestore(whichnav)
  {
  
      if (whichnav !== gOriginalnav)
      {
        el = document.getElementById(whichnav);
        el.parentNode.className = "";
      }
      
  }