Index: trunk/FACT++/www/viewer/index.php
===================================================================
--- trunk/FACT++/www/viewer/index.php	(revision 17788)
+++ trunk/FACT++/www/viewer/index.php	(revision 17789)
@@ -193,4 +193,7 @@
 
 $fil['runType']       = trim(fread($file, 80));
+if (feof($file))
+   return header('HTTP/1.0 400 Data not available.');
+
 $fil['runStart']      = get($file, "d");
 $fil['runEnd']        = get($file, "d");
@@ -328,12 +331,15 @@
     // 376, 720, 91.75 MiB
 
-    $rc['startJs'] = microtime(true);
-    $rc['timeJS']  = array();
+    $internal = file_get_contents("internal.js");
 
     // Buffer output from javascript
     ob_start();
 
+    $rc['timeJS']  = array();
+    $rc['startJs'] = microtime(true);
+
     try
     {
+        $v8->executeString($internal, 'internal.js');
 
         // We unpack the data pixel by pixel and copy the array directly to the
@@ -371,17 +377,13 @@
     }
 
+    $rc['timeJs'][2]  = (microtime(true) - $rc['startJs']);
+
     // Copy output buffer and clean it
     $rc['debug'] = ob_get_contents();
     ob_end_clean();
-
-    // Get execution times
-    $now = microtime(true);
-
-    $rc['timeJs'][2]  = ($now - $rc['startJs']);
-}
-
-$rc['timePhp'] = ($now - $rc['startPhp']);
-
-$rc['memory'] = memory_get_peak_usage(true)/1024/1024;
+}
+
+$rc['memory']  = memory_get_peak_usage(true)/1024/1024;
+$rc['timePhp'] = (microtime(true) - $rc['startPhp']);
 
 //unset($rc['neighbors']);
