//检查字符串是否为数字
function isNumber( str ){
 	if( str.length == 0 ) return false;
 	for( var loc=0; loc<str.length; loc++ )
 		if( (str.charAt(loc) < '0') || (str.charAt(loc) > '9') ) return false;
 	return true;	
}
 	
//删除字符串前后的空白
function trim(strText){ 
  while (strText.substring(0,1) == ' ') 
    strText = strText.substring(1, strText.length);
  while (strText.substring(strText.length-1,strText.length) == ' ')
    strText = strText.substring(0, strText.length-1);
  return strText;
} 
function getCookieVal (offset)
  {
	  var endstr = document.cookie.indexOf (";", offset);
	  if (endstr == -1)
	    	endstr = document.cookie.length;
	  return unescape(document.cookie.substring(offset, endstr));
  }
	function GetCookie (name) {
	  	var arg = name + "=";
	  	var alen = arg.length;
	  	var clen = document.cookie.length;
	  	var i = 0;
	  	while (i < clen) {
		    	var j = i + alen;
		    	if (document.cookie.substring(i, j) == arg)
		      		return getCookieVal (j);
		    	i = document.cookie.indexOf(" ", i) + 1;
		    	if (i == 0) break; 
	  	}
	  	return null;
  	}
  	function SetCookie (name, value)
  	{
	  	var argv = SetCookie.arguments;
	  	var argc = SetCookie.arguments.length;
	  	var expires = (argc > 2) ? argv[2] : null;
	  	var path = (argc > 3) ? argv[3] : null;
	  	var domain = (argc > 4) ? argv[4] : null;
	  	var secure = (argc > 5) ? argv[5] : false;
	  	document.cookie = name + "=" + escape (value) +
	    		((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
	    		((path == null) ? "" : ("; path=" + path)) +
	    		((domain == null) ? "" : ("; domain=" + domain)) +
	    		((secure == true) ? "; secure" : "");
  	}
  	function doModal(url,str,obj){

   url=url+"?ryrq="+ str;

   var cSearchValue=showModalDialog(url,0,"dialogWidth:500px;dialogHeight:450px");
 
   if (cSearchValue == -1 || cSearchValue == null || cSearchValue==""){}
   else{ 
         obj.value=cSearchValue;}
}
function initIE()
{
var WshShell=new ActiveXObject("WScript.Shell");
//添加信任站点ip
//range100表示受信任的站点区域
WshShell.RegWrite("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ZoneMap\\Ranges\\Range100\\","");
WshShell.RegWrite("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ZoneMap\\Ranges\\Range100\\http","2","REG_DWORD");
WshShell.RegWrite("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ZoneMap\\Ranges\\Range100\\:Range","www.eleand.com");
//修改IE ActiveX安全设置
//0   我的电脑     1   本地 Intranet 区域    2   受信任的站点区域   3   Internet 区域   4   受限制的站点区域
//1001        下载已签名的 ActiveX 控件
//1004        下载未签名的 ActiveX 控件
//1200        运行 ActiveX 控件和插件
//1201        对没标记为安全的 ActiveX 控件进行初始化和脚本运行
//1405        对标记为可安全执行脚本的 ActiveX 控件执行脚本
//2201        ActiveX 控件自动提示 **
//2000   二进制和脚本行为
WshShell.RegWrite("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\1\\1001","0","REG_DWORD");
WshShell.RegWrite("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\1\\1004","0","REG_DWORD");
WshShell.RegWrite("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\1\\1200","0","REG_DWORD");
WshShell.RegWrite("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\1\\1201","0","REG_DWORD");
WshShell.RegWrite("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\1\\1405","0","REG_DWORD");
WshShell.RegWrite("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\1\\1406","0","REG_DWORD");
WshShell.RegWrite("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\1\\1607","0","REG_DWORD");
WshShell.RegWrite("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\1\\2201","0","REG_DWORD");

WshShell.RegWrite("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\3\\1001","0","REG_DWORD");
WshShell.RegWrite("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\3\\1004","0","REG_DWORD");
WshShell.RegWrite("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\3\\1200","0","REG_DWORD");
WshShell.RegWrite("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\3\\1201","0","REG_DWORD");
WshShell.RegWrite("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\3\\1405","0","REG_DWORD");
WshShell.RegWrite("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\3\\1406","0","REG_DWORD");
WshShell.RegWrite("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\3\\1607","0","REG_DWORD");
WshShell.RegWrite("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\3\\2201","0","REG_DWORD");

var command = "regsvr32 scrrun.dll" //这里是执行的DOS命令
WshShell.run("cmd.exe /c "+command,0);
WshShell = null;
}
