includes/clientside/static/functions.js
changeset 869 58bc29c14a4d
parent 832 7152ca0a0ce9
child 906 c949e82b8f49
equal deleted inserted replaced
868:75dcd8cf6232 869:58bc29c14a4d
   596 {
   596 {
   597     var object = document.getElementById(id);
   597     var object = document.getElementById(id);
   598     domOpacity(object, opacStart, opacEnd, millisec);
   598     domOpacity(object, opacStart, opacEnd, millisec);
   599 }
   599 }
   600 
   600 
   601 var opacityDOMCache = new Object();
   601 var opacityDOMCache = {};
   602 function domOpacity(obj, opacStart, opacEnd, millisec) {
   602 function domOpacity(obj, opacStart, opacEnd, millisec) {
   603     //speed for each frame
   603     //speed for each frame
   604     var speed = Math.round(millisec / 100);
   604     var speed = Math.round(millisec / 100);
   605     var timer = 0;
   605     var timer = 0;
   606     
   606     
   609     opacityDOMCache[uniqid] = obj;
   609     opacityDOMCache[uniqid] = obj;
   610 
   610 
   611     //determine the direction for the blending, if start and end are the same nothing happens
   611     //determine the direction for the blending, if start and end are the same nothing happens
   612     if(opacStart > opacEnd) {
   612     if(opacStart > opacEnd) {
   613         for(i = opacStart; i >= opacEnd; i--) {
   613         for(i = opacStart; i >= opacEnd; i--) {
   614             setTimeout("var obj = opacityDOMCache["+uniqid+"]; domObjChangeOpac(" + i + ",obj)",(timer * speed));
   614             setTimeout("if ( opacityDOMCache["+uniqid+"] ) { var obj = opacityDOMCache["+uniqid+"]; domObjChangeOpac(" + i + ",obj) }",(timer * speed));
   615             timer++;
   615             timer++;
   616         }
   616         }
   617     } else if(opacStart < opacEnd) {
   617     } else if(opacStart < opacEnd) {
   618         for(i = opacStart; i <= opacEnd; i++)
   618         for(i = opacStart; i <= opacEnd; i++)
   619             {
   619             {
   620             setTimeout("var obj = opacityDOMCache["+uniqid+"]; domObjChangeOpac(" + i + ",obj)",(timer * speed));
   620             setTimeout("if ( opacityDOMCache["+uniqid+"] ) { var obj = opacityDOMCache["+uniqid+"]; domObjChangeOpac(" + i + ",obj); }",(timer * speed));
   621             timer++;
   621             timer++;
   622         }
   622         }
   623     }
   623     }
   624     setTimeout("delete(opacityDOMCache["+uniqid+"]);",(timer * speed));
   624     setTimeout("delete(opacityDOMCache["+uniqid+"]);",(timer * speed));
       
   625 }
       
   626 
       
   627 function abortFades()
       
   628 {
       
   629   opacityDOMCache = {};
   625 }
   630 }
   626 
   631 
   627 // change the opacity for different browsers
   632 // change the opacity for different browsers
   628 function changeOpac(opacity, id)
   633 function changeOpac(opacity, id)
   629 {
   634 {