//函数库
var ResponseType="";
var ActionControl="";
var XMLDom
//xml字符串转DOM对象
function StrToXML(xmlStr)
{
   var xmlDom=new ActiveXObject("Microsoft.XMLDOM");
   xmlDom.loadXML(xmlStr);
   return xmlDom;
}
//Ajax请求响应函数
function alertContents()
{
  if(Http_Request.readyState==4)
  {
	 if(Http_Request.status==200)
     { 
        if(ResponseType=="XML")
        {
           XMLDocument=Http_Request.responseXML;
           XMLDom=XMLDocument;
           InitProvinces();
        }
        else
        {
           //XMLDocument=Http_Request.responseBody;
           XMLDocument=Http_Request.responseText;
           //重新装载生成后的缩略图片
		   document.getElementById(this.ImgId).src=parent.SpanCurrPath.innerText+"\\"+XMLDocument;
        }    
     }
     else
     {
        XMLDocument=null;
     }
  }
  else
  {
     XMLDocument=null;
  }
}

function alertContents3(){
  if(Http_Request.readyState==4){
	 if(Http_Request.status==200){ 
           //XMLDocument=Http_Request.responseBody;
           XMLDocument=Http_Request.responseText;

			ForAddPic.batch.options[IIndex].innerText=ForAddPic.batch.options[IIndex].innerText+" "+XMLDocument;
			
			//alert(ForAddPic.batch.options[IIndex].innerText+" "+XMLDocument);
			window.status=ForAddPic.batch.options[IIndex].innerText+" "+XMLDocument;
			IIndex++;
		   CatchTwo();
      }    
  }
}
function alertContents4(){
  if(Http_Request.readyState==4){
	 if(Http_Request.status==200){ 
		   addpercent();
		   CurrPonit++;
		   GoMake();
      }    
  }
}

function gb2utf8(data){
	var glbEncode = [];
	gb2utf8_data = data;   //这是一个无符号型数组,里边装载着从服务器返回的未经解码的二进制数据
	
	execScript("gb2utf8_data = MidB(gb2utf8_data, 1)", "VBScript");
	var t=escape(gb2utf8_data).replace(/%u/g,"").replace(/(.{2})(.{2})/g,"%$2%$1").replace(/%([A-Z].)%(.{2})/g,"@$1$2");
	t=t.split("@");
	var i=0,j=t.length,k;
	while(++i<j) {
		k=t[i].substring(0,4);
		if(!glbEncode[k]) {
			gb2utf8_char = eval("0x"+k);
			execScript("gb2utf8_char = Chr(gb2utf8_char)", "VBScript");
			glbEncode[k]=escape(gb2utf8_char).substring(1,6);
		}
		t[i]=glbEncode[k]+t[i].substring(4);
	}
	gb2utf8_data = gb2utf8_char = null;
	return unescape(t.join("%"));
}