時間の経過と共にリンクの文字色を変更する

(function(){
    //イベントとイベントハンドラを設定
    if (window.addEventListener) window.addEventListener("load", setLinkColor, true);
    if (window.attachEvent) window.attachEvent("onload", setLinkColor);
    
    function setLinkColor(){
        //カラーを変更する領域を設定
        var aTag = document.getElementById("myLink").getElementsByTagName("a");
        var textColor = [	"#00f", "#02f","#04f","#06f","#08f","#0af","#0cf","#0ef","#0ff",
							"#0ff", "#0ef","#0cf","#0af","#08f","#06f","#04f","#02f","#00f"];
        var time = 200;	// 200 msec
        var count = 0;
        //インターバルタイマー
        setInterval(function(){
            for(var i=0; i<aTag.length; i++){
                aTag[i].style.color = textColor[count];
            }
            count = (count + 1) % textColor.length;
        }, time);
    }
})();