//version:2.2
function browserType_scroll()
{
  var agent = navigator.userAgent.toLowerCase();
  this.ns = (agent.indexOf('mozilla')!= -1 && agent.indexOf('spoofer')== -1 && agent.indexOf('compatible') == -1 && agent.indexOf("opera") == -1 && agent.indexOf("firefox") == -1);
  this.ie = ((agent.indexOf("msie") != -1) && (agent.indexOf("opera") == -1));      // IE
  this.op = (agent.indexOf("opera") != -1);    // Opera
  this.ff = (agent.indexOf('mozilla')!= -1 && agent.indexOf('spoofer')== -1 && agent.indexOf('compatible') == -1 && agent.indexOf("opera") == -1 && agent.indexOf("firefox") != -1);
}
var is_scroll = new browserType_scroll();

function siteem_img(img,txt,ln,tg)
{
  this.img = img;
  this.txt = txt;
  this.ln = ln;
  this.tg = tg;
}

function siteem_imgPre(imgTdId, imgId, txtTdId, effectId, delayTime)
{
  this.imgArr = new Array();
  this.imgArrLen = 0;
  this.imgPos = 0;
  this.imgId = imgId;
  this.ImgTdId = imgTdId;
  this.imgTd = document.getElementById(imgTdId);
  this.imgObj = document.getElementById(imgId);
  this.txtTd = document.getElementById(txtTdId);
  this.effectId = effectId;
  this.delayTime = delayTime;
  if (this.delayTime < 1000)
    this.delayTime = 1000;
  this.duration = parseFloat((this.delayTime / 1000) * 0.2);
  if (this.duration > 2)
    this.duration = 2;
  this.add = function (img,txt,ln,tg)
  {
    var si = new siteem_img(img,txt,ln,tg);
    this.imgArr.push(si);
    this.imgArrLen++;
  }
  this.nextImg = function()
  {
    //if ((this.imgTd == null) || (this.imgObj == null) || (this.txtTd == null)) return;
    if ((this.imgTd == null) || (this.imgObj == null)) return;
    this.imgPos++;
    if (this.imgPos >= this.imgArrLen)
      this.imgPos = 0;
    var ramNum = 0;
    if (this.effectId == 23)
      ramNum = parseInt((Math.random() * 100) % 24,10);
    else
      ramNum = this.effectId;
    if (is_scroll.ie)
    {
      this.imgObj.filters["revealTrans"].Transition = ramNum;
      this.imgObj.filters["revealTrans"].Duration = this.duration;
      this.imgObj.filters["revealTrans"].apply();
      this.imgObj.filters["revealTrans"].play();
    }
    this.imgObj.src = this.imgArr[this.imgPos].img;
    if (is_scroll.ie)
    {
      var pe = this.imgObj.parentElement;
      if (pe != null)
      {
        if (this.imgArr[this.imgPos].ln != "")
        {
          if (pe.tagName.toLowerCase() == "a")
          {
            pe.href = this.imgArr[this.imgPos].ln;
            pe.target = this.imgArr[this.imgPos].tg;
          }
          else if ((pe.tagName.toLowerCase() == "td") && (pe.id == this.ImgTdId))
          {//insert A
            var ae = document.createElement("A");
            ae = this.imgObj.applyElement(ae);
            ae.href = this.imgArr[this.imgPos].ln;
            ae.target = this.imgArr[this.imgPos].tg;
          }
        }
        else
        {
          if (pe.tagName.toLowerCase() == "a")
          {
            pe.removeNode();
          }
        }
      }
    }
    else
    {
      var html = "";
      var imgHtml = "";
      var pe = this.imgObj.parentNode;
      if (pe != null)
        imgHtml = pe.innerHTML;
      if (this.imgArr[this.imgPos].ln != "")
      {//add img link
        html = "<a href=\"" + this.imgArr[this.imgPos].ln + "\" target=\"" + this.imgArr[this.imgPos].tg + "\">" + imgHtml + "</a>";
      }
      else
      {//remove img link
        html = imgHtml;
      }
      this.imgTd.innerHTML = html;
    }
    if (this.txtTd != null) {
     this.txtTd.innerHTML = this.imgArr[this.imgPos].txt;
    }
    this.imgObj = document.getElementById(this.imgId);
  }
}

function isJsInternetExplorer()
{
  var agent = navigator.userAgent.toLowerCase();
  if ((agent.indexOf("msie") != -1) && (agent.indexOf("opera") == -1))
    return true;
  else
    return false;
}

var isjsie = isJsInternetExplorer();