// Detect if the browser is IE or not.
// If it is not IE, we assume that the browser is NS.
var IE = document.all?true:false

// If NS -- that is, !IE -- then set up for mouse capture
if (!IE) document.captureEvents(Event.KEYPRESS)
if (!IE) document.captureEvents(Event.KEYDOWN)
if (!IE) document.captureEvents(Event.KEYUP)

document.onkeydown = FullScreen;

function FullScreen(e) {

var code;
if (!e) var e = window.event;
if (e.keyCode) code = e.keyCode;
else if (e.which) code = e.which;
var character = String.fromCharCode(code);
var key = e.which || e.keyCode;

if(key == 122){  

if (document.getElementById('FScreen').style.visibility == 'visible') {
document.getElementById('FScreen').style.visibility = 'hidden';
//window.alert(key); 
}

else {
document.getElementById('FScreen').style.visibility = 'visible';
}

}

return true
}
