<!--
/******************************************************************************
@owner: SVSi
@author: Arthur Johnson
@function: Main Panel Builder panels HTML/PHP page
*******************************************************************************/
-->
<!DOCTYPE html>
<html>
	<head>
	
		<title>Debugging</title>
		
		<!-- Meta Data -->
			<meta charset="utf-8">
			<meta http-equiv="X-UA-Compatible" content="IE=Edge">
		<!-- End of Meta Data -->
		
		<!-- Touch Panel Style -->
			<style id="tpstyle">* {cursor: none !important;}
				body {overflow: hidden}
			</style>
		<!-- End of Touch Panel Style -->
		
		<!-- Initialize Page Global Variables -->
			<script>
				var dev = true; //development
				var version = '1.0.16';
				if (dev) version = parseInt(Math.random()*1000000000);
				
				var ncommand = false;
				var standalone = false;
				var wallcon = true;
				
				var activepanel = isworkingpanel = true; 
				var usephp = true;
				var useDB_read = false;
				var useDB_write = false;
				
				var unitlist = [];
				var Server = {name: location.hostname, ip: location.host, 
					errors: true, warnings: true, notices: true};
				var Client = {username: false};
				
				var project = false;
				
				if (standalone){
					var os = require('os'), fs = require('fs');
					var gui = require('nw.gui');
					var win = gui.Window.get();
				}
			</script> 
		<!-- End of Initialize -->
		
		<!-- PHP
			<?php				
				$ncommand = false;
				$standalone = false;
				$wallcon = true;
				
				if ($ncommand) include_once "verify.php";
				if ($wallcon){
					session_start(); require_once "../wallfunctions.php";
					if (isset($_REQUEST) && isset($_REQUEST['User']) && isset($_REQUEST['Pass'])){
						$mobile_user = getUser($_REQUEST['User']);
						if ($mobile_user){
							if (md5($_REQUEST['Pass']) != $mobile_user['password']){
								header("location: /login.php");
								exit;
							}
						}
					}
					else {
						if ($_SERVER['SERVER_ADDR'] != $_SERVER['REMOTE_ADDR']){
							if (!isLoggedIn()){
								header("location: /login.php");
								exit;
							}
						}
					}
				}
			?>
		End of PHP -->
		
		<!-- Stylesheets -->
			<script>
				document.write('<link rel="stylesheet" href="css/fonts.css?v='+version+'" type="text/css" />');
				document.write('<link rel="stylesheet" href="css/index.css?v='+version+'" type="text/css" />');
			</script>
		<!-- End of Stylesheets -->
		
		<!-- Start Websocket -->
			<script>document.write('<script src="js/websocket.js?v='+version+'"\><\/script>');</script>
		<!-- End Start Websocket -->

		<!-- jQuery etc. -->
			<script src="js/libs/jquery.js"></script>
			<script src="js/libs/resize.js"></script>
			<script src="js/libs/slider.js"></script>
			<script src="js/libs/easing.js"></script>
			<script src="js/libs/drag.js"></script>
		<!-- End of jQuery etc. -->
		
		<!-- Shims/Polyfills -->
			<script> if (window.attachEvent && !window.addEventListener) var oldIE = true; </script>
			<script src="js/libs/modernizr.js"></script>
			<!--[IF IE]>
				<script src="js/libs/exCanvas.js"></script>
				<script src="js/libs/cssSandpaper.js"></script>
				<script src="js/libs/es5.js"></script>
				<script src="js/libs/web.js"></script>
				<script src="js/libs/pie.js"></script>
				<script src="js/libs/ie-opacity-polyfill.js"></script>
			<![ENDIF]-->
			<script src="js/libs/typedarray.js"></script>
			<script src="js/libs/stacktrace.js"></script>
			<script>document.write('<script src="js/utils.js?v='+version+'"\><\/script>');</script>
		<!-- End of Shims/Polyfills -->
		
		<!-- Libraries -->
			<script>
				document.write('<script src="js/libs/angular.js?v='+version+'"\><\/script>');
				document.write('<script src="js/libs/angimate.js?v='+version+'"\><\/script>');
				document.write('<script src="js/libs/watch.js?v='+version+'"\><\/script>');
				document.write('<script src="js/libs/shortcut.js?v='+version+'"\><\/script>');
				document.write('<script src="js/libs/socketio.js?v='+version+'"\><\/script>');
				document.write('<script src="js/libs/binary.js?v='+version+'"\><\/script>');
				document.write('<script src="js/libs/saveas.js?v='+version+'"\><\/script>');
			</script>
		<!-- End of Libraries -->
		
		<!-- Classes -->
			<script>
				//document.write('<script src="js/ngmodel.js?v='+version+'"\><\/script>');
				document.write('<script src="js/panelbuilder.js?v='+version+'"\><\/script>');
				document.write('<script src="js/button.js?v='+version+'"\><\/script>');
				document.write('<script src="js/widget.js?v='+version+'"\><\/script>');
				document.write('<script src="js/widgetpart.js?v='+version+'"\><\/script>');
				document.write('<script src="js/panel.js?v='+version+'"\><\/script>');
				document.write('<script src="js/mouse.js?v='+version+'"\><\/script>');
				document.write('<script src="js/setupPB.js?v='+version+'"\><\/script>');
				document.write('<script src="js/tween.js?v='+version+'"\><\/script>');
			</script>
		<!-- End of Classes -->

		<!-- Set up Local and Remote Storage -->
			<script>document.write('<script src="js/storage.js?v='+version+'"\><\/script>');</script>
		<!-- End of Local and Remote Storage Setup -->
		
		<script>
			startWebsocket(function(){
				window._console = {log: console.log, error: console.error}; websocket.emit('message', {command: 'debugging'});
			});
		</script>
		
	</head>
	
	<body id="thebody" class="thebody" style="z-index: -1; font-family: Helvetica; background-color: white !important;">
		
	</body>
</html>