/*
	WebRegio Interactie - WebRegio WebControl Library
	Copyright (C) 2003 WebRegio Development b.v.
*/
function checkAlphaNumeric(lStrValue) {
	return (/^[a-z|A-Z|0-9|\s]*$/.test(lStrValue));
}

function checkAlpha(lStrValue) {
	return (/^[a-z|A-Z]*$/.test(lStrValue));
}

function checkPostcode(lStrValue) 
{		
	if( lStrValue.length > 7) 
		return false;
	else
		return (/^[a-z|A-Z|0-9|\s]*$/.test(lStrValue));	
}

function checkNumeric(lStrValue) {
	return (/^[0-9]*$/.test(lStrValue));
}

function checkDate(lStrValue) {
	if (lStrValue.length == 10) {
		var lArrStr = lStrValue.split( "-" );
		if (lArrStr.length == 3) {
			var lDate	= new Date( lArrStr[ 2 ], lArrStr[ 1 ] - 1, lArrStr[ 0 ] );
			var lIntMonth = lDate.getMonth() + 1;
		
			if (lArrStr[ 2 ].length == 4) {
				if (  lIntMonth == lArrStr[ 1 ] ) {
					return true;
				}
			}
		}
	}
	
	return false;
}

function checkEmail(lstrValue) {
    return (lstrValue.search(/^[\w\.\-_]+@([\w\.\-_]+\.)+[A-Za-z]{2,4}$/) != -1)
}
function checkPhoneNr(lstrValue) {
	return (lstrValue.search(/^[\d|\-|\s]{0,16}$/) != -1)
}

function checkRadio(radio) {
	for(var i = 0; i < radio.length; i++) {
		if (radio[i].checked) {
			return true;
		}
	}
	return false;
}


