// This is the main jQuery function that only begins once the page has loaded
$(document).ready(function() {
	// Show dropdown on mouseover of main link
	$("div#nav ul li").mouseover(function() {
			$(this).find('ul:first').show();
	});

	// Hides the submenu when the mouse leaves the main navigation link area
	$("div#nav ul li").mouseleave(function() {
		$("div#nav ul li ul").hide();
	});

	// Hides the submenu when the mouse leaves the submenu itself
	$("div#nav ul li ul").mouseleave(function() {
		$("div#nav ul li ul").hide();
	});

	// jQuery plugin - Feature List
	$.featureList(
		$("#tabs > li a"),
		$("#output > li"), {
//			start_item	:	1
		}
	);

	var path = window.location.pathname.substr(1);
	if ( path ) {
		if (path.match(/news/i)) {
			$('#nav a[href$="/news.html"]').attr('class', 'active');
		}
		else {
			$('#nav a[href$="/' + path + '"]').attr('class', 'active');
		}
	}
	else {
		$('#nav a[href="/"]').attr('class', 'active');
	}
	$('.accordion .head span').click(function() {
		$(this).parent().next().toggle();
		$(this).toggleClass("hide");
		return false;
	}).parent().next().hide();
	$('.standings tr:even').addClass('alt');

	$('.clip a').click(function(){
		var link = $(this).attr('href');
		var player = flowplayer();
		player.play(link);
		return false;
	});

});


