Index: /trunk/FACT++/www/index.js
===================================================================
--- /trunk/FACT++/www/index.js	(revision 13641)
+++ /trunk/FACT++/www/index.js	(revision 13642)
@@ -513,17 +513,17 @@
 
     // ---------------------------------------
-
-    tr = document.createElement("tr");
-    tr.setAttribute("class", "row");
-
     if (debug == true)
     {
+
+        tr = document.createElement("tr");
+        tr.setAttribute("class", "row");
+
         td = document.createElement("td");
         td.setAttribute("id", "debug"+z);
         td.setAttribute("colspan", "3");
         tr.appendChild(td);
-    }
-
-    tbody.appendChild(tr);
+
+        tbody.appendChild(tr);
+    }
 
     // ---------------------------------------
@@ -533,5 +533,5 @@
 }
 
-function doresize(z)
+function resizeimpl(z, cnt)
 {
     // 393 / 482    488/482 / 200   200+482-488
@@ -548,4 +548,6 @@
     var H = window.innerHeight;
 
+    var x = parseInt(img.style.height, 10);
+
     var ih = H - h + parseInt(img.style.height, 10);
 
@@ -555,4 +557,14 @@
     canv.width  = W;
     canv.height = ih;
+
+    if ($("table"+z).offsetHeight == H || cnt==2)
+        return;
+
+    resizeimpl(z, ++cnt);
+}
+
+function doresize(z)
+{
+    resizeimpl(z, 0);
 
     // ------ debug -----
