Fixed bug #9008: template.php doesn't fully utilize the loadJavascriptLib function