Hi Adam,
Yes, Javascript can be used to spread viruses. All they need to do is add a hidden iframe to a page, this can then be used to track users or prompt users to install software (such as rouge plugins, etc).
Please could you verify that the lines of JavaScript do not have any rouge code contained within them. Unfortunatly all I see is obfiscated code, so it's very difficult to see what it's doing.
Currently anyone that uses AVG or other cross site scripting detection tool will not run the entire JavaScript file, and are also prompted in this way. I have also seen Google & FireFox block sites that contain these types of JS attacks (although not from sites containing this tool at present).
Many Thanks,
Ady