function TatunoPopup() {
  var pop_count = new Array();

  this.popup = function(id) {
    if(pop_count[id]) {
      pop_count[id]++;
    } else {
      pop_count[id] = 1;
    }
    if(pop_count[id] > 0) {
      document.getElementById(id).style.display = 'block';
    }
  }
  this.popdown = function(id) {
    pop_count[id]--;
    if(pop_count[id] == 0) {
      setTimeout(function(){if(pop_count[id] <= 0) document.getElementById(id).style.display = 'none';},100);
    }
  }
}
window.tpop = new TatunoPopup();
