/**
 * initiates all external links
 *
 * @return	void		returns nothing
 */
function initExternalLinks () {
	var allLinks = document.getElementsByTagName("a");
	var count = allLinks.length;
	for (var i=0; i<count; i++) {
		if (allLinks[i].className === "external-link-new-window") {
			allLinks[i].onclick = allLinks[i].onkeypress = openThisInNewWindow;
		}
	}
}

/**
 * opens the the link in a new window
 *
 * @return	boolean		returns false to prevent from deafault behavior
 */
function openThisInNewWindow() {
	var newWin = window.open(this.href);
	newWin.focus();
	return false;
};

// do on load
oldOnload = window.onload;
window.onload = function() {
	if (typeof(oldOnload) === "function") {
		oldOnload();
	}
	if (document.getElementById && document.createTextNode) {
		initExternalLinks();
	}
};

function openWindow(url, width, height, scrollbars, resizable){
	if (typeof scrollbars == "undefined") {
		scrollbars = "no";
	}
	if (typeof resizable == "undefined") {
		resizable = "no";
	}
	var win = window.open(url, "webcast", "width=" + width + ",height=" + height + ",left=0,top=0,location=no,menubar=no,toolbar=no,dependent=yes,status=no,scrollbars=" + scrollbars + ",resizable=" + resizable);
	win.focus();
	return false;
}
