spiegel-keyman/output/keymanweb.js
2015-07-28 14:51:09 +10:00

269 lines
135 KiB
JavaScript

String.kmwFromCharCode=function(a){var b=[],c;for(c=0;c<arguments.length;c++){var d=Number(arguments[c]);if(!isFinite(d)||0>d||1114111<d||Math.floor(d)!==d)throw new RangeError("Invalid code point "+d);65536>d?b.push(d):(d-=65536,b.push((d>>10)+55296),b.push(d%1024+56320))}return String.fromCharCode.apply(void 0,b)};
String.prototype.kmwCharCodeAt=function(a){var b=""+this,c=0;if(0>a||a>=b.length)return NaN;for(var d=0;d<a;d++)if(c=b.kmwNextChar(c),null===c)return NaN;a=b.charCodeAt(c);return 55296<=a&&(56319>=a&&b.length>c+1)&&(b=b.charCodeAt(c+1),56320<=b&&57343>=b)?(a-55296<<10)+(b-56320)+65536:a};String.prototype.kmwIndexOf=function(a,b){var c=""+this,d=c.indexOf(a,b);if(0>d)return d;for(var e=0,f=0;null!==f&&f<d;f=c.kmwNextChar(f))e++;return e};
String.prototype.kmwLastIndexOf=function(a,b){var c=""+this,d=c.lastIndexOf(a,b);if(0>d)return d;for(var e=0,f=0;null!==f&&f<d;f=c.kmwNextChar(f))e++;return e};String.prototype.kmwLength=function(){var a=""+this;if(0==a.length)return 0;for(var b=0,c=0;null!==c;b++)c=a.kmwNextChar(c);return b};String.prototype.kmwSlice=function(a,b){var c=""+this,d=c.kmwCodePointToCodeUnit(a),e=c.kmwCodePointToCodeUnit(b);return null===d||null===e?"":c.slice(d,e)};
String.prototype.kmwSubstr=function(a,b){var c=""+this;0>a&&(a=c.kmwLength()+a);0>a&&(a=0);var d=c.kmwCodePointToCodeUnit(a),e=d;if(null===d)return"";if(2>arguments.length)e=c.length;else for(var f=0;f<b;f++)e=c.kmwNextChar(e);return null===e?c.substring(d):c.substring(d,e)};
String.prototype.kmwSubstring=function(a,b){var c=""+this,d,e;"undefined"==typeof b?(d=c.kmwCodePointToCodeUnit(a),e=c.length):(a>b&&(d=a,a=b,b=d),d=c.kmwCodePointToCodeUnit(a),e=c.kmwCodePointToCodeUnit(b));if(isNaN(d)||null===d)d=0;if(isNaN(e)||null===e)e=c.length;return c.substring(d,e)};
String.prototype.kmwNextChar=function(a){var b=""+this;if(null===a||0>a||a>=b.length-1)return null;var c=b.charCodeAt(a);return 55296<=c&&(56319>=c&&b.length>a+1)&&(c=b.charCodeAt(a+1),56320<=c&&57343>=c)?a==b.length-2?null:a+2:a+1};String.prototype.kmwPrevChar=function(a){var b=""+this;if(null==a||0>=a||a>b.length)return null;var c=b.charCodeAt(a-1);return 56320<=c&&(57343>=c&&1<a)&&(b=b.charCodeAt(a-2),55296<=b&&56319>=b)?a-2:a-1};
String.prototype.kmwCodePointToCodeUnit=function(a){if(null===a)return null;var b=""+this,c=0;if(0>a){for(var c=b.length,d=0;d>a;d--)c=b.kmwPrevChar(c);return c}if(a==b.kmwLength())return b.length;for(d=0;d<a;d++)c=b.kmwNextChar(c);return c};String.prototype.kmwCodeUnitToCodePoint=function(a){var b=""+this;return null===a?null:0==a?0:0>a?b.substr(a).kmwLength():b.substr(0,a).kmwLength()};String.prototype.kmwCharAt=function(a){return 0<=a?(""+this).kmwSubstr(a,1):""};
String.prototype.kmwBMPNextChar=function(a){return 0>a||a>=(""+this).length-1?null:a+1};String.prototype.kmwBMPPrevChar=function(a){return 0>=a||a>(""+this).length?null:a-1};String.prototype.kmwBMPCodePointToCodeUnit=function(a){return a};String.prototype.kmwBMPCodeUnitToCodePoint=function(a){return a};String.prototype.kmwBMPLength=function(){return(""+this).length};String.prototype.kmwBMPSubstr=function(a,b){var c=""+this;return-1<a?c.substr(a,b):c.substr(c.length+a,-a)};
String.kmwEnableSupplementaryPlane=function(a){var b=String.prototype;String._kmwFromCharCode=a?String.kmwFromCharCode:String.fromCharCode;b._kmwCharAt=a?b.kmwCharAt:b.charAt;b._kmwCharCodeAt=a?b.kmwCharCodeAt:b.charCodeAt;b._kmwIndexOf=a?b.kmwIndexOf:b.indexOf;b._kmwLastIndexOf=a?b.kmwLastIndexOf:b.lastIndexOf;b._kmwSlice=a?b.kmwSlice:b.slice;b._kmwSubstring=a?b.kmwSubstring:b.substring;b._kmwSubstr=a?b.kmwSubstr:b.kmwBMPSubstr;b._kmwLength=a?b.kmwLength:b.kmwBMPLength;b._kmwNextChar=a?b.kmwNextChar:
b.kmwBMPNextChar;b._kmwPrevChar=a?b.kmwPrevChar:b.kmwBMPPrevChar;b._kmwCodePointToCodeUnit=a?b.kmwCodePointToCodeUnit:b.kmwBMPCodePointToCodeUnit;b._kmwCodeUnitToCodePoint=a?b.kmwCodeUnitToCodePoint:b.kmwBMPCodeUnitToCodePoint};
var __BUILD__=403;
(function(){var b=(window.tavultesoft={}).keymanweb={_TitleElement:null,_Enabled:1,_IE:0,legacy:0,_IsActivatingKeymanWebUI:0,_JustActivatedKeymanWebUI:0,_IgnoreNextSelChange:0,_Selection:null,_SelectionControl:null,_KeyboardStubs:[],dfltStub:null,_Keyboards:[],_ActiveKeyboard:null,_ActiveStub:null,_LoadingInternalName:null,_AnyIndices:[],_DeadKeys:[],_ActiveControl:null,_Controls:[],_AttachedElements:[],_ActiveElement:null,_LastActiveElement:null,_DfltStyle:"",_MasterDocument:null,_HotKeys:[],focusTimer:null,
focusing:!1,resizing:!1,sortedInputs:[],inputList:[],languageList:null,languagesPending:[],deferredStubs:[],deferredKRS:[],deferredKR:[],loadTimer:null,waiting:null,warned:!1,baseFont:"sans-serif",appliedFont:"",embeddedFonts:[],fontCheckTimer:null,srcPath:"",rootPath:"",mustReloadKeyboard:!1,fullInitialization:!0};b.initialized=0;b.build=__BUILD__;b.version="2.0";b.helpURL="http://help.keyman.com/go";window.KeymanWeb=b;var a=b.util={},h=b.osk={ready:!1};b.ui={};b.setDefaultDeviceOptions=function(){};
b.getStyleSheetPath=function(b){return b};b.getKeyboardPath=function(b){return b};b.KC_=function(){return""};b.handleRotationEvents=function(){};b.alignInputs=function(){};b.refreshElementContent=null;h.highlightSubKeys=function(){};h.createKeyTip=function(){};h.optionKey=function(){};h.showKeyTip=function(){};h.registerPopup=function(){return!1};h.waitForFonts=function(){return!0};b.options={root:"",resources:"",keyboards:"",fonts:"",attachType:"",ui:null};a.events=[];a.currentEvents=[];h=document.getElementsByTagName("script");
h=h[h.length-1].src;h=h.substr(0,h.lastIndexOf("/")+1);b.srcPath=h;b.rootPath=h.replace(/(https?:\/\/)([^\/]*)(.*)/,"$1$2/");b.protocol=h.replace(/(.{3,5}:)(.*)/,"$1");a.addEventListener=function(b,c){a.removeEventListener(b,c);a.events[b].push(c);return!0};a.removeEventListener=function(b,c){"undefined"==typeof a.events[b]&&(a.events[b]=[]);for(var d=0;d<a.events[b].length;d++)if(a.events[b][d]==c)return a.events[b].splice(d,1),!0;return!1};a.callEvent=function(b,c){if("undefined"==typeof a.events[b])return!0;
if("undefined"!=typeof a.currentEvents[b])return!1;a.currentEvents.push(b);for(var d=0;d<a.events[b].length;d++){var e=a.events[b][d],f=!1;try{f=e(c)}catch(n){f=!1}if(!f)return a.currentEvents.pop(),!1}a.currentEvents.pop();return!0};a.attachDOMEvent=a.attachDOMEvent=function(b,c,d,e){a.detachDOMEvent(b,c,d,e);b.attachEvent?b.attachEvent("on"+c,d):b.addEventListener&&b.addEventListener(c,d,e?!0:!1)};a.detachDOMEvent=a.detachDOMEvent=function(b,c,d,a){b.detachEvent?b.detachEvent("on"+c,d):b.removeEventListener&&
b.removeEventListener(c,d,a)};a.getOption=a.getOption=function(a,c){return a in b.options?b.options[a]:1<arguments.length?c:""};a.setOption=a.setOption=function(a,c){b.options[a]=c};a.getAbsoluteX=a._GetAbsoluteX=function(g){if(!g)return 0;var c=g.offsetLeft?g.offsetLeft:0,d=g;if(d.offsetParent)for(;d.offsetParent;)d=d.offsetParent,c+=d.offsetLeft;d&&(d.ownerDocument&&g.ownerDocument!=b._MasterDocument)&&(d=d.ownerDocument);return d&&d.parentWindow&&d.parentWindow.frameElement?c+a._GetAbsoluteX(d.parentWindow.frameElement)-
d.documentElement.scrollLeft:d&&d.defaultView&&d.defaultView.frameElement?c+a._GetAbsoluteX(d.defaultView.frameElement)-d.documentElement.scrollLeft:c};a.getAbsoluteY=a._GetAbsoluteY=function(g){if(!g)return 0;var c=g.offsetTop?g.offsetTop:0,d=g;if(d.offsetParent)for(;d.offsetParent;)d=d.offsetParent,c+=d.offsetTop;d&&(d.ownerDocument&&g.ownerDocument!=b._MasterDocument)&&(d=d.ownerDocument);return d&&d.parentWindow&&d.parentWindow.frameElement?c+a._GetAbsoluteY(d.parentWindow.frameElement)-d.documentElement.scrollTop:
d&&d.defaultView&&d.defaultView.frameElement?c+a._GetAbsoluteY(d.defaultView.frameElement)-d.documentElement.scrollTop:c};a.getAbsolute=a._GetAbsolute=function(b){var c={};c.x=a._GetAbsoluteX(b);c.y=a._GetAbsoluteY(b);return c};a.selectStartHandler=function(){return!1};a.mouseDownPreventDefaultHandler=function(b){b&&b.preventDefault()};a.mouseDownPreventDefaultHandler=function(b){b&&b.preventDefault()};a.createElement=a._CreateElement=function(b){b=document.createElement(b);"undefined"!=typeof b.onselectstart?
(b.unSelectable="on",b.onselectstart=a.selectStartHandler):(b.style.MozUserSelect="none",b.style.KhtmlUserSelect="none",b.style.UserSelect="none",b.style.WebkitUserSelect="none");return b};a.getIEVersion=a._GetIEVersion=function(){var b,c="";"userAgent"in navigator&&(c=navigator.userAgent);if("selection"in document){var d=navigator.appVersion;b=d.indexOf("MSIE ");if(0<=b){if("BackCompat"==document.compatMode)return 6;d=d.substr(b+5);b=d.indexOf(".");if(0<b)return parseInt(d.substr(0,b),10)}}b=c.indexOf("Trident/");
if(0>b)return 999;c=c.substr(b+8);b=c.indexOf(".");return 0<b?parseInt(c.substr(0,b),10)+4:999};a.getDPI=function(){var b=document.createElement("DIV"),c=b.style,d=96;if("complete"!==document.readyState)return d;b.id="calculateDPI";c.position="absolute";c.display="block";c.visibility="hidden";c.left="10px";c.top="10px";c.width="1in";c.height="10px";document.body.appendChild(b);d="undefined"==typeof window.devicePixelRatio?b.offsetWidth:b.offsetWidth*window.devicePixelRatio;document.body.removeChild(b);
return d};a.getStyleValue=function(b,c){try{if(b&&"undefined"!=typeof window.getComputedStyle)return window.getComputedStyle(b,"").getPropertyValue(c);if(b&&"undefined"!=typeof b.currentStyle)return b.currentStyle[c]}catch(d){}return""};a.getStyleInt=function(b,c,d){b=parseInt(a.getStyleValue(b,c),10);return!isNaN(b)?b:"number"==typeof d?d:0};var i=a.device={touchable:!!("ontouchstart"in window),OS:"",formFactor:"desktop",dyPortrait:0,dyLandscape:0,version:"0",orientation:window.orientation};if(navigator&&
navigator.userAgent){h=navigator.userAgent;0<=h.indexOf("iPad")&&(i.OS="iOS",i.formFactor="tablet",i.dyPortrait=i.dyLandscape=0);0<=h.indexOf("iPhone")&&(i.OS="iOS",i.formFactor="phone",i.dyPortrait=i.dyLandscape=25);if(0<=h.indexOf("Android")){i.OS="Android";i.formFactor="phone";i.dyPortrait=75;i.dyLandscape=25;try{i.version=h.match(/(?:Android\s+)(\d+\.\d+\.\d+)/)[1]}catch(j){}}if(0<=h.indexOf("Windows NT")&&(i.OS="Windows",0<=h.indexOf("Touch")&&(i.formFactor="phone"),"number"==typeof navigator.msMaxTouchPoints&&
0<navigator.msMaxTouchPoints))i.touchable=!0}"tablet"==i.formFactor&&400>Math.min(screen.width,screen.height)&&(i.formFactor="phone");"phone"==i.formFactor&&720<Math.max(screen.width,screen.height)&&(i.formFactor="tablet");"iOS"==i.OS&&(!("ongesturestart"in window)&&"Win32"!=navigator.platform)&&(i.OS="Android");i.browser="web";if(999>a._GetIEVersion())i.browser="ie";else{if("iOS"==i.OS||"macosx"==i.OS.toLowerCase())i.browser="safari";/Firefox|Chrome|OPR/.test(navigator.userAgent)&&(0<=navigator.userAgent.indexOf("Firefox")&&
"onmozorientationchange"in screen?i.browser="firefox":0<=navigator.userAgent.indexOf("OPR")?i.browser="opera":0<=navigator.userAgent.indexOf("Chrome")&&(i.browser="chrome"))}a.isTouchDevice=function(){return i.touchable};a.portraitView=function(){return!a.landscapeView()};a.landscapeView=function(){return typeof window.orientation=="undefined"?false:Math.abs(window.orientation/90)==1};a.getViewportScale=function(){try{if(screen.width>document.documentElement.clientWidth)return 1;var b=screen.width;
if(a.landscapeView()){if(screen.width<screen.height)b=screen.height}else if(screen.width>screen.height)b=screen.height;return Math.round(100*b/window.innerWidth)/100}catch(c){return 1}};a.barHeight=function(){var b=0;i.formFactor=="phone"&&(b=screen.height/2-window.innerHeight-(a.landscapeView()?i.dyLandscape:i.dyPortrait));return b};a._EncodeEntities=function(b){return b.replace("&","&amp;").replace("<","&lt;").replace(">","&gt;")};a.createShim=a.createShim=function(){var b=a._CreateElement("IFRAME");
b.src="";b.style.display="none";b.style.position="absolute";b.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";b.frameBorder="0";b.scrolling="no";return b};a.showShim=a.showShim=function(b,c,d){if(c)try{c.style.left=a._GetAbsoluteX(b)+"px";c.style.top=a._GetAbsoluteY(b)+"px";if(d){c.style.width=a._GetAbsoluteX(d)-a._GetAbsoluteX(b)+d.offsetWidth+"px";c.style.height=a._GetAbsoluteY(d)-a._GetAbsoluteY(b)+d.offsetHeight+"px"}else{c.style.width=b.offsetWidth+"px";c.style.height=
b.offsetHeight+"px"}c.style.zindex="9999";c.style.display="block"}catch(e){}};a.hideShim=function(b){try{if(b)b.style.display="none"}catch(c){}};a.rgba=a.rgba=function(b,c,d,e,f){var n="transparent";if(a._GetIEVersion()<9){f=Math.floor(100*f);c=c.toString(16);d=d.toString(16);e=e.toString(16);c=("00"+c).substr(-2);d=("00"+d).substr(-2);e=("00"+e).substr(-2);e=f+c+d+e;b.filter="progid:DXImageTransform.Microsoft.gradient(startColorstr=#"+e+",endColorstr=#"+e+")";b.zoom="1"}else try{n="rgba("+c+","+
d+","+e+","+f+")"}catch(h){n="rgb("+c+","+d+","+e+")"}return n};a.addStyleSheet=a.addStyleSheet=function(b){var c=document.createElement("STYLE");c.type="text/css";c.styleSheet?c.styleSheet.cssText=b:c.appendChild(document.createTextNode(b));b=document.getElementsByTagName("HEAD");b.length>0?b[0].appendChild(c):document.body.appendChild(c);return c};a.removeStyleSheet=a.removeStyleSheet=function(b){if(b==null||typeof b!="object"||b.nodeName!="STYLE"||typeof b.parentNode=="undefined"||b.parentNode==
null)return false;b.parentNode.removeChild(b);return true};a.linkStyleSheet=a.linkStyleSheet=function(b){var c=document.getElementsByTagName("head");if(c.length>0){var d=document.createElement("link");d.type="text/css";d.rel="stylesheet";d.href=b;c[0].appendChild(d)}};a.addFontFaceStyleSheet=function(g){if(typeof g!="undefined"){typeof g.files=="undefined"&&(g.files=g.source);if(typeof g.files!="undefined"){var c,d="",e="",f="",n="",h=[];for(c=0;c<b.embeddedFonts.length;c++)if(b.embeddedFonts[c]==
g.family)return;typeof g.files=="string"?h[0]=g.files:h=g.files;for(c=0;c<h.length;c++){h[c].indexOf(".ttf")>0&&(d=h[c]);h[c].indexOf(".woff")>0&&(e=h[c]);h[c].indexOf(".eot")>0&&(f=h[c]);h[c].indexOf(".svg")>0&&(n=h[c])}d!=""&&d.indexOf("/")<0&&(d=b.options.fonts+d);e!=""&&e.indexOf("/")<0&&(e=b.options.fonts+e);f!=""&&f.indexOf("/")<0&&(f=b.options.fonts+f);n!=""&&n.indexOf("/")<0&&(n=b.options.fonts+n);c="@font-face {\nfont-family:"+g.family+";\nfont-style:normal;\nfont-weight:normal;\n";if(a._GetIEVersion()>=
9)if(i.OS=="iOS")if(d!="")c=c+"src:url('"+d+"') format('truetype');";else return;else{f=[];if(i.OS=="Android"){n!=""&&f.push("url('"+n+"') format('svg')");e!=""&&f.push("url('"+e+"') format('woff')");d!=""&&f.push("url('"+d+"') format('truetype')")}else{e!=""&&f.push("url('"+e+"') format('woff')");d!=""&&f.push("url('"+d+"') format('truetype')");n!=""&&f.push("url('"+n+"') format('svg')")}if(f.length==0)return;c=c+("src:"+f.join(",")+";")}else if(f!="")c=c+"src:url('"+f+"');";else return;a.addStyleSheet(c+
"\n}\n");b.embeddedFonts.push(g.family)}}};a.loadCookie=a.loadCookie=function(b){var c={};if(arguments.length>0){var d=a.loadCookie(),e;for(e in d)if(e==b)for(var f=unescape(d[e]).split(";"),h=0;h<f.length;h++){var k=f[h].split("=");c[k[0]]=k.length>1?k[1]:""}}else if(typeof document.cookie!="undefined"&&document.cookie!=""){d=document.cookie.split(/;\s*/);for(h=0;h<d.length;h++){f=d[h].split("=");f.length==2&&(c[f[0]]=f[1])}}return c};a.saveCookie=a.saveCookie=function(b,c){var d="",a;for(a in c)d=
d+a+"="+c[a]+";";a=(new Date((new Date).valueOf()+2592E6)).toGMTString();document.cookie=b+"="+escape(d)+"; path=/; expires="+a};a.toNumber=a.toNumber=function(b,c){var d=parseInt(b,10);return isNaN(d)?c:d};a.toFloat=a.toFloat=function(b,c){var d=parseFloat(b);return isNaN(d)?c:d};a.toNzString=a.nzString=function(b,c){var d="";arguments.length>1&&(d=c);return typeof b=="undefined"||b==null||b==0||b==""?d:""+b};a.deepCopy=function(b,c){var d=c||{},e;for(e in b)if(typeof b[e]==="object"){d[e]=b[e].constructor===
Array?[]:{};a.deepCopy(b[e],d[e])}else d[e]=b[e];return d};"indexOf"in Array||(Array.prototype.indexOf=function(b,c){for(var d=c||0;d<this.length;d++)if(this[d]==b)return d;return-1});a.eventTarget=function(b){return b&&b.target?b.target:window.event?window.event.srcElement:null};a.eventType=function(b){return b&&b.type?b.type:window.event?window.event.type:""};a.alert=a.alert=function(a,c){var d=b.waiting,e=d.firstChild.childNodes;e[0].style.display="block";e[1].className="kmw-alert-text";e[1].innerHTML=
a;e[2].style.display="none";d.style.display="block";d.dismiss=arguments.length>1?c:null};a.prepareWait=function(){var a=document.createElement("DIV"),c=document.createElement("DIV"),d=document.createElement("DIV"),e=document.createElement("DIV"),f=document.createElement("DIV");a.className="kmw-wait-background";c.className="kmw-wait-box";a.dismiss=null;d.className="kmw-wait-text";e.className="kmw-wait-graphic";f.className="kmw-alert-close";c.onmousedown=c.onclick=function(){if(f.style.display=="block"){a.style.display=
"none";a.dismiss&&a.dismiss()}};c.addEventListener("touchstart",c.onclick,false);a.onmousedown=a.onclick=function(c){c.preventDefault();c.stopPropagation()};a.addEventListener("touchstart",a.onclick,false);c.appendChild(f);c.appendChild(d);c.appendChild(e);a.appendChild(c);document.body.appendChild(a);b.waiting=a};a.myPath=function(b){var c,a=document.getElementsByTagName("script"),e;for(c=0;c<a.length;c++){e=a[c];if(e.src.indexOf(b)>=0)return e.src.substr(0,e.src.lastIndexOf("/")+1)}return""};a.prependProtocol=
function(a){return/^https?:/.test(a)?a:a.substr(0,2)=="//"?b.protocol+a:a.substr(0,1)=="/"?b.protocol+"/"+a:b.protocol+"//"+a};a.testString=function(b){var c=b.family;if("sample"in b&&typeof b.sample=="string")return"BESbswy"+b.sample;for(var a=["TamilWeb","TibetanWeb","LatinWeb","CherokeeWeb","EgyptianWeb","SinhalaWeb","KhmerWeb","ArabicWeb","BurmeseWeb","LaoWeb","OriyaWeb","GeezWeb"],e=["\u0bbe\u0bf5","\u0f7f\u0fd0","\u02b0\u02a4","\u13d0\u13c9","\ua723\uf7d3","\u0dd8\u0da3","\u17d6\u178e","\u0639\u06b3",
"\u1038\u1024","\u0ec0\u0edd","\u0b03\u0b06","\u1361\u132c"],b=0;b<a.length;b++)if(c==a[b])return"BESbswy"+e[b];return"BESbswy"};a.checkFont=function(b){var c=false,c=b.family,d=document.createElement("DIV"),e=d.style,f=document.createElement("P"),h=document.createElement("P"),k=document.createElement("SPAN"),j=k.style,i=document.createElement("SPAN"),l=i.style;e.position="absolute";e.top="10px";e.left="10px";e.visibility="hidden";document.body.appendChild(d);d.appendChild(f);d.appendChild(h);f.appendChild(k);
h.appendChild(i);k.setAttribute("style","font-family:monospace !important");l.fontFamily=c+",monospace";j.fontSize=l.fontSize="24px";k.innerHTML=i.innerHTML=a.testString(b);if(k.offsetWidth!=i.offsetWidth){k.setAttribute("style","font-family:sans-serif !important");l.fontFamily=c+",sans-serif";if(k.offsetWidth!=i.offsetWidth){k.setAttribute("style","font-family:serif !important");l.fontFamily=c+",serif"}}c=k.offsetWidth!=i.offsetWidth;f.removeChild(k);h.removeChild(i);d.removeChild(f);d.removeChild(h);
document.body.removeChild(d);return c};b.isFontAvailable=function(b){return a.checkFont({family:b})};a.checkFontDescriptor=function(b){return typeof b=="undefined"||typeof b.family!="string"?true:a.checkFont(b)}})();(function(){var b=window.tavultesoft.keymanweb,a=b.osk,h=b.util,i=h.device;b.debug=b.debug=function(a){var c;if(null==b.debugElement){var d=document.createElement("DIV");c=d.style;c.position="absolute";c.width="30%";c.maxHeight="50%";c.top="0";c.right="0";c.minHeight="50px";c.border="1px solid blue";c.whiteSpace="pre-line";c.overflowY="scroll";c=document.createElement("P");c.id="debug_output";c.style.margin="2px";d.appendChild(c);document.body.appendChild(d);b.debugElement=c}if(null!=(c=document.getElementById("debug_output")))if(0==
arguments.length)"undefined"!=typeof c.textContent?c.textContent="":c.innerHTML="";else{var d=(new Date).toTimeString().substr(3,5)+" ",e,f,h,k;for(f=0;f<arguments.length;f++)if(0<f&&(d+="; "),k=arguments[f],"object"==typeof k)if(null==k)d+="null";else{e="";for(h in k){0<e.length&&(e+=", ");e=e+h+":";switch(typeof k[h]){case "string":case "number":case "boolean":e+=k[h];break;default:e+=typeof k[h]}if(1024<e.length){e=e.substr(0,1E3)+"...";break}}0<e.length&&(d=d+"{"+e+"}")}else d+=k;1500<d.length&&
(d=d.substr(0,1500)+" (more)");"undefined"!=typeof c.textContent?c.textContent=d+"\n"+c.textContent:c.innerHTML=d+"<br />"+c.innerHTML}};b.debugElement=null;b.addEventListener=b.addEventListener=function(b,c){return h.addEventListener("kmw."+b,c)};b.setupTouchDevice=function(){b.cancelInput=function(){b._ActiveElement=null;b.hideCaret();a.hideNow()};b.setBlur=function(c){"relatedTarget"in c&&c.relatedTarget&&("DIV"!=c.relatedTarget.nodeName||-1==c.relatedTarget.className.indexOf("keymanweb-input"))?
b.cancelInput():b.focusing||b.cancelInput()};b.setFocus=function(c){b.focusing=!0;b.focusTimer=window.setTimeout(function(){b.focusing=!1},1E3);var d=c;c?"object"==typeof c.touches&&(d=c.touches[0]):(d={clientX:0,clientY:0},d.target=b._LastActiveElement?b._LastActiveElement.kmw_ip:b.sortedInputs[0].kmw_ip);var c=d.clientX,e=d.clientY,g=d.target,f;f="SPAN"==g.nodeName?g.parentNode:null!=g.className&&0<=g.className.indexOf("keymanweb-input")?g.firstChild:g;d=f.parentNode;b._ActiveElement!=d&&(b.hideCaret(),
b._ActiveElement=d,d.focus());b._SetTargDir(d);b.useInternalKeyboard=!1;a.ready&&!a._Visible&&a._Show();if("DIV"==g.nodeName)e=h._GetAbsoluteX(f.firstChild),"rtl"==d.dir?(e+=f.firstChild.offsetWidth,f=c>e?0:1E5):f=c<e?0:1E5,b.setTextCaret(d,f),b.scrollInput(d);else{var k,n,j,m,i,l,g=f.childNodes[1];k=0;n=b.getText(d)._kmwLength();f=b.getTextCaret(d);m=document.body.scrollTop;if("TEXTAREA"==d.base.nodeName){i=Math.round(d.base.offsetHeight/d.base.rows);for(l=0;16>l;l++){j=h._GetAbsoluteY(g)-m;if(j>
e&&f>k&&f!=n)n=f,f=Math.round((f+k)/2);else if(j<e-i&&f<n&&f!=k)k=f,f=Math.round((f+n)/2);else break;b.setTextCaret(d,f)}for(;h._GetAbsoluteY(g)-m>e&&f>k;)b.setTextCaret(d,--f);for(;h._GetAbsoluteY(g)-m<e-i&&f<n;)b.setTextCaret(d,++f)}if("rtl"==d.dir){for(l=0;16>l;l++){e=h._GetAbsoluteX(g);if(e<c&&f>k&&f!=n)n=f,f=Math.round((f+k)/2);else if(e>c&&f<n&&f!=k)k=f,f=Math.round((f+n)/2);else break;b.setTextCaret(d,f)}for(;h._GetAbsoluteX(g)<c&&f>k;)b.setTextCaret(d,--f);for(;h._GetAbsoluteX(g)>c&&f<n;)b.setTextCaret(d,
++f)}else{for(l=0;16>l;l++){e=h._GetAbsoluteX(g);if(e>c&&f>k&&f!=n)n=f,f=Math.round((f+k)/2);else if(e<c&&f<n&&f!=k)k=f,f=Math.round((f+n)/2);else break;b.setTextCaret(d,f)}for(;h._GetAbsoluteX(g)>c&&f>k;)b.setTextCaret(d,--f);for(;h._GetAbsoluteX(g)<c&&f<n;)b.setTextCaret(d,++f)}}b._ActiveControl=null;b._LastActiveElement=d;for(c=0;c<b._Controls.length;c++)if(b._Controls[c].LControl==d){b._ActiveControl=b._Controls[c];break}null!=b._ActiveControl&&null!=b._ActiveControl.LDefaultInternalName&&(b._JustActivatedKeymanWebUI?
b._ActiveControl.LDefaultInternalName=null==b._ActiveKeyboard?"":b._ActiveKeyboard.KI:b._SetActiveKeyboard(b._ActiveControl.LDefaultInternalName,"",!0));!b._IsIEEditableIframe(d,1)||!b._IsMozillaEditableIframe(d,1)?b._DisableInput=1:(b._DisableInput=0,b._JustActivatedKeymanWebUI||(b._DeadKeys=[],b._NotifyKeyboard(0,d,1)),!b._JustActivatedKeymanWebUI&&b._SelectionControl!=d&&(b._IsActivatingKeymanWebUI=0),b._JustActivatedKeymanWebUI=0,b._SelectionControl=d)};b.caret=document.createElement("DIV");var g=
b.caret.style;g.position="absolute";g.height="16px";g.width="2px";g.backgroundColor="blue";g.border="none";g.left=g.top=0;g.display="block";g.visibility="hidden";g.zIndex="9998";b.showCaret=function(c){if(c&&c.firstChild&&!(3>c.firstChild.childNodes.length)){var d=c.firstChild,a=b.caret.style,e=d.childNodes[1];b.caret.parentNode!=d&&d.appendChild(b.caret);a.left=e.offsetLeft+"px";a.top=e.offsetTop+"px";a.height=e.offsetHeight-1+"px";a.visibility="hidden";b.scrollBody(c);b.setScrollBar(c)}};b.setScrollBar=
function(c){var b=c.childNodes[0],d=c.childNodes[1].style;(b.offsetWidth>c.offsetWidth||0>b.offsetLeft)&&"TEXTAREA"!=c.base.nodeName?(d.height="4px",d.width=100*(c.offsetWidth/b.offsetWidth)+"%",d.left=100*(-b.offsetLeft/b.offsetWidth)+"%",d.top="0",d.visibility="visible"):b.offsetHeight>c.offsetHeight||0>b.offsetTop?(d.width="4px",d.height=100*(c.offsetHeight/b.offsetHeight)+"%",d.top=100*(-b.offsetTop/b.offsetHeight)+"%",d.left="0",d.visibility="visible"):d.visibility="hidden"};b.flashCaret=function(){if(i.touchable&&
null!=b._ActiveElement){var c=b.caret.style;c.visibility="visible"!=c.visibility?"visible":"hidden"}};b.hideCaret=function(){var c=b._LastActiveElement;if(c&&null!=c.className&&0<=c.className.indexOf("keymanweb-input")){c.base.value=b.getText(c);b.setText(c,null,1E5);var d=c.firstChild.style;"TEXTAREA"==c.base.nodeName?d.top="0":d.left="rtl"==c.base.dir?c.offsetWidth-c.firstChild.offsetWidth-8+"px":"0";b.caret.parentNode&&b.caret.parentNode.removeChild(b.caret);b.caret.style.visibility="hidden";1<
c.childNodes.length&&(c.childNodes[1].style.visibility="hidden")}};b.timerId=window.setInterval(b.flashCaret,500);b.setText=function(c,d,a){if(c&&0<c.childNodes.length){var e=c.firstChild,g=0;if(3<=e.childNodes.length){var f=e.childNodes[0],e=e.childNodes[2],h;null===d&&(h="string"==typeof f.textContent?f.textContent:f.innerText,d="string"==typeof e.textContent?e.textContent:e.innerText,d=h+d);0>a&&(a=0);g=d._kmwLength();if(null===a||a>g)a=g;h=d._kmwSubstr(0,a);d=d._kmwSubstr(a);"string"==typeof f.textContent?
f.textContent=h:f.innerText=h;"string"==typeof e.textContent?e.textContent=d:e.innerText=d}}b.updateBaseElement(c,g)};b.updateBaseElement=function(c,d){c.base.value=b.getText(c);c.style.backgroundColor=0==d?"transparent":window.getComputedStyle(c.base,null).backgroundColor;"iOS"==i.OS&&(c.base.style.visibility=0==d?"visible":"hidden")};b.getText=function(c){return null==c?"":"string"==typeof c.textContent?c.textContent:c.innerText};b.getTextBeforeCaret=function(c){if(c&&1<c.childNodes.length&&(c=
c.firstChild,0<c.childNodes.length)){c=c.childNodes[0];if("textContent"in c)return c.textContent;if("innerText"in c)return c.innerText}return""};b.setTextBeforeCaret=function(c,d){if(c&&0<c.childNodes.length){var a=c.firstChild,e=0;1<a.childNodes.length&&(e=a.childNodes[0],a=a.childNodes[2],"TEXTAREA"!=c.base.nodeName&&(d=d.replace(/\s+$/," ")),"textContent"in e?e.textContent=d:"innerText"in e&&(e.innerText=d),e=d.length,"textContent"in a?e+=a.textContent.length:"innerText"in a&&(e+=a.innerText.length))}b.updateBaseElement(c,
e);b.scrollInput(c)};b.getTextCaret=function(c){return b.getTextBeforeCaret(c)._kmwLength()};b.setTextCaret=function(c,d){b.setText(c,null,d);b.showCaret(c)};b.dragInput=function(c){c.preventDefault();c.stopPropagation();var d="object"==typeof c.targetTouches?c.targetTouches[0].target:c.target;if(null!=d){if(null==d.className||0>d.className.indexOf("keymanweb-input"))d=d.parentNode;if(null==d.className||0>d.className.indexOf("keymanweb-input"))d=d.parentNode;if(!(null==d.className||0>d.className.indexOf("keymanweb-input"))){var a=
"object"==typeof c.touches?c.touches[0].screenX:c.screenX,e="object"==typeof c.touches?c.touches[0].screenY:c.screenY;if("undefined"==typeof b.firstTouch||null==b.firstTouch)b.firstTouch={x:a,y:e};else{var g=b.firstTouch.x,f=b.firstTouch.y,c=d.firstChild,k;if("TEXTAREA"==d.base.nodeName){if(a=parseInt(c.style.top,10),isNaN(a)&&(a=0),g=f-e,-4>g||4<g)c.style.top=(a<g?a-g:0)+"px",b.firstTouch.y=e}else if(e=parseInt(c.style.left,10),isNaN(e)&&(e=0),k=g-a,-4>k||4<k)g=0,f=h._GetAbsoluteX(d)+d.offsetWidth-
c.offsetWidth-32,"rtl"==d.base.dir?g=16:f-=24,e-=k,e>g&&(e=g),e<f&&(e=f),c.style.left=e+"px",b.firstTouch.x=a}b.setScrollBar(d)}}};b.scrollInput=function(c){if(c&&c.firstChild&&!(null==c.className||0>c.className.indexOf("keymanweb-input"))){var d=c.firstChild;if(!(3>d.childNodes.length)){var a=d.childNodes[1],e=h._GetAbsoluteX(a),a=h._GetAbsoluteY(a),g=h._GetAbsoluteX(c),f=h._GetAbsoluteY(c),k=parseInt(d.style.left,10),n=parseInt(d.style.top,10),j=0,m=0;isNaN(k)&&(k=0);isNaN(n)&&(n=0);"TEXTAREA"==
c.base.nodeName?(e=Math.round(c.offsetHeight/c.base.rows),a<f&&(m=a-f),a>f+c.offsetHeight-e&&(m=a-f-c.offsetHeight+e),0!=m&&(d.style.top=(n<m?n-m:0)+"px")):(e<g+8&&(j=e-g-12),e>g+c.offsetWidth-12&&(j=e-g-c.offsetWidth+12),0!=j&&(d.style.left=(k<j?k-j:0)+"px"));b.showCaret(c)}}};b.scrollBody=function(c){if(c&&!(null==c.className||0>c.className.indexOf("keymanweb-input")||!a.ready)){var c=c.firstChild.childNodes[1],b=h._GetAbsoluteY(c),d=window.pageYOffset,e=0;b<d?e=b-d:(e=b-d-(window.innerHeight-a._Box.offsetHeight-
c.offsetHeight-2),0>e&&(e=0));0!=e&&window.scrollTo(0,e+window.pageYOffset)}};b.updateInput=function(c){var b=c.style,d=c.base,a=window.getComputedStyle(d,null),e=parseInt(a.marginLeft,10),g=parseInt(a.marginTop,10),f=h._GetAbsoluteX(d),k=h._GetAbsoluteY(d),n=c.offsetParent;n&&(f-=h._GetAbsoluteX(n),k-=h._GetAbsoluteY(n));isNaN(e)&&(e=0);isNaN(g)&&(g=0);b.left=f-e+"px";b.top=k-g+"px";"undefined"!=typeof a.MozBoxSizing&&(b.left=f+"px",b.top=k+"px");var e=d.offsetWidth,d=d.offsetHeight,g=parseInt(a.paddingLeft,
10),f=parseInt(a.paddingRight,10),k=parseInt(a.paddingTop,10),n=parseInt(a.paddingBottom,10),j=parseInt(a.borderLeft,10),m=parseInt(a.borderRight,10),l=parseInt(a.borderTop,10),o=parseInt(a.borderBottom,10),B="undefined";"undefined"!=typeof a.boxSizing?B=a.boxSizing:"undefined"!=typeof a.MozBoxSizing&&(B=a.MozBoxSizing);"content-box"==B&&(isNaN(g)||(e-=g),isNaN(f)||(e-=f),isNaN(j)||(e-=j),isNaN(m)||(e-=m),isNaN(k)||(d-=k),isNaN(n)||(d-=n),isNaN(l)||(d-=l),isNaN(o)||(d-=o));"Android"==i.OS&&("undefined"!=
typeof a.MozBoxSizing?(b.paddingTop=k+1+"px",b.paddingLeft=g+"px","TEXTAREA"==c.base.nodeName?b.marginTop="1px":b.marginLeft="1px",e--,d--):(e++,d++));b.width=e+"px";b.height=d+"px"};for(var c=0;2>c;c++)for(var d=document.getElementsByTagName(0==c?"INPUT":"TEXTAREA"),g=0;g<d.length;g++)if(d[g].kmwInput){var e=document.createElement("DIV");e.base=e.base=d[g];e.base.className=e.base.className?e.base.className+" keymanweb-font":"keymanweb-font";d[g].kmw_ip=e;b.inputList.push(e)}else d[g].addEventListener("touchstart",
function(){b.focusing=!1;clearTimeout(b.focusTimer);a.hideNow()},!1);for(var f,n,k,j,o,l,g=0;g<b.inputList.length;g++)e=b.inputList[g],e.className="keymanweb-input",e.dir=e.base.dir,f=document.createElement("DIV"),d=window.getComputedStyle(e.base,null),c=e.style,c.overflow="hidden",c.position="absolute",c.border="hidden",c.border="none",c.borderRadius="5px",o=document.createElement("DIV"),n=o.style,n.position="absolute",n.height=n.width="4px",n.left=n.top="0",n.display="block",n.visibility="hidden",
n.backgroundColor="#808080",n.borderRadius="2px",n=document.createElement("SPAN"),k=document.createElement("SPAN"),j=document.createElement("SPAN"),n.innerHTML=k.innerHTML=j.innerHTML="",n.className=k.className=j.className="keymanweb-font",f.appendChild(n),f.appendChild(j),f.appendChild(k),e.appendChild(f),e.appendChild(o),f=f.style,f.position="absolute",o=n.style,l=k.style,j=j.style,o.border=l.border="none",o.height=l.height="100%",o.fontFamily=l.fontFamily=f.fontFamily=d.fontFamily,"INPUT"==e.base.nodeName&&
!isNaN(parseInt(d.height,10))&&(o.lineHeight=l.lineHeight=d.height),j.border="1px solid red",j.visibility="hidden",j.marginLeft=j.marginRight="-1px",c.padding="8px",f.padding="0px 2px",f.backgroundColor="Android"==i.OS&&"transparent"==d.backgroundColor?"#fff":d.backgroundColor,e.tabIndex="0",e.style.msTouchAction="none",e.addEventListener("touchstart",b.setFocus),e.onmspointerdown=function(c){c.preventDefault();c.stopPropagation();return b.setFocus(c)},e.addEventListener("touchend",function(c){c.stopPropagation()}),
e.onmspointerup=function(c){c.stopPropagation()},e.addEventListener("touchmove",b.dragInput,!1),e.onmspointermove=b.dragInput,e.onblur=b.setBlur,n.style.whiteSpace="TEXTAREA"==e.base.nodeName?k.style.whiteSpace="pre-wrap":k.style.whiteSpace="pre",e.base.parentNode.appendChild(e),b.updateInput(e),c=e.style,c.color=d.color,c.fontFamily=d.fontFamily,c.fontSize=d.fontSize,c.fontWeight=d.fontWeight,c.textDecoration=d.textDecoration,c.padding=d.padding,c.margin=d.margin,c.border=d.border,c.borderRadius=
d.borderRadius,"webkitTapHighlightColor"in c&&(c.webkitTapHighlightColor="rgba(0,0,0,0)"),"TEXTAREA"==e.base.nodeName?(2==e.base.rows&&(n=parseInt(d.height,10)-parseInt(d.paddingTop,10)-parseInt(d.paddingBottom,10),d=parseInt(d.fontSize,10),d=Math.round(n/d),d>e.base.rows+1&&(e.base.rows=d)),f.width=c.width,f.minHeight=c.height):(f.minWidth=c.width,f.height=c.height),e.base.style.visibility="hidden",function(c){c.base.addEventListener("resize",function(){b.updateInput(c)},false)}(e),b.setText(e,e.base.value,
null)};b.setupDesktopPage=function(){for(var a=0;2>a;a++)for(var c=document.getElementsByTagName(0==a?"INPUT":"TEXTAREA"),d=0;d<c.length;d++)0>c[d].className.indexOf("kmw-disabled")&&!c[d].readOnly&&b.inputList.push(c[d]),c[d].className=c[d].className?c[d].className+" keymanweb-font":"keymanweb-font"};b.getBaseFont=function(){var b=document.getElementsByTagName("INPUT"),c=document.getElementsByTagName("TEXTAREA"),d=0,a;0==b.length&&0==c.length?d=0:0<b.length&&0==c.length?d=1:0==b.length&&0<c.length?
d=2:b[0].offsetTop<c[0].offsetTop?d=1:b[0].offsetTop>c[0].offsetTop?d=2:b[0].offsetLeft<c[0].offsetLeft?d=1:b[0].offsetLeft>c[0].offsetLeft&&(d=2);switch(d){case 0:case 1:h.getStyleValue(b[0],"font-family");case 2:a=h.getStyleValue(c[0],"font-family")}if("undefined"==typeof a||"monospace"==a)a="Arial,sans-serif";return a};b.setFocus=function(){};b.timerID=null;b.getText=function(){return""};b.setText=function(){};b.getTextBeforeCaret=function(){return""};b.setTextBeforeCaret=function(){};b.getTextCaret=
function(){return 0};b.setTextCaret=function(){};b.hideCaret=function(){};b.flashCaret=function(){};b.updateInput=function(){};b.addKeyboards=function(a){0==arguments.length?b.keymanCloudRequest("",!1):b.addKeyboardArray(arguments)};b.addKeyboardArray=function(a){if(b.initialized){if(0!=a.length){var c,d,e,f,h,k=d="";b.cloudList=[];for(c=0;c<a.length;c++){if("string"==typeof a[c]&&0<a[c].length){e=a[c].split("@");f=[""];"english"==e[0].toLowerCase()&&(e[0]="us");1<e.length&&(f=e[1].split(","));for(d=
0;d<f.length;d++)h={id:e[0]},""!=f[d]&&(h.language=f[d]),2<e.length&&(h.version=e[2]),b.cloudList.push(h)}if("object"==typeof a[c]&&null!=a[c])if("string"==typeof a[c].filename)b.addStub(a[c])||alert("To use a custom keyboard, you must specify file name, keyboard name, language, language code and region code.");else if(f=a[c].language,"number"==typeof f.length)for(d=0;d<f.length;d++)b.cloudList.push({id:a[c].id,language:a[c].language[d].id});else b.cloudList.push({id:a[c].id,language:a[c].language.id})}if(0!=
b.cloudList.length){d="&keyboardid=";for(c=0;c<b.cloudList.length;c++)a=b.cloudList[c],e=a.id,h=f="","string"==typeof a.language&&""!=a.language&&(f=a.language),"string"==typeof a.version&&""!=a.version&&(h=a.version),""!=f?(e=e+"@"+f,""!=h&&(e=e+"@"+h)):""!=h&&(e=e+"@@"+h),d=d+k+e,k=",";b.keymanCloudRequest(d,!1)}}}else for(c=0;c<a.length;c++)b.deferredStubs.push(a[c])};b.keymanCloudRequest=function(a,c){var d="https://r.keymanweb.com/api/4.0/",e,f=h._CreateElement("SCRIPT"),d=d+(1<arguments.length&&
c?"languages":"keyboards")+"?jsonp=tavultesoft.keymanweb.register";e="&timerid="+window.setTimeout(function(){b.serverUnavailable(a)},1E4);f.charset="UTF-8";f.src=d+a+e;f.type="text/javascript";try{document.body.appendChild(f)}catch(n){document.getElementsByTagName("head")[0].appendChild(f)}};b.addKeyboardsForLanguage=function(a){b.addLanguageKeyboards(arguments)};b.addLanguageKeyboards=function(a){var c,d,e,f=b.languageList,n,k;if(null==f){d=0==b.languagesPending.length;for(c=0;c<a.length;c++)b.languagesPending.push(a[c]);
d&&b.keymanCloudRequest("",!0)}else{n="";for(c=0;c<a.length;c++){e=a[c].toLowerCase();(k="$"==e.substr(-1,1))&&(e=e.substr(0,e.length-1));for(d=0;d<f.length;d++)if(e==f[d].name.toLowerCase()){""!=n&&(n+=",");n=n+"@"+f[d].id;k&&(n+="$");break}}""==n?h.alert("No keyboards are available for "+a[0]+". Does it have another language name?"):b.keymanCloudRequest("&keyboardid="+n,!1)}};b.addStub=function(a){if("string"!=typeof a.id||"undefined"==typeof a.language)return!1;"string"!=typeof a.name&&(a.name=
a.id.replace("_"," "),a.name=a.name.substr(0,1).toUpperCase()+a.name.substr(1));var c=a.language,d=[];"undefined"==typeof c.length?d[0]=c:d=c;for(var e={keyboardBaseUri:b.options.keyboards,fontBaseUri:b.options.fonts},c=0;c<d.length;c++)b.mergeStub(a,d[c],e);return!0};b.findStub=function(a,c){var d,e=b._KeyboardStubs;for(d=0;d<e.length;d++)if(e[d].KI=="Keyboard_"+a&&e[d].KLC==c)return e[d];return null};b.regions="World;Africa;Asia;Europe;South America;North America;Oceania;Central America;Middle East".split(";");
b.regionCodes="un af as eu sa na oc ca me".split(" ");b.mergeStub=function(a,c,d){var e=b.findStub(a.id,c.id);null==e&&(e={KI:"Keyboard_"+a.id,KLC:c.id},b._KeyboardStubs.push(e));var f=c.region,h=0;if("number"==typeof f)h=1>f||9<f?0:f-1;else if("string"==typeof f)for(var k=2==f.length?b.regionCodes:b.regions,j=0;j<k.length;j++)if(f.toLowerCase()==k[j].toLowerCase()){h=j;break}f=null;"undefined"==typeof e.KL&&(e.KL=c.name);"undefined"==typeof e.KR&&(e.KR=b.regions[h]);"undefined"==typeof e.KRC&&(e.KRC=
b.regionCodes[h]);"undefined"==typeof e.KN&&(e.KN=a.name);"undefined"==typeof e.KF&&(f=/^(([.]\/)|([.][.]\/)|(\/))|(:)/,e.KF=a.filename,f.test(e.KF)||(e.KF=d.keyboardBaseUri+e.KF));a=d.fontBaseUri;""!=b.options.fonts?(a=b.options.fonts,f=/^https?:/,f.test(a)||(a="//"==a.substr(0,2)?b.protocol+a:"/"==a.substr(0,1)?b.rootPath+a.substr(1):b.rootPath+a)):b.options.fonts=a;"undefined"==typeof e.KFont&&"undefined"!=typeof c.font&&(d=e.KFont=c.font,d.files=d.source,d.path=a);"undefined"==typeof e.KOskFont&&
"undefined"!=typeof c.oskFont&&(d=e.KOskFont=c.oskFont,d.files=d.source,d.path=a);b.doKeyboardRegistered(e.KI,e.KL,e.KN,e.KLC);1==b._KeyboardStubs.length&&"complete"==document.readyState&&b._SetActiveKeyboard(e.KI,e.KLC)};b.registerLanguagesForKeyboard=function(a,c,d){var e,f,h,k=0;e="";if("undefined"!=typeof a)if("string"==typeof c.keyboardid&&(e=c.keyboardid.split(",")[d]),"number"==typeof a.length)if(1==a.length||"$"==e.substr(-1,1)||""==e)for(e=0;e<a.length;e++)b.registerLanguagesForKeyboard(a[e],
c,d);else{for(e=0;e<a.length;e++){h=a[e].id.toLowerCase();"us"==h&&(h="english");for(f=0;f<a[e].languages.length;f++)if(h==a[e].languages[f].name.toLowerCase()){k=e;break}}b.registerLanguagesForKeyboard(a[k],c,d)}else if(d=e.split("@")[1],"string"==typeof d&&(d=d.replace(/\$$/,"")),k=a.languages,"undefined"!=typeof k)if("number"==typeof k.length)for(e=0;e<k.length;e++)("undefined"==typeof d||k[e].id==d)&&b.mergeStub(a,k[e],c);else b.mergeStub(a,k,c)};b.register=function(a){var c=a.options;a.timerid&&
window.clearTimeout(a.timerid);if("string"==typeof a.error)c="","string"==typeof a.keyboardid&&(c=a.keyboardid.substr(0,1).toUpperCase()+a.keyboardid.substr(1)),b.serverUnavailable(c+" keyboard not found.");else if(!("undefined"==typeof c||"undefined"==typeof c.context))if("keyboard"==c.context){var d=a.keyboard;if("number"==typeof d.length)for(a=0;a<d.length;a++)b.registerLanguagesForKeyboard(d[a],c,a);else b.registerLanguagesForKeyboard(d,c,0)}else"language"==c.context&&(b.languageList=a.languages,
b.languagesPending&&b.addLanguageKeyboards(b.languagesPending),b.languagesPending=[])};b.serverUnavailable=function(a){h.alert(""==a?"Unable to connect to Keyman Cloud server!":a);b.warned=!0};b.removeKeyboards=function(a){if(0!=arguments.length){var c,d,e=b._KeyboardStubs;for(c=0;c<arguments.length;c++)for(d=e.length-1;0<=d;d--)if("Keyboard_"+arguments[c]==e[d].KI&&1<e.length){e.splice(d,1);break}b._SetActiveKeyboard(e[0].KI,e[0].KLC,!0);b.doKeyboardUnregistered()}};if(document.selection){var j=
navigator.appVersion;"undefined"==typeof document.createEventObject&&(0<=j.indexOf("MSIE 5.0")||0<=j.indexOf("MSIE 4.0")||0<=j.indexOf("MSIE 3.0"))?b.legacy=1:0<=j.indexOf("MSIE 6.0")?b._IE=6:0<=j.indexOf("MSIE 7.0")?b._IE=7:0<=j.indexOf("MSIE 8.0")&&(b._IE=8);b._IE&&"BackCompat"==document.compatMode&&(b._IE=6)}a._BaseLayout="undefined"!==typeof window.KeymanWeb_BaseLayout?window.KeymanWeb_BaseLayout:"us";b._BrowserIsSafari=0<=navigator.userAgent.indexOf("AppleWebKit");b._GetEventObject=function(a){if(!a&&
(a=window.event,!a&&(a=b._GetLastActiveElement()))){if(a=a.ownerDocument)a=a.parentWindow;if(!a)return null;a=a.event}return a};b._push=function(b,c){b.push?b.push(c):b=b.concat(c);return b};b._IsAttached=function(a){for(var c=0;c<b._AttachedElements.length;c++)if(b._AttachedElements[c]==a)return 1;return 0};b.attachToControl=b.attachToControl=function(a){var c=a.attributes.readonly,d=a.className;!("object"==typeof c&&"false"!=c.value)&&!("string"==typeof d&&0<=d.indexOf("kmw-disabled"))&&("iframe"==
a.tagName.toLowerCase()?b._AttachToIframe(a):(h.attachDOMEvent(a,"focus",b._ControlFocus),h.attachDOMEvent(a,"blur",b._ControlBlur),a.onkeypress=b._KeyPress,a.onkeydown=b._KeyDown,a.onkeyup=b._KeyUp),b._IsAttached(a)||b._AttachedElements.push(a))};b._AttachToIframe=function(a){try{var c=a.contentWindow.document;if(c)if(c.parentWindow){if("on"==c.designMode.toLowerCase()||c.body.isContentEditable)h.attachDOMEvent(a,"focus",b._ControlFocus),h.attachDOMEvent(a,"blur",b._ControlBlur),h.attachDOMEvent(c,
"keydown",b._KeyDown),h.attachDOMEvent(c,"keypress",b._KeyPress),h.attachDOMEvent(c,"keyup",b._KeyUp),b.legacy||(h.attachDOMEvent(c,"selectionchange",b._SelectionChange),b._SelectionChange())}else"on"==c.designMode.toLowerCase()?(h.attachDOMEvent(c,"focus",b._ControlFocus),h.attachDOMEvent(c,"blur",b._ControlBlur),h.attachDOMEvent(c,"keydown",b._KeyDown),h.attachDOMEvent(c,"keypress",b._KeyPress),h.attachDOMEvent(c,"keyup",b._KeyUp)):b._AttachToControls(c)}catch(d){}};b.GetEnabled=function(){return b._Enabled};
b.SetEnabled=function(a){a=a?1:0;b._Enabled!=a&&(b._Enabled=a,!a&&b.HideInterface&&b.HideInterface())};b.DisableControl=function(a){var c;for(c=0;c<b._Controls.length;c++)if(b._Controls[c].LControl==a){b._Controls[c].LEnabled=0;return}b._Controls=b._push(b._Controls,{LControl:a,LEnabled:0,LDefaultInternalName:"-"})};b.EnableControl=function(a){var c;for(c=0;c<b._Controls.length;c++)if(b._Controls[c].LControl==a){b._Controls[c].LEnabled=1;return}b._Controls=b._push(b._Controls,{LControl:a,LEnabled:1,
LDefaultInternalName:"-"})};b.SetDefaultKeyboardForControl=function(a,c){var d;for(d=0;d<b._Controls.length;d++)if(b._Controls[d].LControl==a){b._Controls[d].LDefaultInternalName=c;return}b._Controls=b._push(b._Controls,{LControl:a,LEnabled:1,LDefaultInternalName:c})};b.focusLastActiveElement=b._FocusLastActiveElement=function(){b._LastActiveElement&&(b._JustActivatedKeymanWebUI=1,b._IsMozillaEditableIframe(b._LastActiveElement,0)?b._LastActiveElement.defaultView.focus():b._LastActiveElement.focus&&
b._LastActiveElement.focus())};b.getLastActiveElement=b._GetLastActiveElement=function(){return b._LastActiveElement};b.setActiveElement=b.setActiveElement=function(a,c){"string"==typeof a&&(a=document.getElementById(a));b._ActiveElement=b._LastActiveElement=a;1<arguments.length&&c&&(i.touchable?b.setFocus():b.focusLastActiveElement())};b.getUIState=b.getUIState=function(){var a={};a.activationPending=a.activationPending=b._IsActivatingKeymanWebUI;a.activated=a.activated=b._JustActivatedKeymanWebUI;
return a};b.activatingUI=function(a){b._IsActivatingKeymanWebUI=a?1:0};b._ControlFocus=function(g){var c;if(!b._Enabled)return!0;g=b._GetEventObject(g);if(!g)return!0;if(g.target)g=g.target;else if(g.srcElement)g=g.srcElement;else return!0;if(i.touchable&&(null==g.className||0>g.className.indexOf("keymanweb-input")))return!0;c=g.nodeName.toLowerCase();if("input"==c){if(c=g.type.toLowerCase(),!("text"==c||"search"==c))return!0}else if("textarea"!=c)return!0;b._ActiveElement=g;3==g.nodeType&&(g=g.parentNode);
var d=g;i.touchable&&(null==g.className||0>g.className.indexOf("keymanweb-input"))&&b.scrollBody(g);"IFRAME"==g.tagName&&(b._AttachToIframe(g),g=g.contentWindow.document);b._ActiveControl=null;b._LastActiveElement=g;for(c=0;c<b._Controls.length;c++)if(b._Controls[c].LControl==g){b._ActiveControl=b._Controls[c];break}null!=b._ActiveControl&&null!=b._ActiveControl.LDefaultInternalName&&(b._JustActivatedKeymanWebUI?b._ActiveControl.LDefaultInternalName=null==b._ActiveKeyboard?"":b._ActiveKeyboard.KI:
b._SetActiveKeyboard(b._ActiveControl.LDefaultInternalName,"",!0));if(!b._IsIEEditableIframe(g,1)||!b._IsMozillaEditableIframe(g,1))return b._DisableInput=1,!0;b._DisableInput=0;b._JustActivatedKeymanWebUI||(b._DeadKeys=[],b._NotifyKeyboard(0,g,1));!b._JustActivatedKeymanWebUI&&b._SelectionControl!=g&&(b._IsActivatingKeymanWebUI=0);b._JustActivatedKeymanWebUI=0;b._SelectionControl=g;g._KeymanWebSelectionStart=g._KeymanWebSelectionEnd=null;b._SetTargDir(g);b.doControlFocused(d,b._ActiveControl);i.touchable?
a._Enabled=1:a.ready&&(b.isCJK()&&(a._Enabled=1),a._Enabled?a._Show():a._Hide(!1));return!0};b._IsIEEditableIframe=function(b,c){var a,e=b&&(a=b.tagName)&&"body"==a.toLowerCase()&&(a=b.ownerDocument)&&a.parentWindow;return!c&&e||c&&(!e||b.isContentEditable)};b._IsMozillaEditableIframe=function(b,c){var a,e=b&&(a=b.defaultView)&&a.frameElement;return!c&&e||c&&(!e||"on"==a.document.designMode.toLowerCase())};b._ControlBlur=function(g){var c;if(!b._Enabled)return!0;g=b._GetEventObject(g);if(!g)return!0;
if(g.target)c=g.target;else if(g.srcElement)c=g.srcElement;else return!0;b._ActiveElement=null;i.touchable&&b.hideCaret();3==c.nodeType&&(c=c.parentNode);"IFRAME"==c.tagName&&(c=c.contentWindow.document);c.setSelectionRange&&(c._KeymanWebSelectionStart=c.value._kmwCodeUnitToCodePoint(c.selectionStart),c._KeymanWebSelectionEnd=c.value._kmwCodeUnitToCodePoint(c.selectionEnd));b._LastActiveElement=c;null!=b._ActiveControl&&null!=b._ActiveControl.LDefaultInternalName&&(b._ActiveControl.LDefaultInternalName=
null==b._ActiveKeyboard?"":b._ActiveKeyboard.KI);b._ActiveControl=null;b._IsActivatingKeymanWebUI||b._NotifyKeyboard(0,c,0);g=b._GetEventObject(g);b.doControlBlurred(c,g,b._IsActivatingKeymanWebUI);a.ready&&!b._IsActivatingKeymanWebUI&&a._Hide(!1);return!0};b.doControlBlurred=function(b,c,a){var e={};e.target=b;e.event=c;e.isActivating=a;return h.callEvent("kmw.controlblurred",e)};b.doControlFocused=function(b,c){var a={};a.target=b;a.activeControl=c;return h.callEvent("kmw.controlfocused",a)};b.doKeyboardRegistered=
function(b,c,a,e){return h.callEvent("kmw.keyboardregistered",{internalName:b,language:c,keyboardName:a,languageCode:e})};b.doKeyboardUnregistered=function(){return h.callEvent("kmw.keyboardregistered",{})};b.doKeyboardLoaded=function(b){var c={};c.keyboardName=b;return h.callEvent("kmw.keyboardloaded",c)};b.doBeforeKeyboardChange=function(b,c){var a={};a.internalName=b;a.languageCode=c;return h.callEvent("kmw.beforekeyboardchange",a)};b.doKeyboardChange=function(b,c,a){var e={};e.internalName=b;
e.languageCode=c;e.indirect=2<arguments.length?a:!1;return h.callEvent("kmw.keyboardchange",e)};b.doUnloadOSK=function(){return h.callEvent("kmw.unloadosk",{})};b.doLoadUI=function(){return h.callEvent("kmw.loaduserinterface",{})};b.doUnloadUI=function(){return h.callEvent("kmw.unloaduserinterface",{})};b._BubbledFocus=function(){};window.addEventListener&&window.addEventListener("focus",b._BubbledFocus,!0);b._GetKeyEventProperties=function(a){var c={},a=b._GetEventObject(a);if(!a||!0===a.cancelBubble)return null;
if(a.target)c.Ltarg=a.target;else if(a.srcElement)c.Ltarg=a.srcElement;else return null;3==c.Ltarg.nodeType&&(c.Ltarg=c.Ltarg.parentNode);if(a.keyCode)c.Lcode=a.keyCode;else if(a.which)c.Lcode=a.which;else return null;c.Lmodifiers=(a.shiftKey?16:0)|(a.ctrlKey?32:0)|(a.altKey?64:0);c.LisVirtualKeyCode="undefined"!=typeof a.charCode&&null!=a.charCode&&(0==a.charCode||0!=(c.Lmodifiers&96));c.LisVirtualKey=c.LisVirtualKeyCode||"keypress"!=a.type;return c};b._SelectionChange=function(){if(b._IgnoreNextSelChange)b._IgnoreNextSelChange--;
else{var a=document.selection;if("control"!=a.type.toLowerCase()&&(a=a.createRange(),!b._Selection||!b._Selection.isEqual(a)))b._Selection=a,b._DeadKeys=[]}return!0};b._FindCaret=function(a){if(!a.createTextRange&&a.selectionStart){var c=document.createEvent("KeyboardEvent");if(c.initKeyEvent){c.initKeyEvent("keypress",!0,!0,null,!1,!1,!1,!1,0,32);var d=b._KeyPress;b._KeyPress=function(){};a.dispatchEvent(c);c=document.createEvent("KeyboardEvent");c.initKeyEvent("keypress",!0,!0,null,!1,!1,!1,!1,
8,0);a.dispatchEvent(c);b._KeyPress=d}}};b._NotifyKeyboard=function(a,c,d){null!=b._ActiveKeyboard&&"function"==typeof b._ActiveKeyboard.KNS&&b._ActiveKeyboard.KNS(a,c,d)};b._KeyDown=function(g){var c;b._KeyPressToSwallow=0;if(!b._Enabled||b._DisableInput||null==b._ActiveKeyboard||null!=b._ActiveControl&&!b._ActiveControl.LEnabled)return!0;var d=h.eventTarget(g);if(i.touchable){if(d&&"undefined"!=typeof d.kmwInput&&!1==d.kmwInput)return!0}else if(d&&0<=d.className.indexOf("kmw-disabled"))return!0;
if(!a.ready)return!0;d=b._GetKeyEventProperties(g);if(null==d)return!0;switch(d.Lcode){case 8:b._DeadKeys=[];break;case 16:case 17:case 18:return b._NotifyKeyboard(d.Lcode,d.Ltarg,1),a._UpdateVKShift(d,d.Lcode-15,1)}(c=d.Ltarg.ownerDocument)&&((c=c.selection)&&(33>d.Lcode||40<d.Lcode))&&c.createRange().select();!window.event&&b._VKMap_FF_IE["k"+d.Lcode]&&(d.Lcode=b._VKMap_FF_IE["k"+d.Lcode]);if(b._ActiveKeyboard.KM){if(8==d.Lcode)return b._KeyPressToSwallow=1,b.callKeyboardStartGroup(d.Ltarg,d)||
b.KO(1,b._LastActiveElement,""),!1;b._KeyPressToSwallow=0}else{var e=0;if((c=b._VKMap[a._BaseLayout])&&c["k"+d.Lcode])d.Lcode=c["k"+d.Lcode];"undefined"==typeof b._ActiveKeyboard.KM&&!(d.Lmodifiers&96)&&(c={Lcode:b._USKeyCodeToCharCode(d),Ltarg:d.Ltarg,Lmodifiers:0,LisVirtualKey:0},b.callKeyboardStartGroup(c.Ltarg,c)&&(e=1));e=e||b.callKeyboardStartGroup(d.Ltarg,d);8==d.Lcode&&(!e&&null!=d.Ltarg.className&&0<=d.Ltarg.className.indexOf("keymanweb-input"))&&b.KO(1,b._LastActiveElement,"")}!e&&(96<=
d.Lcode&&111>=d.Lcode)&&(b.KO(0,d.Ltarg,String._kmwFromCharCode(106>d.Lcode?d.Lcode-48:d.Lcode-64)),e=1);if(e)return b._FindCaret(d.Ltarg),g&&g.preventDefault&&g.preventDefault(),b._KeyPressToSwallow=g?g.keyCode:0,!1;b._KeyPressToSwallow=0;return 8==d.Lcode&&null!=d.Ltarg.className&&0<=d.Ltarg.className.indexOf("keymanweb-input")?!1:!0};b.callKeyboardStartGroup=function(a,c){b._CachedSelectionStart=null;b._DeadkeyResetMatched();b.cachedContext.reset();return b._ActiveKeyboard.gs(a,c)};b._KeyPress=
function(a){var c;if(!b._Enabled||b._DisableInput||null==b._ActiveKeyboard||null!=b._ActiveControl&&!b._ActiveControl.LEnabled)return!0;c=b._GetKeyEventProperties(a);if(null==c||c.LisVirtualKey)return!0;if(!b._ActiveKeyboard.KM){if(!b._KeyPressToSwallow||32>c.Lcode||b._BrowserIsSafari&&63232<c.Lcode&&63744>c.Lcode)return!0;if(a=b._GetEventObject(a))a.returnValue=!1;return!1}if(b._KeyPressToSwallow||b.callKeyboardStartGroup(c.Ltarg,c))return b._KeyPressToSwallow=0,a&&a.preventDefault&&a.preventDefault(),
b._FindCaret(c.Ltarg),!1;b._KeyPressToSwallow=0;return!0};b._KeyUp=function(g){g=b._GetKeyEventProperties(g);if(null==g||!a.ready)return!0;switch(g.Lcode){case 13:if("TEXTAREA"==g.Ltarg.nodeName)break;"search"==g.Ltarg.type||"submit"==g.Ltarg.type?g.Ltarg.form.submit():b.moveToNext(!1);return!0;case 16:case 17:case 18:return b._NotifyKeyboard(g.Lcode,g.Ltarg,0),a._UpdateVKShift(g,g.Lcode-15,1)}var c;if((c=g.Ltarg.ownerDocument)&&(c=c.selection)&&"control"!=c.type)c=c.createRange(),b._Selection=c;
return!1};b.moveToNext=function(a){var c,d=b.sortedInputs,e=b._ActiveElement;i.touchable&&(e=e.base);for(c=0;c<d.length&&d[c]!=e;c++);c=a?c-1:c+1;c>=d.length&&(c-=d.length);0>c&&(c+=d.length);i.touchable?(b.focusing=!0,a=d[c].kmw_ip,"undefined"==typeof a?d[c].focus():(b._ActiveElement=b._LastActiveElement=a,b.setTextCaret(a,1E4),b.scrollInput(a))):d[c].focus()};b.moveToElement=function(a){"string"==typeof a&&(a=document.getElementById(a));i.touchable&&a.kmw_ip?a.kmw_ip.focus():a.focus()};b._SetActiveKeyboard=
function(g,c,d){var e,f,n;n=2>arguments.length||!c?"---":c;for(e=0;e<b._KeyboardStubs.length&&!(g==b._KeyboardStubs[e].KI&&(n==b._KeyboardStubs[e].KLC||"---"==n));e++);if(i.touchable&&(""==g||null==g||e>=b._KeyboardStubs.length))g=b._KeyboardStubs[0].KI,n=b._KeyboardStubs[0].KLC;2<arguments.length&&d&&b.saveCurrentKeyboard(g,n);if(!b._ActiveStub||!b._ActiveKeyboard||!(b._ActiveKeyboard.KI==g&&b._ActiveStub.KI==g&&b._ActiveStub.KLC==c&&!b.mustReloadKeyboard)){if(b._ActiveKeyboard&&b._ActiveKeyboard.KI==
g)for(f=0;f<b._KeyboardStubs.length;f++)if(b._KeyboardStubs[f].KI==g&&b._KeyboardStubs[f].KLC==c){b._ActiveStub=b._KeyboardStubs[f];a.appendStyleSheet();b.mustReloadKeyboard&&a._Load();return}b._ActiveKeyboard=null;b._ActiveStub=null;if(""==g)a._Hide(!1);else{for(f=0;f<b._Keyboards.length;f++)if(b._Keyboards[f].KI==g){b._ActiveKeyboard=b._Keyboards[f];b._SetTargDir(b._LastActiveElement);for(e=0;e<b._KeyboardStubs.length;e++)if(b._KeyboardStubs[e].KI==g&&b._KeyboardStubs[e].KLC==c){b._ActiveStub=b._KeyboardStubs[e];
break}break}if("undefined"==c||""==c)c="---";if(null==b._ActiveKeyboard){for(f=0;f<b._KeyboardStubs.length;f++)if(b._KeyboardStubs[f].KI==g&&(b._KeyboardStubs[f].KLC==c||"---"==c)){if(b.isCJK(b._KeyboardStubs[f])||i.touchable)a._Enabled=1;if(null==b._LoadingInternalName||b._LoadingInternalName!=g)a.ready&&a._Hide(!1),b._LoadingInternalName=g,null!=b.loadTimer&&window.clearTimeout(b.loadTimer),b.loadTimer=null,b.loadTimer="function"==typeof b.keyboardUnavailable?b.keyboardUnavailable(f):null,e="Installing keyboard<br/>"+
b._KeyboardStubs[f].KN.replace(/\s*keyboard\s*/i,""),"function"==typeof h.wait&&h.wait(e),window.setTimeout(function(){b.installKeyboard(b._KeyboardStubs[f].KF)},0);b._ActiveStub=b._KeyboardStubs[f];return}b._SetTargDir(b._LastActiveElement)}e=b._ActiveKeyboard;null!==e&&String.kmwEnableSupplementaryPlane(e&&(e.KS&&1==e.KS||"Hieroglyphic"==e.KN));a._Load()}}};b.installKeyboard=function(a){var c=h._CreateElement("SCRIPT");c.charset="UTF-8";c.src=b.getKeyboardPath(a);c.type="text/javascript";try{document.body.appendChild(c)}catch(d){document.getElementsByTagName("head")[0].appendChild(c)}};
b.setDfltKeyboard=function(){b._SetActiveKeyboard("Keyboard_us","eng",!0);b.doKeyboardChange("Keyboard_us","eng",!0)};b.isCJK=function(a){var c=b._ActiveKeyboard,d="";0<arguments.length&&(c=a);c&&("undefined"!=typeof c.KLC?d=c.KLC:"undefined"!=typeof c.LanguageCode&&(d=c.LanguageCode));return"cmn"==d||"jpn"==d||"kor"==d};b.isCJK=b.isCJK;b.setActiveKeyboard=function(a,c){b.doBeforeKeyboardChange(a,c);b._SetActiveKeyboard(a,c,!0);null!=b._LastActiveElement&&b._FocusLastActiveElement();b.doKeyboardChange(a,
c)};b.getActiveKeyboard=function(){return null==b._ActiveKeyboard?"":b._ActiveKeyboard.KI};b.getActiveLanguage=function(){return null==b._ActiveStub?"":b._ActiveStub.KLC};b.getKeyboard=function(a,c){var d,e;for(d=0;d<b._KeyboardStubs.length;d++)if(e=b._GetKeyboardDetail(b._KeyboardStubs[d]),e.InternalName==a&&(2>arguments.length||e.LanguageCode==c))return e;return null};b.GetKeyboardDetail=function(a){for(var c=b.getKeyboards(),d=0;d<c.length;d++)if(c[d].InternalName==a)return c[d];return null};b._GetKeyboardDetail=
function(a){var c=[];c.Name=a.KN;c.InternalName=a.KI;c.LanguageName=a.KL;c.LanguageCode=a.KLC;c.RegionName=a.KR;c.RegionCode=a.KRC;c.CountryName=a.KC;c.CountryCode=a.KCC;c.KeyboardID=a.KD;c.Font=a.KFont;c.OskFont=a.KOskFont;return c};b.getKeyboards=function(){var a=[],c,d;for(c=0;c<b._KeyboardStubs.length;c++)d=b._KeyboardStubs[c],d=b._GetKeyboardDetail(d),a=b._push(a,d);return a};b._WindowUnload=function(){b.doUnloadUI();a.ready&&a._Unload();b._LastActiveElement=0};h.attachDOMEvent(window,"load",
function(){document.body.scrollTop=0;"undefined"!=typeof document.documentElement&&(document.documentElement.scrollTop=0)},!1);h.attachDOMEvent(window,"unload",b._WindowUnload,!1);b._AttachToControls=function(a){for(var c=a.getElementsByTagName("INPUT"),d=a.getElementsByTagName("TEXTAREA"),e=a.getElementsByTagName("IFRAME"),a=document.evaluate?document.evaluate('//*[@contenteditable and @contenteditable != "false"]',document,null,XPathResult.ANY_TYPE,null):null,f=0;f<c.length;f++)"text"==c[f].type.toLowerCase()&&
b.attachToControl(c[f]);for(f=0;f<d.length;f++)b.attachToControl(d[f]);for(f=0;f<e.length;f++)try{e[f].contentWindow.document&&b._AttachToIframe(e[f])}catch(h){}if(a)for(c=a.iterateNext();c;c=a.iterateNext())b.attachToControl(c);for(f=0;f<b.inputList.length;f++)b.attachToControl(b.inputList[f])};b.fixPath=function(a){if(0==a.length)return a;var c=a.substr(a.length-1,1);return"/"==c||"\\"==c?a:a+"/"};b.init=b.init=function(g){var c,d,e,f,n,k;d=function(c){if(0==c.length)return c;"/"!=c.substr(c.length-
1,1)&&(c+="/");return"http"==c.replace(/^(http)s?:.*/,"$1")||"file"==c.replace(/^(file):.*/,"$1")?c:"//"==c.substr(0,2)?b.protocol+c:"/"==c.substr(0,1)?b.rootPath+c.substr(1):b.srcPath+c};c=b.options;if("object"==typeof g&&null!==g)for(f in c)g.hasOwnProperty(f)&&(c[f]=g[f]);""!=c.root&&(b.rootPath=d(c.root));""==c.resources&&(c.resources=b.srcPath);c.resources=d(c.resources);c.keyboards=d(c.keyboards);c.fonts=d(c.fonts);""==c.attachType&&(c.attachType=i.touchable?"manual":"auto");b.setDefaultDeviceOptions(c);
if(!b.initialized)if("complete"!==document.readyState)window.setTimeout(function(){b.init(g)},50);else{b._MasterDocument=window.document;if(i.touchable){n=document.getElementsByTagName("textarea");k=document.getElementsByTagName("input");for(c=0;c<n.length;c++)if(e=n[c],d=e.className,e.kmwInput=!1,(!d||0>d.indexOf("kmw-disabled"))&&!e.readOnly)e.disabled=!0,e.kmwInput=!0;for(c=0;c<k.length;c++)if(e=k[c],d=e.className,e.kmwInput=!1,(!d||0>d.indexOf("kmw-disabled"))&&!e.readOnly)if("text"==e.type||
"search"==e.type)e.disabled=!0,e.kmwInput=!0}"Android"==i.OS&&(i.dpi=h.getDPI(),i.formFactor=screen.height<4*i.dpi||screen.width<4*i.dpi?"phone":"tablet");window.removeEventListener&&window.removeEventListener("focus",b._BubbledFocus,!0);"manual"!=b.options.attachType&&b._AttachToControls(document);b.initialized=1;a.prepare();h.prepareWait();b.addKeyboardArray(b.deferredStubs);for(c=0;c<b.deferredKRS.length;c++)b.KRS(b.deferredKRS[c]);b.initializeUI();for(c=0;c<b.deferredKR.length;c++)b.KR(b.deferredKR[c]);
b.fullInitialization&&(b.appliedFont=b.baseFont=b.getBaseFont(),b.listInputs(),i.touchable&&b.handleRotationEvents(),i.touchable?b.setupTouchDevice():b.setupDesktopPage(),6==h._GetIEVersion()&&(a.shim=h.createShim()),i.touchable&&(a._Box.addEventListener("touchend",function(c){c.stopPropagation()},!1),c=document.createElement("DIV"),d=c.style,d.width="100%",d.height=screen.width/2+"px",document.body.appendChild(c),"Android"==i.OS&&0<navigator.userAgent.indexOf("Chrome")?(b.hideOskWhileScrolling=function(c){if(typeof a._Box!=
"undefined"&&typeof a._Box.style!="undefined"){f=c.target.parentNode;if(typeof f!="undefined"&&f!=null){if(f.className.indexOf("keymanweb-input")>=0||f.className.indexOf("kmw-key-")>=0)return;if(typeof f.parentNode!="undefined"){f=f.parentNode;if(f.className.indexOf("keymanweb-input")>=0||f.className.indexOf("kmw-key-")>=0)return}}a.hideNow()}},document.body.addEventListener("touchstart",b.hideOskWhileScrolling,!1)):(b.conditionallyHideOsk=function(){b.hideOnRelease&&!a.lgList&&a.hideNow();b.hideOnRelease=
false},b.hideOskIfOnBody=function(c){b.touchY=c.touches[0].screenY;b.hideOnRelease=true},b.cancelHideIfScrolling=function(c){var c=c.touches[0].screenY,a=b.touchY;if(c-a>5||a-c<5)b.hideOnRelease=false},document.body.addEventListener("touchstart",b.hideOskIfOnBody,!1),document.body.addEventListener("touchmove",b.cancelHideIfScrolling,!1),document.body.addEventListener("touchend",b.conditionallyHideOsk,!1))),a.shim&&document.body.appendChild(a.shim),document.selection&&!b.legacy&&h.attachDOMEvent(document,
"selectionchange",b._SelectionChange),"manual"!=b.options.attachType&&(document.attachEvent?document.attachEvent("onfocusin",b._IEFocusIn):document.addEventListener&&document.addEventListener("DOMNodeInserted",b._DOMNodeInserted,!0)),b.restoreCurrentKeyboard(),b.initialized=2)}};b.listInputs=function(){var a,c=[],d=document.getElementsByTagName("INPUT"),e=document.getElementsByTagName("TEXTAREA");for(a=0;a<d.length;a++)switch(d[a].type){case "text":case "search":case "email":case "url":0>d[a].className.indexOf("kmw-disabled")&&
c.push({ip:d[a],x:h._GetAbsoluteX(d[a]),y:h._GetAbsoluteY(d[a])})}for(a=0;a<e.length;a++)0>e[a].className.indexOf("kmw-disabled")&&c.push({ip:e[a],x:h._GetAbsoluteX(e[a]),y:h._GetAbsoluteY(e[a])});c.sort(function(c,a){return c.y!=a.y?c.y-a.y:c.x-a.x});d=[];for(a=0;a<c.length;a++)d.push(c[a].ip);b.sortedInputs=d};b.initializeUI=function(){"function"==typeof b.ui.initialize?(b.ui.initialize(),a._Show()):window.setTimeout(b.initializeUI,1E3)};b.isPositionSynthesized=function(){return i.touchable};b._SelPos=
function(a){var c,d=999>h._GetIEVersion();if(b.isPositionSynthesized())return b.getTextCaret(a);if(a._KeymanWebSelectionStart)return a._KeymanWebSelectionStart;if(a.setSelectionRange)return a.value.substr(0,a.selectionStart)._kmwLength();if((c=a.ownerDocument)&&(c=c.defaultView)&&c.getSelection&&"on"==a.ownerDocument.designMode.toLowerCase()){if(a=c.getSelection(),3==a.focusNode.nodeType)return a.focusNode.substringData(0,a.focusOffset)._kmwLength()}else if(d){if("string"==typeof a.value)return c=
b.getInputSelection(a),a.value.substr(0,c.start)._kmwLength();if(a=a.body?a:a.ownerDocument)c=a.selection;else return 0;a=c.createRange();a.moveStart("textedit",-1);return a.text._kmwLength()}return 0};b.getInputSelection=function(a){var c=0,b=0,e="",f,h=0;if("number"==typeof a.selectionStart&&"number"==typeof a.selectionEnd)c=a.selectionStart,b=a.selectionEnd;else if((f=document.selection.createRange())&&f.parentElement()==a)h=a.value.length,e=a.value.replace(/\r\n/g,"\n"),b=a.createTextRange(),
b.moveToBookmark(f.getBookmark()),a=a.createTextRange(),a.collapse(!1),-1<b.compareEndPoints("StartToEnd",a)?c=b=h:(c=-b.moveStart("character",-h),c+=e.slice(0,c).split("\n").length-1,-1<b.compareEndPoints("EndToEnd",a)?b=h:(b=-b.moveEnd("character",-h),b+=e.slice(0,b).split("\n").length-1));return{start:c,end:b}};b._DeadkeyResetMatched=function(){var a,c=b._DeadKeys;for(a=0;a<c.length;a++)c[a].matched=0};b._DeadkeyDeleteMatched=function(){var a,c=b._DeadKeys;for(a=0;a<c.length;a++)c[a].matched&&
c.splice(a,1)};b._DeadkeyAdjustPos=function(a,c){var d,e=b._DeadKeys;for(d=0;d<e.length;d++)e[d].p>a&&(e[d].p+=c)};b._SetTargDir=function(a){var c=null!=b._ActiveKeyboard&&b._ActiveKeyboard.KRTL?"rtl":"ltr";a&&(i.touchable?0==a.textContent.length&&(a.base.dir=a.dir=c,b.setTextCaret(a,1E4)):0==a.value.length&&(a.dir=c))};b._IEFocusIn=function(){var a=b._GetEventObject(null);a&&(a=a.srcElement,null!=a&&!b._IsAttached(a)&&("input"==a.tagName.toLowerCase()&&"text"==a.type.toLowerCase()||"textarea"==a.tagName.toLowerCase()||
"iframe"==a.tagName.toLowerCase())&&b.attachToControl(a))};b._DOMNodeInserted=function(a){a=a.target;null!=a&&1==a.nodeType&&b._AttachToControls(a)};b._ResetVKShift=function(){b._IsActivatingKeymanWebUI||a._UpdateVKShift&&a._UpdateVKShift(null,15,0)};b.addHotKey=b.addHotKey=function(a,c,d){for(var e=0;e<b._HotKeys.length;e++)if(b._HotKeys[e].Code==a&&b._HotKeys[e].Shift==c){b._HotKeys[e].Handler=d;return}b._HotKeys.push({Code:a,Shift:c,Handler:d})};b.removeHotKey=b.removeHotKey=function(a,c){for(var d=
0;d<b._HotKeys.length;d++)if(b._HotKeys[d].Code==a&&b._HotKeys[d].Shift==c){b._HotKeys.splice(d,1);break}};b._ProcessHotKeys=function(a){a||(a=window.event);if(a.keyCode)var c=a.keyCode;else if(a.which)c=a.which;else return 0;for(var d=(a.shiftKey?16:0)|(a.ctrlKey?32:0)|(a.altKey?64:0),e=0;e<b._HotKeys.length;e++)if(c==b._HotKeys[e].Code&&d==b._HotKeys[e].Shift)return b._HotKeys[e].Handler(),a.returnValue=0,a&&a.preventDefault&&a.preventDefault(),a.cancelBubble=!0,!1;return!0};h.attachDOMEvent(document,
"keyup",b._ProcessHotKeys,!1);b.saveCurrentKeyboard=function(a,c){h.saveCookie("KeymanWeb_Keyboard",{current:a+":"+c})};b.restoreCurrentKeyboard=function(){var a=b._KeyboardStubs,c,d=a.length;if(!(1>a.length)){c=b.getSavedKeyboard();var e=c.split(":"),e=c.split(":");2>e.length&&(e[1]="");for(c=0;c<d&&!(a[c].KI==e[0]&&(a[c].KLC==e[1]||""==e[1]));c++);if(c<d||null==b._ActiveKeyboard)b._SetActiveKeyboard(e[0],e[1],!1),b.doKeyboardChange(e[0],e[1])}};b.getSavedKeyboard=b.getSavedKeyboard=function(){var a=
h.loadCookie("KeymanWeb_Keyboard");if("string"!=typeof a.current)return"Keyboard_us:eng";var c,d=b._KeyboardStubs,e;for(c=0;c<d.length;c++)if(e=d[c].KI+":"+d[c].KLC,e==a.current)return e;for(c=0;c<d.length;c++)if(e=d[c].KI+":"+d[c].KLC,"Keyboard_us:eng"==e)return e;return 0<d.length?d[0].KI+":"+d[0].KLC:"Keyboard_us:eng"};h.attachDOMEvent(window,"focus",b._ResetVKShift,!1);h.attachDOMEvent(window,"blur",b._ResetVKShift,!1);String.kmwEnableSupplementaryPlane(!1)})();(function(){var b=window.tavultesoft.keymanweb,a=b.osk,h=b.util,i=h.device;a.keyCodes={K_BKSP:8,K_TAB:9,K_ENTER:13,K_SHIFT:16,K_CONTROL:17,K_ALT:18,K_PAUSE:19,K_CAPS:20,K_ESC:27,K_SPACE:32,K_PGUP:33,K_PGDN:34,K_END:35,K_HOME:36,K_LEFT:37,K_UP:38,K_RIGHT:39,K_DOWN:40,K_SEL:41,K_PRINT:42,K_EXEC:43,K_INS:45,K_DEL:46,K_HELP:47,K_0:48,K_1:49,K_2:50,K_3:51,K_4:52,K_5:53,K_6:54,K_7:55,K_8:56,K_9:57,K_A:65,K_B:66,K_C:67,K_D:68,K_E:69,K_F:70,K_G:71,K_H:72,K_I:73,K_J:74,K_K:75,K_L:76,K_M:77,K_N:78,K_O:79,K_P:80,
K_Q:81,K_R:82,K_S:83,K_T:84,K_U:85,K_V:86,K_W:87,K_X:88,K_Y:89,K_Z:90,K_NP0:96,K_NP1:97,K_NP2:98,K_NP3:99,K_NP4:100,K_NP5:101,K_NP6:102,K_NP7:103,K_NP8:104,K_NP9:105,K_NPSTAR:106,K_NPPLUS:107,K_SEPARATOR:108,K_NPMINUS:109,K_NPDOT:110,K_NPSLASH:111,K_F1:112,K_F2:113,K_F3:114,K_F4:115,K_F5:116,K_F6:117,K_F7:118,K_F8:119,K_F9:120,K_F10:121,K_F11:122,K_F12:123,K_NUMLOCK:144,K_SCROLL:145,K_LSHIFT:160,K_RSHIFT:161,K_LCONTROL:162,K_RCONTROL:163,K_LALT:164,K_RALT:165,K_COLON:186,K_EQUAL:187,K_COMMA:188,K_HYPHEN:189,
K_PERIOD:190,K_SLASH:191,K_BKQUOTE:192,K_LBRKT:219,K_BKSLASH:220,K_RBRKT:221,K_QUOTE:222,K_oE2:226,K_LOPT:50001,K_ROPT:50002,K_NUMERALS:50003,K_SYMBOLS:50004,K_CURRENCIES:50005,K_UPPER:50006,K_LOWER:50007,K_ALPHA:50008,K_SHIFTED:50009,K_ALTGR:50010,K_TABBACK:50011,K_TABFWD:50012};var j=[["0123456789",";=,-./`","[\\]'"],[")!@#$%^&*(",":+<_>?~",'{|}"']],g="K_BKQUOTE K_1 K_2 K_3 K_4 K_5 K_6 K_7 K_8 K_9 K_0 K_HYPHEN K_EQUAL K_* K_* K_* K_Q K_W K_E K_R K_T K_Y K_U K_I K_O K_P K_LBRKT K_RBRKT K_BKSLASH K_* K_* K_* K_A K_S K_D K_F K_G K_H K_J K_K K_L K_COLON K_QUOTE K_* K_* K_* K_* K_* K_oE2 K_Z K_X K_C K_V K_B K_N K_M K_COMMA K_PERIOD K_SLASH K_* K_* K_* K_* K_* K_SPACE".split(" ");
a._Box=null;a._DivVKbd=null;a._DivVKbdHelp=null;a._Visible=0;a._Enabled=1;a._VShift=[];a._VKeySpans=[];a._VKeyDown=null;a._VKbdContainer=null;a._VOriginalWidth=1;a._BaseLayout="us";a._BaseLayoutEuro={};a._BaseLayoutEuro.se="\u00a71234567890+\u00b4~~~QWERTYUIOP\u00c5\u00a8'~~~ASDFGHJKL\u00d6\u00c4~~~~~<ZXCVBNM,.-~~~~~ ";a._BaseLayoutEuro.uk="`1234567890-=~~~QWERTYUIOP[]#~~~ASDFGHJKL;'~~~~~\\ZXCVBNM,./~~~~~ ";a.lgTimer=null;a.lgKey=null;a.hkKey=null;a.spaceBar=null;a.lgList=null;a.frameColor="#ad4a28";
a.keyPending=null;a.fontFamily="";a.fontSize="1em";a.layout=null;a.layers=null;a.layerId="default";a.nextLayer="default";a.layerIndex=0;a.currentKey="";a.subkeyDelayTimer=null;a.popupPending=!1;a.popupVisible=!1;a.popupCallout=null;a.styleSheet=null;a.loadRetry=0;a.popupDelay=500;a.currentTarget=null;a.touchCount=0;a.touchX=0;a.x=99;a.y=0;a.width=1;a.height=1;a.rowHeight=1;a.nRows=1;a.vpScale=1;a.closeButton=null;a.resizeIcon=null;a.resizing=0;a.pinImg=null;a.userPositioned=0;a.dfltX="";a.dfltY="";
a.noDrag=!1;a.shim=null;a.keytip=null;a.touchY=0;a.addCallout=function(){};a.addEventListener=function(c,a){return h.addEventListener("osk."+c,a)};a._TitleBarInterior=function(){var c=h._CreateElement("DIV"),d=c.style;d.paddingLeft="2px";d.cursor="move";d.background="#ad4a28";d.font="8pt Tahoma,Arial,sans-serif";d=h._CreateElement("DIV");d.className="kmw-title-bar-actions";d.onmousedown=a._CancelMouse;var e=h._CreateElement("DIV");e.className="kmw-close-button";e.onmousedown=a._CancelMouse;e.onclick=
function(){a._Hide(!0)};a.closeButton=e;d.appendChild(e);a.restorePosition=function(){a._Visible&&(b._FocusLastActiveElement(),a.loadCookie(),a.userPositioned=!1,a.saveCookie(),a._Show(),a.doResizeMove());a.pinImg&&(a.pinImg.style.display="none");window.event&&(window.event.returnValue=!1)};e=a.pinImg=h._CreateElement("DIV");e.className="kmw-pin-image";e.title="Pin the On Screen Keyboard to its default location on the active text box";e.onclick=a.restorePosition;e.onmousedown=a._CancelMouse;e.style.display=
"none";i.touchable||d.appendChild(e);c.appendChild(d);e=b._TitleElement=h._CreateElement("SPAN");e.className="kmw-title-bar-caption";e.innerHTML="Tavultesoft KeymanWeb";c.appendChild(e);return c};a.isEnabled=a.isEnabled=function(){return a._Enabled};a.isVisible=a.isVisible=function(){return a._Visible};a.getRect=a.getRect=function(){var c={};a._DivVKbd?(c.left=c.left=h._GetAbsoluteX(a._DivVKbd),c.top=c.top=h._GetAbsoluteY(a._DivVKbd),c.width=c.width=h._GetAbsoluteX(a._DivVKbdHelp)-h._GetAbsoluteX(a._DivVKbd)+
a._DivVKbdHelp.offsetWidth,c.height=c.height=h._GetAbsoluteY(a._DivVKbdHelp)-h._GetAbsoluteY(a._DivVKbd)+a._DivVKbdHelp.offsetHeight):(c.left=c.left=h._GetAbsoluteX(a._Box),c.top=c.top=h._GetAbsoluteY(a._Box),c.width=c.width=h._GetAbsoluteX(a._Box)+a._Box.offsetWidth,c.height=c.height=h._GetAbsoluteY(a._Box)+a._Box.offsetHeight);return c};a.setRect=a.setRect=function(c){if(!(null==a._Box||"desktop"!=i.formFactor)){var b=a._Box,e=b.style;"left"in c&&(e.left=c.left-h._GetAbsoluteX(b)+b.offsetLeft+"px",
a.dfltX=e.left);"top"in c&&(e.top=c.top-h._GetAbsoluteY(b)+b.offsetTop+"px",a.dfltY=e.top);if(null!=a._DivVKbd){var f=a._DivVKbd,e=f.style;if("width"in c){var g=c.width-(b.offsetWidth-f.offsetWidth);g<0.2*screen.width&&(g=0.2*screen.width);g>0.9*screen.width&&(g=0.9*screen.width);e.width=g+"px";a.width=g}"height"in c&&(b=c.height-(b.offsetHeight-f.offsetHeight),b<0.1*screen.height&&(b=0.1*screen.height),b>0.5*screen.height&&(b=0.5*screen.height),e.height=b+"px",e.fontSize=b/8+"px",a.height=b);"nosize"in
c&&a.resizeIcon&&(a.resizeIcon.style.display=c.nosize?"none":"block")}"nomove"in c&&(a.noDrag=c.nomove,a.pinImg&&(a.pinImg.style.display=c.nomove||!a.userPositioned?"none":"block"));a.saveCookie()}};a.getPos=function(){var c=a._Box,b={};b.left=a._Visible?c.offsetLeft:a.x;b.top=a._Visible?c.offsetTop:a.y;return b};a.setPos=a.setPos=function(c){if(!("undefined"==typeof a._Box||i.touchable)){if(a.userPositioned){var b=c.left,c=c.top;"undefined"!=typeof b&&(b<-0.8*a._Box.offsetWidth&&(b=-0.8*a._Box.offsetWidth),
a.userPositioned&&(a._Box.style.left=b+"px",a.x=b));"undefined"!=typeof c&&(0>c&&(c=0),a.userPositioned&&(a._Box.style.top=c+"px",a.y=c))}a.pinImg&&(a.pinImg.style.display=a.userPositioned?"block":"none")}};a._VKeyGetTarget=function(c){c=b._GetEventObject(c);if(!c)return null;if(c.target)c=c.target;else if(c.srcElement)c=c.srcElement;else return null;3==c.nodeType&&(c=c.parentNode);"SPAN"==c.tagName&&(c=c.parentNode);return c};a.highlightKey=function(c,b){if(c&&!(""==c.className||0<=c.className.indexOf("kmw-key-row"))){var e=
c.className;null!=a.keytip&&0>e.indexOf("kmw-key-shift")&&0>e.indexOf("kmw-spacebar")&&0>c.id.indexOf("popup")?a.showKeyTip(c,b):b&&0>e.indexOf(" kmw-key-touched")?(c.className=e+" kmw-key-touched",a.showKeyTip(null,!1)):c.className=e.replace(" kmw-key-touched","")}};a.showSubKeys=function(c){if(null!=a.keyPending){var b=document.createElement("DIV"),e,f,g,k,j,o;b.id="kmw-popup-keys";a.popupBaseKey=c;e=c.id.split("-");var l=e[e.length-1];if("phone"==i.formFactor&&c.subKeys[0].id!=l){l={id:l,layer:""};
1<e.length&&(l.layer=e[0]);for(e=0;e<c.childNodes.length&&!a.hasClass(c.childNodes[e],"kmw-key-text");e++);e<c.childNodes.length&&(l.text=c.childNodes[e].textContent);c.subKeys.splice(0,0,l)}e=b.style;e.bottom=parseInt(c.style.bottom,10)+parseInt(c.style.height,10)+4+"px";e.fontFamily=a.fontFamily;e.fontSize=h.getStyleValue(c,"font-size");e.visibility="hidden";var l=c.subKeys.length,p,q;p=Math.min(Math.ceil(l/9),2);q=Math.ceil(l/p);1<p&&(e.width=q*c.offsetWidth+5*q+"px");for(e=0;e<l;e++)f=c.subKeys[e],
j=document.createElement("DIV"),j.className="kmw-key-square-ex",j.keyId=f.id,g=j.style,o=Math.floor(e/q),1<p&&0<o&&(g.marginTop="5px"),j.width="undefined"!=typeof f.width?g.width=parseInt(f.width,10)*c.offsetWidth/100+"px":g.width=c.offsetWidth+"px",g.height=c.offsetHeight+"px",o=document.createElement("DIV"),a.setButtonClass(f,o),o.id="string"==typeof f.layer&&""!=f.layer?"popup-"+f.layer+"-"+f.id:"popup-default-"+f.id,"string"==typeof f.nextlayer&&""!=f.nextlayer&&(o.nextLayer=f.nextlayer),k=o.style,
k.height=g.height,k.width=g.width,k.position="absolute",g=h._CreateElement("SPAN"),g.className="kmw-key-text",null==f.text||""==f.text?(g.innerHTML="\u00a0","string"==typeof f.id&&/^U_[0-9A-F]{4}$/i.test(f.id)&&(g.innerHTML=String.fromCharCode(parseInt(f.id.substr(2),16)))):g.innerHTML=f.text,k=g.style,k.fontSize=a.fontSize,"string"==typeof f.font&&""!=f.font&&(k.fontFamily=f.font),"string"==typeof f.fontsize&&0!=f.fontsize&&(k.fontSize=f.fontsize),o.appendChild(g),j.appendChild(o),b.appendChild(j);
a.registerPopup(c)||(a.showKeyTip(null,!1),a._Box.appendChild(b),e=b.style,l=h._GetAbsoluteX(c)+0.5*(c.offsetWidth-b.offsetWidth),p=(h.landscapeView()?screen.height:screen.width)-b.offsetWidth,l>p&&(l=p),0>l&&(l=0),e.left=l+"px",a.popupCallout=a.addCallout(c),e.visibility="visible",b.shim=document.createElement("DIV"),b.shim.id="kmw-popup-shim",a._Box.appendChild(b.shim),"phone"==i.formFactor&&(c=b.childNodes[0].firstChild,a.keyPending=c,a.highlightKey(c,!0)))}};a.getVKDictionaryCode=function(c){if(!b._ActiveKeyboard.VKDictionary){var a=
[];if("string"==typeof b._ActiveKeyboard.KVKD)for(var e=b._ActiveKeyboard.KVKD.split(" "),f=0;f<e.length;f++)a[e[f]]=f+256;b._ActiveKeyboard.VKDictionary=a}return(c=b._ActiveKeyboard.VKDictionary[c])?c:0};a.selectLayer=function(c,b){var e=2>arguments.length?null:b;if(!e)switch(c){case "K_LSHIFT":case "K_RSHIFT":case "K_SHIFT":e="shift";break;case "K_LCONTROL":case "K_RCONTROL":case "K_LCTRL":case "K_RCTRL":case "K_CTRL":e="ctrl";break;case "K_LMENU":case "K_RMENU":case "K_LALT":case "K_RALT":case "K_ALT":e=
"alt";break;case "K_ALTGR":e="ctrlalt";break;case "K_CURRENCIES":case "K_NUMERALS":case "K_SHIFTED":case "K_UPPER":case "K_LOWER":case "K_SYMBOLS":e="default"}if(!e)return!1;a.updateLayer(e);a._Show();return!0};a.defaultKeyOutput=function(c,a,b){var f=0;"U_"==c.substr(0,2)&&32<a&&!(127<a&&!1>a)?f=String.fromCharCode(a):48<=a&&57>=a?f=j[b][0][a-48]:65<=a&&90>=a?f=String.fromCharCode(a+(b?0:32)):186<=a&&192>=a?f=j[b][1][a-186]:219<=a&&222>=a&&(f=j[b][2][a-219]);return f};a.clickKey=function(c){var d=
b._LastActiveElement,e,f,g,h=c.id.split("-");if(2>h.length)return!0;"popup"==h[0]&&h.splice(0,1);if(null!=d){var j=h[0],h=h[1];e=f=a.getModifierState(a.layerId);"undefined"!=typeof c.key&&(e=c.key.nextlayer);null==b._ActiveElement&&(b._ActiveElement=d);if("K_LOPT"==h||"K_ROPT"==h)return a.optionKey(c,h,!0),!0;a.highlightKey(c,!1);if(a.selectLayer(h,e))return!0;"K_SPACE"!=h&&(g=c.childNodes[0].innerHTML);e=d._KeymanWebSelectionStart;f=d._KeymanWebSelectionEnd;g=b._Selection;b._IsActivatingKeymanWebUI=
1;b._IgnoreNextSelChange=100;b._FocusLastActiveElement();b._IsMozillaEditableIframe(d,0)&&(d=d.documentElement);document.selection&&null!=g&&g.select();d._KeymanWebSelectionStart=e;d._KeymanWebSelectionEnd=f;b._IgnoreNextSelChange=0;b._CachedSelectionStart=null;b._DeadkeyDeleteMatched();e={Ltarg:d,Lmodifiers:0,Lcode:a.keyCodes[h],LisVirtualKey:!0};"U_"==h.substr(0,2)&&(e.LisVirtualKey=!1);"undefined"==typeof e.Lcode&&(e.Lcode=a.getVKDictionaryCode(h),!e.Lcode&&"U_"==h.substr(0,2)&&(f=parseInt(h.substr(2),
16),isNaN(f)||(e.Lcode=f)));f="undefined"==typeof c.key?null:c.key.layer;f=null==f?a.getModifierState(j):a.getModifierState(f);e.Lmodifiers=16*f;b._ActiveKeyboard&&b._ActiveKeyboard.KM?(g=c.firstChild.firstChild.wholeText,e.LisVirtualKey=!1,e.LisVirtualKeyCode=!1,e.vkCode=e.Lcode,32!=e.Lcode&&(e.Lcode="string"==typeof g&&""!=g?g.charCodeAt(0):0,160==e.Lcode&&(e.Lcode=0)),e.Lmodifiers=0):e.vkCode=e.Lcode;"undefined"==typeof b._ActiveKeyboard.KM&&(e.Lcode=b._USKeyCodeToCharCode(e),e.LisVirtualKey=!1);
if(!b._ActiveKeyboard||0!=e.Lcode&&!b._ActiveKeyboard.gs(d,e))switch(e.Lcode=e.vkCode,h){case "K_BKSP":b.KO(1,b._LastActiveElement,"");break;case "K_TAB":b.moveToNext("shift"==a.layerId);break;case "K_TABBACK":b.moveToNext(!0);break;case "K_TABFWD":b.moveToNext(!1);break;case "K_ENTER":"TEXTAREA"==d.nodeName||"undefined"!=typeof d.base&&"TEXTAREA"==d.base.nodeName?b.KO(0,d,"\n"):"INPUT"==d.nodeName&&("search"==d.type||"submit"==d.type)?d.form.submit():"undefined"!=typeof d.base&&("search"==d.base.type||
"submit"==d.base.type)?(d.base.disabled=!1,d.base.form.submit()):b.moveToNext(!1);break;case "K_SPACE":b.KO(0,d," ");break;default:(j=a.defaultKeyOutput(h,e.Lcode,f))&&b.KO(0,d,j)}"undefined"!=typeof c.key&&null!==c.key.nextlayer?a.nextLayer=c.key.nextlayer:"undefined"!=typeof c.nextLayer&&null!==c.nextLayer&&(a.nextLayer=c.nextLayer);a.nextLayer!=a.layerId&&(a.layerId=a.nextLayer,a._Show());d._KeymanWebSelectionStart=null;d._KeymanWebSelectionEnd=null}b._IsActivatingKeymanWebUI=0;return!0};a.getLayerId=
function(a){var b="";if(0==a)return"default";a&1&&(b="shift");a&4&&(b="alt"+b);a&2&&(b="ctrl"+b);return b};a.getModifierState=function(a){var b=0;0<=a.indexOf("shift")&&(b+=1);0<=a.indexOf("ctrl")&&(b+=2);0<=a.indexOf("alt")&&(b+=4);return b};a.updateLayer=function(c){var b=a.layerId,e;e=c.replace("shift","");e=e.replace("ctrl","");e=e.replace("alt","");if("default"==a.layerId||"numeric"==a.layerId||"symbol"==a.layerId||"currency"==a.layerId||""!=e)b=c;else{e=a.getModifierState(b);b=b.replace("shift",
"");b=b.replace("ctrl","");b=b.replace("alt","");switch(c){case "shift":e^=1;break;case "ctrl":e^=2;break;case "alt":e^=4;break;default:b=c}"default"!=b&&(e&1&&(b="shift"+b),e&2&&(b="ctrl"+b),e&4&&(b="alt"+b))}""==b&&(b="default");a.layerId=b.replace("altctrl","ctrlalt");for(c=0;c<a.layers.length;c++)if(a.layerId==a.layers[c].id)return;a.layerId="default"};a.showLanguage=function(){var c="",d="";b._ActiveStub?(c=b._ActiveStub.KL,d=b._ActiveStub.KN):c=b._ActiveLanguage?b._ActiveLanguage.KN:"English";
try{var e=a.spaceBar.firstChild.firstChild;e.parentNode.className="undefined"==typeof e.parentNode.className||""==e.parentNode.className?"kmw-spacebar":e.parentNode.className+" kmw-spacebar";e.className="kmw-spacebar-caption";d=d.replace(/\s*keyboard\s*/i,"");e.innerHTML=d==c?c:c+" ("+d+")"}catch(f){}};a.showLanguageMenu=function(){var c=b._KeyboardStubs;if(!(1>c.length)){var d=a.lgList=h._CreateElement("DIV");a.lgList.id="kmw-language-menu";d.shim=h._CreateElement("DIV");d.shim.id="kmw-language-menu-background";
d.shim.addEventListener("touchstart",function(c){c.preventDefault();a.hideLanguageList();if(2<c.touches.length){var b=c.touches[1].pageX,c=c.touches[1].pageY;b>a.spaceBar.offsetLeft&&(b<a.spaceBar.offsetLeft+a.spaceBar.offsetWidth&&c>a.spaceBar.offsetTop&&c<a.spaceBar.offsetTop+a.spaceBar.offsetHeight)&&a.showBuild()}},!1);document.body.appendChild(d.shim);var e=h._CreateElement("DIV"),f=e.style,g=h._CreateElement("DIV");e.id="kmw-menu-scroll-container";g.id="kmw-menu-scroller";"WebkitOverflowScrolling"in
f&&(f.WebkitOverflowScrolling="touch");e.appendChild(g);d.appendChild(e);var k,j,f=h._CreateElement("DIV");f.id="kmw-menu-index";for(k=1;26>=k;k++)j=h._CreateElement("P"),j.innerHTML=String.fromCharCode(k+64),f.appendChild(j);f.addEventListener("touchstart",function(c){a.scrollToLanguage(c,e,g)},!1);f.addEventListener("touchend",function(a){a.stopPropagation();a.preventDefault()},!1);d.appendChild(f);d.addEventListener("scroll",function(){a.lgList.scrolling=true},!1);e.addEventListener("scroll",function(){if(e.scrollTop<
1)e.scrollTop=1;if(e.scrollTop>e.scrollHeight-e.offsetHeight-1)e.scrollTop=e.scrollHeight-e.offsetHeight-1},!1);a.lgList.activeLgNo=a.addLanguagesToMenu(g,c);a.lgList.visibility="hidden";document.body.appendChild(a.lgList);"Android"==i.OS&&"devicePixelRatio"in window&&(a.lgList.style.fontSize=2/window.devicePixelRatio+"em");if("Android"==i.OS&&("tablet"==i.formFactor&&"devicePixelRatio"in window)&&(k=parseInt(h.getStyleValue(d,"width"),10),c=d.style,isNaN(k)||(c.width=c.maxWidth=2*k/window.devicePixelRatio+
"px"),k=parseInt(h.getStyleValue(e,"width"),10),c=e.style,isNaN(k)||(c.width=c.maxWidth=2*k/window.devicePixelRatio+"px"),k=parseInt(h.getStyleValue(g,"width"),10),c=g.style,!isNaN(k)))c.width=c.maxWidth=2*k/window.devicePixelRatio+"px";a.adjustLanguageMenu(0);c=Math.floor(d.offsetHeight/26);j=Math.round(100*c/(f.childNodes[1].offsetTop-f.childNodes[0].offsetTop))/100;var o=0.6<j?1:2;1.25<j&&(j=1.25);for(k=0;26>k;k++){var l=f.childNodes[k].style;2==o&&1==k%2?l.display="none":(l.fontSize=j*o+"em",
l.lineHeight=c*o+"px")}k=e.offsetWidth;e.scrollHeight>e.offsetHeight+3?k+=f.offsetWidth:f.style.display="none";d.style.width=k+"px";a.lgList.visibility="";d=g.firstChild.offsetHeight*a.lgList.activeLgNo+1;e.scrollTop=d;e.scrollTop<d&&(e.scrollTop=e.scrollHeight-e.offsetHeight);e.scrollTop>e.scrollHeight-e.offsetHeight-1&&(e.scrollTop=e.scrollHeight-e.offsetHeight-1)}};a.adjustLanguageMenu=function(c){var b=a.lgList,e=b.firstChild,f=e.firstChild,g=0,k=b.style,b=b.childNodes[1],j=window.innerHeight-
a.lgKey.offsetHeight-16,c=(f.childNodes.length+c-1)*f.firstChild.firstChild.offsetHeight;"iOS"==i.OS&&("phone"==i.formFactor?(g=h.landscapeView()?36:0,j=(window.innerHeight-g-16)*h.getViewportScale()):"tablet"==i.formFactor&&(g=h.landscapeView()?16:0,j-=g));k.left=h._GetAbsoluteX(a.lgKey)+"px";c>j&&(c=j);k.height=c+"px";k.top=h._GetAbsoluteY(a._Box)+a._Box.offsetHeight-c+window.pageYOffset-6+"px";k.bottom="auto";b.style.height=e.style.height=k.height};a.scrollToLanguage=function(a,b,e){a.stopImmediatePropagation();
a.stopPropagation();a.preventDefault();if("P"==a.touches[0].target.nodeName){var f,g,h=0,a=a.touches[0].target.innerHTML.charCodeAt(0),j=e.childNodes;try{for(f=0;f<j.length-1&&!(g=j[f].firstChild.innerHTML.toUpperCase().charCodeAt(0),g>=a);f++);}catch(i){}try{h=e.firstChild.offsetHeight*f+1,b.scrollTop=h}catch(l){h=0}try{if(b.scrollTop<h&&(b.scrollTop=b.scrollHeight-b.offsetHeight),b.scrollTop>b.scrollHeight-b.offsetHeight-1)b.scrollTop=b.scrollHeight-b.offsetHeight-1}catch(p){}}};a.addLanguagesToMenu=
function(c,d){var e=d.length,f,g,j,m=[];for(g=0;g<e;g++)j=d[g].KL,-1==m.indexOf(j)&&m.push(j);m.sort();var o=Math.round(100/h.getViewportScale())/100,l,p,q;j=-1;for(f=0;f<m.length;f++){l=h._CreateElement("DIV");l.className="kbd-list-closed";p=h._CreateElement("P");p.kList=[];for(g=0;g<e;g++)d[g].KL==m[f]&&p.kList.push(d[g]);"iOS"==i.OS&&(p.style.fontSize=o+"em");l.appendChild(p);c.appendChild(l);m[f]==b._ActiveStub.KL&&(j=f);if(1<p.kList.length){p.className="kbd-list";p.innerHTML=m[f]+"...";p.scrolled=
!1;p.ontouchend=function(c){c.preventDefault();c.stopPropagation();c.target.scrolled?c.target.scrolled=false:this.parentNode.className=this.parentNode.className=="kbd-list-closed"?"kbd-list-open":"kbd-list-closed";a.adjustLanguageMenu(this.parentNode.className=="kbd-list-closed"?0:this.kList.length)};p.addEventListener("touchstart",function(a){a.stopPropagation()},!1);p.addEventListener("touchmove",function(a){a.target.scrolled=true;a.stopPropagation()},!1);for(g=0;g<p.kList.length;g++)q=h._CreateElement("P"),
q.className="kbd-list-entry","iOS"==i.OS&&(q.style.fontSize=o+"em"),a.addKeyboardToMenu(p.kList[g],q,!1),l.appendChild(q)}else p.innerHTML=m[f],p.className="kbd-single-entry",a.addKeyboardToMenu(p.kList[0],p,!0);f==j&&(p.className+=" current")}e=h._CreateElement("DIV");e.id="kmw-menu-footer";m=function(a){a.preventDefault();a.stopPropagation()};e.addEventListener("touchstart",m,!1);e.addEventListener("touchmove",m,!1);e.addEventListener("touchend",m,!1);c.appendChild(e);return j};a.addKeyboardToMenu=
function(c,d,e){d.kn=c.KI;d.kc=c.KLC;d.innerHTML=e?c.KL:c.KN.replace(" Keyboard","");var c=function(c){c.stopPropagation();0>=this.className.indexOf("selected")&&(this.className+=" selected");a.lgList.scrolling=!1;a.lgList.y0=c.touches[0].pageY;return!0},e=function(c){c.stopImmediatePropagation();var b=a.lgList.childNodes[0],d=b.scrollHeight-b.offsetHeight,e,f;if("undefined"!=typeof c.pageY)e=c.pageY;else if("undefined"!=typeof c.touches)e=c.touches[0].pageY;else return;f=e-a.lgList.y0;if(0>f)b.scrollTop>=
d-1&&(c.preventDefault(),a.lgList.y0=e);else if(0<f)2>b.scrollTop&&(c.preventDefault(),a.lgList.y0=e);else return;if(-5>f||5<f)a.lgList.scrolling=!0,this.className=this.className.replace(/\s*selected/,""),a.lgList.y0=e;return!0},f=function(c){c.preventDefault();"undefined"!=typeof c.stopImmediatePropagation?c.stopImmediatePropagation():c.stopPropagation();a.lgList.scrolling?this.className=this.className.replace(/\s*selected/,""):(b.focusing=!0,b.focusTimer=window.setTimeout(function(){b.focusing=
!1},1E3),a.lgList.style.display="none",b._SetActiveKeyboard(this.kn,this.kc,!0),b.doKeyboardChange(this.kn,this.kc),b._FocusLastActiveElement(),a.hideLanguageList(),a._Show());return!0};d.onmspointerdown=c;d.addEventListener("touchstart",c,!1);d.onmspointermove=e;d.addEventListener("touchmove",e,!1);d.onmspointerout=f;d.addEventListener("touchend",f,!1)};a.hideLanguageList=function(){a.lgList&&(a.highlightKey(a.lgKey.firstChild,!1),a.lgList.style.visibility="hidden",window.setTimeout(function(){null!=
a.lgList&&"undefined"!=typeof a.lgList&&(document.body.removeChild(a.lgList.shim),document.body.removeChild(a.lgList));a.lgList=null},500))};a._UpdateVKShift=function(c,b,e){var f=0,f=c?c.Lmodifiers/16:e?f|b:f&~b;a.layerId=a.getLayerId(f);a._Visible&&a._Show();return!0};a._CancelMouse=function(a){(a=b._GetEventObject(a))&&a.preventDefault&&a.preventDefault();a&&(a.cancelBubble=!0,a.returnValue=!1);return!1};a.showLayer=function(c){if(b._ActiveKeyboard)for(var d=0;d<a.layers.length;d++)if(a.layers[d].id==
c)return a.layerId=c,a._Show(),!0;return!1};a.getHeight=function(){if("function"==typeof b.getOskHeight)return b.getOskHeight();var a=Math.floor(Math.min(screen.availHeight,screen.availWidth)/2);if("phone"==i.formFactor)var d=Math.min(screen.height,screen.width),e=Math.max(screen.height,screen.width),a=h.portraitView()?Math.floor(Math.max(screen.availHeight,screen.availWidth)/3):a*(e/d)/1.6;"iOS"==i.OS&&(a/=h.getViewportScale());"Android"==i.OS&&"phone"==i.formFactor&&"devicePixelRatio"in window&&
/Firefox|Chrome|OPR/.test(navigator.userAgent)&&(a*=window.devicePixelRatio);return a};a.getWidth=function(){if("function"==typeof b.getOskWidth)return b.getOskWidth();var a=screen.width;if("Android"==i.OS)try{a=document.documentElement.clientWidth}catch(d){a=screen.availWidth}return a};a.mouseOverMouseDownHandler=function(c){var b=h.eventTarget(c);null===b||"desktop"!=i.formFactor||(("SPAN"==b.nodeName&&(b=b.parentNode),"mousedown"==h.eventType(c))?(a.currentKey=b.id,a._CancelMouse(c),a.highlightKey(b,
!0)):b.id==a.currentKey&&a.highlightKey(b,!0))};a.mouseUpMouseOutHandler=function(c){var b=h.eventTarget(c);if(!(null===b||"desktop"!=i.formFactor))if("SPAN"==b.nodeName&&(b=b.parentNode),a.highlightKey(b,!1),"mouseup"==h.eventType(c))b.id==a.currentKey&&a.clickKey(b),a.currentKey=""};a.deviceDependentLayout=function(c,b){var e=h._CreateElement("DIV"),f=e.style,g=0;e.className="kmw-key-layer-group";switch(b){case "phone":case "tablet":g=a.getHeight(),f.height=g+"px"}if(null==c)return e;f.fontSize=
"undefined"==typeof c.fontsize||null==c.fontsize?"1em":c.fontsize;a.fontSize=f.fontSize;var j,m,o,l,p,q,w,t,s,r,x,A,u,z;o=c.layer;var D={text:""};D.fontsize=f.fontSize;D.width="100";D.pad="15";D.sp="0";D.layer=null;D.nextlayer=null;for(var G=/\*\w+\*/,g=0;g<o.length;g++){l=o[g];q=l.row;for(j=q.length;0<j&&!(0<q[j-1].key.length);j--);j<q.length&&q.splice(j-q.length,q.length-j)}w=100/q.length;"desktop"==b&&(w=100/q.length);var E,B;"desktop"==b?(E=function(a){return a+"%"},B=100):(E=function(a){return Math.round(a)+
"px"},B=a.getWidth());i.touchable&&"ontouchstart"in window&&(e.addEventListener("touchstart",a.touch,!0),e.addEventListener("touchend",a.release,!1),e.addEventListener("touchmove",a.moveOver,!1));for(g=0;g<o.length;g++){l=o[g];l.aligned=!1;p=h._CreateElement("DIV");q=p.style;p.className="kmw-key-layer";q.display=0==g?"block":"none";q.height=f.height;q.fontFamily="font"in c?c.font:"";p.layer=p.nextLayer=l.id;"string"==typeof l.nextlayer&&(p.nextLayer=l.nextlayer);q=l.row;var C=0;for(j=0;j<q.length;j++){t=
0;m=q[j];s=m.key;for(m=0;m<s.length;m++)if(r=s[m],null==r)s.length-=1;else{var y;A="string"==typeof r.width&&""!=r.width?parseInt(r.width,10):100;if(isNaN(A)||0==A)A=100;r.width=A.toString();y="string"==typeof r.pad&&""!=r.pad?parseInt(r.pad,10):15;if(isNaN(y)||0==y)y=15;r.pad=y.toString();t+=A+y}t>C&&(C=t)}C="desktop"==b?C+5:C+15;for(j=0;j<q.length;j++){t=h._CreateElement("DIV");t.className="kmw-key-row";t.onmousedown=h.mouseDownPreventDefaultHandler;m=q[j];A=t.style;A.maxHeight=A.height=w+"%";s=
m.key;for(m=0;m<s.length;m++){r=s[m];for(var F in D)"string"!=typeof r[F]&&(r[F]=D[F]);switch(r.sp){case "1":G.test(r.text)||(r.sp="3");break;case "2":G.test(r.text)||(r.sp="4")}}for(m=y=0;m<s.length-1;m++)r=Math.round(parseInt(s[m].width,10)*B/C),s[m].widthpc=r,x=Math.round(parseInt(s[m].pad,10)*B/C),s[m].padpc=x,y+=x+r;y+=Math.round(15*B/C);1==s.length&&0>parseInt(s[0].pad,10)?(r=Math.round(parseInt(s[0].width,10)*B/C),s[0].widthpc=r,y+=r,s[0].padpc=B-y):0<s.length&&(m=s.length-1,x=Math.round(parseInt(s[m].pad,
10)*B/C),s[m].padpc=x,y+=x,s[m].widthpc=B-y);for(m=y=0;m<s.length;m++){r=s[m];x=h._CreateElement("DIV");x.keyId=r.id;x.className="kmw-key-square";u=x.style;x.width=u.width=E(r.widthpc);"desktop"!=b?(u.left=E(y+s[m].padpc),u.bottom=A.bottom,u.height=A.height):u.marginLeft=E(r.padpc);y=y+s[m].padpc+s[m].widthpc;z=h._CreateElement("DIV");a.setButtonClass(r,z,c);"desktop"!=b&&(z.style.left=u.left,z.style.width=u.width);u=null;if(c.keyLabels||"desktop"==b){var v=a.keyCodes[r.id];switch(v){case 186:v=59;
break;case 187:v=61;break;case 188:v=44;break;case 189:v=45;break;case 190:v=46;break;case 191:v=47;break;case 192:v=96;break;case 219:v=91;break;case 220:v=92;break;case 221:v=93;break;case 222:v=39;break;default:if(48>v||90<v)v=0}0<v&&(u=h._CreateElement("DIV"),u.className="kmw-key-label",u.innerHTML=String.fromCharCode(v),z.appendChild(u))}z.id=l.id+"-"+r.id;z.key=r;if("undefined"!=typeof r.sk&&null!=r.sk){v=z.subKeys=r.sk;for(u=0;u<v.length;u++)if("1"==v[u].sp||"2"==v[u].sp)v[u].text=a.renameSpecialKey(v[u].text)}else z.subKeys=
null;i.touchable||(z.onmouseover=z.onmousedown=a.mouseOverMouseDownHandler,z.onmouseup=z.onmouseout=a.mouseUpMouseOutHandler);u=h._CreateElement("SPAN");v=u.style;null==r.text||""==r.text?(u.innerHTML="\u00a0","string"==typeof r.id&&/^U_[0-9A-F]{4}$/i.test(r.id)&&(u.innerHTML=String.fromCharCode(parseInt(r.id.substr(2),16)))):u.innerHTML=r.text;u.className="kmw-key-text";if("1"==r.sp||"2"==r.sp)u.innerHTML=a.renameSpecialKey("*Tab*"==r.text&&1==g?"*TabLeft*":r.text);"font"in r&&(v.fontFamily=r.font);
"fontsize"in r&&(v.fontSize=r.fontsize);z.appendChild(u);x.appendChild(z);"undefined"!=typeof r.sk&&null!=r.sk&&(r=h._CreateElement("DIV"),r.className="kmw-key-popup-icon",z.appendChild(r));t.appendChild(x)}p.appendChild(t)}e.appendChild(p)}return e};a.renameSpecialKey=function(a){for(var b="*Shift* *Enter* *Tab* *BkSp* *Menu* *Hide* *Alt* *Ctrl* *Caps* *ABC* *abc* *123* *Symbol* *Currency* *Shifted* *AltGr* *TabLeft*".split(" "),e=[8,5,6,4,11,10,25,1,3,16,17,19,21,20,8,2,7],f=0;f<b.length;f++)if(a==
b[f])return String.fromCharCode(57344+e[f]);return a};a.clearPopup=function(){var c=document.getElementById("kmw-popup-keys");null!=c&&(c.shim&&a._Box.removeChild(c.shim),c.parentNode.removeChild(c));a.popupCallout&&a._Box.removeChild(a.popupCallout);a.popupCallout=null;a.subkeyDelayTimer&&(window.clearTimeout(a.subkeyDelayTimer),a.subkeyDelayTimer=null);a.popupBaseKey=null};a.touch=function(c){var d=c.changedTouches[0].target,e=a.keyTarget(d);a.touchX=c.changedTouches[0].pageX;a.currentTarget=e;
var f=document.getElementById("kmw-popup-keys");if(!(f&&"visible"==f.style.visibility||a.popupVisible)){a.touchCount=c.touches.length;if(e&&0<=e.className.indexOf("key-hidden")||0<=d.className.indexOf("kmw-key-row"))e=a.findNearestKey(c,d);null!=e&&(c=e.id.split("-")[1],a.highlightKey(e,!0),"K_LOPT"==c||"K_ROPT"==c?(window.setTimeout(function(){a.clickKey(e)},0),a.keyPending=null):"K_BKSP"==c?(b.KO(1,b._LastActiveElement,""),a.deleting=!0,window.setTimeout(a.repeatDelete,500),a.keyPending=null):(a.keyPending?
(a.highlightKey(a.keyPending,!1),a.clickKey(a.keyPending),a.clearPopup(),a.touchCount--):null!=e.subKeys&&(a.subkeyDelayTimer=window.setTimeout(function(){a.showSubKeys(e)},a.popupDelay)),a.keyPending=e))}};a.release=function(c){var b=document.getElementById("kmw-popup-keys"),e=a.currentTarget;if(b&&"visible"==b.style.visibility||a.popupVisible){if(0<c.touches.length)return;if(null==e||0>e.id.indexOf("popup")&&e.id!=a.popupBaseKey.id)a.highlightKey(a.keyPending,!1),a.clearPopup(),a.keyPending=null}e&&
e.id&&a.optionKey(c,e.id,!1);e=c.changedTouches[0].pageX;e=2>e&&5<a.touchX||e>window.innerWidth-2&&a.touchX<window.innerWidth-5;b=a.touchCount;0<a.touchCount&&a.touchCount--;a.keyPending?(a.highlightKey(a.keyPending,!1),0>a.keyPending.className.indexOf("hidden")&&(0<b&&!e)&&a.clickKey(a.keyPending),a.clearPopup(),a.keyPending=null):(b=c.changedTouches[0],e=a.keyTarget(b.target),e||(e=document.elementFromPoint(b.clientX,b.clientY),e=a.findNearestKey(c,e)),a.highlightKey(e,!1));a.deleting=!1};a.moveOver=
function(c){c.preventDefault();c.cancelBubble=!0;"function"==typeof c.stopImmediatePropagation?c.stopImmediatePropagation():"function"==typeof c.stopPropagation&&c.stopPropagation();if(!(1<c.touches.length||0==a.touchCount)){var b="object"==typeof c.touches?c.touches[0].clientX:c.clientX,e="object"==typeof c.touches?c.touches[0].clientY:c.clientY,f=document.elementFromPoint(b,e),g=a.keyPending,h=a.keyTarget(f);if(h&&0<=h.className.indexOf("key-hidden")||f&&!h&&0<=f.className.indexOf("key-row"))h=
a.findNearestKey(c,f);h&&("string"==typeof h.id&&0>h.id.indexOf("BKSP"))&&(a.deleting=!1);if(a.popupVisible)null==h?(g&&a.highlightKey(g,!1),a.keyPending=null):h==a.popupBaseKey?(a.hasClass(h,"kmw-key-touched")||a.highlightKey(h,!0),a.keyPending=h):(g&&a.highlightKey(g,!1),a.keyPending=null);else{if((f=document.getElementById("kmw-popup-keys"))&&"visible"==f.style.visibility&&"phone"==i.formFactor&&h==a.popupBaseKey)h=f.childNodes[0].firstChild;a.currentTarget=h;g&&(h&&h.id!=g.id)&&a.highlightKey(g,
!1);a.highlightSubKeys(h,b,e);if(f&&"visible"==f.style.visibility){if(h&&0>h.id.indexOf("popup")&&h!=a.popupBaseKey)return;h&&(h==a.popupBaseKey&&0>h.className.indexOf("kmw-key-touched"))&&a.highlightKey(h,!0)}else Math.max(5,a._Box.offsetTop-0.25*a._Box.offsetHeight),g&&c.touches[0].pageY<Math.max(5,a._Box.offsetTop-0.25*a._Box.offsetHeight)&&(a.highlightKey(g,!1),a.showKeyTip(null,!1),a.keyPending=null);h&&a.keyPending&&(a.keyPending=h);a.keyPending&&(g!=h||0>h.className.indexOf("kmw-key-touched"))&&
a.highlightKey(h,!0);if(g&&(h&&h!=g&&""!=h.id)&&(a.subkeyDelayTimer&&(window.clearTimeout(a.subkeyDelayTimer),a.subkeyDelayTimer=null),null!=h.subKeys))a.subkeyDelayTimer=window.setTimeout(function(){a.clearPopup();a.showSubKeys(h)},a.popupDelay)}}};a.hasClass=function(a,b){return 0<=(" "+a.className+" ").replace(/[\n\t\r\f]/g," ").indexOf(" "+b+" ")};a.keyTarget=function(c){try{if(c){if(a.hasClass(c,"kmw-key"))return c;if(c.parentNode&&a.hasClass(c.parentNode,"kmw-key"))return c.parentNode;if(c.firstChild&&
a.hasClass(c.firstChild,"kmw-key"))return c.firstChild}}catch(b){}return null};a.findNearestKey=function(a,b){if(!a||"undefined"==typeof a.changedTouches||0==a.changedTouches.length)return null;for(var e=a.changedTouches[0].pageX;b&&0>b.className.indexOf("key-row");)b=b.parentNode;if(!b)return null;var f,g=0,h,j=24,i=1E5,l;for(f=0;f<b.childNodes.length;f++)if(!(0<=b.childNodes[f].firstChild.className.indexOf("key-hidden"))&&(h=b.childNodes[f].firstChild.offsetLeft,l=h+b.childNodes[f].firstChild.offsetWidth,
h-=e,0<=h&&h<i&&(g=f,i=h),h=e-l,0<=h&&h<i))g=f,i=h;return 1E5>i&&(b=b.childNodes[g].firstChild,h=b.offsetLeft,l=h+b.offsetWidth,40<b.offsetWidth&&(j=0.6*b.offsetWidth),0<=h-e&&h-e<j||0<=e-l&&e-l<j)?b:null};a.repeatDelete=function(){a.deleting&&(b.KO(1,b._LastActiveElement,""),window.setTimeout(a.repeatDelete,100))};a.setButtonClass=function(c,b,e){var f=0,g="default shift shift-on special special-on deadkey blank hidden".split(" ");"string"==typeof c.dk&&"1"==c.dk&&(f=8);"string"==typeof c.sp&&
(f=parseInt(c.sp,10));if(0>f||10<f)f=0;e=e||a.layout;b.className=4<e.layer[0].row.length&&"phone"==h.device.formFactor?"kmw-key kmw-5rows kmw-key-"+g[f]:"kmw-key kmw-key-"+g[f]};a.buildDefaultLayout=function(a,b){var e;e=b;var f=window.dfltLayout;"object"!=typeof f[e]&&(e="desktop");e=h.deepCopy(f[e]);var j=e.layer,k=a.BK,i=a.K102,o,l,p,q,w;p=/\*\w+\*/;for(var t="default shift ctrl ctrlshift alt altshift ctrlalt ctrlaltshift".split(" "),f=0;8>f;f++){0<f&&(j[f]=h.deepCopy(j[0]));j[f].id=t[f];j[f].nextlayer=
t[f];for(o=0;o<j[f].row.length;o++){l=j[f].row[o];w=l.key;for(l=0;l<w.length;l++)switch(q=w[l],q.id){case "K_SHIFT":case "K_LSHIFT":case "K_RSHIFT":1==(f&1)&&(q.sp="2");"desktop"!=b&&0<f&&(q.nextlayer="default");break;case "K_CONTROL":case "K_LCTRL":case "K_LCONTROL":case "K_RCTRL":case "K_RCONTROL":2==(f&2)&&(q.sp="2");break;case "K_ALT":case "K_LALT":case "K_RALT":4==(f&4)&&(q.sp="2")}}if("undefined"==typeof i||!i)for(o=0;o<j[f].row.length;o++)for(l=0;l<j[f].row[o].key.length;l++)"K_oE2"==j[f].row[o].key[l].id&&
("desktop"==b?(j[f].row[o].key.splice(l,1),j[f].row[o].key[0].width="200"):j[f].row[o].key[l].sp="10")}for(f=0;f<j.length;f++){var s=j[f],r,x=null,A="",i=s.row;for(o=0;o<i.length;o++){w=i[o].key;for(l=0;l<w.length;l++)q=w[l],r=g.indexOf(q.id),"undefined"!=typeof k&&(0<=r&&r+65*f<k.length)&&(q.text=k[r+65*f]),""==q.text&&("K_SPACE"!=q.id&&130>r+65*f)&&(q.text="`1234567890-=\u00a7~~qwertyuiop[]\\~~~asdfghjkl;'~~~~~?zxcvbnm,./~~~~~ ~!@#$%^&*()_+\u00a7~~QWERTYUIOP{}\\~~~ASDFGHJKL:\"~~~~~?ZXCVBNM<>?~~~~~ "[r+
65*f]),"undefined"==typeof q.text&&(q.text=""),"K_SHIFT"==q.id&&(x=q),p.test(q.text)||(A+=q.text)}s.valid=0<A.trim().length;s.shiftKey=x;if("desktop"!=b&&0<f&&null!=x)switch(x.sp="2",x.sk=null,j[f].id){case "ctrl":x.text="*Ctrl*";break;case "alt":x.text="*Alt*";break;case "ctrlalt":x.text="*AltGr*"}}for(f=0;8>f;f++){i=j[f].row;for(o=0;o<i.length;o++){w=i[o].key;for(l=0;l<w.length;l++)if(q=w[l],null!=q.sk){for(p=0;8>p;p++)for(k=0;k<q.sk.length;k++)if(q.sk[k].nextlayer==t[p]){j[p].valid||q.sk.splice(k,
1);break}0==q.sk.length&&(q.sk=null)}}}return e};a._GenerateVisualKeyboard=function(c,d,e){d=h._CreateElement("DIV");if("object"!=typeof e||null==e)e=a.buildDefaultLayout(c,i.formFactor);a.layout=e;a.layers=e.layer;a.fontFamily="font"in e?e.font:"";e.keyLabels=b._ActiveKeyboard&&"undefined"!=typeof b._ActiveKeyboard.KDU&&b._ActiveKeyboard.KDU;c=a.deviceDependentLayout(e,i.formFactor);a.ddOSK=!0;a.keyMap=c;d.appendChild(c);a._DivVKbdHelp=a._DivVKbd=d;a._Box.className=i.formFactor+" "+i.OS.toLowerCase()+
" kmw-osk-frame";d.className=i.formFactor+" kmw-osk-inner-frame";"desktop"==i.formFactor&&a._Box.appendChild(a.controlBar());a._Box.appendChild(d);"desktop"==i.formFactor?a._Box.appendChild(a.resizeBar()):a.adjustHeights()};b.BuildVisualKeyboard=b.buildOSK=function(c,d,e,f){var g=b._ActiveKeyboard,d=null,h="undefined"==typeof e?"desktop":e,f="undefined"==typeof f?"default":f;if(null!=c){d=c.toLowerCase().replace("keyboard_","");for(e=0;e<b._Keyboards.length;e++)if(d==b._Keyboards[e].KI.toLowerCase().replace("keyboard_",
"")){g=b._Keyboards[e];break}}if(!g)return null;d=g.KVKL;c=null;e=g.KV;"object"==typeof d&&("object"==typeof d[h]&&null!=d[h]?c=d[h]:"phone"==h&&"object"==typeof d.tablet&&null!=d.tablet?c=d.tablet:"tablet"==h&&"object"==typeof d.phone&&null!=d.phone?c=d.phone:"object"==typeof d.desktop&&null!=d.desktop&&(c=d.desktop));null==c&&null!=e&&(c=a.buildDefaultLayout(e,h));null!=c&&(c.keyLabels="undefined"!=typeof g.KDU&&g.KDU);d=a.deviceDependentLayout(c,h);d.className=h+"-static kmw-osk-inner-frame";if(null!=
c)for(var j,i,l,e=0;e<c.layer.length;e++){g=d.childNodes[e];for(i=0;i<g.childNodes.length;i++){h=g.childNodes[i];for(l=0;l<h.childNodes.length;l++)j=h.childNodes[l],j.style.height="100%"}g.style.display="number"==typeof f?e==f&&0<=f?"block":"none":"string"==typeof f?c.layer[e].id==f?"block":"none":0==e?"block":"none"}else d.innerHTML="<p style='color:#c40; font-size:0.5em;margin:10px;'>No "+h+" layout is defined for "+g.KN+".</p>";d.style.border="1px solid #ccc";return d};a.adjustHeights=function(){if(a._Box&&
a._Box.firstChild&&a._Box.firstChild.firstChild&&a._Box.firstChild.firstChild.childNodes){var c=a._Box.firstChild.firstChild.childNodes,b=c[0].childNodes.length,e=a.getHeight(),f=Math.floor(e/b),g,j,m,o,l,p,q,w,t,s;g=1;"Android"==i.OS&&"devicePixelRatio"in window&&(f/=window.devicePixelRatio);e=b*f;s=a._Box;j=s.style;j.height=j.maxHeight=e+3+"px";s=s.firstChild.firstChild;j=s.style;j.height=j.maxHeight=e+3+"px";"phone"==i.formFactor&&(g=0.6);s=Math.round(0.15*f);"iOS"==i.OS&&(g/=h.getViewportScale());
j.fontSize=g+"em";var r="iOS"==i.OS&&"phone"==i.formFactor&&h.landscapeView();for(g=0;g<c.length;g++){c[g].style.height=e+3+"px";for(j=0;j<b;j++){m=c[g].childNodes[j].style;m.bottom=(b-j-1)*f+1+"px";m.maxHeight=m.height=f+"px";o=c[g].childNodes[j].childNodes;l=o.length;for(p=0;p<l;p++){q=o[p];for(t=0;t<q.childNodes.length&&!a.hasClass(q.childNodes[t],"kmw-key");t++);w=q.childNodes[t].style;w.bottom=m.bottom;w.height=w.minHeight=f-s+"px";r&&0<t&&(q.childNodes[0].style.fontSize="6px")}}}}};a.controlBar=
function(){var c=h._CreateElement("DIV"),d="";c.id="keymanweb_title_bar";c.className="kmw-title-bar";c.onmousedown=a._VMoveMouseDown;b._ActiveKeyboard&&(d=b._ActiveKeyboard.KN);var e=h._CreateElement("SPAN");e.className="kmw-title-bar-caption";e.innerHTML=d;c.appendChild(e);d=a.closeButton=h._CreateElement("DIV");d.id="kmw-close-button";d.className="kmw-title-bar-image";d.onmousedown=a._CancelMouse;d.onclick=function(){a._Hide(!0)};c.appendChild(d);d=a.helpImg=h._CreateElement("DIV");d.id="kmw-help-image";
d.className="kmw-title-bar-image";d.title="KeymanWeb Help";d.onclick=function(){h.callEvent("osk.helpclick",{});window.event&&(window.event.returnValue=!1);return!1};d.onmousedown=a._CancelMouse;c.appendChild(d);d=a.configImg=h._CreateElement("DIV");d.id="kmw-config-image";d.className="kmw-title-bar-image";d.title="KeymanWeb Configuration Options";d.onclick=function(){h.callEvent("osk.configclick",{});window.event&&(window.event.returnValue=!1);return!1};d.onmousedown=a._CancelMouse;c.appendChild(d);
d=a.pinImg=h._CreateElement("DIV");d.id="kmw-pin-image";d.className="kmw-title-bar-image";d.title="Pin the On Screen Keyboard to its default location on the active text box";d.onclick=function(){a.loadCookie();a.userPositioned=!1;a.saveCookie();a._Show();a.doResizeMove();a.pinImg&&(a.pinImg.style.display="none");window.event&&(window.event.returnValue=!1);return!1};d.onmousedown=a._CancelMouse;c.appendChild(d);return c};a.showBuild=function(){h.alert("KeymanWeb Build "+b.build+'<br /><br /><span style="font-size:0.8em">Copyright &copy; 2013 Tavultesoft Pty Ltd</span>')};
a.resizeBar=function(){var c=h._CreateElement("DIV");c.className="kmw-footer";c.onmousedown=a._CancelMouse;var b=h._CreateElement("DIV");b.className="kmw-footer-caption";b.innerHTML="Keyboard &copy; 2013 Tavultesoft Pty Ltd";b.id="keymanweb-osk-footer-caption";h.attachDOMEvent(b,"dblclick",function(c){c&&c.shiftKey&&a.showBuild()},!1);"onselectstart"in b&&(b.onselectstart=h.selectStartHandler);c.appendChild(b);b=h._CreateElement("DIV");b.className="kmw-footer-resize";b.onmousedown=a._VResizeMouseDown;
b.onmouseover=b.onmouseout=a._VResizeMouseOut;c.appendChild(b);a.resizeIcon=b;return c};a._VKbdMouseOver=function(){b._IsActivatingKeymanWebUI=1};a._VKbdMouseOut=function(){b._IsActivatingKeymanWebUI=0};a._VResizeMouseOver=a._VResizeMouseOut=function(c){c=b._GetEventObject(c);if(!c)return!1;c&&c.preventDefault&&c.preventDefault();var d=a.getRect();a.width=d.width;a.height=d.height;c.cancelBubble=!0;return!1};a._VResizeMouseDown=function(c){b._JustActivatedKeymanWebUI=1;c=b._GetEventObject(c);if(!c)return!0;
a.resizing=1;var d,e;c.pageX?(d=c.pageX,e=c.pageY):c.clientX&&(d=c.clientX+document.body.scrollLeft,e=c.clientY+document.body.scrollTop);a._ResizeMouseX=d;a._ResizeMouseY=e;document.onmousemove!=a._VResizeMouseMove&&document.onmousemove!=a._VMoveMouseMove&&(a._VPreviousMouseMove=document.onmousemove,a._VPreviousMouseUp=document.onmouseup);a._VPreviousCursor=document.body.style.cursor;a._VPreviousMouseButton="undefined"==typeof c.which?c.button:c.which;a._VOriginalWidth=a._DivVKbd.offsetWidth;a._VOriginalHeight=
a._DivVKbd.offsetHeight;document.onmousemove=a._VResizeMouseMove;document.onmouseup=a._VResizeMoveMouseUp;document.body.style.cursor&&(document.body.style.cursor="se-resize");c&&c.preventDefault&&c.preventDefault();c.cancelBubble=!0;return!1};a._VResizeMouseMove=function(c){var d,e,c=b._GetEventObject(c);if(!c)return!0;a.resizing=1;if(a._VPreviousMouseButton!=("undefined"==typeof c.which?c.button:c.which))return a._VResizeMoveMouseUp(c);c.pageX?(d=c.pageX,e=c.pageY):c.clientX&&(d=c.clientX+document.body.scrollLeft,
e=c.clientY+document.body.scrollTop);d=a._VOriginalWidth+d-a._ResizeMouseX;e=a._VOriginalHeight+e-a._ResizeMouseY;d<0.2*screen.width&&(d=0.2*screen.width);e<0.1*screen.height&&(e=0.1*screen.height);d>0.9*screen.width&&(d=0.9*screen.width);e>0.5*screen.height&&(d=0.5*screen.height);a._DivVKbd.style.width=d+"px";a._DivVKbd.style.height=e+"px";a._DivVKbd.style.fontSize=e/8+"px";h.showShim(a._DivVKbd,a.shim,a._DivVKbdHelp);c&&c.preventDefault&&c.preventDefault();c.cancelBubble=!0;return!1};a._VMoveMouseDown=
function(c){var d,e;b._JustActivatedKeymanWebUI=1;c=b._GetEventObject(c);if(!c)return!0;a.resizing=1;c.pageX?(d=c.pageX,e=c.pageY):c.clientX&&(d=c.clientX+document.body.scrollLeft,e=c.clientY+document.body.scrollTop);document.onmousemove!=a._VResizeMouseMove&&document.onmousemove!=a._VMoveMouseMove&&(a._VPreviousMouseMove=document.onmousemove,a._VPreviousMouseUp=document.onmouseup);a._VPreviousCursor=document.body.style.cursor;a._VPreviousMouseButton="undefined"==typeof c.which?c.button:c.which;a._VMoveX=
d-a._Box.offsetLeft;a._VMoveY=e-a._Box.offsetTop;b.isCJK()&&(a.pinImg.style.left="15px");document.onmousemove=a._VMoveMouseMove;document.onmouseup=a._VResizeMoveMouseUp;document.body.style.cursor&&(document.body.style.cursor="move");c&&c.preventDefault&&c.preventDefault();c.cancelBubble=!0;return!1};a._VMoveMouseMove=function(c){var d,e,c=b._GetEventObject(c);if(!c||a.noDrag)return!0;a.resizing=1;a.userPositioned=!0;a.pinImg.style.display="block";if(a._VPreviousMouseButton!=("undefined"==typeof c.which?
c.button:c.which))return a._VResizeMoveMouseUp(c);c.pageX?(d=c.pageX,e=c.pageY):c.clientX&&(d=c.clientX+document.body.scrollLeft,e=c.clientY+document.body.scrollTop);a._Box.style.left=d-a._VMoveX+"px";a._Box.style.top=e-a._VMoveY+"px";a._DivVKbd?h.showShim(a._DivVKbd,a.shim,a._DivVKbdHelp):h.showShim(a._Box,a.shim);c&&c.preventDefault&&c.preventDefault();d=a.getRect();a.width=d.width;a.height=d.height;c.cancelBubble=!0;return!1};a._VResizeMoveMouseUp=function(c){c=b._GetEventObject(c);if(!c)return!0;
a.resizing=0;a.currentKey=null;document.onmousemove=a._VPreviousMouseMove;document.onmouseup=a._VPreviousMouseUp;document.body.style.cursor&&(document.body.style.cursor=a._VPreviousCursor);b._FocusLastActiveElement();c&&c.preventDefault&&c.preventDefault();b._JustActivatedKeymanWebUI=0;b._IsActivatingKeymanWebUI=0;a._DivVKbd&&(a._VOriginalWidth=a._DivVKbd.offsetWidth,a._VOriginalHeight=a._DivVKbd.offsetHeight);a.doResizeMove();c.cancelBubble=!0;a.saveCookie();return!1};a.userLocated=function(){return a.userPositioned};
a.show=function(c){0<arguments.length?(a._Enabled=c)?a._Show():a._Hide(!0):a._Visible?a._Hide(!0):a._Show()};a.doShow=function(a){return h.callEvent("osk.show",a)};a.doHide=function(a){return h.callEvent("osk.hide",a)};a.doResizeMove=function(a){return h.callEvent("osk.resizemove",a)};a._Show=function(c,d){if(!(null==a._Box||null==b._ActiveElement))if(i.touchable||null!=b._ActiveKeyboard&&a._Enabled){var e=a._Box.style;i.touchable&&""==e.bottom&&(e.visibility="hidden");if(a.ddOSK){var f,g=-1,j=a._DivVKbd.childNodes[0].childNodes;
for(f=0;f<j.length;f++)j[f].layer==a.layerId?(j[f].style.display="block",a.nextLayer=a.layerId,a.layerIndex=g=f,"string"==typeof a.layers[f].nextlayer&&(a.nextLayer=a.layers[f].nextlayer)):j[f].style.display="none";i.touchable&&(e.position="fixed",e.left=e.bottom="0px",e.height=e.maxHeight=a._Box.firstChild.firstChild.style.height,e.border="none",e.borderTop="1px solid gray",a._Enabled=1,a._Visible=1,a._DivVKbd.style.fontSize="phone"==i.formFactor?"120%":"Android"==i.OS&&"tablet"==i.formFactor&&300>
parseInt(e.height,10)?"120%":"200%",a.lgKey=a.getSpecialKey(g,"K_LOPT"),a.hkKey=a.getSpecialKey(g,"K_ROPT"),"iOS"==i.OS&&"phone"==i.formFactor&&a.adjustHeights());a.spaceBar=a.getSpecialKey(g,"K_SPACE")}e.display="block";a.showLanguage();if("desktop"==i.formFactor&&(e.position="absolute",e.display="block",e.left="0px",a.loadCookie(),0<=c?(e.left=c+"px",e.top=d+"px"):a.userPositioned?(e.left=a.x+"px",e.top=a.y+"px"):(f=b._ActiveElement,""!=a.dfltX?e.left=a.dfltX:"undefined"!=typeof f&&null!=f&&(e.left=
h._GetAbsoluteX(f)+"px"),""!=a.dfltY)?e.top=a.dfltY:"undefined"!=typeof f&&null!=f&&(e.top=h._GetAbsoluteY(f)+f.offsetHeight+"px"),a._Enabled=1,a._Visible=1,a._DivVKbd&&(a.width=a._DivVKbd.offsetWidth,a.height=a._DivVKbd.offsetHeight),a.saveCookie(),f=a.pinImg,"undefined"!=typeof f&&null!=f))f.style.display=a.userPositioned?"block":"none";"hidden"==e.visibility&&window.setTimeout(function(){a._Box.style.visibility="visible"},0);i.touchable||(e={},e.x=a._Box.offsetLeft,e.y=a._Box.offsetTop,e.userLocated=
a.userPositioned,a.doShow(e))}};a.adjustRowLengths=function(c){if(!(0<=c)){var b,e=a._DivVKbd.childNodes[0].childNodes;if(!(0>c||c>=e.length||e[c].aligned)&&"block"==e[c].style.display){b=a._DivVKbd.childNodes[0].offsetWidth-6;"Windows"==i.OS&&(b-=h.landscapeView()?4:40);var f,g=e[c].childNodes,j,m,o;for(f=0;f<g.length;f++)j=g[f].childNodes,m=j.length,o=j[m-2].offsetLeft+j[m-2].offsetWidth,j=j[m-1],j.style.width=b-o+"px";e[c].aligned=!0}}};a.resetRowLengths=function(){var c,b=a._DivVKbd.childNodes[0].childNodes,
e=-1;for(c=0;c<b.length;c++)"block"==b[c].style.display&&(e=c),b[c].aligned=!1;return e};a.getSpecialKey=function(c,b){var e,f;e=a._DivVKbd.childNodes[0].childNodes;if(0<=c&&c<e.length){e=e[c].childNodes;f=e[e.length-1].childNodes;for(e=0;e<f.length;e++)if(f[e].keyId==b)return f[e]}return null};a.hide=function(){a._Enabled=0;a._Hide(!0)};a._Hide=function(c){a._Box&&("block"==a._Box.style.display&&a._DivVKbd)&&(a.width=a._DivVKbd.offsetWidth,a.height=a._DivVKbd.offsetHeight);if(c)a._Enabled=b.isCJK()||
i.touchable?1:0,a.saveCookie();else if("desktop"==i.formFactor&&0<=document.body.className.indexOf("osk-always-visible"))return;a._Visible=0;if(a._Box&&i.touchable&&0<a._Box.offsetHeight){var d=a._Box.style;d.transition="string"==typeof d.MozBoxSizing?"opacity 0.8s linear":d.msTransition=d.WebkitTransition="opacity 0.5s linear 0";window.setTimeout(function(){var c=a._Box.style;if(a._Visible)c.transition=c.msTransition=c.MozTransition=c.WebkitTransition="";else{c.opacity="0";a._Box.addEventListener("transitionend",
a.hideNow,false);a._Box.addEventListener("webkitTransitionEnd",a.hideNow,false)}},200)}else a._Box&&(a._Box.style.display="none"),h.hideShim(a.shim);d={};d.HiddenByUser=c;a.doHide(d);c&&b._FocusLastActiveElement()};a.hideNow=function(){a._Box.removeEventListener("transitionend",a.hideNow,!1);a._Box.removeEventListener("webkitTransitionEnd",a.hideNow,!1);var c=a._Box.style;c.display="none";c.opacity="1";a._Visible=0;c.transition=c.msTransition=c.mozTransition=c.WebkitTransition="";a.hkKey&&"undefined"!=
typeof a.hkKey&&a.highlightKey(a.hkKey.firstChild,!1)};a.prepare=function(){b.initialized?(a.ready||(a._Box=h._CreateElement("DIV"),document.body.appendChild(a._Box),h.linkStyleSheet(b.getStyleSheetPath("kmwosk.css")),h.attachDOMEvent(a._Box,"mousedown",function(){b._IsActivatingKeymanWebUI=1}),i.touchable&&(h.attachDOMEvent(a._Box,"touchstart",function(a){b._IsActivatingKeymanWebUI=1;a.preventDefault();a.stopPropagation()}),h.attachDOMEvent(a._Box,"touchend",function(a){a.preventDefault();a.stopPropagation()}),
h.attachDOMEvent(a._Box,"touchmove",function(a){a.preventDefault();a.stopPropagation()}),h.attachDOMEvent(a._Box,"touchcancel",function(a){a.preventDefault();a.stopPropagation()}),a.vpScale=h.getViewportScale())),a.loadCookie(),a.ready=!0):window.setTimeout(a.prepare,200)};a._Load=function(){if(null==a._Box)99<=a.loadRetry||(window.setTimeout(a._Load,100),a.loadRetry++);else{a.loadRetry=0;b._TitleElement&&(b._TitleElement.innerHTML="Tavultesoft KeymanWeb");a._Visible=0;a.layerId="default";var c=a._Box.style;
c.zIndex="9999";c.display="none";c.width="auto";c.position="desktop"==i.formFactor?"absolute":"fixed";"phone"==i.formFactor&&(c.fontSize="1.6em");a._DivVKbd=a._DivVKbdHelp=null;a._Box.innerHTML="";a._Box.onmouseover=a._VKbdMouseOver;a._Box.onmouseout=a._VKbdMouseOut;if(null==b._ActiveKeyboard&&!i.touchable){var d=h._CreateElement("DIV");d.className="kmw-title-bar";d.appendChild(a._TitleBarInterior());d.onmousedown=a._VMoveMouseDown;a._Box.appendChild(d);d=h._CreateElement("DIV");d.className="kmw-osk-none";
a._Box.appendChild(d)}else{var e=d=null,f=null,c="";a._Box.className="";if(null!=b._ActiveKeyboard&&(d=b._ActiveKeyboard.KV,c=b._ActiveKeyboard.KH,e=b._ActiveKeyboard.KVKL,"undefined"!=typeof e&&null!=e&&(f=e[i.formFactor],"undefined"==typeof f||null==f)))if("phone"==i.formFactor?f=e.tablet:"tablet"==i.formFactor&&(f=e.phone),"undefined"==typeof f||null==f)f=e.desktop;if(null!=d&&null!=d.BK){for(var e=d.BK,g=!0,j=0;j<e.length;j++)if(0<e[j].length){g=!1;break}g&&(d=null)}null!=d||""==c||i.touchable?
(null==d&&(d={F:"Tahoma",BK:"`1234567890-=\u00a7~~qwertyuiop[]\\~~~asdfghjkl;'~~~~~?zxcvbnm,./~~~~~ ~!@#$%^&*()_+\u00a7~~QWERTYUIOP{}\\~~~ASDFGHJKL:\"~~~~~?ZXCVBNM<>?~~~~~ "}),a._GenerateVisualKeyboard(d,c,f)):(a.ddOSK=!1,d=h._CreateElement("DIV"),d.className="kmw-title-bar",d.appendChild(a._TitleBarInterior()),d.onmousedown=a._VMoveMouseDown,a._Box.appendChild(d),d=h._CreateElement("DIV"),d.className="kmw-osk-static",d.innerHTML=c,a._Box.appendChild(d),b._ActiveKeyboard.KHF&&b._ActiveKeyboard.KHF(a._Box));
b._TitleElement&&(b._TitleElement.innerHTML="<span style='font-weight:bold'>"+b._ActiveKeyboard.KN+"</span> - "+b._TitleElement.innerHTML,b._TitleElement.className="",b._TitleElement.style.color="#fff")}a.createKeyTip();c=a._Box.firstChild;d=" kmw-keyboard-"+(b._ActiveKeyboard?b._ActiveKeyboard.KI.replace("Keyboard_",""):"");"keymanweb_title_bar"==c.id&&(c=c.nextSibling);c.className="kmw-osk-inner-frame"+d;a.appendStyleSheet();a._Enabled&&a._Show()}};a.appendStyleSheet=function(){if(null!=b._ActiveStub){a.styleSheet&&
h.removeStyleSheet(a.styleSheet);var c=b._ActiveStub,d=c.KFont,c=c.KOskFont;h.addFontFaceStyleSheet(d);h.addFontFaceStyleSheet(c);b.alignInputs(!1);var e=a.addFontStyle(d,c);null!=b._ActiveKeyboard&&"string"==typeof b._ActiveKeyboard.KCSS&&(e+=b._ActiveKeyboard.KCSS);a.styleSheet=h.addStyleSheet(e);a.waitForFonts(d,c)&&b.alignInputs(!0)}};a.addFontStyle=function(a,d){var e=b.baseFont;"undefined"!=typeof a&&"undefined"!=typeof a.family&&(e=a.family);var f=b.appliedFont,f=f.replace(RegExp("s?"+e+",?"),
""),f=f.replace(/,$/,""),f=""==f?e:e+","+f,e=".keymanweb-font{\nfont-family:"+f+" !important;\n}\n";"undefined"!=typeof d?e=e+".kmw-key-text{\nfont-family:"+d.family+";\n}\n":"undefined"!=typeof a&&(e=e+".kmw-key-text{\nfont-family:"+a.family+";\n}\n");b.appliedFont=f;return e};a._Unload=function(){a._VShift=a._DivVKbd=a._VKeySpans=a._Box=0};a.saveCookie=function(){var b=h.loadCookie("KeymanWeb_OnScreenKeyboard"),d=a.getPos();b.visible=a._Enabled?1:0;b.userSet=a.userPositioned?1:0;b.left=d.left;b.top=
d.top;a._DivVKbd&&(b.width=a.width,b.height=a.height);h.saveCookie("KeymanWeb_OnScreenKeyboard",b)};a.loadCookie=function(){var b=h.loadCookie("KeymanWeb_OnScreenKeyboard");if("undefined"==typeof b||null==b)return a.userPositioned=!1;a._Enabled=h.toNumber(b.visible,!0);a.userPositioned=h.toNumber(b.userSet,!1);a.x=h.toNumber(b.left,-1);a.y=h.toNumber(b.top,-1);var d=h.toNumber(b.width,0.3*screen.width),b=h.toNumber(b.height,0.15*screen.height);d<0.2*screen.width&&(d=0.2*screen.width);b<0.1*screen.height&&
(b=0.1*screen.height);d>0.9*screen.width&&(d=0.9*screen.width);b>0.5*screen.height&&(d=0.5*screen.height);a._DivVKbd&&(a._DivVKbd.style.width=d+"px",a._DivVKbd.style.height=b+"px",a._DivVKbd.style.fontSize=b/8+"px");if(-1==a.x||-1==a.y||!a._Box)a.userPositioned=!1;a.x<window.pageXOffset-0.8*d&&(a.x=window.pageXOffset-0.8*d);0>a.y&&(a.x=-1,a.y=-1,a.userPositioned=!1);a.userPositioned&&a._Box&&a.setPos({left:a.x,top:a.y});return!0}})();(function(){var b=window.tavultesoft.keymanweb,a=b.osk,h=b.util,i=h.device;b.fullInitialization=!0;b.setDefaultDeviceOptions=function(a){""==a.attachType&&(a.attachType=i.touchable?"manual":"auto")};h.wait=function(a){var g=b.waiting;if(!("undefined"==typeof g||null==g||b.warned)){var c=g.firstChild.childNodes;a?(g.pending=!0,window.setTimeout(function(){g.pending&&(window.scrollTo(0,0),c[0].style.display="none",c[1].className="kmw-wait-text",c[1].innerHTML=a,c[2].style.display="block",g.style.display=
"block")},1E3)):g.pending&&(c[1].innerHTML="",g.pending=!1,g.style.display="none")}};b.getStyleSheetPath=function(a){return h.getOption("resources")+"osk/"+a};b.getKeyboardPath=function(a){return(/^(([.]\/)|([.][.]\/)|(\/))|(:)/.test(a)?"":b.options.keyboards)+a};b.keyboardUnavailable=function(a){return window.setTimeout(function(){h.wait(!1);var g=b._KeyboardStubs[a],c=g.KN,g=g.KL,c=c.replace(/\s*keyboard\s*/i,"");h.alert("Sorry, the "+c+" keyboard for "+g+" is not currently available!",b.setDfltKeyboard);
0<a&&(g=b._KeyboardStubs[0],b._SetActiveKeyboard(g.KI,g.KLC,!0))},1E4)};b.KC_=function(a,g,c){var d,e=c.body?c:c.ownerDocument;if(i.touchable)return b.getTextBeforeCaret(c)._kmwSubstr(-a)._kmwSubstr(0,g);if(b.legacy)return c.value._kmwSubstr(c.length-a,g);if(e&&(d=e.defaultView)&&d.getSelection&&("on"==e.designMode.toLowerCase()||"true"==c.contentEditable||"plaintext-only"==c.contentEditable||""===c.contentEditable)){if(c=d.getSelection(),3==c.focusNode.nodeType)return c.focusOffset>2*a?c.focusNode.substringData(c.focusOffset-
2*a,2*a)._kmwSubstr(-a)._kmwSubstr(0,g):c.focusNode.substringData(0,c.focusOffset)._kmwSubstr(-a)._kmwSubstr(0,g)}else{if(c.setSelectionRange){if(c._KeymanWebSelectionStart)d=c._KeymanWebSelectionStart;else{if(null===b._CachedSelectionStart||c.selectionStart!==b._LastCachedSelection)b._LastCachedSelection=c.selectionStart,b._CachedSelectionStart=c.value._kmwCodeUnitToCodePoint(c.selectionStart),b._CachedSelectionEnd=c.value._kmwCodeUnitToCodePoint(c.selectionEnd);d=b._CachedSelectionStart}return d<
a?(Array(a-d+1).join("\ufffe")+c.value._kmwSubstr(0,d))._kmwSubstr(0,g):c.value._kmwSubstring(d-a,d-a+g)}if(e&&(d=e.selection))return c=d.createRange(),c.moveStart("character",-2*a),c.text._kmwSubstr(-a)._kmwSubstring(0,g)}return""};b.alignInputs=function(a){if(i.touchable)for(var g=0;g<b.inputList.length;g++)a?(b.updateInput(b.inputList[g]),b.inputList[g].style.visibility="visible",0<b.inputList[g].base.textContent.length&&(b.inputList[g].base.style.visibility="hidden")):(b.inputList[g].style.visibility=
"hidden",b.inputList[g].base.style.visibility="visible")};a.highlightSubKeys=function(b,g,c){if(!(null==b||null==b.subKeys)){var d,e,f,i,k,m,o,l=document.getElementById("kmw-popup-keys");5<a.touchY-c&&null==l&&(a.subkeyDelayTimer&&window.clearTimeout(a.subkeyDelayTimer),a.showSubKeys(b),l=document.getElementById("kmw-popup-keys"));for(d=0;d<b.subKeys.length;d++)try{e=l.childNodes[d].firstChild,f=h._GetAbsoluteX(e),i=h._GetAbsoluteY(e),k=f+e.offsetWidth,m=i+e.offsetHeight,o=g>f&&g<k&&c>i&&c<m,a.highlightKey(e,
o),o&&a.highlightKey(b,!1)}catch(p){}}};a.optionKey=function(h,g,c){c&&(0<=g.indexOf("K_LOPT")?a.showLanguageMenu():0<=g.indexOf("K_ROPT")&&(b._IsActivatingKeymanWebUI=0,a._Hide(!0),b.hideCaret(),b._LastActiveElement=0))};a.createKeyTip=function(){"phone"==i.formFactor&&(null==a.keytip&&(a.keytip=h._CreateElement("DIV"),a.keytip.className="kmw-keytip",a.keytip.id="kmw-keytip",a.keytip.style.pointerEvents="none",a.keytip.appendChild(h._CreateElement("CANVAS")),a.keytip.appendChild(h._CreateElement("SPAN")),
a.keytip.key=null,a.keytip.state=!1),a._Box.appendChild(a.keytip))};a.showKeyTip=function(b,g){var c=a.keytip;if(!(null==c||b==c.key&&g==c.state)){var d=document.getElementById("kmw-popup-keys"),d=d&&"visible"==d.style.visibility;if(g&&!d){for(var e=h._GetAbsoluteY(a._Box),f=a._Box.offsetHeight,d=h._GetAbsoluteX(b),i=h._GetAbsoluteY(b),k=b.offsetWidth,m=b.offsetHeight,o=b.firstChild,l=c.style,p=c.childNodes[1],q=p.style,w=0,t=c.firstChild,s=0;s<b.childNodes.length&&!(o=b.childNodes[s],a.hasClass(o,
"kmw-key-text"));s++);t.width=1.6*k;t.height=2.3*m;l.top="auto";l.bottom=e+f-i-m+"px";l.textAlign="center";l.overflow="visible";l.fontFamily=h.getStyleValue(o,"font-family");l.width=t.width+"px";l.height=t.height+"px";e=h.getStyleInt(o,"font-size");0!=e&&(l.fontSize=1.8*e+"px");p.textContent=o.textContent;q.display="block";q.position="absolute";q.textAlign="center";q.width="100%";q.top="2%";q.bottom="auto";o=(t.width-k)/2;d<o?(w=-1,d+=o):d>window.innerWidth-k-o&&(w=1,d-=o);a.drawPreview(t,k,m,w);
l.left=d-o+"px";l.display="block"}else c.style.display="none";c.key=b;c.state=g}};a.drawPreview=function(a,b,c,d){var c=a.getContext("2d"),e=(a.width-b)/2,f=a.height,h=0,k=e,m=b+e,b=b+2*e,o=0.5*f,l=0.6*f,p=8;"Android"==i.OS&&(p=3);switch(d){case -1:k-=e;m-=e;b-=e;break;case 1:h+=e,k+=e,m+=e}c.clearRect(0,0,a.width,a.height);"Android"==i.OS?(k=m=(k+m)/2,c.fillStyle="#999"):c.fillStyle="#ffffff";c.lineWidth="1";c.strokeStyle="#cccccc";c.save();c.beginPath();c.moveTo(h+p,0);c.arcTo(b,0,b,p,p);"Android"==
i.OS?(c.arcTo(b,o,m,l,p),c.arcTo(m,l,k,l,p)):(c.arcTo(b,o,m,l,p),c.arcTo(m,l,m-p,f,p),c.arcTo(m,f,k,f,p),c.arcTo(k,f,k,l-p,p));c.arcTo(k,l,h,o-p,p);c.arcTo(h,o,h,p,p);c.arcTo(h,0,h+p,0,p);c.fill();c.stroke();c.restore()};a.addCallout=function(b){if("phone"!=i.formFactor||"iOS"!=i.OS)return null;var g=h._CreateElement("DIV"),c=g.style;g.id="kmw-popup-callout";a._Box.appendChild(g);var d=b.offsetLeft,e=b.offsetWidth,f=b.offsetHeight;c.top=b.offsetTop-6+"px";c.left=d+"px";c.width=e+"px";c.height=f+6+
"px";return g};b.handleRotationEvents=function(){"iOS"==i.OS&&h.attachDOMEvent(window,"orientationchange",b.rotateDevice);"Android"==i.OS&&(a.wasVisible=a.isVisible,"onmozorientationchange"in screen?h.attachDOMEvent(screen,"mozorientationchange",a.hideNow):h.attachDOMEvent(window,"orientationchange",a.hideNow),h.attachDOMEvent(window,"resize",function(){b.alignInputs(!0);a.hideLanguageList();a._Load();a.wasVisible&&a._Show()}))};b.rotateDevice=function(){a.hideLanguageList();a._Visible&&(a.adjustHeights(),
"phone"==i.formFactor&&"Android"==i.OS&&window.setTimeout(function(){window.scrollTo(0,1)},1E3))};a.waitForFonts=function(a,g){if("undefined"==typeof a&&"undefined"==typeof g||"undefined"==typeof a.files&&"undefined"==typeof g.files)return!0;var c=h.checkFontDescriptor(a),d=h.checkFontDescriptor(g);if(c&&d)return!0;b.fontCheckTimer=window.setInterval(function(){h.checkFontDescriptor(a)&&h.checkFontDescriptor(g)&&(window.clearInterval(b.fontCheckTimer),b.fontCheckTimer=null,b.alignInputs(!0))},100);
window.setTimeout(function(){b.fontCheckTimer&&(window.clearInterval(b.fontCheckTimer),b.fontCheckTimer=null,b.alignInputs(!0))},5E3);return!1}})();(function(){var b=window.tavultesoft.keymanweb,a=b.util,h=b.osk,i=a.device;b.TSS_LAYER=33;b.TSS_PLATFORM=31;b._BeepObjects=[];b._BeepTimeout=0;b.KSF=b.KSF=function(){b._IgnoreNextSelChange=1};b.KT=b.KT=function(a,g){b.cachedContext.reset();var c=b._LastActiveElement,d,e,f;d=!1;null!=c&&(d=c._KeymanWebSelectionStart,e=c._KeymanWebSelectionEnd,f=b._Selection,b._IsActivatingKeymanWebUI=1,b._IgnoreNextSelChange=100,b._FocusLastActiveElement(),b._IsMozillaEditableIframe(c,0)&&(c=c.documentElement),document.selection&&
null!=f&&f.select(),c._KeymanWebSelectionStart=d,c._KeymanWebSelectionEnd=e,b._IgnoreNextSelChange=0,null!=a&&b.KO(0,c,a),"undefined"!=typeof g&&b.KDO(0,c,g),c._KeymanWebSelectionStart=null,c._KeymanWebSelectionEnd=null,d=!0);return d};b.KR=b.KR=function(j){b.loadTimer&&j.KI==b._LoadingInternalName&&(window.clearTimeout(b.loadTimer),b.loadTimer=null);if(b.initialized){var g,c=b._ActiveStub;if(!c||!("KI"in c)||c.KI!=j.KI)for(g=0;g<b._KeyboardStubs.length;g++){c=b._KeyboardStubs[g];if(j.KI==c.KI)break;
c=null}null==b._ActiveStub&&null!=c&&(b._ActiveStub=c);for(g=0;g<b._Keyboards.length;g++)if(j.KI==b._Keyboards[g].KI)return;b._Keyboards=b._push(b._Keyboards,j);b._LoadingInternalName==j.KI&&(b.doBeforeKeyboardChange(j.KI,c.KLC),b._ActiveKeyboard=j,null!=b._LastActiveElement&&(b._JustActivatedKeymanWebUI=1,b._SetTargDir(b._LastActiveElement)),b._LoadingInternalName=null,j.KL="undefined"!=typeof c.KL?c.KL:"",j.KLC="undefined"!=typeof c.KLC?c.KLC:"",j.KR="undefined"!=typeof c.KR?c.KR:"",j.KRC="undefined"!=
typeof c.KRC?c.KRC:"",j.KC="undefined"!=typeof c.KC?c.KC:"",j.KCC="undefined"!=typeof c.KCC?c.KCC:"",j.KD="undefined"!=typeof c.KD?c.KD:"",j.KS="undefined"!=typeof c.KS?c.KS:0,String.kmwEnableSupplementaryPlane(c&&(c.KS&&1==c.KS||"Hieroglyphic"==j.KN)),b.saveCurrentKeyboard(j.KI,c.KLC),h._Load(),"function"==typeof a.wait&&a.wait(!1));b.doKeyboardLoaded(j.KI)}else b.deferredKR.push(j)};b.KRS=b.KRS=function(a){var g;if(b.initialized){null==b.dfltStub&&(b.dfltStub=a);"undefined"==typeof a.KLC&&(a.KLC=
"");"undefined"==typeof a.KL&&(a.KL="undefined");for(g=0;g<b._KeyboardStubs.length;g++)if(b._KeyboardStubs[g].KI==a.KI&&(""==a.KLC||b._KeyboardStubs[g].KLC==a.KLC))return 1;b._KeyboardStubs=b._push(b._KeyboardStubs,a);b.doKeyboardRegistered(a.KI,a.KL,a.KN,a.KLC)}else b.deferredKRS.push(a)};b.KC=b.KC=function(a,g,c){var d=b.cachedContext.get(a,g);if(null!==d)return d;c=b.KC_(a,g,c);b.cachedContext.set(a,g,c);return c};b.KN=b.KN=function(a,b){var c=this.KC(a+1,a+1,b);return!1===c?!0:c._kmwLength()<
a+1};b.KCM=b.KCM=function(a,b,c,d){a=this.KC(a,d,b);if(!1!==a&&a===c)return!0;this._DeadkeyResetMatched();return!1};b.KIK=b.KIK=function(a){return b._ActiveKeyboard.KM?!a.LisVirtualKey:b._USKeyCodeToCharCode(a)?!0:!1};b.KKM=b.KKM=function(a,b,c){var d=0,e=173==a.Lcode?189:a.Lcode;255<a.vkCode&&(e=a.vkCode);if(a.LisVirtualKey||255<e){if(16384==(b&16384)||255<e)d=c==e&&(b&127)==a.Lmodifiers}else 0==(b&16384)&&(d=e==c);d||this._DeadkeyResetMatched();return d};b.KKI=b.KKI=function(a){var b={};b.vk=a.LisVirtualKey;
b.code=a.Lcode;b.modifiers=a.Lmodifiers;return b};b.KDM=b.KDM=function(a,g,c){if(0==b._DeadKeys.length)return!1;a=b._SelPos(g)-a;for(g=0;g<b._DeadKeys.length;g++)if(b._DeadKeys[g].p==a&&b._DeadKeys[g].d==c)return b._DeadKeys[g].matched=1;this._DeadkeyResetMatched();return!1};b.KBR=b.KBR=function(){b.cachedContext.reset();var a;for(a=b._BeepTimeout=0;a<b._BeepObjects.length;a++)b._BeepObjects[a].e.style.backgroundColor=b._BeepObjects[a].c;b._BeepObjects=[]};b.KB=b.KB=function(a){b.cachedContext.reset();
a.body&&(a=a.body);if(a.style&&"undefined"!=typeof a.style.backgroundColor){for(var g=0;g<b._BeepObjects.length;g++)if(b._BeepObjects[g].e==a)return;b._BeepObjects=b._push(b._BeepObjects,{e:a,c:a.style.backgroundColor});a.style.backgroundColor="#000000";0==b._BeepTimeout&&(b._BeepTimeout=1,window.setTimeout(b.KBR,50))}};b.KA=b.KA=function(a,g,c){if(""==g)return 0;g=c._kmwIndexOf(g);b._AnyIndices[a]=g;return 0<=g};b.KO=b.KO=function(a,g,c){b.cachedContext.reset();if("oninserttext"in b)b.oninserttext(a,
c);var d=g.body?g:g.ownerDocument,e;if(0<=g.className.indexOf("keymanweb-input")){var f=b.getTextBeforeCaret(g),f=0<a?f._kmwSubstr(0,f._kmwLength()-a)+c:f+c;b.setTextBeforeCaret(g,f)}else{if(b.legacy)g.value=0<a?g.value._kmwSubstr(0,g.value._kmwLength()-a)+c:g.value+c;else if(d&&(e=d.defaultView)&&e.getSelection&&("on"==d.designMode.toLowerCase()||"true"==g.contentEditable||"plaintext-only"==g.contentEditable||""===g.contentEditable)){var h="on"==d.designMode.toLowerCase();if(h)var i=b._CacheCommands(d);
e=e.getSelection();f=e.focusNode.nodeValue?e.focusNode.substringData(0,e.focusOffset)._kmwLength():0;e.isCollapsed||e.deleteFromDocument();var m=e.getRangeAt(0);0<a&&(m.setStart(e.focusNode,e.focusOffset-e.focusNode.nodeValue.substr(0,e.focusOffset)._kmwSubstr(-a).length),m.deleteContents());if(0<c._kmwLength())if(3==e.focusNode.nodeType){m=e.focusOffset;e.focusNode.insertData(e.focusOffset,c);try{e.extend(e.focusNode,m+c.length)}catch(o){e.focusNode.parentNode.scrollIntoView(),e.extend(e.focusNode,
m+c.length)}}else{var l=d.createTextNode(c);m.insertNode(l);e.extend(l,c.length)}h&&b._CacheCommandsReset(d,i,null);e.collapseToEnd();0<=a&&(b._DeadkeyDeleteMatched(),b._DeadkeyAdjustPos(f,-a+c._kmwLength()))}else if(d&&(e=d.selection)){if(d.body.isContentEditable||"on"==d.designMode.toLowerCase())i=b._CacheCommands(d);m=e.createRange();""!=m.text?(e.clear(),a=0):m.collapse(!0);0<a?(m.moveStart("character",-2*a),h=m.text._kmwSubstr(-a),m.collapse(!1),m.moveStart("character",-h.length)):a=0;m.text=
c;if(d.body.isContentEditable||"on"==d.designMode.toLowerCase())m.moveStart("character",-c.length),b._CacheCommandsReset(d,i,m.select),m.moveStart("character",c.length),m.select();0<=a&&(b._DeadkeyDeleteMatched(),b._DeadkeyAdjustPos(f,-a+c._kmwLength()));b._Selection=e.createRange();b._Selection.select();b._Selection.scrollIntoView()}else g.setSelectionRange&&(null!=g._KeymanWebSelectionStart?(f=g._KeymanWebSelectionStart,d=g._KeymanWebSelectionEnd):(f=g.value._kmwCodeUnitToCodePoint(g.selectionStart),
d=g.value._kmwCodeUnitToCodePoint(g.selectionEnd)),"textarea"==g.type.toLowerCase()&&"undefined"!=typeof g.scrollTop&&(h=g.scrollTop,m=g.scrollLeft),0>a?(g.value=g.value._kmwSubstring(0,f)+c+g.value._kmwSubstring(d),a=0):g.value=f<a?c+g.value._kmwSubstring(d):g.value._kmwSubstring(0,f-a)+c+g.value._kmwSubstring(d),0<=a&&(b._DeadkeyDeleteMatched(),b._DeadkeyAdjustPos(f,-a+c._kmwLength())),"undefined"!=typeof h&&(g.scrollTop=h,g.scrollLeft=m),a=f-a+c._kmwLength(),a=g.value._kmwCodePointToCodeUnit(a),
g.setSelectionRange(a,a),g._KeymanWebSelectionStart=null,g._KeymanWebSelectionEnd=null);"function"==typeof b.refreshElementContent&&b.refreshElementContent(g)}};b.KDO=b.KDO=function(a,g,c){b.cachedContext.reset();var d={};0<=a&&b.KO(a,g,"");d.p=b._SelPos(g);d.d=c;b._DeadKeys=b._push(b._DeadKeys,d)};b.KIO=b.KIO=function(a,g,c,d){b.cachedContext.reset();b._AnyIndices[c-1]<g._kmwLength()&&b.KO(a,d,g._kmwCharAt(b._AnyIndices[c-1]))};b._CacheCommands=function(a){var g=[["backcolor",1],["fontname",1],["fontsize",
1],["forecolor",1],["bold",0],["italic",0],["strikethrough",0],["subscript",0],["superscript",0],["underline",0]];a.defaultView&&b._push(g,["hilitecolor",1]);for(var c=0;c<g.length;c++)b._push(g[c],g[c][1]?a.queryCommandValue(g[c][0]):a.queryCommandState(g[c][0]));return g};b._CacheCommandsReset=function(a,b,c){for(var d=0;d<b.length;d++)b[d][1]?a.queryCommandValue(b[d][0])!=b[d][2]&&(c&&c(),a.execCommand(b[d][0],!1,b[d][2])):a.queryCommandState(b[d][0])!=b[d][2]&&(c&&c(),a.execCommand(b[d][0],!1,
null))};b.KIFS=b.KIFS=function(a,g){var c=!0;if(a==b.TSS_LAYER)c=h.layerId===g;else if(a==b.TSS_PLATFORM){var d,e,f=g.split(" ");for(d=0;d<f.length;d++){e=f[d].toLowerCase();switch(e){case "touch":case "hardware":i.touchable!=("touch"==e)&&(c=!1)}switch(e){case "windows":case "android":case "ios":case "macosx":case "linux":i.OS.toLowerCase()!=e&&(c=!1)}switch(e){case "tablet":case "phone":case "desktop":i.formFactor!=e&&(c=!1)}switch(e){case "native":case "web":case "ie":case "chrome":case "firefox":case "safari":case "opera":i.browser!=
e&&(c=!1)}}}return c};b.KSETS=function(a,g){b.cachedContext.reset();return a==b.TSS_LAYER?h.showLayer(g):!1};b.KLOAD=function(h,g,c){b.cachedContext.reset();h=a.loadCookie("KeymanWeb_"+h+"_Option_"+g);return"undefined"!=typeof h[g]?unescape(h[g]):c};b.KSAVE=function(h,g){b.cachedContext.reset();var c=b._ActiveKeyboard;if(!c||"undefined"==typeof c.KI||""==c.KI)return!1;var c="KeymanWeb_"+c.KI+"_Option_"+h,d=escape(g);a.saveCookie(c,d);return!0};b.GetLastActiveElement=function(){return b._LastActiveElement};
b.FocusLastActiveElement=function(){b._FocusLastActiveElement()};b.HideHelp=function(){h._Hide(!0)};b.ShowHelp=function(a,b){h._Show(a,b)};b.ShowPinnedHelp=function(){h.userPositioned=!0;h._Show(-1,-1)};b.cachedContext={_cache:[],reset:function(){this._cache=[]},get:function(a,b){return"undefined"==typeof this._cache[a]||"undefined"==typeof this._cache[a][b]?null:this._cache[a][b]},set:function(a,b,c){"undefined"==typeof this._cache[a]&&(this._cache[a]=[]);this._cache[a][b]=c}}})();(function(){var b=window.tavultesoft.keymanweb,a=b._VKMap_FF_IE={};a.k61=187;a.k59=186;b._VKMap_Opera_IE={};b._VKMap_Safari_IE={};a=b._VKMap={};a.se={};a.se.k220=192;a.se.k187=189;a.se.k219=187;a.se.k221=219;a.se.k186=221;a.se.k191=220;a.se.k192=186;a.se.k189=191;a.uk={};a.uk.k223=192;a.uk.k192=222;a.uk.k222=226;a.uk.k220=220;var a={},h={};a.k192=96;a.k49=49;a.k50=50;a.k51=51;a.k52=52;a.k53=53;a.k54=54;a.k55=55;a.k56=56;a.k57=57;a.k48=48;a.k189=45;a.k187=61;a.k81=113;a.k87=119;a.k69=101;a.k82=114;
a.k84=116;a.k89=121;a.k85=117;a.k73=105;a.k79=111;a.k80=112;a.k219=91;a.k221=93;a.k220=92;a.k65=97;a.k83=115;a.k68=100;a.k70=102;a.k71=103;a.k72=104;a.k74=106;a.k75=107;a.k76=108;a.k186=59;a.k222=39;a.k90=122;a.k88=120;a.k67=99;a.k86=118;a.k66=98;a.k78=110;a.k77=109;a.k188=44;a.k190=46;a.k191=47;h.k192=126;h.k49=33;h.k50=64;h.k51=35;h.k52=36;h.k53=37;h.k54=94;h.k55=38;h.k56=42;h.k57=40;h.k48=41;h.k189=95;h.k187=43;h.k81=81;h.k87=87;h.k69=69;h.k82=82;h.k84=84;h.k89=89;h.k85=85;h.k73=73;h.k79=79;h.k80=
80;h.k219=123;h.k221=125;h.k220=124;h.k65=65;h.k83=83;h.k68=68;h.k70=70;h.k71=71;h.k72=72;h.k74=74;h.k75=75;h.k76=76;h.k186=58;h.k222=34;h.k90=90;h.k88=88;h.k67=67;h.k86=86;h.k66=66;h.k78=78;h.k77=77;h.k188=60;h.k190=62;h.k191=63;b._USCharCode=[a,h];b._USKeyCodeToCharCode=function(a){return b._USCharCode[a.Lmodifiers&16?1:0]["k"+a.Lcode]}})();window.dfltLayout={desktop:{font:"Tahoma,Helvetica",layer:[{id:"default",row:[{id:"1",key:[{id:"K_BKQUOTE"},{id:"K_1"},{id:"K_2"},{id:"K_3"},{id:"K_4"},{id:"K_5"},{id:"K_6"},{id:"K_7"},{id:"K_8"},{id:"K_9"},{id:"K_0"},{id:"K_HYPHEN"},{id:"K_EQUAL"},{id:"K_BKSP",text:"*BkSp*",sp:"1",width:"130"}]},{id:"2",key:[{id:"K_TAB",text:"*Tab*",sp:"1",width:"130"},{id:"K_Q"},{id:"K_W"},{id:"K_E"},{id:"K_R"},{id:"K_T"},{id:"K_Y"},{id:"K_U"},{id:"K_I"},{id:"K_O"},{id:"K_P"},{id:"K_LBRKT"},{id:"K_RBRKT"},{id:"K_BKSLASH"}]},
{id:"3",key:[{id:"K_CAPS",text:"*Caps*",sp:"1",width:"165"},{id:"K_A"},{id:"K_S"},{id:"K_D"},{id:"K_F"},{id:"K_G"},{id:"K_H"},{id:"K_J"},{id:"K_K"},{id:"K_L"},{id:"K_COLON"},{id:"K_QUOTE"},{id:"K_ENTER",text:"*Enter*",sp:"1",width:"165"}]},{id:"4",key:[{id:"K_SHIFT",text:"*Shift*",sp:"1",width:"130"},{id:"K_oE2"},{id:"K_Z"},{id:"K_X"},{id:"K_C"},{id:"K_V"},{id:"K_B"},{id:"K_N"},{id:"K_M"},{id:"K_COMMA"},{id:"K_PERIOD"},{id:"K_SLASH"},{id:"K_RSHIFT",text:"*Shift*",sp:"1",width:"130"}]},{id:"5",key:[{id:"K_LCONTROL",
text:"*Ctrl*",sp:"1",width:"170"},{id:"K_LALT",text:"*Alt*",sp:"1",width:"160"},{id:"K_SPACE",text:"",width:"770"},{id:"K_ALT",text:"*Alt*",sp:"1",width:"160"},{id:"K_RCONTROL",text:"*Ctrl*",sp:"1",width:"170"}]}]}]},tablet:{font:"Tahoma,Helvetica",layer:[{id:"default",row:[{id:"0",key:[{id:"K_1"},{id:"K_2"},{id:"K_3"},{id:"K_4"},{id:"K_5"},{id:"K_6"},{id:"K_7"},{id:"K_8"},{id:"K_9"},{id:"K_0"},{id:"K_HYPHEN"},{id:"K_EQUAL"},{sp:"10",width:"1"}]},{id:"1",key:[{id:"K_Q",pad:"25"},{id:"K_W"},{id:"K_E"},
{id:"K_R"},{id:"K_T"},{id:"K_Y"},{id:"K_U"},{id:"K_I"},{id:"K_O"},{id:"K_P"},{id:"K_LBRKT"},{id:"K_RBRKT"},{sp:"10",width:"1"}]},{id:"2",key:[{id:"K_A",pad:"50"},{id:"K_S"},{id:"K_D"},{id:"K_F"},{id:"K_G"},{id:"K_H"},{id:"K_J"},{id:"K_K"},{id:"K_L"},{id:"K_COLON"},{id:"K_QUOTE"},{id:"K_BKSLASH",width:"90"}]},{id:"3",key:[{id:"K_oE2",width:"90"},{id:"K_Z"},{id:"K_X"},{id:"K_C"},{id:"K_V"},{id:"K_B"},{id:"K_N"},{id:"K_M"},{id:"K_COMMA"},{id:"K_PERIOD"},{id:"K_SLASH"},{id:"K_BKQUOTE"},{sp:"10",width:"1"}]},
{id:"4",key:[{id:"K_SHIFT",text:"*Shift*",sp:"1",width:"200",sk:[{id:"K_LCONTROL",text:"*Ctrl*",sp:"1",width:"50",nextlayer:"ctrl"},{id:"K_LALT",text:"*Alt*",sp:"1",width:"50",nextlayer:"alt"},{id:"K_ALTGR",text:"*AltGr*",sp:"1",width:"50",nextlayer:"ctrlalt"}]},{id:"K_LOPT",text:"*Menu*",sp:"1",width:"150"},{id:"K_SPACE",text:"",width:"570"},{id:"K_BKSP",text:"*BkSp*",sp:"1",width:"150"},{id:"K_ENTER",text:"*Enter*",sp:"1",width:"200"}]}]}]},phone:{font:"Tahoma,Helvetica",layer:[{id:"default",row:[{id:"0",
key:[{id:"K_1"},{id:"K_2"},{id:"K_3"},{id:"K_4"},{id:"K_5"},{id:"K_6"},{id:"K_7"},{id:"K_8"},{id:"K_9"},{id:"K_0"},{id:"K_HYPHEN"},{id:"K_EQUAL"},{sp:"10",width:"1"}]},{id:"1",key:[{id:"K_Q",pad:"25"},{id:"K_W"},{id:"K_E"},{id:"K_R"},{id:"K_T"},{id:"K_Y"},{id:"K_U"},{id:"K_I"},{id:"K_O"},{id:"K_P"},{id:"K_LBRKT"},{id:"K_RBRKT"},{sp:"10",width:"1"}]},{id:"2",key:[{id:"K_A",pad:"50"},{id:"K_S"},{id:"K_D"},{id:"K_F"},{id:"K_G"},{id:"K_H"},{id:"K_J"},{id:"K_K"},{id:"K_L"},{id:"K_COLON"},{id:"K_QUOTE"},
{id:"K_BKSLASH",width:"90"}]},{id:"3",key:[{id:"K_oE2",width:"90"},{id:"K_Z"},{id:"K_X"},{id:"K_C"},{id:"K_V"},{id:"K_B"},{id:"K_N"},{id:"K_M"},{id:"K_COMMA"},{id:"K_PERIOD"},{id:"K_SLASH"},{id:"K_BKQUOTE"},{sp:"10",width:"1"}]},{id:"4",key:[{id:"K_SHIFT",text:"*Shift*",sp:"1",width:"200",sk:[{id:"K_LCONTROL",text:"*Ctrl*",sp:"1",width:"50",nextlayer:"ctrl"},{id:"K_LALT",text:"*Alt*",sp:"1",width:"50",nextlayer:"alt"},{id:"K_ALTGR",text:"*AltGr*",sp:"1",width:"50",nextlayer:"ctrlalt"}]},{id:"K_LOPT",
text:"*Menu*",width:"150",sp:"1"},{id:"K_SPACE",width:"570",text:""},{id:"K_BKSP",text:"*BkSp*",width:"150",sp:"1"},{id:"K_ENTER",text:"*Enter*",width:"200",sp:"1"}]}]}]}};(function(){var b=window.tavultesoft.keymanweb;if("complete"===document.readyState)b.init(null);else var a=window.setInterval(function(){"complete"===document.readyState&&(window.clearInterval(a),b.init(null))},10)})();