<!--
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_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_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_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];}
}
//-->

// Kommentarmodul Leo
var v = 0;

function loginAnzeigen(){

     v++;

     if(v == 1){

        if(document.getElementById("login")){
           document.getElementById("login").style.display = "block";
        }

     }    
 
     if(v == 2){
        v=0;

        if(document.getElementById("login")){
           document.getElementById("login").style.display = "none";
        }
     }

}

//Kommentarmodul comments2
// Comments

var imageTag = false;
var theSelection = false;
// Array für BB-Code Parser | @@ Peter Beauvain, 2004-05-27
bbcode = new Array();
bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[align=left]','[/align]','[center]','[/center]','[align=right]','[/align]','[align=justify]','[/align]','[ul]','[/ul]','[li]','[/li]','[img]','[/img]','[url]','[/url]','[email]','[/email]','[lart= lang=]','','[code]','[/code]','[php]','[/php]','[quote]','[/quote]');
imageTag = false;
//-----------------------------------------------
// Browser Variablen | @@ Peter Beauvain, 2004-05-27
var clientPC = navigator.userAgent.toLowerCase(); // Get client info
var clientVer = parseInt(navigator.appVersion); // Get browser version

var is_ie = ((clientPC.indexOf("msie") != -1) && (clientPC.indexOf("opera") == -1));
var is_nav = ((clientPC.indexOf('mozilla')!=-1) && (clientPC.indexOf('spoofer')==-1)
                && (clientPC.indexOf('compatible') == -1) && (clientPC.indexOf('opera')==-1)
                && (clientPC.indexOf('webtv')==-1) && (clientPC.indexOf('hotjava')==-1));
var is_moz = 0;

var is_win = ((clientPC.indexOf("win")!=-1) || (clientPC.indexOf("16bit") != -1));
var is_mac = (clientPC.indexOf("mac")!=-1);
//------------------------------------------------
// Array der Texte für die Permanent Hilfe  | @@ Peter Beauvain, 2004-05-27
a_help = "Alle noch offenen UBB-Tags schließen:[/..]";
b_help = "Text in fett: [b]Text[/b]";
i_help = "Text in kursiv: [i]Text[/i]";
u_help = "Unterstrichener Text: [u]Text[/u]";
l_help ="Linksbündiger Text: [align=left]Text[/align]";
c_help ="Zentrierter Text: [center]Text[/center]";
r_help ="Linksbündiger Text: [align=right]Text[/align]";
j_help ="Text im Blocksatz: [align=justify]Text[/align]";
ul_help ="Geordnete Liste: [ul]Text[/ul]";
li_help ="Listenelement: [li]Text[/li]";

url_help ="Link: [url]www.tkkg-site.de[/url] oder [url=www.tkkg-site.de]Text[/url]";
mail_help ="eMail Adresse:[email]acquire@tkkg-site.de[/email]";


s_help ="Schriftfarbe: [color=red]Text[/color]";
t_help ="Schriftgröße: [size=7]kleiner Text[/size] bis [size=24]großer Text[/size]";
icon1_help ="Emoticon Augenzwinkern :wink:";
icon2_help ="Emoticon Lachen :smile:";
icon3_help ="Emoticon Information :info:";
icon4_help ="Emoticon Achtung! :!:";
icon5_help ="Emoticon Cool :cool:";

//---------------------------------------------

// Funktion für die Permanent Hilfe | @@ Peter Beauvain, 2004-05-27
function helpline(help)
{
   document.comments.helpbox.value = eval(help + "_help");
}

function getarraysize(thearray)
{
   for (i = 0; i < thearray.length; i++) {
      if ((thearray[i] == "undefined") || (thearray[i] == "") || (thearray[i] == null))
         return i;
      }
   return thearray.length;
}

// Replacement for arrayname.push(value) not implemented in IE until version 5.5 | @@ Peter Beauvain, 2004-05-27
// Appends element to the array
function arraypush(thearray,value)
{
   thearray[ getarraysize(thearray) ] = value;
}

// Replacement for arrayname.pop() not implemented in IE until version 5.5 | @@ Peter Beauvain, 2004-05-27
// Removes and returns the last element of an array
function arraypop(thearray)
{
   thearraysize = getarraysize(thearray);
   retval = thearray[thearraysize - 1];
   delete thearray[thearraysize - 1];
   return retval;
}
// Funktion für die Textgrössen | @@ Peter Beauvain, 2004-05-27

function bbfontstyle(bbopen, bbclose)
{
   var txtarea = document.comments.commenttext;

   if ((clientVer >= 4) && is_ie && is_win) {
      theSelection = document.selection.createRange().text;
      if (!theSelection) {
         txtarea.value += bbopen + bbclose;
         txtarea.focus();
         return;
      }
      document.selection.createRange().text = bbopen + theSelection + bbclose;
      txtarea.focus();
      return;
   }
   else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0))
   {
      mozWrap(txtarea, bbopen, bbclose);
      return;
   }
   else
   {
      txtarea.value += bbopen + bbclose;
      txtarea.focus();
   }
   storeCaret(txtarea);
}

//Funktion für die Abfrage der Buttons  | @@ Peter Beauvain, 2004-05-27

function bbstyle(bbnumber)
{
   var txtarea = document.comments.commenttext;

   donotinsert = false;
   theSelection = false;
   bblast = 0;

   if (bbnumber == -1) { // Close all open tags & default button names
      while (bbcode[0]) {
         butnumber = arraypop(bbcode) - 1;
         txtarea.value += bbtags[butnumber + 1];

      }
      imageTag = false; // All tags are closed including image tags :D
      txtarea.focus();
      return;
   }

   if ((clientVer >= 4) && is_ie && is_win)
   {
      theSelection = document.selection.createRange().text; // Get text selection
      if (theSelection) {
         // Add tags around selection
         document.selection.createRange().text = bbtags[bbnumber] + theSelection + bbtags[bbnumber+1];
         txtarea.focus();
         theSelection = '';
         return;
      }
   }
   else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0))
   {
      mozWrap(txtarea, bbtags[bbnumber], bbtags[bbnumber+1]);
      return;
   }

   // Find last occurance of an open tag the same as the one just clicked
   for (i = 0; i < bbcode.length; i++) {
      if (bbcode[i] == bbnumber+1) {
         bblast = i;
         donotinsert = true;
      }
   }

   if (donotinsert) {      // Close all open tags up to the one just clicked & default button names
      while (bbcode[bblast]) {
            butnumber = arraypop(bbcode) - 1;
            txtarea.value += bbtags[butnumber + 1];

            imageTag = false;
         }
         txtarea.focus();
         return;
   } else { // Open tags

      if (imageTag && (bbnumber != 18)) {      // Close image tag before adding another
         txtarea.value += bbtags[19];
         lastValue = arraypop(bbcode) - 1;   // Remove the close image tag from the list

         imageTag = false;
      }

      // Open tag
      txtarea.value += bbtags[bbnumber];
      if ((bbnumber == 18) && (imageTag == false)) imageTag = 1; // Check to stop additional tags after an unclosed image tag
      arraypush(bbcode,bbnumber+1);

      txtarea.focus();
      return;
   }
   storeCaret(txtarea);
}


function Picture(pic,title,width,height)
{
   popup=window.open(pic, title,'width='+width+',height='+height+',toolbar=no,directories=no,status=no,scrollbars=no,resizable=yes,menubar=no');
   popup.focus();
}

// Taken from http://www.massless.org/mozedit/
var thisForm;

function mozWrap(txtarea, lft, rgt)
{
   var selLength = txtarea.textLength;
   var selStart = txtarea.selectionStart;
   var selEnd = txtarea.selectionEnd;
   if (selEnd==1 || selEnd==2) selEnd=selLength;
   var s1 = (txtarea.value).substring(0,selStart);
   var s2 = (txtarea.value).substring(selStart, selEnd)
   var s3 = (txtarea.value).substring(selEnd, selLength);
   txtarea.value = s1 + lft + s2 + rgt + s3;
}


function emoticon(text)
{
   var txtarea = document.comments.commenttext;
   text = ' ' + text + ' ';
   if (txtarea.createTextRange && txtarea.caretPos) {
      var caretPos = txtarea.caretPos;
      caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
      txtarea.focus();
   } else {
      txtarea.value  += text;
      txtarea.focus();
   }
}

// Insert at Claret position. Code from
// http://www.faqts.com/knowledge_base/view.phtml/aid/1052/fid/130
function storeCaret(textEl)
{
    if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
}

// Spielerdetail Div ein-/ausblenden
<!--

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
//-->