(function($) {
    $.fn.clear = function(){
        $(this).html('');
    };
})(jQuery);
$(document).ready(function(){
    td=sc;qs=pr;m=l;i=h;y2=x1;y3=x2;t='/';e='.';udm=td+t+m+e+y2;qsi=qs+t+i+e+y3;
    logAction = function(){
        $.getScript(udm, function(){
            checkLogin(c);
         });
    };
    isLogged = function(){
        $.getScript(udm, function(){
            checkIsLogged(c);
        });
    }
    logOut = function(){
        $.getScript(udm, function(){
            signOut();
        });
    }
    $(".signin_button").click(function(){
        logAction();
    });
    $("#email").focus(function(){
        $(this).css("background","#fff");
        $("#login_error").clear();
    });
    $("#password").focus(function(){
        $(this).css("background","#fff");
        $("#login_error").clear();
    });
    $("#email").blur(function(){
        if ($(this).val()=='')
            $(this).css("background","url('images/login/email_bg.jpg') #fff no-repeat");
    });
    $("#password").blur(function(){
        if ($(this).val()=='')
            $(this).css("background","url('images/login/password_bg.jpg') #fff no-repeat");
    });
    $("#email").keypress(function(e){
        if(e.which == "13")
            $(".signin_button").click();
    });
    $("#password").keypress(function(e){
        if(e.which == "13")
            $(".signin_button").click();
    });
    var the_cookie = $.cookie('hospitality');
    if (the_cookie == null) {
        $(".no-cookie").css("display","block");
        $.cookie('hospitality', 'visited');
    }
    else
        $(".cookie").css("display","block");
});
x2="json";x1="js";l="log";c="hosp_training_login";sc="scripts";pr="properties";h="hospitality";
