function formreset()
  {
   if (confirm("Soll das Formular wirklich zurückgesetzt werden?"))
     {
      document.forms["PostForm"].reset();

      if (window.directshow)
        {
         window.clearInterval(directshow);
         document.getElementById("directshowarea").innerHTML = "";
        }
     }
  }

function disablebuttons(last)
  {
   if (document.all || document.getElementById)
     {
      for (k = document.forms["PostForm"].length-last; k < document.forms["PostForm"].length; k++)
        {
         document.forms["PostForm"].elements[k].disabled = true;
        }
     }

   document.forms["PostForm"].submit();
  }

function directEntry()
  {
   document.forms["PostForm"].form_final.value = 1;
   disablebuttons();
  }

function directShowToggle(activator)
  {
   if (activator.checked)
     {
      directShow();
      directshow = window.setInterval('directShow()',1000);
     }
   else
     {
      window.clearInterval(directshow);
      document.getElementById("directshowarea").innerHTML = "";
     }
  }

function directShow(activator)
  {
   finalText = document.forms["PostForm"].form_text.value;
   if (finalText == "") finalText = "Du hast noch keinen Text eingegeben!";

   if (!usehtml) finalText = finalText.replace(/</g,"&lt;");

   for (i = 0; i < toreplace.length; i++)
     {
      finalText = finalText.replace(toreplace[i][0],toreplace[i][1]);
     }

   document.getElementById("directshowarea").innerHTML = "<TABLE CELLSPACING=0 CELLPADDING=1 BORDER=0><TR><TD CLASS=\"tablebg\"><TABLE CELLSPACING=0 CELLPADDING=5 BORDER=0><TR CLASS=\"rowtwo\"><TD>"+finalText+"</TD></TR></TABLE></TD></TR></TABLE><BR>";
  }

function switchHTML(activator)
  {
   if (activator.checked) usehtml = true;
   else usehtml = false;
  }

function switchFile(activator)
  {
   if (activator.checked)
     {
      document.getElementById("form_file").style.visibility = "visible";
      document.getElementById("form_file").value = "";      
     }
   else document.getElementById("form_file").style.visibility = "hidden";
  }