$(function () {
  $('#home .banner li')
    .each(function () {
      var $this = $(this);

      $this
        .hover(
          function (e) {
            $this
              .find('img')
              .animate({ opacity: 0.7 }, { duration: 200, queue: false });

            $tooltip = $this.find('.tooltip');

            if ($tooltip.length > 0) {
              $('#home_tooltip').remove();

              $('<div id="home_tooltip">' + $tooltip.html() + '</div>')
              .css({
                top: (e.pageY - 117),
                left: (e.pageX - 84),
                opacity: 0
              })
              .appendTo('body')
              .animate({ opacity: 1 }, { duration: 200, queue: false });
            }

          }, function () {
            $this
              .find('img')
              .animate({ opacity: 1 }, { duration: 200, queue: false });

            $('#home_tooltip')
              .animate({ opacity: 0 }, { duration: 200, queue: false, complete: function () { $(this).remove(); } }); ;
          })
        .mousemove(function (e) {
          $('#home_tooltip')
            .css({
              top: (e.pageY - 117),
              left: (e.pageX - 84)
            })
        });
    });
});
