
SIZES = {

	minTextSize : 0.55,
	standardTextSize : 0.7,
	
	onload : function(_title) {
		var _div_sizes = document.getElementById("sizes");
		SIZES.writeControls(_div_sizes);
	},
	
	writeControls : function(_div_sizes) {
		var _controls = "";
		
		if(STYLES.textSize > SIZES.minTextSize){
			_controls = "<a href='#' onclick='SIZES.setSize(-1);'>A-</a> ";
		} else {
			_controls = "<span class='inactive'>A-</span> ";
		}
		if(STYLES.textSize != SIZES.standardTextSize){
			_controls += "<a href='#' onclick='SIZES.setSize(0);'>A=</a> ";
		} else {
			_controls += "<span class='inactive'>A=</span> ";
		}
						
		_controls += "<a href='#' onclick='SIZES.setSize(+1);'>A+</a>";
		_div_sizes.innerHTML = _controls;
	},
	
	/* font size */
	setSize : function(down_up) {
		//alert("setSize");

		switch(down_up) {
			case 0:
				STYLES.textSize = 0.7;
				break;
			case -1:
				STYLES.textSize -= 0.15;
				if(STYLES.textSize < SIZES.minTextSize) STYLES.textSize = SIZES.minTextSize;
				break;
			case 1:
				STYLES.textSize += 0.15;
				break;
		}	
		STYLES.setBodyTextSize(STYLES.textSize);
		var _container = document.getElementById("container");
		var containerWidth = _container.clientWidth;
		var documentWidth = document.width ? document.width : document.documentElement.offsetWidth - 25;
		//alert(_container.clientWidth + " / " + dw);
		switch(down_up) {
			case 0:
				if(containerWidth < documentWidth) {
					STYLES.setActiveStyleSheet("settings_1");
				} else {
					STYLES.setActiveStyleSheet("settings_2");
				}
			case 1:
				if(containerWidth > documentWidth) {
					STYLES.setActiveStyleSheet("settings_2");
				}
			break;
			case -1:
				if(containerWidth < documentWidth) {
					STYLES.setActiveStyleSheet("settings_1");
				}
			break;
		}
		
		SIZES.onload();
		//COLUMN.setTall();
	}

}

if (document.getElementsByTagName){
	EXTRAS.addEvent(window, 'load', SIZES.onload, false);
}