writer.startElement(HTML.SCRIPT_ELEM, null);
writer.writeAttribute(HTML.TYPE_ATTR, "text/javascript", null);
final ExternalContext externalContext = facesContext.getExternalContext();
final MyfacesConfig currentInstance = MyfacesConfig.getCurrentInstance(externalContext);
boolean autoScroll = currentInstance.isAutoScroll();
ScriptContext context = new ScriptContext(currentInstance
.isPrettyHtml());
context.prettyLine();
context.increaseIndent();
prepareScript(context, autoScroll);