//person register step 1: 2004-06-30 08:06:48 

function checkThisForm() 
{
   
    if(!document.thisForm.memberClass[0].checked) {
        if(!document.thisForm.memberClass[1].checked)	{
            alert("请选择您注册的会员的类型!");
            document.thisForm.memberClass[0].focus();
            return false;
        }
    }
    if(document.thisForm.username.value=="") {
        alert("请填写用户名!");
        document.thisForm.username.focus();
        return false;
    }

    if( 6 > len(document.thisForm.username.value)) {
        alert("用户名长度不能低于6个字符!");
        document.thisForm.username.focus();
        return false;
    }

    /*if(!isStr(document.thisForm.username.value)) {
        alert("请填写英文字母，数字或下划线!");
        document.thisForm.username.focus();
        return false;
    }*/
    if(document.thisForm.password.value=="") {
        alert("请填写密码!");
        document.thisForm.password.focus();
        return false;
    }

    if(!isStr(document.thisForm.password.value)) {
        alert("请填写英文字母，数字或下划线!");
        document.thisForm.password.focus();
        return false;
    }

    if(document.thisForm.password.value.length < 6) {
        alert("密码长度不能小于六位,请修改!");
        document.thisForm.password.focus();
        return false;
    }

    if(!isStr(document.thisForm.confirmPassword.value)) {
        alert("请填写英文字母，数字或下划线!");
        document.thisForm.confirmPassword.focus();
        return false;
    }

    if(document.thisForm.confirmPassword.value.length < 6) {
        alert("密码长度不能小于六位,请修改!");
        document.thisForm.confirmPassword.focus();
        return false;
    }

    if(document.thisForm.password.value==document.thisForm.username.value) {
        alert("用户名和口令不能一样,请修改!");
        document.thisForm.password.focus();
        return false;
    }

    if(document.thisForm.password.value != document.thisForm.confirmPassword.value) {
        alert("密码与确认密码不匹配，请重新填写!");
        document.thisForm.password.focus();
        return false;
    }
    if(document.thisForm.email.value=="") {
        alert("请填写邮件地址!");
        document.thisForm.email.focus();
        return false;
    }
    if(!isEmail(document.thisForm.email.value)) {
        alert("对不起,您输入的电子邮件可能不正确!\n如果，您使用的是我们系统无法识别的电子邮件地址，请和我们联系!");
        document.thisForm.email.focus();
        return false;
    }

    document.thisForm.submit();
}



function check_user()
{
    if(document.thisForm.username.value=="")
    {
        alert("请填写用户名!");
        document.thisForm.username.focus();
        return false;
    }

    if(6>len(document.thisForm.username.value))
    {
        alert("用户名长度不能低于6个字符!");
        document.thisForm.username.focus();
        return false;
    }

   /* if (!isStr(document.thisForm.username.value))
    {
        msg="对不起，用户名必须为6个以上的英文字母或数字！\n注意：您不能使用汉字、汉字字符以及非法字符（包括：空格、#、%等）当作用户名！";
        alert(msg);
        document.thisForm.username.focus();
        return false;
    }
*/
    var feature = "dialogHeight:250px;dialogWidth:470px;dialogTop:100px; center:yes;scroll:no;status:no;resizable:yes;edge:raised;help:no;unadorned:no";
    //var feature = "center=yes; dialogWidth=470px; dialogHeight=250px; help=no;status=no; resizable=no";
    var returnValue = window.showModalDialog("/my/check_uk_user_email.jsp?username="+document.thisForm.username.value, "东江人才提醒您", feature);

    alert(returnValue);
    if(returnValue=="对不起!该用户名已经有人注册"){
    	 document.thisForm.email.focus();
    }
    return true ;
}

function check_email()
{
    if(len(document.thisForm.email.value)<3)
    {
        alert("请输入电子邮件!");
        document.thisForm.email.focus();
        return false;
    }

    if (!isEmail(document.thisForm.email.value))
    {
        msg="对不起,您输入的电子邮件可能不正确！\n如果，您使用的是我们系统无法识别的电子邮件地址，请和我们联系！";
        alert(msg);
        document.thisForm.email.focus();
        return false;
    }

    var feature = "dialogHeight:250px;dialogWidth:470px;dialogTop:100px; center:yes;scroll:no;status:no;resizable:yes;edge:raised;help:no;unadorned:no";
    //var feature = "center=yes; dialogWidth=470px; dialogHeight=250px; help=no;status=no; resizable=no";
    var returnValue = window.showModalDialog("/my/check_uk_user_email.jsp?email="+document.thisForm.email.value, "东江人才提醒您", feature);
    //if(returnValue<=0) document.thisForm.step2.focus();
    alert(returnValue);
    if(returnValue=="对不起!该Email已经有人注册"){
    	 document.thisForm.email.focus();
    }
    //else document.thisForm.email.focus();
    return true;
}
