
$(document).ready(function()
{
	var aTargets = ['body',
					'h1',
					'h2',
					'h3',
					'h4',
					'h5',
					'h6',
					'#content p'
					// GS: increasing the font size here is problematic
					//'#top_menu a'
				   ];

	// Create the buttons here
	var aHtml = ['<p>' + 'Font Size' + '</p>',
				 '<span id="fontsize-increase" title="Increase font size">' + '<a href="#">Increase +</a>' + '</span>',
				 '<span id="fontsize-decrease" title="Decrease font size">' + '<a href="#">Decrease -</a>' + '</span>'
				];
	$('#fontsize').html(aHtml.join(''));

	// Decrease Font Size
	$('#fontsize-decrease').click(function()
	{
		for (var i = 0; i < aTargets.length; i++)
		{
			var sFontSize = String($(aTargets[i]).css('font-size')).replace('px', '');
			var nFontSize = parseInt(sFontSize) - 2;
			if (nFontSize <= 8)
			{
				continue;
			}
			$(aTargets[i]).css('font-size', nFontSize + 'px');
		}

		return false;
	});

	// Increase Font Size
	$('#fontsize-increase').click(function()
	{
		for (var i = 0; i < aTargets.length; i++)
		{
			var sFontSize = String($(aTargets[i]).css('font-size')).replace('px', '');
			var nFontSize = parseInt(sFontSize) + 2;
			$(aTargets[i]).css('font-size', nFontSize + 'px');
		}

		return false;
	});

	// do ie6 menu attaching if needed
	if (jQuery.browser.msie && String(jQuery.browser.version).charAt(0) == '6')
	{
		$('#nav_menu_1 > li').hover(
		function()
		{
			$(this).find('a:first').addClass('hover');
			$(this).addClass('hover').find('ul:first').css('display', 'none').css('display', 'block');
		},
		function()
		{
			$(this).find('a:first').removeClass('hover');
			$(this).removeClass('hover').find('ul:first').css('display', 'none');
		});
	}
});
