/* Author: Lynn Wallenstein */
$(document).ready(function() {
  $('input, textarea').placeholder();
  
  $('#mycarousel').jcarousel({});
  
  $('div#thumbnails a').click(function(e) {
    var chosen = $(this).attr("data-video-url");
    // console.log("You Selected " + chosen);
    $('div#thumbnails a').removeClass("active");
    $(this).addClass("active");
    $('iframe#playing-video').attr('src', chosen);
    var index = parseInt($(this).children('.count').text());
    var feature_content = $('section#feature-content');
    var feature_title = $(this).children('.title').text();
    feature_content.fadeOut( 'fast', function () {
      feature_content.find('#feature-description').html(feature_descriptions[index]);
      feature_content.find('h1').text(feature_title);    
      feature_content.fadeIn('fast');
    });
    e.preventDefault();
  });
  
  $("html body div#wrapper div#main section#content article h1.page-title").filter(function(){
      return $(this).text().length < 37;
  }).addClass("short-title");
  
  //console.log(window.location.pathname);
  $('nav#access ul a[href$="' + window.location.pathname + '"]').parent().addClass("active");
  $('nav#courses ul a[href$="' + window.location.pathname + '"]').parent().addClass("active");
  
});



