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

window.onload = function() {
// basic things to run at startup...

	modifyNewWindowLinks();
	hideDottedLines();
}

function modifyNewWindowLinks() {
// This function looks for all the links with a class of "NewWindow" and will cause them to open in a new window.

	var aTags = document.getElementsByTagName("a");
	for (var x = 0; x < aTags.length; x++) {
		var currTag = aTags[x];
		if (String(currTag.className).indexOf('NewWindow') > -1) {
			currTag.onclick = function(){ window.open(this.href); return false;}
		}
	}
}

function hideDottedLines() {
// hide the 'dotted lines' around the link for links with image-replacement.

	var theahrefs = document.getElementsByTagName("a");

	// fix dotted line thing when link is OnClicked
	for(var x=0;x!=theahrefs.length;x++) {
		//if (theahrefs[x].className!="") alert(theahrefs[x].className);
		if (theahrefs[x].className.indexOf("hideOutline")>-1) {
			theahrefs[x].onfocus = function stopLinkFocus(){ this.hideFocus=true; };
		}
	}
}
