/*function modules() {
	this.modList=new Array();
	this.modList['__noentry']=new Array();
	this.modList['__noentry']['dep']=undefined;
	this.modList['__noentry']['loaded']=false;
}


modules.prototype.addModule = function(name,deps) {
	this.modList[name]=new Array();
	this.modList[name]['dep']=new Array();
	this.modList[name]['loaded']=false;
	this.modList[name]['dep_loading']=false;
	if (deps!=undefined) {
		for (i in deps) {
			this.addDep(name,deps[i]);
		}
	}
}

modules.prototype.getModule = function(name) {
	if (this.modList[name]==undefined) {
		return this.modList['__noentry'];
	}
	return this.modList[name];
}

modules.prototype.addDep = function(modName,depName){
	this.modList[modName]['dep'].push(depName);
}


mods= new modules();
mods.addModule('nXrpcFuncs',['md5','xmlrpc']);
mods.addModule('xmlrpc');
mods.addModule('md5');
mods.addModule('jsTmpl');
mods.addModule('insrow');
mods.addModule('aSuggest');
mods.addModule('checkdatum');
mods.addModule('checknumber');
mods.addModule('formatNumber');
mods.addModule('validater');
mods.addModule('JSLogger');


*/


function JSL() {
	this.loaded= new Array();
	this.requires = new Array();
	try {
		this.aRequest = new XMLHttpRequest();
	} catch (e){
		try{
			this.aRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				this.aRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				alert("Browser not supported!");
				return false;
			}
		}
	}

}


JSL.prototype.isLoaded= function (modName) {
	if (this.loaded[modName]) return true;
	return false;
}


JSL.prototype.load=function(modName,jsName) {
//	new Ajax.Request("http://serv1:1337/~steveetm/Etaloan/modules/"+modName+"/xarjavascript/"+jsName+".js");
	var sc = document.createElement('script')
	sc.type = 'text/javascript'
	sc.setAttribute('type',"text/javascript");
        if (jsName.indexOf('views',0)==0) {
           	sc.setAttribute('src',"application/"+modName+"/"+jsName+".js");
                 document.getElementsByTagName('head')[0].appendChild(sc);
                return;
        }
	if (modName!='system') {
           	sc.setAttribute('src',"application/"+modName+"/ui/javascript/"+jsName+".js");
	} else {
           	sc.setAttribute('src',"/ui/html/javascript/"+jsName+".js");
	}
	document.getElementsByTagName('head')[0].appendChild(sc);
	return;
}

JSL.prototype.loadmap=function() {

	var Parameter_map = new Object;
	var remote_key = new cItemV2({'sync':true});
	var ret_key = remote_key.xarModAPIFunc('ceg','user','main_google_map',Parameter_map);
	var url_ = 'http://maps.google.com/maps?file=api&v=2.x&key='+ret_key;

	var sc = document.createElement('script')
	sc.type = 'text/javascript'
	sc.setAttribute('type',"text/javascript");
	sc.setAttribute('src',""+url_+"");
	document.getElementsByTagName('head')[0].appendChild(sc);
	return;
}




var JLoader= new JSL();



