function getoffsetTop(e)
{
  var t=e.offsetTop;
  while(e=e.offsetParent) t+=e.offsetTop;
  return t;
}

function getoffsetLeft(e)
{
  var l=e.offsetLeft;
  while(e=e.offsetParent) l+=e.offsetLeft;
  return l;
}


function dropdown(hostControl,hostWindow,WindowHeight,WindowWidth,WindowDirector)
{
    dropdownHide();    
    document.onclick=null;

    var hCon=document.getElementById(hostControl);
    var hWin=document.getElementById(hostWindow);
   
    hWin.style.visibility="visible"
    if (WindowDirector=="up")
    {
        hWin.style.width=WindowWidth;
        hWin.style.height=WindowHeight;
        hWin.style.pixelTop = getoffsetTop(hCon)-WindowHeight;
        hWin.style.pixelLeft =getoffsetLeft(hCon);
    }
    else  //down or null
    {
        hWin.style.width=WindowWidth;  
        hWin.style.height=WindowHeight;
        hWin.style.pixelTop = getoffsetTop(hCon)+hCon.clientHeight+6;
        hWin.style.pixelLeft =getoffsetLeft(hCon);
    }
    setTimeout("document.onclick=dropdownHide;",10);
}


function dropdownex(hostControl,hostWindow,hostFrame,hostFrameUrl,WindowHeight,WindowWidth,WindowDirector)
{
    dropdownHide();    
    document.onclick=null;

    var hCon=document.getElementById(hostControl);
    var hWin=document.getElementById(hostWindow);
    var tmpFrame=document.getElementById(hostFrame);
    if(tmpFrame.src!=hostFrameUrl)
    {
      tmpFrame.src=hostFrameUrl;
    }
    
    hWin.style.visibility="visible"
    if (WindowDirector=="up")
    {
        hWin.style.width=WindowWidth;
        hWin.style.height=WindowHeight;
        hWin.style.pixelTop = getoffsetTop(hCon)-WindowHeight;
        hWin.style.pixelLeft =getoffsetLeft(hCon);
    }
    else  //down or null
    {
        hWin.style.width=WindowWidth;  
        hWin.style.height=WindowHeight;
        hWin.style.pixelTop = getoffsetTop(hCon)+hCon.clientHeight+6;
        hWin.style.pixelLeft =getoffsetLeft(hCon);
    }
    setTimeout("document.onclick=dropdownHide;",10);
}


function dropdownloadwin(hostControl,hostWindow,hostFrame,hostFrameUrl,WindowHeight,WindowWidth,WindowDirector)
{
    dropdownHide();    
    document.onclick=null;

    var hCon=document.getElementById(hostControl);
    var hWin=document.getElementById(hostWindow);
    var tmpFrame=document.getElementById(hostFrame);
    if(tmpFrame.src!=hostFrameUrl)
    {
      tmpFrame.src=hostFrameUrl;
    }
    
    hWin.style.visibility="visible"
    if (WindowDirector=="up")
    {
        hWin.style.width=WindowWidth;
        hWin.style.height=WindowHeight;
        hWin.style.pixelTop = getoffsetTop(hCon)-WindowHeight;
        hWin.style.pixelLeft =getoffsetLeft(hCon);
    }
    else  //down or null
    {
        hWin.style.width=WindowWidth;  
        hWin.style.height=WindowHeight;
        hWin.style.pixelTop = getoffsetTop(hCon)+hCon.clientHeight+6;
        hWin.style.pixelLeft =getoffsetLeft(hCon);
    }    
}


function dropdownHide()
{
    for(var i=0; i<document.all.length;i++)
    {
      if (document.all[i].className=="link_value" && document.all[i].style.visibility=="visible")
		document.all[i].style.visibility="hidden";
    }
}


