$(document).ready(function(){ 



	//Define the animation speed for the Carousel 
	var speed = 5000; 
	//delay between transitions
	var delay = 12000;
	//how many images there are total
	var imagestotal= $('.banner').size();
	//imagewidth
	var imagewidth = 100;
	//imageheight
	var imageheight = 100;
	//used to count through the images
	var opaqueimage = 1;
	//sets banner animate type (only set one, 1=on 0=off)
	var fade = 0;
	var slide_instant = 0;
	var slide_smooth = 1;
		var imagesdisplayed = 5; //for sliders
		var leftx = 0;
		var maxleftx = -(imagewidth * imagestotal);
	//allow custom styling or using variables here
	var custom_styles = 1;



$('.banner').css( "opacity", "0" ); 
$('.banner').css( "zIndex", "0" ); 
$('.banner:nth-child('+opaqueimage+')').css( "opacity", "1" );
$('.banner:nth-child('+opaqueimage+')').css( "zIndex", "1" ); 
 

function wait()
	{

	setTimeout(fader, delay)
	}
	
	function fader()
	{
	
	if (opaqueimage == imagestotal)
	{

	
	
	$('.banner:nth-child('+opaqueimage+')').animate({ opacity: 0}, speed)
	$('.banner:nth-child('+opaqueimage+')').css( "zIndex", "0" );
	
	$('.banner:nth-child('+1+')').animate({ opacity: 1}, speed)
	$('.banner:nth-child('+1+')').css( "zIndex", "1" ); 
	
	opaqueimage = 1;
	
	}
	else
	{

	
	
	$('.banner:nth-child('+opaqueimage+')').animate({ opacity: 0}, speed)
	$('.banner:nth-child('+opaqueimage+')').css( "zIndex", "0" );
	
	$('.banner:nth-child('+(opaqueimage+1)+')').animate({ opacity: 1}, speed)
	$('.banner:nth-child('+(opaqueimage+1)+')').css( "zIndex", "1" ); 	
	opaqueimage = opaqueimage +1;
	}
	
	wait()
	}
	
setTimeout(fader, speed)
	});
	
	
