+ fs.classList.add("hidden");
+ }
+}
+
+function toggleFullscreen() {
+ if ((document.fullScreenElement && document.fullScreenElement !== null) ||
+ (document.mozFullScreenElement && document.mozFullScreenElement !== null) ||
+ (document.webkitFullScreenElement && document.webkitFullScreenElement !== null)) {
+ if (document.cancelFullScreen) {
+ document.cancelFullScreen();
+ } else if (document.mozCancelFullScreen) {
+ document.mozCancelFullScreen();
+ } else if (document.webkitCancelFullScreen) {
+ document.webkitCancelFullScreen();
+ }
+ }
+ else {
+ var elem = document.getElementById("body");
+ if (elem.requestFullScreen) {
+ elem.requestFullScreen();
+ } else if (elem.mozRequestFullScreen) {
+ elem.mozRequestFullScreen();
+ } else if (elem.webkitRequestFullScreen) {
+ elem.webkitRequestFullScreen();
+ }
+ }
+}
+
+function showUploadDialog() {
+ var dia = document.getElementById("trackDialogArea");
+ var areas = dia.children;
+ for (var i = 0; i <= areas.length - 1; i++) {
+ areas[i].style.display = "none";
+ }
+ document.getElementById("uploadDialog").style.display = "block";
+ document.getElementById("uploadTrackButton").disabled = true;
+ dia.classList.remove("hidden");
+}
+
+function cancelTrackDialog() {
+ document.getElementById("trackDialogArea").classList.add("hidden");
+ document.getElementById("uploadTrackButton").disabled = false;
+}
+
+function showGLWarningDialog() {
+ var dia = document.getElementById("dialogArea");
+ var areas = dia.children;
+ for (var i = 0; i <= areas.length - 1; i++) {
+ areas[i].style.display = "none";
+ }
+ document.getElementById("noGLwarning").style.display = "block";
+ dia.classList.remove("hidden");
+}
+
+function showDBErrorDialog() {
+ var dia = document.getElementById("dialogArea");
+ var areas = dia.children;
+ for (var i = 0; i <= areas.length - 1; i++) {
+ areas[i].style.display = "none";
+ }
+ document.getElementById("DBError").style.display = "block";
+ dia.classList.remove("hidden");
+}
+
+function showFirstRunDialog() {
+ var dia = document.getElementById("dialogArea");
+ var areas = dia.children;
+ for (var i = 0; i <= areas.length - 1; i++) {
+ areas[i].style.display = "none";
+ }
+ document.getElementById("firstRunIntro").style.display = "block";
+ dia.classList.remove("hidden");
+}
+
+function closeDialog() {
+ document.getElementById("dialogArea").classList.add("hidden");
+}
+
+function showInfoDialog() {
+ var dia = document.getElementById("dialogArea");
+ var areas = dia.children;
+ for (var i = 0; i <= areas.length - 1; i++) {
+ areas[i].style.display = "none";
+ }
+ document.getElementById("infoDialog").style.display = "block";
+ dia.classList.remove("hidden");
+}
+
+var uiEvHandler = {
+ handleEvent: function(aEvent) {
+ var touchEvent = aEvent.type.indexOf('touch') != -1;
+
+ switch (aEvent.type) {
+ case "mousedown":
+ case "touchstart":
+ case "mousemove":
+ case "touchmove":
+ case "mouseup":
+ case "touchend":
+ case "keydown":
+ showUI();
+ break;
+ }
+ }
+};
+
+function setUploadField(aField) {
+ switch (aField.id) {
+ case "uploadDevName":
+ gPrefs.set("devicename", aField.value);
+ break;