// LOAD SET
hide = true;
activeSub2 = false;
// FUNCTIONS
setAlpha = function(id, alpha) {
  var object = document.getElementById(id).style;
  object.opacity = (alpha / 100);
  object.MozOpacity = (alpha / 100);
  object.KhtmlOpacity = (alpha / 100);
  object.filter = 'alpha(opacity='+alpha+')';
}
showSub2 = function(id) {
	activeSub2 = document.getElementById(id);
	activeCat = document.getElementById('a_'+id.substring(4, id.length));
	activeSub2.style.display = 'block';
	activeSub2.onmousedown = function() {
    hide = false;
	}
	activeSub2.onmouseup = function() {
    hide = true;
	}
	activeCat.style.color = '#ecad78';
}
hideSub2 = function() {
  if (hide && activeSub2) {
    activeSub2.style.display = 'none';
    if (activeCat.className != 'actual') {
      activeCat.style.color = '#aaa';
    }
  }
}
hideAllSub2s = function() {
  var menuDivs = document.getElementById('menu').getElementsByTagName('div');
  for (i=0; i<menuDivs.length; i++) {
    if(menuDivs[i].id.substring(0,4) == 'sub2') {
      menuDivs[i].style.display = 'none';
    }
  }
}
document.onmousedown = function() {
  hideSub2();
}

