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

function gestisciOverflowPagina(e){    
    document.getElementById("pagina").style.display="block";
    //new Effect.Appear('pagina',{duration:1,from:0,to:1});
	var nAltezzaMax=document.getElementById("divColonnaSinistra").clientHeight;
	nAltezzaMax=(nAltezzaMax<document.getElementById("divColonnaDestra").clientHeight?document.getElementById("divColonnaDestra").clientHeight:nAltezzaMax);
    if(document.getElementById("pagina").clientHeight<nAltezzaMax)document.getElementById("pagina").style.height=nAltezzaMax+"px";
}
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;
}
Event.observe(window,'load', gestisciOverflowPagina);
