$(function(){

    var $el, leftPos, newWidth,
        $mainNav2 = $("#navslide");
        
    
    /*
        EXAMPLE TWO
    */
    $mainNav2.append("<li id='magic-line-two'></li>");
    
    var $magicLineTwo = $("#magic-line-two");
    
    $magicLineTwo
        .width($(".current_page_item, .current_page_parent, .current_page_ancestor").width())
        .height($mainNav2.height())
        .css("left", $(".current_page_item a, .current_page_parent a, .current_page_ancestor a").position().left)
        .data("origLeft", $(".current_page_item a, .current_page_parent a, .current_page_ancestor a").position().left)
        .data("origWidth", $magicLineTwo.width());
                
    $("#navslide li").hover(function() {
		if (!$(this).parent('ul').hasClass('children'))
		{
			$el = $(this).find('a');
			if ($el.lenght==0) $el = $(this);
			leftPos = $el.position().left;
			newWidth = $el.parent().width();
			$magicLineTwo.stop().animate({
				left: leftPos,
				width: newWidth
			});
		}
    }, function() {
		if (!$(this).parent('ul').hasClass('children'))
		{
			$magicLineTwo.stop().animate({
				left: $magicLineTwo.data("origLeft"),
				width: $magicLineTwo.data("origWidth")
			});
		}
    });
});

