Index: /trunk/FACT++/www/smartfact/index.js
===================================================================
--- /trunk/FACT++/www/smartfact/index.js	(revision 13876)
+++ /trunk/FACT++/www/smartfact/index.js	(revision 13877)
@@ -404,4 +404,10 @@
     hhtr.appendChild(htd2);
 
+    htd0.style.verticalAlign = "middle";
+    htd1.style.verticalAlign = "middle";
+    htd2.style.verticalAlign = "middle";
+    htd3.style.verticalAlign = "middle";
+    htd4.style.verticalAlign = "middle";
+
     var div1 = document.createElement("div");
     var div2 = document.createElement("div");
@@ -481,15 +487,55 @@
     ftd.appendChild(ftab);
 
+    var ftdH = document.createElement("td");
     var ftd0 = document.createElement("td");
     var ftd1 = document.createElement("td");
-
+    var ftd2 = document.createElement("td");
+    var ftd3 = document.createElement("td");
+    ftdH.setAttribute("width", "1px");
+    ftd2.setAttribute("width", "1px");
+    ftd3.setAttribute("width", "1px");
+
+    ftdH.style.verticalAlign = "middle";
+    ftd0.style.verticalAlign = "middle";
+    ftd1.style.verticalAlign = "middle";
+    ftd2.style.verticalAlign = "middle";
+    ftd3.style.verticalAlign = "middle";
+
+    ftdH.setAttribute("class", "tcell1");
     ftd0.setAttribute("class", "tcell1");
     ftd1.setAttribute("class", "tcell2");
-
+    ftd2.setAttribute("class", "tcell2");
+    ftd3.setAttribute("class", "tcell2");
+
+    ftab.appendChild(ftdH);
     ftab.appendChild(ftd0);
     ftab.appendChild(ftd1);
-
+    ftab.appendChild(ftd2);
+    ftab.appendChild(ftd3);
+
+    var fdivH = document.createElement("div");
     var fdiv0 = document.createElement("span");
     var fdiv1 = document.createElement("span");
+    var fdiv2 = document.createElement("div");
+    var fdiv3 = document.createElement("div");
+    ftd0.style.paddingLeft = "5px";
+
+    fdivH.setAttribute("class", "icon_white");
+    fdiv2.setAttribute("class", "icon_white");
+    fdiv3.setAttribute("class", "icon_white");
+    fdivH.setAttribute("style", "background-position:-611px 50%;");
+    fdiv2.setAttribute("style", "background-position:-72px 50%;");
+    fdivH.onclick = function() { this.style.backgroundColor='rgba(0,0,0,0.77)'; loadPage('help-'+name, z, +1); }
+    fdiv2.onclick = function() { this.style.backgroundColor='rgba(0,0,0,0.77)'; sendCommand('stop'); this.style.backgroundColor=''; }
+    if (is_cmd)
+    {
+        fdiv3.onclick = function() { this.style.backgroundColor='rgba(0,0,0,0.77)'; submit(name); this.style.backgroundColor=''; }
+        fdiv3.setAttribute("style", "background-position:-109px 50%;");
+    }
+    else
+    {
+        fdiv3.onclick = function() { this.style.backgroundColor='rgba(0,0,0,0.77)'; loadPage('control', z,  +1); }
+        fdiv3.setAttribute("style", "background-position:-288px 50%;");
+    }
 
     fdiv0.setAttribute("style", "font-size:large;");
@@ -500,6 +546,10 @@
     fdiv1.appendChild(document.createTextNode("loading..."));
 
+    ftdH.appendChild(fdivH);
     ftd0.appendChild(fdiv0);
     ftd1.appendChild(fdiv1);
+    ftd2.appendChild(fdiv2);
+    if (name!='control')
+        ftd3.appendChild(fdiv3);
 
     $("body").appendChild(table);
@@ -910,34 +960,4 @@
 }
 
-function strike(e, status)
-{
-    if (!e)
-        return;
-
-    if (!status)
-        e.style.textDecoration="line-through";
-    else
-        e.style.textDecoration="";
-}
-
-/*
-function gray(id, str)
-{
-    var e = $(id);
-    if (!e)
-        return;
-
-    if (valid(str))
-    {
-        e.style.color="#000";
-        e.style.textDecoration="";
-    }
-    else
-    {
-        e.style.color="#daa";
-        e.style.textDecoration="line-through";
-    }
-}
-*/
 var date0 = null;
 
@@ -954,34 +974,43 @@
     // ----------------------------------------------------
 
-    var  time = $("reporttime"+z);
+    var rtime = $("reporttime"+z);
     var ltime = $("localtime"+z);
 
-    var date1 = new Date();
+    var now = new Date();
 
     var header = tokens[0].split('\t');
 
-    // File corrupted /should we remove the date?)
-    if (header.length!=2 && header.length!=1 && header[0].length!=13)
-    {
-        if (date0 != null)
-            strike(time, date0.getTime()+60000>date1.getTime());
-        return;
-    }
-
-    var date2 = new Date();
-    date2.setTime(header[0]);
-
-    $("warn"+z).style.display = header.length!=2 || header[1]=='0' ? "none" : "";
-
-    strike(time, date2.getTime()+60000>date1.getTime());
-
-    date0 = date2;
-
-    var utc = date0.toUTCString();
-
-    time.innerHTML =
-        "&#8226;&nbsp;"+utc.substr(utc.length-12, 8)+"&nbsp;UTC&nbsp;&#8226;"
-    ltime.innerHTML =
-        "&#8226;&nbsp;"+date1.toLocaleString()+"&nbsp;&#8226;";
+    // File corrupted / should we remove the date?)
+    if (header.length!=3 && header.length!=2 && header.length!=1 && header[0].length!=13)
+    {
+        // we ignore corrupted files for one minute
+        if (date0==null || date0.getTime()+60000<now.getTime())
+            rtime.style.color = "darkred";
+
+        return;
+    }
+
+    // File OK
+    date0 = now;
+
+    var stamp = new Date();
+    stamp.setTime(header[0]);
+
+    // File older than 1min
+    if (stamp.getTime()+60000<now.getTime())
+        rtime.style.color = "darkred";
+    else
+        rtime.style.color = "";
+
+    var str_file = stamp.toUTCString();
+    var str_now  = now.toUTCString();
+
+    var utc_file = str_file.substr(str_file.length-12, 8);
+    var utc_now  = str_now.substr(str_now.length-12, 8);
+
+    rtime.innerHTML = "&#8226;&nbsp;"+utc_file+"&nbsp;UTC&nbsp;&#8226;"
+    ltime.innerHTML = "&#8226;&nbsp;"+utc_now +"&nbsp;UTC&nbsp;&#8226;";
+
+    $("warn"+z).style.display = header.length<2 || header[1]=='0' ? "none" : "";
 
     // ----------------------------------------------------
@@ -1312,7 +1341,7 @@
     ctx.strokeStyle  = "#000";
 
-    ctx.strokeText(min, 5+mw, 5);
+    ctx.strokeText(min, 5+mw, 5+24);
     ctx.strokeText(med, 5+mw, 5+12);
-    ctx.strokeText(max, 5+mw, 5+24);
+    ctx.strokeText(max, 5+mw, 5);
 }
 
