// Funzione che cambia effettivamente lo stile
	
	function cambiaStile(vecchioid, nuovoid) {
		
		var quale=document.getElementById(vecchioid);
		if(quale!=null) {
			quale.id = nuovoid;
			return true;
		}
		else {
			quale = document.getElementById(nuovoid);
			quale.id = vecchioid;
			return true;
		}
	}

// Aprire una nuova finestra (con parametri)
function aprila(pth_pathfile, titolo, str_parametri)
{
	
	var finestra;
	var arrPar, strStrPara;
	// alt,lar,scroll,resiz,status,menu,toolb,locat
	
	arrPar = str_parametri.split(",");
	strStrPara = "height="+arrPar[0]+",width="+arrPar[1]+",scrollbars="+arrPar[2]+",resizable="+arrPar[3]+",status="+arrPar[4]+",menubar="+arrPar[5]+",toolbar="+arrPar[6]+",location="+arrPar[7];
	
	finestra=window.open(pth_pathfile,titolo,strStrPara)
	
	if(finestra != null){
		finestra.focus();
		return false;
	}
	else {
		alert("La pagina '"+titolo+"' viene visualizzata in una nuova finestra (popup window)\nLa preghiamo di consentire, sul suo browser, l'apertura di finestre popup.\n\n\nThe page '"+titolo+"' is displayed in a new popup window.\nPlease allow your browser to open it.\n");
		return false;
	}
}

// Chiedere conferma prima di chiudere una "FINESTRA" di modifiche
function confermaAnnulla() {
	if(confirm("Chiudere la finestra senza salvare le modifiche?")) {
		window.close();
		opener.focus();
		return true;
	}
	else { return false; }
}

function confermaElimina(paginaEliminazione) {
	if(confirm("Confermi l'eliminazione del dato?")) {
		document.location = paginaEliminazione;
		return true;
	}
	else { return false; }
}


function SaltaAPagina(objSelect) {
	location.href="default.asp?filter=mese&parametre="+objSelect.options[objSelect.selectedIndex].value;
	return true;
}


function VerificaCampiFRM(strcosa) {
    
    var str_MessaggioAlert = "Attenzione\n I seguenti campi, obbligatori, non sono stati compilati\n\n";
    var lung_mess = str_MessaggioAlert.length;
    
    switch(strcosa) {
    case "commento":
    	if(document.frm_snd_comment.txt_name.value == "" || document.frm_snd_comment.txt_name.value == null) {
      str_MessaggioAlert += "\t- Nome e cognome\n\n";
    	}
    	if(document.frm_snd_comment.txt_email.value == "" || document.frm_snd_comment.txt_email.value == null) {
      str_MessaggioAlert += "\t- Indirizzo email (obbligatorio ma non viene visualizzato agli utenti del blog)\n\n";
    	}
    	if(document.frm_snd_comment.strCAPTCHA.value == "" || document.frm_snd_comment.strCAPTCHA.value == null) {
      str_MessaggioAlert += "\t- Codice numerico di sicurezza\n\n";
    	}
    	if(document.frm_snd_comment.txta_commento.value == "" || document.frm_snd_comment.txta_commento.value == null) {
      str_MessaggioAlert += "\t- Testo del commento\n\n";
    	}
			    if (str_MessaggioAlert.length == lung_mess) {
			      document.frm_snd_comment.submit();
			      return true;
			    }
			    else {
			      alert(str_MessaggioAlert);
			      return false
			    }
    	break;
    
    case "autore":	
    	if(document.frm_mod_autori.txt_nome_aut.value == "" || document.frm_mod_autori.txt_nome_aut.value == null || document.frm_mod_autori.txt_cognome_aut.value == "" || document.frm_mod_autori.txt_cognome_aut.value == null ) {
      str_MessaggioAlert += "\t- Nome e cognome\n\n";
    	}
    	if(document.frm_mod_autori.txt_email_aut.value == "" || document.frm_mod_autori.txt_email_aut.value == null) {
      str_MessaggioAlert += "\t- Indirizzo email \n\n";
    	}
    	if(document.frm_mod_autori.txt_uname_aut.value == "" || document.frm_mod_autori.txt_uname_aut.value == null) {
      str_MessaggioAlert += "\t- Username \n\n";
    	}
    	if(document.frm_mod_autori.txt_pwd_aut.value == "" || document.frm_mod_autori.txt_pwd_aut.value == null) {
      str_MessaggioAlert += "\t- Password \n\n";
    	}
					if (str_MessaggioAlert.length == lung_mess) {
			      document.frm_mod_autori.submit();
			      return true;
			    }
			    else {
			      alert(str_MessaggioAlert);
			      return false
			    }
    	break;
    }
    
  }
  
function ChiudiEOpener(pagina) {
	opener.location = pagina;
	this.window.close();
	return true;	
}


function allerta(testo) {
	alert(testo);
	return true;
}

