  /**
   * We use the initCallback callback
   * to assign functionality to the controls
   */
  function mycarousel_initCallback(carousel) {
      jQuery('.jcarousel-next').bind('click', function() {
          carousel.next();
          return false;
      });
   
      jQuery('.jcarousel-prev').bind('click', function() {
          carousel.prev();
          return false;
      });
  };

  function carousel_initCallback(carousel) {
      jQuery('.jcarousel-next').bind('click', function() {
          if ($(this).hasClass('jcarousel-next-disabled') === false) $(this).parents('.mycarousel').next();
          return false;
      });
   
      jQuery('.jcarousel-prev').bind('click', function() {
          if ($(this).hasClass('jcarousel-prev-disabled') === false) $(this).parents('.mycarousel').prev();
          return false;
      });
  };

  function disableCustomButtons(carousel){
      var prev_class = 'jcarousel-prev-disabled jcarousel-prev-disabled-horizontal';
      if (carousel.first == 1) {
      $('.jcarousel-prev').attr('disabled', 'true').addClass(prev_class);
      } else {
      $('.jcarousel-prev').attr('disabled', 'false').removeClass(prev_class);
      }
  
      var next_class = 'jcarousel-next-disabled jcarousel-next-disabled-horizontal';
      if (carousel.last == carousel.size()) {
      $('.jcarousel-next').attr('disabled', 'true').addClass(next_class);
      } else {
      $('.jcarousel-next').attr('disabled', 'false').removeClass(next_class);
      }
  }   

  $(document).ready(function() {
      $('.news_ticker').vTicker({
            speed: 1000,
            pause: 6000,
            showItems: 1,
            animation: 'fade',
            mousePause: true,
            height: 0,
            direction: 'up'
      });

      jQuery('.mycarousel').jcarousel({
          scroll: 1,
          initCallback: carousel_initCallback,
          // This tells jCarousel NOT to autobuild prev/next buttons
          buttonNextHTML: null,
          buttonPrevHTML: null
      });

    	$('.gallery_images ul li a').fancybox({
    		'transitionIn'	:	'elastic',
    		'transitionOut'	:	'elastic',
    		'speedIn'		:	600, 
    		'speedOut'		:	200, 
    		'overlayShow'	:	true
    	});

    	$('.reklamni_gallery_images ul li a').fancybox({
    		'transitionIn'	:	'elastic',
    		'transitionOut'	:	'elastic',
    		'speedIn'		:	600, 
    		'speedOut'		:	200, 
    		'overlayShow'	:	true
    	});
  });

