Uses of Java script on a website in SEO view
It is acceptable that we cannot create a website in pure html. To gain functionality we should add flavors like PHP,Java script,ASP etc. So it is acceptable that for the completion of a perfect website we need to use:
* html
*PHP/ASP
* Java scripts and its different flavors
* Flash
As an SEO I give 100 marks for fist two. I prefer not to use the last two. The reason is what ever we see in major SE's guidelines it is sure that Java script and flash are not spider friendly.
Common web designing mistake in SEO view
Most of the developers use java based menus on their website. The links to other pages also built with Java script. So in a nut shell if a spider get in to the home page, it cannot go to other pages as most probably that website lags a html based link structure. So my suggestion is if you really stick with the usage of Java script based link structure ,provide an alternate html based links too. You should develop a site map too on your website for spiders.