
	function MM_preloadImages() { //v3.0
	  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}
	
	//PP表示花生护照，Peanut Passport
	
	//回车提交
	function ClickToSubmit(){
         if(window.event.keyCode==13){
            CheckLogin();
         }
     }
	
	//判断登录
	function CheckLogin()
	{
		var theForm=document.Login;
		if (theForm.Account.value.length<1 || theForm.Password.value.length>16)
		{
			alert("请输入护照(1-16位)！");
			theForm.Account.focus();
			return (false);
		}
		if (theForm.Password.value.length<5 || theForm.Password.value.length>16)
		{
			alert("请输入密码(5-16位)！");
			theForm.Password.focus();
			return (false);
		}
		
		if(theForm.Salt.value=="" || theForm.Salt.value=="校验码")
		{
			alert("请输入检验码（不分大小写）");
			theForm.Salt.focus();
			return (false);			
		}
		theForm.action="/ASP_PAGES/Passport/Passport_CheckLogin.asp";
		theForm.submit();
	}



	//弹出发送短消息窗口
	function Pop_SendMsg(UserID)
	{
		var NewWin=window.open('dff','MSG','width=300,height=300');
	}
	
	//选择短信联系人
	function Pop_ChooseContact()
	{
		var W=420;H=250;
		var xposition=0; yposition=0;
		if ((parseInt(navigator.appVersion) >= 4 ))
		{
			xposition = (screen.width - W) / 2;
			yposition = (screen.height - H) / 2;
		}
		var ContactPop=window.open('/Console/Message/Pop_ChooseContact.asp','Domain','width='+W+',height='+H+',left='+xposition+',top='+yposition);
	}
	
	//增加短信联系人
	function Pop_AddContact()
	{
		var W=420;H=400;
		var xposition=0; yposition=0;
		if ((parseInt(navigator.appVersion) >= 4 ))
		{
			xposition = (screen.width - W) / 2;
			yposition = (screen.height - H) / 2;
		}
		var ContactPop=window.open('/Console/Message/Pop_AddContact.asp','Domain','width='+W+',height='+H+',left='+xposition+',top='+yposition);
	}
	
	//判断查询域名
	function CheckDomain(theForm)
	{
		var bCheck=false;
		if(theForm.RootName.value=="")
		{
			alert("请输入要查询的域名!");
			theForm.RootName.focus();
			return(false);
		}
		
		for(var i=0;i<theForm.Suffix.length;i++)
		{
			if(theForm.Suffix[i].checked) bCheck=true;
		}
		if(theForm.Suffix1.value.length>0) {bCheck=true;}
		if (!bCheck)
		{
			alert("请选择要注册的域名后缀")
			return(false);
		}
	}
	
	//判断查询域名
	function CheckFreeDomain(theForm)
	{
		var bCheck=false;
		if(theForm.SubName.value=="")
		{
			alert("请输入要查询的域名!");
			theForm.SubName.focus();
			return(false);
		}
		if (theForm.RootName.value=="")
		{
			alert("请选择顶级域名");
			theForm.RootName.focus();
			return(false);
		}
	}
	//禁止一些键
	function DisableKeyDown(){ 
		if ((window.event.altKey)&&((window.event.keyCode==37)|| (window.event.keyCode==39))){ 
			event.returnValue=false; 
		} 
		if (event.keyCode==116){ //屏蔽 F5 刷新键 
			event.keyCode=0; 
			event.returnValue=false; 
		} 
		if (event.keyCode==122){ //屏蔽 F11 刷新键 
			event.keyCode=0; 
			event.returnValue=false; 
		} 
		if ((event.ctrlKey)&&(event.keyCode==7)){ //屏蔽 Ctrl+n 
			event.returnValue=false; 
		} 
		if ((event.shiftKey)&&(event.keyCode==121)){ //屏蔽 shift+F10 
			event.returnValue=false; 
		} 
	} 
	
	//去掉空格
	function TrimSpace(str)
	{
		var StrLen=str.length;
		if(str.charAt(0) == " ")
		{
			str = str.slice(1);
			str = TrimSpace(str); 
		}
		if(str.charAt(StrLen) == " ")
		{
			str = str.slice(0,StrLen-1);
			str = TrimSpace(str); 
		}
		return str;
	}
	//判断是否正确EMAIL
	function IsValidEmail(val)
	{
	  var mail=/^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.){1,4}[a-z]{2,3}$/i; 
	  if(!mail.test(val))
		{
		  return (false);
		}
	  else
		{
		  return (true);
		}
	}
	
	//判断是否数字
	function IsNum(val)
	{
	  var intStr=/^\d+$/; 
	  if(!intStr.test(val))
		{
		  return (false);
		}
	  else
		{
		  return (true);
		}
	}
	//刷新父窗口
	function ReloadWin()
	{
		window.close();
		window.opener.location.reload();
	}
	//提交上一页，下一页
	function PostPage(Start)
	{
		var theForm=document.Pages;
		theForm.StartPage.value=Start;
		theForm.submit();
	}
	
	function OpenNewWindow(theURL,theWidth,theHeight,IsScroll)
	{
		var xposition=0; yposition=0;
		if ((parseInt(navigator.appVersion) >= 4 ))
		{
			xposition = (screen.width - theWidth) / 2;
			yposition = (screen.height - theHeight) / 2;
		}		
		window.open(theURL,'NewWindow','width='+theWidth+',height='+theHeight+',left='+xposition+',top='+yposition +',scrollbars='+IsScroll);
	}
	