var is_IE = (navigator.appName == "Microsoft Internet Explorer") ? true : false ;

function init()
{
	// make any link with the class 'popup' a popup link onclick with the correct icon / or no icon where necessary
	anchors = document.getElementsByTagName("a")
	for (x = 0; x < anchors.length; x++) {
		if (anchors[x].className == "popup" || anchors[x].className == "popup_no_icon") {
			// set onclick command
			if (anchors[x].className == "close") {
				my_command = "window.close()"
			} else if (anchors[x].className == "popup" || anchors[x].className == "popup_no_icon") {
				my_command = "popup_win = window.open('" + anchors[x].href + "', 'popup', 'height=600px, width=600px, scrollbars, resizable, menubar, location, toolbar, status, directories'); popup_win.focus(); return false"
			}
			//assign command
			if(is_IE) {
				this_innerHTML = anchors[x].parentNode.innerHTML
				this_innerHTML = this_innerHTML.replace(/href=('|\")([^'\"]*)('|\")/gi, "href=\"#\" onclick=\"" + my_command + "\"")
				anchors[x].parentNode.innerHTML = this_innerHTML
			} else {
				anchors[x].setAttribute("onclick", my_command)
				anchors[x].setAttribute("href", "#")
			}
		}
	}
	if (document.getElementById('calendar_submit')) {
		document.getElementById('calendar_submit').style.display = 'none'
	}
}

window.onload = init