var CreateAmtRedirect=function(t,c){var O={};((O.m=t).parent=O).authCookie=c,O.State=0,O.socket=null,O.host=null,O.port=0,O.user=null,O.pass=null,O.authuri="/RedirectionService",O.tlsv1only=0,O.inDataCount=0,O.connectstate=0,O.protocol=t.protocol,O.debugmode=0,O.amtaccumulator="",O.amtsequence=1,O.amtkeepalivetimer=null,O.onStateChanged=null,O.Start=function(t,e,r,a,o){O.host=t,O.port=e,O.user=r,O.pass=a,O.connectstate=0,O.inDataCount=0;var n=window.location.protocol.replace("http","ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/webrelay.ashx?p=2&host="+t+"&port="+e+"&tls="+o+("*"==r?"&serverauth=1":"")+(void 0===a?"&serverauth=1&user="+r:"");null!=c&&""!=c&&(n+="&auth="+c),O.socket=new WebSocket(n),O.socket.onopen=O.xxOnSocketConnected,O.socket.onmessage=O.xxOnMessage,O.socket.onclose=O.xxOnSocketClosed,O.xxStateChange(1)},O.xxOnSocketConnected=function(){1==O.debugmode&&console.log("onSocketConnected"),O.xxStateChange(2),1==O.protocol&&O.xxSend(O.RedirectStartSol),2==O.protocol&&O.xxSend(O.RedirectStartKvm),3==O.protocol&&O.xxSend(O.RedirectStartIder)};var n=new FileReader,l=!1,u=[];return n.readAsBinaryString?n.onload=function(t){O.xxOnSocketData(t.target.result),0==u.length?l=!1:n.readAsBinaryString(new Blob([u.shift()]))}:n.readAsArrayBuffer&&(n.onloadend=function(t){O.xxOnSocketData(t.target.result),0==u.length?l=!1:n.readAsArrayBuffer(u.shift())}),O.xxOnMessage=function(t){if(O.inDataCount++,"object"==typeof t.data){if(1==l)return void u.push(t.data);if(n.readAsBinaryString)l=!0,n.readAsBinaryString(new Blob([t.data]));else if(n.readAsArrayBuffer)l=!0,n.readAsArrayBuffer(t.data);else{for(var e="",r=new Uint8Array(t.data),a=r.byteLength,o=0;o