// JavaScript Document
var item = new Array();

/* Here is where all the magic happens.  
    Just enter as many additional pages that
    that you want to search, then fill in the
    additional listings for each page.
*/

// "Page Name","path","Page Title","Many,Key,Words","Descriptive Comments"

c=0; item[c]=new Array("http://www.emeraldbaycenter.com/index.php","","Emerald Bay Center for Women's Health","index,main,start,home,front","Home page for Emerald Bay Center for Women's Health.");

c++; item[c]=new Array("http://www.emeraldbaycenter.com/about/index.php","","About Us","about,information","Includes information regarding Emerald Bay Center for Women's Health.");

c++; item[c]=new Array("http://www.emeraldbaycenter.org/about/contact.php","","Contact Us","contact,questions,information","Contact details for Emerald Bay Center for Women's Health. Fillable form to ask questions online.");

c++; item[c]=new Array("http://www.emeraldbaycenter.com/about/locations.php","","Locations - Maps and Directions","maps,directions,locations,offices,doctors offices","Contains address and phone numbers for each office location. Also contains links to maps for each.");

c++; item[c]=new Array("http://www.emeraldbaycenter.com/doctors/index.php","","Our Doctors","doctors,physicians,specialty,specialties,care,orthopedics,osteoporosis,rheumatology,internal medicine,physiatry,radiology","Contains links to photos and information on each physician at Emerald Bay Center for Women's Health.");

c++; item[c]=new Array("http://www.emeraldbaycenter.com/about/faqs.php","","Frequently Asked Questions (FAQs)","faqs,questions,frequently asked questions","Contains answers to frequently asked questions at Emerald Bay Center for Women's Health.");

c++; item[c]=new Array("http://www.emeraldbaycenter.com/info/index.php","","Patient Information","patient information,information,resources,health topics","This page contains information and resources for patients at Emerald Bay Center for Women's Health.");

c++; item[c]=new Array("http://www.emeraldbaycenter.com/info/resources.php","","Resources","resources,health resources,health information","Contains links to resources relating to Women's Health.");

c++; item[c]=new Array("http://www.emeraldbaycenter.com/info/topics.php","","Health Topics","acne,polycystic ovarian syndrome,health topics","Contains information on women's health topics.");

c++; item[c]=new Array("http://www.emeraldbaycenter.com/services/index.php","","Our Services","services,procedures,specialties","Contains information regarding services available at Emerald Bay Center for Women's Health.");

c++; item[c]=new Array("http://www.emeraldbaycenter.com/services/gynecology.php","","Gynecology Services","services,procedures,specialties,gynecology","Contains information regarding Gynecology services with Emerald Bay Center for Women's Health.");

c++; item[c]=new Array("http://www.emeraldbaycenter.com/services/obstetrics.php","","Obstetrics Services","services,procedures,specialties,obstetrics","Contains information regarding Obstetrics services with Emerald Bay Center for Women's Health.");

c++; item[c]=new Array("http://www.emeraldbaycenter.com/services/infertility.php","","Infertility Services","services,procedures,specialties,infertility","Contains information regarding Infertility services with Emerald Bay Center for Women's Health.");

page="<html><head><link href='http://www.emeraldbaycenter.com/CSS/StylesSearch.css' rel='stylesheet' type='text/css' /><title>Search Results</title></head><body><div id='wrapper'><div id='container'><div id='logo'><a href='http://www.emeraldbaycenter.com'><img src='http://www.emeraldbaycenter.com/images/PNG/logo.png' alt='Emerald Bay Center for Women's Health Logo' border='0' /></a></div><div id='content'><table border=0 cellspacing=10 width=80%><ul>";


function search() {
win = window.open("","","toolbar=yes,menubar=yes,resizable=yes,scrollbars");
win.document.write(page);
txt = frmSearch.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>Total found: "+total+"<br></div></div><div id='footer'></div></div></body></html>");
win.document.close();
}
function show(which,wind,num) {
link = item[which][1] + item[which][0]; 
line = "<tr><td><a href='"+link+"'>"+item[which][2]+"</a> Score: "+num+"<br>";
line += item[which][4] + "<br>"+link+"</td></tr>";
wind.document.write(line);
return 1;
}
