$(document).ready(	
	function () {
		$('#featured figure').eq(0).siblings('figure').fadeOut(0)
		var wrap = $('div.outerWrap')
		var height = wrap.height() - $('div.outerWrap>header').height() - $('div.outerWrap>nav').height() - $('div.outerWrap>footer').height() - 28;
		$('aside').css('height',height+'px')
		$('ul.thumbs li').click(
			function () {
				clearTimeout(timer)
				$(this).addClass('active').siblings().removeClass('active')
				$('#featured figure').eq($(this).index()).css('z-index',1).fadeIn(600).siblings('figure').css('z-index',0).delay(400).fadeOut(1)
//				$('#featured a.article').fadeOut(0).eq($(this).index()).fadeIn(0)
				startTimeout()
			}
		)
		$('#hash').change(
			function () {
				window.location = '?season='+$(this).attr('value')
			}
		)
	}
)
var timer
function startTimeout() {
	timer = setTimeout(
		function () {
			var active = $('ul.thumbs li.active').next()
			if (!active.length)
				active = $('ul.thumbs li:first-child')
			active.click()
		}
		,5000
	)
}
window.onload = startTimeout
