
function banner_switch1(){
	//This function is called on to switch the banners out when the time limit is reached
	shuffle1();
	
	var next =  $('.banner1.current1').next('.banner1').length ? $('.banner1.current1').next('.banner1') : $('#banners1 .banner1:first');
	$(next).show();
	$(".current1").fadeOut().removeClass("current1");
	$(next).addClass("current1");
}

function shuffle1(){
	//This function takes every .banner and changes the z-index to 1, hides them,
	//then takes the ".current" banner and brings it above and shows it
	$(".banner1").css("z-index", 1).hide();
	$(".current1").css("z-index", 2).show();
}

function banner_switch2(){
	//This function is called on to switch the banners out when the time limit is reached
	shuffle2();
	
	var next =  $('.banner2.current2').next('.banner2').length ? $('.banner2.current2').next('.banner2') : $('#banners2 .banner2:first');
	$(next).show();
	$(".current2").fadeOut().removeClass("current2");
	$(next).addClass("current2");
}

function banner_switch3(){
	//This function is called on to switch the banners out when the time limit is reached
	shuffle3();
	
	var next =  $('.banner3.current3').next('.banner3').length ? $('.banner3.current3').next('.banner3') : $('#banners3 .banner3:first');
	$(next).show();
	$(".current3").fadeOut().removeClass("current3");
	$(next).addClass("current3");
}

function shuffle2(){
	//This function takes every .banner and changes the z-index to 1, hides them,
	//then takes the ".current" banner and brings it above and shows it
	$(".banner2").css("z-index", 1).hide();
	$(".current2").css("z-index", 2).show();
}

function shuffle3(){
	//This function takes every .banner and changes the z-index to 1, hides them,
	//then takes the ".current" banner and brings it above and shows it
	$(".banner3").css("z-index", 1).hide();
	$(".current3").css("z-index", 2).show();
}

function interval2() {
	//Initial timer setting
	slide2 = setInterval( "banner_switch2()", 4000 );
}

function interval3() {
	//Initial timer setting
	slide3 = setInterval( "banner_switch3()", 3000 );
}

$(function() {
	//Initial timer setting
	slide1 = setInterval( "banner_switch1()", 4000 );
	setTimeout("interval2()", 2000);
});

