/* Main scripts */
function borderOver(o){
	o.style.border = 'outset 1px #000000'; 
}

function borderOut(o){
	o.style.border = 'outset 1px #FFFFFF'; 
}

function cms_addOnloadEvents(func) {
  if (!document.getElementById | !document.getElementsByTagName) return
	var oldonload=window.onload
	if (typeof window.onload != 'function') { window.onload=func }
	else {
		window.onload=function() { oldonload(); func() }
	}
}

function setExtLinkTarget() {
	if (document.getElementsByTagName) {
		var anchors = document.getElementsByTagName('a');
		for (var i = 0; i < anchors.length; i++) {
			var anchor = anchors[i];
			if (anchor.getAttribute('href') && anchor.getAttribute('rel') == 'external') {
				anchor.target = '_blank';
				anchor.className = 'link-external';
				anchor.title = (anchor.title.indexOf('(New window)') > -1) ? anchor.title : anchor.title + ' (Opens in a new window)';
			}
		}
	}
}

cms_addOnloadEvents(setExtLinkTarget);
