/*
*       functions to get/set DOM style properties
*/

function getElementStyle(elemID, IEStyleProp, CSSStyleProp) {
    var elem = document.getElementById(elemID);
    if (elem.currentStyle) {
        return elem.currentStyle[IEStyleProp];
    } else if (window.getComputedStyle) {
        var compStyle = window.getComputedStyle(elem, "");
        return compStyle.getPropertyValue(CSSStyleProp);
    }
    return "";
}

function getObj(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}

function xById(id)
{
    return getElementStyle(id,'left','left').replace('px','');
}

function yById(id)
{
    return getElementStyle(id,'top','top').replace('px','');
}

function moveById(id,x,y)
{
    var obj = new getObj(id);
    obj.style.left = x;
    obj.style.top = y;
}
