function submitRequest() { var f = document.forms[1]; var resultPage = "Searchresult-DE"; var strQuery = f.Query.value; if (strQuery == "") { alert("Geben Sie bitte den Begriff ein, nach dem Sie suchen möchten."); return false; } else { var loc = location.href; var i = loc.lastIndexOf("/"); if (i > 0) { var strURLBase = loc.substring(0, i); //location.href = strURLBase + "/" + resultPage + "?OpenDocument&Query=" + strQuery; location.href = "../name/" + resultPage + "?OpenDocument&Query=" + strQuery; } else { alert("Ungültige URL: Die Suche kann nicht ausgeführt werden.") return false; } } return true; } function initQuery() { var strFullQuery = location.search; var strLowerCaseQuery = strFullQuery.toLowerCase(); var i1 = strLowerCaseQuery.indexOf("query"); if (i1 < 0) { return false; } var strStartQuery = strLowerCaseQuery.substring(i1, strLowerCaseQuery.length); var i2 = strStartQuery.indexOf("&"); if (i2 < 0) i2 = strStartQuery.length; var strQuery = strStartQuery.substring(0, i2); var i3 = strQuery.indexOf("="); if (i3 < 0) { return false; } var strQueryString = strQuery.substring(i3 + 1, strQuery.length); var f = document.forms[1]; f.Query.value = decodeURL(strQueryString); return true; } function decodeURL(str) { // ÄÖÜäöüß-Ersatzcodes abfangen und als Zeichen darstellen: // Ä = %c4 ä = %e4 // Ö = %d6 ö = %f6 // Ü = %dc ü = %fc // ß = %df // dabei Ausgabe nur in Kleinbuchstaben! var s = str var i = s.indexOf("%c4"); while (i > 0) { s = replaceCode(s, i, "ä") i = s.indexOf("%c4"); } i = s.indexOf("%e4"); while (i > 0) { s = replaceCode(s, i, "ä") i = s.indexOf("%e4"); } i = s.indexOf("%d6"); while (i > 0) { s = replaceCode(s, i, "ö") i = s.indexOf("%d6"); } i = s.indexOf("%f6"); while (i > 0) { s = replaceCode(s, i, "ö") i = s.indexOf("%f6"); } i = s.indexOf("%dc"); while (i > 0) { s = replaceCode(s, i, "ü") i = s.indexOf("%dc"); } i = s.indexOf("%fc"); while (i > 0) { s = replaceCode(s, i, "ü") i = s.indexOf("%fc"); } i = s.indexOf("%df"); while (i > 0) { s = replaceCode(s, i, "ß") i = s.indexOf("%df"); } return s } function replaceCode(s, p, r) { // in Zeichenkette s an Position p das Zeichen r einfügen // r ersetzt einen dreistelligen Zeichencode var l = s.length var s1 = s.substring(0, p) var s2 = s.substring(p + 3, l) var result = s1.concat(r, s2) return result }