var item = new Array();
var fnd = new Array(); total=0;

// "Page Name","path","Page Title","Many,Key,Words","Descriptive Comments"
//c=0;  item[c]=new Array("index.html","","DemoSite","index,main,start,home,front","Demonstration search engine data about an imagined but probable internet site.");

/*
item[1] = new Array ("objectives.html","","Objectives","Vedic Vision harmony growth ","At Yoga Malika we strive to provide simple solutions for some basic questions");
item[2] = new Array ("activities.html","","Activities","Yoga Malika Research Center Research Library Philosophy","Yoga Malika conducts education and awareness programs to highlight and render the unique vedic solution to humanity.");
item[3] = new Array ("people.html","","People","Sri Daya Sagar Trust Durai Dayananda Saraswathi  Swami Paramarthananda Saraswathi","People behind Yoga Malika");
item[4] = new Array ("audtindex.html","","Audio - Tamil","Lectures Tamil","We are happy to offer you the following audio selections which are in Real Audio format.");
item[5] = new Array ("audeindex.html","","Audio - English","Lectures English","We are happy to offer you the following audio selections which are in Real Audio format.");
item[6] = new Array ("daya.html","","Talks","Morning Meditations Prayers Japa-Talk Knowledge Action Pearls of Wisdom","Talks of Swami Dayananda");
*/

c=0;  item[c]=new Array("objectives.html","","Objectives","Vedic Vision harmony growth","At Yoga Malika we strive to provide simple solutions for some basic questions");
c=1; item[c]=new Array("activities.html","","Activities","Yoga Malika Research Center Research Library Philosophy","Yoga Malika conducts education and awareness programs to highlight and render the unique vedic solution to humanity.");
c=2; item[c]=new Array("people.html","","People","Sri Daya Sagar Trust Durai Dayananda Saraswathi  Swami Paramarthananda Saraswathi","People behind Yoga Malika");
c=3; item[c]=new Array("audtindex.html","","Audio - Tamil","Lectures Tamil","We are happy to offer you the following audio selections which are in Real Audio format.");
c=4; item[c]=new Array("audeindex.html","","Audio - English","Lectures English","We are happy to offer you the following audio selections which are in Real Audio format.");
c=5; item[c]=new Array("daya.html","","Talks","Morning Meditations Prayers Japa-Talk Knowledge Action Pearls of Wisdom","Talks of Swami Dayananda");
c=6; item[c]=new Array("parama.html","","Lectures","Lectures","In this section, we will be giving gists of the one-hour lectures that he gives in Madras.");
c=7; item[c]=new Array("photos.html","","Photo Gallery","Photo Gallery","Welcome to the gallery of some selected photos and can choose and click on one of these options to proceed further.");
c=8; item[c]=new Array("doit_intro.html","","Do it yourself","Do it yourself","A Practical One Year Program to implement in your life.");
c=9; item[c]=new Array("catalog_cassettes1.html","","Audio Tapes","Audio Tapes of Swami Paramarthananda","Click here to view the catalog.");
c=10; item[c]=new Array("catalog_cassettes2.html","","Audio Tapes","Audio Tapes of Swami Dayananda","Click here to view the catalog.");
c=11; item[c]=new Array("catalog_cassettes3.html","","Audio Tapes","Audio Tapes of Swami Guruparananda","Click here to view the catalog.");
/*
c=10; item[c]=new Array("health1.html","","Immunizations","Immunizations vaccines Health","Immunizations");
*/
var page="<html><head><title>Search Results</title><link REL=StyleSheet HREF=css/yoga.css TYPE=text/css TITLE=Design Style></head><body bgcolor=white leftmargin=0 topmargin=0><table border=0 cellspacing=0 cellpadding=0 width=100%><tr><td bgcolor=#F9D4BB height=30 valign=middle><p align=center><font class=SubTitle>Search Results</font></p></td></tr></table><br><center><table border=0 cellspacing=1 bgcolor=#A15D2A width=95%><tr bgcolor=#A15D2A><th><font face=arial size=2 color=#ffffff>Topic</font></th><th><font face=arial size=2 color=#ffffff>Description</font></th></tr>";

function search(frm) {
//win = window.open("","","scrollbars");
//win.document.write(page);
//document.write(page);
txt = frm.srchval.value.split(" ");
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].toLowerCase()) > -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);
if (w > -1) total += show(w, n);
fnd[w] = 0;
}
//win.document.write("</table><br>Total found: "+total+"<br></body></html>");
//win.document.close();
document.write(page+"</table><br><font face=arial size=2 color=#0000ff>Total number of Searches found: "+total+"</font><br><br><font face=arial size=2><a href=javascript:history.back()>Try another search</a></font></body></html>");
document.close();
}

//function show(which,wind,num) {
function show(which,num) {
link = item[which][1] + item[which][0]; 
//line = "<tr><td><a href='"+link+"'>"+item[which][2]+"</a> Score: "+num+"<br>";
//line = "<tr><td width=12 align=right><font face=arial size=2>"+num+"</font></td>";
line = "<tr><td bgcolor=#F0DCCD><a class=regular href='"+link+"'>"+item[which][2]+"</a></td>";
//line += item[which][4] + "<br>"+link+"</td>";
line += "<td bgcolor=#F0DCCD><p class=regular>"+item[which][4] + "</p></td></tr>";
//wind.document.write(line);
//document.write(line);
page=page + line
return 1;
}
