// 2b's JavaScript utilities

// Include a JS file from within other JS code
function include(file) {
    var script = document.createElement('script');
    script.src = file;
    script.type = 'text/javascript';
    document.getElementsByTagName('head')[0].appendChild(script);
}

// Add an onload function to the current page
function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
	window.onload = func;
    } else {
        window.onload = function() {
	    oldonload();
	    func();
	}
    }
}