
<!-- Original:  WarpGear Software (jsfader@warpgear.com) -->
<!-- Web Site:  http://www.warpgear.com/developer -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
//  texts:
//  Your messages wich may contain regular html tags but 
//  must at least contain: [ <font color='{COLOR}'> ]
//  Use single quotes [ ' ] in your html only. If you need 
//  a double quote in the message itself use an escape 
//  sign like this: [ \" ]  (not including the brackets)
//	Revision: Mon Jul 29 22:31:36 EDT 2002
//	Modified to support N6


var texts = new Array(
"<font size='2' color='{COLOR}' face='Arial'>	\
Please G-d, make her well. <br> <br>-- Numbers 12:13 \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	\
The prayers of the sick are more effective than the prayers of others, and \
are answered first.  \
    <br><br> -- Rashi \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	\
If one has a problem and prays for another who has the identical problem, \
he who has prayed will be answered first. \
    <br><br> -- Gemara (Bava Kama 92A) \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	\
The prayer of the sick for himself will avail more than any other.  \
    <br><br> -- Genesis (Bereshit) R. \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	\
Unless we believe that G-d renews creation every day, our prayers grow \
habitual and tedious.   \
    <br><br> -- Baal Shem Tov \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	\
Whoever answers Amen is greater than the suppliant.  \
    <br><br> - Talmud, Berakhot   \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	\
Whoever answers Amen with all his might, to him the gates of Paradise are \
open.   \
    <br><br> -- Talmud, Shabbat \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	\
Whoever cries over the past is offering a vain prayer.   \
    <br><br> - Berakhot 9:3 \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	\
Whoever prays in Jerusalem is as one praying before the Throne of Glory, for \
the Gate of Heaven is there.  \
    <br><br> -- Pirke Derabbi Eliezer \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	\
You don't have to pray loudly; just direct your heart to heaven.  \
    <br><br> - Rabbi Chia \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	\
Rabbi Elazar would first give a coin to a poor man, and then pray. \
<br><br> -- Talmud Bavli, Bava Basra 10a \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	\
A man must bless G-d for the evil, just as he blesses Him for the good.  \
<br><br> -- Berakhot 9:5 \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	\
Better prayer without synagogue than synagogue without prayer.   \
    <br><br> -- Abraham Heschel \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	\
Any study of the Torah and any prayer unaccompanied by good deeds and \
repentance void the Torah and make the prayer unwanted.   \
<br><br> -- Otiyot Derabbi Akiva   \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	\
But how can you say, 'It was only talk, so no harm was done?' Were this \
true, then your prayers, and your words of kindness, would be a waste of \
breath. <br><br> -- Nachman of Breslav \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	\
By benevolence man rises to a height where he meets G-d. Therefore do a \
good deed before you begin your prayers.   \
<br><br> -- Ahai Gaon, Sheiltot \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	\
If a man sees that his prayer was not granted, let him pray again!  \
<br><br> -- Talmud, Berakhot \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	\
In Ne'ilah [the closing prayer] of Yom Kippur, what did he [the Cohen] \
say? 'And Hashem will bless you from Zion and you will see the good of \
Jerusalem all of the days of your life.'   \
    <br> -- Talmud, Sotah 40a  \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	\
Prayer is greater than sacrifices.   \
    <br><br> -- Talmud, Berakhot \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	\
Prayer is the service of the heart.   \
    <br><br> -- Talmud, Ta'anit \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	\
Prayer or benediction without intention is like body without soul.  \
    <br><br> -- Tanya \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	\
Prayers truly from the heart open all the doors in Heaven.   \
    <br><br> -- Nachman of Breslav \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	\
The best weapons of Jew are his prayers.   \
    <br><br> -- Nachman of Breslav \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	\
The gates of prayer are sometimes closed, but the gates of repentance are \
forever open.  \
    <br><br> -- Midrash Deuteronomy R. 2:7 \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	\
When a father gives to his son, both laugh.<br> \
When a son gives to his father, both cry.<br><br>-- Yiddish proverb \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	 \
One father can support ten sons; ten sons cannot support one father. \
<br><br>-- Medieval Jewish proverb \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	 \
The love of parents goes to their children, but the love of these \
children goes to their children. \
<br><br>-- Talmud Bavli, Sotah 49a \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	 \
Honor your father and mother. <br><br>-- Exodus 20:12 \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	 \
When I was young I admired clever people.  Now that I am old, I admire \
kind people. <br><br> Rabbi Avraham Yehoshua Heschel (1907-1972) \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	 \
Give of yourself .. you can always give something even if it is only \
kindness ... No one has ever become poor from giving. \
<br><br> The Diary of a Young Girl, March 1944 \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	 \
He who repeats what he has learned one hundred times cannot be compared \
to one who repeats it one hundred and one times. \
<br><br>-- Talmud Bavli, Hagigah 9b \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	 \
A foolish student will say, \"Who can possibly learn the whole Torah ..?\" \
A wise student will say, \"I will learn two laws today, and two laws \
tomorrow, until I have mastered the whole Torah.\" \
<br><br>-- Song of Songs, Rabbah 5:11 \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	 \
Make your study of Torah a fixed habitual activity. \
<br><br>-- Pirkei Avos, 1:15 \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	 \
Turn it over and over again, for one can find everything in it. \
[i.e. the Torah] <br><br>Pirkei Avos 5:22 \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	 \
It is forbidden to fulfill a commandment through a transgression. \
<br><br>-- Talmud Bavli, Sukkah 30a \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	 \
If a mitzvah comes your way, don't delay. \
<br><br>-- Mechilta Bo \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	 \
Greater is one who is commanded to do something and does it than one \
who is not commanded to do something and does it. \
<br><br>-- Talmud Bavli, Kiddushin 31a \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	 \
Whoever reports a saying in the name of its originator brings the world \
toward redemption. \
<br><br>-- Pirkei Avos 6:6 \
    </font>",	
"<font size='2' color='{COLOR}' face='Arial'>	 \
The ways of the Torah are pleasant and all her paths peaceful. \
<br><br>-- Proverbs 3:17 \
    </font>");

// var bgcolor ="#CCFFCC"; // background color, must be valid browser hex color (not color names)
var bgcolor ="#005700"; // background color, must be valid browser hex color (not color names)
// var fcolor = "#FF8000";  // foreground or font color
// var fcolor = "#FF33CC";  // foreground or font color
// var fcolor = "#009933";  // foreground or font color
var fcolor = "#ffffff";  // foreground or font color
var steps = 20; // number of steps to fade
var show = 12000; // milliseconds to display message
var sleep = 10; // milliseconds to pause inbetween messages
var loop = true; // true = continue to display messages, false = stop at last message

// Do Not Edit Below This Line
var colors = new Array(steps);
getFadeColors(bgcolor,fcolor,colors);
var color = 0;
var text = 0;
var step = 1;

var ns ;var ie ;var n6;var op;var W;
function
BrowserCheck()
{
    ns=document.layers; 	// document.layers = Netscape 4.x only
    ie=document.all; 		// document.all = IE only
    op=window.opera;
    if(!ie&&document.getElementById){ns=false;n6=true;};
}

// getFadeColors: fills Colors (predefined Array)
// with color hex strings fading from ColorA to ColorB

// note: Colors.length equals the number of steps to fade
function getFadeColors(ColorA, ColorB, Colors)
{
    len = Colors.length; 

    // strip '#' signs if present 
    if (ColorA.charAt(0)=='#') ColorA = ColorA.substring(1);
    if (ColorB.charAt(0)=='#') ColorB = ColorB.substring(1);

    // substract rgb compents from hex string 
    var r = HexToInt(ColorA.substring(0,2));
    var g = HexToInt(ColorA.substring(2,4));
    var b = HexToInt(ColorA.substring(4,6));
    var r2 = HexToInt(ColorB.substring(0,2));
    var g2 = HexToInt(ColorB.substring(2,4));
    var b2 = HexToInt(ColorB.substring(4,6));

    // calculate size of step for each color component
    var rStep = Math.round((r2 - r) / len);
    var gStep = Math.round((g2 - g) / len);
    var bStep = Math.round((b2 - b) / len);

    // fill Colors array with fader colors
    for (i = 0; i < len-1; i++) {
    Colors[i] = "#" + IntToHex(r) + IntToHex(g) + IntToHex(b);
    r += rStep;
    g += gStep;
    b += bStep;
    }
    Colors[len-1] = ColorB; // make sure we finish exactly at ColorB
}

// fade: magic fader function
function fade()
{

    BrowserCheck();

    /*
    ret = prompt ("Enter object", "document");
    obj = eval(ret);
    var temp = "";
    var i = 0;
    for (x in obj)
    {
	temp += x + ": " + obj[x] + "\n";
	if (i++ > 7)
	{
	    alert(temp);
	    temp="";
	    i=0;
	}
    }
    alert (temp);
    */

    // insert fader color into message
    // texts should be defined in user script, 
    // e.g.: var texts = new 
    // Array("<font color='{COLOR}' sized='+3' face='Arial'>howdy</font>");
    var text_out = texts[text].replace("{COLOR}", colors[color]);

    // actually write message to document
    if (ie)
    {
	fader.innerHTML = text_out;
    }

    if (ns)
    {
	document.fader.document.write(text_out);
	document.fader.document.close();
    }

    if (n6)
    {
	// need to replace text_out with only the raw text, no HTML encoding
	// "<font size='2' color='{COLOR}' face='Arial'>...</font>"
	var newtext=text_out.slice(44,-7);
	var newtext2=newtext.replace("<br>","\n");
	var newtext3=newtext2.replace("<br>","\n");
	var newtext4=newtext3.replace("<br>","\n");
	document.getElementById("fader").firstChild.nodeValue=newtext4;
    }

    // select next fader color
    color += step; 

    // completely faded in?
    if (color >= colors.length-1) {
    step = -1; // traverse colors array backward to fade out

    // stop at last message if loop=false
    if (!loop && text >= texts.length-1) return; // loop should be defined in user script, e.g.: var loop=true;
    }

    // completely faded out?
    if (color == 0) {
    step = 1; // traverse colors array forward to fade in again

    // select next message
    text += 1;
    if (text == texts.length) text = 0; // loop back to first message
    }

    // subtle timing logic...
    setTimeout("fade()", (color == colors.length-2 && step == -1) ? show : ((color == 1 && step == 1) ? sleep : 50)); // sleep and show should be defined in user script, e.g.: var sleep=30; var show=500;
}

// IntToHex: converts integers between 0-255 into a two digit hex string.
function IntToHex(n) {
var result = n.toString(16);
if (result.length==1) result = "0"+result;
return result;
}

// HexToInt: converts two digit hex strings into integer.
function HexToInt(hex) {
return parseInt(hex, 16);
}

// body tag must include: onload="fade()" bgcolor="#000000"  where bgcolor equals bgcolor in javascript above
//  End -->
