<!--	
	function FB_checkfields(cheform){
		var msg = "";
		var frmInProcess= document.forms[cheform].elements;
		var nowinp = "";

		switch(cheform){
			case "frm_create_profilo":
			case "frm_update_profilo":
				nowinp = frmInProcess["nome"].value;
				if(nowinp.replace(/\s/g,"") == "")
					msg += "- Name (required)\n";

				nowinp = frmInProcess["cognome"].value;
				if(nowinp.replace(/\s/g,"") == "")
					msg += "- Surname (required)\n";


				nowinp = frmInProcess["indirizzo"].value;
				if(nowinp.replace(/\s/g,"") == "")
					msg += "- Address (required)\n";

				nowinp = frmInProcess["citta"].value;
				if(nowinp.replace(/\s/g,"") == "")
					msg += "- Town (required)\n";

				nowinp = frmInProcess["provincia"].options[frmInProcess["provincia"].selectedIndex].value;
				if(nowinp.replace(/\s/g,"") == "")
					msg += "- County (required)\n";

				nowinp = frmInProcess["nazione"].options[frmInProcess["nazione"].selectedIndex].value;
				if(nowinp.replace(/\s/g,"") == "")
					msg += "- Country (required)\n";

				nowinp = frmInProcess["cap"].value;
				if(nowinp.replace(/\s/g,"") == ""){
					msg += "- Post code (required)\n";
				}
				/*
				else if(!isInteger(nowinp.replace(/\s/g,""))){
					msg += "- Cap (solo numeri)\n";
				}
				else if((nowinp.replace(/\s/g,"")).length != 5){
					msg += "- Cap (composto da cinque caratteri)\n";
				}
				*/

				nowinp = frmInProcess["tel"].value;
				if(nowinp.replace(/\s/g,"") == "")
					msg += "- Telephone (required)\n";

				nowinp = frmInProcess["email"].value;
				if(nowinp.replace(/\s/g,"") == ""){
					msg += "- Email (required)\n";
				}
				else if(!emailCheck(nowinp.replace(/\s/g,""))){
					msg += "- Email (valid email)\n";
				}		

				nowinp = frmInProcess["email_confirm"].value;
				if(nowinp.replace(/\s/g,"") == ""){
					msg += "- Confirm email (required)\n";
				}
				if(frmInProcess["email"].value != nowinp)
					msg += "- Confirm email (different from Email field)\n";

				nowinp = frmInProcess["password"].value;
				if(nowinp.replace(/\s/g,"") == "")
					msg += "- Password (required)\n";	

				nowinp = frmInProcess["password_confirm"].value;
				if(nowinp.replace(/\s/g,"") == ""){
					msg += "- Confirm password (required)\n";
				}
				if(frmInProcess["password"].value != nowinp)
					msg += "- Confirm password (different from Password field)\n";

				nowinp = frmInProcess["accetto_norme_contrattuali"];
				if(!nowinp.checked){
					msg += "- It is required to accept website rules and conditions\n";
				}				

				break;
			case "frm_rescue_pwd":
				nowinp = frmInProcess["email"].value;
				if(nowinp.replace(/\s/g,"") == ""){
					msg += "- Email (required)\n";
				}
				else if(!emailCheck(nowinp.replace(/\s/g,""))){
					msg += "- Email (valid email address)\n";
				}		

				break;
			case "frm_tessuto":
				nowinp = frmInProcess["nome_tessuto"];
				var flag_checked = false;
				if(nowinp.length){
					for(var icounter=0; icounter<nowinp.length; icounter++){
						if(nowinp[icounter].checked == true) flag_checked=true;
					}
				}
				else flag_checked = nowinp.checked;
				if(!flag_checked)
					msg += "- Please choose a fabric\n";
				break;
			case "frm_misure":
				nowinp = frmInProcess["collo"].value;
				if(nowinp.replace(/\s/g,"") == "")
					msg += "- Collar (required)\n";	
				else if(!isInteger(nowinp.replace(/\s/g,""))){
					msg += "- Collar (only numbers)\n";
				}

				nowinp = frmInProcess["spalle"].value;
				if(nowinp.replace(/\s/g,"") == "")
					msg += "- Shoulders (required)\n";	
				else if(!isInteger(nowinp.replace(/\s/g,""))){
					msg += "- Shoulders (only numbers)\n";
				}

				nowinp = frmInProcess["manica"].value;
				if(nowinp.replace(/\s/g,"") == "")
					msg += "- Sleeve (required)\n";	
				else if(!isInteger(nowinp.replace(/\s/g,""))){
					msg += "- Sleeve (only numbers)\n";
				}

				nowinp = frmInProcess["torace"].value;
				if(nowinp.replace(/\s/g,"") == "")
					msg += "- Chest (required)\n";	
				else if(!isInteger(nowinp.replace(/\s/g,""))){
					msg += "- Chest (only numbers)\n";
				}

				nowinp = frmInProcess["girovita"].value;
				if(nowinp.replace(/\s/g,"") == "")
					msg += "- Waist (required)\n";
				else if(!isInteger(nowinp.replace(/\s/g,""))){
					msg += "- Waist (only numbers)\n";
				}	

				nowinp = frmInProcess["lunghezza"].value;
				if(nowinp.replace(/\s/g,"") == "")
					msg += "- Length (required)\n";	
				else if(!isInteger(nowinp.replace(/\s/g,""))){
					msg += "- Length (only numbers)\n";
				}

				nowinp = frmInProcess["fianchi"].value;
				if(nowinp.replace(/\s/g,"") == "")
					msg += "- Hip (required)\n";
				else if(!isInteger(nowinp.replace(/\s/g,""))){
					msg += "- Hip (only numbers)\n";
				}	

				nowinp = frmInProcess["polso"].value;
				if(nowinp.replace(/\s/g,"") == "")
					msg += "- Wrist (required)\n";	
				else if(!isInteger(nowinp.replace(/\s/g,""))){
					msg += "- Wrist (only numbers)\n";
				}
				break;
			case "frm_colletto":
				nowinp = frmInProcess["colletto"];
				var flag_checked = false;
				if(nowinp.length){
					for(var icounter=0; icounter<nowinp.length; icounter++){
						if(nowinp[icounter].checked == true) flag_checked=true;
					}
				}
				else flag_checked = nowinp.checked;
				if(!flag_checked)
					msg += "- Please choose a collar\n";
				break;
			case "frm_polsini":
				nowinp = frmInProcess["tipo_polso"];
				var flag_checked = false;
				if(nowinp.length){
					for(var icounter=0; icounter<nowinp.length; icounter++){
						if(nowinp[icounter].checked == true) flag_checked=true;
					}
				}
				else flag_checked = nowinp.checked;
				if(!flag_checked)
					msg += "- Please choose a cuff\n";
				break;
			case "frm_vestibilita":
				nowinp = frmInProcess["vestibilita"];
				var flag_checked = false;
				if(nowinp.length){
					for(var icounter=0; icounter<nowinp.length; icounter++){
						if(nowinp[icounter].checked == true) flag_checked=true;
					}
				}
				else flag_checked = nowinp.checked;
				if(!flag_checked)
					msg += "- Please choose a fitting style\n";
				break;
			case "frm_rifiniture":
				nowinp = frmInProcess["rif_frontale"];
				var flag_checked = false;
				if(nowinp.length){
					for(var icounter=0; icounter<nowinp.length; icounter++){
						if(nowinp[icounter].checked == true) flag_checked=true;
					}
				}
				else flag_checked = nowinp.checked;
				if(!flag_checked)
					msg += "- Please choose a frontal finishing\n";

				nowinp = frmInProcess["rif_finta"];
				var flag_checked = false;
				if(nowinp.length){
					for(var icounter=0; icounter<nowinp.length; icounter++){
						if(nowinp[icounter].checked == true) flag_checked=true;
					}
				}
				else flag_checked = nowinp.checked;
				if(!flag_checked)
					msg += "- Please choose a flap finishing\n";

				nowinp = frmInProcess["taschino"].options[frmInProcess["taschino"].selectedIndex].value;
				if(nowinp.replace(/\s/g,"") == "")
					msg += "- Please choose a fitting for the pocket\n";

				nowinp = frmInProcess["asole"].options[frmInProcess["asole"].selectedIndex].value;
				if(nowinp.replace(/\s/g,"") == "")
					msg += "- Please choose a fitting for the buttonhole\n";

				break;
			case "frm_optional":
				nowinp = frmInProcess["bottoni"];
				var flag_checked = false;
				if(nowinp.length){
					for(var icounter=0; icounter<nowinp.length; icounter++){
						if(nowinp[icounter].checked == true) flag_checked=true;
					}
				}
				else flag_checked = nowinp.checked;
				if(!flag_checked)
					msg += "- It is necessary to choose a style of buttons\n";

				nowinp = frmInProcess["iniziali"].value;
				if(nowinp.replace(/\s/g,"") == ""){
					var selinp = frmInProcess["stile_iniziali"].options[frmInProcess["stile_iniziali"].selectedIndex].value;
					if(selinp != "no monograms"){
						msg += "- Please insert the monograms for the style chosen\n";					
					}
				}
				else if((nowinp.replace(/\s/g,"")).length > 3){
					msg += "- Max 3 charachters for the monograms\n";
				}
				else{
					var selinp = frmInProcess["stile_iniziali"].options[frmInProcess["stile_iniziali"].selectedIndex].value;
					if(selinp == "no monograms"){
						msg += "- It is necessary to choose a style for the embroidery of the initials\n";					
					}
					var selinp = frmInProcess["colore_iniziali"].options[frmInProcess["colore_iniziali"].selectedIndex].value;
					if(selinp == "no monograms"){
						msg += "- It is necessary to choose a colour for the initials\n";					
					}	
				}
				

				break;
			case "frm_spedizione":
				nowinp = frmInProcess["nazione"].value;
				if(nowinp.replace(/\s/g,"") == "")
					msg += "- Please choose a country for the delivery\n";

				nowinp = frmInProcess["colli"].value;
				if(nowinp.replace(/\s/g,"") == "")
					msg += "- Please specify a number of shirts wanted\n";

				nowinp = frmInProcess["indirizzo_spedizione"].value;
				if(nowinp.replace(/\s/g,"") == "")
					msg += "- Please insert delivery address\n";

				break;
			default:
				break;
		}
		
		if(msg != ""){
			msg = "Impossible to send this form.\nPlease check this fields\n\n" + msg;
			alert(msg);
			return false
		}
		else return true;
		/*
		else{
			alert("tutto ok");
			return false;
		}
		*/
	}
//-->