$(document).ready(function(){	
	// # Cufon
	Cufon.replace('h2', {
		fontFamily: 'Myriad Pro',
		fontSize: 19,
		hover: true,
		hoverables: { a: true }
	});
	Cufon.replace('h3', {
		fontFamily: 'Myriad Pro'
	});
	Cufon.replace('h4', {
		fontFamily: 'Myriad Pro'
	});
	
	// # Nav
	$('ul#nav li a').click(function(){
		// # Use the anchor's hash name as the ID to target
		var anchor = "a#hash-"+this.hash.substr(1,this.hash.length-1);
		$(window).scrollTo(anchor, {speed:500, axis:'y'});
		$("h3.highlight").removeClass("highlight");
		$(anchor).next('h3').addClass("highlight");
		return false;
	});
	// # Scroll to Top of Page
	$('a.scroll-to-top').click(function(){
		$("h3.highlight").removeClass("highlight");
		$(window).scrollTo(0, {speed:500, axis:'y'});
		return false;
	});
	// # Scrolling Menu
	var nav = "ul#nav";
	var nav_y_pos = parseInt($(nav).css("top").substring(0,$(nav).css("top").indexOf("px")));
	$(window).scroll(function(){
		var offset = ($(document).scrollTop()-325);
		if(offset <= 83) offset = 83;
		offset += "px";
		$(nav).animate({top:offset},{duration:400,queue:false});
	});
});