# Copyright (C) 2003-2005 Kouichirou Eto, All rights reserved.

$LOAD_PATH << "../../lib" unless $LOAD_PATH.include?("../../lib")

module Qwik
  module GeneratorModule
    def generate_js(prefix="")
      debug = true
      head = []
      if debug
	#ar = %w(common debug history monitor niftypp toc wema wysiwyg startup)
	#ar = %w(debug wema startup)
	#ar = %w(base wema)
	#ar = %w(base niftypp)
	#ar = %w(base debug niftypp)
	#ar = %w(base)

	#ar = %w(base niftypp)
	ar = %w(base niftypp debugwindow)
	ar.each {|f|
	  head << [:script,
	    {:type=>"text/javascript",
	      :src=>"#{prefix}.theme/js/#{f}.js"}, ""]
	}
      else
	head << [:script,
	  {:type=>"text/javascript",
	    :src=>"#{prefix}.theme/all.js"}, ""]
      end

#      head << [:script, {:type=>"text/javascript",
#	  :src=>"#{prefix}.theme/ap/ArekorePopup.js"}, ""]

      head
    end
    module_function :generate_js
  end
end
