function makeArray(n){
      this.length = n;
      for(var i = 1; i <= n; i++){
            this[i] = 0;
      }
      return this;
}

var businessName=" ";


function listing(name,keywords,linktosite){
	this.name=name;
	this.keywords=keywords;
	this.linktosite=linktosite;
	return(this);
        }       


 function searchbusiness(){ 
var businessName="";
var countMatch=0;
   fWin = parent.frames[1].document
   businessName = parent.frames[0].document.searcher.lookup.value;
if(businessName==""){
businessName=" ";
}
businessName=businessName.toUpperCase();
       fWin.open();
       fWin.write("<HTML><HEAD><TITLE>"+ businessName + " </TITLE></HEAD>");
  fWin.write("<BODY background='1956back.jpg' bgproperties='fixed'><font color='navy'><b><center>Business Name --------------------------------------------------------- Website Link</center></b></font>");
fWin.write("<center><table width=98% border=2 bordercolor='navy' cellpadding=5 cellspacing=5><tr><td><table border=1 cellpadding=0 cellspacing=0 width=100%><tr>");
var business="";
var bgcolor=" bgcolor=#ffffff";
  for (var i = 1; i < businessID.length; i++){
if (bgcolor==' bgcolor=#ffffff'){
bgcolor=' bgcolor=#efefef';
}else{
bgcolor=' bgcolor=#ffffff';
}
business=businessID[i].name.toUpperCase()+" ";
keywords=businessID[i].keywords.toUpperCase()+" ";
  if((business.indexOf(businessName) !="-1")||(keywords.indexOf(businessName) !="-1")){
var checkedName=i;
   fWin.write("<td" + bgcolor + ">&nbsp;" + businessID[i].name + "&nbsp;&nbsp;</td><td align='right' " + bgcolor + "><a target='top' href='" +  businessID[i].linktosite + "'>" +  businessID[i].linktosite + "</a>&nbsp;</td>");
countMatch++;
}
      fWin.write("</tr>");
}
      fWin.write("</table></td></tr></table><br>Database was Searched for &quot;" + businessName + "&quot;<br>");
if(countMatch==0){
fWin.write("Sorry there were no matches found. Try again using a single word. Looking for an Exact Match");
}else{
fWin.write("Number of Items found = " + countMatch + " ");
}
fWin.write("</center></body></html>");
fWin.close();
}

