/* Author: 

*/

$(document).ready(function () {
	
	
	$('.lista_rubros a, .top_locales a').click(function(e) {
		$('.lista_rubros li').removeClass('active');
		$(this).parent('li').addClass('active');
		$.get( $(this).attr('href'), function(data) {
          $('.source').quicksand( $(data).find('li'), { 
          	duration: 500,
          	adjustHeight: 'dynamic'
          });
      	});  
      	e.preventDefault(); 
		
	});
	
	$("a#inline").fancybox();
	$('a#youtuber').addClass('aka').click(function(e) {
	e.preventDefault();
	$.fancybox({
        'type' : 'iframe',
        // hide the related video suggestions and autoplay the video
        'href' : this.href.replace(new RegExp('watch\\?v=', 'i'), 'embed/') + '?rel=0&autoplay=1',
        'overlayShow' : true,
        'centerOnScroll' : true,
        'speedIn' : 100,
        'speedOut' : 50,
        'width' : 640,
        'height' : 480
    });
	return false;
	});
	
	$('nav li.activo a').append('<div class="tip"></div>');
	$('#tabs li').wrapInner('<div class="tab-inside" />').append('<div class="tip"></div>');
	$('#tabs li').fadeIn('fast');
	$('#slideshow').cycle({ 
	    fx:     'fade', 
	    speed:  'fast', 
	    timeout: 3000,
	    pager:  '#tabs',
	    pause: true,
	    pauseOnPagerHover: true,
	    pagerAnchorBuilder: function(idx, slide) { 
	        return '#tabs li:eq(' + idx + ') a'; 
	    } 
	});
	
	$('.slideshow').cycle({ 
	    fx:     'fade', 
	    speed:  1000, 
	    timeout: 6000,
	    pause: true
	});
	
	$('.local_slideshow').cycle({ 
	    fx:     'fade', 
	    speed:  1000, 
	    timeout: 6000,
	    pause: true
	});
	
	$('.estrenos_slideshow').before('<div id="navs">').cycle({ 
	    fx:     'fade', 
	    speed:  500, 
	    timeout: 6000,
	    pager:  '#navs',
	    pause: true
	});
		
	
});



















