How can i just get document.write('') to add to the document and not overwrite the whole code?

cheers

<html><head><title></title>
<script>
function table(a)
{
var a;

switch(a)
{
case 1 : document.write("1"); break;
case 2 : document.write("2"); break;
case 3 : document.write("3"); break;
case 4 : document.write("4"); break;
case 5 : document.write("5"); break;
}
}
</script>
<head><body>

<a href = "javascript:void(0)" onclick="table(1)">First</a></font>
<a href = "javascript:void(0)" onclick="table(2)">Second</a></font>
<a href = "javascript:void(0)" onclick="table(3)">Third</a></font>
<a href = "javascript:void(0)" onclick="table(4)">Fourth</a></font>
<a href = "javascript:void(0)" onclick="table(5)">Fifth</a></font>

</body><html>