$().ready(function() {
	
	
	$('#courseScroll').scrollable({size:4});
	
	$('#videoScroll').scrollable({size:3});
	
	/*Author: Paulo Oreda
	 * This method manage the selected video to play
	 * and the styles of the container of that video.
	 */	
	$('.playBtn').click(function(){
		$('.innerItem').removeClass('current');
		$(this).parent().parent().addClass('current');
		getPlayer($(this).parent().attr('type'));
	});
	
	/*Author: Paulo Oreda
	 * This method manage the style of the videos container
	 * on a mouse over the play button of each video.
	 */
	$('.playBtn').mouseover(function(){
		$(this).parent().parent().addClass('mOver');
	}).mouseout(function(){$(this).parent().parent().removeClass('mOver')});
	
	$('.player').mouseover(function(){
		$(this).children().attr('height', '240px');
	}).mouseout(function(){ $(this).children().attr('height', '280px'); });
	
});

function getPlayer(path) {
	$.post("/videos/landingVideos", { vidPath: path }, function (data) {
    		$('div.player').html('<div id="player_container">' + data + '</div>');   	
    }); 
}


