function nosizes(str){
	sx = new String(str);
	sx.replace('px', '');
	sx.replace('em', '');
	return sx;
}

function PositionOnScreen(name)
{
    this.object = name;
    this.x = 0;
    this.y = 0;
    this.w = 0;
    this.h = 0;
	this.getPos = getPos
	this.getPos(name);
	
	function findPosX(obj)
	{
		var curleft = 0;
		if (obj.offsetParent)
		{
			while (obj.offsetParent)
			{
				curleft += obj.offsetLeft
				obj = obj.offsetParent;
			}
		}
		else if (obj.x)
			curleft += obj.x;
		return curleft;
	}
	
	function findPosY(obj)
	{
		var curtop = 0;
		if (obj.offsetParent)
		{
			while (obj.offsetParent)
			{
				curtop += obj.offsetTop
				obj = obj.offsetParent;
			}
		}
		else if (obj.y)
			curtop += obj.y;
		return curtop;
	}	
	
	function getPos() {
	   //xobj = new getObj(this.object);
	   el = $(this.object);
	   if (opera) {
			 this.x = findPosX(el);
			 this.w = nosizes(xobj.style.width);
			 this.y = findPosY(el);
			 this.h = nosizes(xobj.style.height);
	   } else {
		   if (document.getBoxObjectFor) {	     
			 var bo = document.getBoxObjectFor(el);
			 this.x = bo.x;
			 this.w = bo.width;
			 this.y = bo.y;
			 this.h = bo.height;
		   } else {
			 if (el.getBoundingClientRect) {
			   var rect = el.getBoundingClientRect();
			   this.x = rect.left;
			   this.w = rect.right - rect.left;
			   this.y = rect.top;
			   this.h = rect.bottom - rect.top;
			 } 
		   } 
		 }
	}	
}


function getOffset(){
    var pos = 0;
	if (window.innerHeight)
	{
		  pos = window.pageYOffset
	}
	else if (document.documentElement && document.documentElement.scrollTop)
	{
		pos = document.documentElement.scrollTop
	}
	else if (document.body)
	{
		  pos = document.body.scrollTop
	}
	return pos;
}