// ---------------
// Header
// ---------------

function MenuAlto() {
  document.write("<TABLE WIDTH=90% BORDER=0 CELLSPACING=0 CELLPADDING=0 STYLE='margin-right:10px;margin-bottom:3px;'>");
  document.write("<TR><TD WIDTH=33% ALIGN=RIGHT VALIGN=TOP>");
  document.write("<A HREF='home.htm'>HOME</A><BR>");
  document.write("<A HREF='biografia.htm'>BIOGRAFIA</A><BR>");
  document.write("<A HREF='contatti.php'>CONTATTI</A><BR>");

  document.write("</TD><TD WIDTH=33% ALIGN=RIGHT VALIGN=TOP>");
  document.write("<A HREF='portfolio.htm'>PORTFOLIO</A><BR>");
  document.write("<A HREF='esposizioni.htm'>ESPOSIZIONI</A><BR>");
  document.write("<A HREF='recensioni.htm'>RECENSIONI</A><BR>");

  document.write("</TD><TD WIDTH=33% ALIGN=RIGHT VALIGN=TOP>");
  document.write("<A HREF='link.htm'>LINK</A><BR>");
  document.write("<A HREF='guestbook.php'>GUESTBOOK</A><BR>");
  document.write("<A HREF='news.htm'>NEWS</A>");

  document.write("</TD></TR></TABLE>");
}

// ---------------
// Stesura delle sezioni per esteso
// ---------------

function SezioniExt() {
  document.write("<TABLE WIDTH=600 BORDER=0 CELLSPACING=0 CELLPADDING=0>");
  t = sezioni.length; s = t - 1;
  colonna = 0; riga = 0;
  while (s > -1) {
    miniatura = sezioni[s][1];
    if (colonna == 0) document.write("<TR>");
    document.write("<TD ALIGN=CENTER VALIGN=TOP>");
    document.write("<A HREF='sezioni.htm?s="+s+"' STYLE='color:#E4BC74;'>");
    document.write("<IMG SRC='img/"+miniatura+"' WIDTH=100 HEIGHT=100 ALIGN='ABSMIDDLE' STYLE='border-color:#E4BC74;'>");
    document.write("<BR>"+sezioni[s][0]+"<BR>("+sezioni[s][2]+")</A><BR> <BR></TD>");
    if (colonna == 3) document.write("</TR>");
    colonna++; s--;
    if (colonna == 4) {
      colonna = 0;
      riga++;
    }
  }
  document.write("</TABLE>");
}

// ---------------
// Stesura della sezione selezionata
// ---------------

function Galleria(Sezione) {
  document.write("<TABLE WIDTH=700 BORDER=0 CELLSPACING=0 CELLPADDING=0 STYLE='margin-top:10px;margin-bottom:10px;'>");
  document.write("<TR><TD WIDTH=150 ALIGN=CENTER VALIGN=TOP STYLE='background:url(lay/riga.gif) repeat-y top right;'>");
  document.write("<H1>Sezioni</H1>");

  for (x=sezioni.length-1; x>-1; x--) {
    miniatura = sezioni[x][1];
    document.write("<A HREF='sezioni.htm?s="+x+"' STYLE='color:#E4BC74;'>");
    document.write("<IMG SRC='img/"+miniatura+"' WIDTH=50 HEIGHT=50 ALIGN='ABSMIDDLE' STYLE='border-color:#E4BC74;'>");
    document.write("<P CLASS='dida'>"+sezioni[x][0]+"<BR>("+sezioni[x][2]+")</P></A><BR>");
  }
  document.write("</TD>");
  document.write("<TD WIDTH=550 ALIGN=CENTER VALIGN=TOP>");
  titolo = sezioni[Sezione][0];
  anno = sezioni[Sezione][2];
  tipo = sezioni[Sezione][3];
  document.write("<H1>"+titolo+"<BR>("+anno+")</H1><H6>"+tipo+"</H6>");
  document.write("<TABLE WIDTH=550 BORDER=0 CELLSPACING=0 CELLPADDING=0>");
  colonna = 0; riga = 0;
  for (s=0; s<foto.length; s++) {
    sezf = foto[s][0];
    if (sezf == Sezione) {
      titfoto = foto[s][1];
      miniatura = foto[s][2];
      bigfoto = foto[s][3];
      if (colonna == 0) document.write("<TR>");
      document.write("<TD ALIGN=CENTER VALIGN=MIDDLE>");
      document.write("<A HREF='img/"+bigfoto+"' STYLE='color:#E4BC74;' rel='lightbox[bruni]' title='"+titfoto+"'>");
      document.write("<IMG SRC='img/"+miniatura+"' WIDTH=100 HEIGHT=100 ALIGN='ABSMIDDLE' STYLE='border-color:#E4BC74;'>");
      document.write("<BR>"+titfoto+"</A><BR> <BR></TD>");
      if (colonna == 3) document.write("</TR>");
      colonna++;
      if (colonna == 4) {
        colonna = 0;
        riga++;
      }
    }
  }
  document.write("</TABLE>");
   LinkExpo = sezioni[Sezione][4];
   document.write("<P STYLE='text-align:center;'><A STYLE='color:#E4BC74;font-weight:bold;' HREF='"+LinkExpo+"'>Qui trovi informazioni sulla serie che stai guardando ...</A></P>");
  document.write("</TD></TR></TABLE>");
}


// ---------------
// Riga di tabella con due foto laterali
// ---------------

function Riga2pic(ftesto, ffoto1, fdida1, flink1, fd1, ft1, ffoto2, fdida2, flink2, fd2, ft2) {

  document.write("<TR><TD WIDTH=120 ALIGN=CENTER VALIGN=CENTER>");
  if (ffoto1 == "") ffoto1 = "lay/trasp.gif";
  if (flink1 != "") {
    if (ft1 == "n") bersaglio = " TARGET='_new'";
    else bersaglio = "";
    if (ft1 == "f") bersaglio = " rel='lightbox' title='"+fdida1+"'";
    document.write("<A HREF='"+flink1+"'"+bersaglio+">");
    document.write("<IMG SRC='"+ffoto1+"' WIDTH=100 HEIGHT=100></A>")
  }
  else document.write("<IMG SRC='"+ffoto1+"' WIDTH=100 HEIGHT=100>")
  if (fdida1 != "") document.write("<P CLASS='dida'>"+fdida1+"</P>");

  document.write("</TD><TD WIDTH=460 ALIGN=LEFT VALIGN=TOP><P>"+ftesto+"</P>");
  
  document.write("</TD><TD WIDTH=120 ALIGN=CENTER VALIGN=CENTER>");
  if (ffoto2 == "") ffoto2 = "lay/trasp.gif";
  if (flink2 != "") {
    if (ft2 == "n") bersaglio = " TARGET='_new'";
    else bersaglio = "";
    if (ft2 == "f") bersaglio = " rel='lightbox' title='"+fdida2+"'";
    document.write("<A HREF='"+flink2+"'"+bersaglio+">");
    document.write("<IMG SRC='"+ffoto2+"' WIDTH=100 HEIGHT=100></A>")
  }
  else document.write("<IMG SRC='"+ffoto2+"' WIDTH=100 HEIGHT=100>")
  if (fdida2 != "") document.write("<P CLASS='dida'>"+fdida2+"</P>");

  document.write("</TD></TR>");
}

// ---------------
// Pedice
// ---------------

function Pedice() {
  document.write("<P CLASS='dida' STYLE='padding-top:5px;font-style:italic;'>");
  document.write("&copy Marco Bruni<BR>Le immagini ed i contenuti di questo sito sono protetti da Copyright, l'autore se ne riserva tutti i diritti.</P>");
}

