Logged In: YES
user_id=521098

I see two approaches for this:
1: Use the Smarty encoding feature when ever possible
(<{mailto address=$Team.email subject="Email about $Team.name"
encode="javascript"}>)

2: Move that javascript functionallity into Xoops, and parse all output send to
Smarty.