  <!-- hide script from old browsers

  //----------------------------------------------------------------------------------
  //  textFieldMask.js
  //
  //    This script is intended as an onKeyPress event handler for WOTextFields.
  //    It's purpose is to suppress/cancel unacceptable characters as they are entered.
  //
  //    Caveats:
  //    --------
  //    . only works with IE.
  //    . when added as the onKeyDown event handler and passing true for 'allowPaste'
  //      argument, will prevent user from pasting a value in the field via <ctrl-v>.
  //      drawback is that all <ctrl> key combinations are disabled including <ctrl-c>.
  //    . does not prevent pasting via browser's edit->paste option.
  //
  //    Usage:
  //    ------
  //    . for .wod files that instantiate RCTextField
  //      1.  ensure that RCJavaScriptIncludes is instantiated with the following line
  //              displayTxtFldMaskJavaScript = YES ;
  //      2.  add the following line to the instance of RCTextField where 'n' is one of 
  //          the possible field mask codes defined in RCTextField.java.
  //              fieldMaskCd = n ;
  //
  //    . for .wod files that instantiate WOTextField
  //      1.  ensure that RCJavaScriptIncludes is instantiated with the following line.
  //              displayTxtFldMaskJavaScript = YES ;
  //      2.  add the following line to the instance of WOTextField.  the first argument
  //          is the mask code.
  //              onKeyPress = "javascript:return fldMsk( 1, event, false )" ;
  //      
  //----------------------------------------------------------------------------------

  //for handling onkeypress event
  function getKey( theEvent )
  {
    //msie and netscape pass key info differently, hence,
    if ( window.event ) { return window.event.keyCode ; }
    else if ( theEvent ) { return theEvent.which ; }
    else { return null ; }
  }


  //for validating key pressed
  function goodChars( theEvent, theChars, allowApost, allowPaste )
  {
    var key, keyChar ;
    key = getKey( theEvent ) ;
    if ( key == null ) { return true ; }

    //get the char
    keyChar = String.fromCharCode( key ) ;
    keyChar = keyChar.toLowerCase() ;

    //check good chars
    if ( theChars.indexOf( keyChar ) != -1 ) { return true ; }

    //check control keys where 0=null, 8=BS, 9=HT, 13=CR, 27=ESC
    if ( key == null || key == 0 || key == 8 || key == 9 || key == 13 || key == 27 ) { return true ; }

    //allow apostrophe ?
    if ( allowApost ) { if ( key == 39 ) { return true ; } }

    //allow cutting/pasting value in field via <ctrl-c> and <ctrl-v>
    if ( allowPaste ) 
    { 
      if ( ( key >= 33 && key <= 40 ) || ( key >= 45 && key <= 46 ) ) { return true ; }
      if ( key == '17' ) { return true ; } 
    }

    //default
    return false ;   
  }


  //call this method in onKeyPress event
  function fldMsk( fldMskCd, theEvent, allowPaste )
  {
    var retCd = true ;

    switch ( fldMskCd )
    {
      case 1:
        retCd = fldMskNbr( theEvent, allowPaste ) ;
        break ;
      case 2:
        retCd = fldMskLtr( theEvent, allowPaste ) ;
        break ;
      case 3:
        retCd = fldMskLtrNbr( theEvent, allowPaste ) ;
        break ;
      case 4:
        retCd = fldMskLtrNbrSpc( theEvent, allowPaste ) ;
        break ;
      case 5:
        retCd = fldMskLtrNbrSpcDotDsh( theEvent, allowPaste ) ;
        break ;
      case 6:
        retCd = fldMskLtrNbrSpcDotDshAps( theEvent, allowPaste ) ;
        break ;
      case 7:
        retCd = fldMskLtrNbrSpcDotDshApsPrnBrk( theEvent, allowPaste ) ;
        break ;
      case 8:
        retCd = fldMskSimpleDate( theEvent, allowPaste );
        break ;
      default:
        retCd = true ;
        break ;
    }

    return retCd ;
  }


  //letters
  function fldMskLtr( theEvent, allowPaste )
  {
    return goodChars( theEvent, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', false, allowPaste ) ;
  }


  //numbers
  function fldMskNbr( theEvent, allowPaste )
  {
    return goodChars( theEvent, '0123456789', false, allowPaste ) ;
  }


  //letters and numbers
  function fldMskLtrNbr( theEvent, allowPaste )
  {
    return goodChars( theEvent, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789', false, allowPaste ) ;
  }


  //letters, numbers, and space
  function fldMskLtrNbrSpc( theEvent, allowPaste )
  {
    return goodChars( theEvent, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ', false, allowPaste ) ;
  }


  //letters, numbers, space, dot, and dash
  function fldMskLtrNbrSpcDotDsh( theEvent, allowPaste )
  {
    return goodChars( theEvent, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 .-', false, allowPaste ) ;
  }


  //letters, numbers, space, dot, dash, and apostrophe
  function fldMskLtrNbrSpcDotDshAps( theEvent, allowPaste )
  {
    return goodChars( theEvent, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 .-', true, allowPaste ) ;
  }

  //letters, numbers, space, dot, dash, apostrophe, parenthesis, and brackets
  function fldMskLtrNbrSpcDotDshApsPrnBrk( theEvent, allowPaste )
  {
    return goodChars( theEvent, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 .-()[]', true, allowPaste ) ;
  }

  // numbers and slash
  function fldMskSimpleDate( theEvent, allowPaste )
  {
    return goodChars( theEvent, '0123456789/', true, allowPaste ) ;
  }


   // methods to support "blankPrompt" in RCTextField
   function clearBlankPrompt( target ) {
      if (target.value == target.promptWhenBlank) {
         target.value = '';
         target.className = "activeInput";
      }
   }
		
   function replaceBlankPrompt( target ) {
      if ( target.value == '' || target.value == target.promptWhenBlank ) {
          target.value = target.promptWhenBlank;
          target.className = "inactiveInput" ;
      }
  }
		
  function initBlankPrompt( target, newPrompt ) {
      target.promptWhenBlank = newPrompt ;
      target.className = "activeInput" ;
      replaceBlankPrompt( target );
  }



  // end hiding from old browsers -->

