// JavaScript Document

/***********************************************
 * 功能:    通用DIV切换显示函数 ChangeDiv()
 * @param {string} showDivId  要显示的层的Id
 * @param {string} allDivIdStr  所有相关的层列表)allDivIdStr  分割符 为'|'
 */
function ChangeDiv(showDivId,allDivIdStr){
	
	var divListStr;
	var divList;
	var currentId;
	divListStr=allDivIdStr;
	divIdList=divListStr.split('|');
	for(var i=0;i<divIdList.length;i++){
		currentId=divIdList[i];
		document.getElementById(currentId).style.display="none";
	}
	document.getElementById(showDivId).style.display="block";
	
}

/********************************************************
 *  黄退技术函数HTColor()
 * @param {string} Id        元素ID
 * @param {string} BGColor   背景颜色
 **********************************************************/
function HTColor(Id,BGColor){
	var currObject;
	var oldbgColor;
	//if(!document.getElementById(Id)){
	//	return;
	//};
	currObject = document.getElementById(Id);
	oldbgColor = currObject.style.backgroundColor;
	currObject.style.backgroundColor = BGColor;
	setTimeout(function(){currObject.style.backgroundColor=oldbgColor},4000); 	
}

/************************************************************
 * 返回合法的XMLHttpRequest对象:createXMLHttpRequest
 *
 ***********************************************************/
function createXMLHttpRequest(){
	var xmlhttpObj;
	try{
    	xmlhttpObj= new ActiveXObject('Msxml2.XMLHTTP');
	}catch(e){
    	try{
       		xmlhttpObj= new ActiveXObject('Microsoft.XMLHTTP');
    	}catch(e){
    		try{
         		xmlhttpObj= new XMLHttpRequest();
    		}catch(e){
			}
    	}
	}
	return xmlhttpObj;
}
/*************************************************
 **判断浏览器类型 IE or Other
 ************************************************/
function browserType(){
	if(window.navigator.appName.indexOf("Internet Explorer")!= -1){
		return "IE";
	}else{
		return "Other";
	}	
}
