Index: trunk/FACT++/www/index.js
===================================================================
--- trunk/FACT++/www/index.js	(revision 13677)
+++ trunk/FACT++/www/index.js	(revision 13678)
@@ -279,4 +279,18 @@
 
 
+function submit(script)
+{
+    var inputs = document.getElementsByTagName("input");
+
+    var args = "start="+script;
+    for (var i=0; i<inputs.length; i++)
+        args += "&"+inputs[i].name+"="+inputs[i].value;
+
+    alert(args);
+
+    sendCommand(args);
+
+}
+
 function buildPage(name, text, oldz, dz)
 {
@@ -292,4 +306,12 @@
         return;
     }
+
+    if (lines[0].length==0)
+    {
+        alert("buildPage - title missing");
+        return;
+    }
+
+    var title = lines[0].split('/');
 
     var table = $("table"+z);
@@ -301,8 +323,8 @@
     table.id = "table"+z;
     table.border = 0;
-    table.cellspacing = 0;
-    table.cellpadding = "6px";
+    table.cellSpacing = 0;
+    table.cellPadding = "0px";
     table.width = "100%";
-    table.setAttribute("style",       "overflow:hidden;position:fixed;top:0px;left:"+window.innerWidth+"px;");
+    table.setAttribute("style", "overflow:hidden;position:fixed;top:0px;left:"+window.innerWidth+"px;");
 
     // -----------------------------------------------------
@@ -346,15 +368,13 @@
     hhtr.appendChild(htd2);
 
-    var div0 = document.createElement("div");
     var div1 = document.createElement("div");
     var div2 = document.createElement("div");
     var div3 = document.createElement("div");
-    div0.setAttribute("style", "font-size:x-large;");
     div2.setAttribute("class", "icon_white");
-    div2.setAttribute("onclick","this.style.backgroundColor='rgba(0,0,0,0.77)'; loadPage('"+fname+"',"+z+","+(-dz)+");");
+    div3.setAttribute("class", "icon_white");
     div2.setAttribute("style", "background-position:-396px 50%;");
-    div3.setAttribute("class", "icon_white");
-    div3.setAttribute("onclick","this.style.backgroundColor='rgba(0,0,0,0.77)'; loadPage('fact',"+z+","+(-z)+");");
     div3.setAttribute("style", "background-position:-575px 50%;");
+    div3.onclick = function() { this.style.backgroundColor='rgba(0,0,0,0.77)'; loadPage('fact', z, -z); }
+    div2.onclick = function() { this.style.backgroundColor='rgba(0,0,0,0.77)'; loadPage(fname, z, -dz); }
 
     var sp0 = document.createElement("span");
@@ -364,13 +384,12 @@
     sp1.id = "title"+z;
     sp2.id = "rdot" +z;
+    sp1.setAttribute("style", "font-size:large;");
     sp0.setAttribute("data-color", "3");
     sp2.setAttribute("data-color", "3");
     sp0.appendChild(document.createTextNode(" \u2022 "));
-    sp1.appendChild(document.createTextNode(lines[0]));
+    sp1.appendChild(document.createTextNode(title[0]));
     sp2.appendChild(document.createTextNode(" \u2022 "));
-
-    div0.appendChild(sp0);
-    div0.appendChild(sp1);
-    div0.appendChild(sp2);
+    if (title[1]!=undefined)
+        sp1.onclick = function() { submit(title[1]); }
 
     div1.setAttribute("style", "font-size:small;");
@@ -378,5 +397,8 @@
     div1.appendChild(document.createTextNode("---"));
 
-    htd0.appendChild(div0);
+    htd0.appendChild(sp0);
+    htd0.appendChild(sp1);
+    htd0.appendChild(sp2);
+
     htd1.appendChild(div1);
     if (dz!=0/* && z+dz!=0*/)
@@ -417,8 +439,8 @@
     ftab.appendChild(ftd1);
 
-    var fdiv0 = document.createElement("div");
-    var fdiv1 = document.createElement("div");
-
-    fdiv0.setAttribute("style", "font-size:x-large;");
+    var fdiv0 = document.createElement("span");
+    var fdiv1 = document.createElement("span");
+
+    fdiv0.setAttribute("style", "font-size:large;");
     fdiv1.setAttribute("style", "font-size:small;");
     fdiv1.id = "localtime"+z;
@@ -487,8 +509,7 @@
         tr.setAttribute("class", "row");
         if (valid(cols[0]))
-            tr.setAttribute("onclick", "this.style.background='#ccb'; loadPage('"+cols[0]+"',"+z+",-1);");
+            tr.setAttribute("onclick", "this.style.background='#ccb'; loadPage('"+cols[0]+"', "+z+", -1);");
         if (valid(cols[3]))
-            tr.setAttribute("onclick", "this.style.background='#ccb'; loadPage('"+cols[3]+"',"+z+",+1);");
-        //tr.setAttribute("id",    cols[0]+"_row");
+            tr.setAttribute("onclick", "this.style.background='#ccb'; loadPage('"+cols[3]+"', "+z+", +1);");
 
         var td0 = document.createElement("td");
@@ -529,12 +550,40 @@
         var cell1 = document.createElement("td");
         cell1.setAttribute("class", "tcell1");
-        //cell1.setAttribute("id",    cols[0]+"_title");
-        cell1.appendChild(document.createTextNode(cols[1]));
 
         var cell2 = document.createElement("td");
-        cell2.id = "data"+counter;
         cell2.setAttribute("class", "tcell2");
-        cell2.setAttribute("data-form",  cols[2]);
-        cell2.appendChild(document.createTextNode("---"));
+
+        if (check.length==0 || check[0]!="input")
+        {
+            cell1.appendChild(document.createTextNode(cols[1]));
+
+            if (cols.length>2 && cols[2].length>0)
+            {
+                cell2.id = "data"+counter;
+                cell2.setAttribute("data-form",  cols[2]);
+                cell2.appendChild(document.createTextNode("---"));
+                counter++;
+            }
+            else
+                cell1.setAttribute("class", "description");
+        }
+        else
+        {
+            var opt = check[1].split('/');
+
+            if (opt.length<2)
+                alert("Argument name missing for'"+check[1]+"'");
+
+            cell1.appendChild(document.createTextNode(opt[0]));
+
+            var input = document.createElement("input");
+            input.name = opt[1];
+            input.type = "text";
+            input.maxlength = 80;
+            if (opt.length>2)
+                input.value=opt[2];
+
+            cell2.appendChild(input);
+        }
 
         innertr.appendChild(cell1);
@@ -542,8 +591,30 @@
 
         tbody.appendChild(tr);
-
-        counter++;
-    }
-
+    }
+/*
+    if (true)
+    {
+        tr = document.createElement("tr");
+        tr.setAttribute("class", "row");
+
+        td = document.createElement("td");
+        td.colSpan = "3";
+        tr.appendChild(td);
+
+        var sp = document.createElement("div");
+        sp.setAttribute("class", "icon_color");
+        sp.setAttribute("style", "background-position: -144px -14px;");
+        td.appendChild(sp);
+
+        sp = document.createElement("div");
+        sp.setAttribute("class", "icon_color");
+        sp.setAttribute("style", "background-position: -56px -14px;");
+        td.appendChild(sp);
+
+        tr.appendChild(td);
+
+        tbody.appendChild(tr);
+    }
+*/
     // ---------------------------------------
     if (debug == true)
@@ -829,4 +900,7 @@
     {
         if (tokens[line].length==0)
+            continue;
+
+        if (tbody.rows[line-1]==undefined)
             continue;
 
