var sitefunctions = {
	textresize : function()	{
		// show text resizing links
		$(".FontSize").show() ;
		var $cookie_name = "sitename-FontSize" ;
		var originalFontSize = $ ("body") . css("font-size") ;
		// if exists load saved value, otherwise store it
		if ( $ . cookie ($cookie_name) )	{
			var $getSize = $.cookie ($cookie_name) ;
			$ ("body") . css ( "font-size" , $getSize ) ; // IE fix for double "pxpx" error
		}
		// text "+" link
		$("#text_size_increase").bind("click", function()	{
			var currentFontSize = $ ("body") . css ("font-size") ;
			var currentFontSizeNum = pxToPercent ( currentFontSize ) ;
			var newFontSize = currentFontSizeNum * 1.1 ;
			if ( newFontSize < 120 && newFontSize > 70 )	{
				$ ("body") . css ("font-size", newFontSize + '%') ;
				$.cookie ($cookie_name, newFontSize + '%' , { path: '/', domain: 'knrdesigns.com' }) ;
			}
			else	{
				$ ("body") . css ("font-size", '120%') ;
				$ . cookie ($cookie_name, '120%' , { path: '/', domain: 'knrdesigns.com' }) ;
			}
			return false;	
		});
		$("#text_size_decrease").bind("click", function()	{
			var currentFontSize = $ ("body") . css("font-size") ;
			var currentFontSizeNum = pxToPercent ( currentFontSize ) ;
			var newFontSize = currentFontSizeNum * 0.9 ;
			if ( newFontSize > 70 && newFontSize < 120 )	{
				$ ("body") . css ("font-size", newFontSize + '%') ;
				$ . cookie ($cookie_name, newFontSize + '%' , { path: '/', domain: 'knrdesigns.com' }) ;
			}
			else	{
				$ ("body") . css ("font-size", '70%') ;
				$ . cookie ($cookie_name, '70%' , { path: '/', domain: 'knrdesigns.com' }) ;
			}
			return false;
		});
	}
}
 
$(document).ready(function(){
		sitefunctions.textresize () ;	
}) ;


function resizeText ( str )	{
	return null ;
}

function pxToPercent ( px )	{
	pxNum = parseFloat ( px ) ;
	per = pxNum >= 70 ? pxNum : pxNum * 6.25 ;
	return per ;
}
