		window.onload=hide;
		
		function hide(id) {
			var d = document.getElementById(id);
			
			for (var i = 0; i<=10; i++) {
				if (document.getElementById('story'+i)) {
					document.getElementById('story'+i).style.display = 'none';
				}
			}
			
			document.getElementById('story'+Math.floor((Math.random()*5)+1)).style.display = '';
		}
		
		function showhide(id) {
			
			for (var i = 0; i<=10; i++) {
				if(id!=i) {
					if (document.getElementById('story'+i)) {
						document.getElementById('story'+i).style.display = 'none';
					}
				}
			}
			
			if (document.getElementById) {
				obj = document.getElementById(id);
				
				if (obj.style.display == 'none') {
					obj.style.display = '';
				} 
				else {
					obj.style.display = 'none';
				}
			}
		}
		
		var length = 5;
		var x = 1;
		var timerID = null;
		function rotatenews() {
			
			if(x > length) {
				x = 1;
			}
			showhide('story'+x);
			x++;
			timerID = setTimeout('rotatenews()',7000);
		}
		
		
		function pauseNews() {
			
			if (timerID != null) {
				clearTimeout(timerID);
				timerID = null;
			}
		}
		
		function playNews() {
			if (timerID == null) {
				timerID = setTimeout('rotatenews()',7000);
			}
		}
		
		function goBack() {
			x=x-2;
			if(x==0){
				x=5;
				}
			showhide('story'+x);
			x++;
			clearTimeout(timerID);
			timerID = null;
		}
		function goNext() {
			if(x==6){
				x=1;
				}
			showhide('story'+x);
			x++;
			clearTimeout(timerID);
			timerID = null;
		}
