var loc = window.location;
function winop()
{
//Путь к файлу mistakes.php - измените на свой:
phploc = "http://megaconstructor.ru/_mistakes/mistakes.php";
windop = window.open(phploc,"mywin","height=390,width=335,left=200,top=100");
}
var mis; 
 nN = navigator.appName;

    function getText(e) 
	{
	if (!e) e= window.event; 
	if((e.ctrlKey) && ((e.keyCode==10)||(e.keyCode==13))) 
	 
	{
        if(nN == 'Netscape' || nN == 'Opera') {
            if(document.getSelection()) {
                str = document.getSelection();

                newstr = str.replace(/\n+/g, ' ');
                str = newstr.replace(/\ +/g, ' ');

                if(str.length > 150){
                    var i;
                    i = 0;
                    str = str.slice(0, 150);
                    i = str.lastIndexOf(' ');

                    if(i > 0){
                        str = str.slice(0, i);
                    }
                }
                mis = str;
				winop();
            }
        } else if(nN == 'Microsoft Internet Explorer') {
            if(document.selection.createRange()) {
                var range = document.selection.createRange();
                var str = range.text;
            }

            if(str) {
                str = str.replace(/\ +/g, " ");
                mis = str;
				winop();
            }
        }
        return true;
    }
	return true;
	}

    if(window.Event) {
        document.captureEvents(Event.MOUSEUP);
    }

document.onkeypress = getText;   
