Loader = {
	components: new Array (
		'script'
	),
	
	libraries: new Array (
		'mootools'
	),
	
	include: function(f,p) {
		document.write('<script type="text/javascript" src="' + this.basePath + p + f + '"></script>');
    },

	start: function() {
		var l = this.libraries;
		var c = this.components;
		this.basePath = 'fileadmin/torino/js/';
        for (var i = 0; i < l.length; i++) this.include(l[i] + '.js', 'lib/');
		for (var i = 0; i < c.length; i++) this.include(c[i] + '.js', '');
    }
}
function addLoadEvent(func){
  var oldonload=window.onload;
  if(typeof window.onload!='function') {
    window.onload = func;
  }
  else {
    window.onload=function() {
        oldonload();
      func();
    }
  }
}


function addResizeEvent(func) {
  var oldonresize = window.onresize;
  if (typeof window.onresize != 'function') {
    window.onresize = func;
  }
  else {
    window.onResize = function() {
        oldonresize();
      func();
    }
  }
}
Loader.start();
