$(document).ready(function() {

	$("#next").hide();
	window.setTimeout(showNews,1500);

	var i=1;

	function showNews() {

		$("#next").show();
		var loader = i +".html";
		
		$("#newscontent").load(loader, function() {
			$(this).hide();
			$("#loader").hide();			
			$(this).fadeIn("slow");
		});
		
		t = setTimeout(showNews,25000);
		
		i != newsArticles ? i++ : i = 1;

	};
	
	$("#next").click(
		function () {
			clearTimeout(t);
			showNews();
		}
	);
	
});
