﻿function SearchKeyword() {
    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 == "inside")
        strUrl = "http://sou.healthbanks.cn/?k=" + escape(strKeyWords);
    else 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);
}
function submitenter(obj, e) {
    var keycode;
    if (window.event) keycode = window.event.keyCode;
    else if (e) keycode = e.which;
    else return true;

    if (keycode == 13) {
        ExteriorSearch();
        return false;
    }
    else
        return true;
}