VBBootstrap = function() {
	var scriptList = new Array('http://www.houseofjubal.com/widgets/js/HJMusicPlayerv01.js',
							   'http://www.houseofjubal.com/widgets/js/prototype.js',
							   'http://www.houseofjubal.com/widgets/js/VBUIPanel.js',
							   'http://www.houseofjubal.com/widgets/js/AC_RunActiveContent.js');
	var totalScripts = scriptList.length;
	var loadedScripts = 0;
	var scriptCmdList = new Array([],[],[],[],[]);
	var scriptObjectList = new Array(totalScripts);
	var scriptStateList = new Array(totalScripts);
	
	function GetScriptUrl(index){
		var strUrl = scriptList[index];
		var len = scriptCmdList[index].length;
		for (var i = 0;i < len; ++i) {eval("strUrl = " + scriptCmdList[index][i] + "(strUrl);");}
		return strUrl;
	 };
	 function CheckLoaded(fileName) {
		var loaded = false;
		scripts = document.getElementsByTagName('head')[0].getElementsByTagName('script');
		for (var i=0;i<scripts.length;i++) {
			if (scripts[i].src == fileName) {
				loaded = true;
			}
		}
		return loaded;
	 }

	for (var i = 0; i < totalScripts; i++){
		if (CheckLoaded(GetScriptUrl(i)) == false) {
			scriptStateList[i] = new Object();
			scriptStateList[i].fileName = GetScriptUrl(i);
			scriptStateList[i].loadState = 'unload';
	
			scriptObjectList[i] = document.createElement('script');
			scriptObjectList[i].type = "text/javascript";
			scriptObjectList[i].src = scriptStateList[i].fileName;
			scriptObjectList[i].charset = "utf-8";
			scriptObjectList[i].onreadystatechange = new Function("ScriptObjectReadyCallback(" + i + ")");
			scriptObjectList[i].onload = new Function("ScriptObjectLoadCallback(" + i + ")");
			scriptObjectList[i].onerror = new Function("ScriptObjectErrorCallback(" + i + ")");
			
			document.getElementsByTagName('head')[0].appendChild(scriptObjectList[i]);
		}
	}
	ScriptObjectReadyCallback = function(index) {
		if (scriptObjectList[index].readyState == 'loaded' || scriptObjectList[index].readyState == 'complete'){
			scriptStateList[index].loadState = 'loaded';
			++loadedScripts;
			if (loadedScripts == totalScripts){HJMusicPlayerScriptReady(scriptStateList);}
		}
	};
	ScriptObjectLoadCallback = function(index){
		scriptStateList[index].loadState = 'loaded';
			++loadedScripts;
			if (loadedScripts == totalScripts){HJMusicPlayerScriptReady(scriptStateList);}
	};
	ScriptObjectErrorCallback = function(index){
		scriptStateList[index].loadState = 'error';
			++loadedScripts;
			if (loadedScripts == totalScripts){HJMusicPlayerScriptReady(scriptStateList);}
	};
	try{window.detachEvent('onload', HJMusicPlayerLoadBootstrap);}
	catch (e){}
};
var g_objVBBootstrap = null;

function HJMusicPlayerLoadBootstrap(){if (g_objVBBootstrap == null) g_objVBBootstrap = new VBBootstrap();}

try{window.attachEvent('onload', HJMusicPlayerLoadBootstrap);}
catch (e){window.addEventListener('load', HJMusicPlayerLoadBootstrap, false);}
