function initPrintIcon() {
	if (!document.getElementById) return false;
	
	var sidebar = document.getElementById("Sidebar");
	for (i=0; (a = sidebar.getElementsByTagName("A")[i]); i++) {
		if (a.className == "Print") a.onclick = printDocument;
	}
}

function printDocument() {
	if (window.print && document.getElementById) {
		var parameters = "width=500,height=600,location=0,menubar=0,resizable=1,scrollbars=1,toolbar=0,status=0";
		var opener = window.open("PopupPrint.aspx", "printWin", parameters);
		opener.focus();
	}
}

function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

addLoadEvent(initPrintIcon);
