anchor.diff:  	[DoctypeString | AST].
   
   handle_javascript(AST, Attr, SourceFN, {_, DTmp, DJS, _, _, _}) ->
  -	BaseName = filename:basename(SourceFN, ".zml"),
  +	{LibFiles, IndFiles} = get_js_list(Attr, SourceFN),
   
  -	JSFileList = get_js_list(Attr, SourceFN),
  -	LoadedFiles = load_js_files(JSFileList, DTmp),
  -	Result = optimize_js(LoadedFiles, filename:join([DJS, BaseName ++ ".js"])),
  -	case Result of
  -		[] -> great;
  -		_ -> erlang:error({"Javascript Error", Result})
  -	end,
  -	AST.
  +	% Optimize "lib" js files
  +	LoadedFiles = load_js_files(LibFiles, DTmp),
  +	OptLibFName = filename:join([DTmp, zml:tmp_filename()]),
  +	optimize_js(LoadedFiles, OptLibFName),
  +	file:write_file(OptLibFName, "_zmlll=1;", [append]),
  +	[MD5Sum | _] = string:tokens(os:cmd("md5sum '"++OptLibFName++"'")," "),
  +	FinLibFName = filename:join([DJS, MD5Sum ++ ".js"]),
  +	file:rename(OptLibFName, FinLibFName),
  +
  +	% Optimize inline js
  +	LF2 = load_js_files(IndFiles, DTmp),
  +	OptIndFName = filename:join([DTmp, zml:tmp_filename()]),
  +	optimize_js(LF2, OptIndFName, false),
  +	{ok, Inner} = file:read_file(OptIndFName),
  +	Inline = ?JS_LOADER("js/" ++ MD5Sum ++ ".js", Inner),
  +	% TODO! you are here.  Put this in the correct spot in the AST
  +	AST ++ [Inline].
   
   % Look in the attributes and in the source directory to see which javascript
   % files should be associated with this html block.  Resolves paths relative to
  
positive.code: 			"<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">\n"}]).
  
  -define(DEFAULT_TYPE, xhtml_strict).
  
  run_handler(_ID, Attr, _Children, FAST, SourceFN, StagingDir) ->
  	% TODO:
  
negative.code: 			end
  	end.
  
  optimize_js(Files, Dest) ->
  	optimize_js(Files, Dest, true).
  
  optimize_js([], _, _) ->
  	[];
  optimize_js(Files, Dest, Advanced) ->
  	Cmd = lists:flatten(["java -jar $ZML_CLOSURE_JAR",
  		lists:map(fun(A) -> [" --js=",A] end, Files),
  		" --js_output_file=", Dest,
  		case Advanced of
  			true -> " --compilation_level=ADVANCED_OPTIMIZATIONS";
  			false -> ""
  		end,
  		" --warning_level=QUIET"]),
  	case string:strip(os:cmd(Cmd)) of
  		[] -> ok;
  		Result -> erlang:error({"Javascript Error", Result})
  	end.
  