function Q(n){return document.getElementById(n)}function QS(n){try{return Q(n).style}catch(n){}}function QE(n,t){try{Q(n).disabled=!t}catch(n){}}function QV(n,t){try{QS(n).display=t?"":"none"}catch(n){}}function QA(n,t){Q(n).innerHTML+=t}function QH(n,t){Q(n).innerHTML=t}function QC(n){try{return Q(n).classList}catch(n){}}function inputBoxFocus(n){Q(n).focus();var t=Q(n).value;Q(n).value="",Q(n).value=t}function ReadShort(n,t){return(n.charCodeAt(t)<<8)+n.charCodeAt(t+1)}function ReadShortX(n,t){return(n.charCodeAt(t+1)<<8)+n.charCodeAt(t)}function ReadInt(n,t){return 16777216*n.charCodeAt(t)+(n.charCodeAt(t+1)<<16)+(n.charCodeAt(t+2)<<8)+n.charCodeAt(t+3)}function ReadSInt(n,t){return(n.charCodeAt(t)<<24)+(n.charCodeAt(t+1)<<16)+(n.charCodeAt(t+2)<<8)+n.charCodeAt(t+3)}function ReadIntX(n,t){return 16777216*n.charCodeAt(t+3)+(n.charCodeAt(t+2)<<16)+(n.charCodeAt(t+1)<<8)+n.charCodeAt(t)}function ShortToStr(n){return String.fromCharCode(n>>8&255,255&n)}function ShortToStrX(n){return String.fromCharCode(255&n,n>>8&255)}function IntToStr(n){return String.fromCharCode(n>>24&255,n>>16&255,n>>8&255,255&n)}function IntToStrX(n){return String.fromCharCode(255&n,n>>8&255,n>>16&255,n>>24&255)}function MakeToArray(n){return n&&null!=n&&"object"!=typeof n?[n]:n}function SplitArray(n){return n.split(",")}function Clone(n){return JSON.parse(JSON.stringify(n))}function EscapeHtml(n){return"string"==typeof n?n.replace(/&/g,"&").replace(/>/g,">").replace(//g,">").replace(/").replace(/\n/g,"").replace(/\t/g," "):"boolean"==typeof n?n:"number"==typeof n?n:void 0}function ArrayElementMove(n,t,r){n.splice(r,0,n.splice(t,1)[0])}function ObjectToStringEx(n,t){var r="";if(0!=n&&(!n||null==n))return"(Null)";if(n instanceof Array)for(var e in n)r+="
"+gap(t)+"Item #"+e+": "+ObjectToStringEx(n[e],t+1);else if(n instanceof Object)for(var e in n)r+="
"+gap(t)+e+" = "+ObjectToStringEx(n[e],t+1);else r+=EscapeHtml(n);return r}function ObjectToStringEx2(n,t){var r="";if(0!=n&&(!n||null==n))return"(Null)";if(n instanceof Array)for(var e in n)r+="\r\n"+gap2(t)+"Item #"+e+": "+ObjectToStringEx2(n[e],t+1);else if(n instanceof Object)for(var e in n)r+="\r\n"+gap2(t)+e+" = "+ObjectToStringEx2(n[e],t+1);else r+=EscapeHtml(n);return r}function gap(n){for(var t="",r=0;r<4*n;r++)t+=" ";return t}function gap2(n){for(var t="",r=0;r<4*n;r++)t+=" ";return t}function ObjectToString(n){return ObjectToStringEx(n,0)}function ObjectToString2(n){return ObjectToStringEx2(n,0)}function hex2rstr(n){if("string"!=typeof n||0==n.length)return"";for(var t,r="",e=(""+n).match(/../g);t=e.shift();)r+=String.fromCharCode("0x"+t);return r}function char2hex(n){return(n+256).toString(16).substr(-2).toUpperCase()}function rstr2hex(n){var t,r="";for(t=0;t")&&-1==n.indexOf("&")&&-1==n.indexOf('"')&&-1==n.indexOf("'")&&-1==n.indexOf("+")&&-1==n.indexOf("(")&&-1==n.indexOf(")")&&-1==n.indexOf("#")&&-1==n.indexOf("%")&&-1==n.indexOf(":")}function isSafeString2(n){return"string"==typeof n&&-1==n.indexOf("<")&&-1==n.indexOf(">")&&-1==n.indexOf("&")&&-1==n.indexOf('"')&&-1==n.indexOf("'")&&-1==n.indexOf("+")&&-1==n.indexOf("(")&&-1==n.indexOf(")")&&-1==n.indexOf("#")&&-1==n.indexOf("%")}function parseUriArgs(){var n=window.document.location.href;n.endsWith("#")&&(n=n.substring(0,n.length-1));var t,r={},e=n.split(/[\?&|]/);for(var o in e.splice(0,1),e){var i=e[o],a=i.indexOf("=");if(r[t=i.substring(0,a)]=i.substring(a+1),isSafeString(r[t])){var c=parseInt(r[t]);c==r[t]&&(r[t]=c)}else delete r[t]}return r}String.prototype.startsWith||(String.prototype.startsWith=function(n){return 0===this.lastIndexOf(n,0)}),String.prototype.endsWith||(String.prototype.endsWith=function(n){return-1!==this.indexOf(n,this.length-n.length)})