/* Unobfuscate email address */

(function() {
  'use strict';

  function replace_link(event) {
    var new_node, parent_node,
      link = document.getElementById('mailhide');

    event.preventDefault();
    event.stopPropagation();

    parent_node = link.parentNode;
    new_node = document.createTextNode('vid');

    parent_node.insertBefore(new_node, link);
    parent_node.removeChild(link);
  }

  function set_up_listener() {
    var link = document.getElementById('mailhide');

    link.addEventListener('click', replace_link);
  }

  function show_info() {
    var warning_div = document.getElementById('warning_div');

    warning_div.className = 'hidden';
  }

  function set_up() {
    set_up_listener();
    show_info();
  }

  document.addEventListener('DOMContentLoaded', set_up);

}());
