
function initview(){
	if (window.addEventListener) {
		$("special_head_2").addEventListener('mouseover', viewstop, true);
		$("special_head_2").addEventListener('mouseout', viewplay, true);
		$("special_body_2").addEventListener('mouseover', viewstop, true);
		$("special_body_2").addEventListener('mouseout', viewplay, true);
	} else if(window.attachEvent) {
		$("special_head_2").onmouseover = viewstop;
		$("special_head_2").onmouseout = viewplay;
		$("special_body_2").onmouseover = viewstop;
		$("special_body_2").onmouseout = viewplay;
	}
	__chastart = true;
	viewplay();
}

var __chatimer = null; 
var __chastart = false;

function chapics(a) {
	var childs = $("special_head_1").childNodes;
	for (var i=0; i<childs.length; i++)	{
		if (childs[i].className == "current") {
			$("pic"+i).style.display = 'none';
			childs[i].className = "";
			break;
		}
	}
	childs[a].className = "current";
	$("pic"+a).style.display = 'block';
}

function MultiTabs(a){
	var childs = $("special_head_2").childNodes;
	for (var i=0; i<childs.length; i++)	{
		if (childs[i].className == "current") {
			$("top"+i).style.display = 'none';
			childs[i].className = "";
			break;
		}
	}
	childs[a].className = "current";
	$("top"+a).style.display = 'block';
	if (!__chastart && __IntervalTime>0) initview();
}

function TabsForRank(a) {
	var childs = $("special_head_3").childNodes;
	for (var i=0; i<childs.length; i++)	{
		if (childs[i].className == "current") {
			$("pos"+i).style.display = 'none';
			childs[i].className = "";
			break;
		}
	}
	childs[a].className = "current";
	$("pos"+a).style.display = 'block';
}


function viewauto(){
	var current = 1;
	var childs = $("special_head_2").childNodes;
	var lis = childs.length;
	for (var i=0; i<lis; i++){
		if (childs[i].className == "current"){
		    $("top"+i).style.display = 'none';
			childs[i].className = "";
			current = i;
			break;
		}
	}
	current++;
	if(current>=lis){current=0;}
	childs[current].className = "current";
	$("top"+current).style.display = 'block';
	__chatimer = setTimeout(viewauto, __IntervalTime);
}

function viewplay(){
	if(__chatimer != null){clearTimeout(__chatimer)}
	__chatimer = setTimeout(viewauto, __IntervalTime);
}

function viewstop(){
	if(__chatimer != null){clearTimeout(__chatimer)}
}

if(__IntervalTime>0){
	if(window.addEventListener) {
		window.addEventListener('load',initview, true);
	}else if(window.attachEvent){
		window.attachEvent("onload",initview);
	}
}