
function ValidateData(theForm)
{
	if (theForm.FirstName.value == "")
	{
		alert('Please, enter your first name.');
		theForm.FirstName.focus();
		return (false);
	}
	
	if (theForm.LastName.value == "")
	{
		alert('Please, enter your last name.');
		theForm.LastName.focus();
		return (false);
	}

	if (theForm.EmailAddress.value == "")
	{
		alert('Please, enter your email.');
		theForm.EmailAddress.focus();
		return (false);
	}
	else
	{
		if(!ValidateEmail(theForm.EmailAddress.value))
		{
			alert("Please check the emails address");
			theForm.EmailAddress.focus();
			return false;
		}
	}

	if(theForm.Telephone.value != "" && !ValidateNumber(theForm.Telephone.value))
	{
		alert("Please check the telephone, enter only numbers.");
		theForm.Telephone.focus();
		return false;
	}

	return true
}

function ValidateNumber(valor) 
{
    if (/^\d*$/.test(valor))
        return true;
   else
        return false;
}

function ValidateEmail(valor) 
{
	if (/^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]{2,60}\.[a-zA-Z]{2,4}$/.test(valor))
		return true;
	else
		return false;
}



