var GivingInAction = new Object();

GivingInAction.setTextSize = function ( size ) {
	size = 0 + size;
	document.body.style.fontSize = size + "px";
	
	document.cookie = "fontsize=" + ('00' + size).slice(-2) + "; path=/";
};

GivingInAction.init = function () {
	var cookies = ' ' + document.cookie;
	
	var at = cookies.indexOf( ' fontsize=' );
	GivingInAction.raw = '11';
	if ( at >= 0 ) {
		GivingInAction.raw = cookies.substr( at + 10, 2 ); // always 2 digits	
	}

GivingInAction.setTextSize(parseInt(GivingInAction.raw));
};

do {
	/* Internet Explorer */
	/*@cc_on @*/
	/*@if (@_win32)
		if ( window.location.protocol != "https:" ) {
			document.write("<sc" + "ript id='__ie_observeDOMReady' defer='defer' src='javascript:void(0);'><\/sc" + "ript>");
			GivingInAction.DOMReadyBrowserDevice = document.getElementById("__ie_observeDOMReady");
			GivingInAction.DOMReadyBrowserDevice.onreadystatechange = function() {
				if (this.readyState == "complete") {
					GivingInAction.init(); // call the onload handler
				}
			};
			break;
		}
	/*@end @*/
	
	/* Safari/Konqueror */
	/* WebKit must be tested for before DOM2 standard because WebKit supports document.addEventListener but NOT the 
	   DOMContentLoaded event. */
	if (/WebKit/i.test(navigator.userAgent)) { 
		Event.DOMReadyBrowserDevice = setInterval(function() {
			if (/loaded|complete/.test(document.readyState)) {
				clearInterval(Event.DOMReadyBrowserDevice);
				GivingInAction.init(); 
			}
		}, 10);
		break;
	}
	
	/* Mozilla/Opera9/DOM2 Compliant browsers */
	if (document.addEventListener) {
		document.addEventListener("DOMContentLoaded", GivingInAction.init, false);
		break;
	}

	/* Anything else */
	if (window.addEventListener) {
		window.addEventListener("load", GivingInAction.init, false);
	} else if(window.attachEvent) {
		window.attachEvent("onload", GivingInAction.init);
	}

} while(0);

