/*
NOTE:
eval() in mozilla/firefox can assign an object as its execution context but in ie it doesn't work in this way.
window.execScript() is a method of window object, so the executed script will use window as its execution context.
by add execScript method to window in mozilla/firefox to make it work as in ie, we can make sure that it will work
in 
*/

try {
	window.execScript("null");
} catch (e) {
	window.execScript = function (statement) {
		eval(statement, window);
	}
}

function load(path) {
	try {
		if (path.indexOf(":") > -1) {
			throw "ERROR: ':' in path is not allowed.";
			// implement simplest "same site" policy
		}
		var loader = xmlhttp();
		loader.open("GET", path, false);
		loader.send(null);
		if (loader.status == 200) {
			window.execScript(loader.responseText);
		} else {
			throw "ERROR: " + loader.status;
		}
	} catch (e) {
		alert(e);
	}
}

function xmlhttp() {
	try{return new ActiveXObject("Msxml2.XMLHTTP");} catch(e){}
	try{return new ActiveXObject("Microsoft.XMLHTTP");} catch(e){}
	try{return new XMLHttpRequest();} catch(e){}
	alert("XMLHttpRequest Object not existed!!");
	return null;
}

