window.onresize = winResize;

// Korrekturen für Browserfenster mit sehr kleiner Auflösung
function winResize()
{
	// Scrollbalken-Korrektur
	var winHeight = 0;
	var divHeight = 0;
	
	if (window.innerHeight) 
		winHeight = window.innerHeight;
	else if (document.body && document.body.offsetHeight) 
		winHeight = document.body.offsetHeight;
	
	divHeight = winHeight - document.getElementById('Kopfzeile').offsetHeight;

	if (divHeight < 1) 
	{
		divHeight = 1;
	}
 	document.getElementById('Navigation').style.height = divHeight - 4 + 'px';
 	
	if (navigator.appName.indexOf("Microsoft") == -1) 
	{
 		if (divHeight < 700) 
 		{
 			divHeight = divHeight - parseInt((700 - divHeight) / 12);
 		}
	}
 	
 	document.getElementById('Inhalt').style.height = divHeight - 4 +  'px';
}

// Hintergrundfarbenwechsel
function setFldIn(obj)
{
	obj.style.background = '#FEFAE4';
}

function setFldOut(obj)
{ 
	obj.style.background = '#ffffff';
}

// String-Operationen
function trim(str, chars) 
{
    return ltrim(rtrim(str, chars), chars);
}

function ltrim(str, chars) 
{
    chars = chars || "\\s";
    return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}

function rtrim(str, chars) 
{
    chars = chars || "\\s";
    return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}

