jQuery(function ($) { $("#world, #russia").bind("mouseover mouseout", function (event) { $(".tooltip", this)[ {mouseover : "fadeIn", mouseout : "fadeOut"}[event.type] ](200); }); });