var obj, tid;
var size;
var path;
var index = 0;

function getFlashByID(id) {
  if (window.document[id]) {
    return window.document[id];
  }
  if (navigator.appName.indexOf("Microsoft Internet") == -1) {
    if (document.embeds && document.embeds[id])
      return document.embeds[id];
  } else {
    return document.getElementById(id);
  }
}

function init() {
  this.obj = getFlashByID("ltrOAS_AD_2");
  this.size = swf[0].length;
  var src = this.obj.getAttribute("src");
  this.path = src.substring(0, src.lastIndexOf("/") + 1);

  this.tid = setTimeout("play();", swf[1][index]);
}

function play() {
  index++;
  //alert("Movie " + swf[0][index]);
  this.obj.LoadMovie(0, this.path + swf[0][index]);

  if (index >= this.size - 1) index = -1;
  
  clearTimeout(tid);
  //alert("Timeout " + swf[1][index]);
  this.tid = setTimeout("play();", (index != -1) ? swf[1][index] : swf[1][this.size-1])
  
  //swf[1][index] != "" ? swf[1][index] : 0); 
}