Smarty recognizes several types of tags, some of which can be within JavaScript or CSS code. Since you do not want Smarty to try to parse the JavaScript or CSS as Smarty template code, you need to surround the offending code in {literal} {/literal} tags. Example:
{literal}
<script language="JavaScript" type="text/javascript">
// code here
</script>
<style type="text/css">
/* css here */
</style>
{/literal}