// JavaScript Document
function menu(id){
	var idli=document.getElementById(id).getElementsByTagName("li");
	for(var i=0;i<idli.length;i++){
		idli[i].t=i;
		idli[i].onclick=function(){
			cssshow(this.t);
		}
	}
	function cssshow(n){
		for(var i=0;i<idli.length;i++){
			if(n==i){
				idli[i].className="hover";
				document.getElementById(id+i).style.display="block";
			}
			else{
				idli[i].className="";
				document.getElementById(id+i).style.display="none";
			}
		}
	}
}
//ala_show
function ala_show(){
	var img=document.getElementById("showimg");
	var showli=document.getElementById("showli").getElementsByTagName("li");
	for(var i=0;i<showli.length;i++){
		showli[i].t=i;
		showli[i].onmouseover=function(){
			alacss(this.t);
		}
	}
	function alacss(n){
		for(var i=0;i<showli.length;i++){
			//var icimg=document.getElementById("ic"+i);
			if(n==i){
				showli[i].className="hover";
				img.src="images/show_pic"+i+".jpg";
				document.getElementById("ic"+i).src="images/icon"+i+"_big.jpg";
				document.getElementById("showa").href=showa[i];
				//alert(i);
			}
			else{
				showli[i].className="";
				document.getElementById("ic"+i).src="images/icon"+i+".jpg";
			}
		}
	}
}
var i=0;
var timet;
function news(n){
	var tp1=document.getElementById("tp1");
	var newsa=document.getElementById("newsa");
	var newsli=document.getElementById("news").getElementsByTagName("li");
	for(var t=0;t<newsli.length;t++){
		newsli[t].className="";
	}
	newsli[n].className="hover";
	tp1.src=iname[n];
	newsa.href=ahref[n];
	i=n;
	stop_auto();
}
function news_for(){
	if(i==3){
		i=0;
	}
	else{
		i++;
	}
	news(i);
	time_auto();
}
function time_auto(){
	timet=setTimeout(news_for,4500);
}
function stop_auto(){
	clearTimeout(timet);
}

window.onload=function(){
	time_auto();
	ala_show();
}
//sub_nav
function subnav(n){
	var navid=document.getElementById("sub_nav");
	if(n==1){
		navid.style.display="block";
		navid.onmouseover=function(){
			this.style.display="block";
		}
	}
	else{
		navid.style.display="none";
		navid.onmouseout=function(){
			this.style.display="none";
		}
	}
}








