TextSize = {
	increment: 1.1875,
	currentPercent: null,
	defaultPercent: 100,
	defaultSize: 16,
	originalPercent: null,
	minSize: null,
	maxSize: null,
	inited: false,
	
	init: function(){
		if(!this.inited){
			this.inited = true;
			var element = $E('body');
			var origSize = element.getStyle("font-size");
			if(origSize.indexOf("%")!=-1){
				this.originalPercent = parseInt(origSize);
			}else if(origSize.length>0){
				var size = parseInt(origSize);
				if(!isNaN(size) && size>0){
					this.originalPercent = (size/this.defaultSize)*this.defaultPercent;
				}
			}else{
				this.originalPercent = this.defaultPercent;
			}
			element.setStyle("font-size",this.originalPercent+"%");
			this.currentPercent = this.originalPercent;
		}
	},
	limit: function(min, max){
		this.minSize = min;
		this.maxSize = max;
	},
	reset: function(tween){
		this.init();
		this.adjust(this.originalPercent, tween);
	},
	increase: function(tween){
		this.init();
		this.adjust(this.currentPercent*this.increment, tween);
	},
	decrease: function(tween){
		this.init();
		this.adjust(this.currentPercent*(1/this.increment), tween);
	},
	adjust: function(to, tween){
		if(tween==null)tween = false;
		if(to>0){
			var old = this.currentPercent;
			if(this.maxSize)to = Math.min(to,this.maxSize);
			if(this.minSize)to = Math.max(to,this.minSize);
			this.currentPercent = to;
			if(tween && Fx!=null && old!=null){
				var myEffect = $E('body').effect('font-size', {duration: 500, unit: "%"});
				myEffect.start(to+"%");
			}else{
				$E('body').setStyle("font-size",to+"%");
			}
		}
	}
};
					 