function badFade (el, options)
{	
  var current;
	var direction = (options.fade == 'in') ? 1 : -1;
	
	if (options.fade == 'in')
	{
		current = 0;
		el.style.visibility = 'visible';
	}
	else
		current = 1;

	setOpacity(el, current);	
	var interval = window.setInterval(tick, 25);
	
	function tick()
	{
		current += 0.05 * direction;
		
		setOpacity(el, current);
		
		if (((direction == 1) && (current >= 1))
				|| ((direction == -1) && (current <= 0)))
		{
			el.style.visibility = (options.fade == 'in') ? 'visible' : 'hidden';
			window.clearInterval(interval);	
			
			if (options.onComplete)
				options.onComplete();
		}
	};
	
	function setOpacity (el, opacity)
	{						
		var percent = Math.floor(opacity * 100);
			
		// IE
		el.style.zoom = 1;
		el.style.filter = 'alpha(opacity=' + percent + ')';
					
		// CSS 3
		el.style.opacity = opacity;
	};
};
