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