{
             /* document may be undefined for frames out of the same origin */
             /* policy and will break the whole code - so we check this before */
-            if (typeof(win.document) === 'undefined') {
+            if (win.document === undefined) {
                 return;
             }
             var doc = win.document;
     {
         var i = _getHintIdByNum(focusNum);
 
-        if (typeof(hints[i + 1]) !== "undefined") {
+        if (hints[i + 1] !== undefined) {
             return _focus(hints[i + 1].num);
         }
         return _focus(hints[0].num);
     this.focusPrev = function()
     {
         var i = _getHintIdByNum(focusNum);
-        if (i !== 0 && typeof(hints[i - 1].num) !== "undefined") {
+        if (i !== 0 && hints[i - 1].num !== undefined) {
             return _focus(hints[i - 1].num);
         }
         return _focus(hints[hints.length - 1].num);
     function _getXpath(s)
     {
         var x, l;
-        if (typeof(s) === "undefined") {
+        if (s === undefined) {
             s = "";
         }
         switch (mode) {