title = new Object();
desc = new Object();
links= new Object();
matched= new Object();
keywords= new Object();
found= new Object();
var temp=0;
// actual location or the item to be searched
// description of he location
// actual link
// percentage match found
// keywords as parsed from the input
// # of titles present in the database
title[0]=9
//no of keywords after parsing
keywords[0]=0
//no of  matches found.
found[0]=0

title[1]="wywiad"
desc[1]="Rozmowa Polskiego Trakera z Aurelią Kuran-Puszkarską, prezesem Polskiej Izby Paliw Płynnych Zbiornik czy parking?"
links[1]="http://www.polskitraker.pl/newnumer/wywiad.php3"
matched[1]=0

title[2]="wywiad"
desc[2]="Rozmowa Polskiego Trakera z kierownikiem Zakładu Organizacji, Zarządzania i Informatyki w Instytucie Transportu Samochodowego dr. Bogusławem Madejem."
links[2]="http://www.polskitraker.pl/arch/2002/czerwiec/wywiad.php3"
matched[2]=0

title[3]="wywiad"
desc[3]="Rozmowa Polskiego Trakera z dyr. Tadeuszem Suwarą z Generalnej Dyrekcji Dróg Krajowych i Autostrad"
links[3]="http://www.polskitraker.pl/arch/2002/lipiecsierpien/wywiad.php3"
matched[3]=0

title[4]="wywiad"
desc[4]="Rozmowa Polskiego Trakera z Danutą Konopką, naczelnik Wydziału Warunków Pracy w Biurze Kadr Ministerstwa Infrastruktury"
links[4]="http://www.polskitraker.pl/arch/2002/wrzesien/wywiad.php3"
matched[4]=0

title[5]="wywiad"
desc[5]="Rozmowa Polskiego Trakera z prezesem Ogólnopolskiego Związku Pracodawców Transportu Drogowego - Bolesławem Milewskim"
links[5]="http://www.polskitraker.pl/arch/2002/pazdziernik/wywiad.php3"
matched[5]=0

title[6]="wywiad"
desc[6]="Rozmowa Polskiego Trakera z Krzysztofem Grzegorczykiem, radcą ministra w Ministerstwie Infrastruktury 10 proc. przewozów"
links[6]="http://www.polskitraker.pl/arch/2002/listopad/wywiad.php3"
matched[6]=0

title[7]="volvo"
desc[7]="nowości"
links[7]="http://www.polskitraker.pl/arch/2002/czerwiec/nowosci.php3"
matched[7]=0

title[8]="volvo"
desc[8]="technika"
links[8]="http://www.polskitraker.pl/arch/2002/lipiecsierpien/technika.php3"
matched[8]=0

title[9]="volvo"
desc[9]="test"
links[9]="http://www.polskitraker.pl/arch/2002/listopad/test.php3"
matched[9]=0


<!-- End list of Searchable items -->

function search(){
var skeyword=document.searchengine.keywords.value.toLowerCase();
var check=1;
var pos=0;
var i=0;
var j=0;
var  itemp=0;
var config='';

while (true)
	{
	if (skeyword.indexOf("+") == -1 )
		{
		keywords[check]=skeyword;
		break;
		}
	pos=skeyword.indexOf("+");
	if (skeyword !="+")	
	{
	keywords[check]=skeyword.substring(0,pos);
	check++;
	}
	else
	{
	check--;
	break;
	}
	skeyword=skeyword.substring(pos+1, skeyword.length);	
	if (skeyword.length ==0)
		{
		check--;
		break;
		}
			 
	}
// the keywords have been put in keywords object.
keywords[0]=check;

// matching and storing the matches in matched
for ( i=1; i<=keywords[0];i++)
	{
	for (j=1;j<=title[0];j++)
		{
		if (title[j].toLowerCase().indexOf(keywords[i]) > -1 )
			{
			  matched[j]++;
			}
		}	
	}
// putting all the indexes of the matched records  in found

for (i=1;i<=title[0];i++)
{
	if (matched[i] > 0 )
		{
		  found[0]++;
		// increment the found 	
		  found[found[0]]=i;
			
		}	
}



for (i=1;i<=found[0]-1;i++)
	{
	for(j=i+1;j<=found[0];j++)
		{
		if ( matched[found[i]]< matched[found[j]] )
			{
			temp= found[j];
			found[j]=found[i];
			found[i]=temp;
			}
		}
	}

// end of sort

output = self;
output.document.write('<html>');
output.document.write('<head>');
output.document.write('<script>');
output.document.write('window.onerror=new Function("return true")');
output.document.write('<\/script>');
output.document.write('<title>.....::::: Polski Traker - Miesięcznik Transportu Drogowego i Spedycji :::::.....</title>');
output.document.write('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">');
output.document.write('</head>');
output.document.write('<BODY background=http://www.polskitraker.pl/tlo.gif  text=#000000  link=#000080 vlink =#FF0000 >');


output.document.write('<font face=Verdana, Arial, Helvetica, sans-serif size=2>poszukiwany słowo kluczowe: </font>'.big() )
for (i=1;  i<=keywords[0]; i++)
	{
	output.document.write(keywords[i].bold() +"   ");
	}
output.document.write('<br>');

if (found[0]==0)
	{
	//alert(found[0]);
	output.document.write('<hr noshade>');
	output.document.write("<b><font face=Verdana, Arial, Helvetica, sans-serif size=1 color=red>niestety nie znaleziono tego słowa </b></font><br>");
	output.document.write("<font face=Verdana, Arial, Helvetica, sans-serif size=1 color=red>zastosuj inne słowo kluczowe</font><br>");
	}
else
	{
	// data has been found
	output.document.write(" <hr noshade> <b> <font face=Verdana, Arial, Helvetica, sans-serif size=2>rezultat poszukiwania:</font></b>  ");
	output.document.write( found[0] +  "<font face=Verdana, Arial, Helvetica, sans-serif size=2> Znalezionych adresów:</font>");
	output.document.write("<font face=Verdana, Arial, Helvetica, sans-serif size=1>");
	output.document.write("<table border=0  width=100%>");
	for (i=1; i<=found[0];i++)
		{
		output.document.write("<tr><td valign=middle align=center bgcolor=red>");
		output.document.write("<font face=Verdana, Arial, Helvetica, sans-serif size=2 color=white><b>" +i +"</b></font>");
		output.document.write("<td valign=top>");
		itemp=found[i];
		output.document.write(desc[itemp].bold() +"<br>" +
		links[itemp].link(links[itemp])+"<br>");
		temp= (matched[itemp]/keywords[0])*100
		output.document.write("<font face=Verdana, Arial, Helvetica, sans-serif size=1> trafność  : " +temp+"%  </font>" );
		matched[itemp]=0
		} 
	found[0]=0;
	output.document.write("</font>");
	output.document.write("</table>");
	}


output.document.write ("</body></html>"); 
output.document.close();
}