as i said, the javascript probably relies on the content of the page.
So the same script may not work after your changes.
What you can do is
1. backup your tpl
2. ensure the backup is ok, you don't want to loose your template
3. put the default template
4. test the template to see the problem doesn't exist
5. introduce changes from your template, step-by-step
6. at every step, test to see if the problem appears, so you know that latest step introduced it
7. you can eventually post the accused change here on the forum, so that someone may help you