function initImage(imageId) { image = document.getElementById(imageId); setOpacity(image, 0); image.style.visibility = 'visible'; fadeIn(imageId,0); } function setOpacity(obj, opacity) { opacity = (opacity == 100)?99.999:opacity; // IE/Win obj.style.filter = "alpha(opacity:"+opacity+")"; // Safari<1.2, Konqueror obj.style.KHTMLOpacity = opacity/100; // Older Mozilla and Firefox obj.style.MozOpacity = opacity/100; // Safari 1.2, newer Firefox and Mozilla, CSS3 obj.style.opacity = opacity/100; } function fadeIn(objId,opacity) { if (document.getElementById) { obj = document.getElementById(objId); if (opacity <= 100) { setOpacity(obj, opacity); opacity += 10; window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 50); } } } function rand(n) { seed=(0x015a4e35*seed)%0x7fffffff; return (seed >> 16)%n; } var now=new Date(); var seed=now.getTime()%0xffffffff; var rot = 1; var i=rand(1); var ad_pic = new Array (1); var linkto = new Array (1); var description = new Array (1); linkto[0]="https://hs.nnkieh.tn.edu.tw"; ad_pic[0]="https://schnews.tn.edu.tw:443/uploads/schnews//2018-11/banner_sn_722_1.jpg"; description[0]="日本加賀 RoboRAVE 國際賽 南科實中高中部跨校組隊獲 1 金 2 銀"; document.getElementById('tn_banners').innerHTML=''; document.close(); //var linklength = document.links.length-1; function DynamicRoAD() { i++; i %= rot; document.ad.src = ad_pic[i]; //document.links[linklength].href = linkto[i]; document.getElementById('banner_link').href=linkto[i]; document.ad.alt = description[i]; initImage('tn_banner'); setTimeout ('DynamicRoAD()',5000); } setTimeout ('DynamicRoAD()',5000);