home *** CD-ROM | disk | FTP | other *** search
/ Enter 2001 September / EnterCD9.iso / Off-line / w17 / JavaScript2 / wysz.js < prev    next >
Encoding:
Text File  |  2001-07-08  |  8.7 KB  |  380 lines

  1. /* author: Pawe│ Pietrasz */
  2. /* Generated by AceHTML Freeware http://freeware.acehtml.com */
  3. /* Creation date: 01-06-26 */
  4. title = new Object();
  5. desc = new Object();
  6. links= new Object();
  7. matched= new Object();
  8. keywords= new Object();
  9. found= new Object();
  10. var temp=0;
  11. // actual location or the item to be searched
  12. // description of he location
  13. // actual link
  14. // percentage match found
  15. // keywords as parsed from the input
  16. // # of titles present in the database
  17. title[0]=43
  18. //no of keywords after parsing
  19. keywords[0]=0
  20. //no of  matches found.
  21. found[0]=0
  22.  
  23. title[1]="przelatuj▒cy tekst, pole tekstowe"
  24. desc[1]="Przelatuj▒cy tekst w polu tekstowym "
  25. links[1]="s1b.htm"
  26. matched[1]=0
  27.  
  28. title[2]="dodatki do stron, dodatki, ciekawe,"
  29. desc[2]="Dodatki do dobrych stron www "
  30. links[2]="s2b.htm"
  31. matched[2]=0
  32.  
  33. title[3]="dodatki do stron, dodatki, ciekawe,"
  34. desc[3]="Dodatki do dobrych stron www 2"
  35. links[3]="s17b.htm"
  36. matched[3]=0
  37.  
  38. title[4]="data, czas, pasek, godzina, na pasku, data na pasku"
  39. desc[4]="Data, czas na pasku"
  40. links[4]="s3b.htm"
  41. matched[4]=0
  42.  
  43.  
  44. title[5]="galeria na stronie, galeria, zdjΩcia "
  45. desc[5]="Galeria na stronie www"
  46. links[5]="s4b.htm"
  47. matched[5]=0
  48.  
  49. title[6]="zegar,czas, zegar w polu tekstowym"
  50. desc[6]="Zegarek w polu tekstowym"
  51. links[6]="s5b.htm"
  52. matched[6]=0
  53.  
  54.  
  55.  
  56. title[7]="ochrona has│em, has│o, zabezpieczenia"
  57. desc[7]="Ochrona has│em"
  58. links[7]="s6b.htm"
  59. matched[7]=0
  60.  
  61.  
  62. title[8]="tekst na pasku, pasek"
  63. desc[8]="Tekst na pasku"
  64. links[8]="s7b.htm"
  65. matched[8]=0
  66.  
  67.  
  68. title[9]="cookie"
  69. desc[9]="Od twojej wizyty minΩ│o..."
  70. links[9]="s8b.htm"
  71. matched[9]=0
  72.  
  73.  
  74. title[10]="cookie"
  75. desc[10]="Ostatnia modyfikacja strony"
  76. links[10]="s9b.htm"
  77. matched[10]=0
  78.  
  79. title[11]="przegl▒darka, informacje, informacje o przegl▒darce "
  80. desc[11]="Informacje o przegl▒darce"
  81. links[11]="s11b.htm"
  82. matched[11]=0
  83.  
  84. title[12]="nawigacja, nawigacja na stronie"
  85. desc[12]="Nawigacja na stronie"
  86. links[12]="s12b.htm"
  87. matched[12]=0
  88.  
  89. title[13]="miganie, miganie kolorow, kaskada"
  90. desc[13]="Miganie kolor≤w"
  91. links[13]="s15b.htm"
  92. matched[13]=0
  93.  
  94. title[14]="tekst, przewijanie, przewijany tekst"
  95. desc[14]="Przewijany tekst"
  96. links[14]="s20b.htm"
  97. matched[14]=0
  98.  
  99. title[15]="kursor, kursory, kursor myszy"
  100. desc[15]="Efekty przy kursorze"
  101. links[15]="s21b.htm"
  102. matched[15]=0
  103.  
  104. title[16]="drukarz, drukarze"
  105. desc[16]="Drukarz"
  106. links[16]="s22b.html"
  107. matched[16]=0
  108.  
  109. title[17]="kalendarz, kalendarze"
  110. desc[17]="Kalendarze"
  111. links[17]="s23b.html"
  112. matched[17]=0
  113.  
  114. title[18]="formularz,formularze pocztowe, formularz pocztowy"
  115. desc[18]="Formularz pocztowy"
  116. links[18]="s24b.html"
  117. matched[18]=0
  118.  
  119. title[19]="ksi▒┐ka, ksi▒┐ka adresowa,"
  120. desc[19]="Ksi▒┐ka adresowa z opisem"
  121. links[19]="s25b.html"
  122. matched[19]=0
  123.  
  124. title[20]="link z opisem, link, odsy│acz"
  125. desc[20]="Link z opisem"
  126. links[20]="s27b.html"
  127. matched[20]=0
  128.  
  129. title[21]="menu, ruchome menu, "
  130. desc[21]="Ruchome menu"
  131. links[21]="s28b.html"
  132. matched[21]=0
  133.  
  134. title[22]="strona, prze│adowywana strona, prze│adowywanie "
  135. desc[22]="Przeladowywana strona"
  136. links[22]="s29b.html"
  137. matched[22]=0
  138.  
  139. title[23]="pokaz, slajdy, pokaz slajd≤w "
  140. desc[23]="Adresowy pokaz slajd≤w"
  141. links[23]="s31b.html"
  142. matched[23]=0
  143.  
  144. title[24]="│adowarka, │adowanie strony,"
  145. desc[24]="ProszΩ czekaµ-│adowanie strony"
  146. links[24]="s32b.html"
  147. matched[24]=0
  148.  
  149. title[25]="neon, tekst, ruchomy tekst"
  150. desc[25]="Neon"
  151. links[25]="s33b.html"
  152. matched[25]=0
  153.  
  154. title[26]="banery, zmieniaj▒ce banery, baner"
  155. desc[26]="Zmieniaj▒ce siΩ banery"
  156. links[26]="s34b.html"
  157. matched[26]=0
  158.  
  159. title[27]="okienko, pojawiaj▒ce siΩ okienko, animowane okienko"
  160. desc[27]="Pojawiaj▒ce siΩ okienko"
  161. links[27]="s41b.html"
  162. matched[27]=0
  163.  
  164. title[28]="linki, animowane linki, odsy│acze"
  165. desc[28]="Animowane odsy│acze"
  166. links[28]="s42b.html"
  167. matched[28]=0
  168.  
  169. title[29]="otwieracz, grafika, otwieracz plik≤w"
  170. desc[29]="Otwieracz plik≤w graficznych"
  171. links[29]="s43b.html"
  172. matched[29]=0
  173.  
  174. title[30]="link, animacja, animacje, linki,"
  175. desc[30]="Animowany link tekstowy"
  176. links[30]="s54b.html"
  177. matched[30]=0
  178.  
  179. title[31]="animacja, grafika, animacja grafiki, animacje"
  180. desc[31]="Animacja grafiki"
  181. links[31]="s44b.html"
  182. matched[31]=0
  183.  
  184. title[32]="menu"
  185. desc[32]="Menu"
  186. links[32]="s48b.html"
  187. matched[32]=0
  188.  
  189. title[38]="miganie, miganie kolorow, kaskada, rozja╢nienie strony, rozja╢nienie"
  190. desc[38]="Rozja╢nienie strony"
  191. links[38]="s13b.htm"
  192. matched[38]=0
  193.  
  194. title[33]="kalkulator,"
  195. desc[33]="Kalkulator"
  196. links[33]="s14b.htm"
  197. matched[33]=0
  198.  
  199. title[34]="data, godzina, czas, aktualna data i godzina"
  200. desc[34]="Aktualna data i godzina"
  201. links[34]="s16b.htm"
  202. matched[34]=0
  203.  
  204. title[35]="przeliczniki,"
  205. desc[35]="Przeliczniki"
  206. links[35]="s18b.htm"
  207. matched[35]=0
  208.  
  209. title[36]="zegar, czas"
  210. desc[36]="Zegar"
  211. links[36]="s38b.html"
  212. matched[36]=0
  213.  
  214. title[37]="link, linki, "
  215. desc[37]="Linki"
  216. links[37]="s39b.html"
  217. matched[37]=0
  218.  
  219. title[39]="link, linki, "
  220. desc[39]="Likwiduje podkre╢lenie linku"
  221. links[39]="s45b.html"
  222. matched[39]=0
  223.  
  224. title[40]="link, linki, "
  225. desc[40]="Zmienia wygl▒d linku"
  226. links[40]="s46b.html"
  227. matched[40]=0
  228.  
  229. title[41]="tekst,  "
  230. desc[41]="Pod£wietlony tekst"
  231. links[41]="s47b.html"
  232. matched[41]=0
  233.  
  234. title[42]="scrollbar, pasek, pasek przewijania  "
  235. desc[42]="Ustawienie kolor≤w paska przewijania"
  236. links[42]="s50b.html"
  237. matched[42]=0
  238.  
  239. title[43]="tekst, animowany tekst,"
  240. desc[43]="Animacje i efekty z tekstem"
  241. links[43]="s51b.html"
  242. matched[43]=0
  243. <!-- End list of Searchable items -->
  244.  
  245. function search(){
  246. var skeyword=document.searchengine.keywords.value.toLowerCase();
  247. var check=1;
  248. var pos=0;
  249. var i=0;
  250. var j=0;
  251. var  itemp=0;
  252. var config='';
  253.  
  254. while (true)
  255.     {
  256.     if (skeyword.indexOf("+") == -1 )
  257.         {
  258.         keywords[check]=skeyword;
  259.         break;
  260.         }
  261.     pos=skeyword.indexOf("+");
  262.     if (skeyword !="+")    
  263.     {
  264.     keywords[check]=skeyword.substring(0,pos);
  265.     check++;
  266.     }
  267.     else
  268.     {
  269.     check--;
  270.     break;
  271.     }
  272.     skeyword=skeyword.substring(pos+1, skeyword.length);    
  273.     if (skeyword.length ==0)
  274.         {
  275.         check--;
  276.         break;
  277.         }
  278.              
  279.     }
  280. // the keywords have been put in keywords object.
  281. keywords[0]=check;
  282.  
  283. // matching and storing the matches in matched
  284. for ( i=1; i<=keywords[0];i++)
  285.     {
  286.     for (j=1;j<=title[0];j++)
  287.         {
  288.         if (title[j].toLowerCase().indexOf(keywords[i]) > -1 )
  289.             {
  290.               matched[j]++;
  291.             }
  292.         }    
  293.     }
  294. // putting all the indexes of the matched records  in found
  295.  
  296. for (i=1;i<=title[0];i++)
  297. {
  298.     if (matched[i] > 0 )
  299.         {
  300.           found[0]++;
  301.         // increment the found     
  302.           found[found[0]]=i;
  303.             
  304.         }    
  305. }
  306.  
  307.  
  308.  
  309. for (i=1;i<=found[0]-1;i++)
  310.     {
  311.     for(j=i+1;j<=found[0];j++)
  312.         {
  313.         if ( matched[found[i]]< matched[found[j]] )
  314.             {
  315.             temp= found[j];
  316.             found[j]=found[i];
  317.             found[i]=temp;
  318.             }
  319.         }
  320.     }
  321.  
  322. // end of sort
  323.  
  324. output = self;
  325. output.document.write('<html>');
  326. output.document.write('<head>');
  327. output.document.write('<script>');
  328. output.document.write('window.onerror=new Function("return true")');
  329. output.document.write('<\/script>');
  330. output.document.write('<title> Rezultat szukania </title>');
  331. output.document.write('</head>');
  332. output.document.write('<BODY bgcolor=#ffffff text=#000000  link=#000080 vlink =##404040 >');
  333.  
  334. output.document.write('<center> <h1> Rezultat poszukiwania </h1></center>');    
  335. output.document.write('<hr>');
  336. output.document.write(' Poszukiwany s│owo kluczowe:: '.big() )
  337. for (i=1;  i<=keywords[0]; i++)
  338.     {
  339.     output.document.write( keywords[i].bold() +"   ");
  340.     }
  341. output.document.write('<br>');
  342.  
  343. if (found[0]==0)
  344.     {
  345.     //alert(found[0]);
  346.     output.document.write('<hr>');
  347.     output.document.write("<b>Niestety nie znaleziono tego s│owa </b> <br>");
  348.     output.document.write("Zastosuj inne s│owo kluczowe, b▒d╝ je inaczej sformu│uj  <br>");
  349.     }
  350. else
  351.     {
  352.     // data has been found
  353.     output.document.write(" <hr> <b> Rezultat poszukiwania   : </b>  ");
  354.     output.document.write( found[0] +"  Znalezionych adres≤w  ".italics());
  355.     output.document.write("<table border=0  width=100%>");
  356.     for (i=1; i<=found[0];i++)
  357.         {
  358.         output.document.write("<tr><td valign=top bgcolor=#BEBBB0>");
  359.         output.document.write("<h3>" +i +"</h3>");
  360.         output.document.write("<td valign=top>");
  361.         itemp=found[i];
  362.         output.document.write(desc[itemp].bold() +"<br>" +
  363.         links[itemp].link(links[itemp])+"<br>");
  364.         temp= (matched[itemp]/keywords[0])*100
  365.         output.document.write("<i> Trafno╢µ  :: " +temp+" %  </i>" );
  366.         matched[itemp]=0
  367.         } 
  368.     found[0]=0;
  369.     output.document.write("</table>");
  370.     }
  371. output.document.write ("<hr>");
  372. //output.document.write ("<form><center>"); 
  373. output.document.write('<center>Powr≤t do wyszukiwarki <a href="prawa.htm"> Powr≤t</a>');
  374. //output.document.write ("<input type='button' value='Start Another Search' onClick = 'self.close()'"); 
  375. //output.document.write ("<center></form>");
  376.  
  377. output.document.write ("</body></html>"); 
  378. output.document.close();
  379. }
  380.