function ajaxRequest(queryUrl, callbackFunc){
    this.queryUrl = queryUrl;//+"/timeToken/"+new Date().getTime();
	this.callback = callbackFunc;
    this.method   = arguments[2]?arguments[2].toUpperCase():"GET";
    this.content = arguments[3]?arguments[3]:null;
    var othis = this;
    this.post = function(){
        var xhr = ajaxRequest.getInstance();
		var date = new Date()
        xhr.open( this.method, this.queryUrl, true );
        if(this.method == "POST"){
            xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded");
        }
        xhr.onreadystatechange = function(){
            if(xhr.readyState == 4){
                if(xhr.status == 200){//如果是本地测试则条件应改为 xhr.status == 0
                    othis.callback(xhr.responseText);
                }
            }
        }
        xhr.send(this.content);
    };
    this.post();
}
ajaxRequest.xmlHttpRequestPool = [];
ajaxRequest.createObject = function(){
    var XHR = null;
    try{
        XHR = new XMLHttpRequest();
    }catch(e){
        var aXHRVersion = ["msxml2.xmlhttp.6.0","msxml2.xmlhttp.5.0","msxml2.xmlhttp.4.0","msxml2.xmlhttp.3.0","msxml2.xmlhttp", "Microsoft.XMLHTTP"];
        for(var i = 0; i < aXHRVersion.length && !XHR; i++){
            try{
               XHR = new ActiveXObject(aXHRVersion[i]);
            }catch(e){
            }
        }
    }
    if(XHR)
        return XHR;
    else
        alert("not proper");
}
ajaxRequest.getInstance = function(){
    for( var i = 0; i < ajaxRequest.xmlHttpRequestPool.length; i++ ){
        if(ajaxRequest.xmlHttpRequestPool[i].readyState == 0||ajaxRequest.xmlHttpRequestPool[i].readyState == 4 ){
            return ajaxRequest.xmlHttpRequestPool[i];
        }
    }
    ajaxRequest.xmlHttpRequestPool[ajaxRequest.xmlHttpRequestPool.length] = ajaxRequest.createObject();
    return ajaxRequest.xmlHttpRequestPool[ajaxRequest.xmlHttpRequestPool.length-1];
}