var numberOfMenus=6;
var mwidth=Array(80,70,120,50,110,70,70);
var pxBetween=-1;
var imageHeight=17;

var bName = navigator.appName;
var bVer = parseInt(navigator.appVersion);

ie=0;
n=0;
if (bName == "Microsoft Internet Explorer") ie=1;
if (bName == "Netscape") n=1;

var numerotesto=1;
var fade_pos=0;
var fade_dir=1;

var testi=new Array();

testi[0]="Amalfi<i><b>N</b></i>et is a New Media Agency providing Internet services and supporting companies to define their digital identity: from web design of Internet sites to web communication and web marketing strategies, from<br>e-business consulting to<br>e-commerce solutions.";

testi[1]="Amalfi<b><i>N</i></b>et č una New Media Agency che offre servizi Internet, supportando le aziende nel definire la digital identity: dal web design dei siti Internet alle strategie di web communication e web marketing, dalla consulenza per l'e-business alle soluzioni per il commercio elettronico.";

testi[2]="Con le nostre competenze orizzontali offriamo servizi integrati che coprono l'intera <a href=javascript:aprifinestra()><u>catena del valore di Internet</u></a>. Possiamo soddisfare tutte le necessitā delle aziende, dalle soluzioni di connettivitā, allo sviluppo e implementazione delle applicazioni, alla pianificazione delle strategie di comunicazione e di business su Internet.";

testi[3]="Tutti i progetti che abbiamo sviluppato insieme ai nostri clienti: dai siti degli alberghi, su cui abbiamo un know how specifico, ai siti di aziende che operano in diversi settori.";

testi[4]="Cerchi noi?<br>Compila il <a href=sito.asp?m=40><u>modulo</u></a> per ricevere le informazioni che ti occorrono oppure vieni a trovarci nella nostra sede.";

testi[5]="Articoli, newsletter e approfondimenti per documentarti sul mondo dell'Information Technology ed aggiornarti su tutte le tematiche legate ad Internet, all'e-business, al web marketing.";

testi[6]="Visita il nostro sito in versione Flash per vedere una presentazione dinamica di Amalfi<i><b>N</b></i>et.<br>Se non hai il plug-in per visualizzare pagine in flash, scaricalo <a target=_blank href=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash><u>qui</u></a>.";

function fadeText()
{
  var t;
  var colors=new Array();
  colors[0]='000000';
  colors[1]='333333';
  colors[2]='666666';
  colors[3]='999999';
  colors[4]='CCCCCC';
  colors[5]='EEEEEE';
  colors[6]='FFFFFF';

  t="<table width=170 border=0 cellspacing=0 cellpadding=0><tr><td>";
  t=t+"<p align=left>";
  t=t+"<font face=Verdana size=1 color=#" + colors[fade_pos] + ">";
  t=t+testi[numerotesto];
  t=t+"</font></p></td></tr></table>";
  if (ie) testo.innerHTML=t;
  else
  {
    if (bVer<5)
    {
      document.testo.document.write(t);
      document.testo.document.close();
    }
    else document.getElementById("testo").innerHTML=t;
  }
  fade_pos=fade_pos+fade_dir;
  if (fade_pos<=0)
  {
    fade_pos=0;
    fade_dir=1;
    numerotesto=fade_num;
  }
  if (fade_pos<6) setTimeout("fadeText()",80);
  else            fade_pos=6;
}

function showText(num)
{
  if (showDescriptions)
    if (numerotesto!=num)
    {
      fade_dir=-1;
      fade_num=num;
      if (fade_pos>=6) fadeText();
    }
}

function makeNewsMenu(obj,nest)
{
  if (n)
  {
    if (bVer<5)
    {
      nest=(!nest) ? '':'document.'+nest+'.';	
      this.css=eval(nest+'document.'+obj);
    }
    else this.css=eval('document.getElementById("'+obj+'").style');
  }
  else this.css=eval('document.all.'+obj+'.style');
  if (n)
  {
    if (bVer<5) this.scrollHeight=this.css.document.height;
    else        this.scrollHeight=eval("document.getElementById('"+obj+"').offsetHeight");
  }
  else this.scrollHeight=eval('document.all.'+obj+'.offsetHeight');
  this.moveIt=b_moveIt;
  this.slideUp=b_slideUp;
  this.slideDown=b_slideDown;
  this.clipTo=b_clipTo;
  this.obj = obj + "Object";
  eval(this.obj + "=this");
}

function b_moveIt(x,y)
{
  this.x=x;
  this.y=y;
  this.css.left=this.x;
  this.css.top=this.y;
}

function b_clipTo(t,r,b,l)
{
  if ((n)&&(bVer<5))
  {
    this.css.clip.top=t;
    this.css.clip.right=r;
    this.css.clip.bottom=b;
    this.css.clip.left=l;
  }
  else this.css.clip="rect("+t+","+r+","+b+","+l+")";
}

function b_slideUp(ystop,moveby,speed,fn,wh)
{
  if(!this.slideactive)
  {
    if(this.y>ystop)
    {
      this.moveIt(this.x,this.y-moveby);
      eval(wh);
      setTimeout(this.obj+".slideUp("+ystop+","+moveby+","+speed+",'"+fn+"','"+wh+"')",speed);
    }
    else
    {
      this.slideactive=false;
      this.moveIt(0,ystop);
      eval(fn);
    }
  }
}

function b_slideDown(ystop,moveby,speed,fn,wh)
{
  if (!this.slideactive)
  {
    if (this.y<ystop)
    {
      this.moveIt(this.x,this.y+moveby);
      eval(wh);
      setTimeout(this.obj+".slideDown("+ystop+","+moveby+","+speed+",'"+fn+"','"+wh+"')",speed);
    }
    else
    {
      this.slideactive=false;
      this.moveIt(0,ystop);
      eval(fn);
    }
  }
}

function newsMenuInit()
{
  oTopMenu=new Array();
  somma=fromLeft;
  for(i=0;i<=numberOfMenus;i++)
  {
    oTopMenu[i]=new Array();
    oTopMenu[i][0]=new makeNewsMenu('divTopMenu'+i);
    oTopMenu[i][1]=new makeNewsMenu('divTopMenuBottom'+i,'divTopMenu'+i);
    oTopMenu[i][2]=new makeNewsMenu('divTopMenuText'+i,'divTopMenu'+i);
    oTopMenu[i][1].moveIt(0,imageHeight);
    oTopMenu[i][0].clipTo(0,mwidth[i],imageHeight,0);
    oTopMenu[i][0].moveIt(somma,fromTop);
    oTopMenu[i][0].css.visibility="visible";
    somma=somma+mwidth[i]+pxBetween;
  }
}

function topMenu(num)
{
  if (oTopMenu[num][1].y==imageHeight)
  {
    for(i=0;i<=numberOfMenus;i++) setTimeout('chiudi('+i+')',20);
    setTimeout('apri(' + num + ')' , 100);
    setTimeout('chiudi(' + num + ')' , 10000);
  }
  else if (oTopMenu[num][1].y==oTopMenu[num][2].scrollHeight+imageHeight)
  {
    chiudi(num);
  }
}

function apri(num)
{
  oTopMenu[num][1].slideDown(oTopMenu[num][2].scrollHeight+imageHeight,10,20,'oTopMenu['+num+'][0].clipTo(0,mwidth['+num+'],oTopMenu['+num+'][1].y,0)','oTopMenu['+num+'][0].clipTo(0,mwidth['+num+'],oTopMenu['+num+'][1].y,0)');
}
function chiudi(num)
{
  oTopMenu[num][1].slideUp(imageHeight,10,20,'oTopMenu['+num+'][0].clipTo(0,mwidth['+num+'],oTopMenu['+num+'][1].y,0)','oTopMenu['+num+'][0].clipTo(0,mwidth['+num+'],oTopMenu['+num+'][1].y,0)');
}
