//资料左栏

var choice = function(This, show, none){
	var obj = document.getElementById('titleTab');
	var objTag = obj.getElementsByTagName('li');
	var num = objTag.length;
	for(var i=0; i<num; i++){
		objTag[i].className = '';
	}
    if(arguments.length == 1){
        This.className = "title_select_on";
        return true;
    }
    if(arguments.length < 1 || arguments.length == 2){
        alert("运行 choice 函数时出错，参数传递错误。");
        return false;
    }
    for(var i = 0; i < arguments.length; i++){
        if(i == 0){
            This.className = "title_select_on";
        }else if(i == 1){
            document.getElementById(show).style.display = "block";
        }else{
            document.getElementById(arguments[i]).style.display = "none";
        }
    }
    return true;
}

function ziliao_left_hidden_sub()
{
	var m_ziliao = new Array();
	m_ziliao[0] = "xszy";
	m_ziliao[1] = "xtjs";
	m_ziliao[2] = "tsxt";
	m_ziliao[3] = "cygn";
	for(var i=0; i<m_ziliao.length; i++)
	{
		document.getElementById("liebiao_sub_"+m_ziliao[i]).style.display = "none";
		document.getElementById("liebiao_title_"+m_ziliao[i]).className = "";
	}
}

function ziliao_left_show_sub(field)
{
	ziliao_left_hidden_sub();
	document.getElementById("liebiao_sub_"+field).style.display = 'block';
	document.getElementById("liebiao_title_"+field).className = "liebiao_new_on";
}

/**
$(document).ready(function(){
$(".gonggao_title li:first").addClass("gonggao_title_on");  //为第一个span添加 .current 的样式，默认选中
$(".gonggao dl:not(:first)").hide();  //ul 不是第一个时隐藏
$(".gonggao_title li").mouseover(function(){  //鼠标移到 span 上时触发函数
$(".gonggao_title li").removeClass("gonggao_title_on");  //为第一个 span 移除 .current 样式
$(this).addClass("gonggao_title_on");  //为触发的 span 添加样式
$(".gonggao dl").hide();  //隐藏 ul
$("."+$(this).attr("id")).fadeIn("slow");  //这句是核心，class(.) 和触发 span 的ID 一致的 fadeIn(渐显) 
});});
*/

var race_select = "qs";

function ziliao_index_hidden_sub()
{
	var m_ziliao = new Array();
	m_ziliao[0] = "qs";
	m_ziliao[1] = "jl";
	m_ziliao[2] = "ws";
	for(var i=0; i<m_ziliao.length; i++)
	{
		document.getElementById("zl_tu_"+m_ziliao[i]).style.display = "none";
		document.getElementById("zl_title_"+m_ziliao[i]).className = "";
	}
}

function ziliao_index_show_sub(field)
{
	race_select = field;
	ziliao_index_hidden_sub();
	document.getElementById("zl_tu_"+field).style.display = 'block';
	document.getElementById("zl_title_"+field).className = "zl_index_tou_bn_on";
}

function ziliao_index_open(field)
{
	if("castle" == field){
		
	}else if("soldier" == field){
		location.href = "ziliao.php?module=xtjs&sub=bz&race="+race_select;
	}else{
		
	}
}

function ziliao_select_item(item)
{
	var m_ziliao = new Array();
	m_ziliao[0] = "qs";
	m_ziliao[1] = "jl";
	m_ziliao[2] = "ws";
	m_ziliao[3] = "other";
	for(var i=0; i<m_ziliao.length; i++)
	{
		document.getElementById("detail_"+m_ziliao[i]).style.display = "none";
		document.getElementById("nav_title_"+m_ziliao[i]).className = "";
	}
	document.getElementById("detail_"+item).style.display = 'block';
	document.getElementById("nav_title_"+item).className = "title_select_on";
}