// JavaScript Document

var xmlHttp;
var shown="usearchc";

function createXMLHTTPRequest(){
	var xmlHttp_obj;
	if(window.XMLHttpRequest){
		xmlHttp_obj = new XMLHttpRequest();
	}else if(window.ActiveXObject){
		try{
			xmlHttp_obj = new ActiveXObject("Msxml2.XMLHTTP");	
		}catch(e){
			try{
				xmlHttp_obj = new ActiveXObject("Microsoft.XMLHTTP");
			}catch(e){
				xmlHttp_obj = null;
				//alert("消息采用Ajax缓存，您的浏览器不支持AJAX，将不能保存缓存消息。请更换浏览器使用！");
			}
		}
	}
	return xmlHttp_obj;
}

function startRequest(url,params,HttpMethod){
	if(!HttpMethod){
		HttpMethod="POST";
	}
	xmlHttp = createXMLHTTPRequest();
	if(xmlHttp != null){
		xmlHttp.onreadystatechange=handleStateChange;
		xmlHttp.open(HttpMethod,url,true);
		xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;charset=gb2312');
		xmlHttp.send(null);
	}
}
function handleStateChange(){
	if(xmlHttp.readyState==4){
		if(xmlHttp.status=='200'){
			//var res=xmlHttp.responseText;
			//setInnerHTML(res);
		}else{
			//setInnerHTML('');
		}
	}
}

function setInnerHTML(res){
	document.getElementById("usearchc").innerHTML=res;
}

function showloadImg(){
	document.getElementById("usearchc").innerHTML="<img src='img/load.gif' width='50' height='50' border='0' />";
}


function autopost(flag,_value){
	//showloadImg();
	if(!_value){
		_value=""
	}
	var tick = new Date().getTime();
	startRequest('AutoPost.asp?act='+escape(flag)+'&xid='+escape(_value)+'&tick='+tick);
}
