function jetzt() {
        var ret = "";
        var jetzt = new Date();
        
        var tag = jetzt.getDate();
        if (tag < 10)
            tag = "0" + tag;
        var monat = (jetzt.getMonth()+1);
        if (monat < 10)
            monat = "0" + monat;
        var jahr = jetzt.getFullYear();
        
        var std = jetzt.getHours();
        if (std < 10)
            std = "0" + std;
        var min = jetzt.getMinutes();
        if (min < 10)
            min = "0" + min;
        var sec = jetzt.getSeconds();
        if (sec < 10)
            sec = "0" + sec;
        
        ret = tag + "." + monat + "." + jahr + " " + std + ":" + min + ":" + sec;

        return ret;
}

function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function setFocus() {
    var ok = false;
    //alert('document.forms.length = ' + document.forms.length  );
    
    if (document.forms.length > 0) {
        var form1 = document.forms[0];
        var num = form1.elements.length;
        for (var i = 0; i < num; i++) {
            if ( (form1.elements[i].type == "text" || 
                  form1.elements[i].type == "textarea" || 
                  form1.elements[i].type == "password") &&
                 !form1.elements[i].disabled) {
                
                //alert('form1.elements[i].name: ' + form1.elements[i].name);
                try { 
                    form1.elements[i].focus(); ok = true; 
                } 
                catch(e) { }
                break;
            }
        }
    }
    if (!ok) {
        try {
            var elem = document.getElementById('enterSubmit');
            if (elem == null ) {
                var elem = document.getElementsByTagName('div')[0];
            }
            elem.focus();
            ok = true;
            // alert('Element with id=[' + elem.id + '] has the focus.');
        }
        catch(e) { 
          /* ignore */
        }
    }
}

function strtrim(inputString) {
    // Removes leading and trailing spaces from the passed string. Also removes
    // consecutive spaces and replaces it with one space. If something besides
    // a string is passed in (null, custom object, etc.) then return the input.
    if (typeof inputString != "string") { return inputString; }
    var retValue = inputString;
    var ch = retValue.substring(0, 1);
    while (ch == " ") { // Check for spaces at the beginning of the string
       retValue = retValue.substring(1, retValue.length);
       ch = retValue.substring(0, 1);
    }
    ch = retValue.substring(retValue.length-1, retValue.length);
    while (ch == " ") { // Check for spaces at the end of the string
       retValue = retValue.substring(0, retValue.length-1);
       ch = retValue.substring(retValue.length-1, retValue.length);
    }
    while (retValue.indexOf("  ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
       retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
    }
    return retValue; // Return the trimmed string back to the user
} // Ends the "strtrim" function
 

// Funktion strToInt kann noch keine negativen Zahlen!!!
function strToInt(str) {
    var a = 0;
    var code;
    
    str = strtrim(str);
    
    for (var i = 0; i < str.length; i++) {
        code = str.charCodeAt(i);
        if ((code >= 48) && (code <= 57)) {
            a = (a * 10) + (code - 48);
        } else {
            break;
        }
    }
    
    return a;
}

