/**
 * Namespace "Base"
 * @class Base
 * @desc Base class of this project
 */
var Base = function() {
	var arr_init = []; // Array containing all registered init-functions of subclasses
	
	/**
	 * Check and execute registered subclass functions
	 */
	function check_register() {
		for (var i=0; i<arr_init.length; i++) {
			arr_init[i]();
		}
	}

	
  /**
   * Checks IE version. This requires a line of JS in the <head> tags within
   * IE conditional statements similar to the one below. If not given,
   * Base.ieVersion stays null.
   * 
   * document.getElementsByTagName("html")[0].className += (" ie6");
   */
  function check_ie(){
    if( $ ){
      if( $('html.ie6').length > 0 ) // ! window.XMLHttpRequest
        Base.ieVersion = 6;
      
      if( $('html.ie7').length > 0 )
        Base.ieVersion = 7;
    }
  }
	
	return { // Public area
		ieVersion: null,
		paths: {},
		
		/**
		* Register (initialization) calls from subclasses
		* @param (obj_function) Function to initialize subclass
		*/
		register: function(obj_function) {
			arr_init.push(obj_function);
		},
		
		
		/**
		* Initialize this class
		*/
		init: function() {
      check_ie();
			
			
			check_register();
		}
	}
}();

$(document).ready(function(){
	Base.init();
});