Place the scripts.js file in the theme/javascript folder
Apply the lib.patch to course/lib.php file
Place the following line at the end of theme/config.php file
$THEME->javascripts_footer=array('scripts');