function MetinfoNav(m,p,type){
    m.hover(function(){ 
	    overnav($(this),p,type)
	},function(){
	    outnav($(this),p,type)
	});
}

function overnav(dom,p,type){
                var my = dom.find('dl');
		if(my.length > 0){
                var myli = my.find('dd');
                var my_w = dom.outerWidth(true) + p;
                var my_h = dom.outerHeight(true);
                var m_h = type==2?"0px":"auto";
                var m_d = type==3?"none":"block";
	                my.css({
					    "position" : "absolute",
						"display":m_d,
						"height":m_h,
					    "left" : -(p/2),
					    "top" : my_h
					}); 
				var liy = myli.outerHeight(true)*myli.length;
				
					if(type==2){my.animate({ height:liy },200);}
					if(type==3){my.fadeIn("slow");}
					  
                    if( myli.outerWidth(true) <= my_w ){
		                my.width(my_w);
		            }else{ 
		                myliWdith(myli);
		            }
					
        }	
}

function outnav(dom,p,type){
    var my = dom.find('dl');
	if(my.length > 0){
       if(type==2){ my.animate({ height:0 },200);}
       if(type==3){ my.fadeOut("slow");}
		my.css("display","none");
	}
}

function myliWdith(group) {
	tallest = 0;
	group.each(function() {
		thisWdith = $(this).width();
		if(thisWdith > tallest) {
			tallest = thisWdith;
		}
	});
	group.width(tallest);
}
