(function() {

  if (window.dM == null) window.dM = {};

  window.dM.magicHover = {
    enter: function() {
      $(this).stop();
      return $(this).animate($(this).data("animation").hover, 300);
    },
    leave: function() {
      $(this).stop();
      return $(this).animate($(this).data("animation").source, 600);
    }
  };

  $.fn.dMHover = function(property, hover, source) {
    $(this).css(property, source);
    $(this).data("animation", {
      hover: [],
      source: []
    });
    $(this).data("animation").hover[property] = hover;
    $(this).data("animation").source[property] = source;
    $(this).bind("mouseenter", dM.magicHover.enter);
    return $(this).bind("mouseleave", dM.magicHover.leave);
  };

}).call(this);

