
Request.send = function(url, method, callback, data, urlencoded) {
	var req;
	 
	if(window.XMLHttpRequest){
	  
		req = new XMLHttpRequest();
	}else if(window.ActiveXObject){
		req = new ActiveXObject("Microsoft.XMLHTTP");
		
	}	
	req.onreadystatechange = function() {
	  
		if(req.readyState == 4){
			if (req.status < 400) {
				(method=="POST") ? callback(req) : callback(req,data);
			}else{
			//closeLoginMsgDiv();
				alert("æԺ!");
			}
		}
	}
	if (method=="POST") {
		req.open("POST", url, true);
		if (urlencoded) req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');		 
		req.send(data);
	} else {
		req.open("GET", url, true);
		req.send(null);
	}
	return req;
}
Request.sendRawPOST = function(url, data, callback) {
	Request.send(url, "POST", callback, data, false);
}
Request.sendPOST = function(url, data, callback) {
	Request.send(url, "POST", callback, data, true);
}
Request.sendGET = function(url, callback, args) {
	return Request.send(url, "GET", callback, args);
}


function loginResult(response) {
	var resultStr = response.responseText;
    
	if(resultStr.indexOf("Login True") != -1){
		tmt = window.setTimeout(onReady,500);		
	}
}
var tmt;


function GetEvent(id)
{
	if(document.getElementById)
	{
		return document.getElementById(id);
	}
	else if(document.all)
	{
		return document.all[id];
	}
	else if(document.layers)
	{
		return document.layers[id];
	}
}

function xmlhttp()
{
	var A=null;
	try
	{
		A=new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			A=new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(oc)
		{
			if (typeof XMLHttpRequest != "undefined" );
			{
				A=new XMLHttpRequest();
			}
		}
	}
	return A;
}


