/* TEXT ENLARGEMENT SCRIPT 
//////////////////////////
Written by Stephanie Williams, stephanie.williams@gmx.com
Last Revised October 2009 
*/

/* 
HOW THIS WORKS
//////////////////////////
All of the 'content' text in the CW website is within a table cell (<td></td>) with the id "textmain".  This script works by looking in "textmain" for paragraph tags (<p></p>) and then setting the font-size of the text inside those paragraph tags to stepped percentages above 100%.*

////// The script requires the following HTML block to be placed in the <head> tags of each HTML page: 

    <!-- THIS IS WHERE TEXT ADJUSTER HEAD CONTENT BEGINS -->
    <link rel="stylesheet" type="text/css" href="/css/text_enlarge_styles.css"/>
    
    <noscript>
     <style type="text/css">
     div#textenlarge {
     display: none;
     }
     </style>
    </noscript>
    
    <script type="text/javascript" src="/pages/text_enlarge.js"></script>
    <!-- THIS IS WHERE TEXT ADJUSTER HEAD CONTENT ENDS -->
    
////// The following code must be added to the content area to display the buttons. Please refer to an existing page for placement.

<!-- THIS IS WHERE TEXT ADJUSTER PAGE BUTTONS BEGIN -->

    <div id="textenlarge">
    
    <span class="sizelabel">Enlarge Text</span>
    
    <div id="sizebuttons">
    
    <a id="normal" class="sizelink" onclick="normal();"><img 
    src="/images/button_normal.jpg" alt="normal"/></a><a id="big" class="sizelink" 
    onclick="big();"><img src="/images/button_big.jpg" alt="big"/></a><a 
    id="bigger" class="sizelink" onclick="bigger();"><img 
    src="/images/button_bigger.jpg" alt="bigger"/></a> </div>
    
    </div>
    
    <!-- THIS IS WHERE TEXT ADJUSTER PAGE BUTTONS END -->


TROUBLESHOOTING:
//////////////////////////
If a block of text isn't growing/shrinking with the buttons, the most likely solution will be to put paragraph tags (<p></p>) around that text in your HTML editor. 

IF NO JAVASCRIPT
//////////////////////////
Pages will hide the "Enlarge Text" buttons if the user's browser does not support Javascript or if Javascript has been disabled.


*/


function normal(x) {
var newsize = "100%"; //change this to affect the size this button produces
var x = x;
changesize(newsize,x)
}

function big(x) {
var newsize = "115%"; //change this to affect the size this button produces
var x = x;
changesize(newsize,x)
}

function bigger(x) {
var newsize = "130%"; //change this to affect the size this button produces
var x = x;
changesize(newsize,x);
}

function changesize(newsize,x) {
jQuery(".entry-content").children().css({fontSize:newsize});
}



