 //this will make the script run a function and pass it a parameter saying if Caps Lock is engaged
 //function format NOT compatible with v1 - it will now be run even if Caps Lock is not enabled
 function capsError( display ) {
  if( display ) {
   //do something to warn the user that caps lock is engaged
   document.getElementById('warning').style.display = 'block';
  } else {
   //remove any warnings that caps lock is engaged
   document.getElementById('warning').style.display = 'none';
  }
 }
 
 function capsDetect( e ) {
 if( !e ) { e = window.event; } if( !e ) { MWJ_say_Caps( false ); return; }
 //what (case sensitive in good browsers) key was pressed
 var theKey = e.which ? e.which : ( e.keyCode ? e.keyCode : ( e.charCode ? e.charCode : 0 ) );
 //was the shift key was pressed
 var theShift = e.shiftKey || ( e.modifiers && ( e.modifiers & 4 ) ); //bitWise AND
 //if upper case, check if shift is not pressed. if lower case, check if shift is pressed
 MWJ_say_Caps( ( theKey > 64 && theKey < 91 && !theShift ) || ( theKey > 96 && theKey < 123 && theShift ) );
 }
 function MWJ_say_Caps( oC ) {
  if( typeof( capsError ) == 'string' ) { if( oC ) { alert( capsError ); } } else { capsError( oC ); }
 }


/*
HTML for your page.

		<div id="warning" style="display:none">
		Warning: You have CAPS LOCK enabled on your keyboard.  That may cause your password to be incorrectly entered as the system is case sensitive.
		</div>

*/
