//
// Global variables
//
var bV  = parseInt(navigator.appVersion);
var bNS = navigator.appName=="Netscape";
var bIE = navigator.appName=="Microsoft Internet Explorer";
function validateField(fieldName) {
     for(var i = 0; i < fieldName.length; i++) {
        var c = fieldName.charAt(i); 
        if(!(c >= "0" && c <= "9")) 
          return false;
        } return true; }
function beep() {
    if (bNS)
       return;
       //java.awt.Toolkit.getDefaultToolkit().beep();
    if (bIE)
        return;
        //document.JavaBeep.oneBeep();
}
//
// Check for right mouse click 
//
//bV  = parseInt(navigator.appVersion)
//bNS = navigator.appName=="Netscape"
//bIE = navigator.appName=="Microsoft Internet Explorer"
//
function nrc(e) {
   if (bNS && e.which > 1){
      beep();
      alert('Restricted-Manor House Preservation Fund Use Only!');
      
      self.focus();
      <!-- //alert(am)-->
      return false;
   }else if (bIE && (event.button >1)) {
      beep();
      alert('Restricted-Manor House Preservation Fund Use Only!');
      
      //var x = screen.availWidth;
      //var y = screen.availHeight;
      //window.open('http://www.yahoo.com','HelpWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,alwaysRaised=yes,screenX=0,screenY=0,width='+ x + ',height=' + y); 
      <!-- //alert(am) -->
      return false;
   }
}
function nrc1(e) {
   if (bNS && e.which > 1){
      return false;
   } else if (bIE && (event.button >1)) {
      return false;
   }
}
//
// END OF RIGHT CLICK
//
//
// TRAP KEY DOWN EVENTS
//
//NS4=(document.layers);
//IE4=(document.all);
//if(document.layers){
//
// Netscape Navigator Alert windows
//
function netscapeKeyPress(e) {
if (e.which == 17 ) {
   beep();
   alert('CNTRL Key Disabled!');
   self.focus();
   return false;
}
if (e.which == 18 ) {
   beep();
   alert('ALT Key Disabled!');
   self.focus();
   return false;

}
//
// otherwise process the keystrokes, say in a text field
//
return true;
}
//
// Internet Explorer Alert windows
//
function microsoftKeyPress() {
  if (window.event.ctrlKey) {
      beep();
  	alert('CNTRL Key Disabled!');
      self.focus();
      return false;
  }
  if (window.event.altKey) {
      beep();
      alert('ALT Key Disabled!');
      self.focus();
      return false;
  }
//
// otherwise process the keystrokes
//
  return true;
}
//
// Cross browser script to trap CNTRL/ALT and Right-click events
//
function initRCU() {
   document.onmousedown = nrc;
//
// I had to call the following to get only one alert
//
   document.onmouseup   = nrc1;
//
// Netscape requires the captureEvents() method to capture events outside its 
// intended target.
// Assigning event handlers
   if (bNS && bV<7) {
// note: window or document works here   
      //window.captureEvents(Event.KEYDOWN);
      //window.onkeydown   = netscapeKeyPress;
// note: assigning a reference call not a function call
      document.captureEvents(Event.KEYDOWN);
      document.onkeydown   = netscapeKeyPress;

   }else {
// note: only document works here 
// note: assigning a reference call not a function call  
      document.onkeydown   = microsoftKeyPress;
   }
   return true; 
}
