document.onkeydown = catchKey; function catchKey (event) { // var event; if (!document.getElementById) return; if (window.event) event = window.event; if (event.ctrlKey) { switch (event.keyCode ? event.keyCode : event.which ? event.which : null) { case 13: openMailWindow(); break; } } } function openMailWindow() { var html = showDialog(); } function showDialog(pagePath, args, width, height) { misprintWindow = window.open("misprint_dlg.html", "Misprint", 'width=400,height=400') }