factored out css/js, fixed small syntax errors