run()

function run() {
	if(document.getElementsByTagName) {
		var oldOnload = window.onload;

		if (typeof(window.onload) != "function") {
			window.onload = install;
		} else {
			window.onload = function() {
				oldOnload();
				install();
			}
		}
	}
}

function install() {
	createOutLinks();
	createImgLinks();
	createMailLinks();
	createTabOutline();
}

function createOutLinks() {
	var links = document.getElementsByTagName('a');
	if(links) {
		for(i = 0; i < links.length; i++) {
			if(/linkOut/.test(links[i].className)) {
				links[i].onclick = function() {return !window.open(this.href, "", "fullscreen, location, menubar, resizable, scrollbars, status, toolbar");}
			}
		}
	}
}

function createImgLinks() {
	var links = document.getElementsByTagName('a');
	if(links) {
		for(i = 0; i < links.length; i++) {
			var imgs = links[i].getElementsByTagName('img');
			if(imgs && (imgs.length > 0)) {
				links[i].onclick = function() {return !window.open(this.href, "", "location, menubar, resizable, scrollbars, status, toolbar");}
			}
		}
	}
}

function createMailLinks() {
	var links = document.getElementsByTagName('a');
	if(links) {
		for(i = 0; i < links.length; i++) {
			if(/mailto/.test(links[i].href)) {
				links[i].className += links[i].className ? " mail" : "mail";
			}
		}
	}
}

function createTabOutline() {
	var tabs = document.getElementsByTagName('tbody')
	if(tabs) {
		for(i = 0; i < tabs.length; i++) {
			var trs = tabs[i].getElementsByTagName('tr');
			for(j = 0; j < trs.length; j++) {
				trs[j].onmouseover = function() {this.style.backgroundColor = '#500'; this.style.color = '#fff'};
				trs[j].onmouseout = function() {this.style.backgroundColor = ''; this.style.color = ''};
			}
		}
	}
}