Index: /CKPackager/trunk/LICENSE.html
===================================================================
--- /CKPackager/trunk/LICENSE.html	(revision 2381)
+++ /CKPackager/trunk/LICENSE.html	(revision 2381)
@@ -0,0 +1,1331 @@
+﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+== BEGIN TEXT ONLY VERSION ==
+
+Software License Agreement
+==========================
+
+CKPackager - http://ckeditor.com
+Copyright (C) 2003-2008 Frederico Caldeira Knabben ("FredCK.com")
+
+Licensed under the terms of any of the following licenses at your
+choice:
+
+ - GNU General Public License Version 2 or later (the "GPL")
+   http://www.gnu.org/licenses/gpl.html
+   (See Appendix A)
+
+ - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+   http://www.gnu.org/licenses/lgpl.html
+   (See Appendix B)
+
+ - Mozilla Public License Version 1.1 or later (the "MPL")
+   http://www.mozilla.org/MPL/MPL-1.1.html
+   (See Appendix C)
+
+You are not required to, but if you want to explicitly declare the
+license you have chosen to be bound to when using, reproducing,
+modifying and distributing this software, just include a text file
+titled "legal.txt" in your version of this software, indicating your
+license choice. In any case, your choice will not restrict any
+recipient of your version of this software to use, reproduce, modify
+and distribute this software under any of the above licenses.
+
+Sources of Intellectual Property Included in CKPackager
+=====================================================
+
+Where not otherwise indicated, all CKPackager content is authored by
+FredCK.com engineers and consists of FredCK.com-owned intellectual
+property. In some specific instances, CKPackager will incorporate work
+done by developers outside of FredCK.com with their express permission.
+
+Rhino: The js.jar file is part of the Rhino distribution, which is
+licensed under the terms of the MPL/GPL License 
+(http://developer.mozilla.org/en/Rhino_License).
+
+Trademarks
+==========
+
+CKPackager is a trademark of Frederico Caldeira Knabben. All other brand
+and product names are trademarks, registered trademarks or service
+marks of their respective holders.
+
+Appendix A: The GPL License
+===========================
+
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software-to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+
+Appendix B: The LGPL License
+============================
+
+		  GNU LESSER GENERAL PUBLIC LICENSE
+		       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software-to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages-typically libraries-of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+		  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+
+Appendix C: The MPL License
+===========================
+
+                          MOZILLA PUBLIC LICENSE
+                                Version 1.1
+
+                              ===============
+
+1. Definitions.
+
+     1.0.1. "Commercial Use" means distribution or otherwise making the
+     Covered Code available to a third party.
+
+     1.1. "Contributor" means each entity that creates or contributes to
+     the creation of Modifications.
+
+     1.2. "Contributor Version" means the combination of the Original
+     Code, prior Modifications used by a Contributor, and the Modifications
+     made by that particular Contributor.
+
+     1.3. "Covered Code" means the Original Code or Modifications or the
+     combination of the Original Code and Modifications, in each case
+     including portions thereof.
+
+     1.4. "Electronic Distribution Mechanism" means a mechanism generally
+     accepted in the software development community for the electronic
+     transfer of data.
+
+     1.5. "Executable" means Covered Code in any form other than Source
+     Code.
+
+     1.6. "Initial Developer" means the individual or entity identified
+     as the Initial Developer in the Source Code notice required by Exhibit
+     A.
+
+     1.7. "Larger Work" means a work which combines Covered Code or
+     portions thereof with code not governed by the terms of this License.
+
+     1.8. "License" means this document.
+
+     1.8.1. "Licensable" means having the right to grant, to the maximum
+     extent possible, whether at the time of the initial grant or
+     subsequently acquired, any and all of the rights conveyed herein.
+
+     1.9. "Modifications" means any addition to or deletion from the
+     substance or structure of either the Original Code or any previous
+     Modifications. When Covered Code is released as a series of files, a
+     Modification is:
+          A. Any addition to or deletion from the contents of a file
+          containing Original Code or previous Modifications.
+
+          B. Any new file that contains any part of the Original Code or
+          previous Modifications.
+
+     1.10. "Original Code" means Source Code of computer software code
+     which is described in the Source Code notice required by Exhibit A as
+     Original Code, and which, at the time of its release under this
+     License is not already Covered Code governed by this License.
+
+     1.10.1. "Patent Claims" means any patent claim(s), now owned or
+     hereafter acquired, including without limitation,  method, process,
+     and apparatus claims, in any patent Licensable by grantor.
+
+     1.11. "Source Code" means the preferred form of the Covered Code for
+     making modifications to it, including all modules it contains, plus
+     any associated interface definition files, scripts used to control
+     compilation and installation of an Executable, or source code
+     differential comparisons against either the Original Code or another
+     well known, available Covered Code of the Contributor's choice. The
+     Source Code can be in a compressed or archival form, provided the
+     appropriate decompression or de-archiving software is widely available
+     for no charge.
+
+     1.12. "You" (or "Your")  means an individual or a legal entity
+     exercising rights under, and complying with all of the terms of, this
+     License or a future version of this License issued under Section 6.1.
+     For legal entities, "You" includes any entity which controls, is
+     controlled by, or is under common control with You. For purposes of
+     this definition, "control" means (a) the power, direct or indirect,
+     to cause the direction or management of such entity, whether by
+     contract or otherwise, or (b) ownership of more than fifty percent
+     (50%) of the outstanding shares or beneficial ownership of such
+     entity.
+
+2. Source Code License.
+
+     2.1. The Initial Developer Grant.
+     The Initial Developer hereby grants You a world-wide, royalty-free,
+     non-exclusive license, subject to third party intellectual property
+     claims:
+          (a)  under intellectual property rights (other than patent or
+          trademark) Licensable by Initial Developer to use, reproduce,
+          modify, display, perform, sublicense and distribute the Original
+          Code (or portions thereof) with or without Modifications, and/or
+          as part of a Larger Work; and
+
+          (b) under Patents Claims infringed by the making, using or
+          selling of Original Code, to make, have made, use, practice,
+          sell, and offer for sale, and/or otherwise dispose of the
+          Original Code (or portions thereof).
+
+          (c) the licenses granted in this Section 2.1(a) and (b) are
+          effective on the date Initial Developer first distributes
+          Original Code under the terms of this License.
+
+          (d) Notwithstanding Section 2.1(b) above, no patent license is
+          granted: 1) for code that You delete from the Original Code; 2)
+          separate from the Original Code;  or 3) for infringements caused
+          by: i) the modification of the Original Code or ii) the
+          combination of the Original Code with other software or devices.
+
+     2.2. Contributor Grant.
+     Subject to third party intellectual property claims, each Contributor
+     hereby grants You a world-wide, royalty-free, non-exclusive license
+
+          (a)  under intellectual property rights (other than patent or
+          trademark) Licensable by Contributor, to use, reproduce, modify,
+          display, perform, sublicense and distribute the Modifications
+          created by such Contributor (or portions thereof) either on an
+          unmodified basis, with other Modifications, as Covered Code
+          and/or as part of a Larger Work; and
+
+          (b) under Patent Claims infringed by the making, using, or
+          selling of  Modifications made by that Contributor either alone
+          and/or in combination with its Contributor Version (or portions
+          of such combination), to make, use, sell, offer for sale, have
+          made, and/or otherwise dispose of: 1) Modifications made by that
+          Contributor (or portions thereof); and 2) the combination of
+          Modifications made by that Contributor with its Contributor
+          Version (or portions of such combination).
+
+          (c) the licenses granted in Sections 2.2(a) and 2.2(b) are
+          effective on the date Contributor first makes Commercial Use of
+          the Covered Code.
+
+          (d)    Notwithstanding Section 2.2(b) above, no patent license is
+          granted: 1) for any code that Contributor has deleted from the
+          Contributor Version; 2)  separate from the Contributor Version;
+          3)  for infringements caused by: i) third party modifications of
+          Contributor Version or ii)  the combination of Modifications made
+          by that Contributor with other software  (except as part of the
+          Contributor Version) or other devices; or 4) under Patent Claims
+          infringed by Covered Code in the absence of Modifications made by
+          that Contributor.
+
+3. Distribution Obligations.
+
+     3.1. Application of License.
+     The Modifications which You create or to which You contribute are
+     governed by the terms of this License, including without limitation
+     Section 2.2. The Source Code version of Covered Code may be
+     distributed only under the terms of this License or a future version
+     of this License released under Section 6.1, and You must include a
+     copy of this License with every copy of the Source Code You
+     distribute. You may not offer or impose any terms on any Source Code
+     version that alters or restricts the applicable version of this
+     License or the recipients' rights hereunder. However, You may include
+     an additional document offering the additional rights described in
+     Section 3.5.
+
+     3.2. Availability of Source Code.
+     Any Modification which You create or to which You contribute must be
+     made available in Source Code form under the terms of this License
+     either on the same media as an Executable version or via an accepted
+     Electronic Distribution Mechanism to anyone to whom you made an
+     Executable version available; and if made available via Electronic
+     Distribution Mechanism, must remain available for at least twelve (12)
+     months after the date it initially became available, or at least six
+     (6) months after a subsequent version of that particular Modification
+     has been made available to such recipients. You are responsible for
+     ensuring that the Source Code version remains available even if the
+     Electronic Distribution Mechanism is maintained by a third party.
+
+     3.3. Description of Modifications.
+     You must cause all Covered Code to which You contribute to contain a
+     file documenting the changes You made to create that Covered Code and
+     the date of any change. You must include a prominent statement that
+     the Modification is derived, directly or indirectly, from Original
+     Code provided by the Initial Developer and including the name of the
+     Initial Developer in (a) the Source Code, and (b) in any notice in an
+     Executable version or related documentation in which You describe the
+     origin or ownership of the Covered Code.
+
+     3.4. Intellectual Property Matters
+          (a) Third Party Claims.
+          If Contributor has knowledge that a license under a third party's
+          intellectual property rights is required to exercise the rights
+          granted by such Contributor under Sections 2.1 or 2.2,
+          Contributor must include a text file with the Source Code
+          distribution titled "LEGAL" which describes the claim and the
+          party making the claim in sufficient detail that a recipient will
+          know whom to contact. If Contributor obtains such knowledge after
+          the Modification is made available as described in Section 3.2,
+          Contributor shall promptly modify the LEGAL file in all copies
+          Contributor makes available thereafter and shall take other steps
+          (such as notifying appropriate mailing lists or newsgroups)
+          reasonably calculated to inform those who received the Covered
+          Code that new knowledge has been obtained.
+
+          (b) Contributor APIs.
+          If Contributor's Modifications include an application programming
+          interface and Contributor has knowledge of patent licenses which
+          are reasonably necessary to implement that API, Contributor must
+          also include this information in the LEGAL file.
+
+               (c)    Representations.
+          Contributor represents that, except as disclosed pursuant to
+          Section 3.4(a) above, Contributor believes that Contributor's
+          Modifications are Contributor's original creation(s) and/or
+          Contributor has sufficient rights to grant the rights conveyed by
+          this License.
+
+     3.5. Required Notices.
+     You must duplicate the notice in Exhibit A in each file of the Source
+     Code.  If it is not possible to put such notice in a particular Source
+     Code file due to its structure, then You must include such notice in a
+     location (such as a relevant directory) where a user would be likely
+     to look for such a notice.  If You created one or more Modification(s)
+     You may add your name as a Contributor to the notice described in
+     Exhibit A.  You must also duplicate this License in any documentation
+     for the Source Code where You describe recipients' rights or ownership
+     rights relating to Covered Code.  You may choose to offer, and to
+     charge a fee for, warranty, support, indemnity or liability
+     obligations to one or more recipients of Covered Code. However, You
+     may do so only on Your own behalf, and not on behalf of the Initial
+     Developer or any Contributor. You must make it absolutely clear than
+     any such warranty, support, indemnity or liability obligation is
+     offered by You alone, and You hereby agree to indemnify the Initial
+     Developer and every Contributor for any liability incurred by the
+     Initial Developer or such Contributor as a result of warranty,
+     support, indemnity or liability terms You offer.
+
+     3.6. Distribution of Executable Versions.
+     You may distribute Covered Code in Executable form only if the
+     requirements of Section 3.1-3.5 have been met for that Covered Code,
+     and if You include a notice stating that the Source Code version of
+     the Covered Code is available under the terms of this License,
+     including a description of how and where You have fulfilled the
+     obligations of Section 3.2. The notice must be conspicuously included
+     in any notice in an Executable version, related documentation or
+     collateral in which You describe recipients' rights relating to the
+     Covered Code. You may distribute the Executable version of Covered
+     Code or ownership rights under a license of Your choice, which may
+     contain terms different from this License, provided that You are in
+     compliance with the terms of this License and that the license for the
+     Executable version does not attempt to limit or alter the recipient's
+     rights in the Source Code version from the rights set forth in this
+     License. If You distribute the Executable version under a different
+     license You must make it absolutely clear that any terms which differ
+     from this License are offered by You alone, not by the Initial
+     Developer or any Contributor. You hereby agree to indemnify the
+     Initial Developer and every Contributor for any liability incurred by
+     the Initial Developer or such Contributor as a result of any such
+     terms You offer.
+
+     3.7. Larger Works.
+     You may create a Larger Work by combining Covered Code with other code
+     not governed by the terms of this License and distribute the Larger
+     Work as a single product. In such a case, You must make sure the
+     requirements of this License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+
+     If it is impossible for You to comply with any of the terms of this
+     License with respect to some or all of the Covered Code due to
+     statute, judicial order, or regulation then You must: (a) comply with
+     the terms of this License to the maximum extent possible; and (b)
+     describe the limitations and the code they affect. Such description
+     must be included in the LEGAL file described in Section 3.4 and must
+     be included with all distributions of the Source Code. Except to the
+     extent prohibited by statute or regulation, such description must be
+     sufficiently detailed for a recipient of ordinary skill to be able to
+     understand it.
+
+5. Application of this License.
+
+     This License applies to code to which the Initial Developer has
+     attached the notice in Exhibit A and to related Covered Code.
+
+6. Versions of the License.
+
+     6.1. New Versions.
+     Netscape Communications Corporation ("Netscape") may publish revised
+     and/or new versions of the License from time to time. Each version
+     will be given a distinguishing version number.
+
+     6.2. Effect of New Versions.
+     Once Covered Code has been published under a particular version of the
+     License, You may always continue to use it under the terms of that
+     version. You may also choose to use such Covered Code under the terms
+     of any subsequent version of the License published by Netscape. No one
+     other than Netscape has the right to modify the terms applicable to
+     Covered Code created under this License.
+
+     6.3. Derivative Works.
+     If You create or use a modified version of this License (which you may
+     only do in order to apply it to code which is not already Covered Code
+     governed by this License), You must (a) rename Your license so that
+     the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
+     "MPL", "NPL" or any confusingly similar phrase do not appear in your
+     license (except to note that your license differs from this License)
+     and (b) otherwise make it clear that Your version of the license
+     contains terms which differ from the Mozilla Public License and
+     Netscape Public License. (Filling in the name of the Initial
+     Developer, Original Code or Contributor in the notice described in
+     Exhibit A shall not of themselves be deemed to be modifications of
+     this License.)
+
+7. DISCLAIMER OF WARRANTY.
+
+     COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+     WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+     WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
+     DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
+     THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
+     IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
+     YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
+     COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
+     OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
+     ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+8. TERMINATION.
+
+     8.1.  This License and the rights granted hereunder will terminate
+     automatically if You fail to comply with terms herein and fail to cure
+     such breach within 30 days of becoming aware of the breach. All
+     sublicenses to the Covered Code which are properly granted shall
+     survive any termination of this License. Provisions which, by their
+     nature, must remain in effect beyond the termination of this License
+     shall survive.
+
+     8.2.  If You initiate litigation by asserting a patent infringement
+     claim (excluding declatory judgment actions) against Initial Developer
+     or a Contributor (the Initial Developer or Contributor against whom
+     You file such action is referred to as "Participant")  alleging that:
+
+     (a)  such Participant's Contributor Version directly or indirectly
+     infringes any patent, then any and all rights granted by such
+     Participant to You under Sections 2.1 and/or 2.2 of this License
+     shall, upon 60 days notice from Participant terminate prospectively,
+     unless if within 60 days after receipt of notice You either: (i)
+     agree in writing to pay Participant a mutually agreeable reasonable
+     royalty for Your past and future use of Modifications made by such
+     Participant, or (ii) withdraw Your litigation claim with respect to
+     the Contributor Version against such Participant.  If within 60 days
+     of notice, a reasonable royalty and payment arrangement are not
+     mutually agreed upon in writing by the parties or the litigation claim
+     is not withdrawn, the rights granted by Participant to You under
+     Sections 2.1 and/or 2.2 automatically terminate at the expiration of
+     the 60 day notice period specified above.
+
+     (b)  any software, hardware, or device, other than such Participant's
+     Contributor Version, directly or indirectly infringes any patent, then
+     any rights granted to You by such Participant under Sections 2.1(b)
+     and 2.2(b) are revoked effective as of the date You first made, used,
+     sold, distributed, or had made, Modifications made by that
+     Participant.
+
+     8.3.  If You assert a patent infringement claim against Participant
+     alleging that such Participant's Contributor Version directly or
+     indirectly infringes any patent where such claim is resolved (such as
+     by license or settlement) prior to the initiation of patent
+     infringement litigation, then the reasonable value of the licenses
+     granted by such Participant under Sections 2.1 or 2.2 shall be taken
+     into account in determining the amount or value of any payment or
+     license.
+
+     8.4.  In the event of termination under Sections 8.1 or 8.2 above,
+     all end user license agreements (excluding distributors and resellers)
+     which have been validly granted by You or any distributor hereunder
+     prior to termination shall survive termination.
+
+9. LIMITATION OF LIABILITY.
+
+     UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
+     (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
+     DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
+     OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
+     ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
+     CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
+     WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
+     COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
+     INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
+     LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
+     RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
+     PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
+     EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
+     THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+10. U.S. GOVERNMENT END USERS.
+
+     The Covered Code is a "commercial item," as that term is defined in
+     48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
+     software" and "commercial computer software documentation," as such
+     terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
+     C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
+     all U.S. Government End Users acquire Covered Code with only those
+     rights set forth herein.
+
+11. MISCELLANEOUS.
+
+     This License represents the complete agreement concerning subject
+     matter hereof. If any provision of this License is held to be
+     unenforceable, such provision shall be reformed only to the extent
+     necessary to make it enforceable. This License shall be governed by
+     California law provisions (except to the extent applicable law, if
+     any, provides otherwise), excluding its conflict-of-law provisions.
+     With respect to disputes in which at least one party is a citizen of,
+     or an entity chartered or registered to do business in the United
+     States of America, any litigation relating to this License shall be
+     subject to the jurisdiction of the Federal Courts of the Northern
+     District of California, with venue lying in Santa Clara County,
+     California, with the losing party responsible for costs, including
+     without limitation, court costs and reasonable attorneys' fees and
+     expenses. The application of the United Nations Convention on
+     Contracts for the International Sale of Goods is expressly excluded.
+     Any law or regulation which provides that the language of a contract
+     shall be construed against the drafter shall not apply to this
+     License.
+
+12. RESPONSIBILITY FOR CLAIMS.
+
+     As between Initial Developer and the Contributors, each party is
+     responsible for claims and damages arising, directly or indirectly,
+     out of its utilization of rights under this License and You agree to
+     work with Initial Developer and Contributors to distribute such
+     responsibility on an equitable basis. Nothing herein is intended or
+     shall be deemed to constitute any admission of liability.
+
+13. MULTIPLE-LICENSED CODE.
+
+     Initial Developer may designate portions of the Covered Code as
+     "Multiple-Licensed".  "Multiple-Licensed" means that the Initial
+     Developer permits you to utilize portions of the Covered Code under
+     Your choice of the NPL or the alternative licenses, if any, specified
+     by the Initial Developer in the file described in Exhibit A.
+
+EXHIBIT A -Mozilla Public License.
+
+     ``The contents of this file are subject to the Mozilla Public License
+     Version 1.1 (the "License"); you may not use this file except in
+     compliance with the License. You may obtain a copy of the License at
+     http://www.mozilla.org/MPL/
+
+     Software distributed under the License is distributed on an "AS IS"
+     basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+     License for the specific language governing rights and limitations
+     under the License.
+
+     The Original Code is ______________________________________.
+
+     The Initial Developer of the Original Code is ________________________.
+     Portions created by ______________________ are Copyright (C) ______
+     _______________________. All Rights Reserved.
+
+     Contributor(s): ______________________________________.
+
+     Alternatively, the contents of this file may be used under the terms
+     of the _____ license (the  "[___] License"), in which case the
+     provisions of [______] License are applicable instead of those
+     above.  If you wish to allow use of your version of this file only
+     under the terms of the [____] License and not to allow others to use
+     your version of this file under the MPL, indicate your decision by
+     deleting  the provisions above and replace  them with the notice and
+     other provisions required by the [___] License.  If you do not delete
+     the provisions above, a recipient may use your version of this file
+     under either the MPL or the [___] License."
+
+     [NOTE: The text of this Exhibit A may differ slightly from the text of
+     the notices in the Source Code files of the Original Code. You should
+     use the text of this Exhibit A rather than the text found in the
+     Original Code Source Code for Your Modifications.]
+
+== END TEXT ONLY VERSION ==
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>License - CKPackager</title>
+</head>
+<body>
+	<h1>
+		Software License Agreement
+	</h1>
+	<p>
+		<strong>CKPackager&trade;</strong> - <a href="http://ckeditor.com">http://ckeditor.com</a><br />
+		Copyright &copy; 2003-2008 Frederico Caldeira Knabben
+	</p>
+	<p>
+		Licensed under the terms of any of the following licenses at your choice:
+	</p>
+	<ul>
+		<li><a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a> Version
+			2 or later (the "GPL");</li>
+		<li><a href="http://www.gnu.org/licenses/lgpl.html">GNU Lesser General Public License</a>
+			Version 2.1 or later (the "LGPL");</li>
+		<li><a href="http://www.mozilla.org/MPL/MPL-1.1.html">Mozilla Public License</a> Version
+			1.1 or later (the "MPL").</li>
+	</ul>
+	<p>
+		You are not required to, but if you want to explicitly declare the license you have
+		chosen to be bound to when using, reproducing, modifying and distributing this software,
+		just include a text file titled "LEGAL" in your version of this software, indicating
+		your license choice. In any case, your choice will not restrict any recipient of
+		your version of this software to use, reproduce, modify and distribute this software
+		under any of the above licenses.
+	</p>
+	<h2>
+		Sources of Intellectual Property Included in CKPackager
+	</h2>
+	<p>
+		Where not otherwise indicated, all CKPackager content is authored by FredCK.com
+		engineers and consists of FredCK.com-owned intellectual property. In some specific
+		instances, CKPackager will incorporate work done by developers outside of FredCK.com
+		with their express permission.
+	</p>
+	<p>
+		<a href="http://www.mozilla.org/rhino/">Rhino</a>: The js.jar file is part of the
+		Rhino distribution, which is licensed under the terms of the <a href="http://developer.yahoo.com/yui/license.txt">
+			MPL/GPL License</a>.
+	</p>
+	<h2>
+		Trademarks
+	</h2>
+	<p>
+		CKPackager is a trademark of Frederico Caldeira Knabben. All other brand and product
+		names are trademarks, registered trademarks or service marks of their respective
+		holders.
+	</p>
+</body>
+</html>
Index: /CKPackager/trunk/_dev/compress.bat
===================================================================
--- /CKPackager/trunk/_dev/compress.bat	(revision 2381)
+++ /CKPackager/trunk/_dev/compress.bat	(revision 2381)
@@ -0,0 +1,8 @@
+:: Copyright (c) 2003-2008, Frederico Caldeira Knabben. All rights reserved.
+:: For licensing, see LICENSE.html or http://ckeditor.com/license
+
+@ECHO OFF
+CLS
+ECHO.
+
+java -jar ../js.jar -opt -1 ../ckpackager.js -compress script.js
Index: /CKPackager/trunk/_dev/dump.bat
===================================================================
--- /CKPackager/trunk/_dev/dump.bat	(revision 2381)
+++ /CKPackager/trunk/_dev/dump.bat	(revision 2381)
@@ -0,0 +1,11 @@
+:: Copyright (c) 2003-2008, Frederico Caldeira Knabben. All rights reserved.
+:: For licensing, see LICENSE.html or http://ckeditor.com/license
+
+@ECHO OFF
+CLS
+ECHO.
+
+java -jar ../js.jar -opt -1 ../ckpackager.js -dump script.js
+
+:: To save the output to file
+:: java -jar ../js.jar -opt -1 ../ckpackager.js -dump script.js > dump.txt
Index: /CKPackager/trunk/_dev/script.js
===================================================================
--- /CKPackager/trunk/_dev/script.js	(revision 2381)
+++ /CKPackager/trunk/_dev/script.js	(revision 2381)
@@ -0,0 +1,1 @@
+var a = 2;
Index: /CKPackager/trunk/_samples/basic/basic.pack
===================================================================
--- /CKPackager/trunk/_samples/basic/basic.pack	(revision 2381)
+++ /CKPackager/trunk/_samples/basic/basic.pack	(revision 2381)
@@ -0,0 +1,31 @@
+﻿/*
+ * CKPackager - Sample Package file
+ */
+
+header :
+	'/*'												+ '\n' +
+	' * This file has been compressed with CKPackager'	+ '\n' +
+	' */'												+ '\n' +
+	'\n',
+
+constants :
+	{
+		'BASIC_COLOR_RED'	: 1,
+		'BASIC_COLOR_BLUE'	: 2,
+		'BASIC_COLOR_WHITE'	: 3,
+		'MyObject.CONST'	: 1
+	},
+
+packages :
+	[
+		{
+			output : 'basic_sample_compressed.js',
+
+			renameGlobals : false,
+			compactJavascript : true,
+			files :
+				[
+					'basic_sample.js'
+				]
+		}
+	]
Index: /CKPackager/trunk/_samples/basic/basic_sample.js
===================================================================
--- /CKPackager/trunk/_samples/basic/basic_sample.js	(revision 2381)
+++ /CKPackager/trunk/_samples/basic/basic_sample.js	(revision 2381)
@@ -0,0 +1,88 @@
+/*
+ * #########
+ *  This is a sample script file, were we can check all features of FCKpackager.
+ *  The code has not much sense and it's here for demonstration purposes only.
+ *
+ * Please note that all statements are correctly terminated with a semi-colon
+ * (except brackets enclosed blocks, where it is optional). This is a
+ * requirement, otherwise your packed code may be broken.
+ * #########
+ */
+
+/*
+ * These constants must not be deployed. They are used in the development
+ * environment only, for readability and code comprehension.
+ */
+var BASIC_COLOR_RED = 1 ;
+var BASIC_COLOR_BLUE = 2 ;
+var BASIC_COLOR_WHITE = 3 ;
+
+// Create the global "MyObject".
+var MyObject = new Object() ;
+MyObject.CONST = 1 ;
+
+var _Html =
+'<div>\
+	<i>\
+		Some text\
+	</i>\
+</div>' ;
+
+// Get the color name.
+MyObject.GetColorName = function( colorId, upperCase )
+{
+	var name ;
+
+	if ( !colorId )
+		colorId = MyObject.CONST ;
+
+	switch ( colorId )
+	{
+		case BASIC_COLOR_RED :
+			name = 'Red' ;
+
+		case BASIC_COLOR_BLUE :
+			name = 'Blue' ;
+
+		case BASIC_COLOR_WHITE :
+			name = 'White' ;
+
+		default :
+			// The following must strings must be combined.
+			name =
+				'Unknown ' +
+				'color ' +
+				'id' +
+				" (double quotes " + "too)" ;
+	}
+
+	return upperCase ? name.toUpperCase() : name ;
+}
+
+// The following function has not much sense... it is just an example.
+MyObject.GetArray = function( value1, value2, value3, theLastWellDescriptiveArgument )
+{
+	var myArray = new Array() ;
+
+	var A = 'Let\'s see if the name "A" will cause conflict' ;
+
+	// Let's just push the arguments in the array.
+	myArray.push( value1 ) ;
+	myArray.push( value2 ) ;
+	myArray.push( value3 ) ;
+	myArray.push( theLastWellDescriptiveArgument ) ;
+
+	// The following line must not be deployed.
+	MyDebugFunction( myArray ) ;		// @Packager.RemoveLine
+
+	return myArray ;
+}
+
+// @Packager.Remove.Start
+// This function is used during the development. We don't want to deploy it,
+// so we use the @Packager.Remove.(Start/End) instructions.
+function DebugIt( message )
+{
+	alert( message ) ;
+}
+// @Packager.Remove.End
Index: /CKPackager/trunk/_samples/basic/basic_sample_compressed.js
===================================================================
--- /CKPackager/trunk/_samples/basic/basic_sample_compressed.js	(revision 2381)
+++ /CKPackager/trunk/_samples/basic/basic_sample_compressed.js	(revision 2381)
@@ -0,0 +1,5 @@
+/*
+ * This file has been compressed with CKPackager
+ */
+
+var BASIC_COLOR_RED=1,BASIC_COLOR_BLUE=2,BASIC_COLOR_WHITE=3,MyObject={};MyObject.CONST=1;var _Html='<div>\t<i>\t\tSome text\t</i></div>';MyObject.GetColorName=function(f,g){var h;if(!f)f=1;switch(f){case 1:h='Red';case 2:h='Blue';case 3:h='White';default:h='Unknown color id (double quotes too)';}return g?h.toUpperCase():h;};MyObject.GetArray=function(f,g,h,i){var j=[],k='Let\'s see if the name "A" will cause conflict';j.push(f);j.push(g);j.push(h);j.push(i);return j;};
Index: /CKPackager/trunk/_samples/basic/run.bat
===================================================================
--- /CKPackager/trunk/_samples/basic/run.bat	(revision 2381)
+++ /CKPackager/trunk/_samples/basic/run.bat	(revision 2381)
@@ -0,0 +1,13 @@
+:: Copyright (c) 2003-2008, Frederico Caldeira Knabben. All rights reserved.
+:: For licensing, see LICENSE.html or http://ckeditor.com/license
+
+@ECHO OFF
+
+CLS
+ECHO.
+
+:: Show call stack on errors.
+java -jar ../../js.jar -opt -1 ../../ckpackager.js basic.pack
+
+:: Best performance.
+:: java -jar ../../js.jar -opt 1 ../../ckpackager.js basic.pack
Index: /CKPackager/trunk/ckpackager.js
===================================================================
--- /CKPackager/trunk/ckpackager.js	(revision 2381)
+++ /CKPackager/trunk/ckpackager.js	(revision 2381)
@@ -0,0 +1,123 @@
+/*
+Copyright (c) 2003-2008, Frederico Caldeira Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+importPackage( org.mozilla.javascript );
+
+importClass( java.lang.System );
+importClass( java.io.File );
+importClass( java.io.BufferedWriter );
+importClass( java.io.FileWriter );
+
+var CKPACKAGER =
+{
+	dir : (function()
+		{
+			var packagerDir = new File( System.getProperty( 'java.class.path' ) );
+			return packagerDir.getParent();
+		})(),
+
+	getPackPath : function( relativePath )
+	{
+		var file = new File( CKPACKAGER.packDir, relativePath );
+		return file.getAbsolutePath();
+	},
+
+	getPackagerPath : function( relativePath )
+	{
+		var file = new File( CKPACKAGER.dir, relativePath );
+		return file.getAbsolutePath();
+	},
+
+	_loadedCode : {},
+
+	loadCode : function( path )
+	{
+		if ( this._loadedCode[ path ] )
+			return;
+
+		load( CKPACKAGER.getPackagerPath( path ) );
+	},
+
+	tools :
+	{
+		readFile : function( file )
+		{
+			var data = readFile( file );
+
+			// Remove the UTF-8 BOM.
+			return data.replace( /^\xEF\xBB\xBF/, '' );
+		},
+
+		getFileName : function( file )
+		{
+			var file = new File( file );
+			return file.getName();
+		}
+	}
+};
+
+function error( msg )
+{
+	print( msg );
+	print( '' );
+	quit();
+}
+
+if ( arguments[0] == '-dump' )
+{
+	CKPACKAGER.loadCode( 'includes/parser.js' );
+	CKPACKAGER.parser.dumpThree( CKPACKAGER.tools.readFile( arguments[1] ) );
+	quit();
+}
+else if ( arguments[0] == '-compress' )
+{
+	CKPACKAGER.loadCode( 'includes/scriptcompressor.js' );
+
+	var compressed = CKPACKAGER.scriptCompressor.compress( CKPACKAGER.tools.readFile( arguments[1] ) );
+
+	if ( arguments[2] )
+	{
+		var out = new BufferedWriter( new FileWriter( arguments[2] ) );
+		out.write( compressed );
+		out.close();
+	}
+
+	print( compressed );
+	quit();
+}
+else if ( arguments[0] == '-test' )
+{
+	CKPACKAGER.loadCode( 'test/test.js' );
+	quit();
+}
+
+CKPACKAGER.packFile = arguments[0];
+
+if ( !CKPACKAGER.packFile )
+	error( 'Usage:java -jar js.jar ckpackager.js sample.pack' );
+
+CKPACKAGER.packDir = (function()
+{
+	var packFile = new File( CKPACKAGER.packFile );
+
+	if ( !packFile.isFile() )
+		error( 'The file name "' + CKPACKAGER.packFile + '" was not found.' );
+
+	return packFile.getParent() || './';
+})();
+
+CKPACKAGER.loadCode( 'includes/packager.js' );
+
+//for ( var o in CKPACKAGER )
+//	print( o + ': ' + CKPACKAGER[o] );
+
+// print( String( System.getProperties() ).replace( /,/g, '\n') );
+
+(function()
+{
+	var packager = new CKPACKAGER.packager();
+	packager.loadDefinitionFile( CKPACKAGER.packFile );
+	packager.run();
+})();
Index: /CKPackager/trunk/includes/packagefile.js
===================================================================
--- /CKPackager/trunk/includes/packagefile.js	(revision 2381)
+++ /CKPackager/trunk/includes/packagefile.js	(revision 2381)
@@ -0,0 +1,72 @@
+/*
+Copyright (c) 2003-2008, Frederico Caldeira Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+importClass( java.io.BufferedWriter );
+importClass( java.io.FileWriter );
+
+CKPACKAGER.loadCode( 'includes/scriptcompressor.js' );
+
+CKPACKAGER.packageFile = function( outputFile )
+{
+	this.output = outputFile;
+
+	this.header = null;
+	this.noCheck = false;
+	this.constants = null;
+	this.renameGlobals = false;
+	this.compactJavascript = true;
+	this.wrap = false;
+	this.files = [];
+};
+
+CKPACKAGER.packageFile.prototype =
+{
+	createFile : function()
+	{
+		var source = [];
+
+		print( 'Packaging file ' + CKPACKAGER.tools.getFileName( this.output ) + '\n' );
+
+		for ( var i = 0 ; i < this.files.length ; i++ )
+		{
+			var file = this.files[ i ];
+
+			print( '    Adding ' + CKPACKAGER.tools.getFileName( file ) );
+
+			source.push( CKPACKAGER.tools.readFile( file ), '\n' );
+		}
+
+		source = source.join( '' );
+
+		var compressed = this.compactJavascript ?
+			CKPACKAGER.scriptCompressor.compress( source, this.renameGlobals, this.constants, this.noCheck, this.wrap ) :
+			source;
+
+		if ( this.header )
+			compressed = this.header + compressed;
+
+		compressed += '\n';
+
+		try
+		{
+			var file = new File( this.output );
+			file['delete']();
+
+			var out = new BufferedWriter( new FileWriter( this.output ) );
+			out.write( compressed );
+			out.close();
+	    }
+	    catch ( e )
+	    {
+			throw e;
+	    }
+
+		print( '' );
+		print( '    Number of files processed: ' + this.files.length );
+		print( '    Original size............: ' + source.length + ' bytes' );
+		print( '    Output file size.........: ' + compressed.length + ' bytes (' + Math.round( compressed.length / source.length * 100 ) + '% of original)' );
+		print( '' );
+	}
+};
Index: /CKPackager/trunk/includes/packager.js
===================================================================
--- /CKPackager/trunk/includes/packager.js	(revision 2381)
+++ /CKPackager/trunk/includes/packager.js	(revision 2381)
@@ -0,0 +1,103 @@
+/*
+Copyright (c) 2003-2008, Frederico Caldeira Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+CKPACKAGER.loadCode( 'includes/packagefile.js' );
+
+CKPACKAGER.packager = function()
+{
+	this.packageFiles = [];
+};
+
+CKPACKAGER.packager.prototype =
+{
+	loadDefinitionFile : function( filePath )
+	{
+		var file = new File( filePath );
+
+		// Evaluate the package definition, moving its contents to CKPACKAGER.packDefinition.
+		var packCode = 'var pack = { ' + CKPACKAGER.tools.readFile( filePath ) + '\n};';
+
+		var cx = Context.enter(),
+			scope = cx.initStandardObjects();
+
+		cx.evaluateString( scope, packCode, file.getName(), 1, null );
+
+		this.loadDefinition( scope.pack );
+	},
+
+	loadDefinition : function( definitionObject )
+	{
+		var packages = definitionObject.packages;
+
+		if ( packages )
+		{
+			for ( var i = 0 ; i < packages.length ; i++ )
+			{
+				var packDefinition = packages[ i ];
+
+				if ( !packDefinition.output )
+					error( 'The "output" value must be set for all packages in the packager defintion file(' + CKPACKAGER.packFile + ').' );
+
+				var packFile = new CKPACKAGER.packageFile( CKPACKAGER.getPackPath( packDefinition.output ) );
+
+				if ( definitionObject.header )
+					packFile.header = definitionObject.header;
+
+				if ( typeof definitionObject.noCheck != 'undefined' )
+					packFile.noCheck = definitionObject.noCheck;
+
+				if ( definitionObject.constants )
+					packFile.constants = definitionObject.constants;
+
+				if ( typeof packDefinition.renameGlobals != 'undefined' )
+					packFile.renameGlobals = packDefinition.renameGlobals;
+
+				if ( typeof packDefinition.compactJavascript != 'undefined' )
+					packFile.compactJavascript = packDefinition.compactJavascript;
+
+				if ( typeof packDefinition.wrap != 'undefined' )
+					packFile.wrap = packDefinition.wrap;
+
+				var files = packDefinition.files;
+
+				if ( files )
+				{
+					for ( var f = 0 ; f < files.length ; f++ )
+						packFile.files.push( CKPACKAGER.getPackPath( files[ f ] ) );
+				}
+
+				this.packageFiles.push( packFile );
+			}
+		}
+	},
+
+	run : function()
+	{
+		var time = new Date();
+
+		for ( var i = 0 ; i < this.packageFiles.length ; i++ )
+		{
+			this.packageFiles[ i ].createFile();
+		}
+
+		time = ( new Date() ) - time;
+		time = time / 1000;
+
+		switch ( this.packageFiles.length )
+		{
+			case 0 :
+				print( 'No files defined' );
+				break;
+			case 1 :
+				print( 'The generation of the package file has been completed in ' + time + ' seconds.' );
+				break;
+			default :
+				print( 'The generation of ' + this.packageFiles.length + ' files has been completed in ' + time + ' seconds.' );
+				break;
+		}
+
+		print( '' );
+	}
+};
Index: /CKPackager/trunk/includes/parser.js
===================================================================
--- /CKPackager/trunk/includes/parser.js	(revision 2381)
+++ /CKPackager/trunk/includes/parser.js	(revision 2381)
@@ -0,0 +1,121 @@
+/*
+Copyright (c) 2003-2008, Frederico Caldeira Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+load( '../includes/token.js' );
+
+importPackage( org.mozilla.javascript );
+
+importClass( java.io.File );
+importClass( java.io.FileReader );
+
+(function()
+{
+	var indentation,
+		tree;
+
+	var printNode = function( node )
+	{
+		var str,
+			type = node.getType(),
+			currentTree = tree;
+
+		str =
+			node instanceof Node.StringNode ?
+				node.getString()
+			: type == Token.NUMBER ?
+				str = node.getDouble()
+			:
+				'';
+
+		switch ( type )
+		{
+			case Token.FUNCTION :
+
+				var fnIndex = node.getExistingIntProp( Node.FUNCTION_PROP ),
+					fn		= tree.getFunctionNode(fnIndex),
+					args	= [];
+
+				if ( fn.symbolTable != null )
+				{
+					var iter = fn.symbolTable.keySet().iterator();
+					while ( args.length < fn.getParamCount() )
+						args.push( iter.next() );
+				}
+
+				str += '(' + args + ')';
+
+				node = tree = fn;
+				break;
+
+			case Token.REGEXP :
+				str = '/' + tree.getRegexpString( node.getExistingIntProp( Node.REGEXP_PROP ) ) + '/';
+				str += tree.getRegexpFlags( node.getExistingIntProp( Node.REGEXP_PROP ) );
+				break;
+
+			case Token.CASE :
+			case Token.GOTO :
+				str = node.target.getNext();
+				break;
+
+			case Token.LOOP :
+				str = node.target;
+				break;
+
+			case Token.TARGET :
+				str = node.labelId();
+				break;
+		}
+
+		try { str = node.getString(); } catch (e) {}
+
+		print( indentation + node + ': ' + GetTokenName( type ) +
+			' (' + node.getLineno() + ')' +
+			( node instanceof Node.Scope ? ' (scope)' : '' ) +
+			( str !== '' ? ' = ' + str : '' ) );
+
+		indentation += '.';
+
+		node = node.getFirstChild()
+
+		while ( node )
+		{
+			printNode( node );
+			node = node.getNext();
+		}
+
+		if ( type == Token.FUNCTION )
+		{
+			tree = currentTree;
+		}
+
+		// Uncomment to stop on a specific token type.
+		/*
+		if ( type == Token.USE_STACK )
+			quit();
+		*/
+
+		indentation = indentation.substr( 1 );
+	}
+
+	CKPACKAGER.parser =
+	{
+		dumpThree : function( script )
+		{
+			// Setup the compiler environment, error reporter...
+			var compilerEnv = new CompilerEnvirons();
+			var errorReporter = compilerEnv.getErrorReporter();
+
+			// Create an instance of the parser...
+			var parser = new Parser(compilerEnv, errorReporter);
+
+			var scriptOrFnNode = parser.parse(script, null, 1);
+			tree = scriptOrFnNode;
+
+			indentation = '';
+
+			printNode( scriptOrFnNode );
+		}
+	};
+})();
Index: /CKPackager/trunk/includes/scope.js
===================================================================
--- /CKPackager/trunk/includes/scope.js	(revision 2381)
+++ /CKPackager/trunk/includes/scope.js	(revision 2381)
@@ -0,0 +1,151 @@
+/*
+Copyright (c) 2003-2008, Frederico Caldeira Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+(function()
+{
+	var preProcess = function ( scope, node, names )
+	{
+		var child = node.getFirstChild();
+		while( child )
+		{
+			switch ( child.getType() )
+			{
+				case Token.THIS :
+					scope.thisCount++;
+					break;
+
+				case Token.FUNCTION :
+
+					// Functions are considered declared since the very start
+					// of the scope execution. So, we must look for them here.
+					// Unfortunately Symbol.declType is not public in the Rhino
+					// code.
+
+					scope.functionCount++;
+
+					var name = String( child.getString() );
+					if ( name.length > 0 )
+						scope.declaredNames[ name ] = 1;
+					break;
+
+				default:
+					preProcess( scope, child, names );
+			}
+
+			child = child.getNext();
+		}
+
+		return names;
+	};
+
+	CKPACKAGER.scope = function( rhinoNode, parentScope )
+	{
+		this.node = rhinoNode;
+		this.parent = parentScope;
+		this.args = [];
+		this.names = {};
+		this.declaredNames =
+		{
+			'this' : 1
+		};
+		this.thisCount = 0;
+		this.functionCount = 0;
+		this.noRename = false;
+
+		this.newNames = {};
+		this.nameCounter = parentScope ? parentScope.nameCounter : 0;
+
+		if ( rhinoNode.symbolTable != null )
+		{
+			var iter = rhinoNode.symbolTable.keySet().iterator(),
+				paramCount = rhinoNode.getParamCount();
+
+			while ( iter.hasNext() )
+			{
+				var symbol = String( iter.next() );
+
+				if ( this.args.length < paramCount )
+				{
+					this.args.push( symbol );
+					this.declaredNames[ symbol ] = 1;
+				}
+
+				this.names[ symbol ] = getNextName( this );
+			}
+		}
+
+		preProcess( this, rhinoNode );
+	}
+
+	var nameChars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'.split( '' ),
+		nameCharsLength = nameChars.length;
+
+	// Mangles the list, having a different order for each run.
+	/*
+	nameChars.sort( function( a, b )
+		{
+			return Math.random() < 0.5 ? -1 : 1;
+		});
+	*/
+
+	var getNextName = function( scope )
+	{
+		var name;
+
+		do
+		{
+			var number = ++scope.nameCounter;
+
+			name = '';
+
+			while ( true )
+			{
+				var mod = number % nameCharsLength;
+				number = Math.floor( number / nameCharsLength );
+
+				if ( mod == 0 )
+				{
+					name = nameChars[ nameCharsLength - 1 ] + name;
+					number--;
+				}
+				else
+				{
+					name = nameChars[ mod - 1 ] + name;
+				}
+
+				if ( number <= 0 )
+					break;
+			}
+		}
+		while ( !isNaN( name.substr( 0, 1 ) ) )
+
+		return name;
+	};
+
+	CKPACKAGER.scope.prototype.getNewName = function( name, includeNotDeclared, includeNotListed )
+	{
+		if ( !this.noRename )
+		{
+			if ( ( includeNotDeclared || this.declaredNames[ name ] ) && this.names[ name ] )
+				return this.names[ name ];
+			else if ( includeNotListed || name == 'this' )
+				return ( this.declaredNames[ name ] = this.names[ name ] = getNextName( this ) );
+			else if ( this.parent )
+				return this.parent.getNewName( name, true );
+		}
+
+		return name;
+	};
+
+	CKPACKAGER.scope.prototype.declareName = function( name )
+	{
+		this.declaredNames[ name ] = 1;
+	};
+
+	CKPACKAGER.scope.prototype.addRenamedRef = function( name )
+	{
+		return this.names[ name ] = getNextName( this );
+	};
+})();
Index: /CKPackager/trunk/includes/scriptcompressor.js
===================================================================
--- /CKPackager/trunk/includes/scriptcompressor.js	(revision 2381)
+++ /CKPackager/trunk/includes/scriptcompressor.js	(revision 2381)
@@ -0,0 +1,1194 @@
+/*
+Copyright (c) 2003-2008, Frederico Caldeira Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+importPackage( org.mozilla.javascript );
+importPackage( java.util.regex );
+
+importClass( java.io.File );
+importClass( java.io.FileReader );
+
+CKPACKAGER.loadCode( 'includes/scope.js' );
+CKPACKAGER.loadCode( 'includes/token.js' );
+
+(function()
+{
+	var scope,
+		tree,
+		noGlobals,
+		constantList,
+		lastWasVar,
+		ignoreSiblings,
+		isLoop,
+		output,
+		outputSize = 0,
+		maxSize = 2500;
+
+	var lang = {};
+
+	lang[ Token.NOT ] = '!';
+	lang[ Token.BITNOT ] = '~';
+	lang[ Token.POS ] = '+';
+	lang[ Token.NEG ] = '-';
+	lang[ Token.TYPEOF ] = 'typeof ';
+	lang[ Token.MUL ] = '*';
+	lang[ Token.DIV ] = '/';
+	lang[ Token.MOD ] = '%';
+	lang[ Token.ADD ] = '+';
+	lang[ Token.SUB ] = '-';
+	lang[ Token.RSH ] = '>>';
+	lang[ Token.LSH ] = '<<';
+	lang[ Token.URSH ] = '>>>';
+	lang[ Token.LT ] = '<';
+	lang[ Token.LE ] = '<=';
+	lang[ Token.GT ] = '>';
+	lang[ Token.GE ] = '>=';
+	lang[ Token.EQ ] = '==';
+	lang[ Token.NE ] = '!=';
+	lang[ Token.SHEQ ] = '===';
+	lang[ Token.SHNE ] = '!==';
+	lang[ Token.BITAND ] = '&';
+	lang[ Token.BITXOR ] = '^';
+	lang[ Token.BITOR ] = '|';
+	lang[ Token.AND ] = '&&';
+	lang[ Token.OR ] = '||';
+	lang[ Token.COMMA ] = ',';
+	lang[ Token.IN ] = ' in ';
+
+	// From http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Operators:Operator_Precedence
+	var precedence = {};
+	precedence[ Token.DOT ] = 1;
+	precedence[ Token.INC ] = precedence[ Token.DEC ] = 3;
+	precedence[ Token.NOT ] = precedence[ Token.BITNOT ] = precedence[ Token.POS ] = precedence[ Token.NEG ] = precedence[ Token.TYPEOF ] = 4;
+	precedence[ Token.MUL ] = precedence[ Token.DIV ] = precedence[ Token.MOD ] = 5;
+	precedence[ Token.ADD ] = precedence[ Token.SUB ] = 6;
+	precedence[ Token.RSH ] = precedence[ Token.LSH ] = precedence[ Token.URSH ] = 7;
+	precedence[ Token.LT ] = precedence[ Token.LE ] = precedence[ Token.GT ] = precedence[ Token.GE ] = precedence[ Token.INSTANCEOF ] = precedence[ Token.IN ] = 8;
+	precedence[ Token.EQ ] = precedence[ Token.NE ] = precedence[ Token.SHEQ ] = precedence[ Token.SHNE ] = 9;
+	precedence[ Token.BITAND ] = 10;
+	precedence[ Token.BITXOR ] = 11;
+	precedence[ Token.BITOR ] = 12;
+	precedence[ Token.AND ] = 13;
+	precedence[ Token.OR ] = 14;
+	precedence[ Token.HOOK ] = 15;
+	precedence[ Token.SETNAME ] = precedence[ Token.SETPROP ] = precedence[ Token.SETELEM ] = 16;
+	precedence[ Token.COMMA ] = 17;
+	
+	//Other
+	precedence[ Token.FUNCTION ] = 100;
+
+	var noSpaceChars = {' ':1,';':1,',':1,'.':1,'(':1,')':1,'[':1,']':1,'{':1,'}':1,'?':1,':':1,'!':1,'=':1,'>':1,'<':1,'*':1,'/':1,'%':1,'+':1,'-':1,'&':1,'|':1,'^':1};
+	var out = function()
+	{
+		if ( out.checkSpace )
+		{
+			var first = String( arguments[ 0 ] );
+			first = first.substr( 0, 1 );
+
+			if (
+				( first == '+' && out.last == '+' ) ||
+				( first == '-' && out.last == '-' ) ||
+				( out.mayNeedSpace && !noSpaceChars[ first ] && !noSpaceChars[ out.last ] ) )
+			{
+				output.push( ' ' );
+				outputSize++;
+			}
+		}
+
+		var last = String( arguments[ arguments.length - 1 ] );
+		last = out.last = last.substr( last.length - 1 );
+		out.mayNeedSpace = ( last == '+' || last == '-' || !noSpaceChars[ last ] );
+
+		for ( var i = 0 ; i < arguments.length ; i++ )
+		{
+			var str = String( arguments[i] );
+			outputSize += str.length;
+			output.push( str );
+		}
+
+		if ( outputSize > maxSize && last == ';' )
+		{
+			output.push( '\n' );
+			outputSize = 0;
+		}
+	};
+
+	out.mayNeedSpace = false;
+	out.checkSpace = true;
+	out.size = 0;
+	
+	var outString = function( str )
+	{
+		var value = String( str ),
+			singleParts = value.split( "'" ),
+			doubleParts = value.split( '"' );
+
+		value = value.replace( /[\b\t\n\v\f\r\\]/g, function( match )
+			{
+				var chars =
+				{
+					'\b' : '\\b',
+					'\t' : '\\t',
+					'\n' : '\\n',
+					'\v' : '\\v',
+					'\f' : '\\f',
+					'\r' : '\\r',
+					'\\' : '\\\\'
+				};
+
+				return chars[ match ];
+			} );
+
+		if ( doubleParts.length > singleParts.length )
+			out( "'", value.replace( /'/g, "\\'" ), "'" );
+		else if ( singleParts.length > 1 )
+			out( '"', value.replace( /"/g, '\\"' ), '"' );
+		else
+			out( "'", value, "'" );
+	};
+
+	var isReserved = function( word )
+	{
+		return !!isReserved.words[ word ];
+	};
+	// Taken from the ECMA-262.
+	isReserved.words = { 'break':1,'else':1,'new':1,'var':1,'case':1,'finally':1,'return':1,'void':1,'catch':1,'for':1,'switch':1,'while':1,'continue':1,'function':1,'this':1,'with':1,'default':1,'if':1,'throw':1,'delete':1,'in':1,'try':1,'do':1,'instanceof':1,'typeof':1,'abstract':1,'enum':1,'int':1,'short':1,'boolean':1,'export':1,'interface':1,'static':1,'byte':1,'extends':1,'long':1,'super':1,'char':1,'final':1,'native':1,'synchronized':1,'class':1,'float':1,'package':1,'throws':1,'const':1,'goto':1,'private':1,'transient':1,'debugger':1,'implements':1,'protected':1,'volatile':1,'double':1,'import':1,'public':1 };
+
+	var getPropParts = function( propNode, parts )
+	{
+		if ( !parts )
+			parts = [];
+
+		var owner		= propNode.getFirstChild(),
+			property	= propNode.getLastChild();
+		
+		if ( owner )
+		{
+			if ( owner.getType() == Token.GETPROP )
+				getPropParts( owner, parts );
+			else
+				parts.push( owner );
+
+			parts.push( property );
+		}
+		else
+			parts.push( propNode );
+		
+		return parts;
+	};
+
+	var writeNode = function( node, opt )
+	{
+		if ( !node )
+			return;
+
+		var type = node.getType();
+
+		if ( type != Token.VAR )
+			lastWasVar = false;
+
+		switch ( type )
+		{
+			case Token.SCRIPT :
+				scope = new CKPACKAGER.scope( node, scope );
+				scope.noRename = noGlobals;
+
+				tree = node;
+				writeChildren( node );
+				break;
+
+			case Token.NAME :
+			case Token.BINDNAME :
+				var name = node.getString();
+				if ( constantList[ name ] )
+					out( constantList[ name ] );
+				else
+					out( scope.getNewName( name ) );
+				break;
+
+			case Token.VAR :
+				if ( lastWasVar )
+					out( ',' );
+				else
+					out( 'var ' );
+
+				var child = node.getFirstChild();
+				while ( child )
+				{
+					var name = child.getString();
+
+					out( scope.getNewName( name, true ) );
+
+					if ( child.getFirstChild() )
+					{
+						out( '=' );
+						writeChildren( child );
+					}
+
+					scope.declareName( name );
+
+					child = child.getNext();
+
+					if ( child )
+						out( ',' );
+				}
+
+				lastWasVar = ( node.getNext() && node.getNext().getType() == Token.VAR );
+
+				if ( !lastWasVar && ( !opt || !opt.noSemiColon ) )
+					out( ';' );
+
+				break;
+
+			case Token.SETNAME :
+				var name = node.getFirstChild().getString();
+
+				writeNode( node.getFirstChild() );
+
+				var value = node.getLastChild();
+
+				switch ( value.getType() )
+				{
+					case Token.MUL :
+					case Token.DIV :
+					case Token.MOD :
+					case Token.ADD :
+					case Token.SUB :
+					case Token.BITAND :
+					case Token.BITXOR :
+					case Token.BITOR :
+					case Token.LSH :
+					case Token.RSH :
+					case Token.URSH :
+
+						if ( ( value.getFirstChild().getType() == Token.NAME && value.getFirstChild().getString() == name ) )
+						{
+							out( lang[ value.getType() ], '=' );
+							writeNode( value.getLastChild() );
+							break;
+						}
+
+					default :
+						out( '=' );
+						writeNode( value );
+						break;
+				}
+
+				break;
+
+			case Token.NEW :
+				var child = node.getFirstChild(),
+					isArray,
+					isObject;
+
+				if ( child.getType() == Token.NAME )
+				{
+					if ( child.getString() == 'Array' && ( !child.getNext() || child.getNext().getType() != Token.NUMBER || child.getNext().getNext() ) )
+					{
+						out( '[' );
+						isArray = true;
+					}
+					else if ( child.getString() == 'Object' && !child.getNext() )
+					{
+						out( '{' );
+						isObject = true;
+					}
+				}
+
+				if ( !isArray && !isObject )
+				{
+					out( 'new ' );
+					writeNode( child );
+					out( '(' );
+				}
+
+				child = child.getNext();
+
+				while ( child )
+				{
+					if ( !writeNode( child ) )
+						break;
+
+					child = child.getNext();
+
+					if ( child )
+						out( ',' );
+				}
+
+				if ( isArray )
+					out( ']' );
+				else if ( isObject )
+					out( '}' );
+				else
+					out( ')' );
+				break;
+
+			case Token.FUNCTION :
+				var name = node.getString();
+
+				out( 'function' );
+
+				if ( name.length() )
+					out( ' ', scope.getNewName( name, true ) );
+
+				var currentTree = tree,
+					fnIndex = node.getExistingIntProp( Node.FUNCTION_PROP ),
+					fn = tree.getFunctionNode(fnIndex);
+
+				scope = new CKPACKAGER.scope( fn, scope );
+
+				out( '(' );
+
+				for ( var i = 0, len = scope.args.length ; i < len ; i++ )
+				{
+					if ( i > 0 )
+						out( ',' );
+					out( scope.getNewName( scope.args[ i ] ) );
+				}
+
+				out( '){' );
+
+				// Initialize the "this" replacement. Changes here must be
+				// reflected in the Token.THIS case.
+				if ( !scope.functionCount && scope.thisCount > 3 )
+					out( 'var ', scope.getNewName( 'this' ), '=this;' );
+
+				tree = fn;
+				writeNode( fn.getFirstChild(), { isFunction : true } );
+
+				scope = scope.parent;
+				tree = currentTree;
+
+				out( '}' );
+
+				if ( name.length() )
+					out( ';' );
+				break;
+
+			case Token.CALL :
+				var child = node.getFirstChild(),
+					childType = child.getType(),
+					isFunctionCall = ( childType == Token.FUNCTION || childType == Token.SETPROP || childType == Token.SETELEM );
+
+				if ( childType == Token.NAME && child.getString() == 'PACKAGER_RENAME' )
+				{
+					var renamed = child.getNext(),
+						renamedRef = '',
+						parts = getPropParts( renamed );
+
+					for ( var i = 0 ; i < parts.length ; i++ )
+					{
+						if ( i > 0 )
+							renamedRef += '.';
+						renamedRef += parts[ i ].getString();
+					}
+					
+					// print( '[' + renamedRef + ']' );
+					
+					out( 'var ', scope.addRenamedRef( renamedRef ), '=' );
+					writeNode( renamed );
+					
+					scope.declareName( renamedRef );
+					
+					break;
+				}
+
+				if ( isFunctionCall )
+					out( '(' );
+
+				writeNode( child );
+
+				if ( isFunctionCall )
+					out( ')' );
+
+				out( '(' );
+
+				var param = child.getNext();
+				while( param )
+				{
+					if ( !writeNode( param ) )
+						break;
+
+					param = param.getNext();
+
+					if ( param )
+						out( ',' );
+				}
+
+				out( ')' );
+				break;
+
+			case Token.LOCAL_BLOCK :
+				writeChildren( node );
+				break;
+
+			case Token.BLOCK :
+				var child = node.getFirstChild(),
+					isLoop = opt && opt.isLoop,
+					isFunction = opt && opt.isFunction,
+					ignoreChildren = false;
+
+				if ( !child )
+					break;
+
+				if ( child.getType() == Token.IFNE )
+				{
+					writeNode( child );
+					break;
+				}
+				else if ( child.getType() == Token.SWITCH )
+				{
+					out( 'switch(' );
+					writeNode( child.getFirstChild() );
+					out( '){' );
+
+					var caseChild = child.getFirstChild().getNext();
+					while( caseChild )
+					{
+						writeNode( caseChild );
+						caseChild = caseChild.getNext();
+					}
+
+					caseChild = child.getNext().target.getNext();
+					if ( caseChild )
+					{
+						out( 'default:' );
+						writeChildren( caseChild );
+					}
+
+					out( '}' );
+
+					break;
+				}
+				else if ( child.getType() == Token.ENTERWITH )
+				{
+					out( 'with(' );
+					writeNode( child.getFirstChild() );
+					out( '){' );
+					writeChildren( child.getNext() );
+					out( '}' );
+					break;
+				}
+
+				while( child )
+				{
+					if ( child.getType() == Token.CONTINUE )
+					{
+						if ( !isLoop )
+							writeNode( child );
+						ignoreChildren = true;
+					}
+					else if ( child.getType() == Token.RETURN )
+					{
+						if ( !isFunction || child.getFirstChild() )
+							writeNode( child );
+						ignoreChildren = true;
+					}
+
+					// All children are ignored, except functions.
+					if ( !ignoreChildren || child.getType() == Token.FUNCTION )
+					{
+						if ( !writeNode( child ) )
+							break;
+					}
+
+					child = child.getNext();
+				}
+
+				break;
+
+			case Token.CASE :
+				out( 'case' );
+				writeNode( node.getFirstChild() );
+				out( ':' );
+				writeChildren( node.target.getNext() );
+				break;
+
+			case Token.BREAK :
+				out( 'break;' )
+				break;
+
+			case Token.LOOP :
+				var child = node.getFirstChild(),
+					block,
+					isDo = false;
+
+				if ( child.getType() == Token.GOTO )	// while (x) && for (;[x];[x])
+				{
+					// The block is located two nodes after it.
+					block = child.getNext().getNext();
+
+					// The increment expression is two steps from the block, if available.
+					var incrementExpression = block.getNext().getNext();
+
+					var expression = child.target.getNext();
+
+					if ( incrementExpression.getType() == Token.EXPR_VOID )	// for
+					{
+						out( 'for(;' );
+
+						if ( expression.getFirstChild().getType() != Token.TRUE )
+							writeNode( expression, { noSemiColon : true } );
+
+						out( ';' );
+
+						writeNode( incrementExpression, { noSemiColon : true } );
+
+						out( ')' );
+					}
+					else
+					{
+						if ( expression.getFirstChild().getType() == Token.TRUE )
+							out( 'for(;;)' );
+						else
+						{
+							out( 'while(' );
+							writeNode( expression );
+							out( ')' );
+						}
+					}
+				}
+				else if ( child.getType() == Token.TARGET )		// do { ... } while()
+				{
+					isDo = true;
+
+					out( 'do' );
+					block = child.getNext();
+				}
+				else	// for (x;[x];[x]) / for ( x in o )
+				{
+					out( 'for(' );
+
+					var hasName = false;
+
+					if ( child.getType() != Token.ENUM_INIT_KEYS )
+					{
+						writeNode( child, { noSemiColon : true } );
+
+						child = child.getNext();
+						hasName = true;
+					}
+
+					if ( child.getType() == Token.ENUM_INIT_KEYS )
+					{
+						block = child.getNext().getNext().getNext();
+
+						// Gets the BINDNAME token.
+						if ( !hasName )
+							writeNode( block.getFirstChild().getFirstChild().getFirstChild() );
+
+						writeNode( child );
+
+						block = block.getFirstChild().getNext();
+					}
+
+					if ( child.getType() == Token.GOTO )
+					{
+						out( ';' );
+						writeNode( child.target.getNext(), { noSemiColon : true } );
+						out( ';' );
+
+						block = child.getNext().getNext();
+
+						// The increment expression is two steps from the block, if available.
+						var incrementExpression = block.getNext().getNext();
+
+						if ( incrementExpression.getType() == Token.EXPR_VOID )
+						{
+							writeNode( incrementExpression, { noSemiColon : true } );
+						}
+					}
+
+					out( ')' );
+				}
+
+				var hasCurly = ( !block || !block.getFirstChild() || !!block.getFirstChild().getNext() );
+
+				if ( hasCurly )
+					out( '{' );
+
+				writeNode( block, { isLoop : true } );
+
+				if ( hasCurly )
+					out( '}' );
+
+				if ( isDo )
+				{
+					out( 'while(' );
+					writeNode( block.getNext().getNext() );
+					out( ')' );
+				}
+
+				break;
+
+			case Token.ENUM_INIT_KEYS :
+				out( ' in ' );
+				writeNode( node.getFirstChild() );
+				break;
+
+			case Token.EXPR_RESULT :
+			case Token.EXPR_VOID :
+				writeChildren( node );
+				
+				if ( !opt || !opt.noSemiColon )
+					out( ';' );
+
+				break;
+
+			case Token.GETPROP :
+				var child = node.getFirstChild(),
+					name = child.getNext().getString(),
+					finalName = name;
+				
+				// Get all parts that compose this node (part1.part2.partN).
+				var parts = getPropParts( node ),
+					startAt = 0,
+					names = [];
+				
+				// Get all part names form the start.
+				for ( var i = 0 ; i < parts.length ; i++ )
+				{
+					var part = parts[ i ],
+						partType = part.getType();
+					if ( partType == Token.NAME || partType == Token.STRING )
+						names.push( String( part.getString() ) );
+					else
+						break;
+				}
+
+				// Check if the name parts are to be replaced.
+				for ( var i = names.length ; i > 0 ; i-- )
+				{
+					// Build the full name (e.g. Obj.prop1.prop2).
+					var fullName = i == 1 ? names[ 0 ] : names.slice( 0, i ).join( '.' );
+					
+					// If we have a property composed by names only.
+					if ( i == parts.length && typeof constantList[ fullName ] != 'undefined' )
+					{
+						out( constantList[ fullName ] )
+						return true;
+					}
+					
+					var newName = scope.getNewName( fullName );
+						
+					// If a new names is available.
+					if ( newName != fullName )
+					{
+						// Send the new name.
+						out( newName );
+						
+						// Removed the replaced names from the parts list.
+						startAt = i;						
+						break;
+					}
+				}
+				
+				for ( var i = startAt ; i < parts.length ; i++ )
+				{
+					var part = parts[ i ],
+						partType = part.getType(),
+						parenthesis = !!precedence[ partType ];
+
+					if ( i > 0 )
+						out( '.' );
+					
+					if ( partType == Token.STRING )
+						out( part.getString() );
+					else
+					{
+						if ( parenthesis )
+							out( '(' );
+
+						writeNode( part );
+
+						if ( parenthesis )
+							out( ')' );
+					}
+				}
+
+				break;
+
+			case Token.GETELEM :
+			case Token.DELPROP :
+			case Token.SETPROP :
+			case Token.SETELEM :
+			case Token.SETPROP_OP :
+			case Token.SETELEM_OP :
+				var owner = node.getFirstChild(),
+					prop = owner.getNext(),
+					ownerParenthesis = !!precedence[ owner.getType() ];
+
+				if ( type == Token.DELPROP )
+					out( 'delete ' );
+
+				if ( ownerParenthesis )
+					out( '(' );
+
+				writeNode( owner );
+
+				if ( ownerParenthesis )
+					out( ')' );
+
+				if ( prop.getType() == Token.STRING && !isReserved( prop.getString() ) && /^[a-zA-Z$_][\w$_]*$/.test( prop.getString() ) )
+				{
+					out( '.' );
+					out( prop.getString() );
+				}
+				else
+				{
+					out( '[' );
+					writeNode( prop );
+					out( ']' );
+				}
+
+				if ( type == Token.SETPROP || type == Token.SETELEM )
+				{
+					out( '=' );
+					writeNode( node.getLastChild() );
+				}
+
+				if ( type == Token.SETPROP_OP || type == Token.SETELEM_OP )
+				{
+					out( lang[ node.getLastChild().getType() ] );
+					out( '=' );
+					writeChildren( node.getLastChild() );
+				}
+				break;
+
+			case Token.IFNE :
+				out( 'if(' );
+				writeNode( node.getFirstChild() );
+				out( ')' );
+
+				var block = node.getNext(),
+					hasCurly = true;
+
+				hasCurly = ( !block || ( block.getType() == Token.BLOCK && ( !block.getFirstChild() || block.getFirstChild().getNext() ) ) );
+
+				if ( hasCurly )
+					out( '{' );
+
+				writeNode( block );
+
+				if ( hasCurly )
+					out( '}' );
+
+				block = block.getNext();
+				if ( block.getType() == Token.GOTO )
+				{
+					out( 'else' );
+					block = block.getNext().getNext();
+
+					hasCurly = ( !block || ( block.getType() == Token.BLOCK && ( !block.getFirstChild() || block.getFirstChild().getType() != Token.IFNE && block.getFirstChild().getNext() ) ) );
+
+					if ( hasCurly )
+						out( '{' );
+
+					writeNode( block );
+
+					if ( hasCurly )
+						out( '}' );
+				}
+
+				break;
+
+			case Token.IFEQ :
+				writeNode( node.getFirstChild() );
+				break;
+
+			case Token.STRING :
+				outString( node.getString() );
+				break;
+
+			case Token.NUMBER :
+				out( node.getDouble() );
+				break;
+
+			case Token.TRUE :
+				out( 'true' );
+				break;
+
+			case Token.FALSE :
+				out( 'false' );
+				break;
+
+			case Token.ARRAYLIT :
+				out( '[' );
+				var child = node.getFirstChild();
+				while( child )
+				{
+					if ( !writeNode( child ) )
+						break;
+
+					child = child.getNext();
+
+					if ( child )
+						out( ',' );
+				}
+				out( ']' );
+				break;
+
+			case Token.OBJECTLIT :
+				out( '{' );
+
+				var ids = node.getProp(Node.OBJECT_IDS_PROP),
+					counter = 0;
+
+				var child = node.getFirstChild();
+				while( child )
+				{
+					var id = String( ids[ counter++ ] );
+
+					if ( isReserved( id ) || !/^(?:(?:[a-zA-Z$_][\w$_]*)|(?:\d+))$/.test( id ) )
+						outString( id );
+					else
+						out( id );
+
+					out( ':' );
+					if ( !writeNode( child ) )
+						break;
+
+					child = child.getNext();
+
+					if ( child )
+						out( ',' );
+				}
+
+				out( '}' );
+				break;
+
+			case Token.THIS :
+				// Replace "this" with a shorter name. Changes here must be
+				// reflected in the Token.FUNCTION case, which initialized the
+				// replacement variable.
+				if ( !scope.functionCount && scope.thisCount > 3 )
+					out( scope.getNewName( 'this' ) );
+				else
+					out( 'this' );
+				break;
+
+			case Token.NULL :
+				out( 'null' );
+				break;
+
+			case Token.CONTINUE :
+				out ( 'continue', ';' );
+				break;
+
+			case Token.RETURN :
+				var value = node.getFirstChild();
+
+				out( 'return' );
+
+				if ( value )
+					writeNode( value );
+
+				out( ';' );
+
+				break;
+
+			case Token.HOOK :
+				writeNode( node = node.getFirstChild() );
+				out( '?' );
+				writeNode( node = node.getNext() );
+				out( ':' );
+				writeNode( node.getNext() );
+				break;
+
+			case Token.REGEXP :
+				out( '/',
+					tree.getRegexpString( node.getExistingIntProp( Node.REGEXP_PROP ) ),
+					'/',
+					tree.getRegexpFlags( node.getExistingIntProp( Node.REGEXP_PROP ) ) );
+
+				break;
+
+			case Token.TRY :
+				// Get the "try" body.
+				var child = node.getFirstChild(),
+					finallyNode;
+
+				out( 'try{' );
+				writeNode( child );
+				out( '}' );
+
+				child = child.getNext();
+
+				// If a GOTO node is following it, then we have a "catch" block.
+				if ( child.getType() == Token.GOTO )
+				{
+					// The catch definition is 2 steps later (LOCAL_BLOCK node).
+					child = child.getNext().getNext();
+
+					var catchScopeVar = child.getFirstChild().getFirstChild().getString(),
+						overrideLocal = !!scope.names[ catchScopeVar ];
+
+					if ( !overrideLocal )
+						scope.names[ catchScopeVar ] = scope.declaredNames[ catchScopeVar ] = scope.getNewName( catchScopeVar, true, true );
+
+					out( 'catch(' );
+					// Send the catch scope (CATCH_SCOPE).
+					writeNode( child.getFirstChild().getFirstChild() );
+					out( '){' );
+
+					// Because of the scope, the catch block is in a much deeper node.
+					writeNode( child.getFirstChild().getNext().getFirstChild().getNext().getFirstChild() );
+
+					if ( !overrideLocal )
+						scope.names[ catchScopeVar ] = scope.declaredNames[ catchScopeVar ] = null;
+
+					out( '}' );
+				}
+
+				while ( child )
+				{
+					if ( child.getType() == Token.FINALLY )
+					{
+						out( 'finally{' );
+						writeNode( child.getFirstChild() );
+						out( '}' );
+						break;
+					}
+					child = child.getNext();
+				}
+
+				break;
+
+			case Token.THROW :
+				out( 'throw ' );
+				writeNode( node.getFirstChild() );
+				out( ';' );
+				break;
+
+			case Token.VOID :
+				out( 'void(' );
+				writeChildren( node );
+				out( ')' );
+				break;
+
+			case Token.INSTANCEOF :
+				writeNode( node.getFirstChild() );
+				out( ' instanceof ' );
+				writeNode( node.getLastChild() );
+				break;
+
+			case Token.TYPEOFNAME :
+				out( 'typeof ', scope.getNewName( node.getString() ) );
+				break;
+
+			case Token.TYPEOF :
+			case Token.NOT :
+			case Token.BITNOT :
+			case Token.POS :
+			case Token.NEG :
+				var child = node.getFirstChild();
+				var parenthesis = ( precedence[ type ] < ( precedence[ child.getType() ] || 0 ) );
+
+				out( lang[ type ] );
+
+				if ( parenthesis )
+					out( '(' );
+
+				writeNode( child );
+
+				if ( parenthesis )
+					out( ')' );
+
+				break;
+
+			case Token.MUL :
+			case Token.DIV :
+			case Token.MOD :
+			case Token.ADD :
+			case Token.SUB :
+			case Token.RSH :
+			case Token.LSH :
+			case Token.URSH :
+			case Token.LT :
+			case Token.LE :
+			case Token.GT :
+			case Token.GE :
+			case Token.EQ :
+			case Token.NE :
+			case Token.SHEQ :
+			case Token.SHNE :
+			case Token.BITAND :
+			case Token.BITXOR :
+			case Token.BITOR :
+			case Token.AND :
+			case Token.OR :
+			case Token.COMMA :
+			case Token.IN :
+				var left = node.getFirstChild(),
+					right = node.getLastChild(),
+					parenthesis;
+
+				// Check the operator precedence, to properly isolate things on
+				// parenthesis.
+				parenthesis = ( precedence[ type ] < ( precedence[ left.getType() ] || 0 ) );
+
+				if ( parenthesis )
+					out( '(' );
+
+				// The left side.
+				writeNode( left );
+
+				if ( parenthesis )
+					out( ')' );
+
+				// The operator.
+				out( lang[ type ] );
+
+				// The right side.
+				parenthesis = ( precedence[ type ] < ( precedence[ right.getType() ] || 0 ) );
+
+				if ( parenthesis )
+					out( '(' );
+
+				writeNode( right );
+
+				if ( parenthesis )
+					out( ')' );
+
+				break;
+
+			case Token.INC :
+			case Token.DEC :
+				var post = ( node.getExistingIntProp(Node.INCRDECR_PROP) & Node.POST_FLAG ) != 0,
+					str = type == Token.INC ? '++' : '--';
+
+				if ( !post )
+					out( str );
+
+				out.checkSpace = false;
+
+				writeNode( node.getFirstChild() );
+
+				if ( post )
+					out( str );
+
+				out.checkSpace = true;
+				break;
+
+			case Token.GOTO:
+			case Token.EMPTY:
+			case Token.LEAVEWITH:		// TRY
+			case Token.USE_STACK:		// SETPROP_OP
+				break;
+
+			default :
+				print( 'WARNING: Unknown token ' + GetTokenName( type ) );
+				break;
+		}
+
+		return true;
+	};
+
+	var writeChildren = function( node )
+	{
+		node = node.getFirstChild()
+
+		while ( node )
+		{
+			if ( !writeNode( node ) )
+				break;
+
+			node = node.getNext();
+		}
+	};
+
+	var regexLib =
+	{
+		packagerRemove : Pattern.compile( '(?m-s:^.*?@Packager\\.Remove\\.Start).*?(?m-s:@Packager\\.Remove\\.End.*?$)', Pattern.DOTALL ),
+		packagerRemoveLine : Pattern.compile( '^.*@Packager\\.RemoveLine.*$', Pattern.MULTILINE ),
+		packagerRename : Pattern.compile( '^.*PACKAGER_RENAME\\(\\s*([^\\s]+).*$', Pattern.MULTILINE )
+	};
+
+	var preProcess = function( script )
+	{
+		// Protect IE conditional comments. We are doing it in a way that works
+		// for CKEditor, but this is not a generic solution.
+		script = script.replace( /\/\*@([\s\S]+?)@\*\/(?:)/g, function( match, contents )
+			{
+				return 'CKPACKAGER_COND_COMMENT("' + encodeURIComponent( contents ) + '")||'
+			});
+
+		// The Java regex here is much faster.
+		script = String( regexLib.packagerRemove.matcher( script ).replaceAll( '' ) );
+//		script = script.replace( /[^\r\n]*@Packager\.Remove\.Start[\s\S]*?@Packager\.Remove\.End[^\r\n]*/g, '' );
+
+		// The Java regex makes no much difference here instead, but for
+		// consistense let's use it again.
+		script = String( regexLib.packagerRemoveLine.matcher( script ).replaceAll( '' ) );
+//		script = script.replace( /^.*@Packager\.RemoveLine.*/gm, '' );
+
+		script = String( regexLib.packagerRename.matcher( script ).replaceAll( 'PACKAGER_RENAME($1);' ) );
+
+		return script;
+	};
+
+	var postProcess = function( script )
+	{
+		script = script.replace( /CKPACKAGER_COND_COMMENT\(["']([\s\S]+?)["']\)\|\|/g, function( match, contents )
+			{
+				return '/*@' + decodeURIComponent( contents ) + '@*/'
+			});
+
+		return script;
+	};
+
+	CKPACKAGER.scriptCompressor =
+	{
+		compress : function( script, renameGlobals, constants, noCheck, wrap )
+		{
+			script = preProcess( script );
+
+			// Reset.
+			scope = null;
+			tree = null;
+			lastWasVar = false;
+			ignoreSiblings = false;
+			isLoop = false;
+			
+			if ( wrap )
+				script = '(function(){' + script + '})();';
+
+			var compilerEnv = new CompilerEnvirons(),
+				errorReporter = compilerEnv.getErrorReporter(),
+				parser = new Parser(compilerEnv, errorReporter),
+				scriptNode = parser.parse( script, null, 1 );
+
+			noGlobals = !wrap && !renameGlobals;
+			constantList = constants || {};
+
+			// Reset the output.
+			output = [];
+			outputSize = 0;
+
+			// Start writting the "script" node.
+			writeNode( scriptNode );
+
+			var compressed = output.join( '' );
+
+			compressed = postProcess( compressed );
+
+			/*
+			print( '' );
+			print( compressed );
+			*/
+
+			// Try to parse the compressed results. If the resulting script is
+			// not valid, an error will be thrown here.
+
+			if ( !noCheck )
+			{
+				print( '' );
+				print( '    Checking compressed code...' );
+				parser.parse( compressed/*.replace( /;/g, ';\n' )*/, null, 1 );
+			}
+
+			return compressed;
+		}
+	}
+})();
Index: /CKPackager/trunk/includes/token.js
===================================================================
--- /CKPackager/trunk/includes/token.js	(revision 2381)
+++ /CKPackager/trunk/includes/token.js	(revision 2381)
@@ -0,0 +1,264 @@
+/*
+Copyright (c) 2003-2008, Frederico Caldeira Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+function GetTokenName( token )
+{
+    switch ( token )
+    {
+      case Token.ERROR:           return "ERROR";
+      case Token.EOF:             return "EOF";
+      case Token.EOL:             return "EOL";
+      case Token.ENTERWITH:       return "ENTERWITH";
+      case Token.LEAVEWITH:       return "LEAVEWITH";
+      case Token.RETURN:          return "RETURN";
+      case Token.GOTO:            return "GOTO";
+      case Token.IFEQ:            return "IFEQ";
+      case Token.IFNE:            return "IFNE";
+      case Token.SETNAME:         return "SETNAME";
+      case Token.BITOR:           return "BITOR";
+      case Token.BITXOR:          return "BITXOR";
+      case Token.BITAND:          return "BITAND";
+      case Token.EQ:              return "EQ";
+      case Token.NE:              return "NE";
+      case Token.LT:              return "LT";
+      case Token.LE:              return "LE";
+      case Token.GT:              return "GT";
+      case Token.GE:              return "GE";
+      case Token.LSH:             return "LSH";
+      case Token.RSH:             return "RSH";
+      case Token.URSH:            return "URSH";
+      case Token.ADD:             return "ADD";
+      case Token.SUB:             return "SUB";
+      case Token.MUL:             return "MUL";
+      case Token.DIV:             return "DIV";
+      case Token.MOD:             return "MOD";
+      case Token.NOT:             return "NOT";
+      case Token.BITNOT:          return "BITNOT";
+      case Token.POS:             return "POS";
+      case Token.NEG:             return "NEG";
+      case Token.NEW:             return "NEW";
+      case Token.DELPROP:         return "DELPROP";
+      case Token.TYPEOF:          return "TYPEOF";
+      case Token.GETPROP:         return "GETPROP";
+      case Token.GETPROPNOWARN:   return "GETPROPNOWARN";
+      case Token.SETPROP:         return "SETPROP";
+      case Token.GETELEM:         return "GETELEM";
+      case Token.SETELEM:         return "SETELEM";
+      case Token.CALL:            return "CALL";
+      case Token.NAME:            return "NAME";
+      case Token.NUMBER:          return "NUMBER";
+      case Token.STRING:          return "STRING";
+      case Token.NULL:            return "NULL";
+      case Token.THIS:            return "THIS";
+      case Token.FALSE:           return "FALSE";
+      case Token.TRUE:            return "TRUE";
+      case Token.SHEQ:            return "SHEQ";
+      case Token.SHNE:            return "SHNE";
+      case Token.REGEXP:          return "REGEXP";
+      case Token.BINDNAME:        return "BINDNAME";
+      case Token.THROW:           return "THROW";
+      case Token.RETHROW:         return "RETHROW";
+      case Token.IN:              return "IN";
+      case Token.INSTANCEOF:      return "INSTANCEOF";
+      case Token.LOCAL_LOAD:      return "LOCAL_LOAD";
+      case Token.GETVAR:          return "GETVAR";
+      case Token.SETVAR:          return "SETVAR";
+      case Token.CATCH_SCOPE:     return "CATCH_SCOPE";
+      case Token.ENUM_INIT_KEYS:  return "ENUM_INIT_KEYS";
+      case Token.ENUM_INIT_VALUES:return "ENUM_INIT_VALUES";
+      case Token.ENUM_INIT_ARRAY: return "ENUM_INIT_ARRAY";
+      case Token.ENUM_NEXT:       return "ENUM_NEXT";
+      case Token.ENUM_ID:         return "ENUM_ID";
+      case Token.THISFN:          return "THISFN";
+      case Token.RETURN_RESULT:   return "RETURN_RESULT";
+      case Token.ARRAYLIT:        return "ARRAYLIT";
+      case Token.OBJECTLIT:       return "OBJECTLIT";
+      case Token.GET_REF:         return "GET_REF";
+      case Token.SET_REF:         return "SET_REF";
+      case Token.DEL_REF:         return "DEL_REF";
+      case Token.REF_CALL:        return "REF_CALL";
+      case Token.REF_SPECIAL:     return "REF_SPECIAL";
+      case Token.DEFAULTNAMESPACE:return "DEFAULTNAMESPACE";
+      case Token.ESCXMLTEXT:      return "ESCXMLTEXT";
+      case Token.ESCXMLATTR:      return "ESCXMLATTR";
+      case Token.REF_MEMBER:      return "REF_MEMBER";
+      case Token.REF_NS_MEMBER:   return "REF_NS_MEMBER";
+      case Token.REF_NAME:        return "REF_NAME";
+      case Token.REF_NS_NAME:     return "REF_NS_NAME";
+      case Token.TRY:             return "TRY";
+      case Token.SEMI:            return "SEMI";
+      case Token.LB:              return "LB";
+      case Token.RB:              return "RB";
+      case Token.LC:              return "LC";
+      case Token.RC:              return "RC";
+      case Token.LP:              return "LP";
+      case Token.RP:              return "RP";
+      case Token.COMMA:           return "COMMA";
+      case Token.ASSIGN:          return "ASSIGN";
+      case Token.ASSIGN_BITOR:    return "ASSIGN_BITOR";
+      case Token.ASSIGN_BITXOR:   return "ASSIGN_BITXOR";
+      case Token.ASSIGN_BITAND:   return "ASSIGN_BITAND";
+      case Token.ASSIGN_LSH:      return "ASSIGN_LSH";
+      case Token.ASSIGN_RSH:      return "ASSIGN_RSH";
+      case Token.ASSIGN_URSH:     return "ASSIGN_URSH";
+      case Token.ASSIGN_ADD:      return "ASSIGN_ADD";
+      case Token.ASSIGN_SUB:      return "ASSIGN_SUB";
+      case Token.ASSIGN_MUL:      return "ASSIGN_MUL";
+      case Token.ASSIGN_DIV:      return "ASSIGN_DIV";
+      case Token.ASSIGN_MOD:      return "ASSIGN_MOD";
+      case Token.HOOK:            return "HOOK";
+      case Token.COLON:           return "COLON";
+      case Token.OR:              return "OR";
+      case Token.AND:             return "AND";
+      case Token.INC:             return "INC";
+      case Token.DEC:             return "DEC";
+      case Token.DOT:             return "DOT";
+      case Token.FUNCTION:        return "FUNCTION";
+      case Token.EXPORT:          return "EXPORT";
+      case Token.IMPORT:          return "IMPORT";
+      case Token.IF:              return "IF";
+      case Token.ELSE:            return "ELSE";
+      case Token.SWITCH:          return "SWITCH";
+      case Token.CASE:            return "CASE";
+      case Token.DEFAULT:         return "DEFAULT";
+      case Token.WHILE:           return "WHILE";
+      case Token.DO:              return "DO";
+      case Token.FOR:             return "FOR";
+      case Token.BREAK:           return "BREAK";
+      case Token.CONTINUE:        return "CONTINUE";
+      case Token.VAR:             return "VAR";
+      case Token.WITH:            return "WITH";
+      case Token.CATCH:           return "CATCH";
+      case Token.FINALLY:         return "FINALLY";
+      case Token.VOID:            return "VOID";
+      case Token.RESERVED:        return "RESERVED";
+      case Token.EMPTY:           return "EMPTY";
+      case Token.BLOCK:           return "BLOCK";
+      case Token.LABEL:           return "LABEL";
+      case Token.TARGET:          return "TARGET";
+      case Token.LOOP:            return "LOOP";
+      case Token.EXPR_VOID:       return "EXPR_VOID";
+      case Token.EXPR_RESULT:     return "EXPR_RESULT";
+      case Token.JSR:             return "JSR";
+      case Token.SCRIPT:          return "SCRIPT";
+      case Token.TYPEOFNAME:      return "TYPEOFNAME";
+      case Token.USE_STACK:       return "USE_STACK";
+      case Token.SETPROP_OP:      return "SETPROP_OP";
+      case Token.SETELEM_OP:      return "SETELEM_OP";
+      case Token.LOCAL_BLOCK:     return "LOCAL_BLOCK";
+      case Token.SET_REF_OP:      return "SET_REF_OP";
+      case Token.DOTDOT:          return "DOTDOT";
+      case Token.COLONCOLON:      return "COLONCOLON";
+      case Token.XML:             return "XML";
+      case Token.DOTQUERY:        return "DOTQUERY";
+      case Token.XMLATTR:         return "XMLATTR";
+      case Token.XMLEND:          return "XMLEND";
+      case Token.TO_OBJECT:       return "TO_OBJECT";
+      case Token.TO_DOUBLE:       return "TO_DOUBLE";
+      case Token.GET:             return "GET";
+      case Token.SET:             return "SET";
+      case Token.LET:             return "LET";
+      case Token.YIELD:           return "YIELD";
+      case Token.CONST:           return "CONST";
+      case Token.SETCONST:        return "SETCONST";
+      case Token.ARRAYCOMP:       return "ARRAYCOMP";
+      case Token.WITHEXPR:        return "WITHEXPR";
+      case Token.LETEXPR:         return "LETEXPR";
+      case Token.DEBUGGER:        return "DEBUGGER";
+    }
+
+    return '??? ' + token;
+}
+
+/*
+	The following tokens are not managed by the compressor.
+
+          case ERROR:           return "ERROR";
+          case EOF:             return "EOF";
+          case EOL:             return "EOL";
+          case GETPROPNOWARN:   return "GETPROPNOWARN";
+          case RETHROW:         return "RETHROW";
+          case IN:              return "IN";
+          case INSTANCEOF:      return "INSTANCEOF";
+          case LOCAL_LOAD:      return "LOCAL_LOAD";
+          case GETVAR:          return "GETVAR";
+          case SETVAR:          return "SETVAR";
+          case ENUM_INIT_KEYS:  return "ENUM_INIT_KEYS";
+          case ENUM_INIT_VALUES:return "ENUM_INIT_VALUES";
+          case ENUM_INIT_ARRAY: return "ENUM_INIT_ARRAY";
+          case ENUM_NEXT:       return "ENUM_NEXT";
+          case ENUM_ID:         return "ENUM_ID";
+          case THISFN:          return "THISFN";
+          case RETURN_RESULT:   return "RETURN_RESULT";
+          case GET_REF:         return "GET_REF";
+          case SET_REF:         return "SET_REF";
+          case DEL_REF:         return "DEL_REF";
+          case REF_CALL:        return "REF_CALL";
+          case REF_SPECIAL:     return "REF_SPECIAL";
+          case DEFAULTNAMESPACE:return "DEFAULTNAMESPACE";
+          case ESCXMLTEXT:      return "ESCXMLTEXT";
+          case ESCXMLATTR:      return "ESCXMLATTR";
+          case REF_MEMBER:      return "REF_MEMBER";
+          case REF_NS_MEMBER:   return "REF_NS_MEMBER";
+          case REF_NAME:        return "REF_NAME";
+          case REF_NS_NAME:     return "REF_NS_NAME";
+          case SEMI:            return "SEMI";
+          case LB:              return "LB";
+          case RB:              return "RB";
+          case LC:              return "LC";
+          case RC:              return "RC";
+          case LP:              return "LP";
+          case RP:              return "RP";
+          case ASSIGN:          return "ASSIGN";
+          case ASSIGN_BITOR:    return "ASSIGN_BITOR";
+          case ASSIGN_BITXOR:   return "ASSIGN_BITXOR";
+          case ASSIGN_BITAND:   return "ASSIGN_BITAND";
+          case ASSIGN_LSH:      return "ASSIGN_LSH";
+          case ASSIGN_RSH:      return "ASSIGN_RSH";
+          case ASSIGN_URSH:     return "ASSIGN_URSH";
+          case ASSIGN_ADD:      return "ASSIGN_ADD";
+          case ASSIGN_SUB:      return "ASSIGN_SUB";
+          case ASSIGN_MUL:      return "ASSIGN_MUL";
+          case ASSIGN_DIV:      return "ASSIGN_DIV";
+          case ASSIGN_MOD:      return "ASSIGN_MOD";
+          case COLON:           return "COLON";
+          case DOT:             return "DOT";
+          case EXPORT:          return "EXPORT";
+          case IMPORT:          return "IMPORT";
+          case IF:              return "IF";
+          case ELSE:            return "ELSE";
+          case DEFAULT:         return "DEFAULT";
+          case WHILE:           return "WHILE";
+          case DO:              return "DO";
+          case FOR:             return "FOR";
+          case WITH:            return "WITH";
+          case RESERVED:        return "RESERVED";
+          case EMPTY:           return "EMPTY";
+          case LABEL:           return "LABEL";
+          case JSR:             return "JSR";
+          case USE_STACK:       return "USE_STACK";
+          case SETPROP_OP:      return "SETPROP_OP";
+          case SETELEM_OP:      return "SETELEM_OP";
+          case LOCAL_BLOCK:     return "LOCAL_BLOCK";
+          case SET_REF_OP:      return "SET_REF_OP";
+          case DOTDOT:          return "DOTDOT";
+          case COLONCOLON:      return "COLONCOLON";
+          case XML:             return "XML";
+          case DOTQUERY:        return "DOTQUERY";
+          case XMLATTR:         return "XMLATTR";
+          case XMLEND:          return "XMLEND";
+          case TO_OBJECT:       return "TO_OBJECT";
+          case TO_DOUBLE:       return "TO_DOUBLE";
+          case GET:             return "GET";
+          case SET:             return "SET";
+          case LET:             return "LET";
+          case YIELD:           return "YIELD";
+          case CONST:           return "CONST";
+          case SETCONST:        return "SETCONST";
+          case ARRAYCOMP:       return "ARRAYCOMP";
+          case WITHEXPR:        return "WITHEXPR";
+          case LETEXPR:         return "LETEXPR";
+          case DEBUGGER:        return "DEBUGGER";
+*/
Index: /CKPackager/trunk/test/test.bat
===================================================================
--- /CKPackager/trunk/test/test.bat	(revision 2381)
+++ /CKPackager/trunk/test/test.bat	(revision 2381)
@@ -0,0 +1,8 @@
+:: Copyright (c) 2003-2008, Frederico Caldeira Knabben. All rights reserved.
+:: For licensing, see LICENSE.html or http://ckeditor.com/license
+
+@ECHO OFF
+CLS
+ECHO.
+
+java -jar ../js.jar -opt -1 ../ckpackager.js -test
Index: /CKPackager/trunk/test/test.js
===================================================================
--- /CKPackager/trunk/test/test.js	(revision 2381)
+++ /CKPackager/trunk/test/test.js	(revision 2381)
@@ -0,0 +1,323 @@
+/*
+Copyright (c) 2003-2008, Frederico Caldeira Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+CKPACKAGER.loadCode( 'includes/scriptcompressor.js' );
+
+(function()
+{
+	// These are tests automatically generated later in this file. The following array contain the list of tests to be executed.
+	var autoTests =
+	[
+		[	"var a=1;" ],
+
+		[	"var a=1;var b=2;",
+			"var a=1,b=2;" ],
+
+		[	"var var1 = var1, var2 = var1;",
+			"var a=var1,b=a;" ],
+
+		[	"function Test( param ) { var myVar = 1; return myVar + param; }; Test( 'Sample' );",
+			"function a(b){var c=1;return c+b;};a('Sample');" ],
+
+		[	"var result = 6 * 10 / 3 + 4;",
+			"var a=24;" ],
+
+		[	"var sum = 1 + 2 + Math['P' + String('I')] - Math.E;",
+			"var a=3+Math['P'+String('I')]-Math.E;" ],
+
+		[	"var sum = ( a + b ) - ( c * ( d - e ) );",
+			"var a=a+b-c*(d-e);" ],
+
+		[	"var str = '\"Tiger\", \"Lion\" ' + \"& 'Cat'\";",
+			"var a='\"Tiger\", \"Lion\" & \\'Cat\\'';" ],
+
+		[	"var str = \"'Tiger', 'Lion' \" + '& \"Cat\"';",
+			"var a=\"'Tiger', 'Lion' & \\\"Cat\\\"\";" ],
+
+		[	"var funs = fun() + fun1( a ) + fun2( a + b, c );",
+			"var a=fun()+fun1(a)+fun2(a+b,c);" ],
+
+		[	"var a,b,c;if(a)go();" ],
+
+		[	"if(a){go1();go2();}" ],
+
+		[	"if(a){go();}",
+			"if(a)go();" ],
+
+		[	"if((a=1))go();",
+			"if(a=1)go();" ],
+
+		[	"if(a){if(b)go();}",
+			"if(a)if(b)go();" ],
+
+		[	"while(a=1){go();break;}" ],
+
+		[	"while(a=1)go();" ],
+
+		[	"while(a=1){go();}",
+			"while(a=1)go();" ],
+
+		[	"while(a=1){go1();continue;go2();}",
+			"while(a=1){go1();}" ],
+
+		[	"while(a=1){go1();continue;go2();function go1(){go();};}",
+			"while(a=1){a();function a(){go();};}" ],
+
+		[	"do{go1();go2();}while(e)" ],
+
+		[	"do{go();}while(e)",
+			"do go();while(e)" ],
+
+		[	"for(var i=0,len=ar.length;i<len;i++){go1();go2();}",
+			"for(var a=0,b=ar.length;a<b;a++){go1();go2();}" ],
+
+		[	"for(var i=0,len=ar.length;i<len;i++){go();}",
+			"for(var a=0,b=ar.length;a<b;a++)go();" ],
+
+		[	"for(var o in obj.prop){go1();go2();}",
+			"for(var a in obj.prop){go1();go2();}" ],
+
+		[	"for(var o in obj.prop){go()}",
+			"for(var a in obj.prop)go();" ],
+
+		[	"for(o in obj.prop)go();" ],
+
+		[	"for(;;i++){}" ],
+
+		[	"for(;;){}" ],
+
+		[	"while(true){go();}",
+			"for(;;)go();" ],
+
+		[	"for(;a;){}",
+			"while(a){}" ],
+
+		[	"for(;q;++q){}" ],
+
+		[	"for(var a=b.length-1;a>=0;a--){}" ],
+
+		[	"if(true){go();}",
+			"go();" ],
+
+		[	"if(c==false)go();" ],
+
+		[	"if(c===true)go();" ],
+
+		[	"if(e)go1();else go2();" ],
+
+		[	"a&b;a&&b;" ],
+
+		[	"a+=10;a&=10;" ],
+
+		[	"a=b-14;a=b+1;" ],
+
+		[	"a>>b;a<<b;a>>>b;" ],
+
+		[	"a=a+2;b=b+2;c=c/3;d=d*4;",
+			"a+=2;b+=2;c/=3;d*=4;" ],
+
+		[	"typeof v=='string';" ],
+
+		[	"delete a.b.c;" ],
+
+		[	"new OBJ.clazz('Test',15);" ],
+
+		[	"new clazz();" ],
+
+		[	"var a=new Array();",
+			"var a=[];" ],
+
+		[	"var a=new Array(2);" ],
+
+		[	"var a=new Array(2,'fred');",
+			"var a=[2,'fred'];" ],
+
+		[	"var a=new Array(b);",
+			"var a=[b];" ],
+
+		[	"var a=new Object();",
+			"var a={};" ],
+
+		[	"var a=new Object(2);" ],
+
+		[	"if(a)b();else if(c)d();else e();" ],
+
+		[	"A.B.C=3;" ],
+
+		[	"A.B['C']=3;",
+			"A.B.C=3;" ],
+
+		[	"A.B['C'+a]=3;" ],
+
+		[	"var o={a:{b:function(){o;}}};",
+			"var a={a:{b:function(){a;}}};" ],
+
+		[	"var a=[1,2,'Fred'];" ],
+
+		[	"function(A,B,C){var D=A+B,E=C+1;return D+E;}",
+			"function(a,b,c){var d=a+b,e=c+1;return d+e;}" ],
+
+		[	"function(){return;go();}",
+			"function(){}" ],
+
+		[	"function(){go();return;}",
+			"function(){go();}" ],
+
+		[	"function(){function A(B,C){var D=B+C;return D;};}",
+			"function(){function a(b,c){var d=b+c;return d;};}" ],
+
+		[	"function(){}" ],
+
+		[	"switch(A){case 'A':go1();break;case 'B':go2();default:go3();}" ],
+
+		[	"var a,x,y,r=10;with(Math){a=PI*r*r;x=r*cos(PI);y=r*sin(E/2);}",
+			"var a,b,c,d=10;with(Math){a=PI*d*d;b=d*cos(PI);c=d*sin(E/2);}" ],
+
+		[	"(function(A){go(A);})('Test');",
+			"(function(a){go(a);})('Test');" ],
+
+		[	"x=a?b:c;" ],
+
+		[	"a=++c+d-- - --d;" ],
+
+		[	"a=/AA\s*/gi;" ],
+
+		[	"is=/AA\s*/gi.test('Test');" ],
+
+		[	"s='Test1 ' +\n'& \\\nTest2';",
+			"s='Test1 & Test2';" ],
+
+		[	"x=null;" ],
+
+		[	"try{go();}catch(e){throw 'Test';}",
+			"try{go();}catch(a){throw 'Test';}" ],
+
+		[	"try{go();}finally{go2();}" ],
+
+		[	"try{go();}catch(e){throw e;}finally{go2();}",
+			"try{go();}catch(a){throw a;}finally{go2();}" ],
+
+		[	"a=-c;" ],
+
+		[	"b=+c;" ],
+
+		[	"a=!(b+c);" ],
+
+		[	"typeof a+b;" ],
+
+		[	"x+=y;x-=y;x*=y;x/=y;x%=y;x<<=y;x>>=y;x>>>=y;x&=y;x^=y;x|=y;" ],
+
+		[	"x=void(0);" ],
+
+		[	"x=\"\\nFred\\t\\tKami's \\\\Edu \\r\\n\";" ],
+
+		[	"function(){this.a();this.b();this.c();}" ],
+
+		[	"function(){this.a();this.b();this.c();this.d();}",
+			"function(){var a=this;a.a();a.b();a.c();a.d();}" ],
+
+		[	"ie=/*@cc_on!@*/false;" ],
+
+		[	"(this.a||(this.a={})).b={};" ],
+
+		[	"while(a){if(b)continue;go();}" ],
+
+		[	"function(a){if(b)return;go();}" ],
+
+		[	"a||(a=b);"],
+
+		[	"obj instanceof claz;" ],
+
+		[	"o={prop1:1,1:'Fred','var':'Reserved','#':'XYZ','do-it':1};" ],
+
+		[	"o['#']['var']=1;" ],
+
+		[	"a.b+=1;" ],
+
+		[	"(a?b:c).go();" ],
+
+		[	"for(i=0;i<1;i++){}" ],
+
+		[	"a in b;" ],
+
+		[	"o={'':1};" ],
+
+		[	"with(o){a=b;}" ],
+
+		[	"o={'\\b':'\\\\b','\\t':'\\\\t','\\n':'\\\\n','\\f':'\\\\f','\\r':'\\\\r','\"':'\\\\\"','\\\\':'\\\\\\\\'};" ],
+
+		[	"if(a){}else{}" ],
+		
+		[	"a=b+c*1;",
+			"a=b+ +c;" ],
+		
+		[	"function(){\n// PACKAGER_RENAME( CKEDITOR )\nCKEDITOR.env={ie:true};\n// PACKAGER_RENAME( CKEDITOR.env )\n// PACKAGER_RENAME( CKEDITOR.env.ie )\nif (CKEDITOR&&CKEDITOR.env&&CKEDITOR.env.ie){go();}}",
+			"function(){var a=CKEDITOR;a.env={ie:true};var b=a.env;var c=b.ie;if(a&&b&&c)go();}" ]
+
+	];
+
+	var tests =
+	{
+	};
+
+	////////////////////////////////////////////////
+
+	function assertEquals( expected, actual )
+	{
+		if ( expected != actual )
+		{
+			var error =
+			{
+				expected : expected,
+				actual : actual
+			}
+
+			throw error;
+		}
+	}
+
+	// Create the auto tests.
+	function createAutoTest( counter, source, expected )
+	{
+		tests[ 'autoTest' + ( counter + 1000 ).toString().substr( 1 ) ] = function()
+		{
+			assertEquals( expected || source, CKPACKAGER.scriptCompressor.compress( source, true, null, true ) );
+		};
+	}
+
+	for ( var i = 0 ; i < autoTests.length ; i++ )
+	{
+		var autoTest = autoTests[ i ];
+		createAutoTest( i+1, autoTest[ 0 ], autoTest[ 1 ] );
+	}
+
+	// Run tests.
+	var passCount = 0,
+		failCount = 0;
+	for ( var test in tests )
+	{
+		try
+		{
+			tests[ test ]();
+			print( 'PASSED: ' + test );
+			passCount++;
+		}
+		catch ( error )
+		{
+			print( 'FAILED: ' + test );
+
+			if ( !error.expected )
+				throw error;
+
+			print( '  Expected: ' + error.expected );
+			print( '  Actual  : ' + error.actual );
+
+			failCount++;
+		}
+	}
+
+	print( '' );
+	print( 'Finished: ' + passCount + ' passed / ' + failCount + ' failed' );
+})();
