<html>
<head>
<title></title>
<Script language="JavaScript">
var someText = "欢迎来到中能电力科技开发有限公司"; // the text
var aChar;
var aSentence;
var i=0; // a counter
var colors = new Array("EFEFEF","164781"); // the colors
var aColor; // the chosen color
function loadText(){
aColor="164781"
// randomly choose color
aChar = someText.charAt(i);
if (i==0)
aSentence = aChar;
else
aSentence += aChar;
// 50 iterations max.
if (i < 20) {
i++;
}
else{
aColor = colors[Math.floor(Math.random()*colors.length)];
}
// For IE
if (document.all){
textDiv.innerHTML= "<font color='#"+aColor+"' style='font-size:12px'>"+aSentence+"</font>";
setTimeout("loadText()",300);
}
// For Netscape Navigator 4
else if (document.layers){
document.textDiv.document.write("<font color='#"+aColor+"' style='font-size:12px'>"+aSentence+"</font>");
document.textDiv.document.close();
setTimeout("loadText()",300);
}
// For other
else if (document.getElementById){
document.getElementById("textDiv").innerHTML = "<font color='#"+aColor+"' style='font-size:12px'>"+aSentence+"</font>";
setTimeout("loadText()",300);
}
}
</SCRIPT>
<div id="textDiv" style="font-size:12px"></div>
</head>
<body onLoad="loadText()">
</body>
</html>