$(document).ready(function () {


	var i =0;
	
	$("#leftcol").find(".menu").find("li").each(function(){
		
		
		
		if(i%2) $(this).addClass("impar");
			else $(this).addClass("par");
	
		i++;	
		
	});

    $(document).pngFix();

    var nr = 0;

    var i = 0;
    $("#main_menu .parent").each(function () {

        var ul = $(this).find("ul").html();
       
	    $(this).find("ul").remove();


        var o = $(this).offset();
        
		
        l = o.left;

        
		
        var top = (o.top + 28);

        if ($.browser.msie && $.browser.version == "6.0") {
            top = 28;
            
            var o2 = $("#layer").offset();
            l = o.left - o2.left- 22;
        }
        $(this).append('<ul class="sub_mmenu' + i + ' sub_mmenu" style="position: absolute;left:' + l + 'px; top:' + top + 'px">' + ul + '</ul>');


        $(this).append('<span style="display:none" class="pos">' + i + '</span>');

        i++;
    });



    $("#main_menu .parent").hover(function () {

        var o = $(this).offset();



        if ($(this).parent().parent().attr("id") == "main_menu") {

            $(this).find("ul :first").css({

                top: (o.top + 21) + "px",
                left: o.left + "px"

            });

            $(this).find("ul ul").hide();
        }
        else {
            $(this).find("ul").css({

                top: "-18px",
                left: "155px",
                position: "relative"


            });
        }

        $(this).children("ul").slideDown({ duration: 300, easing: "easeOutCirc" });

        $(this).find("ul ul").hide();
    }, function () {
       

// alert( $(this).children("ul").html());

        if ($(this).parent().parent().attr("id") == "main_menu") $(this).children("ul").slideUp({ duration: 300, easing: "easeOutCirc" });
        else $(this).children("ul").hide();

    });


	


});

