
var font =
{
	defaultFontSize: 85,
	currentFontSize: 0,
	increment: 10,
	max: 3,
	imagesDirectory: "images/",
	
	init: function()
	{
		var fontsize = document.getElementById("fontsize");
		var anchors = fontsize.getElementsByTagName("a");
		
		for (var i = 0; i < anchors.length; i++)
		{
			switch(anchors[i].getElementsByTagName("img")[0].alt)
			{
				case "Smaller":
				
					anchors[i].onclick = font.down;
					
					break;
				
				case "Larger":

					anchors[i].onclick = font.up;
					
					break;
					
				default:
				
					anchors[i].onclick = font.reset;
			}
		}

		return true;
	},
	
	up: function()
	{
		if (font.currentFontSize < font.max)
		{
			font.currentFontSize++;
			
			document.getElementsByTagName("body")[0].style.fontSize = font.defaultFontSize + (font.currentFontSize * font.increment) + "%";
		}
		
		return false;
	},
	
	down: function()
	{
		if (font.currentFontSize > -font.max)
		{
			font.currentFontSize--;
			
			document.getElementsByTagName("body")[0].style.fontSize = font.defaultFontSize + (font.currentFontSize * font.increment) + "%";
		}
		
		return false;
	},
	
	reset: function()
	{
		font.currentFontSize = 0;
		
		document.getElementsByTagName("body")[0].style.fontSize = font.defaultFontSize + "%";
		
		return false;
	}
};




schedule("window", font.init);
