	/*
	 * La seguente funzione attiva e disattiva i figli di un menù 
	 * utilizza come sistema di navizazione lo standard ZF
	 * 
	 * $("#MioMenu li").ZfMenu();
	 * 
	 * 
	 */	
	$.fn.ZfMenu = function(){
		var element = this;
		var args = arguments[0] || {}; 
		var newSelected = args.value;
		var RootThis = $(this);
		
		$(this).mouseover(function(){
			 
			 $.each($(RootThis), function () {
				 $(this).removeClass("active");
			 });
			
			$(RootThis).find("ul").hide();
			 $(this).find("ul").show(); 
			 $(this).addClass("active");
		  });
		
		  var ceck=false;
		  $.each($(this).find("ul"), function () {
			  if($(this).css("display") != "none")
				  ceck = true;
		  }); 
		  
		  if(!ceck)
		  {
		   $.each($(this), function () {
			   	  if($(this).attr("class") == "active")
				  {
					  $(this).mouseover();
					  ceck = true;
				  }
		   }); 
			 if(!ceck)
			 {
				 var i=0;
				   $.each($(this), function () {
					   if(i==0)
					   {	   
						   $(this).addClass("active");
						   $(this).mouseover();
					   }
					   i++;
				   });			 
			 }  
		  }		
	};
