Javascript blinking background colour: when to stop blinking and when to start
<p>I've figured out by using the below code, we can blink the background of my html page:</p>

<pre><code>&lt;script type="text/javascript"&gt; 
setInterval("Timer()", 500);
var x=1;
var set;
function Timer() 
{
    set=1;
    if(x==0 &amp;&amp; set==1) {
        document.bgColor='#00008B';
        x=1;
        set=0;
    }
    if(x==1 &amp;&amp; set==1) {
        document.bgColor='#FFFFFF';
        x=0;
        set=0;
    }
}
&lt;/script&gt;
</code></pre>

<p>The html page will forever be blinking with just using this code.
But how do we stop the blinking and start the blinking again?</p>

<p>I want to start blinking when the page received some protocol command, and stop blinking when user press a button on the page. How do we do it?</p>
