function $(id)
{
	return document.getElementById(id);	
}
function echo(obj,html)
{

 try
 {
	    $(obj).innerHTML=html;
 }
 catch(e)
 {
 alert(html);
    $(obj).innerHTML=e;
 }
}
function fopen(obj)
{
	$(obj).style.display="";
}
function fclose(obj)
{
	$(obj).style.display="none";
}
function GetXmlHttpObject()
{
	var xmlHttp=false;
	try	{
  		xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
 	} 
	catch (e) {
  		try {
   			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  		} 
		catch (e) {
   			xmlHttp = false;
 		}
 	}
	if (!xmlHttp && typeof XMLHttpRequest!='undefined') {
  		xmlHttp = new XMLHttpRequest();
				if (xmlHttp.overrideMimeType) {
			xmlHttp.overrideMimeType('text/xml');
		}
	}	

	return xmlHttp;	
}

function PostData(method,url,postData,obj)
{

	var xmlHttp = null;
	xmlHttp=GetXmlHttpObject();
	if(!xmlHttp)
	{
		alert("sorry!your browser not support XMLHTTP！");
		return;
	}
		
	xmlHttp.onreadystatechange=RequestData;
	xmlHttp.open(method,url,true);
	
	if(method.toUpperCase() == "POST")
	{
		xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	}
	
	xmlHttp.send(postData);
	
	function RequestData()
	{
		fopen(obj);
		echo(obj,"<img src='../images/loading.gif'>");//"<label style='color:red;'>Communication</label>");
		if(xmlHttp.readyState==4)
		{
			if(xmlHttp.status==200)
			{
				echo(obj,xmlHttp.responseText);	
				//alert(xmlHttp.responseText);
			}	
			else
			{
				echo(obj,"some errors occur!");	
		    }
		}
		//echo(obj,xmlHttp.readyState);	
	}
}

function getdata(url,obj)
{
		
		var xmlhttp=createxmlhttp();
		if(!xmlhttp)
		{
			alert("你的浏览器不支持XMLHTTP！！");
			return;
		}
		xmlhttp.onreadystatechange=requestdata;
		xmlhttp.open("GET",url,true);
		xmlhttp.send(null);
		function requestdata()
		{
			
				fopen(obj1);
				echo(obj,"正在加载数据，请稍等......");
				if(xmlhttp.readyState==4)
				{
					if(xmlhttp.status==200)
					{
						//if(obj1!=obj2){fclose(obj1);};
						//{
						    echo(obj,xmlhttp.responseText);
						    alert(xmlhttp.responseText);
						//}
					}
				}
		}
}
