TOP /すぐに使えるJavaScript 一行トッピックス

<script type="text/javascript"><!--
msgtxts=new Array();
msgtxts[0]=new Array("http://himajin.moo.jp/","<font color=blue>HIMAJIN</font>の","Home Pageです!");
msgtxts[1]=new Array("","<font color=blue>HIMAJIN</font>の書いた","JavaScriptを色々","UPしています");
msgtxts[2]=new Array("http://himajin.moo.jp/freejava/hanabi.html","JavaScriptによる","<font color=blue>打ち上げ花火</font>","あなたのHPを","飾ってみませんか。");
msgtxts[3]=new Array("","他にも","色々なJavaScriptが","有りますよ","\(^o^)/");

txt_color="violet";                             //文字色
txt_size=12;                                    //文字の大きさ
txt_msec=3000;                                   //表示時間
//--------------------------------------------------------------
document.write("<div ID='sctxt'onclick='noticelink()'");
document.write("style='color:"+txt_color+";font-size:"+txt_size+"pt;cursor: hand;height:"+txt_size+"'></div>");

msgno=0;msgleng=0;
function notice(){
if(msgleng < msgtxts[msgno].length){
  msgleng++;
}else if(msgleng == msgtxts[msgno].length){
  msgno++;msgno%=msgtxts.length;
  msgleng=0;
}
txtplus="";
    for(i=1;i<msgleng;i++)
txtplus+=msgtxts[msgno][i];

document.getElementById("sctxt").innerHTML=txtplus;

if(msgtxts[msgno][0] && msgleng == msgtxts[msgno].length)
document.getElementById("sctxt").style.cursor="hand";
else
document.getElementById("sctxt").style.cursor="default";

if(msgleng < msgtxts[msgno].length){
  setTimeout("notice()", 200);
}else if(msgleng == msgtxts[msgno].length){
  setTimeout("notice()", txt_msec);
}
}
function noticelink(){
if(!msgtxts[msgno][0] || msgleng < msgtxts[msgno].length)return;
location.href = msgtxts[msgno][0];
}
notice();/* himajin.moo.jp */
// --></script>