A script like that is not really intended to include in a template.
What you
should could do it install the script "outside" WB, (ie
www.yourserver.com/calendar) and use the wrapper (iframe) module to show it inside WB.
Otherwise,
have a look at the calendar scripts built for WB
Ruud