/*
 * Common jQuery wizardery for Circle Solutions
 */

$(document).ready(function() {
	
	
	// Apply the box style mark-up around the #main div...
	
	$("div#main").wrapInner('<div class="box-top"><div class="box-bottom"><div class="box-body"><div class="box-content"></div></div></div></div>');
		
	// Insert back-to-top buttons
	
	$("li.faq").append('<p class="back-to-top"><a href="#container">Top</a></p>');
	
	
	// Silky Smooth Scrolling magic...
	
	$('div#main a[href*=#]').click(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
			&& location.hostname == this.hostname) {
			var $target = $(this.hash);	
			$target = $target.length && $target		
			|| $('[name=' + this.hash.slice(1) +']');	
			if ($target.length) {		
				var targetOffset = $target.offset().top;	
				$('html,body')	
				.animate({scrollTop: targetOffset}, 500);	
				return false;	
			}		
		}
	});
	
	
});	
