$(document).ready( function () {

	//HERO MODULE CONTROLS
	$('#hero1').show(0);
	$('#hero1_Tab').addClass('active');
	$('#hero ul.tab li').click (function () {
		var tabName = '#' + $(this).attr('tab');
		$('#heroCounter').val(2);
		$('#hero ul.tab li span').hide(0);
		$(this).find('span').show(0);
		$('#hero ul.tab li').removeClass('active');
		$(this).addClass('active');
		$('#hero ul.display li').hide(0);
		$( tabName ).show(0);
			
	});
	
	//HERO TIMER
	function heroTimer () {
		var Position = $('#heroCounter').val();
		//alert($('#heroCounter').val());
		$('#hero ul.tab li').removeClass('active');
		$('#hero ul.tab li span').hide(0);
		$('#hero ul.display li').hide(0);
		
		var Tab = '#hero' + Position + '_Tab';
		var Pane =  '#hero' + Position;
		$(Tab).addClass('active');
		$(Pane).show(0);
		
		if( Position >= 4 )
		{
			$('#heroCounter').val(1);
		}
		else
		{
			Position = Math.abs(Position) + 1;
			$('#heroCounter').val(Position);
		}
	}
	$('#heroCounter').val(2);
	setInterval(heroTimer,8000);


	$('#serverReload').fadeOut(500).delay(1000).load('serverstatus/server_status2.php', function () {
		$('#serverReload').delay(500).fadeIn('slow');
	});

	//LOAD SERVER STATUS SCRIPT
	function ReloadServerStatus () {
		$('#serverReload').fadeOut(500).delay(1000).load('serverstatus/server_status2.php', function () {
			$('#serverReload').delay(500).fadeIn('slow');
		});
	}
	setInterval(ReloadServerStatus,300000);


});
