// JavaScript Document
function swapImages1(){
  var $active1 = $('.animate1 .active1');
  var $next1 = ($('.animate1 .active1').next().length > 0) ? $('.animate1 .active1').next() : $('.animate1 img:first');
  $active1.fadeOut(function(){
    $active1.removeClass('active1');
    $next1.fadeIn().addClass('active1');
  });
}

function swapImages2(){
  var $active2 = $('.animate2 .active2');
  var $next2 = ($('.animate2 .active2').next().length > 0) ? $('.animate2 .active2').next() : $('.animate2 img:first');
  $active2.fadeOut(function(){
    $active2.removeClass('active2');
    $next2.fadeIn().addClass('active2');
  });
}

function swapImages3(){
  var $active3 = $('.animate3 .active3');
  var $next3 = ($('.animate3 .active3').next().length > 0) ? $('.animate3 .active3').next() : $('.animate3 img:first');
  $active3.fadeOut(function(){
    $active3.removeClass('active3');
    $next3.fadeIn().addClass('active3');
  });
}

function swapImages4(){
  var $active4 = $('.animate4 .active4');
  var $next4 = ($('.animate4 .active4').next().length > 0) ? $('.animate4 .active4').next() : $('.animate4 img:first');
  $active4.fadeOut(function(){
    $active4.removeClass('active4');
    $next4.fadeIn().addClass('active4');
  });
}

function swapImages5(){
  var $active5 = $('.animate5 .active5');
  var $next5 = ($('.animate5 .active5').next().length > 0) ? $('.animate5 .active5').next() : $('.animate5 img:first');
  $active5.fadeOut(function(){
    $active5.removeClass('active5');
    $next5.fadeIn().addClass('active5');
  });
}

function swapImages6(){
  var $active6 = $('.animate6 .active6');
  var $next6 = ($('.animate6 .active6').next().length > 0) ? $('.animate6 .active6').next() : $('.animate6 img:first');
  $active6.fadeOut(function(){
    $active6.removeClass('active6');
    $next6.fadeIn().addClass('active6');
  });
}

function swapImages7(){
  var $active7 = $('.animate7 .active7');
  var $next7 = ($('.animate7 .active7').next().length > 0) ? $('.animate7 .active7').next() : $('.animate7 img:first');
  $active7.fadeOut(function(){
    $active7.removeClass('active7');
    $next7.fadeIn().addClass('active7');
  });
}

function swapImagesA(){
  var $activeA = $('.animateA .activeA');
  var $nextA = ($('.animateA .activeA').next().length > 0) ? $('.animateA .activeA').next() : $('.animateA img:first');
  $activeA.fadeOut(function(){
    $activeA.removeClass('activeA');
    $nextA.fadeIn().addClass('activeA');
  });
}

function swapImagesB(){
  var $activeB = $('.animateB .activeB');
  var $nextB = ($('.animateB .activeB').next().length > 0) ? $('.animateB .activeB').next() : $('.animateB img:first');
  $activeB.fadeOut(function(){
    $activeB.removeClass('activeB');
    $nextB.fadeIn().addClass('activeB');
  });
}

function swapImagesC(){
  var $activeC = $('.animateC .activeC');
  var $nextC = ($('.animateC .activeC').next().length > 0) ? $('.animateC .activeC').next() : $('.animateC img:first');
  $activeC.fadeOut(function(){
    $activeC.removeClass('activeC');
    $nextC.fadeIn().addClass('activeC');
  });
}

function swapImagesD(){
  var $activeD = $('.animateD .activeD');
  var $nextD = ($('.animateD .activeD').next().length > 0) ? $('.animateD .activeD').next() : $('.animateD img:first');
  $activeD.fadeOut(function(){
    $activeD.removeClass('activeD');
    $nextD.fadeIn().addClass('activeD');
  });
}

function swapImagesE(){
  var $activeE = $('.animateE .activeE');
  var $nextE = ($('.animateE .activeE').next().length > 0) ? $('.animateE .activeE').next() : $('.animateE img:first');
  $activeE.fadeOut(function(){
    $activeE.removeClass('activeE');
    $nextE.fadeIn().addClass('activeE');
  });
}

function swapImagesF(){
  var $activeF = $('.animateF .activeF');
  var $nextF = ($('.animateF .activeF').next().length > 0) ? $('.animateF .activeF').next() : $('.animateF img:first');
  $activeF.fadeOut(function(){
    $activeF.removeClass('activeF');
    $nextF.fadeIn().addClass('activeF');
  });
}

$(document).ready(function(){
	setInterval('swapImages1()', 6500);
	setInterval('swapImages2()', 5000);
	setInterval('swapImages3()', 5000);
	setInterval('swapImages4()', 5000);
	setInterval('swapImages5()', 5000);
	setInterval('swapImages6()', 5000);
	setInterval('swapImages7()', 5000);
	setInterval('swapImagesA()', 8000);
	setInterval('swapImagesB()', 8000);
	setInterval('swapImagesC()', 8000);
	setInterval('swapImagesD()', 8000);
	setInterval('swapImagesE()', 8000);
	setInterval('swapImagesF()', 8000);
});
