$(document).ready(function() {

	var i = 1;
	var intervalID; 

		intervalID = setInterval(switches,8000);

	function switches()
	{

		i = i+1;
		
		switch(i)
			{
			case 1:
				switch1();	
				break
			case 2:
				switch2();	
				break
			case 3:
				switch3();	
				break
				
			case 4:
				switch4();	
				break
			}
		
		if(i == 3)
		{
			i = 0;
		}

	}
	
	function switch1()
	{
		$('#box1').show();
		$('#box2').hide();
		$('#box3').hide();
		$('#box4').hide();
		return false;

	}
	function switch2()
	{
		$('#box1').hide();
		$('#box2').show();
		$('#box3').hide();
		$('#box4').hide();
		return false;

	}
	function switch3()
	{
		$('#box1').hide();
		$('#box2').hide();
		$('#box3').show();
		$('#box4').hide();
		return false;

	}

	function switch4()
	{
		$('#box1').hide();
		$('#box2').hide();
		$('#box3').hide();
		$('#box4').show();
		return false;

	}
		
		$('.s1').click(function() {
			clearInterval(intervalID);
				$('#box1').show();
				$('#box2').hide();
				$('#box3').hide();
				$('#box4').hide();
				return false;


		});
		
		$('.s2').click(function() {
			clearInterval(intervalID);
				$('#box1').hide();
				$('#box2').show();
				$('#box3').hide();
				$('#box4').hide();
				return false;


		});
		
		$('.s3').click(function() {
			clearInterval(intervalID);
				$('#box1').hide();
				$('#box2').hide();
				$('#box3').show();
				$('#box4').hide();
				return false;

 
		});

		$('.s4').click(function() {
			clearInterval(intervalID);
				$('#box1').hide();
				$('#box2').hide();
				$('#box3').hide();
				$('#box4').show();
				return false;

 
		});
		
	
		

		
	
			/*
				$('#mainBox1').innerfade({
					speed: 500,
					timeout: 2000,
					type: 'sequence',
					containerheight: '263px',
					cancelLink: 'stop',
						
				});
*/
					
});
