

function sack(file) {
       this.xmlhttp = null;

       this.resetData = function() {
               this.method = "POST";
                 this.queryStringSeparator = "?";
               this.argumentSeparator = "&";
               this.URLString = "";
               this.encodeURIString = true;
                 this.execute = false;
                 this.element = null;
               this.elementObj = null;
               this.requestFile = file;
               this.vars = new Object();
               this.responseStatus = new Array(2);
         };

       this.resetFunctions = function() {
                 this.onLoading = function() { };
                 this.onLoaded = function() { };
                 this.onInteractive = function() { };
                 this.onCompletion = function() { };
                 this.onError = function() { };
               this.onFail = function() { };
       };

       this.reset = function() {
               this.resetFunctions();
               this.resetData();
       };

       this.createAJAX = function() {
               try {
                       this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
               } catch (e1) {
                       try {
                               this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                       } catch (e2) {
                               this.xmlhttp = null;
                       }
               }

               if (! this.xmlhttp) {
                       if (typeof XMLHttpRequest != "undefined") {
                               this.xmlhttp = new XMLHttpRequest();
                       } else {
                               this.failed = true;
                       }
               }
       };

       this.setVar = function(name, value){
               this.vars[name] = Array(value, false);
       };

       this.encVar = function(name, value, returnvars) {
               if (true == returnvars) {
                       return Array(encodeURIComponent(name), encodeURIComponent(value));
               } else {
                       this.vars[encodeURIComponent(name)] = Array(encodeURIComponent(value), true);
               }
       }

       this.processURLString = function(string, encode) {
               encoded = encodeURIComponent(this.argumentSeparator);
               regexp = new RegExp(this.argumentSeparator + "|" + encoded);
               varArray = string.split(regexp);
               for (i = 0; i < varArray.length; i++){
                       urlVars = varArray[i].split("=");
                       if (true == encode){
                               this.encVar(urlVars[0], urlVars[1]);
                       } else {
                               this.setVar(urlVars[0], urlVars[1]);
                       }
               }
       }

       this.createURLString = function(urlstring) {
               if (this.encodeURIString && this.URLString.length) {
                       this.processURLString(this.URLString, true);
               }

               if (urlstring) {
                       if (this.URLString.length) {
                               this.URLString += this.argumentSeparator + urlstring;
                       } else {
                               this.URLString = urlstring;
                       }
               }

               // prevents caching of URLString
               this.setVar("rndval", new Date().getTime());

               urlstringtemp = new Array();
               for (key in this.vars) {
                       if (false == this.vars[key][1] && true == this.encodeURIString) {
                               encoded = this.encVar(key, this.vars[key][0], true);
                               delete this.vars[key];
                               this.vars[encoded[0]] = Array(encoded[1], true);
                               key = encoded[0];
                       }

                       urlstringtemp[urlstringtemp.length] = key + "=" + this.vars[key][0];
               }
               if (urlstring){
                       this.URLString += this.argumentSeparator + urlstringtemp.join(this.argumentSeparator);
               } else {
                       this.URLString += urlstringtemp.join(this.argumentSeparator);
               }
       }

       this.runResponse = function() {
               eval(this.response);
       }

       this.runAJAX = function(urlstring) {
               if (this.failed) {
                       this.onFail();
               } else {
                       this.createURLString(urlstring);
                       if (this.element) {
                               this.elementObj = document.getElementById(this.element);
                       }
                       if (this.xmlhttp) {
                               var self = this;
                               if (this.method == "GET") {
                                       totalurlstring = this.requestFile + this.queryStringSeparator + this.URLString;
                                       this.xmlhttp.open(this.method, totalurlstring, true);
                               } else {
                                       this.xmlhttp.open(this.method, this.requestFile, true);
                                       try {
                                               this.xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
                                       } catch (e) { }
                               }

                               this.xmlhttp.onreadystatechange = function() {
                                       switch (self.xmlhttp.readyState) {
                                               case 1:
                                                       self.onLoading();
                                                       break;
                                               case 2:
                                                       self.onLoaded();
                                                       break;
                                               case 3:
                                                       self.onInteractive();
                                                       break;
                                               case 4:
                                                       self.response = self.xmlhttp.responseText;
                                                       self.responseXML = self.xmlhttp.responseXML;
                                                       self.responseStatus[0] = self.xmlhttp.status;
                                                       self.responseStatus[1] = self.xmlhttp.statusText;

                                                       if (self.execute) {
                                                               self.runResponse();
                                                       }

                                                       if (self.elementObj) {
                                                               elemNodeName = self.elementObj.nodeName;
                                                               elemNodeName.toLowerCase();
                                                               if (elemNodeName == "input"
                                                               || elemNodeName == "select"
                                                               || elemNodeName == "option"
                                                               || elemNodeName == "textarea") {
                                                                       self.elementObj.value = self.response;
                                                               } else {
                                                                       self.elementObj.innerHTML = self.response;
                                                               }
                                                       }
                                                       if (self.responseStatus[0] == "200") {
                                                               self.onCompletion();
                                                       } else {
                                                               self.onError();
                                                       }

                                                       self.URLString = "";
                                                       break;
                                       }
                               };

                               this.xmlhttp.send(this.URLString);
                       }
               }
       };

       this.reset();
       this.createAJAX();
}
function MM_showHideLayers() { //v3.0

  var i,p,v,obj,args=MM_showHideLayers.arguments;
  //document.getElementById('yanzheng').style.visibility='hidden';
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; 
		}
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function showajax(url){
		var truename = document.getElementById('truename').value;
		//var identify = document.getElementById('identify').value;
		var zhengshuhao = document.getElementById('zhengshuhao').value;
       var ajaxObjects = new Array();
       var ajaxIndex = ajaxObjects.length;
       ajaxObjects[ajaxIndex] = new sack();
       ajaxObjects[ajaxIndex].requestFile = url+"?truename="+truename+"&"+"zhengshuhao="+escape(zhengshuhao)+"&";
	   // 调用的文件路径
	   //ajaxObjects[ajaxIndex].URLString= "truename="+truename+"&"+"identify="+escape(identify)+"&"
	   				//					+"zhengshuhao="+escape(zhengshuhao)+"&"; 
       ajaxObjects[ajaxIndex].onCompletion = function(){ showAjaxData(ajaxIndex,ajaxObjects); };
	   //ajaxObjects[ajaxIndex].onError=function(){ajaxerr()};
	   ajaxObjects[ajaxIndex].onLoading=function(){onlog()};// 大括号里面可以换成你要执行的function，注意，ajaxIndex,ajaxObjects这两个参数一定要要的，如果你要增加自己的参数，可以在后面增加
       ajaxObjects[ajaxIndex].runAJAX();
}
function showAjaxData(ajaxIndex,ajaxObjects){
var rsp = ajaxObjects[ajaxIndex].response;
document.getElementById('yanzheng').style.visibility='hidden';
document.getElementById('yanzheng1').innerHTML = rsp;
document.getElementById('yanzheng1').style.visibility='visible';
}
function ajaxerr() {
	alert("出现错误");
}
function onlog() {
	document.getElementById('yanzheng1').innerHTML = '<font size=+4 color=#FFFFFF>正在加载。。。</font>';
}
function showtq2(){
$urls='http://webchat.tq.cn/sendmain.jsp?uin=8445731&amp;agentid=0&amp;transferpage=1&amp;tq_bottom_ad_url=http://qtt.tq.cn/post/sendmain.html&amp;tq_right_infocard_url=http://qtt.tq.cn/showcard.do&amp;page=http%3A//www.lupa.gov.cn/list.php%3Fcid%3D107&amp;ispaymoney=1&amp;localurl=http://www.lupa.gov.cn/indexv2.php&amp;ltype=0&amp;buttonsflag=&amp;iscallback=0&amp;rand=9988114167';
　window.open ($urls, "newwindow", "height=500, width=600, toolbar= no, menubar=no, scrollbars=no, resizable=no, location=no, status=no,top=100,left=300")
}