/* script.js 
   Author:
   Date:
*/


$(document).ready(function(){ // begin document.ready block

   $('.letsgo').click(function(){

      $('html, body').animate({scrollTop: $('.intro').offset().top}, 1000);

   });

   $('.stationbox').mouseenter(function(){

      $(this).css({
         'background-color':'#2f241e'
      });

   });

   $('.stationbox').mouseleave(function(){

      $(this).css({
         'background-color':'#0A0A0A'
      });
      
   });

   $('.stationbox').click(function(){

      var gotoposition ='.'+$(this).attr('stationtag');

      $('html, body').animate({scrollTop: $(gotoposition).offset().top}, 800);

      if($(this).attr('stationtag')=='s14'){
         $('.trainaudio').get(0).play();
      };

   });

   $('.nugget').click(function(){

      $(this).find('.animalcaption').fadeToggle(400);

   });

   $('.s14').waypoint(function(dir){

      if(dir==='down'){
         $('.trainaudio').get(0).play();

      }

   });
}); //end document.ready block
