/**************************************************************************
 *  copyright (c) 2008 Kalango
 *	Este documento está protegido por leis de propriedade intelectual. 
 *  @autor Leonardo Sapucaia maio/2008
 **************************************************************************/
 var KalangoLibrary = {
	version: '1.0',
	js: [//núcleo
		 'prototype',
		 'effects',
		 'dragdrop',
		 //componentes
		 'scrollbar'],
	css: [],
	getPath: function(){
				var scripts = document.getElementsByTagName('script');
				for(var i=0; i<scripts.length; i++){
					if(scripts[i].src && scripts[i].src.match(/js\/kalango\.js(\?.*)?$/)){
						return scripts[i].src.replace(/js\/kalango\.js(\?.*)?$/,'');
					}
				}
			},
	includeJS: function(jsName) {
				document.write('<script type="text/javascript" src="'+jsName+'"></script>');
			},
	includeCSS: function(cssName) {
				document.write('<link rel="stylesheet" type="text/css" href="'+cssName+'"/>');
			},
	processJS: function(jsPath) {
		for(var i=0; i<this.js.length; i++){
			this.includeJS(jsPath+this.js[i]+'.js');
		}
	},
	processCSS: function(cssPath) {
		for(var i=0; i<this.css.length; i++){
			this.includeCSS(cssPath+this.css[i]+'.css');
		}
	},
	start: function(){
				var path = this.getPath();
				this.processJS(path+'js/');
				this.processCSS(path+'css/');
			}
};

KalangoLibrary.start();
