Is this possible?

The code works fine (errorless) when put amongst the html of a page, but if I put this in my footer.js file... (below is the entire footer.js file)

Code JavaScript:
document.write('<P/>')
document.write('<div align="center"><span class="footer">')
if (GetCookie ("LOCHDG" + getCookieLocationPort()) != false)
{
	document.write('<span class="bold">Location:</span> ' + GetCookie("LOCHDG" + getCookieLocationPort()));
}
document.write('<br/>')
document.write('© 2004 Civica Pty. Limited All Rights Reserved')
document.write('</span></div>')
document.write('</td>')
document.write('</tr>')
document.write('</table>')
document.write('</div>')
document.write('<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>')
document.write('<script type="text/javascript">')
document.write('_uacct = "UA-2502622-1";')
document.write('urchinTracker();')
document.write('</script>')

...internet explorer returns an error saying: Object expected on line <line after urchinTracker(); is called>

So is there an error free way to include the javascript code in an existing .js file to save me editing 70 or so files. Just note that I didn't make this 'site', it's part of a library application.

Thanks!