/// Preloader Class
///	Written By: Matthew Gaddis <matthew_gaddis@yahoo.com>
/// Created: 2005-01-07

var Pre = 
{
	debug: false,
	require: function(scriptName)
	{
		document.write('<script type="text/javascript" src="' + scriptName + '"></script>');	
	},
	load: function()
	{
		var nodeListScript = document.getElementsByTagName("script");
		var i = 0;
		var path = null;
		for(i = 0; i < nodeListScript.length; i++)
		{
			//alert(nodeListScript[i].src);
			if(nodeListScript[i].src.match(/Pre\.js$/))
			{
				path = nodeListScript[i].src.replace(/Pre.\js$/,'');
				
				if(this.debug && typeof Trace == 'undefined') this.require(path + 'Trace.js');
				if(typeof Nav == 'undefined') this.require(path + 'Nav.js');
				if(typeof Header == 'undefined') this.require(path + 'Header.js');

				break;
			}
		}
	},
	meditate: function(f)
	{
		var m=window.onload;
		window.onload=function(){ if(m)m(); f(); }
	}
}

Pre.load();


