/**
 *  Bewital JavaScript collection
 *
 *  @version 1.0.0
 *  @copyright four for business AG <www.4fb.de>
 *  @author Holger Librenz
 *
 *  @internals {
 *      2007-07-05, H. Librenz - created
 *  }
 */

/**
 * Checks if privacy statement was accepted
 * 
 * @return boolean
 */
function checkPrivacy() {
    if (document.getElementById('oxsecurityinfo') && !document.getElementById('oxsecurityinfo').checked) {
        alert('Bitte akzeptieren Sie die Datenschutzerklärung.');
        return false;
    }    
    return true;
}

function checkIpAddress() {
    if (document.getElementById('bewital_ipaddress') && !document.getElementById('bewital_ipaddress').checked) {
        alert('Bitte akzeptieren Sie das Speichern der IP-Adresse.');
        return false;
    }    
    return true;
}

function redirectTo ( area ) {
	if ( area != "" ) {
		document.location.href = "index.php?cl=" + area;
	}

}

function charCount(InputStr) {
    StrLen = InputStr.value.length
    if (StrLen == 1 && InputStr.value.substring(0,1) == " ") {
        InputStr.value = ""
        StrLen = 0
    } else {
        CharsLeft = 250 - StrLen
    }
    document.order.counter.value = CharsLeft
    if (InputStr.value.length >= 250) {
        InputStr.value = InputStr.value.substr(0, 250);
    }
}

function OnKeyDownInTextArea( item, maxlen ) {
    if (item.value.length > maxlen - 1) {
        event.returnValue = false;
    }
}