function checkLogin(){
var loader = $('#loader');
var notif = $('#notif');
var print_a = $('#print_a');
var er = [];
//er[0] = "Такая пара логин/пароль не зарегистрированы";
er[0] = "Нет ответа сервера, повторите попытку позднее";
var options = {
type: "post",
dataType: "json",
url: "/models/ajax.php",
beforeSubmit: function (){
notif.fadeOut(200);
loader.show();
},
success: function (result){
if (result && result['status'] == '1'){
loader.hide();
window.location.href = "/kabinet/";
} else {
loader.hide();
if (result && result['message']){
notif.html(result['message'][0]);
} else {
notif.html(er[0]);
}
notif.fadeIn(200);
}
}
}
$('#formauth').submit(function(){
$(this).ajaxSubmit(options);
return false;
});
print_a.click(function (){
$('head').append('');
$('body').append('
');
window.print();
window.setTimeout(function (){
$('.img_print').remove();
}, 0);
return false;
});
}