includes/clientside/static/functions.js
changeset 869 58bc29c14a4d
parent 832 7152ca0a0ce9
child 906 c949e82b8f49
--- a/includes/clientside/static/functions.js	Sun Mar 15 11:15:16 2009 -0400
+++ b/includes/clientside/static/functions.js	Wed Mar 18 11:35:28 2009 -0400
@@ -598,7 +598,7 @@
     domOpacity(object, opacStart, opacEnd, millisec);
 }
 
-var opacityDOMCache = new Object();
+var opacityDOMCache = {};
 function domOpacity(obj, opacStart, opacEnd, millisec) {
     //speed for each frame
     var speed = Math.round(millisec / 100);
@@ -611,19 +611,24 @@
     //determine the direction for the blending, if start and end are the same nothing happens
     if(opacStart > opacEnd) {
         for(i = opacStart; i >= opacEnd; i--) {
-            setTimeout("var obj = opacityDOMCache["+uniqid+"]; domObjChangeOpac(" + i + ",obj)",(timer * speed));
+            setTimeout("if ( opacityDOMCache["+uniqid+"] ) { var obj = opacityDOMCache["+uniqid+"]; domObjChangeOpac(" + i + ",obj) }",(timer * speed));
             timer++;
         }
     } else if(opacStart < opacEnd) {
         for(i = opacStart; i <= opacEnd; i++)
             {
-            setTimeout("var obj = opacityDOMCache["+uniqid+"]; domObjChangeOpac(" + i + ",obj)",(timer * speed));
+            setTimeout("if ( opacityDOMCache["+uniqid+"] ) { var obj = opacityDOMCache["+uniqid+"]; domObjChangeOpac(" + i + ",obj); }",(timer * speed));
             timer++;
         }
     }
     setTimeout("delete(opacityDOMCache["+uniqid+"]);",(timer * speed));
 }
 
+function abortFades()
+{
+  opacityDOMCache = {};
+}
+
 // change the opacity for different browsers
 function changeOpac(opacity, id)
 {