$(document).ready(function() {

	// external links open new window
	
	$("a[rel='external']").click(function() { 
		
		window.open($(this).href); 
		
		return false;
		
	});
	
	
	// hide steps list using js rather than css
	$('.steps ol').hide();
	
	// turn off decimal bullets
	$('.steps ol').css({"list-style-type" : "none"});
	
	// insert step numbers as h3s
	$('.steps ol li').each(function(index) {

		var insertNumber = '<h3>'+($(this).index() + 1)+'.</h3>';
		
		$(insertNumber).insertBefore($('p', this).first());
		
	});
	
	// step list slide reveal
	$('.steps .button-toggle').click(function() {

		// toggle button class 
		$('.steps .button-toggle').toggleClass('button-hide');
		
		// toggle button text 
		if ($(this).html() == VIEW) {
			
			$(this).html(HIDE);
			
		} else {
			
			$(this).html(VIEW);
			
		}
		
		// adjust slide speed
		$('.steps ol').slideToggle(800);
		
		return false;

	});
	
});
