// Global JavaScripts
$(document).ready(function(){

//JQuery IFRAME Plugin
$('.menu').bgiframe();
//End IFRAM Plugin

	var currentNav;var overL=0;
	$("#topnav").hoverIntent(
     function () {
            $("#gray").fadeIn("fast") ;

      },
      function () {
            $("#gray").fadeOut("fast") ;
      }

    );
	
    $("#topnav ul > li.tab").hoverIntent({
		sensitivity: 7, // number = sensitivity threshold (must be 1 or higher)    
    	interval: 100, // number = milliseconds for onMouseOver polling interval    
    	timeout: 150, // number = milliseconds delay before onMouseOut   
      over:function () {
        $(this).addClass("over");
      },
      out:function () {
        $(this).removeClass("over");
      }
										 });

	$("#topnav ul li > a").focus(function () {
        $(this).parent("li").trigger("focus");
        overL=1;
    });

	$("#topnav li.tab").focus(function () {
		$(currentNav).trigger("blur");
        $(this).addClass("over");
        $("#gray").fadeIn("fast") ;
		currentNav = this;
		if(overL==0) { $("#gray").fadeIn("fast") ;}
    });

	$("#topnav li.tab").blur(function () {
        $(this).removeClass("over");
    });


	$("#topnav ul li > a").click(function () {
		$(this).trigger("blur");
        $("#gray").fadeOut("fast") ;
	});

});


