// Changes the font size of the element and stores the size in a cookie
function changeFontSize(strID, strSize) {
	// get the element
	document.getElementById(strID).style.fontSize = strSize;
	// set the cookie
	SetCookie("fontSize",strSize,"December,31,2009");
	document.getElementById('footer').style.clear = 'both';
	document.getElementById('footer').style.bottom = 0;	
	document.getElementById('footer').style.display = 'none';
	document.getElementById('footer').style.display = 'block';
}
	
// Function to find any cookied css modifications that were set by user on last visit
function getCssMods(strID) {
	// check if the object whose id is given exists
	if(document.getElementById(strID)) {
		// create regular expression to match pattern 'fontSize=.......' till a semicolon is encountered or the string ends
		var fSize = new RegExp("fontSize=[^;]+");
		// if size cookie exists
		if(fSize.test(document.cookie)){
			// if match found, then extract the part of the string matching the regular expression pattern
			var cookieEntry = document.cookie.toString().match(fSize);
			if(cookieEntry != '') {
				// from the match, extract the font size
				var fontSize = cookieEntry.toString().split("=")[1];
				//var fontSize = cookieEntry.toString().substring(9, cookieEntry.toString().length);
				// call the function to change the font size accordingly
				changeFontSize(strID, fontSize.toString());
			}
		}
	}	
}

// Set cookie
function SetCookie(name,value,expires) {
	var exp = new Date(expires);
	document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString(); + ";path=";
}
