//to alter position of the layer in relation to the anchor you need to change the value of 
//var xOff and 
//yOff.
//x position function
function pivotXOku(pivot){
  var pivot2= pivot + "2"; //NS4 pivot olarak <a> kullandığından farkli id ismi. Cunku ayni id'ye sahip farkli pivotlar olmaz (mine ve mine2) 
  var pivX;
  var tempPivX;
  
  if ((document.all && navigator.userAgent.indexOf("Opera")>-1) || (navigator.userAgent.indexOf("Netscape/7")>-1)) {// Opera veya Netscape7: Her ikisi de bir üst node'a olan uzaklığı veriyor. IE için de çalışabilir.
   var activeNode=document.getElementById(pivot);
   //alert(document.getElementById(pivot).parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.nodeName);
   pivX=2;
   tempPivX=-1;
   while (activeNode.nodeName != "BODY" ) {// En üst node BODY'ye gelene kadar ...
    tempPivX = tempPivX + activeNode.parentNode.offsetLeft;
    
    if (activeNode.nodeName == "TABLE")
    {
     pivX = tempPivX;
    }
    
    //pivX = pivX + activeNode.parentNode.offsetLeft; //...bütün içiçe offset uzaklıklarını topla
    activeNode=activeNode.parentNode; 
   }
   //pivX = pivX + activeNode.parentNode.offsetLeft;
   return pivX;
  } 
  else if (document.all) { //IE 
  
   var xOff=-0;  //Dikkat icinde bulunulan tablolarin borderlari varsa IE icin duzeltme gerekebilir
   
   var cElement = document.all[pivot];
   var useClient = (cElement.offsetTop == 0) ? 
    ((cElement.offsetParent.tagName == "TR") ? false : true) : false
   if (useClient) {
    var pivX = cElement.clientLeft
   } else {
    var pivX = cElement.offsetLeft
   }
   var pElement = document.getElementById(pivot).offsetParent;
   while (pElement != document.body) {
    if (useClient) {
     pivX += pElement.clientLeft
    } else {
     pivX += pElement.offsetLeft
    }
    pElement = pElement.offsetParent
   }    
   pivX=pivX+xOff;
   return pivX;
  }
  else if (document.layers) { // NS4
   pivX=document.anchors[pivot2].x;
   return pivX;
  }
  else { //NS6
   var NSxOff=+4;
      pivX=document.getElementById(pivot).offsetLeft - NSxOff;
   return pivX;
  } 
 }
 
//y position function 
 function pivotYOku(pivot){
  var pivot2= pivot + "2"; 
  var pivY;
  
  if ((document.all && navigator.userAgent.indexOf("Opera")>-1) || (navigator.userAgent.indexOf("Netscape/7")>-1)) {// Opera or Netscape7
   var activeNode=document.getElementById(pivot);
   pivY=+13;
   while (activeNode.nodeName != "TABLE" ) {
    pivY = pivY + activeNode.parentNode.offsetTop;
    activeNode=activeNode.parentNode;   
   } 
   pivY = pivY + activeNode.parentNode.offsetTop;
   return pivY;
  } 
  else if (document.all) { //IE 
   
   var yOff=+12;  
      
   var cElement = document.all[pivot];
   var useClient = (cElement.offsetTop == 0) ? 
    ((cElement.offsetParent.tagName == "TR") ? false : true) : false
   if (useClient) {
    var pivY = cElement.clientTop
   } else {
    var pivY = cElement.offsetTop
   }
   var pElement = document.getElementById(pivot).offsetParent;
   while (pElement != document.body) {
    if (useClient) {
     pivY += pElement.clientTop
    } else {
     pivY += pElement.offsetTop
    }
    pElement = pElement.offsetParent
   }    
   pivY=pivY+yOff;
   return pivY;
  }
  else if (document.layers) { // NS4
   pivY=document.anchors[pivot2].y;
   return pivY;
  }
  else {//NS6
   var NSyOff=-12; 
   pivY=document.getElementById(pivot).offsetTop - NSyOff;
   return pivY;
  } 
 }