// JavaScript Document

var xmlHttp;
var divid;
var info;

function BaseAjax(aimUrl,reElement){
	//数据成员
	this.aimUrl = aimUrl;
	this.reElement = reElement;
	//成员函数
	
	//事件句柄

}


function createXMLHttpRequest() {
	if (window.ActiveXObject) {
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
	else if (window.XMLHttpRequest) {
		xmlHttp = new XMLHttpRequest();
	}
}

function startRequest(str1,str2) {
	divid = str1;
	activeid = str2;
	createXMLHttpRequest();
	xmlHttp.onreadystatechange = Change;
	xmlHttp.open ("GET",activeid,true);
	xmlHttp.send (null);
}
/**/

function getqueryString(){
	var str1 = document.getElementById('str1').value;
	var str2 = document.getElementById('str2').value;
	var queryString = 'str1=' + escape(str1) + '&str2=' + escape(str2);	
	return queryString;
}

function startRequestPost(str1,str2) {
	divid = str1;
	activeid = str2;
	createXMLHttpRequest();
	var queryString = getqueryString();
	//alert(queryString);
	xmlHttp.onreadystatechange = Change;
	xmlHttp.open ("POST",activeid,true);
	xmlHttp.setRequestHeader("content-type","application/x-www-form-urlencoded;");
	xmlHttp.send (queryString);
}

function Change () {
	if (xmlHttp.readyState == 4) {
		if (xmlHttp.status == 200 ) {
			document.getElementById(divid).innerHTML = xmlHttp.responseText;
			}
		}
}

