function cambiaColoreSfondo(idCampo) {
	n=document.getElementById(idCampo).value;
	switch(n) {
		case "1":
			document.getElementById(idCampo).style.backgroundColor = "#CC0000";
		break;
		case "2":
			document.getElementById(idCampo).style.backgroundColor = "#EE7F00";
		break;
		case "3":
			document.getElementById(idCampo).style.backgroundColor = "#FFED00";
		break;
		case "4":
			document.getElementById(idCampo).style.backgroundColor = "#006600";
		break;
		case "5":
			document.getElementById(idCampo).style.backgroundColor = "#3300FF";
		break;
		default:
			document.getElementById(idCampo).style.backgroundColor = "#444444";
		break;
	}
}

function cambio_pagina(p) {
	document.forms['entryform'].npagina.value = p;
	document.forms['entryform'].submit();
}

function apri_finestra(pagina) { 
	var id=window.open(pagina,'AP-GPM','height=300,width=550,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes'); 
	id.focus();
}

function apri_evento(pagina,w,h) {
	var idw=window.open(pagina,'evento','status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes, height='+h+',width='+w );
	idw.focus();
}

function Archivio (data,m){
	var iw=window.open('popuparchivionews.php?date=' + data + '&m=' + m,'Archivio','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=1,resizable=0,width=620,height=450,left=0,top=0');
    	iw.focus();
}

function apri_faq(idd) {
	var iw=window.open('risposta.php?id=' + idd,'FAQ','height=300,width=680,status=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=yes');
	iw.focus();
}

function cambio_paginafoto(p) {
	document.forms['paginafoto'].npagina.value = p;
	document.forms['paginafoto'].submit();
}

function cambio_categoriafoto(p) {
	document.forms['catfoto'].idcat.value = p;
	document.forms['catfoto'].submit();
}
function apri_credits(pagina,w,h) {
	var idw=window.open(pagina,'cartina','status=no,statusbar=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no, height='+h+',width='+w );
	idw.focus();
}
function entra_sito() {
	//document.forms['form1'].npagina.value = p;
	document.forms['form1'].submit();
}
