home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Internet 2001 November / MICD2001_11_NR1.iso / Www / CentrumProg / wysz.js < prev    next >
Text File  |  2001-09-19  |  10KB  |  406 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]=48
  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, ruchomy tekst"
  240. desc[43]="Animacje i efekty z tekstem"
  241. links[43]="s51b.html"
  242. matched[43]=0
  243.  
  244. title[44]="tekst, t│o, ekty z tekstem,"
  245. desc[44]="Zniekszta│cone t│o tekstu"
  246. links[44]="s55b.html"
  247. matched[44]=0
  248.  
  249. title[45]="tekst, animacje z tekstem, animowany tekst, ruchomy tekst,"
  250. desc[45]="Ruchomy tekst"
  251. links[45]="s56b.html"
  252. matched[45]=0
  253.  
  254. title[46]="tekst, animacje z tekstem, animowany tekst, ruchomy tekst,"
  255. desc[46]="Ruchomy tekst"
  256. links[46]="s58b.html"
  257. matched[46]=0
  258.  
  259. title[47]="neon, tekst, ruchomy tekst"
  260. desc[47]="Neon III"
  261. links[47]="s58b.html"
  262. matched[47]=0
  263.  
  264. title[48]="drukuj, drukowanie strony, drukowanie, drukarka, wydruk"
  265. desc[48]="Drukowanie strony"
  266. links[48]="s63b.html"
  267. matched[48]=0
  268.  
  269. <!-- End list of Searchable items -->
  270.  
  271. function search(){
  272. var skeyword=document.searchengine.keywords.value.toLowerCase();
  273. var check=1;
  274. var pos=0;
  275. var i=0;
  276. var j=0;
  277. var  itemp=0;
  278. var config='';
  279.  
  280. while (true)
  281.     {
  282.     if (skeyword.indexOf("+") == -1 )
  283.         {
  284.         keywords[check]=skeyword;
  285.         break;
  286.         }
  287.     pos=skeyword.indexOf("+");
  288.     if (skeyword !="+")    
  289.     {
  290.     keywords[check]=skeyword.substring(0,pos);
  291.     check++;
  292.     }
  293.     else
  294.     {
  295.     check--;
  296.     break;
  297.     }
  298.     skeyword=skeyword.substring(pos+1, skeyword.length);    
  299.     if (skeyword.length ==0)
  300.         {
  301.         check--;
  302.         break;
  303.         }
  304.              
  305.     }
  306. // the keywords have been put in keywords object.
  307. keywords[0]=check;
  308.  
  309. // matching and storing the matches in matched
  310. for ( i=1; i<=keywords[0];i++)
  311.     {
  312.     for (j=1;j<=title[0];j++)
  313.         {
  314.         if (title[j].toLowerCase().indexOf(keywords[i]) > -1 )
  315.             {
  316.               matched[j]++;
  317.             }
  318.         }    
  319.     }
  320. // putting all the indexes of the matched records  in found
  321.  
  322. for (i=1;i<=title[0];i++)
  323. {
  324.     if (matched[i] > 0 )
  325.         {
  326.           found[0]++;
  327.         // increment the found     
  328.           found[found[0]]=i;
  329.             
  330.         }    
  331. }
  332.  
  333.  
  334.  
  335. for (i=1;i<=found[0]-1;i++)
  336.     {
  337.     for(j=i+1;j<=found[0];j++)
  338.         {
  339.         if ( matched[found[i]]< matched[found[j]] )
  340.             {
  341.             temp= found[j];
  342.             found[j]=found[i];
  343.             found[i]=temp;
  344.             }
  345.         }
  346.     }
  347.  
  348. // end of sort
  349.  
  350. output = self;
  351. output.document.write('<html>');
  352. output.document.write('<head>');
  353. output.document.write('<script>');
  354. output.document.write('window.onerror=new Function("return true")');
  355. output.document.write('<\/script>');
  356. output.document.write('<title> Rezultat szukania </title>');
  357. output.document.write('</head>');
  358. output.document.write('<BODY bgcolor=#ffffff text=#000000  link=#000080 vlink =##404040 >');
  359. output.document.write('    <meta http-equiv="content-type" content="text/html; charset=iso-8859-2">');
  360. output.document.write('<center> <h1> Rezultat poszukiwania </h1></center>');    
  361. output.document.write('<hr>');
  362. output.document.write(' Poszukiwany s│owo kluczowe:: '.big() )
  363. for (i=1;  i<=keywords[0]; i++)
  364.     {
  365.     output.document.write( keywords[i].bold() +"   ");
  366.     }
  367. output.document.write('<br>');
  368.  
  369. if (found[0]==0)
  370.     {
  371.     //alert(found[0]);
  372.     output.document.write('<hr>');
  373.     output.document.write("<b>Niestety nie znaleziono tego s│owa </b> <br>");
  374.     output.document.write("Zastosuj inne s│owo kluczowe, b▒d╝ je inaczej sformu│uj  <br>");
  375.     }
  376. else
  377.     {
  378.     // data has been found
  379.     output.document.write(" <hr> <b> Rezultat poszukiwania   : </b>  ");
  380.     output.document.write( found[0] +"  Znalezionych adres≤w  ".italics());
  381.     output.document.write("<table border=0  width=100%>");
  382.     for (i=1; i<=found[0];i++)
  383.         {
  384.         output.document.write("<tr><td valign=top bgcolor=#BEBBB0>");
  385.         output.document.write("<h3>" +i +"</h3>");
  386.         output.document.write("<td valign=top>");
  387.         itemp=found[i];
  388.         output.document.write(desc[itemp].bold() +"<br>" +
  389.         links[itemp].link(links[itemp])+"<br>");
  390.         temp= (matched[itemp]/keywords[0])*100
  391.         output.document.write("<i> Trafno╢µ  :: " +temp+" %  </i>" );
  392.         matched[itemp]=0
  393.         } 
  394.     found[0]=0;
  395.     output.document.write("</table>");
  396.     }
  397. output.document.write ("<hr>");
  398. //output.document.write ("<form><center>"); 
  399. output.document.write('<center>Powr≤t do wyszukiwarki <a href="dol.htm"> Powr≤t</a>');
  400. //output.document.write ("<input type='button' value='Start Another Search' onClick = 'self.close()'"); 
  401. //output.document.write ("<center></form>");
  402.  
  403. output.document.write ("</body></html>"); 
  404. output.document.close();
  405. }
  406.