/*  controlcommon.js



*/



var browser = new Object();

browser.version = parseInt( navigator.appVersion );
browser.isIE = (navigator.appName.indexOf( "Microsoft" ) != -1);
browser.isNetscape = (navigator.appName.indexOf( "Netscape" ) != -1);





function InputMask()
{
}


new InputMask();

InputMask.prototype.Key0 = 48;
InputMask.prototype.Key9 = 57;
InputMask.prototype.KeyControl = 0;



InputMask.prototype.Validate = Validate;
InputMask.prototype.ValidateInteger = ValidateInteger;



function Validate ( e, mode )
{
  var valid = false;
  
  switch( mode )
  {
    case "Integer" :
      valid =  this.ValidateInteger( e );
      break;
      
    default:
      event.returnValue = true;
      break;   
  }  
  
  
  e.returnValue = valid                           // IE  
  return valid;    
}







function ValidateInteger( e )
{
  var keyCode = GetKeyCode( e );  
  return ((keyCode >= this.Key0) && (keyCode <= this.Key9)) || (keyCode == this.KeyControl);
}



function GetKeyCode( e )
{
  return browser.isIE ? e.keyCode : e.which;
}





