// DOM Ready
$(function() {

    var $el, topPos, newWidth;
        $mainNav2 = $("#moje_menu");
        
    /*
        EXAMPLE TWO
    */
    
    $mainNav2.append("<li id='magic-line-two'></li>");
    
    var $magicLineTwo = $("#magic-line-two");
    
    $magicLineTwo
        .width(150)
        .height(40)
        .css("top", $(".biezacy a").position().top+15)
        .data("origtop", $(".biezacy a").position().top+15)
        .data("origWidth", $magicLineTwo.width())
        .data("origColor", $(".biezacy a").attr("rel"));
                
    $("#moje_menu a").hover(function() {
        $el = $(this);
        topPos = $el.position().top+15;
		leftPos= $el.position().left+50;
        newWidth = 150;
        $magicLineTwo.stop().animate({
            top: topPos,
			left : leftPos,
            width: newWidth,
            backgroundColor: $el.attr("rel")
        })
    }, function() {
        $magicLineTwo.stop().animate({
            top: $magicLineTwo.data("origtop"),
            width: $magicLineTwo.data("origWidth"),
            backgroundColor: $magicLineTwo.data("origColor")
        });    
    });
    
    /* Kick IE into gear */
    $(".biezacy  a").mouseenter();
    
});
