
function f_solo_letras(evt){ 
    var nav4 = window.Event ? true : false;
	var key = nav4 ? evt.which : evt.keyCode; 
	//return (key <= 13 || (key >= 65 && key <= 90) || (key >= 97 && key <= 122) || key == 32 || key == 241 || key == 209);
	return (key <= 13 || (key >= 65 && key <= 90) || (key >= 97 && key <= 122) || key == 32 || key == 241 || key == 209  || key == 225 || key == 233 || key == 237 || key == 243 || key == 250 || key == 193 || key == 201 || key == 205 || key == 211 || key == 218);
}

function Trimming(pStrCadena)
{
	while(pStrCadena.charAt(0)==' ')
		pStrCadena=pStrCadena.substring(1,pStrCadena.length);
	while(pStrCadena.charAt(pStrCadena.length-1)==' ')
		pStrCadena=pStrCadena.substring(0,pStrCadena.length-1);
	return pStrCadena;
}

function f_valida_email(pStrEMail)
{
    if (pStrEMail.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
        return true;
    else
        return false;
}

function f_enviar_contact_us(){
	var strNames = Trimming(document.getElementById("Contact_us_log_control1_txtName").value);
	var strEmail = Trimming(document.getElementById("Contact_us_log_control1_txtEmail").value);
	var strPhone = Trimming(document.getElementById("Contact_us_log_control1_txtPhone").value);
	var strText = Trimming(document.getElementById("Contact_us_log_control1_txtayuda").value);
	if(strNames==""){
		alert("Names are required.");
		document.getElementById("Contact_us_log_control1_txtName").focus();
		return false;
	}
	else if(strEmail==""){
		alert("E-mail is required.");
		document.getElementById("Contact_us_log_control1_txtEmail").focus();
		return false;
	}
	else if(!f_valida_email(strEmail)){
		alert("The e-mail is incorrect.");
		document.getElementById("Contact_us_log_control1_txtEmail").focus();
		return false;
	}
	else if(strPhone==""){
		alert("Phone is required.");
		document.getElementById("Contact_us_log_control1_txtPhone").focus();
		return false;
	}
	else if(strText==""){
		alert("Please write how can we help you.");
		document.getElementById("Contact_us_log_control1_txtayuda").focus();
		return false;
	}
	else return true;
}