var overlej = {
      
      click_on_overlej_hide: false,

      show_loading_image: true,

      loading_image: "loading.gif",

      $: function(id){
            return document.getElementById(id);
      },

      init: function(){
            var ol_div = document.createElement("div");

            ol_div.id = "overlej";
            ol_div.style.display = "none";
            ol_div.onclick = (this.click_on_overlej_hide)? overlej.hide : null;

            if(this.show_loading_image){
                  var l_img = document.createElement("img");

                  l_img.src = this.loading_image;
                  l_img.style.position = "absolute";
                  l_img.style.top = (((window.innerHeight)? window.innerHeight : document.body.clientHeight) / 2) + "px";
                  l_img.style.left = (((window.innerWidth)? window.innerWidth : document.body.clientWidth) / 2) + "px";

                  ol_div.appendChild(l_img);
            }

            document.body.appendChild(ol_div);
      },

      show: function(){
            if(this.$("overlej")){
                  this.$("overlej").style.display = "";
            }
      },

      hide: function(){
            if(overlej.$("overlej")){
                  overlej.$("overlej").style.display = "none";
            }
      }

}