var GECKO = document.getElementById? 1:0 ;
var NS = document.layers? 1:0 ;
var IE = document.all? 1:0 ;

function checkSELECT() {
	if (form.grund.selectedIndex == 11 || form.grund.selectedIndex == 12) {
		openlayer('lay_grunddauer');
	} else {
		closelayer('lay_grunddauer');
	}
} function radioWert(rObj) {
	for (var i=0; i<rObj.length; i++) if (rObj[i].checked) return rObj[i].value;
	return false;
} function closelayer(Layer_Name) {
	if (GECKO) {
		document.getElementById(Layer_Name).style.display='none';
	} else if (NS) {
		document.layers[Layer_Name].display='none';
	} else if (IE) {
		document.all[Layer_Name].style.display='none';
	}
} function openlayer(Layer_Name) {
	if (GECKO) {
		document.getElementById(Layer_Name).style.display='block';
	} else if (NS) {
		document.layers[Layer_Name].display='block';
	} else if (IE) {
		document.all[Layer_Name].style.display='block';
	}
}


var bodyWidth = 0;

function getWidth(){
	if( typeof( window.innerWidth ) == 'number' ) {    //Non-IE
		bodyWidth = window.innerWidth;
	} 
	else {
		if( document.documentElement && ( document.documentElement.clientWidth ) ) {
			//IE 6+ in 'standards compliant mode'
			bodyWidth = document.documentElement.clientWidth;
		} 
		else {
			if( document.body && ( document.body.clientWidth ) ) {
				bodyWidth = document.body.clientWidth;
			}
		}
	}
	return(bodyWidth);
}

function adjustWidth() {
	var bodyWidth=getWidth();
	if(bodyWidth < 1000) {
		var nVer = navigator.appVersion;
		var nAgt = navigator.userAgent;
		var fullVersion = parseFloat(0);
		var majorVersion = parseInt(0);
		if ((verOffset=nAgt.indexOf("MSIE"))!=-1) {
			fullVersion = parseFloat(nAgt.substring(verOffset+5,nAgt.length));
			majorVersion = parseInt(''+fullVersion);
		}
		if (fullVersion > 0 && fullVersion < 7) {
			document.getElementById('metanav').style.width='1000px';
			document.getElementById('dreispalten').style.width='1000px';
			document.getElementById('footer1').style.width='1000px';
		}
	} else {
		document.getElementById('metanav').style.width='100%';
		document.getElementById('dreispalten').style.width='100%';
		document.getElementById('footer1').style.width='100%';
	}
}
