/***
  Copyright © Gallagher & Robertson A/S. All rights reserved.
  This source code is protected by copyright law and international treaties.
  Unauthorized reproduction, distrubution or alteration of this source code, 
  or any portion of it, is illegal.
***/

// updated 2005-02-16 JG

var charCodeMapOn = true; //change to false for no check (Chinese?)
var charCodeMap = [ // Legal display characters for fields with no checking
                    // Save this table before changing it. You can have any number
                    // of lines, with any number of characters in each string
                    // the following is ISO8859-1 (Latin-1) with the euro
                    // Note the euro, not the international currency
                    // Note that " and \ must be quoted with \
                    // Simply delete the characters you don't want to allow
                    // add new characters for Latin-2 etc.
                   " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNO",
                   "PQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",
                   " ¡¢£€¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ",
                   "ÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
                   ];
bKeyMap = [
// By default all keys are delivered to the browser when you are not in the form
// Keys that you do not want the browser to see can be added here
{ keyCode:8,   isMapped:true, shift:false, ctrl:false, alt:false, vKey:"Backspace" }, //  BackSpace
{ keyCode:0,   isMapped:false } // End of table
];

fKeyMap = [
 { keyCode:49,  isMapped:true, shift:false, ctrl:false, alt:true,  vKey:"cmd:F1"  }, // Alt/1
 { keyCode:50,  isMapped:true, shift:false, ctrl:false, alt:true,  vKey:"cmd:F2"  }, // Alt/2
 { keyCode:51,  isMapped:true, shift:false, ctrl:false, alt:true,  vKey:"cmd:F3"  }, // Alt/3
 { keyCode:52,  isMapped:true, shift:false, ctrl:false, alt:true,  vKey:"cmd:F4"  }, // Alt/4
 { keyCode:53,  isMapped:true, shift:false, ctrl:false, alt:true,  vKey:"cmd:F5"  }, // Alt/5
 { keyCode:54,  isMapped:true, shift:false, ctrl:false, alt:true,  vKey:"cmd:F6"  }, // Alt/6
 { keyCode:55,  isMapped:true, shift:false, ctrl:false, alt:true,  vKey:"cmd:F7"  }, // Alt/7
 { keyCode:56,  isMapped:true, shift:false, ctrl:false, alt:true,  vKey:"cmd:F8"  }, // Alt/8
 { keyCode:57,  isMapped:true, shift:false, ctrl:false, alt:true,  vKey:"cmd:F9"  }, // Alt/9
 { keyCode:48,  isMapped:true, shift:false, ctrl:false, alt:true,  vKey:"cmd:F10" }, // Alt/0
 { keyCode:187, isMapped:true, shift:false, ctrl:false, alt:true,  vKey:"cmd:F11" }, // Alt/+
 { keyCode:219, isMapped:true, shift:false, ctrl:false, alt:true,  vKey:"cmd:F12" }, // Alt/\
 { keyCode:49,  isMapped:true, shift:true,  ctrl:false, alt:true,  vKey:"cmd:F13" }, // Shift/Alt/1
 { keyCode:50,  isMapped:true, shift:true,  ctrl:false, alt:true,  vKey:"cmd:F14" }, // Shift/Alt/2
 { keyCode:51,  isMapped:true, shift:true,  ctrl:false, alt:true,  vKey:"cmd:F15" }, // Shift/Alt/3
 { keyCode:52,  isMapped:true, shift:true,  ctrl:false, alt:true,  vKey:"cmd:F16" }, // Shift/Alt/4
 { keyCode:53,  isMapped:true, shift:true,  ctrl:false, alt:true,  vKey:"cmd:F17" }, // Shift/Alt/5
 { keyCode:54,  isMapped:true, shift:true,  ctrl:false, alt:true,  vKey:"cmd:F18" }, // Shift/Alt/6
 { keyCode:55,  isMapped:true, shift:true,  ctrl:false, alt:true,  vKey:"cmd:F19" }, // Shift/Alt/7
 { keyCode:56,  isMapped:true, shift:true,  ctrl:false, alt:true,  vKey:"cmd:F20" }, // Shift/Alt/8
 { keyCode:57,  isMapped:true, shift:true,  ctrl:false, alt:true,  vKey:"cmd:F21" }, // Shift/Alt/9
 { keyCode:48,  isMapped:true, shift:true,  ctrl:false, alt:true,  vKey:"cmd:F22" }, // Shift/Alt/0
 { keyCode:187, isMapped:true, shift:true,  ctrl:false, alt:true,  vKey:"cmd:F23" }, // Shift/Alt/+
 { keyCode:219, isMapped:true, shift:true,  ctrl:false, alt:true,  vKey:"cmd:F24" }, // Shift/Alt/\
 { keyCode:49,  isMapped:true, shift:false, ctrl:true,  alt:false, vKey:"cmd:PA1" }, // Ctrl/1 (3270)
 { keyCode:50,  isMapped:true, shift:false, ctrl:true,  alt:false, vKey:"cmd:PA2" }, // Ctrl/2 (3270)
 { keyCode:51,  isMapped:true, shift:false, ctrl:true,  alt:false, vKey:"cmd:PA3" }, // Ctrl/3 (3270)
 { keyCode:67,  isMapped:true, shift:false, ctrl:true,  alt:false, vKey:"cmd:Break" },      // Ctrl/C
 { keyCode:68,  isMapped:true, shift:false, ctrl:true,  alt:false, vKey:"cmd:Disconnect" }, // Ctrl/D
 { keyCode:82,  isMapped:true, shift:false, ctrl:true,  alt:false, vKey:"cmd:Refresh" },    // Ctrl/R
 { keyCode:33,  isMapped:true, shift:false, ctrl:false, alt:true,  vKey:"cmd:RollDown" },   // Alt/PageUp (5250)
 { keyCode:34,  isMapped:true, shift:false, ctrl:false, alt:true,  vKey:"cmd:RollUp" },     // Alt/PageDown (5250)
 { keyCode:72,  isMapped:true, shift:false, ctrl:true,  alt:true,  vKey:"cmd:Help" },       // Ctrl/Alt/Home (5250)
 { keyCode:35,  isMapped:true, shift:false, ctrl:true,  alt:false, vKey:"GoToBottom" },  // Ctrl/End
 { keyCode:46,  isMapped:true, shift:true,  ctrl:false, alt:false, vKey:"EraseField" },  // Shift/Del
 { keyCode:46,  isMapped:true, shift:false, ctrl:true,  alt:false, vKey:"EraseEOP" },    // Ctrl/Del
 { keyCode:46,  isMapped:true, shift:false, ctrl:false, alt:true,  vKey:"ClearScreen" }, // Alt/Del
 { keyCode:36,  isMapped:true, shift:false, ctrl:false, alt:false, vKey:"CursorHome" },  // Home
 { keyCode:36,  isMapped:true, shift:false, ctrl:true,  alt:false, vKey:"ControlHome" },  // Escape from protected field

//The browser interprets tab and backtab, but tabs beyond the v fields in a form.
//The Cursorup and Cursordown functions give tab around the v fields, and wrap between first/last.
//You can map the tab key (9) and shifted tab to use these functions instead.
 { keyCode:9,   isMapped:true, shift:false, ctrl:false, alt:false, vKey:"BrowserTab" },  // Tab (check field first)
 { keyCode:9,   isMapped:true, shift:true,  ctrl:false, alt:false, vKey:"BrowserBtab" }, // Backtab (check field first)
 { keyCode:38,  isMapped:true, shift:false, ctrl:false, alt:false, vKey:"CursorUp" },    // Cursor Up (Backtab and wrap in v fields)
 { keyCode:40,  isMapped:true, shift:false, ctrl:false, alt:false, vKey:"CursorDown" },  // Cursor Down (tab and wrap in v fields)
//You can map a key to a macro, using the CPIC keycode syntax (See Gweb manual)
 { keyCode:84,  isMapped:false, shift:false, ctrl:true,  alt:false, vKey:"macro:@E" },   // Ctrl/T: transmit key (example only)

 { keyCode:0,   isMapped:false } // End of table
];

// If you need to modify this table, you might want to use the
// HTML file "gwebkbd.htm" to help you find key codes easily.
// Keys added to this table will generally not then be interpreted by the browser,
// except for some keys such as F1. Supression of the browser interpretation of F1
// is being studied.

