function Sounds(callback) {
	Sounds.names = [];
	Sounds.durations = [];
	Sounds.loadNames();
	Sounds.isDoneLoading = false;
	callback();
}

Sounds.loadNames=function(){
	var request = "sound/names";
	var callback = function(response) {
		Sounds.names = response.split("\n")
		HtmlServer.sendRequest("server/log/LOG:Got_Names"+Sounds.names.length);
		for (var i = 0; i < Sounds.names.length; i++) {
			var request = "sound/duration/" + Sounds.getSoundName(i);
			var callback = function(duration) {
				HtmlServer.sendRequest("server/log/LOG:Got_duration");
				Sounds.durations[i] = duration;
				if(i == Sounds.names.length - 1) {
					Sounds.isDoneLoading = true;
				}
			}
			HtmlServer.sendRequestWithCallback(request,callback);
		}	
	};
	HtmlServer.sendRequestWithCallback(request, callback);
};

Sounds.getSoundDuration=function(index){
	return Sounds.durations[index];
};

Sounds.getSoundName=function(index){
	return Sounds.names[index];
};
Sounds.getSoundCount=function(){
	return Sounds.names.length;
};
Sounds.indexFromName=function(soundName){
	return Sounds.names.indexOf(soundName);
};
Sounds.checkNameIsValid=function(soundName){
	return Sounds.indexFromName(soundName)>=0;
};

@@ -87,51 +87,16 @@
 mes(
-);%0A%09Sounds.isDoneLoading = false;%0A%09
 callback
 ();%0A
@@ -91,17 +91,16 @@
 callback
-(
 );%0A%7D%0A%0ASo
@@ -119,24 +119,38 @@
 es=function(
+parentCallback
 )%7B%0A%09var requ
@@ -612,35 +612,24 @@
 %09%09%09%09
-Sounds.isDoneLoading = true
+parentCallback()
 ;%0A%09%09

Update Sounds.js