(function($)
{
	$.fn.ditofade = function(options)
	{
		return this.each(function()
		{
			$.ditofade(this, options);
		});
	};

	var count	= 1;
	var settings= {};
	var elements= {};

	$.ditofade = function(container, options)
	{
		settings = {
			'speed':	'normal',
			'timeout':	2000
		};

		if (options)
		{
			$.extend(settings, options);
		}

		elements = $(container).children();
		$(elements).css('display', 'none');
		$(elements[0]).css('display', 'block');

		setTimeout(function()
		{
			$.ditofade.element(0, 1);
		}, settings.timeout);
	};

	$.ditofade.element = function(current, next)
	{
		$(elements[current]).fadeOut(settings.speed);
		$(elements[next]).fadeIn(settings.speed, function() {
							removeFilter($(this)[0]);
						});

		current = next;
		next = $.ditofade.next(current);

		setTimeout(function()
		{
			$.ditofade.element(current, next);
		}, settings.timeout);
	};

	$.ditofade.next = function(current)
	{
		next = Math.floor(Math.random() * (elements.length));
		if ((next >= elements.length) || (current == next))
		{
			$.ditofade.next(current);
		}
		return next;
	}

})(jQuery);


// **** remove Opacity-Filter in ie ****
function removeFilter(element)
{
	if(element.style.removeAttribute)
	{
		element.style.removeAttribute('filter');
	}
}

