// JavaScript Document
$(function(){
	
	var url = window.location.pathname;
	var teams = Array("/girls13U.html", "/girls14U.html", "/girls15U.html", "/girls16U.html", "/girls18U.html", "/boys15U.html");
	for (i=0;i<=4;i++) {
	  if (url == teams[i]) {
		$("#topnav ul li:nth-child(3) a").addClass("jqCurrent");
		$("#topnav ul li:nth-child(3) a").children("img").attr("src",$("#topnav ul li:nth-child(3) a").children("img").attr("src").replace("_off","_on"));
	  } 
	}
	
	var sScriptName = "index.html";
	if (location.pathname != "/"){
		sScriptName = location.pathname.split("?")[0];
		sScriptName = sScriptName.split("/")[sScriptName.split("/").length - 1];
	}
	$("#topnav ul li a").each(function(){
		var $objCurrentLink = $(this);
		if ($objCurrentLink.attr("href") == sScriptName){
			$objCurrentLink.addClass("jqCurrent");
			$objCurrentLink.children("img").attr("src",$objCurrentLink.children("img").attr("src").replace("_off","_on"));
		}
	});

	$("#topnav ul li a:not(.jqCurrent)").hover(
		function(){
			var $objCurrentLink = $(this)
			var sSrc = $objCurrentLink.children("img").attr("src");
			$objCurrentLink.children("img").attr("src",sSrc.replace("_off","_on"));
		},
		function(){
			var $objCurrentLink = $(this)
			var sSrc = $objCurrentLink.children("img").attr("src");
			$objCurrentLink.children("img").attr("src",sSrc.replace("_on","_off"));
		}
	);
	
	$("#sidebar ul li ul li a").each(function(){
		var $objCurrentLink = $(this);
		if ($objCurrentLink.attr("href") == sScriptName){
			$objCurrentLink.addClass("jqCurrent");
		}
	});

	if ($.browser.msie && $.browser.version == '6.0') {
		jqPngFix();
	}
	
	
});
