var th=0;

function showdiv(id)
{
  if (document.all)
    document.all[''+id+''].style.visibility = "visible";
  else
    document.getElementById(''+id+'').style.visibility = "visible";
}

function toggleDiv(id,flagit,e) {
if (flagit=="1")
  {
    if (e.clientX)
      {
        x = e.clientX;
        y = e.clientY;
      }

    if (e.pageX)
      {
        x = e.pageX;
        y = e.pageY;
      }


    scrollX=document.body.scrollLeft;
    scrollY=document.body.scrollTop;

    if (!self.pageYOffset)
      {
        y+=scrollY;
        x+=scrollX;
      }

    if (document.body.clientHeight)
      {
        windowheight=document.body.clientHeight;
        windowwidth=document.body.clientWidth;
      }
    else
      {
        windowheight=self.innerHeight;
        windowwidth=self.innerWidth;
      }

    if (document.getElementById)
      {
        if (x-scrollX>windowwidth - 150)
            newleft =windowwidth - 150;
          else
            newleft = x+15;
        if (y-scrollY>windowheight - 40)
            newtop = windowheight - 40;
          else
            newtop = y+15;


        document.getElementById(''+id+'').style.top=newtop +"px";
        document.getElementById(''+id+'').style.left=newleft +"px";

        if (th!=0)
          clearTimeout(th);

        th=setTimeout("showdiv('"+id+"')",200);
      }
  }
else
 if (flagit=="0")
   {
     if (th!=0)
       {
         clearTimeout(th);
         th=0;
       }
     if (document.getElementById) document.getElementById(''+id+'').style.visibility = "hidden"
   }
}

