/* Author: Bryan Mills
*/

$(document).ready(function() {
	
	// Add HTML5 placeholder behavior to all text fields if the browser does not support it
	$('input, textarea').placeholder();
	
    $(".slider-inner").easySlider({ 
        auto: true,
        continuous: true,
        controlsShow: false,
        pause: 6000,
        counterId: 'sliderStatus'
      });

  
  if ($('.related-videos .scroll-wrapper').length > 0) {
    $('.related-videos .scroll-wrapper').jcarousel({
      vertical: true,
      visible: 4, // we want the fifth element hanging off the bottom
      buttonNextHTML: "<p class='controls down jcarousel-next jcarousel-next-vertical'><a href='javascript:void(0);' class='up'>&nbsp</a></p>",
      buttonPrevHTML: "<p class='controls up jcarousel-prev jcarousel-prev-vertical'><a href='javascript:void(0);' class='down'>&nbsp</a></p>"

    });
  }
	
	// Vertically align nav text for browsers that's don't support display: table
	(function ($) {
	$.fn.vAlign = function() {
		return this.each(function(i){
		var ah = $(this).height();
		var ph = $(this).parent().height();
		var mh = Math.ceil((ph-ah) / 2);
		$(this).css('margin-top', mh);
		});
	};
	})(jQuery);
	
	$('html.ie7 .nav li a span, html.ie6 .nav li a span').vAlign();
	
	
});






















