var SiteShell = new Object();
SiteShell.Version = "0.4";

// -------------
//  COMPONENTS
// -------------
SiteShell.Components = new Object();

//--------------
// SITE LOADER
//--------------
SiteShell.Loader = new Object();
SiteShell.Loader.aFunctions = new Array ();

SiteShell.Loader.Initialize = function() {}
SiteShell.Loader.Push = function(sFunction) {
  this.aFunctions[this.aFunctions.length] = sFunction;
}

SiteShell.Loader.Execute = function() {
  for (var i in this.aFunctions){
    eval(this.aFunctions[i]);
  }
}

//--------------
// SITE UNLOADER
//--------------
SiteShell.Unloader = new Object();
SiteShell.Unloader.aFunctions = new Array ();

SiteShell.Unloader.Initialize = function() {}
SiteShell.Unloader.Push = function(sFunction) {
  this.aFunctions[this.aFunctions.length] = sFunction;
}

SiteShell.Unloader.Execute = function() {
  for (var i in this.aFunctions){
    eval(this.aFunctions[i]);
  }
}

//---------------
// DEPRECATED
//---------------
var SiteLoader = SiteShell.Loader;
var SiteUnloader = SiteShell.Unloader;

//---------------
// INITIALIZATION
//---------------
window.onload = function() {
  SiteShell.Loader.Execute();
}

window.onunload = function() {
  SiteShell.Unloader.Execute();
}