// ----------------------------------------------------------------------------
// 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 = 1;
USE_UTF8 = 0;
REMOVE_ACCENTS = 1;
BOLD_LINKS = 1;
ONLINE_WEBSITE = 1;

namesArray = new Array(" caftan djellaba jabador takchita tekchita maroc tradition vente art acheter ligne haute couture prix pas cher qualite mariage soiree marie magasin cerimonie collection sfifa merwazi akkad akad ",
" collection 2009 chaque occasion son caftan passer commande veuillez retenir numero modele cliquer sur menu catalogue ",
" caftan coupe evasee demi manche longues avec tres belle chapka porte sur pantalon aussi est orne sfifa multicolore ",
" robe caftan deux pieces composee d'une veste portee sur jupe finition sfifa manches envasees longues dentelle avec dessous ",
" caftan decoupe milieu ceinture assortie radieux elegant peux aussi porter sans ",
" caftan evase ornee sfifa multicolore travaillee fil sois finition akkad merwazi travaille main ",
" caftan mlifa noir avec tres jolies fleurs brodees fil sois aussi dos est brodee finitions modele sfifa large akad merwazi ",
" caftan demi manches longues coupe evasee avec tres belle chebka portee sur pantalon aussi est ornee sfifa multicolores skili brodee comme dos jolis fleurs egalement ",
" collection 2009 chaque occasion son caftan passer commande veuillez retenir numero modele cliquer sur menu catalogue ",
" desirez saisissez description photo ici desactivez-la decochant case texte ci-dessus recadrer ameliorer encadrer images utiliser actions modifier taille bordure ",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" djellaba moderne portee sur pantalon large possedant trois ouvertures avec poches devant modele style travaille sfifas akads finition merwazi ",
" djellaba deux pieces avec petite veste courte travaillee sfifas akads ",
" jolie djellaba coupe respectueuse tradition porte sur pantalon enrichi sfifas akads agremente trois ouvertures sortir tout restant elegante ",
" collection 2009 chaque occasion son caftan passer commande veuillez retenir numero modele cliquer sur menu catalogue ",
" magnifique ensemble compose pieces travaillees avec large sfifa finition merwazi tres modernes classe ",
" djellaba courte portee sur jupe enrichie sfifa finition merwazi tres moderne ",
" Élegant manteau orne avec sfifa mrema porte sur jabador pantalon agremente akads ferme mjidlat ",
" jolie jabador porte sur pantalon large enjolive sfifa akad tres habille ",
" ensemble moderne enrichie sfifa ferme avec mgidlat tres habille ",
" collection 2009 chaque occasion son caftan passer commande veuillez retenir numero modele cliquer sur menu catalogue ",
" manteau tres chic portee sur jabador enrichie sfifas akads mjidlat style habille travaille main ",
" saisissez description image ici ",
" belle djellaba courte portee sur pantalon large tissus mlifa imprime motifs sfifa finition merwazi ",
" Élegant manteau orne avec sfifa mrema porte sur jabador pantalon agremente akads ferme mjidlat ",
" djellaba courte portee sur jupe ornee sfifa akad finition merwazi modele tres chic ",
" collection 2009 chaque occasion son caftan passer commande veuillez retenir numero modele cliquer sur menu catalogue ",
" tekchita noire pieces travaillees avec belle sfifa large main akad finition merwazi ceinture livree ",
" tekchita deux pieces travaillees avec belle sfifa large akad finition merwazi ",
" tekchita deux pieces travaillee avec sfifa skili large akad finition merwazi ceinture assortis ",
" tekchita deux pieces hrir travaillee avec sfifa tres large belle akad joli merwazi ",
" tekchita deux pieces travaillee avec sfifa main skilli elhour akad finition merwazi ",
" magnifique tekchita deux pieces travaillees main elle tres belle allure stylee ",
" tekchita coupe evasee col carre peu decollee manches longues finition modele sfifa skili elhor travaillee main elle est tres classe ",
" tekchita evasee brocard dessous chantant enrichi sfifa tres large realise main ceinture travaillee avec tissu elle est style ",
" tres belle tekchita manches longues evasees finition modele sfifa large toujours faite soie ceinture assortie travaille main ",
" tekchita noire sobre mettant valeur feminite coupe evasee ses manches longues avec decoupe milieu portes sous dfina dentelle pailletee sont completees ceinture assortie modele ",
" tekchita blanc manches longues evasees avec decoupe milieu porte sous dfina dentelle brodee pailletee taille ",
" caftan brocard colore manches longues evasees porte sous dfina dentelles avec tres belle ceinture travaillee main egaie l'ensemble ",
" tekchita coupe evasee manches longues finitions modele wdifa tres jolie faites fils ",
" tekchita noire sari coupe evasee ses manches sont longues avec decoupe milieu ornees sfifa multicolores tres jolis akads travailles main bustiers viens completer l'ensemble ",
" tres belle tekchita sari faite main enrichi avec large sfifa coupe evasee manches longues  ",
" tres jolie tekchita travaillee main elle belle allure classe  ",
" tekchita trois pieces jupe kaftan dfina sari travaillee avec belle sfifa large skili tres joli merwazi elle est raffinee ",
" tekchita trois pieces jupe caftan dfina enjolivee avec sfifa large tres jolie akad merwazi manches longues decoupe haut modele travaille main ",
" caftan djellaba jabador takchita tekchita maroc tradition vente art acheter ligne haute couture prix pas cher qualite mariage soiree marie magasin cerimonie  ",
" tekchita tres moderne orange enchantant dfina chebka avec peu fil dore travaillee facon sfifa large skilli sur cotes ",
" tekchita caftan beige satin dfina marron travaillee facon sfifa large avec ceinture employee maintenir le ",
" 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 ",
" tekchita pieces travaillee avec sfifa large akad finition merwazi ceinture assortis comprise  ",
" tekchita pieces ",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" saisissez description image ici ",
" tekchita pieces avec traine finition modele sfifa tres large belle akad merwazi ceinture assortis  ",
" tekchita pieces jabador pantalon dfina travaillee avec belles sfifa large merwazi ceinture livree tries raffinee ",
" tekchita deux pieces tres classe travaillee avec sfifa mrema finition merwazi ceinture assortie comprise elle belle allure  ",
" tekchita deux pieces travaillee main enjolivee sfifa large merwazi  ",
" caftan evase orne sfifa skili avec manches courtes longues haut dentelles decoupe milieu porte sur pantalon dentelle beige est tres classe  ",
" tekchita chanton coupe evasee imprime manche longues finitions modele sfifa dfina brodee pailletee ceinture assortie travaillee main  ",
" caftan djellaba jabador takchita tekchita maroc tradition vente art acheter ligne haute couture prix pas cher qualite mariage soiree marie magasin cerimonie collection sfifa merwazi ",
" tekchita noir pieces travaillees avec belle sfifa large main akad finition merwazi ceinture livree ",
" deux pieces travaillees avec belle sfifa large akad finition merwazi  ",
" tekchita deux pieces travaillees avec sfifa skiai large akad finition merwazi ceinture assortis  ",
" tekchita pieces hrir travaillee avec sfifa tres large belle akad jolis merwazi  ",
" tekchita deux pieces travaillee avec sfifa main skili elhour akad finition merwazi ",
" magnifique ensemble compose pieces travaille avec large sfifa finition merwazi tres modernes classe  ",
" magnifique tekchita pieces travaillee main elle tres belle allure stylee  ",
" takchita coupe evasee col carree peu decollee manches longues finition modele sfifa skili elhor travaillee main elle est tres classe  ",
" tekchita evase brocard dessous chantant enrichi sfifa tres large realise main ceinture travaillee avec tissu elle est style  ",
" caftan coupe evasee demi manche longue avec tres belle chebka portee sur pantalon aussi est orne sfifa multicolore  ",
" tres belle tekchita manche longue evasee finition modele sfifa large toujours faite soie ceinture assortie travaille main ",
" djellaba courte portee sur jupe enrichie sfifa finition merwazi tres moderne ",
" djellaba moderne portee sur pantalon large possedant trois ouvertures avec poches devant travaillee sfifa akads finition merwazi style ",
" caftan noir sobre mettant valeur feminite coupe evasee ses manches longues avec decoupe milieu portes sous dfina dentelle pailletee sont completees ceinture assortie modele  ",
" caftan coupe evasee tissu brocard manche longue decoupe milieu ceinture assortie radieux elegant peux aussi porter sans ",
" djellaba deux pieces avec petite veste courte travaillee sfifas akads  ",
" belle djellaba courte portee sur pantalon large tissu mlifa imprime motifs sfifa finition merwazi  ",
" jolie djellaba coupe respectueuse tradition porte sur pantalon enrichi sfifa akad agremente trois ouvertures sortir tout restant elegante  ",
" caftan blanc manche longues evasee avec decoupe milieu porte sous dfina dentelle brodee pailletee taille  ",
" caftan brocard colore manches longues evasees porte sous dfina dentelles avec tres belle ceinture travaillee main egaie l'ensemble  ",
" Élegant manteau orne avec sfifa mrema porte sur jabador pantalon agremente akads ferme mjidlat  ",
" Élegant manteau orne avec sfifa mrema porte sur jabador pantalon agremente akads ferme mjidlat  ",
" djellaba courte portee sur jupe ornee sfifa akad finition merwazi modele tres chic  ",
" jolie jabador portee sur pantalon large enjolive sfifa akad tres habille ",
" ensemble tres moderne enrichie sfifa ferme avec mgidlat habille  ",
" tekchita coupe evasee manches longues finitions modele wdifa tres jolie faites fils sois skili akad finition merwazi avec ceinture  ",
" caftan evase ornee sfifa multicolore travaillee fil sois finition akkad merwazi travaille main  ",
" caftan mlifa noir avec tres jolies fleurs brodee fil sois aussi dos est finitions modele sfifa large akad merwazi  ",
" tekchita noire sari coupe evasee ses manches sont longues avec decoupe milieu ornees sfifa multicolores tres jolis akads travailles main bustiers viens completer l'ensemble  ",
" tres belle tekchita sari faite main enrichi avec large sfifa coupe evasee manches longues  ",
" tres jolie tekchita travaillee main elle belle allure classe  ",
" tekchita pieces jupe kaftan dfina sari travaillee avec belle sfifa large skili tres joli merwazi elle est raffinee ",
" tekchita trois pieces jupe caftan dfina enjolivee avec sfifa large tres jolie akad merwazi manches longues decoupe haut modele travaille main  ",
" caftan demi manches longues coupe evasee avec tres belle chebka portee sur pantalon aussi est ornee sfifa multicolores skili brodee comme dos jolis fleurs egalement ",
" sommes nous entreprise faconne personnalise vend caftans robes dans regles tradition marocaine notre etablissement est connus reactivite qualite sens service faire avons nos propres stylistes couturiers elaborer modeles objectif satisfaire repondant facon personnalisee demandes atelier installe ville meknes maroc ",
" caftan djellaba jabador takchita tekchita maroc tradition vente art acheter ligne haute couture prix pas cher qualite mariage soiree marie magasin cerimonie collection sfifa merwazi ");
urlsArray = new Array("../topic/index.html",
"../caftans/index.html",
"../caftans/page1.html",
"../caftans/page2.html",
"../caftans/page3.html",
"../caftans/page4.html",
"../caftans/page5.html",
"../caftans/page6.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",
"../albumphoto1/index.html",
"../albumphoto1/page1.html",
"../albumphoto1/page2.html",
"../albumphoto1/page3.html",
"../albumphoto1/page4.html",
"../albumphoto1/page5.html",
"../albumphoto2/index.html",
"../albumphoto2/page1.html",
"../albumphoto2/page2.html",
"../albumphoto2/page3.html",
"../albumphoto2/page4.html",
"../albumphoto2/page5.html",
"../collection2009/index.html",
"../collection2009/page1.html",
"../collection2009/page2.html",
"../collection2009/page3.html",
"../collection2009/page4.html",
"../collection2009/page5.html",
"../collection2009/page6.html",
"../collection2009/page7.html",
"../collection2009/page8.html",
"../collection2009/page9.html",
"../collection2009/page10.html",
"../collection2009/page11.html",
"../collection2009/page12.html",
"../collection2009/page13.html",
"../collection2009/page14.html",
"../collection2009/page15.html",
"../collection2009/page16.html",
"../collection2009/page17.html",
"../collection2009/page18.html",
"../albumphotosepia/index.html",
"../albumphotosepia/page1.html",
"../albumphotosepia/page2.html",
"../albumphotosepia/page3.html",
"../albumphotosepia/page4.html",
"../albumphotosepia/page5.html",
"../albumphotosepia/page6.html",
"../albumphotosepia/page7.html",
"../albumphotosepia/page8.html",
"../albumphotosepia/page9.html",
"../albumphotosepia/page10.html",
"../albumphotosepia/page11.html",
"../albumphotosepia/page12.html",
"../albumphotosepia/page13.html",
"../albumphotosepia/page14.html",
"../albumphotosepia/page15.html",
"../albumphotosepia/page16.html",
"../albumphotosepia/page17.html",
"../albumphotosepia/page18.html",
"../albumphotosepia/page19.html",
"../albumphotosepia/page20.html",
"../albumphotosepia/page21.html",
"../topic2/index.html",
"../topic2/page1.html",
"../topic2/page2.html",
"../topic2/page3.html",
"../topic2/page4.html",
"../topic2/page5.html",
"../topic2/page6.html",
"../topic2/page7.html",
"../topic2/page8.html",
"../topic2/page9.html",
"../topic2/page10.html",
"../topic2/page11.html",
"../topic2/page12.html",
"../topic2/page13.html",
"../topic2/page14.html",
"../topic2/page15.html",
"../topic2/page16.html",
"../topic2/page17.html",
"../topic2/page18.html",
"../topic2/page19.html",
"../topic2/page20.html",
"../topic2/page21.html",
"../topic2/page22.html",
"../topic2/page23.html",
"../topic2/page24.html",
"../topic2/page25.html",
"../topic2/page26.html",
"../topic2/page27.html",
"../topic2/page28.html",
"../topic2/page29.html",
"../topic2/page30.html",
"../topic2/page31.html",
"../topic2/page32.html",
"../topic2/page33.html",
"../topic2/page34.html",
"../aproposdemoi/index.html",
"../topic4/index.html");
titlesArray = new Array("Bienvenue au palais du caftan",
"Collection 2009                                           A chaque occasion son caftan",
"Caftan 144",
"Caftan 145",
"Caftan 153",
"Caftan 166",
"Caftan 167",
"Caftan 173",
"Collection 2009                                           A chaque occasion son caftan",
"Djellaba 052",
"Djellaba 062",
"Djellaba 070",
"Djellaba 079",
"Djellaba 150",
"Djellaba 154",
"Djellaba 157",
"Collection 2009                                           A chaque occasion son caftan",
"Ensemble 137",
"Ensemble 147",
"Ensemble 161",
"Ensemble 163",
"Ensemble 164",
"Collection 2009                                           A chaque occasion son caftan",
"Jabador 076",
"Jabador 095",
"Jabador 156",
"Jabador 160",
"Jabador 162",
"Collection 2009                                           A chaque occasion son caftan",
"Tekchita125",
"Tekchita 127",
"Tekchita 128",
"Tekchita 132",
"Tekchita 134",
"Tekchita 138",
"Tekchita 142",
"Tekchita 143",
"Tekchita 146",
"Tekchita 151",
"Tekchita 158",
"Tekchita 159.",
"Tekchita165",
"Tekchita 16",
"Tekchita 16",
"Tekchita 170",
"Tekchita 17",
"Tekchita 172",
"Collection 2008",
"Tekchita 009",
"Tekchita 012",
"Djellaba 035",
"Djellaba 042",
"Modèle 47",
"Djellaba 058",
"Tekchita 097",
"Tekchita 100",
"Tekchita 107",
"Tekchita 110",
"Tekchita 112",
"Tekchita 114",
"Jabador 117",
"Caftan 122",
"caftan 124",
"Tekchita 133 (Promotion)",
"Tekchita 135",
"Tekchita 136",
"Tekchita 139",
"Caftan 140 (Promotion)",
"Tekchita 141",
"Catalogue",
"Tekchita 125",
"Tekchita 127",
"Tekchita 128 (modèle épuisé)",
"Tekchita 132",
"Tekchita 134",
"Ensemble 137 (modèle épuisé)",
"Tekchita 138 (modèle épuisé)",
"Tekchita 142 (modèle épuisé)",
"Tekchita 143",
"Caftan 144",
"Tekchita 146",
"Ensemble147",
"Djellaba 150",
"Tekchita 151",
"Caftan 153",
"Djellaba 154",
"Djellaba 156",
"Djellaba 157",
"Caftan 158",
"Tekchita 159",
"Manteau 160",
"Manteau 161",
"Djellaba 162",
"Modèle 163",
"Ensemble 164",
"Tekchita 165",
"Caftan 166",
"Caftan 167",
"Tekchita 168",
"Tekchita 169",
"Tekchita 170",
"Tekchita 171",
"Tekchita 172",
"Caftan 173",
"QUI SOMMES NOUS",
"Formulaire de contact");
descArray = new Array("",
"Pour passer une commande, veuillez retenir le numéro du modèle et cliquer sur le menu catalogue",
"&",
"&",
"&",
"&",
"&",
"&",
"Pour passer une commande, veuillez retenir le numéro du modèle et cliquer sur le menu catalogue",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"Pour passer une commande, veuillez retenir le numéro du modèle et cliquer sur le menu catalogue",
"&",
"&",
"&",
"&",
"&",
"Pour passer une commande, veuillez retenir le numéro du modèle et cliquer sur le menu catalogue",
"&",
"&",
"&",
"&",
"&",
"Pour passer une commande, veuillez retenir le numéro du modèle et cliquer sur le menu catalogue",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
" ",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"Nous fabriquons, personnalisons revendons  vos caftans, takchita dans les règles de la tradition Marocaine Nous proposons à la vente une collection de...",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"&",
"Nous sommes une entreprise qui façonne,personnalise et vend des caftans et robes dans les règles de la tradition Marocaine. Notre établissement est co...",
"N'hésitez pas à nous contacter, poser vos questions et nous laisser vos coordonnés.");
sublinksArray = new Array(106);
var linksCount = 106;


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>");
}
