Great ! Works like a charm ! Thank you very much !
There is half my problem solved !
I have a different kind of search in the top right. I can't see how to do the same thing with this one:
<SCRIPT>
<!-- hide this script from non-JavaScript browsers
var MAX_ENGINES = 75;
var SNARK_STRING = "hunting+the+snark";
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 snark = find_substring(SNARK_STRING, search);
this.name = name;
this.opts = opts;
this.home = home;
this.pre_snark = search.substring(0,snark);
this.post_snark= search.substring(snark+SNARK_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("Better increase MAX_ENGINES: " + engs.len + ">" + engs.maxlen)
}
}
// ADD YOUR OWN SEARCH ENGINES BELOW. (See http://www.cs.cmu.edu/~jab/snark/ )
Add("Google", "",
"http://www.google.com",
"http://www.google.com/search?q=hunting+the+snark&btnG=Google+Search");
Add("Alltheweb", "",
"http://www.AllTheWeb.com",
"http://www.alltheweb.com/search?cat=web&lang=english&query=hunting+the+snark");
// ADD YOUR OWN SEARCH ENGINES ABOVE. (See http://www.cs.cmu.edu/~jab/snark/ )
function HandleForm(form) {
form.submit(); // This fixes a mysterious Netscape bug. Without this line,
// you can't use <enter> to start the search the first time.
var i, oldq=form.query.value, newq="";
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];
location.href = newq ? eng.pre_snark + newq + eng.post_snark : eng.home;
}
function DisplayForm() {
document.writeln('<CENTER><FORM OnSubmit="HandleForm(this); return false">');
document.writeln('<SELECT name="service">');
for (i=1; i <= engs.len; i++) {
document.writeln("<OPTION " + engs[i].opts + "> " + engs[i].name);
}
document.writeln('</SELECT> <INPUT size=20 name="query">');
document.writeln('<input type=submit value=" Submit">');
document.writeln('<input type=reset value=" Reset">');
document.writeln('</FORM> </CENTER>');
}
DisplayForm();
// done hiding from old browsers -->
</SCRIPT> <!-- END JavaScript Search Code ---->
Maybe something in this line ?
}
var eng = engs[1+form.service.selectedIndex];
locaton.href = newq eng.pre_snark + newq + eng.post_snark : eng.home;
}
I don't know.....still learning. If you can fix this for me as well, I would be most greatful indeed !