Index: /trunk/FACT++/www/viewer/index.js
===================================================================
--- /trunk/FACT++/www/viewer/index.js	(revision 17809)
+++ /trunk/FACT++/www/viewer/index.js	(revision 17810)
@@ -470,6 +470,4 @@
     }
 
-    canv.hillas = Hillas(canv.dataAbs);
-
     canv.min = Math.min.apply(Math, canv.dataAbs.filter(function(e){return !isNaN(e)}));
     canv.max = Math.max.apply(Math, canv.dataAbs.filter(function(e){return !isNaN(e)}));
@@ -1359,29 +1357,32 @@
     // ======================= Draw Ellipse ======================
 
-    var h = canv.hillas;
-    if (h && document.getElementById('image').checked)
-    {
-        ctx.save();
-
-        ctx.translate(h.mean[0], h.mean[1]);
-        ctx.rotate(h.phi);
-
-        ctx.save();
-        ctx.scale(h.axis[0], h.axis[1]);
-        ctx.beginPath();
-        ctx.arc(0, 0, 1, 0, 2*Math.PI);
-        ctx.restore();
-
-        ctx.lineWidth = 0.15;
-        ctx.strokeStyle = "#444";
-        ctx.stroke();
-
-        ctx.strokeStyle = "#888";
-        ctx.beginPath();
-        ctx.moveTo(0, -h.disp);
-        ctx.lineTo(0,  h.disp);
-        ctx.stroke();
-
-        ctx.restore();
+    if (document.getElementById('image').checked)
+    {
+        var h = Hillas(canv.dataAbs, canv.zmin);
+        if (h)
+        {
+            ctx.save();
+
+            ctx.translate(h.mean[0], h.mean[1]);
+            ctx.rotate(h.phi);
+
+            ctx.save();
+            ctx.scale(h.axis[0], h.axis[1]);
+            ctx.beginPath();
+            ctx.arc(0, 0, 1, 0, 2*Math.PI);
+            ctx.restore();
+
+            ctx.lineWidth = 0.15;
+            ctx.strokeStyle = "#555";
+            ctx.stroke();
+
+            ctx.strokeStyle = "#888";
+            ctx.beginPath();
+            ctx.moveTo(0, -h.disp);
+            ctx.lineTo(0,  h.disp);
+            ctx.stroke();
+
+            ctx.restore();
+        }
     }
 
@@ -1426,5 +1427,5 @@
 // ===================================================================
 
-function Hillas(data)
+function Hillas(data, min)
 {
     var mx = 0;
@@ -1439,5 +1440,5 @@
     for (var i=0; i<1440; i++)
     {
-        if (data[i]===undefined)
+        if (data[i]===undefined || data[i]<min)
             continue;
 
