What I find strange is that when I remove the javascript (which is always placed at the very bottom of the page, outside of any tags or code) it doesn't instantly come back when I run the site
It is this that makes me think the site has been hacked in some way. If the infection was on your system it would be there when you upload it, do you have a log of entries that show when the page was last amended ?