Javascript Typewriter effect PAUSE/STOP button
<p>I've this script below allows me to play the text with a type writer effect when the button is clicked. But how can I change the code that allow me the pause or stop the script when the button is clicked again. </p>

<p>HTML</p>

<pre><code>     &lt;div ID="textDestination" class="news"&gt;&lt;/div&gt;
     &lt;div class="play" id="playbtn"&gt;&lt;/div&gt;
</code></pre>

<p>JavaScript</p>

<pre><code>  var text="I remember the big tree in Mums yard I used to climb when they were drinking. I remember sitting up there crying cause I knew I’d have to get down, and how the look on his face made me want to laugh, how small he looked from up there. I remember he would threaten to throw things at me if I didn't get down. He knew he had no power over me up there, but he also knew eventually I would have to get down. Then he would say I was in for it whether I came down or not. But up there I was untouchable, and the world outside our house held endless possibility."

  var delay=50;
  var currentChar=1;
  var destination="[none]";
  function type()
  {
      //if (document.all)
      {
    var dest=document.getElementById(destination);
    if (dest)// &amp;&amp; dest.innerHTML)
    {
        dest.innerHTML=text.substr(0, currentChar)+"_";
        currentChar++;
        if (currentChar&gt;text.length)
        {
            currentChar=1;
            setTimeout("type()", 5000);
        }   
        else
        {
            setTimeout("type()", delay);
        }
         }
     }
 }
 function startTyping(textParam, delayParam, destinationParam)
 {
   text=textParam;
   delay=delayParam;
   currentChar=1;
   destination=destinationParam;
   type();
 }

 $('#playbtn').click(function() {
 javascript:startTyping(text, 50, "textDestination");
 });
</code></pre>
