$(function () {
    $('.bubbleInfo').each(function () {
        var trigger = $('.trigger', this);
        var popup = $('.popup', this).css('display', 'none');
        var close = $('.close', this).css('display', 'none');

        // set the mouseover and mouseout on both element
        $([trigger.get(0), close.get(0)]).click(function () {

            popup.slideDown('fast');
            popup.css('display', 'block');
            setTimeout(function () { close.css('display', 'block'); }, 150);
            setTimeout(function () { trigger.css('display', 'none'); }, 150);
            return false;
        })
        $([close.get(0)]).click(function () {
            popup.slideUp('fast');
            setTimeout(function(){trigger.css('display', 'block');}, 150);
            setTimeout(function () { close.css('display', 'none'); }, 150);
            return false;
        });
    });
});
