// NAVIGATION TABLES DEFINITION

var i = 0;
var j = 0;
var k = 0;
var a;
var na;
var b;
var nb;
var tab;
var coordY;
var zeroX = 0;


/*
	Buckets.

	Format is:
		bucket label#bucket URL;

	To change the TAB display order,
	just change below and in TabServiceName array further!
*/
var TabBucket = new Array();
TabBucket[i++] = "";
TabBucket[i++] = "";
TabBucket[i++] = "";
TabBucket[i++] = "";
TabBucket[i++] = "";

i = -1; // RAZ for next use

/*
	Top Links.

	Format is:
		bucket number#top link label#top link URL#Pixel Inizial Position
*/
var TabTopLink = new Array();
TabTopLink[j++] = i + "#barSocieta#/' target='_top#17";
TabTopLink[j++] = i + "#barProdotti#/' target='_top#71";
TabTopLink[j++] = i + "#barSoluzioni#/' target='_top#122";
TabTopLink[j++] = i + "#barValori#/' target='_top#181";
TabTopLink[j++] = i + "#barProgetti#/' target='_top#320";
TabTopLink[j++] = i + "#barAreaRiservata#/' target='_top#425";
TabTopLink[j++] = i + "#barAreaDemo#/' target='_top#425";
TabTopLink[j++] = i + "#barContatti#/' target='_top#433";
TabTopLink[j++] = i + "#barNews#/' target='_top#506";

function show(i) {
	if(na == i) {
		clearTimeout(a);
	}

	StrTabTopLinkValue = TabTopLink[i].split("#");
	m = StrTabTopLinkValue[1];
	posLeft = StrTabTopLinkValue[3];

	if (i != -1) {
		if (document.layers) {
			document.layers[m].visibility="visible";
			document.layers[m].top=119;

			if (pos<450) {
				pos=parseInt(pos)+100;
			}
			document.layers[m].left=pos;
		}

		if (document.all) {
			posTop = 95;
			
			if (document.getElementById) {
				document.getElementById(m).style.visibility = "visible";
				document.getElementById(m).style.top = posTop;
				document.getElementById(m).style.left = posLeft;
			} else {
				document.all[m].style.visibility = "visible";
				document.all[m].style.top = posTop;
				document.all[m].style.left = posLeft;
			}
		}
	}

}

function showbis(i) {
	clearTimeout(a);

	StrTabTopLinkValue=TabTopLink[i].split("#");
	m=StrTabTopLinkValue[1];
	pos=StrTabTopLinkValue[3];

	if (i==0) {
	} else {
		if (document.layers) {
			document.layers[m].visibility="visible";
			document.layers[m].top=123;
			if (pos<450) {
				pos=parseInt(pos)+100;
			}
			document.layers[m].left=pos;
		}
		if (document.all) {
			document.all[m].style.visibility="visible";
			document.all[m].style.top=123;
			pos = parseInt(zeroX)+parseInt(pos);
			document.all[m].style.left=pos;
		} else alert(zeroX);
		if (document.getElementById) {
			document.getElementById(m).style.visibility="visible";
			document.getElementById(m).style.top=123;
			pos = parseInt(zeroX)+parseInt(pos);
			document.getElementById(m).style.left=pos;
		}
	}
	switchform("form1", "hidden");
}

function hide(m) {
	a = setTimeout("hidebis('"+m+"')",250);
	na=m;
}

function hidebis(i) {
	StrTabTopLinkValue = TabTopLink[i].split("#");
	m = StrTabTopLinkValue[1];

	if (i|=-1) {
		if (document.layers) {
			document.layers[m].visibility="hidden";
		}
		if (document.all) {
			if (document.getElementById) {
				document.getElementById(m).style.visibility="hidden";
			} else document.all[m].style.visibility="hidden";
		}
	}
}

function hide2(m) {
	b = setTimeout("hidebis2('"+m+"')", 750); //250
	nb=m;
}

function hidebis2(m) {
	if (document.layers) {
		document.layers[m].visibility="hidden";
	}
	if (document.all) {
		document.all[m].style.visibility="hidden";
	}
	if (document.getElementById) {
		document.getElementById(m).style.visibility="hidden";
	}
}

function show2(m) {
	if (nb==m)  {
		clearTimeout(b);
	}

	num=m.indexOf("_")
	nb=m.substring(num+1,m.length)
	nom=m.substring(0,num)

	for (i=0;i<tab.length;i++) {
		if (tab[i]==nom) {
			StrTabTopLinkValue=TabTopLink[i+1].split("#");
			pos=StrTabTopLinkValue[3];
		}
	}

	if (document.layers) {
		document.layers[m].visibility="visible";
		document.layers[m].top=119+nb*23;

		if (parseInt(pos)>450) {
			document.layers[m].left=parseInt(pos)+100;
		} else {
			document.layers[m].left=parseInt(pos)+295;
		}
	}

	if (document.all) {
		document.all[m].style.visibility="visible";
		document.all[m].style.top=122+parseInt(coordY[nb]);

		if (parseInt(pos)>500) {
			pos = parseInt(zeroX)+parseInt(pos);
			document.all[m].style.left=parseInt(pos)+100;
		} else {
			pos = parseInt(zeroX)+parseInt(pos);
			document.all[m].style.left=parseInt(pos)+125;
		}
	}

	if (document.getElementById) {
		document.getElementById(m).style.visibility="visible";
		document.getElementById(m).style.top=122+parseInt(coordY[nb]);

		if (parseInt(pos)>500) {
			pos = parseInt(zeroX)+parseInt(pos);
			document.getElementById(m).style.left=parseInt(pos)+100;
		} else {
			pos = parseInt(zeroX)+parseInt(pos);
			document.getElementById(m).style.left=parseInt(pos)+125;
		}
	}

	switchform("form1", "hidden");
}

function showbis2(m) {
	clearTimeout(b);

	num=m.indexOf("_")
	nb=m.substring(num+1,m.length)
	nom=m.substring(0,num)

	for (i=0;i<tab.length;i++) {
		if (tab[i]==nom) {
			StrTabTopLinkValue=TabTopLink[i+1].split("#");
			pos=parseInt(zeroX)+parseInt(StrTabTopLinkValue[3]);
		}
	}

	if (document.layers) {
		document.layers[m].visibility="visible";
		document.layers[m].top=119+nb*12;

		if (parseInt(pos)>450) {
			document.layers[m].left=parseInt(pos)+100;
		} else {
			document.layers[m].left=parseInt(pos)+295;
		}
	}

	if (document.all) {
		document.all[m].style.visibility="visible";
		document.all[m].style.top=119+nb*22;

		if (parseInt(pos)>500) {
			document.all[m].style.left=parseInt(pos)+100;
		} else {
			document.all[m].style.left=parseInt(pos)+110;
		}
	}

	if (document.getElementById) {
		document.getElementById(m).style.visibility="visible";
		document.getElementById(m).style.top=119+nb*22;

		if (parseInt(pos)>500) {
			document.getElementById(m).style.left=parseInt(pos)+100;
		} else {
			document.getElementById(m).style.left=parseInt(pos)+110;
		}
	}

	switchform("form1", "hidden");
}

function switchform(formname, value) {
	if (document.layers) {
		if ( document.layers[formname] != null )	document.layers[formname].visibility=value;
	}
	if (document.all) {
		if ( document.all[formname] != null ) document.all[formname].style.visibility=value;
	}
	if (document.getElementById) {
		if ( document.getElementById(formname) != null ) document.getElementById(formname).style.visibility=value;
	}
}

tab=new Array("barSocieta","barProdotti","barServizi","barUtenti");
coordY=new Array("4", "23", "", "61", "80");
