Index: src/webapp/webclient/css/GnuBoat.css
===================================================================
--- src/webapp/webclient/css/GnuBoat.css	(revision 4ce069e4224fca8f43b386d85f943c2b8672efee)
+++ src/webapp/webclient/css/GnuBoat.css	(revision 4ce069e4224fca8f43b386d85f943c2b8672efee)
@@ -0,0 +1,122 @@
+/*
+    Copyright (C) 2016 - 2017 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+.backgroundblue {
+	background-color: #93C0C0;
+	background-image: linear-gradient(#BCD9D9, #93C0C0);
+}
+
+.backgroundgreen {
+	background-color: #ACDFAC;
+	background-image: linear-gradient(#CCECCC, #ACDFAC);
+}
+
+.l-box {
+	padding: 1em;
+}
+
+.header h1 img {
+	height: 2em;
+	width: auto;
+}
+
+#display {
+	background-color: #BCD9D9;
+	height: 9em;
+	min-width: 14em;
+	font-size: 12pt;
+	font-weight: normal;
+	padding: 0mm;
+	position:relative;
+	line-height: 1.5em;
+	color: black;
+}
+
+#display h2 {
+	font-size: 12pt;
+	font-weight: normal;
+	margin: 0em;
+	padding: 0em;
+}
+
+#display span {
+	font-size: 24pt;
+	font-weight: bold;
+	margin: 0em;
+	padding: 0em;
+}
+
+#display #speedthroughwater {
+	position: absolute;
+	top: 0.5em;
+	left: 0.5em;
+}
+
+#display .important {
+	font-size: 40pt;
+	line-height: 0.6em;
+}
+
+#display #speedoverground {
+	position: absolute;
+	top:  0.5em;
+	left: 7em;
+}
+
+#display #waterdepth {
+	position: absolute;
+	top: 5em;
+	left: 0.5em;
+}
+
+#display #watertemperature {
+	position: absolute;
+	top: 5em;
+	left: 7em;
+}
+
+#display #gpsfix {
+	position: absolute;
+	top: 5em;
+	left: 11em;
+}
+
+#mapViewport {
+	width: 100%;
+	height: 24em;
+	border: 1px solid #347C7C;
+	margin-top: 1em;
+}
+
+.shutdown-button {
+	background-color: #8C1C00;
+	color: white;
+	font-weight: bold;
+	height: 3em;
+	width: 100%;
+	margin-top: 3em;
+}
+
+#shutdownMessage {
+	font-weight: bold;
+	color: #8C1C00;
+}
+
+.logfiles-reload-button, .logfiles-reload-button:hover, .logfiles-reload-button:active, .logfiles-reload-button:focus {
+	float: right;
+	background:url('../resources/view-refresh.svg') no-repeat left center;
+}
Index: src/webapp/webclient/css/main.css
===================================================================
--- src/webapp/webclient/css/main.css	(revision df8c58afe1e5ad1030e6691c76819b58d843bed2)
+++ 	(revision )
@@ -1,117 +1,0 @@
-/*
-    Copyright (C) 2016 - 2017 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
-
-    This program is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-.backgroundblue {
-	background-color: #93C0C0;
-	background-image: linear-gradient(#BCD9D9, #93C0C0);
-}
-
-.backgroundgreen {
-	background-color: #ACDFAC;
-	background-image: linear-gradient(#CCECCC, #ACDFAC);
-}
-
-.l-box {
-	padding: 1em;
-}
-
-#display {
-	background-color: #BCD9D9;
-	height: 9em;
-	min-width: 14em;
-	font-size: 12pt;
-	font-weight: normal;
-	padding: 0mm;
-	position:relative;
-	line-height: 1.5em;
-	color: black;
-}
-
-#display h2 {
-	font-size: 12pt;
-	font-weight: normal;
-	margin: 0em;
-	padding: 0em;
-}
-
-#display span {
-	font-size: 24pt;
-	font-weight: bold;
-	margin: 0em;
-	padding: 0em;
-}
-
-#display #speedthroughwater {
-	position: absolute;
-	top: 0.5em;
-	left: 0.5em;
-}
-
-#display .important {
-	font-size: 40pt;
-	line-height: 0.6em;
-}
-
-#display #speedoverground {
-	position: absolute;
-	top:  0.5em;
-	left: 7em;
-}
-
-#display #waterdepth {
-	position: absolute;
-	top: 5em;
-	left: 0.5em;
-}
-
-#display #watertemperature {
-	position: absolute;
-	top: 5em;
-	left: 7em;
-}
-
-#display #gpsfix {
-	position: absolute;
-	top: 5em;
-	left: 11em;
-}
-
-#mapViewport {
-	width: 100%;
-	height: 24em;
-	border: 1px solid #347C7C;
-	margin-top: 1em;
-}
-
-.shutdown-button {
-	background-color: #8C1C00;
-	color: white;
-	font-weight: bold;
-	height: 3em;
-	width: 100%;
-	margin-top: 3em;
-}
-
-#shutdownMessage {
-	font-weight: bold;
-	color: #8C1C00;
-}
-
-.logfiles-reload-button, .logfiles-reload-button:hover, .logfiles-reload-button:active, .logfiles-reload-button:focus {
-	float: right;
-	background:url('../resources/view-refresh.svg') no-repeat left center;
-}
Index: src/webapp/webclient/index.html
===================================================================
--- src/webapp/webclient/index.html	(revision df8c58afe1e5ad1030e6691c76819b58d843bed2)
+++ src/webapp/webclient/index.html	(revision 4ce069e4224fca8f43b386d85f943c2b8672efee)
@@ -37,8 +37,41 @@
 		<script language="javascript\" src="lib/js/leaflet.js" type="text/javascript"></script>
 		
-		<link rel="stylesheet" href="css/main.css" type="text/css"/>
+		<link rel="stylesheet" href="css/GnuBoat.css" type="text/css"/>
 		<link rel="stylesheet" href="css/side-menu.css" type="text/css"/>
-		<script language="javascript" src="js/side-menu.js" type="text/javascript"></script>
-		<script language="javascript" src="js/main.js" type="text/javascript"></script>
+		<script language="javascript" src="js/GnuBoat.js" type="text/javascript"></script>
+		<script language="javascript" type="text/javascript">
+			var active = 'active';
+			var layout = null;
+			var menu = null;
+			var menuLink = null;
+			var content = null;
+
+			function toggleAll() {
+				layout.toggleClass(active);
+				menu.toggleClass(active);
+				menuLink.toggleClass(active);
+			}
+
+			$(document).ready(function () {
+				layout   = $("#layout");
+				menu     = $("#menu");
+				menuLink = $("#menuLink");
+				content  = $("#main");
+
+				menuLink.click(function () {
+					toggleAll();
+				});
+
+				content.click(function() {
+					if (menu.hasClass(active)) {
+						toggleAll();
+					}
+				});
+
+				GnuBoat.initialize();
+				GnuBoat.setServer("../webservice");
+				GnuBoat.start();
+			});
+		</script>
 	</head>
 	<body>
@@ -52,4 +85,5 @@
 						<li class="pure-menu-item"><a class="pure-menu-link" href="#map">Map</a></li>
 						<li class="pure-menu-item"><a class="pure-menu-link" href="#logfiles">Logfiles</a></li>
+						<li class="pure-menu-item"><a class="pure-menu-link" href="#opencpn">OpenCPN</a></li>
 						<li class="pure-menu-item"><button type="button" class="pure-button shutdown-button" id="shutdownButton">SHUTDOWN</button></li>
 					</ul>
@@ -127,4 +161,10 @@
 						<form id="logfilesForm" class="pure-form" method="POST" action="../webservice/?request=logfiles"></form>
 					</div>
+					
+					<h2 class="content-subhead">OpenCPN</h2>
+					<div>
+						<a name="opencpn"></a>
+						<div id="opencpnHint"></div>
+					</div>
 				</div>
 			</div>
Index: src/webapp/webclient/js/GnuBoat.js
===================================================================
--- src/webapp/webclient/js/GnuBoat.js	(revision 4ce069e4224fca8f43b386d85f943c2b8672efee)
+++ src/webapp/webclient/js/GnuBoat.js	(revision 4ce069e4224fca8f43b386d85f943c2b8672efee)
@@ -0,0 +1,356 @@
+/*
+
+    Copyright (C) 2016 - 2017 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+    MA 02110-1301  USA.
+
+*/
+
+/** @namespace GnuBoat JavaScript namespace */
+var GnuBoat = GnuBoat || {};
+
+/**
+ * @brief Sets the webservice base url, used by any other functions
+ */
+GnuBoat.setServer = function(baseUrl)
+{
+	if(baseUrl.slice(-1) != "/")
+		baseUrl += "/";
+	GnuBoat.private.serverBaseUrl = baseUrl;
+	
+}
+
+/**
+ * @brief Used to display user messages
+ */
+GnuBoat.displayMessage = function(text)
+{
+	$("#message").clear();
+	$(shutdownHint).appendTo("#message");
+	location.hash = "#messages";
+}
+
+/**
+ * @brief Fetches the data shown in the display area from the webservice
+ */
+GnuBoat.displayDataGet = function()
+{
+	if(GnuBoat.private.serverBaseUrl == null){
+		GnuBoat.displayMessage("No server set/found");
+		return;
+	}
+	var gnuboatApi = GnuBoat.private.serverBaseUrl;
+	$.getJSON(gnuboatApi, GnuBoat.private.displayDataSet);
+};
+
+/**
+ * @brief Gets the metadata of all maps, provided by the tileserver
+ */
+GnuBoat.getMapInfos = function()
+{
+	if(GnuBoat.private.serverBaseUrl == null){
+		GnuBoat.displayMessage("No server set/found");
+		return;
+	}
+	$.getJSON(GnuBoat.private.serverBaseUrl +"tileserver.php?/index.json", GnuBoat.private.mapInfos);
+};
+
+/**
+ * @brief Fetches the list of available logfiles and adds them to the log file download form
+ */
+GnuBoat.logfilesLoad = function()
+{
+	if(GnuBoat.private.serverBaseUrl == null){
+		GnuBoat.displayMessage("No server set/found");
+		return;
+	}
+	$("#logfilesForm").empty();
+	$.getJSON(GnuBoat.private.serverBaseUrl +"?request=logfiles", function(data){
+		if(!Array.isArray(data) || data.length < 1){
+			$("<p>No Logfiles found!</p>").appendTo("#logfilesForm");
+			console.log(data);
+			return;
+		}
+		if(("error" in data) && data["error"] == 1){
+			alert("Failed to upload map: "+ data["errormessage"]);
+			$("#mapTileUploadProgress").hide();
+			$("#mapFileInput").show();
+			return;
+		}
+		$("<select id=\"logfilesSelect\" name=\"logfilesSelected[]\" class=\"pure-input-1\" multiple></select>").appendTo("#logfilesForm");
+		$("<input type=\"submit\" class=\"pure-button pure-button-primary\" name=\"logfilesDownload\" value=\"Download\"/>").appendTo("#logfilesForm");
+		data.forEach(function(value, index){
+			$("<option value=\""+ value +"\">"+ value +"</option>").appendTo("#logfilesSelect");
+		});
+	});
+};
+/**
+ * @brief Sends a shutdown request to the webservice
+ */
+GnuBoat.shutdown = function()
+{
+	if(GnuBoat.private.serverBaseUrl == null){
+		GnuBoat.displayMessage("No server set/found");
+		return;
+	}
+	$.getJSON(GnuBoat.private.serverBaseUrl +"?request=shutdown", function(data){
+		var shutdownTime = data["shutdownstart"];
+		var shutdownDate = Date.parse(shutdownTime);
+		var currentDate = new Date();
+		var shutdownHint = "Shutting down in "+ Math.floor((shutdownDate - currentDate)/1000) +"s at "+ shutdownTime.toLocaleString();
+		if(shutdownTime == -1){
+			shutdownHint = "Failed to initiate shutdown: "+ data["errormessage"];
+		}
+		GnuBoat.displayMessage(shutdownHint);
+	});
+};
+
+/**
+ * @brief Uploads a map and refreshes the maps metadata on success
+ */
+GnuBoat.uploadMap = function(form)
+{
+	if(GnuBoat.private.serverBaseUrl == null){
+		displayMessage("No server set/found");
+		return;
+	}
+	$("#mapFileInput").hide();
+	$("#mapTileUploadProgress").show();
+	$.ajax({
+		type: 'POST',
+		url: GnuBoat.private.serverBaseUrl +'?request=map',
+		data: new FormData($("#mapTileUpload")[0]),
+		contentType: false,
+		processData: false,
+		success: function(data){
+			if(("error" in data) && data["error"] == 1){
+				alert("Failed to upload map: "+ data["errormessage"]);
+				$("#mapTileUploadProgress").hide();
+				$("#mapFileInput").show();
+				return;
+			}
+			alert("Map upload successfully");
+			$("#mapTileUploadProgress").hide();
+			$("#mapFileInput").show();
+			GnuBoat.getMapInfos();
+		},
+		error: function(jqXHR, exception, errorThrown){
+			alert("Failed to upload map (XHR): "+ exception);
+			$("#mapTileUploadProgress").hide();
+			$("#mapFileInput").show();
+		}
+	}).progress(function(e){
+		$("#mapTileUploadProgress").attr({value: e.oloaded, max: e.total});
+	});
+};
+
+/**
+ * @brief Setups up GnuBoat to be able to start() after configured a server with setServer().
+ */
+GnuBoat.initialize = function()
+{
+	$("#mapTileUploadProgress").hide();
+	$("#logfilesReload").click(GnuBoat.logfilesLoad);
+	$("#shutdownButton").click(GnuBoat.shutdown);
+
+	$("#mapTileUpload").validate({
+		rules: {
+			mapFile: {
+				required: true
+			},
+			mapName: {
+				required: true
+			}
+		},
+		submitHandler: function(form){
+			GnuBoat.uploadMap(form);
+		}
+	});
+	
+	$("#logfilesForm").validate({
+		rules: {
+			logfilesSelect: {
+				required: true
+			},
+		}
+	});
+}
+
+/**
+ * @brief Starts querying the webservice
+ * 
+ * Call initialize() and setServer() before start()
+ */
+GnuBoat.start = function()
+{
+	if(GnuBoat.private.serverBaseUrl == null){
+		GnuBoat.displayMessage("No server set/found");
+		return;
+	}
+	
+	GnuBoat.getMapInfos();
+	GnuBoat.displayDataGet();
+	if(GnuBoat.private.timerDisplay == null)
+		GnuBoat.private.timerDisplay = setInterval(GnuBoat.displayDataGet, 10000);
+	GnuBoat.logfilesLoad();	
+}
+
+/**
+ * @brief Stops querying the webservice
+ */
+GnuBoat.stop = function()
+{
+	if(GnuBoat.private.timerDisplay != null){
+		clearInterval(GnuBoat.private.timerDisplay);
+		GnuBoat.private.timerDisplay = null;
+	}
+}
+
+/**
+ * @brief Private methods and properties of GnuBoat
+ */
+GnuBoat.private = {
+	map: null,
+	mapLayerCurrent: null,
+	// var mapControl = null;
+	mapsMetadata: null,
+	polyline: null,
+	serverBaseUrl: null,
+	timerDisplay: null,
+	
+	openLink: function(target)
+	{
+		window.location=target;
+	},
+	
+	displayDataSet: function(data)
+	{
+		if(!Array.isArray(data) && !(data instanceof Object)){
+			console.log("No data array returned!");
+			console.log(data);
+			return;
+			}
+		if(!("lastvalid" in data)){
+				console.log("No last valid values given!");
+		}
+		else{
+			var lastValid = data["lastvalid"];
+			var keys = ["speedthroughwater", "speedoverground", "waterdepth", "watertemperature", "gpsfix"];
+			for(var i = 0; i < keys.length; i++){
+				var key = keys[i];
+				var value = lastValid[key];
+				if($.isNumeric(value)){
+					var text = value.toFixed(1);
+					if(key == "watertemperature"){
+						text = value.toFixed(0);
+					}
+					$("#display #"+ keys[i] +" #value").text(text);
+				}
+				else if(key == "gpsfix"){
+					$("#display #"+ keys[i] +" #value").text(value);
+				}
+			}
+		}
+		
+		if(!("track" in data)){
+				console.log("No track given!");
+		}
+		else{
+			if(GnuBoat.private.map == null){
+				console.log("No map in use");
+			}
+			else{
+				var track = data["track"];
+				var points = [];
+				for(var time in track){
+					points.push(new L.latLng(track[time]["latitude"], track[time]["longitude"]));
+				}
+				if(points.length > 0){
+					if(!GnuBoat.private.polyline){
+						GnuBoat.private.polyline = L.polyline(points, {color: 'red'}).addTo(GnuBoat.private.map);
+					}
+					else{
+						GnuBoat.private.polyline.setLatLngs(points);
+					}
+					GnuBoat.private.map.fitBounds(GnuBoat.private.polyline.getBounds());
+				}
+			}
+		}
+	},
+	
+	mapSetup: function ()
+	{
+		var mapMetadataIndex = $("#mapSelect").val();
+		if(GnuBoat.private.mapsMetadata == null){
+			console.log("No mapsMetadata set");
+			return;
+		}
+		if(mapMetadataIndex < 0 || mapMetadataIndex >= GnuBoat.private.mapsMetadata.length){
+			console.log("Map metadata is outside of range :"+ mapMetadataIndex.toString());
+			console.log(mapsMetadata);
+			return;
+		}
+		var mapMetadata = GnuBoat.private.mapsMetadata[mapMetadataIndex];
+		
+		var latitudeTop = mapMetadata["bounds"][3];
+		var latitudeBottom = mapMetadata["bounds"][1];
+		var longitudeLeft = mapMetadata["bounds"][0];
+		var longitudeRight = mapMetadata["bounds"][2];
+		
+		var mapZoomMin = mapMetadata["minzoom"];
+		var mapZoomMax = mapMetadata["maxzoom"];
+		
+		var latitudeCenter = (latitudeTop - latitudeBottom)/2 + latitudeBottom;
+		var longitudeCenter = (longitudeLeft - longitudeRight)/2 + longitudeRight;
+		var mapZoomStart = (mapZoomMax - mapZoomMin)/2 + mapZoomMin;
+		
+		var mapBounds = new L.LatLngBounds(
+				new L.LatLng(latitudeBottom, longitudeLeft),
+				new L.LatLng(latitudeTop, longitudeRight));
+		
+		if(GnuBoat.private.map == null){
+			// only initialize the map (viewport) once
+			GnuBoat.private.map = L.map('mapViewport');
+		}
+		GnuBoat.private.map.setView([latitudeCenter, longitudeCenter], mapZoomStart);
+		
+		if(GnuBoat.private.mapLayerCurrent != null){
+			GnuBoat.private.map.removeLayer(GnuBoat.private.mapLayerCurrent);
+			GnuBoat.private.mapLayerCurrent = null;
+		}
+		GnuBoat.private.mapLayerCurrent = L.tileLayer(mapMetadata["tiles"][0], {
+			minZoom: mapZoomMin, maxZoom: mapZoomMax,
+			bounds: mapBounds,
+			attribution: mapMetadata["name"],
+			opacity: 0.85
+			}).addTo(GnuBoat.private.map);
+	},
+	
+	mapInfos: function(data)
+	{
+		GnuBoat.private.mapsMetadata = data;
+		
+		$("#mapSelect").empty();
+		var selected = "selected";
+		data.forEach(function(value, index){
+			$("<option value=\""+ index.toString() +"\" "+ selected +">"+ value["name"] +"</option>").appendTo("#mapSelect");
+			selected = "";
+		});
+		
+		GnuBoat.private.mapSetup();
+		$("#mapSelect").change(function(){ mapSetup(); });
+	},
+};
Index: src/webapp/webclient/js/main.js
===================================================================
--- src/webapp/webclient/js/main.js	(revision df8c58afe1e5ad1030e6691c76819b58d843bed2)
+++ 	(revision )
@@ -1,262 +1,0 @@
-/*
-
-    Copyright (C) 2016 - 2017 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-    MA 02110-1301  USA.
-
-*/
-
-var map = null;
-var mapLayerCurrent = null;
-// var mapControl = null;
-var mapsMetadata = null;
-var polyline = null;
-
-function openLink(target)
-{
-	window.location=target;
-}
-
-function displayDataSet(data)
-{
-	if(!Array.isArray(data) && !(data instanceof Object)){
-		console.log("No data array returned!");
-		console.log(data);
-		return;
-        }
-	if(!("lastvalid" in data)){
-			console.log("No last valid values given!");
-	}
-	else{
-		var lastValid = data["lastvalid"];
-		var keys = ["speedthroughwater", "speedoverground", "waterdepth", "watertemperature", "gpsfix"];
-		for(var i = 0; i < keys.length; i++){
-			var key = keys[i];
-			var value = lastValid[key];
-			if($.isNumeric(value)){
-				var text = value.toFixed(1);
-				if(key == "watertemperature"){
-					text = value.toFixed(0);
-				}
-				$("#display #"+ keys[i] +" #value").text(text);
-			}
-			else if(key == "gpsfix"){
-				$("#display #"+ keys[i] +" #value").text(value);
-			}
-		}
-	}
-	
-	if(!("track" in data)){
-			console.log("No track given!");
-	}
-	else{
-		if(map == null){
-			console.log("No map in use");
-		}
-		else{
-			var track = data["track"];
-			var points = [];
-			for(var time in track){
-				points.push(new L.latLng(track[time]["latitude"], track[time]["longitude"]));
-			}
-			if(points.length > 0){
-				if(!polyline){
-					polyline = L.polyline(points, {color: 'red'}).addTo(map);
-				}
-				else{
-					polyline.setLatLngs(points);
-				}
-				map.fitBounds(polyline.getBounds());
-			}
-		}
-	}
-}
-
-function displayDataGet()
-{
-	var gnuboatApi = "../webservice/";
-	$.getJSON( gnuboatApi, displayDataSet);
-}
-
-function mapSetup()
-{
-	var mapMetadataIndex = $("#mapSelect").val();
-	if(mapsMetadata == null){
-		console.log("No mapsMetadata set");
-	}
-	if(mapMetadataIndex < 0 || mapMetadataIndex >= mapsMetadata.length){
-		console.log("Map metadata is outside of range :"+ mapMetadataIndex.toString());
-		console.log(mapsMetadata);
-		return;
-	}
-	var mapMetadata = mapsMetadata[mapMetadataIndex];
-	
-	var latitudeTop = mapMetadata["bounds"][3];
-	var latitudeBottom = mapMetadata["bounds"][1];
-	var longitudeLeft = mapMetadata["bounds"][0];
-	var longitudeRight = mapMetadata["bounds"][2];
-	
-	var mapZoomMin = mapMetadata["minzoom"];
-	var mapZoomMax = mapMetadata["maxzoom"];
-	
-	var latitudeCenter = (latitudeTop - latitudeBottom)/2 + latitudeBottom;
-	var longitudeCenter = (longitudeLeft - longitudeRight)/2 + longitudeRight;
-	var mapZoomStart = (mapZoomMax - mapZoomMin)/2 + mapZoomMin;
-	
-	var mapBounds = new L.LatLngBounds(
-              new L.LatLng(latitudeBottom, longitudeLeft),
-              new L.LatLng(latitudeTop, longitudeRight));
-	
-	if(map == null){
-		// only initialize the map (viewport) once
-		map = L.map('mapViewport');
-	}
-	map.setView([latitudeCenter, longitudeCenter], mapZoomStart);
-	
-	if(mapLayerCurrent != null){
-		map.removeLayer(mapLayerCurrent);
-		mapLayerCurrent = null;
-	}
-	mapLayerCurrent = L.tileLayer(mapMetadata["tiles"][0], {
-		minZoom: mapZoomMin, maxZoom: mapZoomMax,
-		bounds: mapBounds,
-		attribution: mapMetadata["name"],
-		opacity: 0.85
-		}).addTo(map);
-}
-
-function getMapInfos()
-{
-	$.getJSON("../webservice/tileserver.php?/index.json", mapInfos);
-}
-
-function mapInfos(data)
-{
-	mapsMetadata = data;
-	
-	$("#mapSelect").empty();
-	var selected = "selected";
-	data.forEach(function(value, index){
-		$("<option value=\""+ index.toString() +"\" "+ selected +">"+ value["name"] +"</option>").appendTo("#mapSelect");
-		selected = "";
-	});
-	
-	mapSetup();
-	$("#mapSelect").change(function(){ mapSetup(); });
-}
-
-function shutdown()
-{
-	$.getJSON("../webservice/?request=shutdown", function(data){
-		var shutdownTime = data["shutdownstart"];
-		var shutdownDate = Date.parse(shutdownTime);
-		var currentDate = new Date();
-		var shutdownHint = "Shutting down in "+ Math.floor((shutdownDate - currentDate)/1000) +"s at "+ shutdownTime.toLocaleString();
-		if(shutdownTime == -1){
-			shutdownHint = "Failed to initiate shutdown: "+ data["errormessage"];
-		}
-		$("#shutdownMessage").text(shutdownHint);
-	});
-	location.hash = "#shutdown";
-}
-
-function uploadMap(form)
-{
-	$("#mapFileInput").hide();
-	$("#mapTileUploadProgress").show();
-	$.ajax({
-		type: 'POST',
-		url: '../webservice/?request=map',
-		data: new FormData($("#mapTileUpload")[0]),
-		contentType: false,
-		processData: false,
-		success: function(data){
-			if(("error" in data) && data["error"] == 1){
-				alert("Failed to upload map: "+ data["errormessage"]);
-				$("#mapTileUploadProgress").hide();
-				$("#mapFileInput").show();
-				return;
-			}
-			alert("Map upload successfully");
-			$("#mapTileUploadProgress").hide();
-			$("#mapFileInput").show();
-			getMapInfos();
-		},
-		error: function(jqXHR, exception, errorThrown){
-			alert("Failed to upload map (XHR): "+ exception);
-			$("#mapTileUploadProgress").hide();
-			$("#mapFileInput").show();
-		}
-	}).progress(function(e){
-		$("#mapTileUploadProgress").attr({value: e.oloaded, max: e.total});
-	});
-}
-
-function logfilesLoad()
-{
-	$("#logfilesForm").empty();
-	$.getJSON("../webservice/?request=logfiles", function(data){
-		if(!Array.isArray(data) || data.length < 1){
-			$("<p>No Logfiles found!</p>").appendTo("#logfilesForm");
-			console.log(data);
-			return;
-		}
-		if(("error" in data) && data["error"] == 1){
-			alert("Failed to upload map: "+ data["errormessage"]);
-			$("#mapTileUploadProgress").hide();
-			$("#mapFileInput").show();
-			return;
-		}
-		$("<select id=\"logfilesSelect\" name=\"logfilesSelected[]\" class=\"pure-input-1\" multiple></select>").appendTo("#logfilesForm");
-		$("<input type=\"submit\" class=\"pure-button pure-button-primary\" name=\"logfilesDownload\" value=\"Download\"/>").appendTo("#logfilesForm");
-		data.forEach(function(value, index){
-			$("<option value=\""+ value +"\">"+ value +"</option>").appendTo("#logfilesSelect");
-		});
-	});
-}
-
-$(document).ready(function() {
-	$("#mapTileUploadProgress").hide();
-	$("#logfilesReload").click(logfilesLoad);
-	$("#shutdownButton").click(shutdown);
-
-	$("#mapTileUpload").validate({
-		rules: {
-			mapFile: {
-				required: true
-			},
-			mapName: {
-				required: true
-			}
-		},
-		submitHandler: function(form){
-			uploadMap(form);
-		}
-	});
-	
-	$("#logfilesForm").validate({
-		rules: {
-			logfilesSelect: {
-				required: true
-			},
-		}
-	});
-
-	getMapInfos();
-	displayDataGet();
-	setInterval(displayDataGet, 10000);
-	logfilesLoad();
-});
Index: src/webapp/webclient/js/side-menu.js
===================================================================
--- src/webapp/webclient/js/side-menu.js	(revision df8c58afe1e5ad1030e6691c76819b58d843bed2)
+++ 	(revision )
@@ -1,28 +1,0 @@
-var active = 'active';
-var layout = null;
-var menu = null;
-var menuLink = null;
-var content = null;
-
-function toggleAll() {
-	layout.toggleClass(active);
-	menu.toggleClass(active);
-	menuLink.toggleClass(active);
-}
-
-$(document).ready(function () {
-	layout   = $("#layout");
-	menu     = $("#menu");
-	menuLink = $("#menuLink");
-	content  = $("#main");
-
-	menuLink.click(function () {
-		toggleAll();
-	});
-
-	content.click(function() {
-		if (menu.hasClass(active)) {
-			toggleAll();
-		}
-	});
-});
