jQuery callbacks optimization
I don't understand the need for 

function() {
    if (f) f();
}


put f instead of that whole thing. If it is undefined it won't get called.

e.g

.bind('show',function(event, f) {
    $(this).animate({right:0}, lag + 200, f);
});


Another thought came to me. The functions you use could be factored and used like:

function animateRight(event, f, rightValue, delay)
{
    $(this).animate({right: rightValue}, lag + delay, f);
}


(or if you can't pass that information in:

function animateRight(event, f, rightValue, delay)
{
    return new function()
    {
        $(this).animate({right: rightValue}, lag + delay, f);
    }
}