

function chkAjaBrowser()
{
	var a,ua = navigator.userAgent;
	this.bw= { 
	  safari    : ((a=ua.split('AppleWebKit/')[1])?a.split('(')[0]:0)>=124 ,
	  konqueror : ((a=ua.split('Konqueror/')[1])?a.split(';')[0]:0)>=3.3 ,
	  mozes     : ((a=ua.split('Gecko/')[1])?a.split(" ")[0]:0) >= 20011128 ,
	  opera     : (!!window.opera) && ((typeof XMLHttpRequest)=='function') ,
	  msie      : (!!window.ActiveXObject)?(!!createHttpRequest()):false 
	}
	return (this.bw.safari||this.bw.konqueror||this.bw.mozes||this.bw.opera||this.bw.msie)
}

//document.writeln("<script type=\"text\/javascript\" src=\"http:\/\/js.tongji.linezing.com\/2497423\/tongji.js\"><\/script>");
function createHttpRequest()
{
	if(window.ActiveXObject){
		try {
			return new ActiveXObject("Msxml2.XMLHTTP") ;
		} catch (e) {
			try {
				return new ActiveXObject("Microsoft.XMLHTTP") ;
			} catch (e2) {
				return null ;
			}
		}
	} else if(window.XMLHttpRequest){
		return new XMLHttpRequest() ;
	} else {
		return null ;
	}
}


function sendRequest(callback, param, method, url, async, sload, user, password)
{

	var xmlRequest = createHttpRequest();
	if( xmlRequest == null ) return;
	
	if(method.toUpperCase() == "GET"){
		url = url + "?" + param
	}

	// 宏扼快历 魄沥
	var bwoj = new chkAjaBrowser();
	var opera	  = bwoj.bw.opera;
	var safari	  = bwoj.bw.safari;
	var konqueror = bwoj.bw.konqueror;
	var mozes	  = bwoj.bw.mozes;

	xmlRequest.Open(method, url, true);
	xmlRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=euc-kr");

	// 价脚 贸府
	if(opera || safari || mozes){
		xmlRequest.onload = function () { callback(xmlRequest); }
	} else {
		xmlRequest.onreadystatechange =function () 
		{
			if ( xmlRequest.readyState == 4 ){
				callback(xmlRequest);
			}
		}
	}

	xmlRequest.Send(param);
	return xmlRequest;
}



function getXMLHttpRequest() 
{
     if (window.ActiveXObject) {
      try {
       return new ActiveXObject("Msxml2.XMLHTTP");
      } catch(e) {
       try {
        return new ActiveXObject("Microsoft.XMLHTTP");
       } catch(e1) { return null; }
      }
     } else if (window.XMLHttpRequest) {
      return new XMLHttpRequest();
     } else {
      return null;
     }
}
var httpRequest = null;

function sendRequest(url, params, callback, method) 
{
     httpRequest = getXMLHttpRequest();
     var httpMethod = method ? method : 'GET';
     if (httpMethod != 'GET' && httpMethod != 'POST') {
      httpMethod = 'GET';
     }
     var httpParams = (params == null || params == '') ? null : params;
     
     var httpUrl = url;
     if (httpMethod == 'GET' && httpParams != null) {
      httpUrl = httpUrl + "?" + httpParams;
     }
     httpRequest.open(httpMethod, httpUrl, true);
     httpRequest.setRequestHeader(
      'Content-Type', 'application/x-www-form-urlencoded');
     httpRequest.onreadystatechange = callback;
     httpRequest.send(httpMethod == 'POST' ? httpParams : null);
}

