Template FAQ
From Documentation
Can I insert Javascript in templates?
Yes you can insert javascript in your template files but you will need to wrap literal tags around the javascript code. For example:
{literal}
<script language="javascript">
javasrcript code here
</script>
{/literal}
The best way to include javascript is to include it though a seperate file.