$(function() { 
	/*nav + subnav*/
	var folderpath = location.pathname.substring(0).toLowerCase();
	
	var pagefilename = folderpath.substring(folderpath.lastIndexOf('/')+1).toLowerCase();
	var defaultfilename = "default.asp";
	
	//remove default.asp if it exists in folderpath
	if (pagefilename == defaultfilename) {
		folderpath = location.pathname;
		folderpath = folderpath.substring(0,folderpath.lastIndexOf('/')+1).toLowerCase();
	}
	
	$('#subnav div.menu ul a[href="' + folderpath + '"]').addClass('selected');
	$('#nav a[href="' + folderpath + '"]').addClass('selected');
	
	/*Add style to programs link if you are in a program page - only happens if you are 2 folders deep in the folder structure
	
	if (location.pathname.match(/\/\w+\/\w+\//)[0].toLowerCase()) {
		$('#nav a[href=/health/programs.asp]').addClass('selected');
	}*/

	/*End nav + subnav*/
	
	
	/*style note better*/
	$('div.note').wrapInner($("<div class='innerwrap'></div>"));
	
	/*zebra stripes for tablees with stripe class*/
	$('table.stripe tr:even td').addClass('even'); 
	
	/*Dropdown Nav*/
	$('#nav li.programs').removeClass('programs').addClass('programsjs');
	
	
	$('#nav li.programsjs').hoverIntent({
		sensitivity: 3,
		interval: 50,
		over: showdropdown,
		timeout: 500,
		out: hidedropdown
	}); 
	
	$("li.programsjs div#drop a").focus(function () {
         $(this).parents('li.programsjs').addClass('hover');
    });
	$("li.programsjs div#drop a").blur(function () {
         $(this).parents('li.programsjs').removeClass('hover');
    });

});

function showdropdown(){ $(this).addClass('hover');}
function hidedropdown(){ $(this).removeClass('hover');} 