// JavaScript Document
var fade_interval;	
var old_tab = 0;
var old_event = 0;

		function changeNewsTab(t) {
			changeTab(t);
			clearInterval(fade_interval);
		}
		function changeTab(t) {
			tabs = $('div.right_box_2');
			lis = $('#menunews li');
			$(tabs).each(function(i){
				if (i != t) {
					// hide tabs, will show the current one after loop
					$(tabs[i]).hide();
					$(lis[i]).removeClass('current');
				}
				
				if ((i == t-1) || (i == tabs.length-1)) {
					$(lis[i]).addClass('last');
				} else {
					$(lis[i]).removeClass('last');
				}
			});
			$(tabs[t]).show();
			$(lis[t]).addClass('current');
		}
	function rotate_news() {
				tabs = $('div.right_box_2');
				lis = $('#menunews li');
				current_tab = (old_tab + 1) % tabs.length;
				changeTab(current_tab);
				old_tab = current_tab;
		}
		
	$(document).ready(function() {
				fade_interval = setInterval(rotate_news, 6000);
				
		});
