function positionEl(mainElId, moveElId, xoffset, yoffset){
 
  mainObj = document.getElementById(mainElId); 
  
  x = getPageOffsetLeft(mainObj);
  y = getPageOffsetTop(mainObj);
         //alert (x + ", " + y);
  moveObj = document.getElementById(moveElId);
  moveX = x + xoffset;
  moveY = y + yoffset;
  moveObj.style.left = moveX + "px";
  moveObj.style.top  = moveY + "px";   
}

function getPageOffsetLeft(el) {

  var x;

    // Return the x coordinate of an element relative to the page.
  x = el.offsetLeft;
 
  if (el.offsetParent != null)
    x += getPageOffsetLeft(el.offsetParent);

  return x;
}

function getPageOffsetTop(el) {

  var y;

    // Return the y coordinate of an element relative to the page.
  y = el.offsetTop;
  if (el.offsetParent != null)
    y += getPageOffsetTop(el.offsetParent);
	
  return y;
}