/*******************************************************************
* JavaScript/CSS Font Size Changer (Persistent Between Pages)
* (c) DB Design, All rights are reserved
* http://phpscriptindex.com, phpsales@gmail.com
********************************************************************
* Script will allow user to visually change font size. Font size 
* will persist thru page change using a cookie.
********************************************************************
* Directions: Change fontElementId var to the element id you wish to
* allow users to change font sizes. 
********************************************************************
* Tip: Next span element inside normal div to inherit parent style
* but enable use to change font size.
*******************************************************************
* FireFox 2.0.0.3 Tested
* MS IE 7 Tested
* Netscape 8.1.2 Tested
* Opera 9.1 Tested
******************************************************************/

var fontElementId = "wrap"; //CHANGE ME TO YOUR ELEMENT ID

//DO NOT MODIFY BELOW

/* Module Change Font (string) */
function changeFont(fontClass){
	var element = document.getElementById(fontElementId);
	element.className = fontClass;
	setCookie("fontSize", fontClass, 5);
}		

/* Module Set Default Font Size (void) */
function setDefaultFontSize(){
	var fontSize = getCookie("fontSize")
	if(fontSize){
		var element = document.getElementById(fontElementId);
		element.className = fontSize;
	}
}

/* Module Set Cookie (string, string, int) -- http://www.w3schools.com/js/js_cookies.asp */
function setCookie(c_name,value,expiredays){
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value)+ ((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}
/* Module Get Cookie (string) -- http://www.w3schools.com/js/js_cookies.asp */
function getCookie(c_name){
	if(document.cookie.length>0){
		c_start=document.cookie.indexOf(c_name + "=");
		if (c_start!=-1){ 
			c_start=c_start + c_name.length+1;
			c_end=document.cookie.indexOf(";",c_start);
			if (c_end==-1) c_end=document.cookie.length;
			return unescape(document.cookie.substring(c_start,c_end));
		}
	}
	return false;
}