/***************************************/
/*                                     */
/*   Script: Balaton.cz scripts file   */
/*   Author: Michal Kobelka            */    
/*           michalkobelka@gmail.com   */
/*           EtosComp.eu               */
/*                                     */
/***************************************/

var timer1;

$(document).ready(function() {

  //timer1 = null;
  
  $(".navi").hover(
    function() {
      $(this).stop(true, false).animate({
        left: '0',
        //background-position: '100% -509px',
      }, 500);
      $(this).css("background-position","100% -509px");
  }, function() {
  
    $(".navi").stop(true, false).animate({
      left: '-208',
      //background-position: '100% 0px',
    }, 500);
    $(".navi").css("background-position","100% 0px");
      

  });
});




function scroll(id){

  $('html,body').animate({scrollTop: $("#"+id).offset().top},'slow');
  $("#"+id).find(".bolder").css("color", "#db2307");

}



$(document).ready(function() {
  
  $(".activeb").parent().parent().css("display", "block");
  $(".activeb").parent().parent().parent().find("a").first().addClass("activeul");
  
});


 function mycarousel_initCallback(carousel)
  {
      // Disable autoscrolling if the user clicks the prev or next button.
      carousel.buttonNext.bind('click', function() {
          carousel.startAuto(0);
          $(".pause").hide();
          $(".play").show();
      });    
   
      carousel.buttonPrev.bind('click', function() {
          carousel.startAuto(0);
          $(".pause").hide();
          $(".play").show();
      });
  
  
      $(".pause").click(function() {
          carousel.startAuto(0);
          $(this).hide();
          $(".play").show();
      });       
      $(".play").click(function() {
          carousel.startAuto(1); // Aby to jelo hned po kliknutí na "spustit animaci"
          carousel.startAuto(10); // Tím se přepíše interval a pojede to zase po 10 sekundách
          $(this).hide();
          $(".pause").show();
      });   
      
      
      // Pause autoscrolling if the user moves with the cursor over the clip.
      carousel.clip.hover(function() {
          carousel.stopAuto();
      }, function() {
          carousel.startAuto();
      });    
  
  };
  
  
jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
        auto: 10,
        animation: 2000,
        wrap: 'circular',
        scroll: 1,        
        initCallback: mycarousel_initCallback

    });
});  

  
$(document).ready(function() {

  $(".submenua").hover(function() {
  
    $(this).parent().find(".subul").fadeIn();
    $(this).parent().parent().find(".subul").addClass("fakebor");
    $(this).parent().find(".subul").removeClass("fakebor");
    
    $(".fakebor").fadeOut();
  
  });
  
  $(".subul").hover(function() {
    // do nothing, muhaha
  }, function() {
    $(this).stop(true, false).fadeOut();
  });

});










