ns=(navigator.appName.indexOf('Netscape')!=-1)?1:0; //check del browser
var active=1;	// Tiene traccia dell'immagina attiva
var APERTO=0
function Init()
{
	// Precarica le immagini OnMouseOver
	var IMGsel1=new Image(); IMGsel1.src="images/img01_sel.gif";
	var IMGsel2=new Image(); IMGsel2.src="images/img02_sel.gif";
	var IMGsel3=new Image(); IMGsel3.src="images/img03_sel.gif";
	var IMGsel4=new Image(); IMGsel4.src="images/img09_sel.gif";
	var IMGsel5=new Image(); IMGsel5.src="images/img11_sel.gif";
	var IMGsel6=new Image(); IMGsel6.src="images/img06_sel.gif";
	var IMGsel7=new Image(); IMGsel7.src="images/img10_sel.gif";
	// Precarica le immagini OnClick
	var IMGact1=new Image(); IMGact1.src="images/img01_act.gif";
	var IMGact2=new Image(); IMGact2.src="images/img02_act.gif";
	var IMGact3=new Image(); IMGact3.src="images/img03_act.gif";
	var IMGact4=new Image(); IMGact4.src="images/img09_act.gif";
	var IMGact5=new Image(); IMGact5.src="images/img11_act.gif";
	var IMGact6=new Image(); IMGact6.src="images/img06_act.gif";
	var IMGact7=new Image(); IMGact7.src="images/img10_act.gif";	
	
	// Precarica le immagini OnClick
	var IMGmenu2=new Image(); IMGmenu2.src="images/foto_menu_02.gif";
	var IMGmenu3=new Image(); IMGmenu3.src="images/foto_menu_03.gif";
	var IMGmenu4=new Image(); IMGmenu4.src="images/foto_menu_04.gif";
	var IMGmenu5=new Image(); IMGmenu5.src="images/foto_menu_05.gif";
	
	if ( parent.inferiore6 )
		parent.inferiore6.location.href="html/titolo01.htm";
	if ( parent.inferiore9 )
		parent.inferiore9.location.href="html/centrale01.htm";
}

function OnMouseOver(img)
{	
	if (active!=img)	// Se non è attiva, mette l'immagine OnMouseOver
		document.images['Img0'+img].src="images/img0"+img+"_sel.gif";
}

function OnClick(img)
{
	if (active!=img)	// Se non è già attiva (altrimenti non deve fare nulla)
	{	
		if (active!=0)	// Se un'altra è già attiva, la disattiva (all'inizio potrebbero essere tutte disattive)
			document.images['Img0'+active].src="images/img0"+active+"_dis.gif";
		document.images['Img0'+img].src="images/img0"+img+"_act.gif";	// Mette l'immagine attiva
		if (img==9 || img==10 || img==11)
			document.images['Menu'].src="images/foto_menu_04.gif";	// Cambia l'immagine in alto
		else
			document.images['Menu'].src="images/foto_menu_0"+img+".gif";
		active=img;	// Tiene traccia di quella attiva
		if ( parent.inferiore6 )
			parent.inferiore6.location.href="html/titolo0"+img+".htm";
		if (parent.inferiore9)
			if (img==6)
				parent.inferiore9.location.href="news1/select.php";
			else
				parent.inferiore9.location.href="html/centrale0"+img+".htm";
	}
}

function OnMouseOut(img)
{
	if (active!=img)	// Se non è attiva, mette l'immagine OnMouseOut (altrimenti non deve fare nulla)
		 document.images['Img0'+img].src="images/img0"+img+"_dis.gif";
}

function initmenu()
{

	//Sistemazione dei div per il menu anche per Netscape ("Zamodany")
	if(ns)
	{
		
		document.div1.visibility='hide';
		document.div2.left=1;
		document.div2.top=270;
		document.div2.visibility='show';
	/*	document.div3.left=1;
		document.div3.top=290;
		document.div3.visibility='show';*/
		document.div4.left=25;
		document.div4.top=150;
		document.div4.visibility='show';
	}
	else
	{
		document.all['div1'].style.visibility='hidden';
		document.all['div2'].style.pixelLeft=0;
		document.all['div2'].style.pixelTop=175;
		document.all['div2'].style.visibility='visible';
/*		document.all['div3'].style.pixelLeft=0;
		document.all['div3'].style.pixelTop=195;
		document.all['div3'].style.visibility='visible';*/
	document.all['div4'].style.pixelLeft=4;
		document.all['div4'].style.pixelTop=285;
		document.all['div4'].style.visibility='visible';
//		alert(document.all['div1'].style.visibility)
	}

}

function Apri()
{
	if(APERTO==0)
	{
		if(ns)
		{
			document.div1.visibility='show';
			document.div1.left=1;
			document.div1.top=255;
			document.div2.left=0;
			document.div2.top=300;
//			document.div3.left=0;
//			document.div3.top=320;
			APERTO=1;
		}
		else
		{
			document.all['div1'].style.visibility='visible';
			document.all['div1'].style.pixelLeft=0;
			document.all['div1'].style.pixelTop=175;
			document.all['div2'].style.pixelLeft=0;
			document.all['div2'].style.pixelTop=235;
//			document.all['div3'].style.pixelLeft=0;
//			document.all['div3'].style.pixelTop=255;
			APERTO=1;
		}
	}
	else
	{
		initmenu();
		APERTO=0;
	}
}

function Chiudi()
{
	if(APERTO==1)
	{
		initmenu();
		APERTO=0
	}
}