here is site where you can take lot of tips regarding javascript.....
http://www.stopgeek.com/neat-trick-with-javascript.html