﻿var xmlHttp;
var out = "";

//在不同的浏览器下创建XmlHttpRequest对象,
function createXmlHttpRequest(){
	if(window.ActiveXObject){
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");		
	}
	else if(window.XMLHttpRequest){
		xmlHttp = new XMLHttpRequest();
	}	
}

//发送请求
function startRequest(strurl,parm,bool){
	createXmlHttpRequest();
	//xmlHttp.onreadystatechange = handleStateChange;
	xmlHttp.open("GET", strurl, bool);
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	xmlHttp.send(parm);
	out = xmlHttp.responseText;
}

function SetAjaxInnerHTML(strurl,ID)
{
	out="";
	startRequest(strurl,"", false);
	o(ID).innerHTML = out;
	out="";
	
}
function GetAjaxValue(strurl)
{
	out="";
	startRequest(strurl,"", false);
	return out;
	}
function o(strId)
{
	if(document.all(strId))
		return document.all(strId);
	else if(document.getElementById(strId))
	return document.getElementById(strId);
	else if(document.getElementsByName(strId))
		return document.getElementsByName(strId);
	else
	return null;
}