function createXMLHttpRequest() {
    if (window.ActiveXObject) {
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");   //IE
    } else if (window.XMLHttpRequest) {
        xmlHttp = new XMLHttpRequest();                     //Mozilla
    }

    return xmlHttp;
} 

function ajaxPostReturnText(submitServerUrl, queryString, callback) { 
    var url = "../App_Ashx/" + submitServerUrl+".ashx?time=" + new Date().getTime();
    var xmlHttp = createXMLHttpRequest();
    if (xmlHttp == null) return false;
    xmlHttp.open("POST",url,true);
    xmlHttp.onreadystatechange = function() {
        if (xmlHttp.readyState == 4) {
            if (xmlHttp.status == 200) {
                callback(xmlHttp.responseText);
                delete xmlHttp;
                xmlHttp = null;
            } else {
                alert("msg status = " + xmlHttp.status);
            }
        }
    }
    xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    xmlHttp.send(escape(queryString));
}
 

//2011-05-10
function ajaxPostReturnTextParam(submitServerUrl, queryString, callparam, callback) { 
    var url = "../App_Ashx/" + submitServerUrl+".ashx?time=" + new Date().getTime();
    var xmlHttp = createXMLHttpRequest();
    if (xmlHttp == null) return false;
    xmlHttp.open("POST",url,true);
    xmlHttp.onreadystatechange = function(){
        if(xmlHttp.readyState == 4){
            if(xmlHttp.status == 200){                        
                callback(callparam, xmlHttp.responseText);
                delete xmlHttp;
                xmlHttp = null;
            }else{
                //alert("msg status = " + xmlHttp.status);
            }
        }        
    }
    xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    xmlHttp.send(escape(queryString));
} 
