// Add functions to the window.onload event

function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

// Add a StyleSheet for JavaScript

function addStyleSheet(cssLink) {
	var head = document.getElementsByTagName("head")[0];
	var homepage_css = document.createElement("link");
	homepage_css.setAttribute("type", "text/css");
	homepage_css.setAttribute("rel", "stylesheet");
	homepage_css.setAttribute("href", cssLink);
	head.appendChild(homepage_css);
}