home *** CD-ROM | disk | FTP | other *** search
Wrap
<!-- /* Kommentar */ var op = (navigator.userAgent.indexOf('Opera') != -1); var Optionen = true; function suche(eingabe) { var Beschreibung = new Object(); Beschreibung.Bilder = 'Bilder'; Beschreibung.desc = 'Beschreibung'; Beschreibung.kw = 'Text'; Beschreibung.title = 'Titel'; Beschreibung.url = 'Name'; var options = ' <b>Suche bei: </b>'; var SuchIn = new Array(); var ok = (document.mf && document.mf.Bilder); var einsok = ok; if ((!op && ok && document.mf.Bilder.checked) || (op && ok && document.mf.Bilder.value)) { SuchIn[SuchIn.length] = 'Bilder'; options += Beschreibung.Bilder + ', '; } ok = (document.mf && document.mf.kw); einsok = (ok || einsok); if ((!op && ok && document.mf.kw.checked) || (op && ok && document.mf.kw.value)) { SuchIn[SuchIn.length] = 'desc'; options += Beschreibung.desc + ', '; } ok = (document.mf && document.mf.kw); einsok = (ok || einsok); if ((!op && ok && document.mf.kw.checked) || (op && ok && document.mf.kw.value)) { SuchIn[SuchIn.length] = 'kw'; options += Beschreibung.kw + ', '; } ok = (document.mf && document.mf.kw); einsok = (ok || einsok); if ((!op && ok && document.mf.kw.checked) || (op && ok && document.mf.kw.value)) { SuchIn[SuchIn.length] = 'title'; options += Beschreibung.title + ', '; } ok = (document.mf && document.mf.url); einsok = (ok || einsok); if ((!op && ok && document.mf.url.checked) || (op && ok && document.mf.url.value)) { SuchIn[SuchIn.length] = 'url'; options += Beschreibung.url + ', '; } if (!einsok) { SuchIn[SuchIn.length] = 'kw'; options += Beschreibung.kw + ', '; } options = options.substring(0, options.length-2) + '<br>\n <b>Berücksichtigt wird:</b> '; var wortwahl = -1; ok = (document.mf && document.mf.lc); if ((!op && ok && document.mf.lc.checked) || (op && ok && document.mf.lc.value)) options += 'Groß-/Kleinschreibung, '; ok = (document.mf && document.mf.wa); var ok2 = (document.mf && document.mf.we); if ((!op && ok && ok2 && document.mf.wa.checked && document.mf.we.checked) || (op && ok && ok2 && document.mf.wa.value && document.mf.we.value)) { wortwahl = 3; options += 'Wortanfang, Wortende<br>\n'; } else if ((!op && ok && document.mf.wa.checked) || (op && ok && document.mf.wa.value)) { wortwahl = 1; options += 'Wortanfang<br>\n'; } else if ((!op && ok2 && document.mf.we.checked) || (op && ok2 && document.mf.we.value)) { wortwahl = 2; options += 'Wortende<br>\n'; } else if (ok || ok2) { wortwahl = 0; options += 'Alles<br>\n'; } else { wortwahl = 1; options += 'Wortanfang<br>\n'; } var auswahl = 0; options += ' <b>Verknüpfung: </b>'; ok = (document.mf && document.mf.r); if ((!op && ok && document.mf.r[0] && document.mf.r[0].checked) || (op && ok && document.mf.r[0] && document.mf.r[0].value)) { auswahl = 1; options += 'UND'; } else if ((!op && ok && document.mf.r[1] && document.mf.r[1].checked) || (op && ok && document.mf.r[1] && document.mf.r[1].value)) { auswahl = 2; options += 'ODER'; } else if ((!op && ok && document.mf.r[2] && document.mf.r[2].checked) || (op && ok && document.mf.r[2] && document.mf.r[2].value)) { auswahl = 3; options += 'NICHT UND'; } else if (ok && document.mf.r[3]) { auswahl = 4; options += 'NICHT ODER'; } else { auswahl = 1; options += 'UND'; } var HTMLDok = Kopf(eingabe, auswahl, options); var eoa = p.length + 1; var zaehler = 0; var liste = new Array(); var liste2 = new Array(); var tquot = new Array(); var ausgWort = new Array(); var Anker = new Array(); for (var i=0; i < p.length; i++) { liste[i] = i; ausgWort[i] = ''; Anker[i] = ''; } liste[i] = eoa; var keyw = splitter(eingabe); if (!keyw[0]) { alert ('Bitte mindestens einen gâżltigen Suchbegriff eingeben!'); return; } else if (!SuchIn.length) { alert ('Wo soll gesucht werden? ;)'); return; } var tmptquot = 0; var tmpWort = ''; var tmpAnker = ''; var gefunden = false; for (var i=0; i < keyw.length; i++) { for (var j=0; liste[j] != eoa; j++) { for (var k=0; k < SuchIn.length; k++) { var suchObj = new Array(); if (SuchIn[k] != 'kw' && p[liste[j]][SuchIn[k]]) suchObj = splitter(p[liste[j]][SuchIn[k]]); else if (p[liste[j]][SuchIn[k]]) suchObj = p[liste[j]][SuchIn[k]]; for (var l=0; l < suchObj.length; l++) { var suchKw = ''; var suchStr = ''; ok = (document.mf && document.mf.lc); if ((!op && ok && document.mf.lc.checked) || (op && ok && document.mf.lc.value)) { suchKw = suchObj[l]; suchStr = keyw[i]; } else { suchKw = suchObj[l].toLowerCase(); suchStr = keyw[i].toLowerCase(); } if (suchKw.indexOf(suchStr) != -1 && ((wortwahl == 1 && suchKw.indexOf(suchStr) == 0) || (wortwahl == 2 && suchKw.substring(suchKw.length - suchStr.length) == suchStr) || (wortwahl == 3 && (suchKw.indexOf(suchStr) == 0 || suchKw.substring(suchKw.length - suchStr.length) == suchStr)) || wortwahl == 0)) { if (keyw[i].length / suchKw.length * 100 > tmptquot) { tmptquot = keyw[i].length / suchKw.length * 100; if (auswahl == 1 || auswahl == 2) { if (wortwahl == 1 || (wortwahl == 3 && suchKw.indexOf(suchStr) == 0) || wortwahl == 0) tmpWort = suchObj[l].substring(0, suchKw.indexOf(suchStr)) + '<i><u>' + suchObj[l].substring(suchKw.indexOf(suchStr), suchKw.indexOf(suchStr)+suchStr.length) + '</u></i>' + suchObj[l].substring(suchKw.indexOf(suchStr)+suchStr.length) + ' (' + Beschreibung[SuchIn[k]] + ')' + ', '; else tmpWort = suchObj[l].substring(0, suchKw.length - suchStr.length) + '<i><u>' + suchObj[l].substring(suchKw.length - suchStr.length) + '</u></i>' + ' (' + Beschreibung[SuchIn[k]] + ')' + ', '; tmpAnker = suchObj[l].toLowerCase(); } gefunden = true; } } } } if (gefunden) { if (auswahl == 1 || auswahl == 2) { ausgWort[liste[j]] += tmpWort; Anker[liste[j]] = tmpAnker; } if (auswahl == 1 || auswahl == 3) { liste[zaehler] = liste[j]; if (!tquot[j]) tquot[j] = 0; tquot[zaehler] = (i * tquot[j] + tmptquot) / (i + 1); zaehler++; } else { liste2[j] = 1; if (!tquot[j] || tquot[j] < tmptquot) tquot[j] = tmptquot; } gefunden = false; tmptquot = 0; } } if (auswahl == 1 || auswahl == 3) { liste[zaehler] = eoa; tquot[zaehler] = 0; if (i+1 < keyw.length) zaehler=0; } } if (auswahl == 2 || auswahl == 4) { for (var i=0; i < p.length; i++) { if (liste2[i]) { liste[zaehler] = i; tquot[zaehler] = tquot[i]; zaehler++; } } liste[zaehler] = eoa; tquot[zaehler] = 0; } if (auswahl == 3 || auswahl == 4) { for (var i=0; i < p.length; i++) liste2[i] = i; for (i=0; liste[i] != eoa; i++) liste2[liste[i]] = eoa; zaehler = 0; for (var i=0; i < liste2.length; i++) { if (liste2[i] != eoa) { liste[zaehler] = liste2[i]; tquot[zaehler] = 100; zaehler++; } } tquot[zaehler] = 0; } HTMLDok += Zwischen(zaehler); if (zaehler) { var k = 0; for (var i=0; tquot[i]; i++) { for (var j=i+1; tquot[j]; j++) { if (tquot[i] < tquot[j]) { k = liste[j]; liste[j] = liste[i]; liste[i] = k; k = tquot[j]; tquot[j] = tquot[i]; tquot[i] = k; } } } for (var i=0; tquot[i]; i++) { HTMLDok += ' <li><font face="Arial,Helvetica, sans-serif;" size=+1>['+Math.round(tquot[i])+'%]<strong>' + p[liste[i]].title +'</strong> <A HREF="'+p[liste[i]].url; if (Anker[liste[i]]) HTMLDok += '#'+Anker[liste[i]]; HTMLDok += '">'+p[liste[i]].url+'</a><br><font size="-1">\n'; if (p[liste[i]].Bilder && 1==2) HTMLDok += ' <b>Bilder: </b><i>' +p[liste[i]].Bilder+ '</i><br>\n'; HTMLDok += ' <b>Beschreibung: </b>' +p[liste[i]].desc + '\n'; if (ausgWort[liste[i]]) HTMLDok += ' <br><b>Treffer: </b><font face="Courier New,Courier">' + ausgWort[liste[i]].substring(0, ausgWort[liste[i]].length-2); HTMLDok += '\n </font></font></font></li><br><br>\n' } HTMLDok += ' </ol>\n'; } else HTMLDok += ' </ol>\n' + ' <p>Leider wurde kein Ergebnis gefunden.</p>\n'; HTMLDok += Fuss(); document.open ('text/html'); document.write(HTMLDok); document.close(); return; } function splitter(Wert) { var tmpWert = Wert.split(' ').join(',').split(',').join('+').split('+').join('&').split('&'); var retVal = new Array(); for (var i=0; i < tmpWert.length; i++) if (tmpWert[i]) retVal[retVal.length] = tmpWert[i]; return (retVal); } function Kopf(eingabe, auswahl, options) { var retVal = '<html>\n' + '<head>\n' + '<title>Suchergebnis</title>\n' + '</head>\n' + '<body>\n' + '<center><h1><table border=3 cellspacing=1 cellpadding=0><tr><td bgcolor="#C0C0C0"><font face="Arial,Helvetica,Sans-Serif" size=+2><b> LookyLooky Album Suchergebnis </b></font></td></tr></table></h1></center><br>\n'; if (auswahl == 1 || auswahl == 2) retVal += '<center><td bgcolor="#C0C0C0"><font face="Arial,Helvetica,Sans-Serif" size=+1><b>Sie haben nach "<b>'+eingabe+'</b>" gesucht.</b></font></center><br>\n'; //retVal += ' <p>Sie haben nach "<b>'+eingabe+'</b>" gesucht.<br><br>\n'; else retVal += ' <p>Sie haben nach Dokumenten gesucht, in denen "<b>'+eingabe+'</b>" nicht vorkommt.<br><br>\n'; if (Optionen) //retVal += ' <font face="Arial,Helvetica,Sans-Serif" size="1"><b><i>Optionen:</i></b><br>\n' + options + '</font><br><br>\n'; return (retVal); } function Zwischen(zaehler) { return (' <hr color="#004080" noshade>\n' + ' <center><p><font face="Arial,Helvetica,Sans-Serif" size=+1><b>Es wurden '+zaehler+' von ' + p.length + ' Seiten gefunden: </b></font></p></center>\n' + // ' <P><b>Folgende Seiten/Stellen wurden gefunden:</b></P>\n' + ' <OL>\n'); } function Fuss() { return ('<a href="javascript:history.back();">Zurück zur Suche</a>\n' + '</body>\n' + '</html>'); } function loesche() { document.mf.reset(); document.mf.eingabe.focus(); } //-->