$(document).ready(
	function()
	{

		// Sifr Settings.
		/*
		$.sifrSettings({path:'/flash/'});
		$("#maincontent h2").sifr({font:'caecilia-heavy'});
		$("#maincontent h3").sifr({font:'caecilia-heavy'});
		$("#maincontent .masthead p").sifr({font:'caecilia-heavy'});
		$("dl.sectionlinks dt").sifr({font:'caecilia-heavy'});
		*/

		// Flash for homepage.
		$('#flashbox').flash(
			{src: '/flash/homeflash.swf', width: 962, height: 336},
			{update: false}
		);
		
		// Add a class to the last navigational element
		$("ul#topnav li:last-child a").addClass("lastnav");
		
		
		// Function to add padding to #maincontent if there is a secondary navigation
		$.fn.mainContentPad = function(liNumber) {
			if (liNumber > 0) {
   			$("#maincontent").css("padding-top", "80px");
   			}
   			
		}
		
		// Add class to active navigation button and to secondary navigation ul
		var pageClass = $('body').attr('class');
		$("ul#topnav li." +pageClass).has("ul li").addClass("activelink");
		$("ul#topnav li." +pageClass+ " ul").has("li").addClass("secondarynav");
		
		// Call to function to add padding to #maincontent if there is a secondary navigation
		var liNumber = $("ul#topnav li." +pageClass+ " ul li").length;
		$("ul#topnav li." +pageClass+ " ul").has("li").mainContentPad(liNumber);
		
		// Add cufon to navigation
		Cufon.replace('#topnav li');

	}
);
