function formSubmit(arrayCheck){
	
	var name	 		= document.getElementById("name");
	var surname			= document.getElementById("surname");
	var company			= document.getElementById("company");
	var from			= document.getElementById("from");
	var email	 		= document.getElementById("email");
	var requests 		= document.getElementById("requests");
	var email_reg_exp 	= /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
	var privacy 		= document.getElementById("privacy").checked;
	var colorKO			= "#F36E6E";
	
	if (name.value == "" || name.value == "undefined"){
		alert(arrayCheck["name"]);
		name.style.backgroundColor = colorKO;
		name.focus();
	}
	else if (surname.value == "" || surname.value == "undefined"){
		alert(arrayCheck["surname"]);
		surname.style.backgroundColor = colorKO;
		surname.focus();
	}
	else if (company.value == "" || company.value == "undefined"){
		alert(arrayCheck["company"]);
		company.style.backgroundColor = colorKO;
		company.focus();
	}
	else if (from.value == "" || from.value == "undefined"){
		alert(arrayCheck["from"]);
		from.style.backgroundColor = colorKO;
		from.focus();
	}
	else if (email.value == "" || email.value == "undefined"){
		alert(arrayCheck["email1"]);
		email.style.backgroundColor = colorKO;
		email.focus();
	}
	else if (email.value != "" && !email_reg_exp.test(email.value)){
		alert(arrayCheck["email2"]);
		email.style.backgroundColor = colorKO;
		email.value = '';
		email.focus();
	}
	else if (requests.value == "" || requests.value == "undefined"){
		alert(arrayCheck["requests"]);
		requests.style.backgroundColor = colorKO;
		requests.focus();
	}
	else if (privacy == false){
		alert(arrayCheck["privacy"]);
	}
	else{
		document.getElementById("contact").action = 'modules/Contatti/form.php';
		document.getElementById("contact").submit();
	}

}



function colorOK(field){
	var colorOK	= "#FFFFFF";
	if (field == "name")
		document.getElementById("name").style.backgroundColor = colorOK;
	if (field == "surname")
		document.getElementById("surname").style.backgroundColor = colorOK;
	if (field == "company")
		document.getElementById("company").style.backgroundColor = colorOK;
	if (field == "from")
		document.getElementById("from").style.backgroundColor = colorOK;
	if (field == "email")
		document.getElementById("email").style.backgroundColor = colorOK;
	if (field == "requests")
		document.getElementById("requests").style.backgroundColor = colorOK;
}
