(function ($)
{
$(document).ready(function()
{  
    var boxiciHeight = new Array();
    boxiciHeight[0] = $("#nav-example2-01cir").offset();
    boxiciHeight[1] = $("#nav-example2-02cir").offset();
    boxiciHeight[2] = $("#nav-example2-03cir").offset();
    boxiciHeight[3] = $("#nav-example2-04cir").offset();
    boxiciHeight[4] = $("#nav-example2-05cir").offset();
    boxiciHeight[5] = $("#nav-example2-01lat").offset();
    boxiciHeight[6] = $("#nav-example2-02lat").offset();
    boxiciHeight[7] = $("#nav-example2-03lat").offset();
    boxiciHeight[8] = $("#nav-example2-04lat").offset();
    boxiciHeight[9] = $("#nav-example2-05lat").offset();

    var boxici = new Array();
    boxici[0] = "nav-example2-01cir";
    boxici[1] = "nav-example2-02cir";
    boxici[2] = "nav-example2-03cir";
    boxici[3] = "nav-example2-04cir";
    boxici[4] = "nav-example2-05cir";
    boxici[5] = "nav-example2-01lat";
    boxici[6] = "nav-example2-02lat";
    boxici[7] = "nav-example2-03lat";
    boxici[8] = "nav-example2-04lat";
    boxici[9] = "nav-example2-05lat";
	
    $("#nav-kategorije p").css("opacity","0");
    $("#nav-example2-01cir,#nav-example2-02cir,#nav-example2-03cir,#nav-example2-04cir,#nav-example2-05cir,#nav-example2-01lat,#nav-example2-02lat,#nav-example2-03lat,#nav-example2-04lat,#nav-example2-05lat").mouseover(function()
    {	
		var kat;
		var el;
		var p_el;
        var element = "." + $(this).attr("id");
        $(this).stop(true,true).animate({marginTop:"-=27px"},300);
        $(element).stop(true,true).animate({marginTop:"-=135px",height:"+=135px",opacity:1},400);
		if($.browser.msie && ($.browser.version == "8.0" || $.browser.version == "9.0"))
		{
			// for (i = 0; i <= boxici.length; i++)
			// {
				// el = "#" + boxici[i];
				// p_el = "." + boxici[i];
				// kat = boxiciHeight[i];
				// if($(el).attr("id") != $(this).attr("id"))
				// {
					// $(el).offset({top: kat.top + 27});
				// }
				
			// }
			// $(this).prev().offset({top: boxiciHeight[0].top + 0});
			// $(this).prev().prev().offset({top: boxiciHeight[0].top + 27});
			// $(this).prev().prev().prev().offset({top: boxiciHeight[0].top + 27});
			// $(this).prev().prev().prev().prev().offset({top: boxiciHeight[0].top + 27});
		}
    }).mouseout(function()
    {
        var kat;
        var element = "." + $(this).attr("id");
        $(this).stop(true,true).animate({marginTop:"+=27px"},300);
        $(element).stop(true,true).animate({marginTop:"+=135px",height:"-=135px",opacity:0},400);
	for (i = 0; i <= boxici.length; i++)
        {
            if($(this).attr("id") == boxici[i]) kat = boxiciHeight[i];
        }
	//if($.browser.opera) $(this).css("display","block");
	$(this).offset({top: kat.top - 27});
	if($.browser.opera) $(this).css({"display":"block","visibility":"visible"});
    });
});
})(jQuery)
