/*
'######################################
'## Copyright (C) 2008 lg2lg5 All rights reserved.
'## Powered by lg2lg5
'## http://www.lg2lg5.cn
'## lg2lg5@163.com
'######################################
*/





/*
************************************************************************************************************************************
***函数名  : createXMLHttpRequest
***函数说明: 实例化为XMLHTTP对象
***参数    : 
				objType			: 对象类型
				objID			: 对象ID
				objContentID	: 对象内容中控件ID
				sURL			: URL地址
				bBoolean		: 布尔值(表示同步/异步)
				ReturnFunction	: 回调函数
***返回值  : 实例化的XMLHTTP对象
*/
function createXMLHttpRequest(objType, objID, objContentID, sURL, bBoolean, ReturnFunction) {
	var xmlHttp = null;
	if (window.XMLHttpRequest)	{    //Mozilla Firefox 浏览器
		xmlHttp = new XMLHttpRequest();
	}
	else {   //IE 浏览器
		if (window.ActiveXObject) {
			try {
				xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e) {
				xmlHttp = null;
			}
		}
	}
	if (xmlHttp) {
		xmlHttp.onreadystatechange = function() {
			if (xmlHttp.readyState==4) {
				if (xmlHttp.status==200) {
					try {
						ReturnFunction(objType, objID, objContentID, xmlHttp.responseText);
					}
					catch (exception) {
						if (exception.description.indexOf("-1072896748")>0) {
							return "";
						}
					}
				}
			}
		}
		xmlHttp.open("GET", sURL, bBoolean);
		xmlHttp.send(null);
	}
	else {
		return "";
	}
}





function ReturnFunction(objType, objID, objContentID, ReturnValue) {
	if (objID) {
		switch (objType.toLowerCase()) {
			case "div" :
				document.getElementById(objID).removeChild(document.getElementById(objContentID)); //清除DIV中的内容
				document.getElementById(objID).innerHTML = ReturnValue;
				break;
			case "input" :
				document.getElementById(objID).value = ReturnValue;
				break;
			default :
				break;
		}
	}
	return;
}