 var Ajaxer = function(URL,callBackFunction,errorFunction,ProMethod,strPara)
{
    if(ProMethod==null)
    {
        this.AjaxMethod = "GET";                            //默认传输方式 POST;
    }
    else
    {
        this.AjaxMethod=ProMethod;
    }
    
    this.SendObject = null;                                //传输的内容，默认null    
    if(strPara!=null)
    {
        this.SendObject=strPara;
    }
    this.ResponseType = "Text";                        //返回值类型 
    this.Async = true;                                        //是否异步方式
    
    function createXMLHttp()
    {
        var xmlhttp;
        try
        {
            xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (ex)
        {
            try
            {
                xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (ex)
            {
                xmlhttp = new XMLHttpRequest();
            }
        }
        return xmlhttp;
    }
    var xmlHttp;    
     this.send =    function ()
    {
        xmlHttp = null;
        xmlHttp = createXMLHttp();
        if(xmlHttp == null)
        {
            alert("创建xmlHTTP失败！");
        }else
        {
            xmlHttp.onreadystatechange = this.SendBack;
            xmlHttp.open(this.AjaxMethod,URL,this.Async);
            if(this.SendObject!=null)
            {
                xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
            }
            xmlHttp.send(this.SendObject);
        }
    }
    
    this.SendBack = function (){

        if(xmlHttp.readyState == 4){
            if(xmlHttp.status == 200){
                var res;
                res = xmlHttp.responseText;
                callBackFunction(res);                
            }else{
                var error = eval(error + "=" + "{\"code\":\"" + xmlHttp.status + "\",\"message\":\"" + xmlHttp.statusText + "\"}" );
                errorFunction(error);
            }
        }
    }
}