<HTML>
<HEAD>
<TITLE>Put Some Colors Into The Text</TITLE>
<SCRIPT language=JavaScript>
<!-- Start hiding
var i
function ColoredText() {
var argLen = ColoredText.arguments.length;
if (argLen == 0)
{argLen = 1}
var text = ColoredText.arguments[0];
var textLen = ColoredText.arguments[0].length;
var defClrsArray = new Array("red","purple","cyan","green","blue","magenta");
//default colors, change as needed
for (i=0; i<textLen; i++) {
charColor = text.charAt(i);
if (argLen == 1)
{
colorCode = Math.floor(Math.random() * defClrsArray.length);
tempStr = charColor.fontcolor(defClrsArray[colorCode])
}
else
{
colorCode = i % (argLen - 1);
tempStr = charColor.fontcolor(ColoredText.arguments[colorCode+1])
}
document.write(tempStr)
}
}
// Stop hiding -->
</SCRIPT>
</HEAD>
<BODY bgcolor="ffffcc">
<SCRIPT language=JavaScript>
<!-- Start hiding
ColoredText("This is a text sample written using the
function ColoredText");
document.write ("<BR>")
ColoredText("Another text sample, this time only with red
and orange repeatedly","red","orange");
document.write ("<BR><H1>")
ColoredText("Another sample with shades of green","#006000","#007000","#008000","#009000","#00A000","#00B000");
document.write ("</H1><BR><BR><CENTER><FONT
FACE=courier SIZE=+2>")
ColoredText("Try refreshing the page a couple of times!");
document.write ("</FONT></CENTER>")
// Stop hiding -->
</SCRIPT>
</BODY>
</HTML>