var isIE4 = false, isNav4 = false, isNav6 = false;
var cap_max = 2000, old = null, rd;;
setBrowser();
var docEle = function(){ return $(arguments[0]) || false; }
function setBrowser(){
    if (document.all) isIE4 = true;
    else if (document.layers) isNav4 = true;
    else if (document.getElementById) isNav6 = true;
}
function CallBackObject(){this.XmlHttp = this.GetHttpObject();} 
CallBackObject.prototype.GetHttpObject = function(){ 
    var xmlhttp;
    /*@cc_on
    @if (@_jscript_version >= 5)
    try{xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    }catch (e){try{xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");}catch (E){xmlhttp = false;}}
    @else
    xmlhttp = false;
    @end @*/
    if (!xmlhttp && typeof XMLHttpRequest != 'undefined'){try{xmlhttp = new XMLHttpRequest();}catch (e){xmlhttp = false;}}
    return xmlhttp;
}
CallBackObject.prototype.DoCallBack = function(URL){ 
    if( this.XmlHttp ){
        if( this.XmlHttp.readyState == 4 || this.XmlHttp.readyState == 0 ){
            var oThis = this;
            this.XmlHttp.open('POST', '/Data/Ajax' + URL);
            this.XmlHttp.onreadystatechange = function(){ oThis.ReadyStateChange(); };
            this.XmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
            this.XmlHttp.send(null);
        }
    }
} 
CallBackObject.prototype.AbortCallBack = function(){if( this.XmlHttp ) this.XmlHttp.abort();} 
CallBackObject.prototype.OnLoading = function(){} 
CallBackObject.prototype.OnLoaded = function(){} 
CallBackObject.prototype.OnInteractive = function(){} 
CallBackObject.prototype.OnComplete = function(responseText, responseXml){} 
CallBackObject.prototype.OnAbort = function(){} 
CallBackObject.prototype.OnError = function(status, statusText){} 
CallBackObject.prototype.ReadyStateChange = function(){
    if( this.XmlHttp.readyState == 1 ) this.OnLoading();
    else if( this.XmlHttp.readyState == 2 ) this.OnLoaded();
    else if( this.XmlHttp.readyState == 3 ) this.OnInteractive();
    else if( this.XmlHttp.readyState == 4 ){
        if( this.XmlHttp.status == 0 ) this.OnAbort();
        else if( this.XmlHttp.status == 200 && this.XmlHttp.statusText == "OK" ) this.OnComplete(this.XmlHttp.responseText, this.XmlHttp.responseXML);
        else this.OnError(this.XmlHttp.status, this.XmlHttp.statusText, this.XmlHttp.responseText);
    }
}
function $(_sId){ return document.getElementById(_sId); }
function SeaHahp(){
    var HMHP = $('hmhp').value;
    if(HMHP.length<2){ alert("请输入正确的车牌号！");}
    else{
      var sea = new CallBackObject();sea.OnComplete = Sea_C;sea.DoCallBack("Sea.aspx?Field=XZZD&HPHM=" + HMHP);
    }
}
function Sea_C(responseText, responseXML){
   alert(responseText); 
}
function CancelHahp(){
    $('hmhp').value="";
}
function SeaFkxx(){
    var Fkxx = $('FKxx').value;
    var code = $('Code').value;   //获取验证码
    if(Fkxx.length<2){ alert("请输入举报反馈信息查询代码！");}
    else if(code.length<1) alert("请输入验证码！");
    else if(code !=$('checkCode').value) alert("验证码输入错误，请重新输入！");
    else{
      var sea = new CallBackObject();sea.OnComplete = Sea_Fkxx;sea.DoCallBack("Sea.aspx?Field=FKXX&FKXX=" + Fkxx);
    }
}
function Sea_Fkxx(responseText, responseXML){
   alert('反馈信息为：'+responseText); 
}
