﻿function SearchKeyword()
{
    if(document.getElementById("ExteriorType").value=="inside")
    {
        var strKeyword=document.getElementById("txtKeyWord").value;
        if(strKeyword=="")
        {
            alert("请输入关键字！");
            document.getElementById("txtKeyWord").focus();
            return;
        }
        var url="/NewsList.aspx?k="+strKeyword;
        
        Healthbanks.SNW.BusinessRules.Ajax.InsertSearchKeyword(strKeyword);
        window.location=url;
    }
    else
    {
        ExteriorSearch();
    }
}
function ExteriorSearch()
{
    var strKeyWords=document.getElementById("txtKeyWord").value;
    if(strKeyWords=="")
    {
        alert("请输入关键字");
        document.getElementById("txtKeyWord").focus();
        return;
    }
    var strExteriorType=document.getElementById("ExteriorType").value;
    var strUrl="";
    if(strExteriorType=="baidu")
        strUrl="http://www.baidu.com/s?wd="+strKeyWords+"&cl=3";
    else if(strExteriorType=="google")
        strUrl="http://www.google.cn/search?complete=1&hl=zh-CN&q="+strKeyWords+"&btnG=Google+%E6%90%9C%E7%B4%A2&meta=";
    else if(strExteriorType=="yahoo")
        strUrl="http://search.cn.yahoo.com/search?p="+strKeyWords+"&ei=UTF-8&source=ysearch_web_hp_button&z=";
    else if(strExteriorType=="soso")
        strUrl="http://www.soso.com/q?pid=s.idx&w="+strKeyWords;  
    else if(strExteriorType=="sogou")
        strUrl="http://www.sogou.com/web?query="+strKeyWords+"&pid=58009401";  
    else if(strExteriorType=="163")
        strUrl="http://so.163.com/search.php?q="+strKeyWords;     
  
    window.open(strUrl);
}