$("#login").change(function(){
login = $("#login").val();
var expLogin = /^[a-zA-Z0-9_]+$/g;
var resLogin = login.search(expLogin);
if(resLogin == -1){
$("#login").next().hide().text("Неверный логин").css("color","red").
fadeIn(400);
$("#login").removeClass().addClass("inputRed");
loginStat = 0;
buttonOnAndOff();
}else{
loginStat = 1;
buttonOnAndOff();
}
function buttonOnAndOff(){
if(loginStat == 1){
$("#submit").removeAttr("disabled");
}else{
$("#submit").attr("disabled","disabled");
}
}