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; case 45: if (document.getElementById("rnews_bloger2")) { var txt = ""; if (document.getSelection) { txt = document.getSelection(); } else if (document.selection && document.selection.createRange) { txt = document.selection.createRange().text; } if (txt) { var txt1 = $("#rnews_bloger_txt").val(); if (!document.getElementById("rnews_bloger_add")) { $("#blog_link").after(''); } $("#rnews_bloger_add").html(txt1); $("#rnews_bloger1").text(txt); $("#rnews_bloger_txt").val($("#rnews_bloger_add").html()); $("#rnews_bloger2").text(txt); x = document.getElementById("blog_link").offsetLeft+200; y = document.getElementById("blog_link").offsetTop-200; document.getElementById("blocks_tabs_id").style.top = y; document.getElementById("blocks_tabs_id").style.Left = x; var of = $("#blog_link").offset(); $("body").scrollTop(of.top-300); $(".blocks_tabs").show(); } } break; } } } function openMailWindow() { var html = showDialog(); } function showDialog(pagePath, args, width, height) { misprintWindow = window.open("misprint_dlg.html", "Misprint", 'width=400,height=400') }