// JavaScript Document
// update the nav fonts first thing
Cufon.replace('.cufon li a', {
	hover: true
});
	
$(document).ready(function () {
	// make parent as currentPage when sub sub menus are selected
	$("ul#subNav li ul li a.currentPage").parent().parent().parent().children("a:first").addClass('currentPage');
	
	// hide sub navs if parent is not clicked
	$("ul#subNav li ul").hide();
	$("ul#subNav li a.currentPage").parent().children().show();
	
	// mark current pages current
	var location = window.location.href;
	location = location.split('/');
	var page = location[location.length-1];
	$("a").each(function () {
		var href = $(this).attr('href');
		if (href == page || href == '/' + page || href == './' + page) {
			$(this).addClass('currentPage');
		}
	});
	
	// mark if child page is current
	page = $("#parent").val() + '.php';
	$("a").each(function () {
		var href = $(this).attr('href');
		if (href == page || href == '/' + page || href == './' + page) {
			$(this).addClass('currentPage');
		}
	});
	
	// update link fonts after classes may have changed
	Cufon.replace('.currentPage', {
	hover: true
	});

});