(function () {

  window.PopUp = function () {
    this.id = '#popup-widget-container';
    this.elem = $(this.id);
    this.initEvents();
  };

  $.extend(PopUp.prototype, {
    initEvents: function () {
      var self = this;

      setTimeout(function () {
        self.elem.fadeIn();
      }, 500);

      $(document).ready(function () {
        $("a.close", this.elem).click(function (event) { self.close(event); });
      });
    },

    close: function (event) {
      event.preventDefault();
      this.elem.fadeOut();
    }
  });


  $(window).load(function () {
    if (window.location.hash == "#pop") {
      var popup = new PopUp();
    }
  });
})();

