function resize_background() {
  var myWidth = 0, myHeight = 0, bildhoehe = 900, bildbreite = 1200, neue_bildhoehe = 900, neue_bildbreite = 1200;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
//window.alert( 'Bild-Breite: ' + neue_bildbreite + ' Bild-Höhe: ' + neue_bildhoehe + '\r\nFenster-Breite: ' + myWidth + ' Fenster-Höhe: ' + myHeight);
  if ((myWidth > bildbreite) || (myHeight > bildhoehe))
	{
//	  window.alert('1');
	  if ((myWidth > bildbreite) && (myHeight > bildhoehe))
	  {
//		window.alert('2');
		if ((myWidth / 4) < (myHeight / 3))
		  {
//			window.alert('3');
			neue_bildbreite = Math.round(myHeight / 3 * 4);
			neue_bildhoehe = myHeight;
		  }
		 else {
//			window.alert('4');
			neue_bildhoehe = Math.round(myWidth / 4 * 3);
			neue_bildbreite = myWidth;
			}
	  }
	  else {
		  if (myWidth > bildbreite) {
//			window.alert('5');
			  neue_bildhoehe = Math.round(myWidth / 4 * 3);
			  neue_bildbreite = myWidth;
		  }
		  if (myHeight > bildhoehe) {
			  neue_bildbreite = Math.round(myHeight /3 * 4);
			  neue_bildhoehe = myHeight;
//  			window.alert('6');
		  }
	  }
	document.getElementById('bg_gestreckt').style.width = neue_bildbreite + 'px';
	document.getElementById('bg_gestreckt').style.height = neue_bildhoehe + 'px';
	document.getElementById('bg_gestreckt').style.display = "block";
	document.getElementById('bg_normal').style.display = "none";
//	window.alert( 'Neue Bild-Breite: ' + neue_bildbreite + ' Neue Bild-Höhe: ' + neue_bildhoehe + '\r\nFenster-Breite: ' + myWidth + ' Fenster-Höhe: ' + myHeight);
	}
 // wenn browserfenster in hohe und breite kleiner als Bildgroesse ist dann 
// div bg_gestreckt verstecken und bg_normal anzeigen
else {
	document.getElementById('bg_normal').style.width = myWidth;
	document.getElementById('bg_normal').style.height = myHeight;
	document.getElementById('bg_gestreckt').style.display = "none";
    document.getElementById('bg_normal').style.display = "block";
	}
}	

