$(document).ready(function(){ 

$("#idSelezione").change(function(){    

            $( "#idParametro" ).empty();
         $('<option value="0"></option>').html("Nazione").appendTo("#idParametro");
         $.ajax({

               type: "POST",
               url: "/catalogo/loadNazioniMachtNoleggio.action",    
               data: "id=" + $("#idSelezione").val(),
               dataType: "xml",
               success: function(xml){    
             
                     var found=false;               

               $(xml).find('elemento').each(function(){
                   found=true;
                   var id = $(this).find("id").text();
                   var descrizione = $(this).find("value").text();                 
                   $('<option value="'+ id + '"></option>').html(descrizione).appendTo("#idParametro");
                   });
                 
                   if(!found){
                       $( "#idParametro" ).empty();
                       $('<option value="0"></option>').html("Nazione").appendTo("#idParametro");
                   }
               }
         })
        });

});     


$(document).ready(function(){ 

    
        //Hide (Collapse) the toggle containers on load
        $(".toggle_container").hide();
        $("h2.active").next(".toggle_container").show();
    

    //Switch the "Open" and "Close" state per click
    $("h2.trigger").toggle(function(){
        $(this).addClass("active");
        //$("h2.trigger a").replace(/\+/g,"-");
        }, function () {
        $(this).removeClass("active");
        //$("h2.trigger a").replace("-","+");
    });

    //Slide up and down on click
    $("h2.trigger").click(function(){ 
        $(this).next(".toggle_container").slideToggle("slow");
    });

});
