/*  Razor JavaScript framework, version 1.0.0
 *
 *	Author: YuYanxin
 *  Date:   2009-04-18
 *  So that a more simple JavaScript
 *
 *--------------------------------------------------------------------------*/

function $(sID) {
  return document.getElementById(sID);
}

function $s(sID) {
  return document.getElementById(sID).style;
}

var xmlHttp = false;

function Ajax(sURL,dele) {
	try {
		
		xmlHttp = new XMLHttpRequest();
	} 
	catch (trymicrosoft) {
		
		try {
			
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (othermicrosoft) {
			
			try {
				
				xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (failed) {
				
					xmlHttp = false;
			}
		}
	}
	if (!xmlHttp) {
		alert("request failed");
	}
	else {
		var url = sURL;
		xmlHttp.open("GET", url, true);	//这里的true代表是异步请求
		xmlHttp.onreadystatechange = dele;	//委托方法名称	
		xmlHttp.send(null);
	}
}
/*委托示例(接收AJAX返回数据)
function deleName() {
	if (xmlHttp.readyState == 4) {
		var response = xmlHttp.responseText;	//得到返回字符串
		alert(response);
	}
}*/
