// JavaScript Document

//封裝document.getElementById
function $(id)
{
	return document.getElementById(id);
}
function getAjaxObject()
{
	if (window.ActiveXObject)
		return new ActiveXObject("Microsoft.XMLHTTP");
	else if (window.XMLHttpRequest)
		return new XMLHttpRequest();
	
}
//返回对象位于窗口的绝对左边距离
function getAbsoluteLeft( ob )
{
  	if(!ob){return null;}
   	var obj = ob;
   	var objLeft = obj .offsetLeft;
   	while( obj != null && obj .offsetParent != null && obj .offsetParent.tagName != "BODY" )
	{
     	objLeft += obj .offsetParent.offsetLeft;
     	obj = obj .offsetParent;
   	}
 	return objLeft ;
}

//返回对象位于窗口的绝对上边距离
function getAbsoluteTop( ob )
{
 	if(!ob){return null;}
 	var obj = ob;
 	var objTop = obj .offsetTop;
 	while( obj != null && obj .offsetParent != null && obj .offsetParent.tagName != "BODY" )
	{
   		objTop += obj .offsetParent.offsetTop;
   		obj = obj .offsetParent;
 	}
 	return objTop ;
}
