;(function() {

	if(typeof xspire == 'undefined') xspire = {};
	
	xspire.load = function(o, c) {
	
		if(typeof o == "object") {
			a = o;
		} else {
			a = [];
			a[0] = o;
		}
		
		if(typeof c != "function") {
		
			for(var n in a) {
				document.write('<script type="text/javascript" src="' + a[n] + '"></script>');
			}
		
		} else {
		
			var h = document.getElementsByTagName('head')[0];
			
			var nTotal = a.length;
			var nReady = 0;
			
			function ready() {
				nReady++;
				
				if(nReady == nTotal)
					c();
			}
			
			for(var n in a) {
				var s = document.createElement('script');
				s.type = 'text/javascript';
				s.src = a[n];
				
				if(c) {
					s.onload = ready;
					s.onreadystatechange = function() {
						if(this.readyState == 'complete' || this.readyState == 'loaded')
							ready();
					};
				}
				
				h.appendChild(s);
			}
		
		}
	
	};
	
	xspire.load([
		'js/jquery-1.4.4.min.js',
		'js/xspire.validate.js',
		'js/custom.js',
		'js/init.js'
	]);

}());
