// JavaScript Document

$(function(){
	// This method is called when any Hash is changed or
	// if there is a hash present when the page loads.
	$.History.bind(function(state){
		// Remove the -js if present from the hash and scroll
		$(window)._scrollable().scrollTo($("#" + state.replace('-js','')), 300, {easing: "easeInOutQuad"});
	});
	
	// Find all anchors that start with #
	$("a[href^='#']").click(function(e){ 
		// Keep them from setting the hash
		e.preventDefault(); 
		
		// Set the hash manually, appending '-js' to keep
		// Firefox from doing double duty
		$.History.setHash($(this).attr('href').replace('#','') + "-js"); 
	});
})