/*
*******************************************************************************************************************************************************
Do not remove this notice. 

Copyright (c) since 2007 by Andreas Janda.

See http://www.teutoburger-schlacht.de for terms of use.
*******************************************************************************************************************************************************
*/

 
  
  
  
function win(p, name, ww, hh, z, fmt)
  {
  var h=hoehe(ww, hh, z, fmt);//alert(h);
  var w=breite(ww, hh, z, fmt);

/*  
if(navigator.appName=="Microsoft Internet Explorer")
  {
  var scrollweite=100;

  if(2*w==3*h)
    h=h+1;
  while(2*w!=3*h)
    {                                        document.write("Fenstergr&ouml;ße 2/3-optimieren"+"<br>");
    if(h>2*w/3)
	  {
	  h=2*w/3;
      f.resizeTo(w, h);
	  }
    else
	  {
	  w=3*h/2;
      f.resizeTo(w, h);
	  }
	  	                                        document.write(2*w+", "+3*h+"<br>");
    f.scrollTo(0, 0);
	var y=new Array(-1, 0);
	f.scrollBy(0, 1);//alert(w+", "+h);
	while((2*w==3*h)&&y[0]!=y[1]&&y[1]<screen.availHeight)
      {                                      document.write("while-schleife"+"<br>");
	                                          document.write(y[0]+", "+y[1]+"<br>");
      y[0]=y[1];
	  	                                          document.write(y[0]+", "+y[1]+"<br>");
      y[1]=f.document.body.scrollTop;
	  	                                          document.write(y[0]+", "+y[1]+"<br>");
      f.scrollBy(0, scrollweite);
	  y[0]=f.document.body.scrollTop;
	  	                                          document.write(y[0]+", "+y[1]+"<br>");
	  if(y[0]<scrollweite)
        {	                                          document.write(y[0]+", "+y[1]+"<br>");
	    h=h+y[0];
		y[1]=y[0];
//		w=3*h/2-1;
//		if(y[0]==0)
//		  {
//		  y[1]=y[0];
		  while(3*h>2*w||3*h<2*w)
		    {	                                          document.write("gemeinsamer nenner "+3*h+", "+2*w+"<br>");
            if(3*h<2*w)
			  h=h+1;
			else
			  w=w+1;
			  	                                          document.write(3*h+", "+2*w+"<br>");
			}
//          }
		}
	  else
        {
	    h=h+y[0];
	    w=3*h/2-1;
		y[1]=y[0];
		}
      }
	
	                                        document.write(h+", "+w+"<br>");											
    }
*/

  if(h>=screen.availHeight)
    {
    var f=window.open(p+name+'.htm', name, 'width='+w+', height='+h+', resizable=yes, scrollbars=yes');
	//MSIE misst die Innenmaße, daher Überstand nach unten
	}
  else
    var f=window.open(p+name+'.htm', name, 'width='+w+', height='+h+', resizable=yes');


/*  
// nach_oben_scrollen:
  var y1=y[1];
  while(y1>0)
    {
    f.scrollBy(0, -25);
    y1=y1-25;
    }
*/

  fenster_zentrieren(f, w, h);

  f.focus();

 
// }  // end if(nav.appName=="MSIE")
  }   // Ende function win

  
  
  
  
function hoehe(w, h, z, fmt)
  {
    switch(fmt)
    {
    case 1:     // Text neben dem Bild (raspi, mall)
      w=w+300;
      h=h+144; 
      break;
    case 2:     // Text unter dem Bild (spbg, bgf, raspi, mall)
      h=h+143;  
      if(navigator.appName=='Microsoft Internet Explorer')
        w=w+56;  
      else
        w=w+43; 
      break; 
    case 3:     // nur Text, kein Bild bzw. B[px] * H[z] (Begriffs-Erkl.-Dateien und große)
      h=h+112;
      break;
    case 4:     // frei skalierbar (px * px) mit Text und Bild (Lettner (Neustädter))
      break;
    case 5:     // wie 2, nur schmale Rahmen (neust)
      w=w+50;
      h=h+142;
      break;
    case 6:     // wie 1, nur schmale Rahmen (neust)
      w=w+300;
      h=h+126;
      break;
    default:    // kein Text, nur Bild (Alter Markt usw., canv, spbgf)
      w=w+50;
      h=h+114;
    }
  if(z==0)
    var n=0;
  else if(z>0)
    var n=38+(z-1)*23;//alert('n='+n+'    h='+h);
  h=h+n;
  // f_overflow:
  if(h>=screen.availHeight)
    {
    h=screen.availHeight;
	if(navigator.appName=='Opera')
	  h=h-50;
    w=w+18;
    }
  return h;
  }
  
  


function breite(w, h, z, fmt)
  {
    switch(fmt)
    {
    case 1:     // Text neben dem Bild (raspi, mall)
      w=w+300;
      h=h+144; 
      break;
    case 2:     // Text unter dem Bild (spbg, bgf, raspi, mall)
      h=h+143;  
      if(navigator.appName=='Microsoft Internet Explorer')
        w=w+56;  
      else
        w=w+43; 
      break; 
    case 3:     // nur Text, kein Bild bzw. B[px] * H[z] (Begriffs-Erkl.-Dateien und große)
      h=h+112;
      break;
    case 4:     // frei skalierbar (px * px) mit Text und Bild (Lettner (Neustädter))
      break;
    case 5:     // wie 2, nur schmale Rahmen (neust)
      w=w+50;
      h=h+132;
      break;
    case 6:     // wie 1, nur schmale Rahmen (neust)
      w=w+300;
      h=h+126;
      break;
    default:    // kein Text, nur Bild (Alter Markt usw., canv, spbgf)
      w=w+50;
      h=h+114;
    }
  if(z==0)
    var n=0;
  else if(z>0)
    var n=38+(z-1)*23;
  h=h+n;
  // f_overflow:
  if(w>screen.availWidth)
    w=screen.availWidth;
  return w;
  }





function fenster_zentrieren(f, w, h)
  {
//  alert("zentrieren");
  if(w%2==0)
    var l=(screen.availWidth-w)/2;
  else
    var l=(screen.availWidth-w-1)/2;
  if(l<0)l=0; 
  var s=screen.height-screen.availHeight;
  if(h<=screen.availHeight && h>=screen.height-2*s)
    var t=screen.availHeight-h;
  if(h<screen.height-2*s)
    {
    if(h%2==0)
      var t=(screen.height-h)/2;
    else
      var t=(screen.height-h-1)/2;
    }
  f.moveTo(l, t);
  }




/*
function imFrame(a, b, c)
  {
  if(top.frames.length==0)
    {
    var x='';
    for(var i=1; i<=a; i++)
      x=x+'../';
    a=x;
    if(b!='')
      {
      x=b;
      b=b+'_links.htm';
      if(dateiname(location.href)!=b)
        {
        b=x+'/'+x+'_frame.htm?';
        if(c!='')
          {
          if(c.indexOf('?')!=c.length-1)
            c=c+'/';
          else
            c=ordnernamen(x)+'/'+c;
          }
        else
          {
          if(location.href.indexOf('termine')!=-1)
            c='veranstaltungskalender.htm?termine/'+ordnername(location.href)+'/';
		  else if(location.href.indexOf('automuseum')!=-1)
		    {
		    switch(ordnername(location.href))
		      {
			  case 'lkw':
			    c='nutzfahrzeuge.htm?lkw/';
              break;	 
              case 'pkw':
                c='oldtimer.htm?pkw/';
		      break;	 
              case 'yng':
                c='youngtimer.htm?yng/';
			  break;	 
              case 'us':
                c='us_cars.htm?us/';
              break;
              default:
                c='';				   
			  }
			  c='automuseum/'+c;
		    }
          else
            {
            c=ordnernamen(x);
            if(c!='')
              c=c+'/';
            }
          }  
        b=b+c+dateiname(location.href);
        }
      else
        b=x+'/'+x+'_frame.htm';
      }
    if(b=='')
      var address=a+'index.htm';
    else
      var address=a+'index.htm?freizeit/'+b;
    if(document.images)
      top.location.replace(address);
    else
      top.location.href=address;
	}
  }
*/





function imFrame(a, b)// a=aufwärts bis index, b=Verzeichnis/se zwischen index und datei
  {
  if(top.frames.length==0)
    {
	/*if(top.location.href.indexOf('#'))
	  b=b+top.location.hash;*/
    address=a+'index.htm?'+b+top.location.href;
    if(document.images)
      top.location.replace(address);
    else
      top.location.href=address;
    }
  }





function ordnernamen(x)
  {
  var a=new String(location.href);
  var b=location.href.length;
  var c=location.href.indexOf(x);
  for(var i=b-1; i>=0; i=i-1)
    {
    d=new String(location.href.charAt(i));
    if(d=='/')
      {
      a=a.slice(c+x.length+1, i);
      i=-1;
      }
    }
    return a;
  }









/*function imFrame(a, b)
  {
  if(top.frames.length==0)
    {
    address=a+'index.htm?freizeit/'+b;
    if(document.images)
      top.location.replace(address);
    else
      top.location.href=address;
    }
  } */









function imFrameWin(a, b, c0, c1, c2, c3, c4, c5)
/*
a = Anzahl ../ bis zur index.htm-Ebene
b = Pfad der Datei vor der das Fenster ge&ouml;ffnet werden soll
c0 = ./ (JS-Parameter für diese Funktion)
c1 = Name der Datei, die im Fenster ge&ouml;ffnet werden soll
c2 = Breite des Fensters (Pixel)
c3 = H&ouml;he des Fensters (Pixel; nicht erforderlich = 0)
c4 = Zeilen
c5 = Format
*/
  {
  if(window.opener!=null && window.opener.location.href==self.location.href)
	{
	var y=0;
	y=y+1;
	}
  else if(window.opener==null || window.opener.location.href.indexOf('sitemap')!=-1)
    {
	if(self.location.href.indexOf('sitemap_info')==-1 || (self.location.href.indexOf('sitemap_info')!=-1 && window.opener==null))
	  {
      address=a+/*'index.htm?'+*/b;
      if(document.images)
	    {
	    if(top.location.href!=address)
          top.location.replace(address);
        }
      else if(top.location.href!=address)
        top.location.href=address;
      win(c0, c1, c2, c3, c4, c5);
      }
    }
  if(window.opener!=null && window.opener.location.href!=self.location.href)
	{
    if(pfad(self.location.href)==pfad(window.opener.location.href))
	  window.opener.close();
	}
  }	





  
 
function pfad(x)
  {
  var a=new String(x);
  var b=a.length;
  var c=a.charAt(b-1);
  var d=new String('');
  var e=new String('');
  for(var i=b-1; i>=0; i=i-1)
    {
    c=a.charAt(i);
	d=('');
    if(c=='/')
      {
      var j=i-1;
	  var f=a.charAt(j);
      while(f!='/' && f!='?' && j>=0)
	    {
        d=d+f;
		j=j-1;
		f=a.charAt(j);
	    i=j+1;
		if(f=='?')
		  j=-1;
		}
	  if(d=='tiezierf')
        i=-1;
      else		
	    e=e+d;
      }
    }
    return e;
  }  


  



function text(tx)
  {
  window.defaultStatus=tx;
  }





function textop(tx)
  {
  if(window.opener!=null&&window.opener.location.href.indexOf('sitemap')==-1)
  window.opener.defaultStatus=tx;
  }
  
  
  
  
  
function opfoc()  
  {
  if(window.opener!=null&&window.opener.location.href.indexOf('sitemap')==-1)window.opener.focus();
  }
 
 





function dateiname(name)
  {
   var a=new String(name);
   var b=a.length;
   var c=a.charAt(b-1);
   for(var i=b-1; i>=0; i=i-1)
     {
     c=a.charAt(i);
     if(c=='/')
       {
       a=a.slice(i+1, b);
       i=-1
       }
     }
   return a;
  }





function ordnername(name)
  {
   var a=new String(name);
   var b=a.length;
   var c=a.charAt(b-1);
   for(var i=b-1; i>=0; i=i-1)
     {
     c=a.charAt(i);
     if(c=='/')
       {
       name=name.slice(0, i);
       a=dateiname(name);
       i=-1;
       }
     }
   return a;
  }





var bild;

function bild_over(a)
  {
  bild.src=a;
  }

function bild_out(a)
  {
  bild.src=a;
  }
  
    
  
  
  
  
  


  
var subs=new Array('sub1','sub12','sub122','sub13','sub14','sub143');
    
function hideall()
  {
  for(i=0; i<subs.length; i++)
    {
    document.getElementById(subs[i]).style.visibility='hidden';
    }
  }






  
function anzeige(mode,elem)
  {
  if(mode=='v')
    {
    //hideall();
    document.getElementById(elem).style.visibility='visible';
    }
  else
    {
    document.getElementById(elem).style.visibility='hidden';
    }
  }
  
  



var hide=new Array('hideA', 'hideB', 'hideC', 'hideD', 'hideE', 'hideF', 'hideK', 'hideL','hideM', 'hideN', 'hideO', 'hideP', 'hideV', 'hideW', 'hideX', 'hideY', 'hideZ'); 

if(navigator.appName=='Microsoft Internet Explorer')
  {
  document.write('<style type="text/css">');
  for(i=0; i<hide.length; i++)
    { 
    document.write('.'+hide[i]+'{z-index:'+(-i-2)+';}');
    }
  document.write('</style>');
  }
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
