/*
	openBlank()
	written by Ryan Cannon

	OpenBlank causes links with offsite as part of their class
	attribute to open in a new window. It also appends "(opens
	in a new window)" to the title attribute. This should be
	combined with additional visual indication of its difference
	from a standard link.
	
*/
function openBlank() {
	if ( document.getElementById && document.createTextNode ) {
		var anchors = document.getElementsByTagName('a');
		for ( var i=0; i < anchors.length; i++ ) {
			var classes_array = anchors[i].className.split(' ');
			var isBlank = false;
			var isPopup = false;
			for ( var g = 0; g < classes_array.length; g++ ) {
				if ( classes_array[g] == 'offsite' ) {
					anchors[i].title= anchors[i].title + ' (opens in a new window)';
					anchors[i].onclick = function(e) {
						var evt = (typeof e != 'undefined')? e : window.event;
						var newWin = window.open( this.getAttribute('href'), '_blank', '' );
						newWin.focus();
						evt.returnValue = false;
						if (typeof evt.preventDefault !='undefined') { evt.preventDefault(); }
						return false;
					}
				}
			}
		}
		return true;
	}
	else { return false; }
}
// Run script after page loads
YAHOO.util.Event.addListener(window,"load",openBlank,false);