I am not able to reproduce the error using only the DWT file you have sent.
Perhaps the issue is caused by the template not being a dynamic template. Try changing it from a .dwt file to the .dwt.php dynamic template file
It could also be an issue with the supporting CSS or JS for the template file. Or perhaps an issue with the site definition, if you save the template to another site, so you have the same error?