var httpRequest=null;

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;
    }
}
function sendRequest(callback,params,method,url,async,sload){
    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.onreadystatechange=callback;
    httpRequest.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
    httpRequest.send(httpMethod=='POST' ? httpParams : null);
}