function Is() {
    agent  = navigator.userAgent.toLowerCase();
    this.major = parseInt(navigator.appVersion);
    this.minor = parseFloat(navigator.appVersion);
	 this.ns = ((agent.indexOf('mozilla') != -1) && 
	      (agent.indexOf('spoofer') == -1) && (agent.indexOf('compatible') == -1) &&
		 (agent.indexOf('opera') == -1) &&
		 (agent.indexOf('webtv') == -1));	
    this.ns2   = (this.ns && (this.major      ==    3));
    this.ns3   = (this.ns && (this.major      ==    3));
    this.ns4   = (this.ns && (this.major      ==    4));
    this.ns6   = (this.ns && (this.major      >=    5));
    this.ie    = (agent.indexOf("msie")       !=   -1);
    this.ie3   = (this.ie && (this.major      < 4));
    this.ie4   = (this.ie && (this.major      ==    4) && (agent.indexOf("msie 5.0")   ==   -1));
    this.ie5   = (this.ie && (this.major      ==    4) && (agent.indexOf("msie 5.0")   !=   -1));
	this.ieX = (this.ie && !this.ie3 && !this.ie4); 
}

var is = new Is();

function layerObject(id,position,left,top,visibility) {
     if (is.ie5||is.ns6) {
	      this.obj = document.getElementById(id).style;
		 this.obj.position = position;
		 this.obj.left = left;
		 this.obj.top = top;
		 this.obj.visibility = visibility;
		 return this.obj;
	 } else if(is.ie4) {
	      this.obj = document.all[id].style;
		 this.obj.position = position;
		 this.obj.left = left;
		 this.obj.top = top;
		 this.obj.visibility = visibility;
		 return this.obj;
     } else if(is.ns4) {
	 	 this.obj = document.layers[id];
		 this.obj.position = position;
		 this.obj.left = left;
		 this.obj.top = top;
		 this.obj.visibility = visibility;
		 return this.obj;
	 } 
}



function getRealLeft(el) {

    xPos = el.offsetLeft;
    tempEl = el.offsetParent;
    while (tempEl != null) {
        xPos += tempEl.offsetLeft;
        tempEl = tempEl.offsetParent;
    }
    return xPos;
}

function getRealTop(el) {
    yPos = el.offsetTop;
    tempEl = el.offsetParent;
    while (tempEl != null) {
        yPos += tempEl.offsetTop;
        tempEl = tempEl.offsetParent;
    }
    return yPos;
}


function MoveToAbsPos(ref,target,x,y) {

var ref = document.all ? document.all(ref) : document.getElementById ? document.getElementById(ref) : null;

//var target = document.all ? document.all(target) : document.getElementById ? document.getElementById(target) : null;

if (ref && target) {
var trueX = getRealLeft(ref) + x;
var trueY = getRealTop(ref) + y;

layerObject(target,'absolute',trueX,trueY,'visible');
}




}