if(!nexacro.DeviceI){nexacro.DeviceI=function(){this.setup();};var _pDeviceI=nexacro.DeviceI.prototype=nexacro._createPrototype(nexacro.EventSinkObject,nexacro.DeviceI);_pDeviceI._type_name="Device";_pDeviceI.libraryversion={};_pDeviceI.setup=function(){};_pDeviceI.execiOS=function(){};_pDeviceI.keyEvent=function(_a,_b){var _c=1;var _d=82;var _e=4;if(_a==_d){_c=1;}else if(_a==_e){_c=2;}return application.getActiveForm()._on_devicebuttonup({button:_c});};_pDeviceI.makeID=function(){var _a=new Date();var _b=_a.getMilliseconds().toString()+Math.floor(Math.random()*100).toString();return parseInt(_b);};_pDeviceI.runCallback=function(sid,sfunc,params){var obj;if(nexacro.Device.curDevice==0){obj=eval("("+params+")");}else{obj=params;}var willrunfunc=this._userCreatedObj[sid];if((willrunfunc!=undefined)&&(typeof willrunfunc[sfunc]=="function")){return willrunfunc[sfunc](obj);}};_pDeviceI.on_created=function(){};_pDeviceI.print=function(_a){var _b=document.getElementById('DeviceAPI_status');_b.innerHTML=_b.innerHTML+_a+'
';};_pDeviceI.publicNumCheck=function(_a){if(_a==null||_a==undefined){return false;}if(typeof (_a)=="string"&&_a.length<=0){return false;}if(typeof (_a)=="number"){return true;}return isFinite(Number(_a));};_pDeviceI.pramck_makeCall=function(_a,_b){if(_a==null||typeof (_a)=="undefined"){return false;}else{_a=_a.toString();}var _c="";try{_c=_a.split("+").join("");_c=_c.split("-").join("");}catch(e){return false;}var _d=/[^0-9+-]/gi;if(_d.test(_a)==true){_d.lastIndex=0;return false;}if(typeof (_b)!="boolean"){return false;}return true;};_pDeviceI.paramck_play=function(_a){if(_a==null||typeof (_a)=="undefined"||typeof (_a)!="string"){return false;}var _b=_a.split(" ").join("");if(_b.length==0){return false;}return true;};_pDeviceI.pramck_contactString=function(_a){if(_a==null||typeof (_a)=="undefined"||typeof (_a)!="string"){return false;}return true;};_pDeviceI.isConvertDateToString=function(_a){var _b;var _c=new Date();try{_b=_a.split('/');_c.setYear(parseInt(_b[0])|0);_c.setMonth(parseInt(_b[1])|0-1);_c.setDate(parseInt(_b[2])|0);}catch(e){return _c;}return _c;};_pDeviceI.parseDateToInt=function(_a){if(_a<10){_a="0"+_a;}return _a;};_pDeviceI.encodeString=function(_a){if(_a===undefined||_a===null){return _a;}if(typeof (_a)!='string'){return _a;}var _b=_a;_b=_b.replace(/\&/g,"&");_b=_b.replace(/\/g,">");_b=_b.replace(/\"/g,""");_b=_b.replace(/\'/g,"'");_b=_b.replace(/\ /g," ");_b=_b.replace(/\r/g," ");_b=_b.replace(/\n/g," ");_b=_b.replace(/\t/g," ");_b=_b.replace(/\\/g,"\");_b=_b.replace(/\x03/g,"");return _b;};_pDeviceI.decodeString=function(_a){if(_a===undefined||_a===null){return _a;}if(typeof (_a)!='string'){return _a;}var _b=_a;_b=_b.replace(/\&\;/g,"&");_b=_b.replace(/\<\;/g,"<");_b=_b.replace(/\>\;/g,">");_b=_b.replace(/\"\;/g,"\"");_b=_b.replace(/\&apos\;/g,"'");_b=_b.replace(/\&\#32\;/g," ");_b=_b.replace(/\&\#13\;/g,"\r");_b=_b.replace(/\&\#10\;/g,"\n");_b=_b.replace(/\&\#9\;/g,"\t");_b=_b.replace(/\&\#92\;/g,"\\");_b=_b.replace(/\&\#3\;/g,String.fromCharCode(3));return _b;};_pDeviceI.DatasetToJSONString=function(_a){if(_a==undefined){return '{"columnInfos":[], "rows":[]}';}var _b=_a.getColCount();var _c=_a.getRowCount();var _d=false;var _e='{"columnInfos":[';for(var _f=0;_f<_b;_f++ ){var _g=_a.getColumnInfo(_f);if(_d){_e+=(',{"name":"'+_g.name+'", "type":'+_g.ntype+'}');}else{_e+=('{"name":"'+_g.name+'", "type":'+_g.ntype+'}');}_d=true;}_d=false;_e+='],"rows":[';for(var _f=0;_f<_c;_f++ ){if(_d){_e+=',[';}else{_e+='[';}_d=true;var _h=false;for(var _i=0;_i<_b;_i++ ){var _g=_a.getColumnInfo(_i);var _j=_a.getColumn(_f,_g.name);if(_h){_e+=',';}_h=true;var _k;if(_j==null){_k='null';}else if(_j==undefined){_k='undefined';}else{switch(_g.ntype){case 2:case 3:_k=nexacro.DataUtils.toTextFromDecimal(_j);break;case 4:_k='"'+nexacro.DataUtils.toTextFromDecimal(_j)+'"';break;case 5:_k='"'+nexacro.DataUtils.toTextFromDate(_j)+'"';break;case 6:_k='"'+nexacro.DataUtils.toTextFromTime(_j)+'"';break;case 7:if(_j.dateObj==undefined){_k='"'+nexacro.DataUtils.toTextFromDateTime(_j)+'"';}else{_k='"'+nexacro.DataUtils.toTextFromDateTime(_j.dateObj)+'"';}break;case 1:_k='"'+nexacro.Device.encodeString(_j)+'"';break;case 0:case 8:case 9:default:_k='"'+_j+'"';break;}}_e+=_k;}_e+=']';}_e+=']}';return _e;};_pDeviceI.DatasetToJSONObject=function(dataset){return eval('('+DatasetToJSONString(dataset)+')');};_pDeviceI.JSONObjectToDataset=function(_a,_b){if(_a==undefined){return _b;}if(_b==undefined){_b=new nexacro.Dataset();}var _c=_a.columnInfos;for(var _e=0;_e<_c.length;_e++ ){_b.addColumn(_c[_e].name,nexacro.DataUtils.toTypeName(_c[_e].type));}var _d=_a.rows;for(var _e=0;_e<_d.length;_e++ ){var _f=_b.addRow();for(var _g=0;_g<_c.length;_g++ ){switch(_c[_g].type){case 1:_b.setColumn(_f,_c[_g].name,nexacro.Device.decodeString(_d[_e][_g]));break;case 4:_b.setColumn(_f,_c[_g].name,_d[_e][_g]);break;case 2:case 3:case 5:case 6:case 7:case 0:case 8:case 9:default:_b.setColumn(_f,_c[_g].name,_d[_e][_g]);break;}}}return _b;};_pDeviceI.JSONStringToDataset=function(jsonString,dataset){if(dataset==undefined){dataset=new nexacro.Dataset();}return nexacro.Device.JSONObjectToDataset(eval('('+jsonString+')'));};_pDeviceI.DatasetToJSONString2=function(_a){if(_a==undefined){return '{"columnInfos":[], "rows":[]}';}var _b=_a.getColCount();var _c=_a.getRowCount();var _d=false;var _e='{"columnInfos":[';for(var _f=0;_f<_b;_f++ ){var _g=_a.getColumnInfo(_f);if(_d){_e+=(',{"name":"'+_g.name+'", "type":'+_g.ntype+'}');}else{_e+=('{"name":"'+_g.name+'", "type":'+_g.ntype+'}');}_d=true;}_d=false;_e+='],"rows":[';for(var _f=0;_f<_c;_f++ ){if(_d){_e+=',{';}else{_e+='{';}_d=true;var _h=false;for(var _i=0;_i<_b;_i++ ){var _g=_a.getColumnInfo(_i);var _j=_a.getColumn(_f,_g.name);if(_j==undefined){continue;}if(_h){_e+=',';}_h=true;_e+='"'+_g.name+'":';var _k;if(_j==null){_k='null';}else if(_j==undefined){_k='undefined';}else{switch(_g.ntype){case 2:case 3:_k=nexacro.DataUtils.toTextFromDecimal(_j);break;case 4:_k='"'+nexacro.DataUtils.toTextFromDecimal(_j)+'"';break;case 5:_k='"'+nexacro.DataUtils.toTextFromDate(_j)+'"';break;case 6:_k='"'+nexacro.DataUtils.toTextFromTime(_j)+'"';break;case 7:if(_j.dateObj==undefined){_k='"'+nexacro.DataUtils.toTextFromDateTime(_j)+'"';}else{_k='"'+nexacro.DataUtils.toTextFromDateTime(_j.dateObj)+'"';}break;case 1:_k='"'+nexacro.Device.encodeString(_j)+'"';break;case 0:case 8:case 9:default:_k='"'+_j+'"';break;}}_e+=_k;}_e+='}';}_e+=']}';return _e;};_pDeviceI.DatasetToJSONObject2=function(dataset){return eval('('+nexacro.Device.DatasetToJSONString2(dataset)+')');};_pDeviceI.JSONObjectToDataset2=function(_a,_b){if(_a==undefined){return _b;}if(_b==undefined){_b=new nexacro.Dataset();}var _c=_a.columnInfos;for(var _e=0;_e<_c.length;_e++ ){_b.addColumn(_c[_e].name,nexacro.DataUtils.toTypeName(_c[_e].type));}var _d=_a.rows;for(var _e=0;_e<_d.length;_e++ ){var _f=_b.addRow();for(var _g=0;_g<_c.length;_g++ ){switch(_c[_g].type){case 1:_b.setColumn(_f,_c[_g].name,nexacro.Device.decodeString(_d[_e][_c[_g].name]));break;case 4:_b.setColumn(_f,_c[_g].name,_d[_e][_c[_g].name]);break;case 2:case 3:case 5:case 6:case 7:case 0:case 8:case 9:default:_b.setColumn(_f,_c[_g].name,_d[_e][_c[_g].name]);break;}}}return _b;};_pDeviceI.JSONStringToDataset2=function(jsonString,dataset){if(dataset==undefined){dataset=new nexacro.Dataset();}return nexacro.Device.JSONObjectToDataset2(eval('('+jsonString+')'),dataset);};_pDeviceI.isHybrid=function(){return this._is_hybrid;};_pDeviceI.exit=function(_a){var _b=false;if(arguments.length==0){_bUseCache="false";}else{if(_a==true||(typeof (_a)=="string"&&_a=="true")){_b="true";}else if(_a==false||(typeof (_a)=="string"&&_a=="false")){_b="false";}else{return false;}}if(nexacro.Device.curDevice==1){var _c="";_c="EXIT"+_b;nexacro.Device.exec(_c);}};_pDeviceI=null;}if(nexacro.System){nexacro.System.prototype=function(){this._id=nexacro.Device.makeID();nexacro.Device._userCreatedObj[this._id]=this;this.enableevent=true;if(nexacro.Device.curDevice==1){var _a="iOS";var _b,_c;var _d=navigator.userAgent.match(/(iPhone\sOS)\s([\d_]+)/);var _e=navigator.userAgent.match(/(iPad).*OS\s([\d_]+)/);if(_d){_b="iphone";_c=_d[2].replace(/_/g,'.');}if(_e){_b="ipad";_c=_e[2].replace(/_/g,'.');}this.osversion=_a+" "+_c;this.navigatorname="nexacro";this.navigatorversion="14";this.mobilephonenumber="";this.mobileproducttype=_b;this.mobileuniqueid="";this.mobileorientation="";this.taskbarsize="20";this.userapppath="";}};nexacro.System.prototype.set_osversion=function(){};nexacro.System.prototype.set_navigatorname=function(){};nexacro.System.prototype.set_navigatorversion=function(){};nexacro.System.prototype.set_mobilephonenumber=function(){};nexacro.System.prototype.set_mobileproducttype=function(){};nexacro.System.prototype.set_mobileuniqueid=function(){};nexacro.System.prototype.set_mobileorientation=function(){};nexacro.System.prototype.set_taskbarsize=function(){};nexacro.System.prototype.set_userapppath=function(){};nexacro.System.prototype.set_sdcardpath=function(){};nexacro.System.prototype.destroy=function(){delete nexacro.Device._userCreatedObj[this._id];return true;};nexacro.System.makeCall=function(_a,_b){if(_b=="undefined"||_b==null){this.bAutoDialing=false;}else{this.bAutoDialing=_b;}var _c=nexacro.Device.pramck_makeCall(_a,this.bAutoDialing);if(_c==true){var _d=_a;_d=_d.split("-").join("");var _e=_d.split("+").join("");if(_e.length<3){return false;}if(nexacro.Device.curDevice==0){var _f='{"telNo":"'+_d+'", "bAuto":"'+this.bAutoDialing+'"}';var _g='{"id":'+this._id+', "div":"Call", "method":"sendCall", "params":'+_f+'}';nexacro.Device.exec(_g);}else{if((typeof nexacro.Device.isHybrid()=="undefined")||nexacro.Device.isHybrid()==false){return true;}nexacro.Device.bridge.src='tel:'+_d;}return true;}else{return false;}};nexacro.System._setAccessibilityStatus=function(_a){if(_a.accessibilitystatus==1){nexacro.System._accessibilitystatus=true;}else{nexacro.System._accessibilitystatus=false;}};nexacro.System.getAccessibilityStatus=function(){if(nexacro.Device.curDevice==0){nexacro.System._accessibilitystatus=nexacro._getAccessibilityStatus();}return nexacro.System._accessibilitystatus;};nexacro.Application.enableAutoUpdate=function(){this._id=nexacro.Device.makeID();nexacro.Device._userCreatedObj[this._id]=this;var _a='{"id":'+this._id+', "div":"Update", "method":"enableAutoUpdate"}';nexacro.Device.exec(_a);};nexacro.System.play=function(_a){var _b=nexacro.Device.paramck_play(_a);if(_b==true){if(nexacro.Device.curDevice==0){var _c="";var _d="";var _e=_a.substring(0,9);if(_e.toLowerCase()=="%userapp%"){_c=1;_d=_a.substring(9,_a.length);}else if(_e.toLowerCase()=="%sd_card%"){_c=2;_d=_a.substring(9,_a.length);}else if(_e.substring(0,7)=="http://"){_d=_a;}else{var _f=application._getFileCache(_a);if(null!=_f){_c=3;_d=_f;}else{return false;}}var _g='{"filePath":"'+_d+'", "EnvironmentPath":"'+_c+'"}';}else{var _h="";var _e=_a.substring(0,9);if(_e.toLowerCase()=="%userapp%"){_h="_userapp_"+_a.substring(9,_a.length);}else if(_e.substring(0,7)=="http://"){_h=_a;}else{var _f=application._getFileCache(_a);if(null!=_f){_h="_userapp_"+_f;}else{return false;}}var _g='{"filePath":"'+_h+'"}';}var _i='{"id":'+this._id+', "div":"Sound", "method":"shotplay", "params":'+_g+'}';nexacro.Device.exec(_i);return true;}else{return false;}};nexacro.System.stop=function(){var _a='""';var _b='{"id":'+this._id+', "div":"Sound", "method":"shotstop", "params":'+_a+'}';nexacro.Device.exec(_b);return true;};nexacro.System.getSystemInfo=function(){this._id=nexacro.Device.makeID();nexacro.Device._userCreatedObj[this._id]=this;nexacro.Device.exec('{"id":'+this._id+', "div":"PhoneInfo","method":"getAll"}');};nexacro.System.recvPhoneInfo=function(_a){nexacro.System.osversion=_a.osversion;nexacro.System.mobilephonenumber=_a.mobilephonenumber;nexacro.System.mobileproducttype=_a.mobileproducttype;nexacro.System.mobileuniqueid=_a.mobileuniqueid;nexacro.System.mobileorientation=_a.mobileorientation;this.userapppath=_a.userapppath;this.sdcardpath="";if(nexacro.Device.curDevice==1){nexacro.Device.isphone=_a.isIPhone;nexacro.System.computername=_a.computername;nexacro.System.cpuarchitecture=_a.cpuarchitecture;nexacro.System.cputype=_a.cputype;nexacro.System.cpucount=_a.cpucount;nexacro.Device.libraryversion[0]=_a.libraryversion;if(_a.accessibility==1){nexacro.System._accessibilitystatus=true;}else{nexacro.System._accessibilitystatus=false;}}oninitend();};nexacro.System.setOrientation=function(_a){this.mobileorientation=_a;if(nexacro.Device.curDevice==1){nexacro.System.mobileorientation=_a;}};}nexacro._initDeviceAPI=function(){nexacro.Device=new nexacro.DeviceI();if(nexacro.Device.isHybrid()){if(window.system){if(nexacro.Device.curDevice==1){nexacro.System.prototype();nexacro.System.getSystemInfo();}}}};