$(document).ready(function () {
	$.get("/ajax/next-game.php", function(data) {
		var ts = parseInt(data);
		if(isNaN(ts) || ts == 0) {
			$('#billboard-wrap').remove();
			return false;
		 }
		var liftoffTime = new Date();
		liftoffTime.setTime(ts);
		$('#countdown-inner').countdown({until: liftoffTime, format: 'DHMS', 
			layout: '<ul><li><span>{dnn}</span>{dl}</li><li><span>{hnn}</span>{hl}</li><li><span>{mnn}</span>{ml}</li><li><span>{snn}</span>{sl}</li></ul>',
			 expiryUrl: window.location
			});
		});
		
		
		
    $('#results-wrap').cycle({
		fx: 'fade',
		timeout: 5000
	});    
	
	var h = 0;    
	$('#teams .teams_block').each(function() {
		h = Math.max($(this).height(), h);
	});
	
	$('#teams').height(h).cycle({
		fx: 'scrollUp',
		slideResize: 0,
		containerResize: 0,
		timeout: 5000
	});
	
	
});
