VirtualKeyboard=new Object();var tmp=function(){if(myTrace==undefined){function p(A){}myTrace=p;}kbdDefinition=function(C,A,D,B){this.Name=C;this.ShortName=A;this.Definition=D;this.Enable=true;this.Shifted=B;};var i;var z;var j;var c;var v;var f;var w=new Array();var n;var t;var h;var u;w.push(new kbdDefinition("Edhanced","edh",[["1","2","3","4","5","6","7","8","9","0"],["a","b","c","d","e","f","g","h","i","j"],["k","l","m","n","o","p","q","r","s","t"],["u","v","w","x","y","z","SPC","","SH","aa"]],[["!","@","#","$","%","^","&","*","(",")"],["A","B","C","D","E","F","G","H","I","J"],["K","L","M","N","O","P","Q","R","S","T"],["U","V","W","X","Y","Z","SPC","","SH",""]]));w.push(new kbdDefinition("Letters","abc",[["a","b","c","d","e","f","g","h","i","j"],["k","l","m","n","o","p","q","r","s","t"],["u","v","w","x","y","z"," ","","",""]]));w.push(new kbdDefinition("Digits","123",[["1","2","3","4","5","6","7","8","9","0"]]));w.push(new kbdDefinition("9 lines","9L",[["1","2","3","4","5","6","7","8","9","0"],["1","2","3","4","5","6","7","8","9","0"],["1","2","3","4","5","6","7","8","9","0"],["1","2","3","4","5","6","7","8","9","0"],["1","2","3","4","5","6","7","8","9","0"],["1","2","3","4","5","6","7","8","9","0"],["1","2","3","4","5","6","7","8","9","0"],["1","2","3","4","5","6","7","8","9","0"],["a","2","3","4","5","6","7","8","9","0"]]));w.kbdDefault=w[0];function k(B,A){j[A]=B[A];B[A]=this["fg_"+A];}function x(A){return(A+1)%10;}function b(A){if(A==0){return 9;}return A-1;}function d(G,B){n=G;if(B&&(G.Shifted!=undefined)){t=G.Shifted;}else{t=G.Definition;}z.kbdDoc.KBD_GROUP.kbdTitle.setValue(G.Name);for(var I=0;I<10;I++){var D=z.kbdDoc.KBD_GROUP["line"+x(I)];if(I in t){D.show(true);q(D,I+1,t[I]);if((I%2)==0){D.kbdLine.KBD_LINE_GROUP.kbdLineLight.show(true);}else{D.kbdLine.KBD_LINE_GROUP.kbdLineDark.show(true);}}else{D.show(false);}}var H=t.length;u=this.arr2ndx(H);var F=z.kbdDoc.KBD_GROUP["line"+u];if((H%2)==0){F.kbdLine.KBD_LINE_GROUP.kbdLineLight.show(true);}else{F.kbdLine.KBD_LINE_GROUP.kbdLineDark.show(true);}F.show(true);F.kbdLine.KBD_LINE_GROUP.lineName.setValue("0");for(var C=0;C<10;C++){var E=this.arr2ndx(C);var A=F.kbdLine.KBD_LINE_GROUP["col"+E];if(C in f){A.setValue(f[C].ShortName);}else{A.setValue("");}}}function q(B,E,A){B.kbdLine.KBD_LINE_GROUP.lineName.setValue(E);for(var C=0;C<10;C++){var D=B.kbdLine.KBD_LINE_GROUP["col"+this.arr2ndx(C)];D.setValue(A[C]);}}function y(B,A){z.kbdDoc.KBD_GROUP.input.setValue(c);i.bubble("doKbdProgress",B,A,c);}function a(F){var B=b(F);if(v==-1){if(B==9){v=9;h=z.kbdDoc.KBD_GROUP["line"+u];h.kbdLine.KBD_LINE_GROUP.kbdLineSel.show(true);}else{if(!(B in t)){}else{v=B;var A=z.kbdDoc.KBD_GROUP["line"+F];h=A;h.kbdLine.KBD_LINE_GROUP.kbdLineSel.show(true);}}}else{if(v==9){var E=f[B];if(E!=undefined){d(E);}}else{var C=t[v][B];var D=m(C);c+=D;y(C,D);}if(h!=undefined){h.kbdLine.KBD_LINE_GROUP.kbdLineSel.show(false);}v=-1;}}function m(A){if(A.lenght==1){return A;}if(A=="SPC"){return" ";}if(A=="SH"){d(n,t==n.Definition);return"";}return A;}VirtualKeyboard.Activate=function(C,A){myTrace("V.Activate");z=A;i=C;z.show(true);c="";z.kbdDoc.KBD_GROUP.input.setValue("");v=-1;h=undefined;j=new Object();k(C,"doCenter");k(C,"doMark");k(C,"doMarkMenu");k(C,"doMenu");k(C,"doDigit");var B=0;f=new Array();f.push(w.kbdDefault);while((B<w.length)&&(f.length<10)){if(w[B].Enable&&(w[B]!=w.kbdDefault)){f.push(w[B]);}B++;}d(w.kbdDefault);myTrace("V.Activate done");};VirtualKeyboard.Deactivate=function(){myTrace("V.Deactivate");if(i==undefined){return;}z.show(false);for(var A in j){if(j[A]==undefined){delete i[A];}else{i[A]=j[A];}}z=undefined;i=undefined;j=undefined;};function o(){this.bubble("doKbdInput",c);}function g(){this.bubble("doKbdCancel");}function l(){c="";y("CLR",undefined);}function r(){c=c.slice(0,-1);y("BS",undefined);}function s(A){a(A.key);}};try{tmp();}catch(e){if(log!=undefined){log.error("in VirtualKeyboard.js",e);}if(myTrace!=undefined){myTrace("Error loading VirtualKeyboard.js: "+e);}}