function getOs()   
{   
   var OsObject = "";   
   if(navigator.userAgent.indexOf("MSIE")>0) {   
        return "MSIE";       //IE浏览器
   }
   if(isFirefox=navigator.userAgent.indexOf("Firefox")>0){   
        return "Firefox";     //Firefox浏览器
   }
   if(isSafari=navigator.userAgent.indexOf("Safari")>0) {   
        return "Safari";      //Safan浏览器
   }
   if(isCamino=navigator.userAgent.indexOf("Camino")>0){   
        return "Camino";   //Camino浏览器
   }
   if(isMozilla=navigator.userAgent.indexOf("Gecko/")>0){   
        return "Gecko";    //Gecko浏览器
   }   
} 


var http_request = false;
function send_request(method,url,content,responseType,callback){
	http_request=false;
	if(window.XMLHttpRequest){//Mozilla浏览器
		http_request=new XMLHttpRequest();
		if(http_request.overrideMimeType){
			http_request.overrideMimeType("text/xml");
		}
		
		//window.alert("创建成功1！"+http_request);
	}
	else{
		try{
			http_request=new ActiveXObject("Msxml2.XMLHTTP");
		}catch(e){
			try{
				http_request=new ActiveXObject("Microsoft.XMLHTTP");
			}catch(e){}
		}
		//window.alert("创建成功2！"+http_request);
	}
	if(!http_request){
		window.alert("不能创建XMLHttpRequest对象实例。");
		return false;
	}
	if(responseType.toLowerCase()=="text"){
	    var btype=getOs();
		http_request.onreadystatechange=callback;
		
		//window.alert(http_request.onreadyStatechange);
	}else{
		
		window.alert("响应类别参数错误。");
		return false;
	}
	if(method.toLowerCase()=="get"){
	//window.alert("11111");
		http_request.open(method,url,true);
	}
	else if(method.toLowerCase()=="post"){
	window.alert("22222");
		http_request.open(method,url,true);
		//http_request.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	}else{
	window.alert("33333");
		window.alert("http请求类别参数错误。");
		return false;
	}
	http_request.send(content);
}
//处理返回文本格式信息的函数
function processTextResponse(){
	if(http_request.readyState==4){
		if(http_request.status==200){
			alert("Text文档响应");
		}else{
			alert("您所请求的页面有异常。");
		}
	}
}
function processXMLResponse(){
	if(http_request.readyState==4){
		if(http_request.status==200){
			alert("XML文档响应");
		}else{
			alert("您所请求的页面有异常。");
		}
	}
}

