// JavaScript Document

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-28151219-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();



var actual = 1;

function primero(){
	_gaq.push(['_trackEvent','home', 'click']);
	 $('#sombra').animate({
			opacity: 1,
			//marginRight: '594px',
			width: '0'
		  	}, 300);
		   $('#chica').animate({
			opacity: 1,
			top: '-63px'
		  	}, 600);
		  
	
	$('#btnIzq').hide();
	$('#btnDer').show();
	
	
	
	/*var ua = $.browser;   
	if ( ua.msie && ua.version.slice(0,1) == "7" ) {    
			$('#btnDer').css('top', '-45px')
	  } 
	  */
	//$('#btnDer').css('top', '-45px')
	//$('#btnDer').css('margin-top', '0px')
	
	actual = 1;
	  $("#barraAzul").animate({
		opacity: 1,
			top: '250px'
		  	}, 600);
		  
		 $("#contenido1").animate({
		opacity: 1,
			left: '0px'
		  	}, 600);
		  $("#contenido2").animate({
		opacity: 1,
			left: '3000px'
			}, 600);
		  $("#contenido3").animate({
		opacity: 1,
			left: '6000px'
		  	}, 600);
		  $("#contenido4").animate({
		opacity: 1,
			left: '9000px'
		  	}, 600);
			 $("#contenido5").animate({
		opacity: 1,
			left: '12000px'
		  	}, 600);
		  
	}

	
	
	function tercero(){
		 
		_gaq.push(['_trackEvent','mecanica', 'click']);
		 $('#sombra').animate({
			opacity: 1,
			marginRight: '665px',
			width: '87'
		  	}, 300);
		  
		    $('#chica').animate({
			opacity: 1,
			top: '2000px'
		  	}, 600);
		  
		
	$('#btnIzq').show();
	$('#btnDer').show();
	/*var ua = $.browser;   
	if ( ua.msie && ua.version.slice(0,1) == "7" ) {    
			$('#btnDer').css('margin-top', '-45px')
	  } */
	
		
	
	actual = 3;
		   $("#barraAzul").animate({
		opacity: 1,
			top: '415px'
		  	}, 600);
		  
		   $("#contenido1").animate({
		opacity: 1,
			left: '-6000px'
		  	}, 600);
		  
		  $("#contenido3").animate({
		opacity: 1,
			left: '0px'
		  	}, 600);
		  $("#contenido4").animate({
		opacity: 1,
			left: '3000px'
		  	}, 600);
			$("#contenido5").animate({
		opacity: 1,
			left: '6000px'
		  	}, 600);

		  
	}
	function cuarto(){
		 
		_gaq.push(['_trackEvent','mecanica', 'click']);
		 $('#sombra').animate({
			opacity: 1,
			marginRight: '359px',
			width: '192'
		  	}, 300);
		  
		    $('#chica').animate({
			opacity: 1,
			top: '2000px'
		  	}, 600);
		  
		
			$('#btnIzq').show();
			$('#btnDer').show();
	/*var ua = $.browser;   
	if ( ua.msie && ua.version.slice(0,1) == "7" ) {    
			$('#btnDer').css('margin-top', '-45px')
	  } */
	
		
	
	actual = 4;
		   $("#barraAzul").animate({
		opacity: 1,
			top: '415px'
		  	}, 600);
		  
		  $("#contenido1").animate({
		opacity: 1,
			left: '-9000px'
		  	}, 600);
			$("#contenido2").animate({
		opacity: 1,
			left: '-6000px'
		  	}, 600);
		   $("#contenido3").animate({
		opacity: 1,
			left: '-3000px'
		  	}, 600);
		  
		  $("#contenido4").animate({
		opacity: 1,
			left: '0px'
		  	}, 600);
		  $("#contenido5").animate({
		opacity: 1,
			left: '3000px'
		  	}, 600);

		  
	}



	function quinto(){
		
		_gaq.push(['_trackEvent','bases', 'click']);
		 $('#sombra').animate({
			opacity: 1,
			marginRight: '61px',
			width: '184'
		  	}, 300);
		  
		  $('#chica').animate({
			opacity: 1,
			top: '2000px'
		  	}, 600);
		
		
		$('#btnIzq').show();
		$('#btnDer').hide();
	
	
	actual = 5;
		   $("#barraAzul").animate({
		opacity: 1,
			top: '325px'
		  	}, 600);
			
		  $("#contenido1").animate({
		opacity: 1,
			left: '-12000px'
		  	}, 600);
		   $("#contenido2").animate({
		opacity: 1,
			left: '-9000px'
		  	}, 600);
		  $("#contenido3").animate({
		opacity: 1,
			left: '-6000px'
		  	}, 600);
		  $("#contenido4").animate({
		opacity: 1,
			left: '-3000px'
		  	}, 600);
		  $("#contenido5").animate({
		opacity: 1,
			left: '0px'
		  	}, 600);
			

		  
	}	


function siguiente(){
	
	_gaq.push(['_trackEvent','Flecha derecha', 'click']);
	if(actual == 1){
		tercero();
	}
	else if(actual == 3){
		cuarto();
	}
	else if(actual == 4){
		quinto();
	}
}
	
function anterior(){
	
	_gaq.push(['_trackEvent','Flecha izquerda', 'click']);
	if(actual == 3){
		primero();
	}
	else if(actual == 4){
		tercero();
	}
	else if(actual == 5){
		cuarto();
	}
	
}


$(document).ready(function() {
	$('#btnIzq').hide();
		$('#btnDer').show();
	
$("#contenido1").animate({
		opacity: 1,
			left: '0px'
		  	}, 0);

			$("#barraAzul").animate({
		opacity: 1,
			left: '0px'
		  	}, 0);
			
			$("#chica").animate({
		opacity: 1,
			left: '0px'
		  	}, 0);
			
			
			
			
			
	
	 $("#jtable").dataTable({
                        "bPaginate": false,
                        "bLengthChange": false,
                        "bFilter": true,
                        "bSort": false,
                        "bInfo": false,
                        "bAutoWidth": false,
                     "aoColumns": [
                                        null,
                                        null //put as many null values as your columns

                    ]
                    });

	
	$('.scroll1').jScrollPane();
	
	
	
	
	


	$('#btn_ganadores').mouseover(function() {
		  $('#sombra').animate({
			opacity: 1,
			
			
			marginRight: '694px',
			width: '99'
			
		  	}, 300);
	});
	
	$('#btn_mecanica').mouseover(function() {
		  $('#sombra').animate({
			opacity: 1,
			marginRight: '665px',
			width: '87'
		  	}, 300);
	});
	
	$('#btn_bases').mouseover(function() {
		  $('#sombra').animate({
			opacity: 1,
			marginRight: '359px',
			width: '192'
		  	}, 300);
	});
	$('#btn_aviso').mouseover(function() {
		  $('#sombra').animate({
			opacity: 1,
			marginRight: '61px',
			width: '184'
		  	}, 300);
	});
	
	function regresar(){
		 if(actual == 1){
				$('#sombra').animate({
					opacity: 1,
					//marginRight: '594px',
					width: '0'
		  			}, 300);  
			  
			}else if(actual==2){
				 $('#sombra').animate({
			opacity: 1,
			marginRight: '665px',
			width: '99'
		  	}, 300);
			}
			else if(actual==3){
				  $('#sombra').animate({
			opacity: 1,
			marginRight: '665px',
			width: '87'
		  	}, 300);
			}
			else if(actual==4){
				   $('#sombra').animate({
			opacity: 1,
			marginRight: '359px',
			width: '192'
		  	}, 300);
			}
			else if(actual==5){
				   $('#sombra').animate({
			opacity: 1,
			marginRight: '61px',
			width: '184'
		  	}, 300);
			}
		}
	
		$('#btn_ganadores').mouseout(function() {
				regresar();
	});
	
	$('#btn_mecanica').mouseout(function() {
		 regresar();
	});
	
	$('#btn_bases').mouseout(function() {
		 regresar();
	});
	
	
	
	



	$('#btnDer_img').click(function() {
		  siguiente();
	});
	
	
	$('#btnIzq_img').click(function() {
		 anterior();
	});
	
	$('#btn_ganadores').click(function() {
		  segundo();
	});
	$('#btn_mecanica').click(function() {
		  tercero();
	});
	$('#btn_bases').click(function() {
		  cuarto();
	});
	$('#btn_aviso').click(function() {
		  quinto();
	});
	$('#logo').click(function() {
		  primero();
	});


 
});

