added styles to smart javascript function