From ba3a2ba015feeb0eff7ffa3cebca638bb7c65bf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Chapeaux?= Date: Sun, 17 Jun 2001 18:11:54 +0000 Subject: [PATCH] optimized again the code for NS4+ --- left.js | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/left.js b/left.js index 64de0a4d0..2f363a6b3 100644 --- a/left.js +++ b/left.js @@ -81,10 +81,10 @@ if (isIE4) { */ function nsGetIndex(el) { var ind = null; - var layersCnt = document.layers.length; + var theLayers = document.layers; + var layersCnt = theLayers.length; for (var i = 0; i < layersCnt; i++) { - var whichEl = document.layers[i]; - if (whichEl.id == el) { + if (theLayers[i].id == el) { ind = i; break; } @@ -100,13 +100,13 @@ function nsGetIndex(el) { */ function nsArrangeList() { if (firstInd != null) { - var nextY = document.layers[firstInd].pageY + document.layers[firstInd].document.height; - var layersCnt = document.layers.length; + var theLayers = document.layers; + var layersCnt = theLayers.length; + var nextY = theLayers[firstInd].pageY + theLayers[firstInd].document.height; for (var i = firstInd + 1; i < layersCnt; i++) { - var whichEl = document.layers[i]; - if (whichEl.visibility != 'hide') { - whichEl.pageY = nextY; - nextY += whichEl.document.height; + if (theLayers[i].visibility != 'hide') { + theLayers[i].pageY = nextY; + nextY += theLayers[i].document.height; } } } @@ -119,10 +119,10 @@ function nsArrangeList() { * @access public */ function nsShowAll() { - var layersCnt = document.layers.length; + var theLayers = document.layers; + var layersCnt = theLayers.length; for (i = firstInd; i < layersCnt; i++) { - whichEl = document.layers[i]; - whichEl.visibility = 'show'; + theLayers[i].visibility = 'show'; } } // end of the 'nsShowAll()' function @@ -154,13 +154,13 @@ function initIt() } } // end of the IE4 case else if (isNS4) { - var layersCnt = document.layers.length; - for (var i=0; i