// Background animation on top nav
$(document).ready(function() {
//Append a div with hover class to all the LI  
    $('header nav ul li').append('<div class="hover"></div>');  
  
  
    $('header nav ul li').hover(  
          
        //Mouseover, fadeIn the hidden hover class    
        function() {  
              
            $(this).children('div').fadeIn('1000');   
          
        },   
      
        //Mouseout, fadeOut the hover class  
        function() {  
          
            $(this).children('div').fadeOut('1000');      
          
    }).click (function () {  
      
        //Add selected class if user clicked on it  
        $(this).addClass('selected');  
          
    });  
});

// HTML5 Forms
$(document).ready(function(){
	$('#myform').html5form({    
        colorOn: '#002e5a',
        colorOff: '#999'    
    });
});


// Sidebar
		$(document).ready(function() {
			// Slide
			// Expand only the active menu, which is determined by the class name
			$("#menu1 > li > a[class=expanded]").find("+ ul").slideToggle("medium");
		
			// Toggle the selected menu's class and expand or collapse the menu
			$("#menu1 > li > a").click(function() {
				$(this).toggleClass("expanded").toggleClass("collapsed").find("+ ul").slideToggle("medium");
			});
		
		});
