var item = new Array();
// "Page Name","path","Page Title","Many,Key,Words","Descriptive Comments"

c=0; item[c]=new Array("letter.asp","","President's Letter","Message, President's Message, President's Letter","Message....");

c++; item[c]=new Array("history.asp","","SAI History","History","History of SAI..........");

c++; item[c]=new Array("glance.asp","","SAI at a glance","SAI's mandate, SAI's objectives, The constitution of SAI, SAI’s audit jurisdiction, SAI’s responsibilities, SAI’s audit reports, SAI and the international community, international community","SAI at a glance....");

c++; item[c]=new Array("chart.asp","","Organizational Chart","organizational chart, President, Deputy President, Assistant Deputy President","Organizational chart....");

c++; item[c]=new Array("team.asp","","Management Team","Management Team, Team, members", "Team Members of SAI....");

c++; item[c]=new Array("laws.asp","","Laws & Regulations","Laws and Regulations, Regulations, Laws, terms and conditions","Laws and Regulations of SAI....");

c++; item[c]=new Array("relations.asp","","International Relations","international relations, relations","International Relation with SAI ....");

c++; item[c]=new Array("training.asp","","Training","training, courses","Training held in SAI....");

c++; item[c]=new Array("contact.asp","","Contact Us","contact us, address, contact, location","SAI's Contact....");

c++; item[c]=new Array("album.asp","","Photo Gallery","photo gallery, pics, images","Photo Gallery of SAI....");

c++; item[c]=new Array("links.asp","","Links","Government Links, Government, Gov, Audit Links, Audit, Related Links, Related","URL to Government, Audit and Related Websites....");
c++; item[c]=new Array("related_links.asp","","Related Links", "INTOSAI, Committees, Professional Audit Training, Audit Firms","Related Links to INTOSAI, Committees, Professional Audit Training and Audit Firms....");

c++; item[c]=new Array("press.asp","","Press", "President, news of SAI, Press release, conference, meeting, participating","Press Release....");


page="<html><head><meta http-equiv='Content-Type' content='text/html; charset=windows-1256'><title>Search  Results</title></head><body leftmargin='0' background='images/search_bg.jpg' topmargin='0' dir='ltr'><b><img src='images/search_hdr.jpg'><br><br><p style='margin-left: 10px;'><font face='simplified arabic' size='3' align='right'color='#E2DEB9'>Search Results</b></font><center><table border=0  cellspacing=10 width=80%>";

function search(frm) {
win = window.open("","","height=500,width=518,scrollbars");
win.document.write(page);
txt = frm.srchval.value.split(" ");
fnd = new Array(); total=0;
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 ]) > -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);
fnd[w] = 0;
}
win.document.write("</table><br><font face='Verdana' size='2'>Total found:  "+total+"<br></font></body></html>");
win.document.close();
}
function show(which,wind,num) {
link = item[which][1] + item[which][0];
line = "<tr><td><font face='Verdana' size='2'><a style='font-weight:bold; color: #E2DEB9' href='"+link+"' target='_blank'>"+item[which][2]+"</a> Score:  "+num+"<br>";
line += item[which][4] +  "<br>"+link+"</font></td></tr>";
wind.document.write(line);
return 1;
}
