Updated javascript and style function.