function scrubLinks() {
	if (document.all || document.getElementsByTagName) {
		links = (document.all) ? document.all.tags("a") : document.getElementsByTagName("a");
		for(i=0; i<links.length; i++) {
			links[i].onfocus = links[i].blur;
		}
	}
}

var onloadHandlers = [];
window.onload = function() {
	scrubLinks();
	for(var i=0; i<onloadHandlers.length;i++) {
		eval(onloadHandlers[i]);
	}
}

//	Popup Windows
function openWindow(url, name, width, height, x, y, status, scrollbars, moreProperties, openerName) {
	var ua = navigator.userAgent.toLowerCase();
	if (moreProperties == null || moreProperties == '') {
		moreProperties = "directories=0,location=0,menubar=0,resizable=1,toolbar=0";
	}
	if (x == null || x == "" || x != "center") x = 0;
	if (y == null || y == "" || y != "center") y = 0;
	// ie4.5 mac - windows are 2 pixels too short; if a statusbar is used, the window will be an additional 15 pixels short
	height += (status!='' && status!=null && ua.indexOf("mac")!=-1 && ua.indexOf("msie")!=-1 && ua.indexOf("msie 5.0")==-1) ? 17 : 2;
	// adjust width if scrollbars are used (win places scrollbars inside the content area; mac outside)
	width += (scrollbars==true && ua.indexOf("mac")==-1) ? 16 : 0;
	x = (x == "center" && (screen)) ? ((screen.availWidth - width) / 2) : x;
	y = (y == "center" && (screen)) ? ((screen.availHeight - height) / 2) : y;
	if (!status) status = '';
	if (!scrollbars) scrollbars = 0;
	if (!openerName) openerName = '';
	var properties = 'width=' + width + ',height=' + height + ',screenX=' + x + ',screenY=' + y + ',left=' + x + ',top=' + y + ((status) ? ',status' : '') + ((scrollbars) ? ',scrollbars=' + scrollbars : '') + ((moreProperties) ? ',' + moreProperties : '');
	var reference = cbPop(url, name, properties, openerName);
	return reference;
}

function cbPop(url, name, properties, openerName) {
	var ua = navigator.userAgent.toLowerCase();
	// ie4.x win can't give focus to windows containing documents from a different domain
	if (ua.indexOf("msie") != -1 && parseInt(navigator.appVersion) == 4 && ua.indexOf("msie 5") == -1 && ua.indexOf("msie5") == -1 && ua.indexOf("win") != -1 && url.indexOf('http://') == 0) {
		winReference = window.open('about:blank', name, properties);
		setTimeout('if (winReference && !winReference.closed) winReference.location.replace("' + url + '")', 300);
	} else {
		winReference = window.open(url, name, properties);
	}
	// ie doesn't like giving focus immediately
	setTimeout('if (winReference && !winReference.closed) winReference.focus()', 200);
	if (openerName) self.name = openerName;
	return winReference;
}

function showhide(id) {
	if (document.getElementById) {
		document.getElementById(id).style.display = (document.getElementById(id).style.display == 'none' || document.getElementById(id).style.display == '') ? 'block' : 'none';
	}
}
