//$("#teamsmenu li a:contains('Snow')").addClass('teamsnow');

$(document).ready(function(){
	
	$('#teamsmenu li li.sponsor').each(function (index) {
		var height = $(this).children('ul').height();
		$(this).children('ul').css({'height': 0, 'overflow': 'hidden'});
		$(this).parent().css('overflow', 'hidden');
		
		$(this).hover(
			function () {
				$(this).children('ul').stop(true,false).animate({
					'height': height
					},500
			)},
			function () {
				$(this).children('ul').stop(true,false).animate({
					'height': 0
					},500
			)}	
		);
		
		/*var oddClick = true;
		$(this).click(function () {
			$(this).children('ul').stop(true,false).animate({
				'height': (oddClick) ? height : 0
				},500
			);
			oddClick = !(oddClick);
		});*/
	});
	
  	jQuery('#teamsmenu').accordion({ 
		active: false, 
		header: '.headerlink', 
		navigation: true, 
		event: 'mouseover', 
		autoHeight: false, 
		animated: 'bounceslide' 
	});

	$('#teams td').hover(function() {
		$(this).find('div').animate({bottom:'0px'},200);
	}, function(){
		$(this).find('div').animate({bottom:'-35px'},200);
	});

	var h = $('div.teamoverlay').height();
	var t = $('#TeamHeader').height();
	$('div.teamoverlay')
		.css({'opacity' : 0, 'top' : t+'px', 'visibility' : 'visible'})
		.delay(1000)
		.animate({top: (t-20-h)+'px', opacity: 1}, 'slow');	
});
$.fn.delay = function(time, callback){
	// Empty function:
	jQuery.fx.step.delay = function(){};
	// Return meaningless animation, (will be added to queue)
	return this.animate({delay:1}, time, callback);
}
$(function() {
	$('#teamtabs > ul').tabs({ fx: { height: 'toggle', opacity: 'toggle' } });
});

