/*
Name		Font resizing tool
Created 	Wednesday 20 May 2009
By 			Yvon Viger

Small Font	62.5%
Medium Font	75%
Large Font	87.5%
*/

function fontResizeInit()
{
	//$( "#" + $.cookie( "font_size" ) ).mouseover();
	//$( "#" + $.cookie( "font_size" ) ).click();


	$( ".font" ).livequery( "mouseover", function()
	{
		var size = $( this ).attr( "id" );
		$( this ).attr( "src", $( this ).attr( "src" ).replace( "_inactive", "_hover" ) );
	});

	$( ".font" ).livequery( "mouseout", function()
	{
		var size = $( this ).attr( "id" );
		$( this ).attr( "src", $( this ).attr( "src" ).replace( "_hover", "_inactive" ) );
	});

	$( ".font" ).livequery( "click", function()
	{
		if( $( this ).attr( "src" ).indexOf( "_active" ) == -1 )
		{
			$( ".font" ).each( function()
			{
				$( this ).attr( "src", $( this ).attr( "src" ).replace( "_active", "_inactive" ) );
			});
			
			var size = $( this ).attr( "id" );
			$.cookie( "font_size", size, { expires: 365, path: "/", domain: document.location.host, secure: false });

			switch( size )
			{
				case "small":
					$( "body" ).css({ fontSize: "62.5%" });
				break;
				
				case "medium":
					$( "body" ).css({ fontSize: "75%" });
				break;
				
				case "large":
					$( "body" ).css({ fontSize: "87.5%" });
				break;
			}
			
			$( this ).attr( "src", $( this ).attr( "src" ).replace( "_hover", "_active" ) );
		}
	});
}
