Color-cycling an element not working?
<p>I am a beginner in javascript, can you tell me what's wrong with the below code?</p>

<p>I want this to invoke <code>buttonPressed()</code> when a button gets pressed. From <code>buttonPressed()</code> it should call <code>changeColor1()</code>, <code>changeColor1()</code> should change the text color of a paragraph, and start a timer to invoke <code>changeColor2()</code>. Similarly <code>changeColor2()</code> should also change the color and call <code>changeColor1()</code> once the timer expires.</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;script type="text/javascript"&gt;

function changeColor2()
{
  alert("2");
  var v = document.getElementById("onet");
  v.style.color = rgb(0,255,255);  // this statement is not working 
  var t=setTimeout(changeColor1,3000);
}

function changeColor1()
{
  alert("1");
  var v = document.getElementById("onet");
  v.style.color = rgb(255,255,0); // this statement is not working
  var t=setTimeout(changeColor2,3000); 
}

function buttonPressed()
{
 alert("Hello");
 changeColor1();
}
&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;p id="onet"&gt; Hello how are you? &lt;/p&gt;
&lt;form&gt;
&lt;input type="button" value="Display alert box!" onClick="buttonPressed()" /&gt;
&lt;/form&gt;
&lt;/body&gt;

&lt;/html&gt;
</code></pre>
