// SCROLL TO TOP IN JQUERY MODIFICATO
              $(document).ready(function() {
     $('div.up').click(function(){
          $('html, body').animate({scrollTop:0}, 'slow');
     });
});



// MENU CHE SI ESPANDONO IN JQUERY MODIFICATO
$(function(){
    $('#nav>li>ul').hide();
    $('#nav>li').mousedown(function(){
        // check that the menu is not currently animated
        if ($('#nav ul:animated').size() == 0) {
            // create a reference to the active element (this)
            // so we don't have to keep creating a jQuery object
            $heading = $(this);
            // create a reference to visible sibling elements
            // so we don't have to keep creating a jQuery object
            $expandedSiblings = $heading.siblings().find('ul:visible');
            if ($expandedSiblings.size() > 0) {
                $expandedSiblings.slideUp(500, function(){
                    $heading.find('ul').slideDown(500);
                });
            }
            else {
                $heading.find('ul').slideDown(1000);
            }
        }
    });
});
