﻿// JScript File

function Sort_Click(pType)
{
    if($("top"+pType).className == "notlink")
        return;
    var oEle = $("div_Sort");
    var url = "/top"+pType+".htm";
    getResponse(url,oEle);

    $("topit").className = "link";
    $("topnet").className = "link";
    $("toptongxin").className = "link";
    $("topbbs").className = "link";
    $("top"+pType).className = "notlink";
}

function stockTabClickHandle(pType)
{
    $("hfStockType").value = pType;
    $("form1").submit();
}

function doSearch()
{
    var oKey = $("searchKey");
    var strType = $("searchType").value;
    var strKey = trim(oKey.value);
    
    if(strKey == "")
    {
        oKey.value="请先输入条件!";
        oKey.focus();
        oKey.select();
        return;
    }
    
    window.open("http://search.itdb.cn/search"+strType+".aspx?sStar=1&sType=1&sKey="+encodeURI(strKey));
}

function $(){
    return document.getElementById(arguments[0]);
}

function trim(pStr)
{
    return pStr.replace(/(^\s*)|(\s*$)/g, "");
}