
/*
 * scriptsCheckLoaded()
 *	Verifies that all <script> elements that also have a checkload="true" attribute
 *	contain a function whose name is formatted as:
 *	"<file_name>_js_loaded".
 *	If the function does not exist it is assumed that the script in question failed to load.
 */
function scriptsCheckLoaded()
{
	var scripts = document.getElementsByTagName("script");
	for (var i = 0; i < scripts.length; ++i) {
		var current_node = scripts[i];
		var tag = current_node.getAttribute("checkload");
		if (tag && (tag == "true")) {
			var src = current_node.getAttribute("src");
			src = src.replace(".js", "_js_loaded");
			if (src.search("_js_loaded") >= 0) {
				src = src.replace(/\\/g,"/");
				src = src.substring(src.lastIndexOf("/") + 1);
				if (eval("typeof(" + src + ")") != 'function') {
					return false;
				}
			}
		}
	}

	return true;
}
