var mode = 0;
	var updateinterval = 7000;
	
	var current = "#hi1";
	var others = new Array("#hi2","#hi3","#hi4","#hi5","#hi6");
					
	function rollTimer() {
		$(current).animate({ opacity: "hide" },"slow");
		$(current+"a").css("color","#a0c6dd");
		$(others[0]).animate({ opacity: "show" },"slow");
		$(others[0]+"a").css("color","#ffffff");
		c = others[0];
		for (i=0;i<others.length;i++) {
			others[i] = others[i+1];
		}
		others[others.length-1] = current;
		current = c;
	}

	function roll(id,ids) {
		if (id!=current) {
			$(current).animate({ opacity: "hide" }, "fast");
			$(current+"a").css("color","#a0c6dd");
			$(id).animate({ opacity: "show" }, "fast");
			$(id+"a").css("color","#ffffff");
		}
		current = id;
		others = ids;
		$(document).stopTime("roller");
	}	

	function reroll() {
		$(document).everyTime(updateinterval,"roller",rollTimer);
	}

	var clm = "";
	var plm = "";
	var hlm = "";
	
	function showmenu(id) {
		$(id).slideDown();
		if ($(id).length>0) $("#"+id.substring(6)).addClass("active");
		clm = id;
	}
	
	function hidemenu() {
		if (hlm!="") {
			$(hlm+":visible").animate({opacity:"hide"},"slow");
			$("#"+hlm.substring(6)).removeClass("active");
		}
		hlm = "";
	}
	
	function mover(f) {
		menuover("#local"+$(this).attr("id"));
	}
	
	function menuover(id) {
		if (id!=clm || $(clm+":hidden").length>0) {
			hlm = clm;
			hidemenu();
			showmenu(id);
			$(document).stopTime("plmt");
		}
	}
	
	function mout(f) {
		menuout("#local"+$(this).attr("id"));
	}
	
	function showplm() {
		$("#menu a.active").removeClass("active");
		$(".local:visible").animate({opacity:"hide"},"slow");
		showmenu(plm);
	}
	
	function menuout(id) {
		hlm = clm;
		$(document).oneTime(5000,hidemenu);
		$(document).oneTime(7000,"plmt",showplm);
	}
			
	$(document).ready(function(){
		$(document).everyTime(updateinterval,"roller",rollTimer);
		plm = "#local"+$("#menu a.active").attr("id");
		clm = plm;
		$(plm).slideDown();
		$("#menu a").each(function(i) {
			$(this).hover(mover,mout);
		});
		$('#centercolumn table[border="1"]').addClass('borderedtable');
		$('#centercolumn table[border="1"] td').addClass('borderedtabletd');
		$('#centercolumn table[border="1"] tr:odd').addClass('borderedtableodd');
		$('#centercolumn table[border="1"] tr:even').addClass('borderedtableeven');
		$('#centercolumn table[border="1"] tr:first').addClass('borderedtablefirst');
		$('#centercolumn table[border="1"]').attr('border',0);


	});



