<?
require_once 'erpc_codepdv_header.php';
require_once 'inc/usuario.php';


// capturando o usuário e unidade logado
$usuario_venda = getLoggedUser();
$id_usuario=$usuario_venda['id'];
$id_unidade=$usuario_venda['unidade'];

?>
    <script language="jscript">
	$(document).ready(function() {
    
		function goFullscreen() {
            // Must be called as a result of user interaction to work
            mf = document.getElementById("main_frame");
            mf.webkitRequestFullscreen();
            mf.style.display="";
        }
        function fullscreenChanged() {
            if (document.webkitFullscreenElement == null) {
                mf = document.getElementById("main_frame");
                mf.style.display="none";
            }
        }
		
		$(window).bind('keydown', function(e) {
			
				/** Prevents the default function such as the help pop-up **/
				function removeDefaultFunction()
				{
					window.onhelp = function () { return false; }
				}
			
				//This is the F1 key code, but NOT with SHIFT/CTRL/ALT
	            var keyCode = e.keyCode || e.which;
				
				console.log('keycode:' + keyCode + 'e.keycode:' + e.keyCode + '|key:' + e.key);
				
	            /*if((keyCode == 114 || e.key == 'F3') && 
	                    !(event.altKey ||event.ctrlKey || event.shiftKey || event.metaKey))
				*/
	            if((keyCode == 120 || e.keyCode == 120 || e.key == 'F9') && 
		                    !(event.ctrlKey))
		             {
		                // prevent code starts here:
		                removeDefaultFunction();
		                e.cancelable = true;
		                e.stopPropagation();
		                e.preventDefault();
		                e.returnValue = false;

						document.onwebkitfullscreenchange = fullscreenChanged;
						document.documentElement.onclick  = goFullscreen;
						document.documentElement.hover    = goFullscreen;
						document.onkeydown = goFullscreen;

						document.getElementById("main_frame").focus();
	                }
		        });

	}(jQuery));

    </script>

<body style="margin:0">
    <h3><br>Pressione CRT + ENTER para iniciar a Tela cheia.</h3>
	<iframe id="main_frame" src="" style="width:100%;height:100%;border:none;display:none"></iframe>
    <!--
	<iframe id="main_frame" src="erpc_codepdv.php" style="width:100%;height:100%;border:none;display:none"></iframe>
	-->
</body>

