/* ############################################################################### # Copyright (C) 2001 T.Kimata # http://www.nk.rim.or.jp/~t_kimata/cgi/ # # All rights reserved. # # This software is provided 'as-is', without any express or implied warranty. # In no event will the authors be held liable for any damages arising from the # use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not claim # that you wrote the original software. If you use this software in a product, # an acknowledgment in the product documentation would be appreciated but is # not required. # # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # ############################################################################### */ ENGINES = new Array( new Array( "Google", "http://www.google.com/", "http://www.google.com/search?q=" ), new Array( "Yahoo", "http://www.yahoo.co.jp/", "http://search.yahoo.co.jp/bin/search?p=" ), new Array( "Goo", "http://www.goo.ne.jp/", "http://www.goo.ne.jp/default.asp?MT=" ), new Array( "Fresheye", "http://www.fresheye.com/", "http://search.fresheye.com/?kw=" ), new Array( "Excite", "http://www.excite.co.jp/", "http://www.excite.co.jp/search.gw?search=" ), new Array( "Lycos", "http://www.lycos.co.jp/", "http://www.lycos.co.jp/cgi-bin/pursuit?query=" ), new Array( "Infoseek", "http://www.infoseek.co.jp/", "http://www.infoseek.co.jp/Titles?qt=" ), new Array( "GooE2J", "http://dictionary.goo.ne.jp/ej/", "http://dictionary.goo.ne.jp/cgi-bin/dict_search.cgi?sw=0&MT=" ), new Array( "GooJ2E", "http://dictionary.goo.ne.jp/je/", "http://dictionary.goo.ne.jp/cgi-bin/dict_search.cgi?sw=1&MT=" ), new Array( "GooJDic", "http://dictionary.goo.ne.jp/jp/", "http://dictionary.goo.ne.jp/cgi-bin/dict_search.cgi?sw=2&MT=" ), new Array( "GooNJDic", "http://dictionary.goo.ne.jp/nw/", "http://dictionary.goo.ne.jp/cgi-bin/dict_search.cgi?sw=3&MT=" ), new Array( "E_Words", "http://www.e-words.ne.jp/", "http://www.e-words.ne.jp/search.asp?word=" ), new Array( "BizTech", "http://biztech.nikkeibp.co.jp/", "http://bizns.nikkeibp.co.jp/cgi-bin/search/title.cgi?NP_DSPN=20&NP_SHTML=easy&NP_THTML=title-sample&NP_BHTML=bun-sample&NP_SORT=1&NP_KEY1=" ) ); NAME = 0; JUMP_LOCATION = 1; SEARCH_LOCATION = 2; function SubmitHandler(targetForm) { engineName = ""; keyword = ""; engine = null; for (i = 0; i < document.forms.length; i++) { for (j = 0; j < document.forms[i].elements.length; j++) { element = document.forms[i].elements[j]; // 検索エンジンをプルダウンメニュー以外で指定する場合は修正の必要あり if ((engineName == "") && (element.name == "engine")) { engineName = element.options[element.selectedIndex].text; } if ((keyword == "") && (element.name == "keyword")) { keyword = element.value; } } if ((engineName != "") && (keyword != "")) { break; } } if (escape("漢字") == "%u6F22%u5B57") { // 最低限のものだけ置き換える keyword = keyword.replace("%", "%25").replace("#", "%23").replace("?", "%3F"); } else { keyword = escape(keyword); } if (engineName == "") { return Error("検索エンジンを指定してください。"); } for (i = 0; i < ENGINES.length; i++) { if (ENGINES[i][NAME] == engineName) { engine = ENGINES[i]; break; } } if (engine == null) { return Error("未知の検索エンジンが指定されました。"); } if (keyword == "") { location.href = engine[JUMP_LOCATION]; } else { location.href = engine[SEARCH_LOCATION] + keyword; } } function Error(message) { alert(message); }