﻿
/*
	FONT SIZE CHANGE
	-------------------------------------------------------------------------
*/

	// initialize the jquery code
	$(document).ready(

		function()
		{
			// changer links when clicked
			$("a.FontChanger").click(
			
				function()
				{
					//set the div with class mainText as a var called $mainText 
					var $mainText = $('div.homepage_copy');

					// set the current font size of .mainText as a var called currentSize
					var currentSize = $mainText.css('font-size');

					// parse the number value out of the font size value, set as a var called 'num'
					var num = parseFloat(currentSize, 10);

					// make sure current size is 2 digit number, save as var called 'unit'
					var unit = currentSize.slice(-2);

					// set the current line height of .mainText as a var called currentLH
					var currentLH = $mainText.css('line-height');

					// parse the number value out of the line-height value, set as a var called 'numLH'
					var numLH = parseFloat(currentLH, 10);

					// make sure current line height is 2 digit number, save as var called 'unitLH'
					var unitLH = currentLH.slice(-2);

					// javascript lets us choose which link was clicked, by ID
					if (this.id == 'LargerFont')
					{
						
						if (num >= 14)
						{
							$mainText.css('font-size', '10px');
							$mainText.css('line-height', '16px');

							//num = num / 1.2;
							//numLH = numLH / 1.2;
						}
						else
						{

					// jQuery lets us set the font Size value of the mainText div
						$mainText.css('font-size', '14px');

						// jQuery lets us set the line height value of the mainText div
						$mainText.css('line-height', '22px');
						}
					}
					else if (this.id == 'SmallerFont')
					{
						// jQuery lets us set the font Size value of the mainText div
						$mainText.css('font-size', '10px');

						// jQuery lets us set the line height value of the mainText div
						$mainText.css('line-height', '16px');
					}
				
					return false;
				}
			);
		}
	);
