Index: /trunk/FACT++/www/smartfact/index.js
===================================================================
--- /trunk/FACT++/www/smartfact/index.js	(revision 14998)
+++ /trunk/FACT++/www/smartfact/index.js	(revision 14999)
@@ -213,5 +213,5 @@
     var inputs = document.getElementsByTagName("input");
 
-    var args = "start="+script+".dim";
+    var args = "start="+script+".js";
     for (var i=0; i<inputs.length; i++)
         args += "&"+inputs[i].name+"="+inputs[i].value;
@@ -248,6 +248,10 @@
     var title  = lines[0];
     var is_cmd = title[0]=='*';
+    var script = title.split('|');
     if (is_cmd)
-        title = title.substr(1);
+    {
+        title = script.length>=1 ? script[0].substr(1) : title.substr(1);
+        script = script.length>=1 ? script[1] : name;
+    }
 
     // ==================================================================
@@ -349,5 +353,5 @@
     if (is_cmd)
     {
-        sp1.onclick = function () { this.style.backgroundColor='rgba(0,0,0,0.77)'; submit(name); this.style.backgroundColor=''; };
+        sp1.onclick = function () { this.style.backgroundColor='rgba(0,0,0,0.77)'; submit(script); this.style.backgroundColor=''; };
     }
     else
@@ -434,5 +438,5 @@
     if (is_cmd)
     {
-        fdiv3.onclick = function () { this.style.backgroundColor='rgba(0,0,0,0.77)'; submit(name); this.style.backgroundColor=''; };
+        fdiv3.onclick = function () { this.style.backgroundColor='rgba(0,0,0,0.77)'; submit(script); this.style.backgroundColor=''; };
         fdiv3.setAttribute("style", "background-position:-109px 50%;");
     }
@@ -676,5 +680,23 @@
             }
         }
-        if (check.length==0 || (check[0]!="input" && check[0]!="select"))
+        if (check.length>0 && check[0]=="checkbox")
+        {
+            var opt = check[1].split('/');
+
+            var div = $new("div");
+            div.innerHTML = opt[0];
+            cell1.appendChild(div);
+
+            var input = $new("input");
+            input.type  = "checkbox";
+            input.name  = opt[1];
+            input.onclick = function() { this.value=this.checked; };
+            var c = opt.length>2 && opt[2]=="1";
+            input.checked = c;
+            input.value = c;
+
+            cell2.appendChild(input);
+        }
+        if (check.length==0 || (check[0]!="input" && check[0]!="select" && check[0]!="checkbox"))
         {
             var div = $new("div");
@@ -754,4 +776,5 @@
 
     table.pageName = name;//setAttribute("data-file", name);
+    table.counter = counter;
 
     // This is needed so that the page is extended in height
@@ -935,4 +958,5 @@
 
     var fname = $("table"+z).pageName;//getAttribute("data-file");
+    var counter = $("table"+z).counter;//getAttribute("data-file");
 
     var is_help = fname.substr(0,5)=="help-";
@@ -964,5 +988,5 @@
 //        }
 
-        if (xmlText.status!=200 && xmlText.status!=412)
+        if (counter>1 && xmlText.status!=200 && xmlText.status!=412)
         {
             alert("ERROR[2] - HTTP request '"+fname+".data': "+xmlText.statusText+" ["+xmlText.status+"]");
@@ -974,5 +998,5 @@
         {
             cycleCol($("ldot"+z));
-            update_text(fname, xmlText.responseText);
+            update_text(fname, counter>1 ? xmlText.responseText : undefined);
             doresize(z);
         }
@@ -993,13 +1017,15 @@
         return;
 
+    // ----------------------------------------------------
+    var now = new Date();
+
+    var ltime = $("localtime"+z);
+    setUTC(ltime, now);
+
+    if (!result)
+        return;
+
+    var rtime = $("reporttime"+z);
     var tokens = result.split('\n');
-
-    // ----------------------------------------------------
-
-    var rtime = $("reporttime"+z);
-    var ltime = $("localtime"+z);
-
-    var now = new Date();
-
     var header = tokens[0].split('\t');
 
@@ -1027,7 +1053,4 @@
 
     setUTC(rtime, stamp);
-    setUTC(ltime, now);
-
-    // ----------------------------------------------------
 
     $("warn"+z).style.display = header.length>=4 && header[3]=='1' ? "" : "none";
@@ -1035,4 +1058,6 @@
     if (header.length>=5)
         $("cmd"+z).style.backgroundColor = header[4]=='1' ? "darkgreen" : "darkred";
+
+    // ----------------------------------------------------
 
     if (header.length>=3 && $("body").sound)
