$.fn.pictureChanger = function(speed)
{
	var position= 0;
	var id = '#' + this.attr('id');
	var nChildren = $(id).children().length;

	if(nChildren > 1)
	{
		$(document).everyTime(speed, function() {
			if(position >= nChildren - 1) position = nChildren - 1;
			$(id + ' > div:eq(' + position + ')').fadeOut(1000, function() {
				if($(this).attr('rel') == 'startImage')
				{
					$(this).remove();
					position--;
					nChildren = $(id).children().length;
				}
			});

			position++;

			if(position > nChildren - 1) position = 0;
			$(id + ' > div:eq(' + (position) + ')').fadeIn(1000);
		});
	}
}
