function Validate()
{    
    var focus = false;
    var msge = "";
    
    var txtFirstName = document.getElementById("txtFirstName");
    if(txtFirstName != null && trim(txtFirstName.value) == "")
    {
       msge = msge + "Please, enter your First Name.\r\n";
       if(focus == false)
       {
          focus = true;
          txtFirstName.focus();
       }
    }    
    
    var txtLastName = document.getElementById("txtLastName");
    if(txtLastName != null && trim(txtLastName.value) == "")
    {
       msge = msge + "Please, enter your Last Name.\r\n";
       if(focus == false)
       {
          focus = true;
          txtLastName.focus();
       }
    }    
                   
    var txtCity = document.getElementById("txtCity");
    if(txtCity != null && trim(txtCity.value) != "")
    {
        if(ValidateCity(trim(txtCity.value))==false)
        {
           msge = msge + "Please, enter a valid City.\r\n";
           if(focus == false)
           {
              focus = true;
              txtCity.focus();
           }
        }        
    }           
       
    var txtZipCode = document.getElementById("txtZipCode");
    if(txtZipCode != null && trim(txtZipCode.value) != "")    
    {
        if(ValidateZipCode(trim(txtZipCode.value))==false)
        {
           msge = msge + "Please, enter a valid ZipCode.\r\n";
           if(focus == false)
           {
              focus = true;
              txtZipCode.focus();
           }
        }        
    }
       
    var txtPhone = document.getElementById("txtPhone");
    if(txtPhone != null && trim(txtPhone.value) != "")
    {          
        if(ValidatePhone(trim(txtPhone.value))==false)
        {           
           msge = msge + "Please, enter a valid Phone.\r\n";
           if(focus == false)
           {
              focus = true;
              txtPhone.focus();
           }
        }    
    }
       
    var txtEmail = document.getElementById("txtEmail");    
    if(txtEmail != null && trim(txtEmail.value) == "")
    {
       msge = msge + "Please, enter your Email.\r\n";
       if(focus == false)
       {
          focus = true;
          txtEmail.focus();
       }
    }
    else
    {
        if(txtEmail != null && ValidateEmail(trim(txtEmail.value))==false)
        {
           msge = msge + "Please check your Email.\r\n";        
           if(focus == false)
           {
              focus = true;
              txtEmail.focus();
           }
        }
    }           
    
    if(msge == "")
       return true;
    else
    {
       alert(msge);
       return false;
    }
}

function trim(myString)
{
    return myString.replace(/^\s+/g,'').replace(/\s+$/g,'');
}

function ValidateName(name)
{    
	if(!ValidateCharacter(name) || !ValidateConsonants(name))
	    return false;
	else
	    return true;	
}

function ValidateCity(value)
{    
	if(!ValidateCharacter(value))
	    return false;
	else
	    return true;	
}

function ValidateZipCode(value)
{    
    var ValidChars = "0123456789";
    var IsCorrect=true;
    var Char;
	var incoming=value;
    var IsValid=false;
    
    for (cont = 0; cont < incoming.length && IsCorrect == true; cont++) 
    { 
        Char = incoming.charAt(cont); 
        if (ValidChars.indexOf(Char) == -1)
	        return false;
    }
    return true;	     
}

function ValidatePhone(value)
{    
    var ValidChars = "0123456789.()- ";
    var IsCorrect=true;
    var Char;
	var incoming=value;
    var IsValid=false;        
    
    for (cont = 0; cont < incoming.length && IsCorrect == true; cont++) 
    { 
        Char = incoming.charAt(cont); 
        if (ValidChars.indexOf(Char) == -1)
            return false;
    }
    return true;
}

function ValidateEmail(email) 
{	    
	if (/^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(email))
		return true;
	else
	    return false;
}

function ValidateCharacter(valor) 
{
    valor = valor.toLowerCase();
	if (/^[a-z ]+$/i.test(valor))
		return true;
	else
		return false;
}


function ValidateConsonants(valor) 
{
	   valor = valor.toLowerCase();
	if (/[áéíóúbcdfghjklmnpqrstvwxyz]{7}/.test(valor))
		return false;
	else
		return true;
}
