window.onload = rotate;

//初始值为 0，该变量值能取值0,1,2，和 adImages 数组元素对应
var thisAd = 0;

function rotate(){
  var adImages = new Array("images/reading1.gif", "images/reading2.gif", "images/reading3.gif");
  thisAd++;
  if(thisAd == adImages.length){
    thisAd = 0;
  }
  document.getElementById("adBanner").src = adImages[thisAd];
	
  setTimeout(rotate, 2000);
  //指定一个操作多长时间执行一次，这里设置的是2秒
	
}