idx = -1;
srcs = new Array(17);
srcs[0] = "images/img0.png";
srcs[1] = "images/img1.png";
srcs[2] = "images/img2.png";
srcs[3] = "images/img3.png";
srcs[4] = "images/img4.png";
srcs[5] = "images/img5.png";
srcs[6] = "images/img6.png";
srcs[7] = "images/img7.png";
srcs[8] = "images/img8.png";
srcs[9] = "images/img9.png";
srcs[10]= "images/img10.png";
srcs[11]= "images/img11.png";
srcs[12]= "images/img12.png";
srcs[13]= "images/img13.png";
srcs[14]= "images/img14.png";
srcs[15]= "images/img15.png";
srcs[16]= "images/img16.png";

function TpImageLoad(inSender, inIndex)
{
  img = inSender;
  if (idx < 0)
    Recycle();
}

function Recycle()
{
  // cycle every 8 seconds
  setTimeout( "Cycle()", 8000 );
}

function Cycle()
{
  if (img.filters)
  {
    img.style.filter =
      "blendTrans(duration=2.5) revealTrans(duration=1.0,transition=7)";
    img.filters(0).apply();
    img.filters(1).apply();
  }
  //
  idx = (idx + 1) % 17;
  img.src = srcs[idx];
  //
  if (img.filters)
  {
    img.filters(0).play();
    img.filters(1).play();
  }
  //
  Recycle();
}

idx1 = -1;
srcs1 = new Array(3);
srcs1[0] = "images/imagemx.png";
srcs1[1] = "images/imagemy.png";
srcs1[2] = "images/imagemz.png";

function TpImage1Load(inSender, inIndex)
{
  img1 = inSender;
  if (idx1 < 0)
    Recycle1();
}

function Recycle1()
{
  // cycle every 12 seconds
  setTimeout( "Cycle1()", 10000 );
}

function Cycle1()
{
  if (img1.filters)
  {
    img1.style.filter =
      "blendTrans(duration=2.5) revealTrans(duration=1.0,transition=3)";
    img1.filters(0).apply();
    img1.filters(1).apply();
  }
  //
  idx1 = (idx1 + 1) % 3;
  img1.src = srcs1[idx1];
  //
  if (img1.filters)
  {
    img1.filters(0).play();
    img1.filters(1).play();
  }
  //
  Recycle1();
}
