// JavaScript Document

var Fuori=gFuori="";
function ApriGruppo(cosa, gruppo)
{
	if(cosa!=Fuori)
	{
		f=Fuori!=""?document.getElementById(Fuori).style:"";
		gf=gFuori!=""?document.getElementById(gFuori).style:"";
		Fuori!=""?f.display="none":null;
		gFuori!=""?gf.backgroundImage="url(images/chiuso.gif)":null;
		Fuori=cosa;
		gFuori=gruppo;
	}
	
	d=document.getElementById(cosa).style;
	g=document.getElementById(gruppo).style;
//	g.backgroundImage=d.display!="none"?"url(images/chiuso.gif)":"url(images/apertosu.gif)";
g.backgroundImage=d.display!="none"?"url(images/chiuso.gif)":"url(images/aperto.gif)";
	d.display=d.display!="none"?"none":"";
}

function Evidenza()
{
	x=window.open("evidenza.php","notice","resizable=no,menubar=no,locationbar=no,toolbar=no,statusbar=no,width=640,height=480");
	if(x)
		x.focus();
	
}
function Dimensiona()
{
		x=navigator.appName == 'Microsoft Internet Explorer'?document.body.clientWidth: window.innerWidth; //screen.availWidth;
		y=navigator.appName == 'Microsoft Internet Explorer'?document.body.clientHeight: window.innerHeight; //screen.availHeight;
		
		g=Math.ceil(14000/x)*1.5;
		if(document.getElementById("MnSx"))
		{
			document.getElementById("MnSx").style.width=g+"%";
		}
		if(document.getElementById("MnDx"))
		{
			document.getElementById("MnDx").style.width=g+"%";
		}
	l=x>1024?parseInt(x-1000)/2:0;
	document.getElementById("LySfondo").style.left=document.getElementById("titolino").style.left=(350+l)+"px";
	document.getElementById("layerfotosotto").style.left=document.getElementById("layerfoto").style.left=(280+l)+"px";
	document.getElementById("Layer2").style.left=(391+l)+"px";		
}

function Scrivi(testo, foto,sfondo, sopra)
{
	fs=document.getElementById("fotosopra");
	ft=document.getElementById("fotosotto");
	f=sopra=="fotosopra"?fs:ft;
	l=document.getElementById("LySfondo").style;
	l.backgroundColor="#"+sfondo;
	
	document.getElementById("titolino").innerHTML=testo;
	document.getElementById('contenuto').style.scrollbarBaseColor="#"+sfondo;
	

if(navigator.appName == 'Microsoft Internet Explorer' && foto.indexOf(".png")!=0)
{
	fs.style.filter=sopra=="fotosopra"?"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=image, src='"+foto+"');":"";
	ft.style.filter=sopra=="fotosopra"?"":"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=image, src='"+foto+"');";
f.src=foto;
f.width=1;
f.height=1;
	
}	
else
{
if(foto!=0 && f.src!=foto)
		f.src=foto;
}
	fs.style.display=sopra=="fotosopra"?"":"none";
	ft.style.display=sopra=="fotosopra"?"none":"";
}


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


function MostraLog()
{
	var x=window.open("admin/trylog.htm","full","resizable=yes,menubar=no,locationbar=no,toolbar=no,statusbar=no,width=250,height=150");
	x.moveTo((screen.availWidth-250)/2,(screen.availHeight-150)/2 );
	x.focus();
}

/*function Check_Images()
{
	for(x=1;x<parseInt(document.getElementById("cntImg").value);x++)
	{
		navigator.appName == 'Microsoft Internet Explorer'?document.getElementById("mnu"+x).style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=image, src='images/menu.png');":document.getElementById("mnu"+x).style.backgroundImage="url(images/menu.png);";
	}

}*/