// JavaScript Document

/* End Toggle divs scripts */
/*Increase Font*/
// free to use as long as this copyright notice stays intact
var tags = new Array( 'div','td','tr','p','b','table','strong','emphasis','a','h1','h2','h3','pre','sub','sup','i','th','cp','ul','ol','li','dt','dd');
var pixelArray =  new Array('6','8','10','12','14','16','18');
var emArray =  new Array('0.7','0.9','1.0','1.5','2.0','2.5','3');
var initSize = 3;

/**
 * This function changes the font size of all the text on the page
 * it also sets a cookie to remember the size that's been set. It
 * loops through all the tags that could have text in it.
 * @member FontSizeNS
 * @param {int}  inc The increment number of the font increase a location as taken from the pixelArray or emArray
 * @param {string} unit The string containing the value unit to be used px or em
 */	 
function fontSizerRead(inc, unit){

	if (!document.getElementById) 
		return;
	if(document.cookie == '' || document.cookie == null ) { // there's no cookie, so go no further			
			return false; 
		} 
	if (inc==0){	
	// try {		    
		    var cookies= readCookie1("fontsize");			    
		    if (cookies==null){return;}
		    var values = cookies.split(",");		    		    
	  //      }
	  //      catch(e) {return;}
	    if (values[1]== urlPath){
	     eraseCookie("fontsize"); return;             }
	    else{	        
	        initSize = values[0];
	        var size = initSize;
	        createCookie("fontsize",size,0);
	    	getBody = document.getElementsByTagName('body')[0];
	        for (i = 0 ; i < tags.length ; i++ ) {
		        getallTags = getBody.getElementsByTagName(tags[i]);
	        for (k = 0 ; k < getallTags.length ; k++) 
		        getallTags[k].style.fontSize = (unit=='px') ? pixelArray[size]+unit: emArray[size]+unit;
	                                             }
	        }
    
        }			
}
/**
 * This function increases the text size of the fonts on the page.
 * It sets a cookie to remember the new font size. Works in conjunction
 * with the larger A image on the footer of the page.
 * @member FontSizeNS
 * @param {int}  inc The increment number of the font increase a location as taken from the pixelArray or emArray
 * @param {string} unit The string containing the value unit to be used px or em
 */	 

function fontSizerUp(inc,unit) {
	
	if (!document.getElementById) 
		return;
	
	if (inc==1){
	var size = initSize;	
		size += inc;
	if (size < 0 ) {
		size = 0;
	}
	if (size > 6 ) {
		size = 6;
	} 
	createCookie("fontsize",size,0);	
	initSize = size;
	}
		getBody = document.getElementsByTagName('body')[0];
	for (i = 0 ; i < tags.length ; i++ ) {
		getallTags = getBody.getElementsByTagName(tags[i]);
	for (k = 0 ; k < getallTags.length ; k++) 
		getallTags[k].style.fontSize = (unit=='px') ? pixelArray[size]+unit: emArray[size]+unit;
	}
}

/**
 * This function decreases the text size of the fonts on the page.
 * It sets a cookie to remember the new font size. Works in conjunction
 * with the smaller An image on the footer of the page.
 * @member FontSizeNS
 * @param {int}  inc The increment number of the font increases a location as taken from the pixelArray or emArray
 * @param {string} unit The string containing the value unit to be used px or em
 */	 
function fontSizerDown(inc,unit) {
	if (!document.getElementById) 
		return;
	var size = initSize;		
		size -= inc;
	if (size < 0 ) {
		size = 0;
	}
	if (size > 6 ) {
		size = 6;
	}    
	initSize = size;
	createCookie("fontsize",size,0);
		getBody = document.getElementsByTagName('body')[0];
	for (i = 0 ; i < tags.length ; i++ ) {
		getallTags = getBody.getElementsByTagName(tags[i]);
	for (k = 0 ; k < getallTags.length ; k++) 
		getallTags[k].style.fontSize = (unit=='px') ? pixelArray[size]+unit: emArray[size]+unit;
	}
}
