
var userAgent = navigator.userAgent.toLowerCase();
var is_opera = userAgent.indexOf('opera') != -1 && opera.version();
var is_moz = (navigator.product == 'Gecko') && userAgent.substr(userAgent.indexOf('firefox') + 8, 3);
var is_ie = (userAgent.indexOf('msie') != -1 && !is_opera) && userAgent.substr(userAgent.indexOf('msie') + 5, 3);

var ietype="";
if(document.getElementById)
{
ietype="Public";
}
else if(document.all)
{
ietype="IE4"
}
else if(document.layers)
{
ietype="NS4"
}

function $(obj){
switch(ietype)
{
  case "Public":
  {
   return document.getElementById(obj);
  }
   break;
  case "IE4":
  {
   return document.all[obj];
  }
   break;
  case "NS4":
  {
   return document.layers[obj];
  }
   break;
}
}


window.onerror = function(m,u,l){
	//alert("脚本错误发生错误\n如果该错误影响了功能的正常使用,请立刻和系统管理员联系.\n\n提示信息:\n-----------------------------\n-错误描述:"+m+"\n-错误源:"+u+"\n-错误行:"+l)	;
	return true;
}

function createxmlhttp()
{
	xmlhttpobj = false;
	try{
		xmlhttpobj = new XMLHttpRequest;
	}catch(e){
		try{
			xmlhttpobj=new ActiveXObject("MSXML2.XMLHTTP");
		}catch(e2){
			try{
				xmlhttpobj=new ActiveXObject("Microsoft.XMLHTTP");
			}catch(e3){
				xmlhttpobj = false;
			}
		}
	}
	return xmlhttpobj;
	
}

function xmlobjpost(url,act){
	var xmlobj;
	xmlobj=createxmlhttp();
	xmlobj.open("post",url,true);
	xmlobj.setRequestHeader("Content-Type","gb2312"); 
	xmlobj.onreadystatechange=function(){
			if (xmlobj.readyState==4){
				if (xmlobj.status==200){
					act(xmlobj.responseText);
				}
			}
	};
	xmlobj.send(null);
}

