$.extend($.expr[':'],{
    inView: function(a) {
        var st = (document.documentElement.scrollTop || document.body.scrollTop),
            ot = $(a).offset().top,
            wh = (window.innerHeight && window.innerHeight < $(window).height()) ? window.innerHeight : $(window).height();
        return ot > st && ($(a).height() + ot) < (st + wh);
    }
});

$(document).ready(function() {
	$("#conference-notes-dropdown, #press-release-dropdown").change(function(){
		window.open($(this).val(), "_blank");
	});
	
	$("#topics-dropdown").change(function(){
		window.location = $(this).val();
	});
	
	
// 	$("#client-slider").anythingSlider({ width: "817px", height: "147px", buildArrows: false, buildNavigation: false, enableNavigation: false});
	
	
	$("#client-slider").easySlider({
			auto: true, 
			continuous: true,
			controlsShow: false,
			speed: 800,
			pause: 4000
		});
		
	$("#client-slider").css('height', '147px');


	$("#home-slider").easySlider({
			auto: true, 
			continuous: true,
			controlsShow: false,
			speed: 800,
			pause: 6000
		});

	$("#home-slider").css('height', '357px').css('width','618px');


  $("#client-1").click(function() {
    animateCaseExample("#client-1-content");
    return false;
  });


  $("#client-2").click(function() {
    animateCaseExample("#client-2-content");
  return false;
    
  });

  $("#client-3").click(function() {
    animateCaseExample("#client-3-content");
    return false;
  });
});


var done_animation = 0;

function animateCaseExample(content_id)
{
  $(".case-example").fadeOut();
  
  $(content_id).fadeIn();

  if (done_animation == 0)
  { $('html, body').animate({
        scrollTop: $(content_id).offset().top
      }, 700);
  }
  done_animation = 1;

}
