/**
 * 完成ajax请求
 */
var xmlHttp;
function ajaxRequest(url, stateChanged) {  
	if (window.XMLHttpRequest) { // Non-IE browsers
		xmlHttp = new XMLHttpRequest();
	} else {
		if (window.ActiveXObject) { // IE      
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	if (xmlHttp) {
		if (xmlHttp) {  
			xmlHttp.onreadystatechange = stateChanged;
			xmlHttp.open("post", url, true);
			xmlHttp.send(null);
		}
	}
}
/**
 * 完成ajax请求
 */
function ajaxRequest2(url, stateChanged, parameters) {
	if (window.XMLHttpRequest) { // Non-IE browsers
		xmlHttp = new XMLHttpRequest();
	} else {
		if (window.ActiveXObject) { // IE      
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	if (xmlHttp) {
		if (xmlHttp) {
			xmlHttp.onreadystatechange = stateChanged;
			xmlHttp.open("post", url, true);
			xmlHttp.setRequestHeader("Content-type ", "application/x-www-form-urlencoded ");
			xmlHttp.send(parameters);
		}
	}
}
function exampleShow() {
	if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete") {
		if (xmlHttp.responseText != null) {
      //build.innerHTML=buildOri+xmlHttp.responseText+"<br><br>";
      //alert(build.innerHTML);
		}
	}
}
function example() {
	var input1;
	if (id) {
		input1 = prompt("\u8bf7\u8f93\u5165\u697c\u5b87\u67d0\u5e62\u7684\u540d\u79f0");
		if (input1) {
			ajaxRequest("edit/edit.cmd?method=addBuild&ajax=true&save=true&tableName=TB_Build&name=" + EncodeUtf8(input1) + "&TB_Eaves=" + id, exampleShow);
		}
	} else {
		alert("\u8bf7\u5148\u4fdd\u5b58\u697c\u5b87\u4fe1\u606f");
	}
}

