// JavaScript Document

title = new Object();
desc = new Object();
links= new Object();
matched= new Object();
keywords= new Object();
found= new Object();
var temp=0;

// # of titles present in the database
title[0]=8
//no of keywords after parsing
keywords[0]=0
//no of  matches found.
found[0]=0

<!-- Begin List of Searchable Items -->

<!--put the list of the links and descriptions here!!-->

title[1]="60 75 78 91 92 93 94 95"
desc[1]=""
links[1]="0ile.html"
matched[1]=0

title[2]="8 08 10 21 25 39 51 52 54 55 57 67 68 70 88 90"
desc[2]=""
links[2]="p04.html"
matched[2]=0

title[3]="1 01 5 05 3 03 15 23 38 42 43 63 69 71 73 74"
desc[3]=""
links[3]="p07.html"
matched[3]=0

title[4]="4 04 6 06 7 07 12 13 20 26 30 34 48 83 84"
desc[4]=""
links[4]="p08.html"
matched[4]=0

title[5]="9 09 11 16 17 19 24 31 32 33 40 46 47 64 65 66 81 82 87"
desc[5]=""
links[5]="p09.html"
matched[5]=0

title[6]="14 22 29 35 37 44 49 50 53 56 61 72 79 85 86"
desc[6]=""
links[6]="p10.html"
matched[6]=0

title[7]="2 02 27 59 62 76 80"
desc[7]=""
links[7]="p13.html"
matched[7]=0

title[8]="18 28 36 41 45 58 77 89"
desc[8]=""
links[8]="p14.html"
matched[8]=0

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

function search(){
var lower=document.searchengine.keywords.value.toLowerCase();
var skeyword=lower.slice(0, 2);
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;
		}
			 
	}

keywords[0]=check;


for ( i=1; i<=keywords[0];i++)
	{
	for (j=1;j<=title[0];j++)
		{
		if (title[j].toLowerCase().indexOf(keywords[i]) > -1 )
			{
			  matched[j]++;
			}
		}	
	}


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



if (found[0]==0)

	{
    var URL = '0fail.html';
    return (URL)     	      
	}
	
else

{
	for (i=1; i<=found[0];i++)
	
	{
		itemp=found[i];
    var URL = links[itemp];
    return (URL)      
	}
}

}

function output()
{   

{var ges = search();}
  
  document.open(); 
  window.location.replace(ges);
  document.close();

}
