function initTypefaceJsClass(){
	$('.blurb p strong').addClass('typeface-js');
}

function initIE7Check(){
	if ( $.browser.msie ) {
	  if ( $.browser.version == 7.0 ){
	  		$('h2').each(function(){
		  		var textOfH2 = $('h2').html();
	  			$(this).replaceWith('<span class="h2 typeface-js">' + textOfH2 + '</span>');
	  		});
	  		$('h4').each(function(){
		  		var textOfH4 = $('h4').html();
	  			$(this).replaceWith('<span class="h4 typeface-js">' + textOfH4 + '</span>');
	  		});
	  		$('h3').each(function(){
		  		var textOfH3 = $('h3').html();
	  			$(this).replaceWith('<span class="h3 typeface-js">' + textOfH3 + '</span>');
	  		});
	  }
	}
}

function initAreasOfPractice(){
	$('.aop h3').next('p').prev().wrap('<a href="#" />');
	$('.aop a h3').click(function(e){
		e.preventDefault();
		$(this).parent().nextUntil('a').toggle();
	});
}

$(document).ready(function(){
	initTypefaceJsClass();
	initIE7Check();
	initAreasOfPractice();
	_typeface_js.renderDocument();
	
    $.waypoints.settings.scrollThrottle = 30;
    $('#disclaimer').waypoint(function(event, direction) {
        $(this).toggleClass('sticky', direction === "down");
        event.stopPropagation();
    }, {offset:150});
});
