// JavaScript Document
function Button_Search_IC()
{
    var IC_Mode=document.getElementById("ctl00_SW_IC").value;
    if(IC_Mode.length<4||IC_Mode=="请输入IC关键字！"){
        alert("IC型号必须输入4个字符及以上！");
        document.getElementById("ctl00_SW_IC").focus();
        return false;
    }
    else
    {
        var IC_Packaging=document.getElementById("SW_IC_FZ").value;
        var IC_LotNo=document.getElementById("SW_IC_PH").value;
        if(IC_Packaging=="封装")
        {
            IC_Packaging="";
        }
        if(IC_LotNo=="批号")
        {
            IC_LotNo="";
        }
        var IFJQ=0;
        if(document.getElementById("ctl00_IFJQ").checked)
        {
            IFJQ=1;
        }
        var M_Province=document.getElementById('province').options[document.getElementById('province').selectedIndex].value;
        
        location.href="/IC/Search.aspx?IC_Mode=" + IC_Mode + "&IFJQ="+IFJQ+"&IC_Packaging=" + IC_Packaging + "&IC_Type=1&IC_LotNo=" + IC_LotNo + "&M_Province=" + M_Province + "&IFSearch=1";
    }
}

function Button_Search_Other()
{
    var SW_Other=document.getElementById("ctl00_SW_Other").value;
    var Hidden_Type=document.getElementById("ctl00_Hidden_Type").value;
    
    switch(Hidden_Type)
    {
        case "PJ":
            location.href="/PJ/List.aspx?PJ_Mode="+SW_Other+"&IFSearch=2";
            break;
        case "CP":
            location.href="/CP/List.aspx?CP_Mode="+SW_Other+"&IFSearch=2";
            break;
//        case "News":
//            location.href="/News/List.aspx?Title="+SW_Other+"&N_State=Search";
//            break;
        case "Company":
            location.href="/Company/?Com_Name="+SW_Other;
            break;
        case "List":
            location.href="/List/?Title="+SW_Other+"&IFSearch=1";
            break;
        case "Escrow":
            location.href="/Escrow/?Title="+SW_Other+"&IFSearch=1";
            break;
    }
}

function Button_Search_Ency()
{
    var SW_Ency=document.getElementById("ctl00_SW_Ency").value;
    var Ency_Type=document.getElementById('ctl00_Ency_Type').options[document.getElementById('ctl00_Ency_Type').selectedIndex].value;
    
    switch(Ency_Type)
    {
        case "Technical":
            location.href="/Ency/Technical.shtml?Title="+SW_Ency;
            break;
        case "Circuit":
            location.href="/Ency/Circuit.shtml?Title="+SW_Ency;
            break;
        case "Std":
            location.href="/Ency/Std.shtml?Title="+SW_Ency;
            break;
        case "Dictionary":
            location.href="/Ency/Dictionary.shtml?Title="+SW_Ency;
            break;
        case "Chips":
            location.href="/Ency/Chips.shtml?Title="+SW_Ency;
            break;
        case "Company":
            location.href="/Ency/Company.shtml?Title="+SW_Ency;
            break;
        case "YQJ":
            location.href="/Ency/YQJ.shtml?Title="+SW_Ency;
            break;
    }
}

function Button_Search_News()
{
    var SW_News=document.getElementById("ctl00_SW_News").value;
    var News_Type=document.getElementById('ctl00_News_Type').options[document.getElementById('ctl00_News_Type').selectedIndex].value;
    
    switch(News_Type)
    {
        case "News":
            location.href="/News/List.aspx?Title="+SW_News+"&N_State=Search";
            break;
        case "Market":
            location.href="/News/MarketList.aspx?Title="+SW_News+"&N_State=Search";
            break;
        case "Collection":
            location.href="/News/CollectionList.aspx?Title="+SW_News+"&N_State=Search";
            break;
    }
}
