function Fader(holder, faders, conf)
{
	var holder=$(holder);
	var currentImage=false;
	var nextImage=false;
	var fadeState=0; // Percent through the fade
	var fadeInterval=6000; // Time between fades in ms
	var fadeDuration=1000; // Time of fade in ms
	var fps=25; // Frames per second

	// Configure using the optional conf object
	if (conf.fadeInterval) fadeInterval=conf.fadeInterval;
	if (conf.fadeDuration) fadeDuration=conf.fadeDuration;
	if (conf.fps) fps=conf.fps;
	
	// Initialise the holder
	holder.innerHTML='';
	holder.style.position='relative';
	holder.innerHTML='';

	// Put all the images into the fade holder
	for (var n=0;n<faders.length;++n)
	{
		var f=faders[n];
		var i=document.createElement('img');
		i.src=f.src;
		i.alt=f.alt;
		i.url=f.url;
		i.title=f.alt;
		i.style.visibility='hidden';
		i.style.opacity=0;
		i.style.filter='alpha(opacity=0)';
		i.style.position='absolute';
		i.style.top='0px';
		i.style.left='0px';
		i.style.marginTop='0px';
		i.style.padding='0px';
		i.style.cursor='pointer';
		if (f.click)
			Event.observe(i, 'click', f.click, false);
		else
			Event.observe(i, 'click', function(event) { document.location.href=Event.element(event).url; }, false);
		holder.appendChild(i);
		
		// Initialise the currentImage and nextImage
		if (false==currentImage) currentImage=i;
		else if (false==nextImage) nextImage=i;
	}

	// Show the first image
	currentImage.style.visibility='visible';
	currentImage.style.opacity=1;
	currentImage.style.filter='alpha(opacity=90)';

	// Start the fade timer if there is more than one image
	if (faders.length > 1)
		setTimeout(fadeCallback, fadeInterval); 

	
	
	
	/*
	Function: fadeCallback
		Is called by the fader to swap images
	*/
	function fadeCallback()
	{
		// If the fadeState=0, we are starting a fade.
		if (0==fadeState)
		{
			nextImage.style.opacity=0;
			nextImage.style.filter='alpha(opacity=0)';
			nextImage.style.visibility='visible';
			fadeState=0.1;
			setTimeout(fadeCallback, 1000/fps);
		}
		else
		{
			// Otherwise, we are carrying on a fade
			fadeState+=1000/(fps*fadeDuration);
			nextImage.style.opacity=fadeState;
			nextImage.style.filter='alpha(opacity='+(fadeState*100)+')';			
			currentImage.style.opacity=1-fadeState;
			currentImage.style.filter='alpha(opacity='+((1-fadeState)*100)+')';
			
			// Have we finished fading?
			if (fadeState>=1)
			{
				currentImage.style.visibility='hidden';
				fadeState=0;
				currentImage=nextImage;
				nextImage=nextImage.nextSibling;
				if (!nextImage) nextImage=holder.firstChild;
				setTimeout(fadeCallback, fadeInterval);
			}
			else
			{
				// Fade some more 
				setTimeout(fadeCallback, 1000/fps);
			}
		}
	}
	
}
 