I have hardcoded the colors you can use class.
<DIV>
<script language="javascript">
var ajxObj;
if (window.XMLHttpRequest) {
ajxObj = new XMLHttpRequest();
} else {
ajxObj = new ActiveXObject('Microsoft.XMLHTTP');
}
ajxObj.open('GET', 'OutputXML.xml', false);
ajxObj.send();
var myXml = ajxObj.responseXML;
prs = myXml.getElementsByTagName("Table4")
if(prs.length >0 )
{
document.write('<DIV ID="TICKER" STYLE="overflow:hidden" onmouseover="TICKER_PAUSED=true" onmouseout="TICKER_PAUSED=false" class="aligncenter" style="background-color:#003366;" />');
}
else document.write('<DIV ID="TICKER" STYLE="overflow:hidden" onmouseover="TICKER_PAUSED=true" onmouseout="TICKER_PAUSED=false" class="aligncenter" style="background-color:#000366;" />');
for (i = 0; i < prs.length ; i++) {
document.write(prs[i].getElementsByTagName('ticker')[0].childNodes[0].nodeValue);
document.write('>>');
document.write(prs[i].getElementsByTagName('comp_current_price')[0].childNodes[0].nodeValue);
document.write(' % ');
document.write(prs[i].getElementsByTagName('change_perc')[0].childNodes[0].nodeValue);
document.write('..........');
}
document.write('</div>');
</script>
</div>