// DOM Ready
$(function() {

    var $el2, leftPos2, newWidth2;
        $mainNav2 = $("#example-two2");
    
    /*
        EXAMPLE TWO
    */
    
    $mainNav2.append("<li id='magic-line-two2'></li>");
    
    var $magicLineTwo2 = $("#magic-line-two2");
    
    $magicLineTwo2
        .width($(".current_page_item_two2").width())
        .height($mainNav2.height())
        .css("left", $(".current_page_item_two2 a").position().left)
        .data("origLeft", $(".current_page_item_two2 a").position().left)
        .data("origWidth", $magicLineTwo2.width())
        .data("origColor", $(".current_page_item_two2 a").attr("rel"));
                
    $("#example-two2 a").hover(function() {
        $el2 = $(this);
        leftPos = $el2.position().left;
        newWidth = $el2.parent().width();
        $magicLineTwo2.stop().animate({
            left: leftPos,
            width: newWidth,
            backgroundColor: $el2.attr("rel")
        })
    }, function() {
        $magicLineTwo2.stop().animate({
            left: $magicLineTwo2.data("origLeft"),
            width: $magicLineTwo2.data("origWidth"),
            backgroundColor: $magicLineTwo2.data("origColor")
        });    
    });
    
    /* Kick IE into gear */
    $(".current_page_item_two2 a").mouseenter();
    
});
