var styleSwitcher = Class.create();

styleSwitcher.prototype = {
    initialize: function(stylePrefix,activeSheet) {
    	this.stylePrefix = stylePrefix || 'bigger';
    	this.activeSheet = activeSheet || 1;
    	this.links = $$("link");
		
		this.setActiveStyleSheet();
    },
    
    changeTextSize : function(a) {
    	if (a == "+") {
			this.activeSheet = this.activeSheet < 3 ? this.activeSheet+1 : this.activeSheet;
		}
		if (a == "-") {
			this.activeSheet = this.activeSheet > 0 ? this.activeSheet-1 : this.activeSheet;
		}
		if ( this.activeSheet <= 3 ) {
			this.setActiveStyleSheet();
		}
	},
	
	setActiveStyleSheet : function() {
		for (var link=0; link<this.links.length; link++) {
			if(this.links[link].getAttribute("rel").indexOf("alternate") != -1 && this.links[link].getAttribute("title")  ) {
				this.links[link].disabled = true;
				if(this.links[link].getAttribute("title") == "bigger"+this.activeSheet){
					this.links[link].disabled = false;
				}
			}
		}
	}	
	
}
