
var xmlhttp = null;
var questionid = null;
function createXMLHttpRequest() {
	
	try {
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");// ie5
	}
	catch (e) {
		try {
			xmlhttp = new ActiveXObject("MSxml2.XMLHTTP");
		}
		catch (e) {
			try {
				xmlhttp = new XMLHttpRequest();
			}
			catch (e) {
				xmlhttp = null;
				window.alert("\u4e0d\u652f\u6301\u7684\u6d4f\u89c8\u5668\u7c7b\u578b\uff01");
			}
		}
	}
	return xmlhttp;
}

function doGet(responseFunction, url, params,obj) {
	var xmlhttp=createXMLHttpRequest();
	if (xmlhttp != null) {
		if(obj != undefined && obj){
			obj.xmlhttp=xmlhttp;
		}
		try{
		if(params.indexOf("=")!=params.lastIndexOf("="))
		{
			questionid = params.substring(params.indexOf("=")+1,params.indexOf("&"));
		}else{
		questionid = params.substring(params.indexOf("=")+1);
		}
		}catch(e){}
		xmlhttp.onreadystatechange = responseFunction;
		xmlhttp.open("GET", url + "?" + params,true);
		xmlhttp.send(null);
	}
	
}

function doPost(responseFunction, url, params,obj) {
	var xmlhttp=createXMLHttpRequest();
	if (xmlhttp != null) {
		if(obj != undefined && obj){
			obj.xmlhttp=xmlhttp;
		}
		xmlhttp.onreadystatechange = responseFunction;
		xmlhttp.open("POST", url,true);	
		xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlhttp.send(params);
		
	}
	
	return xmlhttp;
}
