//depends on loginForm.js
$(function(){
    $("#recommendDiv").hide();
    $("#homemenu .recommend").unbind("hover").hover(function(){
        $(this).addClass("recommendOver");
    },function(){
        $(this).removeClass("recommendOver");
    }).unbind("click").click(function(){
        if(ajax.currentUser!=undefined && ajax.currentUser.userHash!=undefined){
            var url="http://"+window.location.host+""+wsUrl+"/invitation/"+ajax.currentUser.userHash;
            $("#recommendLink").attr("value",url);
            $("#recommendDiv").slideToggle();
        }
    });
    
    $("#recommendLink").click(function(){
        $(this).focus();
        $(this).select();
    })
    
    $("#recommendDiv .close img").click(function(){
        $("#recommendDiv").slideToggle();
    });
});
