$(function(){
    //FB login
    $('a.facebook-login').live('click', function(e){
        e.preventDefault();
        FB.login(function(response){ }, { scope: 'email,publish_stream' });
    });
    
    /*$('.facebook-admin-permissions').live('click', function(e){
        e.preventDefault();
        var $target = $(this);
        FB.login(function(response){
            if (response.session) {
                $target.removeClass('facebook-admin-permissions');
                $target.click();
            }
        }, { perms: 'offline_access' });
    });*/

    // logout from FB
    $('a.facebook-logout').live('click', function(e) {
        if (FB.getAccessToken()) {
            e.preventDefault();
            var href = $(this).attr('href');
            FB.logout(function(response){
                window.location.href = href;
            });
        }
    });

    $('#menu>ul>li>a').each(function(){
        $(this).removeAttr('title');
    })
    
    
    $('dl.more').prev('a').toggle(function(e){
        e.preventDefault();
        window.location.hash = 'more';
        $(this).next().slideDown(500, function(){
            $(this).fadeTo(300, 1);
        });
    }, function(e){
        e.preventDefault();
        window.location.hash = 'less';
        $(this).next().fadeTo(300, 0, function(){
            $(this).slideUp(500);
        });
    });

});
