function VerifyCheckBox(checkBoxElement)
{
	if (checkBoxElement.checked)	checkBoxElement.value = 'true';
	else checkBoxElement.value = 'false';
}

function ValidateDataContact(theForm)
{
	if (theForm.contactDate.value != "")
	{
		//alert('Test');		
		return (false);
	}

	if (theForm.requiredFirst_Name.value == "")
	{
		alert('Please, enter your first name.');
		theForm.requiredFirst_Name.focus();
		return (false);
	}

	if (theForm.requiredLast_Name.value == "")
	{
		alert('Please, enter your last name.');
		theForm.requiredLast_Name.focus();
		return (false);
	}
	
	if (theForm.phone.value != "")
	{
		if(!ValidatePhone(theForm.phone.value))
		{
			alert('Please, enter check your phone number.');
			theForm.phone.focus();
			return (false);
		}
	}
	
	if (theForm.requiredEmail.value == "")
	{
		alert('Please, enter your email.');
		theForm.requiredEmail.focus();
		return (false);
	}
	else
	{
		if(!ValidateEmail(theForm.requiredEmail.value))
		{
			alert("Please check the emails address");
			theForm.requiredEmail.focus();
			return false;
		}
	}
}

function ValidateEmail(valor) 
{
    if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(valor))
        return true;
    else
        return false;
}

function ValidatePhone(incoming)
{
    var ValidChars = "0123456789.()- ";
    var Char;
    for (cont = 0; cont < incoming.length; cont++) 
    { 
        Char = incoming.charAt(cont); 
        if (ValidChars.indexOf(Char) == -1)
        {
            return false;
        }
    }
    return true;
}