      $(function() {

          var $el, leftPos, newWidth,
          $mainNav = $("#example-one");

          $mainNav.append("<li id='magic-line'></li>");
          var $magicLine = $("#magic-line");

          $magicLine
          .width($(".current_page_item").width()-20)
          .css("left", $(".current_page_item a").position().left+10)
          .data("origLeft", $magicLine.position().left)
          .data("origWidth", $magicLine.width());

$el = $(".current_page_item a");
leftPos = $el.position().left+10;
newWidth = $el.parent().width()-20;
$magicLine.stop().animate({ left: leftPos, width: newWidth });

          $("#example-one li a").hover(function() {
            $el = $(this);
            if ($el.hasClass('subnav'))
              $el = $('#product-nav-link');

            leftPos = $el.position().left+10;
            newWidth = $el.parent().width()-20;
            $magicLine.stop().animate({
left: leftPos,
width: newWidth
});
            }, function() {
            $magicLine.stop().animate({
left: $magicLine.data("origLeft"),
width: $magicLine.data("origWidth")
});
            });
});

