
var ie5;
var ns6;

nPlus = 5;  //the % of fading for each step
speed = 50;  //the speed
delay=4000;

// You don't have to edit below this line
nOpac = 100;

inum=1;

function FadeImg(){
    if(document.getElementById)
    {
        inum2=inum+1;
        if (!document.getElementById('img'+inum2)) inum2=1;
        imgs = document.getElementById('img'+inum);
        imgf = document.getElementById('img'+inum2);


	opacity = nOpac-nPlus;
	nOpac = opacity;

    if(opacity>100 || opacity<0){
        //nPlus=-nPlus;
    }
    if(ie5){
        imgs.style.filter="alpha(opacity=0)";
      	imgs.filters.alpha.opacity = opacity;
        imgf.style.filter="alpha(opacity=100)";
      	imgf.filters.alpha.opacity = 100-opacity;
    }
    if(ns6){
       	imgs.style.opacity = opacity/100;
       	imgf.style.opacity = (100-opacity)/100;
    }

     document.getElementById('img'+inum).style.visibility="visible";
     document.getElementById('img'+inum2).style.visibility="visible";

    if (opacity<0 || opacity>100)
    {
	   nOpac = 100;
         document.getElementById('img'+inum).style.visibility="hidden";
          inum++;
       if (!document.getElementById('img'+inum)) inum=1;
       setTimeout('FadeImg()',delay*2);
    }
    else
    {
        setTimeout('FadeImg()',speed);
    }
  }
}

function startfade()
{
   ie5=(document.getElementById && document.all);
   ns6=(document.getElementById && !document.all);
   if (document.getElementById('faderimages'))
   {

     document.getElementById('img'+inum).style.visibility="visible";
     document.getElementById('img'+inum).style.filter="alpha(opacity=100)";
     document.getElementById('img'+inum).style.opacity=1;
     setTimeout('FadeImg()',delay);
   }
}


