function WindowKeyPress(toEvent) { if (window.event) { Key=window.event.keyCode } else { if (toEvent) { Key=toEvent.keyCode } else { } } }