var maxsize = 140;
var minsize = 80;
if (!window.getComputedStyle)
{
	window.getComputedStyle = function(_elem)
	{
	  var computedStyle;
	  if (typeof _elem.currentStyle != 'undefined')
		{
			computedStyle = _elem.currentStyle;
		}
	  else
		{
			computedStyle = document.defaultView.getComputedStyle(_elem, null);
		}
	
	  return computedStyle;
	}
}

String.prototype.toInt = function()
{
	var returnvalue = "";
	for (i = 0; i < this.length; i++)
	{
		var char = this.substr(i,1);
		if (!isNaN(char))
		{
			returnvalue += char;
		}
	}
	return returnvalue - 0;
}

function getFontSize(_elem)
{
	fontSize = getComputedStyle(_elem, null)["fontSize"]+"";
	font = {}
	font.size = fontSize.toInt() + "";
	font.unit = fontSize.substr(font.size.length, fontSize.length - font.size.length);
	font.size -= 0;
	return font;
}

var units = new Array();
units[0] = new Array("%", 10);

function chooseunit(_unit)
{
	for (var i = 0; i < units.length; i++)
	{
		if (units[i][0] == _unit) return units[i][1];
	}
	return 1;
}

function biggerfont()
{
	var obj = document.getElementById("cpage2");
	var font = getFontSize(obj);
	var value = (font.size < maxsize) ? chooseunit(font.unit):0;
	obj.style.fontSize = (font.size+value)+font.unit;
}

function smallerfont()
{
	var obj = document.getElementById("cpage2");
	var fontSize = getFontSize(obj);
	var value = (font.size > minsize) ? chooseunit(font.unit):0;
	obj.style.fontSize = (font.size-value)+font.unit;
}

window.onload = function()
{
	if (document.getElementById("minimap"))
	{
		load_miniroutenplaner();
	}
}

window.onunload = function()
{
	if (document.getElementById("minimap"))
	{
		unload_miniroutenplaner();
	}
}