/*Gradual-Highlight Image Script II- By J. Mark Birenbaum (birenbau@ugrad.cs.ualberta.ca)Permission granted to Dynamicdrive.com to feature script in archiveFor full source to script, visit http://dynamicdrive.comModified here by jscheuer1 in http://dynamicdrive.com/forums/to work with Mozilla and other opacity compliant browsersin addition to the original IE functionality*/nereidFadeObjects = new Object();nereidFadeTimers = new Object();/* object - image to be faded (actual object, not name); * destop - destination transparency level, use 0 to 99 (ie 80, for mostly solid, set no higher than 99) * rate - time in milliseconds between trasparency changes (best under 100) * delta- amount of change each time (ie 5, for 5% change in transparency) */ function sourceNum(obj) {if ((document.documentElement.sourceIndex*1)+1)return obj.sourceIndex;else if (document.getElementsByTagName)var order=document.getElementsByTagName('*');for (var i_tem = 0; i_tem < order.length; i_tem++)if (order[i_tem]==obj)return i_tem;}function nereidFade(object, destOp, rate, delta){if (object.toString().indexOf('object') == -1){/* do this so I can take a string too */setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0);return;}if (!(object.filters||typeof object.style.MozOpacity=='string'||typeof object.style.opacity=='string'))return;var objOpac=object.filters? object.filters.alpha.opacity : typeof object.style.MozOpacity=='string'? object.style.MozOpacity*100 : typeof object.style.opacity=='string'? object.style.opacity*100 : null;clearTimeout(nereidFadeTimers[sourceNum(object)]);diff = destOp-objOpac;direction = 1;if (objOpac!==null&&objOpac > destOp){direction = -1;}delta=Math.min(direction*diff,delta);if (object.filters)object.filters.alpha.opacity+=direction*delta;else if (typeof object.style.MozOpacity=='string')object.style.MozOpacity=(object.style.MozOpacity*1)+(direction*delta/100);else if (typeof object.style.opacity=='string')object.style.opacity=(object.style.opacity*1)+(direction*delta/100);objOpac=object.filters? object.filters.alpha.opacity : typeof object.style.MozOpacity=='string'? object.style.MozOpacity*100 : typeof object.style.opacity=='string'? object.style.opacity*100 : null;if (objOpac!==null&&objOpac != destOp){nereidFadeObjects[sourceNum(object)]=object;nereidFadeTimers[sourceNum(object)]=setTimeout("nereidFade(nereidFadeObjects["+sourceNum(object)+"],"+destOp+","+rate+","+delta+")",rate);}}
