function pageLoaded(currentNav) {
  setInterval('setColumnHeight()', 100);
  // Nice text stuff here
	Cufon.replace('.site-nav li a', { fontFamily: 'MyriadProCondensed', hover: true, textShadow: '1px 1px #252524' });
	Cufon.replace('.title', { fontFamily: 'MyriadProCondensed'});
};

function setColumnHeight(){
  $('#sidebar').height('auto'); //temporarily reset sidebar.
  var sidebarHeight = $("#sidebar").height();
  var mainContentHeight = $("#main-content").height();
  (sidebarHeight > mainContentHeight) ? $("main-content").height(sidebarHeight) : $("#sidebar").height(mainContentHeight);
};

function setActiveNav(currentNavItem){
  // Set the active class for the current nav menu item.
  $('.site-nav li:nth-child('+currentNavItem+') a').addClass('active');
};

$(function(){
	if ($('#slider').length) {	
		$('#slider ul').jcarousel({
			auto: 5,
			wrap: 'circular',
			easing: 'swing',
			buttonNextHTML: null,
			buttonPrevHTML: null
	    });  
	};
	
	if ($('#top-slider').length) {
		$('#top-slider').jqFancyTransitions({ 
			width: 869, 
			height: 431,
			delay: 5000,
			stripDelay: 50,
			strips: 6
		});	
	};

	$('.pagination a').click(function() {
		if ($(this).attr('href') != '#') {
			$('.pagination a').removeClass('active');
			$(this).addClass('active');
			var href = $(this).attr('href');
			$('.tabs .tab').hide();
			$(href).fadeIn();
      setColumnHeight();
			return false;
		};
	});
	
});

