function assignArray(text,delay) {           
this.text=text           
this.delay=delay           
}           
function createArray() {           
fadecolor=new Array("FF6699","E80000","E80000","FF5050","FE4393","FF5050") //色彩           
msg=new Array(6) //訊息總數
 
         
msg[0]=new assignArray("Recently in China,",100); 
msg[1]=new assignArray("there is an unethical proprietor selling",100);            
msg[2]=new assignArray("faked product in the name of 'new Chi-fa'",100); 
msg[3]=new assignArray("We have already taken legal actions.",100);           
msg[4]=new assignArray("Please be alert and do not be cheated.",100);           
msg[5]=new assignArray("",500); 
msg[6]=new assignArray("",500); 


//輸入文字內容，1600是每段字出現後暫停的時間

         
           
setTimeout("typeIt()", 0)} //進入頁面效果開始的等待時間，1000=1秒   
var msgNo=0           
var character=1           
var colorNo=0           
var fixColor=0           
var colorCheck=0           
function typeIt() {           
var insertHTML=""           
if(msgNo <= msg.length-1) {           
if(character <= msg[msgNo].text.length || colorCheck < msg[msgNo].text.length) {           
colorCheck=0           
for(var charCheck=0; charCheck<character; charCheck++,colorNo--,fixColor--){           
if(fixColor>5)colorNo=5          
if(colorNo==5)colorCheck+=1           
insertHTML += '<SPAN style="font-family: Black; font-size:coolboo; color:'+fadecolor[colorNo]+'">' + msg           
[msgNo].text.substring(charCheck, charCheck+1) + '</SPAN>'           
}           
if(document.layers) {           
document.typeWriter.document.write(insertHTML)           
document.typeWriter.document.close()           
} else if (document.all) {           
document.all.typeWriter.innerHTML = insertHTML           
}           
setTimeout("typeIt()", 70)   //色彩跑動的速度，數目越大越慢        
character++           
colorNo=character-1           
fixColor=character           
}           
else {           
character=1           
colorNo=character-1           
fixColor=character           
setTimeout("typeIt()", msg[msgNo].delay)           
if (msgNo==msg.length-1) {           
msgNo=0           
}else            
{ msgNo++}           
           
}           
}           
} 