<!--
// custom function to retrieve elements by their class
function getElementsByClass(searchClass, node, tag) {
	var classElements = new Array();
	if ( node == null )
		node = document;
	if ( tag == null )
		tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}

// function used to generate random banner
function getRandomBanner() {
	var randomBanner = Math.floor(Math.random()*8) + 1;
	
	document.writeln('<img src="img/whsfl_logo' + randomBanner + '.jpg" height="131" border="0" alt="Go back to the WHSFL Homepage" />');
}

// multi tabbing navigation system
function switchActive(tabidentifier) {
	// initialize variables to hold the elements with these classes
	var menulink = getElementsByClass('multi_tab_active');
	var menucontent = getElementsByClass('multi_tab_active_container');
	
	// loops through all the tabs and deactivates their status
	for (i=0; i<3; i++)
	{
		menulink[0].className = 'multi_tab_not_active';	
		menucontent[0].className = 'multi_tab_not_active_container';	
	}
	
	// now set the one we clicked to be active
	document.getElementById("multi_tab_" + tabidentifier).className = 'multi_tab_active';
	document.getElementById(tabidentifier + "_container").className = 'multi_tab_active_container';
}

// multi week navigation
function switchActiveWeek(weekidentifier) {
	// initialize variables to hold the elements with these classes
	var activeweeks = getElementsByClass('scores_matchups_show');
	
	// loops through all the weeks and deactivates their status
	for (i=0; i<3; i++)
	{
		activeweeks[0].className = 'scores_matchups_hide';	
	}
	
	// now set the one we clicked to be active
	document.getElementById("scores_matchups_" + weekidentifier).className = 'scores_matchups_show';
	
	// special text for playoffs
	if (weekidentifier == 8)
		text = 'Quarters';
	else if (weekidentifier == 9)
		text = 'Semis';
	else if (weekidentifier == 10)
		text = 'Finals';
	else
		text = 'Week ' + weekidentifier;

	// update week number now
	document.getElementById("week_number").innerHTML = text;
}

// player of the week chang
function switchActiveWeek2(weekidentifier) {
	// initialize variables to hold the elements with these classes
	var activeweeks = getElementsByClass('scores_matchups_show2');
	var text = 'Week ' + weekidentifier;

// loops through all the weeks and deactivates their status
	for (i=0; i<3; i++)
	{
		activeweeks[0].className = 'scores_matchups_hide2';	
	}
	
	// now set the one we clicked to be active
	document.getElementById("potw_" + weekidentifier).className = 'scores_matchups_show2';
	
	// update week number now
	document.getElementById("week_number2").innerHTML = text;
}

// multi leaders box
function switchActiveLeaderBox(leaderboxidentifier) {
	// initialize variables to hold the elements with these classes
	var activeleaderbox = getElementsByClass('leaders_active_tab');
	var activeleaderboxcontent = getElementsByClass('leaders_tab_content_show');
	
	// loops through the tabs
	for (i=0; i<1; i++)
	{
		activeleaderbox[0].className = 'leaders_non_active_tab';	
		activeleaderboxcontent[0].className = 'leaders_tab_content_hide';
	}
	
	// now set the one we clicked to be active
	document.getElementById(leaderboxidentifier).className = 'leaders_active_tab';
	document.getElementById(leaderboxidentifier + "_content").className = 'leaders_tab_content_show';
}