// JavaScript Document

function RefreshImage(valImageId) {
	var objImage = document.images[valImageId];
	if (objImage == undefined) {
		return;
	}
	var now = new Date();
	objImage.src = objImage.src.split('?')[0] + '?x=' + now.toUTCString();
}


function check() {

var nome=document.getElementById("nome").value;
var cognome=document.getElementById("cognome").value;
var email=document.getElementById("email").value;
var iscritto=document.getElementById("iscritto").value;
var professione=document.getElementById("professione").value;
var settore=document.getElementById("settore");
var specializzazione=document.getElementById("specializzazione");
var provincia=document.getElementById("provincia");
/*var pcaptchacode=document.getElementById("captchacode");*/

var iscrivi=document.getElementById("subsc");
var cancella=document.getElementById("unsubsc");

var stato = false;
var stringa = "";

	if (nome == '') {
		stato = true;
		stringa = stringa + " - nome\n";
	}
	if (cognome == '') {
		stato = true;
		stringa = stringa + " - cognome\n";
	}	
	if (email == '') {
		stato = true;
		stringa = stringa + " - email\n";
	}
	if (professione == 0) {
		stato = true;
		stringa = stringa + " - professione\n";
	}
	if (provincia.value == "--") {
		stato = true;
		stringa = stringa + " - selezionare provincia\n";
	}
	if( stato != false) {
		window.alert("I seguenti campi sono obbligatori:\n\n" + stringa + "\n");
  		return false;
	}
	else {

/*	    if (pcaptchacode.value == '') {
		    window.alert("Attenzione!\nEffettuare il controllo caratteri per proseguire");
		    return false;
	    }
*/
  		if(cancella.checked) {
			if(confirm("Accetti le condizioni del disclaimer?")) {
				document.news.submit();
			}
			else {
				return false;
			}
		}
		else {
			document.news.submit();
		}
	}	
}

/*	if (professione != 0 && settore == "null")
	{
		stato = true;
		stringa = stringa + " settore\n";		
	}
	
	if (professione != 0 && specializzazione == "null")
	{
		stato = true;
		stringa = stringa + " specializzazione\n";	
	}
	
	if (professione != 0 && provincia == "null")
	{
		stato = true;
		stringa = stringa + " provincia\n";	
	}*/	

	
