
 		
			Cufon.replace('#menu-primary, .action, .page-content h1, .page-content h2, .blog-content h2, footer h2, span.month, h1.page_title, .date_container .day, #programs_list_carousel h3, #programs_list_carousel h2, .program_description h1, #program h1, #general h1, #program_details h3', { fontFamily: 'Knockout-HTF29-JuniorLiteweight', hover: true });
			Cufon.replace('.date_container .month', { fontFamily: 'Knockout-HTF47-Bantamweight', hover: true });
			Cufon.replace('.date_container .year', { fontFamily: 'Knockout-HTF32-JuniorCruiserwt', hover: true });
			Cufon.replace('#programs_list_carousel h1', { fontFamily: 'Knockout-HTF50-Welterweight', hover: true });
 
 $(document).ready(function(){
			$('#programs_list_carousel').jcarousel({
				auto:5,
				wrap:"last",
				scroll: 1,
				size: 3,
				initCallback: initCallback,
				itemVisibleInCallback: {
					onBeforeAnimation: skip_4,
					onAfterAnimation:  itemVisibleInCallbackAfterAnimation
				}
			});
			
			var count_programs = 1;
			$('#programs_list_carousel li').each(function(){ //append list item per program pulled
				var title = $(this).attr('title');
				$('#programs_list').append('<li><a id='+count_programs+' index='+count_programs+' href="#" >'+title+'</a></li>'); 
				if (count_programs == 1) {$('#programs_list li:last').addClass('active');};
				count_programs++;
			});

		 $(window).bind('resize', (function() { 
			var timer; 
			return function() { 
			  clearTimeout(timer); 
			  timer = setTimeout(function() { 
				Cufon.refresh(); 
			  }, 50); // possibly more than 50 
			}; 
		  })()); 
  
 Cufon.refresh();
  
  
  			  loader = setTimeout(function() { 
				$('#load').css('display','none');
			  }, 500); // possibly more than 50 
		}); 

		 
function initCallback(carousel) { // external controls
    $('#programs_list a').live('click', function() {
		//alert('here');
        carousel.scroll($.jcarousel.intval($(this).attr('index')));
		$('#programs_list').children().removeClass('active');
		$(this).parent().addClass('active');
        return false;
    });
	
};	
function itemVisibleInCallbackAfterAnimation(carousel, item, idx, state) { //traces which title to activate
 		$('#programs_list').children().removeClass('active');
		$('#programs_list li a[index ="'+idx+'"]').parent().addClass('active');  
};

function skip_4(carousel, item, idx, state) { //skip that weird one
 		if(idx == 4){alert(idx);}
};
