﻿
// 网站全局函数
function ChangeDiv(divID1,divData1,divID2,divData2)
{
    document.getElementById(divID1).style.backgroundColor="";
    document.getElementById(divID2).style.backgroundColor="";
    document.getElementById(divData1).style.display="none";
    document.getElementById(divData2).style.display="none";
    document.getElementById(divID1).style.backgroundColor="#ffffff";
    document.getElementById(divData1).style.display="block";
}
function ShowDiv(divID,divDataID)
{
document.getElementById("div_winForm").style.backgroundColor="";
document.getElementById("div_winFormData").style.display="none";
document.getElementById("div_aspNet").style.backgroundColor="";
document.getElementById("div_aspNetData").style.display="none";
document.getElementById(divID).style.backgroundColor="#ffffff";
document.getElementById(divDataID).style.display="block";
}
function ChangeHotDiv(divID,divData)
{
document.getElementById("div_hotAspNet").style.backgroundColor="#ffffff";
document.getElementById("div_hotWinfom").style.backgroundColor="#ffffff";
document.getElementById("div_hotAspNet").style.borderBottom="1px solid #ffffff";
document.getElementById("div_hotWinfom").style.borderBottom="1px solid #ffffff";
document.getElementById("div_hot_aspNet").style.display="none";
document.getElementById("div_hot_winForm").style.display="none";
document.getElementById(divID).style.backgroundColor="#9DB7E0";
document.getElementById(divID).style.borderBottom="1px solid #6B9BE5";
document.getElementById(divData).style.display="block";
}
function runSearch()
{
    var tbContent=document.getElementById("topSearch");
    if(tbContent.value=="")
    {
        alert("请输入搜索内容,多个搜索以空格隔开");
        return;
    }
    var url = "/search.aspx?k=" + escape(tbContent.value);
    window.location.href=url;
}
function btnSearch()
{
    var tbContent=document.getElementById("tbContent");
    var type=document.getElementById("selectType");
    var btype=document.getElementById("selectbType")
    if(tbContent.value=="")
    {
        alert("请输入搜索内容,多个搜索以空格隔开");
        return;
    }
    var url = "/search.aspx?k=" + escape(tbContent.value);
    if(type!=null||btype!=null)
    {
        if(type.value!="")
            url = url + "&t=" + type.value;
        if(btype.value!="")
            url = url + "&b=" + btype.value;
    }
    window.location.href=url;
}

function ClickSearch(btnID)
{   
    if(event.keyCode==13)
    {
        event.returnValue=false;
        
        var btn=window.document.getElementById(btnID);
        btn.focus();
        btn.click();
    }
   
} 