Index: trunk/FACT++/www/smartfact/index.js
===================================================================
--- trunk/FACT++/www/smartfact/index.js	(revision 13926)
+++ trunk/FACT++/www/smartfact/index.js	(revision 13927)
@@ -165,7 +165,7 @@
 function $txt(txt) { return document.createTextNode(txt); }
 function trim(str) { return str.replace("/^\s\s*/", '').replace("/\s\s*$/", ''); }
-function valid(str) { if (str===undefined) return false; if (str.length==0) return false; return true;}
+function valid(str) { if (!str) return false; if (str.length==0) return false; return true;}
 function isSliding() { var z = $("body").getAttribute("data-visible"); return $("table"+z) ? $("table"+z).offsetLeft!=0 : false; }
-function htmlDecode(input) { var e = $new('div'); e.innerHTML = input; return e.firstChild===undefined ? input : e.firstChild.nodeValue; }
+function htmlDecode(input) { var e = $new('div'); e.innerHTML = input; return e.firstChild ? e.firstChild.nodeValue : input; }
 function setUTC(el, time) { var str = time.toUTCString(); var utc = str.substr(str.length-12, 8); el.innerHTML = "&#8226;&nbsp;"+utc+"&nbsp;UTC&nbsp;&#8226;"; }
 
@@ -811,5 +811,5 @@
     var img  = $("image"+z);
     var canv = $("canvas"+z);
-    if (img === undefined || canv === undefined)
+    if (!img || !canv)
         return;
 
@@ -1079,9 +1079,9 @@
 
         var e = $("data"+z+"-"+line);
-        if (e === undefined)
+        if (!e)
             continue;
 
         var form = e.getAttribute("data-form");
-        if (form===undefined)
+        if (!form)
             continue;
 
@@ -1498,5 +1498,5 @@
     var z = $("body").getAttribute("data-visible");
     var canv = $("canvas"+z);
-    if (canv === undefined)
+    if (!canv)
         return;
 
