// JavaScript Document

<!--

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() {
var lina, url, dir, erg;
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+"\"");
    document.gb_formular.gb_text.focus(document.gb_formular.gb_text.caretPos);

}

function video() {
var ex, vh, vv, dir, erg;
ex = confirm("Ist das Video auf tauchvideo.com eingebunden?");
if (ex == true) {
vh = window.prompt("Breite des Videos","400");
vv = window.prompt("Höhe des Videos","300");
dir = window.prompt("Speicherort/Name des Videos","video_flash/");

vv = parseInt(vv,10)+parseInt(20,10);
erg="[video=" + vh + "|" + vv + "]" + dir + "[/video]";
} else {
vh = window.prompt("Breite des Videos","400");
vv = window.prompt("Höhe des Videos","300");
dir = window.prompt("Linkadresse des Videos","http://");

vv = parseInt(vv,10)+parseInt(30,10);
erg="[xvideo=" + vh + "|" + vv + "]" + dir + "[/xvideo]";
}

    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)
   {
  var erg; 
   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 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('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 ('agb.php','AGB','width=600,height=680,scrollbars=yes'); }

function show2(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 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("show();",1000);
}
                        
function show(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 = "show";
   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 hide(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;
}


//-->
