Dear All, can you pls help. I have the below code on my SharePoint 2007. My problem is that if I place this code above a SharePoint list does not calculate, if I put this under the list it calculates. Can you pls let me know how I could display the table above the list that would calculate the number of "On track" items.
=====


<html>
<head>

<script language="JavaScript" type="text/JavaScript">


var x = document.getElementsByTagName("TD") // find all of the TDs

var Ont=0;

var i=0;

for (i=0;i<x.length;i++)
{

if (x[i].className=="ms-vb2") //find the TDs styled for lists
{

if (x[i].innerHTML=="On track")
{
Ont++
x[i].style.backgroundColor='palegreen'; // set the background color
x[i].style.color='Black'; //set the font color
}

}
}

document.write('<table id="test" style="margin-right:5" style="float:left" class="main1" border=1 cellspacing=0 cellpadding=2 bordercolor="#EEEEEE">' );


document.write(
'<tr bgcolor="#EEEEEE"> <td > <font color="#319ACE"> ' + 'SISRR' +
'<td bgcolor="#EEEEEE"</td> <font color="#319ACE">' + ' # ' +
'<td bgcolor="#EEEEEE"</td> <font color="#319ACE">' + ' Zita V. ' +
'<td bgcolor="#EEEEEE"</td> <font color="#319ACE">' + ' Gergely P. ' +
'<td bgcolor="#EEEEEE"</td> <font color="#319ACE">' + ' Peter M. ' +
'<td bgcolor="#EEEEEE"</td> <font color="#319ACE">' + ' Balazs G. ' +
'<td bgcolor="#EEEEEE"</td> <font color="#319ACE">' + ' Christian B.I. ' +
'</td></tr>');

document.write(
'<tr align="right"><td >' + 'Very high ' +
'<td </td> ' + Ont +
'<td </td> ' + Ont +
'<td </td> ' + Ont +
'<td </td> ' + Ont +
'<td </td> ' + Ont +
'<td </td> ' + Ont +
'</td></tr>');

document.write('</table id="test"></center>');


table = document.getElementById('test');

</script>

</head>
</html>