$(document).ready(
	function(){		
		var t = "";
		
		function linkh1(){
			$("#homecontent1").fadeIn("slow");
			$("#homecontent2").hide();
			$("#homecontent3").hide();
			$("#homecontent4").hide();
			$("#homecontent5").hide();
			$("#homecontent6").hide();
			$("#homecontent7").hide();
			$("#homecontent8").hide();
			$("#homecontent9").hide();
			return false;
		}		
		
		function linkh2(){
			$("#homecontent2").fadeIn("slow");
			$("#homecontent1").hide();
			$("#homecontent3").hide();
			$("#homecontent4").hide();
			$("#homecontent5").hide();
			$("#homecontent6").hide();
			$("#homecontent7").hide();
			$("#homecontent8").hide();
			$("#homecontent9").hide();
			return false;
		}
		
		function linkh3(){				
			$("#homecontent3").fadeIn("slow");			
			$("#homecontent1").hide();
			$("#homecontent2").hide();
			$("#homecontent4").hide();
			$("#homecontent5").hide();
			$("#homecontent6").hide();
			$("#homecontent7").hide();
			$("#homecontent8").hide();
			$("#homecontent9").hide();
			return false;
		}
		
		function linkh4(){				
			$("#homecontent4").fadeIn("slow");				
			$("#homecontent1").hide();
			$("#homecontent2").hide();
			$("#homecontent3").hide();
			$("#homecontent5").hide();
			$("#homecontent6").hide();
			$("#homecontent7").hide();
			$("#homecontent8").hide();
			$("#homecontent9").hide();
			return false;
		}		
		
        function linkh5(){				
			$("#homecontent5").fadeIn("slow");				
			$("#homecontent1").hide();
			$("#homecontent2").hide();
			$("#homecontent3").hide();
			$("#homecontent4").hide();
			$("#homecontent6").hide();
			$("#homecontent7").hide();
			$("#homecontent8").hide();
			$("#homecontent9").hide();
			return false;
		}
		
        function linkh6(){				
			$("#homecontent6").fadeIn("slow");				
			$("#homecontent1").hide();
			$("#homecontent2").hide();
			$("#homecontent3").hide();
			$("#homecontent4").hide();
			$("#homecontent5").hide();
			$("#homecontent7").hide();
			$("#homecontent8").hide();
			$("#homecontent9").hide();
			return false;
		}
			
        function linkh7(){				
			$("#homecontent7").fadeIn("slow");				
			$("#homecontent1").hide();
			$("#homecontent2").hide();
			$("#homecontent3").hide();
			$("#homecontent4").hide();
			$("#homecontent5").hide();
			$("#homecontent6").hide();
			$("#homecontent8").hide();
			$("#homecontent9").hide();
			return false;
		}
			
        function linkh8(){				
			$("#homecontent8").fadeIn("slow");				
			$("#homecontent1").hide();
			$("#homecontent2").hide();
			$("#homecontent3").hide();
			$("#homecontent4").hide();
			$("#homecontent5").hide();
			$("#homecontent6").hide();
			$("#homecontent7").hide();
			$("#homecontent9").hide();
			return false;
		}
		
        function linkh9(){				
			$("#homecontent9").fadeIn("slow");				
			$("#homecontent1").hide();
			$("#homecontent2").hide();
			$("#homecontent3").hide();
			$("#homecontent4").hide();
			$("#homecontent5").hide();
			$("#homecontent6").hide();
			$("#homecontent7").hide();
			$("#homecontent8").hide();
			return false;
		}		
		
		
		
		
		$("#linkh1").click(
			function(){
				linkh1();
				clearTimeout(t);
				setTimeout("startLoop(1)",6000);
			}
		);
		$("#linkh2").click(
			function(){
				linkh2();
				clearTimeout(t);
				setTimeout("startLoop(2)",6000);
			}
		);
		$("#linkh3").click(
			function(){
				linkh3();
				clearTimeout(t);
				setTimeout("startLoop(3)",6000);
			}
		);
		$("#linkh4").click(
			function(){
				linkh4();
				clearTimeout(t);
				setTimeout("startLoop(4)",6000);
			}
		);
		$("#linkh5").click(
			function(){
				linkh5();
				clearTimeout(t);
				setTimeout("startLoop(5)",6000);
			}
		);
		$("#linkh6").click(
			function(){
				linkh6();
				clearTimeout(t);
				setTimeout("startLoop(6)",6000);
			}
		);
		$("#linkh7").click(
			function(){
				linkh7();
				clearTimeout(t);
				setTimeout("startLoop(7)",6000);
			}
		);
		$("#linkh8").click(
			function(){
				linkh8();
				clearTimeout(t);
				setTimeout("startLoop(8)",6000);
			}
		);
		
		$("#linkh9").click(
			function(){
				linkh9();
				clearTimeout(t);
				setTimeout("startLoop(9)",6000);
			}
		);		
		
		
		
		startLoop = function(count){
			count++;
			var image_to_show = count%10;
			if(image_to_show>0){
				function_name = "linkh"+image_to_show+"()";
				eval(function_name);
			}
			t = setTimeout("startLoop("+count+")",6000);
		}
		
		startLoop(0);
	}
);