jQuery(document).ready(function($) {

		// transition effect
		style = 'easeOutQuart';

		// if the mouse hover the image
				
		
			var photos = $('#banner-items > div');
				var gallery_size = $('#banner-items > div').size();
				var gallery_index = $('#banner-items > div').index(this) + 1; 
				
				for(i=1; i<=gallery_size; i++){
					gallery_index = i;
					photos.css("display", "none");	
				}
						
				gallery_index = 0;
				photos.eq(gallery_index).show();
				
				
				
				
				
				
									
					
					window.setInterval( function play(){ 
								
							gallery_index++;
							photos.css("display","none");
							photos.eq(gallery_index).fadeIn(1500);
														
						if(gallery_index == gallery_size){
							gallery_index = 0;
							photos.css("display","none");
							photos.eq(gallery_index).fadeIn(1500);
							
						}
						
						
						
					
					
					}, 8000);
					
					
										
					
			   
			   
			   
			   
		
		    $('.back-btn').click(function () {
					
					
					if(gallery_index == 0){
						return false;
					}
					
					else if(gallery_index >= 0){
										 
						gallery_index -= 1;	
						photos.css("display","none");
						photos.eq(gallery_index).show();
						return [gallery_index, false];
					}
					
					
					
			 });			
			 
	 		
});
