  // Abfrage auf CSS
if(document.ids)x='nc4';
else if( document.all && !document.getElementById )x='ie4';
else if( window.opera && !document.createElement )x='op5';
else if( window.opera && window.getComputedStyle )  {
          if(document.createRange)x='op8';
            else if(window.navigate)x='op7.5';
                             else x='op7.2';                   }
else if( window.opera && document.compatMode )x='op7';
else if( window.opera && document.releaseEvents )x='op6';
else if( document.contains && !window.opera )x='kq3';
else if(window.pkcs11&&window.XML)x='f15';
else if( window.getSelection && window.atob )x='nn7';
else if( window.getSelection && !document.compatMode )x='nn6';
else if( window.clipboardData && document.compatMode )
  x=window.XMLHttpRequest? 'IE7' : 'IE6';
else if( window.clipboardData ){x='ie5';
     if( !document.createDocumentFragment ) x+='.5'; 
     if( document.doctype && !window.print ) x+='m';}
else if( document.getElementById && !document.all ) x='op4';
else if( document.images && !document.all ) x='nn3';
else if(document.clientWidth&&!window.RegExp)x='kq2';
else x='???';


if(x == 'IE7')
{
document.write('<link href="css/moselglas_FF.css" rel="stylesheet" type="text/css">');
}
else if(navigator.appName == 'Microsoft Internet Explorer')
{
document.write('<link href="css/moselglas_IE.css" rel="stylesheet" type="text/css">');
}
else
{
document.write('<link href="css/moselglas_FF.css" rel="stylesheet" type="text/css">');
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

MM_reloadPage(true);

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


var cancelImage=false;
function overlibImage(caption,imagePath)
{
  bgImage=new Image();
  bgImage.src=imagePath;
  if(!bgImage.complete)
  {
    overlib("Bild wird geladen...",FGCOLOR,'#FFFFFF',WIDTH,120);
    cancelImage=false;
    bgImage.onload=function()
    {   
      if(!cancelImage)
      {
        var substringpos=bgImage.src.length-imagePath.length;
        if(bgImage.src.substring(substringpos)==imagePath)
        {
          overlib(caption,TEXTCOLOR,'#FFFFFF',BACKGROUND,imagePath,FGCOLOR,'',WIDTH,bgImage.width,HEIGHT,bgImage.height,VAUTO);
        }
      }
    }
  }
  else
  {
    overlib(caption,TEXTCOLOR,'#FFFFFF',BACKGROUND,imagePath,FGCOLOR,'',WIDTH,bgImage.width,HEIGHT,bgImage.height,VAUTO);
  }
}

function overlibMouseout()
{
  cancelImage=true;
  return nd();
}

// Höhen richtig einstellen*************************************************************************************
function adjustLayout() {
	
	var iHeight = xHeight("area_head");
	var hoehe = Fensterhoehe ();
	xHeight("main_hg", hoehe-iHeight-75);
	xHeight("area_main", hoehe-iHeight-95);
	xHeight("main_hg_bild",hoehe-iHeight-95);
	xHeight("main_hg_bild_rechts",hoehe-iHeight-95);
	xHeight("main_hg_bild_links",hoehe-iHeight-95);
	xHeight("hauptseite_inhalt",hoehe-iHeight-95);
	xHeight("si_scroll",hoehe-iHeight-95);
	xHeight("si_menu",hoehe-iHeight-95);
	if(hoehe-iHeight-195 > 270) {
		document.getElementById("adresse").style.visibility = '';
		xTop("adresse",hoehe-iHeight-195);
	}
	else
		document.getElementById("adresse").style.visibility = 'hidden';
}


function Fensterweite () {
  if (window.innerWidth) {
    return window.innerWidth;
  } else if (document.body && document.body.offsetWidth) {
    return document.body.offsetWidth;
  } else {
    return 0;
  }
}

function Fensterhoehe () {
  if (window.innerHeight) {
    return window.innerHeight;
  } else if (document.body && document.body.offsetHeight) {
    return document.body.offsetHeight;
  } else {
    return 0;
  }
}

/* Überwachung von Netscape initialisieren*/
if (!window.alteWeite && window.innerWidth) {
  window.onresize = neuAufbau;
  Weite = Fensterweite();
  Hoehe = Fensterhoehe();
}

function neuAufbau () {
  if (Weite != Fensterweite() || Hoehe != Fensterhoehe())
    location.href = location.href;
}

// Bildwechsel bei DIV-Anzeige *************************************************************************************
function showMainPicture(){

	if(xHeight("kopfbild")!=0) {
		Effect.BlindUp('kopfbild'); 
		var myAjax = new Ajax.Request("aufbau/menu.php", { method: 'get', parameters: {bildNav: 'X_'}, onComplete: setze_menu });
		setTimeout('adjustLayout()',1250); 
		document.getElementById("changePic").src = 'gifs/aufbau/aufklappen.png';
		return false;
	} else {
		Effect.BlindDown('kopfbild'); 
		var myAjax = new Ajax.Request("aufbau/menu.php", { method: 'get', parameters: {bildNav: ' '}, onComplete: setze_menu });
		setTimeout('adjustLayout()',1250); 
		document.getElementById("changePic").src = 'gifs/aufbau/zuklappen.png';
		return false;
	}

}

function setze_menu( originalRequest ) {
  document.getElementById('menu').innerHTML = originalRequest.responseText;
}

