var xmlHttp=null;
function InitAJAX(){
if (window.ActiveXObject) {
        try {
            xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e) {
            xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
    }
    else if (window.XMLHttpRequest) {
        xmlHttp = new XMLHttpRequest();
    }
}

function AjaxRequest(_method,_url,_async){
	InitAJAX();
	this.Param="";
	this.Method=_method;
	this.URL=_url;
	this.Async=_async;

	this.setParameter = function(name,value) {
		var Temp=this.Param+"&"+name+"="+value;
		this.Param=Temp;
	}
	this.send = function(v,onComplete){

		xmlHttp.onreadystatechange =function(){
			if (xmlHttp.readyState == 4) {
				if (xmlHttp.status == 200) {
					//此处可对应更改为xmlHttp.responseXML和xmlHttp.responseStream
					onComplete(xmlHttp.responseText);
				}
				else {
					alert("there is an error in server!the status is:" + xmlHttp.status.toString());
				}
			}
		}//EndFunction

		if("post" == this.Method){
			xmlHttp.open('POST', this.URL, false);
			//FF兼容中文
			this.Param=encodeURI(this.Param);
			xmlHttp.setRequestHeader("Content-Length",this.Param.length);
			xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
			xmlHttp.send(this.Param);
		}else{
			xmlHttp.open('GET', this.URL, false);
			xmlHttp.send();
		}					
	}		
}


function BodyGray(){
  ht = document.getElementsByTagName("body");
  ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
}
function BodyReset(){
  ht = document.getElementsByTagName("body");
  ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=0)";
}
function SetOBJfilter(objname,ve){
	eval(objname+".style.filter='progid:DXImageTransform.Microsoft.BasicImage(grayscale="+ve+")'")
}
