function MouseOver(i) {
	if (bPrint) {return}
	document.all.tags("H3")[i-1].style.backgroundColor="#A9E362";
	document.all.tags("IMG")[i*2-1].style.borderColor="white";
	document.all.tags("IMG")[i*2-1].style.filter="";
	document.all.tags("IMG")[i*2-2].src='images/n_link_h.gif';
	document.all.item("comp"+i).style.backgroundColor="#A9E362";
}	
function MouseOut(i) {
	if (bPrint) {return}
	document.all.tags("H3")[i-1].style.backgroundColor="#A9E362";
	document.all.tags("IMG")[i*2-1].style.borderColor="#A9E362";
	document.all.tags("IMG")[i*2-1].style.filter="Gqray()";
	document.all.tags("IMG")[i*2-2].src='images/n_link.gif';
	document.all.item("comp"+i).style.backgroundColor="A9E362";
}

function RowMouseOver(j) {
	if (bPrint || document.all.item("comp"+j).contains(event.fromElement)) {return}
//	alert('rowin');
	document.all.item("comp"+j).style.backgroundColor="#A9E362";
}
function RowMouseOut(j) {
	if (bPrint || document.all.item("comp"+j).contains(event.toElement)) {return}
 	document.all.item("comp"+j).style.backgroundColor="transparent";
}

function CompMouseOver(j) {
	if (bPrint) {return}
	document.all.item("comp"+j).cells(0).all.tags("IMG")[0].style.borderColor="white";
	document.all.item("comp"+j).cells(0).all.tags("IMG")[0].style.filter="";
	document.all.item("comp"+j).cells(1).all.tags("IMG")[0].src="images/n_link_sm_h.gif";
	document.all.item("comp"+j).cells(1).all.tags("B")[0].style.color="white";
	document.all.item("comp"+j).cells(1).all.tags("B")[0].style.textDecoration="underline";
	document.all.item("comp"+j).style.backgroundColor="#A9E362";
}

function CompMouseOut(j) {
	if (bPrint) {return}
	document.all.item("comp"+j).cells(0).all.tags("IMG")[0].style.borderColor="#A9E362";
	document.all.item("comp"+j).cells(0).all.tags("IMG")[0].style.filter="Grqay()";
	document.all.item("comp"+j).cells(1).all.tags("IMG")[0].src="images/n_link_sm.gif";
	document.all.item("comp"+j).cells(1).all.tags("B")[0].style.color="red";
	document.all.item("comp"+j).cells(1).all.tags("B")[0].style.textDecoration="none";
	document.all.item("comp"+j).style.backgroundColor="A9E362";
}

bNavBar=(window.parent.name=="GraphicNavBar");
bPrint=(window.location.search.indexOf('?stampa',0)>=0)

document.title="GSA - TEA: "+document.title;

if (bPrint) {
	document.write("<img src='images/logoprintnew.gif' style='position:absolute;left:0;top:0;z-index:10'>")
	document.write("<img src='images/writingprint.gif' style='position:absolute;left:310;top:0;z-index:10'>")
	document.styleSheets[0].href="print.css";
/*	fnt=document.all.tags("FONT");
	for (i=0;i<fnt.length;i++) {
		red=Math.max(eval("0x"+fnt[i].color.substr(1,2))-127,0);
		grn=Math.max(eval("0x"+fnt[i].color.substr(3,2))-127,0);
		blu=Math.max(eval("0x"+fnt[i].color.substr(5,2))-127,0);
		fnt[i].color=red*65536+grn*256+blu;
	}
*/
	img=document.all.tags("INPUT");
	for (i=0;i<img.length;i++) {
		if (img[i].className=="chgprint") {
			img[i].src=img[i].src.substr(0,img[i].src.length-4)+"_print.jpg";
//	alert(img[i].src.substr(0,img[i].src.length-4)+"_print.jpg");
		}
	}
}

if (!bNavBar && !bPrint) {

	if (document.title!="GSA - TEA: Novità") {
		document.write("<img src='images/logononav.jpg' style='position:absolute;left:0;top:0;z-index:10'>")
	}

//document.body.style.background="url('logononav.jpg') no-repeat fixed";


var cHighTop="#303090";
var cNormTop="#303090";
var cHighMid="#7070C0";
var cNormMid="#7070C0";
var cHighSub="#a0a0f0";
var cNormSub="#a0a0a0";

var mURL=1;
var mText=0;
var mHeight=2;
var mWidth=3;
var mMainKey=0;
var lnkHeight=19;
//var menuFirst=Array(Array("La società","societa.html"),Array("Sistemi","sistemi.html",Array("Prodotti","prodotti.html",Array("Area tecnica","tecnica.html"));

var menuSocieta=Array(
	 Array("La società","societa.html",5,80)
		,Array(
			 Array("Novità","index.html",1,0)
		)
		,Array(
			Array("Chi siamo","chisiamo.html",1,0)
		)
		,Array(
			Array("Case history","history.html",1,0)
		)
		,Array(
			Array("Mappa del sito","mappa.html",1,0)
		)
		,Array(
			Array("Contattaci","contattaci.html",1,0)
		)
	);

var menuSistemi=Array(
	 Array("Sistemi","sistemi.html",7,110)
		,Array(
			 Array("Controllo accessi<br>ambienti sportivi","sportivi.html",2,70)
			,Array("WINNER","sw_winner.html")
			//,Array("GYM 2002-NP","gym2002np.html")
			,Array("HOlimpo","sw_holimpo.html")
			//,Array("SI-Chip 2000","si-chip.html")
			,Array("Varchi meccanici","varchi.html")
			,Array("Prodotti hardware","hardware.html")
			,Array("Tessere e chip","tessere.html")
		)
		,Array(
			 Array("Controllo accessi<br>civile-industriale alberghiero","industriale.html",2,60)
			,Array("FK-Light L/A","fk-light.html")
			,Array("SI-FK001/A","si-fk001a.html")
			,Array("SI-FKL Camere","fk-lightb.html")
			,Array("SI-CRB","si-crb.html")
			,Array("SI-Iside","si-iside.html")
			,Array("SI-FK W/R Alberghiero","fk-lightw5.html")
			,Array("SI-Mensa","si-mensa.html")
			,Array("Costo permanenza","costo.html")
		)
		//,Array(
		//	 Array("Sistemi di<br>pagamento elettronico","pagamento.html",2,80)
		//	,Array("Money TML","moneytml.html")
		//	,Array("Mulmoney","mulmoney.html")
		//	,Array("PAT 2000/T","pat2000t.html")
		//	,Array("AT 2000","at2000.html")
		//	,Array("MEGA","scheda.html?mega")
		//	,Array("NICO","scheda.html?nico")
		//	,Array("NICOSHOP","scheda.html?nicoshop")
		//	,Array("TEX","scheda.html?tex")
		//	,Array("ESA","scheda.html?esa")
		//	,Array("GIOTTO","scheda.html?giotto")
		//	,Array("RAPID 2000 DM","scheda.html?rapid")
		//	,Array("MASTER","scheda.html?master")
		//)
		,Array(
			 Array("Sistemi di sicurezza","sicurezza.html",1,70)
			,Array("Antintrusione","sicurezza.html")
			,Array("Antincendio","sicurezza.html")
			,Array("TVCC","sicurezza.html")
			,Array("Gestione Accessi Aree Pubbliche","sicurezza.html")
		)
	);
var menuProdotti=Array(
	 Array("Prodotti","prodotti.html",1,100)
		,Array(
			 Array("Software","sportivi.html",1,70)
			,Array("WINNER","sw_winner.html")
			,Array("FitNext","sw_fitnext.html")
			,Array("HOlimpo","sw_holimpo.html")
			,Array("FK SW-10","si-fk001a.html")
			,Array("SW-CRB","si-crb.html")
			,Array("Iside","sw_iside.html")
			,Array("Mensa","si-mensa.html")
		)
		,Array(
			 Array("Software composizione corporea","software.html",1,70)
			,Array("FitNext","sw_fitnext.html")
			,Array("Plicometro","plicometro.html")
		)
		,Array(
			 Array("Hardware","hardware.html",1,70)
			,Array("FK-VBM8","scheda.html?fkvbm8")
			,Array("FK-LAR5","scheda.html?fklar5")
			,Array("FK-Lar15","scheda.html?fklar15")
			,Array("BX 601","bx601.html")
			,Array("LE.DS-D","scheda.html?ledsd")
			,Array("FK-1023-T2","scheda.html?fk1023")
			,Array("FK-MRS","scheda.html?fkmrs")
			,Array("FK-PLUS","scheda.html?fkplus")
			,Array("FK-001/A","scheda.html?fk001a")
			,Array("FK-001/CRB","scheda.html?fk001crb")
			,Array("FK-OCA/A","scheda.html?fkocaa")
			,Array("FKA5830","scheda.html?fka5830")
			,Array("CAMR/63","scheda.html?camr63")
			,Array("GSA-PASS","scheda.html?gsapass")
			,Array("LECH-01","scheda.html?lech01")
			,Array("LECHR-03","scheda.html?lechr03")
			,Array("FK-2348","scheda.html?fk2348")
			,Array("FKIO8","scheda.html?fkio8")
			,Array("A&63.GT1","scheda.html?ae63gt1")
			,Array("A&63.GT2","scheda.html?ae63gt2")
		)
		,Array(
			 Array("Meccanici","varchi.html",1,70)
			,Array("TR.3PV3","scheda.html?tr3pv3")
			,Array("TR.3PV3AC","scheda.html?tr3pv3ac")
			,Array("TR.ACC1","scheda.html?tracc1")
			,Array("TR.ELS1","scheda.html?trels1")
			,Array("TR.GI.A1","scheda.html?trgia1")
			,Array("GI.V6","scheda.html?giv6")
			,Array("GI.V5","scheda.html?giv5")
		)
		,Array(
			 Array("Tessere","tessere.html",1,90)
			,Array("Cards","scheda.html?cards")
			,Array("Portachiavi solo lettura","scheda.html?portachiavi")
			,Array("Tessere magnetiche","scheda.html?tessere")
			,Array("TAGS sola lettura","scheda.html?tags_ro")
			,Array("TAGS lettura/scrittura","scheda.html?tags_rw")
			,Array("Chip Card","scheda.html?chipcard")
		)
		,Array(
			 Array("Stampanti","stampanti.html",1,90)
			,Array("Datacard SP35","scheda.html?dc_sp35")
			,Array("Datacard SP55","scheda.html?dc_sp55")
			,Array("Datacard Select","scheda.html?dc_select")
			,Array("Datacard Magna","scheda.html?dc_magna")
			,Array("Datacard Ultima","scheda.html?dc_iciv")
			,Array("Eltron P310i","scheda.html?p310")
			,Array("Eltron P420i","scheda.html?p420")
			,Array("Materiale di consumo","scheda.html?materiali")
			,Array("Tessere plastiche","scheda.html?tes_pla")
			,Array("Service","scheda.html?service")
		)
	);

var menuTecnica=Array(
	Array("Area tecnica","tecnica.html",8,80)
		,Array(
			 Array("Manuali<br>software","manuali_sw.html",2,90)
			,Array("SI-CRB","man_sicrb.html")
			,Array("SI-Iside","man_iside.html")
			//,Array("GYM 2000-NP","man_gym2000.html")
			//,Array("SI-Chip","man_sichip.html")
		)
		,Array(
			 Array("Manuali<br>hardware","manuali_hw.html",2,110)
			,Array("Money-Chip 2000","man_moneychip.html")
			,Array("PAT 2000/T","man_pat2000t.html")
			,Array("AT 2000","man_at2000.html")
			,Array("GE-927B","man_ge927b.html")
			,Array("RI.TEA","man_ritea.html")
			,Array("DI-972A","man_di972a.html")
		)
		,Array(
			 Array("Schede tecniche<br>hardware","schede_hw.html",2,0)
		)
		,Array(
			 Array("Download e<br>aggiornamenti","download.html",2,150)
			,Array("Aggiornamento HOlimpo","update_holimpo.html")
			,Array("Demo HOlimpo","demo_holimpo.html")
		)
	);
var menu=Array(null,menuSocieta,menuSistemi,menuProdotti/*,menuTecnica*/);


var tMidState=new Array(null,0,0,0,0);
var tSubState=new Array(null,0,0,0,0,0,0,0);

var mAnimSpeed=50;
var mCloseDelay=3000;
var mClosed=0;
var mExpanding=1;
var mOpen=2;
var mCollapsing=3;

function MidAction(i) {
	if (tMidState[i]==mCollapsing) {
		MidCollapse(i,-((menu[i][mMainKey][mHeight]-1)*lnkHeight+3));
	}
	if (tMidState[i]==mExpanding) {
		MidExpand(i,lnkHeight+1);
	}
}

function MidOpen(i) {
var j;
//	alert("!!open");
	if (document.all.item("topmenu"+i).contains(event.fromElement)) {return}
//	if (tMidState[i]==mOpen) {return}
//	alert("open "+tMidState[i]);
	document.all.item("topkey"+i).style.backgroundColor=cHighTop;
	document.all.item("midmenu"+i).style.pixelTop=-((menu[i][mMainKey][mHeight]-1)*lnkHeight);
	document.all.item("midmenu"+i).style.display='block';
	for (j=1;j<menu.length;j++)	{
		if (j!=i) {
			if (tMidState[j]!=mClosed) {tMidState[j]=mCollapsing;MidAction(j);};
		}
	}
	tMidState[i]=mExpanding;
	MidAction(i);
//	setTimeout("MidScroll("+i+","+(lnkHeight+1)+")",mAnimSpeed);
}

function MidClose(i) {
	if (document.all.item("topmenu"+i).contains(event.toElement)) {return}
	document.all.item("topkey"+i).style.backgroundColor=cNormTop;
//	bMidExpand[i]=false;
	tMidState[i]=mCollapsing;
	setTimeout("MidAction("+i+")",mCloseDelay);
//	setTimeout("MidScroll("+i+",-"+((menu[i][mMainKey][mHeight]-1)*lnkHeight+3)+")",mAnimSpeed);
}

function MidCollapse(i,end) {
	if (tMidState[i]!=mCollapsing)	{return}
	itm=document.all.item("midmenu"+i).style;
	if (Math.abs(itm.pixelTop-end)<2) {
		itm.display='none';
		tMidState[i]=mClosed;
		return
	}
	itm.pixelTop+=Math.round((end-itm.pixelTop)/2);
	setTimeout("MidCollapse("+i+","+end+")",mAnimSpeed);
}


function MidExpand(i,end) {
	if (tMidState[i]!=mExpanding)	{return}
	itm=document.all.item("midmenu"+i).style;
	if (Math.abs(itm.pixelTop-end)<2) {
		tMidState[i]=mOpen;
		return
	}
	itm.pixelTop+=Math.round((end-itm.pixelTop)/2);
	setTimeout("MidExpand("+i+","+end+")",mAnimSpeed);
}

function SubOpen(i,j) {
var k;
	if (document.all.item("midtrap"+i+"_"+j).contains(event.fromElement)) {return}
	if (tMidState[i]==mCollapsing)	{tMidState[i]=mExpanding;MidAction(i);}
	document.all.item("midkey"+i+"_"+j).style.backgroundColor=cHighMid;
	document.all.item("submenu"+i+"_"+j).style.left="0%";
	document.all.item("submenu"+i+"_"+j).style.display='block';
	for (k=1;k<menu[i].length;k++)	{
		if (k!=j) {
			if (tSubState[k]!=mClosed) {tSubState[k]=mCollapsing;SubAction(i,k);}
		}
	}
	tSubState[j]=mExpanding;
	SubAction(i,j);
//	setTimeout("SubScroll("+i+","+j+",-"+(menu[i][j][mMainKey][mWidth]+7)+")",mAnimSpeed);
}

function SubClose(i,j) {
	if (document.all.item("midtrap"+i+"_"+j).contains(event.toElement)) {return}
	document.all.item("midkey"+i+"_"+j).style.backgroundColor=cNormMid;
	tSubState[j]=mCollapsing;
	setTimeout("SubAction("+i+","+j+")",mCloseDelay);
//	setTimeout("SubScroll("+i+","+j+",0)",mAnimSpeed);
}
function SubAction(i,j) {
	if (tSubState[j]==mCollapsing) {
		SubCollapse(i,j,0);
	}
	if (tSubState[j]==mExpanding) {
		SubExpand(i,j,-(menu[i][j][mMainKey][mWidth]));
	}

}
function SubCollapse(i,j,end) {
	if (tSubState[j]!=mCollapsing)	{return}
	itm=document.all.item("submenu"+i+"_"+j).style;
	nLeft=itm.left.substr(0,itm.left.length-2)+1-1;
	if (Math.abs(nLeft-end)<4) {
		itm.display='none';
		tSubState[j]=mClosed;
		return
	}
	nLeft+=Math.round((end-nLeft)/2);
	nClip=Math.round((-nLeft)/menu[i][j][mMainKey][mWidth]*100)+1;
	itm.clip="rect(0 "+(nClip)+"% auto 0)";
	itm.left=nLeft+"%";
	setTimeout("SubCollapse("+i+","+j+","+end+")",mAnimSpeed);
}
function SubExpand(i,j,end) {
	if (tSubState[j]!=mExpanding)	{return}
	itm=document.all.item("submenu"+i+"_"+j).style;
	nLeft=itm.left.substr(0,itm.left.length-2)+1-1;
	if (Math.abs(nLeft-end)<9) {
		tSubState[j]=mOpen;
		return
	}
	nLeft+=Math.round((end-nLeft)/2);
	nClip=Math.round((-nLeft)/menu[i][j][mMainKey][mWidth]*100)+8;
	itm.clip="rect(0 "+(nClip)+"% auto 0)";
	itm.left=nLeft+"%";
	setTimeout("SubExpand("+i+","+j+","+end+")",mAnimSpeed);
}


build="<a name='top' id='atop'>";
//build="";
for (i=1;i<menu.length;i++) { 
	build+="<div id='topmenu"+i+"' class='topmenu' style='left:"+(i*20-1)+"%' onmouseout='MidClose("+i+")'>";
	build+="<div id='topkey"+i+"' class='topkey' style='height:"+lnkHeight+"px;cursor:default' onmouseover='MidOpen("+i+")'>";
//	build+="<a class='nav' href='"+menu[i][mMainKey][mURL]+"'>"+menu[i][mMainKey][mText]+"</a></div>";
	build+="<b>"+menu[i][mMainKey][mText]+"</b></div>";

	midwdt=menu[i][mMainKey][mWidth];
	build+="<div id='midmenu"+i+"' class='midmenu' style='width:"+midwdt+"%;left:"+((100-midwdt)/2)+"%;top:"+lnkHeight+"px'>"
	tmptop=0;
	for (j=1;j<menu[i].length;j++) {
		build+="<div id='midtrap"+i+"_"+j+"' onmouseout='SubClose("+i+","+j+")' class='midtrap'>";
		tmphgt=menu[i][j][mMainKey][mHeight];
		build+="<div id='midkey"+i+"_"+j+"' class='midkey' style='top:"+(tmptop*lnkHeight)+"px;height:"+(tmphgt*lnkHeight)+"px' ";
		build+="onmouseover='SubOpen("+i+","+j+")'>";
		build+="<a class='nav' href='"+menu[i][j][mMainKey][mURL]+"'>"+menu[i][j][mMainKey][mText]+"</a></div>";
		subwdt=menu[i][j][mMainKey][mWidth];
		build+="<div id='submenu"+i+"_"+j+"' class='submenu' style='top:"+(tmptop*lnkHeight)+"px;width:"+subwdt+"%;left:-"+subwdt+"%;clip:rect(0 0 0 0)'>";
		tmptop+=tmphgt;

		for (k=1;k<menu[i][j].length;k++) {
			build+="<div id='subkey"+i+"_"+j+"_"+k+"' class='subkey' style='top:"+((k-1)*lnkHeight)+"px;height:"+lnkHeight+"px' ";
			build+="onmouseover='this.style.backgroundColor=\""+cHighSub+"\";if (tMidState["+i+"]=="+mCollapsing+")	{tMidState["+i+"]="+mExpanding+";MidAction("+i+");};if (tSubState["+j+"]=="+mCollapsing+") {tSubState["+j+"]="+mExpanding+";SubAction("+i+","+j+");}' onmouseout='this.style.backgroundColor=\""+cNormSub+"\"'>";
			build+="<a class='nav' href='"+menu[i][j][k][mURL]+"'>"+menu[i][j][k][mText]+"</a></div>";
		}
		build+="</div></div>";
	}
	build+="</div></div>";
}

document.write(build);



window.onscroll=WindowScroll;
window.onresize=WindowScroll;


function WindowScroll() {
	for(i=1;i<menu.length;i++) {
		document.all.item("topmenu"+i).style.top=document.body.scrollTop;
	}
}

//-----------------FINE PARTE NO-NAVBAR
}

//----------------------------------------------

if (bPrint) {
	build="<br><br><hr width=100% size=1 color=black><center><font color='#006000' style='font-size:9pt'>Copyright &copy;2001</font> <font color='#0080c0'><b>GSA - TEA s.r.l.</b></font> &nbsp; <font style='font-size:7pt'>via Palazzina - 36030 Caldogno (VI)</font><br><font style='font-size:7pt'><b>Uffici operativi:</b> via Palazzina - 36030 <font color='#400000'>Caldogno (VI)</font>  - tel. <font color='#004040'>0444-986382</font> fax <font color='#000040'>0444-986384</font> &nbsp; | &nbsp; via Pusiano 24 - 20132 <font color='#400000'>Milano</font></font><br><font color='202080' style='font-size:8pt'><b>www.gsa-tea.com</b></font> &nbsp; <font color='004080' style='font-size:8pt'>info@gsa-tea.com</font>";
} else {
	build="<br><table width=100% cellpadding=0 cellspacing=0 style='color:#90ffff;margin:0px'><tr class='bottomnav'><td width=30%>&nbsp;</td><td width=10%><a style='color:#ff4040' href='javascript:history.back()' onmouseover=\"nback.src='images/n_back_h.gif';this.style.color='white'\"  onmouseout=\"nback.src='images/n_back.gif';this.style.color='#ff4040'\"><img id='nback' src='images/n_back.gif' class='nav'>indietro</a></td><td width=10%><a style='color:#ff4040' href='javascript:atop.scrollIntoView()' onmouseover=\"ntop.src='images/n_top_h.gif';this.style.color='white'\"  onmouseout=\"ntop.src='images/n_top.gif';this.style.color='#ff4040'\"><img id='ntop' src='images/n_top.gif' class='nav'>inizio</a></td><td width=10%><a style='color:#ff4040' href='index.html' onmouseover=\"nhome.src='images/n_home_h.gif';this.style.color='white'\"  onmouseout=\"nhome.src='images/n_home.gif';this.style.color='#ff4040'\"><img id='nhome' src='images/n_home.gif' class='nav'>home</a></td><td width=10%><a style='color:#ff4040'  href='"+window.location+"?stampa' onmouseover=\"nprint.src='images/n_print_h.gif';this.style.color='white'\" onmouseout=\"nprint.src='images/n_print.gif';this.style.color='#ff4040'\"><img id='nprint' src='images/n_print.gif' class='nav'>stampa</a></td><td width=30%>&nbsp;</td></tr><tr><td style='row' colspan=6><br><hr width=100% size=1 color=white></td></tr><tr class='copy'><td align=center colspan=6 id='td_stats'>Copyright &copy;2001 <a href='contattaci.html'><font color=F79C13>GSA - TEA s.r.l.</font></a></td></tr></table>";
}
if (document.title!="GSA - TEA: Novità") {
	if (!bPrint)	{
		document.body.onload=tst;
	} else {
		document.all.tags("SPAN")[1].insertAdjacentHTML("beforeEnd",build);
	}
}


function tst() {
//	document.all.tags("SPAN")[0].insertAdjacentHTML("afterBegin","<a name='top' id='atop'><font size=1>.</font>");

	document.all.tags("SPAN")[1].insertAdjacentHTML("beforeEnd",build);
}


if (bPrint) {document.body.onload=window.print;}
//setInterval("document.all.idhomelink1.innerHTML=tSubState[1];",50);