// JavaScript Document
var infotext = new Array();
function fenster(NeueBreite, NeueHoehe)
{
    window.resizeTo(NeueBreite, NeueHoehe);
    window.moveTo((screen.availWidth-NeueBreite)/2, (screen.availHeight-NeueHoehe-60)/2);
}
function Fensterbreite () {
  if (window.innerWidth) {
    return window.innerWidth;
  } else if (document.body && document.body.offsetWidth) {
    return document.body.offsetWidth;
  } else {
    return 0;
  }
}

function Fensterhoehe () {
var hoehe=0;
if (self.innerHeight)
{
   hoehe = self.innerHeight;
}

// Explorer 6 Strict Mode
else if (document.documentElement && document.documentElement.clientHeight)

{
        hoehe = document.documentElement.clientHeight;
}

// andere Explorers
else if (document.body)
{
        hoehe = document.body.clientHeight;
}
return hoehe;
}

function resizebox(){
  if(getheight(document.getElementById("kopf"))==0){
     document.body.style.height= 'auto';
     document.body.style.overflow= 'visible';
	 document.getElementById("seite").style.height= 'auto';
     document.getElementById("seite").style.overflow= 'visible';
	 document.getElementById("inhalt_scroll").style.height= 'auto';
     document.getElementById("inhalt_scroll").style.overflow= 'visible';
	 document.getElementById("inhalt").style.height= 'auto';
     document.getElementById("inhalt").style.overflow= 'visible';
	 document.getElementById("inhalt_r").style.height= 'auto';
     document.getElementById("inhalt_r").style.overflow= 'visible';
  	 document.getElementById("kopf").style.width= '100%';
  	 document.getElementById("leisteo").style.width= '100%';
  	 document.getElementById("leisten").style.width= '100%';
  	 document.getElementById("inhalt_scroll").style.width= '100%';
  	 document.getElementById("stru").style.width= '100%';
  	 document.getElementById("strz").style.width= '100%';
  	 document.getElementById("leisteu").style.width= '950px';
  	 document.getElementById("seite").style.width= '100%';
	 document.getElementById("leisteo_inhalt").style.width= 'auto';
  }
  else
  {
     var h=Fensterhoehe()-152;
     var w=Fensterbreite()-23;
	 var h1=Fensterhoehe()-2;
	 var wz=0;
	 if(navigator.appName.indexOf("Netscape") != -1){
  	   if(w < 975){
	     h=h-23;
	     h1=h1-23;
	   }
	   w=w+20;
//	   h=h+5;
     }
  	 if(w < 975){
//	   h=h-23;
//	   h1=h1-23;
       var browser = navigator.userAgent.toLowerCase();
       var ganzzahl = parseInt(navigator.appVersion);
       var explorer = ((browser.indexOf("msie") != -1) && (browser.indexOf("opera") == -1));
       var explorer6 = (explorer && (ganzzahl == 4) && (browser.indexOf("msie 6.0") !=-1));  
	   if(explorer6){
	     h1=h1-23;
   	     document.body.style.height= h1+'px';
		 h1=h1+23;
	   }
	   else
	   {
         document.body.style.height= h1+'px';
         document.body.style.overflow= 'hidden';
	   }
	   document.getElementById("kopf").style.width= '975px';
  	   document.getElementById("leisteo").style.width= '975px';
  	   document.getElementById("leisten").style.width= '975px';
  	   document.getElementById("inhalt_scroll").style.width= '975px';
 	   document.getElementById("stru").style.width= '975px';
 	   document.getElementById("strz").style.width= '975px';
  	   document.getElementById("leisteu").style.width= '950px';
  	   document.getElementById("seite").style.width= '975px';
	 }
	 else
	 {
       var browser = navigator.userAgent.toLowerCase();
       var ganzzahl = parseInt(navigator.appVersion);
       var explorer = ((browser.indexOf("msie") != -1) && (browser.indexOf("opera") == -1));
       var explorer6 = (explorer && (ganzzahl == 4) && (browser.indexOf("msie 6.0") !=-1));  
  	   document.getElementById("kopf").style.width= '100%';
  	   document.getElementById("leisteo").style.width= '100%';
  	   document.getElementById("leisten").style.width= '100%';
  	   document.getElementById("inhalt_scroll").style.width= '100%';
  	   document.getElementById("stru").style.width= '100%';
  	   document.getElementById("strz").style.width= '100%';
  	   document.getElementById("leisteu").style.width= '950px';
  	   document.getElementById("seite").style.width= '100%';
       document.body.style.height= h1+'px';
       document.body.style.overflow= 'hidden';
	 }
	 if(document.getElementById("link_box2b")){
  	   var lb=document.getElementById("link_box2b");
	   lb.style.height='auto';  
	   if(getheight(lb) > h){
	      lb.style.height=h-25+'px';  
	   }
	 }
	 document.getElementById("leisteo_inhalt").style.width= '950px';
	 document.getElementById("inhalt_scroll").style.height= h+'px';
	 document.getElementById("seite").style.height= h1+'px';
	 document.getElementById("seite").style.overflow= 'hidden';
	 document.getElementById("leisteu").style.position= 'relative';
  }
}

    function zeige(src) {
     var topf=0;
     if(Fensterhoehe() < 570){
       topf=Math.round((Fensterhoehe()-400-25)/2);
     }
     else
     {
       topf=Math.round(125+(Fensterhoehe()-400-150)/2);
     }
     if(topf < 0){
       topf=0;
     }
     if(topf > 150){
       topf=150;
     }
	  document.getElementById("abr").style.top = topf+"px";
	  document.getElementById("ac1").src = src;
	  document.getElementById("ab1").style.visibility="visible";
	  document.getElementById("ab1").style.height="400px";
	  document.getElementById("ab1").style.width="580px";
	  document.getElementById("ac1").style.height="385px";
	  document.getElementById("ac1").style.width="580px";
	  document.getElementById("ekopf").style.width="580px";
      document.getElementById("infoank").innerHTML= '';
	  document.getElementById("infoank").style.width="580px";
	};
    function zeige_gr(src, breite, hoehe) {
     var topf=0;
     if(Fensterhoehe() < (hoehe+150)){
       topf=Math.round((Fensterhoehe()-hoehe-25)/2);
     }
     else
     {
       topf=Math.round(125+(Fensterhoehe()-hoehe-150)/2);
     }
     if(topf < 0){
       topf=0;
     }
     if(topf > 150){
       topf=150;
     }
	  document.getElementById("ekopf").style.width=breite+"px";
	  document.getElementById("abr").style.top = topf+"px";
	  document.getElementById("abr").style.visibility="visible";
	  document.getElementById("abt").style.visibility="visible";
	  document.getElementById("ac1").src = src;
	  document.getElementById("ab1").style.visibility="visible";
	  document.getElementById("ab1").style.height=(hoehe+15)+"px";
	  document.getElementById("ab1").style.width=breite+"px";
	  document.getElementById("ac1").style.height=hoehe+"px";
	  document.getElementById("ac1").style.width=breite+"px";
      document.getElementById("infoank").innerHTML= '';
	  document.getElementById("infoank").style.width=breite+"px";
    };	

    function gal(gal, hoehe, breite, infoanz) {
     var topf=0;
	 hoehe=hoehe+90;
	 breite=breite + 24;
	 var src='galerie.php?gal='+gal+'&info='+infoanz;
     if(Fensterhoehe() < (hoehe+150)){
       topf=Math.round((Fensterhoehe()-hoehe-25)/2);
     }
     else
     {
       topf=Math.round(125+(Fensterhoehe()-hoehe-150)/2);
     }
     if(topf < 0){
       topf=0;
     }
     if(topf > 150){
       topf=150;
     }
	  document.getElementById("ekopf").style.width=breite+"px";
	  document.getElementById("abr").style.top = topf+"px";
	  document.getElementById("abr").style.visibility="visible";
	  document.getElementById("abt").style.visibility="visible";
	  document.getElementById("ac1").src = src;
	  document.getElementById("ab1").style.visibility="visible";
	  document.getElementById("ab1").style.height=(hoehe+15)+"px";
	  document.getElementById("ab1").style.width=breite+"px";
	  document.getElementById("ac1").style.height=hoehe+"px";
	  document.getElementById("ac1").style.width=breite+"px";
      document.getElementById("infoank").innerHTML= '';
	  document.getElementById("infoank").style.width=breite+"px";
    };	

    function zeige_gri(src, breite, hoehe, id) {
     var topf=0;
     if(Fensterhoehe() < (hoehe+150)){
       topf=Math.round((Fensterhoehe()-hoehe-25)/2);
     }
     else
     {
       topf=Math.round(125+(Fensterhoehe()-hoehe-150)/2);
     }
     if(topf < 0){
       topf=0;
     }
     if(topf > 150){
       topf=150;
     }
	  document.getElementById("ekopf").style.width=breite+"px";
	  document.getElementById("abr").style.top = topf+"px";
	  document.getElementById("abr").style.visibility="visible";
	  document.getElementById("abt").style.visibility="visible";
	  document.getElementById("ac1").src = src;
	  document.getElementById("ab1").style.visibility="visible";
	  document.getElementById("ab1").style.height=(hoehe+15)+"px";
	  document.getElementById("ab1").style.width=breite+"px";
	  document.getElementById("ac1").style.height=hoehe+"px";
	  document.getElementById("ac1").style.width=breite+"px";
	  document.getElementById("infoank").style.width=breite+"px";
	  document.getElementById("infoank").style.height= '14px';
	  document.getElementById("infoank").style.overflow='hidden';
      document.getElementById("infoank").innerHTML='<div id="binfo"><img src="http://www.kleusberg.de/picture/bild_info.gif" alt="Bildinformationen anzeigen" title="Bildinformationen anzeigen" onclick="zeige_bildinfo('+id+')"></div>';
    };	

    function zeige_gra(src, breite, hoehe) {
     var topf=0;
     topf=50;
	 topf=topf+getScrollY();
	  document.getElementById("ekopf").style.width=breite+"px";
	  document.getElementById("abr").style.top = topf+"px";
	  document.getElementById("abr").style.left = "50px";
	  document.getElementById("abr").style.visibility="visible";
	  document.getElementById("abt").style.visibility="visible";
	  document.getElementById("ac1").src = src;
	  document.getElementById("ab1").style.visibility="visible";
	  document.getElementById("ab1").style.height=(hoehe+15)+"px";
	  document.getElementById("ab1").style.width=breite+"px";
	  document.getElementById("ac1").style.height=hoehe+"px";
	  document.getElementById("ac1").style.width=breite+"px";
      document.getElementById("infoank").innerHTML= '';
	  document.getElementById("infoank").style.width=breite+"px";
    };	

    function zeige_grai(src, breite, hoehe, id) {
     var topf=0;
     topf=50;
	 topf=topf+getScrollY();
	  document.getElementById("ekopf").style.width=breite+"px";
	  document.getElementById("abr").style.top = topf+"px";
	  document.getElementById("abr").style.left = "50px";
	  document.getElementById("abr").style.visibility="visible";
	  document.getElementById("abt").style.visibility="visible";
	  document.getElementById("ac1").src = src;
	  document.getElementById("ab1").style.visibility="visible";
	  document.getElementById("ab1").style.height=(hoehe+15)+"px";
	  document.getElementById("ab1").style.width=breite+"px";
	  document.getElementById("ac1").style.height=hoehe+"px";
	  document.getElementById("ac1").style.width=breite+"px";
	  document.getElementById("infoank").style.width=breite+"px";
	  document.getElementById("infoank").style.height= '14px';
	  document.getElementById("infoank").style.overflow='hidden';
      document.getElementById("infoank").innerHTML='<div id="binfo"><img src="http://www.kleusberg.de/picture/bild_info.gif" alt="Bildinformationen anzeigen" title="Bildinformationen anzeigen" onclick="zeige_bildinfo('+id+')"></div>';
    };	
    function zeige_bildinfo(id){
	  document.getElementById("infoank").style.height= 'auto';
	  document.getElementById("infoank").innerHTML='<div id="binfo"><img src="http://www.kleusberg.de/picture/bild_info_z.gif" alt="Bildinformationen schließen" title="Bildinformationen schließen" onclick="close_bildinfo('+id+')"></div><div id="info_d">'+infotext[id]+'</div>';	
	}
    function close_bildinfo(id){
	  document.getElementById("infoank").style.height= '14px';
	  document.getElementById("infoank").style.overflow='hidden';
      document.getElementById("infoank").innerHTML='<div id="binfo"><img src="http://www.kleusberg.de/picture/bild_info.gif" alt="Bildinformationen anzeigen" title="Bildinformationen anzeigen" onclick="zeige_bildinfo('+id+')"></div>';
	}

    function grundriss(src){
     var topf=0;
	 var breite=650;
	 var hoehe=480;
     if(Fensterhoehe() < (hoehe+150)){
       topf=Math.round((Fensterhoehe()-hoehe-25)/2);
     }
     else
     {
       topf=Math.round(125+(Fensterhoehe()-hoehe-150)/2);
     }
     if(topf < 0){
       topf=0;
     }
     if(topf > 150){
       topf=150;
     }
	 src='grundriss.php?datei='+src;
	  document.getElementById("ekopf").style.width=breite+"px";
	  document.getElementById("abr").style.top = topf+"px";
	  document.getElementById("abr").style.visibility="visible";
	  document.getElementById("abt").style.visibility="visible";
	  document.getElementById("ac1").src = src;
	  document.getElementById("ab1").style.visibility="visible";
	  document.getElementById("ab1").style.height=(hoehe+15)+"px";
	  document.getElementById("ab1").style.width=breite+"px";
	  document.getElementById("ac1").style.height=hoehe+"px";
	  document.getElementById("ac1").style.width=breite+"px";
      document.getElementById("infoank").innerHTML= '';
	  document.getElementById("infoank").style.width=breite+"px";
    };	

    function qt(src, hoehe, breite){
     var topf=0;
     if(Fensterhoehe() < (hoehe+150)){
       topf=Math.round((Fensterhoehe()-hoehe-25)/2);
     }
     else
     {
       topf=Math.round(125+(Fensterhoehe()-hoehe-150)/2);
     }
     if(topf < 0){
       topf=0;
     }
     if(topf > 150){
       topf=150;
     }
	 src='quicktime.php?datei='+src+'&breite='+breite+'&hoehe='+hoehe;
	  document.getElementById("ekopf").style.width=breite+"px";
	  document.getElementById("abr").style.top = topf+"px";
	  document.getElementById("abr").style.visibility="visible";
	  document.getElementById("abt").style.visibility="visible";
	  document.getElementById("ac1").src = src;
	  document.getElementById("ab1").style.visibility="visible";
	  document.getElementById("ab1").style.height=(hoehe+15)+"px";
	  document.getElementById("ab1").style.width=breite+"px";
	  document.getElementById("ac1").style.height=hoehe+"px";
	  document.getElementById("ac1").style.width=breite+"px";
      document.getElementById("infoank").innerHTML= '';
	  document.getElementById("infoank").style.width=breite+"px";
    };	

    function startf() {
	  document.getElementById("abt1").style.height=	Fensterhoehe()-125+'px';
	  document.getElementById("abt1").style.visibility="visible";
    };	

    function flash(){
     var topf=0;
	 var breite=970;
	 var hoehe=602;
	 var src='http://www.kleusberg.de/planungssoftware/kurzanleitung_flash.html';
     if(Fensterhoehe() < (hoehe+150)){
       topf=Math.round((Fensterhoehe()-hoehe-25)/2);
     }
     else
     {
       topf=Math.round(125+(Fensterhoehe()-hoehe-150)/2);
     }
     if(topf < 0){
       topf=0;
     }
     if(topf > 150){
       topf=150;
     }
	  document.getElementById("ekopf").style.width=breite+"px";
	  document.getElementById("ekopf").style.backgroundImage = "url('http://www.kleusberg.de/picture/h_planung.jpg')";
	  document.getElementById("abr").style.top = topf+"px";
	  document.getElementById("abr").style.visibility="visible";
	  document.getElementById("ac1").src = src;
	  document.getElementById("ab1").style.visibility="visible";
	  document.getElementById("ab1").style.height=(hoehe+15)+"px";
	  document.getElementById("ab1").style.width=breite+"px";
	  document.getElementById("ac1").style.height=hoehe+"px";
	  document.getElementById("ac1").style.width=breite+"px";
      document.getElementById("infoank").innerHTML= '';
	  document.getElementById("infoank").style.width=breite+"px";
    };	

    function hide() {
	  document.getElementById("ekopf").style.backgroundImage = "url('')";
      document.getElementById("ab1").style.visibility = "hidden";
	  document.getElementById("abr").style.left = "0px";
	  document.getElementById("abr").style.visibility="hidden";
	  document.getElementById("abt").style.visibility="hidden";
      document.getElementById("ac1").src="";
	  document.getElementById("ab1").style.height="0px";
	  document.getElementById("ab1").style.width="0px";
	  document.getElementById("infoank").style.width="0px";
	  resizebox();
   }
	function ende(){
	  document.getElementById("abt1").style.visibility="hidden";
      document.getElementById("intro").style.height="0px";
      document.getElementById("intro").style.overflow="hidden";
      document.getElementById("flashcontent").style.height="0px";
      document.getElementById("flashcontent").style.overflow="hidden";
	  document.getElementById("inhalt_flash1").firstChild.nodeValue="";
      document.getElementById("inhalt_scroll").style.visibility="visible";
      document.getElementById("inhalt_r").style.height="auto";
      document.getElementById("inhalt_r").style.overflow="";
      document.getElementById("inhalt_flash").style.height="0px";
      document.getElementById("inhalt_flash").style.overflow="hidden";
      document.getElementById("inhalt_flash1").style.height="0px";
      document.getElementById("inhalt_flash1").style.overflow="hidden";
	  document.getElementById("flashcontent").firstChild.nodeValue="";
	  document.getElementById("inhalt_flash1").firstChild.nodeValue="";
	  document.getElementById("inhalt_flash").firstChild.nodeValue="";
  	  document.getElementById("leisteo").style.width= '970px';
      document.getElementById("leisteu").style.visibility= 'visible';
	  resizebox();
    }
	function weiss(){
	  document.getElementById("abt1").style.visibility="hidden";
    }

function getPosition(element){
  var elem=element,tagname="",x=0,y=0;
  while((typeof(elem)=="object")&&(typeof(elem.tagName)!="undefined")){
    y+=elem.offsetTop;     /* Offset des jeweiligen Elements addieren */
    x+=elem.offsetLeft;    /* Offset des jeweiligen Elements addieren */
    tagname=elem.tagName.toUpperCase(); /* tag-Name ermitteln, Grossbuchstaben */
    if((tagname=="HTML")||(tagname=="BODY"))
      elem=0;
    if (typeof(elem)=="object")
      if (typeof(elem.offsetParent)=="object"){
        elem=elem.offsetParent;
	  }
  }
  position=new Object();
  position.x=x;
  position.y=y;
  return position;
}


function getheight(elem){
  var h=0;
   h=elem.offsetHeight;     
   return h;
}

  function sw_open(did){
	var e1, e2, ep1, ep2, ty, h1;
	e1=document.getElementById(did);
	ep1=getPosition(e1);
	e2=document.getElementById("leisteu");
	ep2=getPosition(e2);
	ty=document.getElementById("inhalt_scroll").scrollTop;
	if(e1.style.visibility == 'visible'){
	  h1=getheight(e1);
	  d_close(did, h1,2);
	}
	else
	{
      e1.style.visibility= 'visible';
      e1.style.height= 'auto';
      e1.style.overflow= 'visible';
	  h1=getheight(e1);
	  var t1=ep2.y-ep1.y+ty-10;
	  if(t1 < h1){
	    w_scroll("inhalt_scroll", h1-t1);
	  }
	}
  }
	
function w_scroll(id, wert){
 if(wert >0){
   var ty=document.getElementById(id).scrollTop;
   document.getElementById(id).scrollTop=ty+2;
   wert = wert -2;
   window.setTimeout( function(){ w_scroll(id,wert) }, 15);
 }
}	

function d_close(id, wert, wert1){
 if(wert -wert1 >0){
   wert = wert -wert1;
   document.getElementById(id).style.height=wert+'px';
   document.getElementById(id).style.overflow='hidden';	 
   window.setTimeout( function(){ d_close(id,wert,wert1) }, 15);
 }
 else
 {
   document.getElementById(id).style.visibility='hidden';
 }
}	

function zeige_fr(id, ges){
  var ida= 'fr'+id;	
  for (var i=1; i <= ges; i++){
    ida= 'fr'+i;
	if ((i == id)&&(document.getElementById(ida).style.height != 'auto')){
      document.getElementById(ida).style.visibility='visible';
      document.getElementById(ida).style.height='auto';  
      document.getElementById(ida).style.paddingTop='10px';  
      document.getElementById(ida).style.paddingBottom='10px';
	}
	else
	{
      document.getElementById(ida).style.visibility='hidden';
      document.getElementById(ida).style.height='0px';  
      document.getElementById(ida).style.paddingTop='0px';  
      document.getElementById(ida).style.paddingBottom='0px';
	}
	  resizebox();
  }
}

function dinfo(id, ges){
  var ida= 'd'+id;	
  for (var i=1; i <= ges; i++){
    ida= 'd'+i;
	if(document.getElementById(ida)){
	  if ((i == id)&&(document.getElementById(ida).style.height != 'auto')){
        document.getElementById(ida).style.visibility='visible';
        document.getElementById(ida).style.height='auto';  
        document.getElementById(ida).style.visibility='visible';
        document.getElementById(ida).style.overflow='visible';
        document.getElementById(ida).style.width='auto';
        document.getElementById(ida).style.display='block';
	  }
	  else
	  {
        document.getElementById(ida).style.visibility='hidden';
        document.getElementById(ida).style.height='0px';  
        document.getElementById(ida).style.overflow='hidden';
        document.getElementById(ida).style.width='0px';
        document.getElementById(ida).style.display='none';
	  }
	}
  }
}

function getScrollY() {
var x,y;
  if (self.pageYOffset) // all except Explorer
  {
	y = self.pageYOffset;
  }
  else if (document.documentElement && document.documentElement.scrollTop)
	// Explorer 6 Strict
  {
	y = document.documentElement.scrollTop;
  }
  else if (document.body) // all other Explorers
  {
	y = document.body.scrollTop;
  }
  return y;
}
function zeige_bainfo(id){
      document.getElementById('c_'+id).style.visibility='visible';  
}
function hide_bainfo(id){
      document.getElementById('c_'+id).style.visibility='hidden';  
}