// JavaScript Document

var myBoolean = false;


/*if(myBoolean == true)
{
document.onclick = myBoolfalse; 
//alert("focus  is true");


 if (myBoolean == false )
{
	document.onkeydown = checkKeycode;
//alert("false");




}
*/

function myBool()

{
	myBoolean = true;
if (myBoolean== true) {
	
	document.onkeydown = !checkKeycode;
	
	}
}



function myBoolfalse()

{
	//myBoolean=false;
	//alert("false");
	document.onkeydown = checkKeycode;
	
}





var numcheck;
//document.onkeydown = checkKeycode;
function checkKeycode(e) {
var keycode;
if (window.event) 
keynum = window.event.keyCode;
else if (e) 
keynum = e.which;


keychar = String.fromCharCode(keynum);
/*if (keynum == 17)

{void(0);
return;
}
else
{
}
*/


		
		if(keynum == 17)
		{
			alert("Sorry that key is not accessible on this page");
			return;
			
		}
		
		//alert("keycode: " + keynum);
// start of case
switch (keynum)
{
case 49:
	document.location.href="#top";//top
  break;		
case 17:
   void(0);
   break;
case 65:
	document.location.href="#letterA";
  break;
case 66:
 	document.location.href="#letterB";
  break;
case 67:
  document.location.href="#letterC";
  break;
case 68:
  document.location.href="#letterD";
  break;
case 69:
 document.location.href="#letterE";
  break;
case 70:
  document.location.href="#letterF";
  break;
case 71:
   document.location.href="#letterG";
  break;
case 72:
   document.location.href="#letterH";
  break;
case 73:
   document.location.href="#letterI";
  break;
case 74:
   document.location.href="#letterJ";
   break;
case 75:
   document.location.href="#letterK";
   break;
case 76:
   document.location.href="#letterL";
   break;
case 77:
   document.location.href="#letterM";
   break;
case 78:
   document.location.href="#letterN";
   break; 
case 79:
   document.location.href="#letterO";
   break;
case 80:
   document.location.href="#letterP";
   break;
case 81:
   document.location.href="#letterQ";
   break;
case 82:
   document.location.href="#letterR";
   break;  
case 83:
   document.location.href="#letterS";
   break;
case 84:
   document.location.href="#letterT";
   break;
case 85:
   document.location.href="#letterU";
   break;    
case 86:
   document.location.href="#letterV";
   break;
case 87:
   document.location.href="#letterW";
   break;
case 88:
   document.location.href="#letterX";
   break;
case 89:
   document.location.href="#letterY";
   break;
case 90:
   document.location.href="#letterZ";
   break;  

}
//end of case
numcheck = /\d/;
return !numcheck.test(keychar);



}
