<!--

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 einfuegen(Zeichen)

{
document.gb_formular.gb_text.value =
document.gb_formular.gb_text.value + Zeichen;
document.gb_formular.gb_text.focus();
}


function bbcode(BBCauf, BBCzu)
   {
   text = prompt("Bitte ein Text eingeben!");
   document.gb_formular.gb_text.value = document.gb_formular.gb_text.value + BBCauf + text + BBCzu;
   }

function url() {
lina = window.prompt("Name des Links","");
url= window.prompt("URL","http://");
dir = window.prompt("Wo soll sich der Link öffnen","_blank");

if(lina=="") { lina=url; } 
if(dir=="") { dir=_self; }

erg=" "+"[URL=" + url + "]" + lina + "[/URL=" + dir + "]";

    eval("document.gb_formular.gb_text.value += \""+erg+"\"");
    window.document.gb_formular.gb_text.focus(window.document.gb_formular.gb_text.caretPos);

}

function img_bbcode(url,alt,ausrichtung)
   {
   erg=" "+"[IMG=" + alt + "]" + url + "[/IMG=" + ausrichtung + "]";
   eval("document.gb_formular.gb_text.value += \""+erg+"\"");
   window.document.gb_formular.gb_text.focus(window.document.gb_formular.gb_text.caretPos);
   
}

function img2_bbcode(url,alt,ausrichtung)
   {
   erg=" "+"[2IMG=" + alt + "]" + url + "[/2IMG=" + ausrichtung + "]";
   eval("document.gb_formular.gb_text.value += \""+erg+"\"");
   window.document.gb_formular.gb_text.focus(window.document.gb_formular.gb_text.caretPos);
   
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;

}



var statusWin, toppos, leftpos;
    toppos = (screen.height - 401)/2;
    leftpos = (screen.width - 401)/2;


function showProgress() {
      statusWin = window.open('http://www.bauzentrum-haenig.de/progress.php','Status','height=155,width=350,top='+toppos+',left='+leftpos+',location=no,scrollbars=no,menubars=no,toolbars=no,resizable=yes');
      statusWin.focus();
    }



function hideProgress() {
      if (statusWin != null) {
        if (!statusWin.closed) {
          statusWin.close();
        }
      }
    }


function del(Seite)
{
	var Antwort = confirm("Möchten Sie den Datenbankeintrag wirklich unwiederruflich löschen?");
	if(Antwort == true)
	{
		location.href = Seite;
	}
}

function show_pm(pm_read)
{
	var Antwort = confirm("Sie haben neue Mitteilungen! Wollen Sie diese lesen?");
	if(Antwort == true)
	{
		location.href = pm_read;
	}
}

var hinweis = "Beachten Sie das Ihr Eintrag erst angezeigt wird wenn dieser durch einen Administrator freigeschalten wurde !";

function HinweisOeffnen()
{
	alert(hinweis);
}

function neuesfenster()
{ window.open ('http://www.bauzentrum-haenig.de/agb.php','AGB','width=600,height=680,scrollbars=yes'); }

function show(Seite) {
      statusWin = window.open(Seite,'Status','height=370,width=500,top='+toppos+',left='+leftpos+',location=no,scrollbars=yes,menubars=no,toolbars=no,resizable=yes');
      statusWin.focus();
    }

function meldungshow(id_name)
{
document.getElementById(id_name).style.visibility = "visible";
}
function meldunghide(id_name)
{
document.getElementById(id_name).style.visibility = "hidden";
}
//--- Prüft, ob nur Ziffern eingegeben wurden
  function NurZiffern(Feld)
  {  PruefeZeichen(Feld, "0123456789", "Bitte prüfen Sie die Zahl") }
//--- Unterprogramm, welches die Zeichen prüft
    function PruefeZeichen(Feld, ZugelasseneZeichen, FehlerMeldung)
    {  
       for (var Pos = 0; Pos < Feld.value.length; Pos++)
       {
          if (ZugelasseneZeichen.indexOf(Feld.value.charAt(Pos)) == -1)
          { FehlerMeldung += "\n\nIhre Eingabe enthält das Zeichen '"
            FehlerMeldung += Feld.value.charAt(Pos)
            FehlerMeldung += "'. Sie dürfen nur diese Zeichen verwenden:\n"
            FehlerMeldung += ZugelasseneZeichen
            if (ZugelasseneZeichen.indexOf(" ") == -1)
               { FehlerMeldung += "\nLeerzeichen sind nicht erlaubt" }
            else
               { FehlerMeldung += "\nund das Leerzeichen" }
            alert(FehlerMeldung)
            Feld.focus()
            return
          }
       }
    }

function setCheckboxes(the_form, do_check)
{
    var elts      = (typeof(document.forms[the_form].elements['nl_usergroup[]']) != 'undefined')
                  ? document.forms[the_form].elements['nl_usergroup[]']
                  : (typeof(document.forms[the_form].elements['nl_usergroup[]']) != 'undefined')
          ? document.forms[the_form].elements['nl_usergroup[]']
          : document.forms[the_form].elements['nl_usergroup[]'];
    var elts_cnt  = (typeof(elts.length) != 'undefined')
                  ? elts.length
                  : 0;

    if (elts_cnt) {
        for (var i = 0; i < elts_cnt; i++) {
            elts[i].checked = do_check;
        } // end for
    } else {
        elts.checked        = do_check;
    } // end if... else

    return true;
} // end of the 'setCheckboxes()' function

// Forum Menueinblendung
NS4 = (document.layers) ? 1 : 0;
IE4 = (document.all) ? 1 : 0;
NS6 = (document.getElementById) ? 1 : 0;

activmenu = false;
timerRunning = false;

function checkTimer() {
 if(timerRunning)  {
  clearTimeout(timerRunning);
  timerRunning = false;
 }
}

function startTimer() {
 timerRunning = setTimeout("showdiv();",1000);
}

function showdiv(menu) { 
 if(activmenu) {
  checkTimer();
  if(NS4) document.layers[activmenu].display = "none";
  if(NS6) document.getElementById(activmenu).style.display= "none";
  if(IE4) document.all(activmenu).style.display = "none";
  activmenu = false;
 }
   
 if(menu) {
  if(NS4) {
   document.layers[menu].display = "showdiv";
   document.layers[menu].bgColor = "FFFFFF";
   document.layers[menu].onmouseover = checkTimer;
   document.layers[menu].onmouseout = startTimer;
  }
      
  if(IE4) {
   document.all(menu).style.display = "inline";
   document.all(menu).onmouseover = checkTimer;
   document.all(menu).onmouseout = startTimer;
  }
      
  if(NS6) {
   document.getElementById(menu).style.display = "inline";
   document.getElementById(menu).onmouseover = checkTimer;
   document.getElementById(menu).onmouseout = startTimer;
  }
  activmenu = menu;
 }
}

function hidediv(menu) {
 checkTimer();
 if(NS4) document.layers[menu].display = "none";
 if(NS6) document.getElementById(menu).style.display = "none";
 if(IE4) document.all(menu).style.display = "none";
 activmenu = false;
}

//-->


