// JavaScript Document /* Font Size Selection Script: James Almeida PA Interactive */ /* Get and return the current Font Size */ function getFontSize() { sizeIs = $.cookie("paGov"); return (sizeIs); } /* Check to see if the PAGov Cookie is set - it if is update the font size */ /* If not - set the cookie with an em of 1 */ if ($.cookie("paGov")) { modifyFont($.cookie("paGov")); } else { $.cookie("paGov", 1, { expires: 20 }); } /* Apply the font changes to
tags */ function modifyFont(changeTo) { $('p').css('font-size', String(changeTo) + 'em'); $('body').css('font-size', String(changeTo) + 'em'); $.cookie("paGov", changeTo, { expires: 20 }); } /* Decrease Font Size : Utilizes ID font-down */ function attachFontSize() { $('#font-down').click(function () { curSize = .8; modifyFont(curSize); }) /* Increase Font Size : Utilizes ID font-up */ $('#font-up').click(function () { curSize = 1.35; modifyFont(curSize); }) /* Reset Font to 1em : Utilizes ID font-reset */ $('#font-reset').click(function () { curSize = 1; modifyFont(curSize); }) }