var CreateAmtRedirect=function(e,o){var x={};function y(e){return String.fromCharCode.apply(null,e)}return((x.m=e).parent=x).authCookie=o,x.State=0,x.socket=null,x.host=null,x.port=0,x.user=null,x.pass=null,x.authuri="/RedirectionService",x.tlsv1only=0,x.inDataCount=0,x.connectstate=0,x.protocol=e.protocol,x.acc=null,x.amtsequence=1,x.amtkeepalivetimer=null,x.onStateChanged=null,x.Start=function(e,t,n,r,a){x.host=e,x.port=t,x.user=n,x.pass=r,x.connectstate=0,x.inDataCount=0;e=window.location.protocol.replace("http","ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/webrelay.ashx?p=2&host="+e+"&port="+t+"&tls="+a+("*"==n?"&serverauth=1":"")+(void 0===r?"&serverauth=1&user="+n:"");null!=o&&""!=o&&(e+="&auth="+o),x.socket=new WebSocket(e),x.socket.binaryType="arraybuffer",x.socket.onopen=x.xxOnSocketConnected,x.socket.onmessage=x.xxOnMessage,x.socket.onclose=x.xxOnSocketClosed,x.xxStateChange(1)},x.xxOnSocketConnected=function(){x.xxStateChange(2),1==x.protocol&&x.directSend(new Uint8Array([16,0,0,0,83,79,76,32])),2==x.protocol&&x.directSend(new Uint8Array([16,1,0,0,75,86,77,82])),3==x.protocol&&x.directSend(new Uint8Array([16,0,0,0,73,68,69,82]))},x.xxOnMessage=function(e){if(e.data&&-1!=x.connectstate){if(x.inDataCount++,1==x.connectstate&&(2==x.protocol||3==x.protocol))return x.m.ProcessBinaryData?x.m.ProcessBinaryData(e.data):x.m.ProcessData(y(e.data));var t;for(null==x.acc?x.acc=e.data:((t=new Uint8Array(x.acc.byteLength+e.data.byteLength)).set(new Uint8Array(x.acc),0),t.set(new Uint8Array(e.data),x.acc.byteLength),x.acc=t.buffer);null!=x.acc&&1<=x.acc.byteLength;){var n=0,r=new Uint8Array(x.acc);switch(r[0]){case 17:if(r.byteLength<4)return;var a=r[1];if(0===a){if(r.byteLength<13)return;a=r[12];if(r.byteLength<13+a)return;x.directSend(new Uint8Array([19,0,0,0,0,0,0,0,0])),n=13+a}else x.Stop(1);break;case 20:if(r.byteLength<9)return;var o=new DataView(x.acc).getUint32(5,!0);if(r.byteLength<9+o)return;var a=r[1],c=r[4],s=[];for(i=0;i