<!--
//http://www.dynamicdrive.com/dynamicindex4/highlightgrad2.htm

/*
Gradual-Highlight Image Script II- 
By J. Mark Birenbaum (birenbau@ugrad.cs.ualberta.ca)
Permission granted to Dynamicdrive.com to feature script in archive
For full source to script, visit http://dynamicdrive.com
*/

// <img style="filter:alpha(opacity=10)" onmouseover="img_fade(this,100,30,5)" onmouseout="img_fade(this,10,50,5)" />

	img_fade_object = new Object();
	img_fade_timer 	= new Object();
	
	/* object - image to be faded (actual object, not name);
	 * destop - destination transparency level (ie 80, for mostly solid)
	 * rate   - time in milliseconds between trasparency changes (best under 100)
	 * delta  - amount of change each time (ie 5, for 5% change in transparency)
	 */
	
	function img_fade(object, destOp, rate, delta)
	{
		if (!document.all)
			return
		if (object != "[object]")
		{  //do this so I can take a string too
			setTimeout("img_fade(" + object + "," + destOp + "," + rate + "," + delta + ")", 0);
			return;
		}
			
		clearTimeout(img_fade_timer[object.sourceIndex]);
		
		diff 		= destOp - object.filters.alpha.opacity;
		direction 	= 1;
		if (object.filters.alpha.opacity > destOp)
			direction = -1;
		delta = Math.min(direction * diff,delta);
		object.filters.alpha.opacity += direction * delta;
	
		if (object.filters.alpha.opacity != destOp)
		{
			img_fade_object[object.sourceIndex]	= object;
			img_fade_timer[object.sourceIndex]	= setTimeout("img_fade(img_fade_object[" + object.sourceIndex + "]," + destOp + "," + rate + "," + delta + ")", rate);
		}
	}
-->
