// codigo del script Copyright(C) 1996, Justin Boyan, jab+j@cs.cmu.edu
var MAX_ENGINES = 30;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("Google","","http://www.google.com/advanced_search?hl=es&lr=&safe=off",
"http://www.google.com/search?q=hunting+the+snark&safe=off&hl=es&btnG=porta" );Add("Google, espa&ntilde;ol","","http://www.google.com/advanced_search?hl=es&lr=&safe=off",
 "http://www.google.com/search?as_q=hunting+the+snark&btnG=B%FAsqueda+en+Google&lr=lang_es" );Add(" Vivisimo, metabuscador","","http://vivisimo.com/form?form=Advanced","http://vivisimo.com/search?query=hunting+the+snark&se=Yahoo%2CMSN%2CFast%2CNetscape%2COD%2CLooksmart%2CAskJeeves&enablejs=1" );Add("Sol","","http://www.sol.es/","http://www.sol.es/buscar.asp?q=hunting+the+snark" );Add("Wisenut","","http://www.wisenut.com/","http://www.wisenut.com/search/query.dll?q=hunting+the+snark");Add("Open Directory","","http://search.dmoz.org/","http://search.dmoz.org/cgi-bin/search?search=hunting+the+snark" );Add("Alltheweb", "","http://www.alltheweb.com/","http://www.alltheweb.com/search?cat=web&lang=any&query=hunting+the+snark" );Add("Altavista","","http://es.altavista.com/","http://es-ca.altavista.com/cgi-bin/query?text=yes&aveenc=1&pg=q&sc=on&q=hunting+the+snark&kl=XX&what=web");Add("Altavista, espa&ntilde;ol","","http://es.altavista.com/","http://es.altavista.com/q?pg=q&text=yes&Translate=on&q=hunting+the+snark&kl=es&search=B%C3%BAsqueda&what=web");
function HandleForm(form) {form.submit(); // This fixes a mysterious Netscape bug.
var i, oldq=form.query.value, newq="";for (i=0; i<oldq.length; i++) {  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('<FORM OnSubmit="HandleForm(this); return false">');document.writeln('<font color="Maroon" size="-1"><b>Busca con</b>:</font> <select name="service"  class="caixa2">');for (i=1; i <= engs.len; i++) {document.writeln("<OPTION " + engs[i].opts + "> " + engs[i].name);}document.writeln('</SELECT><INPUT size="20" class="caixa2" name="query"><input type="submit" value="Busca!" class="caixa1"></FORM>');}DisplayForm(); 
//eurocalc
function formatnumber(number){ var i = 0; var result = ""; var limit = 0; num = (Math.round(number*100))/100; num = num + ""; var len = num.length; var posit = num.indexOf("."); if (num == "NaN") result = "error!"; else{ if (posit == "-1")  result = num + ".00";  else{if (posit == "0")  result = "0";  limit = posit;         if ((len-posit) >= 3)  result = result + num; else{ for (i=0; i<limit; i++)  result = result + num.charAt(i); result = result + "."; if ((len-posit) == 2) result = result + num.charAt(limit+1) + "0"; else if ((len-posit) == 1) result = result + "00";}}} return(result);} function convert(country, currency){ var euros; if (country != "EUR"){ eval("euros = document.cal." + country + ".value/" + currency + ";"); eval("document.cal.EUR.value = formatnumber(euros);");}else{  euros = document.cal.EUR.value;}  if (country != "ESP")  document.cal.ESP.value =formatnumber(euros*166.386);};
