$(document).ready(function(){
	// CUFON TEXT REPLACER
	Cufon.replace(".description", {hover:true, fontFamily:"Monotype Corsiva"});
	Cufon.replace("#topnavi ul li, #sidebar h3", {hover:true, fontFamily:"Futura Bk BT"});
	
	// SAME HEIGHT
	var sameHeight = 0;
	$("#content").each(function(){
		if($(this).height() > sameHeight){
			sameHeight = $(this).height();
		}
	});
	$("#sidebar").height(sameHeight+40);
		
	// TEXT INCREASE/DECREASE
    var originalFontSize = getFontSize();
	/*
    $(".resetFont").click(function(){
		setFontSize(originalFontSize);
		$("#changeFont").fadeToggle("fast");
		return false;
	});
	*/
	$(".increaseFont").click(function(){
		var fontSize = getFontSize();
		var newFontSize = fontSize + 2;
		setFontSize(newFontSize);
		$("#sidebar").height(sameHeight+120);
		return false;
	});
	$(".decreaseFont").click(function(){
		var fontSize = getFontSize();
		var newFontSize = fontSize - 1;
		setFontSize(newFontSize);
		$("#sidebar").height(sameHeight+40);
		return false;
	});
});

function getFontSize() {
	var currentSize = $("body").css("font-size");
	var currentSizeNumber = parseFloat(currentSize, 14);
	if(currentSizeNumber > 14) {
		currentSizeNumber = 14;
	}
	return currentSizeNumber;
}

function setFontSize(size) {
	$("#content p").css("font-size", size);
} 
