var x = 1;

function rolling_event(total){ 
	

	//alert('total = ' + total + ' , x = ' + x);

	if(x == 1){
	
		$('#event_'+ total).fadeOut(1500,function(){
			$('#event_'+ 1).fadeIn(1500);
		});
	}

	if(x == 2){
	
		$('#event_'+ 1).fadeOut(1500,function(){
			$('#event_'+ 2).fadeIn(1500);
		});
	}

	if(x == 3){
	
		$('#event_'+ 2).fadeOut(1500,function(){
			$('#event_'+ 3).fadeIn(1500);
		});
	}

	if(x == 4){
	
		$('#event_'+ 3).fadeOut(1500,function(){
			$('#event_'+ 4).fadeIn(1500);
		});
	}

	if(x == 5){
	
		$('#event_'+ 4).fadeOut(1500,function(){
			$('#event_'+ 5).fadeIn(1500);
		});
	}

	if(x == 6){
	
		$('#event_'+ 5).fadeOut(1500,function(){
			$('#event_'+ 6).fadeIn(1500);
		});
	}

	if(x == 7){
	
		$('#event_'+ 6).fadeOut(1500,function(){
			$('#event_'+ 7).fadeIn(1500);
		});
	}


	x++;	
	if(x > total){ x=1; }

	setTimeout('rolling_event(total)', 6000); 

}


/*
function rolling_event(total){ 
	
	if(x == 1){			
		z = total;		
	}else{			
		z = x - 1; 
	}
	
	$('#event_'+ z).fadeOut(2000,function(){
		
		if(z == total){
			x = 1;
		}else{
			x = z + 1;
		}
		
		//alert( 'z = ' + z + ' , x = ' + x + ' , total = ' + total);

		$('#event_'+ x).fadeIn(2000);
	});

	x++;	
	if(x > total){ x=1; }

}
*/



/*
function rolling_event_1(){ 

	if(x <= 2){ 
		
		if(x == 1){
						
			$('#event_'+ 2).fadeOut(1500,function(){
				$('#event_'+ 1).fadeIn(1500);
			});

		}else if(x == 2){
			
			$('#event_'+ 1).fadeOut(1500,function(){
				$('#event_'+ 2).fadeIn(1500);
			});
		}

		x++;	
		if(x > 2){ x=1; }
	}//if 
} 


function rolling_event_2(){ 
		
		if(x == 1){
						
			$('#event_'+ 3).fadeOut(1500,function(){
				$('#event_'+ 1).fadeIn(1500);
			});

		}else if(x == 2){
			
			$('#event_'+ 1).fadeOut(1500,function(){
				$('#event_'+ 2).fadeIn(1500);
			});
		}else if(x == 3){
			
			$('#event_'+ 2).fadeOut(1500,function(){
				$('#event_'+ 3).fadeIn(1500);
			});
		}

		x++;	
		if(x > 3){ x=1; }
} 
*/
