function validarCampoNoVacio(campo, mensaje) {
	if (campo == null || campo == "" || /^\s+$/.test(campo)) {
		alert(mensaje);
		return false;
	}
	return true;
}

function validarTelefono(telefono, mensaje) {
	telefono = telefono.replace(/\s+/g,'');
	var RegExPattern = /^\+?[0-9]/;
	if (!validarCampoNoVacio(telefono, mensaje)) {
		return false;
	}
	if (!telefono.match(RegExPattern) || telefono.length > 16) {
		alert(mensaje);
		return false;
	}
	return true;
}

function validarEmail(email, mensaje) {
	if (!validarCampoNoVacio(email, mensaje))
		return false;
	else {
		atPosicion = email.indexOf("@");
		puntoPosicion = email.lastIndexOf(".");
		if (atPosicion < 1 || puntoPosicion < atPosicion + 2
				|| puntoPosicion + 2 >= email.length) {
			alert(mensaje);
			return false;
		}
	}
	return true;
}
