// image fading ie & others
//
// 2006-10-22
// Copyright (c)2006 guru@guruware
//-------------------------------------------------

nStartImages = 1;
si_names = new Array("normal.jpg");
var si = new Array(1);

//-----< IE image-fading >-----
var fader = "";
blendInt = 3;
maxLoops = 0;
finite = (maxLoops > 0) ? 1 : 0;

function BrowserCheck()
{
  var b = navigator.appName
  if (b=="Netscape") this.b = "ns"
  else if (b=="Microsoft Internet Explorer") this.b = "ie"
  else this.b = b
  this.v = parseInt(navigator.appVersion)
  this.ns = (this.b=="ns" && this.v>=4)
  this.ns4 = (this.b=="ns" && this.v==4)
  this.ns5 = (this.b=="ns" && this.v==5)
  this.ie = (this.b=="ie" && this.v>=4)
  this.ie4 = (navigator.userAgent.indexOf('MSIE 4')>0)
  this.ie5 = (navigator.userAgent.indexOf('MSIE 5')>0)
  this.ie6 = (navigator.userAgent.indexOf('MSIE 6')>0)
  this.ie7 = (navigator.userAgent.indexOf('MSIE 7')>0)
  if (this.ie6) this.v = 6
  this.min = (this.ns||this.ie)
}

is = new BrowserCheck()

function initFader()
{
  count = 0;
  if(finite)
    loopCount = 0;
  blendTimer = setInterval("Fade()", blendInt*1000);
}

function Fade()
{
  if(finite && loopCount==maxLoops)
  {
    clearInterval(blendTimer);
    return;
  }

  _img = document.images[fader];
  if(_img == undefined)
  {
    clearInterval(blendTimer);
    return;
  }

  _img2 = "img/"+fader+".jpg";

  if(fader == "normalmap")
    _img1 = "img/"+fader+"_f.jpg";
  else
    _img1 = _img2;

  if(is.ie)
    _img.filters.blendTrans.Apply();

  if(count==0)
    _img.src = _img1;
  else
    _img.src = _img2;

  if(is.ie)
    _img.filters.blendTrans.Play();

  count++;
  if(count == 2) 
  {
    count=0;
    if(finite)
      loopCount++;
  }
}

//-----< the end >---------------------------------
