$(document).ready(function() {
//ANIMATION HOME
  $('#AnimationTop').tabs({fx:{opacity: "show"}}).tabs("rotate", 5000, true);
  $('#tabs').tabs({fx:{opacity: "show"}}).tabs("rotate", 5000, true);
  
//ANIMATION END
  
//SUPERFISH
  $('ul.sf-menu').superfish();
//SUPERFISH
  
//FONT SIZE RESET
  
 // Reset Font Size
 var originalFontSize = $('div#Contenido').css('font-size');
   $(".resetFont").click(function(){
   $('div#Contenido').css('font-size', originalFontSize);
 });
  
 // Increase Font Size
 $(".increaseFont").click(function(){
   var currentFontSize = $('div#Contenido').css('font-size');
   var currentFontSizeNum = parseFloat(currentFontSize, 10);
   var newFontSize = currentFontSizeNum*1.2;
     $('div#Contenido').css('font-size', newFontSize);
     return false;
 });
  
 // Decrease Font Size
 $(".decreaseFont").click(function(){
   var currentFontSize = $('div#Contenido').css('font-size');
   var currentFontSizeNum = parseFloat(currentFontSize, 10);
   var newFontSize = currentFontSizeNum*0.8;
     $('div#Contenido').css('font-size', newFontSize);
     return false;
 });
  
//PIROBOX
$().piroBox_ext({
    piro_speed : 700,
    bg_alpha : 0.5,
    piro_scroll : true // pirobox always positioned at the center of the page
});
  
//GALERIA DE FOTOS
$("ul.thumb li").hover(function() {
    $(this).css({'z-index' : '10'});
    $(this).find('span.p').css({'z-index' : '11','visibility' : 'visible'}).stop().animate({
        left: '-30px',
        bottom: '-24px',
        width: '164px'
    }, 200);
    $(this).find('img.fl').addClass("hover").stop()
      .animate({
        marginTop: '-110px', 
        marginLeft: '-110px', 
        top: '50%', 
        left: '50%', 
        width: '174px', 
        height: '174px',
        padding: '20px' 
      }, 200);
    
    } , function() {
    $(this).css({'z-index' : '0'});
    $(this).find('span.p').css({'z-index' : '0','visibility' : 'hidden'}).stop().animate({
        left: '6px',
        bottom: '14px',
        width: '90px'
    });
    $(this).find('img.fl').removeClass("hover").stop()
      .animate({
        marginTop: '0', 
        marginLeft: '0',
        top: '0', 
        left: '0', 
        width: '100px', 
        height: '100px', 
        padding: '5px'
      }, 400);
});
 
  
  /*Tabs*/
  




  //Default Action
  $(".tab_content").hide(); //Hide all content
  $("ul.tabs li:first").addClass("active").show(); //Activate first tab
  $(".tab_content:first").show(); //Show first tab content
  
  //On Click Event
  $("ul.tabs li").click(function() {
    $("ul.tabs li").removeClass("active"); //Remove any "active" class
    $(this).addClass("active"); //Add "active" class to selected tab
    $(".tab_content").hide(); //Hide all tab content
    var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
    $(activeTab).fadeIn(); //Fade in the active content
    return false;
  });

  /*FUTBOLCONTENT*/

  //Default Action
  $(".CotentFutbolstab_content").hide(); //Hide all content
  $("ul.CotentFutbolstabs li:first").addClass("active").show(); //Activate first tab
  $(".CotentFutbolstab_content:first").show(); //Show first tab content
  
  //On Click Event
  $("ul.CotentFutbolstabs li").click(function() {
    $("ul.CotentFutbolstabs li").removeClass("active"); //Remove any "active" class
    $(this).addClass("active"); //Add "active" class to selected tab
    $(".CotentFutbolstab_content").hide(); //Hide all tab content
    var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
    $(activeTab).fadeIn(); //Fade in the active content
    return false;
  });
  
  /*FederacionesClubs*/
  
    $(".FederacionesClubstab_content").hide(); //Hide all content
  $("ul.FederacionesClubstabs li:first").addClass("active").show(); //Activate first tab
  $(".FederacionesClubstab_content:first").show(); //Show first tab content
  
  //On Click Event
  $("ul.FederacionesClubstabs li").click(function() {
    $("ul.FederacionesClubstabs li").removeClass("active"); //Remove any "active" class
    $(this).addClass("active"); //Add "active" class to selected tab
    $(".FederacionesClubstab_content").hide(); //Hide all tab content
    var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
    $(activeTab).fadeIn(); //Fade in the active content
    return false;
  });
/*jquery*/
  $('#anuncio1').cycle({    
    fx: 'turnDown' // choose your transition type, ex: fade, scrollUp, shuffle, etc...  
  });
  
  $('#anuncio2').cycle({    
    fx: 'scrollRight' // choose your transition type, ex: fade, scrollUp, shuffle, etc...  
  });
  
  $('#anuncio3').cycle({    
    fx: 'scrollLeft' // choose your transition type, ex: fade, scrollUp, shuffle, etc...  
  });
  
  $('.BannerTop div.imagen').cycle({    
    fx: 'scrollUp' ,
    speed:    900, 
    timeout:  9000
  });
  
  $('#BannerEventos').cycle({    
    fx: 'turnUp' // choose your transition type, ex: fade, scrollUp, shuffle, etc...  
  });
   
  $('#mycarousel').jcarousel({
      wrap: 'circular',
      scroll: 1,
      auto: 2
    });
   $('#mycarousel2').jcarousel({
     
     vertical: true,
     wrap: 'circular',
     auto: 5,
     scroll:1
    });
  
      
$('#slideshow').cycle({ 
    fx:     'turnDown', 
    speed:  'fast', 
    timeout: 7000, 
    pager:  '#nav', 

    pagerAnchorBuilder: function(idx, slide) {
        return '#nav li:eq(' + idx + ') a'; 
    }     
});

  $("#tab1").cycle({
    fx: "turnUp",
      speed:  'slow', 
    timeout: 7000
   
    
  });
  
    $("#tab2").cycle({
    fx: "turnUp"   
    
  });
  
  
  
  
  
  
  /*--------------------------------------------------------------------*/
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
});
