// Delete All
// by Micah Aills
// http://textcleaner.x10hosting.com/
// http://www.micahaills.com/

function DeleteText()  { 
document.getElementById("EditingArea").value = "";
}




// Remove Line Breaks by K&L Productions
// http://www.webdeveloper.com/forum/showthread.php?t=15359
// http://www.klproductions.com/

String.prototype.stripBreaks = function()
{
        var matchTag = /\s+/g;
        return this.replace(matchTag, " ");
}

function RemoveBreaks()
{
        var sourceInput = document.getElementById("EditingArea");
        var destInput = document.getElementById("EditingArea");

        destInput.value = sourceInput.value.stripBreaks();
}




// Code by Andrew Pociu
// http://www.geekpedia.com/code20_Strip-HTML-using-JavaScript.html 
// http://www.geekpedia.com/author1_Andrew-Pociu.html

String.prototype.stripHTML = function()
{
        var matchTag = /<(?:.|\s)*?>/g;
        return this.replace(matchTag, "");
};

function ShowStrippedText()
{
        var sourceInput = document.getElementById("EditingArea");
        var destInput = document.getElementById("EditingArea");

        destInput.value = sourceInput.value.stripHTML();
}




// Remove Excess White Space Script
// http://javascript.internet.com/forms/spaces-to-plus.html

// Original:  Mike McGrath (mike_mcgrath@lineone.net)
// Web Site:  http://website.lineone.net/~mike_mcgrath

// This script and many more are available free online at
// The JavaScript Source!! http://javascript.internet.com

function convertSpaces(str) {
var out = "", flag = 0;
for (i = 0; i < str.length; i++) {
if (str.charAt(i) != " ") {
out += str.charAt(i);
flag = 0;
}
else {
if(flag == 0) {
out += " ";
flag = 1;
      }
   }
}
return out;
}





// Remove Tab Spaces by K&L Productions
// http://www.webdeveloper.com/forum/showthread.php?t=15359
// http://www.klproductions.com/

// Modified to remove tab spaces by Micah Aills
// http://textcleaner.x10hosting.com/

String.prototype.stripTabs = function()
{
        var matchTag = /\t+/g;
        return this.replace(matchTag, " ");
}

function RemoveTabs()
{
        var sourceInput = document.getElementById("EditingArea");
        var destInput = document.getElementById("EditingArea");

        destInput.value = sourceInput.value.stripTabs();
}




// Convert Text to Lowercase - Javascript Source
// http://javascript.internet.com/forms/all-lower-case.html

function makeLowercase() {
document.EditForm.EditingArea.value = document.EditForm.EditingArea.value.toLowerCase();
}




// Toggle Script by TwoD
// http://www.programmingtalk.com/showthread.php?t=21570

function getStyle()
   {
      var temp = document.getElementById("about").style.visibility;
  
      return temp;
   }

 function switchMain()
  {

      var current = getStyle();

      if( current == "visible" )
       {
         document.getElementById("about").style.visibility = "hidden";
       }
       else
       {
         document.getElementById("about").style.visibility = "visible";
       }
  }