if(!ChangeFontSize) var ChangeFontSize = {};			// verifica se ChangeFontSize existe e a declara
ChangeFontSize = Class.create();						// cria a classe ChangeFontSize

ChangeFontSize.prototype = {
	
	count					: null,
	minSize					: null,
	maxSize					: null,
	element					: null,
	
	initialize				: function(element, minSize, maxSize, init) {			// contrutor da classe
		
		this.element = element;
	
		if (minSize) {
			this.minSize = minSize;
		}
		if (maxSize) {
			this.maxSize = maxSize;
		}
		if (init) {
			this.count = init;
		}
		
		this._init();
	},
	
	_init					: function() {
		var increaseSizeLinks = $$(".increaseLink a"); 
		var decreaseSizeLinks = $$(".decreaseLink a");
		
		for (x=0; increaseSizeLinks.length > x; x++) {
	 		Event.observe(increaseSizeLinks[x], 'click', this.increase.bindAsEventListener(this));
		}
		
		for (x=0; decreaseSizeLinks.length > x; x++) {
	 		Event.observe(decreaseSizeLinks[x], 'click',  this.decrease.bindAsEventListener(this));
		}
		this.element.addClassName("fontSize" + this.count);	
	},
	
	increase				: function() {
		this.changeSize(1);
	},

	decrease				: function() {
		this.changeSize(-1);
	},
	
	changeSize				: function(offSet) {
		
		this.count += offSet;

		if (this.count < this.minSize) {
			if (offSet < 0){
				this.count = this.minSize;
			}
		}
	
		if (this.count > this.maxSize) {
			if (offSet > 0){
				this.count = this.maxSize;
			}
		}

		this.element = this.element.removeClassName("fontSize" + (this.count+1));
		this.element = this.element.removeClassName("fontSize" + (this.count-1));

		this.element.addClassName("fontSize" + this.count);
	}
	
}