var vimg = document.getElementById('validate_img');
if(vimg){
    vimg.onclick = function(){
        this.src = '/function/fun_validate.php#'+(new Date()).getTime();
    }
}
function reg_simple_check(f){
    //以前曾经允许注册5位的用户名.而现在至少有6位.
    //因此登录和注册时的验证不一样.
    var reg = /^[a-z0-9]+$/i;
    if(!(reg.test(f.username.value))){
        alert('用户名格式错误');
        f.username.focus();
        return false;
    }
    if(!(reg.test(f.userpass.value))){
        alert('密码格式错误');
        f.userpass.focus();
        return false;
    }
    if(!c_validatecode(f.validateCode.value)){
        alert('验证码格式错误');
        f.validateCode.focus();
        return false;
    }
    return true;
}