<!--Home-->
<?xjs var _hpl = getLanguage(settings.language_file || 'english.ini', 'page_home'); ?>

<!-- fTelnet -->
<?xjs
    if (settings.ftelnet) {
        load(settings.web_lib + 'ftelnet.js');
        load('ftelnethelper.js');
?>
        <style>.fTelnetStatusBar { display : none; }</style>
    	<div id="fTelnetContainer" class="fTelnetContainer"></div>
        <div class="row">
            <div class="center-block" style="width:200px;margin-bottom:1em;margin-top:1em;">
                <button id="ftelnet-connect" class="btn btn-primary">
                    <?xjs write(_hpl.button_ftelnet); ?>
                </button>
            </div>
        </div>

    	<script>document.write('<script src="//embed-v2.ftelnet.ca/js/ftelnet-loader.norip.noxfer.js?v=' + (new Date()).getTime() + '"><\/script>');</script>
    	<script>
            var wsp = <?xjs write(GetWebSocketServicePort()); ?>;
            var wssp = <?xjs write(GetWebSocketServicePort(true)); ?>;
    		var Options = new fTelnetOptions();
    		Options.BareLFtoCRLF = false;
    		Options.BitsPerSecond = 57600;
    		Options.ConnectionType = 'telnet';
    		Options.Emulation = 'ansi-bbs';
    		Options.Enter = '\r';
    		Options.Font = 'CP437';
    		Options.ForceWss = false;
    		Options.Hostname = '<?xjs write(http_request.vhost); ?>';
    		Options.LocalEcho = false;
    		Options.Port = location.protocol == 'https:' ? wssp : wsp;
    		Options.ScreenColumns = 80;
    		Options.ScreenRows = 25;
            Options.SplashScreen = '<?xjs write(getSplash()); ?>';
    		var fTelnet = new fTelnetClient('fTelnetContainer', Options);
            $('#ftelnet-connect').click(function() { fTelnet.Connect(); });
    	</script>

<?xjs } ?>

<!-- end fTelnet -->
