		function getCheckedValue(radioObj) {
			if(!radioObj)
				return 0;
			var radioLength = radioObj.length;
			if(radioLength == undefined)
				if(radioObj.checked)
					return radioObj.value;
				else
					return 0;
			for(var i = 0; i < radioLength; i++) {
				if(radioObj[i].checked) {
					return radioObj[i].value;
				}
			}
			return 0;
		}

		function check(){

		/*	doc = document.regform

			x=0;
			x=getCheckedValue(doc.prodotto);
			//alert(x);

			
			if(x==0){
				alert('Selezionare il prodotto da ordinare!');
				return false;
			}
*/


			doc = document.regform

			x = doc.prodotto.selectedIndex
			
			if(doc.prodotto.options[x].value == 0){
				alert('Selezionare il prodotto da ordinare!');
				return false;
			}

			if(doc.nome.value==""){
				alert('Il campo NOME è obbligatorio!');
				doc.nome.focus();
				return false;
			}

			if(doc.cognome.value==""){
				alert('Il campo COGNOME è obbligatorio!');
				doc.cognome.focus();
				return false;
			}

			if((doc.indirizzo.value=="")||(doc.indirizzo.value=="dove ricevere il prodotto")){
				alert('Il campo INDIRIZZO è obbligatorio!');
				doc.indirizzo.focus();
				return false;
			}

			if((doc.civico.value=="")||(doc.civico.value=="n°")){
				alert('Il campo N.CIVICO è obbligatorio!');
				doc.civico.focus();
				return false;
			}

			if(doc.citta.value==""){
				alert('Il campo CITTA\' è obbligatorio!');
				doc.citta.focus();
				return false;
			}

			if((doc.cap.value=="")||(isNaN(doc.cap.value))){
				alert('Il campo CAP è obbligatorio (numerico)!');
				doc.cap.focus();
				return false;
			}

			y = doc.prov.selectedIndex

			if(doc.prov.options[y].value == 0){
				alert('Selezionare una Provincia!');
				return false;
			}

			if((doc.telf.value=="")&&(doc.telm.value=="")){
				alert('E\' obbligatorio inserire il Tel. fisso o il Tel. mobile!');
				doc.telf.focus();
				return false;
			}

			if((doc.CodiceFiscale.value.length!=16)){
				alert('E\' obbligatorio inserire il Codice fiscale!');
				doc.telf.focus();
				return false;
			}

			if((doc.email.value=="")||(doc.email.value=="e-mail necessaria per conferma")){
				alert('Il campo E-MAIL è obbligatorio!');
				doc.email.focus();
				return false;
			}
			
			if((!doc.pagamento[0].checked) && (!doc.pagamento[1].checked)){
				alert('Il campo pagamento è obbligatorio!');
			return false;
			}
			
			if (doc.privacy.checked != true){
				alert('Per proseguire bisogna accettare l\'informativa sulla privacy!');
				return false;
			}
		}
