var adam={};
adam.Ajax=function(url,obj){
	var httpRequest;
	if (window.ActiveXObject)
		try{
			httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
		}catch (e){
			try{
				httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
			}catch (e){}
		}
	if (!httpRequest){
		alert('不能创建XMLHTTP实例');
		obj.onComplete();
	}
	httpRequest.onreadystatechange = function(){
		if (httpRequest.readyState == 4){
			obj['onComplete'](httpRequest);
		}
	}
	if(url.indexOf('machineDate')==-1) 
		url+=(url.indexOf('?')==-1?"?":"&")+("machineDate="+new Date().getTime());
		url+=(url.indexOf('?')==-1?"?":"&")+obj.parameters;
	if(obj.asynchronous==true) 
		httpRequest.open(obj.method, url); 
	else 
		httpRequest.open(obj.method, url,false);
        httpRequest.send(null);
    return httpRequest;
};

function getContent( url, pars, updateElemID){
	//var url="module/wajax.php"
	adam.Ajax(url,{
		method  : "POST",
		parameters : pars,
		asynchronous : false,
		onFailure : function(httpRequest){alert("网络连接失败!");},
		onComplete  : function(httpRequest){
			if(httpRequest.status==200){
				showResponse(httpRequest,updateElemID)
			}
		}
	});
}

function $(element)
{
	return document.getElementById(element);
}

function showResponse(httpRequest,updateElemID)
{
	$(updateElemID).innerHTML = httpRequest.responseText;
}



function upTime(id,vid)
{	
	$(vid).innerHTML='<img src="images/spinner_grey.gif"> 处理中...';
	getContent('module/ajaxw.php', 'act=uptime&id='+id, vid);
}
//wave-2008-09-23
function FloorUptime(id,vid)
{	
	$(vid).innerHTML='<img src="images/spinner_grey.gif"> 处理中...';
	getContent('module/ajaxw.php', 'act=flooruptime&id='+id, vid);
}

function HouseUptime(id,vid)
{	
	$(vid).innerHTML='<img src="images/spinner_grey.gif"> 处理中...';
	getContent('module/ajaxw.php', 'act=houseuptime&id='+id, vid);
}

function NewsUptime(id,vid)
{	
	$(vid).innerHTML='<img src="images/spinner_grey.gif"> 处理中...';
	getContent('module/ajaxw.php', 'act=newsuptime&id='+id, vid);
}

function SelType2()
{	
	getContent('module/ajaxw.php', 'act=aaaaaa', 'aa123');
}

function ifJump(jid)
{	
	var ifj=$(jid).value;
	alert(ifj);
	getContent('msn.php', 'act=ifjump&ij='+ifj, jid);
}

