// Form Element functions.
// goes in the common main.js file FE == form elements
function FE_isemail(el) {
	if (el.value.length > 0) {
		return (el.value.search (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/) == 0);
	}
	return true;
}

function FE_istextonly(el) {
	/*if (el.value.match (/^[a-zA-Z\s\-\.\'ÁÉÍÓÚÝáéíóúýÀÈÌÒÙàèìòùÂÊÎÔÛâêîôûçÇ\s]*$/)) {
		alert ("text")
	} else {
		alert ("not text")
	}*/
	return (el.value.match (/^[a-zA-Z\s\-\.\'ÁÉÍÓÚÝáéíóúýÀÈÌÒÙàèìòùÂÊÎÔÛâêîôûçÇ\s]*$/));
}

function FE_isalphanumeric(el) {
	return (el.value.match (/^[a-zA-Z0-9\s\-\.\'ÁÉÍÓÚÝáéíóúýÀÈÌÒÙàèìòùÂÊÎÔÛâêîôûçÇ\s]*$/));
}

function FE_isphone(el) {
	if (el.value.length > 0) {
		return (el.value.search (/^[0-9\-\. \s\(\)]*$/) == 0);
	}
	return true;
}

function FE_ispostal(el) {
	return (el.value.search (/^\w\d\w(\s)?\d\w\d$/) == 0);
}

function FE_iszip(el) {
	return (el.value.search (/^\d{5,5}$/) == 0);
}

function FE_isblank(el) {
	
/*	if (el.value.match (/^[\s ]*$/)) {
		alert ("blank")
	} else {
		alert ("not blank")
	} */
	return (el.value.match (/^[\s ]*$/));
}

function FE_islengthlt (el, m_l) {
	return el.value.length < m_l;
}

function FE_islengthgt (el, m_l) {
	return (el.value.length > m_l);
}

function FE_isinteger(el) {
	return (el.value.match (/^[\d]*$/));
}

function FE_iscurrency(el) {
	return el.value.match (/^\s*[$]?\s*\d+(\s*(,)?\s*\d+)*(\s*[.|,]?\s*\d+)?\s*[$]?\s*$/);
}
// ----------- 
// combo boxes 

function FE_valueis (el, m_l) {
	return (el.value == m_l)
}

