var smfFadeContent = new Array(                         "One of the worst sins is a person taking his sin lightly. <br /> - Abu Bakr (R)(reported by ad-Daynuri)",                         "Allah is beautiful and loves beauty. <br/> - Prophet Muhammad pbuh (Muslim)",                         "Purity and cleanliness is part of faith. <br/> - Prophet Muhammad pbuh (Muslim)",                         "There is no vessel worse for the son of Adam to fill than his stomach. <br /> - Prophet Muhammad pbuh (Tirmidhi)",                         "There are two blessings that many people fail to make the most of good health and free time. <br /> - Prophet Muhammad pbuh (Bukhari)",                         "He is not one of us who does not show mercy to our little ones and respect to our elders. <br /> - Prophet Muhammad pbuh (Tirmidhi)",                         "Each one of you is a guardian and is responsible for what he is entrusted with. <br /> - Prophet Muhammad pbuh pbuh (Bukhari)",                         "On a journey, the leader of the group is their servant. <br /> - Prophet Muhammad pbuh (Sunan Ibn Majah)",                         "The cure for ignorance is to question. <br /> - Prophet Muhammad pbuh (Sunan Abi Dawud)",                         "Modesty is part of faith. <br /> - Prophet Muhammad pbuh (Muslim)",                         "Blessed is he who preoccupies himself with his own defects, rather than those of others. <br /> - Prophet Muhammad pbuh (Musnad Al-Bazzar)",                         "No one can give a better or more abundant gift than patience. <br /> - Prophet Muhammad pbuh (Bukhari)",                         "Calmness and determination is from Allah and haste is from Satan. <br /> - Prophet Muhammad pbuh (Tirmidhi)",                         "God has revealed to me that you must be humble, so that no one oppresses another and boasts over another. <br /> - Prophet Muhammad pbuh (Muslim)",                         "What is little but sufficient is better than that which is abundant but causes heedlessness. <br /> - Prophet Muhammad pbuh (Hibban)",                         "Contemplate those who have less than you and not those who have more than you, lest you belittle the favors of Allah conferred upon you. <br /> - Prophet Muhammad pbuh (Bukhari)",                         "Honesty leads to righteousness and righteousness leads to Paradise. <br /> - Prophet Muhammad pbuh (Bukhari)",                         "The Muslim does not slander, curse, speak obscenely, or speak rudely. <br /> - Prophet Muhammad pbuh (Tirmidhi)",                         "Wealth does not come from having great riches; (true) wealth is contentment of the soul. <br /> - Prophet Muhammad pbuh (Bukhari)",                         "The best of you is the one who is best to his own family, and I am the best of you towards my family. <br /> - Prophet Muhammad pbuh (Tirmidhi)",                         "Believers are like a single person; if his eye is in pain his whole body pains, and if his head is in pain his whole body pains. <br /> - Prophet Muhammad pbuh (Muslim)",                         "The most perfect of the believers in faith are the best of them in moral excellence, and the best of you are the kindest to their wives. <br /> - Prophet Muhammad pbuh (Tirmidhi)",                         "The burden of proof is upon the plaintiff and the taking of oath is upon the defendant. <br /> - Prophet Muhammad pbuh (Al-Bayhaqi)",                         "The food of two people is enough for three, and the food of three people is enough for four. <br /> - Prophet Muhammad pbuh (Bukhari)",                         "Do not be people without minds of your own, saying that if others treat you well you will treat them well, and that if they do wrong you will do wrong. <br />Instead, accustom yourselves to do good if people do good and not to do wrong if they do evil. <br /> - Prophet Muhammad pbuh (Tirmidhi)"                     );
// smfFadeIndex: the current item in smfFadeContent.
var smfFadeIndex = -1;
// smfFadePercent: percent of fade. (-64 to 510.)
var smfFadePercent = 510
// smfFadeSwitch: direction. (in or out)
var smfFadeSwitch = false;
// smfFadeScroller: the actual div to mess with.
var smfFadeScroller = document.getElementById('smfFadeScroller');
// The ranges to fade from for R, G, and B. (how far apart they are.)
var smfFadeRange = {
	'r': smfFadeFrom.r - smfFadeTo.r,
	'g': smfFadeFrom.g - smfFadeTo.g,
	'b': smfFadeFrom.b - smfFadeTo.b
};

// Divide by 20 because we are doing it 20 times per one ms.
smfFadeDelay /= 20;

// Start the fader!
window.setTimeout('smfFader();', 20);

// Main	fading function... called 50 times every second.
function smfFader()
{
	var curr_index = Math.floor(Math.random()*(smfFadeContent.length));
	if (smfFadeContent.length <= 1)
		return;

	// A fix for Internet Explorer 4: wait until the document is loaded so we can use setInnerHTML().
	if (typeof(window.document.readyState) != "undefined" && window.document.readyState != "complete")
	{
		window.setTimeout('smfFader();', 20);
		return;
	}

	// Starting out?  Set up the first item.
	if (smfFadeIndex == -1)
	{
		setInnerHTML(smfFadeScroller, smfFadeBefore + smfFadeContent[curr_index] + smfFadeAfter);
		smfFadeIndex = 1;

		// In Mozilla, text jumps around from this when 1 or 0.5, etc...
		if (typeof(smfFadeScroller.style.MozOpacity) != "undefined")
			smfFadeScroller.style.MozOpacity = "0.90";
		else if (typeof(smfFadeScroller.style.opacity) != "undefined")
			smfFadeScroller.style.opacity = "0.90";
		// In Internet Explorer, we have to define this to use it.
		else if (typeof(smfFadeScroller.style.filter) != "undefined")
			smfFadeScroller.style.filter = "alpha(opacity=100)";
	}

	// Are we already done fading in?  If so, fade out.
	if (smfFadePercent >= 510)
		smfFadeSwitch = !smfFadeSwitch;
	// All the way faded out?
	else if (smfFadePercent <= -64)
	{
		smfFadeSwitch = !smfFadeSwitch;

		// Go to the next item, or first if we're out of items.
		
		if (curr_index == smfFadeIndex)
			curr_index = Math.floor(Math.random()*(smfFadeContent.length));
		setInnerHTML(smfFadeScroller, smfFadeBefore + smfFadeContent[curr_index] + smfFadeAfter);
		if (smfFadeIndex >= smfFadeContent.length)
			smfFadeIndex = 0;
	}

	// Increment or decrement the fade percentage.
	if (smfFadeSwitch)
		smfFadePercent -= 255 / smfFadeDelay * 2;
	else
		smfFadePercent += 255 / smfFadeDelay * 2;

	// If it's not outside 0 and 256... (otherwise it's just delay time.)
	if (smfFadePercent < 256 && smfFadePercent > 0)
	{
		// Easier... also faster...
		var tempPercent = smfFadePercent / 255, rounded;

		if (typeof(smfFadeScroller.style.MozOpacity) != "undefined")
		{
			rounded = Math.round(tempPercent * 100) / 100;
			smfFadeScroller.style.MozOpacity = rounded == 1 ? "0.99" : rounded;
		}
		else if (typeof(smfFadeScroller.style.opacity) != "undefined")
		{
			rounded = Math.round(tempPercent * 100) / 100;
			smfFadeScroller.style.opacity = rounded == 1 ? "0.99" : rounded;
		}
		else
		{
			var done = false;
			if (typeof(smfFadeScroller.filters.alpha) != "undefined")
			{
				// Internet Explorer 4 just can't handle "try".
				eval("try\
					{\
						smfFadeScroller.filters.alpha.opacity = Math.round(tempPercent * 100);\
						done = true;\
					}\
					catch (err)\
					{\
					}");
			}

			if (!done)
			{
				// Get the new R, G, and B. (it should be bottom + (range of color * percent)...)
				var r = Math.ceil(smfFadeTo.r + smfFadeRange.r * tempPercent);
				var g = Math.ceil(smfFadeTo.g + smfFadeRange.g * tempPercent);
				var b = Math.ceil(smfFadeTo.b + smfFadeRange.b * tempPercent);

				// Set the color in the style, thereby fading it.
				smfFadeScroller.style.color = 'rgb(' + r + ', ' + g + ', ' + b + ')';
			}
		}
	}

	// Keep going.
	window.setTimeout('smfFader();', 20);
}
