
var sidebar;
Cufon.replace('.body .main-col h1, .body .main-col h2');
$(function() {
	$('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}, 300);
				return false;
			}
		}
	});
	if (typeof fromApp.sidebarImageSets !== 'undefined' && fromApp.sidebarImageSets.length > 0) {
		sidebar = new Sidebar(fromApp.sidebarImageSets, { mainHeightOffset: 75 });
		sidebar.load('sidebar-images');
		sidebar.topUp();
		$('.main-col').resize(function() {
			sidebar.topUp();
		});
	}
});

