/*********************************************************
	Automatische Bildschirmanpassung
	Version		1.1
	Stand		09.02.2011
*********************************************************/
function resize_110122(){
	var nav		= document.getElementById("nav");
	var cont	= document.getElementById("content");
	var txt		= document.getElementById("txt");
	var minFs	=	12;
	var maxFs	=	15;
	cont.style.minWidth="300px";
	var mWidth		= window.innerWidth || (window.document.documentElement.clientWidth || window.document.body.clientWidth);
	var mHeight		= window.innerHeight || (window.document.documentElement.clientHeight || window.document.body.clientHeight);
	var nWidth		= Math.floor(mWidth*0.2);
	if(nWidth <200) nWidth=200;
	var dist		= Math.floor(mWidth*0.01);
	var nCLeft 		= nWidth+dist;
	var nCWidth 	= mWidth-(nCLeft+5);
	if(nCWidth<300)nCWidth=300;  //content mindestbreite
	cont.style.width=nCWidth+"px";
	var nCHeight 			= Math.floor(mHeight*0.99)-16;
	with(cont.style){
		height		= nCHeight+"px";
		width		= nCWidth+"px";
		minHeight	= nCHeight+"px";
		left		= nCLeft+"px";
		overflow	="auto";
	}
	with(nav.style){
		overflow="auto";
		height		= nCHeight+"px";
		width		= nWidth+"px";
		minHeight	= nCHeight+"px";
	}
	var fs;
	var yfs	= nCHeight/60;
	var xfs	= nCWidth/90;
	if(xfs>yfs)fs=xfs; else fs=xfs;
	fs=Math.round(fs);
	if(fs<minFs) fs=minFs;
	if(fs>maxFs) fs=maxFs;
	cont.style.fontSize= Math.floor(fs)+"px";
	nav.style.fontSize= Math.floor(fs)+"px";
	if(txt){
		var ts;
		ts=fs;
		var tw=Math.floor(ts *65);
		if(tw>nCWidth)tw=nCWidth;
		if(tw<50)tw=50;
		txt.style.width=tw-20+"px";
		
		
	}
}
window.addEventListener?window.addEventListener('load',resize_110122,false):window.attachEvent('onload',resize_110122);
window.addEventListener?window.addEventListener('resize',resize_110122,false):window.attachEvent('onresize',resize_110122);
