jQuery(document).ready(function($) {
  var featured = $("#featured .scrollable");
  featured.scrollable({
    item: "div.items > div",
    next: "#featured .forward a",
    prev: "#featured .backward a",
    size: 1,
    easing: 'linear'
  }).mousewheel();

  // Categories drop-down
  var catdd = $('.playtime-catlist .categories');
  var catddtrigger = $('.playtime-catlist .trigger a');
  catddtrigger.click(function($){
    if (!catdd.is(':visible')) {catdd.slideDown('slow');}
    else {catdd.slideUp('slow');}
    return false;
  });

  // customInput()
  var theInput = $('#subscribe');
  var theLabel = $('label[for='+theInput.attr('id')+']');

  //bind custom event, trigger it, bind click,focus,blur events
  theInput.bind('updateState', function(){
    if (theInput.is(':checked')) { theLabel.addClass('checked'); }
    else { theLabel.removeClass('checked checkedHover checkedFocus'); }
  })
  .trigger('updateState')
  .click(function(){
    $(this).trigger('updateState');
  })
  .blur(function(){ theLabel.removeClass('focus checkedFocus'); });

  // Featured Videos ToolTip
  if ($('.playtime-featuredvids li a').length) {
    $(".playtime-featuredvids li a[title]").tooltip('#featuredtip');
  }

});
