var MAX_ENGINES = 30;
var EHGO_STRING = "eight+hundred+go";
function MakeArray(n) {
for (var i = 1; i <= n; i++) {
this[i] = 0;
}
this.maxlen = n;
this.len = 0;
return this;
}
var engs = new MakeArray(MAX_ENGINES);
function find_substring(needle, haystack) {
var i, needlen = needle.length, haylen = haystack.length;
for (i=0; i<=haylen-needlen; i++) {
if (needle == haystack.substring(i,i+needlen))
return i;
}
return false;
}
function Engine(name, opts, home, search) {
var ehgo = find_substring(EHGO_STRING, search);
this.name = name;
this.opts = opts;
this.home = home;
this.pre_ehgo = search.substring(0,ehgo);
this.post_ehgo= search.substring(ehgo+EHGO_STRING.length, search.length);
}
function Add(name, opts, home, search) {
engs.len++;
if (engs.len <= engs.maxlen) {
engs[engs.len] = new Engine(name, opts, home, search)
}
else {
alert("Increase MAX_ENGINES: " + engs.len + ">" + engs.maxlen)
}
}
function DisplayForm() {
document.writeln('<CENTER><FORM Name=EhuGoform OnSubmit="HandleForm(this); return false">');
document.writeln('<INPUT size=26 name="query">');
document.writeln(' <SELECT name="service">');
for (i=1; i <= engs.len; i++) {
document.writeln("<OPTION " + engs[i].opts + "> " + engs[i].name);
}
document.writeln('</SELECT> &nbsp; <input type=submit value="   go !  "></FORM>');
document.writeln('</font></CENTER>');
query = self.location.search;
if (query != null && query !='') {
if (query.length > 1) {
query = query.substring(1, query.length);
document.EhuGoform.query.value=query
}
}
// document.EhuGoform.query.focus()
}
function HandleForm(form) {
//form.submit();
var i, newq="", oldq=form.query.value;
for (i=0; i<oldq.length; i++) {  // compress [ ]+ into \+
var thischar = oldq.charAt(i);
if (thischar != ' ')
newq += thischar;
else if (lastchar != ' ')
newq += '+';
lastchar = thischar;
}
var eng = engs[1+form.service.selectedIndex];
window.open(newq ? eng.pre_ehgo + newq + eng.post_ehgo : eng.home);
//parent.parent.location.href = newq ? eng.pre_ehgo + newq + eng.post_ehgo : eng.home;
// document.EhuGoform.query.focus()
}

Add("Google", "", "http://www.google.ie/", "http://www.google.ie/search?q=eight+hundred+go" );
Add("Youtube", "", "http://www.youtube.com/", "http://www.youtube.com/results?search_type=&search_query=eight+hundred+go" );
Add("Polish Google", "", "http://www.google.pl/", "http://www.google.pl/search?q=eight+hundred+go" );
Add("French Google", "", "http://www.google.fr/", "http://www.google.fr/search?q=eight+hundred+go" );
Add("German Google", "", "http://www.google.de/", "http://www.google.de/search?q=eight+hundred+go" );
Add("Greek Google", "", "http://www.google.gr/", "http://www.google.gr/search?q=eight+hundred+go" );
Add("Romanian Google", "", "http://www.google.ro/", "http://www.google.ro/search?q=eight+hundred+go" );
Add("Italian Google", "", "http://www.google.it/", "http://www.google.it/search?q=eight+hundred+go" );
Add("Latvian Google", "", "http://www.google.lv/", "http://www.google.lv/search?q=eight+hundred+go" );
Add("Russian Google", "", "http://www.google.ru/", "http://www.google.ru/search?q=eight+hundred+go" );
Add("Spanish Google", "", "http://www.google.es/", "http://www.google.es/search?q=eight+hundred+go" );
Add("Dutch Google", "", "http://www.google.nl/", "http://www.google.nl/search?q=eight+hundred+go" );
Add("Ebay", "", "http://www.ebay.com/", "http://search.ebay.com//search/search.dll?from=R40&satitle=eight+hundred+go" );
Add("Yahoo", "selected", "http://www.yahoo.com/", "http://search.yahoo.com/bin/search?p=eight+hundred+go" );
Add("Yahoo Ireland", "", "http://www.yahoo.com/", "http://uk.search.yahoo.com/search/ukie?y=ie&p=eight+hundred+go" );
Add("Yahoo UK", "", "http://www.yahoo.com/", "http://uk.search.yahoo.com/search/ukie?y=uk&p=eight+hundred+go" );
Add("Lycos", "", "http://www.lycos.com/", "http://www.lycos.com/cgi-bin/pursuit?query=eight+hundred+go" );
Add("Excite", "", "http://www.excite.com/", "http://search.excite.com/search.gw?search=eight+hundred+go" );
Add("Hot Bot", "", "http://www.hotbot.com/", "http://www.hotbot.com/default.asp?MT=eight+hundred+go" );
Add("Dog Pile", "", "http://www.dogpile.com/", "http://ms3.dogpile.com/search?q=eight+hundred+go" );
Add("Info Seek", "", "http://www.infoseek.com/", "http://www.infoseek.com/Titles?qt=eight+hundred+go" );
Add("Alta Vista", "", "http://altavista.digital.com/", "http://altavista.digital.com/cgi-bin/query?q=eight+hundred+go" );
Add("Deja News", "", "http://www.dejanews.com/", "http://www.dejanews.com/dnquery.xp?QRY=eight+hundred+go" );
Add("News Index", "", "http://www.newsindex.com/", "http://www.newsindex.com/cgi-bin/process.cgi?query=eight+hundred+go" );
Add("Look Smart", "", "http://www.looksmart.com/", "http://www.looksmart.com/r_search?key=eight+hundred+go" );
Add("Web Crawler", "", "http://www.webcrawler.com/", "http://www.webcrawler.com/cgi-bin/WebQuery?searchText=eight+hundred+go" );
Add("Meta Crawler", "", "http://www.metacrawler.com/", "http://www.metacrawler.com/crawler?general=eight+hundred+go" );
Add("Northern Light", "", "http://www.northernlight.com/", "http://www.northernlight.com/nlquery.fcg?qr=eight+hundred+go" );



//-->
