$('body').addClass('js');

function display_flash() {
  $flash = $('body.js').find('span.flash-notice');

  if ($flash.length) {
    var h = $flash.height();

    $flash.css({top: 0 - (h * 2)})
      .css({visibility: 'visible'})
      .animate({opacity: 0})
      .animate({opacity: 1, top: 0 },1300, 'easeOutBounce')
      .animate({opacity: 1}, 3000)
      .animate({top: 0 - (h * 2), opacity: 0}, 1500, 'easeInBounce');

    $(window)._scrollable().scrollTo('body', 700, {easing: 'easeOutExpo'});
  }
}
display_flash();

if ($('form').length > 0) {
  if (Modernizr.input.placeholder){
    $('form').find('label').hide().end()
                 .find(':input, textarea').filter('[type=text], [type=tel], [type=password], [type=email], textarea')
                    .focusin(function(){
                      $(this).prev('label').slideDown();
                    })
                    .focusout(function(){
                      $(this).prev('label').slideUp('fast');
                    });
  }
  $(':input')[1].focus();
}
