function openPopup(href, window_name, width, height, is_resizable, show_scrollbars, show_menubar, show_statusbar) {
	if (!window_name || window_name == "") window_name = "popup";
    window_name = window_name.replace(/ /g, "_");
    var features = '';
    if (is_resizable) {
        features += ',resizable=yes'
    } else {
        features += ',resizable=no'
    }
    if (show_scrollbars) {
        width = parseInt(width) + 16;
        features += ',scrollbars=yes'
    } else {
        features += ',scrollbars=no'
    }
    if (show_menubar) {
        features += ',menubar=yes'
    } else {
        features += ',menubar=no'
    }
    if (show_statusbar) {
        features += ',status=yes'
    } else {
        features += ',status=no'
    }
    features = 'width=' + width + ',height=' + height + features + ',dependent=yes,toolbar=yes,location=yes,directories=yes';
    var popup = window.open(href, window_name, features);
    popup.focus();
    return popup;
}

function openPopupMinimalistic(href, window_name, width, height, show_scrollbars) {
	if (!window_name || window_name == "") window_name = "popup";
    window_name = window_name.replace(/ /g, "_");
    var features = '';
    features += ',resizable=no'
    if (show_scrollbars) {
        width = parseInt(width) + 16;
        features += ',scrollbars=yes'
    } else {
        features += ',scrollbars=no'
    }
    features += ',menubar=no'
    features += ',status=no'
    features = 'width=' + width + ',height=' + height + features + ',dependent=no,toolbar=no,location=no,directories=no';
    var popup = window.open(href, window_name, features);
    popup.focus();
    return popup;
}

function getField(field_name) {
    var i;
    for (i = 0; i < document.forms.length; ++i) {
        var field;
        eval("field = document.forms[" + i + "]." + field_name);
        if (field) return field;
    }
}

/*
* Die Input-Parameter sind: der Feld-Name;
* das Feld mit der Zahl der verbleibenden Stellen;
* die max. Stellenanzahl.
*/
function textCounter(field, countfield, maxlimit) {
    if (field.value.length > maxlimit) {    // wenn die eingegebene Länge größer als erlaubt ist
        field.value =field.value.substring(0, maxlimit);
    } else {
        countfield.value = maxlimit - field.value.length;
    }
}
