$(document).ready(function(){
	// Dropdown functions - requires hoverIndent.js plugin
	var config = {    
         sensitivity: 3, // number = sensitivity threshold (must be 1 or higher)    
         interval: 50,  // number = milliseconds for onMouseOver polling interval    
         over: doOpen,   // function = onMouseOver callback (REQUIRED)    
         timeout: 400,   // number = milliseconds delay before onMouseOut    
         out: doClose    // function = onMouseOut callback (REQUIRED)    
    	};
    
    function doOpen() {
        $(this).addClass("hover");
        $(this).children('ul').css('visibility', 'visible');
    	}
 
    function doClose() {
        $(this).removeClass("hover");
        $(this).children('ul').css('visibility', 'hidden');
    	}

    $("#tabNav ul li").hoverIntent(config);

	// Dropdown menu item hover visual cues
	$('#tabNav ul li ul li').each(function() {
		$(this).hover(
			function() {$(this).addClass('hover');},
			function() {$(this).removeClass('hover');}
			);
		});	
	
	//send url email function
	$('#email').click(function() {
 		var url = window.location.href;
		var subject = $('#main').children('h1:first').text();
		window.location.href = 'mailto:?subject='+subject+ '&body=' + url;
 		});

	//print page function
	$('#print').click(function() {
		window.print();
		});
	
	});