
function getObj(name)
{
  if (document.getElementById)
  {
  	return document.getElementById(name);
  }
  else if (document.all)
  {
	  return document.all[name];
  }
  else if (document.layers)
  {
   	return document.layers[name];
  }
}

function getWidth(obj)
{
	if (obj.offsetWidth) 
		return obj.offsetWidth;
	return (null);  
}

function getHeight(obj)
{
	if (obj.offsetHeight) 
		return obj.offsetHeight;
	return (null);  
}

function getStyle(obj,styleProp)
{
	if (obj.currentStyle)
		var r = obj.currentStyle[styleProp];
	else if (window.getComputedStyle)
		var r = document.defaultView.getComputedStyle(obj,null).getPropertyValue(styleProp);
	return r;
}

function getPageWidth ()
{
  if (self.innerHeight) // all except Explorer
  	return self.innerWidth;
  if (document.documentElement && document.documentElement.clientHeight)
  	// Explorer 6 Strict Mode
  	return document.documentElement.clientWidth;
  if (document.body) // other Explorers
  	return document.body.clientWidth;
}

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;
}


