$(function(){

    var $el, leftPos, newWidth,
        $mainNav = $("#navigation");
    
    /*
        EXAMPLE ONE
    */
    $mainNav.append("<li id='magic-line'></li>");
    
    var $magicLine = $("#magic-line");
	
    $magicLine
        .width($(".current_page_item").width())
        .css("left", $(".current_page_item a").position().left - 5)
		.css("top", $(".current_page_item a").position().top + $(".current_page_item a").height())
        .data("origLeft", $(".current_page_item a").position().left - 5)
        .data("origWidth", $(".current_page_item a").width());
        
    $("#cont-1 div").find("a").hover(function() {
		$split = $(this).parent().attr("id").split("-");
        $el = $("#nav-"+$split[1]);
		//alert($el.attr("id"));
        leftPos = $el.position().left;
        newWidth = $el.width();
        
        $magicLine.stop().animate({
            left: leftPos,
            width: newWidth
        });
    }, function() {
        $magicLine.stop().animate({
            left: $magicLine.data("origLeft"),
            width: $magicLine.data("origWidth")
        });    
    });
	
	$("#navigation li").find("a").hover(function() {
        $el = $(this);
		//alert($el.attr("id"));
        leftPos = $el.position().left - 5;
        newWidth = $el.width();
        
        $magicLine.stop().animate({
            left: leftPos,
            width: newWidth
        });
    }, function() {
        $magicLine.stop().animate({
            left: $magicLine.data("origLeft"),
            width: $magicLine.data("origWidth")
        });    
    });
});
