/*ROTATING BANNER*/
if (document.images)
{
pic1= new Image(); 
pic1.src="images/rotate1.jpg"; 

pic2= new Image(); 
pic2.src="images/rotate2.jpg"; 

pic3= new Image(); 
pic3.src="images/rotate3.jpg"; 

pic4= new Image(); 
pic4.src="images/rotate4.jpg"; 
}

var num = 1;
var fouttime;
var fintime;
var r;
var fo;
var fi;

function startroto()
  {
    clearTimeout(r);
    r = setTimeout('rotation()', 7000);
  }

function rotation()
  {
    if (num == 4)
      {
        num = 0;
      }
    num++;
    fouttime = 100;
    fadeout();
    fintime = 0;
    fadein();
    r = setTimeout('rotation()', 8000);
  }

function fadeout()
  {
    if (num == 1)
      {
        var fout = document.getElementById('rotate4');
      }
    else if (num == 2)
      {
        var fout = document.getElementById('rotate1');
      }
    else if (num == 3)
      {
        var fout = document.getElementById('rotate2');
      }
    else if (num == 4)
      {
        var fout = document.getElementById('rotate3');
      }

    if (fouttime > 0)
      {
        fouttime--;
        fouttime--;
        fouttime--;
        fouttime--;
        fouttime--;
        fo = setTimeout('fadeout()', 5);
      }
    fout.style.opacity = fouttime*.01;
    fout.style.filter = "alpha(opacity=" + fouttime + ")";
    fout.style.zIndex = "0";
  }
    
function fadein()
  {
    var fin = document.getElementById('rotate' + num);
    if (fintime < 99)
      {
        fintime++;
        fintime++;
        fintime++;
        fintime++;
        fintime++;
        fi = setTimeout('fadein()', 5);
      }
    fin.style.opacity = fintime*.01;
    fin.style.filter = "alpha(opacity=" + fintime + ")";
    fin.style.zIndex = "1";
  }
