var ByteArray=function(){var a=this,c=[],e=0,m=0;this.__defineGetter__("bytesAvailable",function(){return e-m});this.clear=function(){c=[];m=e=0};this.__defineGetter__("length",function(){return e});this.__defineSetter__("length",function(d){if(d<=0)a.clear();else{if(d<e)c.splice(d,e-d);else if(d>e){var b;for(b=e+1;b<=d;b++)c.push(0)}e=d}});this.__defineGetter__("position",function(){return m});this.__defineSetter__("position",function(a){a<=0?a=0:a>=e&&(a=e);m=a});this.readBytes=function(a,b,j){if(m+
j>e)throw"There is not sufficient data available to read.";a.position=b;for(b=0;b<j;b++)a.writeByte(c[m++]&255)};this.readString=function(){var d=[],b;for(b=m;b<e;b++)d.push(String.fromCharCode(c[b]));a.clear();return d.join("")};this.readUnsignedByte=function(){if(m>=e)throw"There is not sufficient data available to read.";return c[m++]&255};this.toString=function(){var a=[],b;for(b=0;b<e;b++)a.push(String.fromCharCode(c[b]));return a.join("")};this.writeByte=function(a){c[m++]=a&255;m>e&&e++};this.writeBytes=
function(a,b,e){typeof b==="undefined"&&(b=0);typeof e==="undefined"&&(e=0);b<0&&(b=0);if(!(e<0)){if(e===0)e=a.length;b>=a.length&&(b=0);if(e>a.length)e=a.length;b+e>a.length&&(e=a.length-b);a.position=b;for(b=0;b<e;b++)c.writeByte(a.readUnsignedByte())}};this.writeString=function(c){var b,e=c.length;for(b=0;b<e;b++)a.writeByte(c.charCodeAt(b))}},FileReference=function(a,c){this.data=new ByteArray;this.name=a;this.size=c},Keyboard=0,TKeyboard=function(){this.BACKSPACE=8;this.DELETE=46;this.DOWN=40;
this.END=35;this.ESCAPE=27;this.ENTER=13;this.F1=112;this.F2=113;this.F3=114;this.F4=115;this.F5=116;this.F6=117;this.F7=118;this.F8=119;this.F9=120;this.F10=121;this.F11=122;this.F12=123;this.HOME=36;this.INSERT=45;this.LEFT=37;this.PAGE_DOWN=34;this.PAGE_UP=33;this.RIGHT=39;this.SPACE=32;this.TAB=9;this.UP=38},Keyboard=new TKeyboard,Point=function(a,c){this.x=a;this.y=c};
function Base64Decode(a){for(var c="",e,m,d,b,j,k=0,a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");k<a.length;)e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(k++)),m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(k++)),b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(k++)),j="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(k++)),e=e<<2|m>>4,m=(m&15)<<4|b>>
2,d=(b&3)<<6|j,c+=String.fromCharCode(e),b!==64&&(c+=String.fromCharCode(m)),j!==64&&(c+=String.fromCharCode(d));return c}
var ConnectAns=Base64Decode("G1swbRtbMkobWzA7MEgbWzE7NDQ7MzRt2sTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTEG1swOzQ0OzMwbb8bWzBtDQobWzE7NDQ7MzRtsyAgG1szN21XZWxjb21lISAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAbWzA7NDQ7MzBtsxtbMG0NChtbMTs0NDszNG3AG1swOzQ0OzMwbcTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTE2RtbMG0NCg0KG1sxbSAbWzBtIBtbMTs0NDszNG3axMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMQbWzA7NDQ7MzBtvxtbMG0NCiAgG1sxOzQ0OzM0bbMbWzA7MzRt29vb2xtbMzBt29vb29vb29vb29vb29vb29vb29vb2xtbMzRt29vb29vbG1s0NDszMG2zG1swbQ0KICAbWzE7NDQ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b29vb29vb29vbG1szNG3b2xtbNDQ7MzBtsxtbNDA7MzdtDQogIBtbMTs0NDszNG2zG1s0MDszMG3b2xtbMG3b29vb29vb29vb29vb29vb29vb29vb29vb29vbG1szMG3b2xtbNDRtsxtbNDA7MzdtIBtbMzRtIBtbMTs0NzszN23axMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMQbWzMwbb8bWzBtDQogIBtbMTs0NDszNG2zG1swOzMwbdvbG1sxbdvb29vb29vb29vb29vb29sbWzA7MzBt29vb29vb29vb2xtbMW3b2xtbMDszMG3b2xtbNDRtsxtbNDA7MzdtIBtbMzRtIBtbMTs0NzszN22zICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAbWzMwbbMbWzBtDQogIBtbMTs0NDszNG2zG1s0MDszMG3b2xtbMG3b29vb29vb29vb29vb29vb29vb29vb29vb29vbG1szMG3b2xtbNDRtsxtbMG0gG1szNG0gG1sxOzQ3OzM3bbMgICAbWzM0bUh0bWxUZXJtIC0tIFRlbG5ldCogZm9yIHRoZSBXZWIgICAgG1szMG2zG1swbQ0KG1sxbSAbWzBtIBtbMTs0NDszNG2zG1swOzMwbdvbG1sxbdvb29vb29vb29vb29vb29vb29vb29vb2xtbMDszMG3b29vb29sbWzQ0bbMbWzBtIBtbMzRtIBtbMTs0NzszN22zICAgICAbWzA7NDc7MzRtV2ViIGJhc2VkIEJCUyB0ZXJtaW5hbCBjbGllbnQgICAgG1sxOzMwbbMbWzBtDQogIBtbMTs0NDszNG2zG1swOzM0bdvbG1szMG3b29vb29vb29vb29vb29vb29vb29vb29vb29vbG1szNG3b2xtbNDQ7MzBtsxtbMG0gG1szNG0gG1sxOzQ3OzM3bbMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIBtbMzBtsxtbMG0NCiAgG1sxOzQ0OzM0bcAbWzA7NDQ7MzBtxMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTZG1swbSAbWzM0bSAbWzE7NDc7MzdtwBtbMzBtxMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTZG1swbQ0KDQobWzExQxtbMTszMm1Db3B5cmlnaHQgKEMpIDIwMDAtMjAxMCBSJk0gU29mdHdhcmUuICBBbGwgUmlnaHRzIFJlc2VydmVkDQobWzE7MzBtICogTk9URTogSHRtbFRlcm0gaXMgYWN0dWFsbHkgYSBXZWJTb2NrZXQgY2xpZW50LCBub3QgYSBUZWxuZXQgY2xpZW50DQobWzA7MzRtxMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExA=="),DEBUG=
!1,PNGAsset="data:image/png;base64,";
try{!Object.prototype.__defineGetter__&&Object.defineProperty({},"x",{get:function(){return!0}}).x&&(Object.defineProperty(Object.prototype,"__defineGetter__",{enumerable:!1,configurable:!0,value:function(a,c){Object.defineProperty(this,a,{get:c,enumerable:!0,configurable:!0})}}),Object.defineProperty(Object.prototype,"__defineSetter__",{enumerable:!1,configurable:!0,value:function(a,c){Object.defineProperty(this,a,{set:c,enumerable:!0,configurable:!0})}}))}catch(defPropException){if(!Object.prototype.__defineGetter__)Object.prototype.__defineGetter__=function(){},
Object.prototype.__defineSetter__=function(){}}!Object.prototype.addEventListener&&Object.attachEvent&&(Object.defineProperty(Object.prototype,"addEventListener",{enumerable:!1,configurable:!0,value:function(a,c){Object.attachEvent("on"+a,c)}}),Object.defineProperty(Object.prototype,"removeEventListener",{enumerable:!1,configurable:!0,value:function(a,c){Object.detachEvent("on"+a,c)}}));
function getElementPosition(a){for(var a=typeof a==="string"?document.getElementById(a):a,c=0,e=0;a;)c+=a.offsetLeft,e+=a.offsetTop,a=a.offsetParent;navigator.userAgent.indexOf("Mac")!==-1&&typeof document.body.leftMargin!=="undefined"&&(c+=document.body.leftMargin,e+=document.body.topMargin);return new Point(c,e)}function trace(a){setTimeout(function(){throw Error("trace: "+a);},0)}
var StringUtils=0,TStringUtils=function(){var a=this;this.AddCommas=function(a){var e="",m=1,d;for(d=a.toString().length-1;d>=0;d--)m>3&&m%3===1&&(e=","+e),e=a.toString().charAt(d)+e,m++;return e};this.FormatPercent=function(a,e){a*=100;return e===0?Math.round(a)+"%":Math.round(a)+"."+Math.round(a*Math.pow(10,e)).toString().substr(-e)+"%"};this.NewString=function(a,e){if(a.length===0)return"";var m="",d;for(d=0;d<e;d++)m+=a.charAt(0);return m};this.PadLeft=function(a,e,m){if(e.length===0)return a;
for(;a.length<m;)a=e.charAt(0)+a;return a.substring(0,m)};this.PadRight=function(a,e,m){if(e.length===0)return a;for(;a.length<m;)a+=e.charAt(0);return a.substring(0,m)};this.Trim=function(c){return a.TrimLeft(a.TrimRight(c))};this.TrimLeft=function(a){return a.replace(/^\s+/g,"")};this.TrimRight=function(a){return a.replace(/\s+$/g,"")}},StringUtils=new TStringUtils,TConnectButton=function(){this.ongraphicchanged=function(){};var a=this,c=PNGAsset+"[encoded data, 5064 characters]",
e=PNGAsset+"[encoded data, 5192 characters]",
m=PNGAsset+"[encoded data, 5076 characters]",
d=1,b=0,j=1,k=1,n=function(){},g=function(){},o=function(){},i=function(){},f=function(){},h=function(){},q=function(){};this.Center=function(a){if(b.style.display!=="none"){var c=getElementPosition(a);b.style.left="0px";b.style.top="0px";var e=getElementPosition(b);b.style.left=(a.width-b.width)/2+(c.x-e.x)+"px";b.style.top=(a.height-b.height)/2+(c.y-e.y)+"px"}};this.Hide=function(){b.style.display="none"};this.__defineGetter__("Image",function(){return b});n=function(){b.onerror=g;b.src=d?c:"img/ConnectDown.png";
a.ongraphicchanged()};g=function(){d=!0;b.onerror="";b.src=c;a.ongraphicchanged()};o=function(){a.ongraphicchanged()};i=function(){b.onerror=f;b.src=j?e:"img/ConnectOver.png";a.ongraphicchanged()};f=function(){j=!0;b.onerror="";b.src=e;a.ongraphicchanged()};h=function(){b.onerror=q;b.src=k?m:"img/ConnectUp.png";a.ongraphicchanged()};q=function(){k=!0;b.onerror="";b.src=m;a.ongraphicchanged()};this.Show=function(){b.style.display=""};b=document.createElement("img");b.onerror=q;b.onload=o;b.onmouseover=
i;b.onmouseout=h;b.onmousedown=n;b.onmouseup=h;b.src=m;b.style.cursor="pointer";b.style.position="absolute";b.style.left="0px";b.style.top="0px";a.Hide()},TSaveFilesButton=function(){this.ongraphicchanged=function(){};var a=this,c=PNGAsset+"[encoded data, 10600 characters]",
e=PNGAsset+"[encoded data, 10148 characters]",
m=PNGAsset+"[encoded data, 10604 characters]",
d=1,b=0,j=1,k=1,n=function(){},g=function(){},o=function(){},i=function(){},f=function(){},h=function(){},q=function(){};this.Center=function(a){if(b.style.display!=="none"){var c=getElementPosition(a);b.style.left="0px";b.style.top="0px";var e=getElementPosition(b);b.style.left=(a.width-b.width)/2+(c.x-e.x)+"px";b.style.top=(a.height-b.height)/2+(c.y-e.y)+"px"}};this.Hide=function(){b.style.display="none"};this.__defineGetter__("Image",function(){return b});n=function(){b.onerror=g;b.src=d?c:"img/SaveFilesDown.png";
a.ongraphicchanged()};g=function(){d=!0;b.onerror="";b.src=c;a.ongraphicchanged()};o=function(){a.ongraphicchanged()};i=function(){b.onerror=f;b.src=j?e:"img/SaveFilesOver.png";a.ongraphicchanged()};f=function(){j=!0;b.onerror="";b.src=e;a.ongraphicchanged()};h=function(){b.onerror=q;b.src=k?m:"img/SaveFilesUp.png";a.ongraphicchanged()};q=function(){k=!0;b.onerror="";b.src=m;a.ongraphicchanged()};this.Show=function(){b.style.display=""};b=document.createElement("img");b.onerror=q;b.onload=o;b.onmouseover=
i;b.onmouseout=h;b.onmousedown=n;b.onmouseup=h;b.src=m;b.style.cursor="pointer";b.style.position="absolute";b.style.left="0px";b.style.top="0px";a.Hide()},BlinkState=0,TBlinkState=function(){this.Show=0;this.Hide=1},BlinkState=new TBlinkState,TCursor=function(a,c,e){this.onhide=function(){};this.onshow=function(){};var m=this,d,b=0,j,k=0,n,g,o,i,f,h,q=function(){},r=function(){},s=function(){};this.__defineSetter__("BlinkRate",function(a){o.delay=a});this.__defineSetter__("Colour",function(a){j=a;
q()});q=function(){if(k)b.width=g.x,b.height=g.y,k.fillStyle=j,k.fillRect(0,g.y-g.y*0.2,g.x,g.y*0.2)};r=function(){d=d===BlinkState.Hide?BlinkState.Show:BlinkState.Hide;b.style.opacity=i?d===BlinkState.Hide?0:1:0;switch(d){case BlinkState.Hide:m.onhide();break;case BlinkState.Show:m.onshow()}};this.__defineGetter__("Position",function(){return n});this.__defineSetter__("Position",function(a){n=a;s()});this.__defineSetter__("Size",function(a){g=a;q();s()});s=function(){if(b&&i)b.style.left=(n.x-1)*
g.x+h.x+"px",b.style.top=(n.y-1)*g.y+h.y+"px"};this.__defineSetter__("Visible",function(a){(i=a)&&s()});this.__defineSetter__("WindowOffset",function(a){if(a.x!==f.x||a.y!==f.y){f=a;b.style.left="0px";b.style.top="0px";var c=getElementPosition(b);h.x=a.x-c.x;h.y=a.y-c.y;s()}});d=BlinkState.Hide;j=c;n=new Point(1,1);g=e;i=!0;f=new Point(0,0);h=new Point(0,0);b=document.createElement("canvas");if(b.getContext)b.style.position="absolute",k=b.getContext("2d"),a.appendChild(b),s(),q(),o=setInterval(r,
500)},CrtFonts=[];CrtFonts["437x9x16"]=PNGAsset+"iVBORw0KGgoAAAANSUhEUgAABIAAAAAQCAMAAABZX/Q4AAAAAXNSR0IArs4c6QAAAwBQTFRFAAAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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){this.onchange=function(){};this.HTML_COLOURS=["#000000","#0000A8","#00A800","#00A8A8","#A80000","#A800A8","#A85400","#A8A8A8","#545454","#5454FC","#54FC54","#54FCFC","#FC5454","#FC54FC","#FCFC54","#FCFCFC"];var a=this,c=0,e=[],m=0,d=0,b=0,j=0,k=0,n=0,g=0,o=0,i=function(){},f=function(){};this.__defineGetter__("CodePage",function(){return m});this.GetChar=function(c,f){if(b>0)return 0;if(c<0||c>255||f<0||f>255)return 0;if(!e[c][f]&&(e[c][f]=d.getImageData(c*g.x,0,g.x,g.y),f!==
15)){var k=a.HTML_COLOURS[(f&240)>>4],h=a.HTML_COLOURS[f&15],m=parseInt(k[1].toString()+k[2].toString(),16),i=parseInt(k[3].toString()+k[4].toString(),16),k=parseInt(k[5].toString()+k[6].toString(),16),j=parseInt(h[1].toString()+h[2].toString(),16),o=parseInt(h[3].toString()+h[4].toString(),16),h=parseInt(h[5].toString()+h[6].toString(),16),n=0,p=0,l=0,t;for(t=0;t<e[c][f].data.length;t+=4)e[c][f].data[t]?(n=j,p=o,l=h):(n=m,p=i,l=k),e[c][f].data[t]=n,e[c][f].data[t+1]=p,e[c][f].data[t+2]=l,e[c][f].data[t+
3]=255}return e[c][f]};this.__defineGetter__("Height",function(){return g.y});this.Load=function(c,e,g){CrtFonts[c+"x"+e+"x"+g]!==void 0?(a.HTML_COLOURS[7]="#A8A8A8",a.HTML_COLOURS[0]="#000000",b+=1,k=c,n=new Point(e,g),isNaN(parseInt(c,10))?(c.indexOf("ATASCII")===0&&(a.HTML_COLOURS[7]="#63B6E7",a.HTML_COLOURS[0]="#005184"),j=new Image,j.onload=f,j.src=CrtFonts[k+"x"+n.x+"x"+n.y],o=0):(j=new Image,j.onload=i,j.src=CrtFonts["ASCIIx"+e+"x"+g])):trace("HtmlTerm Error: Font CP="+c+", Width="+e+", Height="+
g+" does not exist")};i=function(){o=new Image;o.onload=f;o.src=CrtFonts[k+"x"+n.x+"x"+n.y]};f=function(){m=k;g=n;c.width=o?j.width*2:j.width;c.height=j.height;d.drawImage(j,0,0);o&&d.drawImage(o,j.width,0);var f;for(f=0;f<256;f++)e[f]=[];b-=1;a.onchange()};this.__defineGetter__("Size",function(){return g});this.__defineGetter__("Width",function(){return g.x});var m=437,g=new Point(9,16),h,c=document.createElement("canvas");if(c.getContext){d=c.getContext("2d");for(h=0;h<256;h++)e[h]=[];this.Load(m,
g.x,g.y)}},KeyPressEvent=function(a,c){this.altKey=a.altKey;this.charCode=a.charCode;this.ctrlKey=a.ctrlKey;this.keyCode=a.keyCode;this.keyString=c;this.shiftKey=a.shiftKey},Crt=function(){},TCrt=function(){this.BLACK=0;this.BLUE=1;this.GREEN=2;this.CYAN=3;this.RED=4;this.MAGENTA=5;this.BROWN=6;this.LIGHTGRAY=7;this.DARKGRAY=8;this.LIGHTBLUE=9;this.LIGHTGREEN=10;this.LIGHTCYAN=11;this.LIGHTRED=12;this.LIGHTMAGENTA=13;this.YELLOW=14;this.WHITE=15;this.BLINK=128;var a=this,c=!1,e,m,d,b,j,k,n,g,o,i,
f,h,q,r,s=navigator.userAgent.toLowerCase().indexOf("chrome/7.0.517")!==-1,y=function(){},z=function(){},w=function(){},x=function(){},u=function(){},v=function(){};Array.prototype.InitTwoDimensions=function(a,l){var b;for(b=0;b<=a;b++)this[b]=[l+1]};this.Init=function(b){e=!1;m=!0;d=!1;g=new TFont;g.onchange=x;o=[];i=0;f=new Point(80,25);h=7;j=document.createElement("canvas");j.innerHTML='Your browser doesn\'t support the HTML5 Canvas element!<br>The latest version of every major web browser supports this element, so please consider upgrading now:<ul><li><a href="http://www.mozilla.com/firefox/">Mozilla Firefox</a></li><li><a href="http://www.google.com/chrome">Google Chrome</a></li><li><a href="http://www.apple.com/safari/">Apple Safari</a></li><li><a href="http://www.opera.com/">Opera</a></li><li><a href="http://windows.microsoft.com/en-US/internet-explorer/products/ie/home">MS Internet Explorer</a></li></ul>';
j.width=g.Width*f.x;j.height=g.Height*f.y;b.appendChild(j);if(!j.getContext)return trace("HtmlTerm Error: Canvas not supported"),!1;window.addEventListener("keydown",u,!1);window.addEventListener("keypress",v,!1);y();n=new TCursor(b,g.HTML_COLOURS[a.LIGHTGRAY],g.Size);n.onhide=z;n.onshow=w;q=0;r=f.x-1|f.y-1<<8;k=j.getContext("2d");k.font="12pt monospace";k.textBaseline="top";a.ClrScr();return!0};this.__defineGetter__("Atari",function(){return c});this.__defineSetter__("Atari",function(a){c=a});this.Beep=
function(){};this.__defineGetter__("bitmapData",function(){return(void 0).bitmapData});this.__defineGetter__("Blink",function(){return m});this.__defineSetter__("Blink",function(a){m=a});this.__defineGetter__("Canvas",function(){return j});this.ClrBol=function(){a.FastWrite(StringUtils.NewString(" ",a.WhereX()),a.WindMinX+1,a.WhereYA(),h)};this.ClrBos=function(){a.ScrollUpWindow(a.WhereY());a.ScrollDownWindow(a.WhereY())};this.ClrEol=function(){a.FastWrite(StringUtils.NewString(" ",a.WindMaxX-a.WhereX()+
1),a.WhereXA(),a.WhereYA(),h)};this.ClrEos=function(){a.ScrollDownWindow(a.WindRows-a.WhereY()+1);a.ScrollUpWindow(a.WindRows-a.WhereY()+1)};this.ClrLine=function(){a.FastWrite(StringUtils.NewString(" ",a.WindCols),a.WindMinX+1,a.WhereYA(),h)};this.ClrScr=function(){a.ScrollUpWindow(a.WindRows);a.GotoXY(1,1)};this.Conceal=function(){var b=0,b=m?(h&112)>>4:(h&240)>>4;a.TextColor(b)};this.__defineGetter__("Cursor",function(){return n});this.DelChar=function(p){p===void 0&&(p=1);var l;for(l=a.WhereXA();l<=
a.WindMinX+a.WindCols-p;l++)a.FastWrite(String.fromCharCode(b[l+p][a.WhereYA()].x),l,a.WhereYA(),b[l+p][a.WhereYA()].y);for(l=a.WindMinX+a.WindCols+1-p;l<=a.WindMinX+a.WindCols;l++)a.FastWrite(" ",l,a.WhereYA(),h)};this.DelLine=function(b){b===void 0&&(b=1);a.ScrollUpCustom(a.WindMinX+1,a.WhereYA(),a.WindMaxX+1,a.WindMaxY+1,b,h)};this.FastWrite=function(a,l,c,e,d){d===void 0&&(d=!0);if(l<=f.x&&c<=f.y){var h=m?e&127:e,i;for(i=0;i<a.length;i++){var j=g.GetChar(a.charCodeAt(i),h);j&&k.putImageData(j,
(l-1+i)*g.Width,(c-1)*g.Height);if(d)b[l+i][c].x=a.charCodeAt(i),b[l+i][c].y=e;if(l+i>=f.x)break}}};this.GotoXY=function(b,l){if(b>0&&l>0&&b-1+a.WindMinX<=a.WindMaxX&&l-1+a.WindMinY<=a.WindMaxY)n.Position=new Point(b,l)};this.HideCursor=function(){n.Visible=!1};this.HighVideo=function(){h|=8};y=function(){b=[];b.InitTwoDimensions(f.x,f.y);var a,l;for(l=1;l<=f.y;l++)for(a=1;a<=f.x;a++)b[a][l]=new Point(32,7)};this.InsChar=function(p){p===void 0&&(p=1);var l;for(l=a.WindMinX+a.WindCols;l>=a.WhereXA()+
p;l--)a.FastWrite(String.fromCharCode(b[l-p][a.WhereYA()].x),l,a.WhereYA(),b[l-p][a.WhereYA()].y);for(l=a.WhereXA();l<a.WhereXA()+p;l++)a.FastWrite(" ",l,a.WhereYA(),h)};this.InsLine=function(b){b===void 0&&(b=1);a.ScrollDownCustom(a.WindMinX+1,a.WhereYA(),a.WindMaxX+1,a.WindMaxY+1,b,h)};this.KeyPressed=function(){return o.length>0};this.LowVideo=function(){h&=247};this.NormVideo=function(){h=a.LIGHTGRAY};z=function(){if(m){d=!0;var p,l;for(l=1;l<=f.y;l++)for(p=1;p<=f.x;p++)(b[p][l].y&a.BLINK)===
a.BLINK&&b[p][l].x!==32&&a.FastWrite(" ",p,l,b[p][l].y,!1)}if(s)Crt.Canvas.style.opacity=0.999};w=function(){if(m||d){d=!1;var p,l;for(l=1;l<=f.y;l++)for(p=1;p<=f.x;p++)(b[p][l].y&a.BLINK)===a.BLINK&&b[p][l].x!==32&&a.FastWrite(String.fromCharCode(b[p][l].x),p,l,b[p][l].y,!1)}n.WindowOffset=getElementPosition(j);if(s)Crt.Canvas.style.opacity=1};x=function(){n.Size=g.Size;j.height=g.Height*f.y;j.width=g.Width*f.x;var p,l;if(b!==null)for(l=1;l<=f.y;l++)for(p=1;p<=f.x;p++)a.FastWrite(String.fromCharCode(b[p][l].x),
p,l,b[p][l].y,!1)};u=function(a){var b="";if(a.ctrlKey)if(a.keyCode>=65&&a.keyCode<=90)if(c)switch(a.keyCode){case 72:b=String.fromCharCode(126);break;case 74:b=String.fromCharCode(13);break;case 77:b=String.fromCharCode(155);break;default:b=String.fromCharCode(a.keyCode-64)}else b=String.fromCharCode(a.keyCode-64);else{if(a.keyCode>=97&&a.keyCode<=122)if(c)switch(a.keyCode){case 104:b=String.fromCharCode(126);break;case 106:b=String.fromCharCode(13);break;case 109:b=String.fromCharCode(155);break;
default:b=String.fromCharCode(a.keyCode-96)}else b=String.fromCharCode(a.keyCode-96)}else switch(a.keyCode){case Keyboard.BACKSPACE:b=c?String.fromCharCode(126):String.fromCharCode(a.keyCode);break;case Keyboard.DELETE:b="\u007f";break;case Keyboard.DOWN:b="\u001b[B";break;case Keyboard.END:b="\u001b[K";break;case Keyboard.ENTER:b=c?"\u009b":"\r\n";break;case Keyboard.ESCAPE:b="\u001b";break;case Keyboard.F1:b="\u001bOP";break;case Keyboard.F2:b="\u001bOQ";break;case Keyboard.F3:b="\u001bOR";break;
case Keyboard.F4:b="\u001bOS";break;case Keyboard.F5:b="\u001bOt";break;case Keyboard.F6:b="\u001b[17~";break;case Keyboard.F7:b="\u001b[18~";break;case Keyboard.F8:b="\u001b[19~";break;case Keyboard.F9:b="\u001b[20~";break;case Keyboard.F10:b="\u001b[21~";break;case Keyboard.F11:b="\u001b[23~";break;case Keyboard.F12:b="\u001b[24~";break;case Keyboard.HOME:b="\u001b[H";break;case Keyboard.INSERT:b="\u001b@";break;case Keyboard.LEFT:b="\u001b[D";break;case Keyboard.PAGE_DOWN:b="\u001b[U";break;case Keyboard.PAGE_UP:b=
"\u001b[V";break;case Keyboard.RIGHT:b="\u001b[C";break;case Keyboard.SPACE:b=" ";break;case Keyboard.TAB:b=c?"\u007f":String.fromCharCode(a.keyCode);break;case Keyboard.UP:b="\u001b[A"}o.push(new KeyPressEvent(a,b));(b||a.ctrlKey)&&a.preventDefault()};v=function(a){var b="";if(!a.ctrlKey){var c=a.charCode!==null?a.charCode:a.which;c>=33&&c<=126&&(b=String.fromCharCode(c));o.push(new KeyPressEvent(a,b))}};this.OnKeyFocusChange=function(a){a.preventDefault()};this.ReadKey=function(){return o.length===
0?null:o.shift()};this.ReDraw=function(){var c,l;for(l=1;l<=f.y;l++)for(c=1;c<=f.x;c++)a.FastWrite(String.fromCharCode(b[c][l].x),c,l,b[c][l].y,!1)};this.RestoreScreen=function(b,c,e,g,f){var d;for(d=e;d<=f;d++)for(e=c;e<=g;e++)a.FastWrite(String.fromCharCode(b[e][d].x),e,d,b[e][d].y)};this.ReverseVideo=function(){h=m?(h&112)>>4|(h&7)<<4:(h&240)>>4|(h&15)<<4};this.SaveScreen=function(a,c,e,g){var d=[];d.InitTwoDimensions(f.x,f.y);var k;for(k=c;k<=g;k++)for(c=a;c<=e;c++)d[c][k]=new Point(b[c][k].x,
b[c][k].y);return d};this.__defineGetter__("ScreenCols",function(){return f.x});this.__defineGetter__("ScreenRows",function(){return f.y});this.ScrollDownCustom=function(a,c,e,f,d,h){var i=f-c+1;d>i&&(d=i);var i=(a-1)*g.Width,j=(c-1)*g.Height,n=(e-a+1)*g.Width,o=(f-c+1-d)*g.Height;o>0&&(n=k.getImageData(i,j,n,o),i=(a-1)*g.Width,j=(c-1)*g.Height,k.putImageData(n,i,j));k.fillStyle=m?g.HTML_COLOURS[(h&112)>>4]:g.HTML_COLOURS[(h&240)>>4];i=(a-1)*g.Width;j=(c-1)*g.Height;n=(e-a+1)*g.Width;o=d*g.Height;
k.fillRect(i,j,n,o);j=i=0;for(j=f;j>d;j--)for(i=a;i<=e;i++)b[i][j].x=b[i][j-d].x,b[i][j].y=b[i][j-d].y;for(j=c;j<=d;j++)for(i=a;i<=e;i++)b[i][j].x=32,b[i][j].y=h};this.ScrollDownScreen=function(b){a.ScrollDownCustom(1,1,f.x,f.y,b,h)};this.ScrollDownWindow=function(b){a.ScrollDownCustom(a.WindMinX+1,a.WindMinY+1,a.WindMaxX+1,a.WindMaxY+1,b,h)};this.ScrollUpCustom=function(a,c,e,f,d,i){var h=f-c+1;d>h&&(d=h);var h=(a-1)*g.Width,j=(c-1+d)*g.Height,n=(e-a+1)*g.Width,o=(f-c+1-d)*g.Height;o>0&&(n=k.getImageData(h,
j,n,o),h=(a-1)*g.Width,j=(c-1)*g.Height,k.putImageData(n,h,j));k.fillStyle=m?g.HTML_COLOURS[(i&112)>>4]:g.HTML_COLOURS[(i&240)>>4];h=(a-1)*g.Width;j=(f-d)*g.Height;n=(e-a+1)*g.Width;o=d*g.Height;k.fillRect(h,j,n,o);j=h=0;for(j=c;j<=f-d;j++)for(h=a;h<=e;h++)b[h][j].x=b[h][j+d].x,b[h][j].y=b[h][j+d].y;for(j=f;j>f-d;j--)for(h=a;h<=e;h++)b[h][j].x=32,b[h][j].y=i};this.ScrollUpScreen=function(b){a.ScrollUpCustom(1,1,f.x,f.y,b,h)};this.ScrollUpWindow=function(b){a.ScrollUpCustom(a.WindMinX+1,a.WindMinY+
1,a.WindMaxX+1,a.WindMaxY+1,b,h)};this.SetBlinkRate=function(a){n.BlinkRate=a};this.SetFont=function(a,b,c){(a!==g.CodePage||b!==g.Size.x||c!==g.Size.y)&&g.Load(a,b,c)};this.SetScreenSize=function(c,e){if(!(c===f.x&&e===f.y)){var d=0,g=0,h;if(b!==null){h=[];h.InitTwoDimensions(f.x,f.y);for(g=1;g<=f.y;g++)for(d=1;d<=f.x;d++)h[d][g]=new Point(b[d][g].x,b[d][g].y)}var k=new Point(f.x,f.y);f.x=c;f.y=e;q=0;r=f.x-1|f.y-1<<8;b=[];b.InitTwoDimensions(f.x,f.y);for(g=1;g<=f.y;g++)for(d=1;d<=f.x;d++)b[d][g]=
new Point(32,7);if(h!==null)for(g=1;g<=Math.min(f.y,k.y);g++)for(d=1;d<=Math.min(f.x,k.x);d++)a.FastWrite(String.fromCharCode(h[d][g].x),d,g,h[d][g].y);d=document.createEvent("Events");d.initEvent(a.SCREEN_SIZE_CHANGED,!0,!1);j.dispatchEvent(d)}};this.ShowCursor=function(){n.Visible=!0};this.__defineGetter__("TextAttr",function(){return h});this.__defineSetter__("TextAttr",function(a){h=a});this.TextBackground=function(a){h=m?h&143|(a&7)<<4:h&15|(a&15)<<4};this.TextColor=function(a){h=h&240|a&15};
this.WhereX=function(){return n.Position.x};this.WhereXA=function(){return a.WhereX()+a.WindMinX};this.WhereY=function(){return n.Position.y};this.WhereYA=function(){return a.WhereY()+a.WindMinY};this.__defineGetter__("WindCols",function(){return a.WindMaxX-a.WindMinX+1});this.__defineGetter__("WindMax",function(){return r});this.__defineGetter__("WindMaxX",function(){return a.WindMax&255});this.__defineGetter__("WindMaxY",function(){return(a.WindMax&65280)>>8});this.__defineGetter__("WindMin",function(){return q});
this.__defineGetter__("WindMinX",function(){return a.WindMin&255});this.__defineGetter__("WindMinY",function(){return(a.WindMin&65280)>>8});this.Window=function(b,c,e,d){if(b>0&&c>0&&b<=e&&c<=d&&e<=f.x&&d<=f.y)q=b-1+(c-1<<8),r=e-1+(d-1<<8),n.WindowOffset=new Point(b-1,c-1),a.GotoXY(1,1)};this.__defineGetter__("WindRows",function(){return a.WindMaxY-a.WindMinY+1});this.Write=function(b){c?a.WriteATASCII(b):a.WriteASCII(b)};this.WriteASCII=function(b){b===void 0&&(b="");var c=a.WhereX(),e=a.WhereY(),
d="",g;for(g=0;g<b.length;g++){var f=!1;b.charCodeAt(g)===7?a.Beep():b.charCodeAt(g)===8?(a.FastWrite(d,a.WhereXA(),a.WhereYA(),h),c+=d.length,c>1&&(c-=1),f=!0,d=""):b.charCodeAt(g)===9?(a.FastWrite(d,a.WhereXA(),a.WhereYA(),h),c+=d.length,d="",c===a.WindCols?(c=1,e+=1):c+=8-c%8,f=!0):b.charCodeAt(g)===10?(a.FastWrite(d,a.WhereXA(),a.WhereYA(),h),c+=d.length,e+=1,f=!0,d=""):b.charCodeAt(g)===12?(a.ClrScr(),e=c=1,d=""):b.charCodeAt(g)===13?(a.FastWrite(d,a.WhereXA(),a.WhereYA(),h),c=1,f=!0,d=""):b.charCodeAt(g)!==
0&&(d+=String.fromCharCode(b.charCodeAt(g)&255),c+d.length>a.WindCols&&(a.FastWrite(d,a.WhereXA(),a.WhereYA(),h),d="",c=1,e+=1,f=!0));if(e>a.WindRows)e=a.WindRows,a.ScrollUpWindow(1),f=!0;f&&a.GotoXY(c,e)}d.length>0&&(a.FastWrite(d,a.WhereXA(),a.WhereYA(),h),c+=d.length,a.GotoXY(c,e))};this.WriteATASCII=function(b){b===void 0&&(b="");var c=a.WhereX(),d=a.WhereY(),g="",f;for(f=0;f<b.length;f++){var k=!1;b.charCodeAt(f)===27&&!e?e=!0:b.charCodeAt(f)===28&&!e?(a.FastWrite(g,a.WhereXA(),a.WhereYA(),h),
c+=g.length,d=d>1?d-1:a.WindRows,k=!0,g=""):b.charCodeAt(f)===29&&!e?(a.FastWrite(g,a.WhereXA(),a.WhereYA(),h),c+=g.length,d=d<a.WindRows?d+1:1,k=!0,g=""):b.charCodeAt(f)===30&&!e?(a.FastWrite(g,a.WhereXA(),a.WhereYA(),h),c+=g.length,c=c>1?c-1:a.WindCols,k=!0,g=""):b.charCodeAt(f)===31&&!e?(a.FastWrite(g,a.WhereXA(),a.WhereYA(),h),c+=g.length,c=c<a.WindCols?c+1:1,k=!0,g=""):b.charCodeAt(f)===125&&!e?(a.ClrScr(),d=c=1,g=""):b.charCodeAt(f)===126&&!e?(a.FastWrite(g,a.WhereXA(),a.WhereYA(),h),c+=g.length,
g="",k=!0,c>1&&(c-=1,a.FastWrite(" ",c,a.WhereYA(),h))):b.charCodeAt(f)===127&&!e?(a.FastWrite(g,a.WhereXA(),a.WhereYA(),h),c+=g.length,g="",c===a.WindCols?(c=1,d+=1):c+=8-c%8,k=!0):b.charCodeAt(f)===155&&!e?(a.FastWrite(g,a.WhereXA(),a.WhereYA(),h),c=1,d+=1,k=!0,g=""):b.charCodeAt(f)===156&&!e?(a.FastWrite(g,a.WhereXA(),a.WhereYA(),h),c=1,g="",a.GotoXY(c,d),a.DelLine()):b.charCodeAt(f)===157&&!e?(a.FastWrite(g,a.WhereXA(),a.WhereYA(),h),c=1,g="",a.GotoXY(c,d),a.InsLine()):b.charCodeAt(f)===253&&
!e?a.Beep():b.charCodeAt(f)===254&&!e?(a.FastWrite(g,a.WhereXA(),a.WhereYA(),h),c+=g.length,g="",a.GotoXY(c,d),a.DelChar()):b.charCodeAt(f)===255&&!e?(a.FastWrite(g,a.WhereXA(),a.WhereYA(),h),c+=g.length,g="",a.GotoXY(c,d),a.InsChar()):(g+=b.charCodeAt(f)===0&&i===13?"":String.fromCharCode(b.charCodeAt(f)&255),e=!1,i=b.charCodeAt(f),c+g.length>a.WindCols&&(a.FastWrite(g,a.WhereXA(),a.WhereYA(),h),g="",c=1,d+=1,k=!0));if(d>a.WindRows)d=a.WindRows,a.ScrollUpWindow(1),k=!0;k&&a.GotoXY(c,d)}g.length>
0&&(a.FastWrite(g,a.WhereXA(),a.WhereYA(),h),c+=g.length,a.GotoXY(c,d))};this.WriteLn=function(b){b===void 0&&(b="");a.Write(b+"\r\n")}},Crt=new TCrt,AnsiParserState=0,TAnsiParserState=function(){this.None=0;this.Escape=1;this.Bracket=2},AnsiParserState=new TAnsiParserState,ESCQEvent=function(a,c,e){this.CodePage=a;this.Width=c;this.Height=e},Ansi=0,TAnsi=function(){this.onesc5n=function(){};this.onesc6n=function(){};this.onesc255n=function(){};this.onescQ=function(){};var a=[0,4,2,6,1,5,3,7],c=this,
e,m,d,b,j;this.ClrBol=function(){return"\u001b[1K"};this.ClrBos=function(){return"\u001b[1J"};this.ClrEol=function(){return"\u001b[K"};this.ClrEos=function(){return"\u001b[J"};this.ClrLine=function(){return"\u001b[2K"};this.ClrScr=function(){return"\u001b[2J"};this.CursorDown=function(a){return a===1?"\u001b[B":"\u001b["+a.toString()+"B"};this.CursorLeft=function(a){return a===1?"\u001b[D":"\u001b["+a.toString()+"D"};this.CursorPosition=function(a,b){a===void 0&&(a=Crt.WhereYA());b===void 0&&(b=Crt.WhereXA());
return"\u001b["+a+";"+b+"R"};this.CursorRestore=function(){return"\u001b[u"};this.CursorRight=function(a){return a===1?"\u001b[C":"\u001b["+a.toString()+"C"};this.CursorSave=function(){return"\u001b[s"};this.CursorUp=function(a){return a===1?"\u001b[A":"\u001b["+a.toString()+"A"};this.GotoX=function(a){return a===1?c.CursorLeft(255):c.CursorLeft(255)+c.CursorRight(a-1)};this.GotoXY=function(a,b){return"\u001b["+b.toString()+";"+a.toString()+"H"};this.GotoY=function(a){return a===1?c.CursorUp(255):
c.CursorUp(255)+c.CursorDown(a-1)};this.TextAttr=function(a){return c.TextColor(a%16)+c.TextBackground(Math.floor(a/16))};this.TextBackground=function(b){for(;b>=8;)b-=8;return"\u001b["+(40+a[b]).toString()+"m"};this.TextColor=function(b){switch(b%16){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:return"\u001b[0;"+(30+a[b%16]).toString()+"m"+c.TextBackground(Crt.TextAttr/16);case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:return"\u001b[1;"+(30+a[b%16-8]).toString()+"m"}return""};
this.Write=function(k){if(Crt.Atari)Crt.Write(k);else{var n="",g;for(g=0;g<k.length;g++)if(k.charAt(g)==="\u001b")b=AnsiParserState.Escape;else if(b===AnsiParserState.Escape&&k.charAt(g)==="["){b=AnsiParserState.Bracket;for(m="0";d.length>0;)d.pop()}else if(b===AnsiParserState.Bracket)if("0123456789".indexOf(k.charAt(g))!==-1)m+=k.charAt(g);else if(k.charAt(g)===";")d.push(m),m="0";else{if("?=<> \r\n".indexOf(k.charAt(g))===-1){Crt.Write(n);n="";d.push(m);var o=k.charAt(g),i=0,f=i=0,h=0;switch(o){case "A":f=
Math.max(1,parseInt(d.shift(),10));f=Math.max(1,Crt.WhereY()-f);Crt.GotoXY(Crt.WhereX(),f);break;case "B":f=Math.max(1,parseInt(d.shift(),10));f=Math.min(Crt.WindRows,Crt.WhereY()+f);Crt.GotoXY(Crt.WhereX(),f);break;case "C":i=Math.max(1,parseInt(d.shift(),10));i=Math.min(Crt.WindCols,Crt.WhereX()+i);Crt.GotoXY(i,Crt.WhereY());break;case "D":i=Math.max(1,parseInt(d.shift(),10));i=Math.max(1,Crt.WhereX()-i);Crt.GotoXY(i,Crt.WhereY());break;case "E":f=Math.max(1,parseInt(d.shift(),10));f=Math.min(Crt.WindRows,
Crt.WhereY()+f);Crt.GotoXY(1,f);break;case "F":f=Math.max(1,parseInt(d.shift(),10));f=Math.max(1,Crt.WhereY()-f);Crt.GotoXY(1,f);break;case "f":for(;d.length<2;)d.push("1");f=Math.max(1,parseInt(d.shift(),10));i=Math.max(1,parseInt(d.shift(),10));Crt.GotoXY(i,f);break;case "G":i=Math.max(1,parseInt(d.shift(),10));i>=1&&i<=Crt.WindCols&&Crt.GotoXY(i,Crt.WhereY());break;case "H":for(;d.length<2;)d.push("1");f=Math.max(1,parseInt(d.shift(),10));i=Math.max(1,parseInt(d.shift(),10));Crt.GotoXY(i,f);break;
case "h":i=parseInt(d.shift(),10);switch(i){case 7:break;case 25:Crt.ShowCursor();break;default:trace("ANSI Escape "+i+"h is not implemented")}break;case "J":switch(parseInt(d.shift(),10)){case 0:Crt.ClrEos();break;case 1:Crt.ClrBos();break;case 2:Crt.ClrScr()}break;case "K":switch(parseInt(d.shift(),10)){case 0:Crt.ClrEol();break;case 1:Crt.ClrBol();break;case 2:Crt.ClrLine()}break;case "L":f=Math.max(1,parseInt(d.shift(),10));Crt.InsLine(f);break;case "l":i=parseInt(d.shift(),10);switch(i){case 7:break;
case 25:Crt.HideCursor();break;default:trace("ANSI Escape "+i+"l is not implemented")}break;case "M":f=Math.max(1,parseInt(d.shift(),10));Crt.DelLine(f);break;case "m":for(;d.length>0;)switch(i=parseInt(d.shift(),10),i){case 0:Crt.NormVideo();break;case 1:Crt.HighVideo();break;case 5:Crt.TextAttr|=Crt.BLINK;Crt.SetBlinkRate(500);break;case 6:Crt.TextAttr|=Crt.BLINK;Crt.SetBlinkRate(250);break;case 7:Crt.ReverseVideo();break;case 8:e=Crt.TextAttr;Crt.Conceal();break;case 22:Crt.LowVideo();break;case 25:Crt.TextAttr&=
~Crt.BLINK;break;case 27:Crt.ReverseVideo();break;case 28:Crt.TextAttr=e;break;case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:i=a[i-30];Crt.TextAttr%16>7&&(i+=8);Crt.TextColor(i);break;case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:i=a[i-40],Crt.TextBackground(i)}break;case "n":i=parseInt(d.shift(),10);switch(i){case 5:c.onesc5n();break;case 6:c.onesc6n();break;case 255:c.onesc255n();break;default:trace("ANSI Escape "+i+"n is not implemented")}break;case "Q":for(;d.length<
3;)d.push("0");i=parseInt(d.shift(),10);f=parseInt(d.shift(),10);h=parseInt(d.shift(),10);c.onescQ(new ESCQEvent(i,f,h));break;case "S":f=Math.max(1,parseInt(d.shift(),10));Crt.ScrollUpScreen(f);break;case "s":j=new Point(Crt.WhereX(),Crt.WhereY());break;case "T":f=Math.max(1,parseInt(d.shift(),10));Crt.ScrollDownWindow(f);break;case "u":Crt.GotoXY(j.x,j.y);break;default:trace("Unknown ESC sequence: "+o+" ("+d.toString()+")")}b=AnsiParserState.None}}else n+=k.charAt(g);Crt.Write(n)}};e=7;m="0";d=
[];b=AnsiParserState.None;j=new Point(1,1)},Ansi=new TAnsi,TTelnet=function(){this.onclose=function(){};this.onconnect=function(){};this.onioerror=function(){};this.onsecurityerror=function(){};var a=this,c,e,m=!1,d,b=function(){},j=function(){},k=function(){},n=function(){};this.__defineGetter__("bytesAvailable",function(){return c.bytesAvailable});this.close=function(){d&&d.close()};this.connect=function(c,e){try{m=!1,d=new WebSocket("ws://"+c+":"+e)}catch(i){try{d=new MozWebSocket("ws://"+c+":"+
e)}catch(f){a.onsecurityerror();return}}d.onclose=b;d.onerror=j;d.onmessage=n;d.onopen=k};this.__defineGetter__("connected",function(){return d?d.readyState===d.OPEN:!1});this.flush=function(){d.send(e.toString());e.clear()};b=function(){if(m)a.onclose();else a.onsecurityerror();m=!1};j=function(b){a.onioerror(b)};k=function(){m=!0;a.onconnect()};n=function(a){c.bytesAvailable===0&&c.clear();var b=c.position;c.position=c.length;c.writeString(a.data);c.position=b};this.readBoolean=function(){return c.readBoolean()};
this.readByte=function(){return c.readByte()};this.readBytes=function(a,b,d){return c.readBytes(a,b,d)};this.readDouble=function(){return c.readDouble()};this.readFloat=function(){return c.readFloat()};this.readInt=function(){return c.readInt()};this.readMultiByte=function(a,b){return c.readMultiByte(a,b)};this.readObject=function(){return c.readObject()};this.readShort=function(){return c.readShort()};this.readString=function(){return c.readString()};this.readUnsignedByte=function(){return c.readUnsignedByte()};
this.readUnsignedInt=function(){return c.readUnsignedInt()};this.readUnsignedShort=function(){return c.readUnsignedShort()};this.readUTF=function(){return c.readUTF()};this.readUTFBytes=function(a){return c.readUTFBytes(a)};this.writeBoolean=function(a){e.writeBoolean(a)};this.writeByte=function(a){e.writeByte(a)};this.writeBytes=function(a,b,c){e.writeBytes(a,b,c)};this.writeDouble=function(a){e.writeDouble(a)};this.writeFloat=function(a){e.writeFloat(a)};this.writeInt=function(a){e.writeInt(a)};
this.writeMultiByte=function(a,b){e.writeMultiByte(a,b)};this.writeObject=function(a){e.writeObject(a)};this.writeShort=function(a){e.writeShort(a)};this.writeString=function(b){e.writeString(b);a.flush()};this.writeUnsignedInt=function(a){e.writeUnsignedInt(a)};this.writeUTF=function(a){e.writeUTF(a)};this.writeUTFBytes=function(a){e.writeUTFBytes(a)};c=new ByteArray;e=new ByteArray},HtmlTerm=function(){},THtmlTerm=function(){var a=0,c=0,e=0,m=0,d=!1,b=0,j=0,k=!1,n=115200,g=!0,o="437",i="connect.ans",
f="\r",h=16,q=9,r="",s=11235,y=80,z=25,w="",x="fTelnet and HtmlTerm Support BBS",u="bbs.ftelnet.ca",v=1123,p=function(){},l=function(){},t=function(){},G=function(){},H=function(){},I=function(){},J=function(){},A=function(){},K=function(){},D=function(){},L=function(){},M=function(){},N=function(){},O=function(){},P=function(){},E=function(){},Q=function(){},B=function(){},R=function(){},F=function(){},S=function(){},T=function(){},C=function(){},U=function(){};this.Init=function(f,m){if(document.getElementById(f)===
null)return trace('HtmlTerm Error: Your document is missing the required element with id="'+f+'"'),!1;e=document.getElementById(f);if(navigator.appName==="Microsoft Internet Explorer"){var n=-1;/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent)!==null&&(n=parseFloat(RegExp.$1));if(n<9)return trace("HtmlTerm Error: IE less than 9.0 found (and is not supported)"),!1}t(m);T();if(Crt.Init(e)){Crt.Blink=g;Crt.SetFont(o,q,h);Crt.SetScreenSize(y,z);Crt.Canvas.addEventListener(Crt.FONT_CHANGED,O,!1);
Crt.Canvas.addEventListener(Crt.SCREEN_SIZE_CHANGED,P,!1);if(typeof WebSocket==="undefined"&&typeof MozWebSocket==="undefined")return Crt.WriteLn("Sorry, your browser doesn't support the WebSocket API"),Crt.WriteLn(),Crt.WriteLn("When this version of HtmlTerm was released, WebSocket was implemented in:"),Crt.WriteLn("    Chrome 4"),Crt.WriteLn("    Firefox 4 *"),Crt.WriteLn("    Internet Explorer 10 Developer Preview"),Crt.WriteLn("    Opera 10.70 **"),Crt.WriteLn("    Safari 5"),Crt.WriteLn(),Crt.WriteLn("* WebSockets are disabled by default in FireFox 4 and 5."),
Crt.WriteLn('  Enable them by changing this setting in "about:config":'),Crt.WriteLn("    network.websocket.enabled = true"),Crt.WriteLn("    network.websocket.override-security-block = true"),Crt.WriteLn("  As of Firefox 6 this change is no longer required"),Crt.WriteLn(),Crt.WriteLn("** WebSockets are disabled by default in Opera."),Crt.WriteLn('   Enable them by changing this setting in "opera:config":'),Crt.WriteLn("     User Prefs -> Enable WebSockets = checked"),trace("HtmlTerm Error: WebSocket not supported"),
!1;c=new TTelnet;c.onclose=D;c.onconnect=L;c.onioerror=M;c.onsecurityerror=N;a=new TConnectButton;e.appendChild(a.Image);a.ongraphicchanged=K;p();b=new TSaveFilesButton;e.appendChild(b.Image);b.ongraphicchanged=R;l();Ansi.onesc5n=G;Ansi.onesc6n=H;Ansi.onesc255n=I;Ansi.onescQ=J;if(k)A("AutoConnect");else{C();Crt.Canvas.style.opacity=1;n=new XMLHttpRequest;try{n.onreadystatechange=function(){try{this.readyState===4&&(this.status===200?this.responseText===""?Ansi.Write(ConnectAns):Ansi.Write(this.responseText):
Ansi.Write(ConnectAns))}catch(a){Ansi.Write(ConnectAns)}},n.overrideMimeType&&n.overrideMimeType("text/plain; charset=x-user-defined"),n.open("GET",i,!0),n.send(null)}catch(r){Ansi.Write(ConnectAns)}}}else trace("HtmlTerm Error: Unable to init Crt");j=setInterval(F,50);return d=!0};p=function(){a.Center(Crt.Canvas)};l=function(){b.Center(Crt.Canvas)};this.Connect=function(a,b){c!==null&&c.connected||(u=a,v=b,A("EIConnect"))};this.Connected=function(){return c===null?!1:c.connected};this.Disconnect=
function(){c!==null&&c.connected&&(c.close(),D("Disconnect"))};this.__defineGetter__("Loaded",function(){return d});t=function(a){if(a!==void 0){if(a.AutoConnect!==void 0)k=a.AutoConnect;if(a.BitsPerSecond!==void 0)n=a.BitsPerSecond;if(a.Blink!==void 0)g=a.Blink;if(a.CodePage!==void 0)o=a.CodePage;if(a.ConnectAnsi!==void 0)i=a.ConnectAnsi;if(a.Enter!==void 0)f=a.Enter;if(a.FontHeight!==void 0)h=a.FontHeight;if(a.FontWidth!==void 0)q=a.FontWidth;if(a.ProxyWebSocketHostName!==void 0)r=a.ProxyWebSocketHostName;
if(a.ProxyWebSocketPort!==void 0)s=a.ProxyWebSocketPort;if(a.ScreenColumns!==void 0)y=a.ScreenColumns;if(a.ScreenRows!==void 0)z=a.ScreenRows;if(a.SendOnConnect!==void 0)w=a.SendOnConnect;if(a.ServerName!==void 0)x=a.ServerName;if(a.WebSocketHostName!==void 0)u=a.WebSocketHostName;if(a.WebSocketPort!==void 0)v=a.WebSocketPort;o.indexOf("ATASCII")===0?(Crt.Atari=!0,h=16,q=o.indexOf("HalfWidth")===-1?16:8):o.indexOf("BStrict")===0?q=h=8:o.indexOf("BStruct")===0?q=h=8:o.indexOf("MicroKnight")===0?q=
h=8:o.indexOf("MoSoul")===0?q=h=8:o.indexOf("PotNoodle")===0?(h=8,q=11):o.indexOf("TopazPlus")===0?(h=8,q=11):o.indexOf("Topaz")===0&&(h=8,q=11)}};G=function(){c.writeString("\u001b[0n")};H=function(){c.writeString(Ansi.CursorPosition())};I=function(){c.writeString(Ansi.CursorPosition(Crt.ScreenRows,Crt.ScreenCols))};J=function(a){Crt.SetFont(a.CodePage,a.Width,a.Height)};A=function(){Crt.Canvas.style.opacity=1;Crt.ShowCursor();a.Image.removeEventListener("click",A,!1);a.Hide();k=!1;Crt.NormVideo();
Crt.ClrScr();r===""?(Crt.WriteLn("Connecting to "+x+" ("+u+":"+v+")"),c.connect(u,v)):(Crt.WriteLn("Connecting to "+x+" ("+u+":"+v+") via proxy"),c.connect(r,s))};K=function(){p()};D=function(){b.Image.removeEventListener("click",B,!1);b.Hide();C()};L=function(){Crt.ClrScr();r!==""&&c.writeString(u+":"+v+"\r");w.length>0&&c.writeString(w)};M=function(){trace("HtmlTerm.OnConnectionIOError")};N=function(){Crt.WriteLn("Unable to connect...");C()};O=function(){p();l()};P=function(){p();l()};E=function(){j=
setInterval(F,50);(0).removeEventListener("TRANSFER_COMPLETE",E,!1);(0).FileCount>0&&U()};Q=function(){c!==null&&c.connected&&(clearInterval(j),(0).addEventListener("TRANSFER_COMPLETE",E,!1),(0).Download())};B=function(){if(0!==null&&(0).FileCount!==0){var a=new FileReference;if((0).FileCount===1)a.save((0).FileAt(0).data,(0).FileAt(0).name);else if((0).FileCount>1){for(var c=0,d=0,e=new ByteArray,c=0;c<(0).FileCount;c++){for(var f=new ByteArray,g=(0).FileAt(c).name,d=0;d<100;d++)d<g.length?f.writeByte(g.charCodeAt(d)):
f.writeByte(0);for(d=0;d<8;d++)f.writeByte(0);for(d=0;d<8;d++)f.writeByte(0);for(d=0;d<8;d++)f.writeByte(0);g=(0).FileAt(c).data.length.toString(8);for(d=0;d<11-g.length;d++)f.writeByte("0".charCodeAt(0));for(d=0;d<g.length;d++)f.writeByte(g.charCodeAt(d));f.writeByte(0);for(d=0;d<11;d++)f.writeByte(0);f.writeByte(0);for(d=0;d<8;d++)f.writeByte(32);f.writeByte("0".charCodeAt(0));for(d=0;d<100;d++)f.writeByte(0);for(d=0;d<255;d++)f.writeByte(0);for(d=g=f.position=0;d<512;d++)g+=f.readUnsignedByte();
e.writeBytes(f,0,148);g=g.toString(8);for(d=0;d<6-g.length;d++)e.writeByte("0".charCodeAt(0));for(d=0;d<g.length;d++)e.writeByte(g.charCodeAt(d));e.writeByte(0);e.writeByte(32);e.writeBytes(f,156,356);e.writeBytes((0).FileAt(c).data);if((0).FileAt(c).data.length%512!==0)for(d=0;d<512-(0).FileAt(c).data.length%512;d++)e.writeByte(0)}for(c=0;c<1024;c++)e.writeByte(0);a.save(e,"fTelnet-BatchDownload.tar")}b.removeEventListener("click",B,!1);b.Hide();Crt.Canvas.style.opacity=1}};R=function(){l()};F=function(){if(c.connected){var a=
(new Date).getTime()-m;a<1&&(a=1);a=Math.floor(n/8/(1E3/a));a<1&&(a=1);a=c.readString(a);for(a.length>0&&Ansi.Write(a);Crt.KeyPressed();)a=Crt.ReadKey(),a!==null&&(a.ctrlKey&&a.keyCode===Keyboard.PAGE_DOWN?Q():a.ctrlKey&&a.keyCode===Keyboard.PAGE_UP?S():a.keyString.length>0&&(a.keyString==="\r\n"?c.writeString(f):c.writeString(a.keyString)))}m=(new Date).getTime()};S=function(){};T=function(){};C=function(){Crt.Canvas.style.opacity=0.4;Crt.HideCursor();a.Image.addEventListener("click",A,!1);a.Show()};
U=function(){Crt.Canvas.style.opacity=0.4;b.addEventListener("click",B,!1);b.Show()}},HtmlTerm=new THtmlTerm;
