﻿// JavaScript Document// before rendering the page...
$(document).ready( function() {
							
	// figure out server
	var server = window.location.protocol + "//" + window.location.host;

// remove noscripts 
		   $('.noscript').remove(); 

	// main menu highlighting
	$('#mainnav li a').each(function(){
		var href = $(this).attr('href');
		if( window.location.href.indexOf( server + href ) >= 0 && href.length > 1 ) {
			
			if(href == "/resources/")
			{
				$('#facebook a').addClass("linklow");
			}
			$(this).addClass("current");
			$(this).parent().addClass("current");
		}
	});

	// section menu highlighting
	var $currentAnchor = null;
	$('#subnav li a').each(function(){
		var href = $(this).attr('href');
		if( window.location.href.indexOf( server + href ) >= 0 && href.length > 1 ) {
			$(this).addClass("current");

	
	
			if ($currentAnchor != null) {
						
				$currentAnchor.removeClass("current"); // remove top-level section highlight
			} else {

				$currentAnchor = $(this);	
			}
		}
	});


			// open non-web documents in a new window without browser chrome 
			$(" #content a[href$='.doc'], #content a[href$='.pdf'],  #content a[href$='.xls'],  #content a[href$='.ppt'],  #content a[href$='.dot'],  #content a[href$='.pot']").each(function() {
																																													$(this).click(function () { 
																																																			window.open( $(this).attr("href"), $(this).text(),'height=500,width=700,left=100,top=75,resizable=yes,scrollbars=yes,toolbar=no,status=no' ); 
return false; }); 

$(this).after(" <small class=\"noprint\">(opens in a new window)</small>"); 
}); 
							});