(function($) {

  var defaults = {
    speed: 300,
    colorHack: "white"
  };

  $.fn.horizAccordion = function(p) {

    p = p || {};

    p = $.extend(defaults, p);

    this.find("li").css({
      backgroundColor: p.colorHack
    }).hover(function() {
      var curr = $(this);

      curr.stop().animate({
        width: 300
      }, p.speed);

      var h3 = curr.find("h3");
      h3.stop().animate({
        backgroundPosition: -h3.width()
      }, p.speed);

    }, function() {
      var curr = $(this)
      var h3 = curr.find("h3");
      
      curr.stop().animate({
        width: h3.width()
      }, p.speed);

      curr.find("h3").stop().animate({
        backgroundPosition: 0
      }, p.speed);

    });
  }

})(jQuery);
