/*<title>Search Engines Load</title>
 * File: gl_search.js
 * Include with: <SCRIPT SRC="scripts/gl_search.js"></SCRIPT>
 *
 * Load Search Engines and execute call to selected engine
 */
// Create Array Function
function StringArray(num) {
  this.length = num;
  for (var i=0; i<num; i++) this[i] = new String();
  return this;
}
// Build query and submit to search engine
function NavToSearch() {
  var alpha = new StringArray(14);
  alpha[0] = "http://www.altavista.com/cgi-bin/query?pg=q&kl=XX&q=";
  alpha[1] = "http://search.yahoo.com/bin/search?p=";
  alpha[2] = "http://search.excite.com/search.gw?search=";
  alpha[3] = "http://www.hotbot.com/?MT=";
  alpha[4] = "http://www.infoseek.com/Titles?qt=";
  alpha[5] = "http://www.lycos.com/cgi-bin/pursuit?matchmode=and&cat=lycos&query=";
  alpha[6] = "http://www.webcrawler.com/cgi-bin/WebQuery?searchText=";
  alpha[7] = "http://search.iwon.com/commerce/multisearch.jsp?searchfor=";
  alpha[8] = "http://www.networksolutions.com/whois/results.jsp?domain=";
  alpha[9] = "http://";
  alpha[10] = "http://www.google.com/search?q=";
  alpha[11] = "http://multimeta.com/prog/multicrawlg.cgi?ort=Acoon,Altavista,Voila,Excite,HotBot,Lycos,MSN,Infoseek,Yahoo.de,Yahoo.com&suchbegriff=";
  alpha[12] = "http://ixquick.com/do/metasearch.pl?language=english&cat=web&query=";
  alpha[13] = "http://www.alltheweb.com/cgi-bin/search?type=all&query=";

  var omega = new StringArray(14);
  omega[0] = "&search=Search";
  omega[1] = "";
  omega[2] = "";
  omega[3] = "&SM=MC&DV=0&LG=any&DC=10&DE=2&submit=SEARCH&_v=2&OPs=MDRTP";
  omega[4] = "&col=WW&sv=IS&lk=noframes";
  omega[5] = "&x=40&y=5";
  omega[6] = "";
  omega[7] = "&alias=%2Falias%2Fsearch";
  omega[8] = "";
  omega[9] = "";
  omega[10] = "&btnG=Google+Search";
  omega[11] = "&darstellung=Zusammenfassung&darstellung=Einzelansicht";
  omega[12] = "";
  omega[13] = "";

  var Snum = document.searchform.robot.selectedIndex;
  var the_input = document.searchform.searchtext.value;
  if (the_input.indexOf(" ") != -1) {
    var the_input_array = the_input.split(" ");
        the_input = "";
    for (var i=0; i<the_input_array.length-1; i++)
        the_input = the_input + the_input_array[i] + "+";
        the_input += the_input_array[the_input_array.length-1];
  }

  var stuff_to_send = alpha[Snum] + the_input + omega[Snum];
  top.location = stuff_to_send;
}


