
aImgFiles = new Array ("tree-plus.gif","tree-minus.gif","tree-box.gif","tree-gbox.gif","tree-dot.gif")
sImgFol   = "img/"

aoImgFiles=new Array(aImgFiles.length)
for (i=0;i<aImgFiles.length;i++) {
  aoImgFiles[i] = new Image()
  aoImgFiles[i].src = sImgFol + aImgFiles[i]
}

var MenuItems = new Array(
"135|1|id135.html|Introduzione",
"951|2|id951.html|Introduzione",
"136|1|id136.html|Ottobre",
"952|2|id952.html|Il primo giorno di scuola",
"953|2|id953.html|Il nostro maestro",
"954|2|id954.html|Una disgrazia",
"955|2|id955.html|Il ragazzo calabrese",
"956|2|id956.html|I miei compagni",
"957|2|id957.html|Un tratto generoso",
"958|2|id958.html|La mia maestra di prima superiore",
"959|2|id959.html|In una soffitta",
"960|2|id960.html|La scuola",
"961|2|id961.html|Il piccolo patriotta padovano",
"137|1|id137.html|Novembre",
"962|2|id962.html|Lo spazzacamino",
"963|2|id963.html|Il giorno dei morti",
"964|2|id964.html|Il mio amico Garrone",
"965|2|id965.html|Il carbonaio e il signore",
"966|2|id966.html|La maestra di mio fratello",
"967|2|id967.html|Mia madre",
"968|2|id968.html|Il mio compagno Coretti",
"969|2|id969.html|Il Direttore",
"970|2|id970.html|I soldati",
"971|2|id971.html|Il protettore di Nelli",
"972|2|id972.html|Il primo della classe",
"973|2|id973.html|La piccola vedetta lombarda",
"974|2|id974.html|I poveri",
"138|1|id138.html|Dicembre",
"975|2|id975.html|Il trafficante",
"976|2|id976.html|Vanità",
"977|2|id977.html|La prima nevicata",
"978|2|id978.html|Il muratorino",
"979|2|id979.html|Una palla di neve",
"980|2|id980.html|Le maestre",
"981|2|id981.html|In casa del ferito",
"982|2|id982.html|Il piccolo scrivano fiorentino",
"983|2|id983.html|La volontà",
"984|2|id984.html|Gratitudine",
"139|1|id139.html|Gennaio",
"985|2|id985.html|Il maestro supplente",
"986|2|id986.html|La libreria di Stardi",
"987|2|id987.html|Il figliuolo del fabbro ferraio",
"988|2|id988.html|Una bella visita",
"989|2|id989.html|I funerali di Vittorio Emanuele",
"990|2|id990.html|Franti, cacciato dalla scuola",
"991|2|id991.html|Il tamburino sardo",
"992|2|id992.html|L'amor di patria",
"993|2|id993.html|Invidia",
"994|2|id994.html|La madre di Franti",
"995|2|id995.html|Speranza",
"140|1|id140.html|Febbraio",
"996|2|id996.html|Una medaglia ben data",
"997|2|id997.html|Buoni propositi",
"998|2|id998.html|Il vaporino",
"999|2|id999.html|Superbia",
"1000|2|id1000.html|I feriti del lavoro",
"1001|2|id1001.html|Il prigioniero",
"1002|2|id1002.html|L'infermiere di Tata",
"1003|2|id1003.html|L'officina",
"1004|2|id1004.html|Il piccolo pagliaccio",
"1005|2|id1005.html|L'ultimo giorno di carnevale",
"1006|2|id1006.html|I ragazzi ciechi",
"1007|2|id1007.html|Il maestro malato",
"1008|2|id1008.html|La strada",
"141|1|id141.html|Marzo",
"1009|2|id1009.html|Le scuole serali",
"1010|2|id1010.html|La lotta",
"1011|2|id1011.html|I parenti dei ragazzi",
"1012|2|id1012.html|Il numero 78",
"1013|2|id1013.html|Un piccolo morto",
"1014|2|id1014.html|La vigilia del 14 marzo",
"1015|2|id1015.html|La distribuzione dei premi",
"1016|2|id1016.html|Litigio",
"1017|2|id1017.html|Mia sorella",
"1018|2|id1018.html|Sangue romagnolo",
"1019|2|id1019.html|Il muratorino moribondo",
"1020|2|id1020.html|Il conte Cavour",
"142|1|id142.html|Aprile",
"1021|2|id1021.html|Primavera",
"1022|2|id1022.html|Re Umberto",
"1023|2|id1023.html|L'asilo infantile",
"1024|2|id1024.html|Alla ginnastica",
"1025|2|id1025.html|Il maestro di mio padre",
"1026|2|id1026.html|Convalescenza",
"1027|2|id1027.html|Gli amici operai",
"1028|2|id1028.html|La madre di Garrone",
"1029|2|id1029.html|Giuseppe Mazzini",
"1030|2|id1030.html|Valor civile",
"143|1|id143.html|Maggio",
"1031|2|id1031.html|I bambini rachitici",
"1032|2|id1032.html|Sacrificio",
"1033|2|id1033.html|L'incendio",
"1034|2|id1034.html|Dagli Appennini alle Ande (parte prima)",
"1035|2|id1035.html|Dagli Appennini alle Ande (parte seconda)",
"1036|2|id1036.html|Estate",
"1037|2|id1037.html|Poesia",
"1038|2|id1038.html|La sordomuta",
"144|1|id144.html|Giugno",
"1039|2|id1039.html|Garibaldi",
"1040|2|id1040.html|L'esercito",
"1041|2|id1041.html|Italia",
"1042|2|id1042.html|32 gradi",
"1043|2|id1043.html|Mio padre",
"1044|2|id1044.html|In campagna",
"1045|2|id1045.html|La distribuzione dei premi agli operai",
"1046|2|id1046.html|La mia maestra morta",
"1047|2|id1047.html|Grazie",
"1048|2|id1048.html|Naufragio",
"145|1|id145.html|Luglio",
"1049|2|id1049.html|L'ultima pagina di mia madre",
"1050|2|id1050.html|Gli esami",
"1051|2|id1051.html|L' ultimo esame",
"1052|2|id1052.html|Addio");

function openNode(getId) {
  if (document.getElementById && navigator.userAgent.indexOf("Opera") == -1){
    for (var i = 0; i < MenuItems.length; i++) {
      data = MenuItems[i].split("|");
      if(data[1] == "1" && data[0] != getId){
        document.getElementById(data[0]).style.display = "none";
        document.images["pic_" + data[0]].src = sImgFol + aImgFiles[0];
      }
      if(data[1] == "1" && data[0] == getId){
        document.getElementById(data[0]).style.display = "block";
        document.images["pic_" + data[0]].src = sImgFol + aImgFiles[1];
      }
    }
  }                                           
  else {
     splitUrl = this.location.href.split("?");
     document.location = splitUrl[0] + '?' + getId;
  }  
}

function writemenu(current) {
  if(document.getElementById && navigator.userAgent.indexOf("Opera") == -1){
    document.write('<table border="0" cellpadding="0" cellspacing="0">');
    for (var i = 0; i < MenuItems.length; i++) {
      data = MenuItems[i].split("|");
      if(data[1] == "1"){
        var nodeId = data[0];
        document.write('<tr><td><img src="' + sImgFol + aImgFiles[4] + '" width="4" height="1" alt=""></td><td valign="top">');
        document.write('<a href="javascript:openNode(\'' + data[0] + '\');">');
        document.write('<img src="' + sImgFol + aImgFiles[0] + '" NAME="pic_' + data[0] + '" width="9" height="12" alt="" border="0"></a>')
        document.write('<img src="' + sImgFol + aImgFiles[4] + '" width="4" height="1" alt=""></td>');
        document.write('<td id="testo"><a class="nol" href="javascript:openNode(\'' + data[0] + '\');"><font color="#000000">' + data[3] + '</font></a></td>');
        document.write('</tr><tr><td colspan="3" height="3"></td></tr>');
        document.write('<tr><td colspan="2"></td><td>')
        document.write('<span id="' + data[0] + '" style="display: none"><table border="0" cellpadding="0" cellspacing="0">');
        if (current && current == data[0]) {
           var startOpen = nodeId;
        }
      }
      else {
        document.write('<tr><td valign="top">');
        if (current && current == data[0]) {
           document.write('<img src="' + sImgFol + aImgFiles[3] + '" width="9" height="12" alt="" border="0">');
           var startOpen = nodeId;
        }
        else {
           document.write('<img src="' + sImgFol + aImgFiles[2] + '" width="9" height="12" alt="" border="0">');
        }
        document.write('<img src="' + sImgFol + aImgFiles[4] + '" width="4" height="1" alt=""></td>');
        document.write('<td><img src="' + sImgFol + aImgFiles[4] + '" width="4" height="1" alt=""></td>');
        document.write('<td id="testo"><a class="nol" href="' + data[2] + '"><font color="#000000">' + data[3] + '</font></a></td></tr>');
        document.write('<tr><td colspan="3" height="4"></td></tr>');
        var j = i+1;
        if (j < MenuItems.length) {
          dataNextLine = MenuItems[j].split("|");
          if(dataNextLine[1] == "1"){
            document.write('</table></span></td></tr>');
          }
        }
        else {
          document.write('</span>');
        }
      }
    }
    document.write('</table></tr></td></table>');
    if (startOpen) {
       openNode(startOpen);
    }
  }
  else {
    if(location.href.indexOf('?') != -1) {
       splitUrl = this.location.href.split("?");
    }
    else {
       var splitUrl = new Array (null, null);
    }
    document.write('<table border="0" cellpadding="0" cellspacing="0">');
    for (var i = 0; i < MenuItems.length; i++) {
      data = MenuItems[i].split("|");
      if(data[1] == "1"){
        var nodeId = data[0];
        document.write('<tr><td><img src="' + sImgFol + aImgFiles[4] + '" width="4" height="1" alt=""></td>\n<td valign="top">');
        document.write('<a href="javascript:openNode(\'' + data[0] + '\');">');
        document.write('<img src="' + sImgFol + aImgFiles[0] + '" NAME="pic_' + data[0] + '" width="9" height="12" alt="" border="0"></a>')
        document.write('<img src="' + sImgFol + aImgFiles[4] + '" width="4" height="1" alt=""></td>\n');
        document.write('<td id="testo"><a class="nol" href="javascript:openNode(\'' + data[0] + '\');"><font color="#000000">' + data[3] + '</font></a></td>\n</tr>');
        document.write('<tr><td colspan="3" height="3"></td></tr>');
        document.write('<tr><td colspan="2"></td><td>');
        if (splitUrl[1] == nodeId) {
           document.write('<table border="0" cellpadding="0" cellspacing="0">');
        }
        if (current && current == data[0]) {
           var startOpen = nodeId;
        }
      }
      else if (splitUrl[1] == nodeId) {
        document.write('<tr><td valign="top">');
        if (current && current == data[0]) {
           document.write('<img src="' + sImgFol + aImgFiles[3] + '" width="9" height="12" alt="" border="0">');
           var startOpen = nodeId;
        }
        else {
           document.write('<img src="' + sImgFol + aImgFiles[2] + '" width="9" height="12" alt="" border="0">');
        }
        document.write('<img src="' + sImgFol + aImgFiles[4] + '" width="4" height="1" alt=""></td>');
        document.write('<td><img src="' + sImgFol + aImgFiles[4] + '" width="4" height="1" alt=""></td>');
        document.write('<td id="testo"><a class="nol" href="' + data[2] + '"><font color="#000000">' + data[3] + '</font></a></td></tr>');
        document.write('<tr><td colspan="3" height="4"></td></tr>');
        var j = i+1;
        if (j < MenuItems.length) {
          dataNextLine = MenuItems[j].split("|");
          if(dataNextLine[1] == "1"){
            document.write('</table></td></tr>');
          }
        }
        else {
            document.write('</table></td></tr>');
        }
      }
      else {
        if (current && current == data[0]) {
           var startOpen = nodeId;
        }
      }
    }
    document.write('</table>');
    if (startOpen && splitUrl[1] == null) {
      openNode(startOpen);
    }
  }
}
 


