function clap( id )
	   {
	   displayType = ( document.getElementById( id ).style.display == 'none') 
	                 ? 'block' : 'none';
	   document.getElementById( id ).style.display = displayType;
	   }

function open_close(id)
{
displayT =( document.getElementById( id ).style.display == 'none' ) ? 'block' : 'none';
idd= (displayT == "block") ? 'open' : 'closed'
document.getElementById( id ).style.display = displayT;
Zweitbild = new Image();
Zweitbild.src = "images/cross"+idd+".gif";
document.images[id.substring('1','2')].src = Zweitbild.src;
}

function checkinsert(type)
{
for(var i=0;i < document.getElementById( type ).elements.length;i++)
{
if(document.getElementById( type ).elements[i].value=="") { window.alert("Sie müssen alle Felder ausfüllen"); return false; break; }
}
return true;
}

function folgenadd()
{
for(var i=1;i < document.all.tags("div").length;i++)
{
if(document.all.tags("div")[i].id.substring(0,2)=="fa")
{
type = (document.addit.senderall.checked == true) ? 'none' : 'block';
document.all.tags("div")[i].style.display = type;
}
}
}

function replaceit(integer)
{
mix = (integer.length==1) ? "0"+integer : integer;
return mix;
}

function anzmake()
{
for(var i=0;i < document.all.tags("div").length;i++)
{
if(document.all.tags("div")[i].id.substring(0,2)=="a_")
{
readid=replaceit(document.all.tags("div")[i].id.replace("a_",""));
compare=replaceit(document.addit.anzwk.value.replace("a_",""));
if(readid <= compare)
document.all.tags("div")[i].style.display='block';
else
document.all.tags("div")[i].style.display='none';
}
}
}

function checkbox()
{
if(document.form1.html.checked==true)
document.form1.text.value = "<html><body>";
else
document.form1.text.value = "";
}


function korrigieren(date)
        {
        if(date < 10) { date="0"+date; }
        return date;

}

//Datumanzeige im Adminbereich
function showit()
        {
        var jetzt = new Date();
        stunden = jetzt.getHours();
        minuten = jetzt.getMinutes();
        sekunden = jetzt.getSeconds();
        tag = jetzt.getDate();
        monat = jetzt.getMonth()+1;
        jahr = jetzt.getYear();
        //document.all.t2.innerHTML=korrigieren(tag)+"."+korrigieren(monat)+"."+jahr+" |         "+korrigieren(stunden)+":"+korrigieren(minuten)+":"+korrigieren(sekunden);
        }


//Funktion um unterschiedliche Knotenbehandlung der Browser zu revidieren - rekursiv
function RemoveWhiteSpaceChildNodesOf(node)
{
  if (node != null)
  {
    var child = node.lastChild;
    while (child != null)
    {
      if (child.nodeType == 3 && child.nodeValue.match(/\S/) == null)
      {
        var previous = child.previousSibling;
        child.parentNode.removeChild(child);
        child = previous;
      }
      else
      {
        RemoveWhiteSpaceChildNodesOf(child);
        child = child.previousSibling;
      }
    }

  }
}

//rückgängig machen. versteckte id, button ändern
function markiere(id)
         {
         if(id!= null)
            {
            var spalte=document.getElementById(id);
            RemoveWhiteSpaceChildNodesOf(spalte);
            for(i=0;i<spalte.childNodes.length;i++)
                {
                spalte.childNodes[i].style.background='#FF0000';
                }
                aendereHiddenFeld(spalte.childNodes[0]);
            }
         }

function aendereHiddenFeld(knoten)
         {
         knoten.firstChild.setAttribute("value",1);
         }

function count_string(string,zeichen)
	                   {
	                   var posi;
	                   var count=0;
	                   for(var i=0;i < string.length;i++)
	                        	{
		                       posi = string.indexOf(zeichen);
		                       if(posi!=-1) 
			                    {
			                      count++;
			                      string = string.substr((posi+3),(string.length-posi+3));
			                      }
		                    else break;
		                       }
                    	return count;
	                   }

                  function smileins(ins)
	                   {
	                if(ins!='0') document.gbinsert.comments.value +=ins;
	                document.gbinsert.size.selectedIndex=0;
	                document.gbinsert.color.selectedIndex=0;
	                document.gbinsert.family.selectedIndex=0;
	                   }

                 function find_bbcode()
	                 {
	               var text=document.gbinsert.comments;
	               var code = new Array('[B]','[I]','[U]','[FONT=','[SIZE=','[COLOR=','[QUOTE','[MAIL=','[URL=','[IMG]','[LIST');
	               var replace = new Array('[/B]','[/I]','[/U]','[/FONT]','[/SIZE]','[/COLOR]','[/QUOTE]','[/MAIL]','[/URL]','[/IMG]','[/LIST]');
	               for(var x=0;x < code.length;x++)
	 	            {
		             temptext=text.value;
	                   	if(count_string(temptext.toUpperCase(),code[x]) > count_string(temptext.toUpperCase(),replace[x]))
		             	text.value+=replace[x];
	                   	}
	                   }



<!--[if lt IE 7]>
 
function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
   var arVersion = navigator.appVersion.split("MSIE")
   var version = parseFloat(arVersion[1])
   if ((version >= 5.5) && (document.body.filters)) 
   {
      for(var i=0; i<document.images.length; i++)
      {
         var img = document.images[i]
         var imgName = img.src.toUpperCase()
         if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
         {
            var imgID = (img.id) ? "id='" + img.id + "' " : ""
            var imgClass = (img.className) ? "class='" + img.className + "' " : ""
            var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
            var imgStyle = "display:inline-block;" + img.style.cssText 
            if (img.align == "left") imgStyle = "float:left;" + imgStyle
            if (img.align == "right") imgStyle = "float:right;" + imgStyle
            if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
            var strNewHTML = "<span " + imgID + imgClass + imgTitle
            + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
            + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
            + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
            img.outerHTML = strNewHTML
            i = i-1
         }
      }
   }    
}
window.attachEvent("onload", correctPNG);
 
<![endif]-->



