<!--
var defaultEmptyOK = false;
var whitespace = " \t\n\r";
var mPrefix = "The field "
var mSuffix = " is empty.\nThis is a required field. Please fill in this field."
var decimalPointDelimiter = ","

function isEmpty(s){
	return ((s == null) || (s.length == 0))
}

function isDigit (c){
	return ((c>='0') && (c<='9'))
}

function isEmpty(s){
	return ((s==null) || (s.length==0))
}

function checkDate(oField, layoutName){
	if(oField.value==''){
		return true;
	}

	var aDate = oField.value.split("/");
	var nDay = aDate[1].toString();
	var nMonth = aDate[0].toString();
	var nYear = aDate[2].toString();
	
	if(nDay ==''){
		alert('The day is empty');
		return false;
	}
	if(nMonth==''){
		alert('The month is empty');
		return false;
	}
	if(nYear==''){
		alert('The year is empty');
		return false
	}
	if(isNaN(nYear)){
		alert('The year is not numeric');
		return false;
	}
	if(nYear.length!=4){
		alert('Yhe year must have 4 digits');
		return false;
	}
	return true;
}

function checkDateNew(oField, layoutName){
	if(oField.value==''){
		return true;
	}

	var aDate 	= oField.value.split('/');
	var nDay 	= aDate[1].toString();
	var nMonth 	= aDate[0].toString();
	var nYear 	= aDate[2].toString();
	var arMonths = new Array('january','february','march','april','may','june','july','august','september','october','november','december');

	if(nDay==''){
		alert('The day is empty');
		return false;
	}
	if(nMonth==''){
		alert('The month is empty');
		return false;
	}
	if(nYear==''){
		alert('The year is empty');
		return false
	}
	if(isNaN(nYear)){
		alert('The year is not numeric');
		return false;
	}
	if(nYear.length != 4){
		alert('Yhe year must have 4 digits');
		return false;
	}
	
	var schYear 	= String(nYear/4)
	var isSchYear 	= schYear.indexOf(".")
	
	if (((nMonth==2)||(nMonth==4)||(nMonth==6)||(nMonth==9)||(nMonth==11))&&(nDay==31)){
		alert('The month ' + arMonths[nMonth-1] + ' hasn\'t got 31 days.\nPlease adjust the date.')
		return false
	}
	if ((nMonth==2)&&(nDay==30)){
		alert('The month ' + arMonths[nMonth-1] + ' hasn\'t got 30 days.\nPlease adjust the date.')
		return false
	}
	
	if (isSchYear>0){
		if ((nMonth==2)&&(nDay==29)){
			alert('The month february has got 28 days this year.\nPlease adjust the date.')
			return false
		}
	}
	return true;
}

function checkHidden(theField,s){
	if(theField.value==''){
		alert(mPrefix + s + mSuffix)
		return false;
	}
	return true;
}

function IsEmail(oField, layoutName){
	var sErrorMessage = 'The e-mailaddress is not a valid e-mailaddress';
	
	if(oField.value==''){
		return true;
	}
	
	var x = oField.value
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;
	if (filter.test(x)){
		return true;
	}
	else{
		alert(sErrorMessage);
		oField.focus();
		return false;
	}
}

function checkString (theField, s, emptyOK){   
    if (checkString.arguments.length == 2) emptyOK = defaultEmptyOK;
    if ((emptyOK == true) && (isEmpty(theField.value))) return true;
    if (isWhitespace(theField.value)) 
       return warnEmpty (theField, s);
    else return true;
}

function checkRadioButton(oField, layoutName){
	
	if(oField.length){
		for(i=0;i<oField.length;i++){
			if(oField[i].checked==true){
				return true;
			}
		}
		alert(layoutName+ ' is a required field. One radiobutton must be checked.');
		return false;
	}
	else{
		if(oField.checked==true){
			return true;
		}
		alert(layoutName+ ' is a required field. One radiobutton must be checked.');
		return false;
	}
}


function checkCheckBox(oField, layoutName){
	var iLength;
	iLength = oField.length;
	
	if(!oField.length){
		if(oField.checked==false){
			alert(layoutName + ' must be checked.');
			return false;
		}
	}
	else{
		for(i=0;i<oField.length;i++){
			if(oField[i].checked==true){
				return true;
			}
		}
		alert('At least one ' +layoutName+ ' should be checked.');
		return false;
	}
	return true;
}

function warnEmpty (theField, s){  
	theField.focus()
    alert(mPrefix + s + mSuffix)
    return false
}

function isWhitespace (s){   
	var i;

    if (isEmpty(s)) return true;
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (whitespace.indexOf(c) == -1) return false;
    }
    return true;
}

//-->
