Codice HTML:
<Haed>
<script language="JavaScript" type="text/javascript">
<!-- Prelevato su [url]http://www.web-link.it[/url]
<!-- Original: Dion (biab@iinet.net.au) -->
<!-- Web Site: [url]http://www.iinet.net.au/~biab[/url] -->
<!-- Begin
var item = new Array();
/* Here is where all the magic happens.
Just enter as many additional pages that
that you want to search, then fill in the
additional listings for each page.
*/
// "Nome pagina","percorso","Titolo pagina","parole,chiave,Key,Words","Descrizione e Commenti"
c=0; item[c]=new Array("http://www.lautoitaliana.altervista.org/index_file/Bugatti.htm","","Bugatti","storia, bugatti, ettore, modelli","Pagina del portale dedicata interamente alla Bugatti.");
c++; item[c]=new Array("index_file/Diatto.htm","","Diatto","diatto, modelli, storia","Pagina del portale dedicata interamente alla Diatto.");
c++; item[c]=new Array("index.html","","Guida html","html,links,pagina,web","Guida html.");
c++; item[c]=new Array("scripting.htm","main/","Scripting","script,scripting,javascript,dhtml","Scripting per tutti.");
c++; item[c]=new Array("lewebcen.gif","main/images/","Link Logo","link,image,logo,graphic,immagine","Il logo del mio sito in formato gif. Potete fare un link adoperando questo.");
page="<html><head><title>Search Results</title></head><body bgcolor='white'><center><table border=0 cellspacing=10 width=80%>";
function search(frm) {
win = window.open("","","scrollbars");
win.document.write(page);
txt = frm.srchval.value.split(" ");
fnd = new Array(); total=0;
for (i = 0; i < item.length; i++) {
fnd[i] = 0; order = new Array(0, 4, 2, 3);
for (j = 0; j < order.length; j++)
for (k = 0; k < txt.length; k++)
if (item[i][order[j]].toLowerCase().indexOf(txt[k]) > -1 && txt[k] != "")
fnd[i] += (j+1);
}
for (i = 0; i < fnd.length; i++) {
n = 0; w = -1;
for (j = 0;j < fnd.length; j++)
if (fnd[j] > n) { n = fnd[j]; w = j; };
if (w > -1) total += show(w, win, n);
fnd[w] = 0;
}
win.document.write("</table><br><div style='font-family: verdana; font-size: 9pt;'>Parole trovate: "+total+"<br></div></body></html>");
win.document.close();
}
function show(which,wind,num) {
link = item[which][1] + item[which][0];
line = "<tr><td><div style='font-family: verdana; font-size: 11pt;'><b><a href='"+link+"'>"+item[which][2]+"</a></b></div><br><div style='font-family: verdana; font-size: 8pt;'> Punti: "+num+"<br></div>";
line += "<div style='font-family: verdana; font-size: 11pt;'>"+item[which][4]+"<br><div style='font-family: verdana; font-size: 8pt; color: #C0C0C0;'>"+link+"</div></div></td></tr>";
wind.document.write("<tr><td><div style='font-family: verdana; font-size: 14pt;'>"+line+"</div></td></tr>");
return 1;
}
// Prelevato su [url]http://www.web-link.it[/url]
// End -->
</SCRIPT>
</Head>
<body>
<form method=get action="javascript:void(0)" onsubmit="search(this); return false;">
<input type=text name=srchval value=""><input type=submit value="Cerca">
</form>
</body>
Vi ringrazio anticipatamente per le risposte.