﻿<!--
function XMLHttpObject(method,url,Syne){
	var	XMLHttp=null;
	var	o=this;
	this.method=method;
	this.url=url;
	this.Syne=Syne;
	this.text="";
	this.xmldoc=null;
	this.params=null;

	this.sendData = function()
	{
		if (window.XMLHttpRequest) {
			XMLHttp	= new XMLHttpRequest();
		} else if (window.ActiveXObject) {
			//XMLHttp	= new ActiveXObject("Microsoft.XMLHTTP");
			try
			{
        XMLHttp = new ActiveXObject("Msxml2.XMLHTTP");
      }
      catch(e)
      {
        try{
             XMLHttp = new ActiveXObject("Microsoft.XMLHTTP");
           }catch(e){}
      }
		}
		with(XMLHttp){
			open(this.method, this.url, this.Syne);
			if(this.method.toUpperCase() =="POST") {
			    setRequestHeader("Method", "POST "+this.url+" HTTP/1.1");
  				setRequestHeader("Content-Type","application/x-www-form-urlencoded");
			} else {
				setRequestHeader("Content-Type","text/xml;charset=UTF-8");
			}
			onreadystatechange = o.onCallBack;
			send(this.params);
		}
	}

	this.onCallBack=function()
	{
		if (XMLHttp.readyState == 4) {
			if (XMLHttp.status == 200) {
				o.text = XMLHttp.responseText;
				o.xmldoc=XMLHttp.responseXML;
				o.CallBackOK();
			} else if(XMLHttp.status == 204) {
				o.CallBackFailed();
			} else if(XMLHttp.status == 203) {
				o.CallBackTimeout();
			} else {
				o.CallBackFailed();
			}
			
		}
	}
	this.CallBackFailed=function(){};
	this.CallBackOK=function(){};
	this.CallBackTimeout=function(){return alert("超时！请重试。");};
}
//-->