function ValidateContestForm() {
	EmptyFields = "";

/*	checkString = document.contest.username.value;
	if (checkString == "" ) {		
		EmptyFields = EmptyFields + "A username is required.\n";
	}	
	regex = /[^A-Za-z0-9_]/
	if (regex.test(checkString) == true)	{
		EmptyFields = EmptyFields + "The username may consist of letters and numbers only.\n";
	}

	if (eval(document.contest.password)) {
		checkString = document.contest.password.value;
		if (checkString == "" ) {		
			EmptyFields = EmptyFields + "A password is required.\n";
		}	
		regex = /[^A-Za-z0-9_~!@#$%^&*+=|?]/
		if (regex.test(checkString) == true)	{
			EmptyFields = EmptyFields + "The password may consist of letters and numbers only.\n";
		}
	}
*/
	checkString = document.contest.Fname.value;
	if (checkString == "" ) {		
		EmptyFields = EmptyFields + "É preciso indicar o nome.\n";
	}	
	regex = /[^A-Za-zÀ-ÿ\.\-_ ]/
	if (regex.test(checkString) == true)	{
		EmptyFields = EmptyFields + "O primiero nome deve conter apenas letras, ', - ou espaço .\n";
	}
	
	checkString = document.contest.Lname.value;
	if (checkString == "" ) {		
		EmptyFields = EmptyFields + "É preciso indicar o sobrenome.\n";
	}	
	regex = /[^A-Za-zÀ-ÿ\.\-\'_ ]/
	if (regex.test(checkString) == true)	{
		EmptyFields = EmptyFields + "O sobrenome deve conter apenas letras, ', - ou espaço .\n";
	}
	
	checkString = document.contest.cpf.value;
	if (checkString == "" ) {		
		EmptyFields = EmptyFields + "É preciso indicar o seu CPF.\n";
	}else{
		regex = /^[0-9]{11}$/
		if (regex.test(checkString) != true)	{
			EmptyFields = EmptyFields + "CPF deve conter 11 dígitos.\n";
		}
	}
	
	checkString = document.contest.email.value;
	if (checkString == "" ) {		
		EmptyFields = EmptyFields + "É preciso indicar um eMail.\n";
	} else if ((checkString.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1) == false) {
		EmptyFields = EmptyFields + "O endereço de e-mail não é válido.\n";
	}
	
	checkString = document.contest.ddd.value;
	if (checkString == "" ) {		
		EmptyFields = EmptyFields + "É preciso indicar o DDD de sua região .\n";
	}	
	regex = /[^A-Za-z0-9\- ]/
	if (regex.test(checkString) == true)	{
		EmptyFields = EmptyFields + "Formato incorreto de DDD.\n";
	}
	
	
	checkString = document.contest.phone.value;
	if (checkString == "" ) {		
		EmptyFields = EmptyFields + "É preciso indicar o número de telefone.\n";
	}
	regex = /[^0-9]/
	if (regex.test(checkString) == true)	{
		EmptyFields = EmptyFields + "Número de telefone deve conter apenas números.\n";
	}
	
	checkString = document.contest.address.value;
	if (checkString == "" ) {		
		EmptyFields = EmptyFields + "É preciso indicar o Endereço.\n";
	}	
	regex = /[^A-Za-zÀ-ÿ\.\-\' ]/
	if (regex.test(checkString) == true)	{
		EmptyFields = EmptyFields + "Endereço deve conter letras, ', - ou espaço apenas.\n";
	}
	
	checkString = document.contest.addressnum1.value;
	if (checkString == "" ) {		
		EmptyFields = EmptyFields + "É preciso indicar o nº.\n";
	}	
	regex = /[^A-Za-z0-9\-]/
	if (regex.test(checkString) == true)	{
		EmptyFields = EmptyFields + "Número deve conter apenas números ou -.\n";
	}
	
	checkString = document.contest.city.value;
	if (checkString == "" ) {		
		EmptyFields = EmptyFields + "É preciso indicar a cidade.\n";
	}	
	regex = /[^A-Za-zÀ-ÿ\.\-\' ]/
	if (regex.test(checkString) == true)	{
		EmptyFields = EmptyFields + "Cidade deve conter apenas letras, -, ' ou espaço.\n";
	}
	
	checkString = document.contest.state.value;
	if (checkString == "" ) {		
		EmptyFields = EmptyFields + "É preciso indicar o Estado.\n";
	}	
	regex = /[^A-Za-zÀ-ÿ\.\-\' ]/
	if (regex.test(checkString) == true)	{
		EmptyFields = EmptyFields + "Estado deve conter  apenas  letras e espaço .\n";
	}
	
	checkString = document.contest.q2.value;
	if (checkString == "" ) {		
		EmptyFields = EmptyFields + "Você deve selecionar uma das duas opções de resposta.\n";
	}

//* Validate Date Field script- By JavaScriptKit.com

var monthfield=document.contest.birthmonth.value
var dayfield=document.contest.birthdate.value
var yearfield=document.contest.birthyear.value
if ((dayfield != "") || (monthfield != "") || (yearfield != "")) {
	var dayobj = new Date(yearfield, monthfield-1, dayfield)
	if ((dayobj.getMonth()+1!=monthfield)||(dayobj.getDate()!=dayfield)||(dayobj.getFullYear()!=yearfield)){
		EmptyFields = EmptyFields + "Data de nascimento inválida.\n"
	}
}


// SMS Checking
/*
if ( document.contest.optinsms.checked ) {
		cellNumber = document.contest.cell.value;
		cellCarrier = document.contest.carrier.value;
		if ( cellCarrier == "SELECT"){
			EmptyFields = EmptyFields + "Please select cell phone carrier.\n";
		}
		if ( cellNumber.length != 10){
			EmptyFields = EmptyFields + "Please enter a 10 digit cell phone number.\n";
		}
		regex = /^\d{10}$/
		if ( regex.test(cellNumber) == false){
			EmptyFields = EmptyFields + "Cell phone number must contain 10 digits.\n";
		}
		
	}

// End SMS Checking
	checkString = document.contest.province.value;
	if (checkString == "SELECT" ) {		
		EmptyFields = EmptyFields + "Please select a province.\n";
	}
*/	
	 if (EmptyFields != "") {
		alert(EmptyFields);
		return false;
	} else {
		return true;
	}
}