function getAbsolutePosition(element) {
  var r = { x: element.offsetLeft, y: element.offsetTop };
  if (element.offsetParent) {
    var tmp = getAbsolutePosition(element.offsetParent);
    r.x += tmp.x;
    r.y += tmp.y;
  }
  return r;
};
function ahah(url, target, lid) {
lid.style.backgroundPosition="100% 100%";
  var bar_window = document.getElementById("bar_win");
  if (bar_window.style.width!="380px") bar_window.style.width="380px";
  
  document.getElementById(target).innerHTML = '<div style="height: 100px; padding: 60px 0 0 0"><center>Loading...</center></div>';
  
  var scrOfY = GetScrOfY();

  bar_window.style.top = getAbsolutePosition(lid).y-100+"px";
  lft = getAbsolutePosition(lid).x+lid.offsetWidth+300;
  //alert(getAbsolutePosition(lid).x-lid.offsetWidth/2);
  if ((getAbsolutePosition(lid).x-lid.offsetWidth/2)>600) lft=getAbsolutePosition(lid).x-lid.offsetWidth/2;
  bar_window.style.left = lft+"px";
  bar_window.style.visibility="visible";
  if (window.XMLHttpRequest) {
    req = new XMLHttpRequest();
  } else if (window.ActiveXObject) {
    req = new ActiveXObject("Microsoft.XMLHTTP");
  }
  if (req != undefined) {
    req.onreadystatechange = function() {ahahDone(url, target);};
    req.open("GET", url, true);
    req.send("");
  }
}  

function winload(name,linkid) {
	ahah(name,"bar_win",document.getElementById(linkid));
	return false;
}
function winclose(linkid) {
  document.getElementById(linkid).style.backgroundPosition="100% 0%";
  var bar_window = document.getElementById("bar_win");
  bar_window.style.visibility="hidden";
  }

  