Man,
do you test the code before posting it on the website? In which language you have written and in which browser you have tested? Your code is not working. I could change the above code as below and its working now.
<html>
<script language="javascript" type="text/javascript">
function ChangeBG(c)
{
document.body.bgColor = c;
}
</script>
<body>
<a href="javascript:ChangeBG('green')" onmouseover="ChangeBG('red')">Anchor</a>
</body>
</html>
Thanks