
function goNext(f) {

//alert(f);
 //var f = document.login_cli; 
 if ((f.cl_login.value=="")||(f.cl_passwd.value=="")) {
   alert("Введите Ваш e-mail и/или пароль !");
   return false;   
 }
 //alert("next");
 if (!valid_email(f.cl_login.value)) {
        alert("Неверно введен адрес электронной почты (e-mail)!");
        return false;
 }
 //alert("submit");
 f.submit();
 return true;
}

function valid_email(email_address) {
    // Create the regular expression
    var reg_exp = /^[a-z][\w\.]*@[\w\.-]+\.[a-z]{2,3}/i
    if(reg_exp.test(email_address)) {
        return true;
    }
    return false;   
}
/*function valid_email(email_address) {
    if (email_address.length < 5) {
        return false
    }  
    at_location = email_address.indexOf("@")
    dot_location = email_address.lastIndexOf(".")
    if (at_location == -1 || dot_location == -1 || at_location > dot_location ) {
        return false
    }
    if (at_location == 0) {
        return false
    }
    if (dot_location - at_location < 2 ) {
        return false
    }
    if (email_address.length - dot_location < 2) {
        return false
    }
    return true
}
*/
