﻿<!--
function checkreg()
{
  if (document.all("username").value=="")
	{
	alert("请填写用户名！");
	document.all("username").focus();
	return false;
	}
  else
    {
	document.reg.CheckName.value=document.all("username").value;
	//var popupWin = window.open('about:blank', 'CheckName', 'scrollbars=no,width=300,height=150');
    window.open("check_username.asp?username="+reg.CheckName.value, 'CheckName', 'scrollbars=no,width=300,height=150');
	//document.reg.submit();
        // window.open("check_username.asp?username="+uid,"top","width=640,height=400");     
	}
}
function del_space(s)
{
	for(i=0;i<s.length;++i)
	{
	 if(s.charAt(i)!=" ")
		break;
	}

	for(j=s.length-1;j>=0;--j)
	{
	 if(s.charAt(j)!=" ")
		break;
	}

	return s.substring(i,++j);
}

function VerifySubmit()
{
    
	username = del_space(document.all("username").value);
     if (username.length == 0)
     {
        alert("请填写用户名！");
        document.all("username").focus();
	return false;
     }
	password = document.all("password").value;
     if (password.length == 0)
     {
        alert("请填写密码！");
        document.all("password").focus();
	return false;
     }
	password2 = document.all("password2").value;
     if (password2!=password)
     {
        alert("两次输入的密码不相同，请重新填写！");
        document.all("password").focus();
		return false;
     }
	 question = del_space(document.all("question").value);
     if (question.length == 0)
     {
        alert("请选择密码提示问题！");
        document.all("question").focus();
        return false;
     }
	 answer = del_space(document.all("answer").value);
     if (answer.length == 0)
     {
        alert("请填写密码提示答案！");
        document.all("answer").focus();
        return false;
     }
	name = del_space(document.all("name").value);
     if (name.length == 0)
     {
        alert("请填写您的姓名！");
        document.all("name").focus();
        return false;
     }
	return true;
}
function chkint(sId)
{
	if(/[^0-9]/g.test(sId.value))
	{
		alert("非法输入，输入格式应该为整数（如：3100）！");
		while(/[^0-9]/g.test(sId.value))
		sId.value=sId.value.substring(0,sId.value.length-1);
		return false;
	}
}
//-->