$(document).ready(function() {
	
	$('body').css('font-size','10px');
	 
	// Increase Font Size
	$(".text-resizer li.increase a").click(function(){
		var currentFontSize = $('body').css('font-size');
		var currentFontSizeNum = parseFloat(currentFontSize, 10);
		var newFontSize = currentFontSizeNum*1.2;
		$('body').css('font-size', newFontSize);
		return false;
	});
	// Decrease Font Size
	$(".text-resizer li.decrease a").click(function(){
		var currentFontSize = $('body').css('font-size');
		var currentFontSizeNum = parseFloat(currentFontSize, 10);
		var newFontSize = currentFontSizeNum*0.8;
		$('body').css('font-size', newFontSize);
		return false;
	});
		
	// navigation
	$("#zd-nav-container ul.zd-nav li").each(function(){
		if ($(this).hasClass('zd-nav-active') || $(this).hasClass('zd-nav-sub-active')){
			$(this).addClass('as-active').parents("li").addClass("as-parent").removeClass('as-active').removeClass('zd-nav-active');
		}
	});
	
	// footer and dynamic sidebar
	if($("#sidebar").children().hasClass("secondary-side")){
		var _topHeight = $("#masthead").height();
		var _navHeight = $("#sidebar .nav").height();
		var _containerHeight = $(".container").height();
		var _gap = 45;
		var _sideHeight = (_containerHeight - (_topHeight + _navHeight)) - _gap ;
		
		$("#footer").addClass("foot-indent");
		$("#sidebar .secondary-side").height(_sideHeight);		
	}
	
});
