function init(){
	//hideFormText();
	initFontResize();
}
//function hideFormText()
//{
//	var _inputs = document.getElementsByTagName('input');
//	var _txt = document.getElementsByTagName('textarea');
//	var _value = [];
//	if (_inputs)
//	{
//		for(var i=0; i<_inputs.length; i++)
//		{
//			if (_inputs[i].type == 'text' || _inputs[i].type == 'password')
//			{
//				_inputs[i].index = i;
//				_value[i] = _inputs[i].value;
//				_inputs[i].onfocus = function()
//				{
//					if (this.value == _value[this.index])
//						this.value = '';
//				}
//				_inputs[i].onblur = function()
//				{
//					if (this.value == '')
//						this.value = _value[this.index];
//				}
//			}
//		}
//	}
//	if (_txt)
//	{
//		for(var i=0; i<_txt.length; i++)
//		{
//			_txt[i].index = i;
//			_value['txt'+i] = _txt[i].value;
//			_txt[i].onfocus = function()
//			{
//				if (this.value == _value['txt'+this.index])
//					this.value = '';
//			}
//			_txt[i].onblur = function()
//			{
//				if (this.value == '')
//					this.value = _value['txt'+this.index];
//			}
//		}
//	}
//}
function initFontResize()
{
	textChanger.init();
}
var textChanger = {
	defaultFS : 1.2,
	init: function()
	{
		var el = document.getElementsByTagName("body")[0];
		var sz = textChanger.getCookie();
		el.style.fontSize = sz ? sz + 'em' : textChanger.defaultFS + 'em';
		var incr = document.getElementById('increase');
		if(incr)
			incr.onclick = function(){textChanger.changeSize(1); return false;};
		var decr = document.getElementById('decrease');
		if(decr)
			decr.onclick = function(){textChanger.changeSize(-1); return false;};
		var reset = document.getElementById('reset');
		if(reset)
			reset.onclick = function(){textChanger.changeSize(0); return false;};
	},
	changeSize: function(val)
	{
		var el = document.getElementsByTagName("body")[0];
		var size = el.style.fontSize.substring(0,3);
		var fSize = parseFloat(size,10);
		if (val == 1)
		{
			fSize += 0.11;
			if (fSize > 2.0) fSize = 2.0;
		} 
		if (val == -1)
		{
			fSize -= 0.11;
			if (fSize < 0.5) fSize = 0.5;
		}       
		if (val == 0)
		{
			fSize = 1.2;
		}
		el.style.fontSize = fSize + 'em';
		textChanger.updateCookie(fSize);
	},
	updateCookie: function(vl)
	{
		var today = new Date();
		var exp = new Date(today.getTime() + (365*24*60*60*1000));
		document.cookie = 'textChangerL=size=' + vl + ';' +'expires=' + exp.toGMTString() + ';' +'path=/';
	},
	getCookie: function()
	{ 
		var cname = 'textChangerL=size=';   
		var start = document.cookie.indexOf(cname);
		var len = start + cname.length;
		if ((!start) && (cname != document.cookie.substring(0,cname.length))) {return null;}
		if (start == -1) return null;
		var end = document.cookie.indexOf(";",len);
		if (end == -1) end = document.cookie.length;
		return unescape(document.cookie.substring(len, end));
	}
}
if (window.addEventListener)
	window.addEventListener("load", init, false);
else if (window.attachEvent)
	window.attachEvent("onload", init);

