/* 
* Skeleton V1.0.3
* Copyright 2011, Dave Gamache
* www.getskeleton.com
* Free to use under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
* 7/17/2011
*/	
	

$(document).ready(function() {
  
  /* Scrolling nav stuff
	================================================== */
	$('#mast a, #toppage a, #steps a, #details a').smoothScroll({
	  easing: 'swing',
	  speed: 2000,
	  
	});
	
	var a = $('#back-to-top');
	$(a).hide().removeAttr("href");
	// $(window).scrollTop() > 400 && $(a).fadeIn("slow");
	
	$(window).scroll(function() {
	  $(this).scrollTop() >= 400 ? $(a).fadeIn("slow") : $(a).fadeOut("slow");
	});
	
	$(a).click(function(){
	  $('html, body').animate({ scrollTop: "0px"}, 1200);
	});
	
	/* Sticky nav stuff
	================================================== */
  // vars
  $wn = $(window);
  $mast = $('#mast');
  
  function _onScroll() {
    if($wn.scrollTop() < 680 && $mast.hasClass('short') === true) $mast.removeClass('short');
    else if($wn.scrollTop() >= 680 && $mast.hasClass('short') === false && $wn.width() >= 480) $mast.addClass('short');
  }
  $wn.bind('scroll', _onScroll);
  
 
  
});

