$(document).ready( function() {
	var $courses = $('.b-tip');	
		
	$courses.each( function() {
		var duration = $(this).attr( 'title' );

		if ( 2 > duration || !duration ) {
			return;
		} else {
			var $parent = $(this).parent();
			var newWidth = $parent.outerWidth();
									
			var i;
			for ( i = 1; i < duration; i++ ) {
				$parent = $parent.next()
				newWidth += $parent.outerWidth();
			}
			
			newWidth -= 5;
			
			$(this).css( 'position', 'absolute' );
			$(this).css( 'width', newWidth + 'px' );
			$(this).css( 'height', $(this).height() );
		}
	});
	
	$courses.tooltip({ 
		effect: 'slide',
		delay: 500,
		position: 'top center'
	});
});
