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