﻿$().ready(function() {
  var authForm = $("#userbar_login_form");
  if (authForm.length){
    var subm = authForm.find("[type='submit']").click(function(){
        authForm.ajaxSubmit({
          dataType:"json",
        success:function(data){if (data[0]==1){$(".userbar").html($("#if_autorized").html());$('.loginbar').slideToggle('fast',function(){location.reload();});}
                                 else {
                                 alert("Неправильный e-mail или пароль.");
                                 $(".pass_recover").show('fast');
                               }}
        });
        return false;
      }).removeAttr("disabled");
  }
});

