;jQuery(document).ready(function($) {
	$(".sf-menu").superfish({delay:333,animation:{opacity:"show"},speed:"fast",autoArrows:false,dropShadows:false,disableHI:true});	
	
	$('#content table').each(function (){
		$('tr:even', this).addClass('alt');
		var numOfCols = $('tr:first', this).children().size();
		$(this).addClass('cols'+numOfCols);
		var colWidths = [];
		$('tr', this).each(function() {
			$('td', this).each(function(i) {
				$(this).addClass(' colnum'+(i+1));
			});
		});
	});
	
	$('#content h4:has(br)').css('width','280px');
  
	$("#carousel").featureCarousel({
		'trackerSummation' 		: false,
		'movedToCenter'			: function($feature) { 	
			$('.play_button', $feature).show();
						
			$('#carousel .tracker-individual-container').each(function() {
				if ( !$(this).hasClass('tracker-individual-container-fixed') ) {
					$('li', this).css('display','block');
					var w = $(this).width(),
						lf = ( 257 - w ),
						rm = ( Math.round( lf / 2 ) - 1 );
					$(this).css('right', rm + 'px' ).addClass('tracker-individual-container-fixed');
				}
			});
			
		},
		'leavingCenter'			: function($feature) {			
			$('#carousel .play_button').hide();	
			
		},
		'clickedCenter'			: function($feature) {
			$.fancybox({
				'padding'		: 0,
				'autoScale'		: false,
				'transitionIn'	: 'fade',
				'transitionOut'	: 'fade',
				'width'			: 640,
				'height'		: 385,
				'href' 			: $('img[rel]', $feature).attr('rel').replace(new RegExp("watch\\?v=", "i"), 'v/') + '&amp;autoplay=1&amp;fs=1',
				'type' 			: 'swf',
				'swf' 			: {
					'wmode' 			: 'transparent',
					'allowfullscreen'   : 'true'
				},
				'overlayColor' 	: '#000',
				'overlayOpacity' : 0.87,
				'title' 		: $('.carousel-caption p', $feature).html()
			});
		}
	});
	
	//$('.play_button').css( 'opacity', 0.67 );
	
	
	/*
	$('.carousel-feature').hover(
		function() { 
			//$('.play_button', this).animate({'opacity' : 1 }); 	
			
		}, 
		function() { 
			//$('.play_button', this).animate({'opacity' : 0.67 }); 	
		}
	);
	*/
	
	$('#carousel a.video').live('click', function(e) { e.preventDefault(); });
	

	
});	
