function aggiornaPagina(idCateg,foglia,idPagina,idContenuto){
    categ=idCateg;
    pagina=idPagina;
    contenuto=idContenuto;
    if(foglia!=1)foglia=0;
    changeCateg(idCateg,foglia);
}

function gestisciOverflowPagina(){    
    document.getElementById("divAttendi").style.display="none";
    document.getElementById("divPagina").style.display="block";
    if(document.getElementById("divPagina").clientHeight<document.getElementById("tdPagina").clientHeight)document.getElementById("divPagina").style.height=document.getElementById("tdPagina").clientHeight;
}
function iscriviNewsLetter(email,idForm){
	if((email!="")&&(email.indexOf("@")!=-1)){
	window.open("modelli/waiting.htm","iscrizioneNewsletter","width=300,height=200");
	document.getElementById(idForm).action="mail/newsletter.php?func=ins"
	document.getElementById(idForm).submit();
	}else{
		alert("Specificare un indirizzo email valido");
	}
}
function cancellaNewsLetter(email,idForm){
if((email!="")&&(email.indexOf("@")!=-1)){
	window.open("modelli/waiting.htm","iscrizioneNewsletter","width=300,height=200");
	document.getElementById(idForm).action="mail/newsletter.php?func=del"
	document.getElementById(idForm).submit();
	}else{
		alert("Specificare un indirizzo email valido");
	}
}
function mostraDiv(div){
	if(document.getElementById(div).style.display=="block"){
		document.getElementById(div).style.display="none";
	}else{
		document.getElementById(div).style.display="block";
	}
}

function navigaRisultatiSQL(nLimiteQueryInf){
	var sIndirizzo=window.location.href;
	if(sIndirizzo.indexOf("?")==-1)sIndirizzo+="?";
	if(sIndirizzo.indexOf("&nLimiteQueryInf")!=-1){
		sIndirizzo=sIndirizzo.substring(0,sIndirizzo.indexOf("&nLimiteQueryInf"))+
		(sIndirizzo.indexOf("&",sIndirizzo.indexOf("nLimiteQueryInf"))!=-1?sIndirizzo.substring(sIndirizzo.indexOf("&",sIndirizzo.indexOf("nLimiteQueryInf"))):"");
	}
	sIndirizzo+="&nLimiteQueryInf="+nLimiteQueryInf;
	window.location.href=sIndirizzo;
}
