//NETVISION SLIDESHOW



$(document).ready(function(){

		$('#fr li').hide().css({'position':'absolute'});	

		var z = 9;
		$('#cr li').each(function(){
			$(this).css({'zIndex':z});
			z--;
		});	
});

$(window).load(function(){		

		$('#cr li').css({'position':'absolute'});			
		$('#cr li').css({'opacity': '1', 'display':'block'});
		
		var nueva = 'si';
		carrusel();		
		function carrusel(){				
				
				var vc = 1000; // velocidad en los fades	
				var delai = 3500;  // delay intermedio									
								
					$('#fr li:first-child').delay(delai).fadeIn(vc);
					$('#cr li:nth-child(2)').delay(delai).fadeIn(vc);
					$('#cr li:first-child').delay(delai).fadeOut(vc, function(){

					$('#fr li:first-child').delay(delai).fadeOut(vc);
					$('#fr li:nth-child(2)').delay(delai).fadeIn(vc);
					$('#cr li:nth-child(3)').delay(delai).fadeIn(vc);
					$('#cr li:nth-child(2)').delay(delai).fadeOut(vc, function(){
					
						$('#fr li:nth-child(2)').delay(delai).fadeOut(vc);
						$('#fr li:nth-child(3)').delay(delai).fadeIn(vc);
						$('#cr li:nth-child(4)').delay(delai).fadeIn(vc);
						$('#cr li:nth-child(3)').delay(delai).fadeOut(vc, function(){
						
								$('#fr li:nth-child(3)').delay(delai).fadeOut(vc);
								$('#fr li:nth-child(4)').delay(delai).fadeIn(vc);
								$('#cr li:nth-child(5)').delay(delai).fadeIn(vc);
								$('#cr li:nth-child(4)').delay(delai).fadeOut(vc, function(){

										/*
										$('#fr li:nth-child(3)').delay(delai).fadeOut(vc);
										$('#fr li:nth-child(4)').delay(delai).fadeIn(vc);
										$('#cr li:nth-child(5)').delay(delai).fadeIn(vc);
										$('#cr li:nth-child(4)').delay(delai).fadeOut(vc, function(){
										*/
										
												$('#fr li:nth-child(4)').delay(delai).fadeOut(vc);
												$('#fr li:nth-child(5)').delay(delai).fadeIn(vc);
												$('#cr li:nth-child(6)').delay(delai).fadeIn(vc);
												$('#cr li:nth-child(5)').delay(delai).fadeOut(vc, function(){
												
													$('#fr li:nth-child(5)').delay(delai).fadeOut(vc);
													$('#fr li:nth-child(6)').delay(delai).fadeIn(vc);
													$('#cr li:nth-child(7)').delay(delai).fadeIn(vc);
													$('#cr li:nth-child(6)').delay(delai).fadeOut(vc, function(){
													
															$('#fr li:nth-child(6)').delay(delai).fadeOut(vc);
															$('#fr li:nth-child(7)').delay(delai).fadeIn(vc);
															$('#cr li:nth-child(8)').delay(delai).fadeIn(vc);
															$('#cr li:nth-child(7)').delay(delai).fadeOut(vc, function(){
															
																					$('#fr li:nth-child(7)').delay(delai).fadeOut(vc);
																					$('#fr li:nth-child(8)').delay(delai).fadeIn(vc);
																					$('#cr li:nth-child(9)').delay(delai).fadeIn(vc);
																					$('#cr li:nth-child(8)').delay(delai).fadeOut(vc, function(){

																						$('#cr li:nth-child(9)').delay(delai).fadeOut(vc);
																						$('#cr li:first-child').delay(delai).fadeIn(vc);
																						//$('#fr li:first-child').delay(delai).fadeIn(vc);
																						$('#fr li:nth-child(8)').delay(delai).fadeOut(vc, function(){

																						carrusel();

																						});
																					});
															});
													});
												});	
										/* }); */
								});
						});
					});
				});
			}	
});




