var thisDb="/pdc/bvdb.nsf/"; // Allgemeine Funktionen function ausgewaehlt(Feld) { // gibt den ausgewählten Text eines Select- Feldes zurück if (Feld) { var sindex=Feld.selectedIndex; if (sindex>=0) return (Feld.options[sindex].text); } return ""; } // *************************** function ausgewaehlterWert(Feld) { // gibt den ausgewählten Wert eines Select- Feldes zurück var sindex=Feld.selectedIndex; if (sindex==-1) return (""); else return (Feld.options[sindex].value); } // *************************** function check(Buttonliste) { // gibt den ausgewählten Wert eines Radio-Buttons zurück if (Buttonliste.length) { for (i=0;i15) { alert("The user name is limited to a maximum of 15 characters."); kennung.focus(); return false; } var treffer=kennwort.match(/[0-9a-zA-Z\-\_\ä\Ä\ö\Ö\ü\Ü\ß]+/); //alle gültige Zeichen if (null != treffer) { // irgendein Treffer if (treffer[0].length == kennwort.length) return true; // alle o.k. } alert ("Please enter only valid characters. This could be letters, numbers, or a combination of both."); kennung.focus(); return false; } // ************************************************* function nurZiffern(Feld, exakt, Fehlermeldung) { var v = Feld.value; // The string value to be searched if ((exakt>0 && v.length==exakt) || exakt==0) { // genau [exakt] Ziffern oder egal var m = v.match(/[0-9]+/); // One or more digit characters if (null != m) { // if we matched something // if we match the entire string, the lengths will match if (m[0].length == v.length ) return true; // Succeeds validation } } alert (Fehlermeldung); Feld.focus(); return false; // Fails validation } // ************************************************* function nurZiffernoderBlanks(Feld) { var v = Feld.value; // The string value to be searched v=v.replace(/ /g,""); var m = v.match(/[0-9]+/); // One or more digit characters if (null != m) { // if we matched something // if we match the entire string, the lengths will match if (m[0].length == v.length ) return true; // Succeeds validation } return false; // Fails validation } // ********************************************* function LTrim(str) { // Trim leading blanks var i=0; // start at the beginning var found = false; // not yet found a nonblank while(i0 && !found) { if (" " == str.charAt(i)) { i--;} else { found = true; }; // found a nonblank } if (found) { // found a nonblank return(str.substring(0,i+1)); } else { // completely blank string return(""); } } // ***************************************** function Trim(str) { // Trim leading and trailing blanks return(RTrim(LTrim(str))); } // *************************************** function falscheEmailadresse(emailadr) { if (! nichtLeer(emailadr,"Please enter a valid e-mail address.")) return true; var email=Trim(emailadr.value); var index=email.indexOf("@"); if (index<0 || email.indexOf(".",index)<0 || email.match(/ /)) { alert ("Please enter a valid e-mail address."); emailadr.focus(); return true; } return false; } function providerOK(emailadresse) { var providerliste = "AOL;att;Yahoo;SBCgobal;Bellsouth;Hotmail"; var provider = providerliste.split(";"); var index=emailadresse.indexOf("@"); emailadresse=emailadresse.substr(index+1); index=emailadresse.indexOf("."); emailadresse=emailadresse.substr(0, index).toLowerCase(); for (var i=0; i=1000000) sZahl=sZahl.substring(0,sZahl.length-6)+","+sZahl.substring(sZahl.length-6,999); if (zahl>=1000) sZahl=sZahl.substring(0,sZahl.length-3)+","+sZahl.substring(sZahl.length-3,999); return(sZahl+"."+fZahl[1]); } // ************************************************* function showAndHide(id, flag) { var id=self.document.getElementById(id); if (id) if (flag) id.style.display = "inline"; else id.style.display = "none"; return false; } // ************************************************* function UngueltigesDatum(datum) { var tempstring=datum.split("/"); if (tempstring.length !=3) return true; var monat=tempstring[0]; var tag=tempstring[1]; var jahr=tempstring[2]; if (monat<1 || monat>12) return true; if (tag<1 || tag>tageMax(monat, jahr)) return true; return false; } // *************************** // function isCCValid(cInputCardNo) { var cCardNo = ""; // Only digits allowed var i; // Temporary variable var nCheckSum; // Build the checksum here var nMult; // 1 or 2 var nDigit; // Value of digit * mult // First delete any non-numbers for (i=0; i < cInputCardNo.length; i++) { if (-1 != "0123456789".indexOf(cInputCardNo.charAt(i))) { cCardNo += cInputCardNo.charAt(i); // append to card no } } if ("" == cCardNo) return false; // Empty: Not valid // If length is odd append a zero to the left if (1 == cCardNo.length % 2) cCardNo = "0" + cCardNo; // cCardNo should now be an even number of characters nCheckSum = 0; // Start from the first character nMult = 2; // First multiplier is 2 for (i=0; i < cCardNo.length; i++) { nDigit = parseInt(cCardNo.charAt(i)); // Get the digit value // Every other digit is multiplied by 2. We shift left to multiply if (2 == nMult) nDigit = nDigit << 1; // Multiply by 2 // If the digit value is now greater than 9, reduce to single digit if (nDigit > 9) nDigit = nDigit - 9; // Single digit answer nCheckSum += nDigit; // Add to the checksum // Switch the multiplier if (2 == nMult) {nMult = 1} else nMult = 2; } // If the final answer is divisible by 10 it is valid if (0 == nCheckSum % 10) { return true; // Valid credit card number } else { return false; // Invalid number } } // ************************************************* function Datumsformat(datum) { var tag="0"+String(datum.getDate()); var monat="0"+String(datum.getMonth()+1); var jahr=String(datum.getFullYear()); tag=tag.substr(tag.length-2,2); monat=monat.substr(monat.length-2,2); return monat+"/"+tag+"/"+jahr; } // ************************************************* function tageMax(monat, jahr) { // ermittelt den letzten Tag des Monats if (monat==4 || monat==6 || monat==9 || monat==11) return 30; if (monat==2) return 28+(jahr % 4==0) return 31; } function encodeEmail(part1,part2,domain,id) { var m = "mai"; var l = "lt"; var o = "o:"; var at = "@"; //Assemble email address var _assembled = m+l+o+part1+at+part2+domain; document.getElementById(id).href = _assembled; } function showOrHide(id, flag) { var id=self.document.getElementById(id); if (id) if (flag) id.className = "show"; else id.className = "hidden"; }