From http://css-tricks.com/snippets/javascript/addclass-function/
addClass Function