jQuery handler for closing a login box
You could combine the calls:

if ($(this).closest('div.login-box')
           .slideToggle("400")
           .attr('id'))


However, I do not recommend this.
Although it will work, it's unnecessarily confusing.