// ----------------------------------------------------------------------------
// Lauyan Software Javascript Search Engine 1.0
//
// This file is the JavaScript search engine for a website created by TOWeb
//
// Copyright (C) LAUYAN SOFTWARE
// web: http://www.lauyan.com
// ----------------------------------------------------------------------------

STR_SEARCH_QUERY_MSG = "Résultats de la recherche pour";
STR_NO_RESULT = "Aucun résultat trouvé";
STR_SEARCH_BUTTON = "Rechercher";
STR_SCORE = "Score";
STR_TERMS = "Termes";
STR_SEARCH_SIZE = "40";
MIN_WORD_LEN = 2;
DISPLAY_SRCH_INFO = 0;
USE_UTF8 = 0;
REMOVE_ACCENTS = 1;
BOLD_LINKS = 1;
ONLINE_WEBSITE = 1;

namesArray = new Array("  ",
" bienvenue sur site commune wavrans l'aa  ",
"  ",
" album photo  ",
" histoire ville  ",
" maires depuis 1898  ",
" population  ",
" evolution structure population  ",
" conseil municipal  ",
" communaute communes pays lumbres  ",
" elus  ",
" ceremonie voeux  ",
" calendrier reunions conseil municipal  ",
" dernier proces verbal reunion conseil municipal  ",
" autres comptes rendus conseil municipal  ",
" demarches administratives  ",
" recensement militaire  ",
" listes electorales  ",
" urbanisme  ",
" acte d'etat civil  ",
" carte nationale d'identite  ",
" passeport  ",
" autorisation sortie territoire  ",
"  ",
" perte papiers d'identite  ",
" budget  ",
"  ",
" vie associative  ",
" parents d'eleves  ",
" l'amicale reserve communale securite civile  ",
" l'abri collines  ",
" societe chasse concorde  ",
" societe chasse saint hubert  ",
"  ",
" societe peche saumonaise  ",
" gym detente  ",
" football club  ",
" amicale personnel communal  ",
" wavrans loisirs culture  ",
" chtis alter egaux  ",
" association campagnettoise  ",
" comite fetes  ",
" sport nature  ",
" amis geant  ",
" rando club l'aa  ",
" wavrans pratique  ",
"  ",
" ecole orchidees  ",
"  ",
" ecole orchidees 2010 2011 utilisez modele commencer page vierge ",
"  ",
"  ",
"  ",
"  ",
" reserve communale securite civile  ",
"  ",
"  ",
"  ",
"  ",
"  ",
" loisirs  ",
" randonnees  ",
" loisirs aux environs  ",
" manifestations  ",
" wavrans photos  ",
" monuments  ",
"",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" reserve naturelle  ",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" hameaux  ",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" batiments publics  ",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" centre village  ",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" paysages  ",
" mont  ",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" liens  ",
" contact  ",
" plan  ",
"  ",
" repas aines 2008  ",
" saisissez description image ici ",
" comme tous ans ccas municipalite offrent repas aux aines plus commune  ",
"",
"",
"",
"",
"",
"",
"",
" repas aines 2009  ",
" saisissez description image ici ",
" samedi septembre 2009 lieu repas aines commune 117 convives ont ete reunis dans salle polyvalente mis l'honneur doyens mme marie manier alexis vetu ainsi couples fetant leur ans mariage eloi anne bernard chauchoy serge masset ",
" doyenne mme marie manier chauchoy doyen alexis vetu ",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" repas aines 2010 septembre ",
"",
" notre doyenne mme marie manier chauchoy ",
" notre doyen alexis vetu ",
" ans mariage mme jean soudans lefebvre sont maries septembre 1960  ",
" ans mariage mme michel dubois brietz sont maries novembre 1960 ",
" ans mariage mme francis masset maillard sont maries novembre 1960 ",
" ans mariage mme pierre wallon deron sont maries decembre 1950 ",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" repas aines 2011  ",
"",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" maisons fleuries  ",
" juillet  ",
" diplomes travail  ",
" virades l'espoir  ",
" calendrier  ",
" autres manifestations  ",
" ducasse  ",
" ramassage printemps  ",
"  ",
" chiens dangereux  ",
" dechetterie horaires d'hiver compter octobre dechetteries sont modifies ceci periode lumbres sera ouverte lundi 14h 17h30 mardi samedi 11h45 h30 attention toutes fermees dimanche matin d'ete decheteries smla seront appliques avril 2011 tatinghem aire sur lys arques dennebroeucq longuenesse reouverture prevue mai ferme 13h30 18h45 mercredi jeudi vendredi 18h45 ",
" recherche genealogique  ");
urlsArray = new Array("../topic/index.html",
"../topic1/index.html",
"../historique/index.html",
"../mapage/index.html",
"../mapage8/index.html",
"../mapage9/index.html",
"../mapage10/index.html",
"../evolutionetstruc/index.html",
"../mapage1/index.html",
"../ccpl/index.html",
"../mapage38/index.html",
"../voeux/index.html",
"../calendrierdesreu/index.html",
"../mapage39/index.html",
"../mapage43/index.html",
"../mapage2/index.html",
"../mapage11/index.html",
"../mapage12/index.html",
"../mapage13/index.html",
"../mapage14/index.html",
"../mapage15/index.html",
"../mapage16/index.html",
"../mapage17/index.html",
"../mapage18/index.html",
"../pertepapiersdide/index.html",
"../mapage3/index.html",
"../ccas/index.html",
"../mapage4/index.html",
"../mapage19/index.html",
"../mapage20/index.html",
"../mapage21/index.html",
"../mapage22/index.html",
"../mapage23/index.html",
"../mapage24/index.html",
"../mapage25/index.html",
"../mapage26/index.html",
"../mapage27/index.html",
"../mapage28/index.html",
"../mapage29/index.html",
"../mapage30/index.html",
"../mapage31/index.html",
"../comitedesfetes/index.html",
"../sportnature/index.html",
"../mapage32/index.html",
"../randoclub2laa/index.html",
"../mapage5/index.html",
"../lamairie/index.html",
"../ecoledesorchidee/index.html",
"../lecoledesorchide/index.html",
"../ecoledesorchide1/index.html",
"../lacantinescolair/index.html",
"../lagarderie/index.html",
"../mapage41/index.html",
"../clsh/index.html",
"../larcsc/index.html",
"../colombarium/index.html",
"../lasallepolyvalen/index.html",
"../jouetsdenoel/index.html",
"../atisanscommercan/index.html",
"../medecingeneralis/index.html",
"../mapage6/index.html",
"../mapage33/index.html",
"../mapage34/index.html",
"../mapage7/index.html",
"../mapage40/index.html",
"../albumphoto1/index.html",
"../albumphoto1/page1.html",
"../albumphoto1/page2.html",
"../albumphoto1/page3.html",
"../albumphoto1/page4.html",
"../albumphoto/index.html",
"../albumphoto/page1.html",
"../albumphoto/page2.html",
"../albumphoto/page3.html",
"../albumphoto/page4.html",
"../albumphoto/page5.html",
"../albumphoto/page6.html",
"../albumphoto/page7.html",
"../albumphoto/page8.html",
"../albumphoto/page9.html",
"../albumphoto/page10.html",
"../albumphoto/page11.html",
"../albumphoto/page12.html",
"../albumphoto/page13.html",
"../albumphoto/page14.html",
"../albumphoto/page15.html",
"../albumphoto/page16.html",
"../albumphoto/page17.html",
"../albumphoto/page18.html",
"../albumphoto2/index.html",
"../albumphoto2/page1.html",
"../albumphoto2/page2.html",
"../albumphoto2/page3.html",
"../albumphoto2/page4.html",
"../albumphoto2/page5.html",
"../albumphoto2/page6.html",
"../albumphoto3/index.html",
"../albumphoto3/page1.html",
"../albumphoto3/page2.html",
"../albumphoto3/page3.html",
"../albumphoto3/page4.html",
"../albumphoto3/page5.html",
"../albumphoto3/page6.html",
"../albumphoto5/index.html",
"../albumphoto5/page1.html",
"../albumphoto5/page2.html",
"../albumphoto5/page3.html",
"../paysages/index.html",
"../albumphoto4/index.html",
"../albumphoto4/page1.html",
"../albumphoto4/page2.html",
"../albumphoto4/page3.html",
"../albumphoto4/page4.html",
"../albumphoto4/page5.html",
"../topic2/index.html",
"../topic3/index.html",
"../mapage37/index.html",
"../lescommissionsco/index.html",
"../repasdesaines/index.html",
"../repasdesaines/page1.html",
"../repasdesaines/page2.html",
"../repasdesaines/page3.html",
"../repasdesaines/page4.html",
"../repasdesaines/page5.html",
"../repasdesaines/page6.html",
"../repasdesaines/page7.html",
"../repasdesaines/page8.html",
"../repasdesaines/page9.html",
"../repasaines2009/index.html",
"../repasaines2009/page1.html",
"../repasaines2009/page2.html",
"../repasaines2009/page3.html",
"../repasaines2009/page4.html",
"../repasaines2009/page5.html",
"../repasaines2009/page6.html",
"../repasdesaines201/index.html",
"../repasdesaines201/page1.html",
"../repasdesaines201/page2.html",
"../repasdesaines201/page3.html",
"../repasdesaines201/page4.html",
"../repasdesaines201/page5.html",
"../repasdesaines201/page6.html",
"../repasdesaines201/page7.html",
"../repasdesaines201/page8.html",
"../repasdesaines201/page9.html",
"../repasdesaines201/page10.html",
"../repasdesaines201/page11.html",
"../repasdesaines201/page12.html",
"../repasdesaines202/index.html",
"../repasdesaines202/page1.html",
"../repasdesaines202/page2.html",
"../repasdesaines202/page3.html",
"../repasdesaines202/page4.html",
"../maisonsfleuries/index.html",
"../mapage35/index.html",
"../medaillesdutrava/index.html",
"../viradesdelespoir/index.html",
"../mapage36/index.html",
"../noeldesenfants/index.html",
"../mapage42/index.html",
"../ramassagedeprint/index.html",
"../elections/index.html",
"../chiensdangereux/index.html",
"../dechetterie/index.html",
"../recherchegenealo/index.html");
titlesArray = new Array("Wavrans-sur-l'Aa",
"Accueil Wavrans sur l'Aa",
"Wavrans sur l'Aa",
"Historique",
"HISTOIRE DE LA VILLE",
"MAIRES DEPUIS 1898",
"POPULATION",
"Evolution et Structure de la population",
"CONSEIL MUNICIPAL",
"Communauté de Communes du Pays de Lumbres",
"LES ELUS",
"Cérémonie des Voeux",
"Calendrier des réunions du Conseil Municipal",
"DERNIER PROCES VERBAL DE REUNION DU CONSEIL MUNICIPAL",
"Autres comptes rendus du Conseil Municipal",
"DEMARCHES ADMINISTRATIVES",
"RECENSEMENT MILITAIRE",
"LISTES ELECTORALES",
"URBANISME",
"ACTE D'ETAT CIVIL",
"CARTE NATIONALE D'IDENTITE",
"PASSEPORT",
"AUTORISATION DE SORTIE DE TERRITOIRE",
"Wavrans sur l'Aa",
"Perte de papiers d'identité",
"BUDGET",
"Wavrans sur l'Aa",
"VIE ASSOCIATIVE",
"PARENTS D'ELEVES",
"L'AMICALE DE LA RESERVE COMMUNALE DE SECURITE CIVILE",
"A L'ABRI DES COLLINES",
"SOCIETE CHASSE LA CONCORDE",
"SOCIETE CHASSE LA SAINT HUBERT",
"A.C.P.G. - C.A.T.M.",
"SOCIETE PECHE LA SAUMONAISE",
"GYM DETENTE",
"FOOTBALL CLUB",
"AMICALE PERSONNEL COMMUNAL",
"WAVRANS LOISIRS CULTURE",
"LES CHTIS ALTER EGAUX",
"ASSOCIATION CAMPAGNETTOISE",
"Comité des Fêtes",
"Sport Nature",
"LES AMIS DU GEANT",
"Rando Club 2 l'Aa",
"WAVRANS PRATIQUE",
"Wavrans sur l'Aa",
"Ecole des Orchidées",
"Wavrans sur l'Aa",
"Ecole des Orchidees 2010 2011",
"Wavrans sur l'Aa",
"Wavrans sur l'Aa",
"Wavrans sur l'Aa",
"C L S H",
"La Réserve Communale de Sécurité Civile",
"Wavrans sur l'Aa",
"Wavrans sur l'Aa",
"Wavrans sur l'Aa",
"Wavrans sur l'Aa",
"Wavrans sur l'Aa",
"LOISIRS",
"RANDONNEES",
"LOISIRS AUX ENVIRONS",
"MANIFESTATIONS",
"WAVRANS EN PHOTOS",
"Les monuments",
"MONUMENTS AUX MORTS",
"STELE EN HOMMAGE AUX DISPARUS D'AFRIQUE DU NORD",
"PLACE JULES TERLAT",
"EGLISE",
"LA RESERVE NATURELLE",
"546.bmp",
"5487.bmp",
"45456.bmp",
"147453.bmp",
"481541.bmp",
"Bruant Jaune",
"Moutons Boulonnais",
"Genévrier",
"Amourette",
"Dectique Verrucivore",
"Prunelliers en fleurs",
"Thym Serpolet",
"Zygène de la filipendule",
"Genévrier et ses bois",
"Ophrys abeille",
"Hélianthème",
"Linotte Mélodieuse",
"Platanthère Verdâtre",
"LES HAMEAUX",
"CAMPAGNETTE",
"WILBEDINGUES",
"FOURDEBECQUES",
"ASSINGHEM",
"VEDRINGHEM",
"PLOUY",
"LES BATIMENTS PUBLICS",
"BIBLIOTHEQUE MUNICIPALE",
"ECOLE DES ORCHIDEES ( MATERNELLE A CE1 )",
"ECOLE DES ORCHIDEES ( DU CE2 AU CM2 ) ET LA MAIRIE",
"LA SALLE POLYVALENTE",
"LA SALLE POLYVALENTE",
"LA SALLE DES ASSOCIATIONS",
"LE CENTRE DU VILLAGE",
"LE SALON DE COIFFURE",
"LE ZENITH ( CAFE / ESTAMINET )",
"LE RELAIS (CAFE)",
"Paysages",
"LE MONT",
"LE MONT",
"LE MONT",
"LE MONT",
"LE MONT",
"LE MONT",
"LIENS",
"CONTACT",
"PLAN",
"Wavrans sur l'Aa",
"repas des Ainés 2008",
"Cliquez sur les photos pour les afficher en plus grand....",
"REPAS DES AINES 2008",
"60 ans de mariage et plus : Mr et Mme Eugène VERRON Doyen : Mr Eugène VERRON",
"60 ans de mariage et plus :Mr et Mme Paul DUBOIS",
"60 ans de mariage et plus :Mr et Mme Alexis VETU",
"50 ans de mariage : Mr et Mme Jean-Louis LARDEUR",
"50 ans de mariage : Mr et Mme Jacques TRICOT",
"50 ans de mariage : Mr et Mme André FICHAUX",
"Doyenne : Mme Marie MANIER",
"Repas des ainés 2009",
"Cliquez sur les photos pour les agrandir...",
"IMGP1573.JPG",
"Mme Marie MANIER CHAUCHOY et Mr Alexis VETU",
"Mr et Mme Eloi ANNE",
"Mr et Mme Serge MASSET",
"Mr et Mme Bernard CHAUCHOY",
"repas des ainés 2010 : Le 11 septembre",
"Cliquez sur les photos pour les agrandir",
"Mme Marie MANIER",
"Mr Alexis VETU",
"Mr et Mme Jean SOUDANS",
"Mr et Mme Michel DUBOIS",
"Mr et Mme Francis MASSET",
"Mr et Mme Pierre WALLON",
"IMGP3050.JPG",
"IMGP3051.JPG",
"IMGP3049.JPG",
"IMGP3052.JPG",
"IMGP3034.JPG",
"repas des ainés 2011",
" Cliquer sur les photos pour les agrandir ",
"Nos Doyens : Mr Pierre Wallon et Mme Marie MANIER CHAUCHOY",
"50 ans de Mariage pour Mr et Mme Elie FOUBE GLEMBA",
"60 ans de Mariage pour Mr et Mme Jean MONCOMBLE MONFAIT",
"Maisons Fleuries",
"14 Juillet",
"Diplômes du Travail",
"Virades de l'Espoir",
"CALENDRIER",
"Autres Manifestations",
"Ducasse",
"Ramassage de Printemps",
"Wavrans sur l'Aa",
"Chiens Dangereux",
"Déchetterie",
"Recherche Généalogique");
descArray = new Array("Wavrans-sur-l'Aa",
"Page d'accueil du site de Wavrans sur l'Aa",
"",
"Historique de Wavrans sur l'Aa",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"  ",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"Utilisez ce modèle pour commencer une page vierge",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"&",
"&",
"&",
"&",
"",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"",
"&",
"&",
"&",
"&",
"&",
"&",
"",
"&",
"&",
"&",
"&",
"&",
"&",
"",
"&",
"&",
"&",
"",
"",
"&",
"&",
"&",
"&",
"&",
"",
"",
"",
"",
"",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"",
"&",
"&",
"&",
"&",
"&",
"&",
"",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"",
"&",
"&",
"&",
"&",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"HORAIRES D'HIVER : A compter du 19 octobre les horaires des déchetteries sont modifiés et ceci pour la période d'hiver :  La Déchetterie de Lumbres se...",
"");
sublinksArray = new Array(165);
var linksCount = 165;


ALLWORDSONLY = false;

// getParam returns the value of the specified GET parameter
function getParam(paramName)
{
    paramStr = document.location.search;
    if( paramStr == "" )
        return "";
    if( paramStr.charAt(0) == "?" )
        paramStr = paramStr.substr(1);
    arg = (paramStr.split("&"));
    for( i=0; i<arg.length; i++ ) 
    {
      arg_values = arg[i].split("=")
      if( unescape(arg_values[0]) == paramName ) 
      {
         if( USE_UTF8 == 1 && self.decodeURIComponent ) // check if decodeURIComponent() is defined
            ret = decodeURIComponent(arg_values[1]);
         else
            ret = unescape(arg_values[1]);  // IE 5.0 and older does not have decodeURI
         return ret;
      }
    }
    return "";
}

function replaceAll(str,from,to) 
{
    var idx = str.indexOf(from);
    while( idx > -1 ) {
        str = str.replace(from, to); 
        idx = str.indexOf(from);
    }
    return str;
}

// lowercase, remove quotes and accents
function formatChars(str) 
{
    str = str.toLowerCase();
    if( REMOVE_ACCENTS ) 
    {
      var a = "àáâãäåòóôõöèéêëçìíîïùúûüÿñ";
      var b = "aaaaaaoooooeeeeciiiiuuuuyn";
      for( i=0; i<a.length; i++ )
        str = replaceAll( str, a.charAt(i), b.charAt(i) );
    }
    str = replaceAll( str, "'", " " );
    return str;
}

function SortCompare(a, b)
{
  if( a[2] == b[2] )
  {  
    if (a[1] < b[1]) return 1;
    else if (a[1] > b[1]) return -1;
    else return 0;
  }
  else if (a[2] < b[2]) return 1;
    else return -1;
}

function jseSearch( internal )
{
  // get params
  var rootURL = '';
	var SelfURL = document.location.href;
  var paramIndex = SelfURL.indexOf("?");    
  if (paramIndex > -1)
     SelfURL = SelfURL.substr(0, paramIndex);
  paramIndex = SelfURL.indexOf("#");
  if (paramIndex > -1)
    SelfURL = SelfURL.substr(0, paramIndex);        
	if (ONLINE_WEBSITE) 
	{
		paramIndex = SelfURL.lastIndexOf('/');
		if (paramIndex > -1) 
		{
			rootURL = SelfURL.substr(0, paramIndex);
			paramIndex = rootURL.lastIndexOf('/');
			if (paramIndex > -1) {
				rootURL = SelfURL.substr(0, paramIndex+1);
			} else
			  rootURL = '';
		}
	}	
  SelfURL = SelfURL.replace(/\</g, "&lt;");
  SelfURL = SelfURL.replace(/\"/g, "&quot;");

  var query = getParam("jse_query");
  query = query.replace(/[\++]/g, " ");  // replace any '+' with spaces
  query = query.replace(/\</g, "&lt;");
  query = query.replace(/[\"+]/g, " ");

  // display the search form
  var lnktarget = "";
	if( internal == null || internal != 1 )
	{
    document.writeln("<form method=\"get\" action=\"" + SelfURL + "\">");
    document.writeln("<input type=\"text\" name=\"jse_query\" size=\"" + STR_SEARCH_SIZE + "\" value=\"" + query + "\" />");
    document.writeln("<input type=\"submit\" value=\"" + STR_SEARCH_BUTTON + "\" />");
    document.writeln("</form>");
  }	
	else
	{
	 lnktarget = "\" target=\"_blank";
  }
	query = formatChars(query);
  if( query.length == 0 ) return;
  
  var found=0, t=0, k=0, score=0, subscore=0, i=0;
  var keyword = "", tmp = "";
  var searchWords = new Array();

  // split search query by spaces
  searchWords = query.split(" ");
	if( internal == null || internal != 1 ) {
		document.writeln( "" + STR_SEARCH_QUERY_MSG + " : <strong>" +query+"</strong><br>");
  }
  // init result table information
  res_table = new Array(linksCount);
  for( t=0; t<linksCount; t++ )
  {
    res_table[t] = new Array(3);
    res_table[t][0] = 0;  // index
    res_table[t][1] = 0;  // score
    res_table[t][2] = 0;  // words found
    res_table[t][3] = ""; // sublinks (output string)
  }
  var significantwords = 0;
  
  // begin search ...
  for( i=0; i<searchWords.length; i++ )
  {
    keyword = searchWords[i];
    if( keyword.length > MIN_WORD_LEN ) // skip "small" words
	{
	  significantwords++;
	  for(var q=0; q<linksCount; q++ )
	  {
	    t = q;
	    score = 0;
	
	    // search for keywords (an exact word doubles the score)
		  tmp = formatChars(descArray[t]);
	    if( tmp.indexOf(keyword) != -1 ) score++;
	    if( tmp.indexOf(' '+keyword+' ') != -1 ) score+=2;
		  tmp = formatChars(titlesArray[t]);
	  	if( tmp.indexOf(keyword) != -1 ) score++;
		  if( tmp.indexOf(' '+keyword+' ') != -1 ) score+=2;
	    if( namesArray[t].indexOf(keyword) != -1 ) score++;
	    if( namesArray[t].indexOf(' '+keyword+' ') != -1 ) score+=2;
	
		// search for keywords in sublinks (i.e. bookmarks)
	    k = q+1;
		while( k <= linksCount )
		{
			tmp = descArray[k];
			if( tmp == null || tmp.charAt(0) != '&' ) break;
			subscore = 0;
			tmp = formatChars(descArray[k]);
			if( tmp.indexOf(keyword) != -1 ) subscore++;
			if( tmp.indexOf(' '+keyword+' ') != -1 ) subscore+=2;
			tmp = formatChars(titlesArray[k]);
			if( tmp.indexOf(keyword) != -1 ) subscore++;
			if( tmp.indexOf(' '+keyword+' ') != -1 ) subscore+=2;
			if( namesArray[k].indexOf(keyword) != -1 ) subscore++;
			if( namesArray[k].indexOf(' '+keyword+' ') != -1 ) subscore+=2;
			
			if( subscore > 0 )
			{
				if( res_table[t][3].indexOf( "\"" + urlsArray[k] + "\"" ) == -1 )
					res_table[t][3] += "<tr><td width='35'>&nbsp;</td><td><a href=\"" + urlsArray[k] + lnktarget + "\">" + titlesArray[k] + "</a></td></tr>";
//	           		if( B OLD_LINKS )  res_table[t][3] += "<tr><td width='50'>&nbsp</td><td><b><a href='" + urlsArray[k] +"'>" + titlesArray[k] + "</a></b></td></tr>";
				score += subscore;
			}	
			k++;
		}
		q = k-1;
		
	    if( score > 0 )
	    {
	      res_table[t][0] = t;
	      res_table[t][1] += score;
	      res_table[t][2]++;
	      found++;
	    }
	  }
	}
  }
  if( found == 0 ) 
  {
    document.write("<p><b>" + STR_NO_RESULT + "</b></p>");
  } 
  else 
  {
	 // sort by words found and scores
    res_table.sort(SortCompare);	
	
    // display the results
    for( q=0; q<found; q++ )
      if( res_table[q][1] > 0 ) // display only results with a positive score
	  if( !ALLWORDSONLY || (ALLWORDSONLY && res_table[q][2] == significantwords) )
	    {
        t = res_table[q][0];    // get page index
        if( BOLD_LINKS ) {
          document.writeln("<br><b>" + (q+1) + ". <a href=\"" + urlsArray[t] + lnktarget + "\">" + titlesArray[t] + "</a></b>" );
        } else
          document.writeln("<br><b>" + (q+1) + ".</b> <a href=\"" + urlsArray[t] + lnktarget + "\">" + titlesArray[t] + "</a>" );
        if( descArray[t].length > 2 )
          document.writeln("<br>" + descArray[t]);
        if( DISPLAY_SRCH_INFO ) 
		{
			document.write("<br><span style='font-size: 80%; font-style: italic;'>");
			if( !ALLWORDSONLY )
				document.write("" + STR_TERMS + ": " + res_table[q][2] + " - " );
			document.write("" + STR_SCORE + ": " + res_table[q][1] );
			if (ONLINE_WEBSITE) {
			  document.writeln(" - URL: " + rootURL + urlsArray[t].substr(3) + "</span>");
			}	else
			  document.writeln(" - URL: " + urlsArray[t] + "</span>");
      	}
				if( res_table[q][3].length > 0 ) { 
      	  document.writeln( '<table>' + res_table[q][3] + '</table>' );
      	} else document.writeln("<br>");
      }
  }
  document.writeln("<br>");
}

