function VATMpad(_1,_2,_3,_4,_5,_6,_7,_8,_9,_a,_b,_c,_d){return this._construct(_1,_2,_3,_4,_5,_6,_7,_8,_9,_a,_b,_c,_d);}VATMpad.prototype={kbArray:[],_setup_event:function(_e,_f,_10){return (_e.attachEvent?_e.attachEvent("on"+_f,_10):((_e.addEventListener)?_e.addEventListener(_f,_10,false):null));},_detach_event:function(_11,_12,_13){return (_11.detachEvent?_11.detachEvent("on"+_12,_13):((_11.removeEventListener)?_11.removeEventListener(_12,_13,false):null));},_start_flash:function(_14){function getColor(str,_16,_17){if(/rgb\((\d+),\s(\d+),\s(\d+)\)/.exec(str)){switch(_16){case 1:return parseInt(RegExp.$1,10);case 2:return parseInt(RegExp.$2,10);case 3:return parseInt(RegExp.$3,10);default:return 0;}}else{return str.length==4?parseInt(str.substr(_16,1)+str.substr(_16,1),16):parseInt(str.substr(_17,2),16);}}function getR(_18){return getColor(_18,1,1);}function getG(_19){return getColor(_19,2,3);}function getB(_1a){return getColor(_1a,3,5);}var el=_14.time?_14:(_14.company&&_14.company.time?_14.company:null);if(el){el.time=0;clearInterval(el.timer);}var vkb=this;var ftc=vkb.fontcolor,bgc=vkb.keycolor,brc=vkb.bordercolor;if(_14.dead){ftc=vkb.deadcolor;}if(((_14.innerHTML=="Shift")&&vkb.Shift)||((_14.innerHTML=="Caps")&&vkb.Caps)||((_14.innerHTML=="AltGr")&&vkb.AltGr)){bgc=vkb.lic;}var fr=getR(ftc),fg=getG(ftc),fb=getB(ftc);var kr=getR(bgc),kg=getG(bgc),kb=getB(bgc);var br=getR(brc),bg=getG(brc),bb=getB(brc);var f_r=getR(vkb.cfc),f_g=getG(vkb.cfc),f_b=getB(vkb.cfc);var k_r=getR(vkb.cbg),k_g=getG(vkb.cbg),k_b=getB(vkb.cbg);var b_r=getR(vkb.cbr),b_g=getG(vkb.cbr),b_b=getB(vkb.cbr);var _24=function(){function dec2hex(dec){var _26="0123456789ABCDEF";var a=dec%16;var b=(dec-a)/16;return _26.charAt(b)+_26.charAt(a)+"";}_14.time=!_14.time?10:(_14.time-1);function calc_color(_29,end){return (end-(_14.time/10)*(end-_29));}var _2b=calc_color(f_r,fr),t_f_g=calc_color(f_g,fg),t_f_b=calc_color(f_b,fb);var _2c=calc_color(k_r,kr),t_k_g=calc_color(k_g,kg),t_k_b=calc_color(k_b,kb);var _2d=calc_color(b_r,br),t_b_g=calc_color(b_g,bg),t_b_b=calc_color(b_b,bb);_14.style.color="#"+dec2hex(_2b)+dec2hex(t_f_g)+dec2hex(t_f_b);_14.style.borderColor="#"+dec2hex(_2d)+dec2hex(t_b_g)+dec2hex(t_b_b);_14.style.backgroundColor="#"+dec2hex(_2c)+dec2hex(t_k_g)+dec2hex(t_k_b);if(!_14.time){clearInterval(_14.timer);return;}};_24();_14.timer=window.setInterval(_24,50);},_setup_style:function(obj,top,_30,_31,_32,_33,_34,_35,_36,_37,_38,_39,_3a,_3b){var os=obj.style;if(top){os.top=top;}if(_30){os.left=_30;}if(_31){os.width=_31;}if(_32){os.height=_32;}if(_33){os.position=_33;}if(_34){os.border="1px solid "+_34;}if(_35){os.backgroundColor=_35;}os.textAlign="center";if(_36){os.lineHeight=_36;}if(_37){os.color=_37;}if(_38){os.fontSize=_38;}os.fontWeight=_39||"bold";if(_3a){os.paddingLeft=_3a;}if(_3b){os.paddingRight=_3b;}},_setup_key:function(_3d,id,top,_40,_41,_42,_43,_44,_45,_46,_47,_48,_49){var _id=this.Cntr.id+id;var _4b=document.getElementById(_id);var key=_4b?_4b.parentNode:document.createElement("DIV");this._setup_style(key,top,_40,_41,_42,"absolute");var _4d=_4b||document.createElement("DIV");key.appendChild(_4d);_3d.appendChild(key);this._setup_style(_4d,"","","",_45,"relative",_43,_44,_45,_46,_47,_48,_49);_4d.id=_id;if(!_4b){this._setup_event(_4d,"mousedown",this._generic_callback_proc);}_4d.state=true;return _4d;},_findX:function(obj){return (obj&&obj.parentNode)?parseFloat(obj.parentNode.offsetLeft):0;},_findY:function(obj){return (obj&&obj.parentNode)?parseFloat(obj.parentNode.offsetTop):0;},_findW:function(obj){return (obj&&obj.parentNode)?parseFloat(obj.parentNode.offsetWidth):0;},_findH:function(obj){return (obj&&obj.parentNode)?parseFloat(obj.parentNode.offsetHeight):0;},_construct:function(_52,_53,_54,_55,_56,_57,_58,_59,_5a,_5b,_5c,_5d,_5e){var _5f=(this.Cntr!=undefined),ct=_5f?this.Cntr:document.getElementById(_52);var _60=(_55&&(_55!=this.fontsize));this._Callback=((typeof (_53)=="function")&&((_53.length==1)||(_53.length==2)))?_53:(this._Callback||null);var ff=_54||this.fontname||"";var fs=_55||this.fontsize||"14px";var fc=_56||this.fontcolor||"#000";var bg=_57||this.bgcolor||"#FFF";var kc=_58||this.keycolor||"#FFF";var bc=_59||this.bordercolor||"#777";this.cfc=_5b||this.cfc||"#CC3300";this.cbg=_5c||this.cbg||"#FF9966";this.cbr=_5d||this.cbr||"#CC3300";this.sc=(_5a==undefined)?((this.sc==undefined)?false:this.sc):_5a;this.fontname=ff,this.fontsize=fs,this.fontcolor=fc;this.bgcolor=bg,this.keycolor=kc,this.bordercolor=bc;if(!_5f){this.keys=[],this.Cntr=ct,this.LastKey=null;VATMpad.prototype.kbArray[_52]=this;}var kb=_5f?ct.childNodes[0]:document.createElement("DIV");if(!_5f){ct.appendChild(kb);ct.style.display="block";ct.style.zIndex=9999;if(_5e){ct.style.position="relative";}else{ct.style.position="absolute";var _68=0,ct_=ct;if(ct_.offsetParent){while(ct_.offsetParent){_68+=ct_.offsetLeft;ct_=ct_.offsetParent;}}else{if(ct_.x){_68+=ct_.x;}}var _69=0;ct_=ct;if(ct_.offsetParent){while(ct_.offsetParent){_69+=ct_.offsetTop;ct_=ct_.offsetParent;}}else{if(ct_.y){_69+=ct_.y;}}ct.style.top=_69+"px",ct.style.left=_68+"px";}kb.style.position="relative";kb.style.top="0px",kb.style.left="0px";}kb.style.border="1px solid "+bc;var _6a=_5f?kb.childNodes[0]:document.createElement("DIV"),ks=_6a.style;if(!_5f){kb.appendChild(_6a);ks.position="relative";ks.width="1px";ks.cursor="default";}this._setup_event(_6a,"selectstart",function(_6b){return false;});this._setup_event(_6a,"mousedown",function(_6c){if(_6c.preventDefault){_6c.preventDefault();}return false;});ks.fontFamily=ff,ks.backgroundColor=bg;if(!_5f||_60){ks.width=this._create_numpad(_52,_6a);ks.height=(this._findY(this.LastKey)+this._findH(this.LastKey)+1)+"px";}return this;},_create_numpad:function(_6d,_6e){var c="center",n="normal";var fc=this.fontcolor,fs=this.fontsize,kc=this.keycolor,bc=this.bordercolor;var mag=parseFloat(fs)/14,cell=Math.floor(25*mag);var cp=String(cell)+"px",lh=String(Math.floor(cell-2))+"px";var _73="1px";var _74=this._setup_key(_6e,"___pad_7","1px",_73,cp,cp,bc,kc,lh,fc,fs);_74.innerHTML="7";this.keys[this.keys.length]=_74;var _75=String(this._findX(_74)+this._findW(_74)+1)+"px";var _76=this._setup_key(_6e,"___pad_8","1px",_75,cp,cp,bc,kc,lh,fc,fs);_76.innerHTML="8";this.keys[this.keys.length]=_76;var _77=String(this._findX(_76)+this._findW(_76)+1)+"px";var _78=this._setup_key(_6e,"___pad_9","1px",_77,cp,cp,bc,kc,lh,fc,fs);_78.innerHTML="9";this.keys[this.keys.length]=_78;var _79=this._findH(_78),edge_Y=(this._findY(_78)+_79+1)+"px";edge_Y=(this._findY(_74)+_79+1)+"px";var _7a=this._setup_key(_6e,"___pad_4",edge_Y,_73,cp,cp,bc,kc,lh,fc,fs);_7a.innerHTML="4";this.keys[this.keys.length]=_7a;var _7b=this._setup_key(_6e,"___pad_5",edge_Y,_75,cp,cp,bc,kc,lh,fc,fs);_7b.innerHTML="5";this.keys[this.keys.length]=_7b;var _7c=this._setup_key(_6e,"___pad_6",edge_Y,_77,cp,cp,bc,kc,lh,fc,fs);_7c.innerHTML="6";this.keys[this.keys.length]=_7c;edge_Y=(this._findY(_7a)+_79+1)+"px";var _7d=this._setup_key(_6e,"___pad_1",edge_Y,_73,cp,cp,bc,kc,lh,fc,fs);_7d.innerHTML="1";this.keys[this.keys.length]=_7d;var _7e=this._setup_key(_6e,"___pad_2",edge_Y,_75,cp,cp,bc,kc,lh,fc,fs);_7e.innerHTML="2";this.keys[this.keys.length]=_7e;var _7f=this._setup_key(_6e,"___pad_3",edge_Y,_77,cp,cp,bc,kc,lh,fc,fs);_7f.innerHTML="3";this.keys[this.keys.length]=_7f;edge_Y=(this._findY(_7d)+_79+1)+"px";var _80=this._setup_key(_6e,"___pad_0",edge_Y,_73,cp,cp,bc,kc,lh,fc,fs);_80.innerHTML="0";this.keys[this.keys.length]=_80;var _81=this._setup_key(_6e,"___pad_period",edge_Y,_75,String(2*cell+1)+"px",cp,bc,kc,lh,fc,parseFloat(fs)*0.9,n);_81.innerHTML="Enter";this.keys[this.keys.length]=_81;this.LastKey=_81;return String(this._findX(_78)+this._findW(_78)+1)+"px";},_generic_callback_proc:function(_82){var e=_82||window.event;var _84=e.srcElement||e.target;var _85=_84.id.substring(0,_84.id.indexOf("___"));var _86=VATMpad.prototype.kbArray[_85];if(_86.sc){_86._start_flash(_84);}if(_86._Callback){_86._Callback(_84.innerHTML,_86.Cntr.id);}},SwitchButton:function(_87,_88){var key=this.keys[_87];if(key.state){if(!_88){key.offline=true;key.style.color="#CCCCCC";this._detach_event(key,"mousedown",this._generic_callback_proc);}}else{if(_88&&key.offline){key.style.color=this.fontcolor;this._setup_event(key_sub,"mousedown",this._generic_callback_proc);}}},Show:function(_8a){var ct=this.Cntr.style;ct.display=((_8a==undefined)||(_8a==true))?"block":((_8a==false)?"none":ct.display);}};