﻿//变换新闻显示框
function SelectTab(order)
{
    var pool = getObj('newsTabs');
    if (pool)
    {
        var l = pool.cells.length;
        while (l--)
        {
            pool.cells[l].className = 'unSelectedTab';
        }
    }
    pool = getObj('newsTab_bs');
    if (pool)
    {
        var l = pool.cells.length;
        while (l--)
        {
            pool.cells[l].className = 'unSelectedTab_bh';
        }
    }
    pool = getObj('newsTab_cs');
    if (pool)
    {
        var l = pool.children.length;
        while (l--)
        {
            pool.children[l].style.display = 'none';
        }
    }
    var unit = getObj('newsTab' + order);
    if (unit) unit.className = 'selectedTab';
    unit = getObj('newsTab_b' + order);
    if (unit) unit.className = 'selectedTab_bh';
    unit = getObj('newsTab_c' + order);
    if (unit) unit.style.display = '';
}

//更多按钮变化
function MoreMove(obj)
{
	if(obj) obj.className = 'NTTitle_More';
}
function MoreOut(obj,aboCN)
{
	if(obj) obj.className = aboCN;
}

//新闻框变化
function NewsBoxMove(obj)
{
    //if (obj) obj.style.backgroundColor = '#fcfcb5';
    if (obj) obj.style.backgroundColor = '#eef9eb';
}
function NewsBoxOut(obj,aboBGC)
{
	aboBGC = (aboBGC) ? aboBGC : '#ffffff';
	if(obj) obj.style.backgroundColor = aboBGC;
}

//简章页操作按钮变化
function RuleExBMove(obj)
{
	if(obj) obj.className = 'BGreen';
}
function RuleExBOut(obj,aboCN)
{
	if(obj) obj.className = aboCN;
}

//简章搜索
function SearchRules()
{
    var pars  ='';
    if (getObj('searchD_End').value.trim().length > 0) pars += '-dmax' + getObj('searchD_End').value.trim();
    if (getObj('searchD_Start').value.trim().length > 0) pars += '-dmin' + getObj('searchD_Start').value.trim();
    if(getObj('search_Specialty').value > 0) pars += '-sp' + getObj('search_Specialty').value;
    if (getObj('search_Vocation').value > 0) pars += '-v' + getObj('search_Vocation').value;
    if (pars.length > 0)
    {
        window.open('/Rules' + pars+ '.shtml');
    }
    else
    {
        alert('请设定要搜索简章的条件');
    }
}

//显示提示框
function ShowCueBox(evt,id)
{
    var cue = getObj(id);
    if(!cue) return;
    cue.style.zIndex = 10;;
    var w = cue.style.width.replace('px','');
    if(w>0)
        cue.style.left = eval(document.documentElement.clientWidth/2-w/2) +'px';
    else
        cue.style.left = eval(document.documentElement.clientWidth/2-100) +'px';
    cue.style.top = eval(document.documentElement.scrollTop + evt.clientY - 150) +'px';
    displayObj(id,true);

}