<!-- Original:  Dion (biab@iinet.net.au) -->
<!-- Web Site:  http://www.iinet.net.au/~biab -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Modifications by Doug Fuller for proper display of results-->
<!-- Modification by Doug Fuller to convert input to lower case for match-->

<!-- Begin
<!-- Grab the search tables -->
document.write("<script src='/Common/searchEngineTables.js'><\/script>");

//pagebasics="<html><head><title>Search Results</title></head><body bgcolor='white'><center><H2>Search Results</H2></center><p><table border=0 cellspacing=2 width=80%>";
pagebasics="<html><head><title>Search Results</title></head><body bgcolor='white'><center><H2>Search Results</H2></center><p><br><br>";

function search(frm) {
	txt = frm.srchval.value.split(" ");
	fnd = new Array(); total=0;
	for (i = 0; i < se_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 (se_item[i][order[j]].toLowerCase().indexOf(txt[k].toLowerCase()) > -1 && txt[k] != "")
				fnd[i] += (j+1);
		}
	win = window.open("","","scrollbars,resizable");
	win.document.write(pagebasics);
	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>Total matching pages found: "+total+"<br></body></p></html>");
	win.document.close();
	}

function show(which,wind,num) {
	link = se_item[which][1] + se_item[which][0]; 
	line = "<a href='"+link+"'>"+se_item[which][2]+"</a> Score: "+num+"<br>";
	line += se_item[which][4] + "<br><br>";
	wind.document.write(line);
	return 1;
	}
//  End -->
