﻿var go = true;var imgLink = new Array()//imgLink[0] = ["/resinter/bannerImages/Titanium_banner.gif","/resinter/H69/Titanium/index.html",156,80];//imgLink[0] = ["/resinter/bannerImages/scrollImg_A.gif","http://www.tbb.com.tw/wps/wcm/connect/TBBInternet/relativeInformation/news/news04/news04gracie990609",136,80];//展示圖主程式function getScrollImg(){  if (go) {    window.setInterval("scrollImg()", 200);    var scrollImgHTML = "";    for (i=0; i<imgLink.length; i++){      scrollImgHTML = scrollImgHTML + "<a href=" + imgLink[i][1] + "><img src=" + imgLink[i][0] + " border=0 width=" + imgLink[i][2] + " height=" + imgLink[i][3] + " /></a><br>";    }    document.getElementById("imgAd").innerHTML = scrollImgHTML;  }}lastScrollY = 0;function scrollImg(){  var locationScrollTop = document.body.scrollTop;  var imgTop = parseInt(document.getElementById("scrollAdImg").style.top);  if (navigator.userAgent.match(/msie/gi)){    var imgLeft = document.body.offsetWidth/2 + 350;  } else {    var imgLeft = document.body.offsetWidth/2 + 360;  }  if (locationScrollTop < 0){    locationScrollTop = document.documentElement.scrollTop;  }  //scroll最高位置-scroll最後位置  lc = 1*(locationScrollTop-lastScrollY);  if (lc > 0){    lc = Math.ceil(lc);  } else {    lc = Math.floor(lc);  }  imgTop = imgTop + lc  //顯示位置  document.getElementById("scrollAdImg").style.top = imgTop;  document.getElementById("scrollAdImg").style.left = imgLeft;  lastScrollY += lc;}
