$(document).bind("click", function(event) {
    $("div.custom-menu").hide();
});