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]=22
//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]="Rabindra Sadan, rabindrasadan, auditoriam, rabindrasadan auditoriam, sadan, sadon, rabindrosadan, hall"
desc[1]="Information About Rabindra Sadan "
links[1]="http://www.tathyabangla.org.in/public/i_cadeprt/Auditoriums/raviaudi.asp"
matched[1]=0

title[2]="Mahajati Sadan, mahajatisadan, auditoriam, mahajatisadan auditoriam, mahajoti sadan, mohajyoti sadan, sadon, hall"
desc[2]="Information About Mahajati Sadan"
links[2]="http://www.tathyabangla.org.in/public/i_cadeprt/Auditoriums/mahaaudi.asp"
matched[2]=0

title[3]="Girish Mancha, girishmancha, auditoriam, girishmancha auditoriam, mancha, moncho, mancho, hall"
desc[3]="Information About Girish Mancha"
links[3]="http://www.tathyabangla.org.in/public/i_cadeprt/Auditoriums/giriaudi.asp"
matched[3]=0

title[4]="Madhusadan Mancha, madhusadanmancha, auditoriam, madhusadanmancha auditoriam, mancha, moncho, mancho, hall"
desc[4]="Information About Madhusadan Mancha"
links[4]="http://www.tathyabangla.org.in/public/i_cadeprt/Auditoriums/madhuaudi.asp"
matched[4]=0

title[5]="Sisir Mancha, sisirmancha, auditoriam, sisirmancha auditoriam, mancha, moncho, mancho, hall"
desc[5]="Information About Sisir Mancha"
links[5]="http://www.tathyabangla.org.in/public/i_cadeprt/Auditoriums/sisiaudi.asp"
matched[5]=0

title[6]="University Institute Hall, CU, auditoriam, calcutta university hall, hall, university hall"
desc[6]="Information About University Institute Hall"
links[6]="http://www.tathyabangla.org.in/public/i_cadeprt/Auditoriums/calaudi.asp"
matched[6]=0

title[7]="Dinbandhu Mancha, dinbandhumancha, auditoriam, dinabandhumancha, dinobandhu, dinobandhumancha, dinbandhu auditoriam, mancha, moncho, mancho, hall"
desc[7]="Information About Sisir Mancha"
links[7]="http://www.tathyabangla.org.in/public/i_cadeprt/Auditoriums/dinaudi.asp"
matched[7]=0

title[8]="Gaganendra Pradarsasala, Gaganendra, exhibition, exhibition hall, hall, exhibition center"
desc[8]="Information About Gaganendra Pradarsasala"
links[8]="http://www.tathyabangla.org.in/public/i_cadeprt/Auditoriums/dinaudi.asp"
matched[8]=0


title[9]="Nandan, hall"
desc[9]="Information About Nandan"
links[9]="http://www.tathyabangla.org.in/public/i_cadeprt/Nandan/NandanAct.asp"
matched[9]=0

title[10]="Madhyamik, madhyamikresult, result, w.b.b.s.e, madhyamikresult07, madhyamikresult2007, madhyamik result, madhyamik result07, madhyamik result2007"
desc[10]="Madhyamik Result"
links[10]="http://www.tathyabangla.org.in/madhyamik/index.asp"
matched[10]=0

title[11]="Joint, Joint entrance result, result, jee, jointresult"
desc[11]="Joint Entrance Result"
links[11]="http://www.tathyabangla.org.in/jee/index.asp"
matched[11]=0

title[12]="result, Madrasah Examination Result, madrasah"
desc[12]="Madrasah Result"
links[12]="http://www.wbresults.nic.in/wbmadrasah_07.asp"
matched[12]=0

title[13]="hs, h.s, hs result, h.s result, h.s. result, h.s., Higher secondary, Highersecondary, result, w.b.c.h.s.e, Highersecondaryresult, Higher secondary result, Higher secondary result 2007, Higher secondary result07, result2007"
desc[13]="Higher Secondary Result"
links[13]="http://www.tathyabangla.org.in/hs/index.asp"
matched[13]=0

title[14]="district of west bengal, district, district profile, west bengal, north 24 parganas, uttar 24 parganas, uttar 24 parganas, South 24 Parganas, 24 prgs, 24 Prgs,  Bankura, Birbhum, Burdawan, CoochBihar, Dakshin Dinajpur, Darjeeling, Hoogly, Howrah, Jalpaiguri, Kolkata, Malda, Murshidabad, Nadia, Paschim Medinipur, Purba Medinipur, Purulia, Uttar Dinajpur, uttar dinajpur, North Dinajpur, north dinajpur, southth dinajpur"
desc[14]="West Bengal District Profile"
links[14]="http://www.tathyabangla.org.in/impinfo/District_Profile.doc"
matched[14]=0

title[15]="minister, west bengal minister, minister of west bengal, wb minister, minister of wb, West Bengal Ministers"
desc[15]="West Bengal Ministers"
links[15]="http://www.tathyabangla.org.in/impinfo/List of Ministers_Modified.pdf"
matched[15]=0

title[16]="mla, mla list, list of mla, mal west bengal, west bengal mla, kolkata mla,  Members of WB Legislative Assembly, Legislative Assembly, Members Legislative Assembly"
desc[16]="Members of WB Legislative Assembly"
links[16]="http://www.tathyabangla.org.in/impinfo/MLA_List_Address.pdf"
matched[16]=0

title[17]="Savadhipatis of West Bengal, Savadhipatis, savadhipatis"
desc[17]="Savadhipatis of West Bengal"
links[17]="http://www.tathyabangla.org.in/impinfo/Sabhadhipati list.pdf"
matched[17]=0

title[18]="Lok Sabha MPs from West Bengal, mp, west bengal mp, mp list, list of mp, mp from west bengal, mp of west bengal, mp of lok sabha"
desc[18]="Lok Sabha MPs from West Bengal"
links[18]=""http://164.100.24.209/newls/statecontactdetail.aspx?state_name=West%20Bengal"
matched[18]=0

title[19]="Rajya Sabha MPs from West Bengal, mp, west bengal mp, mp list, list of mp, mp from west bengal, mp of west bengal, mp of rajya sabha"
desc[19]="Rajya Sabha MPs from West Bengal"
links[19]=""http://164.100.47.5:8080/members/StateWiseListBrief.asp?alphabet=W"
matched[19]=0

title[20]="Councillors of KMC, kmc, Councillors, Councillors list, list of Councillors, kolkata Councillors, councillor"
desc[20]="Councillors of KMC"
links[20]="http://www.tathyabangla.org.in/impinfo/List_KMC_Councillors.pdf"
matched[20]=0


title1[21]="Application For  Press Accreditation Card,List Of press accreditation,press accreditation card,press card,List of press,list of press card,accreditation card,press accreditation,approved press card"
title[21]="Application For  Press Accreditation Card"
desc[21]="Application For  Press Accreditation Card"
links[21]="http://www.tathyabangla.org.in/impinfo/Press_Accreditation_cards.pdf"
matched[21]=0


title[22]="List of DICOs & SDICOs,DICOs &SDICOs,DICOs,SDICOs,list of dicos and sdicos,dico,sdico,dicos,sdicos,list of dicos,list of sdicos.List of DICOs.List of SDICOs"
desc[22]="List of DICOs & SDICOs"
links[22]="http://www.tathyabangla.org.in/impinfo/List_of_DICO___SDICO.pdf"
matched[22]=0

<!-- End list of Searchable items -->

function search(){
var textVal = document.searchengine.keywords.value;
if(textVal == '')
{
	alert("Search criteria should be mentioned.");
	document.searchengine.keywords.focus();
	return false;
}
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> Search Results </title>');
output.document.write('</head>');
output.document.write('<BODY bgcolor=#ffffff  text=#000000  link=#990099 vlink =#339966 >');

output.document.write('<center> <h1> Search Results </h1></center>');    
output.document.write('<hr>');
output.document.write(' The Keyword(s) you searched :: '.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>');
	output.document.write("<b>No matches resulted in this search </b> <br>");
	output.document.write("You may close the results and reduce the length/number  of the keywords  <br>");
	}
else
	{
	// data has been found
	output.document.write(" <hr> <b> The Results of the search are  : </b>  ");
	output.document.write( found[0] +"  Entries found  ".italics());
	output.document.write("<table border=1 width=100%>");
	for (i=1; i<=found[0];i++)
		{
		output.document.write("<tr><td valign=top bgcolor=#9999ff>");
		output.document.write("<h3>" +i +"</h3>");
		output.document.write("<td valign=top>");
		itemp=found[i];
		output.document.write(desc[itemp].bold() +"<br>" +
		links[itemp].link(links[itemp])
		//"<a href=\"#\" onClick=window.showModalDialog(\""+links[itemp]+"\",\"\",\"dialogHeight:600px;dialogWidth:800px;status=no;resizable=yes\")>"+links[itemp]+"</a>"
		+"<br>");
		temp= (matched[itemp]/keywords[0])*100
		output.document.write("<i> Matched  with keywords  :: " +temp+" %  </i>" );
		matched[itemp]=0
		} 
	found[0]=0;
	output.document.write("</table>");
	}
//output.document.write ('This search was created by   &copy <a href="rajarshibanik@gmail.com">Rajarshi Banik</a>    2007');
output.document.write ("<hr>");
//output.document.write ("<form><center>"); 
//output.document.write("<center>Hit the refresh button to return to the search<center>");
output.document.write("<center><br><br>");
output.document.write ("<input type='button' value='Start Another Search' onClick = 'window.history.back()'"); 
output.document.write("</center></br></br>");
//output.document.write ("<center></form>");

output.document.write ("</body></html>"); 
output.document.close();
}