I am trying to rotate 5 images (each linking to a page on my website) but the code doesnt seem to work when I put in inside a table.
Anyone have any idea where I am going wrong please?

This is the code in <head> section


<script language="JavaScript1.2">

var howOften = 5; //number often in seconds to rotate
var current = 0; //start the counter at 0
var ns6 = document.getElementById&&!document.all; //detect netscape 6

// place your images, text, etc in the array elements here
var items = new Array();
items[0]="<a href='commercial_cleaning.htm' ><img alt='image0 (9K)' src='rotate/image0.jpg' border='0' /></a>"; //a linked image
items[1]="<a href='recycle_units.htm'><img alt='image1 (9K)' src='rotate/image1.jpg' border='0' /></a>"; //a linked image
items[2]="<a href='pest_control.htm'><img alt='image2 (9K)' src='rotate/image2.jpg' border='0' /></a>"; //a linked image
items[3]="<a href='washroom_services.htm'><img alt='image3 (9K)' src='rotate/image3.jpg' border='0' /></a>"; //a linked image
items[4]="<a href='window_cleaning.htm'><img alt='image4 (9K)' src='rotate/image4.jpg' border='0' /></a>"; //a linked image
function rotater() {
document.getElementById("placeholder").innerHTML = items[current];
current = (current==items.length-1) ? 0 : current + 1;
setTimeout("rotater()",howOften*1000);
}

function rotater() {
if(document.layers) {
document.placeholderlayer.document.write(items[current]);
document.placeholderlayer.document.close();
}
if(ns6)document.getElementById("placeholderdiv").innerHTML=items[current]
if(document.all)
placeholderdiv.innerHTML=items[current];

current = (current==items.length-1) ? 0 : current + 1; //increment or reset
setTimeout("rotater()",howOften*1000);
}
window.onload=rotater;
//-->
</script>

and in body section (incide table) this code <layer id="placeholderlayer"></layer><div id="placeholderdiv"></div>


Thanks in advance, any help greatly appreciated