function initPage(field) 
{
field.focus();
}
	
function ResetColor(field)
{
	field.style.backgroundColor = "#FFFFFF";
}
function FocusAndColor(field)
{
	field.value = "";
	field.style.backgroundColor = "#FCADC1";
	field.focus();
}

function FillField(field)
{
	ResetColor(field);
	
	var chiffres = new RegExp("[éàçô:,()a-zA-Z0-9\\.\\-_\\s]");
	var verif;
	for(x = 0; x < field.value.length; x++)
	{
		verif = chiffres.test(field.value.charAt(x));
		if(verif == false){field.value = field.value.substr(0,x) + field.value.substr(x+1,field.value.length-x+1); x--;}
	}
}

function Email(field)
{
	ResetColor(field);
	
	var chiffres = new RegExp("[a-z0-9\\.\\-_@]");
	var verif;
	for(x = 0; x < field.value.length; x++)
	{
		verif = chiffres.test(field.value.charAt(x));
		if(verif == false){field.value = field.value.substr(0,x) + field.value.substr(x+1,field.value.length-x+1); x--;}
	}
}

function NumericOnlyPhone(field)
{
	ResetColor(field);
	
	var chiffres = new RegExp("[0-9+()]");
	var verif;
	for(x = 0; x < field.value.length; x++)
	{
		verif = chiffres.test(field.value.charAt(x));
		if(verif == false){field.value = field.value.substr(0,x) + field.value.substr(x+1,field.value.length-x+1); x--;}
	}
}

function NumericOnly(field)
{
	field.style.backgroundColor = "#FFFFFF";
	
	var chiffres = new RegExp("[0-9]");
	var verif;
	for(x = 0; x < field.value.length; x++)
	{
		verif = chiffres.test(field.value.charAt(x));
		if(verif == false){field.value = field.value.substr(0,x) + field.value.substr(x+1,field.value.length-x+1); x--;}
	}
	if (field.value == 0) {field.value = "";}
}

function NumericOnlyDot(field)
{
	field.style.backgroundColor = "#FFFFFF";
	
	var chiffres = new RegExp("[0-9.]");
	var verif;
	for(x = 0; x < field.value.length; x++)
	{
		verif = chiffres.test(field.value.charAt(x));
		if(verif == false){field.value = field.value.substr(0,x) + field.value.substr(x+1,field.value.length-x+1); x--;}
	}
	if (field.value == 0) {field.value = "";}
}

function SubmitForm() {

	if 	(
		(document.formInformation.nameLast.value == "") ||
		(document.formInformation.email.value == "") ||
		(document.formInformation.phone.value == "") ||
		(document.formInformation.gender[0].checked == false && document.formInformation.gender[1].checked == false && document.formInformation.gender[2].checked == false) ||
		(document.formInformation.information.value == "") ||
		(document.formInformation.country.value == "XX")
		)
	{
		if (document.formInformation.information.value == "")
		{
			FocusAndColor(document.formInformation.information);
		}
		if (document.formInformation.country.value == "XX")
		{
			FocusAndColor(document.formInformation.country);
		}
		if (document.formInformation.phone.value == "")
		{
			FocusAndColor(document.formInformation.phone);
		}	
		if (document.formInformation.email.value == "")
		{
			FocusAndColor(document.formInformation.email);
		}	
		if (document.formInformation.nameLast.value == "")
		{
			FocusAndColor(document.formInformation.nameLast);
		}	
		if (document.formInformation.gender[0].checked == false && document.formInformation.gender[1].checked == false && document.formInformation.gender[2].checked == false)
		{
			document.getElementById("genderCel").style.background="#FCADC1";
			document.formInformation.gender[0].focus();
		}	
	}
	else
	{
		mail = document.formInformation.email.value;
		var place = mail.indexOf("@",1);
		var point = mail.indexOf(".",place+1);

		if ((place > -1)&&(mail.length >2)&&(point > 1))
		{
			document.formInformation.submit();
			return(true);
		}
		else
		{
			FocusAndColor(document.formInformation.email);
			return(false);
		}
	}		
}