/**
 * TNJSEffectsLib 0.1a 
 * (c) 2005-2007 Till Niese <tnjslibrary@tillniese.com>
 *
 * You mustn't remove the copyright information.
 */
/*--------------------------------------------------------------------------*/

var TNJSEffectsLib = {
	version : '0.1a',
	
	baseInclude: [],
	
	loadedScripts: new Object(),
	
	libraryPath: getScriptPath("tnjseffectslib.js",true)+"tnjseffectslib/",
	
	load : function() {
		
		var scriptPath = getScriptPath("tnjseffectslib.js");
		if( scriptPath == null ) {
			throw new Error("can't find library ('tnjseffectslib.js')");
		}
		
		var includes = scriptPath.match(/\?.*load=([a-z,]*)/);
		
		this.includeScripts(this.baseInclude,this.libraryPath);
		if( includes != null ) {
			includes = includes[1].split(',');
			this.includeScripts(includes,this.libraryPath);
		}
		
	},
	
	includeScripts : function( scriptPaths, basePath ) {
		if( typeof scriptPaths  == 'string' ) {
			if( this.loadedScripts[scriptPaths] == null ) {
				document.write('\n\t\t<script type="text/javascript" src="'+(basePath||'')+scriptPaths+'.js"></script>');
				this.loadedScripts[scriptPaths] = true;
			}
		} if(  scriptPaths instanceof Array ) {
			for( var i=0 ; i<scriptPaths.length ; i++ ) {
				this.includeScripts(scriptPaths[i], basePath);
			}
		}
	}
}

TNJSEffectsLib.load();
