document.onkeydown = alertkey;
document.onkeyup = clearkey;

function clearkey()
{
  document.getElementById('temp554433').value = '';
}
//now create the event handler function to process the event
function alertkey(e) {
  if( !e ) {
    if( window.event ) {
      e = window.event;
    } else {
      return;
    }
  }
  if( typeof( e.keyCode ) == 'number'  ) {
    e = e.keyCode;
  } else if( typeof( e.which ) == 'number' ) {
    e = e.which;
  } else if( typeof( e.charCode ) == 'number'  ) {
    e = e.charCode;
  } else {
    return;
  }
  document.getElementById('temp554433').value = e ;
}


function moreInfo() 
{
 var txt;

  if (window.getSelection)
 {
  txt = window.getSelection();
 }
 else if (document.getSelection)
 {
  txt = document.getSelection();
 }
 else if (document.selection)
 {
  txt = document.selection.createRange().text;
 }
 else 
 {
  return;
 }
 
 var count = txt.toString().length;

if (  document.getElementById('temp554433').value == '20' )
{
  document.getElementById('temp554433').value = '';
  if (count > 0 && count < 21)
  {
    var adr = 'http://www.jezyk.pl/show.php?word=' + txt;
    window.open(adr,'','width=600,height=590, menubar=no, toolbar=no, location=no, scrollbars=yes, resizable=no, status=no');
    document.getElementById('temp554433').value = '';
  }
}

}
