function load() {
  {
    var divs = document.getElementsByTagName("div");
    if (divs.length > 0) {
      if (isHide()) {
        divs[0].style.display = "none";
      }
      var div = divs[0];
      var button = document.createElement('a');
      //button.setAttribute("onClick", "hide()");
      button.onclick = function () { hide(); };
      button.appendChild(document.createTextNode("x"));
      div.appendChild(button);
    }
  }
  {
    var divs = document.getElementsByTagName("div");
    if (divs.length > 0) {
      if (isHide()) {
        divs[divs.length - 1].style.display = "none";
      }
      var bottom = divs[divs.length - 1];
      var p = document.createElement('p');
      var button = document.createElement('a');
      //button.setAttribute("onClick", "hide()");
      button.onclick = function () { hide(); };
      button.appendChild(document.createTextNode("x"));
      p.appendChild(button);
      bottom.insertBefore(p, bottom.firstChild);
    }
  }
}

function isHide() {
  if (document.cookie == null) return false;
  var entries = document.cookie.split(';');
  for (var i = 0; i < entries.length; i++) {
    var entry = entries[i];
    var index = entry.indexOf('=');
    var key = entry.substring(0, index);
    var value = entry.substring(index + 1, entry.length);
    if (key.indexOf("hide") >= 0 && value.indexOf("true") >= 0) {
      return true;
    }
  }
  return false;
}

function hide() {
  {
    var divs = document.getElementsByTagName("div");
    if (divs.length > 0) {
      divs[0].style.display = "none";
    }
  }
  {
    var divs = document.getElementsByTagName("div");
    if (divs.length > 0) {
      divs[divs.length - 1].style.display = "none";
    }
  }
  document.cookie = "hide=true";
}
