function hidestories() {
  var divs=document.getElementById('stories').getElementsByTagName('div');
  for (j=0; j<divs.length; j++) {
    var rE = new RegExp("(^|\\s)" + 'story' + "(\\s|$)");
    if (rE.test(divs[j].className)) {
      divs[j].style.display="none";
    }
  }
}

function lowopacity() {
  var imgs=document.getElementById('immagini').getElementsByTagName('img');
  for (k=0; k<imgs.length; k++) {
    if (imgs[k].style.opacity==100) {
    imgs[k].style.opacity=0.25;
    imgs[k].style.border='3px solid #fff';
    imgs[k].filters.alpha.opacity=25;
    }
  }
}

function stories(first) {
  var thebuttons=document.getElementById('thebuttons').getElementsByTagName('a');
  var thebuttonstatus=document.getElementById('thebuttons').getElementsByTagName('div');
  for (i=0; i<thebuttons.length; i++) {
    thebuttons[i].onmouseover=function() {
      hidestories();
      var thestory=(this.href).split("#",2)[1];
      document.getElementById(thestory).style.display="block";
      document.getElementById(thestory+thestory).style.opacity=100;
      document.getElementById(thestory+thestory).style.border='3px solid #099705';
      document.getElementById(thestory+thestory).filters.alpha.opacity=100;
    }
    thebuttons[i].onmouseout=function() {
      hidestories();
      lowopacity();
      //return false;
    }
  }
  if (first) {
    var firstone=document.getElementById('stories').firstChild;
    if (firstone.nodeType != 1) {firstone = firstone.nextSibling;}
      firstone.style.display="block";
    }
}

function showafter() {
      document.getElementById('hidingAfter').style.display="block";
  
}

