
var LoadIcon = 
{
  init: function (data)
  {
    // Arguments
    if (typeof data == 'undefined') data = {};
    if (typeof data.img == 'undefined') data.img = './images/ajax-loader.gif';
    
    var div = document.createElement('div');
    div.style.position = 'absolute';
    div.style.zIndex = '1';
    div.setAttribute('id', 'loadIcon');
    
    var img = document.createElement('img');
    img.setAttribute('src', data.img);
    
    div.appendChild(img);
    document.body.appendChild(div);
    
    div.style.top = document.body.scrollTop + 'px';
    div.style.left = (document.body.offsetWidth + document.body.scrollLeft - (div.clientWidth * 2)) + 'px';
    document.getElementById('loadIcon').style.display = 'none';
    
    document.body.onscroll = function (event)
    {
      div.style.top = document.body.scrollTop + 'px';
      div.style.left = (document.body.offsetWidth + document.body.scrollLeft - (div.clientWidth * 2)) + 'px';
    }
    
    document.body.onresize = function (event)
    {
      div.style.top = document.body.scrollTop + 'px';
      div.style.left = (document.body.offsetWidth + document.body.scrollLeft - (div.clientWidth * 2)) + 'px';
    }
  }
};


