Index: /CKEditor/tags/3.0 Beta/.htaccess
===================================================================
--- /CKEditor/tags/3.0 Beta/.htaccess	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/.htaccess	(revision 3046)
@@ -0,0 +1,24 @@
+#
+# Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+# For licensing, see LICENSE.html or http://ckeditor.com/license
+#
+
+#
+# On some specific Linux installations you could face problems with Firefox.
+# It could give you errors when loading the editor saying that some illegal
+# characters were found (three strange chars in the beginning of the file).
+# This could happen if you map the .js or .css files to PHP, for example.
+#
+# Those characters are the Byte Order Mask (BOM) of the Unicode encoded files.
+# All FCKeditor files are Unicode encoded.
+#
+
+AddType application/x-javascript .js
+AddType text/css .css
+
+#
+# If PHP is mapped to handle XML files, you could have some issues. The
+# following will disable it.
+#
+
+AddType text/xml .xml
Index: /CKEditor/tags/3.0 Beta/CHANGES.html
===================================================================
--- /CKEditor/tags/3.0 Beta/CHANGES.html	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/CHANGES.html	(revision 3046)
@@ -0,0 +1,52 @@
+﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>Changelog - CKEditor</title>
+	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
+	<style type="text/css">
+
+#footer hr
+{
+	margin: 10px 0 15px 0;
+	height: 1px;
+	border: solid 1px gray;
+	border-bottom: none;
+}
+
+#footer p
+{
+	margin: 0 10px 10px 10px;
+	float: left;
+}
+
+#footer #copy
+{
+	float: right;
+}
+
+	</style>
+</head>
+<body>
+	<h1>
+		CKEditor Changelog
+	</h1>
+	<h3>
+		CKEditor 3.0 Beta</h3>
+	<p>
+		First public release.</p>
+	<div id="footer">
+		<hr />
+		<p>
+			CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a>
+		</p>
+		<p id="copy">
+			Copyright &copy; 2003-2009, <a href="http://cksource.com/">CKSource</a> - Frederico
+			Knabben. All rights reserved.
+		</p>
+	</div>
+</body>
+</html>
Index: /CKEditor/tags/3.0 Beta/LICENSE.html
===================================================================
--- /CKEditor/tags/3.0 Beta/LICENSE.html	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/LICENSE.html	(revision 3046)
@@ -0,0 +1,1379 @@
+﻿<!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
+==========================
+
+CKEditor - The text editor for Internet - http://ckeditor.com
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+
+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 CKEditor
+=====================================================
+
+Where not otherwise indicated, all CKEditor content is authored by
+CKSource engineers and consists of CKSource-owned intellectual
+property. In some specific instances, CKEditor will incorporate work
+done by developers outside of CKSource with their express permission.
+
+YUI Test: At _source/tests/yuitest.js can be found part of the source
+code of YUI, which is licensed under the terms of the BSD License
+(http://developer.yahoo.com/yui/license.txt). YUI is Copyright (C)
+2008, Yahoo! Inc.
+
+(Ignore this line: %REMOVE_START%)
+
+Software available at our repository and developer version only:
+
+JavaScript Lint: At _dev/_thirdparty/jsl can be found the executable
+files of JavaScript Lint, which are licensed under the terms of the
+Mozilla Public License Version 1.1 (http://www.mozilla.org/MPL/).
+JavaScript Lint is Copyright (c) 2006 Matthias Miller.
+
+JsDoc Toolkit: At _dev/_thirdparty/jsdoc-toolkit can be found the
+source code of JsDoc Toolkit, which is licensed under the terms of the
+X11/MIT License (http://www.opensource.org/licenses/mit-license.php).
+JsDoc Toolkit is Copyright (c) 2008 Michael Mathews.
+
+Console_Getopt and PEAR: At _dev/_thirdparty/console_getopt can be
+found the source code of Console_Getopt and part of the source code of
+PEAR, which are licensed under the terms of the PHP License Version 3.0
+(http://www.php.net/license/3_0.txt). Console_Getopt and PEAR are
+Copyright (c) 1997-2004 The PHP Group.
+
+(Ignore this line: %REMOVE_END%)
+Trademarks
+==========
+
+CKEditor is a trademark of CKSource - Frederico 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 - CKEditor</title>
+</head>
+<body>
+	<h1>
+		Software License Agreement
+	</h1>
+	<p>
+		<strong>CKEditor&trade;</strong> - The text editor for Internet&trade; - <a href="http://ckeditor.com">
+			http://ckeditor.com</a><br />
+		Copyright &copy; 2003-2009, <a href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved.
+	</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 CKEditor
+	</h2>
+	<p>
+		Where not otherwise indicated, all CKEditor content is authored by CKSource engineers
+		and consists of CKSource-owned intellectual property. In some specific instances,
+		CKEditor will incorporate work done by developers outside of CKSource with their
+		express permission.
+	</p>
+	<p>
+		<a href="http://developer.yahoo.com/yui/yuitest/">YUI Test</a>: At _source/tests/yuitest.js
+		can be found part of the source code of YUI, which is licensed under the terms of
+		the <a href="http://developer.yahoo.com/yui/license.txt">BSD License</a>. YUI is
+		Copyright &copy; 2008, Yahoo! Inc.
+	</p>
+	<!-- (Ignore this line: %REMOVE_START%)
+	Software available at our repository and developer version only:
+	-->
+	<p>
+		<a href="http://www.javascriptlint.com/">JavaScript Lint</a>: At _dev/_thirdparty/jsl
+		can be found the executable files of JavaScript Lint, which are licensed under the
+		terms of the Mozilla Public License Version 1.1 (<a href="http://developer.yahoo.com/yui/license.txt">http://developer.yahoo.com/yui/license.txt</a>).
+		JavaScript Lint is Copyright &copy; 2006 Matthias Miller.
+	</p>
+	<p>
+		<a href="http://code.google.com/p/jsdoc-toolkit/">JsDoc Toolkit</a>: At _dev/_thirdparty/jsdoc-toolkit can be found the
+		source code of JsDoc Toolkit, which is licensed under the terms of the
+		X11/MIT License Version
+		(<a href="http://www.opensource.org/licenses/mit-license.php">http://www.opensource.org/licenses/mit-license.php</a>).
+		JsDoc Toolkit is Copyright &copy; 2008 Michael Mathews.
+	</p>
+	<p>
+		<a href="http://pear.php.net/package/Console_Getopt">Console_Getopt</a> and <a href="http://pear.php.net/">
+			PEAR</a>: At _dev/_thirdparty/console_getopt can be found the source code of
+		Console_Getopt and part of the source code of PEAR, which are licensed under the
+		terms of the PHP License Version 3.0 (<a href="http://www.php.net/license/3_0.txt">http://www.php.net/license/3_0.txt</a>).
+		Console_Getopt and PEAR are Copyright &copy; 1997-2004 The PHP Group.
+	</p>
+	<!-- (Ignore this line: %REMOVE_END%) -->
+	<h2>
+		Trademarks
+	</h2>
+	<p>
+		CKEditor is a trademark of CKSource - Frederico Knabben. All other brand and product
+		names are trademarks, registered trademarks or service marks of their respective
+		holders.
+	</p>
+</body>
+</html>
Index: /CKEditor/tags/3.0 Beta/_dev/_thirdparty/console_getopt/Getopt.php
===================================================================
--- /CKEditor/tags/3.0 Beta/_dev/_thirdparty/console_getopt/Getopt.php	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_dev/_thirdparty/console_getopt/Getopt.php	(revision 3046)
@@ -0,0 +1,290 @@
+<?php
+/* vim: set expandtab tabstop=4 shiftwidth=4: */
+// +----------------------------------------------------------------------+
+// | PHP Version 5                                                        |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2004 The PHP Group                                |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 3.0 of the PHP license,       |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available through the world-wide-web at the following url:           |
+// | http://www.php.net/license/3_0.txt.                                  |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license@php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Author: Andrei Zmievski <andrei@php.net>                             |
+// +----------------------------------------------------------------------+
+//
+// $Id: Getopt.php,v 1.4 2007/06/12 14:58:56 cellog Exp $
+
+require_once 'PEAR.php';
+
+/**
+ * Command-line options parsing class.
+ *
+ * @author Andrei Zmievski <andrei@php.net>
+ *
+ */
+class Console_Getopt {
+    /**
+     * Parses the command-line options.
+     *
+     * The first parameter to this function should be the list of command-line
+     * arguments without the leading reference to the running program.
+     *
+     * The second parameter is a string of allowed short options. Each of the
+     * option letters can be followed by a colon ':' to specify that the option
+     * requires an argument, or a double colon '::' to specify that the option
+     * takes an optional argument.
+     *
+     * The third argument is an optional array of allowed long options. The
+     * leading '--' should not be included in the option name. Options that
+     * require an argument should be followed by '=', and options that take an
+     * option argument should be followed by '=='.
+     *
+     * The return value is an array of two elements: the list of parsed
+     * options and the list of non-option command-line arguments. Each entry in
+     * the list of parsed options is a pair of elements - the first one
+     * specifies the option, and the second one specifies the option argument,
+     * if there was one.
+     *
+     * Long and short options can be mixed.
+     *
+     * Most of the semantics of this function are based on GNU getopt_long().
+     *
+     * @param array  $args           an array of command-line arguments
+     * @param string $short_options  specifies the list of allowed short options
+     * @param array  $long_options   specifies the list of allowed long options
+     *
+     * @return array two-element array containing the list of parsed options and
+     * the non-option arguments
+     *
+     * @access public
+     *
+     */
+    function getopt2($args, $short_options, $long_options = null)
+    {
+        return Console_Getopt::doGetopt(2, $args, $short_options, $long_options);
+    }
+
+    /**
+     * This function expects $args to start with the script name (POSIX-style).
+     * Preserved for backwards compatibility.
+     * @see getopt2()
+     */
+    function getopt($args, $short_options, $long_options = null)
+    {
+        return Console_Getopt::doGetopt(1, $args, $short_options, $long_options);
+    }
+
+    /**
+     * The actual implementation of the argument parsing code.
+     */
+    function doGetopt($version, $args, $short_options, $long_options = null)
+    {
+        // in case you pass directly readPHPArgv() as the first arg
+        if (PEAR::isError($args)) {
+            return $args;
+        }
+        if (empty($args)) {
+            return array(array(), array());
+        }
+        $opts     = array();
+        $non_opts = array();
+
+        settype($args, 'array');
+
+        if ($long_options) {
+            sort($long_options);
+        }
+
+        /*
+         * Preserve backwards compatibility with callers that relied on
+         * erroneous POSIX fix.
+         */
+        if ($version < 2) {
+            if (isset($args[0]{0}) && $args[0]{0} != '-') {
+                array_shift($args);
+            }
+        }
+
+        reset($args);
+        while (list($i, $arg) = each($args)) {
+
+            /* The special element '--' means explicit end of
+               options. Treat the rest of the arguments as non-options
+               and end the loop. */
+            if ($arg == '--') {
+                $non_opts = array_merge($non_opts, array_slice($args, $i + 1));
+                break;
+            }
+
+            if ($arg{0} != '-' || (strlen($arg) > 1 && $arg{1} == '-' && !$long_options)) {
+                $non_opts = array_merge($non_opts, array_slice($args, $i));
+                break;
+            } elseif (strlen($arg) > 1 && $arg{1} == '-') {
+                $error = Console_Getopt::_parseLongOption(substr($arg, 2), $long_options, $opts, $args);
+                if (PEAR::isError($error))
+                    return $error;
+            } elseif ($arg == '-') {
+                // - is stdin
+                $non_opts = array_merge($non_opts, array_slice($args, $i));
+                break;
+            } else {
+                $error = Console_Getopt::_parseShortOption(substr($arg, 1), $short_options, $opts, $args);
+                if (PEAR::isError($error))
+                    return $error;
+            }
+        }
+
+        return array($opts, $non_opts);
+    }
+
+    /**
+     * @access private
+     *
+     */
+    function _parseShortOption($arg, $short_options, &$opts, &$args)
+    {
+        for ($i = 0; $i < strlen($arg); $i++) {
+            $opt = $arg{$i};
+            $opt_arg = null;
+
+            /* Try to find the short option in the specifier string. */
+            if (($spec = strstr($short_options, $opt)) === false || $arg{$i} == ':')
+            {
+                return PEAR::raiseError("Console_Getopt: unrecognized option -- $opt");
+            }
+
+            if (strlen($spec) > 1 && $spec{1} == ':') {
+                if (strlen($spec) > 2 && $spec{2} == ':') {
+                    if ($i + 1 < strlen($arg)) {
+                        /* Option takes an optional argument. Use the remainder of
+                           the arg string if there is anything left. */
+                        $opts[] = array($opt, substr($arg, $i + 1));
+                        break;
+                    }
+                } else {
+                    /* Option requires an argument. Use the remainder of the arg
+                       string if there is anything left. */
+                    if ($i + 1 < strlen($arg)) {
+                        $opts[] = array($opt,  substr($arg, $i + 1));
+                        break;
+                    } else if (list(, $opt_arg) = each($args)) {
+                        /* Else use the next argument. */;
+                        if (Console_Getopt::_isShortOpt($opt_arg) || Console_Getopt::_isLongOpt($opt_arg)) {
+                            return PEAR::raiseError("Console_Getopt: option requires an argument -- $opt");
+                        }
+                    } else {
+                        return PEAR::raiseError("Console_Getopt: option requires an argument -- $opt");
+                    }
+                }
+            }
+
+            $opts[] = array($opt, $opt_arg);
+        }
+    }
+
+    /**
+     * @access private
+     *
+     */
+    function _isShortOpt($arg)
+    {
+        return strlen($arg) == 2 && $arg[0] == '-' && preg_match('/[a-zA-Z]/', $arg[1]);
+    }
+
+    /**
+     * @access private
+     *
+     */
+    function _isLongOpt($arg)
+    {
+        return strlen($arg) > 2 && $arg[0] == '-' && $arg[1] == '-' &&
+            preg_match('/[a-zA-Z]+$/', substr($arg, 2));
+    }
+
+    /**
+     * @access private
+     *
+     */
+    function _parseLongOption($arg, $long_options, &$opts, &$args)
+    {
+        @list($opt, $opt_arg) = explode('=', $arg, 2);
+        $opt_len = strlen($opt);
+
+        for ($i = 0; $i < count($long_options); $i++) {
+            $long_opt  = $long_options[$i];
+            $opt_start = substr($long_opt, 0, $opt_len);
+            $long_opt_name = str_replace('=', '', $long_opt);
+
+            /* Option doesn't match. Go on to the next one. */
+            if ($long_opt_name != $opt) {
+                continue;
+            }
+
+            $opt_rest  = substr($long_opt, $opt_len);
+
+            /* Check that the options uniquely matches one of the allowed
+               options. */
+            if ($i + 1 < count($long_options)) {
+                $next_option_rest = substr($long_options[$i + 1], $opt_len);
+            } else {
+                $next_option_rest = '';
+            }
+            if ($opt_rest != '' && $opt{0} != '=' &&
+                $i + 1 < count($long_options) &&
+                $opt == substr($long_options[$i+1], 0, $opt_len) &&
+                $next_option_rest != '' &&
+                $next_option_rest{0} != '=') {
+                return PEAR::raiseError("Console_Getopt: option --$opt is ambiguous");
+            }
+
+            if (substr($long_opt, -1) == '=') {
+                if (substr($long_opt, -2) != '==') {
+                    /* Long option requires an argument.
+                       Take the next argument if one wasn't specified. */;
+                    if (!strlen($opt_arg) && !(list(, $opt_arg) = each($args))) {
+                        return PEAR::raiseError("Console_Getopt: option --$opt requires an argument");
+                    }
+                    if (Console_Getopt::_isShortOpt($opt_arg) || Console_Getopt::_isLongOpt($opt_arg)) {
+                        return PEAR::raiseError("Console_Getopt: option requires an argument --$opt");
+                    }
+                }
+            } else if ($opt_arg) {
+                return PEAR::raiseError("Console_Getopt: option --$opt doesn't allow an argument");
+            }
+
+            $opts[] = array('--' . $opt, $opt_arg);
+            return;
+        }
+
+        return PEAR::raiseError("Console_Getopt: unrecognized option --$opt");
+    }
+
+    /**
+    * Safely read the $argv PHP array across different PHP configurations.
+    * Will take care on register_globals and register_argc_argv ini directives
+    *
+    * @access public
+    * @return mixed the $argv PHP array or PEAR error if not registered
+    */
+    function readPHPArgv()
+    {
+        global $argv;
+        if (!is_array($argv)) {
+            if (!@is_array($_SERVER['argv'])) {
+                if (!@is_array($GLOBALS['HTTP_SERVER_VARS']['argv'])) {
+                    return PEAR::raiseError("Console_Getopt: Could not read cmd args (register_argc_argv=Off?)");
+                }
+                return $GLOBALS['HTTP_SERVER_VARS']['argv'];
+            }
+            return $_SERVER['argv'];
+        }
+        return $argv;
+    }
+
+}
+
+?>
Index: /CKEditor/tags/3.0 Beta/_dev/_thirdparty/console_getopt/PEAR.php
===================================================================
--- /CKEditor/tags/3.0 Beta/_dev/_thirdparty/console_getopt/PEAR.php	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_dev/_thirdparty/console_getopt/PEAR.php	(revision 3046)
@@ -0,0 +1,1118 @@
+<?php
+/**
+ * PEAR, the PHP Extension and Application Repository
+ *
+ * PEAR class and PEAR_Error class
+ *
+ * PHP versions 4 and 5
+ *
+ * LICENSE: This source file is subject to version 3.0 of the PHP license
+ * that is available through the world-wide-web at the following URI:
+ * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
+ * the PHP License and are unable to obtain it through the web, please
+ * send a note to license@php.net so we can mail you a copy immediately.
+ *
+ * @category   pear
+ * @package    PEAR
+ * @author     Sterling Hughes <sterling@php.net>
+ * @author     Stig Bakken <ssb@php.net>
+ * @author     Tomas V.V.Cox <cox@idecnet.com>
+ * @author     Greg Beaver <cellog@php.net>
+ * @copyright  1997-2008 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    CVS: $Id: PEAR.php,v 1.104 2008/01/03 20:26:34 cellog Exp $
+ * @link       http://pear.php.net/package/PEAR
+ * @since      File available since Release 0.1
+ */
+
+/**#@+
+ * ERROR constants
+ */
+define('PEAR_ERROR_RETURN',     1);
+define('PEAR_ERROR_PRINT',      2);
+define('PEAR_ERROR_TRIGGER',    4);
+define('PEAR_ERROR_DIE',        8);
+define('PEAR_ERROR_CALLBACK',  16);
+/**
+ * WARNING: obsolete
+ * @deprecated
+ */
+define('PEAR_ERROR_EXCEPTION', 32);
+/**#@-*/
+define('PEAR_ZE2', (function_exists('version_compare') &&
+                    version_compare(zend_version(), "2-dev", "ge")));
+
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+    define('OS_WINDOWS', true);
+    define('OS_UNIX',    false);
+    define('PEAR_OS',    'Windows');
+} else {
+    define('OS_WINDOWS', false);
+    define('OS_UNIX',    true);
+    define('PEAR_OS',    'Unix'); // blatant assumption
+}
+
+// instant backwards compatibility
+if (!defined('PATH_SEPARATOR')) {
+    if (OS_WINDOWS) {
+        define('PATH_SEPARATOR', ';');
+    } else {
+        define('PATH_SEPARATOR', ':');
+    }
+}
+
+$GLOBALS['_PEAR_default_error_mode']     = PEAR_ERROR_RETURN;
+$GLOBALS['_PEAR_default_error_options']  = E_USER_NOTICE;
+$GLOBALS['_PEAR_destructor_object_list'] = array();
+$GLOBALS['_PEAR_shutdown_funcs']         = array();
+$GLOBALS['_PEAR_error_handler_stack']    = array();
+
+@ini_set('track_errors', true);
+
+/**
+ * Base class for other PEAR classes.  Provides rudimentary
+ * emulation of destructors.
+ *
+ * If you want a destructor in your class, inherit PEAR and make a
+ * destructor method called _yourclassname (same name as the
+ * constructor, but with a "_" prefix).  Also, in your constructor you
+ * have to call the PEAR constructor: $this->PEAR();.
+ * The destructor method will be called without parameters.  Note that
+ * at in some SAPI implementations (such as Apache), any output during
+ * the request shutdown (in which destructors are called) seems to be
+ * discarded.  If you need to get any debug information from your
+ * destructor, use error_log(), syslog() or something similar.
+ *
+ * IMPORTANT! To use the emulated destructors you need to create the
+ * objects by reference: $obj =& new PEAR_child;
+ *
+ * @category   pear
+ * @package    PEAR
+ * @author     Stig Bakken <ssb@php.net>
+ * @author     Tomas V.V. Cox <cox@idecnet.com>
+ * @author     Greg Beaver <cellog@php.net>
+ * @copyright  1997-2006 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    Release: 1.7.1
+ * @link       http://pear.php.net/package/PEAR
+ * @see        PEAR_Error
+ * @since      Class available since PHP 4.0.2
+ * @link        http://pear.php.net/manual/en/core.pear.php#core.pear.pear
+ */
+class PEAR
+{
+    // {{{ properties
+
+    /**
+     * Whether to enable internal debug messages.
+     *
+     * @var     bool
+     * @access  private
+     */
+    var $_debug = false;
+
+    /**
+     * Default error mode for this object.
+     *
+     * @var     int
+     * @access  private
+     */
+    var $_default_error_mode = null;
+
+    /**
+     * Default error options used for this object when error mode
+     * is PEAR_ERROR_TRIGGER.
+     *
+     * @var     int
+     * @access  private
+     */
+    var $_default_error_options = null;
+
+    /**
+     * Default error handler (callback) for this object, if error mode is
+     * PEAR_ERROR_CALLBACK.
+     *
+     * @var     string
+     * @access  private
+     */
+    var $_default_error_handler = '';
+
+    /**
+     * Which class to use for error objects.
+     *
+     * @var     string
+     * @access  private
+     */
+    var $_error_class = 'PEAR_Error';
+
+    /**
+     * An array of expected errors.
+     *
+     * @var     array
+     * @access  private
+     */
+    var $_expected_errors = array();
+
+    // }}}
+
+    // {{{ constructor
+
+    /**
+     * Constructor.  Registers this object in
+     * $_PEAR_destructor_object_list for destructor emulation if a
+     * destructor object exists.
+     *
+     * @param string $error_class  (optional) which class to use for
+     *        error objects, defaults to PEAR_Error.
+     * @access public
+     * @return void
+     */
+    function PEAR($error_class = null)
+    {
+        $classname = strtolower(get_class($this));
+        if ($this->_debug) {
+            print "PEAR constructor called, class=$classname\n";
+        }
+        if ($error_class !== null) {
+            $this->_error_class = $error_class;
+        }
+        while ($classname && strcasecmp($classname, "pear")) {
+            $destructor = "_$classname";
+            if (method_exists($this, $destructor)) {
+                global $_PEAR_destructor_object_list;
+                $_PEAR_destructor_object_list[] = &$this;
+                if (!isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) {
+                    register_shutdown_function("_PEAR_call_destructors");
+                    $GLOBALS['_PEAR_SHUTDOWN_REGISTERED'] = true;
+                }
+                break;
+            } else {
+                $classname = get_parent_class($classname);
+            }
+        }
+    }
+
+    // }}}
+    // {{{ destructor
+
+    /**
+     * Destructor (the emulated type of...).  Does nothing right now,
+     * but is included for forward compatibility, so subclass
+     * destructors should always call it.
+     *
+     * See the note in the class desciption about output from
+     * destructors.
+     *
+     * @access public
+     * @return void
+     */
+    function _PEAR() {
+        if ($this->_debug) {
+            printf("PEAR destructor called, class=%s\n", strtolower(get_class($this)));
+        }
+    }
+
+    // }}}
+    // {{{ getStaticProperty()
+
+    /**
+    * If you have a class that's mostly/entirely static, and you need static
+    * properties, you can use this method to simulate them. Eg. in your method(s)
+    * do this: $myVar = &PEAR::getStaticProperty('myclass', 'myVar');
+    * You MUST use a reference, or they will not persist!
+    *
+    * @access public
+    * @param  string $class  The calling classname, to prevent clashes
+    * @param  string $var    The variable to retrieve.
+    * @return mixed   A reference to the variable. If not set it will be
+    *                 auto initialised to NULL.
+    */
+    function &getStaticProperty($class, $var)
+    {
+        static $properties;
+        if (!isset($properties[$class])) {
+            $properties[$class] = array();
+        }
+        if (!array_key_exists($var, $properties[$class])) {
+            $properties[$class][$var] = null;
+        }
+        return $properties[$class][$var];
+    }
+
+    // }}}
+    // {{{ registerShutdownFunc()
+
+    /**
+    * Use this function to register a shutdown method for static
+    * classes.
+    *
+    * @access public
+    * @param  mixed $func  The function name (or array of class/method) to call
+    * @param  mixed $args  The arguments to pass to the function
+    * @return void
+    */
+    function registerShutdownFunc($func, $args = array())
+    {
+        // if we are called statically, there is a potential
+        // that no shutdown func is registered.  Bug #6445
+        if (!isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) {
+            register_shutdown_function("_PEAR_call_destructors");
+            $GLOBALS['_PEAR_SHUTDOWN_REGISTERED'] = true;
+        }
+        $GLOBALS['_PEAR_shutdown_funcs'][] = array($func, $args);
+    }
+
+    // }}}
+    // {{{ isError()
+
+    /**
+     * Tell whether a value is a PEAR error.
+     *
+     * @param   mixed $data   the value to test
+     * @param   int   $code   if $data is an error object, return true
+     *                        only if $code is a string and
+     *                        $obj->getMessage() == $code or
+     *                        $code is an integer and $obj->getCode() == $code
+     * @access  public
+     * @return  bool    true if parameter is an error
+     */
+    function isError($data, $code = null)
+    {
+        if (is_a($data, 'PEAR_Error')) {
+            if (is_null($code)) {
+                return true;
+            } elseif (is_string($code)) {
+                return $data->getMessage() == $code;
+            } else {
+                return $data->getCode() == $code;
+            }
+        }
+        return false;
+    }
+
+    // }}}
+    // {{{ setErrorHandling()
+
+    /**
+     * Sets how errors generated by this object should be handled.
+     * Can be invoked both in objects and statically.  If called
+     * statically, setErrorHandling sets the default behaviour for all
+     * PEAR objects.  If called in an object, setErrorHandling sets
+     * the default behaviour for that object.
+     *
+     * @param int $mode
+     *        One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT,
+     *        PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE,
+     *        PEAR_ERROR_CALLBACK or PEAR_ERROR_EXCEPTION.
+     *
+     * @param mixed $options
+     *        When $mode is PEAR_ERROR_TRIGGER, this is the error level (one
+     *        of E_USER_NOTICE, E_USER_WARNING or E_USER_ERROR).
+     *
+     *        When $mode is PEAR_ERROR_CALLBACK, this parameter is expected
+     *        to be the callback function or method.  A callback
+     *        function is a string with the name of the function, a
+     *        callback method is an array of two elements: the element
+     *        at index 0 is the object, and the element at index 1 is
+     *        the name of the method to call in the object.
+     *
+     *        When $mode is PEAR_ERROR_PRINT or PEAR_ERROR_DIE, this is
+     *        a printf format string used when printing the error
+     *        message.
+     *
+     * @access public
+     * @return void
+     * @see PEAR_ERROR_RETURN
+     * @see PEAR_ERROR_PRINT
+     * @see PEAR_ERROR_TRIGGER
+     * @see PEAR_ERROR_DIE
+     * @see PEAR_ERROR_CALLBACK
+     * @see PEAR_ERROR_EXCEPTION
+     *
+     * @since PHP 4.0.5
+     */
+
+    function setErrorHandling($mode = null, $options = null)
+    {
+        if (isset($this) && is_a($this, 'PEAR')) {
+            $setmode     = &$this->_default_error_mode;
+            $setoptions  = &$this->_default_error_options;
+        } else {
+            $setmode     = &$GLOBALS['_PEAR_default_error_mode'];
+            $setoptions  = &$GLOBALS['_PEAR_default_error_options'];
+        }
+
+        switch ($mode) {
+            case PEAR_ERROR_EXCEPTION:
+            case PEAR_ERROR_RETURN:
+            case PEAR_ERROR_PRINT:
+            case PEAR_ERROR_TRIGGER:
+            case PEAR_ERROR_DIE:
+            case null:
+                $setmode = $mode;
+                $setoptions = $options;
+                break;
+
+            case PEAR_ERROR_CALLBACK:
+                $setmode = $mode;
+                // class/object method callback
+                if (is_callable($options)) {
+                    $setoptions = $options;
+                } else {
+                    trigger_error("invalid error callback", E_USER_WARNING);
+                }
+                break;
+
+            default:
+                trigger_error("invalid error mode", E_USER_WARNING);
+                break;
+        }
+    }
+
+    // }}}
+    // {{{ expectError()
+
+    /**
+     * This method is used to tell which errors you expect to get.
+     * Expected errors are always returned with error mode
+     * PEAR_ERROR_RETURN.  Expected error codes are stored in a stack,
+     * and this method pushes a new element onto it.  The list of
+     * expected errors are in effect until they are popped off the
+     * stack with the popExpect() method.
+     *
+     * Note that this method can not be called statically
+     *
+     * @param mixed $code a single error code or an array of error codes to expect
+     *
+     * @return int     the new depth of the "expected errors" stack
+     * @access public
+     */
+    function expectError($code = '*')
+    {
+        if (is_array($code)) {
+            array_push($this->_expected_errors, $code);
+        } else {
+            array_push($this->_expected_errors, array($code));
+        }
+        return sizeof($this->_expected_errors);
+    }
+
+    // }}}
+    // {{{ popExpect()
+
+    /**
+     * This method pops one element off the expected error codes
+     * stack.
+     *
+     * @return array   the list of error codes that were popped
+     */
+    function popExpect()
+    {
+        return array_pop($this->_expected_errors);
+    }
+
+    // }}}
+    // {{{ _checkDelExpect()
+
+    /**
+     * This method checks unsets an error code if available
+     *
+     * @param mixed error code
+     * @return bool true if the error code was unset, false otherwise
+     * @access private
+     * @since PHP 4.3.0
+     */
+    function _checkDelExpect($error_code)
+    {
+        $deleted = false;
+
+        foreach ($this->_expected_errors AS $key => $error_array) {
+            if (in_array($error_code, $error_array)) {
+                unset($this->_expected_errors[$key][array_search($error_code, $error_array)]);
+                $deleted = true;
+            }
+
+            // clean up empty arrays
+            if (0 == count($this->_expected_errors[$key])) {
+                unset($this->_expected_errors[$key]);
+            }
+        }
+        return $deleted;
+    }
+
+    // }}}
+    // {{{ delExpect()
+
+    /**
+     * This method deletes all occurences of the specified element from
+     * the expected error codes stack.
+     *
+     * @param  mixed $error_code error code that should be deleted
+     * @return mixed list of error codes that were deleted or error
+     * @access public
+     * @since PHP 4.3.0
+     */
+    function delExpect($error_code)
+    {
+        $deleted = false;
+
+        if ((is_array($error_code) && (0 != count($error_code)))) {
+            // $error_code is a non-empty array here;
+            // we walk through it trying to unset all
+            // values
+            foreach($error_code as $key => $error) {
+                if ($this->_checkDelExpect($error)) {
+                    $deleted =  true;
+                } else {
+                    $deleted = false;
+                }
+            }
+            return $deleted ? true : PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME
+        } elseif (!empty($error_code)) {
+            // $error_code comes alone, trying to unset it
+            if ($this->_checkDelExpect($error_code)) {
+                return true;
+            } else {
+                return PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME
+            }
+        } else {
+            // $error_code is empty
+            return PEAR::raiseError("The expected error you submitted is empty"); // IMPROVE ME
+        }
+    }
+
+    // }}}
+    // {{{ raiseError()
+
+    /**
+     * This method is a wrapper that returns an instance of the
+     * configured error class with this object's default error
+     * handling applied.  If the $mode and $options parameters are not
+     * specified, the object's defaults are used.
+     *
+     * @param mixed $message a text error message or a PEAR error object
+     *
+     * @param int $code      a numeric error code (it is up to your class
+     *                  to define these if you want to use codes)
+     *
+     * @param int $mode      One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT,
+     *                  PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE,
+     *                  PEAR_ERROR_CALLBACK, PEAR_ERROR_EXCEPTION.
+     *
+     * @param mixed $options If $mode is PEAR_ERROR_TRIGGER, this parameter
+     *                  specifies the PHP-internal error level (one of
+     *                  E_USER_NOTICE, E_USER_WARNING or E_USER_ERROR).
+     *                  If $mode is PEAR_ERROR_CALLBACK, this
+     *                  parameter specifies the callback function or
+     *                  method.  In other error modes this parameter
+     *                  is ignored.
+     *
+     * @param string $userinfo If you need to pass along for example debug
+     *                  information, this parameter is meant for that.
+     *
+     * @param string $error_class The returned error object will be
+     *                  instantiated from this class, if specified.
+     *
+     * @param bool $skipmsg If true, raiseError will only pass error codes,
+     *                  the error message parameter will be dropped.
+     *
+     * @access public
+     * @return object   a PEAR error object
+     * @see PEAR::setErrorHandling
+     * @since PHP 4.0.5
+     */
+    function &raiseError($message = null,
+                         $code = null,
+                         $mode = null,
+                         $options = null,
+                         $userinfo = null,
+                         $error_class = null,
+                         $skipmsg = false)
+    {
+        // The error is yet a PEAR error object
+        if (is_object($message)) {
+            $code        = $message->getCode();
+            $userinfo    = $message->getUserInfo();
+            $error_class = $message->getType();
+            $message->error_message_prefix = '';
+            $message     = $message->getMessage();
+        }
+
+        if (isset($this) && isset($this->_expected_errors) && sizeof($this->_expected_errors) > 0 && sizeof($exp = end($this->_expected_errors))) {
+            if ($exp[0] == "*" ||
+                (is_int(reset($exp)) && in_array($code, $exp)) ||
+                (is_string(reset($exp)) && in_array($message, $exp))) {
+                $mode = PEAR_ERROR_RETURN;
+            }
+        }
+        // No mode given, try global ones
+        if ($mode === null) {
+            // Class error handler
+            if (isset($this) && isset($this->_default_error_mode)) {
+                $mode    = $this->_default_error_mode;
+                $options = $this->_default_error_options;
+            // Global error handler
+            } elseif (isset($GLOBALS['_PEAR_default_error_mode'])) {
+                $mode    = $GLOBALS['_PEAR_default_error_mode'];
+                $options = $GLOBALS['_PEAR_default_error_options'];
+            }
+        }
+
+        if ($error_class !== null) {
+            $ec = $error_class;
+        } elseif (isset($this) && isset($this->_error_class)) {
+            $ec = $this->_error_class;
+        } else {
+            $ec = 'PEAR_Error';
+        }
+        if (intval(PHP_VERSION) < 5) {
+            // little non-eval hack to fix bug #12147
+            include 'PEAR/FixPHP5PEARWarnings.php';
+            return $a;
+        }
+        if ($skipmsg) {
+            $a = new $ec($code, $mode, $options, $userinfo);
+        } else {
+            $a = new $ec($message, $code, $mode, $options, $userinfo);
+        }
+        return $a;
+    }
+
+    // }}}
+    // {{{ throwError()
+
+    /**
+     * Simpler form of raiseError with fewer options.  In most cases
+     * message, code and userinfo are enough.
+     *
+     * @param string $message
+     *
+     */
+    function &throwError($message = null,
+                         $code = null,
+                         $userinfo = null)
+    {
+        if (isset($this) && is_a($this, 'PEAR')) {
+            $a = &$this->raiseError($message, $code, null, null, $userinfo);
+            return $a;
+        } else {
+            $a = &PEAR::raiseError($message, $code, null, null, $userinfo);
+            return $a;
+        }
+    }
+
+    // }}}
+    function staticPushErrorHandling($mode, $options = null)
+    {
+        $stack = &$GLOBALS['_PEAR_error_handler_stack'];
+        $def_mode    = &$GLOBALS['_PEAR_default_error_mode'];
+        $def_options = &$GLOBALS['_PEAR_default_error_options'];
+        $stack[] = array($def_mode, $def_options);
+        switch ($mode) {
+            case PEAR_ERROR_EXCEPTION:
+            case PEAR_ERROR_RETURN:
+            case PEAR_ERROR_PRINT:
+            case PEAR_ERROR_TRIGGER:
+            case PEAR_ERROR_DIE:
+            case null:
+                $def_mode = $mode;
+                $def_options = $options;
+                break;
+
+            case PEAR_ERROR_CALLBACK:
+                $def_mode = $mode;
+                // class/object method callback
+                if (is_callable($options)) {
+                    $def_options = $options;
+                } else {
+                    trigger_error("invalid error callback", E_USER_WARNING);
+                }
+                break;
+
+            default:
+                trigger_error("invalid error mode", E_USER_WARNING);
+                break;
+        }
+        $stack[] = array($mode, $options);
+        return true;
+    }
+
+    function staticPopErrorHandling()
+    {
+        $stack = &$GLOBALS['_PEAR_error_handler_stack'];
+        $setmode     = &$GLOBALS['_PEAR_default_error_mode'];
+        $setoptions  = &$GLOBALS['_PEAR_default_error_options'];
+        array_pop($stack);
+        list($mode, $options) = $stack[sizeof($stack) - 1];
+        array_pop($stack);
+        switch ($mode) {
+            case PEAR_ERROR_EXCEPTION:
+            case PEAR_ERROR_RETURN:
+            case PEAR_ERROR_PRINT:
+            case PEAR_ERROR_TRIGGER:
+            case PEAR_ERROR_DIE:
+            case null:
+                $setmode = $mode;
+                $setoptions = $options;
+                break;
+
+            case PEAR_ERROR_CALLBACK:
+                $setmode = $mode;
+                // class/object method callback
+                if (is_callable($options)) {
+                    $setoptions = $options;
+                } else {
+                    trigger_error("invalid error callback", E_USER_WARNING);
+                }
+                break;
+
+            default:
+                trigger_error("invalid error mode", E_USER_WARNING);
+                break;
+        }
+        return true;
+    }
+
+    // {{{ pushErrorHandling()
+
+    /**
+     * Push a new error handler on top of the error handler options stack. With this
+     * you can easily override the actual error handler for some code and restore
+     * it later with popErrorHandling.
+     *
+     * @param mixed $mode (same as setErrorHandling)
+     * @param mixed $options (same as setErrorHandling)
+     *
+     * @return bool Always true
+     *
+     * @see PEAR::setErrorHandling
+     */
+    function pushErrorHandling($mode, $options = null)
+    {
+        $stack = &$GLOBALS['_PEAR_error_handler_stack'];
+        if (isset($this) && is_a($this, 'PEAR')) {
+            $def_mode    = &$this->_default_error_mode;
+            $def_options = &$this->_default_error_options;
+        } else {
+            $def_mode    = &$GLOBALS['_PEAR_default_error_mode'];
+            $def_options = &$GLOBALS['_PEAR_default_error_options'];
+        }
+        $stack[] = array($def_mode, $def_options);
+
+        if (isset($this) && is_a($this, 'PEAR')) {
+            $this->setErrorHandling($mode, $options);
+        } else {
+            PEAR::setErrorHandling($mode, $options);
+        }
+        $stack[] = array($mode, $options);
+        return true;
+    }
+
+    // }}}
+    // {{{ popErrorHandling()
+
+    /**
+    * Pop the last error handler used
+    *
+    * @return bool Always true
+    *
+    * @see PEAR::pushErrorHandling
+    */
+    function popErrorHandling()
+    {
+        $stack = &$GLOBALS['_PEAR_error_handler_stack'];
+        array_pop($stack);
+        list($mode, $options) = $stack[sizeof($stack) - 1];
+        array_pop($stack);
+        if (isset($this) && is_a($this, 'PEAR')) {
+            $this->setErrorHandling($mode, $options);
+        } else {
+            PEAR::setErrorHandling($mode, $options);
+        }
+        return true;
+    }
+
+    // }}}
+    // {{{ loadExtension()
+
+    /**
+    * OS independant PHP extension load. Remember to take care
+    * on the correct extension name for case sensitive OSes.
+    *
+    * @param string $ext The extension name
+    * @return bool Success or not on the dl() call
+    */
+    function loadExtension($ext)
+    {
+        if (!extension_loaded($ext)) {
+            // if either returns true dl() will produce a FATAL error, stop that
+            if ((ini_get('enable_dl') != 1) || (ini_get('safe_mode') == 1)) {
+                return false;
+            }
+            if (OS_WINDOWS) {
+                $suffix = '.dll';
+            } elseif (PHP_OS == 'HP-UX') {
+                $suffix = '.sl';
+            } elseif (PHP_OS == 'AIX') {
+                $suffix = '.a';
+            } elseif (PHP_OS == 'OSX') {
+                $suffix = '.bundle';
+            } else {
+                $suffix = '.so';
+            }
+            return @dl('php_'.$ext.$suffix) || @dl($ext.$suffix);
+        }
+        return true;
+    }
+
+    // }}}
+}
+
+// {{{ _PEAR_call_destructors()
+
+function _PEAR_call_destructors()
+{
+    global $_PEAR_destructor_object_list;
+    if (is_array($_PEAR_destructor_object_list) &&
+        sizeof($_PEAR_destructor_object_list))
+    {
+        reset($_PEAR_destructor_object_list);
+        if (PEAR::getStaticProperty('PEAR', 'destructlifo')) {
+            $_PEAR_destructor_object_list = array_reverse($_PEAR_destructor_object_list);
+        }
+        while (list($k, $objref) = each($_PEAR_destructor_object_list)) {
+            $classname = get_class($objref);
+            while ($classname) {
+                $destructor = "_$classname";
+                if (method_exists($objref, $destructor)) {
+                    $objref->$destructor();
+                    break;
+                } else {
+                    $classname = get_parent_class($classname);
+                }
+            }
+        }
+        // Empty the object list to ensure that destructors are
+        // not called more than once.
+        $_PEAR_destructor_object_list = array();
+    }
+
+    // Now call the shutdown functions
+    if (is_array($GLOBALS['_PEAR_shutdown_funcs']) AND !empty($GLOBALS['_PEAR_shutdown_funcs'])) {
+        foreach ($GLOBALS['_PEAR_shutdown_funcs'] as $value) {
+            call_user_func_array($value[0], $value[1]);
+        }
+    }
+}
+
+// }}}
+/**
+ * Standard PEAR error class for PHP 4
+ *
+ * This class is supserseded by {@link PEAR_Exception} in PHP 5
+ *
+ * @category   pear
+ * @package    PEAR
+ * @author     Stig Bakken <ssb@php.net>
+ * @author     Tomas V.V. Cox <cox@idecnet.com>
+ * @author     Gregory Beaver <cellog@php.net>
+ * @copyright  1997-2006 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    Release: 1.7.1
+ * @link       http://pear.php.net/manual/en/core.pear.pear-error.php
+ * @see        PEAR::raiseError(), PEAR::throwError()
+ * @since      Class available since PHP 4.0.2
+ */
+class PEAR_Error
+{
+    // {{{ properties
+
+    var $error_message_prefix = '';
+    var $mode                 = PEAR_ERROR_RETURN;
+    var $level                = E_USER_NOTICE;
+    var $code                 = -1;
+    var $message              = '';
+    var $userinfo             = '';
+    var $backtrace            = null;
+
+    // }}}
+    // {{{ constructor
+
+    /**
+     * PEAR_Error constructor
+     *
+     * @param string $message  message
+     *
+     * @param int $code     (optional) error code
+     *
+     * @param int $mode     (optional) error mode, one of: PEAR_ERROR_RETURN,
+     * PEAR_ERROR_PRINT, PEAR_ERROR_DIE, PEAR_ERROR_TRIGGER,
+     * PEAR_ERROR_CALLBACK or PEAR_ERROR_EXCEPTION
+     *
+     * @param mixed $options   (optional) error level, _OR_ in the case of
+     * PEAR_ERROR_CALLBACK, the callback function or object/method
+     * tuple.
+     *
+     * @param string $userinfo (optional) additional user/debug info
+     *
+     * @access public
+     *
+     */
+    function PEAR_Error($message = 'unknown error', $code = null,
+                        $mode = null, $options = null, $userinfo = null)
+    {
+        if ($mode === null) {
+            $mode = PEAR_ERROR_RETURN;
+        }
+        $this->message   = $message;
+        $this->code      = $code;
+        $this->mode      = $mode;
+        $this->userinfo  = $userinfo;
+        if (!PEAR::getStaticProperty('PEAR_Error', 'skiptrace')) {
+            $this->backtrace = debug_backtrace();
+            if (isset($this->backtrace[0]) && isset($this->backtrace[0]['object'])) {
+                unset($this->backtrace[0]['object']);
+            }
+        }
+        if ($mode & PEAR_ERROR_CALLBACK) {
+            $this->level = E_USER_NOTICE;
+            $this->callback = $options;
+        } else {
+            if ($options === null) {
+                $options = E_USER_NOTICE;
+            }
+            $this->level = $options;
+            $this->callback = null;
+        }
+        if ($this->mode & PEAR_ERROR_PRINT) {
+            if (is_null($options) || is_int($options)) {
+                $format = "%s";
+            } else {
+                $format = $options;
+            }
+            printf($format, $this->getMessage());
+        }
+        if ($this->mode & PEAR_ERROR_TRIGGER) {
+            trigger_error($this->getMessage(), $this->level);
+        }
+        if ($this->mode & PEAR_ERROR_DIE) {
+            $msg = $this->getMessage();
+            if (is_null($options) || is_int($options)) {
+                $format = "%s";
+                if (substr($msg, -1) != "\n") {
+                    $msg .= "\n";
+                }
+            } else {
+                $format = $options;
+            }
+            die(sprintf($format, $msg));
+        }
+        if ($this->mode & PEAR_ERROR_CALLBACK) {
+            if (is_callable($this->callback)) {
+                call_user_func($this->callback, $this);
+            }
+        }
+        if ($this->mode & PEAR_ERROR_EXCEPTION) {
+            trigger_error("PEAR_ERROR_EXCEPTION is obsolete, use class PEAR_Exception for exceptions", E_USER_WARNING);
+            eval('$e = new Exception($this->message, $this->code);throw($e);');
+        }
+    }
+
+    // }}}
+    // {{{ getMode()
+
+    /**
+     * Get the error mode from an error object.
+     *
+     * @return int error mode
+     * @access public
+     */
+    function getMode() {
+        return $this->mode;
+    }
+
+    // }}}
+    // {{{ getCallback()
+
+    /**
+     * Get the callback function/method from an error object.
+     *
+     * @return mixed callback function or object/method array
+     * @access public
+     */
+    function getCallback() {
+        return $this->callback;
+    }
+
+    // }}}
+    // {{{ getMessage()
+
+
+    /**
+     * Get the error message from an error object.
+     *
+     * @return  string  full error message
+     * @access public
+     */
+    function getMessage()
+    {
+        return ($this->error_message_prefix . $this->message);
+    }
+
+
+    // }}}
+    // {{{ getCode()
+
+    /**
+     * Get error code from an error object
+     *
+     * @return int error code
+     * @access public
+     */
+     function getCode()
+     {
+        return $this->code;
+     }
+
+    // }}}
+    // {{{ getType()
+
+    /**
+     * Get the name of this error/exception.
+     *
+     * @return string error/exception name (type)
+     * @access public
+     */
+    function getType()
+    {
+        return get_class($this);
+    }
+
+    // }}}
+    // {{{ getUserInfo()
+
+    /**
+     * Get additional user-supplied information.
+     *
+     * @return string user-supplied information
+     * @access public
+     */
+    function getUserInfo()
+    {
+        return $this->userinfo;
+    }
+
+    // }}}
+    // {{{ getDebugInfo()
+
+    /**
+     * Get additional debug information supplied by the application.
+     *
+     * @return string debug information
+     * @access public
+     */
+    function getDebugInfo()
+    {
+        return $this->getUserInfo();
+    }
+
+    // }}}
+    // {{{ getBacktrace()
+
+    /**
+     * Get the call backtrace from where the error was generated.
+     * Supported with PHP 4.3.0 or newer.
+     *
+     * @param int $frame (optional) what frame to fetch
+     * @return array Backtrace, or NULL if not available.
+     * @access public
+     */
+    function getBacktrace($frame = null)
+    {
+        if (defined('PEAR_IGNORE_BACKTRACE')) {
+            return null;
+        }
+        if ($frame === null) {
+            return $this->backtrace;
+        }
+        return $this->backtrace[$frame];
+    }
+
+    // }}}
+    // {{{ addUserInfo()
+
+    function addUserInfo($info)
+    {
+        if (empty($this->userinfo)) {
+            $this->userinfo = $info;
+        } else {
+            $this->userinfo .= " ** $info";
+        }
+    }
+
+    // }}}
+    // {{{ toString()
+    function __toString()
+    {
+        return $this->getMessage();
+    }
+    // }}}
+    // {{{ toString()
+
+    /**
+     * Make a string representation of this object.
+     *
+     * @return string a string with an object summary
+     * @access public
+     */
+    function toString() {
+        $modes = array();
+        $levels = array(E_USER_NOTICE  => 'notice',
+                        E_USER_WARNING => 'warning',
+                        E_USER_ERROR   => 'error');
+        if ($this->mode & PEAR_ERROR_CALLBACK) {
+            if (is_array($this->callback)) {
+                $callback = (is_object($this->callback[0]) ?
+                    strtolower(get_class($this->callback[0])) :
+                    $this->callback[0]) . '::' .
+                    $this->callback[1];
+            } else {
+                $callback = $this->callback;
+            }
+            return sprintf('[%s: message="%s" code=%d mode=callback '.
+                           'callback=%s prefix="%s" info="%s"]',
+                           strtolower(get_class($this)), $this->message, $this->code,
+                           $callback, $this->error_message_prefix,
+                           $this->userinfo);
+        }
+        if ($this->mode & PEAR_ERROR_PRINT) {
+            $modes[] = 'print';
+        }
+        if ($this->mode & PEAR_ERROR_TRIGGER) {
+            $modes[] = 'trigger';
+        }
+        if ($this->mode & PEAR_ERROR_DIE) {
+            $modes[] = 'die';
+        }
+        if ($this->mode & PEAR_ERROR_RETURN) {
+            $modes[] = 'return';
+        }
+        return sprintf('[%s: message="%s" code=%d mode=%s level=%s '.
+                       'prefix="%s" info="%s"]',
+                       strtolower(get_class($this)), $this->message, $this->code,
+                       implode("|", $modes), $levels[$this->level],
+                       $this->error_message_prefix,
+                       $this->userinfo);
+    }
+
+    // }}}
+}
+
+/*
+ * Local Variables:
+ * mode: php
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ */
+?>
Index: /CKEditor/tags/3.0 Beta/_dev/docs_build/docs_build.bat
===================================================================
--- /CKEditor/tags/3.0 Beta/_dev/docs_build/docs_build.bat	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_dev/docs_build/docs_build.bat	(revision 3046)
@@ -0,0 +1,17 @@
+@ECHO OFF
+::
+:: Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+:: For licensing, see LICENSE.html or http://ckeditor.com/license
+::
+:: Build the _docs/api documentation files.
+::
+
+ECHO Building the API document at _docs/api...
+
+del /F /Q "../../_docs/api/*.*"
+
+java -jar ../_thirdparty/jsdoc-toolkit/jsrun.jar ../_thirdparty/jsdoc-toolkit/app/run.js -c=docs_build.conf
+
+:: php ../fixlineends/fixlineends.php --eolstripwhite --eofnewline --eofstripwhite --nohidden --nosystem ../../_docs/api/
+
+ECHO Finished!
Index: /CKEditor/tags/3.0 Beta/_dev/docs_build/docs_build.conf
===================================================================
--- /CKEditor/tags/3.0 Beta/_dev/docs_build/docs_build.conf	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_dev/docs_build/docs_build.conf	(revision 3046)
@@ -0,0 +1,36 @@
+﻿/*
+	This is an example of one way you could set up a configuration file to more
+	conveniently define some commandline options. You might like to do this if
+	you frequently reuse the same options. Note that you don't need to define
+	every option in this file, you can combine a configuration file with
+	additional options on the commandline if your wish.
+
+	You would include this configuration file by running JsDoc Toolkit like so:
+	java -jar jsrun.jar app/run.js -c=conf/sample.conf
+
+*/
+
+{
+	// Source files to parse.
+	_:
+	[
+		'../../_source/core/',
+		'../../_source/plugins/',
+		'../../_source/lang/en.js'
+	],
+
+	// Document all functions, even uncommented ones.
+	a: true,
+
+	// Recursively, up to 100 directories depth.
+	r: 100,
+
+	// use this directory as the output directory
+	d: '../../_docs/api',
+
+	// Template.
+	t: 'template',
+
+	// Verbose mode.
+	v: true
+}
Index: /CKEditor/tags/3.0 Beta/_dev/docs_build/template/allclasses.tmpl
===================================================================
--- /CKEditor/tags/3.0 Beta/_dev/docs_build/template/allclasses.tmpl	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_dev/docs_build/template/allclasses.tmpl	(revision 3046)
@@ -0,0 +1,26 @@
+<div align="center">
+	{+new Link().toFile("index.html").withText("Code Index")+}
+	| {+new Link().toFile("files.html").withText("File Index")+}
+</div>
+<hr />
+<h2>Namespaces</h2>
+<ul class="classList">
+	<for each="thisClass" in="data">
+		<if test="thisClass.isNamespace && thisClass.alias != '_global_'">
+			<li>
+				{+ new Link().toClass(thisClass.alias) +}
+			</li>
+		</if>
+	</for>
+</ul>
+<h2>Classes</h2>
+<ul class="classList">
+	<for each="thisClass" in="data">
+		<if test="!thisClass.isNamespace">
+			<li>
+				{+ new Link().toClass(thisClass.alias) +}
+			</li>
+		</if>
+	</for>
+</ul>
+<hr />
Index: /CKEditor/tags/3.0 Beta/_dev/docs_build/template/allfiles.tmpl
===================================================================
--- /CKEditor/tags/3.0 Beta/_dev/docs_build/template/allfiles.tmpl	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_dev/docs_build/template/allfiles.tmpl	(revision 3046)
@@ -0,0 +1,53 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+	<head>
+		<meta http-equiv="content-type" content="text/html; charset={+IO.encoding+}"" />
+		{! Link.base = ""; /* all generated links will be relative to this */ !}
+		<title>File Index - CKEditor 3.0 JavaScript API Documentation</title>
+		<meta name="generator" content="JsDoc Toolkit" />
+		
+		<style type="text/css">
+		{+include("static/default.css")+}
+		</style>
+	</head>
+	
+	<body>
+		{+include("static/header.html")+}
+		
+		<div id="index">
+			{+publish.classesIndex+}
+		</div>
+		
+		<div id="content">
+			<h1 class="classTitle">File Index</h1>
+			
+			<for each="item" in="data">
+			<div>
+				<h2>{+new Link().toSrc(item.alias).withText(item.name)+}</h2>
+				<if test="item.desc">{+resolveLinks(summarize(item.desc))+}</if>
+				<dl>
+					<if test="item.author">
+						<dt class="heading">Author:</dt>
+						<dd>{+item.author+}</dd>
+					</if>
+					<if test="item.version">
+						<dt class="heading">Version:</dt>
+							<dd>{+item.version+}</dd>
+					</if>
+					{! var locations = item.comment.getTag('location').map(function($){return $.toString().replace(/(^\$ ?| ?\$$)/g, '').replace(/^HeadURL: https:/g, 'http:');}) !}
+					<if test="locations.length">
+						<dt class="heading">Location:</dt>
+							<for each="location" in="locations">
+							<dd><a href="{+location+}">{+location+}</a></dd>
+							</for>
+					</if>
+				</dl>
+			</div>
+			<hr />
+			</for>
+			
+		</div>
+		{+include("static/footer.html")+}
+	</body>
+</html>
Index: /CKEditor/tags/3.0 Beta/_dev/docs_build/template/class.tmpl
===================================================================
--- /CKEditor/tags/3.0 Beta/_dev/docs_build/template/class.tmpl	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_dev/docs_build/template/class.tmpl	(revision 3046)
@@ -0,0 +1,536 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+	<head>
+		<meta http-equiv="content-type" content="text/html; charset={+IO.encoding+}" />
+		<meta name="generator" content="JsDoc Toolkit" />
+		{! Link.base = "../"; /* all generated links will be relative to this */ !}
+		<title>{+data.alias+} - CKEditor 3.0 JavaScript API Documentation</title>
+
+		<style type="text/css">
+			{+include("static/default.css")+}
+		</style>
+	</head>
+
+	<body>
+<!-- ============================== header ================================= -->	
+		<!-- begin static/header.html -->
+		{+include("static/header.html")+}
+		<!-- end static/header.html -->
+
+<!-- ============================== classes index ============================ -->
+		<div id="index">
+			<!-- begin publish.classesIndex -->
+			{+publish.classesIndex+}
+			<!-- end publish.classesIndex -->
+		</div>
+		
+		<div id="content">
+<!-- ============================== class title ============================ -->
+			<h1 class="classTitle">
+				{!
+					var classType = "";
+					
+					if (data.isBuiltin()) {
+						classType += "Built-In ";
+					}
+					
+					if (data.isNamespace) {
+						if (data.is('FUNCTION')) {
+							classType += "Function ";
+						}
+						classType += "Namespace ";
+					}
+					else {
+						classType += "Class ";
+					}
+				!}
+				{+classType+}{+data.alias+}
+			</h1>
+
+<!-- ============================== class summary ========================== -->			
+			<p class="description">
+				<if test="data.augments.length"><br />Extends
+					{+
+						data.augments
+						.sort()
+						.map(
+							function($) { return new Link().toSymbol($); }
+						)
+						.join(", ")
+					+}.<br />
+				</if>
+			
+				{+resolveLinks(data.classDesc)+}
+				
+				<if test="!data.isBuiltin()">{# isn't defined in any file #}
+					<br /><i>Defined in: </i> {+ ckeditor_FileLink( data.srcFile ) +}.
+				</if>
+			</p>
+
+<!-- ============================== constructor summary ==================== -->			
+			<if test="!data.isBuiltin() && (data.isNamespace || data.is('CONSTRUCTOR'))">
+			<table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class {+data.alias+}.">
+				<caption>{+classType+}Summary</caption>
+				<thead>
+					<tr>
+						<th scope="col">Constructor Attributes</th>
+						<th scope="col">Constructor Name and Description</th>
+					</tr>
+				</thead>
+				<tbody>
+					<tr>
+						<td class="attributes">{!
+							if (data.isPrivate) output += "&lt;private&gt; ";
+							if (data.isInner) output += "&lt;inner&gt; ";
+						!}&nbsp;</td>
+						<td class="nameDescription" {!if (data.comment.getTag("hilited").length){output += 'style="color: red"'}!}>
+							<div class="fixedFont">
+								<b>{+ new Link().toSymbol(data.alias).inner('constructor')+}</b><if test="classType != 'Namespace '">{+ makeSignature(data.params) +}</if>
+							</div>
+							<div class="description">{+resolveLinks(summarize(data.desc))+}</div>
+						</td>
+					</tr>
+				</tbody>
+			</table>
+			</if>
+
+<!-- ============================== properties summary ===================== -->
+			<if test="data.properties.length">
+
+				{! var ownConstants = data.properties.filter(function($){return $.memberOf == data.alias && !$.isNamespace && $.isConstant}).sort( ckeditor_sortByType ); !}
+				<if test="ownConstants.length">
+				<table class="summaryTable" cellspacing="0" summary="A summary of the constants documented in the class {+data.alias+}.">
+					<caption>Constants Summary</caption>
+					<thead>
+						<tr>
+							<th scope="col">Constant Attributes</th>
+							<th scope="col">Constant Name and Description</th>
+						</tr>
+					</thead>
+					<tbody>
+					<for each="member" in="ownConstants">
+						<tr>
+							<td class="attributes">{!
+								if (member.isPrivate) output += "&lt;private&gt; ";
+								if (member.isInner) output += "&lt;inner&gt; ";
+								if (member.isStatic) output += "&lt;static&gt; ";
+							!}&nbsp;</td>
+							<td class="nameDescription">
+								<div class="fixedFont">
+								<if test="member.isStatic && member.memberOf != '_global_'">{+member.memberOf+}.</if><b>{+new Link().toSymbol(member.alias).withText(member.name)+}</b>
+								</div>
+								<div class="description">{+resolveLinks(summarize(member.desc))+}</div>
+							</td>
+						</tr>
+					</for>
+					</tbody>
+				</table>
+				</if>
+
+				{! var ownProperties = data.properties.filter(function($){return $.memberOf == data.alias && !$.isNamespace && !$.isConstant}).sort( ckeditor_sortByType ); !}
+				<if test="ownProperties.length">
+				<table class="summaryTable" cellspacing="0" summary="A summary of the fields documented in the class {+data.alias+}.">
+					<caption>Field Summary</caption>
+					<thead>
+						<tr>
+							<th scope="col">Field Attributes</th>
+							<th scope="col">Field Name and Description</th>
+						</tr>
+					</thead>
+					<tbody>
+					<for each="member" in="ownProperties">
+						<tr>
+							<td class="attributes">{!
+								if (member.isPrivate) output += "&lt;private&gt; ";
+								if (member.isInner) output += "&lt;inner&gt; ";
+								if (member.isStatic) output += "&lt;static&gt; ";
+								if (member.isConstant) output += "&lt;constant&gt; ";
+							!}&nbsp;</td>
+							<td class="nameDescription">
+								<div class="fixedFont">
+								<if test="member.isStatic && member.memberOf != '_global_'">{+member.memberOf+}.</if><b>{+new Link().toSymbol(member.alias).withText(member.name)+}</b>
+								</div>
+								<div class="description">{+resolveLinks(summarize(member.desc))+}</div>
+							</td>
+						</tr>
+					</for>
+					</tbody>
+				</table>
+				</if>
+				
+				<if test="data.inheritsFrom.length">
+				<dl class="inheritsList">
+				{!
+					var borrowedMembers = data.properties.filter(function($) {return $.memberOf != data.alias});
+					
+					var contributers = [];
+					borrowedMembers.map(function($) {if (contributers.indexOf($.memberOf) < 0) contributers.push($.memberOf)});
+					for (var i = 0, l = contributers.length; i < l; i++) {
+						output +=
+							"<dt>Fields borrowed from class "+new Link().toSymbol(contributers[i])+": </dt>"
+							+
+							"<dd>" +
+							borrowedMembers
+							.filter(
+								function($) { return $.memberOf == contributers[i] }
+							)
+							.sort(makeSortby("name"))
+							.map(
+								function($) { return new Link().toSymbol($.alias).withText($.name) }
+							)
+							.join(", ")
+							+
+							"</dd>";
+					}
+				!}
+				</dl>
+				</if>
+			</if>
+
+<!-- ============================== methods summary ======================== -->
+			<if test="data.methods.length">
+				{! var ownMethods = data.methods.filter(function($){return $.memberOf == data.alias  && !$.isNamespace}).sort( ckeditor_sortByType ); !}
+				<if test="ownMethods.length">
+				<table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class {+data.alias+}.">
+					<caption>Method Summary</caption>
+					<thead>
+						<tr>
+							<th scope="col">Method Attributes</th>
+							<th scope="col">Method Name and Description</th>
+						</tr>
+					</thead>
+					<tbody>
+					<for each="member" in="ownMethods">
+						<tr>
+							<td class="attributes">{!
+								if (member.isPrivate) output += "&lt;private&gt; ";
+								if (member.isInner) output += "&lt;inner&gt; ";
+								if (member.isStatic) output += "&lt;static&gt; ";
+							!}&nbsp;</td>
+							<td class="nameDescription">
+								<div class="fixedFont"><if test="member.isStatic && member.memberOf != '_global_'">{+member.memberOf+}.</if><b>{+new Link().toSymbol(member.alias).withText(member.name)+}</b>{+makeSignature(member.params)+}
+								</div>
+								<div class="description">{+resolveLinks(summarize(member.desc))+}</div>
+							</td>
+						</tr>
+					</for>
+					</tbody>
+				</table>
+				</if>
+				
+				<if test="data.inheritsFrom.length">
+				<dl class="inheritsList">
+				{!
+					var borrowedMembers = data.methods.filter(function($) {return $.memberOf != data.alias});
+					var contributers = [];
+					borrowedMembers.map(function($) {if (contributers.indexOf($.memberOf) < 0) contributers.push($.memberOf)});
+					for (var i = 0, l = contributers.length; i < l; i++) {
+						output +=
+							"<dt>Methods borrowed from class "+new Link().toSymbol(contributers[i])+": </dt>"
+							+
+							"<dd>" +
+							borrowedMembers
+							.filter(
+								function($) { return $.memberOf == contributers[i] }
+							)
+							.sort(makeSortby("name"))
+							.map(
+								function($) { return new Link().toSymbol($.alias).withText($.name) }
+							)
+							.join(", ")
+							+
+							"</dd>";
+					}
+				
+				!}
+				</dl>
+				</if>
+			</if>
+
+<!-- ============================== constructor details ==================== -->		
+			<if test="!data.isBuiltin() && (data.isNamespace || data.is('CONSTRUCTOR'))">
+			<div class="details"><a name="constructor"> </a>
+				<div class="sectionTitle">
+					{+classType+}Detail
+				</div>
+				
+				<div class="fixedFont" style="float:left">{!
+					if (data.isPrivate) output += "&lt;private&gt; ";
+					if (data.isInner) output += "&lt;inner&gt; ";
+				!}
+						<b>{+ data.alias +}</b><if test="classType != 'Namespace '">{+ makeSignature(data.params) +}</if>
+				</div>
+
+				<div style="float:right">
+					<span class="heading">Since:</span>
+						<if test="data.since">
+							{+ data.since +}
+						<else />
+							3.0
+						</if>
+				</div>
+				<div style="clear:both"></div>
+				
+				<div class="description">
+					{+resolveLinks(data.desc)+}
+					<if test="data.author"><br /><i>Author: </i>{+data.author+}.</if>
+				</div>
+				
+				<if test="data.example.length">
+				<for each="example" in="data.example">
+					<if test="example.desc">
+						<pre class="code">{+example+}</pre>
+					</if>
+				</for>
+				<else />
+					<pre class="code"><span style="color:red">NO EXAMPLE AVAILABLE</span></pre>
+				</if>
+				
+				
+					<if test="data.params.length">
+						<dl class="detailList">
+						<dt class="heading">Parameters:</dt>
+						<for each="item" in="data.params">
+							<dt>
+								<span class="light fixedFont">{{+ new Link().toSymbol(item.type || 'Undefined') +}}</span> <b>{+item.name+}</b>
+								<if test="item.isOptional"><i>Optional<if test="item.defaultValue">, Default: {+item.defaultValue+}</if></i></if>
+							</dt>
+								<dd>{+resolveLinks(item.desc)+}</dd>
+						</for>
+						</dl>
+					</if>
+					<if test="data.deprecated">
+						<dl class="detailList">
+						<dt class="heading">Deprecated:</dt>
+						<dt>
+							{+resolveLinks(data.deprecated)+}
+						</dt>
+						</dl>
+					</if>
+					<if test="data.exceptions.length">
+						<dl class="detailList">
+						<dt class="heading">Throws:</dt>
+						<for each="item" in="data.exceptions">
+							<dt>
+								<span class="light fixedFont">{{+ new Link().toSymbol(item.type || 'Undefined') +}}</span> <b>{+item.name+}</b>
+							</dt>
+								<dd>{+resolveLinks(item.desc)+}</dd>
+						</for>
+						</dl>
+					</if>
+					<if test="data.returns.length">
+						<dl class="detailList">
+						<dt class="heading">Returns:</dt>
+						<for each="item" in="data.returns">
+								<dd><span class="light fixedFont">{{+ new Link().toSymbol(item.type || 'Undefined') +}}</span> {+resolveLinks(item.desc)+}</dd>
+						</for>
+						</dl>
+					</if>
+					<if test="data.requires.length">
+						<dl class="detailList">
+						<dt class="heading">Requires:</dt>
+						<for each="item" in="data.requires">
+							<dd>{+ resolveLinks(item) +}</dd>
+						</for>
+						</dl>
+					</if>
+					<if test="data.see.length">
+						<dl class="detailList">
+						<dt class="heading">See:</dt>
+						<for each="item" in="data.see">
+							<dd>{+ new Link().toSymbol(item) +}</dd>
+						</for>
+						</dl>
+					</if>
+
+			</div>
+			</if>
+
+<!-- ============================== field details ========================== -->		
+			<if test="defined(ownProperties) && ownProperties.length">
+				<div class="sectionTitle">
+					Field Detail
+				</div>
+				<for each="member" in="ownProperties">
+					<a name="{+Link.symbolNameToLinkName(member)+}"> </a>
+					<div class="fixedFont" style="float:left">{!
+						if (member.isPrivate) output += "&lt;private&gt; ";
+						if (member.isInner) output += "&lt;inner&gt; ";
+						if (member.isStatic) output += "&lt;static&gt; ";
+						if (member.isConstant) output += "&lt;constant&gt; ";
+					!}
+					
+					<span class="light">{{+ new Link().toSymbol( member.type || 'Undefined') +}}</span>
+					<if test="member.isStatic && member.memberOf != '_global_'"><span class="light">{+member.memberOf+}.</span></if><b>{+member.name+}</b>
+					
+					</div>
+					<div style="float:right">
+						<span class="heading">Since:</span>
+							<if test="member.since">
+								{+ member.since +}
+							<else />
+								3.0
+							</if>
+					</div>
+					<div style="clear:both"></div>
+					<div class="description">
+						{+resolveLinks(member.desc)+}
+						<if test="member.srcFile != data.srcFile">
+							<br />
+							<i>Defined in: </i> {+ ckeditor_FileLink( member.srcFile ) +}.
+						</if>
+						<if test="member.author"><br /><i>Author: </i>{+member.author+}.</if>
+					</div>
+					
+					<if test="member.example.length">
+					<for each="example" in="member.example">
+						<if test="example.desc">
+							<pre class="code">{+example+}</pre>
+						</if>
+					</for>
+					<else />
+						<pre class="code"><span style="color:red">NO EXAMPLE AVAILABLE</span></pre>
+					</if>
+
+						<if test="member.deprecated">
+							<dl class="detailList">
+							<dt class="heading">Deprecated:</dt>
+							<dt>
+								{+ member.deprecated +}
+							</dt>
+							</dl>
+						</if>
+						<if test="member.see.length">
+							<dl class="detailList">
+							<dt class="heading">See:</dt>
+							<for each="item" in="member.see">
+							<dd>{+ new Link().toSymbol(item) +}</dd>
+							</for>
+							</dl>
+						</if>
+						<if test="member.defaultValue">
+							<dl class="detailList">
+							<dt class="heading">Default Value:</dt>
+							<dd>
+								{+resolveLinks(member.defaultValue)+}
+							</dd>
+							</dl>
+						</if>
+
+					<if test="!$member_last"><hr /></if>
+				</for>
+			</if>
+
+<!-- ============================== method details ========================= -->		
+			<if test="defined(ownMethods) && ownMethods.length">
+				<div class="sectionTitle">
+					Method Detail
+				</div>
+				<for each="member" in="ownMethods">
+					<a name="{+Link.symbolNameToLinkName(member)+}"> </a>
+					<div class="fixedFont" style="float:left">{!
+						if (member.isPrivate) output += "&lt;private&gt; ";
+						if (member.isInner) output += "&lt;inner&gt; ";
+						if (member.isStatic) output += "&lt;static&gt; ";
+					!}
+					
+					<span class="light">{{+ new Link().toSymbol( member.type || 'Undefined') +}}</span>
+					<if test="member.isStatic && member.memberOf != '_global_'"><span class="light">{+member.memberOf+}.</span></if><b>{+member.name+}</b>{+makeSignature(member.params)+}
+					
+					</div>
+					<div style="float:right">
+						<span class="heading">Since:</span>
+							<if test="member.since">
+								{+ member.since +}
+							<else />
+								3.0
+							</if>
+					</div>
+					<div style="clear:both"></div>
+					<div class="description">
+						{+resolveLinks(member.desc)+}
+						<if test="member.srcFile != data.srcFile">
+							<br />
+							<i>Defined in: </i> {+ ckeditor_FileLink( member.srcFile ) +}.
+						</if>
+						<if test="member.author"><br /><i>Author: </i>{+member.author+}.</if>
+					</div>
+					
+					<if test="member.example.length">
+					<for each="example" in="member.example">
+						<if test="example.desc">
+							<pre class="code">{+example+}</pre>
+						</if>
+					</for>
+					<else />
+						<pre class="code"><span style="color:red">NO EXAMPLE AVAILABLE</span></pre>
+					</if>
+					
+						<if test="member.params.length">
+							<dl class="detailList">
+							<dt class="heading">Parameters:</dt>
+							<for each="item" in="member.params">
+								<dt>
+									<span class="light fixedFont">{{+ new Link().toSymbol(item.type || 'Undefined') +}}</span> <b>{+item.name+}</b>
+									<if test="item.isOptional"><i>Optional<if test="item.defaultValue">, Default: {+item.defaultValue+}</if></i></if>
+								</dt>
+								<dd>{+resolveLinks(item.desc)+}</dd>
+							</for>
+							</dl>
+						</if>
+						<if test="member.deprecated">
+							<dl class="detailList">
+							<dt class="heading">Deprecated:</dt>
+							<dt>
+								{+member.deprecated+}
+							</dt>
+							</dl>
+						</if>
+						<if test="member.exceptions.length">
+							<dl class="detailList">
+							<dt class="heading">Throws:</dt>
+							<for each="item" in="member.exceptions">
+								<dt>
+									<span class="light fixedFont">{{+ new Link().toSymbol(item.type || 'Undefined') +}}</span> <b>{+item.name+}</b>
+								</dt>
+								<dd>{+resolveLinks(item.desc)+}</dd>
+							</for>
+							</dl>
+						</if>
+						<if test="member.returns.length">
+							<dl class="detailList">
+							<dt class="heading">Returns:</dt>
+							<for each="item" in="member.returns">
+								<dd><span class="light fixedFont">{{+ new Link().toSymbol(item.type || 'Undefined') +}}</span> {+resolveLinks(item.desc)+}</dd>
+							</for>
+							</dl>
+						</if>
+						<if test="member.requires.length">
+							<dl class="detailList">
+							<dt class="heading">Requires:</dt>
+							<for each="item" in="member.requires">
+								<dd>{+ resolveLinks(item) +}</dd>
+							</for>
+							</dl>
+						</if>
+						<if test="member.see.length">
+							<dl class="detailList">
+							<dt class="heading">See:</dt>
+							<for each="item" in="member.see">
+								<dd>{+ new Link().toSymbol(item) +}</dd>
+							</for>
+							</dl>
+						</if>
+
+					<if test="!$member_last"><hr /></if>
+				</for>
+			</if>
+			
+			<hr />
+		</div>
+		
+<!-- ============================== footer ================================= -->
+		{+include("static/footer.html")+}
+	</body>
+</html>
Index: /CKEditor/tags/3.0 Beta/_dev/docs_build/template/index.tmpl
===================================================================
--- /CKEditor/tags/3.0 Beta/_dev/docs_build/template/index.tmpl	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_dev/docs_build/template/index.tmpl	(revision 3046)
@@ -0,0 +1,50 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+	<head>
+		<meta http-equiv="content-type" content="text/html; charset={+IO.encoding+}"" />
+		
+		<title>CKEditor 3.0 JavaScript API Documentation</title>
+		<meta name="generator" content="JsDoc Toolkit" />
+		
+		<style type="text/css">
+		{+include("static/default.css")+}
+		</style>
+	</head>
+	
+	<body>
+		{+include("static/header.html")+}
+		
+		<div id="index">
+			{+publish.classesIndex+}
+		</div>
+		
+		<div id="content">
+			<h1 class="classTitle">Namespace Index</h1>
+			
+			<for each="thisClass" in="data">
+				<if test="thisClass.isNamespace && thisClass.alias != '_global_'">
+					<div>
+						<h2>{+(new Link().toSymbol(thisClass.alias))+}</h2>
+						{+resolveLinks(summarize(thisClass.classDesc))+}
+					</div>
+					<hr />
+				</if>
+			</for>
+
+			<h1 class="classTitle">Class Index</h1>
+			
+			<for each="thisClass" in="data">
+				<if test="!thisClass.isNamespace">
+					<div>
+						<h2>{+(new Link().toSymbol(thisClass.alias))+}</h2>
+						{+resolveLinks(summarize(thisClass.classDesc))+}
+					</div>
+					<hr />
+				</if>
+			</for>
+			
+		</div>
+		{+include("static/footer.html")+}
+	</body>
+</html>
Index: /CKEditor/tags/3.0 Beta/_dev/docs_build/template/publish.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_dev/docs_build/template/publish.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_dev/docs_build/template/publish.js	(revision 3046)
@@ -0,0 +1,214 @@
+function publish(symbolSet) {
+	publish.conf = {  // trailing slash expected for dirs
+		ext: ".html",
+		outDir: JSDOC.opt.d || SYS.pwd+"../out/jsdoc/",
+		templatesDir: JSDOC.opt.t.replace( /\/+$/, '' ) + '/',
+		symbolsDir: "symbols/",
+		srcDir: "symbols/src/"
+	};
+	if (!IO.exists(publish.conf.templatesDir)) {
+		publish.conf.templatesDir = SYS.userDir.replace( /\\/g, '/' ).replace( /\/+$/ ) + '/' + JSDOC.opt.t.replace( /\/+$/, '' ) + '/';
+	}
+
+	if (JSDOC.opt.s && defined(Link) && Link.prototype._makeSrcLink) {
+		Link.prototype._makeSrcLink = function(srcFilePath) {
+			return "&lt;"+srcFilePath+"&gt;";
+		}
+	}
+
+	IO.mkPath((publish.conf.outDir+"symbols/src").split("/"));
+
+	// used to check the details of things being linked to
+	Link.symbolSet = symbolSet;
+
+	try {
+		var classTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"class.tmpl");
+		var classesTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"allclasses.tmpl");
+	}
+	catch(e) {
+		print(e.message);
+		quit();
+	}
+
+	// filters
+	function hasNoParent($) {return ($.memberOf == "")}
+	function isaFile($) {return ($.is("FILE"))}
+	function isaClass($) {return ($.is("CONSTRUCTOR") || $.isNamespace)}
+
+	var symbols = symbolSet.toArray();
+
+	var files = JSDOC.opt.srcFiles;
+ 	for (var i = 0, l = files.length; i < l; i++) {
+ 		var file = files[i];
+ 		var srcDir = publish.conf.outDir + "symbols/src/";
+		makeSrcFile(file, srcDir);
+ 	}
+
+ 	var classes = symbols.filter(isaClass).sort(makeSortby("alias"));
+
+	Link.base = "../";
+ 	publish.classesIndex = classesTemplate.process(classes); // kept in memory
+
+	for (var i = 0, l = classes.length; i < l; i++) {
+		var symbol = classes[i];
+		var output = "";
+		output = classTemplate.process(symbol);
+
+		IO.saveFile(publish.conf.outDir+"symbols/", symbol.alias+publish.conf.ext, output);
+	}
+
+	// regenrate the index with different relative links
+	Link.base = "";
+	publish.classesIndex = classesTemplate.process(classes);
+
+	try {
+		var classesindexTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"index.tmpl");
+	}
+	catch(e) { print(e.message); quit(); }
+
+	var classesIndex = classesindexTemplate.process(classes);
+	IO.saveFile(publish.conf.outDir, "index"+publish.conf.ext, classesIndex);
+	classesindexTemplate = classesIndex = classes = null;
+
+	try {
+		var fileindexTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"allfiles.tmpl");
+	}
+	catch(e) { print(e.message); quit(); }
+
+	var documentedFiles = symbols.filter(isaFile);
+	var allFiles = [];
+
+	for (var i = 0; i < files.length; i++) {
+		allFiles.push(new JSDOC.Symbol(files[i], [], "FILE", new JSDOC.DocComment("/** */")));
+	}
+
+	for (var i = 0; i < documentedFiles.length; i++) {
+		var offset = files.indexOf(documentedFiles[i].alias);
+		allFiles[offset] = documentedFiles[i];
+	}
+
+	allFiles = allFiles.sort( ckeditor_sortFiles );
+
+	var filesIndex = fileindexTemplate.process(allFiles);
+	IO.saveFile(publish.conf.outDir, "files"+publish.conf.ext, filesIndex);
+	fileindexTemplate = filesIndex = files = null;
+}
+
+
+/** Just the first sentence. Should not break on dotted variable names. */
+function summarize(desc) {
+	if (typeof desc != "undefined")
+		return desc.match(/([\w\W]+?\.)[^a-z0-9_$]/i)? RegExp.$1 : desc;
+}
+
+/** make a symbol sorter by some attribute */
+function makeSortby(attribute) {
+	return function(a, b) {
+		if (a[attribute] != undefined && b[attribute] != undefined) {
+			a = a[attribute].toLowerCase();
+			b = b[attribute].toLowerCase();
+			if (a < b) return -1;
+			if (a > b) return 1;
+			return 0;
+		}
+	}
+}
+
+function include(path) {
+	var path = publish.conf.templatesDir+path;
+	return IO.readFile(path);
+}
+
+function makeSrcFile(path, srcDir, name) {
+	if (JSDOC.opt.s) return;
+
+	if (!name) {
+		name = path.replace(/.*\.\.?[\\\/](.*)/g, "$1").replace(/[\\\/]/g, "_");
+		name = name.replace(/\:/g, "_");
+	}
+
+	var src = {path: path, name:name, charset: IO.encoding, hilited: ""};
+
+	if (defined(JSDOC.PluginManager)) {
+		JSDOC.PluginManager.run("onPublishSrc", src);
+	}
+
+	if (src.hilited) {
+		IO.saveFile(srcDir, name+publish.conf.ext, src.hilited);
+	}
+}
+
+function makeSignature(params) {
+	if (!params) return "()";
+	var signature = "("
+	+
+	params.filter(
+		function($) {
+			return $.name.indexOf(".") == -1; // don't show config params in signature
+		}
+	).map(
+		function($) {
+			return $.name;
+		}
+	).join(", ")
+	+
+	")";
+	return signature;
+}
+
+/** Find symbol {@link ...} strings in text and turn into html links */
+function resolveLinks(str, from) {
+	str = str.replace(/\{@link ([^} ]+) ?\}/gi,
+		function(match, symbolName) {
+			return new Link().toSymbol(symbolName);
+		}
+	);
+
+	return str;
+}
+
+function ckeditor_sortFiles( a, b )
+{
+	a = a.srcFile.replace( /.*[\\\/]/, '' );
+	b = b.srcFile.replace( /.*[\\\/]/, '' );
+	return a < b ? -1 : a > b ? 1 : 0;
+}
+
+/** Sorts a symbol by its type */
+function ckeditor_sortByType( a, b )
+{
+	var weightA =
+		a.isConstant ? 1 :
+		a.isStatic ? 2 :
+		a.isPrivate ? 3 :
+		a.isInner ? 4 : 5;
+
+	var weightB =
+		b.isConstant ? 1 :
+		b.isStatic ? 2 :
+		b.isPrivate ? 3 :
+		b.isInner ? 4 : 5;
+
+	if ( weightA == weightB )
+	{
+		weightA = a.name.toLowerCase();
+		weightB = b.name.toLowerCase();
+	}
+
+	return weightA < weightB ? -1 : weightA > weightB ? 1 : 0;
+}
+
+function ckeditor_FileLink( filePath )
+{
+	var text = filePath;
+
+	if ( /_source/.test( text ) )
+	{
+		text = text.replace( /[\/\\]+/g, '/' );
+		text = text.replace( /.*_source\/+/, '' );
+
+		return new Link().toSrc( filePath ).withText( text );
+	}
+
+	return new Link().toSrc( filePath );
+}
Index: /CKEditor/tags/3.0 Beta/_dev/docs_build/template/static/default.css
===================================================================
--- /CKEditor/tags/3.0 Beta/_dev/docs_build/template/static/default.css	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_dev/docs_build/template/static/default.css	(revision 3046)
@@ -0,0 +1,160 @@
+/* default.css */
+body
+{
+	font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
+}
+
+.header
+{
+	clear: both;
+	background-color: #ccc;
+	padding: 8px;
+}
+
+h1
+{
+	font-size: 150%;
+	font-weight: bold;
+	padding: 0;
+	margin: 1em 0 0 .3em;
+}
+
+hr
+{
+	border: none 0;
+	border-top: 1px solid #7F8FB1;
+	height: 1px;
+}
+
+pre.code
+{
+	display: block;
+	padding: 8px;
+	border: 1px dashed #ccc;
+}
+
+#index
+{
+	margin-top: 24px;
+	float: left;
+	width: 160px;
+	position: absolute;
+	left: 8px;
+	background-color: #F3F3F3;
+	padding: 8px;
+}
+
+#content
+{
+	margin-left: 190px;
+}
+
+.classList
+{
+	list-style-type: none;
+	padding: 0;
+	margin: 0 0 0 8px;
+	font-family: arial, sans-serif;
+	font-size: 1em;
+	overflow: auto;
+}
+
+.classList li
+{
+	padding: 0;
+	margin: 0 0 8px 0;
+}
+
+.summaryTable { width: 100%; }
+
+h1.classTitle
+{
+	font-size:170%;
+	line-height:130%;
+}
+
+h2 { font-size: 110%; }
+caption, div.sectionTitle
+{
+	background-color: #7F8FB1;
+	color: #fff;
+	font-size:130%;
+	text-align: left;
+	padding: 2px 6px 2px 6px;
+	border: 1px #7F8FB1 solid;
+}
+
+div.sectionTitle { margin-bottom: 8px; }
+.summaryTable thead { display: none; }
+
+.summaryTable td
+{
+	vertical-align: top;
+	padding: 4px;
+	border-bottom: 1px #7F8FB1 solid;
+	border-right: 1px #7F8FB1 solid;
+}
+
+/*col#summaryAttributes {}*/
+.summaryTable td.attributes
+{
+	border-left: 1px #7F8FB1 solid;
+	width: 140px;
+	text-align: right;
+}
+
+td.attributes, .fixedFont
+{
+	line-height: 15px;
+	color: #002EBE;
+	font-family: "Courier New",Courier,monospace;
+	font-size: 13px;
+}
+
+.summaryTable td.nameDescription
+{
+	text-align: left;
+	font-size: 13px;
+	line-height: 15px;
+}
+
+.summaryTable td.nameDescription, .description
+{
+	line-height: 15px;
+	padding: 4px;
+	padding-left: 4px;
+}
+
+.summaryTable { margin-bottom: 8px; }
+
+ul.inheritsList
+{
+	list-style: square;
+	margin-left: 20px;
+	padding-left: 0;
+}
+
+.detailList {
+	margin-left: 20px;
+	line-height: 15px;
+}
+.detailList dt { margin-left: 20px; }
+
+.detailList .heading
+{
+	font-weight: bold;
+	padding-bottom: 6px;
+	margin-left: 0;
+}
+
+.light, td.attributes, .light a:link, .light a:visited
+{
+	color: #777;
+	font-style: italic;
+}
+
+.fineprint
+{
+	text-align: right;
+	font-size: 10px;
+}
Index: /CKEditor/tags/3.0 Beta/_dev/docs_build/template/static/footer.html
===================================================================
--- /CKEditor/tags/3.0 Beta/_dev/docs_build/template/static/footer.html	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_dev/docs_build/template/static/footer.html	(revision 3046)
@@ -0,0 +1,3 @@
+<div class="fineprint" style="clear:both">
+	&copy; 2003 - 2008 Frederico Caldeira Knabben (<a href="http://www.fredck.com/">FredCK.com</a>). All rights reserved
+</div>
Index: /CKEditor/tags/3.0 Beta/_dev/docs_build/template/static/header.html
===================================================================
--- /CKEditor/tags/3.0 Beta/_dev/docs_build/template/static/header.html	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_dev/docs_build/template/static/header.html	(revision 3046)
@@ -0,0 +1,4 @@
+<div id="header">
+	<h1>CKEditor 3.0 JavaScript API Documentation</h1>
+	<hr />
+</div>
Index: /CKEditor/tags/3.0 Beta/_dev/docs_build/template/static/index.html
===================================================================
--- /CKEditor/tags/3.0 Beta/_dev/docs_build/template/static/index.html	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_dev/docs_build/template/static/index.html	(revision 3046)
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
+	<title>Generated Javascript Documentation</title>
+</head>
+<frameset cols="20%,80%">
+	<frame src="allclasses-frame.html" name="packageFrame" />
+	<frame src="splash.html" name="classFrame" />
+	<noframes>
+		<body>
+		<p>
+		This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
+		</p>
+		</body>
+	</noframes>
+</frameset>
+</html>
Index: /CKEditor/tags/3.0 Beta/_dev/docs_build/template/symbol.tmpl
===================================================================
--- /CKEditor/tags/3.0 Beta/_dev/docs_build/template/symbol.tmpl	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_dev/docs_build/template/symbol.tmpl	(revision 3046)
@@ -0,0 +1,35 @@
+<symbol alias="{+data.alias+}">
+	<name>{+data.name+}</name>
+	<memberOf>{+data.memberOf+}</memberOf>
+	<isStatic>{+data.isStatic+}</isStatic>
+	<isa>{+data.isa+}</isa>
+	<desc>{+data.desc+}</desc>
+	<classDesc>{+data.classDesc+}</classDesc>
+	
+	<methods><for each="method" in="data.methods">
+		<method>
+			<name>{+method.name+}</name>
+			<memberOf>{+method.memberOf+}</memberOf>
+			<isStatic>{+method.isStatic+}</isStatic>
+			<desc>{+method.desc+}</desc>
+			<params><for each="param" in="method.params">
+				<param>
+					<type>{+param.type+}</type>
+					<name>{+param.name+}</name>
+					<desc>{+param.desc+}</desc>
+					<defaultValue>{+param.defaultValue+}</defaultValue>
+				</param></for>
+			</params>
+		</method></for>
+	</methods>
+	
+	<properties><for each="property" in="data.properties">
+		<property>
+			<name>{+property.name+}</name>
+			<memberOf>{+property.memberOf+}</memberOf>
+			<isStatic>{+property.isStatic+}</isStatic>
+			<desc>{+property.desc+}</desc>
+			<type>{+property.type+}</type>
+		</property></for>
+	</properties>
+</symbol>
Index: /CKEditor/tags/3.0 Beta/_dev/dtd_test/dtd_test.html
===================================================================
--- /CKEditor/tags/3.0 Beta/_dev/dtd_test/dtd_test.html	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_dev/dtd_test/dtd_test.html	(revision 3046)
@@ -0,0 +1,65 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>CKEDITOR.dtd Contents</title>
+	<script type="text/javascript">
+	//<![CDATA[
+
+// Define the CKEDITOR namespace.
+var CKEDITOR = {};
+
+	//]]>
+	</script>
+	<script type="text/javascript" src="../../_source/core/tools.js"></script>
+	<script type="text/javascript" src="../../_source/core/dtd.js"></script>
+</head>
+<body>
+	<h1>
+		CKEDITOR.dtd Contents
+	</h1>
+	<table border="1">
+		<script type="text/javascript">
+		//<![CDATA[
+
+var entries = [];
+
+// Get all entries.
+for ( var p in CKEDITOR.dtd )
+{
+	var children = [];
+	for ( var c in CKEDITOR.dtd[p] )
+	{
+		children.push( c );
+	}
+	children.sort();
+	entries.push( [ p, children.join(', ') ] );
+}
+
+// Sort them alphabetically.
+entries.sort( function( a, b )
+	{
+		a = a[0];
+		b = b[0];
+
+		return a < b ? -1 :
+			a > b ? 1 : 0;
+	});
+
+// Writes the list.
+for ( var i = 0 ; i < entries.length ; i++ )
+{
+	document.write(
+		'<tr><td><b>' + entries[i][0] + '</b></td><td>' +
+		entries[i][1] +
+		'</td></tr>' );
+}
+
+		//]]>
+		</script>
+	</table>
+</body>
+</html>
Index: /CKEditor/tags/3.0 Beta/_dev/fixlineends/fixlineends.bat
===================================================================
--- /CKEditor/tags/3.0 Beta/_dev/fixlineends/fixlineends.bat	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_dev/fixlineends/fixlineends.bat	(revision 3046)
@@ -0,0 +1,7 @@
+@ECHO OFF
+::
+:: Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+:: For licensing, see LICENSE.html or http://ckeditor.com/license
+::
+
+php fixlineends.php --excluderegex=/(?:_dev[\\\/]_thirdparty)/ --eolstripwhite --eofnewline --eofstripwhite --nohidden --nosystem ../../
Index: /CKEditor/tags/3.0 Beta/_dev/fixlineends/fixlineends.php
===================================================================
--- /CKEditor/tags/3.0 Beta/_dev/fixlineends/fixlineends.php	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_dev/fixlineends/fixlineends.php	(revision 3046)
@@ -0,0 +1,607 @@
+#!/usr/bin/php -q
+<?php
+/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+
+Script for automatic line-ending corrections.
+Requires PHP5 to run: http://www.gophp5.org/ ;)
+*/
+
+error_reporting(E_ALL);
+
+/**
+ * Carriage return
+ *
+ */
+define('CR', "\r");
+/**
+ * Line feed
+ *
+ */
+define('LF', "\n");
+/**
+ * Carriage return + Line feed
+ *
+ */
+define('CRLF', "\r\n");
+
+/**
+ * Array, where:
+ *  file extension is the key
+ *  value is the new line character
+ */
+$list = array();
+$list["readme"] = CRLF;
+$list["afp"] = CRLF;
+$list["afpa"] = CRLF;
+$list["ascx"] = CRLF;
+$list["asp"] = CRLF;
+$list["aspx"] = CRLF;
+$list["bat"] = CRLF;
+$list["cfc"] = CRLF;
+$list["cfm"] = CRLF;
+$list["cgi"] = LF;
+$list["code"] = CRLF;
+$list["command"] = CRLF;
+$list["conf"] = CRLF;
+$list["css"] = CRLF;
+$list["dtd"] = CRLF;
+$list["htaccess"] = CRLF;
+$list["htc"] = CRLF;
+$list["htm"] = CRLF;
+$list["html"] = CRLF;
+$list["js"] = CRLF;
+$list["jsp"] = CRLF;
+$list["lasso"] = CRLF;
+$list["pack"] = CRLF;
+$list["php"] = CRLF;
+$list["pl"] = LF;
+$list["py"] = CRLF;
+$list["sample"] = CRLF;
+$list["sh"] = LF;
+$list["txt"] = CRLF;
+$list["xml"] = CRLF;
+
+/**
+ * Do not modify anything below
+ * use command line arguments to modify script's behaviour
+ */
+
+/**
+ * Strip whitespace from the end of file
+ * @var boolean $eofstripwhite
+ */
+$eofstripwhite = false;
+/**
+ * Strip whitespace from the end of line
+ * @var boolean $eolstripwhite
+ */
+$eolstripwhite = false;
+/**
+ * Force new line character at the end of file
+ * @var boolean $eofnewline
+ */
+$eofnewline = false;
+/**
+ * Windows only
+ * If set to true, archive files/folders are skipped
+ * @var boolean $noarchive
+ */
+$noarchive = false;
+/**
+ * Windows only
+ * If set to true, hidden files/folders are skipped
+ * @var boolean $nohidden
+ */
+$nohidden = false;
+/**
+ * Windows only
+ * If set to true, system files/folders are skipped
+ * @var boolean $nosystem
+ */
+$nosystem = false;
+/**
+ * If set to true, dot files are skipped
+ * @var boolean $nodotfiles
+ */
+$nodotfiles = false;
+/**
+ * How deep to recurse into subdirectories
+ * -1 to disable
+ *  0 to fix only current directory
+ *
+ * @var integer $maxdepth
+ */
+$maxdepth = -1;
+/**
+ * If set, regex is used to exclude files
+ * Warning: preg_match format expected
+ * example:
+ * --excluderegex = "/(\.\w+)$/"
+ *
+ * @var string $excluderegex
+ */
+$excluderegex = "";
+
+/**
+ * Set to true if script is launched in Windows
+ * @var boolean $windows
+ */
+$windows = (strtolower(substr(PHP_OS, 0, 3)) == "win");
+
+/**
+ * Count saved bytes
+ * @var integer $saved_bytes
+ */
+$saved_bytes = 0;
+
+/**
+ * Filter file list using regular expression (negative result)
+ *
+ */
+class NegRegexFilter extends FilterIterator
+{
+    protected $regex;
+    public function __construct(Iterator $it, $regex)
+    {
+        parent::__construct($it);
+        $this->regex=$regex;
+    }
+    public function accept()
+    {
+        return !preg_match($this->regex, $this->current());
+    }
+}
+
+/**
+ * Filter file list using regular expression
+ *
+ */
+class RegexFilter extends FilterIterator
+{
+    protected $regex;
+    public function __construct(Iterator $it, $regex)
+    {
+        parent::__construct($it);
+        $this->regex=$regex;
+    }
+    public function accept()
+    {
+        return preg_match($this->regex, $this->current());
+    }
+}
+
+/**
+ * Filter file list by depth
+ *
+ */
+class DepthFilter extends FilterIterator
+{
+    protected $depth;
+    public function __construct(Iterator $it, $depth)
+    {
+        parent::__construct($it);
+        $this->depth=$depth;
+    }
+    public function accept()
+    {
+        return $this->getInnerIterator()->getDepth()<$this->depth;
+    }
+}
+
+/**
+ * Fix new line characters in given file
+ * Returns true if file was changed
+ *
+ * @param string $path relative or absolute path name to file
+ * @param string $nl name of a constant that holds new line character (CRLF|CR|LF)
+ * @return bool
+ */
+function fixFile($path, $nl) {
+
+    $contents = file($path);
+    $size = filesize($path);
+    if ($contents === false) {
+        echo "\rERROR: couldn't read the " . $path . " file". "\n";
+        return false;
+    }
+
+    $modified = false;
+    $new_content = "";
+    $contents_len = sizeof($contents);
+
+    if ($GLOBALS['eofstripwhite']) {
+        $lines_processed=0;
+        //iterate through lines, from the end of file
+        for ($i=$contents_len-1; $i>=0; $i--) {
+            $old_line = $contents[$i];
+            $contents[$i] = rtrim($contents[$i]);
+            if ($old_line !== $contents[$i]) {
+                if (!$GLOBALS['eofnewline'] || $old_line !== $contents[$i] . constant($nl) || $lines_processed>0) {
+                    $modified = true;
+                }
+            }
+
+            if (empty($contents[$i])) {
+                //we have an empty line at the end of file, just skip it
+                unset($contents[$contents_len--]);
+            }
+            else {
+                if ($GLOBALS['eofnewline']) {
+                    $contents[$i] .= constant($nl);
+                    if ($old_line !== $contents[$i]) {
+                        $modified = true;
+                    }
+                }
+                //we have found non-empty line, there is no need to go further
+                break;
+            }
+            $lines_processed++;
+        }
+    }
+
+    for ($i=0; $i<$contents_len; $i++) {
+        $is_last_line = ($i == $contents_len-1);
+        $line = $contents[$i];
+
+        switch ($nl)
+        {
+            case 'CRLF':
+                if (substr($line, -2) !== CRLF) {
+                    if (substr($line, -1) === LF || substr($line, -1) === CR) {
+                        $line = substr($line, 0, -1) . CRLF;
+                        $modified = true;
+                    }
+                    elseif(strlen($line)) {
+                        if (!$is_last_line) {
+                            echo "\rERROR: wrong line ending: " . $path . "@line " . ($i+1) . "\n";
+                            return false;
+                        }
+                        elseif(!$GLOBALS['eofstripwhite']) {
+                            $line = $line . CRLF;
+                            $modified = true;
+                        }
+                    }
+                }
+                break;
+
+            case 'CR':
+                if (substr($line, -1) !== CR) {
+                    if (substr($line, -1) === LF) {
+                        $line = substr($line, 0, -1) . CR;
+                        $modified = true;
+                    }
+                    elseif(strlen($line)) {
+                        if (!$is_last_line) {
+                            echo "\rERROR: wrong line ending: " . $path . "@line " . ($i+1) . "\n";
+                            return false;
+                        }
+                        elseif(!$GLOBALS['eofstripwhite']) {
+                            $line = $line . CR;
+                            $modified = true;
+                        }
+                    }
+                }
+                break;
+
+            case 'LF':
+                if(substr($line, -2) === CRLF) {
+                    $line = substr($line, 0, -2) . LF;
+                    $modified = true;
+                }
+                elseif (substr($line, -1) !== LF) {
+                    if (substr($line, -1) === CR) {
+                        $line = substr($line, 0, -1) . LF;
+                        $modified = true;
+                    }
+                    elseif(strlen($line)) {
+                        if (!$is_last_line) {
+                            echo "\rERROR: wrong line ending: " . $path . "@line " . ($i+1) . "\n";
+                            return false;
+                        }
+                        elseif(!$GLOBALS['eofstripwhite']) {
+                            $line = $line . LF;
+                            $modified = true;
+                        }
+                    }
+                }
+                break;
+        }
+        if ($GLOBALS['eolstripwhite']) {
+            $before = strlen($line);
+            $line = preg_replace("/(?:\x09|\x20)+((?:\r|\n)+)$/", "$1", $line);
+            if (strlen($line) != $before) {
+                $modified = true;
+            }
+        }
+        $new_content .= $line;
+    }
+
+    if ($modified) {
+        $fp = fopen($path, "wb");
+        if (!$fp) {
+            echo "\rERROR: couldn't open the " . $path . " file". "\n";
+            return false;
+        }
+        else {
+            if (flock($fp, LOCK_EX)) {
+                fwrite($fp, $new_content);
+                flock($fp, LOCK_UN);
+                echo "\rMODIFIED to " . $nl . ": " . $path ;
+                if ($GLOBALS['eolstripwhite']) {
+                    $saved = $size - strlen($new_content);
+                    $GLOBALS['saved_bytes'] += $saved;
+                    if ($saved>0) {
+                        echo " (saved " . $saved . "B)";
+                    }
+                    else if ($saved<0) {
+                        echo " (" . abs($saved) . "B added)";
+                    }
+                }
+                echo "\n";
+            } else {
+                echo "\rERROR: couldn't lock the " . $path . " file". "\n";
+                return false;
+            }
+            fclose($fp);
+        }
+    }
+
+    return $modified;
+}
+
+/**
+ * Fix ending lines in all files at given path
+ *
+ * @param string $path
+ */
+function fixPath($path)
+{
+    if (is_file($path)) {
+        $ext = strtolower(substr($path, strrpos($path, ".")));
+        foreach (array('CRLF', 'LF', 'CR') as $nl) {
+            //find out what's the correct line ending and fix file
+            //no need to process further
+            if (in_array($ext, $GLOBALS['extList'][$nl])) {
+                echo "Fixing single file:\n";
+                fixFile($path, $nl);
+                break;
+            }
+        }
+
+    }
+    else {
+        $dir = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path), true);
+
+        if ($GLOBALS['maxdepth'] > -1) {
+            $dir = new DepthFilter($dir, $GLOBALS['maxdepth']+1);
+        }
+
+        $dir = new NegRegexFilter($dir, "/\/(\.svn|CVS)/");
+
+        if ($GLOBALS['excluderegex']) {
+            $dir = new NegRegexFilter($dir, $GLOBALS['excluderegex']);
+        }
+
+        foreach (array('CRLF', 'LF', 'CR') as $nl) {
+
+            $filtered_dir = new RegexFilter($dir, "/\.(".implode("|", $GLOBALS['extList'][$nl]).")$/i");
+
+            $extensions = array();
+            $j = 0;
+            $progressbar = "|/-\\";
+            foreach ($filtered_dir as $file) {
+                if (!is_dir($file)) {
+                    $basename = basename($file);
+
+                    //skip dot files
+                    if ($GLOBALS['nodotfiles']) {
+                        if (strpos($basename, ".") === 0) {
+                            continue;
+                        }
+                    }
+
+                    if ($GLOBALS['windows']) {
+                        $attribs = trim(substr(shell_exec("attrib " . $file), 0, 5));
+                        //skip archive files
+                        if ($GLOBALS['noarchive'] && false !== strpos($attribs, "A")) {
+                            print "\r ".$progressbar[$j++ % 4]. " ". str_pad(basename($file), 35, " ", STR_PAD_RIGHT)." SKIPPED";
+                            continue;
+                        }
+                        //skip hidden files
+                        if ($GLOBALS['nohidden'] && false !== strpos($attribs, "H")) {
+                            print "\r ".$progressbar[$j++ % 4]. " ". str_pad(basename($file), 35, " ", STR_PAD_RIGHT)." SKIPPED";
+                            continue;
+                        }
+                        //skip system files
+                        if ($GLOBALS['nosystem'] && false !== strpos($attribs, "S")) {
+                            print "\r ".$progressbar[$j++ % 4]. " ". str_pad(basename($file), 35, " ", STR_PAD_RIGHT)." SKIPPED";
+                            continue;
+                        }
+                    }
+
+                    fixFile($file, $nl);
+                    print "\r ".$progressbar[$j++ % 4]. " ". str_pad(basename($file), 35, " ", STR_PAD_RIGHT);
+                }
+            }
+        }
+    }
+}
+
+function printHelp() {
+    $help = <<<HELP
+
+SYNOPSIS
+       php fixlineends.php [options] PATH [PATH2...]
+
+DESCRIPTION
+       Traverse recursively all the paths given and fix line endings
+       in each file.
+
+OPTIONS
+       --eofnewline
+            force new line character at the end of file
+
+       --eofstripwhite
+            strip whitespace from the end of file
+
+       --eolstripwhite
+            strip whitespace from the end of line (spaces, tabs)
+
+       --excluderegex=regex
+            use regex to exclude files, preg_match() format expected
+
+       --help
+            display this help and exit
+
+       --noarchive
+            if set to true, archive files are skipped (Windows only)
+
+       --nodotfiles
+            if set to true, dot files are skipped
+
+       --nohidden
+            if set to true, hidden files are skipped (Windows only)
+
+       --nosystem
+            if set to true, system files are skipped (Windows only)
+
+       --maxdepth
+            fix line ends only if file is N or fewer levels below
+            the command line argument; Use --max-depth=0 to omit
+            subdirectories
+
+EXAMPLES
+            php fixlineends.php --eofstripwhite --eofnewline --maxdepth=1
+                --nodotfiles --excluderegex=/\_private/ .
+
+       This command fixes line endings in current directory and in
+       subdirectories placed one level below. Dot files are skipped.
+       Paths that match "_private" are skipped. White chars are stripped
+       at the end of file. New line character is added to the end of file
+       (if required).
+
+
+HELP;
+    echo $help;
+}
+
+function translateCommandArgs($args) {
+    $paths = $args[1];
+
+    foreach ($paths as $path) {
+        if (!is_dir($path) && !is_file($path)) {
+            die("Entered path is invalid: " . $path);
+        }
+    }
+
+    foreach ($args[0] as $arg) {
+        if (!isset($arg[0])) {
+            continue;
+        }
+        switch ($arg[0]) {
+            case '--noarchive':
+                $GLOBALS['noarchive'] = true;
+                break;
+
+            case '--help':
+                printHelp();
+                die();
+                break;
+
+            case '--maxdepth':
+                $GLOBALS['maxdepth'] = intval($arg[1]);
+                break;
+
+            case '--nohidden':
+                $GLOBALS['nohidden'] = true;
+                break;
+
+            case '--nosystem':
+                $GLOBALS['nosystem'] = true;
+                break;
+
+            case '--nodotfiles':
+                $GLOBALS['nodotfiles'] = true;
+                break;
+
+            case '--excluderegex':
+                $GLOBALS['excluderegex'] = $arg[1];
+                break;
+
+            case '--eofnewline':
+                $GLOBALS['eofnewline'] = true;
+                break;
+
+            case '--eofstripwhite':
+                $GLOBALS['eofstripwhite'] = true;
+                break;
+
+            case '--eolstripwhite':
+                $GLOBALS['eolstripwhite'] = true;
+                break;
+        }
+    }
+
+    return $paths;
+}
+
+//$extList holds the associative array of extensions
+//key is the name of a constant that holds the line character
+$extList = array();
+$extList['CRLF'] = $extList['CR'] = $extList['LF'] = array();
+
+foreach ($list as $ext => $nl) {
+    $extRegex = preg_quote($ext);
+    switch ($nl) {
+        case CRLF:
+            $extList['CRLF'][] = $extRegex;
+            break;
+        case LF:
+            $extList['LF'][] = $extRegex;
+            break;
+        case CR:
+            $extList['CR'][] = $extRegex;
+            break;
+        default:
+            die("Unknown line ending");
+            break;
+    }
+}
+
+if ($_SERVER['argc']>1) {
+	include "../_thirdparty/console_getopt/Getopt.php";
+
+    if ($windows) {
+        $longoptions = array("eofstripwhite", "eofnewline", "eolstripwhite", "help", "noarchive", "nohidden", "nosystem", "nodotfiles", "maxdepth=", "excluderegex=");
+    }
+    else {
+        $longoptions = array("eofstripwhite", "eofnewline", "eolstripwhite", "help", "nodotfiles", "maxdepth=", "excluderegex=");
+    }
+
+    $con  = new Console_Getopt;
+    $args = $con->readPHPArgv();
+    $options = $con->getopt($args, null, $longoptions);
+
+    if (PEAR::isError($options)) {
+        die($options->getMessage());
+    }
+
+    $paths = translateCommandArgs($options);
+    foreach ($paths as $path) {
+        fixPath($path);
+    }
+}
+else {
+    printHelp();
+    die();
+}
+
+print "\rDone!".str_repeat(" ",40)."\n";
+if ($saved_bytes>0) {
+    echo "saved " . $saved_bytes . "B";
+}
+else if ($saved_bytes<0) {
+    echo abs($saved_bytes) . "B added";
+}
Index: /CKEditor/tags/3.0 Beta/_dev/jslint/lint.bat
===================================================================
--- /CKEditor/tags/3.0 Beta/_dev/jslint/lint.bat	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_dev/jslint/lint.bat	(revision 3046)
@@ -0,0 +1,28 @@
+@ECHO OFF
+::
+:: Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+:: For licensing, see LICENSE.html or http://ckeditor.com/license
+::
+:: Calls the JavaScript Lint (jsl) with the predefined configurations.
+:: If a file name is passed as a parameter it writes there the results,
+:: otherwise it simply outputs it.
+::
+
+IF "%1"=="" GOTO NoParam
+
+ECHO Generating %1...
+bin\jsl -conf lint.conf -nofilelisting -nologo > %1
+
+ECHO.
+ECHO Process completed.
+ECHO.
+
+GOTO End
+
+:NoParam
+
+"../_thirdparty/jsl/jsl.exe" -conf lint.conf -nofilelisting -nologo
+
+ECHO.
+
+:End
Index: /CKEditor/tags/3.0 Beta/_dev/jslint/lint.conf
===================================================================
--- /CKEditor/tags/3.0 Beta/_dev/jslint/lint.conf	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_dev/jslint/lint.conf	(revision 3046)
@@ -0,0 +1,149 @@
+#
+# Configuration File for JavaScript Lint 0.3.0
+# Developed by Matthias Miller (http://www.JavaScriptLint.com)
+#
+# This configuration file can be used to lint a collection of scripts, or to enable
+# or disable warnings for scripts that are linted via the command line.
+#
+
+### Warnings
+# Enable or disable warnings based on requirements.
+# Use "+WarningName" to display or "-WarningName" to suppress.
+#
++no_return_value              # function {0} does not always return a value
++duplicate_formal             # duplicate formal argument {0}
++equal_as_assign              # test for equality (==) mistyped as assignment (=)?{0}
++var_hides_arg                # variable {0} hides argument
++redeclared_var               # redeclaration of {0} {1}
++anon_no_return_value         # anonymous function does not always return a value
++missing_semicolon            # missing semicolon
++meaningless_block            # meaningless block; curly braces have no impact
+-comma_separated_stmts        # multiple statements separated by commas (use semicolons?)
++unreachable_code             # unreachable code
++missing_break                # missing break statement
+-missing_break_for_last_case  # missing break statement for last case in switch
++comparison_type_conv         # comparisons against null, 0, true, false, or an empty string allowing implicit type conversion (use === or !==)
+-inc_dec_within_stmt          # increment (++) and decrement (--) operators used as part of greater statement
++useless_void                 # use of the void type may be unnecessary (void is always undefined)
++multiple_plus_minus          # unknown order of operations for successive plus (e.g. x+++y) or minus (e.g. x---y) signs
++use_of_label                 # use of label
+-block_without_braces         # block statement without curly braces
++leading_decimal_point        # leading decimal point may indicate a number or an object member
++trailing_decimal_point       # trailing decimal point may indicate a number or an object member
++octal_number                 # leading zeros make an octal number
++nested_comment               # nested comment
++misplaced_regex              # regular expressions should be preceded by a left parenthesis, assignment, colon, or comma
+-ambiguous_newline            # unexpected end of line; it is ambiguous whether these lines are part of the same statement
++empty_statement              # empty statement or extra semicolon
+-missing_option_explicit      # the "option explicit" control comment is missing
++partial_option_explicit      # the "option explicit" control comment, if used, must be in the first script tag
++dup_option_explicit          # duplicate "option explicit" control comment
++useless_assign               # useless assignment
++ambiguous_nested_stmt        # block statements containing block statements should use curly braces to resolve ambiguity
++ambiguous_else_stmt          # the else statement could be matched with one of multiple if statements (use curly braces to indicate intent)
+-missing_default_case         # missing default case in switch statement
++duplicate_case_in_switch     # duplicate case in switch statements
++default_not_at_end           # the default case is not at the end of the switch statement
+-legacy_cc_not_understood     # couldn't understand control comment using /*@keyword@*/ syntax
++jsl_cc_not_understood        # couldn't understand control comment using /*jsl:keyword*/ syntax
++useless_comparison           # useless comparison; comparing identical expressions
++with_statement               # with statement hides undeclared variables; use temporary variable instead
++trailing_comma_in_array      # extra comma is not recommended in array initializers
++assign_to_function_call      # assignment to a function call
++parseint_missing_radix       # parseInt missing radix parameter
+
+### Output format
+# Customize the format of the error message.
+#    __FILE__ indicates current file path
+#    __FILENAME__ indicates current file name
+#    __LINE__ indicates current line
+#    __ERROR__ indicates error message
+#
+# Visual Studio syntax (default):
++output-format __FILE__(__LINE__): __ERROR__
+# Alternative syntax:
+#+output-format __FILE__:__LINE__: __ERROR__
+
+
+### Context
+# Show the in-line position of the error.
+# Use "+context" to display or "-context" to suppress.
+#
++context
+
+
+### Semicolons
+# By default, assignments of an anonymous function to a variable or
+# property (such as a function prototype) must be followed by a semicolon.
+#
++lambda_assign_requires_semicolon
+
+
+### Control Comments
+# Both JavaScript Lint and the JScript interpreter confuse each other with the syntax for
+# the /*@keyword@*/ control comments and JScript conditional comments. (The latter is
+# enabled in JScript with @cc_on@). The /*jsl:keyword*/ syntax is preferred for this reason,
+# although legacy control comments are enabled by default for backward compatibility.
+#
++legacy_control_comments
+
+
+### JScript Function Extensions
+# JScript allows member functions to be defined like this:
+#     function MyObj() { /*constructor*/ }
+#     function MyObj.prototype.go() { /*member function*/ }
+#
+# It also allows events to be attached like this:
+#     function window::onload() { /*init page*/ }
+#
+# This is a Microsoft-only JavaScript extension. Enable this setting to allow them.
+#
+-jscript_function_extensions
+
+
+### Defining identifiers
+# By default, "option explicit" is enabled on a per-file basis.
+# To enable this for all files, use "+always_use_option_explicit"
++always_use_option_explicit
+
+# Define certain identifiers of which the lint is not aware.
+# (Use this in conjunction with the "undeclared identifier" warning.)
+#
+# Common uses for webpages might be:
++define window
++define document
++define location
++define navigator
++define setTimeout
++define clearTimeout
++define ActiveXObject
++define XMLHttpRequest
++define DOMParser
++define XMLSerializer
++define console
++define CKEDITOR
++define alert
++define confirm
++define frames
+
+### Interactive
+# Prompt for a keystroke before exiting.
+#+pauseatend
+
+
+### Files
+# Specify which files to lint
+# Use "+recurse" to enable recursion (disabled by default).
+# To add a set of files, use "+process FileName", "+process Folder\Path\*.js",
+# or "+process Folder\Path\*.htm".
+#
+#+process jsl-test.js
++recurse
+
++process ../../_source/*.js
++process ../../_source/*.html
++process ../../_samples/*.js
++process ../../_samples/*.html
++process ../../ckeditor_source.js
++process ../../ckeditor_basic_source.js
++process ../../config.js
Index: /CKEditor/tags/3.0 Beta/_dev/jslint/lint.sh
===================================================================
--- /CKEditor/tags/3.0 Beta/_dev/jslint/lint.sh	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_dev/jslint/lint.sh	(revision 3046)
@@ -0,0 +1,18 @@
+#
+# Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+# For licensing, see LICENSE.html or http://ckeditor.com/license
+#
+# Calls the JavaScript Lint (jsl) with the predefined configurations.
+# If a file name is passed as a parameter it writes there the results,
+# otherwise it simply outputs it.
+#
+
+if [ "$1" = "" ]
+then
+	../_thirdparty/jsl/jsl -conf lint.conf -nofilelisting -nologo
+else
+	echo Generating $1 ...
+	../_thirdparty/jsl/jsl -conf lint.conf -nofilelisting -nologo > $1
+	echo
+	echo Process completed.
+fi
Index: /CKEditor/tags/3.0 Beta/_dev/packager/package.bat
===================================================================
--- /CKEditor/tags/3.0 Beta/_dev/packager/package.bat	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_dev/packager/package.bat	(revision 3046)
@@ -0,0 +1,9 @@
+::
+:: Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+:: For licensing, see LICENSE.html or http://ckeditor.com/license
+::
+
+@ECHO OFF
+CLS
+
+java -jar ckpackager/js.jar -opt -1 ckpackager/ckpackager.js ../../ckeditor.pack
Index: /CKEditor/tags/3.0 Beta/_dev/packager/packagefilegen.html
===================================================================
--- /CKEditor/tags/3.0 Beta/_dev/packager/packagefilegen.html	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_dev/packager/packagefilegen.html	(revision 3046)
@@ -0,0 +1,122 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>Package File Generator - CKEditor</title>
+	<script type="text/javascript">
+	//<![CDATA[
+
+// Firebug has been presented some bugs with console. It must be "initialized"
+// before the page load to work.
+// FIXME: Remove the following in the future, if Firebug gets fixed.
+if ( typeof console != 'undefined' )
+	console.log();
+
+function generate()
+{
+	document.getElementById( 'basic' ).contentWindow.generate();
+	document.getElementById( 'full' ).contentWindow.generate();
+
+	var CKEDITOR = document.getElementById( 'full' ).contentWindow.CKEDITOR;
+
+	var output = document.getElementById( 'output' );
+	output.value = document.getElementById( 'header' ).value + '\r\n\r\n';
+
+	var output2 = document.getElementById( 'output_ckpackager' );
+	output2.value = document.getElementById( 'header_ckpackager' ).value + '\r\n\r\n';
+
+	output.value += '\t<Constants removeDeclaration="false">\r\n';
+	output2.value +=
+		''		+	'constants :'	+ '\r\n' +
+		'\t'	+		'{'			+ '\r\n';
+
+	var hasConst = false;
+
+	for ( var prop in CKEDITOR )
+	{
+		var typeOfProp = typeof CKEDITOR[ prop ];
+		if ( /^[A-Z\d$_]+$/.test( prop ) && typeOfProp != 'object' && typeOfProp != 'function' && typeOfProp != 'undefined' )
+		{
+			if ( hasConst )
+				output2.value += ',\r\n';
+			else
+				hasConst = true;
+			output.value += '\t\t<Constant name="CKEDITOR.' + prop + '" value="' + CKEDITOR[ prop ] + '" />\r\n';
+			output2.value += '\t\t\'CKEDITOR.' + prop + '\' : ' + CKEDITOR[ prop ];
+		}
+	}
+
+	output2.value += '\r\n';
+
+	output.value += '\t</Constants>\r\n\r\n';
+	output2.value +=
+		'\t'	+		'},'		+ '\r\n\r\n';
+
+	output.value += document.getElementById( 'basic' ).contentDocument.getElementById( 'output' ).value + '\r\n';
+	output.value += document.getElementById( 'full' ).contentDocument.getElementById( 'output' ).value + '\r\n';
+
+	output.value += '</Package>\r\n';
+
+	output2.value +=
+		''		+	'packages :'	+ '\r\n' +
+		'\t'	+		'['			+ '\r\n';
+
+	output2.value += document.getElementById( 'basic' ).contentDocument.getElementById( 'output_ckpackager' ).value + '\r\n';
+	output2.value += document.getElementById( 'full' ).contentDocument.getElementById( 'output_ckpackager' ).value + '\r\n';
+
+	output2.value +=
+		'\t'	+		']'			+ '\r\n';
+
+	// Ignore the old FCKpackager stuff now. We should clean up everything later.
+	// output.style.display = '';
+	output2.style.display = '';
+}
+
+	//]]>
+	</script>
+</head>
+<body>
+	<form action="">
+		<p>
+			<input type="button" value="Generate" onclick="generate();" />
+		</p>
+		<p>
+			<textarea id="output" cols="80" rows="15" style="width: 100%; display: none"></textarea>
+		</p>
+		<p>
+			<textarea id="output_ckpackager" cols="80" rows="15" style="width: 100%; display: none"></textarea>
+		</p>
+		<iframe id="basic" src="packagefilegen_basic.html" style="position: absolute; left: -1000px">
+		</iframe>
+		<iframe id="full" src="packagefilegen_full.html" style="position: absolute; left: -1000px">
+		</iframe>
+		<textarea id="header" cols="80" rows="10" style="display: none">&lt;?xml version="1.0" encoding="utf-8" ?&gt;
+&lt;!--
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+--&gt;
+&lt;Package&gt;
+
+	&lt;Header&gt;&lt;![CDATA[/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+]]&gt;&lt;/Header&gt;</textarea>
+		<textarea id="header_ckpackager" cols="80" rows="10" style="display: none">/*
+ * CKPackager - Sample Package file
+ */
+
+header :
+	'/*'																			+ '\n' +
+	'Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.'	+ '\n' +
+	'For licensing, see LICENSE.html or http://ckeditor.com/license'				+ '\n' +
+	'*/'																			+ '\n' +
+	'\n',
+
+noCheck : false,</textarea>
+	</form>
+</body>
+</html>
Index: /CKEditor/tags/3.0 Beta/_dev/packager/packagefilegen_basic.html
===================================================================
--- /CKEditor/tags/3.0 Beta/_dev/packager/packagefilegen_basic.html	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_dev/packager/packagefilegen_basic.html	(revision 3046)
@@ -0,0 +1,101 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>Package File Generator - CKEditor</title>
+	<script type="text/javascript" src="../../ckeditor_basic_source.js"></script>
+	<script type="text/javascript">
+	//<![CDATA[
+
+// Firebug has been presented some bugs with console. It must be "initialized"
+// before the page load to work.
+// FIXME: Remove the following in the future, if Firebug gets fixed.
+if ( typeof console != 'undefined' )
+	console.log();
+
+var downloaded = [];
+
+CKEDITOR.on( 'download', function( event )
+	{
+		downloaded.push( event.data );
+	});
+
+function generate()
+{
+	var output = document.getElementById( 'output' );
+	var output2 = document.getElementById( 'output_ckpackager' );
+
+	output.value = '\t<PackageFile path="ckeditor_basic.js">\r\n';
+	output2.value =
+		'\t\t'		+	'{'										+ '\r\n' +
+		'\t\t\t'	+		'output : \'ckeditor_basic.js\','	+ '\r\n' +
+		'\t\t\t'	+		'wrap : true,'						+ '\r\n' +
+		'\t\t\t'	+		'files :'							+ '\r\n' +
+		'\t\t\t\t'	+			'['								+ '\r\n';
+
+	var appendedFiles = {},
+		hasFile = false;
+	var appendFile = function( filePath )
+	{
+		if ( appendedFiles[ filePath ] )
+			return;
+
+		appendedFiles[ filePath ] = true;
+
+		if ( hasFile )
+			output2.value += ',\r\n';
+		else
+			hasFile = true;
+
+		output.value += '\t\t<File path="' + filePath + '" />\r\n';
+		output2.value += '\t\t\t\t\t\'' + filePath + '\'';
+	};
+
+	appendFile( '_source/core/ckeditor_base.js' );
+
+	for ( var i = 0 ; i < CKEDITOR.loader.loadedScripts.length ; i++ )
+	{
+		var path = CKEDITOR.loader.loadedScripts[i].replace( CKEDITOR.basePath, '' );
+		appendFile( '_source/' + path + '.js' );
+	}
+
+	for ( var i = 0 ; i < downloaded.length ; i++ )
+	{
+		var path = downloaded[i].replace( CKEDITOR.basePath, '' );
+
+		if ( path == 'config.js' )
+			continue;
+
+		appendFile( path );
+	}
+
+	output2.value += '\r\n';
+
+	output.value += '\t</PackageFile>\r\n';
+	output2.value +=
+		'\t\t\t\t'	+			']'								+ '\r\n' +
+		'\t\t'		+	'},'									+ '\r\n';
+
+	// Ignore the old FCKpackager stuff now. We should clean up everything later.
+	// output.style.display = '';
+	output2.style.display = '';
+}
+
+	//]]>
+	</script>
+</head>
+<body>
+	<p>
+		<input type="button" value="Generate" onclick="generate();" />
+	</p>
+	<p>
+		<textarea id="output" rows="10" cols="80" style="width: 100%; display: none"></textarea>
+	</p>
+	<p>
+		<textarea id="output_ckpackager" rows="10" cols="80" style="width: 100%; display: none"></textarea>
+	</p>
+</body>
+</html>
Index: /CKEditor/tags/3.0 Beta/_dev/packager/packagefilegen_full.html
===================================================================
--- /CKEditor/tags/3.0 Beta/_dev/packager/packagefilegen_full.html	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_dev/packager/packagefilegen_full.html	(revision 3046)
@@ -0,0 +1,128 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>Package File Generator - CKEditor</title>
+	<script type="text/javascript" src="../../ckeditor_source.js"></script>
+	<script type="text/javascript">
+	//<![CDATA[
+
+// Firebug has been presented some bugs with console. It must be "initialized"
+// before the page load to work.
+// FIXME: Remove the following in the future, if Firebug gets fixed.
+if ( typeof console != 'undefined' )
+	console.log();
+
+var downloaded = [];
+
+CKEDITOR.on( 'download', function( event )
+	{
+		downloaded.push( event.data );
+	});
+
+function generate()
+{
+	var output = document.getElementById( 'output' );
+	var output2 = document.getElementById( 'output_ckpackager' );
+
+	output.value = '\t<PackageFile path="ckeditor.js">\r\n';
+	output2.value =
+		'\t\t'		+	'{'										+ '\r\n' +
+		'\t\t\t'	+		'output : \'ckeditor.js\','			+ '\r\n' +
+		'\t\t\t'	+		'wrap : true,'						+ '\r\n' +
+		'\t\t\t'	+		'files :'							+ '\r\n' +
+		'\t\t\t\t'	+			'['								+ '\r\n';
+
+	var appendedFiles = {},
+		hasFile = false;
+	var appendFile = function( filePath, commented )
+	{
+		if ( appendedFiles[ filePath ] )
+			return;
+
+		appendedFiles[ filePath ] = true;
+
+		if ( hasFile )
+			output2.value += ',\r\n';
+		else
+			hasFile = true;
+
+		if ( commented )
+		{
+			output.value += '<!--\t';
+			output2.value += '//';
+		}
+		else
+			output.value += '\t\t';
+
+		output.value += '<File path="' + filePath + '" />';
+		output2.value += '\t\t\t\t\t\'' + filePath + '\'';
+
+		if ( commented )
+			output.value += ' -->';
+
+		output.value += '\r\n';
+	};
+
+	appendFile( '_source/core/ckeditor_base.js' );
+
+	for ( var i = 0 ; i < CKEDITOR.loader.loadedScripts.length ; i++ )
+	{
+		var path = CKEDITOR.loader.loadedScripts[i].replace( CKEDITOR.basePath, '' );
+		appendFile( '_source/' + path + '.js' );
+	}
+
+	for ( var i = 0 ; i < downloaded.length ; i++ )
+	{
+		var path = downloaded[i].replace( CKEDITOR.basePath, '' );
+
+		if ( path == 'config.js' )
+			continue;
+
+		appendFile( path, /\/lang\/(?:)/.test( path ) );
+	}
+
+	output2.value += '\r\n';
+
+	output.value += '\t</PackageFile>\r\n';
+	output2.value +=
+		'\t\t\t\t'	+			']'								+ '\r\n' +
+		'\t\t'		+	'}'									+ '\r\n';
+
+	// Ignore the old FCKpackager stuff now. We should clean up everything later.
+	// output.style.display = '';
+	output2.style.display = '';
+}
+
+	//]]>
+	</script>
+</head>
+<body>
+	<form action="">
+		<p>
+			<label for="editor1">
+				Editor 1:</label><br />
+			<textarea name="editor1" rows="10" cols="80">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://www.fckeditor.net/"&gt;FCKeditor&lt;/a&gt;.&lt;/p&gt;</textarea>
+			<script type="text/javascript">
+			//<![CDATA[
+
+			  CKEDITOR.replace( 'editor1' );
+
+			//]]>
+			</script>
+		</p>
+		<p>
+			<input type="button" value="Generate" onclick="generate();" />
+		</p>
+		<p>
+			<textarea id="output" rows="10" cols="80" style="width: 100%; display: none"></textarea>
+		</p>
+		<p>
+			<textarea id="output_ckpackager" rows="10" cols="80" style="width: 100%; display: none"></textarea>
+		</p>
+	</form>
+</body>
+</html>
Index: /CKEditor/tags/3.0 Beta/_dev/releaser/ckreleaser.release
===================================================================
--- /CKEditor/tags/3.0 Beta/_dev/releaser/ckreleaser.release	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_dev/releaser/ckreleaser.release	(revision 3046)
@@ -0,0 +1,79 @@
+header :
+	'/*'																			+ '\n' +
+	'Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.'	+ '\n' +
+	'For licensing, see LICENSE.html or http://ckeditor.com/license'				+ '\n' +
+	'*/'																			+ '\n' +
+	'\n',
+
+fixLineEnds : true,
+
+ignore : 
+[
+	'_dev',
+	'_docs/api',
+	'_samples',
+	'_source/adapters',
+	'.svn',
+	'.settings',
+	'.project'
+],
+
+copy :
+[
+	{
+		source : '_source/lang',
+		target : 'lang',
+		minify : true
+	},
+
+	{
+		source : '_source/plugins',
+		target : 'plugins',
+		minify : true
+	},
+
+	{
+		source : '_source/tests',
+		target : 'tests',
+		minify : false
+	},
+
+	{
+		source : '_source/themes',
+		target : 'themes',
+		minify : true
+	}
+],
+
+rename :
+[
+	{
+		source : 'tests',
+		target : '_tests',
+	},
+],
+
+packages :
+[
+	'../../../ckeditor.pack'
+],
+
+documentation :
+{
+	config: '_dev/docs_build/docs_build.conf',
+	target: '_docs/api'
+},
+
+samples :
+{
+	source : '_samples',
+	target : '_samples',
+	template : '_samples/sample.html',
+},
+
+skins :
+{
+	source : '_source/skins',
+	target : 'skins',
+	minify : true
+}
Index: /CKEditor/tags/3.0 Beta/_dev/releaser/release.bat
===================================================================
--- /CKEditor/tags/3.0 Beta/_dev/releaser/release.bat	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_dev/releaser/release.bat	(revision 3046)
@@ -0,0 +1,13 @@
+:: Copyright (c) 2003-2009, Frederico Caldeira Knabben. All rights reserved.
+:: For licensing, see LICENSE.html or http://ckeditor.com/license
+
+@ECHO OFF
+
+CLS
+ECHO.
+
+:: rmdir /S /Q release
+
+cd ckreleaser
+java -cp js.jar;tools/javatar/tar.jar;tools/tartool/tartool.jar;tools/jaf/activation.jar org.mozilla.javascript.tools.shell.Main ckreleaser.js ../ckreleaser.release ../../.. ../release 0.1 ckeditor_0.1.zip ckeditor_0.1.tar.gz
+cd ..
Index: /CKEditor/tags/3.0 Beta/_dev/releaser/release.sh
===================================================================
--- /CKEditor/tags/3.0 Beta/_dev/releaser/release.sh	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_dev/releaser/release.sh	(revision 3046)
@@ -0,0 +1,6 @@
+# Copyright (c) 2003-2009, Frederico Caldeira Knabben. All rights reserved.
+# For licensing, see LICENSE.html or http://ckeditor.com/license
+
+cd ckreleaser
+java -cp js.jar:tools/javatar/tar.jar:tools/tartool/tartool.jar:tools/jaf/activation.jar org.mozilla.javascript.tools.shell.Main ckreleaser.js ../ckreleaser.release ../../.. ../release 0.1 ckeditor_0.1.zip ckeditor_0.1.tar.gz
+cd ..
Index: /CKEditor/tags/3.0 Beta/_samples/ajax.html
===================================================================
--- /CKEditor/tags/3.0 Beta/_samples/ajax.html	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_samples/ajax.html	(revision 3046)
@@ -0,0 +1,73 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>Ajax - CKEditor Sample</title>
+	<script type="text/javascript" src="sample.js"></script>
+	<script id="headscript" type="text/javascript">
+	//<![CDATA[
+
+var editor;
+
+function createEditor()
+{
+	if ( editor )
+		return;
+
+	var html = document.getElementById( 'editorcontents' ).innerHTML;
+
+	// Create a new editor inside the <div id="editor">
+	editor = CKEDITOR.appendTo( 'editor' );
+	editor.setData( html );
+
+	// This sample may break here if the ckeditor_basic.js is used. In such case, the following code should be used instead:
+	/*
+	if ( editor.setData )
+		editor.setData( html );
+	else
+		CKEDITOR.on( 'loaded', function()
+			{
+				editor.setData( html );
+			});
+	*/
+}
+
+function removeEditor()
+{
+	if ( !editor )
+		return;
+
+	// Retrieve the editor contents. In an Ajax application, this data would be
+	// sent to the server or used in any other way.
+	document.getElementById( 'editorcontents' ).innerHTML = editor.getData();
+	document.getElementById( 'contents' ).style.display = '';
+
+	// Destroy the editor.
+	editor.destroy();
+	editor = null;
+}
+
+	//]]>
+	</script>
+</head>
+<body>
+	<div id="html">
+		<p>
+			<input type="button" value="Create Editor" onclick="createEditor();" />
+			<input type="button" value="Remove Editor" onclick="removeEditor();" />
+		</p>
+		<div id="editor">
+		</div>
+		<div id="contents" style="display: none">
+			<p>Edited Contents:</p>
+			<div id="editorcontents"></div>
+		</div>
+	</div>
+	<div id="code">
+		<pre></pre>
+	</div>
+</body>
+</html>
Index: /CKEditor/tags/3.0 Beta/_samples/api_dialog.html
===================================================================
--- /CKEditor/tags/3.0 Beta/_samples/api_dialog.html	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_samples/api_dialog.html	(revision 3046)
@@ -0,0 +1,153 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>Replace Textarea by Code - CKEditor Sample</title>
+	<script type="text/javascript" src="sample.js"></script>
+	<style id="styles" type="text/css">
+
+.cke_button_myDialogCmd .cke_icon
+{
+	display : none !important;
+}
+
+.cke_button_myDialogCmd .cke_label
+{
+	display : inline !important;
+}
+
+	</style>
+	<script id="headscript" type="text/javascript">
+	//<![CDATA[
+
+// When opening a dialog, its "definition" is created for it, for
+// each editor instance. The "dialogDefinition" event is then
+// fired. We should use this event to make customizations to the
+// definition of existing dialogs.
+CKEDITOR.on( 'dialogDefinition', function( ev )
+	{
+		// Take the dialog name and its definition from the event
+		// data.
+		var dialogName = ev.data.name;
+		var dialogDefinition = ev.data.definition;
+
+		// Check if the definition is from the dialog we're
+		// interested on (the "Link" dialog).
+		if ( dialogName == 'link' )
+		{
+			// Get a reference to the "Link Info" tab.
+			var infoTab = dialogDefinition.getContents( 'info' );
+
+			// Add a text field to the "info" tab.
+			infoTab.add( {
+					type : 'text',
+					label : 'My Custom Field',
+					id : 'customField',
+					'default' : 'Sample!',
+					validate : function()
+					{
+						if ( /\d/.test( this.getValue() ) )
+							return 'My Custom Field must not contain digits';
+					}
+				});
+
+			// Remove the "Link Type" combo and the "Browser
+			// Server" button from the "info" tab.
+			infoTab.remove( 'protocol' );
+			infoTab.remove( 'browse' );
+
+			// Set the default value for the URL field.
+			var urlField = infoTab.get( 'url' );
+			urlField['default'] = 'www.example.com';
+
+			// Remove the "Target" tab from the "Link" dialog.
+			dialogDefinition.removeContents( 'target' );
+
+			// Add a new tab to the "Link" dialog.
+			dialogDefinition.addContents({
+				id : 'customTab',
+				label : 'My Tab',
+				accessKey : 'M',
+				elements : [
+					{
+						id : 'myField1',
+						type : 'text',
+						label : 'My Text Field'
+					},
+					{
+						id : 'myField2',
+						type : 'text',
+						label : 'Another Text Field'
+					}
+				]
+			});
+		}
+	});
+
+	//]]>
+	</script>
+</head>
+<body>
+	<div id="html">
+		<p>
+			This sample shows how to use the dialog API to customize dialogs whithout changing
+			the original editor code. The following customizations are being done::</p>
+		<ol>
+			<li><strong>Add dialog pages</strong> ("My Tab" in the Link dialog).</li>
+			<li><strong>Remove a dialog tab</strong> ("Target" tab from the Link dialog).</li>
+			<li><strong>Add dialog fields</strong> ("My Custom Field" into the Link dialog).</li>
+			<li><strong>Remove dialog fields</strong> ("Link Type" and "Browser Server" the Link dialog).</li>
+			<li><strong>Set default values for dialog fields</strong> (for the "URL" field in the
+				Link dialog). </li>
+			<li><strong>Create a custom dialog</strong> ("My Dialog" button).</li>
+		</ol>
+		<textarea id="editor1" name="editor1" rows="10" cols="80">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://www.fckeditor.net/"&gt;FCKeditor&lt;/a&gt;.&lt;/p&gt;</textarea>
+		<script type="text/javascript">
+		//<![CDATA[
+			// Replace the <textarea id="editor1"> with an CKEditor instance.
+			var editor = CKEDITOR.replace( 'editor1',
+				{
+					// Defines a simpler toolbar to be used in this sample.
+					// Note that we have added out "MyButton" button here.
+					toolbar : [ [ 'Source', '-', 'Bold', 'Italic', 'Underline', 'Strike','-','Link', '-', 'MyButton' ] ]
+				});
+
+			// Listen for the "pluginsLoaded" event, so we are sure that the
+			// "dialog" plugin has been loaded and we are able to do our
+			// customizations.
+			editor.on( 'pluginsLoaded', function( ev )
+				{
+					// If our custom dialog has not been registered, do that now.
+					if ( !CKEDITOR.dialog.exists( 'myDialog' ) )
+					{
+						// We need to do the following trick to find out the dialog
+						// definition file URL path. In the real world, you would simply
+						// point to an absolute path directly, like "/mydir/mydialog.js".
+						var href = document.location.href.split( '/' );
+						href.pop();
+						href.push( 'api_dialog', 'my_dialog.js' );
+						href = href.join( '/' );
+
+						// Finally, register the dialog.
+						CKEDITOR.dialog.add( 'myDialog', href );
+					}
+
+					// Register the command used to open the dialog.
+					editor.addCommand( 'myDialogCmd', new CKEDITOR.dialogCommand( 'myDialog' ) );
+
+					// Add the a custom toolbar buttons, which fires the above
+					// command..
+					editor.ui.addButton( 'MyButton',
+						{
+							label : 'My Dialog',
+							command : 'myDialogCmd'
+						} );
+				});
+		//]]>
+		</script>
+	</div>
+</body>
+</html>
Index: /CKEditor/tags/3.0 Beta/_samples/api_dialog/my_dialog.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_samples/api_dialog/my_dialog.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_samples/api_dialog/my_dialog.js	(revision 3046)
@@ -0,0 +1,28 @@
+/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+CKEDITOR.dialog.add( 'myDialog', function( editor )
+{
+	return {
+		title : 'My Dialog',
+		minWidth : 400,
+		minHeight : 200,
+		contents : [
+			{
+				id : 'tab1',
+				label : 'First Tab',
+				title : 'First Tab',
+				elements :
+				[
+					{
+						id : 'input1',
+						type : 'text',
+						label : 'Input 1'
+					}
+				]
+			}
+		]
+	};
+} );
Index: /CKEditor/tags/3.0 Beta/_samples/divreplace.html
===================================================================
--- /CKEditor/tags/3.0 Beta/_samples/divreplace.html	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_samples/divreplace.html	(revision 3046)
@@ -0,0 +1,115 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>Replace DIV - CKEditor Sample</title>
+	<style id="styles" type="text/css">
+
+		div
+		{
+			border: solid 2px Transparent;
+			padding-left: 15px;
+			padding-right: 15px;
+		}
+
+		div:hover
+		{
+			border-color: black;
+		}
+
+	</style>
+	<script type="text/javascript" src="sample.js"></script>
+	<script id="headscript" type="text/javascript">
+	//<![CDATA[
+
+// Uncomment the following code to test the "Timeout Loading Method".
+// CKEDITOR.loadFullCoreTimeout = 5;
+
+window.onload = function()
+{
+	// Listen to the double click event.
+	if ( window.addEventListener )
+		document.body.addEventListener( 'dblclick', onDoubleClick, false );
+	else if ( window.attachEvent )
+		document.body.attachEvent( 'ondblclick', onDoubleClick );
+
+};
+
+function onDoubleClick( ev )
+{
+	// Get the element which fired the event. This is not necessarily the
+	// element to which the event has been attached.
+	var element = ev.target || ev.srcElement;
+
+	// Find out the div that holds this element.
+	while( element.parentNode && element.parentNode.nodeName.toLowerCase() != 'fieldset' )
+		element = element.parentNode;
+
+	if ( element.nodeName.toLowerCase() == 'div' )
+		replaceDiv( element );
+}
+
+var editor;
+
+function replaceDiv( div )
+{
+	if ( editor )
+		editor.destroy();
+
+	editor = CKEDITOR.replace( div );
+}
+
+	//]]>
+	</script>
+</head>
+<body>
+	<div id="html">
+		<p>
+			Double-click on any of the following DIVs to transform them into editor instances.</p>
+		<div>
+			<h3>
+				Part 1</h3>
+			<p>
+				Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras et ipsum quis mi
+				semper accumsan. Integer pretium dui id massa. Suspendisse in nisl sit amet urna
+				rutrum imperdiet. Nulla eu tellus. Donec ante nisi, ullamcorper quis, fringilla
+				nec, sagittis eleifend, pede. Nulla commodo interdum massa. Donec id metus. Fusce
+				eu ipsum. Suspendisse auctor. Phasellus fermentum porttitor risus.
+			</p>
+		</div>
+		<div>
+			<h3>
+				Part 2</h3>
+			<p>
+				Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras et ipsum quis mi
+				semper accumsan. Integer pretium dui id massa. Suspendisse in nisl sit amet urna
+				rutrum imperdiet. Nulla eu tellus. Donec ante nisi, ullamcorper quis, fringilla
+				nec, sagittis eleifend, pede. Nulla commodo interdum massa. Donec id metus. Fusce
+				eu ipsum. Suspendisse auctor. Phasellus fermentum porttitor risus.
+			</p>
+			<p>
+				Donec velit. Mauris massa. Vestibulum non nulla. Nam suscipit arcu nec elit. Phasellus
+				sollicitudin iaculis ante. Ut non mauris et sapien tincidunt adipiscing. Vestibulum
+				vitae leo. Suspendisse nec mi tristique nulla laoreet vulputate.
+			</p>
+		</div>
+		<div>
+			<h3>
+				Part 3</h3>
+			<p>
+				Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras et ipsum quis mi
+				semper accumsan. Integer pretium dui id massa. Suspendisse in nisl sit amet urna
+				rutrum imperdiet. Nulla eu tellus. Donec ante nisi, ullamcorper quis, fringilla
+				nec, sagittis eleifend, pede. Nulla commodo interdum massa. Donec id metus. Fusce
+				eu ipsum. Suspendisse auctor. Phasellus fermentum porttitor risus.
+			</p>
+		</div>
+	</div>
+	<div id="code">
+		<pre></pre>
+	</div>
+</body>
+</html>
Index: /CKEditor/tags/3.0 Beta/_samples/index.html
===================================================================
--- /CKEditor/tags/3.0 Beta/_samples/index.html	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_samples/index.html	(revision 3046)
@@ -0,0 +1,39 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>Samples List - CKEditor</title>
+	<link type="text/css" rel="stylesheet" href="sample.css" />
+</head>
+<body>
+	<h1>
+		CKEditor Samples List
+	</h1>
+	<h2>
+		Basic Samples
+	</h2>
+	<ul>
+		<li><a href="replacebyclass.html">Replace textareas by class name</a></li>
+		<li><a href="replacebycode.html">Replace textareas by code</a></li>
+	</ul>
+	<h2>
+		Advanced Samples
+	</h2>
+	<ul>
+		<li><a href="divreplace.html">Replace DIV elements on the fly</a>&nbsp; </li>
+		<li><a href="ajax.html">Create and destroy editor instances for Ajax applications</a></li>
+	</ul>
+	<div id="footer">
+		<hr />
+		<p>
+			CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a>
+		</p>
+		<p id="copy">
+			Copyright &copy; 2003-2009, <a href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved.
+		</p>
+	</div>
+</body>
+</html>
Index: /CKEditor/tags/3.0 Beta/_samples/replacebyclass.html
===================================================================
--- /CKEditor/tags/3.0 Beta/_samples/replacebyclass.html	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_samples/replacebyclass.html	(revision 3046)
@@ -0,0 +1,44 @@
+﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>Replace Textareas by Class Name - CKEditor Sample</title>
+	<script type="text/javascript" src="sample.js"></script>
+</head>
+<body>
+	<div id="html">
+		<form action="sample_posteddata.php" method="post">
+			<p>
+				<label for="editor1">
+					Editor 1:</label><br />
+				<textarea id="editor1" name="editor1" class="ckeditor" rows="10" cols="80">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://www.fckeditor.net/"&gt;FCKeditor&lt;/a&gt;.&lt;/p&gt;</textarea>
+			</p>
+			<p>
+				<input type="submit" value="Submit" />
+			</p>
+		</form>
+	</div>
+	<div id="code">
+		<pre>
+&lt;form action=""&gt;
+  &lt;p&gt;
+    &lt;label for="editor1"&gt;
+      Editor 1:&lt;/label&gt;&lt;br /&gt;
+    &lt;textarea id="editor1" name="editor1" <b>class="ckeditor"</b> rows="10" cols="80"&gt;&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://www.fckeditor.net/"&gt;FCKeditor&lt;/a&gt;.&lt;/p&gt;&lt;/textarea&gt;
+  &lt;/p&gt;
+  &lt;p&gt;
+    &lt;label for="editor2"&gt;
+      Editor 2:&lt;/label&gt;&lt;br /&gt;
+    &lt;textarea id="editor2" name="editor2" <b>class="ckeditor"</b> rows="10" cols="80"&gt;&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://www.fckeditor.net/"&gt;FCKeditor&lt;/a&gt;.&lt;/p&gt;&lt;/textarea&gt;
+  &lt;/p&gt;
+  &lt;p&gt;
+    &lt;input type="submit" value="Submit" /&gt;
+  &lt;/p&gt;
+&lt;/form&gt;
+</pre>
+	</div>
+</body>
+</html>
Index: /CKEditor/tags/3.0 Beta/_samples/replacebycode.html
===================================================================
--- /CKEditor/tags/3.0 Beta/_samples/replacebycode.html	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_samples/replacebycode.html	(revision 3046)
@@ -0,0 +1,77 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>Replace Textarea by Code - CKEditor Sample</title>
+	<script type="text/javascript" src="sample.js"></script>
+</head>
+<body>
+	<div id="html">
+		<form action="sample_posteddata.php" method="post">
+			<p>
+				<label for="editor1">
+					Editor 1:</label><br />
+				<textarea id="editor1" name="editor1" rows="10" cols="80">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://www.fckeditor.net/"&gt;FCKeditor&lt;/a&gt;.&lt;/p&gt;</textarea>
+				<script type="text/javascript">
+				//<![CDATA[
+
+					// This call can be placed at any point after the
+					// <textarea>, or inside a <head><script> in a
+					// window.onload event handler.
+
+					// Replace the <textarea id="editor"> with an CKEditor
+					// instance, using default configurations.
+					CKEDITOR.replace( 'editor1' );
+
+				//]]>
+				</script>
+			</p>
+			<p>
+				<label for="editor2">
+					Editor 2:</label><br />
+				<textarea id="editor2" name="editor2" rows="10" cols="80">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://www.fckeditor.net/"&gt;FCKeditor&lt;/a&gt;.&lt;/p&gt;</textarea>
+				<script type="text/javascript">
+				//<![CDATA[
+
+					// This call can be placed at any point after the
+					// <textarea>, or inside a <head><script> in a
+					// window.onload event handler.
+
+					// Replace the <textarea id="editor"> with an CKEditor
+					// instance, using default configurations.
+					CKEDITOR.replace( 'editor2' );
+
+				//]]>
+				</script>
+			</p>
+			<p>
+				<input type="submit" value="Submit" />
+			</p>
+		</form>
+	</div>
+	<div id="code">
+		<pre>
+&lt;form action=""&gt;
+  &lt;p&gt;
+    &lt;label for="editor1"&gt;
+      Editor 1:&lt;/label&gt;&lt;br /&gt;
+    &lt;textarea <b>name="editor1"</b> rows="10" cols="80"&gt;&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://www.fckeditor.net/"&gt;FCKeditor&lt;/a&gt;.&lt;/p&gt;&lt;/textarea&gt;
+    &lt;script type="text/javascript"&gt;
+    //&lt;![CDATA[
+
+      <b>CKEDITOR.replace( 'editor1' );</b>
+
+    //]]&gt;
+    &lt;/script&gt;
+  &lt;/p&gt;
+  &lt;p&gt;
+    &lt;input type="submit" value="Submit" /&gt;
+  &lt;/p&gt;
+&lt;/form&gt;
+</pre>
+	</div>
+</body>
+</html>
Index: /CKEditor/tags/3.0 Beta/_samples/sample.css
===================================================================
--- /CKEditor/tags/3.0 Beta/_samples/sample.css	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_samples/sample.css	(revision 3046)
@@ -0,0 +1,81 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+fieldset
+{
+	margin: 0;
+	padding: 10px;
+}
+
+form
+{
+	margin: 0;
+	padding: 0;
+}
+
+pre
+{
+	background-color: #F7F7F7;
+	border: 1px solid #D7D7D7;
+	overflow: auto;
+	margin: 0;
+	padding: 0.25em;
+}
+
+#alerts
+{
+	color: Red;
+}
+
+#footer hr
+{
+	margin: 10px 0 15px 0;
+	height: 1px;
+	border: solid 1px gray;
+	border-bottom: none;
+}
+
+#footer p
+{
+	margin: 0 10px 10px 10px;
+	float: left;
+}
+
+#footer #copy
+{
+	float: right;
+}
+
+#outputSample
+{
+	width: 100%;
+	table-layout: fixed;
+}
+
+#outputSample thead th
+{
+	color: #dddddd;
+	background-color: #999999;
+	padding: 4px;
+	white-space: nowrap;
+}
+
+#outputSample tbody th
+{
+	vertical-align: top;
+	text-align: left;
+}
+
+#outputSample pre
+{
+	margin: 0;
+	padding: 0;
+	white-space: pre; /* CSS2 */
+	white-space: -moz-pre-wrap; /* Mozilla*/
+	white-space: -o-pre-wrap; /* Opera 7 */
+	white-space: pre-wrap; /* CSS 2.1 */
+	white-space: pre-line; /* CSS 3 (and 2.1 as well, actually) */
+	word-wrap: break-word; /* IE */
+}
Index: /CKEditor/tags/3.0 Beta/_samples/sample.html
===================================================================
--- /CKEditor/tags/3.0 Beta/_samples/sample.html	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_samples/sample.html	(revision 3046)
@@ -0,0 +1,95 @@
+﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>Sample - CKEditor</title>
+	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
+<!-- CKReleaser %REMOVE_LINE%
+	<script type="text/javascript" src="../ckeditor.js"></script>
+CKReleaser %REMOVE_START% -->
+	<script type="text/javascript" src="../ckeditor_source.js"></script>
+	<script type="text/javascript">
+	//<![CDATA[
+
+// Loaded dependencies of sample.js.
+CKEDITOR.loader.load( 'core/ajax' );
+CKEDITOR.loader.load( 'core/env' );
+
+	//]]>
+	</script>
+<!--
+	## Uncomment this if loading the "basic" version.
+
+	<script type="text/javascript" src="../_source/core/loader.js"></script>
+	<script type="text/javascript">
+	//<![CDATA[
+
+// Loaded dependencies of sample.js.
+CKEDITOR.loader.load( 'core/ajax' );
+CKEDITOR.loader.load( 'core/env' );
+
+	//]]>
+	</script>
+-->
+<!-- CKReleaser %REMOVE_END% -->
+	<script type="text/javascript" src="sample.js"></script>
+	<link type="text/css" rel="stylesheet" href="sample.css" />
+	<script id="styles" type="text/javascript">
+	//<![CDATA[
+		document.write( CKEDITOR.samples.styles );
+	//]]>
+	</script>
+	<script id="headscript" type="text/javascript">
+	//<![CDATA[
+		document.write( CKEDITOR.samples.headScript );
+	//]]>
+	</script>
+</head>
+<body>
+	<h1>
+		CKEditor Sample
+	</h1>
+	<!-- This <div> holds alert messages to be display in the sample page. -->
+	<div id="alerts">
+		<noscript>
+			<p>
+				<strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript
+				support, like yours, you should still see the contents (HTML data) and you should
+				be able to edit it normally, without a rich editor interface.
+			</p>
+		</noscript>
+	</div>
+	<!-- This <fieldset> holds the HTML that you will usually find in your
+	     pages. -->
+	<fieldset title="Output">
+		<legend>Output</legend>
+		<script id="html" type="text/javascript">
+		//<![CDATA[
+			document.write( CKEDITOR.samples.htmlData );
+		//]]>
+		</script>
+	</fieldset>
+	<!-- This <fieldset> contains the output readable code that illustrates
+	     how to use the editor, having the results shown in this sample. -->
+	<fieldset title="Code">
+		<legend>Code</legend>
+		<script id="code" type="text/javascript">
+		//<![CDATA[
+			document.write( CKEDITOR.samples.codeData );
+		//]]>
+		</script>
+	</fieldset>
+	<div id="footer">
+		<hr />
+		<p>
+			CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a>
+		</p>
+		<p id="copy">
+			Copyright &copy; 2003-2009, <a href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved.
+		</p>
+	</div>
+</body>
+</html>
Index: /CKEditor/tags/3.0 Beta/_samples/sample.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_samples/sample.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_samples/sample.js	(revision 3046)
@@ -0,0 +1,124 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+// Firebug has been presented some bugs with console. It must be "initialized"
+// before the page load to work.
+// FIXME: Remove the following in the future, if Firebug gets fixed.
+if ( typeof console != 'undefined' )
+	console.log();
+
+// %REMOVE_START%
+(function()
+{
+	// The sample##.html files also include this script. We don't want them to
+	// run, so we redirect to the samples.html page, passing the correct
+	// querystring parameter to load the desired page.
+
+	var sampleMatch = window.location.pathname.match( /[\/\\]([^\/\\]+).html/ );
+	if ( sampleMatch && sampleMatch[1] != 'sample' )
+		window.location = 'sample.html?sample=' + sampleMatch[1] + ( location.search.length > 1 ? '&' + location.search.substr(1) : '' );
+})();
+// %REMOVE_END%
+
+if ( window.CKEDITOR )
+{
+	CKEDITOR.samples = (function()
+	{
+		var ajax = CKEDITOR.ajax;
+
+		// Default values for the CKEDITOR.samples properties.
+		var samples =
+		{
+			htmlData : '<p>No HTML data available.</p>',
+			codeData : '<p>No code data available.</p>'
+		};
+
+		if ( /[?&]sample=[^&]+/.test( document.location.search ) )
+		{
+			var currentSample = document.location.search.match( /[?&]sample=([^&]+)/ )[1];
+			var sampleData = ajax.loadXml( CKEDITOR.getUrl( '_samples/' + currentSample + '.html' ) );
+
+			if ( sampleData )
+			{
+				var getNodeHtml = function ( id )
+				{
+					return sampleData.getInnerXml( '//*[@id="' + id + '"]' );
+				};
+
+				samples.headScript	= getNodeHtml( 'headscript' ) || '';
+				samples.styles		= getNodeHtml( 'styles' ) || '';
+				samples.htmlData	= getNodeHtml( 'html' ) || '';
+				samples.codeData	= getNodeHtml( 'code' ) || '';
+
+				if ( samples.headScript )
+					samples.headScript = '<script id="headscript" type="text/javascript">' + samples.headScript + '</script>';
+
+				if ( samples.styles )
+					samples.styles = '<style id="styles" type="text/css">' + samples.styles + '</style>';
+
+				// The '//*/*/*' XPath is the only way to make it work with
+				// xmlns="http://www.w3.org/1999/xhtml" without workarounds. It
+				// means that we must always have <html><head><title> in this
+				// precise order.
+				document.title = sampleData.getInnerXml( '//*/*/*' );
+			}
+		}
+
+		return samples;
+	})();
+
+	(function()
+	{
+		var showCompatibilityMsg = function()
+		{
+			var env = CKEDITOR.env;
+
+			var html = '<p><strong>Your browser is not compatible with CKEditor.</strong>';
+
+			var browsers =
+			{
+				gecko : 'Firefox 1.5',
+				ie : 'Internet Explorer 6.0',
+				opera : 'Opera 9.5',
+				webkit : 'Safari 3.0'
+			};
+
+			var alsoBrowsers = '';
+
+			for ( var key in env )
+			{
+				if ( browsers[ key ] )
+				{
+					if ( env[key] )
+						html += ' CKEditor is compatible with ' + browsers[ key ] + ' or higher.';
+					else
+						alsoBrowsers += browsers[ key ] + '+, ';
+				}
+			}
+
+			alsoBrowsers = alsoBrowsers.replace( /\+,([^,]+), $/, '+ and $1' );
+
+			html += ' It is also compatible with ' + alsoBrowsers + '.';
+
+			html += '</p><p>With non compatible browsers, you should still be able to see and edit the contents (HTML) in a plain text field.</p>';
+
+			document.getElementById( 'alerts' ).innerHTML = html;
+		};
+
+		var onload = function()
+		{
+			// Show a friendly compatibility message as soon as the page is loaded,
+			// for those browsers that are not compatible with CKEditor.
+			if ( !CKEDITOR.env.isCompatible )
+				showCompatibilityMsg();
+		};
+
+		// Register the onload listener.
+		if ( window.addEventListener )
+			window.addEventListener( 'load', onload, false );
+		else if ( window.attachEvent )
+			window.attachEvent( 'onload', onload );
+	})();
+}
Index: /CKEditor/tags/3.0 Beta/_samples/sample_posteddata.php
===================================================================
--- /CKEditor/tags/3.0 Beta/_samples/sample_posteddata.php	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_samples/sample_posteddata.php	(revision 3046)
@@ -0,0 +1,59 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<?php
+/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>Sample - CKEditor</title>
+	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
+	<link type="text/css" rel="stylesheet" href="sample.css" />
+</head>
+<body>
+	<h1>
+		CKEditor - Posted Data
+	</h1>
+	<table border="1" cellspacing="0" id="outputSample">
+		<colgroup><col width="100" /></colgroup>
+		<thead>
+			<tr>
+				<th>Field&nbsp;Name</th>
+				<th>Value</th>
+			</tr>
+		</thead>
+<?php
+
+if ( isset( $_POST ) )
+	$postArray = &$_POST ;			// 4.1.0 or later, use $_POST
+else
+	$postArray = &$HTTP_POST_VARS ;	// prior to 4.1.0, use HTTP_POST_VARS
+
+foreach ( $postArray as $sForm => $value )
+{
+	if ( get_magic_quotes_gpc() )
+		$postedValue = htmlspecialchars( stripslashes( $value ) ) ;
+	else
+		$postedValue = htmlspecialchars( $value ) ;
+
+?>
+		<tr>
+			<th style="vertical-align: top"><?php echo $sForm?></th>
+			<td><pre><?php echo $postedValue?></pre></td>
+		</tr>
+	<?php
+}
+?>
+	</table>
+	<div id="footer">
+		<hr />
+		<p>
+			CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a>
+		</p>
+		<p id="copy">
+			Copyright &copy; 2003-2009, <a href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved.
+		</p>
+	</div>
+</body>
+</html>
Index: /CKEditor/tags/3.0 Beta/_source/core/_bootstrap.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/_bootstrap.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/_bootstrap.js	(revision 3046)
@@ -0,0 +1,43 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview API initialization code.
+ */
+
+// Load core plugins.
+CKEDITOR.plugins.load( CKEDITOR.config.corePlugins.split( ',' ), function()
+	{
+		CKEDITOR.status = 'loaded';
+		CKEDITOR.fire( 'loaded' );
+
+		// Process all instances created by the "basic" implementation.
+		var pending = CKEDITOR._.pending;
+		if ( pending )
+		{
+			delete CKEDITOR._.pending;
+
+			for ( var i = 0 ; i < pending.length ; i++ )
+				CKEDITOR.add( pending[ i ] );
+		}
+	});
+
+/*
+TODO: Enable the following and check if effective.
+
+if ( CKEDITOR.env.ie )
+{
+	// Remove IE mouse flickering on IE6 because of background images.
+	try
+	{
+		document.execCommand( 'BackgroundImageCache', false, true );
+	}
+	catch (e)
+	{
+		// We have been reported about loading problems caused by the above
+		// line. For safety, let's just ignore errors.
+	}
+}
+*/
Index: /CKEditor/tags/3.0 Beta/_source/core/ajax.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/ajax.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/ajax.js	(revision 3046)
@@ -0,0 +1,143 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Defines the {@link CKEDITOR.ajax} object, which holds ajax methods for
+ *		data loading.
+ */
+
+/**
+ * Ajax methods for data loading.
+ * @namespace
+ * @example
+ */
+CKEDITOR.ajax = (function()
+{
+	var createXMLHttpRequest = function()
+	{
+		// In IE, using the native XMLHttpRequest for local files may throw
+		// "Access is Denied" errors.
+		if ( !CKEDITOR.env.ie || location.protocol != 'file:' )
+			try { return new XMLHttpRequest(); } catch(e) {}
+
+		try { return new ActiveXObject( 'Msxml2.XMLHTTP' ); } catch (e) {}
+		try { return new ActiveXObject( 'Microsoft.XMLHTTP' ); } catch (e) {}
+
+		return null;
+	};
+
+	var checkStatus = function( xhr )
+	{
+		// HTTP Status Codes:
+		//	 2xx : Success
+		//	 304 : Not Modified
+		//	   0 : Returned when running locally (file://)
+		//	1223 : IE may change 204 to 1223 (see http://dev.jquery.com/ticket/1450)
+
+		return ( xhr.readyState == 4 &&
+				(	( xhr.status >= 200 && xhr.status < 300 ) ||
+					xhr.status == 304 ||
+					xhr.status === 0 ||
+					xhr.status == 1223 ) );
+	};
+
+	var getResponseText = function( xhr )
+	{
+		if ( checkStatus( xhr ) )
+			return xhr.responseText;
+		return null;
+	};
+
+	var getResponseXml = function( xhr )
+	{
+		if ( checkStatus( xhr ) )
+		{
+			var xml = xhr.responseXML;
+			return new CKEDITOR.xml( xml && xml.firstChild ? xml : xhr.responseText );
+		}
+		return null;
+	};
+
+	var load = function( url, callback, getResponseFn )
+	{
+		var async = !!callback;
+
+		var xhr = createXMLHttpRequest();
+
+		if ( !xhr )
+			return null;
+
+		xhr.open( 'GET', url, async );
+
+		if ( async )
+		{
+			// TODO: perform leak checks on this closure.
+			/** @ignore */
+			xhr.onreadystatechange = function()
+			{
+				if ( xhr.readyState == 4 )
+				{
+					callback( getResponseFn( xhr ) );
+					xhr = null;
+				}
+			};
+		}
+
+		xhr.send(null);
+
+		return async ? '' : getResponseFn( xhr );
+	};
+
+	return 	/** @lends CKEDITOR.ajax */ {
+
+		/**
+		 * Loads data from an URL as plain text.
+		 * @param {String} url The URL from which load data.
+		 * @param {Function} [callback] A callback function to be called on
+		 *		data load. If not provided, the data will be loaded
+		 *		asynchronously, passing the data value the function on load.
+		 * @returns {String} The loaded data. For asynchronous requests, an
+		 *		empty string. For invalid requests, null.
+		 * @example
+		 * // Load data synchronously.
+		 * var data = CKEDITOR.ajax.load( 'somedata.txt' );
+		 * alert( data );
+		 * @example
+		 * // Load data asynchronously.
+		 * var data = CKEDITOR.ajax.load( 'somedata.txt', function( data )
+		 *     {
+		 *         alert( data );
+		 *     } );
+		 */
+		load : function( url, callback )
+		{
+			return load( url, callback, getResponseText );
+		},
+
+		/**
+		 * Loads data from an URL as XML.
+		 * @param {String} url The URL from which load data.
+		 * @param {Function} [callback] A callback function to be called on
+		 *		data load. If not provided, the data will be loaded
+		 *		asynchronously, passing the data value the function on load.
+		 * @returns {CKEDITOR.xml} An XML object holding the loaded data. For asynchronous requests, an
+		 *		empty string. For invalid requests, null.
+		 * @example
+		 * // Load XML synchronously.
+		 * var xml = CKEDITOR.ajax.loadXml( 'somedata.xml' );
+		 * alert( xml.getInnerXml( '//' ) );
+		 * @example
+		 * // Load XML asynchronously.
+		 * var data = CKEDITOR.ajax.loadXml( 'somedata.xml', function( xml )
+		 *     {
+		 *         alert( xml.getInnerXml( '//' ) );
+		 *     } );
+		 */
+		loadXml : function( url, callback )
+		{
+			return load( url, callback, getResponseXml );
+		}
+	};
+})();
Index: /CKEditor/tags/3.0 Beta/_source/core/ckeditor.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/ckeditor.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/ckeditor.js	(revision 3046)
@@ -0,0 +1,96 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Contains the third and last part of the {@link CKEDITOR} object
+ *		definition.
+ */
+
+// Remove the CKEDITOR.loadFullCore reference defined on ckeditor_basic.
+delete CKEDITOR.loadFullCore;
+
+/**
+ * Holds references to all editor instances created. The name of the properties
+ * in this object correspond to instance names, and their values contains the
+ * {@link CKEDITOR.editor} object representing them.
+ * @type {Object}
+ * @example
+ * alert( <b>CKEDITOR.instances</b>.editor1.name );  // "editor1"
+ */
+CKEDITOR.instances = {};
+
+/**
+ * The document of the window holding the CKEDITOR object.
+ * @type {CKEDITOR.dom.document}
+ * @example
+ * alert( <b>CKEDITOR.document</b>.getBody().getName() );  // "body"
+ */
+CKEDITOR.document = new CKEDITOR.dom.document( document );
+
+/**
+ * Adds an editor instance to the global {@link CKEDITOR} object. This function
+ * is available for internal use mainly.
+ * @param {CKEDITOR.editor} editor The editor instance to be added.
+ * @example
+ */
+CKEDITOR.add = function( editor )
+{
+	CKEDITOR.instances[ editor.name ] = editor;
+
+	editor.on( 'focus', function()
+		{
+			if ( CKEDITOR.currentInstance != editor )
+			{
+				CKEDITOR.currentInstance = editor;
+				CKEDITOR.fire( 'currentInstance' );
+			}
+		});
+
+	editor.on( 'blur', function()
+		{
+			if ( CKEDITOR.currentInstance == editor )
+			{
+				CKEDITOR.currentInstance = null;
+				CKEDITOR.fire( 'currentInstance' );
+			}
+		});
+};
+
+/**
+ * Removes and editor instance from the global {@link CKEDITOR} object. his function
+ * is available for internal use mainly.
+ * @param {CKEDITOR.editor} editor The editor instance to be added.
+ * @example
+ */
+CKEDITOR.remove = function( editor )
+{
+	delete CKEDITOR.instances[ editor.name ];
+};
+
+// Load the bootstrap script.
+CKEDITOR.loader.load( 'core/_bootstrap' );		// @Packager.RemoveLine
+
+// Tri-state constants.
+
+/**
+ * Used to indicate the ON or ACTIVE state.
+ * @constant
+ * @example
+ */
+CKEDITOR.TRISTATE_ON = 1;
+
+/**
+ * Used to indicate the OFF or NON ACTIVE state.
+ * @constant
+ * @example
+ */
+CKEDITOR.TRISTATE_OFF = 2;
+
+/**
+ * Used to indicate DISABLED state.
+ * @constant
+ * @example
+ */
+CKEDITOR.TRISTATE_DISABLED = 0;
Index: /CKEditor/tags/3.0 Beta/_source/core/ckeditor_base.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/ckeditor_base.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/ckeditor_base.js	(revision 3046)
@@ -0,0 +1,146 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Contains the first and essential part of the {@link CKEDITOR}
+ *		object definition.
+ */
+
+// #### Compressed Code
+// Must be updated on changes in the script, as well as updated in the
+// ckeditor_source.js and ckeditor_basic_source.js files.
+
+// if (!window.CKEDITOR){window.CKEDITOR=(function(){return/**@lends CKEDITOR*/{_:{},status:'unloaded',timestamp:'',basePath:(function(){var A='';var B=document.getElementsByTagName('script');for (var i=0;i<B.length;i++){var C=B[i].src.match(/(^|.*[\\\/])ckeditor(?:_basic)?(?:_source)?.js(?:\?.*)?$/i);if (C){A=C[1];break;}};if (A.indexOf('://')==-1){if (A.indexOf('/')===0) A=location.href.match(/^.*?:\/\/[^\/]*/)[0]+A;else A=location.href.match(/^[^\?]*\//)[0]+A;};return A;})(),getUrl:function(resource){if (resource.indexOf('://')==-1&&resource.indexOf('/')!==0) resource=this.basePath+resource;if (this.timestamp) resource+=(resource.indexOf('?')>=0?'&':'?')+'t='+this.timestamp;return resource;}};})();};
+
+// #### Raw code
+// ATTENTION: read the above "Compressed Code" notes when changing this code.
+
+if ( !window.CKEDITOR )
+{
+	/**
+	 * This is the API entry point. The entire CKEditor code runs under this object.
+	 * @name CKEDITOR
+	 * @namespace
+	 * @example
+	 */
+	window.CKEDITOR = (function()
+	{
+		return /** @lends CKEDITOR */ {
+
+			/**
+			 * A constant string unique for each release of CKEditor. Its value
+			 * is used, by default, to build the URL for all resources loaded
+			 * by the editor code, guaranteing clean cache results when
+			 * upgrading.
+			 * @type String
+			 * @example
+			 * alert( CKEDITOR.timestamp );  // e.g. '87dm'
+			 */
+			timestamp : '',				// %REMOVE_LINE%
+			/*							// %REMOVE_LINE%
+			// The production implementation contains a fixed timestamp, unique
+			// for each release, generated by the releaser.
+			// (Base 36 value of each component of YYMMDDHH - 4 chars total - e.g. 87bm == 08071122)
+			timestamp : '%TIMESTAMP%',
+			 */							// %REMOVE_LINE%
+
+			/**
+			 * Private object used to hold core stuff. It should not be used out of
+			 * the API code as properties defined here may change at any time
+			 * without notice.
+			 * @private
+			 */
+			_ : {},
+
+			/**
+			 * Indicates the API loading status. The following status are available:
+			 *		<ul>
+			 *			<li><b>unloaded</b>: the API is not yet loaded.</li>
+			 *			<li><b>basic_loaded</b>: the basic API features are available.</li>
+			 *			<li><b>basic_ready</b>: the basic API is ready to load the full core code.</li>
+			 *			<li><b>loading</b>: the full API is being loaded.</li>
+			 *			<li><b>ready</b>: the API can be fully used.</li>
+			 *		</ul>
+			 * @type String
+			 * @example
+			 * if ( <b>CKEDITOR.status</b> == 'ready' )
+			 * {
+			 *     // The API can now be fully used.
+			 * }
+			 */
+			status : 'unloaded',
+
+			/**
+			 * Contains the full URL for the CKEditor installation directory.
+			 * @type String
+			 * @example
+			 * alert( <b>CKEDITOR.basePath</b> );  // "http://www.example.com/ckeditor/" (e.g.)
+			 */
+			basePath : (function()
+			{
+				// ATTENTION: fixes on this code must be ported to
+				// var basePath in "core/loader.js".
+
+				// Find out the editor directory path, based on its <script> tag.
+				var path = '';
+				var scripts = document.getElementsByTagName( 'script' );
+
+				for ( var i = 0 ; i < scripts.length ; i++ )
+				{
+					var match = scripts[i].src.match( /(^|.*[\\\/])ckeditor(?:_basic)?(?:_source)?.js(?:\?.*)?$/i );
+
+					if ( match )
+					{
+						path = match[1];
+						break;
+					}
+				}
+
+				// In IE (only) the script.src string is the raw valued entered in the
+				// HTML. Other browsers return the full resolved URL instead.
+				if ( path.indexOf('://') == -1 )
+				{
+					// Absolute path.
+					if ( path.indexOf( '/' ) === 0 )
+						path = location.href.match( /^.*?:\/\/[^\/]*/ )[0] + path;
+					// Relative path.
+					else
+						path = location.href.match( /^[^\?]*\/(?:)/ )[0] + path;
+				}
+
+				return path;
+			})(),
+
+			/**
+			 * Gets the full URL for CKEditor resources. By default, URLs
+			 * returned by this function contains a querystring parameter ("t")
+			 * set to the {@link CKEDITOR.timestamp} value.
+			 * @returns {String} The full URL.
+			 * @example
+			 * // e.g. http://www.example.com/ckeditor/skins/default/editor.css?t=87dm
+			 * alert( CKEDITOR.getUrl( 'skins/default/editor.css' ) );
+			 * @example
+			 * // e.g. http://www.example.com/skins/default/editor.css?t=87dm
+			 * alert( CKEDITOR.getUrl( '/skins/default/editor.css' ) );
+			 * @example
+			 * // e.g. http://www.somesite.com/skins/default/editor.css?t=87dm
+			 * alert( CKEDITOR.getUrl( 'http://www.somesite.com/skins/default/editor.css' ) );
+			 */
+			getUrl : function( resource )
+			{
+				// If this is not a full or absolute path.
+				if ( resource.indexOf('://') == -1 && resource.indexOf( '/' ) !== 0 )
+					resource = this.basePath + resource;
+
+				if ( this.timestamp )
+					resource += ( resource.indexOf( '?' ) >= 0 ? '&' : '?' ) + 't=' + this.timestamp;
+
+				return resource;
+			}
+		};
+	})();
+}
+
+// PACKAGER_RENAME( CKEDITOR )
Index: /CKEditor/tags/3.0 Beta/_source/core/ckeditor_basic.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/ckeditor_basic.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/ckeditor_basic.js	(revision 3046)
@@ -0,0 +1,242 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Contains the second part of the {@link CKEDITOR} object
+ *		definition, which defines the basic editor features to be available in
+ *		the root ckeditor_basic.js file.
+ */
+
+if ( CKEDITOR.status == 'unloaded' )
+{
+	(function()
+	{
+		CKEDITOR.event.implementOn( CKEDITOR );
+
+		/**
+		 * Forces the full CKEditor core code, in the case only the basic code has been
+		 * loaded (ckeditor_basic.js). This method self-destroys (becomes undefined) in
+		 * the first call or as soon as the full code is available.
+		 * @example
+		 * // Check if the full core code has been loaded and load it.
+		 * if ( CKEDITOR.loadFullCore )
+		 *     <b>CKEDITOR.loadFullCore()</b>;
+		 */
+		CKEDITOR.loadFullCore = function()
+		{
+			// If not the basic code is not ready it, just mark it to be loaded.
+			if ( CKEDITOR.status != 'basic_ready' )
+			{
+				CKEDITOR.loadFullCore._load = true;
+				return;
+			}
+
+			// Destroy this function.
+			delete CKEDITOR.loadFullCore;
+
+			// Append the script to the head.
+			var script = document.createElement( 'script' );
+			script.type = 'text/javascript';
+			script.src = CKEDITOR.basePath + 'ckeditor.js';
+			script.src = CKEDITOR.basePath + 'ckeditor_source.js';		// %REMOVE_LINE%
+
+			document.getElementsByTagName( 'head' )[0].appendChild( script );
+		};
+
+		/**
+		 * The time to wait (in seconds) to load the full editor code after the
+		 * page load, if the "ckeditor_basic" file is used. If set to zero, the
+		 * editor is loaded on demand, as soon as an instance is created.
+		 *
+		 * This value must be set on the page before the page load completion.
+		 * @type Number
+		 * @default 0 (zero)
+		 * @example
+		 * // Loads the full source after five seconds.
+		 * CKEDITOR.loadFullCoreTimeout = 5;
+		 */
+		CKEDITOR.loadFullCoreTimeout = 0;
+
+		/**
+		 * The class name used to identify &lt;textarea&gt; elements to be replace
+		 * by CKEditor instances.
+		 * @type String
+		 * @default 'ckeditor'
+		 * @example
+		 * <b>CKEDITOR.replaceClass</b> = 'rich_editor';
+		 */
+		CKEDITOR.replaceClass = 'ckeditor';
+
+		/**
+		 * Enables the replacement of all textareas with class name matching
+		 * {@link CKEDITOR.replaceClass}.
+		 * @type Boolean
+		 * @default true
+		 * @example
+		 * // Disable the auto-replace feature.
+		 * <b>CKEDITOR.replaceByClassEnabled</b> = false;
+		 */
+		CKEDITOR.replaceByClassEnabled = true;
+
+		var createInstance = function( elementOrIdOrName, config, creationFunction )
+		{
+			if ( CKEDITOR.env.isCompatible )
+			{
+				// Load the full core.
+				if ( CKEDITOR.loadFullCore )
+					CKEDITOR.loadFullCore();
+
+				var editor = creationFunction( elementOrIdOrName, config );
+				CKEDITOR.add( editor );
+				return editor;
+			}
+
+			return null;
+		};
+
+		/**
+		 * Replaces a &lt;textarea&gt; or a DOM element (DIV) with a CKEditor
+		 * instance. For textareas, the initial value in the editor will be the
+		 * textarea value. For DOM elements, their innerHTML will be used
+		 * instead. We recommend using TEXTAREA and DIV elements only.
+		 * @param {Object|String} elementOrIdOrName The DOM element (textarea), its
+		 *		ID or name.
+		 * @param {Object} [config] The specific configurations to apply to this
+		 *		editor instance. Configurations set here will override global CKEditor
+		 *		settings.
+		 * @returns {CKEDITOR.editor} The editor instance created.
+		 * @example
+		 * &lt;textarea id="myfield" name="myfield"&gt;&lt:/textarea&gt;
+		 * ...
+		 * <b>CKEDITOR.replace( 'myfield' )</b>;
+		 * @example
+		 * var textarea = document.body.appendChild( document.createElement( 'textarea' ) );
+		 * <b>CKEDITOR.replace( textarea )</b>;
+		 */
+		CKEDITOR.replace = function( elementOrIdOrName, config )
+		{
+			return createInstance( elementOrIdOrName, config, CKEDITOR.editor.replace );
+		};
+
+		/**
+		 * Creates a new editor instance inside a specific DOM element.
+		 * @param {Object|String} elementOrId The DOM element or its ID.
+		 * @param {Object} [config] The specific configurations to apply to this
+		 *		editor instance. Configurations set here will override global CKEditor
+		 *		settings.
+		 * @returns {CKEDITOR.editor} The editor instance created.
+		 * @example
+		 * &lt;div id="editorSpace"&gt;&lt:/div&gt;
+		 * ...
+		 * <b>CKEDITOR.appendTo( 'editorSpace' )</b>;
+		 */
+		CKEDITOR.appendTo = function( elementOrId, config )
+		{
+			return createInstance( elementOrId, config, CKEDITOR.editor.appendTo );
+		};
+
+		/**
+		 * @ignore
+		 * Documented at ckeditor.js.
+		 */
+		CKEDITOR.add = function( editor )
+		{
+			// For now, just put the editor in the pending list. It will be
+			// processed as soon as the full code gets loaded.
+			var pending = this._.pending || ( this._.pending = [] );
+			pending.push( editor );
+		};
+
+		/**
+		 * Replace all &lt;textarea&gt; elements available in the document with
+		 * editor instances.
+		 * @example
+		 * // Replace all &lt;textarea&gt; elements in the page.
+		 * CKEDITOR.replaceAll();
+		 * @example
+		 * // Replace all &lt;textarea class="myClassName"&gt; elements in the page.
+		 * CKEDITOR.replaceAll( 'myClassName' );
+		 * @example
+		 * // Selectively replace &lt;textarea&gt; elements, based on custom assertions.
+		 * CKEDITOR.replaceAll( function( textarea, config )
+		 *     {
+		 *         // Custom code to evaluate the replace, returning false
+		 *         // if it must not be done.
+		 *         // It also passes the "config" parameter, so the
+		 *         // developer can customize the instance.
+		 *     } );
+		 */
+		CKEDITOR.replaceAll = function()
+		{
+			var textareas = document.getElementsByTagName( 'textarea' );
+
+			for ( var i = 0 ; i < textareas.length ; i++ )
+			{
+				var config = null;
+				var textarea = textareas[i];
+				var name = textarea.name;
+
+				// The "name" and/or "id" attribute must exist.
+				if ( !textarea.name && !textarea.id )
+					continue;
+
+				if ( typeof arguments[0] == 'string' )
+				{
+					// The textarea class name could be passed as the function
+					// parameter.
+
+					var classRegex = new RegExp( '(?:^| )' + arguments[0] + '(?:$| )' );
+
+					if ( !classRegex.test( textarea.className ) )
+						continue;
+				}
+				else if ( typeof arguments[0] == 'function' )
+				{
+					// An assertion function could be passed as the function parameter.
+					// It must explicitly return "false" to ignore a specific <textarea>.
+					config = {};
+					if ( arguments[0]( textarea, config ) === false )
+						continue;
+				}
+
+				this.replace( textarea, config );
+			}
+		};
+
+		(function()
+		{
+			var onload = function()
+			{
+				var loadFullCore = CKEDITOR.loadFullCore,
+					loadFullCoreTimeout = CKEDITOR.loadFullCoreTimeout;
+
+				// Replace all textareas with the default class name.
+				if ( CKEDITOR.replaceByClassEnabled )
+					CKEDITOR.replaceAll( CKEDITOR.replaceClass );
+
+				CKEDITOR.status = 'basic_ready';
+
+				if ( loadFullCore && loadFullCore._load )
+					loadFullCore();
+				else if ( loadFullCoreTimeout )
+				{
+					setTimeout( function()
+						{
+							if ( CKEDITOR.loadFullCore )
+								CKEDITOR.loadFullCore();
+						}
+						, loadFullCoreTimeout * 1000 );
+				}
+			};
+
+			if ( window.addEventListener )
+				window.addEventListener( 'load', onload, false );
+			else if ( window.attachEvent )
+				window.attachEvent( 'onload', onload );
+		})();
+
+		CKEDITOR.status = 'basic_loaded';
+	})();
+}
Index: /CKEditor/tags/3.0 Beta/_source/core/command.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/command.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/command.js	(revision 3046)
@@ -0,0 +1,21 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+CKEDITOR.command = function( editor, commandDefinition )
+{
+	this.state = CKEDITOR.TRISTATE_OFF;
+
+	this.exec = function()
+	{
+		commandDefinition.exec.call( this, editor );
+	};
+
+	CKEDITOR.tools.extend( this, commandDefinition );
+
+	// Call the CKEDITOR.event constructor to initialize this instance.
+	CKEDITOR.event.call( this );
+};
+
+CKEDITOR.event.implementOn( CKEDITOR.command.prototype );
Index: /CKEditor/tags/3.0 Beta/_source/core/commanddefinition.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/commanddefinition.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/commanddefinition.js	(revision 3046)
@@ -0,0 +1,35 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Defines the "virtual" {@link CKEDITOR.commandDefinition} class,
+ *		which contains the defintion of a command. This file is for
+ *		documentation purposes only.
+ */
+
+/**
+ * (Virtual Class) Do not call this constructor. This class is not really part
+ *		of the API. It just illustrates the features of command objects to be
+ *		passed to the {@link CKEDITOR.editor.prototype.addCommand} function.
+ * @name CKEDITOR.commandDefinition
+ * @constructor
+ * @example
+ */
+
+ /**
+ * Executes the command.
+ * @name CKEDITOR.commandDefinition.prototype.exec
+ * @function
+ * @param {CKEDITOR.editor} editor The editor within which run the command.
+ * @param {Object} [data] Additional data to be used to execute the command.
+ * @example
+ * editorInstance.addCommand( 'sample',
+ * {
+ *     exec : function( editor )
+ *     {
+ *         alert( 'Executing a command for the editor name "' + editor.name + '"!' );
+ *     }
+ * });
+ */
Index: /CKEditor/tags/3.0 Beta/_source/core/config.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/config.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/config.js	(revision 3046)
@@ -0,0 +1,189 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Defines the {@link CKEDITOR.config} object, which holds the
+ * default configuration settings.
+ */
+
+/**
+ * Holds the default configuration settings. Changes to this object are
+ * reflected in all editor instances, if not specificaly specified for those
+ * instances.
+ * @namespace
+ * @example
+ * // All editor created after the following setting will not load custom
+ * // configuration files.
+ * CKEDITOR.config.customConfig = '';
+ */
+CKEDITOR.config =
+{
+	/**
+	 * The URL path for the custom configuration file to be loaded. If not
+	 * overloaded with inline configurations, it defaults to the "config.js"
+	 * file present in the root of the CKEditor installation directory.<br /><br />
+	 *
+	 * CKEditor will recursively load custom configuration files defined inside
+	 * other custom configuration files.
+	 * @type String
+	 * @default '&lt;CKEditor folder&gt;/config.js'
+	 * @example
+	 * // Load a specific configuration file.
+	 * CKEDITOR.replace( 'myfiled', { customConfig : '/myconfig.js' } );
+	 * @example
+	 * // Do not load any custom configuration file.
+	 * CKEDITOR.replace( 'myfiled', { customConfig : '' } );
+	 */
+	customConfig : CKEDITOR.getUrl( 'config.js' ),
+
+	autoUpdateElement : true,
+
+	/**
+	 * The base href URL used to resolve relative and absolute URLs in the
+	 * editor content.
+	 * @type String
+	 * @default '' (empty string)
+	 * @example
+	 * config.baseHref = 'http://www.example.com/path/';
+	 */
+	baseHref : '',
+
+	/**
+	 * The CSS file to be used to apply style to the contents. It should
+	 * reflect the CSS used in the final pages where the contents are to be
+	 * used.
+	 * @type String
+	 * @default '&lt;CKEditor folder&gt;/contents.css'
+	 * @example
+	 * config.contentsCss = '/css/mysitestyles.css';
+	 */
+	contentsCss : CKEDITOR.basePath + 'contents.css',
+
+	/**
+	 * The writting direction of the language used to write the editor
+	 * contents. Allowed values are 'ltr' for Left-To-Right language (like
+	 * English), or 'rtl' for Right-To-Left languages (like Arabic).
+	 * @default 'ltr'
+	 * @type String
+	 * @example
+	 * config.contentsLangDirection = 'rtl';
+	 */
+	contentsLangDirection : 'ltr',
+
+	/**
+	 * Instructs the editor to automatically localize the editor to the user
+	 * language, if possible. If set to false, the [@link #defaultLanguage]
+	 * language is used.
+	 * @default true
+	 * @type Boolean
+	 * @example
+	 * // Forces the editor to always load the German interface.
+	 * config.autoLanguage = false;
+	 * config.defaultLanguage = 'de';
+	 */
+	autoLanguage : true,
+
+	/**
+	 * The language to be used if [@link #autoLanguage] is set to false, or
+	 * when it's not possible to localize the editor to the user language.
+	 * @default 'en'
+	 * @type String
+	 * @example
+	 * config.defaultLanguage = 'it';
+	 */
+	defaultLanguage : 'en',
+
+	enterMode : 'p',
+	shiftEnterMode : 'br',
+
+	/**
+	 * A comma separated list of plugins that are not related to editor
+	 * instances. Reserved to plugins that extend the core code only.<br /><br />
+	 *
+	 * There are no ways to override this setting, except by editing the source
+	 * code of CKEditor (_source/core/config.js).
+	 * @type String
+	 * @example
+	 */
+	corePlugins : '',
+
+	/**
+	 * Sets the doctype to be used when loading the editor content as HTML.
+	 * @type String
+	 * @default '&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;'
+	 * @example
+	 * // Set the doctype to the HTML 4 (quirks) mode.
+	 * config.docType = '&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&gt;';
+	 */
+	docType : '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
+
+	/**
+	 * Indicates whether the contents to be edited are being inputted as a full
+	 * HTML page. A full page includes the &lt;html&gt;, &lt;head&gt; and
+	 * &lt;body&gt; tags. The final output will also reflect this setting,
+	 * including the &lt;body&gt; contents only if this setting is disabled.
+	 * @type Boolean
+	 * @default false
+	 * @example
+	 * config.fullPage = true;
+	 */
+	fullPage : false,
+
+	/**
+	 * The editor height, in CSS size format or pixel integer.
+	 * @type String|Number
+	 * @default '200'
+	 * @example
+	 */
+	height : 200,
+
+	/**
+	 * Comma separated list of plugins to load and initialize for an editor
+	 * instance.
+	 * @type String
+	 * @example
+	 * config.plugins = 'basicstyles,button,htmldataprocessor,toolbar,wysiwygarea';
+	 */
+	plugins : 'basicstyles,button,elementspath,horizontalrule,htmldataprocessor,keystrokes,newpage,removeformat,smiley,sourcearea,specialchar,tab,toolbar,wysiwygarea',
+
+	/**
+	 * The theme to be used to build the UI.
+	 * @type String
+	 * @default 'default'
+	 * @see CKEDITOR.config.skin
+	 * @example
+	 * config.theme = 'default';
+	 */
+	theme : 'default',
+
+	/**
+	 * The skin to load.
+	 * @type String
+	 * @default 'default'
+	 * @example
+	 * config.skin = 'v2';
+	 */
+	skin : 'default',
+
+	/**
+	 * The editor width in CSS size format or pixel integer.
+	 * @type String|Number
+	 * @default '100%'
+	 * @example
+	 */
+	width : '100%',
+
+	/**
+	 * The base Z-index for floating dialogs and popups.
+	 * @type Number
+	 * @default 10000
+	 * @example
+	 * config.baseFloatZIndex = 2000
+	 */
+	baseFloatZIndex : 10000
+
+};
+
+// PACKAGER_RENAME( CKEDITOR.config )
Index: /CKEditor/tags/3.0 Beta/_source/core/dom.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/dom.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/dom.js	(revision 3046)
@@ -0,0 +1,21 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Defines the {@link CKEDITOR.dom} object, which contains DOM
+ *		manipulation objects and function.
+ */
+
+/**
+ * DOM manipulation objects and function.<br /><br />
+ * @see CKEDITOR.dom.element
+ * @see CKEDITOR.dom.node
+ * @namespace
+ * @example
+ */
+CKEDITOR.dom =
+{};
+
+// PACKAGER_RENAME( CKEDITOR.dom )
Index: /CKEditor/tags/3.0 Beta/_source/core/dom/document.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/dom/document.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/dom/document.js	(revision 3046)
@@ -0,0 +1,145 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Defines the {@link CKEDITOR.dom.document} class, which
+ *		represents a DOM document.
+ */
+
+/**
+ * Represents a DOM document.
+ * @constructor
+ * @augments CKEDITOR.dom.domObject
+ * @param {Object} domDocument A native DOM document.
+ * @example
+ * var document = new CKEDITOR.dom.document( document );
+ */
+CKEDITOR.dom.document = function( domDocument )
+{
+	CKEDITOR.dom.domObject.call( this, domDocument );
+};
+
+// PACKAGER_RENAME( CKEDITOR.dom.document )
+
+CKEDITOR.dom.document.prototype = new CKEDITOR.dom.domObject();
+
+CKEDITOR.tools.extend( CKEDITOR.dom.document.prototype,
+	/** @lends CKEDITOR.dom.document.prototype */
+	{
+		/**
+		 * Appends a CSS file to the document.
+		 * @param {String} cssFileUrl The CSS file URL.
+		 * @example
+		 * <b>CKEDITOR.document.appendStyleSheet( '/mystyles.css' )</b>;
+		 */
+		appendStyleSheet : function( cssFileUrl )
+		{
+			if ( this.$.createStyleSheet )
+				this.$.createStyleSheet( cssFileUrl );
+			else
+			{
+				var link = new CKEDITOR.dom.element( 'link' );
+				link.setAttributes(
+					{
+						rel		:'stylesheet',
+						type	: 'text/css',
+						href	: cssFileUrl
+					});
+
+				this.getHead().append( link );
+			}
+		},
+
+		createElement : function( name, attribsAndStyles )
+		{
+			var element = new CKEDITOR.dom.element( name, this );
+
+			if ( attribsAndStyles )
+			{
+				if ( attribsAndStyles.attributes )
+					element.setAttributes( attribsAndStyles.attributes );
+
+				if ( attribsAndStyles.styles )
+					element.setStyles( attribsAndStyles.styles );
+			}
+
+			return element;
+		},
+
+		createText : function( text )
+		{
+			return new CKEDITOR.dom.text( '', this );
+		},
+
+		/**
+		 * Gets and element based on its id.
+		 * @param {String} elementId The element id.
+		 * @returns {CKEDITOR.dom.element} The element instance, or null if not found.
+		 * @example
+		 * var element = <b>CKEDITOR.document.getById( 'myElement' )</b>;
+		 * alert( element.getId() );  // "myElement"
+		 */
+		getById : function( elementId )
+		{
+			var $ = this.$.getElementById( elementId );
+			return $ ? new CKEDITOR.dom.element( $ ) : null;
+		},
+
+		/**
+		 * Gets the &lt;head&gt; element for this document.
+		 * @returns {CKEDITOR.dom.element} The &lt;head&gt; element.
+		 * @example
+		 * var element = <b>CKEDITOR.document.getHead()</b>;
+		 * alert( element.getName() );  // "head"
+		 */
+		getHead : function()
+		{
+			var head = this.$.getElementsByTagName( 'head' )[0];
+			head = new CKEDITOR.dom.element( head );
+
+			return (
+			/** @ignore */
+			this.getHead = function()
+				{
+					return head;
+				})();
+		},
+
+		/**
+		 * Gets the &lt;body&gt; element for this document.
+		 * @returns {CKEDITOR.dom.element} The &lt;body&gt; element.
+		 * @example
+		 * var element = <b>CKEDITOR.document.getBody()</b>;
+		 * alert( element.getName() );  // "body"
+		 */
+		getBody : function()
+		{
+			var body = new CKEDITOR.dom.element( this.$.body );
+
+			return (
+			/** @ignore */
+			this.getBody = function()
+				{
+					return body;
+				})();
+		},
+
+		/**
+		 * Gets the window object that holds this document.
+		 * @returns {CKEDITOR.dom.window} The window object.
+		 * @example
+		 */
+		getWindow : function()
+		{
+			var win = new CKEDITOR.dom.window( this.$.parentWindow || this.$.defaultView );
+
+			return (
+			/** @ignore */
+			this.getWindow = function()
+				{
+					return win;
+				})();
+		}
+	});
Index: /CKEditor/tags/3.0 Beta/_source/core/dom/documentFragment.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/dom/documentFragment.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/dom/documentFragment.js	(revision 3046)
@@ -0,0 +1,44 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+CKEDITOR.dom.documentFragment = function( ownerDocument )
+{
+	this.$ = CKEDITOR.env.ie ? ownerDocument.$.createElement( 'div' ) : ownerDocument.$.createDocumentFragment();
+};
+
+(function()
+{
+	var elementPrototype = CKEDITOR.dom.element.prototype;
+
+	CKEDITOR.dom.documentFragment.prototype =
+	{
+		type : CKEDITOR.NODE_DOCUMENT_FRAGMENT,
+
+		append : elementPrototype.append,
+
+		appendTo : function( targetElement )
+		{
+			if ( CKEDITOR.env.ie )
+				elementPrototype.moveChildren.call( this, targetElement );
+			else
+				targetElement.$.appendChild( this.$ );
+		},
+
+		insertAfterNode : function( node )
+		{
+			var $ = this.$;
+			var $node = node.$;
+			var $parent = $node.parentNode;
+
+			if ( CKEDITOR.env.ie )
+			{
+				for ( var child ; child = $.lastChild ; )
+					$parent.insertBefore( $.removeChild( child ), $node.nextSibling );
+			}
+			else
+				$parent.insertBefore( $, $node.nextSibling );
+		}
+	};
+})();
Index: /CKEditor/tags/3.0 Beta/_source/core/dom/domobject.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/dom/domobject.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/dom/domobject.js	(revision 3046)
@@ -0,0 +1,174 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Defines the {@link CKEDITOR.editor} class, which is the base
+ *		for other classes representing DOM objects.
+ */
+
+/**
+ * Represents a DOM object. This class is not intended to be used directly. It
+ * serves as the base class for other classes representing specific DOM
+ * objects.
+ * @constructor
+ * @param {Object} nativeDomObject A native DOM object.
+ * @augments CKEDITOR.event
+ * @example
+ */
+CKEDITOR.dom.domObject = function( nativeDomObject )
+{
+	if ( nativeDomObject )
+	{
+		/**
+		 * The native DOM object represented by this class instance.
+		 * @type Object
+		 * @example
+		 * var element = new CKEDITOR.dom.element( 'span' );
+		 * alert( element.$.nodeType );  // "1"
+		 */
+		this.$ = nativeDomObject;
+
+		// Get the main private function from the custom data. Create it if not
+		// defined.
+		if ( !( this._ = this.getCustomData( '_' ) ) )
+			this.setCustomData( '_', ( this._ = {} ) );
+
+		// Call the base event constructor.
+		if ( !this._.events )
+			CKEDITOR.event.call( this );
+	}
+};
+
+CKEDITOR.dom.domObject.prototype = (function()
+{
+	// Do not define other local variables here. We want to keep the native
+	// listener closures as clean as possible.
+
+	var getNativeListener = function( domObject, eventName )
+	{
+		return function( domEvent )
+		{
+			domObject.fire( eventName, new CKEDITOR.dom.event( domEvent ) );
+		};
+	};
+
+	return /** @lends CKEDITOR.dom.domObject.prototype */ {
+
+		/** @ignore */
+		on  : function( eventName )
+		{
+			// We customize the "on" function here. The basic idea is that we'll have
+			// only one listener for a native event, which will then call all listeners
+			// set to the event.
+
+			// Get the listeners holder object.
+			var nativeListeners = this.getCustomData( '_cke_nativeListeners' ) || this.setCustomData( '_cke_nativeListeners', {} );
+
+			// Check if we have a listener for that event.
+			if ( !nativeListeners[ eventName ] )
+			{
+				var listener = nativeListeners[ eventName ] = getNativeListener( this, eventName );
+
+				if ( this.$.addEventListener )
+					this.$.addEventListener( eventName, listener, false );
+				else if ( this.$.attachEvent )
+					this.$.attachEvent( 'on' + eventName, listener );
+			}
+
+			// Call the original implementation.
+			return CKEDITOR.event.prototype.on.apply( this, arguments );
+		},
+
+		/** @ignore */
+		removeListener : function( eventName )
+		{
+			// Call the original implementation.
+			CKEDITOR.event.prototype.removeListener.apply( this, arguments );
+
+			// If we don't have listeners for this event, clean the DOM up.
+			if ( !this.hasListeners( eventName ) )
+			{
+				var nativeListeners = this.getCustomData( '_cke_nativeListeners' );
+				var listener = nativeListeners && nativeListeners[ eventName ];
+				if ( listener )
+				{
+					if ( this.$.removeEventListener )
+						this.$.removeEventListener( eventName, listener, false );
+					else if ( this.$.detachEvent )
+						this.$.detachEvent( eventName, listener );
+
+					delete nativeListeners[ eventName ];
+				}
+			}
+		}
+	};
+})();
+
+(function( domObjectProto )
+{
+	var customData = {};
+
+	/**
+	 * Determines whether the specified object is equal to the current object.
+	 * @name CKEDITOR.dom.domObject.prototype.equals
+	 * @function
+	 * @param {Object} object The object to compare with the current object.
+	 * @returns {Boolean} "true" if the object is equal.
+	 * @example
+	 * var doc = new CKEDITOR.dom.document( document );
+	 * alert( doc.equals( CKEDITOR.document ) );  // "true"
+	 * alert( doc == CKEDITOR.document );         // "false"
+	 */
+	domObjectProto.equals = function( object )
+	{
+		return ( object && object.$ === this.$ );
+	};
+
+	/**
+	 * Sets a data slot value for this object. These values are shared by all
+	 * instances pointing to that same DOM object.
+	 * @name CKEDITOR.dom.domObject.prototype.setCustomData
+	 * @function
+	 * @param {String} key A key used to identify the data slot.
+	 * @param {Object} value The value to set to the data slot.
+	 * @returns {CKEDITOR.dom.domObject} This DOM object instance.
+	 * @see CKEDITOR.dom.domObject.prototype.getCustomData
+	 * @example
+	 * var element = new CKEDITOR.dom.element( 'span' );
+	 * element.setCustomData( 'hasCustomData', true );
+	 */
+	domObjectProto.setCustomData = function( key, value )
+	{
+		var expandoNumber = this.$._cke_expando || ( this.$._cke_expando = CKEDITOR.tools.getNextNumber() ),
+			dataSlot = customData[ expandoNumber ] || ( customData[ expandoNumber ] = {} );
+
+		dataSlot[ key ] = value;
+
+		return this;
+	};
+
+	/**
+	 * Gets the value set to a data slot in this object.
+	 * @name CKEDITOR.dom.domObject.prototype.getCustomData
+	 * @function
+	 * @param {String} key The key used to identify the data slot.
+	 * @returns {Object} This value set to the data slot.
+	 * @see CKEDITOR.dom.domObject.prototype.setCustomData
+	 * @example
+	 * var element = new CKEDITOR.dom.element( 'span' );
+	 * alert( element.getCustomData( 'hasCustomData' ) );  // e.g. 'true'
+	 */
+	domObjectProto.getCustomData = function( key )
+	{
+		var expandoNumber = this.$._cke_expando,
+			dataSlot = expandoNumber && customData[ expandoNumber ];
+
+		return ( dataSlot && dataSlot[ key ] ) || null;
+	};
+
+	// Implement CKEDITOR.event.
+	CKEDITOR.event.implementOn( domObjectProto );
+
+})( CKEDITOR.dom.domObject.prototype );
Index: /CKEditor/tags/3.0 Beta/_source/core/dom/domwalker.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/dom/domwalker.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/dom/domwalker.js	(revision 3046)
@@ -0,0 +1,222 @@
+/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+(function()
+{
+	var fireDomWalkerEvent = function( transistionType, fromNode, toNode )
+		{
+			var eventData = { from : fromNode, to : toNode, type : transistionType };
+			this.fire( transistionType, eventData );
+			this._.actionEvents.push( eventData );
+		};
+
+	CKEDITOR.dom.domWalker = function( node )
+	{
+		if ( arguments.length < 1 )
+			return;
+
+		this._ = { currentNode : node, actionEvents : [], stopFlag : false };
+		CKEDITOR.event.implementOn( this );
+	};
+
+	CKEDITOR.dom.domWalker.prototype = {
+		next : (function()
+		{
+			var dfsStepForward = function()
+			{
+				var current = this._.currentNode, next;
+
+				if ( !current )
+					return null;
+
+				if ( current.getChildCount() > 0 )
+				{
+					next = current.getChild( 0 );
+					fireDomWalkerEvent.call( this, 'down', current, next );
+					return next;
+				}
+				else if ( current.getNext() )
+				{
+					next = current.getNext();
+					fireDomWalkerEvent.call( this, 'sibling', current, next );
+					return next;
+				}
+				else
+				{
+					var ancestor = current.getParent();
+					fireDomWalkerEvent.call( this, 'up', current, ancestor );
+
+					while ( ancestor )
+					{
+						if ( ancestor.getNext() )
+						{
+							next = ancestor.getNext();
+							fireDomWalkerEvent.call( this, 'sibling', ancestor, next );
+							return next;
+						}
+						else
+						{
+							next = ancestor.getParent();
+							fireDomWalkerEvent.call( this, 'up', ancestor, next );
+							ancestor = next;
+						}
+					}
+				}
+				return null;
+			};
+
+			return function()
+			{
+				this._.actionEvents = [];
+				return {
+					node : ( this._.currentNode = dfsStepForward.apply( this ) ),
+					events : this._.actionEvents
+				};
+			};
+		})(),
+
+		back : (function()
+		{
+			var dfsStepBackward = function()
+			{
+				var current = this._.currentNode, next;
+
+				if ( !current )
+					return null;
+
+				if ( current.getPrevious() )
+				{
+					var lastChild = current.getPrevious();
+					fireDomWalkerEvent.call( this, 'sibling', current, lastChild );
+					while ( lastChild.getChildCount() > 0 )
+					{
+						next = lastChild.getChild( lastChild.getChildCount() - 1 );
+						fireDomWalkerEvent.call( this, 'down', lastChild, next );
+						lastChild = next;
+					}
+					return lastChild;
+				}
+				else
+				{
+					next = current.getParent();
+					fireDomWalkerEvent.call( this, 'up', current, next );
+					return next;
+				}
+				return null;
+			};
+
+			return function()
+			{
+				this._.actionEvents = [];
+				return {
+					node : ( this._.currentNode = dfsStepBackward.apply( this ) ),
+					events : this._.actionEvents
+				};
+			};
+		})(),
+
+		forward : function( guardFunc )
+		{
+			var retval;
+			this._.stopFlag = false;
+
+			// The default behavior is to stop once the end of document is reached.
+			guardFunc = guardFunc || function( evt ) {};
+
+			this.on( 'sibling', guardFunc );
+			this.on( 'up', guardFunc );
+			this.on( 'down', guardFunc );
+			while( ( !retval || retval.node ) && !this._.stopFlag )
+			{
+				retval = this.next();
+				this.fire( 'step', retval );
+			}
+			this.removeListener( 'sibling', guardFunc );
+			this.removeListener( 'up', guardFunc );
+			this.removeListener( 'down', guardFunc );
+			return retval;
+		},
+
+		reverse : function( guardFunc )
+		{
+			var retval;
+			this._.stopFlag = false;
+
+			// The default behavior is top stop once the start of document is reached.
+			guardFunc = guardFunc || function( evt ) {};
+
+			this.on( 'sibling', guardFunc );
+			this.on( 'up', guardFunc );
+			this.on( 'down', guardFunc );
+			while( ( !retval || retval.node ) && !this._.stopFlag )
+			{
+				retval = this.back();
+				this.fire( 'step', retval );
+			}
+			this.removeListener( 'sibling', guardFunc );
+			this.removeListener( 'up', guardFunc );
+			this.removeListener( 'down', guardFunc );
+			return retval;
+		},
+
+		stop : function()
+		{
+			this._.stopFlag = true;
+			return this;
+		},
+
+		stopped : function()
+		{
+			return this._.stopFlag;
+		},
+
+		setNode : function( node )
+		{
+			this._.currentNode = node;
+			return this;
+		}
+	};
+
+	CKEDITOR.dom.domWalker.blockBoundary = function( customNodeNames )
+	{
+		return function( evt )
+		{
+			/*
+			 * Anything whose display computed style is block, list-item, table,
+			 * table-row-group, table-header-group, table-footer-group, table-row,
+			 * table-column-group, table-column, table-cell, table-caption, or whose node
+			 * name is hr, br (when enterMode is br only) is a block boundary.
+			 */
+			var displayMatches = { block : 1, 'list-item' : 1, table : 1, 'table-row-group' : 1, 'table-header-group' : 1,
+				'table-footer-group' : 1, 'table-row' : 1, 'table-column-group' : 1, 'table-column' : 1, 'table-cell' : 1,
+				'table-caption' : 1 },
+				nodeNameMatches = CKEDITOR.tools.extend( { hr : 1 }, customNodeNames || {} ),
+				to = evt.data.to,
+				from = evt.data.from;
+			if ( to && to.type == CKEDITOR.NODE_ELEMENT )
+			{
+				if ( displayMatches[ to.getComputedStyle( 'display' ) ] || nodeNameMatches[ to.getName() ] )
+				{
+					evt.stop();
+					this.stop();
+					return;
+				}
+			}
+			if ( ( evt.data.type == 'up' || evt.data.type == 'sibling' ) && from && from.type == CKEDITOR.NODE_ELEMENT )
+			{
+				if ( displayMatches[ from.getComputedStyle( 'display' ) ] || nodeNameMatches[ from.getName() ] )
+				{
+					evt.stop();
+					this.stop();
+				}
+			}
+		};
+	};
+
+	CKEDITOR.dom.domWalker.listItemBoundary = function()
+	{
+		return CKEDITOR.dom.domWalker.blockBoundary( { br : 1 } );
+	};
+})();
Index: /CKEditor/tags/3.0 Beta/_source/core/dom/element.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/dom/element.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/dom/element.js	(revision 3046)
@@ -0,0 +1,903 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Defines the {@link CKEDITOR.dom.element} class, which
+ *		represents a DOM element.
+ */
+
+/**
+ * Represents a DOM element.
+ * @constructor
+ * @augments CKEDITOR.dom.node
+ * @param {Object|String} element A native DOM element or the element name for
+ *		new elements.
+ * @param {CKEDITOR.dom.document} [ownerDocument] The document that will contain
+ *		the element in case of element creation.
+ * @example
+ * // Create a new &lt;span&gt; element.
+ * var element = new CKEDITOR.dom.element( 'span' );
+ * @example
+ * // Create an element based on a native DOM element.
+ * var element = new CKEDITOR.dom.element( document.getElementById( 'myId' ) );
+ */
+CKEDITOR.dom.element = function( element, ownerDocument )
+{
+	if ( typeof element == 'string' )
+		element = ( ownerDocument ? ownerDocument.$ : document ).createElement( element );
+
+	// Call the base constructor (we must not call CKEDITOR.dom.node).
+	CKEDITOR.dom.domObject.call( this, element );
+};
+
+// PACKAGER_RENAME( CKEDITOR.dom.element )
+
+/**
+ * The the {@link CKEDITOR.dom.element} representing and element. If the
+ * element is a native DOM element, it will be transformed into a valid
+ * CKEDITOR.dom.element object.
+ * @returns {CKEDITOR.dom.element} The transformed element.
+ * @example
+ * var element = new CKEDITOR.dom.element( 'span' );
+ * alert( element == <b>CKEDITOR.dom.element.get( element )</b> );  "true"
+ * @example
+ * var element = document.getElementById( 'myElement' );
+ * alert( <b>CKEDITOR.dom.element.get( element )</b>.getName() );  e.g. "p"
+ */
+CKEDITOR.dom.element.get = function( element )
+{
+	return element && ( element.$ ? element : new CKEDITOR.dom.element( element ) );
+};
+
+CKEDITOR.dom.element.prototype = new CKEDITOR.dom.node();
+
+/**
+ * Creates an instance of the {@link CKEDITOR.dom.element} class based on the
+ * HTML representation of an element.
+ * @param {String} html The element HTML. It should define only one element in
+ *		the "root" level. The "root" element can have child nodes, but not
+ *		siblings.
+ * @returns {CKEDITOR.dom.element} The element instance.
+ * @example
+ * var element = <b>CKEDITOR.dom.element.createFromHtml( '&lt;strong class="anyclass"&gt;My element&lt;/strong&gt;' )</b>;
+ * alert( element.getName() );  // "strong"
+ */
+CKEDITOR.dom.element.createFromHtml = function( html, ownerDocument )
+{
+	var temp = new CKEDITOR.dom.element( 'div', ownerDocument );
+	temp.setHtml( html );
+
+	// When returning the node, remove it from its parent to detach it.
+	return temp.getFirst().remove();
+};
+
+CKEDITOR.tools.extend( CKEDITOR.dom.element.prototype,
+	/** @lends CKEDITOR.dom.element.prototype */
+	{
+		/**
+		 * The node type. This is a constant value set to
+		 * {@link CKEDITOR.NODE_ELEMENT}.
+		 * @type Number
+		 * @example
+		 */
+		type : CKEDITOR.NODE_ELEMENT,
+
+		/**
+		 * Adds a CSS class to the element. It appends the class to the
+		 * already existing names.
+		 * @param {String} className The name of the class to be added.
+		 * @example
+		 * var element = new CKEDITOR.dom.element( 'div' );
+		 * element.addClass( 'classA' );  // &lt;div class="classA"&gt;
+		 * element.addClass( 'classB' );  // &lt;div class="classA classB"&gt;
+		 * element.addClass( 'classA' );  // &lt;div class="classA classB"&gt;
+		 */
+		addClass : function( className )
+		{
+			var c = this.$.className;
+			if ( c )
+			{
+				var regex = new RegExp( '(?:^|\\s)' + className + '(?:\\s|$)', '' );
+				if ( !regex.test( c ) )
+					c += ' ' + className;
+			}
+			this.$.className = c || className;
+		},
+
+		/**
+		 * Removes a CSS class name from the elements classes. Other classes
+		 * remain untouched.
+		 * @param {String} className The name of the class to remove.
+		 * @example
+		 * var element = new CKEDITOR.dom.element( 'div' );
+		 * element.addClass( 'classA' );  // &lt;div class="classA"&gt;
+		 * element.addClass( 'classB' );  // &lt;div class="classA classB"&gt;
+		 * element.removeClass( 'classA' );  // &lt;div class="classB"&gt;
+		 * element.removeClass( 'classB' );  // &lt;div&gt;
+		 */
+		removeClass : function( className )
+		{
+			var c = this.$.className;
+			if ( c )
+			{
+				var regex = new RegExp( '(?:^|\\s+)' + className + '(?=\\s|$)', '' );
+				if ( regex.test( c ) )
+				{
+					c = c.replace( regex, '' ).replace( /^\s+/, '' );
+
+					if ( c )
+						this.$.className = c;
+					else
+						this.removeAttribute( 'class' );
+				}
+			}
+		},
+
+		/**
+		 * Append a node as a child of this element.
+		 * @param {CKEDITOR.dom.node|String} node The node or element name to be
+		 *		appended.
+		 * @param {Boolean} [toStart] Indicates that the element is to be
+		 *		appended at the start.
+		 * @returns {CKEDITOR.dom.node} The appended node.
+		 * @example
+		 * var p = new CKEDITOR.dom.element( 'p' );
+		 *
+		 * var strong = new CKEDITOR.dom.element( 'strong' );
+		 * <b>p.append( strong );</b>
+		 *
+		 * var em = <b>p.append( 'em' );</b>
+		 *
+		 * // result: "&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;"
+		 */
+		append : function( node, toStart )
+		{
+			if ( typeof node == 'string' )
+				node = new CKEDITOR.dom.element( node );
+
+			if ( toStart )
+				this.$.insertBefore( node.$, this.$.firstChild );
+			else
+				this.$.appendChild( node.$ );
+
+			return node;
+		},
+
+		/**
+		 * Append text to this element.
+		 * @param {String} text The text to be appended.
+		 * @returns {CKEDITOR.dom.node} The appended node.
+		 * @example
+		 * var p = new CKEDITOR.dom.element( 'p' );
+		 * p.appendText( 'This is' );
+		 * p.appendText( ' some text' );
+		 *
+		 * // result: "&lt;p&gt;This is some text&lt;/p&gt;"
+		 */
+		appendText : function( text )
+		{
+			if ( this.$.text != undefined )
+				this.$.text += text;
+			else
+				this.append( new CKEDITOR.dom.text( text ) );
+		},
+
+		/**
+		 * Breaks one of the ancestor element in the element position, moving
+		 * this element between the broken parts.
+		 * @param {CKEDITOR.dom.element} parent The anscestor element to get broken.
+		 * @example
+		 * // Before breaking:
+		 * //     <b>This <i>is some<span /> sample</i> test text</b>
+		 * // If "element" is <span /> and "parent" is <i>:
+		 * //     <b>This <i>is some</i><span /><i> sample</i> test text</b>
+		 * element.breakParent( parent );
+		 * @example
+		 * // Before breaking:
+		 * //     <b>This <i>is some<span /> sample</i> test text</b>
+		 * // If "element" is <span /> and "parent" is <b>:
+		 * //     <b>This <i>is some</i></b><span /><b><i> sample</i> test text</b>
+		 * element.breakParent( parent );
+		 */
+		breakParent : function( parent )
+		{
+			var range = new CKEDITOR.dom.range( this.getDocument() );
+
+			// We'll be extracting part of this element, so let's use our
+			// range to get the correct piece.
+			range.setStartAfter( this );
+			range.setEndAfter( parent );
+
+			// Extract it.
+			var docFrag = range.extractContents();
+
+			// Move the element outside the broken element.
+			range.insertNode( this.remove() );
+
+			// Re-insert the extracted piece after the element.
+			docFrag.insertAfterNode( this );
+		},
+
+		contains :
+			CKEDITOR.env.ie || CKEDITOR.env.webkit ?
+				function( node )
+				{
+					var $ = this.$;
+
+					return node.type != CKEDITOR.NODE_ELEMENT ?
+						$.contains( node.getParent().$ ) :
+						$ != node.$ && $.contains( node.$ );
+				}
+			:
+				function( node )
+				{
+					return !!( this.$.compareDocumentPosition( node.$ ) & 16 );
+				},
+
+		/**
+		 * Moves the selection focus to this element.
+		 * @example
+		 * var element = CKEDITOR.document.getById( 'myTextarea' );
+		 * <b>element.focus()</b>;
+		 */
+		focus : function()
+		{
+			this.$.focus();
+		},
+
+		/**
+		 * Gets the inner HTML of this element.
+		 * @returns {String} The inner HTML of this element.
+		 * @example
+		 * var element = CKEDITOR.dom.element.createFromHtml( '&lt;div&gt;&lt;b&gt;Example&lt;/b&gt;&lt;/div&gt;' );
+		 * alert( <b>p.getHtml()</b> );  // "&lt;b&gt;Example&lt;/b&gt;"
+		 */
+		getHtml : function()
+		{
+			return this.$.innerHTML;
+		},
+
+		/**
+		 * Sets the inner HTML of this element.
+		 * @param {String} html The HTML to be set for this element.
+		 * @returns {String} The inserted HTML.
+		 * @example
+		 * var p = new CKEDITOR.dom.element( 'p' );
+		 * <b>p.setHtml( '&lt;b&gt;Inner&lt;/b&gt; HTML' );</b>
+		 *
+		 * // result: "&lt;p&gt;&lt;b&gt;Inner&lt;/b&gt; HTML&lt;/p&gt;"
+		 */
+		setHtml : function( html )
+		{
+			return ( this.$.innerHTML = html );
+		},
+
+		/**
+		 * Sets the element contents as plain text.
+		 * @param {String} text The text to be set.
+		 * @returns {String} The inserted text.
+		 * @example
+		 * var element = new CKEDITOR.dom.element( 'div' );
+		 * element.setText( 'A > B & C < D' );
+		 * alert( element.innerHTML );  // "A &amp;gt; B &amp;amp; C &amp;lt; D"
+		 */
+		setText : function( text )
+		{
+			CKEDITOR.dom.element.prototype.setText = ( this.$.innerText != undefined ) ?
+				function ( text )
+				{
+					return this.$.innerText = text;
+				} :
+				function ( text )
+				{
+					return this.$.textContent = text;
+				};
+
+			return this.setText( text );
+		},
+
+		/**
+		 * Gets the value of an element attribute.
+		 * @function
+		 * @param {String} name The attribute name.
+		 * @returns {String} The attribute value or null if not defined.
+		 * @example
+		 * var element = CKEDITOR.dom.element.createFromHtml( '&lt;input type="text" /&gt;' );
+		 * alert( <b>element.getAttribute( 'type' )</b> );  // "text"
+		 */
+		getAttribute : (function()
+		{
+			var standard = function( name )
+			{
+				return this.$.getAttribute( name, 2 );
+			};
+
+			if ( CKEDITOR.env.ie )
+			{
+				return function( name )
+				{
+					switch ( name )
+					{
+						case 'class':
+							name = 'className';
+							break;
+
+						case 'tabindex':
+							var tabIndex = standard.call( this, name );
+
+							// IE returns tabIndex=0 by default for all
+							// elements. For those elements,
+							// getAtrribute( 'tabindex', 2 ) returns 32768
+							// instead. So, we must make this check to give a
+							// uniform result among all browsers.
+							if ( tabIndex !== 0 && this.$.tabIndex === 0 )
+								tabIndex = null;
+
+							return tabIndex;
+							break;
+					}
+
+					return standard.call( this, name );
+				};
+			}
+			else
+				return standard;
+		})(),
+
+		getChildren : function()
+		{
+			return new CKEDITOR.dom.nodeList( this.$.childNodes );
+		},
+
+		/**
+		 * Gets the current computed value of one of the element CSS style
+		 * properties.
+		 * @function
+		 * @param {String} propertyName The style property name.
+		 * @returns {String} The property value.
+		 * @example
+		 * var element = new CKEDITOR.dom.element( 'span' );
+		 * alert( <b>element.getComputedStyle( 'display' )</b> );  // "inline"
+		 */
+		getComputedStyle :
+			CKEDITOR.env.ie ?
+				function( propertyName )
+				{
+					return this.$.currentStyle[ CKEDITOR.tools.cssStyleToDomStyle( propertyName ) ];
+				}
+			:
+				function( propertyName )
+				{
+					return this.getWindow().$.getComputedStyle( this.$, '' ).getPropertyValue( propertyName );
+				},
+
+		/**
+		 * Gets the DTD entries for this element.
+		 * @returns {Object} An object containing the list of elements accepted
+		 *		by this element.
+		 */
+		getDtd : function()
+		{
+			var dtd = CKEDITOR.dtd[ this.getName() ];
+
+			this.getDtd = function()
+			{
+				return dtd;
+			};
+
+			return dtd;
+		},
+
+		getElementsByTag : function( tagName )
+		{
+			return new CKEDITOR.dom.nodeList( this.$.getElementsByTagName( tagName ) );
+		},
+
+		/**
+		 * Gets the computed tabindex for this element.
+		 * @function
+		 * @returns {Number} The tabindex value.
+		 * @example
+		 * var element = CKEDITOR.document.getById( 'myDiv' );
+		 * alert( <b>element.getTabIndex()</b> );  // e.g. "-1"
+		 */
+		getTabIndex :
+			CKEDITOR.env.ie ?
+				function()
+				{
+					var tabIndex = this.$.tabIndex;
+
+					// IE returns tabIndex=0 by default for all elements. In
+					// those cases we must check that the element really has
+					// the tabindex attribute set to zero, or it is one of
+					// those element that should have zero by default.
+					if ( tabIndex === 0 && !CKEDITOR.dtd.$tabIndex[ this.getName() ] && parseInt( this.getAttribute( 'tabindex' ), 10 ) !== 0 )
+						tabIndex = -1;
+
+						return tabIndex;
+				}
+			: CKEDITOR.env.webkit ?
+				function()
+				{
+					var tabIndex = this.$.tabIndex;
+
+					// Safari returns "undefined" for elements that should not
+					// have tabindex (like a div). So, we must try to get it
+					// from the attribute.
+					// https://bugs.webkit.org/show_bug.cgi?id=20596
+					if ( tabIndex == undefined )
+					{
+						tabIndex = parseInt( this.getAttribute( 'tabindex' ), 10 );
+
+						// If the element don't have the tabindex attribute,
+						// then we should return -1.
+						if ( isNaN( tabIndex ) )
+							tabIndex = -1;
+					}
+
+					return tabIndex;
+				}
+			:
+				function()
+				{
+					return this.$.tabIndex;
+				},
+
+		/**
+		 * Gets the text value of this element.
+		 *
+		 * Only in IE (which uses innerText), &lt;br&gt; will cause linebreaks,
+		 * and sucessive whitespaces (including line breaks) will be reduced to
+		 * a single space. This behavior is ok for us, for now. It may change
+		 * in the future.
+		 * @returns {String} The text value.
+		 * @example
+		 * var element = CKEDITOR.dom.element.createFromHtml( '&lt;div&gt;Same &lt;i&gt;text&lt;/i&gt;.&lt;/div&gt;' );
+		 * alert( <b>element.getText()</b> );  // "Sample text."
+		 */
+		getText : function()
+		{
+			return this.$.textContent || this.$.innerText;
+		},
+
+		/**
+		 * Gets the window object that contains this element.
+		 * @returns {CKEDITOR.dom.window} The window object.
+		 * @example
+		 */
+		getWindow : function()
+		{
+			return this.getDocument().getWindow();
+		},
+
+		/**
+		 * Gets the value of the "id" attribute of this element.
+		 * @returns {String} The element id, or null if not available.
+		 * @example
+		 * var element = CKEDITOR.dom.element.createFromHtml( '&lt;p id="myId"&gt;&lt;/p&gt;' );
+		 * alert( <b>element.getId()</b> );  // "myId"
+		 */
+		getId : function()
+		{
+			return this.$.id || null;
+		},
+
+		/**
+		 * Gets the value of the "name" attribute of this element.
+		 * @returns {String} The element name, or null if not available.
+		 * @example
+		 * var element = CKEDITOR.dom.element.createFromHtml( '&lt;input name="myName"&gt;&lt;/input&gt;' );
+		 * alert( <b>element.getNameAtt()</b> );  // "myName"
+		 */
+		getNameAtt : function()
+		{
+			return this.$.name || null;
+		},
+
+		/**
+		 * Gets the element name (tag name). The returned name is guaranteed to
+		 * be always full lowercased.
+		 * @returns {String} The element name.
+		 * @example
+		 * var element = new CKEDITOR.dom.element( 'span' );
+		 * alert( <b>element.getName()</b> );  // "span"
+		 */
+		getName : function()
+		{
+			// Cache the lowercased name inside a closure.
+			var nodeName = this.$.nodeName.toLowerCase();
+
+			return (
+			/** @ignore */
+			this.getName = function()
+				{
+					return nodeName;
+				})();
+		},
+
+		/**
+		 * Gets the value set to this element. This value is usually available
+		 * for form field elements.
+		 * @returns {String} The element value.
+		 */
+		getValue : function()
+		{
+			return this.$.value;
+		},
+
+		/**
+		 * Gets the first child node of this element.
+		 * @returns {CKEDITOR.dom.node} The first child node or null if not
+		 *		available.
+		 * @example
+		 * var element = CKEDITOR.dom.element.createFromHtml( '&lt;div&gt;&lt;b&gt;Example&lt;/b&gt;&lt;/div&gt;' );
+		 * var first = <b>element.getFirst()</b>;
+		 * alert( first.getName() );  // "b"
+		 */
+		getFirst : function()
+		{
+			var $ = this.$.firstChild;
+			return $ ? new CKEDITOR.dom.node( $ ) : null;
+		},
+
+		getLast : function()
+		{
+			var $ = this.$.lastChild;
+			return $ ? new CKEDITOR.dom.node( $ ) : null;
+		},
+
+		/**
+		 * Gets the node that follows this element in its parent's child list.
+		 * @returns {CKEDITOR.dom.node} The next node or null if not
+		 *		available.
+		 * @example
+		 * var element = CKEDITOR.dom.element.createFromHtml( '&lt;div&gt;&lt;b&gt;Example&lt;/b&gt; &lt;i&gt;next&lt;/i&gt;&lt;/div&gt;' );
+		 * var first = <b>element.getFirst().getNext()</b>;
+		 * alert( first.getName() );  // "i"
+		 */
+		getNext : function()
+		{
+			var $ = this.$.nextSibling;
+			return $ ? new CKEDITOR.dom.node( $ ) : null;
+		},
+
+		/**
+		 * Checks if the element name matches one or more names.
+		 * @param {String} name[,name[,...]] One or more names to be checked.
+		 * @returns {Boolean} true if the element name matches any of the names.
+		 * @example
+		 * var element = new CKEDITOR.element( 'span' );
+		 * alert( <b>element.is( 'span' )</b> );  "true"
+		 * alert( <b>element.is( 'p', 'span' )</b> );  "true"
+		 * alert( <b>element.is( 'p' )</b> );  "false"
+		 * alert( <b>element.is( 'p', 'div' )</b> );  "false"
+		 */
+		is : function()
+		{
+			var name = this.getName();
+			for ( var i = 0 ; i < arguments.length ; i++ )
+			{
+				if ( arguments[ i ] == name )
+					return true;
+			}
+			return false;
+		},
+
+		/**
+		 * Indicates that the element has defined attributes.
+		 * @returns {Boolean} True if the element has attributes.
+		 * @example
+		 * var element = CKEDITOR.dom.element.createFromHtml( '<div title="Test">Example</div>' );
+		 * alert( <b>element.hasAttributes()</b> );  "true"
+		 * @example
+		 * var element = CKEDITOR.dom.element.createFromHtml( '<div>Example</div>' );
+		 * alert( <b>element.hasAttributes()</b> );  "false"
+		 */
+		hasAttributes :
+			CKEDITOR.env.ie ?
+				function()
+				{
+					var attributes = this.$.attributes;
+
+					for ( var i = 0 ; i < attributes.length ; i++ )
+					{
+						var attribute = attributes[i];
+
+						switch ( attribute.nodeName )
+						{
+							case 'class' :
+								// IE has a strange bug. If calling removeAttribute('className'),
+								// the attributes collection will still contain the "class"
+								// attribute, which will be marked as "specified", even if the
+								// outerHTML of the element is not displaying the class attribute.
+								// Note : I was not able to reproduce it outside the editor,
+								// but I've faced it while working on the TC of #1391.
+								if ( this.$.className.length > 0 )
+									return true;
+
+							// Attributes to be ignored.
+							case '_cke_expando' :
+								continue;
+
+							/*jsl:fallthru*/
+
+							default :
+								if ( attribute.specified )
+									return true;
+						}
+					}
+
+					return false;
+				}
+			:
+				function()
+				{
+					return this.$.attributes.length > 0;
+				},
+
+		/**
+		 * Hides this element (display:none).
+		 * @example
+		 * var element = CKEDITOR.dom.element.getById( 'myElement' );
+		 * <b>element.hide()</b>;
+		 */
+		hide : function()
+		{
+			this.setStyle( 'display', 'none' );
+		},
+
+		moveChildren : function( target, toStart )
+		{
+			var $ = this.$;
+			target = target.$;
+
+			if ( $ == target )
+				return;
+
+			var child;
+
+			if ( toStart )
+			{
+				while ( (child = $.lastChild) )
+					target.insertBefore( $.removeChild( child ), target.firstChild );
+			}
+			else
+			{
+				while ( (child = $.firstChild) )
+					target.appendChild( $.removeChild( child ) );
+			}
+		},
+
+		/**
+		 * Shows this element (display it).
+		 * @example
+		 * var element = CKEDITOR.dom.element.getById( 'myElement' );
+		 * <b>element.show()</b>;
+		 */
+		show : function()
+		{
+			this.setStyles(
+				{
+					display : '',
+					visibility : ''
+				});
+		},
+
+		/**
+		 * Sets the value of an element attribute.
+		 * @param {String} name The name of the attribute.
+		 * @param {String} value The value to be set to the attribute.
+		 * @function
+		 * @returns {CKEDITOR.dom.element} This element instance.
+		 * @example
+		 * var element = CKEDITOR.dom.element.getById( 'myElement' );
+		 * <b>element.setAttribute( 'class', 'myClass' )</b>;
+		 * <b>element.setAttribute( 'title', 'This is an example' )</b>;
+		 */
+		setAttribute : (function()
+		{
+			var standard = function( name, value )
+			{
+				this.$.setAttribute( name, value );
+				return this;
+			};
+
+			if ( CKEDITOR.env.ie )
+			{
+				return function( name, value )
+				{
+					if ( name == 'class' )
+						this.$.className = value;
+					if ( name == 'style' )
+						this.$.style.cssText = value;
+					else
+						standard.apply( this, arguments );
+					return this;
+				};
+			}
+			else
+				return standard;
+		})(),
+
+		/**
+		 * Sets the value of several element attributes.
+		 * @param {Object} attributesPairs An object containing the names and
+		 *		values of the attributes.
+		 * @returns {CKEDITOR.dom.element} This element instance.
+		 * @example
+		 * var element = CKEDITOR.dom.element.getById( 'myElement' );
+		 * <b>element.setAttributes({
+		 *     'class' : 'myClass',
+		 *     'title' : 'This is an example' })</b>;
+		 */
+		setAttributes : function( attributesPairs )
+		{
+			for ( var name in attributesPairs )
+				this.setAttribute( name, attributesPairs[ name ] );
+			return this;
+		},
+
+		/**
+		 * Sets the element value. This function is usually used with form
+		 * field element.
+		 * @param {String} value The element value.
+		 * @returns {CKEDITOR.dom.element} This element instance.
+		 */
+		setValue : function( value )
+		{
+			this.$.value = value;
+			return this;
+		},
+
+		/**
+		 * Removes an attribute from the element.
+		 * @param {String} name The attribute name.
+		 * @function
+		 * @example
+		 * var element = CKEDITOR.dom.element.createFromHtml( '<div class="classA"></div>' );
+		 * element.removeAttribute( 'class' );
+		 */
+		removeAttribute : (function()
+		{
+			var standard = function( name )
+			{
+				this.$.removeAttribute( name );
+			};
+
+			if ( CKEDITOR.env.ie )
+			{
+				return function( name )
+				{
+					if ( name == 'class' )
+						name = 'className';
+					standard.call( this, name );
+				};
+			}
+			else
+				return standard;
+		})(),
+
+		removeAttributes : function ( attributes )
+		{
+			for ( var i = 0 ; i < attributes.length ; i++ )
+				this.removeAttribute( attributes[ i ] );
+		},
+
+		/**
+		 * Removes a style from the element.
+		 * @param {String} name The style name.
+		 * @function
+		 * @example
+		 * var element = CKEDITOR.dom.element.createFromHtml( '<div style="display:none"></div>' );
+		 * element.removeStyle( 'display' );
+		 */
+		removeStyle : function( name )
+		{
+			this.setStyle( name, '' );
+
+			if ( !this.$.style.cssText )
+				this.removeAttribute( 'style' );
+		},
+
+		/**
+		 * Sets the value of an element style.
+		 * @param {String} name The name of the style. The CSS naming notation
+		 *		must be used (e.g. "background-color").
+		 * @param {String} value The value to be set to the style.
+		 * @returns {CKEDITOR.dom.element} This element instance.
+		 * @example
+		 * var element = CKEDITOR.dom.element.getById( 'myElement' );
+		 * <b>element.setStyle( 'background-color', '#ff0000' )</b>;
+		 * <b>element.setStyle( 'margin-top', '10px' )</b>;
+		 * <b>element.setStyle( 'float', 'right' )</b>;
+		 */
+		setStyle : function( name, value )
+		{
+			this.$.style[ CKEDITOR.tools.cssStyleToDomStyle( name ) ] = value;
+			return this;
+		},
+
+		/**
+		 * Sets the value of several element styles.
+		 * @param {Object} stylesPairs An object containing the names and
+		 *		values of the styles.
+		 * @returns {CKEDITOR.dom.element} This element instance.
+		 * @example
+		 * var element = CKEDITOR.dom.element.getById( 'myElement' );
+		 * <b>element.setStyles({
+		 *     'position' : 'absolute',
+		 *     'float' : 'right' })</b>;
+		 */
+		setStyles : function( stylesPairs )
+		{
+			for ( var name in stylesPairs )
+				this.setStyle( name, stylesPairs[ name ] );
+			return this;
+		},
+
+		/**
+		 * Sets the opacity of an element.
+		 * @param {Number} opacity A number within the range [0.0, 1.0].
+		 * @example
+		 * var element = CKEDITOR.dom.element.getById( 'myElement' );
+		 * <b>element.setOpacity( 0.75 )</b>;
+		 */
+		setOpacity : function( opacity )
+		{
+			if ( CKEDITOR.env.ie )
+			{
+				opacity = Math.round( opacity * 100 );
+				this.setStyle( 'filter', opacity >= 100 ? '' : 'progid:DXImageTransform.Microsoft.Alpha(opacity=' + opacity + ')' );
+			}
+			else
+				this.setStyle( 'opacity', opacity );
+		},
+
+		/**
+		 * Makes the element and its children unselectable.
+		 * @function
+		 * @example
+		 * var element = CKEDITOR.dom.element.getById( 'myElement' );
+		 * element.unselectable();
+		 */
+		unselectable :
+			CKEDITOR.env.gecko ?
+				function()
+				{
+					this.$.style.MozUserSelect = 'none';
+				}
+			: CKEDITOR.env.webkit ?
+				function()
+				{
+					this.$.style.KhtmlUserSelect = 'none';
+				}
+			:
+				function()
+				{
+					if ( CKEDITOR.env.ie || CKEDITOR.env.opera )
+					{
+						var element = this.$,
+							e,
+							i = 0;
+
+						element.unselectable = 'on';
+
+						while ( ( e = element.all[ i++ ] ) )
+						{
+							switch ( e.tagName.toLowerCase() )
+							{
+								case 'iframe' :
+								case 'textarea' :
+								case 'input' :
+								case 'select' :
+									/* Ignore the above tags */
+									break;
+								default :
+									e.unselectable = 'on';
+							}
+						}
+					}
+				}
+	});
Index: /CKEditor/tags/3.0 Beta/_source/core/dom/elementpath.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/dom/elementpath.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/dom/elementpath.js	(revision 3046)
@@ -0,0 +1,104 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+(function()
+{
+	// Elements that may be considered the "Block boundary" in an element path.
+	var pathBlockElements = { address:1,blockquote:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,li:1,dt:1,de:1 };
+
+	// Elements that may be considered the "Block limit" in an element path.
+	var pathBlockLimitElements = { body:1,div:1,td:1,th:1,caption:1,form:1 };
+
+	// Check if an element contains any block element.
+	var checkHasBlock = function( element )
+	{
+		var childNodes = element.getChildren();
+
+		for ( var i = 0, count = childNodes.count() ; i < count ; i++ )
+		{
+			var child = childNodes.getItem( i );
+
+			if ( child.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$block[ child.getName() ] )
+				return true;
+		}
+
+		return false;
+	};
+
+	CKEDITOR.dom.elementPath = function( lastNode )
+	{
+		var block = null;
+		var blockLimit = null;
+		var elements = [];
+
+		var e = lastNode;
+
+		while ( e )
+		{
+			if ( e.type == CKEDITOR.NODE_ELEMENT )
+			{
+				if ( !this.lastElement )
+					this.lastElement = e;
+
+				var elementName = e.getName();
+				if ( CKEDITOR.env.ie && e.$.scopeName != 'HTML' )
+					elementName = e.$.scopeName.toLowerCase() + ':' + elementName;
+
+				if ( !blockLimit )
+				{
+					if ( !block && pathBlockElements[ elementName ] )
+						block = e;
+
+					if ( pathBlockLimitElements[ elementName ] )
+					{
+						// DIV is considered the Block, if no block is available (#525)
+						// and if it doesn't contain other blocks.
+						if ( !block && elementName == 'div' && !checkHasBlock( e ) )
+							block = e;
+						else
+							blockLimit = e;
+					}
+				}
+
+				elements.push( e );
+
+				if ( elementName == 'body' )
+					break;
+			}
+			e = e.getParent();
+		}
+
+		this.block = block;
+		this.blockLimit = blockLimit;
+		this.elements = elements;
+	};
+})();
+
+CKEDITOR.dom.elementPath.prototype =
+{
+	/**
+	 * Compares this element path with another one.
+	 * @param {CKEDITOR.dom.elementPath} otherPath The elementPath object to be
+	 * compared with this one.
+	 * @returns {Boolean} "true" if the paths are equal, containing the same
+	 * number of elements and the same elements in the same order.
+	 */
+	compare : function( otherPath )
+	{
+		var thisElements = this.elements;
+		var otherElements = otherPath && otherPath.elements;
+
+		if ( !otherElements || thisElements.length != otherElements.length )
+			return false;
+
+		for ( var i = 0 ; i < thisElements.length ; i++ )
+		{
+			if ( !thisElements[ i ].equals( otherElements[ i ] ) )
+				return false;
+		}
+
+		return true;
+	}
+};
Index: /CKEditor/tags/3.0 Beta/_source/core/dom/event.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/dom/event.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/dom/event.js	(revision 3046)
@@ -0,0 +1,137 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Defines the {@link CKEDITOR.dom.event} class, which
+ *		represents the a native DOM event object.
+ */
+
+/**
+ * Represents a native DOM event object.
+ * @constructor
+ * @param {Object} domEvent A native DOM event object.
+ * @example
+ */
+CKEDITOR.dom.event = function( domEvent )
+{
+	/**
+	 * The native DOM event object represented by this class instance.
+	 * @type Object
+	 * @example
+	 */
+	this.$ = domEvent;
+};
+
+CKEDITOR.dom.event.prototype =
+{
+	/**
+	 * Gets the key code associated to the event.
+	 * @returns {Number} The key code.
+	 * @example
+	 * alert( event.getKey() );  "65" is "a" has been pressed
+	 */
+	getKey : function()
+	{
+		return this.$.keyCode || this.$.which;
+	},
+
+	/**
+	 * Gets a number represeting the combination of the keys pressed during the
+	 * event. It is the sum with the current key code and the {@link CKEDITOR.CTRL},
+	 * {@link CKEDITOR.SHIFT} and {@link CKEDITOR.ALT} constants.
+	 * @returns {Number} The number representing the keys combination.
+	 * @example
+	 * alert( event.getKeystroke() == 65 );                                   // "a" key
+	 * alert( event.getKeystroke() == CKEDITOR.CTRL + 65 );                   // CTRL + "a" key
+	 * alert( event.getKeystroke() == CKEDITOR.CTRL + CKEDITOR.SHIFT + 65 );  // CTRL + SHIFT + "a" key
+	 */
+	getKeystroke : function()
+	{
+		var keystroke = this.getKey();
+
+		if ( this.$.ctrlKey || this.$.metaKey )
+			keystroke += CKEDITOR.CTRL;
+
+		if ( this.$.shiftKey )
+			keystroke += CKEDITOR.SHIFT;
+
+		if ( this.$.altKey )
+			keystroke += CKEDITOR.ALT;
+
+		return keystroke;
+	},
+
+	/**
+	 * Prevents the original behavior of the event to happen. It can optionally
+	 * stop propagating the event in the event chain.
+	 * @param {Boolean} [stopPropagation] Stop propagating this event in the
+	 *		event chain.
+	 * @example
+	 * var element = CKEDITOR.document.getById( 'myElement' );
+	 * element.on( 'click', function( ev )
+	 *     {
+	 *         // The DOM event object is passed by the "data" property.
+	 *         var domEvent = ev.data;
+	 *         // Prevent the click to chave any effect in the element.
+	 *         domEvent.preventDefault();
+	 *     });
+	 */
+	preventDefault : function( stopPropagation )
+	{
+		var $ = this.$;
+		if ( $.preventDefault )
+			$.preventDefault();
+		else
+			$.returnValue = false;
+
+		if ( stopPropagation )
+		{
+			if ( $.stopPropagation )
+				$.stopPropagation();
+			else
+				$.cancelBubble = true;
+		}
+	},
+	/**
+	 * Returns the DOM node where the event was targeted to.
+	 * @returns {CKEDITOR.dom.node} The target DOM node.
+	 * @example
+	 * var element = CKEDITOR.document.getById( 'myElement' );
+	 * element.on( 'click', function( ev )
+	 *     {
+	 *         // The DOM event object is passed by the "data" property.
+	 *         var domEvent = ev.data;
+	 *         // Add a CSS class to the event target.
+	 *         domEvent.getTarget().addClass( 'clicked' );
+	 *     });
+	 */
+
+	getTarget : function()
+	{
+		var rawNode = this.$.target || this.$.srcElement;
+		return rawNode ? new CKEDITOR.dom.node( rawNode ) : null;
+	}
+};
+
+/**
+ * CTRL key (1000).
+ * @constant
+ * @example
+ */
+CKEDITOR.CTRL = 1000;
+
+/**
+ * SHIFT key (2000).
+ * @constant
+ * @example
+ */
+CKEDITOR.SHIFT = 2000;
+
+/**
+ * ALT key (4000).
+ * @constant
+ * @example
+ */
+CKEDITOR.ALT = 4000;
Index: /CKEditor/tags/3.0 Beta/_source/core/dom/node.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/dom/node.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/dom/node.js	(revision 3046)
@@ -0,0 +1,421 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Defines the {@link CKEDITOR.dom.node} class, which is the base
+ *		class for classes that represent DOM nodes.
+ */
+
+/**
+ * Base class for classes representing DOM nodes. This constructor may return
+ * and instance of classes that inherits this class, like
+ * {@link CKEDITOR.dom.element} or {@link CKEDITOR.dom.text}.
+ * @augments CKEDITOR.dom.domObject
+ * @param {Object} domNode A native DOM node.
+ * @constructor
+ * @see CKEDITOR.dom.element
+ * @see CKEDITOR.dom.text
+ * @example
+ */
+CKEDITOR.dom.node = function( domNode )
+{
+	if ( domNode )
+	{
+		switch ( domNode.nodeType )
+		{
+			case CKEDITOR.NODE_ELEMENT :
+				return new CKEDITOR.dom.element( domNode );
+
+			case CKEDITOR.NODE_TEXT :
+				return new CKEDITOR.dom.text( domNode );
+		}
+
+		// Call the base constructor.
+		CKEDITOR.dom.domObject.call( this, domNode );
+	}
+
+	return this;
+};
+
+CKEDITOR.dom.node.prototype = new CKEDITOR.dom.domObject();
+
+/**
+ * Element node type.
+ * @constant
+ * @example
+ */
+CKEDITOR.NODE_ELEMENT = 1;
+
+/**
+ * Text node type.
+ * @constant
+ * @example
+ */
+CKEDITOR.NODE_TEXT = 3;
+
+/**
+ * Comment node type.
+ * @constant
+ * @example
+ */
+CKEDITOR.NODE_COMMENT = 8;
+
+CKEDITOR.NODE_DOCUMENT_FRAGMENT = 11;
+
+CKEDITOR.POSITION_IDENTICAL = 0;
+CKEDITOR.POSITION_DISCONNECTED = 1;
+CKEDITOR.POSITION_FOLLOWING = 2;
+CKEDITOR.POSITION_PRECEDING = 4;
+CKEDITOR.POSITION_IS_CONTAINED = 8;
+CKEDITOR.POSITION_CONTAINS = 16;
+
+CKEDITOR.tools.extend( CKEDITOR.dom.node.prototype,
+	/** @lends CKEDITOR.dom.node.prototype */
+	{
+		/**
+		 * Makes this node child of another element.
+		 * @param {CKEDITOR.dom.element} element The target element to which append
+		 *		this node.
+		 * @returns {CKEDITOR.dom.element} The target element.
+		 * @example
+		 * var p = new CKEDITOR.dom.element( 'p' );
+		 * var strong = new CKEDITOR.dom.element( 'strong' );
+		 * strong.appendTo( p );
+		 *
+		 * // result: "&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;"
+		 */
+		appendTo : function( element, toStart )
+		{
+			element.append( this, toStart );
+			return element;
+		},
+
+		clone : function( includeChildren )
+		{
+			return new CKEDITOR.dom.node( this.$.cloneNode( includeChildren ) );
+		},
+
+		hasPrevious : function()
+		{
+			return !!this.$.previousSibling;
+		},
+
+		hasNext : function()
+		{
+			return !!this.$.nextSibling;
+		},
+
+		/**
+		 * Inserts this element after a node.
+		 * @param {CKEDITOR.dom.node} node The that will preceed this element.
+		 * @returns {CKEDITOR.dom.node} The node preceeding this one after
+		 *		insertion.
+		 * @example
+		 * var em = new CKEDITOR.dom.element( 'em' );
+		 * var strong = new CKEDITOR.dom.element( 'strong' );
+		 * strong.insertAfter( em );
+		 *
+		 * // result: "&lt;em&gt;&lt;/em&gt;&lt;strong&gt;&lt;/strong&gt;"
+		 */
+		insertAfter : function( node )
+		{
+			node.$.parentNode.insertBefore( this.$, node.$.nextSibling );
+			return node;
+		},
+
+		/**
+		 * Inserts this element before a node.
+		 * @param {CKEDITOR.dom.node} node The that will be after this element.
+		 * @returns {CKEDITOR.dom.node} The node being inserted.
+		 * @example
+		 * var em = new CKEDITOR.dom.element( 'em' );
+		 * var strong = new CKEDITOR.dom.element( 'strong' );
+		 * strong.insertBefore( em );
+		 *
+		 * // result: "&lt;strong&gt;&lt;/strong&gt;&lt;em&gt;&lt;/em&gt;"
+		 */
+		insertBefore : function( node )
+		{
+			node.$.parentNode.insertBefore( this.$, node.$ );
+			return node;
+		},
+
+		insertBeforeMe : function( node )
+		{
+			this.$.parentNode.insertBefore( node.$, this.$ );
+			return node;
+		},
+
+		/**
+		 * Gets a DOM tree descendant under the current node.
+		 * @param {Array|Number} indices The child index or array of child indices under the node.
+		 * @returns {CKEDITOR.dom.node} The specified DOM child under the current node. Null if child does not exist.
+		 * @example
+		 * var strong = p.getChild(0);
+		 */
+		getChild : function( indices )
+		{
+			var rawNode = this.$;
+
+			if ( !indices.slice )
+				rawNode = rawNode.childNodes[ indices ];
+			else
+			{
+				while ( indices.length > 0 && rawNode )
+					rawNode = rawNode.childNodes[ indices.shift() ];
+			}
+
+			return rawNode ? new CKEDITOR.dom.node( rawNode ) : null;
+		},
+
+		getChildCount : function()
+		{
+			return this.$.childNodes.length;
+		},
+
+		/**
+		 * Gets the document containing this element.
+		 * @returns {CKEDITOR.dom.document} The document.
+		 * @example
+		 * var element = CKEDITOR.document.getById( 'example' );
+		 * alert( <b>element.getDocument().equals( CKEDITOR.document )</b> );  // "true"
+		 */
+		getDocument : function()
+		{
+			var document = new CKEDITOR.dom.document( this.$.ownerDocument || this.$.parentNode.ownerDocument );
+
+			return (
+			/** @ignore */
+			this.getDocument = function()
+				{
+					return document;
+				})();
+		},
+
+		getIndex : function()
+		{
+			var $ = this.$;
+
+			var currentNode = $.parentNode && $.parentNode.firstChild;
+			var currentIndex = -1;
+
+			while ( currentNode )
+			{
+				currentIndex++;
+
+				if ( currentNode == $ )
+					return currentIndex;
+
+				currentNode = currentNode.nextSibling;
+			}
+
+			return -1;
+		},
+
+		/**
+		 * Gets the node following this node (next sibling).
+		 * @returns {CKEDITOR.dom.node} The next node.
+		 */
+		getNext : function()
+		{
+			var next = this.$.nextSibling;
+			return next ? new CKEDITOR.dom.node( next ) : null;
+		},
+
+		getNextSourceNode : function( startFromSibling, nodeType )
+		{
+			var $ = this.$;
+
+			var node = ( !startFromSibling && $.firstChild ) ?
+				$.firstChild :
+				$.nextSibling;
+
+			var parent;
+
+			while ( !node && ( parent = ( parent || $ ).parentNode ) )
+				node = parent.nextSibling;
+
+			if ( !node )
+				return null;
+
+			if ( nodeType && nodeType != node.nodeType )
+				return arguments.callee.call( { $ : node }, false, nodeType );
+
+			return new CKEDITOR.dom.node( node );
+		},
+
+		getPreviousSourceNode : function( startFromSibling, nodeType )
+		{
+			var $ = startFromSibling ? this.$.previousSibling : this.$,
+				node = null;
+
+			if ( !$ )
+				return null;
+
+			if ( ( node = $.previousSibling ) )
+			{
+				while ( node.lastChild )
+					node = node.lastChild;
+			}
+			else
+				node = $.parentNode;
+
+			if ( !node )
+				return null;
+
+			if ( nodeType && node.nodeType != nodeType )
+				return arguments.callee.apply( { $ : node }, false, nodeType );
+
+			return new CKEDITOR.dom.node( node );
+		},
+
+		getPrevious : function()
+		{
+			var previous = this.$.previousSibling;
+			return previous ? new CKEDITOR.dom.node( previous ) : null;
+		},
+
+		/**
+		 * Gets the parent element for this node.
+		 * @returns {CKEDITOR.dom.element} The parent element.
+		 * @example
+		 * var node = editor.document.getBody().getFirst();
+		 * var parent = node.<b>getParent()</b>;
+		 * alert( node.getName() );  // "body"
+		 */
+		getParent : function()
+		{
+			var parent = this.$.parentNode;
+			return ( parent && parent.nodeType == 1 ) ? new CKEDITOR.dom.node( parent ) : null;
+		},
+
+		getParents : function()
+		{
+			var node = this;
+			var parents = [];
+
+			do
+			{
+				parents.unshift( node );
+			}
+			while ( ( node = node.getParent() ) )
+
+			return parents;
+		},
+
+		getPosition : function( otherNode )
+		{
+			var $ = this.$;
+			var $other = otherNode.$;
+
+			if ( $.compareDocumentPosition )
+				return $.compareDocumentPosition( $other );
+
+			// IE and Safari have no support for compareDocumentPosition.
+
+			if ( $ == $other )
+				return CKEDITOR.POSITION_IDENTICAL;
+
+			// Handle non element nodes (don't support contains nor sourceIndex).
+			if ( this.type != CKEDITOR.NODE_ELEMENT || otherNode.type != CKEDITOR.NODE_ELEMENT )
+			{
+				if ( $.parentNode == $other )
+					return CKEDITOR.POSITION_IS_CONTAINED + CKEDITOR.POSITION_FOLLOWING;
+				else if ( $other.parentNode == $ )
+					return CKEDITOR.POSITION_CONTAINS + CKEDITOR.POSITION_PRECEDING;
+				else if ( $.parentNode == $other.parentNode )
+					return this.getIndex() < otherNode.getIndex() ? CKEDITOR.POSITION_PRECEDING : CKEDITOR.POSITION_FOLLOWING;
+				else
+				{
+					$ = $.parentNode;
+					$other = $other.parentNode;
+				}
+			}
+
+			if ( $.contains( $other ) )
+				return CKEDITOR.POSITION_CONTAINS + CKEDITOR.POSITION_PRECEDING;
+
+			if ( $other.contains( $ ) )
+				return CKEDITOR.POSITION_IS_CONTAINED + CKEDITOR.POSITION_FOLLOWING;
+
+			if ( 'sourceIndex' in $ )
+			{
+				return ( $.sourceIndex < 0 || $other.sourceIndex < 0 ) ? CKEDITOR.POSITION_DISCONNECTED :
+					( $.sourceIndex < $other.sourceIndex ) ? CKEDITOR.POSITION_PRECEDING :
+					CKEDITOR.POSITION_FOLLOWING;
+			}
+
+			// WebKit has no support for sourceIndex.
+
+			var doc = this.getDocument().$;
+
+			var range1 = doc.createRange();
+			var range2 = doc.createRange();
+
+			range1.selectNode( $ );
+			range2.selectNode( $other );
+
+			return range1.compareBoundaryPoints( 1, range2 ) > 0 ?
+				CKEDITOR.POSITION_FOLLOWING :
+				CKEDITOR.POSITION_PRECEDING;
+		},
+
+		/**
+		 * Gets the closes ancestor node of a specified node name.
+		 * @param {String} name Node name of ancestor node.
+		 * @param {Boolean} includeSelf (Optional) Whether to include the current
+		 * node in the calculation or not.
+		 * @returns {CKEDITOR.dom.node} Ancestor node.
+		 */
+		getAscendant : function( name, includeSelf )
+		{
+			var node = this.$;
+			if ( includeSelf && node.nodeName.toLowerCase() == name )
+				return this;
+			while ( ( node = node.parentNode ) )
+			{
+				if ( node.nodeName && node.nodeName.toLowerCase() == name )
+					return new CKEDITOR.dom.node( node );
+			}
+			return null;
+		},
+
+		move : function( target, toStart )
+		{
+			target.append( this.remove(), toStart );
+		},
+
+		/**
+		 * Removes this node from the document DOM.
+		 * @param {Boolean} [preserveChildren] Indicates that the children
+		 *		elements must remain in the document, removing only the outer
+		 *		tags.
+		 * @example
+		 * var element = CKEDITOR.dom.element.getById( 'MyElement' );
+		 * <b>element.remove()</b>;
+		 */
+		remove : function( preserveChildren )
+		{
+			var $ = this.$;
+			var parent = $.parentNode;
+
+			if ( parent )
+			{
+				if ( preserveChildren )
+				{
+					// Move all children before the node.
+					for ( var child ; ( child = $.firstChild ) ; )
+					{
+						parent.insertBefore( $.removeChild( child ), $ );
+					}
+				}
+
+				parent.removeChild( $ );
+			}
+
+			return this;
+		}
+	}
+);
Index: /CKEditor/tags/3.0 Beta/_source/core/dom/nodelist.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/dom/nodelist.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/dom/nodelist.js	(revision 3046)
@@ -0,0 +1,22 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+CKEDITOR.dom.nodeList = function( nativeList )
+{
+	this.$ = nativeList;
+};
+
+CKEDITOR.dom.nodeList.prototype =
+{
+	count : function()
+	{
+		return this.$.length;
+	},
+
+	getItem : function( index )
+	{
+		return new CKEDITOR.dom.node( this.$[ index ] );
+	}
+};
Index: /CKEditor/tags/3.0 Beta/_source/core/dom/range.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/dom/range.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/dom/range.js	(revision 3046)
@@ -0,0 +1,1306 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+CKEDITOR.dom.range = function( document )
+{
+	this.startContainer	= null;
+	this.startOffset	= null;
+	this.endContainer	= null;
+	this.endOffset		= null;
+	this.collapsed		= true;
+
+	this.document = document;
+};
+
+(function()
+{
+	// Updates the "collapsed" property for the given range object.
+	var updateCollapsed = function( range )
+	{
+		range.collapsed = (
+			range.startContainer &&
+			range.endContainer &&
+			range.startContainer.equals( range.endContainer ) &&
+			range.startOffset == range.endOffset );
+	};
+
+	// This is a shared function used to delete, extract and clone the range
+	// contents.
+	// V2
+	var execContentsAction = function( range, action, docFrag )
+	{
+		var startNode	= range.startContainer;
+		var endNode		= range.endContainer;
+
+		var startOffset	= range.startOffset;
+		var endOffset	= range.endOffset;
+
+		var removeStartNode;
+		var removeEndNode;
+
+		// For text containers, we must simply split the node and point to the
+		// second part. The removal will be handled by the rest of the code .
+		if ( endNode.type == CKEDITOR.NODE_TEXT )
+			endNode = endNode.split( endOffset );
+		else
+		{
+			// If the end container has children and the offset is pointing
+			// to a child, then we should start from it.
+			if ( endNode.getChildCount() > 0 )
+			{
+				// If the offset points after the last node.
+				if ( endOffset >= endNode.getChildCount() )
+				{
+					// Let's create a temporary node and mark it for removal.
+					endNode = endNode.append( range.document.createText( '' ) );
+					removeEndNode = true;
+				}
+				else
+					endNode = endNode.getChild( endOffset );
+			}
+		}
+
+		// For text containers, we must simply split the node. The removal will
+		// be handled by the rest of the code .
+		if ( startNode.type == CKEDITOR.NODE_TEXT )
+		{
+			startNode.split( startOffset );
+
+			// In cases the end node is the same as the start node, the above
+			// splitting will also split the end, so me must move the end to
+			// the second part of the split.
+			if ( startNode.equals( endNode ) )
+				endNode = startNode.getNext();
+		}
+		else
+		{
+			// If the start container has children and the offset is pointing
+			// to a child, then we should start from its previous sibling.
+
+			// If the offset points to the first node, we don't have a
+			// sibling, so let's use the first one, but mark it for removal.
+			if ( !startOffset )
+			{
+				// Let's create a temporary node and mark it for removal.
+				startNode = startNode.getFirst().insertBeforeMe( range.document.createText( '' ) );
+				removeStartNode = true;
+			}
+			else if ( startOffset >= startNode.getChildCount() )
+			{
+				// Let's create a temporary node and mark it for removal.
+				startNode = startNode.append( range.document.createText( '' ) );
+				removeStartNode = true;
+			}
+			else
+				startNode = startNode.getChild( startOffset ).getPrevious();
+		}
+
+		// Get the parent nodes tree for the start and end boundaries.
+		var startParents	= startNode.getParents();
+		var endParents		= endNode.getParents();
+
+		// Compare them, to find the top most siblings.
+		var i, topStart, topEnd;
+
+		for ( i = 0 ; i < startParents.length ; i++ )
+		{
+			topStart = startParents[ i ];
+			topEnd = endParents[ i ];
+
+			// The compared nodes will match until we find the top most
+			// siblings (different nodes that have the same parent).
+			// "i" will hold the index in the parents array for the top
+			// most element.
+			if ( !topStart.equals( topEnd ) )
+				break;
+		}
+
+		var clone = docFrag, levelStartNode, levelClone, currentNode, currentSibling;
+
+		// Remove all successive sibling nodes for every node in the
+		// startParents tree.
+		for ( var j = i ; j < startParents.length ; j++ )
+		{
+			levelStartNode = startParents[j];
+
+			// For Extract and Clone, we must clone this level.
+			if ( clone && !levelStartNode.equals( startNode ) )		// action = 0 = Delete
+				levelClone = clone.append( levelStartNode.clone() );
+
+			currentNode = levelStartNode.getNext();
+
+			while( currentNode )
+			{
+				// Stop processing when the current node matches a node in the
+				// endParents tree or if it is the endNode.
+				if ( currentNode.equals( endParents[ j ] ) || currentNode.equals( endNode ) )
+					break;
+
+				// Cache the next sibling.
+				currentSibling = currentNode.getNext();
+
+				// If cloning, just clone it.
+				if ( action == 2 )	// 2 = Clone
+					clone.append( currentNode.clone( true ) );
+				else
+				{
+					// Both Delete and Extract will remove the node.
+					currentNode.remove();
+
+					// When Extracting, move the removed node to the docFrag.
+					if ( action == 1 )	// 1 = Extract
+						clone.append( currentNode );
+				}
+
+				currentNode = currentSibling;
+			}
+
+			if ( clone )
+				clone = levelClone;
+		}
+
+		clone = docFrag;
+
+		// Remove all previous sibling nodes for every node in the
+		// endParents tree.
+		for ( var k = i ; k < endParents.length ; k++ )
+		{
+			levelStartNode = endParents[ k ];
+
+			// For Extract and Clone, we must clone this level.
+			if ( action > 0 && !levelStartNode.equals( endNode ) )		// action = 0 = Delete
+				levelClone = clone.append( levelStartNode.clone() );
+
+			// The processing of siblings may have already been done by the parent.
+			if ( !startParents[ k ] || levelStartNode.$.parentNode != startParents[ k ].$.parentNode )
+			{
+				currentNode = levelStartNode.getPrevious();
+
+				while( currentNode )
+				{
+					// Stop processing when the current node matches a node in the
+					// startParents tree or if it is the startNode.
+					if ( currentNode.equals( startParents[ k ] ) || currentNode.equals( startNode ) )
+						break;
+
+					// Cache the next sibling.
+					currentSibling = currentNode.getPrevious();
+
+					// If cloning, just clone it.
+					if ( action == 2 )	// 2 = Clone
+						clone.$.insertBefore( currentNode.$.cloneNode( true ), clone.$.firstChild ) ;
+					else
+					{
+						// Both Delete and Extract will remove the node.
+						currentNode.remove();
+
+						// When Extracting, mode the removed node to the docFrag.
+						if ( action == 1 )	// 1 = Extract
+							clone.$.insertBefore( currentNode.$, clone.$.firstChild );
+					}
+
+					currentNode = currentSibling;
+				}
+			}
+
+			if ( clone )
+				clone = levelClone;
+		}
+
+		if ( action == 2 )		// 2 = Clone.
+		{
+			// No changes in the DOM should be done, so fix the split text (if any).
+
+			var startTextNode = range.startContainer;
+			if ( startTextNode.type == CKEDITOR.NODE_TEXT )
+			{
+				startTextNode.$.data += startTextNode.$.nextSibling.data;
+				startTextNode.$.parentNode.removeChild( startTextNode.$.nextSibling );
+			}
+
+			var endTextNode = range.endContainer;
+			if ( endTextNode.type == CKEDITOR.NODE_TEXT && endTextNode.$.nextSibling )
+			{
+				endTextNode.$.data += endTextNode.$.nextSibling.data;
+				endTextNode.$.parentNode.removeChild( endTextNode.$.nextSibling );
+			}
+		}
+		else
+		{
+			// Collapse the range.
+
+			// If a node has been partially selected, collapse the range between
+			// topStart and topEnd. Otherwise, simply collapse it to the start. (W3C specs).
+			if ( topStart && topEnd && ( startNode.$.parentNode != topStart.$.parentNode || endNode.$.parentNode != topEnd.$.parentNode ) )
+			{
+				var endIndex = topEnd.getIndex();
+
+				// If the start node is to be removed, we must correct the
+				// index to reflect the removal.
+				if ( removeStartNode && topEnd.$.parentNode == startNode.$.parentNode )
+					endIndex--;
+
+				range.setStart( topEnd.getParent(), endIndex );
+			}
+
+			// Collapse it to the start.
+			range.collapse( true );
+		}
+
+		// Cleanup any marked node.
+		if( removeStartNode )
+			startNode.remove();
+
+		if( removeEndNode && endNode.$.parentNode )
+			endNode.remove();
+	};
+
+	var inlineChildReqElements = { abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1 };
+
+	var getBoundaryNodes = function()
+	{
+		var startNode = this.startContainer,
+			endNode = this.endContainer,
+			startOffset = this.startOffset,
+			endOffset = this.endOffset,
+			childCount;
+
+		if ( startNode.type == CKEDITOR.NODE_ELEMENT )
+		{
+			childCount = startNode.getChildCount();
+			if ( childCount > startOffset )
+				startNode = startNode.getChild( startOffset );
+			else if ( childCount < 1 )
+				startNode = startNode.getPreviousSourceNode();
+			else		// startOffset > childCount but childCount is not 0
+			{
+				// Try to take the node just after the current position.
+				startNode = startNode.$;
+				while ( startNode.lastChild )
+					startNode = startNode.lastChild;
+				startNode = new CKEDITOR.dom.node( startNode );
+
+				// Normally we should take the next node in DFS order. But it
+				// is also possible that we've already reached the end of
+				// document.
+				startNode = startNode.getNextSourceNode() || startNode;
+			}
+		}
+		if ( endNode.type == CKEDITOR.NODE_ELEMENT )
+		{
+			childCount = endNode.getChildCount();
+			if ( childCount > endOffset )
+				endNode = endNode.getChild( endOffset ).getPreviousSourceNode();
+			else if ( childCount < 1 )
+				endNode = endNode.getPreviousSourceNode();
+			else		// endOffset > childCount but childCount is not 0
+			{
+				// Try to take the node just before the current position.
+				endNode = endNode.$;
+				while ( endNode.lastChild )
+					endNode = endNode.lastChild;
+				endNode = new CKEDITOR.dom.node( endNode );
+			}
+		}
+
+		return { startNode : startNode, endNode : endNode };
+	};
+
+	// Check every node between the block boundary and the startNode or endNode.
+	var getCheckStartEndBlockFunction = function( isStart )
+	{
+		return function( evt )
+		{
+			// Don't check the block boundary itself.
+			if ( this.stopped() || !evt.data.node )
+				return;
+
+			var node = evt.data.node,
+				hadBr = false;
+			if ( node.type == CKEDITOR.NODE_ELEMENT )
+			{
+				// If there are non-empty inline elements (e.g. <img />), then we're not
+				// at the start.
+				if ( !inlineChildReqElements[ node.getName() ] )
+				{
+					// If we're working at the end-of-block, forgive the first <br />.
+					if ( !isStart && node.getName() == 'br' && !hadBr )
+						hadBr = true;
+					else
+					{
+						this.checkFailed = true;
+						this.stop();
+					}
+				}
+			}
+			else if ( node.type == CKEDITOR.NODE_TEXT )
+			{
+				// If there's any visible text, then we're not at the start.
+				var visibleText = CKEDITOR.tools.trim( node.getText() );
+				if ( visibleText.length > 0 )
+				{
+					this.checkFailed = true;
+					this.stop();
+				}
+			}
+		};
+	};
+
+
+	CKEDITOR.dom.range.prototype =
+	{
+		clone : function()
+		{
+			var clone = new CKEDITOR.dom.range( this.document );
+
+			clone.startContainer = this.startContainer;
+			clone.startOffset = this.startOffset;
+			clone.endContainer = this.endContainer;
+			clone.endOffset = this.endOffset;
+			clone.collapsed = this.collapsed;
+
+			return clone;
+		},
+
+		collapse : function( toStart )
+		{
+			if ( toStart )
+			{
+				this.endContainer	= this.startContainer;
+				this.endOffset		= this.startOffset;
+			}
+			else
+			{
+				this.startContainer	= this.endContainer;
+				this.startOffset	= this.endOffset;
+			}
+
+			this.collapsed = true;
+		},
+
+		// The selection may be lost when cloning (due to the splitText() call).
+		cloneContents : function()
+		{
+			var docFrag = new CKEDITOR.dom.documentFragment( this.document );
+
+			if ( !this.collapsed )
+				execContentsAction( this, 2, docFrag );
+
+			return docFrag;
+		},
+
+		deleteContents : function()
+		{
+			if ( this.collapsed )
+				return;
+
+			execContentsAction( this, 0 );
+		},
+
+		extractContents : function()
+		{
+			var docFrag = new CKEDITOR.dom.documentFragment( this.document );
+
+			if ( !this.collapsed )
+				execContentsAction( this, 1, docFrag );
+
+			return docFrag;
+		},
+
+		// This is an "intrusive" way to create a bookmark. It includes <span> tags
+		// in the range boundaries. The advantage of it is that it is possible to
+		// handle DOM mutations when moving back to the bookmark.
+		// Attention: the inclusion of nodes in the DOM is a design choice and
+		// should not be changed as there are other points in the code that may be
+		// using those nodes to perform operations. See GetBookmarkNode.
+		createBookmark : function()
+		{
+			var startNode, endNode;
+			var clone;
+
+			startNode = this.document.createElement( 'span' );
+			startNode.setAttribute( '_fck_bookmark', 1 );
+			startNode.setStyle( 'display', 'none' );
+
+			// For IE, it must have something inside, otherwise it may be
+			// removed during DOM operations.
+			startNode.setHtml( '&nbsp;' );
+
+			// If collapsed, the endNode will not be created.
+			if ( !this.collapsed )
+			{
+				endNode = startNode.clone();
+				endNode.setHtml( '&nbsp;' );
+
+				clone = this.clone();
+				clone.collapse();
+				clone.insertNode( endNode );
+			}
+
+			clone = this.clone();
+			clone.collapse( true );
+			clone.insertNode( startNode );
+
+			// Update the range position.
+			if ( endNode )
+			{
+				this.setStartAfter( startNode );
+				this.setEndBefore( endNode );
+			}
+			else
+				this.moveToPosition( startNode, CKEDITOR.POSITION_AFTER_END );
+
+			return {
+				startNode : startNode,
+				endNode : endNode
+			};
+		},
+
+		moveToBookmark : function( bookmark )
+		{
+			// Set the range start at the bookmark start node position.
+			this.setStartBefore( bookmark.startNode );
+
+			// Remove it, because it may interfere in the setEndBefore call.
+			bookmark.startNode.remove();
+
+			// Set the range end at the bookmark end node position, or simply
+			// collapse it if it is not available.
+			var endNode = bookmark.endNode;
+			if ( endNode )
+			{
+				this.setEndBefore( endNode );
+				endNode.remove();
+			}
+			else
+				this.collapse( true );
+		},
+
+		getCommonAncestor : function( includeSelf )
+		{
+			var start = this.startContainer;
+			var end = this.endContainer;
+
+			if ( start.equals( end ) )
+			{
+				if ( includeSelf && start.type == CKEDITOR.NODE_ELEMENT && this.startOffset == this.endOffset - 1 )
+					return start.getChild( this.startOffset );
+				return start;
+			}
+
+			if ( end.type == CKEDITOR.NODE_ELEMENT && end.contains( start ) )
+				return end;
+
+			if ( start.type != CKEDITOR.NODE_ELEMENT )
+				start = start.getParent();
+
+			do
+			{
+				if ( start.contains( end ) )
+					return start;
+			}
+			while( ( start = start.getParent() ) )
+
+			return null;
+		},
+
+		/**
+		 * Transforms the startContainer and endContainer properties from text
+		 * nodes to element nodes, whenever possible. This is actually possible
+		 * if either of the boundary containers point to a text node, and its
+		 * offset is set to zero, or after the last char in the node.
+		 */
+		optimize : function()
+		{
+			var container = this.startContainer;
+			var offset = this.startOffset;
+
+			if ( container.type != CKEDITOR.NODE_ELEMENT )
+			{
+				if ( !offset )
+					this.setStartBefore( container );
+				else if ( offset >= container.getLength() )
+					this.setStartAfter( container );
+			}
+
+			container = this.endContainer;
+			offset = this.endOffset;
+
+			if ( container.type != CKEDITOR.NODE_ELEMENT )
+			{
+				if ( !offset )
+					this.setEndBefore( container );
+				else if ( offset >= container.getLength() )
+					this.setEndAfter( container );
+			}
+		},
+
+		trim : function( ignoreStart, ignoreEnd )
+		{
+			var startContainer = this.startContainer;
+			var startOffset = this.startOffset;
+
+			var endContainer = this.endContainer;
+			var endOffset = this.endOffset;
+
+			if ( !ignoreStart && startContainer && startContainer.type == CKEDITOR.NODE_TEXT )
+			{
+				// If the offset is zero, we just insert the new node before
+				// the start.
+				if ( !startOffset )
+				{
+					startOffset = startContainer.getIndex();
+					startContainer = startContainer.getParent();
+				}
+				// If the offset is at the end, we'll insert it after the text
+				// node.
+				else if ( startOffset >= startContainer.getLength() )
+				{
+					startOffset = startContainer.getIndex() + 1;
+					startContainer = startContainer.getParent();
+				}
+				// In other case, we split the text node and insert the new
+				// node at the split point.
+				else
+				{
+					var nextText = startContainer.split( startOffset );
+
+					startOffset = startContainer.getIndex() + 1;
+					startContainer = startContainer.getParent();
+
+					// Check if it is necessary to update the end boundary.
+					if ( this.collapsed )
+						this.setEnd( startContainer, startOffset );
+					else if ( this.startContainer.equals( this.endContainer ) )
+						this.setEnd( nextText, this.endOffset - this.startOffset );
+				}
+
+				this.setStart( startContainer, startOffset );
+			}
+
+			if ( !ignoreEnd && endContainer && !this.collapsed && endContainer.type == CKEDITOR.NODE_TEXT )
+			{
+				// If the offset is zero, we just insert the new node before
+				// the start.
+				if ( !endOffset )
+				{
+					endOffset = endContainer.getIndex();
+					endContainer = endContainer.getParent();
+				}
+				// If the offset is at the end, we'll insert it after the text
+				// node.
+				else if ( endOffset >= endContainer.getLength() )
+				{
+					endOffset = endContainer.getIndex() + 1;
+					endContainer = endContainer.getParent();
+				}
+				// In other case, we split the text node and insert the new
+				// node at the split point.
+				else
+				{
+					endContainer.split( endOffset );
+
+					endOffset = endContainer.getIndex() + 1;
+					endContainer = endContainer.getParent();
+				}
+
+				this.setEnd( endContainer, endOffset );
+			}
+		},
+
+		enlarge : function( unit )
+		{
+			switch ( unit )
+			{
+				case CKEDITOR.ENLARGE_ELEMENT :
+
+					if ( this.collapsed )
+						return;
+
+					// Get the common ancestor.
+					var commonAncestor = this.getCommonAncestor();
+
+					var body = this.document.getBody();
+
+					// For each boundary
+					//		a. Depending on its position, find out the first node to be checked (a sibling) or, if not available, to be enlarge.
+					//		b. Go ahead checking siblings and enlarging the boundary as much as possible until the common ancestor is not reached. After reaching the common ancestor, just save the enlargeable node to be used later.
+
+					var startTop, endTop;
+
+					var enlargeable, sibling, commonReached;
+
+					// Indicates that the node can be added only if whitespace
+					// is available before it.
+					var needsWhiteSpace = false;
+					var isWhiteSpace;
+					var siblingText;
+
+					// Process the start boundary.
+
+					var container = this.startContainer;
+					var offset = this.startOffset;
+
+					if ( container.type == CKEDITOR.NODE_TEXT )
+					{
+						if ( offset )
+						{
+							// Check if there is any non-space text before the
+							// offset. Otherwise, container is null.
+							container = !CKEDITOR.tools.trim( container.substring( 0, offset ) ).length && container;
+
+							// If we found only whitespace in the node, it
+							// means that we'll need more whitespace to be able
+							// to expand. For example, <i> can be expanded in
+							// "A <i> [B]</i>", but not in "A<i> [B]</i>".
+							needsWhiteSpace = !!container;
+						}
+
+						if ( container )
+						{
+							if ( !( sibling = container.getPrevious() ) )
+								enlargeable = container.getParent();
+						}
+					}
+					else
+					{
+						// If we have offset, get the node preceeding it as the
+						// first sibling to be checked.
+						if ( offset )
+							sibling = container.getChild( offset - 1 ) || container.getLast();
+
+						// If there is no sibling, mark the container to be
+						// enlarged.
+						if ( !sibling )
+							enlargeable = container;
+					}
+
+					while ( enlargeable || sibling )
+					{
+						if ( enlargeable && !sibling )
+						{
+							// If we reached the common ancestor, mark the flag
+							// for it.
+							if ( !commonReached && enlargeable.equals( commonAncestor ) )
+								commonReached = true;
+
+							if ( !body.contains( enlargeable ) )
+								break;
+
+							// If we don't need space or this element breaks
+							// the line, then enlarge it.
+							if ( !needsWhiteSpace || enlargeable.getComputedStyle( 'display' ) != 'inline' )
+							{
+								needsWhiteSpace = false;
+
+								// If the common ancestor has been reached,
+								// we'll not enlarge it immediately, but just
+								// mark it to be enlarged later if the end
+								// boundary also enlarges it.
+								if ( commonReached )
+									startTop = enlargeable;
+								else
+									this.setStartBefore( enlargeable );
+							}
+
+							sibling = enlargeable.getPrevious();
+						}
+
+						// Check all sibling nodes preceeding the enlargeable
+						// node. The node wil lbe enlarged only if none of them
+						// blocks it.
+						while ( sibling )
+						{
+							// This flag indicates that this node has
+							// whitespaces at the end.
+							isWhiteSpace = false;
+
+							if ( sibling.type == CKEDITOR.NODE_TEXT )
+							{
+								siblingText = sibling.getText();
+
+								if ( /[^\s\ufeff]/.test( siblingText ) )
+									sibling = null;
+
+								isWhiteSpace = /[\s\ufeff]$/.test( siblingText );
+							}
+							else
+							{
+								// If this is a visible element.
+								if ( sibling.$.offsetWidth > 0 )
+								{
+									// We'll accept it only if we need
+									// whitespace, and this is an inline
+									// element with whitespace only.
+									if ( needsWhiteSpace && CKEDITOR.dtd.$removeEmpty[ sibling.getName() ] )
+									{
+										// It must contains spaces and inline elements only.
+
+										siblingText = sibling.getText();
+
+										if ( !(/[^\s\ufeff]/).test( siblingText ) )	// Spaces + Zero Width No-Break Space (U+FEFF)
+											sibling = null;
+										else
+										{
+											var allChildren = sibling.$.all || sibling.$.getElementsByTagName( '*' );
+											for ( var i = 0, child ; child = allChildren[ i++ ] ; )
+											{
+												if ( !CKEDITOR.dtd.$removeEmpty[ child.nodeName.toLowerCase() ] )
+												{
+													sibling = null;
+													break;
+												}
+											}
+										}
+
+										if ( sibling )
+											isWhiteSpace = !!siblingText.length;
+									}
+									else
+										sibling = null;
+								}
+							}
+
+							// A node with whitespaces has been found.
+							if ( isWhiteSpace )
+							{
+								// Enlarge the last enlargeable node, if we
+								// were waiting for spaces.
+								if ( needsWhiteSpace )
+								{
+									if ( commonReached )
+										startTop = enlargeable;
+									else if ( enlargeable )
+										this.setStartBefore( enlargeable );
+								}
+								else
+									needsWhiteSpace = true;
+							}
+
+							if ( sibling )
+							{
+								var next = sibling.getPrevious();
+
+								if ( !enlargeable && !next )
+								{
+									// Set the sibling as enlargeable, so it's
+									// parent will be get later outside this while.
+									enlargeable = sibling;
+									sibling = null;
+									break;
+								}
+
+								sibling = next;
+							}
+							else
+							{
+								// If sibling has been set to null, then we
+								// need to stop enlarging.
+								enlargeable = null;
+							}
+						}
+
+						if ( enlargeable )
+							enlargeable = enlargeable.getParent();
+					}
+
+					// Process the end boundary. This is basically the same
+					// code used for the start boundary, with small changes to
+					// make it work in the oposite side (to the right). This
+					// makes it difficult to reuse the code here. So, fixes to
+					// the above code are likely to be replicated here.
+
+					container = this.endContainer;
+					offset = this.endOffset;
+
+					// Reset the common variables.
+					enlargeable = sibling = null;
+					commonReached = needsWhiteSpace = false;
+
+					if ( container.type == CKEDITOR.NODE_TEXT )
+					{
+						// Check if there is any non-space text after the
+						// offset. Otherwise, container is null.
+						container = !CKEDITOR.tools.trim( container.substring( offset ) ).length && container;
+
+						// If we found only whitespace in the node, it
+						// means that we'll need more whitespace to be able
+						// to expand. For example, <i> can be expanded in
+						// "A <i> [B]</i>", but not in "A<i> [B]</i>".
+						needsWhiteSpace = !( container && container.getLength() );
+
+						if ( container )
+						{
+							if ( !( sibling = container.getNext() ) )
+								enlargeable = container.getParent();
+						}
+					}
+					else
+					{
+						// Get the node right after the boudary to be checked
+						// first.
+						sibling = container.getChild( offset );
+
+						if ( !sibling )
+							enlargeable = container;
+					}
+
+					while ( enlargeable || sibling )
+					{
+						if ( enlargeable && !sibling )
+						{
+							if ( !commonReached && enlargeable.equals( commonAncestor ) )
+								commonReached = true;
+
+							if ( !body.contains( enlargeable ) )
+								break;
+
+							if ( !needsWhiteSpace || enlargeable.getComputedStyle( 'display' ) != 'inline' )
+							{
+								needsWhiteSpace = false;
+
+								if ( commonReached )
+									endTop = enlargeable;
+								else if ( enlargeable )
+									this.setEndAfter( enlargeable );
+							}
+
+							sibling = enlargeable.getNext();
+						}
+
+						while ( sibling )
+						{
+							isWhiteSpace = false;
+
+							if ( sibling.type == CKEDITOR.NODE_TEXT )
+							{
+								siblingText = sibling.getText();
+
+								if ( /[^\s\ufeff]/.test( siblingText ) )
+									sibling = null;
+
+								isWhiteSpace = /^[\s\ufeff]/.test( siblingText );
+							}
+							else
+							{
+								// If this is a visible element.
+								if ( sibling.$.offsetWidth > 0 )
+								{
+									// We'll accept it only if we need
+									// whitespace, and this is an inline
+									// element with whitespace only.
+									if ( needsWhiteSpace && CKEDITOR.dtd.$removeEmpty[ sibling.getName() ] )
+									{
+										// It must contains spaces and inline elements only.
+
+										siblingText = sibling.getText();
+
+										if ( !(/[^\s\ufeff]/).test( siblingText ) )
+											sibling = null;
+										else
+										{
+											allChildren = sibling.$.all || sibling.$.getElementsByTagName( '*' );
+											for ( i = 0 ; child = allChildren[ i++ ] ; )
+											{
+												if ( !CKEDITOR.dtd.$removeEmpty[ child.nodeName.toLowerCase() ] )
+												{
+													sibling = null;
+													break;
+												}
+											}
+										}
+
+										if ( sibling )
+											isWhiteSpace = !!siblingText.length;
+									}
+									else
+										sibling = null;
+								}
+							}
+
+							if ( isWhiteSpace )
+							{
+								if ( needsWhiteSpace )
+								{
+									if ( commonReached )
+										endTop = enlargeable;
+									else
+										this.setEndAfter( enlargeable );
+								}
+							}
+
+							if ( sibling )
+							{
+								next = sibling.getNext();
+
+								if ( !enlargeable && !next )
+								{
+									enlargeable = sibling;
+									sibling = null;
+									break;
+								}
+
+								sibling = next;
+							}
+							else
+							{
+								// If sibling has been set to null, then we
+								// need to stop enlarging.
+								enlargeable = null;
+							}
+						}
+
+						if ( enlargeable )
+							enlargeable = enlargeable.getParent();
+					}
+
+					// If the common ancestor can be enlarged by both boundaries, then include it also.
+					if ( startTop && endTop )
+					{
+						commonAncestor = startTop.contains( endTop ) ? endTop : startTop;
+
+						this.setStartBefore( commonAncestor );
+						this.setEndAfter( commonAncestor );
+					}
+					break;
+
+				case CKEDITOR.ENLARGE_BLOCK_CONTENTS:
+				case CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:
+					// DFS backward to get the block/list item boundary at or before the start.
+					var boundaryNodes = getBoundaryNodes.apply( this ),
+						startNode = boundaryNodes.startNode,
+						endNode = boundaryNodes.endNode,
+						guardFunction = ( unit == CKEDITOR.ENLARGE_BLOCK_CONTENTS ?
+							CKEDITOR.dom.domWalker.blockBoundary() :
+							CKEDITOR.dom.domWalker.listItemBoundary() ),
+						walker = new CKEDITOR.dom.domWalker( startNode ),
+						data = walker.reverse( guardFunction ),
+						boundaryEvent = data.events.shift();
+
+					this.setStartBefore( boundaryEvent.from );
+
+					// DFS forward to get the block/list item boundary at or before the end.
+					walker.setNode( endNode );
+					data = walker.forward( guardFunction );
+					boundaryEvent = data.events.shift();
+
+					this.setEndAfter( boundaryEvent.from );
+					break;
+
+				default:
+			}
+		},
+
+		/**
+		 * Inserts a node at the start of the range. The range will be expanded
+		 * the contain the node.
+		 */
+		insertNode : function( node )
+		{
+			this.trim( false, true );
+
+			var startContainer = this.startContainer;
+			var startOffset = this.startOffset;
+
+			var nextNode = startContainer.getChild( startOffset );
+
+			if ( nextNode )
+				node.insertBefore( nextNode );
+			else
+				startContainer.append( node );
+
+			// Check if we need to update the end boundary.
+			if ( node.getParent().equals( this.endContainer ) )
+				this.endOffset++;
+
+			// Expand the range to embrace the new node.
+			this.setStartBefore( node );
+		},
+
+		moveToPosition : function( node, position )
+		{
+			this.setStartAt( node, position );
+			this.collapse( true );
+		},
+
+		selectNodeContents : function( node )
+		{
+			this.setStart( node, 0 );
+			this.setEnd( node, node.type == CKEDITOR.NODE_TEXT ? node.getLength() : node.getChildCount() );
+		},
+
+		/**
+		 * Sets the start position of a Range.
+		 * @param {CKEDITOR.dom.node} startNode The node to start the range.
+		 * @param {Number} startOffset An integer greater than or equal to zero
+		 *		representing the offset for the start of the range from the start
+		 *		of startNode.
+		 */
+		setStart : function( startNode, startOffset )
+		{
+			// W3C requires a check for the new position. If it is after the end
+			// boundary, the range should be collapsed to the new start. It seams
+			// we will not need this check for our use of this class so we can
+			// ignore it for now.
+
+			this.startContainer	= startNode;
+			this.startOffset	= startOffset;
+
+			if ( !this.endContainer )
+			{
+				this.endContainer	= startNode;
+				this.endOffset		= startOffset;
+			}
+
+			updateCollapsed( this );
+		},
+
+		/**
+		 * Sets the end position of a Range.
+		 * @param {CKEDITOR.dom.node} endNode The node to end the range.
+		 * @param {Number} endOffset An integer greater than or equal to zero
+		 *		representing the offset for the end of the range from the start
+		 *		of endNode.
+		 */
+		setEnd : function( endNode, endOffset )
+		{
+			// W3C requires a check for the new position. If it is before the start
+			// boundary, the range should be collapsed to the new end. It seams we
+			// will not need this check for our use of this class so we can ignore
+			// it for now.
+
+			this.endContainer	= endNode;
+			this.endOffset		= endOffset;
+
+			if ( !this.startContainer )
+			{
+				this.startContainer	= endNode;
+				this.startOffset	= endOffset;
+			}
+
+			updateCollapsed( this );
+		},
+
+		setStartAfter : function( node )
+		{
+			this.setStart( node.getParent(), node.getIndex() + 1 );
+		},
+
+		setStartBefore : function( node )
+		{
+			this.setStart( node.getParent(), node.getIndex() );
+		},
+
+		setEndAfter : function( node )
+		{
+			this.setEnd( node.getParent(), node.getIndex() + 1 );
+		},
+
+		setEndBefore : function( node )
+		{
+			this.setEnd( node.getParent(), node.getIndex() );
+		},
+
+		setStartAt : function( node, position )
+		{
+			switch( position )
+			{
+				case CKEDITOR.POSITION_AFTER_START :
+					this.setStart( node, 0 );
+					break;
+
+				case CKEDITOR.POSITION_BEFORE_END :
+					if ( node.type == CKEDITOR.NODE_TEXT )
+						this.setStart( node, node.getLength() );
+					else
+						this.setStart( node, node.getChildCount() );
+					break;
+
+				case CKEDITOR.POSITION_BEFORE_START :
+					this.setStartBefore( node );
+					break;
+
+				case CKEDITOR.POSITION_AFTER_END :
+					this.setStartAfter( node );
+			}
+
+			updateCollapsed( this );
+		},
+
+		setEndAt : function( node, position )
+		{
+			switch( position )
+			{
+				case CKEDITOR.POSITION_AFTER_START :
+					this.setEnd( node, 0 );
+					break;
+
+				case CKEDITOR.POSITION_BEFORE_END :
+					if ( node.type == CKEDITOR.NODE_TEXT )
+						this.setEnd( node, node.getLength() );
+					else
+						this.setEnd( node, node.getChildCount() );
+					break;
+
+				case CKEDITOR.POSITION_BEFORE_START :
+					this.setEndBefore( node );
+					break;
+
+				case CKEDITOR.POSITION_AFTER_END :
+					this.setEndAfter( node );
+			}
+
+			updateCollapsed( this );
+		},
+
+		// TODO: The fixed block isn't trimmed, does not work for <pre>.
+		// TODO: Does not add bogus <br> to empty fixed blocks.
+		fixBlock : function( isStart, blockTag )
+		{
+			var bookmark = this.createBookmark(),
+				fixedBlock = new CKEDITOR.dom.element( blockTag, this.document );
+			this.collapse( isStart );
+			this.enlarge( CKEDITOR.ENLARGE_BLOCK_CONTENTS );
+			this.extractContents().appendTo( fixedBlock );
+			this.insertNode( fixedBlock );
+			this.moveToBookmark( bookmark );
+			return fixedBlock;
+		},
+
+		splitBlock : function( blockTag )
+		{
+			var startPath = new CKEDITOR.dom.elementPath( this.startContainer ),
+				endPath = new CKEDITOR.dom.elementPath( this.endContainer ),
+				startBlockLimit = startPath.blockLimit,
+				endBlockLimit = endPath.blockLimit,
+				startBlock = startPath.block,
+				endBlock = endPath.block,
+				elementPath = null;
+
+			if ( !startBlockLimit.equals( endBlockLimit ) )
+				return null;
+
+			// Get or fix current blocks.
+			if ( blockTag != 'br' )
+			{
+				if ( !startBlock )
+				{
+					startBlock = this.fixBlock( true, blockTag );
+					endBlock = new CKEDITOR.dom.elementPath( this.endContainer );
+				}
+
+				if ( !endBlock )
+					endBlock = this.fixBlock( false, blockTag );
+			}
+
+			// Get the range position.
+			var isStartOfBlock = startBlock && this.checkStartOfBlock(),
+				isEndOfBlock = endBlock && this.checkEndOfBlock();
+
+			// Delete the current contents.
+			// TODO: Why is 2.x doing CheckIsEmpty()?
+			this.deleteContents();
+
+			if ( startBlock && startBlock.equals( endBlock ) )
+			{
+				if ( isEndOfBlock )
+				{
+					elementPath = new CKEDITOR.dom.elementPath( this.startContainer );
+					this.moveToPosition( endBlock, CKEDITOR.POSITION_AFTER_END );
+					endBlock = null;
+				}
+				else if ( isStartOfBlock )
+				{
+					elementPath = new CKEDITOR.dom.elementPath( this.startContainer );
+					this.moveToPosition( startBlock, CKEDITOR.POSITION_BEFORE_START );
+					startBlock = null;
+				}
+				else
+				{
+					// Extract the contents of the block from the selection point to the end
+					// of its contents.
+					this.setEndAt( startBlock, CKEDITOR.POSITION_BEFORE_END );
+					var documentFragment = this.extractContents();
+
+					// Duplicate the block element after it.
+					endBlock = startBlock.clone( false );
+					endBlock.removeAttribute( 'id' );
+
+					// Place the extracted contents into the duplicated block.
+					documentFragment.appendTo( endBlock );
+					endBlock.insertAfter( startBlock );
+					this.moveToPosition( startBlock, CKEDITOR.POSITION_AFTER_END );
+
+					// TODO: Append bogus br to startBlock for Gecko
+				}
+			}
+
+			return {
+				previousBlock : startBlock,
+				nextBlock : endBlock,
+				wasStartOfBlock : isStartOfBlock,
+				wasEndOfBlock : isEndOfBlock,
+				elementPath : elementPath
+			};
+		},
+
+		checkStartOfBlock : function()
+		{
+			var startContainer = this.startContainer,
+				startOffset = this.startOffset;
+
+			// If the starting node is a text node, and non-empty before the offset,
+			// then we're surely not at the start of block.
+			if ( startContainer.type == CKEDITOR.NODE_TEXT )
+			{
+				var textBefore = CKEDITOR.tools.ltrim( startContainer.getText().substr( 0, startOffset ) );
+				if ( textBefore.length > 0 )
+					return false;
+			}
+
+			var startNode = getBoundaryNodes.apply( this ).startNode,
+				walker = new CKEDITOR.dom.domWalker( startNode );
+
+			// DFS backwards until the block boundary, with the checker function.
+			walker.on( 'step', getCheckStartEndBlockFunction( true ), null, null, 20 );
+			walker.reverse( CKEDITOR.dom.domWalker.blockBoundary() );
+
+			return !walker.checkFailed;
+		},
+
+		checkEndOfBlock : function()
+		{
+			var endContainer = this.endContainer,
+				endOffset = this.endOffset;
+
+			// If the ending node is a text node, and non-empty after the offset,
+			// then we're surely not at the end of block.
+			if ( endContainer.type == CKEDITOR.NODE_TEXT )
+			{
+				var textAfter = CKEDITOR.tools.rtrim( endContainer.getText().substr( endOffset ) );
+				if ( textAfter.length > 0 )
+					return false;
+			}
+
+			var endNode = getBoundaryNodes.apply( this ).endNode,
+				walker = new CKEDITOR.dom.domWalker( endNode );
+
+			// DFS forward until the block boundary, with the checker function.
+			walker.on( 'step', getCheckStartEndBlockFunction( false ), null, null, 20 );
+			walker.forward( CKEDITOR.dom.domWalker.blockBoundary() );
+
+			return !walker.checkFailed;
+		}
+	};
+})();
+
+CKEDITOR.POSITION_AFTER_START	= 1;	// <element>^contents</element>		"^text"
+CKEDITOR.POSITION_BEFORE_END	= 2;	// <element>contents^</element>		"text^"
+CKEDITOR.POSITION_BEFORE_START	= 3;	// ^<element>contents</element>		^"text"
+CKEDITOR.POSITION_AFTER_END		= 4;	// <element>contents</element>^		"text"
+
+CKEDITOR.ENLARGE_ELEMENT = 1;
+CKEDITOR.ENLARGE_BLOCK_CONTENTS = 2;
+CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS = 3;
Index: /CKEditor/tags/3.0 Beta/_source/core/dom/text.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/dom/text.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/dom/text.js	(revision 3046)
@@ -0,0 +1,101 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Defines the {@link CKEDITOR.dom.text} class, which represents
+ *		a DOM text node.
+ */
+
+/**
+ * Represents a DOM text node.
+ * @constructor
+ * @augments CKEDITOR.dom.node
+ * @param {Object|String} text A native DOM text node or a string containing
+ *		the text to use to create a new text node.
+ * @param {CKEDITOR.dom.document} [ownerDocument] The document that will contain
+ *		the node in case of new node creation. Defaults to the current document.
+ * @example
+ * var nativeNode = document.createTextNode( 'Example' );
+ * var text = CKEDITOR.dom.text( nativeNode );
+ * @example
+ * var text = CKEDITOR.dom.text( 'Example' );
+ */
+CKEDITOR.dom.text = function( text, ownerDocument )
+{
+	if ( typeof text == 'string' )
+		text = ( ownerDocument ? ownerDocument.$ : document ).createTextNode( text );
+
+	// Theoretically, we should call the base constructor here
+	// (not CKEDITOR.dom.node though). But, IE doesn't support expando
+	// properties on text node, so the features provided by domObject will not
+	// work for text nodes (which is not a big issue for us).
+	//
+	// CKEDITOR.dom.domObject.call( this, element );
+
+	/**
+	 * The native DOM text node represented by this class instance.
+	 * @type Object
+	 * @example
+	 * var element = new CKEDITOR.dom.text( 'Example' );
+	 * alert( element.$.nodeType );  // "3"
+	 */
+	this.$ = text;
+};
+
+CKEDITOR.dom.text.prototype = new CKEDITOR.dom.node();
+
+CKEDITOR.tools.extend( CKEDITOR.dom.text.prototype,
+	/** @lends CKEDITOR.dom.text.prototype */
+	{
+		/**
+		 * The node type. This is a constant value set to
+		 * {@link CKEDITOR.NODE_TEXT}.
+		 * @type Number
+		 * @example
+		 */
+		type : CKEDITOR.NODE_TEXT,
+
+		getLength : function()
+		{
+			return this.$.nodeValue.length;
+		},
+
+		getText : function()
+		{
+			return this.$.nodeValue;
+		},
+
+		/**
+		 * Breaks this text node into two nodes at the specified offset,
+		 * keeping both in the tree as siblings. This node then only contains
+		 * all the content up to the offset point. A new text node, which is
+		 * inserted as the next sibling of this node, contains all the content
+		 * at and after the offset point. When the offset is equal to the
+		 * length of this node, the new node has no data.
+		 * @param {Number} The position at which to split, starting from zero.
+		 * @returns {CKEDITOR.dom.text} The new text node.
+		 */
+		split : function( offset )
+		{
+			return new CKEDITOR.dom.text( this.$.splitText( offset ) );
+		},
+
+		/**
+		 * Extracts characters from indexA up to but not including indexB.
+		 * @param {Number} indexA An integer between 0 and one less than the
+		 *		length of the text.
+		 * @param {Number} [indexB] An integer between 0 and the length of the
+		 *		string. If omitted, extracts characters to the end of the text.
+		 */
+		substring : function( indexA, indexB )
+		{
+			// We need the following check due to a Firefox bug
+			// https://bugzilla.mozilla.org/show_bug.cgi?id=458886
+			if ( typeof indexB != 'number' )
+				return this.$.nodeValue.substr( indexA );
+			else
+				return this.$.nodeValue.substring( indexA, indexB );
+		}
+	});
Index: /CKEditor/tags/3.0 Beta/_source/core/dom/window.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/dom/window.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/dom/window.js	(revision 3046)
@@ -0,0 +1,93 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Defines the {@link CKEDITOR.dom.document} class, which
+ *		represents a DOM document.
+ */
+
+/**
+ * Represents a DOM window.
+ * @constructor
+ * @augments CKEDITOR.dom.domObject
+ * @param {Object} domWindow A native DOM window.
+ * @example
+ * var document = new CKEDITOR.dom.window( window );
+ */
+CKEDITOR.dom.window = function( domWindow )
+{
+	CKEDITOR.dom.domObject.call( this, domWindow );
+};
+
+CKEDITOR.dom.window.prototype = new CKEDITOR.dom.domObject();
+
+CKEDITOR.tools.extend( CKEDITOR.dom.window.prototype,
+	/** @lends CKEDITOR.dom.window.prototype */
+	{
+		/**
+		 * Moves the selection focus to this window.
+		 * @function
+		 * @example
+		 * var win = new CKEDITOR.dom.window( window );
+		 * <b>win.focus()</b>;
+		 */
+		focus : function()
+		{
+			this.$.focus();
+		},
+
+		/**
+		 * Gets the width and height of this window's viewable area.
+		 * @function
+		 * @returns {Object} An object with the "width" and "height"
+		 *		properties containing the size.
+		 * @example
+		 * var win = new CKEDITOR.dom.window( window );
+		 * var size = <b>win.getViewPaneSize()</b>;
+		 * alert( size.width );
+		 * alert( size.height );
+		 */
+		getViewPaneSize : function()
+		{
+			var doc = this.$.document,
+				stdMode = doc.compatMode == 'CSS1Compat';
+			return {
+				width : ( stdMode ? doc.documentElement.clientWidth : doc.body.clientWidth ) || 0,
+				height : ( stdMode ? doc.documentElement.clientHeight : doc.body.clientHeight ) || 0
+			};
+		},
+
+		/**
+		 * Gets the current position of the window's scroll.
+		 * @function
+		 * @returns {Object} An object with the "x" and "y" properties
+		 *		containing the scroll position.
+		 * @example
+		 * var win = new CKEDITOR.dom.window( window );
+		 * var pos = <b>win.getScrollPosition()</b>;
+		 * alert( pos.x );
+		 * alert( pos.y );
+		 */
+		getScrollPosition : function()
+		{
+			var $ = this.$;
+
+			if ( 'pageXOffset' in $ )
+			{
+				return {
+					x : $.pageXOffset || 0,
+					y : $.pageYOffset || 0
+				};
+			}
+			else
+			{
+				var doc = $.document;
+				return {
+					x : doc.documentElement.scrollLeft || doc.body.scrollLeft || 0,
+					y : doc.documentElement.scrollTop || doc.body.scrollTop || 0
+				};
+			}
+		}
+	});
Index: /CKEditor/tags/3.0 Beta/_source/core/dtd.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/dtd.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/dtd.js	(revision 3046)
@@ -0,0 +1,186 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Defines the {@link CKEDITOR.dtd} object, which holds the DTD
+ *		mapping for XHTML 1.0 Transitional. This file was automatically
+ *		generated from the file: xhtml1-transitional.dtd.
+ */
+
+/**
+ * Holds and object representation of the HTML DTD to be used by the editor in
+ * its internal operations.
+ *
+ * Each element in the DTD is represented by a
+ * property in this object. Each property contains the list of elements that
+ * can be contained by the element. Text is represented by the "#" property.
+ *
+ * Several special grouping properties are also available. Their names start
+ * with the "$" character.
+ * @namespace
+ * @example
+ * // Check if "div" can be contained in a "p" element.
+ * alert( !!CKEDITOR.dtd[ 'p' ][ 'div' ] );  "false"
+ * @example
+ * // Check if "p" can be contained in a "div" element.
+ * alert( !!CKEDITOR.dtd[ 'div' ][ 'p' ] );  "true"
+ * @example
+ * // Check if "p" is a block element.
+ * alert( !!CKEDITOR.dtd.$block[ 'p' ] );  "true"
+ */
+CKEDITOR.dtd = (function()
+{
+    var X = CKEDITOR.tools.extend,
+
+		A = {isindex:1,fieldset:1},
+		B = {input:1,button:1,select:1,textarea:1,label:1},
+		C = X({a:1},B),
+		D = X({iframe:1},C),
+		E = {hr:1,ul:1,menu:1,div:1,blockquote:1,noscript:1,table:1,center:1,address:1,dir:1,pre:1,h5:1,dl:1,h4:1,noframes:1,h6:1,ol:1,h1:1,h3:1,h2:1},
+		F = {ins:1,del:1,script:1},
+		G = X({b:1,acronym:1,bdo:1,'var':1,'#':1,abbr:1,code:1,br:1,i:1,cite:1,kbd:1,u:1,strike:1,s:1,tt:1,strong:1,q:1,samp:1,em:1,dfn:1,span:1},F),
+		H = X({sub:1,img:1,object:1,sup:1,basefont:1,map:1,applet:1,font:1,big:1,small:1},G),
+		I = X({p:1},H),
+		J = X({iframe:1},H,B),
+		K = {img:1,noscript:1,br:1,kbd:1,center:1,button:1,basefont:1,h5:1,h4:1,samp:1,h6:1,ol:1,h1:1,h3:1,h2:1,form:1,font:1,'#':1,select:1,menu:1,ins:1,abbr:1,label:1,code:1,table:1,script:1,cite:1,input:1,iframe:1,strong:1,textarea:1,noframes:1,big:1,small:1,span:1,hr:1,sub:1,bdo:1,'var':1,div:1,object:1,sup:1,strike:1,dir:1,map:1,dl:1,applet:1,del:1,isindex:1,fieldset:1,ul:1,b:1,acronym:1,a:1,blockquote:1,i:1,u:1,s:1,tt:1,address:1,q:1,pre:1,p:1,em:1,dfn:1},
+
+		L = X({a:1},J),
+		M = {tr:1},
+		N = {'#':1},
+		O = X({param:1},K),
+		P = X({form:1},A,D,E,I),
+		Q = {li:1};
+
+    return /** @lends CKEDITOR.dtd */ {
+
+		// The "$" items have been added manually.
+
+		/**
+		 * List of block elements, like "p" or "div".
+		 * @type Object
+		 * @example
+		 */
+		$block : {address:1,blockquote:1,center:1,dir:1,div:1,dl:1,fieldset:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,isindex:1,menu:1,noframes:1,ol:1,p:1,pre:1,table:1,ul:1},
+
+		/**
+		 * List of empty (self-closing) elements, like "br" or "img".
+		 * @type Object
+		 * @example
+		 */
+		$empty : {area:1,base:1,br:1,col:1,hr:1,img:1,input:1,link:1,meta:1,param:1},
+
+		/**
+		 * List of list item elements, like "li" or "dd".
+		 * @type Object
+		 * @example
+		 */
+		$listItem : {dd:1,dt:1,li:1},
+
+		/**
+		 * List of elements that can be ignored if empty, like "b" or "span".
+		 * @type Object
+		 * @example
+		 */
+		$removeEmpty : {abbr:1,acronym:1,address:1,b:1,bdo:1,big:1,cite:1,code:1,dfn:1,em:1,font:1,i:1,kbd:1,q:1,s:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1},
+
+		/**
+		 * List of elements that have tabindex set to zero by default.
+		 * @type Object
+		 * @example
+		 */
+		$tabIndex : {a:1,area:1,button:1,input:1,object:1,select:1,textarea:1},
+
+		/**
+		 * List of elements used inside the "table" element, like "tbody" or "td".
+		 * @type Object
+		 * @example
+		 */
+		$tableContent : {caption:1,col:1,colgroup:1,tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1},
+
+        col : {},
+        tr : {td:1,th:1},
+        img : {},
+        colgroup : {col:1},
+        noscript : P,
+        td : P,
+        br : {},
+        th : P,
+        center : P,
+        kbd : L,
+        button : X(I,E),
+        basefont : {},
+        h5 : L,
+        h4 : L,
+        samp : L,
+        h6 : L,
+        ol : Q,
+        h1 : L,
+        h3 : L,
+        option : N,
+        h2 : L,
+        form : X(A,D,E,I),
+        select : {optgroup:1,option:1},
+        font : L,
+        ins : P,
+        menu : Q,
+        abbr : L,
+        label : L,
+        table : {thead:1,col:1,tbody:1,tr:1,colgroup:1,caption:1,tfoot:1},
+        code : L,
+        script : N,
+        tfoot : M,
+        cite : L,
+        li : P,
+        input : {},
+        iframe : P,
+        strong : L,
+        textarea : N,
+        noframes : P,
+        big : L,
+        small : L,
+        span : L,
+        hr : {},
+        dt : L,
+        sub : L,
+        optgroup : {option:1},
+        param : {},
+        bdo : L,
+        'var' : L,
+        div : P,
+        object : O,
+        sup : L,
+        dd : P,
+        strike : L,
+        area : {},
+        dir : Q,
+        map : X({area:1,form:1,p:1},A,F,E),
+        applet : O,
+        dl : {dt:1,dd:1},
+        del : P,
+        isindex : {},
+        fieldset : X({legend:1},K),
+        thead : M,
+        ul : Q,
+        acronym : L,
+        b : L,
+        a : J,
+        blockquote : P,
+        caption : L,
+        i : L,
+        u : L,
+        tbody : M,
+        s : L,
+        address : X(D,I),
+        tt : L,
+        legend : L,
+        q : L,
+        pre : X(G,C),
+        p : L,
+        em : L,
+        dfn : L
+    };
+})();
+
+// PACKAGER_RENAME( CKEDITOR.dtd )
Index: /CKEditor/tags/3.0 Beta/_source/core/editor.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/editor.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/editor.js	(revision 3046)
@@ -0,0 +1,535 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Defines the {@link CKEDITOR.editor} class, which represents an
+ *		editor instance.
+ */
+
+(function()
+{
+	// The counter for automatic instance names.
+	var nameCounter = 0;
+
+	var getNewName = function()
+	{
+		var name = 'editor' + ( ++nameCounter );
+		return ( CKEDITOR.instances && CKEDITOR.instances[ name ] ) ? getNewName() : name;
+	};
+
+	// ##### START: Config Privates
+
+	// These function loads custom configuration files and cache the
+	// CKEDITOR.editorConfig functions defined on them, so there is no need to
+	// download them more than once for several instances.
+	var loadConfigLoaded = {};
+	var loadConfig = function( editor )
+	{
+		var customConfig = editor.config.customConfig;
+
+		// Check if there is a custom config to load.
+		if ( !customConfig )
+			return false;
+
+		var loadedConfig = loadConfigLoaded[ customConfig ] || ( loadConfigLoaded[ customConfig ] = {} );
+
+
+		// If the custom config has already been downloaded, reuse it.
+		if ( loadedConfig.fn )
+		{
+			// Call the cached CKEDITOR.editorConfig defined in the custom
+			// config file for the editor instance depending on it.
+			loadedConfig.fn.call( editor, editor.config );
+
+			// If there is no other customConfig in the chain, fire the
+			// "configLoaded" event.
+			if ( editor.config.customConfig == customConfig || !loadConfig( editor ) )
+				editor.fireOnce( 'customConfigLoaded' );
+		}
+		else
+		{
+			// Load the custom configuration file.
+			CKEDITOR.scriptLoader.load( customConfig, function()
+				{
+					// If the CKEDITOR.editorConfig function has been properly
+					// defined in the custom configuration file, cache it.
+					if ( CKEDITOR.editorConfig )
+						loadedConfig.fn = CKEDITOR.editorConfig;
+					else
+						loadedConfig.fn = function(){};
+
+					// Call the load config again. This time the custom
+					// config is already cached and so it will get loaded.
+					loadConfig( editor );
+				});
+		}
+
+		return true;
+	};
+
+	var initConfig = function( editor, instanceConfig )
+	{
+		// Setup the lister for the "customConfigLoaded" event.
+		editor.on( 'customConfigLoaded', function()
+			{
+				// Overwrite the settings from the in-page config.
+				if ( instanceConfig )
+					CKEDITOR.tools.extend( editor.config, instanceConfig, true );
+
+				// Fire the "configLoaded" event.
+				editor.fireOnce( 'configLoaded' );
+
+				loadLang( editor );
+			});
+
+		// The instance config may override the customConfig setting to avoid
+		// loading the default ~/config.js file.
+		if ( instanceConfig && instanceConfig.customConfig != undefined )
+			editor.config.customConfig = instanceConfig.customConfig;
+
+		// Load configs from the custom configuration files.
+		if ( !loadConfig( editor ) )
+			editor.fireOnce( 'customConfigLoaded' );
+	};
+
+	// ##### END: Config Privates
+
+	var loadLang = function( editor )
+	{
+		CKEDITOR.lang.load( editor.config.defaultLanguage, editor.config.autoLanguage, function( languageCode, lang )
+			{
+				editor.langCode = languageCode;
+
+				// As we'll be adding plugin specific entries that could come
+				// from different language code files, we need a copy of lang,
+				// not a direct reference to it.
+				editor.lang = CKEDITOR.tools.prototypedCopy( lang );
+
+				loadPlugins( editor );
+			});
+	};
+
+	var loadPlugins = function( editor )
+	{
+		// Load all plugins defined in the "plugins" setting.
+		CKEDITOR.plugins.load( editor.config.plugins.split( ',' ), function( plugins )
+			{
+				// The list of plugins.
+				var pluginsArray = [];
+
+				// The language code to get loaded for each plugin. Null
+				// entries will be appended for plugins with no language files.
+				var languageCodes = [];
+
+				// The list of URLs to language files.
+				var languageFiles = [];
+
+				// Cache the loaded plugin names.
+				editor.plugins = plugins;
+
+				// Loop through all plugins, to build the list of language
+				// files to get loaded.
+				for ( var pluginName in plugins )
+				{
+					var plugin = plugins[ pluginName ],
+						pluginLangs = plugin.lang,
+						pluginPath = CKEDITOR.plugins.getPath( pluginName ),
+						lang = null;
+
+					// Set the plugin path in the plugin.
+					plugin.path = pluginPath;
+
+					// If the plugin has "lang".
+					if ( pluginLangs )
+					{
+						// Resolve the plugin language. If the current language
+						// is not available, get the first one (default one).
+						lang = ( CKEDITOR.tools.indexOf( pluginLangs, editor.langCode ) >= 0 ? editor.langCode : pluginLangs[ 0 ] );
+
+						if ( !plugin.lang[ lang ] )
+						{
+							// Put the language file URL into the list of files to
+							// get downloaded.
+							languageFiles.push( CKEDITOR.getUrl( pluginPath + 'lang/' + lang + '.js' ) );
+						}
+						else
+						{
+							CKEDITOR.tools.extend( editor.lang, plugin.lang[ lang ] );
+							lang = null;
+						}
+					}
+
+					// Save the language code, so we know later which
+					// language has been resolved to this plugin.
+					languageCodes.push( lang );
+
+					pluginsArray.push( plugin );
+				}
+
+				// Load all plugin specific language files in a row.
+				CKEDITOR.scriptLoader.load( languageFiles, function()
+					{
+						// Initialize all plugins that have the "beforeInit" and "init" methods defined.
+						var methods = [ 'beforeInit', 'init' ];
+						for ( var m = 0 ; m < methods.length ; m++ )
+						{
+							for ( var i = 0 ; i < pluginsArray.length ; i++ )
+							{
+								var plugin = pluginsArray[ i ];
+
+								// Uses the first loop to update the language entries also.
+								if ( m === 0 && languageCodes[ i ] && plugin.lang )
+									CKEDITOR.tools.extend( editor.lang, plugin.lang[ languageCodes[ i ] ] );
+
+								// Call the plugin method (beforeInit and init).
+								if ( plugin[ methods[ m ] ] )
+									plugin[ methods[ m ] ]( editor );
+							}
+						}
+
+						// Load the editor skin.
+						editor.fire( 'pluginsLoaded' );
+						loadSkin( editor );
+					});
+			});
+	};
+
+	var loadSkin = function( editor )
+	{
+		CKEDITOR.skins.load( editor.config.skin, 'editor', function()
+			{
+				loadTheme( editor );
+			});
+	};
+
+	var loadTheme = function( editor )
+	{
+		var theme = editor.config.theme;
+		CKEDITOR.themes.load( theme, function()
+			{
+				var editorTheme = editor.theme = CKEDITOR.themes.get( theme );
+				editorTheme.path = CKEDITOR.themes.getPath( theme );
+				editorTheme.build( editor );
+
+				if ( editor.config.autoUpdateElement )
+					attachToForm( editor );
+			});
+	};
+
+	var attachToForm = function( editor )
+	{
+		var element = editor.element;
+
+		// If are replacing a textarea, we must
+		if ( editor.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE && element.is( 'textarea' ) )
+		{
+			var form = new CKEDITOR.dom.element( element.$.form );
+			if ( form )
+			{
+				form.on( 'submit', function()
+					{
+						editor.updateElement();
+					});
+
+				// If we have a submit function, override it also, because it doesn't fire the "submit" event.
+				if ( form.submit && form.submit.call )
+				{
+					CKEDITOR.tools.override( form.submit, function( originalSubmit )
+						{
+							return function()
+								{
+									editor.updateElement();
+									originalSubmit.apply( this, arguments );
+								};
+						});
+				}
+			}
+		}
+	};
+
+	/**
+	 * Initializes the editor instance. This function is called by the editor
+	 * contructor (editor_basic.js).
+	 * @private
+	 */
+	CKEDITOR.editor.prototype._init = function()
+		{
+			// Get the properties that have been saved in the editor_base
+			// implementation.
+			var element			= CKEDITOR.dom.element.get( this._.element ),
+				instanceConfig	= this._.instanceConfig;
+			delete this._.element;
+			delete this._.instanceConfig;
+
+			this._.commands = {};
+
+			/**
+			 * The DOM element that has been replaced by this editor instance. This
+			 * element holds the editor data on load and post.
+			 * @name CKEDITOR.editor.prototype.element
+			 * @type CKEDITOR.dom.element
+			 * @example
+			 * var editor = CKEDITOR.instances.editor1;
+			 * alert( <b>editor.element</b>.getName() );  "textarea"
+			 */
+			this.element = element;
+
+			/**
+			 * The editor instance name. It hay be the replaced element id, name or
+			 * a default name using a progressive counter (editor1, editor2, ...).
+			 * @name CKEDITOR.editor.prototype.name
+			 * @type String
+			 * @example
+			 * var editor = CKEDITOR.instances.editor1;
+			 * alert( <b>editor.name</b> );  "editor1"
+			 */
+			this.name = ( element && ( this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE )
+							&& ( element.getId() || element.getNameAtt() ) )
+						|| getNewName();
+
+			/**
+			 * The configurations for this editor instance. It inherits all
+			 * settings defined in (@link CKEDITOR.config}, combined with settings
+			 * loaded from custom configuration files and those defined inline in
+			 * the page when creating the editor.
+			 * @name CKEDITOR.editor.prototype.config
+			 * @type Object
+			 * @example
+			 * var editor = CKEDITOR.instances.editor1;
+			 * alert( <b>editor.config.theme</b> );  "default" e.g.
+			 */
+			this.config = CKEDITOR.tools.prototypedCopy( CKEDITOR.config );
+
+			/**
+			 * Namespace containing UI features related to this editor instance.
+			 * @name CKEDITOR.editor.prototype.ui
+			 * @type CKEDITOR.ui
+			 * @example
+			 */
+			this.ui = new CKEDITOR.ui( this );
+
+			/**
+			 * Controls the focus state of this editor instance. This property
+			 * is rarely used for normal API operations. It is mainly
+			 * destinated to developer adding UI elements to the editor interface.
+			 * @name CKEDITOR.editor.prototype.focusManager
+			 * @type CKEDITOR.focusManager
+			 * @example
+			 */
+			this.focusManager = new CKEDITOR.focusManager( this );
+
+			CKEDITOR.fire( 'instanceCreated', null, this );
+
+			initConfig( this, instanceConfig );
+		};
+})();
+
+CKEDITOR.tools.extend( CKEDITOR.editor.prototype,
+	/** @lends CKEDITOR.editor.prototype */
+	{
+		/**
+		 * Adds a command definition to the editor instance. Commands added with
+		 * this function can be later executed with {@link #execCommand}.
+		 * @param {String} commandName The indentifier name of the command.
+		 * @param {CKEDITOR.commandDefinition} commandDefinition The command definition.
+		 * @example
+		 * editorInstance.addCommand( 'sample',
+		 * {
+		 *     exec : function( editor )
+		 *     {
+		 *         alert( 'Executing a command for the editor name "' + editor.name + '"!' );
+		 *     }
+		 * });
+		 */
+		addCommand : function( commandName, commandDefinition )
+		{
+			this._.commands[ commandName ] = new CKEDITOR.command( this, commandDefinition );
+		},
+
+		/**
+		 * Destroys the editor instance, releasing all resources used by it.
+		 * If the editor replaced an element, the element will be recovered.
+		 * @param {Boolean} [noUpdate] If the instance is replacing a DOM
+		 *		element, this parameter indicates whether or not to update the
+		 *		element with the instance contents.
+		 * @example
+		 * alert( CKEDITOR.instances.editor1 );  e.g "object"
+		 * <b>CKEDITOR.instances.editor1.destroy()</b>;
+		 * alert( CKEDITOR.instances.editor1 );  "undefined"
+		 */
+		destroy : function( noUpdate )
+		{
+			if ( !noUpdate )
+				this.updateElement();
+
+			this.theme.destroy( this );
+			CKEDITOR.remove( this );
+		},
+
+		/**
+		 * Executes a command.
+		 * @param {String} commandName The indentifier name of the command.
+		 * @param {Object} [data] Data to be passed to the command
+		 * @returns {Boolean} "true" if the command has been successfuly
+		 *		executed, otherwise "false".
+		 * @example
+		 * editorInstance.execCommand( 'Bold' );
+		 */
+		execCommand : function( commandName, data )
+		{
+			var command = this.getCommand( commandName );
+			if ( command && command.state != CKEDITOR.TRISTATE_DISABLED )
+				return command.exec( this, data );
+
+			// throw 'Unknown command name "' + commandName + '"';
+			return false;
+		},
+
+		/**
+		 * Gets one of the registered commands. Note that, after registering a
+		 * command definition with addCommand, it is transformed internally
+		 * into an instance of {@link CKEDITOR.command}, which will be then
+		 * returned by this function.
+		 * @param {String} commandName The name of the command to be returned.
+		 * This is the same used to register the command with addCommand.
+		 * @returns {CKEDITOR.command} The command object identified by the
+		 * provided name.
+		 */
+		getCommand : function( commandName )
+		{
+			return this._.commands[ commandName ];
+		},
+
+		/**
+		 * Gets the editor data. The data will be in raw format. It is the same
+		 * data that is posted by the editor.
+		 * @type String
+		 * @returns (String) The editor data.
+		 * @example
+		 * if ( CKEDITOR.instances.editor1.<b>getData()</b> == '' )
+		 *     alert( 'There is no data available' );
+		 */
+		getData : function()
+		{
+			this.fire( 'beforeGetData' );
+
+			var eventData = this._.data;
+
+			if ( typeof eventData != 'string' )
+			{
+				var element = this.element;
+				if ( element && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE )
+					eventData = element.is( 'textarea' ) ? element.getValue() : element.getHtml();
+				else
+					eventData = '';
+			}
+
+			eventData = { dataValue : eventData };
+
+			// Fire "getData" so data manipulation may happen.
+			this.fire( 'getData', eventData );
+
+			return eventData.dataValue;
+		},
+
+		getSnapshot : function()
+		{
+			var data = this.fire( 'getSnapshot' );
+
+			if ( typeof data != 'string' )
+			{
+				var element = this.element;
+				if ( element && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE )
+					data = element.is( 'textarea' ) ? element.getValue() : element.getHtml();
+			}
+
+			return data;
+		},
+
+		/**
+		 * Sets the editor data. The data must be provided in raw format.
+		 * @param {String} data HTML code to replace the curent content in the editor.
+		 * @example
+		 * CKEDITOR.instances.editor1.<b>setData( '&lt;p&gt;This is the editor data.&lt;/p&gt;' )</b>;
+		 */
+		setData : function( data )
+		{
+			// Fire "setData" so data manipulation may happen.
+			var eventData = { dataValue : data };
+			this.fire( 'setData', eventData );
+
+			this._.data = eventData.dataValue;
+
+			this.fire( 'afterSetData', eventData );
+		},
+
+		/**
+		 * Inserts HTML into the currently selected position in the editor.
+		 * @param {String} data HTML code to be inserted into the editor.
+		 * @example
+		 * CKEDITOR.instances.editor1.<b>insertHtml( '&lt;p&gt;This is a new paragraph.&lt;/p&gt;' )</b>;
+		 */
+		insertHtml : function( data )
+		{
+			this.fire( 'insertHtml', data );
+		},
+
+		/**
+		 * Inserts an element into the currently selected position in the
+		 * editor.
+		 * @param {CKEDITOR.dom.element} element The element to be inserted
+		 *		into the editor.
+		 * @example
+		 * var element = CKEDITOR.dom.element.createFromHtml( '&lt;img src="hello.png" border="0" title="Hello" /&gt;' );
+		 * CKEDITOR.instances.editor1.<b>insertElement( element )</b>;
+		 */
+		insertElement : function( element )
+		{
+			this.fire( 'insertElement', element );
+		},
+
+		checkDirty : function()
+		{
+			return ( this.mayBeDirty && this._.previousValue !== this.getSnapshot() );
+		},
+
+		resetDirty : function()
+		{
+			if ( this.mayBeDirty )
+				this._.previousValue = this.getSnapshot();
+		},
+
+		/**
+		 * Updates the &lt;textarea&gt; element that has been replaced by the editor with
+		 * the current data available in the editor.
+		 * @example
+		 * CKEDITOR.instances.editor1.updateElement();
+		 * alert( document.getElementById( 'editor1' ).value );  // The current editor data.
+		 */
+		updateElement : function()
+		{
+			var element = this.element;
+			if ( element && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE )
+			{
+				if ( element.is( 'textarea' ) )
+					element.setValue( this.getData() );
+				else
+					element.setHtml( this.getData() );
+			}
+		}
+	});
+
+CKEDITOR.on( 'loaded', function()
+	{
+		// Run the full initialization for pending editors.
+		var pending = CKEDITOR.editor._pending;
+		if ( pending )
+		{
+			delete CKEDITOR.editor._pending;
+
+			for ( var i = 0 ; i < pending.length ; i++ )
+				pending[ i ]._init();
+		}
+	});
Index: /CKEditor/tags/3.0 Beta/_source/core/editor_basic.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/editor_basic.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/editor_basic.js	(revision 3046)
@@ -0,0 +1,178 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+if ( !CKEDITOR.editor )
+{
+	/**
+	 * No element is linked to the editor instance.
+	 * @constant
+	 * @example
+	 */
+	CKEDITOR.ELEMENT_MODE_NONE = 0;
+
+	/**
+	 * The element is to be replaced by the editor instance.
+	 * @constant
+	 * @example
+	 */
+	CKEDITOR.ELEMENT_MODE_REPLACE = 1;
+
+	/**
+	 * The editor is to be created inside the element.
+	 * @constant
+	 * @example
+	 */
+	CKEDITOR.ELEMENT_MODE_APPENDTO = 2;
+
+	/**
+	 * Represents an editor instance. This constructor should be rarely used,
+	 * being the {@link CKEDITOR} methods preferible.
+	 * @constructor
+	 * @param {Object} instanceConfig Configuration values for this specific
+	 *		instance.
+	 * @param {CKEDITOR.dom.element} [element] The element linked to this
+	 *		instance.
+	 * @param {Number} [mode] The mode in which the element is linked to this
+	 *		instance.
+	 * @augments CKEDITOR.event
+	 * @example
+	 */
+	CKEDITOR.editor = function( instanceConfig, element, mode )
+	{
+		this._ =
+		{
+			// Save the config to be processed later by the full core code.
+			instanceConfig : instanceConfig,
+			element : element
+		};
+
+		/**
+		 * The mode in which the {@link #element} is linked to this editor
+		 * instance. It can be any of the following values:
+		 * <ul>
+		 * <li><b>CKEDITOR.ELEMENT_MODE_NONE</b>: No element is linked to the
+		 *		editor instance.</li>
+		 * <li><b>CKEDITOR.ELEMENT_MODE_REPLACE</b>: The element is to be
+		 *		replaced by the editor instance.</li>
+		 * <li><b>CKEDITOR.ELEMENT_MODE_APPENDTO</b>: The editor is to be
+		 *		created inside the element.</li>
+		 * </ul>
+		 * @name CKEDITOR.editor.prototype.elementMode
+		 * @type Number
+		 * @example
+		 * var editor = CKEDITOR.replace( 'editor1' );
+		 * alert( <b>editor.elementMode</b> );  "1"
+		 */
+		this.elementMode = mode || CKEDITOR.ELEMENT_MODE_NONE;
+
+		// Call the CKEDITOR.event constructor to initialize this instance.
+		CKEDITOR.event.call( this );
+
+		this._init();
+	};
+
+	/**
+	 * Replaces a &lt;textarea&gt; or a DOM element (DIV) with a CKEditor
+	 * instance. For textareas, the initial value in the editor will be the
+	 * textarea value. For DOM elements, their innerHTML will be used
+	 * instead. We recommend using TEXTAREA and DIV elements only. Do not use
+	 * this function directly. Use {@link CKEDITOR.replace} instead.
+	 * @param {Object|String} elementOrIdOrName The DOM element (textarea), its
+	 *		ID or name.
+	 * @param {Object} [config] The specific configurations to apply to this
+	 *		editor instance. Configurations set here will override global CKEditor
+	 *		settings.
+	 * @returns {CKEDITOR.editor} The editor instance created.
+	 * @example
+	 */
+	CKEDITOR.editor.replace = function( elementOrIdOrName, config )
+	{
+		var element = elementOrIdOrName;
+
+		if ( typeof element != 'object' )
+		{
+			// Look for the element by id. We accept any kind of element here.
+			element = document.getElementById( elementOrIdOrName );
+
+			// If not found, look for elements by name. In this case we accept only
+			// textareas.
+			if ( !element )
+			{
+				var i = 0,
+					textareasByName	= document.getElementsByName( elementOrIdOrName );
+
+				while ( ( element = textareasByName[ i++ ] ) && element.tagName.toLowerCase() != 'textarea' )
+				{ /*jsl:pass*/ }
+			}
+
+			if ( !element )
+				throw '[CKEDITOR.editor.replace] The element with id or name "' + elementOrIdOrName + '" was not found.';
+		}
+
+		// Do not replace the textarea right now, just hide it. The effective
+		// replacement will be done by the _init function.
+		element.style.visibility = 'hidden';
+
+		// Create the editor instance.
+		return new CKEDITOR.editor( config, element, CKEDITOR.ELEMENT_MODE_REPLACE );
+	};
+
+	/**
+	 * Creates a new editor instance inside a specific DOM element. Do not use
+	 * this function directly. Use {@link CKEDITOR.appendTo} instead.
+	 * @param {Object|String} elementOrId The DOM element or its ID.
+	 * @param {Object} [config] The specific configurations to apply to this
+	 *		editor instance. Configurations set here will override global CKEditor
+	 *		settings.
+	 * @returns {CKEDITOR.editor} The editor instance created.
+	 * @example
+	 */
+	CKEDITOR.editor.appendTo = function( elementOrId, config )
+	{
+		if ( typeof elementOrId != 'object' )
+		{
+			elementOrId = document.getElementById( elementOrId );
+
+			if ( !elementOrId )
+				throw '[CKEDITOR.editor.appendTo] The element with id "' + elementOrId + '" was not found.';
+		}
+
+		// Create the editor instance.
+		return new CKEDITOR.editor( config, elementOrId, CKEDITOR.ELEMENT_MODE_APPENDTO );
+	};
+
+	CKEDITOR.editor.prototype =
+	{
+		/**
+		 * Initializes the editor instance. This function will be overriden by the
+		 * full CKEDITOR.editor implementation (editor.js).
+		 * @private
+		 */
+		_init : function()
+		{
+			var pending = CKEDITOR.editor._pending || ( CKEDITOR.editor._pending = [] );
+			pending.push( this );
+		},
+
+		// Both fire and fireOnce will always pass this editor instance as the
+		// "editor" param in CKEDITOR.event.fire. So, we override it to do that
+		// automaticaly.
+
+		/** @ignore */
+		fire : function( eventName, data )
+		{
+			return CKEDITOR.event.prototype.fire.call( this, eventName, data, this );
+		},
+
+		/** @ignore */
+		fireOnce : function( eventName, data )
+		{
+			return CKEDITOR.event.prototype.fireOnce.call( this, eventName, data, this );
+		}
+	};
+
+	// "Inherit" (copy actually) from CKEDITOR.event.
+	CKEDITOR.event.implementOn( CKEDITOR.editor.prototype );
+}
Index: /CKEditor/tags/3.0 Beta/_source/core/env.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/env.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/env.js	(revision 3046)
@@ -0,0 +1,161 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Defines the {@link CKEDITOR.env} object, which constains
+ *		environment and browser information.
+ */
+
+if ( !CKEDITOR.env )
+{
+	/**
+	 * Environment and browser information.
+	 * @namespace
+	 * @example
+	 */
+	CKEDITOR.env = (function()
+	{
+		var agent = navigator.userAgent.toLowerCase();
+		var opera = window.opera;
+
+		var env =
+		/** @lends CKEDITOR.env */
+		{
+			/**
+			 * Indicates that CKEditor is running on Internet Explorer.
+			 * @type Boolean
+			 * @example
+			 * if ( CKEDITOR.env.ie )
+			 *     alert( "I'm on IE!" );
+			 */
+			ie		: /*@cc_on!@*/false,
+			/**
+			 * Indicates that CKEditor is running on Opera.
+			 * @type Boolean
+			 * @example
+			 * if ( CKEDITOR.env.opera )
+			 *     alert( "I'm on Opera!" );
+			 */
+			opera	: ( !!opera && opera.version ),
+			/**
+			 * Indicates that CKEditor is running on a WebKit based browser, like
+			 * Safari.
+			 * @type Boolean
+			 * @example
+			 * if ( CKEDITOR.env.webkit )
+			 *     alert( "I'm on WebKit!" );
+			 */
+			webkit	: ( agent.indexOf( ' applewebkit/' ) > -1 ),
+			/**
+			 * Indicates that CKEditor is running on Adobe AIR.
+			 * @type Boolean
+			 * @example
+			 * if ( CKEDITOR.env.air )
+			 *     alert( "I'm on AIR!" );
+			 */
+			air		: ( agent.indexOf( ' adobeair/' ) > -1 ),
+			/**
+			 * Indicates that CKEditor is running on Macintosh.
+			 * @type Boolean
+			 * @example
+			 * if ( CKEDITOR.env.mac )
+			 *     alert( "I love apples!" );
+			 */
+			mac	: ( agent.indexOf( 'macintosh' ) > -1 )
+		};
+
+		/**
+		 * Indicates that CKEditor is running on a Gecko based browser, like
+		 * Firefox.
+		 * @name CKEDITOR.env.gecko
+		 * @type Boolean
+		 * @example
+		 * if ( CKEDITOR.env.gecko )
+		 *     alert( "I'm riding a gecko!" );
+		 */
+		env.gecko = ( navigator.product == 'Gecko' && !env.webkit && !env.opera );
+
+		var version = 0;
+
+		// Internet Explorer 6.0+
+		if ( env.ie )
+		{
+			version = parseFloat( agent.match( /msie (\d+)/ )[1] );
+
+			/**
+			 * Indicates that CKEditor is running on an IE6-like environment, which
+			 * includes IE6 itself and IE7 and IE8 quirks mode.
+			 * @type Boolean
+			 * @example
+			 * if ( CKEDITOR.env.ie6Compat )
+			 *     alert( "I'm on IE6 or quirks mode!" );
+			 */
+			env.ie6Compat = ( version < 7 || document.compatMode == 'BackCompat' );
+		}
+
+		// Gecko.
+		if ( env.gecko )
+		{
+			var geckoRelease = agent.match( /rv:([\d\.]+)/ );
+			if ( geckoRelease )
+			{
+				geckoRelease = geckoRelease[1].split( '.' );
+				version = geckoRelease[0] * 10000 + ( geckoRelease[1] || 0 ) * 100 + ( geckoRelease[2] || 0 );
+			}
+		}
+
+		// Opera 9.50+
+		if ( env.opera )
+			version = parseFloat( opera.version() );
+
+		// Adobe AIR 1.0+
+		// Checked before Safari because AIR have the WebKit rich text editor
+		// features from Safari 3.0.4, but the version reported is 420.
+		if ( env.air )
+			version = parseFloat( agent.match( / adobeair\/(\d+)/ )[1] );
+
+		// WebKit 522+ (Safari 3+)
+		if ( env.webkit )
+			version = parseFloat( agent.match( / applewebkit\/(\d+)/ )[1] );
+
+		/**
+		 * Contains the browser version.
+		 *
+		 * For gecko based browsers (like Firefox) it contains the revision
+		 * number with first three parts concatenated with a padding zero
+		 * (e.g. for revision 1.9.0.2 we have 10900).
+		 *
+		 * For webkit based browser (like Safari and Chrome) it contains the
+		 * WebKit build version (e.g. 522).
+		 * @name CKEDITOR.env.version
+		 * @type Boolean
+		 * @example
+		 * if ( CKEDITOR.env.ie && <b>CKEDITOR.env.version</b> <= 6 )
+		 *     alert( "Ouch!" );
+		 */
+		env.version = version;
+
+		/**
+		 * Indicates that CKEditor is running on a compatible browser.
+		 * @name CKEDITOR.env.isCompatible
+		 * @type Boolean
+		 * @example
+		 * if ( CKEDITOR.env.isCompatible )
+		 *     alert( "Your browser is pretty cool!" );
+		 */
+		env.isCompatible =
+			( env.ie && version >= 6 ) ||
+			( env.gecko && version >= 10801 ) ||
+			( env.opera && version >= 9.5 ) ||
+			( env.air && version >= 1 ) ||
+			( env.webkit && version >= 522 ) ||
+			false;
+
+		return env;
+	})();
+}
+
+// PACKAGER_RENAME( CKEDITOR.env )
+// PACKAGER_RENAME( CKEDITOR.env.ie )
Index: /CKEditor/tags/3.0 Beta/_source/core/event.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/event.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/event.js	(revision 3046)
@@ -0,0 +1,312 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Defines the {@link CKEDITOR.event} class, which serves as the
+ *		base for classes and objects that require event handling features.
+ */
+
+if ( !CKEDITOR.event )
+{
+	/**
+	 * This is a base class for classes and objects that require event handling
+	 * features.
+	 * @constructor
+	 * @example
+	 */
+	CKEDITOR.event = function()
+	{
+		( this._ || ( this._ = {} ) ).events = {};
+	};
+
+	/**
+	 * Implements the {@link CKEDITOR.event} features in an object.
+	 * @param {Object} targetObject The object in which implement the features.
+	 * @example
+	 * var myObject = { message : 'Example' };
+	 * <b>CKEDITOR.event.implementOn( myObject }</b>;
+	 * myObject.on( 'testEvent', function()
+	 *     {
+	 *         alert( this.message );  // "Example"
+	 *     });
+	 * myObject.fire( 'testEvent' );
+	 */
+	CKEDITOR.event.implementOn = function( targetObject )
+	{
+		CKEDITOR.event.call( targetObject );
+
+		for ( var prop in CKEDITOR.event.prototype )
+		{
+			if ( targetObject[ prop ] == undefined )
+				targetObject[ prop ] = CKEDITOR.event.prototype[ prop ];
+		}
+	};
+
+	CKEDITOR.event.prototype = (function()
+	{
+		var eventEntry = function( eventName )
+		{
+			this.name = eventName;
+			this.listeners = [];
+		};
+
+		eventEntry.prototype =
+		{
+			// Get the listener index for a specified function.
+			// Returns -1 if not found.
+			getListenerIndex : function( listenerFunction )
+			{
+				for ( var i = 0, listeners = this.listeners ; i < listeners.length ; i++ )
+				{
+					if ( listeners[i].fn == listenerFunction )
+						return i;
+				}
+				return -1;
+			}
+		};
+
+		return /** @lends CKEDITOR.event.prototype */ {
+			/**
+			 * Registers a listener to a specific event in the current object.
+			 * @param {String} eventName The event name to which listen.
+			 * @param {Function} listenerFunction The function listening to the
+			 *		event.
+			 * @param {Object} [scopeObj] The object used to scope the listener
+			 *		call (the this object. If omitted, the current object is used.
+			 * @param {Object} [listenerData] Data to be sent as the
+			 *		{@link CKEDITOR.eventInfo#listenerData} when calling the
+			 *		listener.
+			 * @param {Number} [priority] The listener priority. Lower priority
+			 *		listeners are called first. Listeners with the same priority
+			 *		value are called in registration order. Defaults to 10.
+			 * @example
+			 * someObject.on( 'someEvent', function()
+			 *     {
+			 *         alert( this == someObject );  // "true"
+			 *     });
+			 * @example
+			 * someObject.on( 'someEvent', function()
+			 *     {
+			 *         alert( this == anotherObject );  // "true"
+			 *     }
+			 *     , anotherObject );
+			 * @example
+			 * someObject.on( 'someEvent', function( event )
+			 *     {
+			 *         alert( event.listenerData );  // "Example"
+			 *     }
+			 *     , null, 'Example' );
+			 * @example
+			 * someObject.on( 'someEvent', function() { ... } );                   // 2nd called
+			 * someObject.on( 'someEvent', function() { ... }, null, null, 100 );  // 3rd called
+			 * someObject.on( 'someEvent', function() { ... }, null, null, 1 );    // 1st called
+			 */
+			on : function( eventName, listenerFunction, scopeObj, listenerData, priority )
+			{
+				// Get the event entry (create it if needed).
+				var event = this._.events[ eventName ] || ( this._.events[ eventName ] = new eventEntry( eventName ) );
+
+				if ( event.getListenerIndex( listenerFunction ) < 0 )
+				{
+					// Get the listeners.
+					var listeners = event.listeners;
+
+					// Fill the scope.
+					if ( !scopeObj )
+						scopeObj = this;
+
+					// Default the priority, if needed.
+					if ( isNaN( priority ) )
+						priority = 10;
+
+					// Create the function to be fired for this listener.
+					var listenerFirer = function( editor, publisherData, stopFn, cancelFn )
+					{
+						var ev =
+						{
+							name : eventName,
+							sender : this,
+							editor : editor,
+							data : publisherData,
+							listenerData : listenerData,
+							stop : stopFn,
+							cancel : cancelFn
+						};
+
+						listenerFunction.call( scopeObj, ev );
+
+						return ev.data;
+					};
+					listenerFirer.fn = listenerFunction;
+					listenerFirer.priority = priority;
+
+					// Search for the right position for this new listener, based on its
+					// priority.
+					for ( var i = listeners.length - 1 ; i >= 0 ; i-- )
+					{
+						// Find the item which should be before the new one.
+						if ( listeners[ i ].priority <= priority )
+						{
+							// Insert the listener in the array.
+							listeners.splice( i + 1, 0, listenerFirer );
+							return;
+						}
+					}
+
+					// If no position has been found (or zero length), put it in
+					// the front of list.
+					listeners.unshift( listenerFirer );
+				}
+			},
+
+			/**
+			 * Fires an specific event in the object. All registered listeners are
+			 * called at this point.
+			 * @function
+			 * @param {String} eventName The event name to fire.
+			 * @param {Object} [data] Data to be sent as the
+			 *		{@link CKEDITOR.eventInfo#data} when calling the
+			 *		listeners.
+			 * @param {CKEDITOR.editor} [editor] The editor instance to send as the
+			 *		{@link CKEDITOR.eventInfo#editor} when calling the
+			 *		listener.
+			 * @returns {Boolean|Object} A booloan indicating that the event is to be
+			 *		canceled, or data returned by one of the listeners.
+			 * @example
+			 * someObject.on( 'someEvent', function() { ... } );
+			 * someObject.on( 'someEvent', function() { ... } );
+			 * <b>someObject.fire( 'someEvent' )</b>;  // both listeners are called
+			 * @example
+			 * someObject.on( 'someEvent', function( event )
+			 *     {
+			 *         alert( event.data );  // "Example"
+			 *     });
+			 * <b>someObject.fire( 'someEvent', 'Example' )</b>;
+			 */
+			fire : (function()
+			{
+				// Create the function that marks the event as stopped.
+				var stopped = false;
+				var stopEvent = function()
+				{
+					stopped = true;
+				};
+
+				// Create the function that marks the event as canceled.
+				var canceled = false;
+				var cancelEvent = function()
+				{
+					canceled = true;
+				};
+
+				return function( eventName, data, editor )
+				{
+					// Get the event entry.
+					var event = this._.events[ eventName ];
+
+					// Save the previous stopped and cancelled states. We may
+					// be nesting fire() calls.
+					var previousStopped = stopped,
+						previousCancelled = canceled;
+
+					// Reset the stopped and canceled flags.
+					stopped = canceled = false;
+
+					if ( event )
+					{
+						// Loop through all listeners.
+						for ( var i = 0, listeners = event.listeners ; i < listeners.length ; i++ )
+						{
+							// Call the listener, passing the event data.
+							var retData = listeners[i].call( this, editor, data, stopEvent, cancelEvent );
+
+							if ( typeof retData != 'undefined' )
+								data = retData;
+
+							// No further calls is stopped or canceled.
+							if ( stopped || canceled )
+								break;
+						}
+					}
+
+					var ret = canceled || ( typeof data == 'undefined' ? false : data );
+
+					// Restore the previous stopped and canceled states.
+					stopped = previousStopped;
+					canceled = previousCancelled;
+
+					return ret;
+				};
+			})(),
+
+			/**
+			 * Fires an specific event in the object, releasing all listeners
+			 * registered to that event. The same listeners are not called again on
+			 * successive calls of it or of {@link #fire}.
+			 * @param {String} eventName The event name to fire.
+			 * @param {Object} [data] Data to be sent as the
+			 *		{@link CKEDITOR.eventInfo#data} when calling the
+			 *		listeners.
+			 * @param {CKEDITOR.editor} [editor] The editor instance to send as the
+			 *		{@link CKEDITOR.eventInfo#editor} when calling the
+			 *		listener.
+			 * @returns {Boolean|Object} A booloan indicating that the event is to be
+			 *		canceled, or data returned by one of the listeners.
+			 * @example
+			 * someObject.on( 'someEvent', function() { ... } );
+			 * someObject.fire( 'someEvent' );  // above listener called
+			 * <b>someObject.fireOnce( 'someEvent' )</b>;  // above listener called
+			 * someObject.fire( 'someEvent' );  // no listeners called
+			 */
+			fireOnce : function( eventName, data, editor )
+			{
+				var ret = this.fire( eventName, data, editor );
+				delete this._.events[ eventName ];
+				return ret;
+			},
+
+			/**
+			 * Unregisters a listener function from being called at the specified
+			 *		event. No errors are thrown if the listener has not been
+			 *		registered previously.
+			 * @param {String} eventName The event name.
+			 * @param {Function} listenerFunction The listener function to unregister.
+			 * @example
+			 * var myListener = function() { ... };
+			 * someObject.on( 'someEvent', myListener );
+			 * someObject.fire( 'someEvent' );  // myListener called
+			 * <b>someObject.removeListener( 'someEvent', myListener )</b>;
+			 * someObject.fire( 'someEvent' );  // myListener not called
+			 */
+			removeListener : function( eventName, listenerFunction )
+			{
+				// Get the event entry.
+				var event = this._.events[ eventName ];
+
+				if ( event )
+				{
+					var index = event.getListenerIndex( listenerFunction );
+					if ( index >= 0 )
+						event.listeners.splice( index, 1 );
+				}
+			},
+
+			/**
+			 * Checks if there is any listener registered to a given event.
+			 * @param {String} eventName The event name.
+			 * @example
+			 * var myListener = function() { ... };
+			 * someObject.on( 'someEvent', myListener );
+			 * alert( someObject.<b>hasListeners( 'someEvent' )</b> );  // "true"
+			 * alert( someObject.<b>hasListeners( 'noEvent' )</b> );    // "false"
+			 */
+			hasListeners : function( eventName )
+			{
+				var event = this._.events[ eventName ];
+				return ( event && event.listeners.length > 0 ) ;
+			}
+		};
+	})();
+}
Index: /CKEditor/tags/3.0 Beta/_source/core/eventInfo.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/eventInfo.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/eventInfo.js	(revision 3046)
@@ -0,0 +1,120 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Defines the "virtual" {@link CKEDITOR.eventInfo} class, which
+ *		contains the defintions of the event object passed to event listeners.
+ *		This file is for documentation purposes only.
+ */
+
+/**
+ * This class is not really part of the API. It just illustrates the features
+ * of the event object passed to event listeners by a {@link CKEDITOR.event}
+ * based object.
+ * @name CKEDITOR.eventInfo
+ * @constructor
+ * @example
+ * // Do not do this.
+ * var myEvent = new CKEDITOR.eventInfo();  // Error: CKEDITOR.eventInfo is undefined
+ */
+
+/**
+ * The event name.
+ * @name CKEDITOR.eventInfo.prototype.name
+ * @field
+ * @type String
+ * @example
+ * someObject.on( 'someEvent', function( event )
+ *     {
+ *         alert( <b>event.name</b> );  // "someEvent"
+ *     });
+ * someObject.fire( 'someEvent' );
+ */
+
+/**
+ * The object that publishes (sends) the event.
+ * @name CKEDITOR.eventInfo.prototype.sender
+ * @field
+ * @type Object
+ * @example
+ * someObject.on( 'someEvent', function( event )
+ *     {
+ *         alert( <b>event.sender</b> == someObject );  // "true"
+ *     });
+ * someObject.fire( 'someEvent' );
+ */
+
+/**
+ * The editor instance that holds the sender. May be the same as sender. May be
+ * null if the sender is not part of an editor instance, like a component
+ * running in standalone mode.
+ * @name CKEDITOR.eventInfo.prototype.editor
+ * @field
+ * @type CKEDITOR.editor
+ * @example
+ * myButton.on( 'someEvent', function( event )
+ *     {
+ *         alert( <b>event.editor</b> == myEditor );  // "true"
+ *     });
+ * myButton.fire( 'someEvent', null, <b>myEditor</b> );
+ */
+
+/**
+ * Any kind of additional data. Its format and usage is event dependent.
+ * @name CKEDITOR.eventInfo.prototype.data
+ * @field
+ * @type Object
+ * @example
+ * someObject.on( 'someEvent', function( event )
+ *     {
+ *         alert( <b>event.data</b> );  // "Example"
+ *     });
+ * someObject.fire( 'someEvent', <b>'Example'</b> );
+ */
+
+/**
+ * Any extra data appended during the listener registration.
+ * @name CKEDITOR.eventInfo.prototype.listenerData
+ * @field
+ * @type Object
+ * @example
+ * someObject.on( 'someEvent', function( event )
+ *     {
+ *         alert( <b>event.listenerData</b> );  // "Example"
+ *     }
+ *     , null, <b>'Example'</b> );
+ */
+
+/**
+ * Indicates that no further listeners are to be called.
+ * @name CKEDITOR.eventInfo.prototype.stop
+ * @function
+ * @example
+ * someObject.on( 'someEvent', function( event )
+ *     {
+ *         <b>event.stop()</b>;
+ *     });
+ * someObject.on( 'someEvent', function( event )
+ *     {
+ *         // This one will not be called.
+ *     });
+ * alert( someObject.fire( 'someEvent' ) );  // "false"
+ */
+
+/**
+ * Indicates that the event is to be cancelled (if cancelable).
+ * @name CKEDITOR.eventInfo.prototype.cancel
+ * @function
+ * @example
+ * someObject.on( 'someEvent', function( event )
+ *     {
+ *         <b>event.cancel()</b>;
+ *     });
+ * someObject.on( 'someEvent', function( event )
+ *     {
+ *         // This one will not be called.
+ *     });
+ * alert( someObject.fire( 'someEvent' ) );  // "true"
+ */
Index: /CKEditor/tags/3.0 Beta/_source/core/focusmanager.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/focusmanager.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/focusmanager.js	(revision 3046)
@@ -0,0 +1,115 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Defines the {@link CKEDITOR.focusManager} class, which is used
+ *		to handle the focus on editor instances..
+ */
+
+/**
+ * Manages the focus activity in an editor instance. This class is to be used
+ * mainly by UI elements coders when adding interface elements to CKEditor.
+ * @constructor
+ * @param {CKEDITOR.editor} editor The editor instance.
+ * @example
+ */
+CKEDITOR.focusManager = function( editor )
+{
+	if ( editor.focusManager )
+		return editor.focusManager;
+
+	/**
+	 * Indicates that the editor instance has focus.
+	 * @type Boolean
+	 * @example
+	 * alert( CKEDITOR.instances.editor1.focusManager.hasFocus );  // e.g "true"
+	 */
+	this.hasFocus = false;
+
+	/**
+	 * Object used to hold private stuff.
+	 * @private
+	 */
+	this._ =
+	{
+		editor : editor
+	};
+
+	return this;
+};
+
+CKEDITOR.focusManager.prototype =
+{
+	/**
+	 * Indicates that the editor instance has the focus.
+	 *
+	 * This function is not used to set the focus in the editor. Use
+	 * {@link CKEDITOR.editor#focus} for it instead.
+	 * @example
+	 * var editor = CKEDITOR.instances.editor1;
+	 * <b>editor.focusManager.focus()</b>;
+	 */
+	focus : function()
+	{
+		if ( this._.timer )
+			clearTimeout( this._.timer );
+
+		if ( !this.hasFocus )
+		{
+			// If another editor has the current focus, we first "blur" it. In
+			// this way the events happen in a more logical sequence, like:
+			//		"focus 1" > "blur 1" > "focus 2"
+			// ... instead of:
+			//		"focus 1" > "focus 2" > "blur 1"
+			if ( CKEDITOR.currentInstance )
+				CKEDITOR.currentInstance.focusManager.forceBlur();
+
+			this.hasFocus = true;
+			this._.editor.fire( 'focus' );
+		}
+	},
+
+	/**
+	 * Indicates that the editor instance has lost the focus. Note that this
+	 * functions acts asynchronously with a delay of 100ms to avoid subsequent
+	 * blur/focus effects. If you want the "blur" to happen immediately, use
+	 * the {@link #forceBlur} function instead.
+	 * @example
+	 * var editor = CKEDITOR.instances.editor1;
+	 * <b>editor.focusManager.blur()</b>;
+	 */
+	blur : function()
+	{
+		var focusManager = this;
+
+		if ( focusManager._.timer )
+			clearTimeout( focusManager._.timer );
+
+		focusManager._.timer = setTimeout(
+			function()
+			{
+				delete focusManager._.timer;
+				focusManager.forceBlur();
+			}
+			, 100 );
+	},
+
+	/**
+	 * Indicates that the editor instance has lost the focus. Unlike
+	 * {@link #blur}, this function is synchronous, marking the instance as
+	 * "blured" immediately.
+	 * @example
+	 * var editor = CKEDITOR.instances.editor1;
+	 * <b>editor.focusManager.forceBlur()</b>;
+	 */
+	forceBlur : function()
+	{
+		if ( this.hasFocus )
+		{
+			this.hasFocus = false;
+			this._.editor.fire( 'blur' );
+		}
+	}
+};
Index: /CKEditor/tags/3.0 Beta/_source/core/htmlparser.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/htmlparser.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/htmlparser.js	(revision 3046)
@@ -0,0 +1,165 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * HTML text parser.
+ * @constructor
+ * @example
+ */
+CKEDITOR.htmlParser = function()
+{
+	this._ =
+	{
+		htmlPartsRegex : new RegExp( '<(?:(?:\\/([^>]+)>)|(?:!--([\\S|\\s]*?)-->)|(?:([^\\s>]+)\\s*((?:(?:[^"\'>]+)|(?:"[^"]*")|(?:\'[^\']*\'))*)\\/?>))', 'g' )
+	};
+};
+
+(function()
+{
+	var attribsRegex	= /([\w:]+)\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+))?/g,
+		emptyAttribs	= {checked:1,compact:1,declare:1,defer:1,disabled:1,ismap:1,multiple:1,nohref:1,noresize:1,noshade:1,nowrap:1,readonly:1,selected:1};
+
+	CKEDITOR.htmlParser.prototype =
+	{
+		/**
+		 * Function to be fired when a tag opener is found. This function
+		 * should be overriden when using this class.
+		 * @param {String} tagName The tag name. The name is guarantted to be
+		 *		lowercased.
+		 * @param {Object} attributes An object containing all tag attributes. Each
+		 *		property in this object represent and attribute name and its
+		 *		value is the attribute value.
+		 * @param {Boolean} selfClosing true if the tag closes itself, false if the
+		 * 		tag doesn't.
+		 * @example
+		 * var parser = new CKEDITOR.htmlParser();
+		 * parser.onTagOpen = function( tagName, attributes, selfClosing )
+		 *     {
+		 *         alert( tagName );  // e.g. "b"
+		 *     });
+		 * parser.parse( "&lt;!-- Example --&gt;&lt;b&gt;Hello&lt;/b&gt;" );
+		 */
+		onTagOpen	: function() {},
+
+		/**
+		 * Function to be fired when a tag closer is found. This function
+		 * should be overriden when using this class.
+		 * @param {String} tagName The tag name. The name is guarantted to be
+		 *		lowercased.
+		 * @example
+		 * var parser = new CKEDITOR.htmlParser();
+		 * parser.onTagClose = function( tagName )
+		 *     {
+		 *         alert( tagName );  // e.g. "b"
+		 *     });
+		 * parser.parse( "&lt;!-- Example --&gt;&lt;b&gt;Hello&lt;/b&gt;" );
+		 */
+		onTagClose	: function() {},
+
+		/**
+		 * Function to be fired when text is found. This function
+		 * should be overriden when using this class.
+		 * @param {String} text The text found.
+		 * @example
+		 * var parser = new CKEDITOR.htmlParser();
+		 * parser.onText = function( text )
+		 *     {
+		 *         alert( text );  // e.g. "Hello"
+		 *     });
+		 * parser.parse( "&lt;!-- Example --&gt;&lt;b&gt;Hello&lt;/b&gt;" );
+		 */
+		onText		: function() {},
+
+		/**
+		 * Function to be fired when a commend is found. This function
+		 * should be overriden when using this class.
+		 * @param {String} comment The comment text.
+		 * @example
+		 * var parser = new CKEDITOR.htmlParser();
+		 * parser.onText = function( comment )
+		 *     {
+		 *         alert( comment );  // e.g. " Example "
+		 *     });
+		 * parser.parse( "&lt;!-- Example --&gt;&lt;b&gt;Hello&lt;/b&gt;" );
+		 */
+		onComment	: function() {},
+
+		/**
+		 * Parses text, looking for HTML tokens, like tag openers or closers,
+		 * or comments. This function fires the onTagOpen, onTagClose, onText
+		 * and onComment function during its execution.
+		 * @param {String} html The HTML to be parsed.
+		 * @example
+		 * var parser = new CKEDITOR.htmlParser();
+		 * // The onTagOpen, onTagClose, onText and onComment should be overriden
+		 * // at this point.
+		 * parser.parse( "&lt;!-- Example --&gt;&lt;b&gt;Hello&lt;/b&gt;" );
+		 */
+		parse : function( html )
+		{
+			var parts,
+				tagName,
+				nextIndex = 0;
+
+			while ( ( parts = this._.htmlPartsRegex.exec( html ) ) )
+			{
+				var tagIndex = parts.index;
+				if ( tagIndex > nextIndex )
+					this.onText( html.substring( nextIndex, tagIndex ) );
+
+				nextIndex = this._.htmlPartsRegex.lastIndex;
+
+				/*
+				 "parts" is an array with the following items:
+					0 : The entire match (not used)
+					1 : Group filled with the tag name for closing tags.
+					2 : Group filled with the comment text.
+					3 : Group filled with the tag name for opening tags.
+					4 : Group filled with the attributes part of opening tags.
+				 */
+
+				// Closing tag
+				if ( ( tagName = parts[ 1 ] ) )
+				{
+					this.onTagClose( tagName.toLowerCase() );
+					continue;
+				}
+
+				// Opening tag
+				if ( ( tagName = parts[ 3 ] ) )
+				{
+					var attribs = {},
+						attribMatch,
+						attribsPart = parts[ 4 ],
+						selfClosing = !!( attribsPart && attribsPart.charAt( attribsPart.length - 1 ) == '/' );
+
+					if ( attribsPart )
+					{
+						while ( ( attribMatch = attribsRegex.exec( attribsPart ) ) )
+						{
+							var attName = attribMatch[1].toLowerCase(),
+								attValue = attribMatch[2] || attribMatch[3] || attribMatch[4] || '';
+
+							if ( !attValue && emptyAttribs[ attName ] )
+								attribs[ attName ] = attName;
+							else
+								attribs[ attName ] = attValue;
+						}
+					}
+
+					this.onTagOpen( tagName.toLowerCase(), attribs, selfClosing );
+					continue;
+				}
+
+				// Comment
+				if( ( tagName = parts[ 2 ] ) )
+					this.onComment( tagName );
+			}
+
+			if ( html.length > nextIndex )
+				this.onText( html.substring( nextIndex, html.length ) );
+		}
+	};
+})();
Index: /CKEditor/tags/3.0 Beta/_source/core/htmlparser/comment.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/htmlparser/comment.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/htmlparser/comment.js	(revision 3046)
@@ -0,0 +1,45 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * A lightweight representation of an HTML comment.
+ * @constructor
+ * @example
+ */
+CKEDITOR.htmlParser.comment = function( value )
+{
+	/**
+	 * The comment text.
+	 * @type String
+	 * @example
+	 */
+	this.value = value;
+
+	/** @private */
+	this._ =
+	{
+		isBlockLike : false
+	};
+};
+
+CKEDITOR.htmlParser.comment.prototype =
+{
+	/**
+	 * The node type. This is a constant value set to {@link CKEDITOR.NODE_COMMENT}.
+	 * @type Number
+	 * @example
+	 */
+	type : CKEDITOR.NODE_COMMENT,
+
+	/**
+	 * Writes the HTML representation of this comment to a CKEDITOR.htmlWriter.
+	 * @param {CKEDITOR.htmlWriter} writer The writer to which write the HTML.
+	 * @example
+	 */
+	writeHtml : function( writer )
+	{
+		writer.comment( this.value );
+	}
+};
Index: /CKEditor/tags/3.0 Beta/_source/core/htmlparser/element.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/htmlparser/element.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/htmlparser/element.js	(revision 3046)
@@ -0,0 +1,134 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * A lightweight representation of an HTML element.
+ * @param {String} name The element name.
+ * @param {Object} attributes And object holding all attributes defined for
+ *		this element.
+ * @constructor
+ * @example
+ */
+CKEDITOR.htmlParser.element = function( name, attributes )
+{
+	/**
+	 * The element name.
+	 * @type String
+	 * @example
+	 */
+	this.name = name;
+
+	/**
+	 * Holds the attributes defined for this element.
+	 * @type Object
+	 * @example
+	 */
+	this.attributes = attributes;
+
+	/**
+	 * The nodes that are direct children of this element.
+	 * @type Array
+	 * @example
+	 */
+	this.children = [];
+
+	var dtd			= CKEDITOR.dtd,
+		isBlockLike	= !!( dtd.$block[ name ] || dtd.$listItem[ name ] || dtd.$tableContent[ name ] ),
+		isEmpty		= !!dtd.$empty[ name ];
+
+	this.isEmpty	= isEmpty;
+	this.isUnknown	= !dtd[ name ];
+
+	/** @private */
+	this._ =
+	{
+		isBlockLike : isBlockLike,
+		hasInlineStarted : isEmpty || !isBlockLike
+	};
+};
+
+(function()
+{
+	// Used to sort attribute entries in an array, where the first element of
+	// each object is the attribute name.
+	var sortAttribs = function( a, b )
+	{
+		a = a[0];
+		b = b[0];
+		return a < b ? -1 : a > b ? 1 : 0;
+	};
+
+	CKEDITOR.htmlParser.element.prototype =
+	{
+		/**
+		 * The node type. This is a constant value set to {@link CKEDITOR.NODE_ELEMENT}.
+		 * @type Number
+		 * @example
+		 */
+		type : CKEDITOR.NODE_ELEMENT,
+
+		/**
+		 * Adds a node to the element children list.
+		 * @param {Object} node The node to be added. It can be any of of the
+		 *		following types: {@link CKEDITOR.htmlParser.element},
+		 *		{@link CKEDITOR.htmlParser.text} and
+		 *		{@link CKEDITOR.htmlParser.comment}.
+		 * @function
+		 * @example
+		 */
+		add : CKEDITOR.htmlParser.fragment.prototype.add,
+
+		/**
+		 * Clone this element.
+		 * @returns {CKEDITOR.htmlParser.element} The element clone.
+		 * @example
+		 */
+		clone : function()
+		{
+			return new CKEDITOR.htmlParser.element( this.name, this.attributes );
+		},
+
+		/**
+		 * Writes the element HTML to a CKEDITOR.htmlWriter.
+		 * @param {CKEDITOR.htmlWriter} writer The writer to which write the HTML.
+		 * @example
+		 */
+		writeHtml : function( writer )
+		{
+			// Open element tag.
+			writer.openTag( this.name, this.attributes );
+
+			// Copy all attributes to an array.
+			var attribsArray = [];
+			for ( var a in this.attributes )
+				attribsArray.push( [ a, this.attributes[ a ] ] );
+
+			// Sort the attributes by name.
+			attribsArray.sort( sortAttribs );
+
+			// Send the attributes.
+			for ( var i = 0, len = attribsArray.length ; i < len ; i++ )
+			{
+				var attrib = attribsArray[ i ];
+				// IE's treated expand fields as dom attributes, skip it
+				if ( CKEDITOR.env.ie && attrib === '_cke_expando' )
+					continue;
+				writer.attribute( attrib[0], attrib[1] );
+			}
+
+			// Close the tag.
+			writer.openTagClose( this.name, this.isEmpty );
+
+			if ( !this.isEmpty )
+			{
+				// Send children.
+				CKEDITOR.htmlParser.fragment.prototype.writeHtml.apply( this, arguments );
+
+				// Close the element.
+				writer.closeTag( this.name );
+			}
+		}
+	};
+})();
Index: /CKEditor/tags/3.0 Beta/_source/core/htmlparser/fragment.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/htmlparser/fragment.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/htmlparser/fragment.js	(revision 3046)
@@ -0,0 +1,283 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * A lightweight representation of an HTML DOM structure.
+ * @constructor
+ * @example
+ */
+CKEDITOR.htmlParser.fragment = function()
+{
+	/**
+	 * The nodes contained in the root of this fragment.
+	 * @type Array
+	 * @example
+	 * var fragment = CKEDITOR.htmlParser.fragment.fromHtml( '<b>Sample</b> Text' );
+	 * alert( fragment.children.length );  "2"
+	 */
+	this.children = [];
+
+	/**
+	 * Get the fragment parent. Should always be null.
+	 * @type Object
+	 * @default null
+	 * @example
+	 */
+	this.parent = null;
+
+	/** @private */
+	this._ =
+	{
+		isBlockLike : true,
+		hasInlineStarted : false
+	};
+};
+
+(function()
+{
+	// Elements which the end tag is marked as optional in the HTML 4.01 DTD
+	// (expect empty elements).
+	var optionalClose = {colgroup:1,dd:1,dt:1,li:1,option:1,p:1,td:1,tfoot:1,th:1,thead:1,tr:1};
+
+	/**
+	 * Creates a {@link CKEDITOR.htmlParser.fragment} from an HTML string.
+	 * @param {String} fragmentHtml The HTML to be parsed, filling the fragment.
+	 * @returns CKEDITOR.htmlParser.fragment The fragment created.
+	 * @example
+	 * var fragment = CKEDITOR.htmlParser.fragment.fromHtml( '<b>Sample</b> Text' );
+	 * alert( fragment.children[0].name );  "b"
+	 * alert( fragment.children[1].value );  " Text"
+	 */
+	CKEDITOR.htmlParser.fragment.fromHtml = function( fragmentHtml )
+	{
+		var parser = new CKEDITOR.htmlParser(),
+			html = [],
+			fragment = new CKEDITOR.htmlParser.fragment(),
+			pendingInline = [],
+			currentNode = fragment;
+
+		var checkPending = function( newTagName )
+		{
+			if ( pendingInline.length > 0 )
+			{
+				for ( var i = 0 ; i < pendingInline.length ; i++ )
+				{
+					var pendingElement = pendingInline[ i ],
+						pendingName = pendingElement.name,
+						pendingDtd = CKEDITOR.dtd[ pendingName ],
+						currentDtd = currentNode.name && CKEDITOR.dtd[ currentNode.name ];
+
+					if ( ( !currentDtd || currentDtd[ pendingName ] ) && ( !newTagName || !pendingDtd || pendingDtd[ newTagName ] || !CKEDITOR.dtd[ newTagName ] ) )
+					{
+						// Get a clone for the pending element.
+						pendingElement = pendingElement.clone();
+
+						// Add it to the current node and make it the current,
+						// so the new element will be added inside of it.
+						currentNode.add( pendingElement );
+						currentNode = pendingElement;
+
+						// Remove the pending element (back the index by one
+						// to properly process the next entry).
+						pendingInline.splice( i, 1 );
+						i--;
+					}
+				}
+			}
+		};
+
+		parser.onTagOpen = function( tagName, attributes, selfClosing )
+		{
+			var element = new CKEDITOR.htmlParser.element( tagName, attributes );
+
+			// "isEmpty" will be always "false" for unknown elements, so we
+			// must force it if the parser has identified it as a selfClosing tag.
+			if ( element.isUnknown && selfClosing )
+				element.isEmpty = true;
+
+			// This is a tag to be removed if empty, so do not add it immediately.
+			if ( CKEDITOR.dtd.$removeEmpty[ tagName ] )
+			{
+				pendingInline.push( element );
+				return;
+			}
+
+			var currentName = currentNode.name,
+				currentDtd = ( currentName && CKEDITOR.dtd[ currentName ] ) || ( currentNode._.isBlockLike ? CKEDITOR.dtd.div : CKEDITOR.dtd.span );
+
+			// If the element cannot be child of the current element.
+			if ( !element.isUnknown && !currentNode.isUnknown && !currentDtd[ tagName ] )
+			{
+				// If this is the fragment node, just ignore this tag and add
+				// its children.
+				if ( !currentName )
+					return;
+
+				var reApply = false;
+
+				// If the element name is the same as the current element name,
+				// then just close the current one and append the new one to the
+				// parent. This situation usually happens with <p>, <li>, <dt> and
+				// <dd>, specially in IE.
+				if ( tagName != currentName )
+				{
+					// If it is optional to close the current element, then
+					// close it at this point and simply add the new
+					// element after it.
+					if ( !optionalClose[ currentName ] )
+					{
+						// The current element is an inline element, which
+						// cannot hold the new one. Put it in the pending list,
+						// and try adding the new one after it.
+						pendingInline.unshift( currentNode );
+					}
+
+					reApply = true;
+				}
+
+				// In any of the above cases, we'll be adding, or trying to
+				// add it to the parent.
+				currentNode = currentNode.parent;
+
+				if ( reApply )
+				{
+					parser.onTagOpen.apply( this, arguments );
+					return;
+				}
+			}
+
+			checkPending( tagName );
+
+			currentNode.add( element );
+
+			if ( !element.isEmpty )
+				currentNode = element;
+		};
+
+		parser.onTagClose = function( tagName )
+		{
+			var closingElement = currentNode,
+				index = 0;
+
+			while ( closingElement && closingElement.name != tagName )
+			{
+				// If this is an inline element, add it to the pending list, so
+				// it will continue after the closing tag.
+				if ( !closingElement._.isBlockLike )
+				{
+					pendingInline.unshift( closingElement );
+
+					// Increase the index, so it will not get checked again in
+					// the pending list check that follows.
+					index++;
+				}
+
+				closingElement = closingElement.parent;
+			}
+
+			if ( closingElement )
+				currentNode = closingElement.parent;
+			else if ( pendingInline.length > index )
+			{
+				// If we didn't find any parent to be closed, let's check the
+				// pending list.
+				for ( ; index < pendingInline.length ; index++ )
+				{
+					// If found, just remove it from the list.
+					if ( tagName == pendingInline[ index ].name )
+					{
+						pendingInline.splice( index, 1 );
+
+						// Decrease the index so we continue from the next one.
+						index--;
+					}
+				}
+			}
+		};
+
+		parser.onText = function( text )
+		{
+			if ( !currentNode._.hasInlineStarted )
+			{
+				text = CKEDITOR.tools.ltrim( text );
+
+				if ( text.length === 0 )
+					return;
+			}
+
+			checkPending();
+			currentNode.add( new CKEDITOR.htmlParser.text( text ) );
+		};
+
+		parser.onComment = function( comment )
+		{
+			currentNode.add( new CKEDITOR.htmlParser.comment( comment ) );
+		};
+
+		parser.parse( fragmentHtml );
+
+		return fragment;
+	};
+
+	CKEDITOR.htmlParser.fragment.prototype =
+	{
+		/**
+		 * Adds a node to this fragment.
+		 * @param {Object} node The node to be added. It can be any of of the
+		 *		following types: {@link CKEDITOR.htmlParser.element},
+		 *		{@link CKEDITOR.htmlParser.text} and
+		 *		{@link CKEDITOR.htmlParser.comment}.
+		 * @example
+		 */
+		add : function( node )
+		{
+			var len = this.children.length,
+				previous = len > 0 && this.children[ len - 1 ] || null;
+
+			if ( previous )
+			{
+				// If the block to be appended is following text, trim spaces at
+				// the right of it.
+				if ( node._.isBlockLike && previous.type == CKEDITOR.NODE_TEXT )
+				{
+					previous.value = CKEDITOR.tools.rtrim( previous.value );
+
+					// If we have completely cleared the previous node.
+					if ( previous.value.length === 0 )
+					{
+						// Remove it from the list and add the node again.
+						this.children.pop();
+						this.add( node );
+						return;
+					}
+				}
+
+				previous.next = node;
+			}
+
+			node.previous = previous;
+			node.parent = this;
+
+			this.children.push( node );
+
+			this._.hasInlineStarted = node.type == CKEDITOR.NODE_TEXT || ( node.type == CKEDITOR.NODE_ELEMENT && !node._.isBlockLike );
+		},
+
+		/**
+		 * Writes the fragment HTML to a CKEDITOR.htmlWriter.
+		 * @param {CKEDITOR.htmlWriter} writer The writer to which write the HTML.
+		 * @example
+		 * var writer = new CKEDITOR.htmlWriter();
+		 * var fragment = CKEDITOR.htmlParser.fragment.fromHtml( '&lt;P&gt;&lt;B&gt;Example' );
+		 * fragment.writeHtml( writer )
+		 * alert( writer.getHtml() );  "&lt;p&gt;&lt;b&gt;Example&lt;/b&gt;&lt;/p&gt;"
+		 */
+		writeHtml : function( writer )
+		{
+			for ( var i = 0, len = this.children.length ; i < len ; i++ )
+				this.children[i].writeHtml( writer );
+		}
+	};
+})();
Index: /CKEditor/tags/3.0 Beta/_source/core/htmlparser/text.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/htmlparser/text.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/htmlparser/text.js	(revision 3046)
@@ -0,0 +1,50 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+(function()
+{
+	var spacesRegex = /[\t\r\n ]{2,}|[\t\r\n]/g;
+
+	/**
+	 * A lightweight representation of HTML text.
+	 * @constructor
+	 * @example
+	 */
+ 	CKEDITOR.htmlParser.text = function( value )
+	{
+		/**
+		 * The text value.
+		 * @type String
+		 * @example
+		 */
+		this.value = value.replace( spacesRegex, ' ' );
+
+		/** @private */
+		this._ =
+		{
+			isBlockLike : false
+		};
+	};
+
+	CKEDITOR.htmlParser.text.prototype =
+	{
+		/**
+		 * The node type. This is a constant value set to {@link CKEDITOR.NODE_TEXT}.
+		 * @type Number
+		 * @example
+		 */
+		type : CKEDITOR.NODE_TEXT,
+
+		/**
+		 * Writes the HTML representation of this text to a CKEDITOR.htmlWriter.
+		 * @param {CKEDITOR.htmlWriter} writer The writer to which write the HTML.
+		 * @example
+		 */
+		writeHtml : function( writer )
+		{
+			writer.text( this.value );
+		}
+	};
+})();
Index: /CKEditor/tags/3.0 Beta/_source/core/imagecacher.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/imagecacher.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/imagecacher.js	(revision 3046)
@@ -0,0 +1,58 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+(function()
+{
+	var loaded = {};
+
+	var loadImage = function( image, callback )
+	{
+		var doCallback = function()
+			{
+				loaded[ image ] = 1;
+				callback();
+			};
+
+		var img = new CKEDITOR.dom.element( 'img' );
+		img.on( 'load', doCallback );
+		img.on( 'error', doCallback );
+		img.setAttribute( 'src', image );
+	};
+
+	/**
+	 * Load images into the browser cache.
+	 * @namespace
+	 * @example
+	 */
+ 	CKEDITOR.imageCacher =
+	{
+		/**
+		 * Loads one or more images.
+		 * @param {Array} images The URLs for the images to be loaded.
+		 * @param {Function} callback The function to be called once all images
+		 *		are loaded.
+		 */
+		load : function( images, callback )
+		{
+			var pendingCount = images.length;
+
+			var checkPending = function()
+			{
+				if ( --pendingCount === 0 )
+					callback();
+			};
+
+			for ( var i = 0 ; i < images.length ; i++ )
+			{
+				var image = images[ i ];
+
+				if ( loaded[ image ] )
+					checkPending();
+				else
+					loadImage( image, checkPending );
+			}
+		}
+	};
+})();
Index: /CKEditor/tags/3.0 Beta/_source/core/lang.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/lang.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/lang.js	(revision 3046)
@@ -0,0 +1,92 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+(function()
+{
+	var loadedLangs = {};
+
+	CKEDITOR.lang =
+	{
+		/**
+		 * The list of languages available in the editor core.
+		 * @type Object
+		 * @example
+		 * alert( CKEDITOR.lang.en );  // "true"
+		 */
+		languages :
+		{
+			'en'	: 1
+		},
+
+		/**
+		 * Loads a specific language file, or auto detect it. A callback is
+		 * then called when the file gets loaded.
+		 * @param {String} languageCode The code of the language file to be
+		 *		loaded. If "autoDetect" is set to true, this language will be
+		 *		used as the default one, if the detect language is not
+		 *		available in the core.
+		 * @param {Boolean} autoDetect Indicates that the function must try to
+		 *		detect the user language and load it instead.
+		 * @param {Function} callback The function to be called once the
+		 *		language file is loaded. Two parameters are passed to this
+		 *		function: the language code and the loaded language entries.
+		 * @example
+		 */
+		load : function( languageCode, autoDetect, callback )
+		{
+			if ( autoDetect )
+				languageCode = this.detect( languageCode );
+
+			if ( !this[ languageCode ] )
+			{
+				CKEDITOR.scriptLoader.load( CKEDITOR.getUrl(
+					'_source/' +	// %REMOVE_LINE%
+					'lang/' + languageCode + '.js' ),
+					function()
+						{
+							callback( languageCode, this[ languageCode ] );
+						}
+						, this );
+			}
+			else
+				callback( languageCode, this[ languageCode ] );
+		},
+
+		/**
+		 * Returns the language that best fit the user language. For example,
+		 * suppose that the user language is "pt-br". If this language is
+		 * supported by the editor, it is returned. Otherwise, if only "pt" is
+		 * supported, it is returned instead. If none of the previous are
+		 * supported, a default language is then returned.
+		 * @param {String} defaultLanguage The default language to be returned
+		 *		if the user language is not supported.
+		 * @returns {String} The detected language code.
+		 * @example
+		 * alert( CKEDITOR.lang.detect( 'en' ) );  // e.g., in a German browser: "de"
+		 */
+		detect : function( defaultLanguage )
+		{
+			var languages = this.languages;
+
+			var parts = ( navigator.userLanguage || navigator.language )
+					.toLowerCase()
+					.match( /([a-z]+)(?:-([a-z]+))?/ ),
+				lang = parts[1],
+				locale = parts[2];
+
+			if ( languages[ lang + '-' + locale ] )
+				lang = lang + '-' + locale;
+			else if ( !languages[ lang ] )
+				lang = null;
+
+			CKEDITOR.lang.detect = lang ?
+				function() { return lang; } :
+				function( defaultLanguage ) { return defaultLanguage; };
+
+			return lang || defaultLanguage;
+		}
+	};
+
+})();
Index: /CKEditor/tags/3.0 Beta/_source/core/loader.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/loader.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/loader.js	(revision 3046)
@@ -0,0 +1,186 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Defines the {@link CKEDITOR.loader} objects, which is used to
+ *		load core scripts and their dependencies from _source.
+ */
+
+if ( typeof CKEDITOR == 'undefined' )
+	CKEDITOR = {};
+
+if ( !CKEDITOR.loader )
+{
+	/**
+	 * Load core scripts and their dependencies from _source.
+	 * @namespace
+	 * @example
+	 */
+	CKEDITOR.loader = (function()
+	{
+		// Table of script names and their dependencies.
+		var scripts =
+		{
+			'core/_bootstrap'		: [ 'core/config', 'core/ckeditor', 'core/plugins', 'core/scriptloader', 'core/tools', /* The following are entries that we want to force loading at the end to avoid dependence recursion */ 'core/dom/elementpath', 'core/dom/text', 'core/dom/range' ],
+			'core/ajax'				: [ 'core/xml' ],
+			'core/ckeditor'			: [ 'core/ckeditor_basic', 'core/dom', 'core/dtd', 'core/dom/document', 'core/dom/element', 'core/editor', 'core/event', 'core/htmlparser', 'core/htmlparser/element', 'core/htmlparser/fragment', 'core/tools' ],
+			'core/ckeditor_base'	: [],
+			'core/ckeditor_basic'	: [ 'core/editor_basic', 'core/env', 'core/event' ],
+			'core/command'			: [],
+			'core/config'			: [ 'core/ckeditor_base' ],
+			'core/dom'				: [],
+			'core/dom/document'		: [ 'core/dom','core/dom/element', 'core/dom/domobject', 'core/dom/window' ],
+			'core/dom/documentFragment'	: [ 'core/dom/element' ],
+			'core/dom/element'		: [ 'core/dom', 'core/dom/document', 'core/dom/domobject', 'core/dom/node', 'core/dom/nodelist', 'core/tools' ],
+			'core/dom/elementpath'	: [ 'core/dom/element' ],
+			'core/dom/event'		: [],
+			'core/dom/node'			: [ 'core/dom/domobject', 'core/tools' ],
+			'core/dom/nodelist'		: [ 'core/dom/node' ],
+			'core/dom/domobject'	: [ 'core/dom/event' ],
+			'core/dom/domwalker'	: [ 'core/dom/node', 'core/dom/element', 'core/dom/document' ],
+			'core/dom/range'		: [ 'core/dom/document', 'core/dom/documentFragment', 'core/dom/element', 'core/dom/domwalker' ],
+			'core/dom/text'			: [ 'core/dom/node', 'core/dom/domobject' ],
+			'core/dom/window'		: [ 'core/dom/domobject' ],
+			'core/dtd'				: [ 'core/tools' ],
+			'core/editor'			: [ 'core/command', 'core/config', 'core/editor_basic', 'core/focusmanager', 'core/lang', 'core/plugins', 'core/skins', 'core/themes', 'core/tools', 'core/ui' ],
+			'core/editor_basic'		: [ 'core/event' ],
+			'core/env'				: [],
+			'core/event'			: [],
+			'core/focusmanager'		: [],
+			'core/htmlparser'		: [],
+			'core/htmlparser/comment'	: [ 'core/htmlparser' ],
+			'core/htmlparser/element'	: [ 'core/htmlparser', 'core/htmlparser/fragment' ],
+			'core/htmlparser/fragment'	: [ 'core/htmlparser', 'core/htmlparser/comment', 'core/htmlparser/text' ],
+			'core/htmlparser/text'		: [ 'core/htmlparser' ],
+			'core/imagecacher'		: [ 'core/dom/element' ],
+			'core/lang'				: [],
+			'core/plugins'			: [ 'core/resourcemanager' ],
+			'core/resourcemanager'	: [ 'core/scriptloader', 'core/tools' ],
+			'core/scriptloader'		: [ 'core/dom/element', 'core/env' ],
+			'core/skins'			: [ 'core/imagecacher', 'core/scriptloader' ],
+			'core/themes'			: [ 'core/resourcemanager' ],
+			'core/tools'			: [ 'core/env' ],
+			'core/ui'				: [],
+			'core/xml'				: [ 'core/env' ]
+		};
+
+		var basePath = (function()
+		{
+			// This is a copy of CKEDITOR.basePath, but requires the script having
+			// "_source/core/loader.js".
+			if ( CKEDITOR && CKEDITOR.basePath )
+				return CKEDITOR.basePath;
+
+			// Find out the editor directory path, based on its <script> tag.
+			var path = '';
+			var scripts = document.getElementsByTagName( 'script' );
+
+			for ( var i = 0 ; i < scripts.length ; i++ )
+			{
+				var match = scripts[i].src.match( /(^|.*[\\\/])core\/loader.js(?:\?.*)?$/i );
+
+				if ( match )
+				{
+					path = match[1];
+					break;
+				}
+			}
+
+			// In IE (only) the script.src string is the raw valued entered in the
+			// HTML. Other browsers return the full resolved URL instead.
+			if ( path.indexOf('://') == -1 )
+			{
+				// Absolute path.
+				if ( path.indexOf( '/' ) === 0 )
+					path = location.href.match( /^.*?:\/\/[^\/]*/ )[0] + path;
+				// Relative path.
+				else
+					path = location.href.match( /^[^\?]*\// )[0] + path;
+			}
+
+			return path;
+		})();
+
+		var timestamp = ( CKEDITOR && CKEDITOR.timestamp ) || ( new Date() ).valueOf();	// %REMOVE_LINE%
+		/*																				// %REMOVE_LINE%
+		 * The production implementation contains a fixed timestamp						// %REMOVE_LINE%
+		 * generated by the releaser													// %REMOVE_LINE%
+		var timestamp = '%TIMESTAMP%';
+		 */																				// %REMOVE_LINE%
+
+		var getUrl = function( resource )
+		{
+			if ( CKEDITOR && CKEDITOR.getUrl )
+				return CKEDITOR.getUrl( resource );
+
+			return basePath + resource +
+				( resource.indexOf( '?' ) >= 0 ? '&' : '?' ) +
+				't=' + timestamp;
+		};
+
+		/** @lends CKEDITOR.loader */
+		return {
+			/**
+			 * The list of loaded scripts in their loading order.
+			 * @type Array
+			 * @example
+			 * // Alert the loaded script names.
+			 * alert( <b>CKEDITOR.loader.loadedScripts</b> );
+			 */
+			loadedScripts : [],
+
+			/**
+			 * Loads a specific script, including its dependencies. This is not a
+			 * synchronous loading, which means that the code the be loaded will
+			 * not necessarily be available after this call.
+			 * @example
+			 * CKEDITOR.loader.load( 'core/dom/element' );
+			 */
+			load : function( scriptName )
+			{
+				// Check if the script has already been loaded.
+				if ( scriptName in this.loadedScripts )
+					return;
+
+				// Get the script dependencies list.
+				var dependencies = scripts[ scriptName ];
+				if ( !dependencies )
+					throw 'The script name"' + scriptName + '" is not defined.';
+
+				// Mark the script as loaded, even before really loading it, to
+				// avoid cross references recursion.
+				this.loadedScripts[ scriptName ] = true;
+
+				// Load all dependencies first.
+				for ( var i = 0 ; i < dependencies.length ; i++ )
+					this.load( dependencies[ i ] );
+
+				// Append this script to the list of loaded scripts.
+				this.loadedScripts.push( scriptName );
+
+				var scriptSrc = getUrl( '_source/' + scriptName + '.js' );
+
+				// Append the <script> element to the DOM.
+				if ( document.body )
+				{
+					var script = document.createElement( 'script' );
+					script.type = 'text/javascript';
+					script.src = scriptSrc;
+
+					document.body.appendChild( script );
+				}
+				else
+					document.write( '<script src="' + scriptSrc + '" type="text/javascript"><\/script>' );
+			}
+		};
+	})();
+}
+
+// Check if any script has been defined for autoload.
+if ( CKEDITOR._autoLoad )
+{
+	CKEDITOR.loader.load( CKEDITOR._autoLoad );
+	delete CKEDITOR._autoLoad;
+}
Index: /CKEditor/tags/3.0 Beta/_source/core/plugindefinition.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/plugindefinition.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/plugindefinition.js	(revision 3046)
@@ -0,0 +1,68 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Defines the "virtual" {@link CKEDITOR.pluginDefinition} class, which
+ *		contains the defintion of a plugin. This file is for documentation
+ *		purposes only.
+ */
+
+/**
+ * (Virtual Class) Do not call this constructor. This class is not really part
+ *		of the API. It just illustrates the features of plugin objects to be
+ *		passed to the {@link CKEDITOR.plugins.add} function.
+ * @name CKEDITOR.pluginDefinition
+ * @constructor
+ * @example
+ */
+
+/**
+ * A list of plugins that are required by this plugin. Note that this property
+ * doesn't guarantee the loading order of the plugins.
+ * @name CKEDITOR.pluginDefinition.prototype.requires
+ * @type Array
+ * @example
+ * CKEDITOR.plugins.add( 'sample',
+ * {
+ *     requires : [ 'button', 'selection' ]
+ * });
+ */
+
+ /**
+ * Function called on initialization of every editor instance created in the
+ * page before the init() call task. The beforeInit function will be called for
+ * all plugins, after that the init function is called for all of them. This
+ * feature makes it possible to initialize things that could be used in the
+ * init function of other plugins.
+ * @name CKEDITOR.pluginDefinition.prototype.beforeInit
+ * @function
+ * @param {CKEDITOR.editor} editor The editor instance being initialized.
+ * @param {String} pluginPath The URL path for the plugin installation folder.
+ * @example
+ * CKEDITOR.plugins.add( 'sample',
+ * {
+ *     beforeInit : function( editor, pluginPath )
+ *     {
+ *         alert( 'Editor "' + editor.name + '" is to be initialized!' );
+ *     }
+ * });
+ */
+
+ /**
+ * Function called on initialization of every editor instance created in the
+ * page.
+ * @name CKEDITOR.pluginDefinition.prototype.init
+ * @function
+ * @param {CKEDITOR.editor} editor The editor instance being initialized.
+ * @param {String} pluginPath The URL path for the plugin installation folder.
+ * @example
+ * CKEDITOR.plugins.add( 'sample',
+ * {
+ *     init : function( editor, pluginPath )
+ *     {
+ *         alert( 'Editor "' + editor.name + '" is being initialized!' );
+ *     }
+ * });
+ */
Index: /CKEditor/tags/3.0 Beta/_source/core/plugins.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/plugins.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/plugins.js	(revision 3046)
@@ -0,0 +1,66 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Defines the {@link CKEDITOR.plugins} object, which is used to
+ *		manage plugins registration and loading.
+ */
+
+/**
+ * Manages plugins registration and loading.
+ * @namespace
+ * @augments CKEDITOR.resourceManager
+ * @example
+ */
+CKEDITOR.plugins = new CKEDITOR.resourceManager(
+	'_source/' +	// %REMOVE_LINE%
+	'plugins/', 'plugin' );
+
+CKEDITOR.plugins.load = CKEDITOR.tools.override( CKEDITOR.plugins.load, function( originalLoad )
+	{
+		return function( name, callback, scope )
+		{
+			var allPlugins = {};
+
+			var loadPlugins = function( names )
+			{
+				originalLoad.call( this, names, function( plugins )
+					{
+						CKEDITOR.tools.extend( allPlugins, plugins );
+
+						var requiredPlugins = [];
+						for ( var pluginName in plugins )
+						{
+							var plugin = plugins[ pluginName ],
+								requires = plugin && plugin.requires;
+
+							if ( requires )
+							{
+								for ( var i = 0 ; i < requires.length ; i++ )
+								{
+									if ( !allPlugins[ requires[ i ] ] )
+										requiredPlugins.push( requires[ i ] );
+								}
+							}
+						}
+
+						if ( requiredPlugins.length )
+							loadPlugins.call( this, requiredPlugins );
+						else if ( callback )
+							callback.call( scope || window, allPlugins );
+					}
+					, this);
+
+			};
+
+			loadPlugins.call( this, name );
+		};
+	});
+
+CKEDITOR.plugins.setLang = function( pluginName, languageCode, languageEntries )
+{
+	var plugin = this.get( pluginName );
+	plugin.lang[ languageCode ] = languageEntries;
+};
Index: /CKEditor/tags/3.0 Beta/_source/core/resourcemanager.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/resourcemanager.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/resourcemanager.js	(revision 3046)
@@ -0,0 +1,195 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Defines the {@link CKEDITOR.resourceManager} class, which is
+ *		the base for resource managers, like plugins and themes.
+ */
+
+ /**
+ * Base class for resource managers, like plugins and themes. This class is not
+ * intended to be used out of the CKEditor core code.
+ * @param {String} basePath The path for the resources folder.
+ * @param {String} fileName The name used for resource files.
+ * @namespace
+ * @example
+ */
+CKEDITOR.resourceManager = function( basePath, fileName )
+{
+	/**
+	 * The base directory containing all resources.
+	 * @name CKEDITOR.resourceManager.prototype.basePath
+	 * @type String
+	 * @example
+	 */
+	this.basePath = basePath;
+
+	/**
+	 * The name used for resource files.
+	 * @name CKEDITOR.resourceManager.prototype.fileName
+	 * @type String
+	 * @example
+	 */
+	this.fileName = fileName;
+
+	/**
+	 * Contains references to all resources that have already been registered
+	 * with {@link #add}.
+	 * @name CKEDITOR.resourceManager.prototype.registered
+	 * @type Object
+	 * @example
+	 */
+	this.registered = {};
+
+	/**
+	 * Contains references to all resources that have already been loaded
+	 * with {@link #load}.
+	 * @name CKEDITOR.resourceManager.prototype.loaded
+	 * @type Object
+	 * @example
+	 */
+	this.loaded = {};
+
+	/**
+	 * Contains references to all resources that have already been registered
+	 * with {@link #addExternal}.
+	 * @name CKEDITOR.resourceManager.prototype.externals
+	 * @type Object
+	 * @example
+	 */
+	this.externals = {};
+
+	/**
+	 * @private
+	 */
+	this._ =
+	{
+		// List of callbacks waiting for plugins to be loaded.
+		waitingList : {}
+	};
+};
+
+CKEDITOR.resourceManager.prototype =
+{
+	/**
+	 * Registers a resource.
+	 * @param {String} name The resource name.
+	 * @param {Object} [definition] The resource definition.
+	 * @example
+	 * CKEDITOR.plugins.add( 'sample', { ... plugin definition ... } );
+	 * @see CKEDITOR.pluginDefinition
+	 */
+	add : function( name, definition )
+	{
+		if ( this.registered[ name ] )
+			throw '[CKEDITOR.resourceManager.add] The resource name "' + name + '" is already registered.';
+
+		this.registered[ name ] = definition || {};
+	},
+
+	/**
+	 * Gets the definition of a specific resource.
+	 * @param {String} name The resource name.
+	 * @type Object
+	 * @example
+	 * var definition = <b>CKEDITOR.plugins.get( 'sample' )</b>;
+	 */
+	get : function( name )
+	{
+		return this.registered[ name ] || null;
+	},
+
+	/**
+	 * Get the full path for a specific loaded resource.
+	 * @param {String} name The resource name.
+	 * @type String
+	 * @example
+	 * alert( <b>CKEDITOR.plugins.getPath( 'sample' )</b> );  // "&lt;editor path&gt;/plugins/sample/"
+	 */
+	getPath : function( name )
+	{
+		return this.externals[ name ] || this.basePath + name + '/';
+	},
+
+	/**
+	 * Registers a resource to be loaded from an external path instead of the core base path.
+	 * @param {String} name The resource name.
+	 * @param {String} path The resource external path.
+	 * @example
+	 * // Loads a plugin from '/myplugin/samples/plugin.js'.
+	 * CKEDITOR.plugins.addExternal( 'sample', '/myplugins/sample/' );
+	 */
+	addExternal : function( name, path )
+	{
+		if ( this.registered[ name ] || this.externals[ name ] )
+			throw '[CKEDITOR.resourceManager.import] The resource name "' + name + '" is already registered or imported.';
+
+		this.externals[ name ] = path;
+	},
+
+	/**
+	 * Loads one or more resources.
+	 * @param {String|Array} name The name of the resource to load. It may be a
+	 *		string with a single resource name, or an array with several names.
+	 * @param {Function} callback A function to be called when all resources
+	 *		are loaded. The callback will receive an array containing all
+	 *		loaded names.
+	 * @param {Object} [scope] The scope object to be used for the callback
+	 *		call.
+	 * @example
+	 * <b>CKEDITOR.plugins.load</b>( 'myplugin', function( plugins )
+	 *     {
+	 *         alert( plugins['myplugin'] );  // "object"
+	 *     });
+	 */
+	load : function( names, callback, scope )
+	{
+		// Ensure that we have an array of names.
+		if ( !CKEDITOR.tools.isArray( names ) )
+			names = names ? [ names ] : [];
+
+		var loaded = this.loaded,
+			registered = this.registered,
+			urls = [],
+			urlsNames = {},
+			resources = {};
+
+		// Loop through all names.
+		for ( var i = 0 ; i < names.length ; i++ )
+		{
+			var name = names[ i ];
+
+			if ( !name )
+				continue;
+
+			// If not available yet.
+			if ( !loaded[ name ] && !registered[ name ] )
+			{
+				var url = CKEDITOR.getUrl( this.getPath( name ) + this.fileName + '.js' );
+				urls.push( url );
+				urlsNames[ url ] = name;
+			}
+			else
+				resources[ name ] = this.get( name );
+		}
+
+		CKEDITOR.scriptLoader.load( urls, function( completed, failed )
+			{
+				if ( failed.length )
+					throw '[CKEDITOR.resourceManager.load] Resource name "' + urlsNames[ failed[ 0 ] ] + '" was not found at "' + failed[ 0 ] + '".';
+
+				for ( var i = 0 ; i < completed.length ; i++ )
+				{
+					var name = urlsNames[ completed[ i ] ];
+					resources[ name ] = this.get( name );
+
+					loaded[ name ] = 1;
+				}
+
+				callback.call( scope, resources );
+			}
+			, this);
+	}
+};
Index: /CKEditor/tags/3.0 Beta/_source/core/scriptloader.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/scriptloader.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/scriptloader.js	(revision 3046)
@@ -0,0 +1,192 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Defines the {@link CKEDITOR.scriptLoader} object, used to load scripts
+ *		asynchronously.
+ */
+
+/**
+ * Load scripts asynchronously.
+ * @namespace
+ * @example
+ */
+CKEDITOR.scriptLoader = (function()
+{
+	var uniqueScripts = {};
+	var waitingList = {};
+
+	return /** @lends CKEDITOR.scriptLoader */ {
+		/**
+		 * Loads one or more external script checking if not already loaded
+		 * previously by this function.
+		 * @param {String|Array} scriptUrl One or more URLs pointing to the
+		 *		scripts to be loaded.
+		 * @param {Function} [callback] A function to be called when the script
+		 *		is loaded and executed. If a string is passed to "scriptUrl", a
+		 *		boolean parameter is passed to the callback, indicating the
+		 *		success of the load. If an array is passed instead, two array
+		 *		parameters are passed to the callback; the first contains the
+		 *		URLs that have been properly loaded, and the second the failed
+		 *		ones.
+		 * @param {Object} [scope] The scope ("this" reference) to be used for
+		 *		the callback call. Default to {@link CKEDITOR}.
+		 * @param {Boolean} [noCheck] Indicates that the script must be loaded
+		 *		anyway, not checking if it has already loaded.
+		 * @example
+		 * CKEDITOR.scriptLoader.load( '/myscript.js' );
+		 * @example
+		 * CKEDITOR.scriptLoader.load( '/myscript.js', function( success )
+		 *     {
+		 *         // Alerts "true" if the script has been properly loaded.
+		 *         // HTTP error 404 should return "false".
+		 *         alert( success );
+		 *     });
+		 * @example
+		 * CKEDITOR.scriptLoader.load( [ '/myscript1.js', '/myscript2.js' ], function( completed, failed )
+		 *     {
+		 *         alert( 'Number of scripts loaded: ' + completed.length );
+		 *         alert( 'Number of failures: ' + failed.length );
+		 *     });
+		 */
+		load : function( scriptUrl, callback, scope, noCheck )
+		{
+			var isString = ( typeof scriptUrl == 'string' );
+
+			if ( isString )
+				scriptUrl = [ scriptUrl ];
+
+			if ( !scope )
+				scope = CKEDITOR;
+
+			var scriptCount = scriptUrl.length,
+				completed = [],
+				failed = [];
+
+			var doCallback = function( success )
+			{
+				if ( callback )
+				{
+					if ( isString )
+						callback.call( scope, success );
+					else
+						callback.call( scope, completed, failed );
+				}
+			};
+
+			if ( scriptCount === 0 )
+			{
+				doCallback( true );
+				return;
+			}
+
+			var checkLoaded = function( url, success )
+			{
+				( success ? completed : failed).push( url );
+
+				if ( --scriptCount <= 0 )
+					doCallback( success );
+			};
+
+			var onLoad = function( url, success )
+			{
+				// Mark this script as loaded.
+				uniqueScripts[ url ] = 1;
+
+				// Get the list of callback checks waiting for this file.
+				var waitingInfo = waitingList[ url ];
+				delete waitingList[ url ];
+
+				// Check all callbacks waiting for this file.
+				for ( var i = 0 ; i < waitingInfo.length ; i++ )
+					waitingInfo[ i ]( url, success );
+			};
+
+			var loadScript = function( url )
+			{
+				if ( noCheck !== true && uniqueScripts[ url ] )
+				{
+					checkLoaded( url, true );
+					return;
+				}
+
+				var waitingInfo = waitingList[ url ] || ( waitingList[ url ] = [] );
+				waitingInfo.push( checkLoaded );
+
+				// Load it only for the first request.
+				if ( waitingInfo.length > 1 )
+					return;
+
+				// Create the <script> element.
+				var script = new CKEDITOR.dom.element( 'script' );
+				script.setAttributes( {
+					type : 'text/javascript',
+					src : url } );
+
+				if ( callback )
+				{
+					if ( CKEDITOR.env.ie )
+					{
+						// FIXME: For IE, we are not able to return false on error (like 404).
+
+						/** @ignore */
+						script.$.onreadystatechange = function ()
+						{
+							if ( script.$.readyState == 'loaded' || script.$.readyState == 'complete' )
+							{
+								script.$.onreadystatechange = null;
+								onLoad( url, true );
+							}
+						};
+					}
+					else
+					{
+						/** @ignore */
+						script.$.onload = function()
+						{
+							onLoad( url, true );
+						};
+
+						// FIXME: Opera and Safari will not fire onerror.
+
+						/** @ignore */
+						script.$.onerror = function()
+						{
+							onLoad( url, false );
+						};
+					}
+				}
+
+				// Append it to <head>.
+				script.appendTo( CKEDITOR.document.getHead() );
+
+				CKEDITOR.fire( 'download', url );		// @Packager.RemoveLine
+			};
+
+			for ( var i = 0 ; i < scriptCount ; i++ )
+			{
+				loadScript( scriptUrl[ i ] );
+			}
+		},
+
+		/**
+		 * Executes a JavaScript code into the current document.
+		 * @param {String} code The code to be executed.
+		 * @example
+		 * CKEDITOR.scriptLoader.loadCode( 'var x = 10;' );
+		 * alert( x );  // "10"
+		 */
+		loadCode : function( code )
+		{
+			// Create the <script> element.
+			var script = new CKEDITOR.dom.element( 'script' );
+			script.setAttribute( 'type', 'text/javascript' );
+			script.appendText( code );
+
+			// Append it to <head>.
+			script.appendTo( CKEDITOR.document.getHead() );
+		}
+	};
+})();
Index: /CKEditor/tags/3.0 Beta/_source/core/skins.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/skins.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/skins.js	(revision 3046)
@@ -0,0 +1,167 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Defines the {@link CKEDITOR.skins} object, which is used to
+ *		manage skins loading.
+ */
+
+/**
+ * Manages skins loading.
+ * @namespace
+ * @example
+ */
+CKEDITOR.skins = (function()
+{
+	// Holds the list of loaded skins.
+	var loaded = {};
+	var preloaded = {};
+
+	var loadedPart = function( skinName, part, callback )
+	{
+		// Get the skin definition.
+		var skinDefinition = loaded[ skinName ];
+
+		var appendSkinPath = function( fileNames )
+		{
+			for ( var n = 0 ; n < fileNames.length ; n++ )
+			{
+				fileNames[ n ] = CKEDITOR.getUrl(
+					'_source/' +	// %REMOVE_LINE%
+					'skins/' + skinName + '/' + fileNames[ n ] );
+			}
+		};
+
+		// Check if we need to preload images from it.
+		if ( !preloaded[ skinName ] )
+		{
+			var preload = skinDefinition.preload;
+			if ( preload && preload.length > 0 )
+			{
+				appendSkinPath( preload );
+				CKEDITOR.imageCacher.load( preload, function()
+					{
+						preloaded[ skinName ] = 1;
+						loadedPart( skinName, part, callback );
+					} );
+				return;
+			}
+
+			// Mark it as preloaded.
+			preloaded[ skinName ] = 1;
+		}
+
+		// Get the part definition.
+		part = skinDefinition[ part ];
+		var partIsLoaded = !part || !!part._isLoaded;
+
+		// Call the callback immediately if already loaded.
+		if ( partIsLoaded )
+			callback && callback();
+		else
+		{
+			// Put the callback in a queue.
+			var pending = part._pending || ( part._pending = [] );
+			pending.push( callback );
+
+			// We may have more than one skin part load request. Just the first
+			// one must do the loading job.
+			if ( pending.length > 1 )
+				return;
+
+			// Check whether the "css" and "js" properties have been defined
+			// for that part.
+			var cssIsLoaded = !part.css || !part.css.length;
+			var jsIsLoaded = !part.js || !part.js.length;
+
+			// This is the function that will trigger the callback calls on
+			// load.
+			var checkIsLoaded = function()
+			{
+				if ( cssIsLoaded && jsIsLoaded )
+				{
+					// Mark the part as loaded.
+					part._isLoaded = 1;
+
+					// Call all pending callbacks.
+					for ( var i = 0 ; i < pending.length ; i++ )
+					{
+						if ( pending[ i ] )
+							pending[ i ]();
+					}
+				}
+			};
+
+			// Load the "css" pieces.
+			if ( !cssIsLoaded )
+			{
+				appendSkinPath( part.css );
+
+				for ( var c = 0 ; c < part.css.length ; c++ )
+					CKEDITOR.document.appendStyleSheet( part.css[ c ] );
+
+				cssIsLoaded = 1;
+			}
+
+			// Load the "js" pieces.
+			if ( !jsIsLoaded )
+			{
+				appendSkinPath( part.js );
+				CKEDITOR.scriptLoader.load( part.js, function()
+					{
+						jsIsLoaded = 1;
+						checkIsLoaded();
+					});
+			}
+
+			// We may have nothing to load, so check it immediately.
+			checkIsLoaded();
+		}
+	};
+
+	return /** @lends CKEDITOR.skins */ {
+
+		/**
+		 * Registers a skin definition.
+		 * @param {String} skinName The skin name.
+		 * @param {Object} skinDefinition The skin definition.
+		 * @example
+		 */
+		add : function( skinName, skinDefinition )
+		{
+			loaded[ skinName ] = skinDefinition;
+
+			skinDefinition.skinPath = CKEDITOR.getUrl(
+					'_source/' +	// %REMOVE_LINE%
+					'skins/' + skinName + '/' );
+		},
+
+		/**
+		 * Loads a skin part. Skins are defined in parts, which are basically
+		 * separated CSS files. This function is mainly used by the core code and
+		 * should not have much use out of it.
+		 * @param {String} skinName The name of the skin to be loaded.
+		 * @param {String} skinPart The skin part to be loaded. Common skin parts
+		 *		are "editor" and "dialog".
+		 * @param {Function} [callback] A function to be called once the skin
+		 *		part files are loaded.
+		 * @example
+		 */
+		load : function( skinName, skinPart, callback )
+		{
+			if ( loaded[ skinName ] )
+				loadedPart( skinName, skinPart, callback );
+			else
+			{
+				CKEDITOR.scriptLoader.load( CKEDITOR.getUrl(
+					'_source/' +	// %REMOVE_LINE%
+					'skins/' + skinName + '/skin.js' ), function()
+						{
+							loadedPart( skinName, skinPart, callback );
+						} );
+			}
+		}
+	 };
+})();
Index: /CKEditor/tags/3.0 Beta/_source/core/test.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/test.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/test.js	(revision 3046)
@@ -0,0 +1,116 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Defines the {@link CKEDITOR.test} object, which contains
+ *		functions used at our testing environment.
+ */
+
+/*jsl:import ../tests/yuitest.js*/
+
+/**
+ * Contains functions used at our testing environment. Currently,
+ * our testing system is based on the
+ * <a href="http://developer.yahoo.com/yui/yuitest/">YUI Test</a>.
+ * @namespace
+ * @example
+ */
+CKEDITOR.test =
+{
+	/**
+	 * The assertion namespace, containing all assertion functions. Currently,
+	 * this is an alias for
+	 * <a href="http://developer.yahoo.com/yui/docs/YAHOO.util.Assert.html">YAHOO.util.Assert</a>.
+	 * @example
+	 * <b>CKEDITOR.test.assert</b>.areEqual( '10', 10 );        // "true"
+	 * <b>CKEDITOR.test.assert</b>.areSame( '10', 10 );         // "false"
+	 * <b>CKEDITOR.test.assert</b>.isUndefined( window.test );  // "true"
+	 */
+	assert : YAHOO.util.Assert,
+
+	/**
+	 * Adds a test case to the test runner.
+	 * @param {Object} testCase The test case object. See other tests for
+	 *		examples.
+	 * @example
+	 * <b>CKEDITOR.test.addTestCase</b>((function()
+	 * {
+	 *     // Local reference to the "assert" object.
+	 *     var assert = CKEDITOR.test.assert;
+	 *
+	 *     return {
+	 *         test_example : function()
+	 *         {
+	 *             assert.areSame( '10', 10 );  // FAIL
+	 *         }
+	 *      };
+	 * })());
+	 */
+	addTestCase : function( testCase )
+	{
+		YAHOO.tool.TestRunner.add( new YAHOO.tool.TestCase( testCase ) );
+	},
+
+	/**
+	 * Gets the inner HTML of an element, for testing purposes.
+	 */
+	getInnerHtml : function( elementOrId )
+	{
+		var html = ( elementOrId.nodeType ? elementOrId : document.getElementById( elementOrId ) ).innerHTML;
+		html = html.toLowerCase();
+		html = html.replace( /[\n\r]/g, '' );
+
+		html = html.replace( /<\w[^>]*/g, function( match )
+			{
+				var attribs = [];
+				var hasClass;
+
+				match = match.replace( /\s([^\s=]+)=((?:"[^"]*")|(?:'[^']*')|(?:[^\s]+))/g, function( match, attName, attValue )
+					{
+						if ( attName == 'style' )
+						{
+							// IE doesn't add the final ";"
+							attValue = attValue.replace( /([^"';\s])\s*(["']?)$/, '$1;$2' );
+
+							// Safari adds some extra space to the end.
+							attValue = attValue.replace( /\s+(["']?)$/, '$1' );
+						}
+
+						// IE may have 'class' more than once.
+						if ( attName == 'class' )
+						{
+							if ( hasClass )
+								return '';
+
+							hasClass = true;
+						}
+
+						if ( attName != '_cke_expando' )
+							attribs.push( [ attName, attValue ] );
+
+						return '';
+					} );
+
+				attribs.sort( function( a, b )
+					{
+						var nameA = a[ 0 ];
+						var nameB = b[ 0 ];
+						return nameA < nameB ? -1 : nameA > nameB ? 1 : 0;
+					} );
+
+				var ret = match.replace( /\s{2,}/g, ' ' );
+
+				for ( var i = 0 ; i < attribs.length ; i++ )
+				{
+					ret += ' ' + attribs[i][0] + '=';
+					ret += (/^["']/).test( attribs[i][1] ) ? attribs[i][1] : '"' + attribs[i][1] + '"';
+				}
+
+				return ret;
+			} );
+
+		return html;
+	}
+};
Index: /CKEditor/tags/3.0 Beta/_source/core/themes.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/themes.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/themes.js	(revision 3046)
@@ -0,0 +1,19 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Defines the {@link CKEDITOR.themes} object, which is used to
+ *		manage themes registration and loading.
+ */
+
+/**
+ * Manages themes registration and loading.
+ * @namespace
+ * @augments CKEDITOR.resourceManager
+ * @example
+ */
+CKEDITOR.themes = new CKEDITOR.resourceManager(
+	'_source/'+		// %REMOVE_LINE%
+	'themes/', 'theme' );
Index: /CKEditor/tags/3.0 Beta/_source/core/tools.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/tools.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/tools.js	(revision 3046)
@@ -0,0 +1,316 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Defines the {@link CKEDITOR.tools} object, which contains
+ *		utility functions.
+ */
+
+/**
+ * Utility functions.
+ * @namespace
+ * @example
+ */
+CKEDITOR.tools =
+{
+	/**
+	 * Copy the properties from one object to another. By default, properties
+	 * already present in the target object <strong>are not</strong> overwritten.
+	 * @param {Object} target The object to be extended.
+	 * @param {Object} source[,souce(n)] The objects from which copy
+	 *		properties. Any number of objects can be passed to this function.
+	 * @param {Boolean} [overwrite] Indicates that properties already present
+	 *		in the target object must be overwritten. This must be the last
+	 *		parameter in the function call.
+	 * @returns {Object} the extended object (target).
+	 * @example
+	 * // Create the sample object.
+	 * var myObject =
+	 * {
+	 *     prop1 : true
+	 * };
+	 *
+	 * // Extend the above object with two properties.
+	 * CKEDITOR.tools.extend( myObject,
+	 *     {
+	 *         prop2 : true,
+	 *         prop3 : true
+	 *     } );
+	 *
+	 * // Alert "prop1", "prop2" and "prop3".
+	 * for ( var p in myObject )
+	 *     alert( p );
+	 */
+	extend : function( target )
+	{
+		var argsLength = arguments.length,
+			overwrite = arguments[ argsLength - 1 ];
+
+		if ( typeof overwrite == 'boolean' )
+			argsLength--;
+		else
+			overwrite = false;
+
+		for ( var i = 1 ; i < argsLength ; i++ )
+		{
+			var source = arguments[ i ];
+
+			for ( var propertyName in source )
+			{
+				if ( overwrite || target[ propertyName ] == undefined )
+					target[ propertyName ] = source[ propertyName ];
+			}
+		}
+
+		return target;
+	},
+
+	/**
+	 * Creates an object which is an instance of a class which prototype is a
+	 * predefined object. All properties defined in the source object are
+	 * automatically inherited by the resulting object, including future
+	 * changes to it.
+	 * @param {Object} source The source object to be used as the prototype for
+	 *		the final object.
+	 * @returns {Object} The resulting copy.
+	 */
+	prototypedCopy : function( source )
+	{
+		var copy = function()
+		{};
+		copy.prototype = source;
+		return new copy();
+	},
+
+	/**
+	 * Checks if an object is an Array.
+	 * @param {Object} object The object to be checked.
+	 * @type Boolean
+	 * @returns <i>true</i> if the object is an Array, otherwise <i>false</i>.
+	 * @example
+	 * alert( CKEDITOR.tools.isArray( [] ) );      // "true"
+	 * alert( CKEDITOR.tools.isArray( 'Test' ) );  // "false"
+	 */
+	isArray : function( object )
+	{
+		return ( !!object && object instanceof Array );
+	},
+
+	/**
+	 * Transforms a CSS property name to its relative DOM style name.
+	 * @param {String} cssName The CSS property name.
+	 * @returns {String} The transformed name.
+	 * @example
+	 * alert( CKEDITOR.tools.cssStyleToDomStyle( 'background-color' ) );  // "backgroundColor"
+	 * alert( CKEDITOR.tools.cssStyleToDomStyle( 'float' ) );             // "cssFloat"
+	 */
+	cssStyleToDomStyle : function( cssName )
+	{
+		if ( cssName == 'float' )
+			return 'cssFloat';
+		else
+		{
+			return cssName.replace( /-./g, function( match )
+				{
+					return match.substr( 1 ).toUpperCase();
+				});
+		}
+	},
+
+	/**
+	 * Replace special HTML characters in a string with their relative HTML
+	 * entity values.
+	 * @param {String} text The string to be encoded.
+	 * @returns {String} The encode string.
+	 * @example
+	 * alert( CKEDITOR.tools.htmlEncode( 'A > B & C < D' ) );  // "A &amp;gt; B &amp;amp; C &amp;lt; D"
+	 */
+	htmlEncode : function( text )
+	{
+		var standard = function( text )
+		{
+			var span = new CKEDITOR.dom.element( 'span' );
+			span.setText( text );
+			return span.getHtml();
+		};
+
+		this.htmlEncode = ( standard( '>' ) == '>' ) ?
+			function( text )
+			{
+				// WebKit does't encode the ">" character, which makes sense, but
+				// it's different than other browsers.
+				return standard( text ).replace( />/g, '&gt;' );
+			} :
+			standard;
+
+		return this.htmlEncode( text );
+	},
+
+	/**
+	 * Gets a unique number for this CKEDITOR execution session. It returns
+	 * progressive numbers starting at 1.
+	 * @function
+	 * @returns {Number} A unique number.
+	 * @example
+	 * alert( CKEDITOR.tools.<b>getNextNumber()</b> );  // "1" (e.g.)
+	 * alert( CKEDITOR.tools.<b>getNextNumber()</b> );  // "2"
+	 */
+	getNextNumber : (function()
+	{
+		var last = 0;
+		return function()
+		{
+			return ++last;
+		};
+	})(),
+
+	/**
+	 * Creates a function override.
+	 * @param {Function} originalFunction The function to be overridden.
+	 * @param {Function} functionBuilder A function that returns the new
+	 *		function. The original function reference will be passed to this
+	 *		function.
+	 * @returns {Function} The new function.
+	 * @example
+	 * var example =
+	 * {
+	 *     myFunction : function( name )
+	 *     {
+	 *         alert( 'Name: ' + name );
+	 *     }
+	 * };
+	 *
+	 * example.myFunction = CKEDITOR.tools.override( example.myFunction, function( myFunctionOriginal )
+	 *     {
+	 *         return function( name )
+	 *             {
+	 *                 alert( 'Override Name: ' + name );
+	 *                 myFunctionOriginal.call( this, name );
+	 *             };
+	 *     });
+	 */
+	override : function( originalFunction, functionBuilder )
+	{
+		return functionBuilder( originalFunction );
+	},
+
+	/**
+	 * Executes a function after specified delay.
+	 * @param {Function} func The function to be executed.
+	 * @param {Number} [milliseconds] The amount of time (millisecods) to wait
+	 *		to fire the function execution. Defaults to zero.
+	 * @param {Object} [scope] The object to hold the function execution scope
+	 *		(the "this" object). By default the "window" object.
+	 * @param {Object|Array} [args] A single object, or an array of objects, to
+	 *		pass as arguments to the function.
+	 * @param {Object} [ownerWindow] The window that will be used to set the
+	 *		timeout. By default the current "window".
+	 * @returns {Object} A value that can be used to cancel the function execution.
+	 * @example
+	 * CKEDITOR.tools.<b>setTimeout(
+	 *     function()
+	 *     {
+	 *         alert( 'Executed after 2 seconds' );
+	 *     },
+	 *     2000 )</b>;
+	 */
+	setTimeout : function( func, milliseconds, scope, args, ownerWindow )
+	{
+		if ( !ownerWindow )
+			ownerWindow = window;
+
+		if ( !scope )
+			scope = ownerWindow;
+
+		return ownerWindow.setTimeout(
+			function()
+			{
+				if ( args )
+					func.apply( scope, [].concat( args ) ) ;
+				else
+					func.apply( scope ) ;
+			},
+			milliseconds || 0 );
+	},
+
+	/**
+	 * Remove spaces from the start and the end of a string. The following
+	 * characters are removed: space, tab, line break, line feed.
+	 * @function
+	 * @param {String} str The text from which remove the spaces.
+	 * @returns {String} The modified string without the boundary spaces.
+	 * @example
+	 * alert( CKEDITOR.tools.trim( '  example ' );  // "example"
+	 */
+	trim : (function()
+	{
+		// We are not using \s because we don't want "non-breaking spaces" to be caught.
+		var trimRegex = /(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;
+		return function( str )
+		{
+			return str.replace( trimRegex, '' ) ;
+		};
+	})(),
+
+	/**
+	 * Remove spaces from the start (left) of a string. The following
+	 * characters are removed: space, tab, line break, line feed.
+	 * @function
+	 * @param {String} str The text from which remove the spaces.
+	 * @returns {String} The modified string excluding the removed spaces.
+	 * @example
+	 * alert( CKEDITOR.tools.ltrim( '  example ' );  // "example "
+	 */
+	ltrim : (function()
+	{
+		// We are not using \s because we don't want "non-breaking spaces" to be caught.
+		var trimRegex = /^[ \t\n\r]+/g;
+		return function( str )
+		{
+			return str.replace( trimRegex, '' ) ;
+		};
+	})(),
+
+	/**
+	 * Remove spaces from the end (right) of a string. The following
+	 * characters are removed: space, tab, line break, line feed.
+	 * @function
+	 * @param {String} str The text from which remove the spaces.
+	 * @returns {String} The modified string excluding the removed spaces.
+	 * @example
+	 * alert( CKEDITOR.tools.ltrim( '  example ' );  // "  example"
+	 */
+	rtrim : (function()
+	{
+		// We are not using \s because we don't want "non-breaking spaces" to be caught.
+		var trimRegex = /[ \t\n\r]+$/g;
+		return function( str )
+		{
+			return str.replace( trimRegex, '' ) ;
+		};
+	})(),
+
+	/**
+	 * Returns the index of an element in an array.
+	 * @param {Array} array The array to be searched.
+	 * @param {Object} entry The element to be found.
+	 * @returns {Number} The (zero based) index of the first entry that matches
+	 *		the entry, or -1 if not found.
+	 * @example
+	 * var letters = [ 'a', 'b', 'c' ];
+	 * alert( CKEDITOR.tools.indexOf( letters, 'b' ) );  "1"
+	 */
+	indexOf : function( array, entry )
+	{
+		for ( var i = 0, len = array.length ; i < len ; i++ )
+		{
+			if ( array[ i ] == entry )
+				return i;
+		}
+		return -1;
+	}
+};
+
+// PACKAGER_RENAME( CKEDITOR.tools )
Index: /CKEditor/tags/3.0 Beta/_source/core/ui.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/ui.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/ui.js	(revision 3046)
@@ -0,0 +1,101 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * Contains UI features related to an editor instance.
+ * @constructor
+ * @param {CKEDITOR.editor} editor The editor instance.
+ * @example
+ */
+CKEDITOR.ui = function( editor )
+{
+	if ( editor.ui )
+		return editor.ui;
+
+	/**
+	 * Object used to hold private stuff.
+	 * @private
+	 */
+	this._ =
+	{
+		handlers : {},
+		items : {}
+	};
+
+	return this;
+};
+
+// PACKAGER_RENAME( CKEDITOR.ui )
+
+CKEDITOR.ui.prototype =
+{
+	/**
+	 * Adds a UI item to the items collection. These items can be later used in
+	 * the interface.
+	 * @param {String} name The UI item name.
+	 * @param {Object} type The item type.
+	 * @param {Object} definition The item definition. The properties of this
+	 *		object depend on the item type.
+	 * @example
+	 * // Add a new button named "MyBold".
+	 * editorInstance.ui.add( 'MyBold', CKEDITOR.UI_BUTTON,
+	 *     {
+	 *         label : 'My Bold',
+	 *         command : 'bold'
+	 *     });
+	 */
+	add : function( name, type, definition )
+	{
+		var item = this._.handlers[ type ].create( definition );
+		item.name = name;
+		this._.items[ name ] = item;
+	},
+
+	/**
+	 * Gets a UI object.
+	 * @param {String} name The UI item hame.
+	 * @example
+	 */
+	get : function( name )
+	{
+		return this._.items[ name ] || null;
+	},
+
+	/**
+	 * Adds a handler for a UI item type. The handler is responsible for
+	 * transforming UI item definitions in UI objects.
+	 * @param {Object} type The item type.
+	 * @param {Object} handler The handler definition.
+	 * @example
+	 */
+	addHandler : function( type, handler )
+	{
+		this._.handlers[ type ] = handler;
+	}
+};
+
+/**
+ * (Virtual Class) Do not call this constructor. This class is not really part
+ *		of the API. It just illustrates the features of hanlder objects to be
+ *		passed to the {@link CKEDITOR.ui.prototype.addHandler} function.
+ * @name CKEDITOR.ui.handlerDefinition
+ * @constructor
+ * @example
+ */
+
+ /**
+ * Transforms an item definition into an UI item object.
+ * @name CKEDITOR.handlerDefinition.prototype.create
+ * @function
+ * @param {Object} definition The item definition.
+ * @example
+ * editorInstance.ui.addHandler( CKEDITOR.UI_BUTTON,
+ *     {
+ *         create : function( definition )
+ *         {
+ *             return new CKEDITOR.ui.button( definition );
+ *         }
+ *     });
+ */
Index: /CKEditor/tags/3.0 Beta/_source/core/xml.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/core/xml.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/core/xml.js	(revision 3046)
@@ -0,0 +1,164 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Defines the {@link CKEDITOR.xml} class, which represents a
+ *		loaded XML document.
+ */
+
+/**
+ * Represents a loaded XML document.
+ * @constructor
+ * @param {object|string} xmlObjectOrData A native XML (DOM document) object or
+ *		a string containing the XML definition to be loaded.
+ * @example
+ * var xml = <b>new CKEDITOR.xml( '<books><book title="My Book" /></books>' )</b>;
+ */
+CKEDITOR.xml = function( xmlObjectOrData )
+{
+	var baseXml = null;
+
+	if ( typeof xmlObjectOrData == 'object' )
+		baseXml = xmlObjectOrData;
+	else
+	{
+		if ( window.DOMParser )
+			baseXml = (new DOMParser()).parseFromString( xmlObjectOrData || '', 'text/xml' );
+		else if ( window.ActiveXObject )
+		{
+			try { baseXml = new ActiveXObject( 'MSXML2.DOMDocument' ); }
+			catch(e)
+			{
+				try { baseXml = new ActiveXObject( 'Microsoft.XmlDom' ); } catch(e) {}
+			}
+
+			if ( baseXml )
+			{
+				baseXml.async = false;
+				baseXml.resolveExternals = false;
+				baseXml.validateOnParse = false;
+				baseXml.loadXML( xmlObjectOrData || '' );
+			}
+		}
+	}
+
+	/**
+	 * The native XML (DOM document) used by the class instance.
+	 * @type object
+	 * @example
+	 */
+	this.baseXml = baseXml;
+};
+
+CKEDITOR.xml.prototype =
+{
+	/**
+	 * Get a single node from the XML document, based on a XPath query.
+	 * @param {String} xpath The XPath query to execute.
+	 * @param {Object} [contextNode] The XML DOM node to be used as the context
+	 *		for the XPath query. The document root is used by default.
+	 * @returns {Object} A XML node element or null if the query has no results.
+	 * @example
+	 * // Create the XML instance.
+	 * var xml = new CKEDITOR.xml( '<list><item id="test1" /><item id="test2" /></list>' );
+	 * // Get the first <item> node.
+	 * var itemNode = <b>xml.selectSingleNode( 'list/item' )</b>;
+	 * // Alert "item".
+	 * alert( itemNode.nodeName );
+	 */
+	selectSingleNode : function( xpath, contextNode )
+	{
+		var baseXml = this.baseXml;
+
+		if ( contextNode || ( contextNode = baseXml ) )
+		{
+			if ( CKEDITOR.env.ie || contextNode.selectSingleNode )	// IE
+				return contextNode.selectSingleNode( xpath );
+			else if ( baseXml.evaluate )							// Others
+			{
+				var result = baseXml.evaluate( xpath, contextNode, null, 9, null);
+				return ( result && result.singleNodeValue ) || null;
+			}
+		}
+
+		return null;
+	},
+
+	/**
+	 * Gets a list node from the XML document, based on a XPath query.
+	 * @param {String} xpath The XPath query to execute.
+	 * @param {Object} [contextNode] The XML DOM node to be used as the context
+	 *		for the XPath query. The document root is used by default.
+	 * @returns {ArrayLike} An array containing all matched nodes. The array will
+	 *		be empty if the query has no results.
+	 * @example
+	 * // Create the XML instance.
+	 * var xml = new CKEDITOR.xml( '<list><item id="test1" /><item id="test2" /></list>' );
+	 * // Get the first <item> node.
+	 * var itemNodes = xml.selectSingleNode( 'list/item' );
+	 * // Alert "item" twice, one for each <item>.
+	 * for ( var i = 0 ; i < itemNodes.length ; i++ )
+	 *     alert( itemNodes[i].nodeName );
+	 */
+	selectNodes : function( xpath, contextNode )
+	{
+		var baseXml = this.baseXml,
+			nodes = [];
+
+		if ( contextNode || ( contextNode = baseXml ) )
+		{
+			if ( CKEDITOR.env.ie || contextNode.selectNodes )		// IE
+				return contextNode.selectNodes( xpath );
+			else if ( baseXml.evaluate )							// Others
+			{
+				var result = baseXml.evaluate( xpath, contextNode, null, 5, null);
+
+				if ( result )
+				{
+					var node;
+					while( ( node = result.iterateNext() ) )
+						nodes.push( node );
+				}
+			}
+		}
+
+		return nodes;
+	},
+
+	/**
+	 * Gets the string representation of hte inner contents of a XML node,
+	 * based on a XPath query.
+	 * @param {String} xpath The XPath query to execute.
+	 * @param {Object} [contextNode] The XML DOM node to be used as the context
+	 *		for the XPath query. The document root is used by default.
+	 * @returns {String} The textual representation of the inner contents of
+	 *		the node or null if the query has no results.
+	 * @example
+	 * // Create the XML instance.
+	 * var xml = new CKEDITOR.xml( '<list><item id="test1" /><item id="test2" /></list>' );
+	 * // Alert "<item id="test1" /><item id="test2" />".
+	 * alert( xml.getInnerXml( 'list' ) );
+	 */
+	getInnerXml : function( xpath, contextNode )
+	{
+		var node = this.selectSingleNode( xpath, contextNode ),
+			xml = [];
+		if ( node )
+		{
+			node = node.firstChild;
+			while ( node )
+			{
+				if ( node.xml )				// IE
+					xml.push( node.xml );
+				else if ( window.XMLSerializer )	// Others
+					xml.push( ( new XMLSerializer() ).serializeToString( node ) );
+
+				node = node.nextSibling;
+			}
+		}
+
+		return xml.length ? xml.join( '' ) : null;
+	}
+};
Index: /CKEditor/tags/3.0 Beta/_source/lang/en.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/lang/en.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/lang/en.js	(revision 3046)
@@ -0,0 +1,370 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Defines the {@link CKEDITOR.lang} object, for the English
+ *		language. This is the base file for all translations.
+ */
+
+/**#@+
+   @type String
+   @example
+*/
+
+/**
+ * Constains the dictionary of language entries.
+ * @namespace
+ */
+CKEDITOR.lang['en'] =
+{
+	/**
+	 * The language reading direction. Possible values are "rtl" for
+	 * Right-To-Left languages (like Arabic) and "ltr" for Left-To-Right
+	 * languages (like English).
+	 * @default 'ltr'
+	 */
+	dir : 'ltr',
+
+	// Toolbar buttons without dialogs.
+	source			: 'Source',
+	newPage			: 'New Page',
+	print			: 'Print',
+	underline		: 'Underline',
+	bold			: 'Bold',
+	italic			: 'Italic',
+	selectAll		: 'Select All',
+	removeFormat	: 'Remove Format',
+	strike			: 'Strike Through',
+	subscript		: 'Subscript',
+	superscript		: 'Superscript',
+	horizontalrule	: 'Insert Horizontal Line',
+	pagebreak		: 'Insert Page Break',
+	unlink			: 'Unlink',
+
+	// Common messages and labels.
+	common :
+	{
+		browseServer	: 'Browser Server',
+		url				: 'URL',
+		protocol		: 'Protocol',
+		upload			: 'Upload',
+		uploadSubmit	: 'Send it to the Server',
+		image			: 'Image',
+		flash			: 'Flash',
+		form			: 'Form',
+		checkbox		: 'Checkbox',
+		radio		: 'Radio Button',
+		textField		: 'Text Field',
+		textarea		: 'Textarea',
+		hiddenField		: 'Hidden Field',
+		button			: 'Button',
+		select	: 'Selection Field',
+		imageButton		: 'Image Button',
+		notSet			: '<not set>',
+		id				: 'Id',
+		name			: 'Name',
+		langDir			: 'Language Direction',
+		langDirLtr		: 'Left to Right (LTR)',
+		langDirRtl		: 'Right to Left (RTL)',
+		langCode		: 'Language Code',
+		longDescr		: 'Long Description URL',
+		cssClass		: 'Stylesheet Classes',
+		advisoryTitle	: 'Advisory Title',
+		cssStyle		: 'Style',
+		ok				: 'OK',
+		cancel			: 'Cancel',
+		generalTab		: 'General',
+		advancedTab		: 'Advanced',
+		validateNumberFailed	: 'This value is not a number.',
+		confirmNewPage	: 'Any unsaved changes to this content will be lost. Are you sure you want to load new page?',
+		confirmCancel	: 'Some of the options have been changed. Are you sure to close the dialog?'
+	},
+
+	// Special char dialog.
+	specialChar		:
+	{
+		toolbar		: 'Insert Special Character',
+		title		: 'Select Special Character'
+	},
+
+	// Link dialog.
+	link :
+	{
+		toolbar		: 'Link\u200b',		// IE6 BUG: A title called "Link" in an <A> tag would invalidate its padding!!
+		title		: 'Link',
+		info		: 'Link Info',
+		target		: 'Target',
+		upload		: 'Upload',
+		advanced	: 'Advanced',
+		type		: 'Link Type',
+		toAnchor	: 'Link to anchor in the text',
+		toEmail		: 'E-mail',
+		target		: 'Target',
+		targetNotSet	: '<not set>',
+		targetFrame	: '<frame>',
+		targetPopup	: '<popup window>',
+		targetNew	: 'New Window (_blank)',
+		targetTop	: 'Topmost Window (_top)',
+		targetSelf	: 'Same Window (_self)',
+		targetParent	: 'Parent Window (_parent)',
+		targetFrameName	: 'Target Frame Name',
+		targetPopupName	: 'Popup Window Name',
+		popupFeatures	: 'Popup Window Features',
+		popupResizable	: 'Resizable',
+		popupStatusBar	: 'Status Bar',
+		popupLocationBar	: 'Location Bar',
+		popupToolbar	: 'Toolbar',
+		popupMenuBar	: 'Menu Bar',
+		popupFullScreen	: 'Full Screen (IE)',
+		popupScrollBars	: 'Scroll Bars',
+		popupDependent	: 'Dependent (Netscape)',
+		popupWidth		: 'Width',
+		popupLeft		: 'Left Position',
+		popupHeight		: 'Height',
+		popupTop		: 'Top Position',
+		id				: 'Id',
+		langDir			: 'Language Direction',
+		langDirNotSet	: '<not set>',
+		langDirLTR		: 'Left to Right',
+		langDirRTL		: 'Right to Left',
+		acccessKey		: 'Access Key',
+		name			: 'Name',
+		langCode		: 'Language Code',
+		tabIndex		: 'Tab Index',
+		advisoryTitle	: 'Advisory Title',
+		advisoryContentType	: 'Advisory Content Type',
+		cssClasses		: 'Stylesheet Classes',
+		charset			: 'Linked Resource Charset',
+		styles			: 'Style',
+		selectAnchor	: 'Select an Anchor',
+		anchorName		: 'By Anchor Name',
+		anchorId		: 'By Element Id',
+		emailAddress	: 'E-Mail Address',
+		emailSubject	: 'Message Subject',
+		emailBody		: 'Message Body',
+		noAnchors		: '(No anchors available in the document)',
+		noUrl			: 'Please type the link URL',
+		noEmail			: 'Please type the e-mail address'
+	},
+
+	// Anchor dialog
+	anchor :
+	{
+		toolbar		: 'Anchor',
+		title		: 'Anchor Properties',
+		name		: 'Anchor Name',
+		errorName	: 'Please type the anchor name'
+	},
+
+	// Find And Replace Dialog
+	findAndReplace :
+	{
+		title				: 'Find and Replace',
+		find				: 'Find',
+		replace				: 'Replace',
+		findWhat			: 'Find what:',
+		replaceWith			: 'Replace with:',
+		notFoundMsg			: 'The specified text was not found.',
+		matchCase			: 'Match case',
+		matchWord			: 'Match whole word',
+		matchCyclic			: 'Match cyclic',
+		replaceAll			: 'Replace All'
+	},
+
+	// Table Dialog
+	table :
+	{
+		toolbar		: 'Table',
+		title		: 'Table Properties',
+		rows		: 'Rows',
+		columns		: 'Columns',
+		border		: 'Border size',
+		align		: 'Alignment',
+		alignNotSet	: '<Not set>',
+		alignLeft	: 'Left',
+		alignCenter	: 'Center',
+		alignRight	: 'Right',
+		width		: 'Width',
+		widthPx		: 'pixels',
+		widthPc		: 'percent',
+		height		: 'Height',
+		cellSpace	: 'Cell spacing',
+		cellPad		: 'Cell padding',
+		caption		: 'Caption',
+		summary		: 'Summary',
+		headers		: 'Headers',
+		headersNone		: 'None',
+		headersColumn	: 'First column',
+		headersRow		: 'First Row',
+		headersBoth		: 'Both'
+	},
+
+	// Button Dialog.
+	button :
+	{
+		title		: 'Button Properties',
+		text		: 'Text (Value)',
+		type		: 'Type',
+		typeBtn		: 'Button',
+		typeSbm		: 'Submit',
+		typeRst		: 'Reset'
+	},
+
+	// Checkbox and Radio Button Dialogs.
+	checkboxAndRadio :
+	{
+		checkboxTitle : 'Checkbox Properties',
+		radioTitle	: 'Radio Button Properties',
+		value		: 'Value',
+		selected	: 'Selected'
+	},
+
+	// Form Dialog.
+	form :
+	{
+		title		: 'Form Properties',
+		action		: 'Action',
+		method		: 'Method',
+		encoding	: 'Encoding',
+		target		: 'Target',
+		targetNotSet	: '<not set>',
+		targetNew	: 'New Window (_blank)',
+		targetTop	: 'Topmost Window (_top)',
+		targetSelf	: 'Same Window (_self)',
+		targetParent	: 'Parent Window (_parent)'
+	},
+
+	// Select Field Dialog.
+	select :
+	{
+		title		: 'Selection Field Properties',
+		selectInfo	: 'Select Info',
+		opAvail		: 'Available Options',
+		value		: 'Value',
+		size		: 'Size',
+		lines		: 'lines',
+		chkMulti	: 'Allow multiple selections',
+		opText		: 'Text',
+		opValue		: 'Value',
+		btnAdd		: 'Add',
+		btnModify	: 'Modify',
+		btnUp		: 'Up',
+		btnDown		: 'Down',
+		btnSetValue : 'Set as selected value',
+		btnDelete	: 'Delete'
+	},
+
+	// Textarea Dialog.
+	textarea :
+	{
+		title		: 'Textarea Properties',
+		cols		: 'Columns',
+		rows		: 'Rows'
+	},
+
+	// Text Field Dialog.
+	textfield :
+	{
+		title		: 'Text Field Properties',
+		name		: 'Name',
+		value		: 'Value',
+		charWidth	: 'Character Width',
+		maxChars	: 'Maximum Characters',
+		type		: 'Type',
+		typeText	: 'Text',
+		typePass	: 'Password'
+	},
+
+	// Hidden Field Dialog.
+	hidden :
+	{
+		title	: 'Hidden Field Properties',
+		name	: 'Name',
+		value	: 'Value'
+	},
+
+	// Image Dialog.
+	image :
+	{
+		title		: 'Image Properties',
+		titleButton	: 'Image Button Properties',
+		infoTab	: 'Image Info',
+		btnUpload	: 'Send it to the Server',
+		url		: 'URL',
+		upload	: 'Upload',
+		alt		: 'Alternative Text',
+		width		: 'Width',
+		height	: 'Height',
+		lockRatio	: 'Lock Ratio',
+		resetSize	: 'Reset Size',
+		border	: 'Border',
+		hSpace	: 'HSpace',
+		vSpace	: 'VSpace',
+		align		: 'Align',
+		alignLeft	: 'Left',
+		alignAbsBottom: 'Abs Bottom',
+		alignAbsMiddle: 'Abs Middle',
+		alignBaseline	: 'Baseline',
+		alignBottom	: 'Bottom',
+		alignMiddle	: 'Middle',
+		alignRight	: 'Right',
+		alignTextTop	: 'Text Top',
+		alignTop	: 'Top',
+		preview	: 'Preview',
+		alertUrl	: 'Please type the image URL',
+		linkTab	: 'Link',
+		button2Img	: 'Do you want to transform the selected image button on a simple image?',
+		img2Button	: 'Do you want to transform the selected image on a image button?'
+	},
+
+	// Flash Dialog
+	flash :
+	{
+		properties		: 'Flash Properties',
+		propertiesTab	: 'Properties',
+		title		: 'Flash Properties',
+		chkPlay		: 'Auto Play',
+		chkLoop		: 'Loop',
+		chkMenu		: 'Enable Flash Menu',
+		chkFull		: 'Allow Fullscreen',
+ 		scale		: 'Scale',
+		scaleAll		: 'Show all',
+		scaleNoBorder	: 'No Border',
+		scaleFit		: 'Exact Fit',
+		access			: 'Script Access',
+		accessAlways	: 'Always',
+		accessSameDomain	: 'Same domain',
+		accessNever	: 'Never',
+		align		: 'Align',
+		alignLeft	: 'Left',
+		alignAbsBottom: 'Abs Bottom',
+		alignAbsMiddle: 'Abs Middle',
+		alignBaseline	: 'Baseline',
+		alignBottom	: 'Bottom',
+		alignMiddle	: 'Middle',
+		alignRight	: 'Right',
+		alignTextTop	: 'Text Top',
+		alignTop	: 'Top',
+		quality		: 'Quality',
+		windowMode	: 'Window mode',
+		flashvars	: 'Variables for Flash',
+		bgcolor	: 'Background color',
+		width	: 'Width',
+		height	: 'Height',
+		hSpace	: 'HSpace',
+		vSpace	: 'VSpace'
+	},
+
+	smiley :
+	{
+		toolbar	: 'Smiley',
+		title	: 'Insert a Smiley'
+	},
+
+	elementsPath :
+	{
+		eleTitle : '%1 element'
+	}
+};
Index: /CKEditor/tags/3.0 Beta/_source/plugins/basicstyles/plugin.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/plugins/basicstyles/plugin.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/plugins/basicstyles/plugin.js	(revision 3046)
@@ -0,0 +1,52 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+CKEDITOR.plugins.add( 'basicstyles',
+{
+	requires : [ 'styles', 'button' ],
+
+	init : function( editor, pluginPath )
+	{
+		// All buttons use the same code to register. So, to avoid
+		// duplications, let's use this tool function.
+		var addButtonCommand = function( buttonName, buttonLabel, commandName, styleDefiniton )
+		{
+			var style = new CKEDITOR.style( styleDefiniton );
+
+			editor.attachStyleStateChange( style, function( state )
+				{
+					var command = editor.getCommand( commandName );
+					command.state = state;
+					command.fire( 'state' );
+				});
+
+			editor.addCommand( commandName, new CKEDITOR.styleCommand( style ) );
+
+			editor.ui.addButton( buttonName,
+				{
+					label : buttonLabel,
+					command : commandName
+				});
+		};
+
+		var config = editor.config;
+		var lang = editor.lang;
+
+		addButtonCommand( 'Bold'		, lang.bold			, 'bold'		, config.coreStyles_bold );
+		addButtonCommand( 'Italic'		, lang.italic		, 'italic'		, config.coreStyles_italic );
+		addButtonCommand( 'Underline'	, lang.underline	, 'underline'	, config.coreStyles_underline );
+		addButtonCommand( 'Strike'		, lang.strike		, 'strike'		, config.coreStyles_strike );
+		addButtonCommand( 'Subscript'	, lang.subscript	, 'subscript'	, config.coreStyles_subscript );
+		addButtonCommand( 'Superscript'	, lang.superscript	, 'superscript'	, config.coreStyles_superscript );
+	}
+});
+
+// Basic Inline Styles.
+CKEDITOR.config.coreStyles_bold			= { element : 'strong', overrides : 'b' };
+CKEDITOR.config.coreStyles_italic		= { element : 'em', overrides : 'i' };
+CKEDITOR.config.coreStyles_underline	= { element : 'u' };
+CKEDITOR.config.coreStyles_strike		= { element : 'strike' };
+CKEDITOR.config.coreStyles_subscript	= { element : 'sub' };
+CKEDITOR.config.coreStyles_superscript	= { element : 'sup' };
Index: /CKEditor/tags/3.0 Beta/_source/plugins/button/plugin.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/plugins/button/plugin.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/plugins/button/plugin.js	(revision 3046)
@@ -0,0 +1,237 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+CKEDITOR.plugins.add( 'button',
+{
+	beforeInit : function( editor )
+	{
+		editor.ui.addHandler( CKEDITOR.UI_BUTTON, CKEDITOR.ui.button.handler );
+	}
+});
+
+/**
+ * Button UI element.
+ * @constant
+ * @example
+ */
+CKEDITOR.UI_BUTTON = 1;
+
+/**
+ * Represents a button UI element. This class should not be called directly. To
+ * create new buttons use {@link CKEDITOR.ui.prototype.addButton} instead.
+ * @constructor
+ * @param {Object} definition The button definition.
+ * @example
+ */
+CKEDITOR.ui.button = function( definition )
+{
+	/**
+	 * The button label.
+	 * @name CKEDITOR.ui.button.prototype.label
+	 * @type String
+	 * @example
+	 */
+	this.label = definition.label;
+
+	/**
+	 * The button advisory title. It is usually displayed as the button tooltip.
+	 * If not defined, the label is used.
+	 * @name CKEDITOR.ui.button.prototype.title
+	 * @type String
+	 * @example
+	 */
+	this.title = definition.title || definition.label;
+
+	/**
+	 * The command name associated to the button. If no command is defined, the
+	 * "click" event is used.
+	 * @name CKEDITOR.ui.button.prototype.command
+	 * @type String
+	 * @example
+	 */
+	this.command = definition.command;
+
+	this.className = definition.className || ( definition.command && 'cke_button_' + definition.command ) || '';
+
+	/**
+	 * The function to be called when the user clicks the button. If not
+	 * defined, the "command" property is required, and the command gets
+	 * executed on click.
+	 * @function
+	 * @name CKEDITOR.ui.button.prototype.click
+	 * @example
+	 */
+	this.click = definition.click || function( editor )
+		{
+			editor.execCommand( definition.command );
+		};
+
+	this._ = {};
+};
+
+/**
+ * Transforms a button definition in a {@link CKEDITOR.ui.button} instance.
+ * @type Object
+ * @example
+ */
+CKEDITOR.ui.button.handler =
+{
+	create : function( definition )
+	{
+		return new CKEDITOR.ui.button( definition );
+	}
+};
+
+CKEDITOR.ui.button.prototype =
+{
+	/**
+	 * Renders the button.
+	 * @param {CKEDITOR.editor} editor The editor instance which this button is
+	 *		to be used by.
+	 * @param {Array} output The output array to which append the HTML relative
+	 *		to this button.
+	 * @example
+	 */
+	render : function( editor, output )
+	{
+		var env = CKEDITOR.env;
+
+		var id = this._.id = 'cke_' + CKEDITOR.tools.getNextNumber();
+
+		var instance =
+		{
+			id : id,
+			button : this,
+			editor : editor,
+			focus : function()
+			{
+				var element = CKEDITOR.document.getById( id );
+				element.focus();
+			},
+			execute : function()
+			{
+				this.button.click( editor );
+			}
+		};
+
+		// Get the command name.
+		var command = this.command;
+
+		if ( command )
+		{
+			// Get the command instance.
+			command = editor.getCommand( command );
+
+			if ( command )
+			{
+				command.on( 'state', function()
+					{
+						this.setState( command.state );
+					}, this);
+			}
+		}
+
+		var index = CKEDITOR.ui.button._.instances.push( instance ) - 1;
+
+		output.push(
+			'<a id="', id, '"' +
+				' class="cke_button ', this.className, '" href="javascript:void(\'', ( this.label || '' ).replace( "'", '' ), '\')"' +
+				' title="', this.title, '"' +
+				' tabindex="-1"' +
+				' hidefocus="true"' );
+
+		// Some browsers don't cancel key events in the keydown but in the
+		// keypress.
+		// TODO: Check if really needed for Gecko+Mac.
+		if ( env.opera || ( env.gecko && env.mac ) )
+		{
+			output.push(
+				' onkeypress="return false;"' );
+		}
+
+		// With Firefox, we need to force the button to redraw, otherwise it
+		// will remain in the focus state.
+		if ( env.gecko )
+		{
+			output.push(
+				' onblur="this.style.cssText = this.style.cssText;"' );
+		}
+
+		output.push(
+				' onkeydown="return CKEDITOR.ui.button._.keydown(', index, ', event);"' +
+				' onclick="return CKEDITOR.ui.button._.click(', index, ', event);">' +
+					'<span class="cke_icon"></span>' +
+					'<span class="cke_label">', this.label, '</span>' +
+			'</a>' );
+
+		return instance;
+	},
+
+	setState : function( state )
+	{
+		var element = CKEDITOR.document.getById( this._.id );
+
+		switch ( state )
+		{
+			case CKEDITOR.TRISTATE_ON :
+				element.addClass( 'cke_on' );
+				element.removeClass( 'cke_off' );
+				element.removeClass( 'cke_disabled' );
+				break;
+			case CKEDITOR.TRISTATE_DISABLED :
+				element.addClass( 'cke_disabled' );
+				element.removeClass( 'cke_off' );
+				element.removeClass( 'cke_on' );
+				break;
+			default :
+				element.addClass( 'cke_off' );
+				element.removeClass( 'cke_on' );
+				element.removeClass( 'cke_disabled' );
+				break;
+		}
+	}
+};
+
+/**
+ * Handles a button click.
+ * @private
+ */
+CKEDITOR.ui.button._ =
+{
+	instances : [],
+
+	click : function( index )
+	{
+		CKEDITOR.ui.button._.instances[ index ].execute();
+		return false;
+	},
+
+	keydown : function( index, ev )
+	{
+		var instance = CKEDITOR.ui.button._.instances[ index ];
+
+		if ( instance.onkey )
+		{
+			ev = new CKEDITOR.dom.event( ev );
+			return ( instance.onkey( instance, ev.getKeystroke() ) !== false );
+		}
+	}
+};
+
+/**
+ * Adds a button definition to the UI elements list.
+ * @param {String} The button name.
+ * @param {Object} The button definition.
+ * @example
+ * editorInstance.ui.addButton( 'MyBold',
+ *     {
+ *         label : 'My Bold',
+ *         command : 'bold'
+ *     });
+ */
+CKEDITOR.ui.prototype.addButton = function( name, definition )
+{
+	this.add( name, CKEDITOR.UI_BUTTON, definition );
+};
Index: /CKEditor/tags/3.0 Beta/_source/plugins/dialog/dialogDefinition.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/plugins/dialog/dialogDefinition.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/plugins/dialog/dialogDefinition.js	(revision 3046)
@@ -0,0 +1,315 @@
+/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Defines the "virtual" dialog, dialog content and dialog button
+ * definition classes.
+ */
+
+/**
+ * This class is not really part of the API. It just illustrates the properties
+ * that developers can use to define and create dialogs.
+ * @name CKEDITOR.dialog.dialogDefinition
+ * @constructor
+ * @example
+ * // There is no constructor for this class, the user just has to define an
+ * // object with the appropriate properties.
+ *
+ * CKEDITOR.dialog.add( 'testOnly', function( editor )
+ *       {
+ *           return {
+ *               title : 'Test Dialog',
+ *               resizable : CKEDITOR.DIALOG_RESIZE_BOTH,
+ *               minWidth : 500,
+ *               minHeight : 400,
+ *               contents : [
+ *                   {
+ *                       id : 'tab1',
+ *                       label : 'First Tab',
+ *                       title : 'First Tab Title',
+ *                       accessKey : 'Q',
+ *                       elements : [
+ *                           {
+ *                               type : 'text',
+ *                               label : 'Test Text 1',
+ *                               id : 'testText1',
+ *                               'default' : 'hello world!'
+ *                           }
+ *                       ]
+ *                    }
+ *               ]
+ *           };
+ *       });
+ */
+
+/**
+ * The dialog title, displayed in the dialog's header. Required.
+ * @name CKEDITOR.dialog.dialogDefinition.prototype.title
+ * @field
+ * @type String
+ * @example
+ */
+
+/**
+ * How the dialog can be resized, must be one of the four contents defined below.
+ * <br /><br />
+ * <strong>CKEDITOR.DIALOG_RESIZE_NONE</strong><br />
+ * <strong>CKEDITOR.DIALOG_RESIZE_WIDTH</strong><br />
+ * <strong>CKEDITOR.DIALOG_RESIZE_HEIGHT</strong><br />
+ * <strong>CKEDITOR.DIALOG_RESIZE_BOTH</strong><br />
+ * @name CKEDITOR.dialog.dialogDefinition.prototype.resizable
+ * @field
+ * @type Number
+ * @default CKEDITOR.DIALOG_RESIZE_NONE
+ * @example
+ */
+
+/**
+ * The minimum width of the dialog, in pixels.
+ * @name CKEDITOR.dialog.dialogDefinition.prototype.minWidth
+ * @field
+ * @type Number
+ * @default 600
+ * @example
+ */
+
+/**
+ * The minimum height of the dialog, in pixels.
+ * @name CKEDITOR.dialog.dialogDefinition.prototype.minHeight
+ * @field
+ * @type Number
+ * @default 400
+ * @example
+ */
+
+/**
+ * The buttons in the dialog, defined as an array of
+ * {@link CKEDITOR.dialog.buttonDefinition} objects.
+ * @name CKEDITOR.dialog.dialogDefinition.prototype.buttons
+ * @field
+ * @type Array
+ * @default [ CKEDITOR.dialog.okButton, CKEDITOR.dialog.cancelButton ]
+ * @example
+ */
+
+/**
+ * The contents in the dialog, defined as an array of
+ * {@link CKEDITOR.dialog.contentDefinition} objects. Required.
+ * @name CKEDITOR.dialog.dialogDefinition.prototype.contents
+ * @field
+ * @type Array
+ * @example
+ */
+
+/**
+ * The function to execute when OK is pressed.
+ * @name CKEDITOR.dialog.dialogDefinition.prototype.onOk
+ * @field
+ * @type Function
+ * @example
+ */
+
+/**
+ * The function to execute when Cancel is pressed.
+ * @name CKEDITOR.dialog.dialogDefinition.prototype.onCancel
+ * @field
+ * @type Function
+ * @example
+ */
+
+/**
+ * The function to execute when the dialog is displayed for the first time.
+ * @name CKEDITOR.dialog.dialogDefinition.prototype.onLoad
+ * @field
+ * @type Function
+ * @example
+ */
+
+/**
+ * This class is not really part of the API. It just illustrates the properties
+ * that developers can use to define and create dialog content pages.
+ * @name CKEDITOR.dialog.contentDefinition
+ * @constructor
+ * @example
+ * // There is no constructor for this class, the user just has to define an
+ * // object with the appropriate properties.
+ */
+
+/**
+ * The id of the content page.
+ * @name CKEDITOR.dialog.contentDefinition.prototype.id
+ * @field
+ * @type String
+ * @example
+ */
+
+/**
+ * The tab label of the content page.
+ * @name CKEDITOR.dialog.contentDefinition.prototype.label
+ * @field
+ * @type String
+ * @example
+ */
+
+/**
+ * The popup message of the tab label.
+ * @name CKEDITOR.dialog.contentDefinition.prototype.title
+ * @field
+ * @type String
+ * @example
+ */
+
+/**
+ * The CTRL hotkey for switching to the tab.
+ * @name CKEDITOR.dialog.contentDefinition.prototype.accessKey
+ * @field
+ * @type String
+ * @example
+ * contentDefinition.accessKey = 'Q';	// Switch to this page when CTRL-Q is pressed.
+ */
+
+/**
+ * The UI elements contained in this content page, defined as an array of
+ * {@link CKEDITOR.dialog.uiElementDefinition} objects.
+ * @name CKEDITOR.dialog.contentDefinition.prototype.elements
+ * @field
+ * @type Array
+ * @example
+ */
+
+/**
+ * This class is not really part of the API. It just illustrates the properties
+ * that developers can use to define and create dialog buttons.
+ * @name CKEDITOR.dialog.buttonDefinition
+ * @constructor
+ * @example
+ * // There is no constructor for this class, the user just has to define an
+ * // object with the appropriate properties.
+ */
+
+/**
+ * The id of the dialog button. Required.
+ * @name CKEDITOR.dialog.buttonDefinition.prototype.id
+ * @type String
+ * @field
+ * @example
+ */
+
+/**
+ * The label of the dialog button. Required.
+ * @name CKEDITOR.dialog.buttonDefinition.prototype.label
+ * @type String
+ * @field
+ * @example
+ */
+
+/**
+ * The popup message of the dialog button.
+ * @name CKEDITOR.dialog.buttonDefinition.prototype.title
+ * @type String
+ * @field
+ * @example
+ */
+
+/**
+ * The CTRL hotkey for the button.
+ * @name CKEDITOR.dialog.buttonDefinition.prototype.accessKey
+ * @type String
+ * @field
+ * @example
+ * exitButton.accessKey = 'X';		// Button will be pressed when user presses CTRL-X
+ */
+
+/**
+ * Whether the button is disabled.
+ * @name CKEDITOR.dialog.buttonDefinition.prototype.disabled
+ * @type Boolean
+ * @field
+ * @default false
+ * @example
+ */
+
+/**
+ * The function to execute when the button is clicked.
+ * @name CKEDITOR.dialog.buttonDefinition.prototype.onClick
+ * @type Function
+ * @field
+ * @example
+ */
+
+/**
+ * This class is not really part of the API. It just illustrates the properties
+ * that developers can use to define and create dialog UI elements.
+ * @name CKEDITOR.dialog.uiElementDefinition
+ * @constructor
+ * @see CKEDITOR.ui.dialog.uiElement
+ * @example
+ * // There is no constructor for this class, the user just has to define an
+ * // object with the appropriate properties.
+ */
+
+/**
+ * The id of the UI element.
+ * @name CKEDITOR.dialog.uiElementDefinition.prototype.id
+ * @field
+ * @type String
+ * @example
+ */
+
+/**
+ * The type of the UI element. Required.
+ * @name CKEDITOR.dialog.uiElementDefinition.prototype.type
+ * @field
+ * @type String
+ * @example
+ */
+
+/**
+ * The popup label of the UI element.
+ * @name CKEDITOR.dialog.uiElementDefinition.prototype.title
+ * @field
+ * @type String
+ * @example
+ */
+
+/**
+ * CSS class names to append to the UI element.
+ * @name CKEDITOR.dialog.uiElementDefinition.prototype.className
+ * @field
+ * @type String
+ * @example
+ */
+
+/**
+ * Inline CSS classes to append to the UI element.
+ * @name CKEDITOR.dialog.uiElementDefinition.prototype.style
+ * @field
+ * @type String
+ * @example
+ */
+
+/**
+ * Function to execute the first time the UI element is displayed.
+ * @name CKEDITOR.dialog.uiElementDefinition.prototype.onLoad
+ * @field
+ * @type Function
+ * @example
+ */
+
+/**
+ * Function to execute whenever the UI element's parent dialog is displayed.
+ * @name CKEDITOR.dialog.uiElementDefinition.prototype.onShow
+ * @field
+ * @type Function
+ * @example
+ */
+
+/**
+ * Function to execute whenever the UI element's parent dialog is closed.
+ * @name CKEDITOR.dialog.uiElementDefinition.prototype.onHide
+ * @field
+ * @type Function
+ * @example
+ */
Index: /CKEditor/tags/3.0 Beta/_source/plugins/dialog/plugin.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/plugins/dialog/plugin.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/plugins/dialog/plugin.js	(revision 3046)
@@ -0,0 +1,2439 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview The floating dialog plugin.
+ */
+
+CKEDITOR.plugins.add( 'dialog',
+	{
+		requires : [ 'dialogui' ]
+	});
+
+/**
+ * No resize for this dialog.
+ * @constant
+ */
+CKEDITOR.DIALOG_RESIZE_NONE = 0;
+
+/**
+ * Only allow horizontal resizing for this dialog, disable vertical resizing.
+ * @constant
+ */
+CKEDITOR.DIALOG_RESIZE_WIDTH = 1;
+
+/**
+ * Only allow vertical resizing for this dialog, disable horizontal resizing.
+ * @constant
+ */
+CKEDITOR.DIALOG_RESIZE_HEIGHT = 2;
+
+/*
+ * Allow the dialog to be resized in both directions.
+ * @constant
+ */
+CKEDITOR.DIALOG_RESIZE_BOTH = 3;
+
+(function()
+{
+	/**
+	 * This is the base class for runtime dialog objects. An instance of this
+	 * class represents a single named dialog for a single editor instance.
+	 * @param {Object} editor The editor which created the dialog.
+	 * @param {String} dialogName The dialog's registered name.
+	 * @constructor
+	 * @example
+	 * var dialogObj = new CKEDITOR.dialog( editor, 'smiley' );
+	 */
+	CKEDITOR.dialog = function( editor, dialogName )
+	{
+		// Load the dialog definition.
+		var definition = CKEDITOR.dialog._.dialogDefinitions[ dialogName ];
+		if ( !definition )
+		{
+			console.log( 'Error: The dialog "' + dialogName + '" is not defined.' );
+			return;
+		}
+
+		// Completes the definition with the default values.
+		definition = CKEDITOR.tools.extend( definition( editor ), defaultDialogDefinition );
+
+		// Create a complex definition object, extending it with the API
+		// functions.
+		definition = new definitionObject( this, definition );
+
+		// Fire the "dialogDefinition" event, making it possible to customize
+		// the dialog definition.
+		this.definition = definition = CKEDITOR.fire( 'dialogDefinition',
+			{
+				name : dialogName,
+				definition : definition
+			}
+			, editor ).definition;
+
+		var themeBuilt = editor.theme.buildDialog( editor );
+
+		// Initialize some basic parameters.
+		this._ =
+		{
+			editor : editor,
+			element : themeBuilt.element,
+			name : dialogName,
+			size : { width : 0, height : 0 },
+			contents : {},
+			buttons : {},
+			accessKeyMap : {},
+
+			// Initialize the tab and page map.
+			tabs : {},
+			pageCount : 0,
+			lastTab : null
+		};
+
+		/**
+		 * An associative map of elements in the dialog. It has the following members:
+		 * <ul>
+		 * 	<li>tl - top left corner.</li>
+		 * 	<li>tl_resize - resize handle at the top left corner.</li>
+		 * 	<li>t - top side.</li>
+		 * 	<li>t_resize - resize handle at the top.</li>
+		 * 	<li>tr - top right corner.</li>
+		 * 	<li>tr_resize - resize handle at the top right.</li>
+		 * 	<li>l - left side.</li>
+		 * 	<li>l_resize - resize handle at the left side.</li>
+		 * 	<li>c - center area.</li>
+		 * 	<li>r - right side.</li>
+		 * 	<li>r_resize - resize handle at the right side.</li>
+		 * 	<li>bl - bottom left corner.</li>
+		 * 	<li>bl_resize - resize handle at the bottom left.</li>
+		 * 	<li>b - bottom side.</li>
+		 * 	<li>b_resize - resize handle at the bottom.</li>
+		 * 	<li>br - bottom right corner.</li>
+		 * 	<li>br_resize - resize handle at the bottom right.</li>
+		 * 	<li>title - title area.</li>
+		 * 	<li>close - close button.</li>
+		 * 	<li>tabs - tabs area.</li>
+		 * 	<li>contents - the content page area.</li>
+		 * 	<li>footer - the footer area.</li>
+		 * </ul>
+		 * @type Object
+		 * @field
+		 */
+		this.parts = {
+			'tl' : [0,0],
+			'tl_resize' : [0,0,0],
+			't' : [0,1],
+			't_resize' : [0,1,0],
+			'tr' : [0,2],
+			'tr_resize' : [0,2,0],
+			'l' : [1,0],
+			'l_resize' : [1,0,0],
+			'c' : [1,1],
+			'r' : [1,2],
+			'r_resize' : [1,2,0],
+			'bl' : [2,0],
+			'bl_resize' : [2,0,0],
+			'b' : [2,1],
+			'b_resize' : [2,1,0],
+			'br' : [2,2],
+			'br_resize' : [2,2,0],
+			'title' : [1,1,0],
+			'close' : [1,1,0,0],
+			'tabs' : [1,1,1,0,0],
+			'tabs_table' : [1,1,1],
+			'contents' : [1,1,2],
+			'footer' : [1,1,3]
+		};
+
+		// Initialize the parts map.
+		var element = this._.element.getFirst();
+		for ( var i in this.parts )
+			this.parts[i] = element.getChild( this.parts[i] );
+
+		// Call the CKEDITOR.event constructor to initialize this instance.
+		CKEDITOR.event.call( this );
+
+		// Initialize load, show, hide, ok and cancel events.
+		if ( definition.onLoad )
+			this.on( 'load', definition.onLoad );
+
+		if ( definition.onShow )
+			this.on( 'show', definition.onShow );
+
+		if ( definition.onHide )
+			this.on( 'hide', definition.onHide );
+
+		if ( definition.onOk )
+		{
+			this.on( 'ok', function( evt )
+				{
+					if ( definition.onOk.call( this, evt ) === false )
+						evt.data.hide = false;
+				});
+		}
+
+		if ( definition.onCancel )
+		{
+			this.on( 'cancel', function( evt )
+				{
+					if ( definition.onCancel.call( this, evt ) === false )
+						evt.data.hide = false;
+				});
+		}
+
+		var me = this;
+
+		// Iterates over all items inside all content in the dialog, calling a
+		// function for each of them.
+		var iterContents = function( func )
+		{
+			var contents = me._.contents,
+				stop = false;
+
+			for ( var i in contents )
+			{
+				for ( var j in contents[i] )
+				{
+					stop = func.call( this, contents[i][j] );
+					if ( stop )
+						return;
+				}
+			}
+		};
+
+		this.on( 'ok', function( evt )
+			{
+				iterContents( function( item )
+					{
+						if ( item.validate )
+						{
+							var isValid = item.validate( this );
+
+							if ( typeof isValid == 'string' )
+							{
+								alert( isValid );
+								isValid = false;
+							}
+
+							if ( isValid === false )
+							{
+								if ( item.select )
+									item.select();
+								else
+									item.focus();
+
+								evt.data.hide = false;
+								evt.stop();
+								return true;
+							}
+						}
+					});
+			}, this, null, 0 );
+
+		this.on( 'cancel', function( evt )
+			{
+				iterContents( function( item )
+					{
+						if ( item.isChanged() )
+						{
+							if ( !confirm( editor.lang.common.confirmCancel ) )
+								evt.data.hide = false;
+							return true;
+						}
+					});
+			}, this, null, 0 );
+
+		this.parts.close.on( 'click', function( evt )
+				{
+					if ( this.fire( 'cancel', { hide : true } ).hide !== false )
+						this.hide();
+				}, this );
+
+		// IE6 BUG: Text fields and text areas are only half-rendered the first time the dialog appears in IE6 (#2661).
+		// This is still needed after [2708] and [2709] because text fields in hidden TR tags are still broken.
+		if ( CKEDITOR.env.ie6Compat )
+		{
+			this.on( 'load', function( evt )
+					{
+						var outer = this.getElement(),
+							inner = outer.getFirst();
+						inner.remove();
+						inner.appendTo( outer );
+					}, this );
+		}
+
+		initDragAndDrop( this );
+		initResizeHandles( this );
+
+		// Insert the title.
+		( new CKEDITOR.dom.text( definition.title, CKEDITOR.document ) ).appendTo( this.parts.title );
+
+		// Insert the tabs and contents.
+		for ( i = 0 ; i < definition.contents.length ; i++ )
+			this.addPage( definition.contents[i] );
+
+		var tabRegex = /cke_dialog_tab(\s|$|_)/,
+			tabOuterRegex = /cke_dialog_tab(\s|$)/;
+		this.parts['tabs'].on( 'click', function( evt )
+				{
+					var target = evt.data.getTarget(), firstNode = target, id, page;
+
+					// If we aren't inside a tab, bail out.
+					if ( !tabRegex.test( target.$.className ) )
+						return;
+
+					// Find the outer <td> container of the tab.
+					while ( target.getName() != 'td' || !tabOuterRegex.test( target.$.className ) )
+					{
+						target = target.getParent();
+					}
+					id = target.$.id.substr( 0, target.$.id.lastIndexOf( '_' ) );
+					this.selectPage( id );
+				}, this );
+
+		// Insert buttons.
+		var buttonsHtml = [],
+			buttons = CKEDITOR.dialog._.uiElementBuilders.hbox.build( this,
+				{
+					type : 'hbox',
+					className : 'cke_dialog_footer_buttons',
+					widths : [],
+					children : definition.buttons
+				}, buttonsHtml ).getChild();
+		this.parts.footer.setHtml( buttonsHtml.join( '' ) );
+
+		for ( i = 0 ; i < buttons.length ; i++ )
+			this._.buttons[ buttons[i].id ] = buttons[i];
+
+		// Insert dummy text box for grabbing focus away from the editing area.
+		this._.dummyText = CKEDITOR.dom.element.createFromHtml( '<input type="text" style="position: absolute; left: -100000px; top: -100000px" />' );
+		this._.dummyText.appendTo( element );
+
+		CKEDITOR.skins.load( editor.config.skin, 'dialog' );
+	};
+
+	CKEDITOR.dialog.prototype =
+	{
+		/**
+		 * Resizes the dialog.
+		 * @param {Number} width The width of the dialog in pixels.
+		 * @param {Number} height The height of the dialog in pixels.
+		 * @function
+		 * @example
+		 * dialogObj.resize( 800, 640 );
+		 */
+		resize : (function()
+		{
+			return function( width, height )
+			{
+				if ( this._.size && this._.size.width == width && this._.size.height == height )
+					return;
+
+				CKEDITOR.dialog.fire( 'resize',
+					{
+						dialog : this,
+						skin : this._.editor.config.skin,
+						width : width,
+						height : height
+					}, this._.editor );
+
+				this._.size = { width : width, height : height };
+			};
+		})(),
+
+		/**
+		 * Gets the current size of the dialog in pixels.
+		 * @returns {Object} An object with "width" and "height" properties.
+		 * @example
+		 * var width = dialogObj.getSize().width;
+		 */
+		getSize : function()
+		{
+			return CKEDITOR.tools.extend( {}, this._.size );
+		},
+
+		/**
+		 * Moves the dialog to an (x, y) coordinate relative to the window.
+		 * @function
+		 * @param {Number} x The target x-coordinate.
+		 * @param {Number} y The target y-coordinate.
+		 * @example
+		 * dialogObj.move( 10, 40 );
+		 */
+		move : (function()
+		{
+			var isFixed;
+			return function( x, y )
+			{
+				// The dialog may be fixed positioned or absolute positioned. Ask the
+				// browser what is the current situation first.
+				if ( isFixed === undefined )
+					isFixed = this._.element.getFirst().getComputedStyle( 'position' ) == 'fixed';
+
+				if ( isFixed && this._.position && this._.position.x == x && this._.position.y == y )
+					return;
+
+				// Save the current position.
+				this._.position = { x : x, y : y };
+
+				// If not fixed positioned, add scroll position to the coordinates.
+				if ( !isFixed )
+				{
+					var scrollPosition = CKEDITOR.document.getWindow().getScrollPosition();
+					x += scrollPosition.x;
+					y += scrollPosition.y;
+				}
+
+				this._.element.getFirst().setStyles(
+						{
+							'left' : x + 'px',
+							'top' : y + 'px'
+						});
+			};
+		})(),
+
+		/**
+		 * Gets the dialog's position in the window.
+		 * @returns {Object} An object with "x" and "y" properties.
+		 * @example
+		 * var dialogX = dialogObj.getPosition().x;
+		 */
+		getPosition : function(){ return CKEDITOR.tools.extend( {}, this._.position ); },
+
+		/**
+		 * Shows the dialog box.
+		 * @example
+		 * dialogObj.show();
+		 */
+		show : function()
+		{
+			// Insert the dialog's element to the root document.
+			var element = this._.element;
+			var definition = this.definition;
+			if ( !( element.getParent() && element.getParent().equals( CKEDITOR.document.getBody() ) ) )
+				element.appendTo( CKEDITOR.document.getBody() );
+			else
+				return;
+
+			// First, set the dialog to an appropriate size.
+			this.resize( definition.minWidth, definition.minHeight );
+
+			// Rearrange the dialog to the middle of the window.
+			var viewSize = CKEDITOR.document.getWindow().getViewPaneSize();
+			this.move( ( viewSize.width - this._.size.width ) / 2, ( viewSize.height - this._.size.height ) / 2 );
+
+			// Select the first tab by default.
+			this.selectPage( this.definition.contents[0].id );
+
+			// Reset all inputs back to their default value.
+			this.reset();
+
+			// Set z-index.
+			if ( CKEDITOR.dialog._.currentZIndex === null )
+				CKEDITOR.dialog._.currentZIndex = this._.editor.config.baseFloatZIndex;
+			this._.element.getFirst().setStyle( 'z-index', CKEDITOR.dialog._.currentZIndex += 10 );
+
+			// Maintain the dialog ordering and dialog cover.
+			// Also register key handlers if first dialog.
+			if ( CKEDITOR.dialog._.currentTop === null )
+			{
+				CKEDITOR.dialog._.currentTop = this;
+				this._.parentDialog = null;
+				addCover( this._.editor );
+
+				CKEDITOR.document.on( 'keydown', accessKeyDownHandler );
+				CKEDITOR.document.on( 'keyup', accessKeyUpHandler );
+			}
+			else
+			{
+				this._.parentDialog = CKEDITOR.dialog._.currentTop;
+				var parentElement = this._.parentDialog.getElement().getFirst();
+				parentElement.$.style.zIndex  -= Math.floor( this._.editor.config.baseFloatZIndex / 2 );
+				CKEDITOR.dialog._.currentTop = this;
+			}
+
+			// Register the Esc hotkeys.
+			registerAccessKey( this, this, '\x1b', null, function()
+					{
+						this.getButton( 'cancel' ) && this.getButton( 'cancel' ).click();
+					} );
+
+			// Save editor selection and grab the focus.
+			if ( !this._.parentDialog )
+				this.saveSelection();
+			this._.dummyText.focus();
+			this._.dummyText.$.select();
+
+			// Execute onLoad for the first show.
+			this.fireOnce( 'load', {} );
+			this.fire( 'show', {} );
+		},
+
+		/**
+		 * Executes a function for each UI element.
+		 * @param {Function} fn Function to execute for each UI element.
+		 * @returns {CKEDITOR.dialog} The current dialog object.
+		 */
+		foreach : function( fn )
+		{
+			for ( var i in this._.contents )
+			{
+				for ( var j in this._.contents[i] )
+					fn( this._.contents[i][j]);
+			}
+			return this;
+		},
+
+		/**
+		 * Resets all input values in the dialog.
+		 * @example
+		 * dialogObj.reset();
+		 * @returns {CKEDITOR.dialog} The current dialog object.
+		 */
+		reset : (function()
+		{
+			var fn = function( widget ){ if ( widget.reset ) widget.reset(); };
+			return function(){ this.foreach( fn ); return this; };
+		})(),
+
+		/**
+		 * Pushes the current values of all inputs in the dialog into the default stack.
+		 * @example
+		 * dialogObj.pushDefault();
+		 * @returns {CKEDITOR.dialog} The current dialog object.
+		 */
+		pushDefault : (function()
+		{
+			var fn = function( widget ){ if ( widget.pushDefault ) widget.pushDefault(); };
+			return function(){ this.foreach( fn ); return this; };
+		})(),
+
+		/**
+		 * Pops the current default values of all inputs in the dialog.
+		 * @example
+		 * dialogObj.popDefault();
+		 * @returns {CKEDITOR.dialog} The current dialog object.
+		 */
+		popDefault : (function()
+		{
+			var fn = function( widget ){ if ( widget.popDefault ) widget.popDefault(); };
+			return function(){ this.foreach( fn ); return this; };
+		})(),
+
+		setupContent : function()
+		{
+			var args = arguments;
+			this.foreach( function( widget )
+				{
+					if ( widget.setup )
+						widget.setup.apply( widget, args );
+				});
+		},
+
+		commitContent : function()
+		{
+			var args = arguments;
+			this.foreach( function( widget )
+				{
+					if ( widget.commit )
+						widget.commit.apply( widget, args );
+				});
+		},
+
+		/**
+		 * Hides the dialog box.
+		 * @example
+		 * dialogObj.hide();
+		 */
+		hide : function()
+		{
+			// Remove the dialog's element from the root document.
+			var element = this._.element;
+			if ( !element.getParent() )
+				return;
+			element.remove();
+
+			// Unregister all access keys associated with this dialog.
+			unregisterAccessKey( this );
+
+			// Maintain dialog ordering and remove cover if needed.
+			if ( !this._.parentDialog )
+				removeCover();
+			else
+			{
+				var parentElement = this._.parentDialog.getElement().getFirst();
+				parentElement.setStyle( 'z-index', parseInt( parentElement.$.style.zIndex, 10 ) + Math.floor( this._.editor.config.baseFloatZIndex / 2 ) );
+			}
+			CKEDITOR.dialog._.currentTop = this._.parentDialog;
+
+			// Deduct or clear the z-index.
+			if ( !this._.parentDialog )
+			{
+				CKEDITOR.dialog._.currentZIndex = null;
+
+				// Remove access key handlers.
+				CKEDITOR.document.removeListener( 'keydown', accessKeyDownHandler );
+				CKEDITOR.document.removeListener( 'keyup', accessKeyUpHandler );
+
+				// Restore focus and (if not already restored) selection in the editing area.
+				this.restoreSelection();
+				this._.editor.focus();
+			}
+			else
+				CKEDITOR.dialog._.currentZIndex -= 10;
+
+			this.fire( 'hide', {} );
+		},
+
+		/**
+		 * Adds a tabbed page into the dialog.
+		 * @param {Object} contents Content definition.
+		 * @example
+		 */
+		addPage : function( contents )
+		{
+			var pageHtml = [],
+				titleHtml = contents.title ? 'title="' + CKEDITOR.tools.htmlEncode( contents.title ) + '" ' : '',
+				elements = contents.elements,
+				vbox = CKEDITOR.dialog._.uiElementBuilders.vbox.build( this,
+						{
+							type : 'vbox',
+							className : 'cke_dialog_page_contents',
+							children : contents.elements,
+							expand : !!contents.expand
+						}, pageHtml );
+
+			// Create the HTML for the tab and the content block.
+			var page = CKEDITOR.dom.element.createFromHtml( pageHtml.join( '' ) );
+			var tab = CKEDITOR.dom.element.createFromHtml( [
+					'<table><tbody><tr><td class="cke_dialog_tab" ', titleHtml, '>',
+					'<table border="0" cellspacing="0" cellpadding="0"><tbody><tr>',
+						'<td class="cke_dialog_tab_left"></td>',
+						'<td class="cke_dialog_tab_center">',
+							CKEDITOR.tools.htmlEncode( contents.label.replace( / /g, '\xa0' ) ),
+						'</td>',
+						'<td class="cke_dialog_tab_right"></td>',
+					'</tr></tbody></table></td></tr></tbody></table>'
+				].join( '' ) );
+			tab = tab.getChild( [0,0,0] );
+
+			// First and last tab styles classes.
+			if ( this._.lastTab )
+				this._.lastTab.removeClass( 'last' );
+			tab.addClass( this._.pageCount > 0 ? 'last' : 'first' );
+
+			// If only a single page exist, a different style is used in the central pane.
+			if ( this._.pageCount === 0 )
+				this.parts.c.addClass( 'single_page' );
+			else
+				this.parts.c.removeClass( 'single_page' );
+
+			// Take records for the tabs and elements created.
+			this._.tabs[ contents.id ] = [ tab, page ];
+			this._.pageCount++;
+			this._.lastTab = tab;
+			var contentMap = this._.contents[ contents.id ] = {},
+				cursor,
+				children = vbox.getChild();
+			while ( ( cursor = children.shift() ) )
+			{
+				contentMap[ cursor.id ] = cursor;
+				if ( typeof( cursor.getChild ) == 'function' )
+					children.push.apply( children, cursor.getChild() );
+			}
+
+			// Attach the DOM nodes.
+			tab.unselectable();
+			page.appendTo( this.parts.contents );
+			tab.insertBefore( this.parts.tabs.getChild( this.parts.tabs.getChildCount() - 1 ) );
+			tab.setAttribute( 'id', contents.id + '_' + CKEDITOR.tools.getNextNumber() );
+			page.setAttribute( 'name', contents.id );
+
+			// Add access key handlers if access key is defined.
+			if ( contents.accessKey )
+			{
+				registerAccessKey( this, this, 'CTRL+' + contents.accessKey,
+					tabAccessKeyDown, tabAccessKeyUp );
+				this._.accessKeyMap[ 'CTRL+' + contents.accessKey ] = contents.id;
+			}
+		},
+
+		/**
+		 * Activates a tab page in the dialog by its id.
+		 * @param {String} id The id of the dialog tab to be activated.
+		 * @example
+		 * dialogObj.selectPage( 'tab_1' );
+		 */
+		selectPage : function( id )
+		{
+			// Hide the non-selected tabs and pages.
+			for ( var i in this._.tabs )
+			{
+				var tab = this._.tabs[i][0],
+					page = this._.tabs[i][1];
+				if ( i != id )
+				{
+					tab.removeClass( 'cke_dialog_tab_selected' );
+					page.hide();
+				}
+			}
+
+			var selected = this._.tabs[id];
+			selected[0].addClass( 'cke_dialog_tab_selected' );
+			selected[1].show();
+			var me = this;
+		},
+
+		/**
+		 * Hides a page's tab away from the dialog.
+		 * @param {String} id The page's Id.
+		 * @example
+		 * dialog.hidePage( 'tab_3' );
+		 */
+		hidePage : function( id )
+		{
+			var tab = this._.tabs[id] && this._.tabs[id][0];
+			if ( !tab )
+				return;
+			tab.hide();
+		},
+
+		/**
+		 * Unhides a page's tab.
+		 * @param {String} id The page's Id.
+		 * @example
+		 * dialog.showPage( 'tab_2' );
+		 */
+		showPage : function( id )
+		{
+			var tab = this._.tabs[id] && this._.tabs[id][0];
+			if ( !tab )
+				return;
+			tab.show();
+		},
+
+		/**
+		 * Gets the root DOM element of the dialog.
+		 * @returns {CKEDITOR.dom.element} The &lt;span&gt; element containing this dialog.
+		 * @example
+		 * var dialogElement = dialogObj.getElement().getFirst();
+		 * dialogElement.setStyle( 'padding', '5px' );
+		 */
+		getElement : function()
+		{
+			return this._.element;
+		},
+
+		/**
+		 * Gets a dialog UI element object from a dialog page.
+		 * @param {String} pageId id of dialog page.
+		 * @param {String} elementId id of UI element.
+		 * @example
+		 * @returns {CKEDITOR.ui.dialog.uiElement} The dialog UI element.
+		 */
+		getContentElement : function( pageId, elementId )
+		{
+			return this._.contents[pageId][elementId];
+		},
+
+		/**
+		 * Gets the value of a dialog UI element.
+		 * @param {String} pageId id of dialog page.
+		 * @param {String} elementId id of UI element.
+		 * @example
+		 * @returns {Object} The value of the UI element.
+		 */
+		getValueOf : function( pageId, elementId )
+		{
+			return this.getContentElement( pageId, elementId ).getValue();
+		},
+
+		/**
+		 * Sets the value of a dialog UI element.
+		 * @param {String} pageId id of the dialog page.
+		 * @param {String} elementId id of the UI element.
+		 * @param {Object} value The new value of the UI element.
+		 * @example
+		 */
+		setValueOf : function( pageId, elementId, value )
+		{
+			return this.getContentElement( pageId, elementId ).setValue( value );
+		},
+
+		/**
+		 * Gets the UI element of a button in the dialog's button row.
+		 * @param {String} id The id of the button.
+		 * @example
+		 * @returns {CKEDITOR.ui.dialog.button} The button object.
+		 */
+		getButton : function( id )
+		{
+			return this._.buttons[ id ];
+		},
+
+		/**
+		 * Simulates a click to a dialog button in the dialog's button row.
+		 * @param {String} id The id of the button.
+		 * @example
+		 * @returns The return value of the dialog's "click" event.
+		 */
+		click : function( id )
+		{
+			return this._.buttons[ id ].click();
+		},
+
+		/**
+		 * Disables a dialog button.
+		 * @param {String} id The id of the button.
+		 * @example
+		 */
+		disableButton : function( id )
+		{
+			return this._.buttons[ id ].disable();
+		},
+
+		/**
+		 * Enables a dialog button.
+		 * @param {String} id The id of the button.
+		 * @example
+		 */
+		enableButton : function( id )
+		{
+			return this._.buttons[ id ].enable();
+		},
+
+		/**
+		 * Gets the number of pages in the dialog.
+		 * @returns {Number} Page count.
+		 */
+		getPageCount : function()
+		{
+			return this._.pageCount;
+		},
+
+		/**
+		 * Gets the editor instance which opened this dialog.
+		 * @returns {CKEDITOR.editor} Parent editor instances.
+		 */
+		getParentEditor : function()
+		{
+			return this._.editor;
+		},
+
+		/**
+		 * Saves the current selection position in the editor.
+		 * This function is automatically called when a non-nested dialog is opened,
+		 * but it may also be called by event handlers in dialog definition.
+		 * @example
+		 */
+		saveSelection : function()
+		{
+			if ( this._.editor.mode )
+			{
+				var selection = new CKEDITOR.dom.selection( this._.editor.document );
+				this._.selectedRanges = selection.getRanges();
+			}
+		},
+
+		/**
+		 * Clears the saved selection in the dialog object.
+		 * This function should be called if the dialog's code has already changed the
+		 * current selection position because the dialog closed. (e.g. at onOk())
+		 * @example
+		 */
+		clearSavedSelection : function()
+		{
+			delete this._.selectedRanges;
+		},
+
+		/**
+		 * Restores the editor's selection from the previously saved position in this
+		 * dialog.
+		 * This function is automatically called when a non-nested dialog is closed,
+		 * but it may also be called by event handlers in dialog definition.
+		 * @example
+		 */
+		restoreSelection : function()
+		{
+			if ( this._.editor.mode && this._.selectedRanges )
+				( new CKEDITOR.dom.selection( this._.editor.document ) ).selectRanges( this._.selectedRanges );
+		}
+	};
+
+	CKEDITOR.tools.extend( CKEDITOR.dialog,
+		/**
+		 * @lends CKEDITOR.dialog
+		 */
+		{
+			/**
+			 * Registers a dialog.
+			 * @param {String} name The dialog's name.
+			 * @param {Function|String} dialogDefinition
+			 * A function returning the dialog's definition, or the URL to the .js file holding the function.
+			 * The function should accept an argument "editor" which is the current editor instance, and
+			 * return an object conforming to {@link CKEDITOR.dialog.dialogDefinition}.
+			 * @example
+			 * @see CKEDITOR.dialog.dialogDefinition
+			 */
+			add : function( name, dialogDefinition )
+			{
+				this._.dialogDefinitions[name] = dialogDefinition;
+			},
+
+			exists : function( name )
+			{
+				return !!this._.dialogDefinitions[ name ];
+			},
+
+			/**
+			 * The default OK button for dialogs. Fires the "ok" event and closes the dialog if the event succeeds.
+			 * @static
+			 * @field
+			 * @example
+			 * @type Function
+			 */
+			okButton : (function()
+			{
+				var retval = function( editor, override )
+				{
+					override = override || {};
+					return CKEDITOR.tools.extend( {
+						id : 'ok',
+						type : 'button',
+						label : editor.lang.common.ok,
+						style : 'width: 60px',
+						onClick : function( evt )
+						{
+							var dialog = evt.data.dialog;
+							if ( dialog.fire( 'ok', { hide : true } ).hide !== false )
+								dialog.hide();
+						}
+					}, override, true );
+				};
+				retval.type = 'button';
+				retval.override = function( override )
+				{
+					return CKEDITOR.tools.extend( function( editor ){ return retval( editor, override ); },
+							{ type : 'button' }, true );
+				};
+				return retval;
+			})(),
+
+			/**
+			 * The default cancel button for dialogs. Fires the "cancel" event and closes the dialog if no UI element value changed.
+			 * @static
+			 * @field
+			 * @example
+			 * @type Function
+			 */
+			cancelButton : (function()
+			{
+				var retval = function( editor, override )
+				{
+					override = override || {};
+					return CKEDITOR.tools.extend( {
+						id : 'cancel',
+						type : 'button',
+						label : editor.lang.common.cancel,
+						style : 'width: 60px',
+						onClick : function( evt )
+						{
+							var dialog = evt.data.dialog;
+							if ( dialog.fire( 'cancel', { hide : true } ).hide !== false )
+								dialog.hide();
+						}
+					}, override, true );
+				};
+				retval.type = 'button';
+				retval.override = function( override )
+				{
+					return CKEDITOR.tools.extend( function( editor ){ return retval( editor, override ); },
+							{ type : 'button' }, true );
+				};
+				return retval;
+			})(),
+
+			/**
+			 * Registers a dialog UI element.
+			 * @param {String} typeName The name of the UI element.
+			 * @param {Function} builder The function to build the UI element.
+			 * @example
+			 */
+			addUIElement : function( typeName, builder )
+			{
+				this._.uiElementBuilders[typeName] = builder;
+			},
+
+			/**
+			 * Sets the width of margins of dialogs, which is used for the dialog moving and resizing logic.
+			 * The margin here means the area between the dialog's container <div> and the visual boundary of the dialog.
+			 * Typically this area is used for dialog shadows.
+			 * This function is typically called in a skin's JavaScript files.
+			 * @param {Number} top The top margin in pixels.
+			 * @param {Number} right The right margin in pixels.
+			 * @param {Number} bottom The bottom margin in pixels.
+			 * @param {Number} left The left margin in pixels.
+			 * @example
+			 */
+			setMargins : function( top, right, bottom, left )
+			{
+				this._.margins = [ top, right, bottom, left ];
+			}
+		});
+
+	CKEDITOR.dialog._ =
+	{
+		uiElementBuilders : {},
+
+		dialogDefinitions : {},
+
+		currentTop : null,
+
+		currentZIndex : null,
+
+		margins : [0, 0, 0, 0]
+	};
+
+	// "Inherit" (copy actually) from CKEDITOR.event.
+	CKEDITOR.event.implementOn( CKEDITOR.dialog );
+	CKEDITOR.event.implementOn( CKEDITOR.dialog.prototype );
+
+	var defaultDialogDefinition =
+	{
+		resizable : CKEDITOR.DIALOG_RESIZE_NONE,
+		minWidth : 600,
+		minHeight : 400,
+		buttons : [ CKEDITOR.dialog.okButton, CKEDITOR.dialog.cancelButton ]
+	};
+
+	// Tool function used to return an item from an array based on its id
+	// property.
+	var getById = function( array, id, recurse )
+	{
+		for ( var i = 0, item ; ( item = array[ i ] ) ; i++ )
+		{
+			if ( item.id == id )
+				return item;
+			if ( recurse && item[ recurse ] )
+			{
+				var retval = getById( item[ recurse ], id, recurse ) ;
+				if ( retval )
+					return retval;
+			}
+		}
+		return null;
+	};
+
+	// Tool function used to add an item into an array.
+	var addById = function( array, newItem, nextSiblingId, recurse, nullIfNotFound )
+	{
+		if ( nextSiblingId )
+		{
+			for ( var i = 0, item ; ( item = array[ i ] ) ; i++ )
+			{
+				if ( item.id == nextSiblingId )
+				{
+					array.splice( i, 0, newItem );
+					return newItem;
+				}
+
+				if ( recurse && item[ recurse ] )
+				{
+					var retval = addById( item[ recurse ], newItem, nextSiblingId, recurse, true );
+					if ( retval )
+						return retval;
+				}
+			}
+
+			if ( nullIfNotFound )
+				return null;
+		}
+
+		array.push( newItem );
+		return newItem;
+	};
+
+	// Tool function used to remove an item from an array based on its id.
+	var removeById = function( array, id, recurse )
+	{
+		for ( var i = 0, item ; ( item = array[ i ] ) ; i++ )
+		{
+			if ( item.id == id )
+				return array.splice( i, 1 );
+			if ( recurse && item[ recurse ] )
+			{
+				var retval = removeById( item[ recurse ], id, recurse );
+				if ( retval )
+					return retval;
+			}
+		}
+		return null;
+	};
+
+	/**
+	 * This class is not really part of the API. It is the "definition" property value
+	 * passed to "dialogDefinition" event handlers.
+	 * @constructor
+	 * @name CKEDITOR.dialog.dialogDefinitionObject
+	 * @extends CKEDITOR.dialog.dialogDefinition
+	 * @example
+	 * CKEDITOR.on( 'dialogDefinition', function( evt )
+	 * 	{
+	 * 		var definition = evt.data.definition;
+	 * 		var content = definition.getContents( 'page1' );
+	 * 		...
+	 * 	} );
+	 */
+	var definitionObject = function( dialog, dialogDefinition )
+	{
+		// TODO : Check if needed.
+		this.dialog = dialog;
+
+		// Transform the contents entries in contentObjects.
+		var contents = dialogDefinition.contents;
+		for ( var i = 0, content ; ( content = contents[i] ) ; i++ )
+			contents[ i ] = new contentObject( dialog, content );
+
+		CKEDITOR.tools.extend( this, dialogDefinition );
+	};
+
+	definitionObject.prototype =
+	/** @lends CKEDITOR.dialog.dialogDefinitionObject.prototype */
+	{
+		/**
+		 * Gets a content definition.
+		 * @param {String} id The id of the content definition.
+		 * @returns {CKEDITOR.dialog.contentDefinition} The content definition
+		 *		matching id.
+		 */
+		getContents : function( id )
+		{
+			return getById( this.contents, id );
+		},
+
+		/**
+		 * Gets a button definition.
+		 * @param {String} id The id of the button definition.
+		 * @returns {CKEDITOR.dialog.buttonDefinition} The button definition
+		 *		matching id.
+		 */
+		getButton : function( id )
+		{
+			return getById( this.buttons, id );
+		},
+
+		/**
+		 * Adds a content definition object under this dialog definition.
+		 * @param {CKEDITOR.dialog.contentDefinition} contentDefinition The
+		 *		content definition.
+		 * @param {String} [nextSiblingId] The id of an existing content
+		 *		definition which the new content definition will be inserted
+		 *		before. Omit if the new content definition is to be inserted as
+		 *		the last item.
+		 * @returns {CKEDITOR.dialog.contentDefinition} The inserted content
+		 *		definition.
+		 */
+		addContents : function( contentDefinition, nextSiblingId )
+		{
+			return addById( this.contents, contentDefinition, nextSiblingId );
+		},
+
+		/**
+		 * Adds a button definition object under this dialog definition.
+		 * @param {CKEDITOR.dialog.buttonDefinition} buttonDefinition The
+		 *		button definition.
+		 * @param {String} [nextSiblingId] The id of an existing button
+		 *		definition which the new button definition will be inserted
+		 *		before. Omit if the new button definition is to be inserted as
+		 *		the last item.
+		 * @returns {CKEDITOR.dialog.buttonDefinition} The inserted button
+		 *		definition.
+		 */
+		addButton : function( buttonDefinition, nextSiblingId )
+		{
+			return addById( this.buttons, buttonDefinition, nextSiblingId );
+		},
+
+		/**
+		 * Removes a content definition from this dialog definition.
+		 * @param {String} id The id of the content definition to be removed.
+		 * @returns {CKEDITOR.dialog.contentDefinition} The removed content
+		 *		definition.
+		 */
+		removeContents : function( id )
+		{
+			removeById( this.contents, id );
+		},
+
+		/**
+		 * Removes a button definition from the dialog definition.
+		 * @param {String} id The id of the button definition to be removed.
+		 * @returns {CKEDITOR.dialog.buttonDefinition} The removed button
+		 *		definition.
+		 */
+		removeButton : function( id )
+		{
+			removeById( this.buttons, id );
+		}
+	};
+
+	/**
+	 * This class is not really part of the API. It is the template of the
+	 * objects representing content pages inside the
+	 * CKEDITOR.dialog.dialogDefinitionObject.
+	 * @constructor
+	 * @name CKEDITOR.dialog.contentDefinitionObject
+	 * @example
+	 * CKEDITOR.on( 'dialogDefinition', function( evt )
+	 * 	{
+	 * 		var definition = evt.data.definition;
+	 * 		var content = definition.getContents( 'page1' );
+	 *		content.remove( 'textInput1' );
+	 * 		...
+	 * 	} );
+	 */
+	var contentObject = function( dialog, contentDefinition )
+	{
+		this._ =
+		{
+			dialog : dialog
+		};
+
+		CKEDITOR.tools.extend( this, contentDefinition );
+	};
+
+	contentObject.prototype =
+	/** @lends CKEDITOR.dialog.contentDefinitionObject.prototype */
+	{
+		/**
+		 * Gets a UI element definition under the content definition.
+		 * @param {String} id The id of the UI element definition.
+		 * @returns {CKEDITOR.dialog.uiElementDefinition}
+		 */
+		get : function( id )
+		{
+			return getById( this.elements, id, 'children' );
+		},
+
+		/**
+		 * Adds a UI element definition to the content definition.
+		 * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition The
+		 *		UI elemnet definition to be added.
+		 * @param {String} nextSiblingId The id of an existing UI element
+		 *		definition which the new UI element definition will be inserted
+		 *		before. Omit if the new button definition is to be inserted as
+		 *		the last item.
+		 * @returns {CKEDITOR.dialog.uiElementDefinition} The element
+		 *		definition inserted.
+		 */
+		add : function( elementDefinition, nextSiblingId )
+		{
+			return addById( this.elements, elementDefinition, nextSiblingId, 'children' );
+		},
+
+		/**
+		 * Removes a UI element definition from the content definition.
+		 * @param {String} id The id of the UI element definition to be
+		 *		removed.
+		 * @returns {CKEDITOR.dialog.uiElementDefinition} The element
+		 *		definition removed.
+		 * @example
+		 */
+		remove : function( id )
+		{
+			removeById( this.elements, id, 'children' );
+		}
+	};
+
+	var initDragAndDrop = function( dialog )
+	{
+		var lastCoords = null,
+			abstractDialogCoords = null,
+			element = dialog.getElement().getFirst(),
+			magnetDistance = dialog._.editor.config.dialog_magnetDistance,
+			mouseMoveHandler = function( evt )
+			{
+				var dialogSize = dialog.getSize(),
+					viewPaneSize = CKEDITOR.document.getWindow().getViewPaneSize(),
+					x = evt.data.$.screenX,
+					y = evt.data.$.screenY,
+					dx = x - lastCoords.x,
+					dy = y - lastCoords.y,
+					realX, realY;
+
+				lastCoords = { x : x, y : y };
+				abstractDialogCoords.x += dx;
+				abstractDialogCoords.y += dy;
+
+				if ( abstractDialogCoords.x + CKEDITOR.dialog._.margins[3] < magnetDistance )
+					realX = - CKEDITOR.dialog._.margins[3];
+				else if ( abstractDialogCoords.x - CKEDITOR.dialog._.margins[1] > viewPaneSize.width - dialogSize.width - magnetDistance )
+					realX = viewPaneSize.width - dialogSize.width + CKEDITOR.dialog._.margins[1];
+				else
+					realX = abstractDialogCoords.x;
+
+				if ( abstractDialogCoords.y + CKEDITOR.dialog._.margins[0] < magnetDistance )
+					realY = - CKEDITOR.dialog._.margins[0];
+				else if ( abstractDialogCoords.y - CKEDITOR.dialog._.margins[2] > viewPaneSize.height - dialogSize.height - magnetDistance )
+					realY = viewPaneSize.height - dialogSize.height + CKEDITOR.dialog._.margins[2];
+				else
+					realY = abstractDialogCoords.y;
+
+				dialog.move( realX, realY );
+
+				evt.data.preventDefault();
+			},
+			mouseUpHandler = function( evt )
+			{
+				CKEDITOR.document.removeListener( 'mousemove', mouseMoveHandler );
+				CKEDITOR.document.removeListener( 'mouseup', mouseUpHandler );
+
+				if ( CKEDITOR.env.ie6Compat )
+				{
+					var coverDoc = new CKEDITOR.dom.document( frames( 'cke_dialog_background_iframe' ).document );
+					coverDoc.removeListener( 'mousemove', mouseMoveHandler );
+					coverDoc.removeListener( 'mouseup', mouseUpHandler );
+				}
+			};
+
+		dialog.parts.title.on( 'mousedown', function( evt )
+				{
+					lastCoords = { x : evt.data.$.screenX, y : evt.data.$.screenY };
+
+					CKEDITOR.document.on( 'mousemove', mouseMoveHandler );
+					CKEDITOR.document.on( 'mouseup', mouseUpHandler );
+					abstractDialogCoords = dialog.getPosition();
+
+					if ( CKEDITOR.env.ie6Compat )
+					{
+						var coverDoc = new CKEDITOR.dom.document( frames( 'cke_dialog_background_iframe' ).document );
+						coverDoc.on( 'mousemove', mouseMoveHandler );
+						coverDoc.on( 'mouseup', mouseUpHandler );
+					}
+
+					evt.data.preventDefault();
+				}, dialog );
+	};
+
+	var initResizeHandles = function( dialog )
+	{
+		var definition = dialog.definition,
+			minWidth = definition.minWidth || 0,
+			minHeight = definition.minHeight || 0,
+			resizable = definition.resizable,
+			topSizer = function( coords, dy )
+			{
+				coords.y += dy;
+			},
+			rightSizer = function( coords, dx )
+			{
+				coords.x2 += dx;
+			},
+			bottomSizer = function( coords, dy )
+			{
+				coords.y2 += dy;
+			},
+			leftSizer = function( coords, dx )
+			{
+				coords.x += dx;
+			},
+			lastCoords = null,
+			abstractDialogCoords = null,
+			magnetDistance = dialog._.editor.config.magnetDistance,
+			parts = [ 'tl', 't', 'tr', 'l', 'r', 'bl', 'b', 'br' ],
+			mouseDownHandler = function( evt )
+			{
+				var partName = evt.listenerData.part, size = dialog.getSize();
+				abstractDialogCoords = dialog.getPosition();
+				CKEDITOR.tools.extend( abstractDialogCoords,
+					{
+						x2 : abstractDialogCoords.x + size.width,
+						y2 : abstractDialogCoords.y + size.height
+					} );
+				lastCoords = { x : evt.data.$.screenX, y : evt.data.$.screenY };
+
+				CKEDITOR.document.on( 'mousemove', mouseMoveHandler, dialog, { part : partName } );
+				CKEDITOR.document.on( 'mouseup', mouseUpHandler, dialog, { part : partName } );
+
+				if ( CKEDITOR.env.ie6Compat )
+				{
+					var coverDoc = new CKEDITOR.dom.document( frames( 'cke_dialog_background_iframe' ).document );
+					coverDoc.on( 'mousemove', mouseMoveHandler, dialog, { part : partName } );
+					coverDoc.on( 'mouseup', mouseUpHandler, dialog, { part : partName } );
+				}
+
+				evt.data.preventDefault();
+			},
+			mouseMoveHandler = function( evt )
+			{
+				var x = evt.data.$.screenX,
+					y = evt.data.$.screenY,
+					dx = x - lastCoords.x,
+					dy = y - lastCoords.y,
+					viewPaneSize = CKEDITOR.document.getWindow().getViewPaneSize(),
+					partName = evt.listenerData.part;
+
+				if ( partName.search( 't' ) != -1 )
+					topSizer( abstractDialogCoords, dy );
+				if ( partName.search( 'l' ) != -1 )
+					leftSizer( abstractDialogCoords, dx );
+				if ( partName.search( 'b' ) != -1 )
+					bottomSizer( abstractDialogCoords, dy );
+				if ( partName.search( 'r' ) != -1 )
+					rightSizer( abstractDialogCoords, dx );
+
+				lastCoords = { x : x, y : y };
+
+				var realX, realY, realX2, realY2;
+
+				if ( abstractDialogCoords.x + CKEDITOR.dialog._.margins[3] < magnetDistance )
+					realX = - CKEDITOR.dialog._.margins[3];
+				else if ( partName.search( 'l' ) != -1 && abstractDialogCoords.x2 - abstractDialogCoords.x < minWidth + magnetDistance )
+					realX = abstractDialogCoords.x2 - minWidth;
+				else
+					realX = abstractDialogCoords.x;
+
+				if ( abstractDialogCoords.y + CKEDITOR.dialog._.margins[0] < magnetDistance )
+					realY = - CKEDITOR.dialog._.margins[0];
+				else if ( partName.search( 't' ) != -1 && abstractDialogCoords.y2 - abstractDialogCoords.y < minHeight + magnetDistance )
+					realY = abstractDialogCoords.y2 - minHeight;
+				else
+					realY = abstractDialogCoords.y;
+
+				if ( abstractDialogCoords.x2 - CKEDITOR.dialog._.margins[1] > viewPaneSize.width - magnetDistance )
+					realX2 = viewPaneSize.width + CKEDITOR.dialog._.margins[1] ;
+				else if ( partName.search( 'r' ) != -1 && abstractDialogCoords.x2 - abstractDialogCoords.x < minWidth + magnetDistance )
+					realX2 = abstractDialogCoords.x + minWidth;
+				else
+					realX2 = abstractDialogCoords.x2;
+
+				if ( abstractDialogCoords.y2 - CKEDITOR.dialog._.margins[2] > viewPaneSize.height - magnetDistance )
+					realY2= viewPaneSize.height + CKEDITOR.dialog._.margins[2] ;
+				else if ( partName.search( 'b' ) != -1 && abstractDialogCoords.y2 - abstractDialogCoords.y < minHeight + magnetDistance )
+					realY2 = abstractDialogCoords.y + minHeight;
+				else
+					realY2 = abstractDialogCoords.y2 ;
+
+				dialog.move( realX, realY );
+				dialog.resize( realX2 - realX, realY2 - realY );
+
+				evt.data.preventDefault();
+			},
+			mouseUpHandler = function( evt )
+			{
+				CKEDITOR.document.removeListener( 'mouseup', mouseUpHandler );
+				CKEDITOR.document.removeListener( 'mousemove', mouseMoveHandler );
+
+				if ( CKEDITOR.env.ie6Compat )
+				{
+					var coverDoc = new CKEDITOR.dom.document( frames( 'cke_dialog_background_iframe' ).document );
+					coverDoc.removeListener( 'mouseup', mouseUpHandler );
+					coverDoc.removeListener( 'mousemove', mouseMoveHandler );
+				}
+			};
+
+		var widthTest = /[lr]/,
+			heightTest = /[tb]/;
+		for ( var i = 0 ; i < parts.length ; i++ )
+		{
+			var element = dialog.parts[ parts[i] + '_resize' ];
+			if ( resizable == CKEDITOR.DIALOG_RESIZE_NONE ||
+					resizable == CKEDITOR.DIALOG_RESIZE_HEIGHT && widthTest.test( parts[i] ) ||
+			  		resizable == CKEDITOR.DIALOG_RESIZE_WIDTH && heightTest.test( parts[i] ) )
+			{
+				element.hide();
+				continue;
+			}
+			element.on( 'mousedown', mouseDownHandler, dialog, { part : parts[i] } );
+		}
+	};
+
+	var resizeCover;
+
+	var addCover = function( editor )
+	{
+		var win = CKEDITOR.document.getWindow();
+
+		var html = [
+				'<div style="position: ', ( CKEDITOR.env.ie6Compat ? 'absolute' : 'fixed' ),
+				'; z-index: ', editor.config.baseFloatZIndex,
+				'; top: 0px; left: 0px; ',
+				'background-color: ', editor.config.dialog_backgroundCoverColor,
+				'" id="cke_dialog_background_cover">'
+			];
+
+		if ( CKEDITOR.env.ie6Compat )
+		{
+			html.push( '<iframe hidefocus="true" frameborder="0" name="cke_dialog_background_iframe" src="javascript: \'\'" ',
+					'style="position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; ',
+					'progid:DXImageTransform.Microsoft.Alpha(opacity=0)" ></iframe>' );
+		}
+
+		html.push( '</div>' );
+
+		var element = CKEDITOR.dom.element.createFromHtml( html.join( '' ) );
+
+		var resizeFunc = function()
+		{
+			var size = win.getViewPaneSize();
+			element.setStyles(
+					{
+						width : size.width + 'px',
+						height : size.height + 'px'
+					});
+		};
+
+		var scrollFunc = function()
+		{
+			var pos = win.getScrollPosition(),
+				cursor = CKEDITOR.dialog._.currentTop;
+			element.setStyles(
+					{
+						left : pos.x + 'px',
+						top : pos.y + 'px'
+					});
+
+			do
+			{
+				var dialogPos = cursor.getPosition();
+				cursor.move( dialogPos.x, dialogPos.y );
+			} while( ( cursor = cursor._.parentDialog ) );
+		};
+
+		resizeCover = resizeFunc;
+		win.on( 'resize', resizeFunc );
+		resizeFunc();
+		if ( CKEDITOR.env.ie6Compat )
+		{
+			// IE BUG: win.$.onscroll assignment doesn't work.. it must be window.onscroll.
+			// So we need to invent a really funny way to make it work.
+			var myScrollHandler = function()
+				{
+					scrollFunc();
+					arguments.callee.prevScrollHandler.apply( this, arguments );
+				};
+			win.$.setTimeout( function()
+				{
+					myScrollHandler.prevScrollHandler = window.onscroll || function(){};
+					window.onscroll = myScrollHandler;
+				}, 0 );
+			scrollFunc();
+		}
+		element.setOpacity( editor.config.dialog_backgroundCoverOpacity );
+		element.appendTo( CKEDITOR.document.getBody() );
+	};
+
+	var removeCover = function()
+	{
+		var element = CKEDITOR.document.getById( 'cke_dialog_background_cover' ),
+			win = CKEDITOR.document.getWindow();
+		if ( element )
+		{
+			element.remove();
+			win.removeListener( 'resize', resizeCover );
+
+			if ( CKEDITOR.env.ie6Compat )
+			{
+				win.$.setTimeout( function()
+					{
+						var prevScrollHandler = window.onscroll && window.onscroll.prevScrollHandler;
+						window.onscroll = prevScrollHandler || null;
+					}, 0 );
+			}
+			resizeCover = null;
+		}
+	};
+
+	var accessKeyProcessors = {};
+
+	var accessKeyDownHandler = function( evt )
+	{
+		var ctrl = evt.data.$.ctrlKey || evt.data.$.metaKey,
+			alt = evt.data.$.altKey,
+			shift = evt.data.$.shiftKey,
+			key = String.fromCharCode( evt.data.$.keyCode ),
+			keyProcessor = accessKeyProcessors[( ctrl ? 'CTRL+' : '' ) + ( alt ? 'ALT+' : '') + ( shift ? 'SHIFT+' : '' ) + key];
+
+		if ( !keyProcessor || !keyProcessor.length )
+			return;
+
+		keyProcessor = keyProcessor[keyProcessor.length - 1];
+		keyProcessor.keydown && keyProcessor.keydown.call( keyProcessor.uiElement, keyProcessor.dialog, keyProcessor.key );
+		evt.data.preventDefault();
+	};
+
+	var accessKeyUpHandler = function( evt )
+	{
+		var ctrl = evt.data.$.ctrlKey || evt.data.$.metaKey,
+			alt = evt.data.$.altKey,
+			shift = evt.data.$.shiftKey,
+			key = String.fromCharCode( evt.data.$.keyCode ),
+			keyProcessor = accessKeyProcessors[( ctrl ? 'CTRL+' : '' ) + ( alt ? 'ALT+' : '') + ( shift ? 'SHIFT+' : '' ) + key];
+
+		if ( !keyProcessor || !keyProcessor.length )
+			return;
+
+		keyProcessor = keyProcessor[keyProcessor.length - 1];
+		keyProcessor.keyup && keyProcessor.keyup.call( keyProcessor.uiElement, keyProcessor.dialog, keyProcessor.key );
+		evt.data.preventDefault();
+	};
+
+	var registerAccessKey = function( uiElement, dialog, key, downFunc, upFunc )
+	{
+		var procList = accessKeyProcessors[key] || ( accessKeyProcessors[key] = [] );
+		procList.push( {
+				uiElement : uiElement,
+				dialog : dialog,
+				key : key,
+				keyup : upFunc || uiElement.accessKeyUp,
+				keydown : downFunc || uiElement.accessKeyDown
+			} );
+	};
+
+	var unregisterAccessKey = function( obj )
+	{
+		for ( var i in accessKeyProcessors )
+		{
+			var list = accessKeyProcessors[i];
+			for ( var j = list.length - 1 ; j >= 0 ; j-- )
+			{
+				if ( list[j].dialog == obj || list[j].uiElement == obj )
+					list.splice( j, 1 );
+			}
+			if ( list.length === 0 )
+				delete accessKeyProcessors[i];
+		}
+	};
+
+	var tabAccessKeyUp = function( dialog, key )
+	{
+		if ( dialog._.accessKeyMap[key] )
+			dialog.selectPage( dialog._.accessKeyMap[key] );
+	};
+
+	var tabAccessKeyDown = function( dialog, key )
+	{
+	};
+
+	(function()
+	{
+		var decimalRegex = /^\d+(?:\.\d+)?$/,
+			fixLength = function( length )
+			{
+				return length + ( decimalRegex.test( length ) ? 'px' : '' );
+			};
+
+		CKEDITOR.ui.dialog =
+		{
+			/**
+			 * The base class of all dialog UI elements.
+			 * @constructor
+			 * @param {CKEDITOR.dialog} dialog Parent dialog object.
+			 * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition Element
+			 * definition. Accepted fields:
+			 * <ul>
+			 * 	<li><strong>id</strong> (Required) The id of the UI element. See {@link
+			 * 	CKEDITOR.dialog#getContentElement}</li>
+			 * 	<li><strong>type</strong> (Required) The type of the UI element. The
+			 * 	value to this field specifies which UI element class will be used to
+			 * 	generate the final widget.</li>
+			 * 	<li><strong>title</strong> (Optional) The popup tooltip for the UI
+			 * 	element.</li>
+			 * 	<li><strong>className</strong> (Optional) Additional CSS class names
+			 * 	to add to the UI element. Separated by space.</li>
+			 * 	<li><strong>style</strong> (Optional) Additional CSS inline styles
+			 * 	to add to the UI element. A semicolon (;) is required after the last
+			 * 	style declaration.</li>
+			 * 	<li><strong>accessKey</strong> (Optional) The alphanumeric access key
+			 * 	for this element. Access keys are automatically prefixed by CTRL.</li>
+			 * 	<li><strong>on*</strong> (Optional) Any UI element definition field that
+			 * 	starts with <em>on</em> followed immediately by a capital letter and
+			 * 	probably more letters is an event handler. Event handlers may be further
+			 * 	divided into registered event handlers and DOM event handlers. Please
+			 * 	refer to {@link CKEDITOR.ui.dialog.uiElement#registerEvents} and
+			 * 	{@link CKEDITOR.ui.dialog.uiElement#eventProcessors} for more
+			 * 	information.</li>
+			 * </ul>
+			 * @param {Array} htmlList
+			 * List of HTML code to be added to the dialog's content area.
+			 * @param {Function|String} nodeNameArg
+			 * A function returning a string, or a simple string for the node name for
+			 * the root DOM node. Default is 'div'.
+			 * @param {Function|Object} stylesArg
+			 * A function returning an object, or a simple object for CSS styles applied
+			 * to the DOM node. Default is empty object.
+			 * @param {Function|Object} attributesArg
+			 * A fucntion returning an object, or a simple object for attributes applied
+			 * to the DOM node. Default is empty object.
+			 * @param {Function|String} contentsArg
+			 * A function returning a string, or a simple string for the HTML code inside
+			 * the root DOM node. Default is empty string.
+			 * @example
+			 */
+			uiElement : function( dialog, elementDefinition, htmlList, nodeNameArg, stylesArg, attributesArg, contentsArg )
+			{
+				if (arguments.length < 4 )
+					return;
+
+				var nodeName = ( nodeNameArg.call ? nodeNameArg( elementDefinition ) : nodeNameArg ) || 'div',
+					html = [ '<', nodeName, ' ' ],
+					styles = ( stylesArg && stylesArg.call ? stylesArg( elementDefinition ) : stylesArg ) || {},
+					attributes = ( attributesArg && attributesArg.call ? attributesArg( elementDefinition ) : attributesArg ) || {},
+					innerHTML = ( contentsArg && contentsArg.call ? contentsArg( dialog, elementDefinition ) : contentsArg ) || '',
+					domId = this.domId = attributes.id || CKEDITOR.tools.getNextNumber() + '_uiElement',
+					id = this.id = elementDefinition.id,
+					i;
+
+				// Set the id, a unique id is required for getElement() to work.
+				attributes.id = domId;
+
+				// Set the type and definition CSS class names.
+				var classes = {};
+				if ( elementDefinition.type )
+					classes[ 'cke_dialog_ui_' + elementDefinition.type ] = 1;
+				if ( elementDefinition.className )
+					classes[ elementDefinition.className ] = 1;
+				var attributeClasses = ( attributes['class'] && attributes['class'].split ) ? attributes['class'].split( ' ' ) : [];
+				for ( i = 0 ; i < attributeClasses.length ; i++ )
+				{
+					if ( attributeClasses[i] )
+						classes[ attributeClasses[i] ] = 1;
+				}
+				var finalClasses = [];
+				for ( i in classes )
+					finalClasses.push( i );
+				attributes['class'] = finalClasses.join( ' ' );
+
+				// Set the popup tooltop.
+				if ( elementDefinition.title )
+					attributes.title = elementDefinition.title;
+
+				// Write the inline CSS styles.
+				var styleStr = ( elementDefinition.style || '' ).split( ';' );
+				for ( i in styles )
+					styleStr.push( i + ':' + styles[i] );
+				for ( i = styleStr.length - 1 ; i >= 0 ; i-- )
+				{
+					if ( styleStr[i] === '' )
+						styleStr.splice( i, 1 );
+				}
+				if ( styleStr.length > 0 )
+					attributes.style = ( attributes.style || '' ) + styleStr.join( '; ' );
+
+				// Write the attributes.
+				for ( i in attributes )
+					html.push( i + '="' + CKEDITOR.tools.htmlEncode( attributes[i] ) + '" ');
+
+				// Write the content HTML.
+				html.push( '>', innerHTML, '</', nodeName, '>' );
+
+				// Add contents to the parent HTML array.
+				htmlList.push( html.join( '' ) );
+
+				( this._ || ( this._ = {} ) ).dialog = dialog;
+
+				// Override isChanged if it is defined in element definition.
+				if ( typeof( elementDefinition.isChanged ) == 'boolean' )
+					this.isChanged = function(){ return elementDefinition.isChanged; };
+				if ( typeof( elementDefinition.isChanged ) == 'function' )
+					this.isChanged = elementDefinition.isChanged;
+
+				// Add events.
+				CKEDITOR.event.implementOn( this );
+
+				this.registerEvents( elementDefinition );
+				if ( this.accessKeyUp && this.accessKeyDown && elementDefinition.accessKey )
+					registerAccessKey( this, dialog, 'CTRL+' + elementDefinition.accessKey );
+
+				// Completes this object with everything we have in the
+				// definition.
+				CKEDITOR.tools.extend( this, elementDefinition );
+			},
+
+			/**
+			 * Horizontal layout box for dialog UI elements, auto-expends to available width of container.
+			 * @constructor
+			 * @extends CKEDITOR.ui.dialog.uiElement
+			 * @param {CKEDITOR.dialog} dialog
+			 * Parent dialog object.
+			 * @param {Array} childObjList
+			 * Array of {@link CKEDITOR.ui.dialog.uiElement} objects inside this
+			 * container.
+			 * @param {Array} childHtmlList
+			 * Array of HTML code that correspond to the HTML output of all the
+			 * objects in childObjList.
+			 * @param {Array} htmlList
+			 * Array of HTML code that this element will output to.
+			 * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition
+			 * The element definition. Accepted fields:
+			 * <ul>
+			 * 	<li><strong>widths</strong> (Optional) The widths of child cells.</li>
+			 * 	<li><strong>height</strong> (Optional) The height of the layout.</li>
+			 * 	<li><strong>padding</strong> (Optional) The padding width inside child
+			 * 	 cells.</li>
+			 * 	<li><strong>align</strong> (Optional) The alignment of the whole layout
+			 * 	</li>
+			 * </ul>
+			 * @example
+			 */
+			hbox : function( dialog, childObjList, childHtmlList, htmlList, elementDefinition )
+			{
+				if ( arguments.length < 4 )
+					return;
+
+				this._ || ( this._ = {} );
+
+				var children = this._.children = childObjList,
+					widths = elementDefinition && elementDefinition.widths || null,
+					height = elementDefinition && elementDefinition.height || null,
+					styles = {},
+					i;
+				/** @ignore */
+				var innerHTML = function()
+				{
+					var html = [ '<tbody><tr class="cke_dialog_ui_hbox">' ];
+					for ( i = 0 ; i < childHtmlList.length ; i++ )
+					{
+						var className = 'cke_dialog_ui_hbox_child',
+							styles = [];
+						if ( i === 0 )
+							className = 'cke_dialog_ui_hbox_first';
+						if ( i == childHtmlList.length - 1 )
+							className = 'cke_dialog_ui_hbox_last';
+						html.push( '<td class="', className, '" ' );
+						if ( widths )
+						{
+							if ( widths[i] )
+								styles.push( 'width:' + fixLength( widths[i] ) );
+						}
+						else
+							styles.push( 'width:' + Math.floor( 100 / childHtmlList.length ) + '%' );
+						if ( height )
+							styles.push( 'height:' + fixLength( height ) );
+						if ( elementDefinition && elementDefinition.padding != undefined )
+							styles.push( 'padding:' + fixLength( elementDefinition.padding ) );
+						if ( styles.length > 0 )
+							html.push( 'style="' + styles.join('; ') + '" ' );
+						html.push( '>', childHtmlList[i], '</td>' );
+					}
+					html.push( '</tr></tbody>' );
+					return html.join( '' );
+				};
+
+				CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition || { type : 'hbox' }, htmlList, 'table', styles,
+						{ align : ( elementDefinition && elementDefinition.align ) ||
+							( dialog.getParentEditor().lang.dir == 'ltr' ? 'left' : 'right' ) }, innerHTML );
+			},
+
+			/**
+			 * Vertical layout box for dialog UI elements.
+			 * @constructor
+			 * @extends CKEDITOR.ui.dialog.hbox
+			 * @param {CKEDITOR.dialog} dialog
+			 * Parent dialog object.
+			 * @param {Array} childObjList
+			 * Array of {@link CKEDITOR.ui.dialog.uiElement} objects inside this
+			 * container.
+			 * @param {Array} childHtmlList
+			 * Array of HTML code that correspond to the HTML output of all the
+			 * objects in childObjList.
+			 * @param {Array} htmlList
+			 * Array of HTML code that this element will output to.
+			 * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition
+			 * The element definition. Accepted fields:
+			 * <ul>
+			 * 	<li><strong>width</strong> (Optional) The width of the layout.</li>
+			 * 	<li><strong>heights</strong> (Optional) The heights of individual cells.
+			 * 	</li>
+			 * 	<li><strong>align</strong> (Optional) The alignment of the layout.</li>
+			 * 	<li><strong>padding</strong> (Optional) The padding width inside child
+			 * 	cells.</li>
+			 * 	<li><strong>expand</strong> (Optional) Whether the layout should expand
+			 * 	vertically to fill its container.</li>
+			 * </ul>
+			 * @example
+			 */
+			vbox : function( dialog, childObjList, childHtmlList, htmlList, elementDefinition )
+			{
+				if (arguments.length < 3 )
+					return;
+
+				this._ || ( this._ = {} );
+
+				var children = this._.children = childObjList,
+					width = elementDefinition && elementDefinition.width || null,
+					heights = elementDefinition && elementDefinition.heights || null;
+				/** @ignore */
+				var innerHTML = function()
+				{
+					var html = [ '<table cellspacing="0" border="0" ' ];
+					html.push( 'style="' );
+					if ( elementDefinition && elementDefinition.expand )
+						html.push( 'height:100%;' );
+					html.push( 'width:' + fixLength( width || '100%' ), ';' );
+					html.push( '"' );
+					html.push( 'align="', CKEDITOR.tools.htmlEncode(
+						( elementDefinition && elementDefinition.align ) || ( dialog.getParentEditor().lang.dir == 'ltr' ? 'left' : 'right' ) ), '" ' );
+
+					html.push( '><tbody>' );
+					for ( var i = 0 ; i < childHtmlList.length ; i++ )
+					{
+						var styles = [];
+						html.push( '<tr><td ' );
+						if ( width )
+							styles.push( 'width:' + fixLength( width || '100%' ) );
+						if ( heights )
+							styles.push( 'height:' + fixLength( heights[i] ) );
+						else if ( elementDefinition && elementDefinition.expand )
+							styles.push( 'height:' + Math.floor( 100 / childHtmlList.length ) + '%' );
+						if ( elementDefinition && elementDefinition.padding != undefined )
+							styles.push( 'padding:' + fixLength( elementDefinition.padding ) );
+						if ( styles.length > 0 )
+							html.push( 'style="', styles.join( '; ' ), '" ' );
+						html.push( ' class="cke_dialog_ui_vbox_child">', childHtmlList[i], '</td></tr>' );
+					}
+					html.push( '</tbody></table>' );
+					return html.join( '' );
+				};
+				CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition || { type : 'vbox' }, htmlList, 'div', null, null, innerHTML );
+			}
+		};
+	})();
+
+	CKEDITOR.ui.dialog.uiElement.prototype =
+	{
+		/**
+		 * Gets the root DOM element of this dialog UI object.
+		 * @returns {CKEDITOR.dom.element} Root DOM element of UI object.
+		 * @example
+		 * uiElement.getElement().hide();
+		 */
+		getElement : function()
+		{
+			return CKEDITOR.document.getById( this.domId );
+		},
+
+		/**
+		 * Gets the DOM element that the user inputs values.
+		 * This function is used by setValue(), getValue() and focus(). It should
+		 * be overrided in child classes where the input element isn't the root
+		 * element.
+		 * @returns {CKEDITOR.dom.element} The element where the user input values.
+		 * @example
+		 * var rawValue = textInput.getInputElement().$.value;
+		 */
+		getInputElement : function()
+		{
+			return this.getElement();
+		},
+
+		/**
+		 * Gets the parent dialog object containing this UI element.
+		 * @returns {CKEDITOR.dialog} Parent dialog object.
+		 * @example
+		 * var dialog = uiElement.getDialog();
+		 */
+		getDialog : function()
+		{
+			return this._.dialog;
+		},
+
+		/**
+		 * Sets the value of this dialog UI object.
+		 * @param {Object} value The new value.
+		 * @returns {CKEDITOR.dialog.uiElement} The current UI element.
+		 * @example
+		 * uiElement.setValue( 'Dingo' );
+		 */
+		setValue : function( value )
+		{
+			this.getInputElement().setValue( value );
+			this.fire( 'change', { value : value } );
+			return this;
+		},
+
+		/**
+		 * Gets the current value of this dialog UI object.
+		 * @returns {Object} The current value.
+		 * @example
+		 * var myValue = uiElement.getValue();
+		 */
+		getValue : function()
+		{
+			return this.getInputElement().getValue();
+		},
+
+		/**
+		 * Tells whether the UI object's value has changed.
+		 * @returns {Boolean} true if changed, false if not changed.
+		 * @example
+		 * if ( uiElement.isChanged() )
+		 * &nbsp;&nbsp;confirm( 'Value changed! Continue?' );
+		 */
+		isChanged : function()
+		{
+			// Override in input classes.
+			return false;
+		},
+
+		/**
+		 * Selects the parent tab of this element. Usually called by focus() or overridden focus() methods.
+		 * @returns {CKEDITOR.dialog.uiElement} The current UI element.
+		 * @example
+		 * focus : function()
+		 * {
+		 * 		this.selectParentTab();
+		 * 		// do something else.
+		 * }
+		 */
+		selectParentTab : function()
+		{
+			var element = this.getInputElement(),
+				cursor = element,
+				tabId;
+			while ( ( cursor = cursor.getParent() ) && cursor.$.className.search( 'cke_dialog_page_contents' ) == -1 )
+			{ /*jsl:pass*/ }
+
+			tabId = cursor.getAttribute( 'name' );
+
+			this._.dialog.selectPage( tabId );
+			return this;
+		},
+
+		/**
+		 * Puts the focus to the UI object. Switches tabs if the UI object isn't in the active tab page.
+		 * @returns {CKEDITOR.dialog.uiElement} The current UI element.
+		 * @example
+		 * uiElement.focus();
+		 */
+		focus : function()
+		{
+			this.selectParentTab().getInputElement().focus();
+			return this;
+		},
+
+		/**
+		 * Registers the on* event handlers defined in the element definition.
+		 * The default behavior of this function is:
+		 * <ol>
+		 *  <li>
+		 *  	If the on* event is defined in the class's eventProcesors list,
+		 *  	then the registration is delegated to the corresponding function
+		 *  	in the eventProcessors list.
+		 *  </li>
+		 *  <li>
+		 *  	If the on* event is not defined in the eventProcessors list, then
+		 *  	register the event handler under the corresponding DOM event of
+		 *  	the UI element's input DOM element (as defined by the return value
+		 *  	of {@link CKEDITOR.ui.dialog.uiElement#getInputElement}).
+		 *  </li>
+		 * </ol>
+		 * This function is only called at UI element instantiation, but can
+		 * be overridded in child classes if they require more flexibility.
+		 * @param {CKEDITOR.dialog.uiElementDefinition} definition The UI element
+		 * definition.
+		 * @returns {CKEDITOR.dialog.uiElement} The current UI element.
+		 * @example
+		 */
+		registerEvents : function( definition )
+		{
+			var regex = /^on([A-Z]\w+)/,
+				match;
+
+			var registerDomEvent = function( uiElement, dialog, eventName, func )
+			{
+				dialog.on( 'load', function()
+				{
+					uiElement.getInputElement().on( eventName, func, uiElement );
+				});
+			};
+
+			for ( var i in definition )
+			{
+				if ( !( match = i.match( regex ) ) )
+					continue;
+				if ( this.eventProcessors[i] )
+					this.eventProcessors[i].call( this, this._.dialog, definition[i] );
+				else
+					registerDomEvent( this, this._.dialog, match[1].toLowerCase(), definition[i] );
+			}
+
+			return this;
+		},
+
+		/**
+		 * The event processor list used by
+		 * {@link CKEDITOR.ui.dialog.uiElement#getInputElement} at UI element
+		 * instantiation. The default list defines three on* events:
+		 * <ol>
+		 *  <li>onLoad - Called when the element's parent dialog opens for the
+		 *  first time</li>
+		 *  <li>onShow - Called whenever the element's parent dialog opens.</li>
+		 *  <li>onHide - Called whenever the element's parent dialog closes.</li>
+		 * </ol>
+		 * @field
+		 * @type Object
+		 * @example
+		 * // This connects the 'click' event in CKEDITOR.ui.dialog.button to onClick
+		 * // handlers in the UI element's definitions.
+		 * CKEDITOR.ui.dialog.button.eventProcessors = CKEDITOR.tools.extend( {},
+		 * &nbsp;&nbsp;CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,
+		 * &nbsp;&nbsp;{ onClick : function( dialog, func ) { this.on( 'click', func ); } },
+		 * &nbsp;&nbsp;true );
+		 */
+		eventProcessors :
+		{
+			onLoad : function( dialog, func )
+			{
+				dialog.on( 'load', func );
+			},
+
+			onShow : function( dialog, func )
+			{
+				dialog.on( 'show', func );
+			},
+
+			onHide : function( dialog, func )
+			{
+				dialog.on( 'hide', func );
+			}
+		},
+
+		/**
+		 * The default handler for a UI element's access key down event, which
+		 * tries to put focus to the UI element.<br />
+		 * Can be overridded in child classes for more sophisticaed behavior.
+		 * @param {CKEDITOR.dialog} dialog The parent dialog object.
+		 * @param {String} key The key combination pressed. Since access keys
+		 * are defined to always include the CTRL key, its value should always
+		 * include a 'CTRL+' prefix.
+		 * @example
+		 */
+		accessKeyDown : function( dialog, key )
+		{
+			this.focus();
+		},
+
+		/**
+		 * The default handler for a UI element's access key up event, which
+		 * does nothing.<br />
+		 * Can be overridded in child classes for more sophisticated behavior.
+		 * @param {CKEDITOR.dialog} dialog The parent dialog object.
+		 * @param {String} key The key combination pressed. Since access keys
+		 * are defined to always include the CTRL key, its value should always
+		 * include a 'CTRL+' prefix.
+		 * @example
+		 */
+		accessKeyUp : function( dialog, key )
+		{
+		},
+
+		/**
+		 * Disables a UI element.
+		 * @example
+		 */
+		disable : function()
+		{
+			var element = this.getInputElement();
+			element.setAttribute( 'disabled', 'true' );
+			element.addClass( 'cke_disabled' );
+		},
+
+		/**
+		 * Enables a UI element.
+		 * @example
+		 */
+		enable : function()
+		{
+			var element = this.getInputElement();
+			element.removeAttribute( 'disabled' );
+			element.removeClass( 'cke_disabled' );
+		}
+	};
+
+	CKEDITOR.ui.dialog.hbox.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.uiElement,
+		/**
+		 * @lends CKEDITOR.ui.dialog.hbox.prototype
+		 */
+		{
+			/**
+			 * Gets a child UI element inside this container.
+			 * @param {Array|Number} indices An array or a single number to indicate the child's
+			 * position in the container's descendant tree. Omit to get all the children in an array.
+			 * @returns {Array|CKEDITOR.ui.dialog.uiElement} Array of all UI elements in the container
+			 * if no argument given, or the specified UI element if indices is given.
+			 * @example
+			 * var checkbox = hbox.getChild( [0,1] );
+			 * checkbox.setValue( true );
+			 */
+			getChild : function( indices )
+			{
+				// If no arguments, return a clone of the children array.
+				if ( arguments.length < 1 )
+					return this._.children.concat();
+
+				// If indices isn't array, make it one.
+				if ( !indices.splice )
+					indices = [ indices ];
+
+				// Retrieve the child element according to tree position.
+				if ( indices.length < 2 )
+					return this._.children[ indices[0] ];
+				else
+					return ( this._.children[ indices[0] ] && this._.children[ indices[0] ].getChild ) ?
+						this._.children[ indices[0] ].getChild( indices.slice( 1, indices.length ) ) :
+						null;
+			}
+		}, true );
+
+	CKEDITOR.ui.dialog.vbox.prototype = new CKEDITOR.ui.dialog.hbox();
+
+
+
+	(function()
+	{
+		var commonBuilder = {
+			build : function( dialog, elementDefinition, output )
+			{
+				var children = elementDefinition.children,
+					child,
+					childHtmlList = [],
+					childObjList = [];
+				for ( var i = 0 ; ( i < children.length && ( child = children[i] ) ) ; i++ )
+				{
+					var childHtml = [];
+					childHtmlList.push( childHtml );
+					childObjList.push( CKEDITOR.dialog._.uiElementBuilders[ child.type ].build( dialog, child, childHtml ) );
+				}
+				return new CKEDITOR.ui.dialog[elementDefinition.type]( dialog, childObjList, childHtmlList, output, elementDefinition );
+			}
+		};
+
+		CKEDITOR.dialog.addUIElement( 'hbox', commonBuilder );
+		CKEDITOR.dialog.addUIElement( 'vbox', commonBuilder );
+	})();
+
+	/**
+	 * Generic dialog command. It opens a specific dialog when executed.
+	 * @constructor
+	 * @augments CKEDITOR.commandDefinition
+	 * @param {string} dialogName The name of the dialog to open when executing
+	 *		this command.
+	 * @example
+	 * // Register the "link" command, which opens the "link" dialog.
+	 * editor.addCommand( 'link', <b>new CKEDITOR.dialogCommand( 'link' )</b> );
+	 */
+	CKEDITOR.dialogCommand = function( dialogName )
+	{
+		this.dialogName = dialogName;
+	};
+
+	CKEDITOR.dialogCommand.prototype =
+	{
+		/** @ignore */
+		exec : function( editor )
+		{
+			editor.openDialog( this.dialogName );
+		}
+	};
+
+	(function()
+	{
+		var notEmptyRegex = /^([a]|[^a])+$/,
+			integerRegex = /^\d*$/,
+			numberRegex = /^\d*(?:\.\d+)?$/;
+
+		CKEDITOR.VALIDATE_OR = 1;
+		CKEDITOR.VALIDATE_AND = 2;
+
+		CKEDITOR.dialog.validate =
+		{
+			functions : function()
+			{
+				return function()
+				{
+					/**
+					 * It's important for validate functions to be able to accept the value
+					 * as argument in addition to this.getValue(), so that it is possible to
+					 * combine validate functions together to make more sophisticated
+					 * validators.
+					 */
+					var value = this && this.getValue ? this.getValue() : arguments[0];
+
+					var msg = undefined,
+						relation = CKEDITOR.VALIDATE_AND,
+						functions = [], i;
+
+					for ( i = 0 ; i < arguments.length ; i++ )
+					{
+						if ( typeof( arguments[i] ) == 'function' )
+							functions.push( arguments[i] );
+						else
+							break;
+					}
+
+					if ( i < arguments.length && typeof( arguments[i] ) == 'string' )
+					{
+						msg = arguments[i];
+						i++;
+					}
+
+					if ( i < arguments.length && typeof( arguments[i]) == 'number' )
+						relation = arguments[i];
+
+					var passed = ( relation == CKEDITOR.VALIDATE_AND ? true : false );
+					for ( i = 0 ; i < functions.length ; i++ )
+					{
+						if ( relation == CKEDITOR.VALIDATE_AND )
+							passed = passed && functions[i]( value );
+						else
+							passed = passed || functions[i]( value );
+					}
+
+					if ( !passed )
+					{
+						if ( msg !== undefined )
+							alert( msg );
+						if ( this && ( this.select || this.focus ) )
+							( this.select || this.focus )();
+						return false;
+					}
+
+					return true;
+				};
+			},
+
+			regex : function( regex, msg )
+			{
+				/*
+				 * Can be greatly shortened by deriving from functions validator if code size
+				 * turns out to be more important than performance.
+				 */
+				return function()
+				{
+					var value = this && this.getValue ? this.getValue() : arguments[0];
+					if ( !regex.test( value ) )
+					{
+						if ( msg !== undefined )
+							alert( msg );
+						if ( this && ( this.select || this.focus ) )
+						{
+							if ( this.select )
+								this.select();
+							else
+								this.focus();
+						}
+						return false;
+					}
+					return true;
+				};
+			},
+
+			notEmpty : function( msg )
+			{
+				return this.regex( notEmptyRegex, msg );
+			},
+
+			integer : function( msg )
+			{
+				return this.regex( integerRegex, msg );
+			},
+
+			'number' : function( msg )
+			{
+				return this.regex( numberRegex, msg );
+			},
+
+			equals : function( value, msg )
+			{
+				return this.functions( function( val ){ return val == value; }, msg );
+			},
+
+			notEqual : function( value, msg )
+			{
+				return this.functions( function( val ){ return val != value; }, msg );
+			}
+		};
+	})();
+
+})();
+
+// Extend the CKEDITOR.editor class with dialog specific functions.
+CKEDITOR.tools.extend( CKEDITOR.editor.prototype,
+	/** @lends CKEDITOR.editor.prototype */
+	{
+		/**
+		 * Loads and opens a registered dialog.
+		 * @param {String} dialogName The registered name of the dialog.
+		 * @see CKEDITOR.dialog.add
+		 * @example
+		 * CKEDITOR.instances.editor1.openDialog( 'smiley' );
+		 * @returns {CKEDITOR.dialog} The dialog object corresponding to the dialog displayed. null if the dialog name is not registered.
+		 */
+		openDialog : function( dialogName )
+		{
+			var dialogDefinitions = CKEDITOR.dialog._.dialogDefinitions[ dialogName ];
+
+			// If the dialogDefinition is already loaded, open it immediately.
+			if ( typeof dialogDefinitions == 'function' )
+			{
+				var storedDialogs = this._.storedDialogs ||
+					( this._.storedDialogs = {} );
+
+				var dialog = storedDialogs[ dialogName ] ||
+					( storedDialogs[ dialogName ] = new CKEDITOR.dialog( this, dialogName ) );
+
+				dialog.show();
+
+				return dialog;
+			}
+
+			// Not loaded? Load the .js file first.
+			var body = CKEDITOR.document.getBody(),
+				cursor = body.$.style.cursor,
+				me = this;
+
+			body.setStyle( 'cursor', 'wait' );
+			CKEDITOR.scriptLoader.load( CKEDITOR.getUrl( dialogDefinitions ), function()
+				{
+					me.openDialog( dialogName );
+					body.setStyle( 'cursor', cursor );
+				} );
+
+			return null;
+		}
+	});
+
+// Dialog related configurations.
+
+/**
+ * The color of the dialog background cover. It should be a valid CSS color
+ * string.
+ * @type String
+ * @default white
+ * @example
+ * config.dialog_backgroundCoverColor = 'rgb(255, 254, 253)';
+ */
+CKEDITOR.config.dialog_backgroundCoverColor = 'white';
+
+/**
+ * The opacity of the dialog background cover. It should be a number within the
+ * range [0.0, 1.0].
+ * @type Number
+ * @default 0.5
+ * @example
+ * config.dialog_backgroundCoverOpacity = 0.7;
+ */
+CKEDITOR.config.dialog_backgroundCoverOpacity = 0.5;
+
+/**
+ * The distance of magnetic borders used in moving and resizing dialogs,
+ * measured in pixels.
+ * @type Number
+ * @default 20
+ * @example
+ * config.dialog_magnetDistance = 30;
+ */
+CKEDITOR.config.dialog_magnetDistance = 20;
Index: /CKEditor/tags/3.0 Beta/_source/plugins/dialogui/plugin.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/plugins/dialogui/plugin.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/plugins/dialogui/plugin.js	(revision 3046)
@@ -0,0 +1,1201 @@
+/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/** @fileoverview The "dialogui" plugin. */
+
+CKEDITOR.plugins.add( 'dialogui' );
+
+(function()
+{
+	var initPrivateObject = function( elementDefinition )
+	{
+		this._ || ( this._ = {} );
+		this._['default'] = [ elementDefinition['default'] || '' ];
+		var args = [ this._ ];
+		for ( var i = 1 ; i < arguments.length ; i++ )
+			args.push( arguments[i] );
+		args.push( true );
+		CKEDITOR.tools.extend.apply( CKEDITOR.tools, args );
+		return this._;
+	},
+	textBuilder =
+	{
+		build : function( dialog, elementDefinition, output )
+		{
+			return new CKEDITOR.ui.dialog.textInput( dialog, elementDefinition, output );
+		}
+	},
+	commonBuilder =
+	{
+		build : function( dialog, elementDefinition, output )
+		{
+			return new CKEDITOR.ui.dialog[elementDefinition.type]( dialog, elementDefinition, output );
+		}
+	},
+	commonPrototype =
+	{
+		isChanged : function()
+		{
+			return this.getValue() != this.getDefault();
+		},
+
+		reset : function()
+		{
+			this.setValue( this.getDefault() );
+		},
+
+		getDefault : function()
+		{
+			var defs = this._['default'];
+			return defs[ defs.length - 1 ];
+		},
+
+		pushDefault : function()
+		{
+			this._['default'].push( this.getValue() );
+		},
+
+		popDefault : function()
+		{
+			this._['default'].pop();
+		}
+	},
+	commonEventProcessors = CKEDITOR.tools.extend( {}, CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,
+		{
+			onChange : function( dialog, func )
+			{
+				if ( !this._.domOnChangeRegistered )
+				{
+					dialog.on( 'load', function()
+						{
+							this.getInputElement().on( 'change', function(){ this.fire( 'change', { value : this.getValue() } ); }, this );
+						}, this );
+					this._.domOnChangeRegistered = true;
+				}
+
+				this.on( 'change', func );
+			}
+		}, true ),
+	eventRegex = /^on([A-Z]\w+)/,
+	cleanInnerDefinition = function( def )
+	{
+		// An inner UI element should not have the parent's type, title or events.
+		for ( var i in def )
+		{
+			if ( eventRegex.test( i ) || i == 'title' || i == 'type' )
+				delete def[i];
+		}
+		return def;
+	};
+
+	CKEDITOR.tools.extend( CKEDITOR.ui.dialog,
+		/** @lends CKEDITOR.ui.dialog */
+		{
+			/**
+			 * Base class for all dialog elements with a textual label on the left.
+			 * @constructor
+			 * @example
+			 * @extends CKEDITOR.ui.dialog.uiElement
+			 * @param {CKEDITOR.dialog} dialog
+			 * Parent dialog object.
+			 * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition
+			 * The element definition. Accepted fields:
+			 * <ul>
+			 * 	<li><strong>label</strong> (Required) The label string.</li>
+			 * 	<li><strong>labelLayout</strong> (Optional) Put 'horizontal' here if the
+			 * 	label element is to be layed out horizontally. Otherwise a vertical
+			 * 	layout will be used.</li>
+			 * 	<li><strong>widths</strong> (Optional) This applies only for horizontal
+			 * 	layouts - an 2-element array of lengths to specify the widths of the
+			 * 	label and the content element.</li>
+			 * </ul>
+			 * @param {Array} htmlList
+			 * List of HTML code to output to.
+			 * @param {Function} contentHtml
+			 * A function returning the HTML code string to be added inside the content
+			 * cell.
+			 */
+			labeledElement : function( dialog, elementDefinition, htmlList, contentHtml )
+			{
+				if ( arguments.length < 4 )
+					return;
+
+				var _ = initPrivateObject.call( this, elementDefinition );
+				_.labelId = CKEDITOR.tools.getNextNumber() + '_label';
+				var children = this._.children = [];
+				/** @ignore */
+				var innerHTML = function()
+				{
+					var html = [];
+					if ( elementDefinition.labelLayout != 'horizontal' )
+						html.push( '<div class="cke_dialog_ui_labeled_label" id="',
+								_.labelId,
+								'" >',
+								CKEDITOR.tools.htmlEncode( elementDefinition.label ),
+								'</div>',
+								'<div class="cke_dialog_ui_labeled_content">',
+								contentHtml( dialog, elementDefinition ),
+								'</div>' );
+					else
+					{
+						var hboxDefinition = {
+							type : 'hbox',
+							widths : elementDefinition.widths,
+							padding : 0,
+							children :
+							[
+								{
+									type : 'html',
+									html : '<span class="cke_dialog_ui_labeled_label" ' +
+										'id="' + _.labelId + '">' +  CKEDITOR.tools.htmlEncode( elementDefinition.label ) +
+										'</span>'
+								},
+								{
+									type : 'html',
+									html : '<span class="cke_dialog_ui_labeled_content">' +
+										contentHtml( dialog, elementDefinition ) +
+										'</span>'
+								}
+							]
+						};
+						CKEDITOR.dialog._.uiElementBuilders.hbox.build( dialog, hboxDefinition, html );
+					}
+					return html.join( '' );
+				};
+				CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition, htmlList, 'div', null, null, innerHTML );
+			},
+
+			/**
+			 * A text input with a label. This UI element class represents both the
+			 * single-line text inputs and password inputs in dialog boxes.
+			 * @constructor
+			 * @example
+			 * @extends CKEDITOR.ui.dialog.labeledElement
+			 * @param {CKEDITOR.dialog} dialog
+			 * Parent dialog object.
+			 * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition
+			 * The element definition. Accepted fields:
+			 * <ul>
+			 * 	<li><strong>default</strong> (Optional) The default value.</li>
+			 * 	<li><strong>validate</strong> (Optional) The validation function. </li>
+			 * 	<li><strong>maxLength</strong> (Optional) The maximum length of text box
+			 * 	contents.</li>
+			 * 	<li><strong>size</strong> (Optional) The size of the text box. This is
+			 * 	usually overridden by the size defined by the skin, however.</li>
+			 * </ul>
+			 * @param {Array} htmlList
+			 * List of HTML code to output to.
+			 */
+			textInput : function( dialog, elementDefinition, htmlList )
+			{
+				if ( arguments.length < 3 )
+					return;
+
+				initPrivateObject.call( this, elementDefinition );
+				var domId = this._.inputId = CKEDITOR.tools.getNextNumber() + '_textInput',
+					attributes = { 'class' : 'cke_dialog_ui_input_' + elementDefinition.type, id : domId },
+					i;
+
+				// Set the validator, if any.
+				if ( elementDefinition.validate )
+					this.validate = elementDefinition.validate;
+
+				// Set the max length and size.
+				if ( elementDefinition.maxLength )
+					attributes.maxlength = elementDefinition.maxLength;
+				if ( elementDefinition.size )
+					attributes.size = elementDefinition.size;
+
+				// If user presses Enter in a text box, it implies clicking OK for the dialog.
+				var me = this;
+				dialog.on( 'load', function()
+					{
+						me.getInputElement().on( 'keyup', function( evt )
+							{
+								if ( evt.data.$.keyCode == 13 )
+									dialog.getButton( 'ok' ) && dialog.getButton( 'ok' ).click();
+							} );
+					} );
+
+				/** @ignore */
+				var innerHTML = function()
+				{
+					// IE BUG: Text input fields in IE at 100% would exceed a <td> or inline
+					// container's width, so need to wrap it inside a <div>.
+					var html = [ '<div class="cke_dialog_ui_input_', elementDefinition.type, '"><input ' ];
+					for ( var i in attributes )
+						html.push( i + '="' + attributes[i] + '" ' );
+					html.push( ' /></div>' );
+					return html.join( '' );
+				};
+				CKEDITOR.ui.dialog.labeledElement.call( this, dialog, elementDefinition, htmlList, innerHTML );
+			},
+
+			/**
+			 * A text area with a label on the top or left.
+			 * @constructor
+			 * @extends CKEDITOR.ui.dialog.labeledElement
+			 * @example
+			 * @param {CKEDITOR.dialog} dialog
+			 * Parent dialog object.
+			 * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition
+			 * The element definition. Accepted fields:
+			 * <ul>
+			 * 	<li><strong>rows</strong> (Optional) The number of rows displayed.
+			 * 	Defaults to 5 if not defined.</li>
+			 * 	<li><strong>cols</strong> (Optional) The number of cols displayed.
+			 * 	Defaults to 20 if not defined. Usually overridden by skins.</li>
+			 * 	<li><strong>default</strong> (Optional) The default value.</li>
+			 * 	<li><strong>validate</strong> (Optional) The validation function. </li>
+			 * </ul>
+			 * @param {Array} htmlList
+			 * List of HTML code to output to.
+			 */
+			textarea : function( dialog, elementDefinition, htmlList )
+			{
+				if ( arguments.length < 3 )
+					return;
+
+				initPrivateObject.call( this, elementDefinition );
+				var me = this,
+					domId = this._.inputId = CKEDITOR.tools.getNextNumber() + '_textarea',
+					attributes = {};
+
+				if ( elementDefinition.validate )
+					this.validate = elementDefinition.validate;
+
+				// Generates the essential attributes for the textarea tag.
+				attributes.rows = elementDefinition.rows || 5;
+				attributes.cols = elementDefinition.cols || 20;
+
+				/** @ignore */
+				var innerHTML = function()
+				{
+					var html = [ '<div class="cke_dialog_ui_input_textarea"><textarea class="cke_dialog_ui_input_textarea" id="', domId, '" ' ];
+					for ( var i in attributes )
+						html.push( i + '="' + CKEDITOR.tools.htmlEncode( attributes[i] ) + '" ' );
+					html.push( '>', CKEDITOR.tools.htmlEncode( me.getDefault() ), '</textarea></div>' );
+					return html.join( '' );
+				};
+				CKEDITOR.ui.dialog.labeledElement.call( this, dialog, elementDefinition, htmlList, innerHTML );
+			},
+
+			/**
+			 * A single checkbox with a label on the right.
+			 * @constructor
+			 * @extends CKEDITOR.ui.dialog.uiElement
+			 * @example
+			 * @param {CKEDITOR.dialog} dialog
+			 * Parent dialog object.
+			 * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition
+			 * The element definition. Accepted fields:
+			 * <ul>
+			 * 	<li><strong>checked</strong> (Optional) Whether the checkbox is checked
+			 * 	on instantiation. Defaults to false.</li>
+			 * 	<li><strong>validate</strong> (Optional) The validation function.</li>
+			 * 	<li><strong>label</strong> (Optional) The checkbox label.</li>
+			 * </ul>
+			 * @param {Array} htmlList
+			 * List of HTML code to output to.
+			 */
+			checkbox : function( dialog, elementDefinition, htmlList )
+			{
+				if ( arguments.length < 3)
+					return;
+
+				var _ = initPrivateObject.call( this, elementDefinition, { 'default' : [ elementDefinition.checked || false ] }  );
+
+				if ( elementDefinition.validate )
+					this.validate = elementDefinition.validate;
+
+				/** @ignore */
+				var innerHTML = function()
+				{
+					var myDefinition = CKEDITOR.tools.extend( {}, elementDefinition,
+							{
+								id : elementDefinition.id ? elementDefinition.id + '_checkbox' : CKEDITOR.tools.getNextNumber() + '_checkbox'
+							}, true ),
+						html = [],
+						attributes = { 'class' : 'cke_dialog_ui_checkbox_input', type : 'checkbox' };
+					cleanInnerDefinition( myDefinition );
+					if ( elementDefinition.checked )
+						attributes.checked = 'checked';
+					_.checkbox = new CKEDITOR.ui.dialog.uiElement( dialog, myDefinition, html, 'input', null, attributes );
+					html.push( ' ', CKEDITOR.tools.htmlEncode( elementDefinition.label ) );
+					return html.join( '' );
+				};
+
+				CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition, htmlList, 'label', null, null, innerHTML );
+			},
+
+			/**
+			 * A group of radio buttons.
+			 * @constructor
+			 * @example
+			 * @extends CKEDITOR.ui.dialog.labeledElement
+			 * @param {CKEDITOR.dialog} dialog
+			 * Parent dialog object.
+			 * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition
+			 * The element definition. Accepted fields:
+			 * <ul>
+			 * 	<li><strong>default</strong> (Required) The default value.</li>
+			 * 	<li><strong>validate</strong> (Optional) The validation function.</li>
+			 * 	<li><strong>items</strong> (Required) An array of options. Each option
+			 * 	is a 1- or 2-item array of format [ 'Description', 'Value' ]. If 'Value'
+			 * 	is missing, then the value would be assumed to be the same as the
+			 * 	description.</li>
+			 * </ul>
+			 * @param {Array} htmlList
+			 * List of HTML code to output to.
+			 */
+			radio : function( dialog, elementDefinition, htmlList )
+			{
+				if ( arguments.length < 3)
+					return;
+
+				initPrivateObject.call( this, elementDefinition );
+				if ( !this.getDefault() )
+					this._['default'] = [ elementDefinition.items[0][1] ] ;
+				if ( elementDefinition.validate )
+					this.validate = elementDefinition.valdiate;
+				var children = [], me = this;
+
+				/** @ignore */
+				var innerHTML = function()
+				{
+					var inputHtmlList = [], html = [],
+						commonAttributes = { 'class' : 'cke_dialog_ui_radio_item' },
+						commonName = elementDefinition.id ? elementDefinition.id + '_radio' : CKEDITOR.tools.getNextNumber() + '_radio';
+					for ( var i = 0 ; i < elementDefinition.items.length ; i++ )
+					{
+						var item = elementDefinition.items[i],
+							title = item[2] !== undefined ? item[2] : item[0],
+							value = item[1] !== undefined ? item[1] : item[0],
+							inputDefinition = CKEDITOR.tools.extend( {}, elementDefinition,
+									{
+										id : CKEDITOR.tools.getNextNumber() + '_radio_input',
+										title : null,
+										type : null
+									}, true ),
+							labelDefinition = CKEDITOR.tools.extend( {}, inputDefinition,
+									{
+										id : null,
+										title : title
+									}, true ),
+							inputHtml = [],
+							inputAttributes =
+							{
+								type : 'radio',
+								'class' : 'cke_dialog_ui_radio_input',
+								name : commonName,
+								value : value
+							};
+						if ( me.getDefault() == value )
+							inputAttributes.checked = 'checked';
+						cleanInnerDefinition( inputDefinition );
+						cleanInnerDefinition( labelDefinition );
+						children.push( new CKEDITOR.ui.dialog.uiElement( dialog, inputDefinition, inputHtml, 'input', null, inputAttributes ) );
+						new CKEDITOR.ui.dialog.uiElement( dialog, labelDefinition, inputHtmlList, 'label', null, null,
+							   inputHtml.join( '' ) + ' ' + item[0] );
+					}
+					new CKEDITOR.ui.dialog.hbox( dialog, [], inputHtmlList, html );
+					return html.join( '' );
+				};
+
+				CKEDITOR.ui.dialog.labeledElement.call( this, dialog, elementDefinition, htmlList, innerHTML );
+				this._.children = children;
+			},
+
+			/**
+			 * A button with a label inside.
+			 * @constructor
+			 * @example
+			 * @extends CKEDITOR.ui.dialog.uiElement
+			 * @param {CKEDITOR.dialog} dialog
+			 * Parent dialog object.
+			 * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition
+			 * The element definition. Accepted fields:
+			 * <ul>
+			 * 	<li><strong>label</strong> (Required) The button label.</li>
+			 * 	<li><strong>disabled</strong> (Optional) Set to true if you want the
+			 * 	button to appear in disabled state.</li>
+			 * </ul>
+			 * @param {Array} htmlList
+			 * List of HTML code to output to.
+			 */
+			button : function( dialog, elementDefinition, htmlList )
+			{
+				if ( arguments.length < 3)
+					return;
+
+				if ( typeof( elementDefinition ) == 'function' )
+					elementDefinition = elementDefinition( dialog.getParentEditor() );
+				initPrivateObject.call( this, elementDefinition, { disabled : elementDefinition.disabled || false } );
+
+				/** @ignore */
+				var innerHTML = function()
+				{
+					return [ '<tbody><tr><td class="cke_dialog_ui_button_txt">',
+						   CKEDITOR.tools.htmlEncode( elementDefinition.label ),
+						   '</td></tr></tbody>' ].join( '' );
+				};
+
+				// Add OnClick event to this input.
+				CKEDITOR.event.implementOn( this );
+
+				// Register an event handler for processing button clicks.
+				var me = this;
+				dialog.on( 'load', function( eventInfo )
+						{
+							var element = this.getElement();
+							element.on( 'mousedown', function( evt )
+								{
+									// If button is disabled, don't do anything.
+									if ( me._.disabled )
+										return;
+
+									// Change styles to indicate the button is being clicked.
+									me.getElement().addClass( 'active' );
+
+									// Store the currently active button.
+									CKEDITOR.ui.dialog.button._.activeButton = [ me, me.getElement() ];
+								});
+
+							// IE BUG: Padding attributes are ignored for <td> cells.
+							if ( CKEDITOR.env.ie )
+								element.getChild( [0, 0, 0] ).$.innerHTML += '';
+
+							if ( !eventInfo.data.buttonHandlerRegistered )
+							{
+								CKEDITOR.document.on( 'mouseup', function( evt )
+									{
+										var target = evt.data.getTarget(),
+											activeButton = CKEDITOR.ui.dialog.button._.activeButton;
+
+										// If there's no active button, bail out.
+										if ( !activeButton )
+											return;
+
+										// Change styles to remove active status.
+										activeButton[1].removeClass( 'active' );
+
+										// Fire the click event - but only if the
+										// active button is the same as target.
+										if ( activeButton[1].equals( target.getAscendant( 'table' ) ) )
+											activeButton[0].fire( 'click', { dialog : activeButton[0].getDialog() } );
+
+										// Clear active button flag.
+										CKEDITOR.ui.dialog.button._.activeButton = null;
+									});
+
+								eventInfo.data.buttonHandlerRegistered = true;
+							}
+
+							this.getElement().unselectable();
+						}, this );
+
+				var styles = {},
+					align = elementDefinition.align || ( dialog.getParentEditor().lang.dir == 'ltr' ? 'left' : 'right' );
+
+				// IE6 & 7 BUG: Need to set margin as well as align.
+				if ( CKEDITOR.env.ie && CKEDITOR.env.version < 8 )
+				{
+					styles.margin = [
+						'auto',
+						align == 'right' ? '0px' : 'auto',
+						'auto',
+						align == 'left' ? '0px' : 'auto' ].join( ' ' );
+				}
+
+				CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition, htmlList, 'table', styles,
+						{ align : align }, innerHTML );
+			},
+
+			/**
+			 * A select box.
+			 * @extends CKEDITOR.ui.dialog.uiElement
+			 * @example
+			 * @constructor
+			 * @param {CKEDITOR.dialog} dialog
+			 * Parent dialog object.
+			 * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition
+			 * The element definition. Accepted fields:
+			 * <ul>
+			 * 	<li><strong>default</strong> (Required) The default value.</li>
+			 * 	<li><strong>validate</strong> (Optional) The validation function.</li>
+			 * 	<li><strong>items</strong> (Required) An array of options. Each option
+			 * 	is a 1- or 2-item array of format [ 'Description', 'Value' ]. If 'Value'
+			 * 	is missing, then the value would be assumed to be the same as the
+			 * 	description.</li>
+			 * 	<li><strong>multiple</strong> (Optional) Set this to true if you'd like
+			 * 	to have a multiple-choice select box.</li>
+			 * 	<li><strong>size</strong> (Optional) The number of items to display in
+			 * 	the select box.</li>
+			 * </ul>
+			 * @param {Array} htmlList
+			 * List of HTML code to output to.
+			 */
+			select : function( dialog, elementDefinition, htmlList )
+			{
+				if ( arguments.length < 3 )
+					return;
+
+				var _ = initPrivateObject.call( this, elementDefinition );
+
+				if ( elementDefinition.validate )
+					this.validate = elementDefinition.validate;
+
+				/** @ignore */
+				var innerHTML = function()
+				{
+					var myDefinition = CKEDITOR.tools.extend( {}, elementDefinition,
+							{
+								id : elementDefinition.id ? elementDefinition.id + '_select' : CKEDITOR.tools.getNextNumber() + '_select'
+							}, true ),
+						html = [],
+						innerHTML = [],
+						attributes = { 'class' : 'cke_dialog_ui_input_select' };
+
+					// Add multiple and size attributes from element definition.
+					if ( elementDefinition.size != undefined )
+						attributes.size = elementDefinition.size;
+					if ( elementDefinition.multiple != undefined )
+						attributes.multiple = elementDefinition.multiple;
+
+					cleanInnerDefinition( myDefinition );
+					for ( var i = 0, item ; i < elementDefinition.items.length && ( item = elementDefinition.items[i] ) ; i++ )
+					{
+						innerHTML.push( '<option value="',
+							CKEDITOR.tools.htmlEncode( item[1] !== undefined ? item[1] : item[0] ), '" /> ',
+							CKEDITOR.tools.htmlEncode( item[0] ) );
+					}
+
+					_.select = new CKEDITOR.ui.dialog.uiElement( dialog, myDefinition, html, 'select', null, attributes, innerHTML.join( '' ) );
+					return html.join( '' );
+				};
+
+				CKEDITOR.ui.dialog.labeledElement.call( this, dialog, elementDefinition, htmlList, innerHTML );
+			},
+
+			/**
+			 * A file upload input.
+			 * @extends CKEDITOR.ui.dialog.labeledElement
+			 * @example
+			 * @constructor
+			 * @param {CKEDITOR.dialog} dialog
+			 * Parent dialog object.
+			 * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition
+			 * The element definition. Accepted fields:
+			 * <ul>
+			 * 	<li><strong>validate</strong> (Optional) The validation function.</li>
+			 * </ul>
+			 * @param {Array} htmlList
+			 * List of HTML code to output to.
+			 */
+			file : function( dialog, elementDefinition, htmlList )
+			{
+				if ( arguments.length < 3 )
+					return;
+
+				if ( elementDefinition['default'] === undefined )
+					elementDefinition['default'] = '';
+
+				var _ = CKEDITOR.tools.extend( initPrivateObject.call( this, elementDefinition ), { definition : elementDefinition, buttons : [] } );
+
+				if ( elementDefinition.validate )
+					this.validate = elementDefinition.validate;
+
+				/** @ignore */
+				var innerHTML = function()
+				{
+					_.frameId = CKEDITOR.tools.getNextNumber() + '_fileInput';
+					var html = [ '<iframe frameborder="0" allowtransparency="0" class="cke_dialog_ui_input_file" id="',
+						_.frameId, '" src="javascript: void(0)" ></iframe>' ];
+					return html.join( '' );
+				};
+
+				// IE BUG: Parent container does not resize to contain the iframe automatically.
+				dialog.on( 'load', function()
+					{
+						var iframe = CKEDITOR.document.getById( _.frameId ),
+							contentDiv = iframe.getParent();
+						contentDiv.addClass( 'cke_dialog_ui_input_file' );
+					} );
+
+				CKEDITOR.ui.dialog.labeledElement.call( this, dialog, elementDefinition, htmlList, innerHTML );
+			},
+
+			/**
+			 * A button for submitting the file in a file upload input.
+			 * @extends CKEDITOR.ui.dialog.button
+			 * @example
+			 * @constructor
+			 * @param {CKEDITOR.dialog} dialog
+			 * Parent dialog object.
+			 * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition
+			 * The element definition. Accepted fields:
+			 * <ul>
+			 * 	<li><strong>for</strong> (Required) The file input's page and element Id
+			 * 	to associate to, in a 2-item array format: [ 'page_id', 'element_id' ].
+			 * 	</li>
+			 * 	<li><strong>validate</strong> (Optional) The validation function.</li>
+			 * </ul>
+			 * @param {Array} htmlList
+			 * List of HTML code to output to.
+			 */
+			fileButton : function( dialog, elementDefinition, htmlList )
+			{
+				if ( arguments.length < 3 )
+					return;
+
+				var _ = initPrivateObject.call( this, elementDefinition ),
+					me = this;
+
+				if ( elementDefinition.validate )
+					this.validate = elementDefinition.validate;
+
+				var myDefinition = CKEDITOR.tools.extend( {}, elementDefinition );
+				myDefinition.className = ( myDefinition.className ? myDefinition.className + ' ' : '' ) + 'cke_dialog_ui_button';
+				myDefinition.onClick = function( evt )
+				{
+					var target = elementDefinition[ 'for' ];		// [ pageId, elementId ]
+					dialog.getContentElement( target[0], target[1] ).submit();
+					this.disable();
+				};
+
+				dialog.on( 'load', function()
+						{
+							dialog.getContentElement( elementDefinition[ 'for' ][0], elementDefinition[ 'for' ][1] )._.buttons.push( me );
+						} );
+
+				CKEDITOR.ui.dialog.button.call( this, dialog, myDefinition, htmlList );
+			},
+
+			html : (function()
+			{
+				var myHtmlRe = /^\s*<[\w:]+\s+([^>]*)?>/,
+					theirHtmlRe = /^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/,
+					emptyTagRe = /\/$/;
+				/**
+				 * A dialog element made from raw HTML code.
+				 * @extends CKEDITOR.ui.dialog.uiElement
+				 * @name CKEDITOR.ui.dialog.html
+				 * @param {CKEDITOR.dialog} dialog Parent dialog object.
+				 * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition Element definition.
+				 * Accepted fields:
+				 * <ul>
+				 * 	<li><strong>html</strong> (Required) HTML code of this element.</li>
+				 * </ul>
+				 * @param {Array} htmlList List of HTML code to be added to the dialog's content area.
+				 * @example
+				 * @constructor
+				 */
+				return function( dialog, elementDefinition, htmlList )
+				{
+					if ( arguments.length < 3 )
+						return;
+
+					var myHtmlList = [],
+						myHtml,
+						theirHtml = elementDefinition.html,
+						myMatch, theirMatch;
+
+					// If the HTML input doesn't contain any tags at the beginning, add a <span> tag around it.
+					if ( theirHtml.charAt( 0 ) != '<' )
+						theirHtml = '<span>' + theirHtml + '</span>';
+
+					CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition, myHtmlList, 'span', null, null, '' );
+
+					// Append the attributes created by the uiElement call to the real HTML.
+					myHtml = myHtmlList.join( '' );
+					myMatch = myHtml.match( myHtmlRe );
+					theirMatch = theirHtml.match( theirHtmlRe ) || [ '', '', '' ];
+
+					if ( emptyTagRe.test( theirMatch[1] ) )
+					{
+						theirMatch[1] = theirMatch[1].slice( 0, -1 );
+						theirMatch[2] = '/' + theirMatch[2];
+					}
+
+					htmlList.push( [ theirMatch[1], ' ', myMatch[1] || '', theirMatch[2] ].join( '' ) );
+				};
+			})()
+		}, true );
+
+	CKEDITOR.ui.dialog.html.prototype = new CKEDITOR.ui.dialog.uiElement;
+
+	CKEDITOR.ui.dialog.labeledElement.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.uiElement,
+			/** @lends CKEDITOR.ui.dialog.labeledElement.prototype */
+			{
+				/**
+				 * Sets the label text of the element.
+				 * @param {String} label The new label text.
+				 * @returns {CKEDITOR.ui.dialog.labeledElement} The current labeled element.
+				 * @example
+				 */
+				setLabel : function( label )
+				{
+					var node = CKEDITOR.document.getById( this._.labelId );
+					if ( node.getChildCount() < 1 )
+						( new CKEDITOR.dom.text( label, CKEDITOR.document ) ).appendTo( node );
+					else
+						node.getChild( 0 ).$.nodeValue = label;
+					return this;
+				},
+
+				/**
+				 * Retrieves the current label text of the elment.
+				 * @returns {String} The current label text.
+				 * @example
+				 */
+				getLabel : function()
+				{
+					var node = CKEDITOR.document.getById( this._.labelId );
+					if ( !node || node.getChildCount() < 1 )
+						return '';
+					else
+						return node.getChild( 0 ).getText();
+				},
+
+				/**
+				 * Defines the onChange event for UI element definitions.
+				 * @field
+				 * @type Object
+				 * @example
+				 */
+				eventProcessors : commonEventProcessors
+			}, true );
+
+	CKEDITOR.ui.dialog.button.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.uiElement,
+			/** @lends CKEDITOR.ui.dialog.button.prototype */
+			{
+				/**
+				 * Simulates a click to the button.
+				 * @example
+				 * @returns {Object} Return value of the 'click' event.
+				 */
+				click : function()
+				{
+					if ( !this._.disabled )
+						return this.fire( 'click', { dialog : this._.dialog } );
+				},
+
+				/**
+				 * Enables the button.
+				 * @example
+				 */
+				enable : function()
+				{
+					this._.disabled = false;
+					this.getElement().removeClass( 'disabled' );
+				},
+
+				/**
+				 * Disables the button.
+				 * @example
+				 */
+				disable : function()
+				{
+					this._.disabled = true;
+					this.getElement().addClass( 'disabled' );
+				},
+
+				/**
+				 * Defines the onChange event and onClick for button element definitions.
+				 * @field
+				 * @type Object
+				 * @example
+				 */
+				eventProcessors : CKEDITOR.tools.extend( {}, CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,
+					{
+						/** @ignore */
+						onClick : function( dialog, func )
+						{
+							this.on( 'click', func );
+						}
+					}, true ),
+
+				/**
+				 * Handler for the element's access key up event. Simulates a click to
+				 * the button.
+				 * @example
+				 */
+				accessKeyUp : function()
+				{
+					this.getElement().removeClass( 'active' );
+					this.click();
+				},
+
+				/**
+				 * Handler for the element's access key down event. Simulates a mouse
+				 * down to the button.
+				 * @example
+				 */
+				accessKeyDown : function()
+				{
+					this.getElement().addClass( 'active' );
+				}
+			}, true );
+
+	CKEDITOR.ui.dialog.textInput.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.labeledElement,
+			/** @lends CKEDITOR.ui.dialog.textInput.prototype */
+			{
+				/**
+				 * Gets the text input DOM element under this UI object.
+				 * @example
+				 * @returns {CKEDITOR.dom.element} The DOM element of the text input.
+				 */
+				getInputElement : function()
+				{
+					return CKEDITOR.document.getById( this._.inputId );
+				},
+
+				/**
+				 * Puts focus into the text input.
+				 * @example
+				 */
+				focus : function()
+				{
+					var me = this.selectParentTab();
+
+					// GECKO BUG: setTimeout() is needed to workaround invisible selections.
+					setTimeout( function(){ me.getInputElement().$.focus(); }, 0 );
+				},
+
+				/**
+				 * Selects all the text in the text input.
+				 * @example
+				 */
+				select : function()
+				{
+					var me = this.selectParentTab();
+
+					// GECKO BUG: setTimeout() is needed to workaround invisible selections.
+					setTimeout( function(){ var e = me.getInputElement().$; e.focus(); e.select(); }, 0 );
+				},
+
+				/**
+				 * Handler for the text input's access key up event. Makes a select()
+				 * call to the text input.
+				 * @example
+				 */
+				accessKeyUp : function()
+				{
+					this.select();
+				}
+			}, commonPrototype, true );
+
+	CKEDITOR.ui.dialog.textarea.prototype = new CKEDITOR.ui.dialog.textInput();
+
+	CKEDITOR.ui.dialog.select.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.labeledElement,
+			/** @lends CKEDITOR.ui.dialog.select.prototype */
+			{
+				/**
+				 * Gets the DOM element of the select box.
+				 * @returns {CKEDITOR.dom.element} The &lt;select&gt; element of this UI
+				 * element.
+				 * @example
+				 */
+				getInputElement : function()
+				{
+					return this._.select.getElement();
+				},
+
+				/**
+				 * Adds an option to the select box.
+				 * @param {String} label Option label.
+				 * @param {String} value (Optional) Option value, if not defined it'll be
+				 * assumed to be the same as the label.
+				 * @param {Number} index (Optional) Position of the option to be inserted
+				 * to. If not defined the new option will be inserted to the end of list.
+				 * @example
+				 * @returns {CKEDITOR.ui.dialog.select} The current select UI element.
+				 */
+				add : function( label, value, index )
+				{
+					var option = new CKEDITOR.dom.element( 'option', this.getDialog().getParentEditor().document ),
+						selectElement = this.getInputElement().$;
+					option.$.text = label;
+					option.$.value = ( value === undefined || value === null ) ? label : value;
+					if ( index === undefined || index === null )
+					{
+						if ( CKEDITOR.env.ie )
+							selectElement.add( option.$ );
+						else
+							selectElement.add( option.$, null );
+					}
+					else
+						selectElement.add( option.$, index );
+					return this;
+				},
+
+				/**
+				 * Removes an option from the selection list.
+				 * @param {Number} index Index of the option to be removed.
+				 * @example
+				 * @returns {CKEDITOR.ui.dialog.select} The current select UI element.
+				 */
+				remove : function( index )
+				{
+					var selectElement = this.getInputElement().$;
+					selectElement.remove( index );
+					return this;
+				},
+
+				/**
+				 * Clears all options out of the selection list.
+				 * @returns {CKEDITOR.ui.dialog.select} The current select UI element.
+				 */
+				clear : function()
+				{
+					var selectElement = this.getInputElement().$;
+					while ( selectElement.length > 0 )
+						selectElement.remove( 0 );
+					return this;
+				}
+			}, commonPrototype, true );
+
+	CKEDITOR.ui.dialog.checkbox.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.uiElement,
+			/** @lends CKEDITOR.ui.dialog.checkbox.prototype */
+			{
+				/**
+				 * Gets the checkbox DOM element.
+				 * @example
+				 * @returns {CKEDITOR.dom.element} The DOM element of the checkbox.
+				 */
+				getInputElement : function()
+				{
+					return this._.checkbox.getElement();
+				},
+
+				/**
+				 * Sets the state of the checkbox.
+				 * @example
+				 * @param {Boolean} true to tick the checkbox, false to untick it.
+				 */
+				setValue : function( checked )
+				{
+					this.getInputElement().$.checked = checked;
+					this.fire( 'change', { value : checked } );
+				},
+
+				/**
+				 * Gets the state of the checkbox.
+				 * @example
+				 * @returns {Boolean} true means the checkbox is ticked, false means it's not ticked.
+				 */
+				getValue : function()
+				{
+					return this.getInputElement().$.checked;
+				},
+
+				/**
+				 * Handler for the access key up event. Toggles the checkbox.
+				 * @example
+				 */
+				accessKeyUp : function()
+				{
+					this.setValue( !this.getValue() );
+				},
+
+				/**
+				 * Defines the onChange event for UI element definitions.
+				 * @field
+				 * @type Object
+				 * @example
+				 */
+				eventProcessors :
+				{
+					onChange : function( dialog, func )
+					{
+						if ( !CKEDITOR.env.ie )
+							return commonEventProcessors.onChange.apply( this, arguments );
+						else
+						{
+							dialog.on( 'load', function()
+								{
+									var element = this._.checkbox.getElement();
+									element.on( 'propertychange', function( evt )
+										{
+											evt = evt.data.$;
+											if ( evt.propertyName == 'checked' )
+												this.fire( 'change', { value : element.$.checked } );
+										}, this );
+								}, this );
+							this.on( 'change', func );
+						}
+						return null;
+					}
+				}
+			}, commonPrototype, true );
+
+	CKEDITOR.ui.dialog.radio.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.uiElement,
+			/** @lends CKEDITOR.ui.dialog.radio.prototype */
+			{
+				/**
+				 * Checks one of the radio buttons in this button group.
+				 * @example
+				 * @param {String} value The value of the button to be chcked.
+				 */
+				setValue : function( value )
+				{
+					var children = this._.children,
+						item;
+					for ( var i = 0 ; ( i < children.length ) && ( item = children[i] ) ; i++ )
+						item.getElement().$.checked = ( item.getValue() == value );
+					this.fire( 'change', { value : value } );
+				},
+
+				/**
+				 * Gets the value of the currently checked radio button.
+				 * @example
+				 * @returns {String} The currently checked button's value.
+				 */
+				getValue : function()
+				{
+					var children = this._.children;
+					for ( var i = 0 ; i < children.length ; i++ )
+					{
+						if ( children[i].getElement().$.checked )
+							return children[i].getValue();
+					}
+					return null;
+				},
+
+				/**
+				 * Handler for the access key up event. Focuses the currently
+				 * selected radio button, or the first radio button if none is
+				 * selected.
+				 * @example
+				 */
+				accessKeyUp : function()
+				{
+					var children = this._.children, i;
+					for ( i = 0 ; i < children.length ; i++ )
+					{
+						if ( children[i].getElement().$.checked )
+						{
+							children[i].getElement().focus();
+							return;
+						}
+					}
+					children[0].getElement().focus();
+				},
+
+				/**
+				 * Defines the onChange event for UI element definitions.
+				 * @field
+				 * @type Object
+				 * @example
+				 */
+				eventProcessors :
+				{
+					onChange : function( dialog, func )
+					{
+						if ( !CKEDITOR.env.ie )
+							return commonEventProcessors.onChange.apply( this, arguments );
+						else
+						{
+							dialog.on( 'load', function()
+								{
+									var children = this._.children, me = this;
+									for ( var i = 0 ; i < children.length ; i++ )
+									{
+										var element = children[i].getElement();
+										element.on( 'propertychange', function( evt )
+											{
+												evt = evt.data.$;
+												if ( evt.propertyName == 'checked' && this.$.checked )
+													me.fire( 'change', { value : this.getAttribute( 'value' ) } );
+											} );
+									}
+								}, this );
+							this.on( 'change', func );
+						}
+						return null;
+					}
+				}
+			}, commonPrototype, true );
+
+	CKEDITOR.ui.dialog.file.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.labeledElement,
+			commonPrototype,
+			/** @lends CKEDITOR.ui.dialog.file.prototype */
+			{
+				/**
+				 * Gets the &lt;input&gt; element of this file input.
+				 * @returns {CKEDITOR.dom.element} The file input element.
+				 * @example
+				 */
+				getInputElement : function()
+				{
+					return new CKEDITOR.dom.element( CKEDITOR.document.getById( this._.frameId )
+						.$.contentWindow.document.forms[0].elements[0] );
+				},
+
+				/**
+				 * Uploads the file in the file input.
+				 * @returns {CKEDITOR.ui.dialog.file} This object.
+				 * @example
+				 */
+				submit : function()
+				{
+					this.getInputElement().getParent().$.submit();
+					return this;
+				},
+
+				/**
+				 * Redraws the file input and resets the file path in the file input.
+				 * The redraw logic is necessary because non-IE browsers tend to clear
+				 * the &lt;iframe&gt; containing the file input after closing the dialog.
+				 * @example
+				 */
+				reset : function()
+				{
+					var frameElement = CKEDITOR.document.getById( this._.frameId ),
+						frameDocument = frameElement.$.contentWindow.document,
+						elementDefinition = this._.definition,
+						buttons = this._.buttons;
+					frameDocument.open();
+					frameDocument.write( [ '<html><head><title></title></head><body style="margin: 0; overflow: hidden; background: transparent;">',
+							'<form enctype="multipart/form-data" method="POST" action="',
+							CKEDITOR.tools.htmlEncode( elementDefinition.action ),
+							'">',
+							'<input type="file" name="',
+							CKEDITOR.tools.htmlEncode( elementDefinition.id || 'cke_upload' ),
+							'" size="',
+							CKEDITOR.tools.htmlEncode( elementDefinition.size || '' ),
+							'" />',
+							'</form>',
+							'</body></html>' ].join( '' ) );
+					frameDocument.close();
+
+					for ( var i = 0 ; i < buttons.length ; i++ )
+						buttons[i].enable();
+				},
+
+				/**
+				 * Defines the onChange event for UI element definitions.
+				 * @field
+				 * @type Object
+				 * @example
+				 */
+				eventProcessors : commonEventProcessors
+			}, true );
+
+	CKEDITOR.ui.dialog.fileButton.prototype = new CKEDITOR.ui.dialog.button;
+
+	CKEDITOR.ui.dialog.button._ = { activeButton : null };
+
+	CKEDITOR.dialog.addUIElement( 'text', textBuilder );
+	CKEDITOR.dialog.addUIElement( 'password', textBuilder );
+	CKEDITOR.dialog.addUIElement( 'textarea', commonBuilder );
+	CKEDITOR.dialog.addUIElement( 'checkbox', commonBuilder );
+	CKEDITOR.dialog.addUIElement( 'radio', commonBuilder );
+	CKEDITOR.dialog.addUIElement( 'button', commonBuilder );
+	CKEDITOR.dialog.addUIElement( 'select', commonBuilder );
+	CKEDITOR.dialog.addUIElement( 'file', commonBuilder );
+	CKEDITOR.dialog.addUIElement( 'fileButton', commonBuilder );
+	CKEDITOR.dialog.addUIElement( 'html', commonBuilder );
+})();
Index: /CKEditor/tags/3.0 Beta/_source/plugins/editingblock/plugin.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/plugins/editingblock/plugin.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/plugins/editingblock/plugin.js	(revision 3046)
@@ -0,0 +1,170 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview The default editing block plugin, which holds the editing area
+ *		and source view.
+ */
+
+(function()
+{
+	var getMode = function( editor, mode )
+	{
+		return editor._.modes && editor._.modes[ mode || editor.mode ];
+	};
+
+	// This is a semaphore used to avoid recursive calls between
+	// the following data handling functions.
+	var isHandlingData;
+
+	CKEDITOR.plugins.add( 'editingblock',
+	{
+		init : function( editor, pluginPath )
+		{
+			if ( !editor.config.editingBlock )
+				return;
+
+			editor.on( 'themeSpace', function( event )
+				{
+					if ( event.data.space == 'contents' )
+						event.data.html += '<br>';
+				});
+
+			editor.on( 'themeLoaded', function()
+				{
+					editor.fireOnce( 'editingBlockReady' );
+				});
+
+			editor.on( 'uiReady', function()
+				{
+					editor.setMode( editor.config.startupMode );
+
+					if ( editor.config.startupFocus )
+						editor.focus();
+				});
+
+			editor.on( 'afterSetData', function()
+				{
+					if ( !isHandlingData && editor.mode )
+					{
+						isHandlingData = true;
+						getMode( editor ).loadData( editor.getData() );
+						isHandlingData = false;
+					}
+				});
+
+			editor.on( 'beforeGetData', function()
+				{
+					if ( !isHandlingData && editor.mode )
+					{
+						isHandlingData = true;
+						editor.setData( getMode( editor ).getData() );
+						isHandlingData = false;
+					}
+				});
+
+			editor.on( 'getSnapshot', function( event )
+				{
+					if ( editor.mode )
+						event.data = getMode( editor ).getSnapshotData();
+				});
+		}
+	});
+
+	/**
+	 * The current editing mode. An editing mode is basically a viewport for
+	 * editing or content viewing. By default the possible values for this
+	 * property are "wysiwyg" and "source".
+	 * @type String
+	 * @example
+	 * alert( CKEDITOR.instances.editor1.mode );  // "wysiwyg" (e.g.)
+	 */
+	CKEDITOR.editor.prototype.mode = '';
+
+	/**
+	 * Registers an editing mode. This function is to be used mainly by plugins.
+	 * @param {String} mode The mode name.
+	 * @param {Object} modeEditor The mode editor definition.
+	 * @example
+	 */
+	CKEDITOR.editor.prototype.addMode = function( mode, modeEditor )
+	{
+		modeEditor.name = mode;
+		( this._.modes || ( this._.modes = {} ) )[ mode ] = modeEditor;
+	};
+
+	/**
+	 * Sets the current editing mode in this editor instance.
+	 * @param {String} mode A registered mode name.
+	 * @example
+	 * // Switch to "source" view.
+	 * CKEDITOR.instances.editor1.setMode( 'source' );
+	 */
+	CKEDITOR.editor.prototype.setMode = function( mode )
+	{
+		var data,
+			holderElement = this.getThemeSpace( 'contents' ),
+			isDirty = this.checkDirty();
+
+		// Unload the previous mode.
+		if ( this.mode )
+		{
+			if ( mode == this.mode )
+				return;
+
+			var currentMode = getMode( this );
+			data = currentMode.getData();
+			currentMode.unload( holderElement );
+			this.mode = '';
+		}
+
+		holderElement.setHtml( '' );
+
+		// Load required mode.
+		var modeEditor = getMode( this, mode );
+		if ( !modeEditor )
+			throw '[CKEDITOR.editor.setMode] Unknown mode "' + mode + '".';
+
+		if ( !isDirty )
+		{
+			this.on( 'mode', function()
+				{
+					this.resetDirty();
+					this.removeListener( 'mode', arguments.callee );
+				});
+		}
+
+		modeEditor.load( holderElement, data || this.getData() );
+	};
+
+	/**
+	 * Moves the selection focus to the editing are space in the editor.
+	 */
+	CKEDITOR.editor.prototype.focus = function()
+	{
+		var mode = getMode( this );
+		if ( mode )
+			mode.focus();
+	};
+})();
+
+/**
+ * The mode to load at the editor startup. It depends on the plugins
+ * loaded. By default, the "wysiwyg" and "source" modes are available.
+ * @type String
+ * @default 'wysiwyg'
+ * @example
+ * config.toolbarLocation = 'source';
+ */
+CKEDITOR.config.startupMode = 'wysiwyg';
+
+/**
+ * Sets whether the editor should have the focus when the page loads.
+ * @type Boolean
+ * @default false
+ */
+CKEDITOR.config.startupFocus = false;
+
+CKEDITOR.config.editingBlock = true;
Index: /CKEditor/tags/3.0 Beta/_source/plugins/elementspath/plugin.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/plugins/elementspath/plugin.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/plugins/elementspath/plugin.js	(revision 3046)
@@ -0,0 +1,177 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview The "elementspath" plugin. It shows all elements in the DOM
+ *		parent tree relative to the current selection in the editing area.
+ */
+
+(function()
+{
+	var commands =
+	{
+		toolbarFocus :
+		{
+			exec : function( editor )
+			{
+				var idBase = editor._.elementsPath.idBase;
+				var element = CKEDITOR.document.getById( idBase + '0' );
+
+				if ( element )
+					element.focus();
+			}
+		}
+	};
+
+	CKEDITOR.plugins.add( 'elementspath',
+	{
+		requires : [ 'selection' ],
+
+		init : function( editor, pluginPath )
+		{
+			var spaceId = 'cke_path_' + editor.name;
+			var spaceElement;
+			var getSpaceElement = function()
+			{
+				if ( !spaceElement )
+					spaceElement = CKEDITOR.document.getById( spaceId );
+				return spaceElement;
+			};
+
+			var idBase = 'cke_elementspath_' + CKEDITOR.tools.getNextNumber() + '_';
+
+			editor._.elementsPath = { idBase : idBase };
+
+			editor.on( 'themeSpace', function( event )
+				{
+					if ( event.data.space == 'bottom' )
+						event.data.html += '<div id="' + spaceId + '" class="cke_path"><br></div>';
+				});
+
+			editor.on( 'selectionChange', function( ev )
+				{
+					var env = CKEDITOR.env;
+
+					var selection = ev.data.selection;
+
+					var element = selection.getStartElement(),
+						html = [],
+						elementsList = this._.elementsPath.list = [];
+
+					while ( element )
+					{
+						var index = elementsList.push( element ) - 1;
+						var name;
+						if ( element.getAttribute( '_cke_real_element_type' ) )
+							name = element.getAttribute( '_cke_real_element_type' );
+						else
+							name = element.getName();
+
+						// Use this variable to add conditional stuff to the
+						// HTML (because we are doing it in reverse order... unshift).
+						var extra = '';
+
+						// Some browsers don't cancel key events in the keydown but in the
+						// keypress.
+						// TODO: Check if really needed for Gecko+Mac.
+						if ( env.opera || ( env.gecko && env.mac ) )
+							extra += ' onkeypress="return false;"';
+
+						// With Firefox, we need to force the button to redraw, otherwise it
+						// will remain in the focus state.
+						if ( env.gecko )
+							extra += ' onblur="this.style.cssText = this.style.cssText;"';
+
+						html.unshift(
+							'<a' +
+								' id="', idBase, index, '"' +
+								' href="javascript:void(\'', name, '\')"' +
+								' tabindex="-1"' +
+								' title="', editor.lang.elementsPath.eleTitle.replace( /%1/, name ), '"' +
+								' onkeydown="return CKEDITOR._.elementsPath.keydown(\'', this.name, '\',', index, ', event);"' +
+								extra ,
+								' onclick="return CKEDITOR._.elementsPath.click(\'', this.name, '\',', index, ');">',
+									name,
+							'</a>' );
+
+						if ( name == 'body' )
+							break;
+
+						element = element.getParent();
+					}
+
+					getSpaceElement().setHtml( html.join('') );
+				});
+
+			editor.on( 'contentDomUnload', function()
+				{
+					getSpaceElement().setHtml( '<br>' );
+				});
+
+			editor.addCommand( 'elementsPathFocus', commands.toolbarFocus );
+		}
+	});
+})();
+
+/**
+ * Handles the click on an element in the element path.
+ * @private
+ */
+CKEDITOR._.elementsPath =
+{
+	click : function( instanceName, elementIndex )
+	{
+		var editor = CKEDITOR.instances[ instanceName ];
+		editor.focus();
+
+		var element = editor._.elementsPath.list[ elementIndex ];
+		editor.getSelection().selectElement( element );
+
+		return false;
+	},
+
+	keydown : function( instanceName, elementIndex, ev )
+	{
+		var instance = CKEDITOR.ui.button._.instances[ elementIndex ];
+		var editor = CKEDITOR.instances[ instanceName ];
+		var idBase = editor._.elementsPath.idBase;
+
+		var element;
+
+		ev = new CKEDITOR.dom.event( ev );
+
+		switch ( ev.getKeystroke() )
+		{
+			case 37 :					// LEFT-ARROW
+			case 9 :					// TAB
+				element = CKEDITOR.document.getById( idBase + ( elementIndex + 1 ) );
+				if ( !element )
+					element = CKEDITOR.document.getById( idBase + '0' );
+				element.focus();
+				return false;
+
+			case 39 :					// RIGHT-ARROW
+			case CKEDITOR.SHIFT + 9 :	// SHIFT + TAB
+				element = CKEDITOR.document.getById( idBase + ( elementIndex - 1 ) );
+				if ( !element )
+					element = CKEDITOR.document.getById( idBase + ( editor._.elementsPath.list.length - 1 ) );
+				element.focus();
+				return false;
+
+			case 27 :					// ESC
+				editor.focus();
+				return false;
+
+			case 13 :					// ENTER	// Opera
+			case 32 :					// SPACE
+				this.click( instanceName, elementIndex );
+				return false;
+
+			//default :
+			//	alert( ev.getKeystroke() );
+		}
+		return true;
+	}
+};
Index: /CKEditor/tags/3.0 Beta/_source/plugins/horizontalrule/plugin.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/plugins/horizontalrule/plugin.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/plugins/horizontalrule/plugin.js	(revision 3046)
@@ -0,0 +1,35 @@
+/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @file Horizontal Rule plugin.
+ */
+
+(function()
+{
+	var horizontalruleCmd =
+	{
+		exec : function( editor )
+		{
+			editor.insertElement( editor.document.createElement( 'hr' ) );
+		}
+	};
+
+	var pluginName = 'horizontalrule';
+
+	// Register a plugin named "horizontalrule".
+	CKEDITOR.plugins.add( pluginName,
+	{
+		init : function( editor, pluginPath )
+		{
+			editor.addCommand( pluginName, horizontalruleCmd );
+			editor.ui.addButton( 'HorizontalRule',
+				{
+					label : editor.lang.horizontalrule,
+					command : pluginName
+				});
+		}
+	});
+})();
Index: /CKEditor/tags/3.0 Beta/_source/plugins/htmldataprocessor/plugin.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/plugins/htmldataprocessor/plugin.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/plugins/htmldataprocessor/plugin.js	(revision 3046)
@@ -0,0 +1,40 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+CKEDITOR.plugins.add( 'htmldataprocessor',
+{
+	requires : [ 'htmlwriter' ],
+
+	init : function( editor, pluginPath )
+	{
+		editor.dataProcessor = new CKEDITOR.htmlDataProcessor();
+	}
+});
+
+CKEDITOR.htmlDataProcessor = function()
+{
+	this.writer = new CKEDITOR.htmlWriter();
+};
+
+CKEDITOR.htmlDataProcessor.prototype =
+{
+	toHtml : function( data )
+	{
+		// The source data is already HTML, so just return it as is.
+		return data;
+	},
+
+	toDataFormat : function( element )
+	{
+		var writer = this.writer,
+			fragment = CKEDITOR.htmlParser.fragment.fromHtml( element.getHtml() );
+
+		writer.reset();
+
+		fragment.writeHtml( writer );
+
+		return writer.getHtml( true );
+	}
+};
Index: /CKEditor/tags/3.0 Beta/_source/plugins/htmlwriter/plugin.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/plugins/htmlwriter/plugin.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/plugins/htmlwriter/plugin.js	(revision 3046)
@@ -0,0 +1,302 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * Class used to write HTML data.
+ * @constructor
+ * @example
+ * var writer = new CKEDITOR.htmlWriter();
+ * writer.openTag( 'p' );
+ * writer.attribute( 'class', 'MyClass' );
+ * writer.openTagClose( 'p' );
+ * writer.text( 'Hello' );
+ * writer.closeTag( 'p' );
+ * alert( writer.getHtml() );  "&lt;p class="MyClass"&gt;Hello&lt;/p&gt;"
+ */
+CKEDITOR.htmlWriter = function()
+{
+	/**
+	 * The characters to be used for each identation step.
+	 * @type String
+	 * @default "\t" (tab)
+	 * @example
+	 * // Use two spaces for indentation.
+	 * editorInstance.dataProcessor.writer.indentationChars = '  ';
+	 */
+	this.indentationChars	= '\t';
+
+	/**
+	 * The characters to be used to close "self-closing" elements, like "br" or
+	 * "img".
+	 * @type String
+	 * @default " /&gt;"
+	 * @example
+	 * // Use HTML4 notation for self-closing elements.
+	 * editorInstance.dataProcessor.writer.selfClosingEnd = '>';
+	 */
+	this.selfClosingEnd		= ' />';
+
+	/**
+	 * The characters to be used for line breaks.
+	 * @type String
+	 * @default "\n" (LF)
+	 * @example
+	 * // Use CRLF for line breaks.
+	 * editorInstance.dataProcessor.writer.lineBreakChars = '\r\n';
+	 */
+	this.lineBreakChars		= '\n';
+
+	this._ =
+	{
+		output : [],
+		indent : false,
+		indentation : '',
+		rules : {}
+	};
+
+	var dtd = CKEDITOR.dtd;
+
+	for ( var e in CKEDITOR.tools.extend( {}, dtd.$block, dtd.$listItem, dtd.$tableContent ) )
+	{
+		this.setRules( e,
+			{
+				indent : true,
+				breakBeforeOpen : true,
+				breakAfterOpen : true,
+				breakBeforeClose : !dtd[ e ][ '#' ],
+				breakAfterClose : true
+			});
+	}
+
+	this.setRules( 'br',
+		{
+			breakAfterOpen : true
+		});
+};
+
+CKEDITOR.htmlWriter.prototype =
+{
+	/**
+	 * Writes the tag opening part for a opener tag.
+	 * @param {String} tagName The element name for this tag.
+	 * @param {Object} attributes The attributes defined for this tag. The
+	 *		attributes could be used to inspect the tag.
+	 * @example
+	 * // Writes "&lt;p".
+	 * writer.openTag( 'p', { class : 'MyClass', id : 'MyId' } );
+	 */
+	openTag : function( tagName, attributes )
+	{
+		var rules = this._.rules[ tagName ];
+
+		if ( this._.indent )
+			this.indentation();
+		// Do not break if indenting.
+		else if ( rules && rules.breakBeforeOpen )
+		{
+			this.lineBreak();
+			this.indentation();
+		}
+
+		this._.output.push( '<', tagName );
+	},
+
+	/**
+	 * Writes the tag closing part for a opener tag.
+	 * @param {String} tagName The element name for this tag.
+	 * @param {Boolean} isSelfClose Indicates that this is a self-closing tag,
+	 *		like "br" or "img".
+	 * @example
+	 * // Writes "&gt;".
+	 * writer.openTagClose( 'p', false );
+	 * @example
+	 * // Writes " /&gt;".
+	 * writer.openTagClose( 'br', true );
+	 */
+	openTagClose : function( tagName, isSelfClose )
+	{
+		var rules = this._.rules[ tagName ];
+
+		if ( isSelfClose )
+			this._.output.push( this.selfClosingEnd );
+		else
+		{
+			this._.output.push( '>' );
+
+			if ( rules && rules.indent )
+				this._.indentation += this.indentationChars;
+		}
+
+		if ( rules && rules.breakAfterOpen )
+			this.lineBreak();
+	},
+
+	/**
+	 * Writes an attribute. This function should be called after opening the
+	 * tag with {@link #openTagClose}.
+	 * @param {String} attName The attribute name.
+	 * @param {String} attValue The attribute value.
+	 * @example
+	 * // Writes ' class="MyClass"'.
+	 * writer.attribute( 'class', 'MyClass' );
+	 */
+	attribute : function( attName, attValue )
+	{
+		this._.output.push( ' ', attName, '="', attValue, '"' );
+	},
+
+	/**
+	 * Writes a closer tag.
+	 * @param {String} tagName The element name for this tag.
+	 * @example
+	 * // Writes "&lt;/p&gt;".
+	 * writer.closeTag( 'p' );
+	 */
+	closeTag : function( tagName )
+	{
+		var rules = this._.rules[ tagName ];
+
+		if ( rules && rules.indent )
+			this._.indentation = this._.indentation.substr( this.indentationChars.length );
+
+		if ( this._.indent )
+			this.indentation();
+		// Do not break if indenting.
+		else if ( rules && rules.breakBeforeClose )
+		{
+			this.lineBreak();
+			this.indentation();
+		}
+
+		this._.output.push( '</', tagName, '>' );
+
+		if ( rules && rules.breakAfterClose )
+			this.lineBreak();
+	},
+
+	/**
+	 * Writes text.
+	 * @param {String} text The text value
+	 * @example
+	 * // Writes "Hello Word".
+	 * writer.text( 'Hello Word' );
+	 */
+	text : function( text )
+	{
+		if ( this._.indent )
+		{
+			this.indentation();
+			text = CKEDITOR.tools.ltrim( text );
+		}
+
+		this._.output.push( text );
+	},
+
+	/**
+	 * Writes a comment.
+	 * @param {String} comment The comment text.
+	 * @example
+	 * // Writes "&lt;!-- My comment --&gt;".
+	 * writer.comment( ' My comment ' );
+	 */
+	comment : function( comment )
+	{
+		if ( this._.indent )
+			this.indentation();
+
+		this._.output.push( '<!--', comment, '-->' );
+	},
+
+	/**
+	 * Writes a line break. It uses the {@link #lineBreakChars} property for it.
+	 * @example
+	 * // Writes "\n" (e.g.).
+	 * writer.lineBreak();
+	 */
+	lineBreak : function()
+	{
+		if ( this._.output.length > 0 )
+			this._.output.push( this.lineBreakChars );
+		this._.indent = true;
+	},
+
+	/**
+	 * Writes the current indentation chars. It uses the
+	 * {@link #indentationChars} property, repeating it for the current
+	 * intentation steps.
+	 * @example
+	 * // Writes "\t" (e.g.).
+	 * writer.indentation();
+	 */
+	indentation : function()
+	{
+		this._.output.push( this._.indentation );
+		this._.indent = false;
+	},
+
+	/**
+	 * Empties the current output buffer.
+	 * @example
+	 * writer.reset();
+	 */
+	reset : function()
+	{
+		this._.output = [];
+	},
+
+	/**
+	 * Empties the current output buffer.
+	 * @param {Boolean} reset Indicates that the {@link reset} function is to
+	 *		be automatically called after retrieving the HTML.
+	 * @returns {String} The HTML written to the writer so far.
+	 * @example
+	 * var html = writer.getHtml();
+	 */
+	getHtml : function( reset )
+	{
+		var html = this._.output.join( '' );
+
+		if ( reset )
+			this.reset();
+
+		return html;
+	},
+
+	/**
+	 * Sets formatting rules for a give element. The possible rules are:
+	 * <ul>
+	 *	<li><b>indent</b>: indent the element contents.</li>
+	 *	<li><b>breakBeforeOpen</b>: break line before the opener tag for this element.</li>
+	 *	<li><b>breakAfterOpen</b>: break line after the opener tag for this element.</li>
+	 *	<li><b>breakBeforeClose</b>: break line before the closer tag for this element.</li>
+	 *	<li><b>breakAfterClose</b>: break line after the closer tag for this element.</li>
+	 * </ul>
+	 *
+	 * All rules default to "false".
+	 *
+	 * By default, all elements available in the {@link CKEDITOR.dtd.$block),
+	 * {@link CKEDITOR.dtd.$listItem} and {@link CKEDITOR.dtd.$tableContent}
+	 * lists have all the above rules set to "true". Additionaly, the "br"
+	 * element has the "breakAfterOpen" set to "true".
+	 * @param {String} tagName The element name to which set the rules.
+	 * @param {Object} rules An object containing the element rules.
+	 * @example
+	 * // Break line before and after "img" tags.
+	 * writer.setRules( 'img',
+	 *     {
+	 *         breakBeforeOpen : true
+	 *         breakAfterOpen : true
+	 *     });
+	 * @example
+	 * // Reset the rules for the "h1" tag.
+	 * writer.setRules( 'h1', {} );
+	 */
+	setRules : function( tagName, rules )
+	{
+		this._.rules[ tagName ] = rules;
+	}
+};
+
+CKEDITOR.plugins.add( 'htmlwriter' );
Index: /CKEditor/tags/3.0 Beta/_source/plugins/keystrokes/plugin.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/plugins/keystrokes/plugin.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/plugins/keystrokes/plugin.js	(revision 3046)
@@ -0,0 +1,158 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+// Register a plugin named "sample".
+CKEDITOR.plugins.add( 'keystrokes',
+{
+	beforeInit : function( editor )
+	{
+		/**
+		 * Controls keystrokes typing in this editor instance.
+		 * @name CKEDITOR.editor.prototype.keystrokeHandler
+		 * @type CKEDITOR.keystrokeHandler
+		 * @example
+		 */
+		editor.keystrokeHandler = new CKEDITOR.keystrokeHandler( editor );
+	},
+
+	init : function( editor )
+	{
+		var keystrokesConfig	= editor.config.keystrokes,
+			blockedConfig		= editor.config.blockedKeystrokes;
+
+		var keystrokes			= editor.keystrokeHandler.keystrokes,
+			blockedKeystrokes	= editor.keystrokeHandler.blockedKeystrokes;
+
+		for ( var i = 0 ; i < keystrokesConfig.length ; i++ )
+		{
+			keystrokes[ keystrokesConfig[i][0] ] = keystrokesConfig[i][1];
+		}
+
+		for ( i = 0 ; i < blockedConfig.length ; i++ )
+		{
+			blockedKeystrokes[ blockedConfig[i] ] = 1;
+		}
+	}
+});
+
+/**
+ * Controls keystrokes typing in an editor instance.
+ * @constructor
+ * @param {CKEDITOR.editor} editor The editor instance.
+ * @example
+ */
+CKEDITOR.keystrokeHandler = function( editor )
+{
+	if ( editor.keystrokeHandler )
+		return editor.keystrokeHandler;
+
+	/**
+	 * List of keystrokes associated to commands. Each entry points to the
+	 * command to be executed.
+	 * @type Object
+	 * @example
+	 */
+	this.keystrokes = {};
+
+	/**
+	 * List of keystrokes that should be blocked if not defined at
+	 * {@link keystrokes}. In this way it is possible to block the default
+	 * browser behavior for those keystrokes.
+	 * @type Object
+	 * @example
+	 */
+	this.blockedKeystrokes = {};
+
+	this._ =
+	{
+		editor : editor
+	};
+
+	return this;
+};
+
+(function()
+{
+	var onKeyDown = function( event )
+	{
+		// The DOM event object is passed by the "data" property.
+		event = event.data;
+
+		var keyCombination = event.getKeystroke();
+		var command = this.keystrokes[ keyCombination ];
+
+		var cancel = !this._.editor.fire( 'key', { keyCode : keyCombination } );
+
+		if ( !cancel )
+		{
+			if ( command )
+				cancel = ( this._.editor.execCommand( command ) !== false );
+
+			if ( !cancel )
+				cancel = !!this.blockedKeystrokes[ keyCombination ];
+		}
+
+		if ( cancel )
+			event.preventDefault( true );
+
+		return !cancel;
+	};
+
+	CKEDITOR.keystrokeHandler.prototype =
+	{
+		/**
+		 * Attaches this keystroke handle to a DOM object. Keystrokes typed
+		 ** over this object will get handled by this keystrokeHandler.
+		 * @param {CKEDITOR.dom.domObject} domObject The DOM object to attach
+		 *		to.
+		 * @example
+		 */
+		attach : function( domObject )
+		{
+			domObject.on( 'keydown', onKeyDown, this );
+		}
+	};
+})();
+
+/**
+ * A list of keystrokes to be blocked if not defined in the {@link #keystrokes}
+ * setting. In this way it is possible to block the default browser behavior
+ * for those keystrokes.
+ * @type Array
+ * @example
+ */
+CKEDITOR.config.blockedKeystrokes =
+[
+	CKEDITOR.CTRL + 66 /*B*/,
+	CKEDITOR.CTRL + 73 /*I*/,
+	CKEDITOR.CTRL + 85 /*U*/
+];
+
+/**
+ * A list associating keystrokes to editor commands. Each element in the list
+ * is an array where the first item is the keystroke, and the second is the
+ * command to be executed.
+ * @type Array
+ * @example
+ */
+CKEDITOR.config.keystrokes =
+[
+	[ CKEDITOR.ALT + 121 /*F10*/, 'toolbarFocus' ],
+	[ CKEDITOR.ALT + 122 /*F11*/, 'elementsPathFocus' ],
+
+	[ CKEDITOR.CTRL + 86 /*V*/, 'paste' ],
+	[ CKEDITOR.SHIFT + 45 /*INS*/, 'paste' ],
+	[ CKEDITOR.CTRL + 88 /*X*/, 'cut' ],
+	[ CKEDITOR.SHIFT + 46 /*DEL*/, 'cut' ],
+	[ CKEDITOR.CTRL + 90 /*Z*/, 'undo' ],
+	[ CKEDITOR.CTRL + 89 /*Y*/, 'redo' ],
+	[ CKEDITOR.CTRL + CKEDITOR.SHIFT + 90 /*Z*/, 'redo' ],
+	[ CKEDITOR.CTRL + 76 /*L*/, 'link' ],
+	[ CKEDITOR.CTRL + 66 /*B*/, 'bold' ],
+	[ CKEDITOR.CTRL + 73 /*I*/, 'italic' ],
+	[ CKEDITOR.CTRL + 85 /*U*/, 'underline' ],
+	[ CKEDITOR.CTRL + CKEDITOR.ALT + 13 /*ENTER*/, 'fitWindow' ],
+	[ CKEDITOR.SHIFT + 32 /*SPACE*/, 'nbsp' ]
+];
Index: /CKEditor/tags/3.0 Beta/_source/plugins/newpage/plugin.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/plugins/newpage/plugin.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/plugins/newpage/plugin.js	(revision 3046)
@@ -0,0 +1,31 @@
+/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @file Horizontal Page Break
+ */
+
+// Register a plugin named "newpage".
+CKEDITOR.plugins.add( 'newpage',
+{
+	init : function( editor, pluginPath )
+	{
+		editor.addCommand( 'newpage',
+			{
+				exec : function( editor )
+				{
+					editor.setData( editor.config.newpage_html );
+				}
+			});
+
+		editor.ui.addButton( 'NewPage',
+			{
+				label : editor.lang.newpage,
+				command : 'newpage'
+			});
+	}
+});
+
+CKEDITOR.config.newpage_html = '';
Index: /CKEditor/tags/3.0 Beta/_source/plugins/removeformat/plugin.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/plugins/removeformat/plugin.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/plugins/removeformat/plugin.js	(revision 3046)
@@ -0,0 +1,119 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+CKEDITOR.plugins.add( 'removeformat',
+{
+	requires : [ 'selection' ],
+
+	init : function( editor, pluginPath )
+	{
+		editor.addCommand( 'removeFormat', CKEDITOR.plugins.removeformat.commands.removeformat );
+		editor.ui.addButton( 'RemoveFormat',
+			{
+				label : editor.lang.removeFormat,
+				command : 'removeFormat'
+			});
+	}
+});
+
+CKEDITOR.plugins.removeformat =
+{
+	commands :
+	{
+		removeformat :
+		{
+			exec : function( editor )
+			{
+				var tagsRegex = editor._.removeFormatRegex ||
+					( editor._.removeFormatRegex = new RegExp( '^(?:' + editor.config.removeFormatTags.replace( /,/g,'|' ) + ')$', 'i' ) );
+
+				var removeAttributes = editor._.removeAttributes ||
+					( editor._.removeAttributes = editor.config.removeFormatAttributes.split( ',' ) );
+
+				var ranges = editor.getSelection().getRanges();
+
+				for ( var i = 0, range ; range = ranges[ i ] ; i++ )
+				{
+					if ( range.collapsed )
+						continue;
+
+					range.enlarge( CKEDITOR.ENLARGE_ELEMENT );
+
+					// Bookmark the range so we can re-select it after processing.
+					var bookmark = range.createBookmark();
+
+					// The style will be applied within the bookmark boundaries.
+					var startNode	= bookmark.startNode;
+					var endNode		= bookmark.endNode;
+
+					// We need to check the selection boundaries (bookmark spans) to break
+					// the code in a way that we can properly remove partially selected nodes.
+					// For example, removing a <b> style from
+					//		<b>This is [some text</b> to show <b>the] problem</b>
+					// ... where [ and ] represent the selection, must result:
+					//		<b>This is </b>[some text to show the]<b> problem</b>
+					// The strategy is simple, we just break the partial nodes before the
+					// removal logic, having something that could be represented this way:
+					//		<b>This is </b>[<b>some text</b> to show <b>the</b>]<b> problem</b>
+
+					var breakParent = function( node )
+					{
+						// Let's start checking the start boundary.
+						var path = new CKEDITOR.dom.elementPath( node );
+						var pathElements = path.elements;
+
+						for ( var i = 1, pathElement ; pathElement = pathElements[ i ] ; i++ )
+						{
+							if ( pathElement.equals( path.block ) || pathElement.equals( path.blockLimit ) )
+								break;
+
+							// If this element can be removed (even partially).
+							if ( tagsRegex.test( pathElement.getName() ) )
+								node.breakParent( pathElement );
+						}
+					};
+
+					breakParent( startNode );
+					breakParent( endNode );
+
+					// Navigate through all nodes between the bookmarks.
+					var currentNode = startNode.getNextSourceNode( true, CKEDITOR.NODE_ELEMENT );
+
+					while ( currentNode )
+					{
+						// If we have reached the end of the selection, stop looping.
+						if ( currentNode.equals( endNode ) )
+							break;
+
+						// Cache the next node to be processed. Do it now, because
+						// currentNode may be removed.
+						var nextNode = currentNode.getNextSourceNode( false, CKEDITOR.NODE_ELEMENT );
+
+						// This node must not be a fake element.
+						if ( currentNode.getName() != 'img' || !currentNode.getAttribute( '_cke_protected_html' ) )
+						{
+							// Remove elements nodes that match with this style rules.
+							if ( tagsRegex.test( currentNode.getName() ) )
+								currentNode.remove( true );
+							else
+								currentNode.removeAttributes( removeAttributes );
+						}
+
+						currentNode = nextNode;
+					}
+
+					range.moveToBookmark( bookmark );
+				}
+
+				editor.getSelection().selectRanges( ranges );
+			}
+		}
+	}
+};
+
+// Only inline elements are valid.
+CKEDITOR.config.removeFormatTags = 'b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var';
+
+CKEDITOR.config.removeFormatAttributes = 'class,style,lang,width,height,align,hspace,valign';
Index: /CKEditor/tags/3.0 Beta/_source/plugins/selection/plugin.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/plugins/selection/plugin.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/plugins/selection/plugin.js	(revision 3046)
@@ -0,0 +1,769 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+(function()
+{
+	// #### checkSelectionChange : START
+
+	// The selection change check basically saves the element parent tree of
+	// the current node and check it on successive requests. If there is any
+	// change on the tree, then the selectionChange event gets fired.
+	var checkSelectionChange = function()
+	{
+		// In IE, the "selectionchange" event may still get thrown when
+		// releasing the WYSIWYG mode, so we need to check it first.
+		var sel = this.getSelection();
+		if ( !sel )
+			return;
+
+		var firstElement = sel.getStartElement();
+		var currentPath = new CKEDITOR.dom.elementPath( firstElement );
+
+		if ( !currentPath.compare( this._.selectionPreviousPath ) )
+		{
+			this._.selectionPreviousPath = currentPath;
+			this.fire( 'selectionChange', { selection : sel, path : currentPath, element : firstElement } );
+		}
+	};
+
+	var checkSelectionChangeTimer;
+	var checkSelectionChangeTimeoutPending;
+	var checkSelectionChangeTimeout = function()
+	{
+		// Firing the "OnSelectionChange" event on every key press started to
+		// be too slow. This function guarantees that there will be at least
+		// 200ms delay between selection checks.
+
+		checkSelectionChangeTimeoutPending = true;
+
+		if ( checkSelectionChangeTimer )
+			return;
+
+		checkSelectionChangeTimeoutExec.call( this );
+
+		checkSelectionChangeTimer = CKEDITOR.tools.setTimeout( checkSelectionChangeTimeoutExec, 200, this );
+	};
+
+	var checkSelectionChangeTimeoutExec = function()
+	{
+		checkSelectionChangeTimer = null;
+
+		if ( checkSelectionChangeTimeoutPending )
+		{
+			// Call this with a timeout so the browser properly moves the
+			// selection after the mouseup. It happened that the selection was
+			// being moved after the mouseup when clicking inside selected text
+			// with Firefox.
+			CKEDITOR.tools.setTimeout( checkSelectionChange, 0, this );
+
+			checkSelectionChangeTimeoutPending = false;
+		}
+	};
+
+	// #### checkSelectionChange : END
+
+	var selectAllCmd =
+	{
+		exec : function( editor )
+		{
+			switch ( editor.mode )
+			{
+				case 'wysiwyg' :
+					editor.document.$.execCommand( 'SelectAll', false, null );
+					break;
+				case 'source' :
+					// TODO
+			}
+		}
+	};
+
+	CKEDITOR.plugins.add( 'selection',
+	{
+		init : function( editor, pluginPath )
+		{
+			editor.on( 'contentDom', function()
+				{
+					if ( CKEDITOR.env.ie )
+					{
+						// IE is the only to provide the "selectionchange"
+						// event.
+						editor.document.on( 'selectionchange', checkSelectionChangeTimeout, editor );
+					}
+					else
+					{
+						// In other browsers, we make the selection change
+						// check based on other events, like clicks or keys
+						// press.
+
+						editor.document.on( 'mouseup', checkSelectionChangeTimeout, editor );
+						editor.document.on( 'keyup', checkSelectionChangeTimeout, editor );
+					}
+				});
+
+			editor.addCommand( 'selectAll', selectAllCmd );
+			editor.ui.addButton( 'SelectAll',
+				{
+					label : editor.lang.selectAll,
+					command : 'selectAll'
+				});
+		}
+	});
+})();
+
+/**
+ * Gets the current selection from the editing area when in WYSIWYG mode.
+ * @returns {CKEDITOR.dom.selection} A selection object or null if not on
+ *		WYSIWYG mode or no selection is available.
+ * @example
+ * var selection = CKEDITOR.instances.editor1.<b>getSelection()</b>;
+ * alert( selection.getType() );
+ */
+CKEDITOR.editor.prototype.getSelection = function()
+{
+	var retval = this.document ? this.document.getSelection() : null;
+
+	/**
+	 * IE BUG: The selection's document may be a different document than the
+	 * editor document. Return null if that's the case.
+	 */
+	if ( retval && CKEDITOR.env.ie )
+	{
+		var range = retval.getNative().createRange();
+		if ( !range )
+			return null;
+		else if ( range.item )
+			return range.item(0).ownerDocument == this.document.$ ? retval : null;
+		else
+			return range.parentElement().ownerDocument == this.document.$ ? retval : null;
+	}
+	return retval;
+};
+
+/**
+ * Gets the current selection from the document.
+ * @returns {CKEDITOR.dom.selection} A selection object.
+ * @example
+ * var selection = CKEDITOR.instances.editor1.document.<b>getSelection()</b>;
+ * alert( selection.getType() );
+ */
+CKEDITOR.dom.document.prototype.getSelection = function()
+{
+	return new CKEDITOR.dom.selection( this );
+};
+
+/**
+ * No selection.
+ * @constant
+ * @example
+ * if ( editor.getSelection().getType() == CKEDITOR.SELECTION_NONE )
+ *     alert( 'Nothing is selected' );
+ */
+CKEDITOR.SELECTION_NONE		= 1;
+
+/**
+ * Text or collapsed selection.
+ * @constant
+ * @example
+ * if ( editor.getSelection().getType() == CKEDITOR.SELECTION_TEXT )
+ *     alert( 'Text is selected' );
+ */
+CKEDITOR.SELECTION_TEXT		= 2;
+
+/**
+ * Element selection.
+ * @constant
+ * @example
+ * if ( editor.getSelection().getType() == CKEDITOR.SELECTION_ELEMENT )
+ *     alert( 'An element is selected' );
+ */
+CKEDITOR.SELECTION_ELEMENT	= 3;
+
+/**
+ * Manipulates the selection in a DOM document.
+ * @constructor
+ * @example
+ */
+CKEDITOR.dom.selection = function( document )
+{
+	this.document = document;
+	this._ =
+	{
+		cache : {}
+	};
+};
+
+(function()
+{
+	var styleObjectElements = { img:1,hr:1,li:1,table:1,tr:1,td:1,embed:1,object:1,ol:1,ul:1 };
+
+	CKEDITOR.dom.selection.prototype =
+	{
+		/**
+		 * Gets the native selection object from the browser.
+		 * @function
+		 * @returns {Object} The native selection object.
+		 * @example
+		 * var selection = editor.getSelection().<b>getNative()</b>;
+		 */
+		getNative :
+			CKEDITOR.env.ie ?
+				function()
+				{
+					return this._.cache.nativeSel || ( this._.cache.nativeSel = this.document.$.selection );
+				}
+			:
+				function()
+				{
+					return this._.cache.nativeSel || ( this._.cache.nativeSel = this.document.getWindow().$.getSelection() );
+				},
+
+		/**
+		 * Gets the type of the current selection. The following values are
+		 * available:
+		 * <ul>
+		 *		<li>{@link CKEDITOR.SELECTION_NONE} (1): No selection.</li>
+		 *		<li>{@link CKEDITOR.SELECTION_TEXT} (2): Text is selected or
+		 *			collapsed selection.</li>
+		 *		<li>{@link CKEDITOR.SELECTION_ELEMENT} (3): A element
+		 *			selection.</li>
+		 * </ul>
+		 * @function
+		 * @returns {Number} One of the following constant values:
+		 *		{@link CKEDITOR.SELECTION_NONE}, {@link CKEDITOR.SELECTION_TEXT} or
+		 *		{@link CKEDITOR.SELECTION_ELEMENT}.
+		 * @example
+		 * if ( editor.getSelection().<b>getType()</b> == CKEDITOR.SELECTION_TEXT )
+		 *     alert( 'Text is selected' );
+		 */
+		getType :
+			CKEDITOR.env.ie ?
+				function()
+				{
+					if ( this._.cache.type )
+						return this._.cache.type;
+
+					var type = CKEDITOR.SELECTION_NONE;
+
+					try
+					{
+						var sel = this.getNative(),
+							ieType = sel.type;
+
+						if ( ieType == 'Text' )
+							type = CKEDITOR.SELECTION_TEXT;
+
+						if ( ieType == 'Control' )
+							type = CKEDITOR.SELECTION_ELEMENT;
+
+						// It is possible that we can still get a text range
+						// object even when type == 'None' is returned by IE.
+						// So we'd better check the object returned by
+						// createRange() rather than by looking at the type.
+						if ( sel.createRange().parentElement )
+							type = CKEDITOR.SELECTION_TEXT;
+					}
+					catch(e) {}
+
+					return ( this._.cache.type = type );
+				}
+			:
+				function()
+				{
+					if ( this._.cache.type )
+						return this._.cache.type;
+
+					var type = CKEDITOR.SELECTION_TEXT;
+
+					var sel = this.getNative();
+
+					if ( !sel )
+						type = CKEDITOR.SELECTION_NONE;
+					else if ( sel.rangeCount == 1 )
+					{
+						// Check if the actual selection is a control (IMG,
+						// TABLE, HR, etc...).
+
+						var range = sel.getRangeAt(0),
+							startContainer = range.startContainer;
+
+						if ( startContainer == range.endContainer
+							&& startContainer.nodeType == 1
+							&& ( range.endOffset - range.startOffset ) == 1
+							&& styleObjectElements[ startContainer.childNodes[ range.startOffset ].nodeName.toLowerCase() ] )
+						{
+							type = CKEDITOR.SELECTION_ELEMENT;
+						}
+					}
+
+					return ( this._.cache.type = type );
+				},
+
+		getRanges :
+			CKEDITOR.env.ie ?
+				( function()
+				{
+					// Finds the container and offset for a specific boundary
+					// of an IE range.
+					var getBoundaryInformation = function( range, start )
+					{
+						// Creates a collapsed range at the requested boundary.
+						range = range.duplicate();
+						range.collapse( start );
+
+						// Gets the element that encloses the range entirely.
+						var parent = range.parentElement();
+						var siblings = parent.childNodes;
+
+						var testRange;
+
+						for ( var i = 0 ; i < siblings.length ; i++ )
+						{
+							var child = siblings[ i ];
+							if ( child.nodeType == 1 )
+							{
+								testRange = range.duplicate();
+
+								testRange.moveToElementText( child );
+								testRange.collapse();
+
+								var comparison = testRange.compareEndPoints( 'StartToStart', range );
+
+								if ( comparison > 0 )
+									break;
+								else if ( comparison === 0 )
+									return {
+										container : parent,
+										offset : i
+									};
+
+								testRange = null;
+							}
+						}
+
+						if ( !testRange )
+						{
+							testRange = range.duplicate();
+							testRange.moveToElementText( parent );
+							testRange.collapse( false );
+						}
+
+						testRange.setEndPoint( 'StartToStart', range );
+						var distance = testRange.text.length;
+
+						while ( distance > 0 )
+							distance -= siblings[ --i ].nodeValue.length;
+
+						if ( distance === 0 )
+						{
+							return {
+								container : parent,
+								offset : i
+							};
+						}
+						else
+						{
+							return {
+								container : siblings[ i ],
+								offset : -distance
+							};
+						}
+					};
+
+					return function()
+					{
+						if ( this._.cache.ranges )
+							return this._.cache.ranges;
+
+						// IE doesn't have range support (in the W3C way), so we
+						// need to do some magic to transform selections into
+						// CKEDITOR.dom.range instances.
+
+						var sel = this.getNative(),
+							nativeRange = sel.createRange(),
+							type = this.getType(),
+							range;
+
+						if ( type == CKEDITOR.SELECTION_TEXT )
+						{
+							range = new CKEDITOR.dom.range( this.document );
+
+							var boundaryInfo = getBoundaryInformation( nativeRange, true );
+							range.setStart( new CKEDITOR.dom.node( boundaryInfo.container ), boundaryInfo.offset );
+
+							boundaryInfo = getBoundaryInformation( nativeRange );
+							range.setEnd( new CKEDITOR.dom.node( boundaryInfo.container ), boundaryInfo.offset );
+
+							return ( this._.cache.ranges = [ range ] );
+						}
+						else if ( type == CKEDITOR.SELECTION_ELEMENT )
+						{
+							var retval = this._.cache.ranges = [];
+
+							for ( var i = 0 ; i < nativeRange.length ; i++ )
+							{
+								var element = nativeRange.item( i ),
+									parentElement = element.parentNode,
+									j = 0;
+
+								range = new CKEDITOR.dom.range( this.document );
+
+								for (; j < parentElement.childNodes.length && parentElement.childNodes[j] != element ; j++ )
+								{ /*jsl:pass*/ }
+
+								range.setStart( new CKEDITOR.dom.node( parentElement ), j );
+								range.setEnd( new CKEDITOR.dom.node( parentElement ), j + 1 );
+								retval.push( range );
+							}
+
+							return retval;
+						}
+
+						return ( this._.cache.ranges = [] );
+					};
+				})()
+			:
+				function()
+				{
+					if ( this._.cache.ranges )
+						return this._.cache.ranges;
+
+					// On browsers implementing the W3C range, we simply
+					// tranform the native ranges in CKEDITOR.dom.range
+					// instances.
+
+					var ranges = [];
+					var sel = this.getNative();
+
+					for ( var i = 0 ; i < sel.rangeCount ; i++ )
+					{
+						var nativeRange = sel.getRangeAt( i );
+						var range = new CKEDITOR.dom.range( this.document );
+
+						range.setStart( new CKEDITOR.dom.node( nativeRange.startContainer ), nativeRange.startOffset );
+						range.setEnd( new CKEDITOR.dom.node( nativeRange.endContainer ), nativeRange.endOffset );
+						ranges.push( range );
+					}
+
+					return ( this._.cache.ranges = ranges );
+				},
+
+		/**
+		 * Gets the DOM element in which the selection starts.
+		 * @returns {CKEDITOR.dom.element} The element at the beginning of the
+		 *		selection.
+		 * @example
+		 * var element = editor.getSelection().<b>getStartElement()</b>;
+		 * alert( element.getName() );
+		 */
+		getStartElement : function()
+		{
+			var node,
+				sel = this.getNative();
+
+			switch ( this.getType() )
+			{
+				case CKEDITOR.SELECTION_ELEMENT :
+					return this.getSelectedElement();
+
+				case CKEDITOR.SELECTION_TEXT :
+
+					var range = this.getRanges()[0];
+
+					if ( range )
+					{
+						if ( !range.collapsed )
+						{
+							range.optimize();
+
+							node = range.startContainer;
+
+							if ( node.type != CKEDITOR.NODE_ELEMENT )
+								return node.getParent();
+
+							node = node.getChild( range.startOffset );
+
+							if ( !node || node.type != CKEDITOR.NODE_ELEMENT )
+								return range.startContainer;
+
+							var child = node.getFirst();
+							while (  child && child.type == CKEDITOR.NODE_ELEMENT )
+							{
+								node = child;
+								child = child.getFirst();
+							}
+
+							return node;
+						}
+					}
+
+					if ( CKEDITOR.env.ie )
+					{
+						range = sel.createRange();
+						range.collapse( true );
+
+						node = range.parentElement();
+					}
+					else
+					{
+						node = sel.anchorNode;
+
+						if ( node.nodeType != 1 )
+							node = node.parentNode;
+					}
+			}
+
+			return ( node ? new CKEDITOR.dom.element( node ) : null );
+		},
+
+		/**
+		 * Gets the current selected element.
+		 * @returns {CKEDITOR.dom.element} The selected element. Null if no
+		 *		selection is available or the selection type is not
+		 *		{@link CKEDITOR.SELECTION_ELEMENT}.
+		 * @example
+		 * var element = editor.getSelection().<b>getSelectedElement()</b>;
+		 * alert( element.getName() );
+		 */
+		getSelectedElement : function()
+		{
+			var node;
+
+			if ( this.getType() == CKEDITOR.SELECTION_ELEMENT )
+			{
+				var sel = this.getNative();
+
+				if ( CKEDITOR.env.ie )
+				{
+					try
+					{
+						node = sel.createRange().item(0);
+					}
+					catch(e) {}
+				}
+				else
+				{
+					var range = sel.getRangeAt( 0 );
+					node = range.startContainer.childNodes[ range.startOffset ];
+				}
+			}
+
+			return ( node ? new CKEDITOR.dom.element( node ) : null );
+		},
+
+		reset : function()
+		{
+			this._.cache = {};
+		},
+
+		selectElement :
+			CKEDITOR.env.ie ?
+				function( element )
+				{
+					this.getNative().empty();
+
+					var range;
+					try
+					{
+						// Try to select the node as a control.
+						range = this.document.$.body.createControlRange();
+						range.addElement( element.$ );
+					}
+					catch(e)
+					{
+						// If failed, select it as a text range.
+						range = this.document.$.body.createTextRange();
+						range.moveToElementText( element.$ );
+					}
+
+					range.select();
+				}
+			:
+				function( element )
+				{
+					// Create the range for the element.
+					var range = this.document.$.createRange();
+					range.selectNode( element.$ );
+
+					// Select the range.
+					var sel = this.getNative();
+					sel.removeAllRanges();
+					sel.addRange( range );
+				},
+
+		selectRanges :
+			CKEDITOR.env.ie ?
+				function( ranges )
+				{
+					// IE doesn't accept multiple ranges selection, so we just
+					// select the first one.
+					if ( ranges[ 0 ] )
+						ranges[ 0 ].select();
+				}
+			:
+				function( ranges )
+				{
+					var sel = this.getNative();
+					sel.removeAllRanges();
+
+					for ( var i = 0 ; i < ranges.length ; i++ )
+					{
+						var range = ranges[ i ];
+						var nativeRange = this.document.$.createRange();
+						nativeRange.setStart( range.startContainer.$, range.startOffset );
+						nativeRange.setEnd( range.endContainer.$, range.endOffset );
+
+						// Select the range.
+						sel.addRange( nativeRange );
+					}
+				},
+
+		createBookmarks : function()
+		{
+			var retval = [],
+				ranges = this.getRanges();
+			for ( var i = 0 ; i < ranges.length ; i++ )
+				retval.push( ranges[i].createBookmark() );
+			return retval;
+		},
+
+		selectBookmarks : function( bookmarks )
+		{
+			var ranges = [];
+			for ( var i = 0 ; i < bookmarks.length ; i++ )
+			{
+				var range = new CKEDITOR.dom.range( this.document );
+				range.moveToBookmark( bookmarks[i] );
+				ranges.push( range );
+			}
+			this.selectRanges( ranges );
+			return this;
+		}
+	};
+})();
+
+CKEDITOR.dom.range.prototype.select =
+	CKEDITOR.env.ie ?
+		// V2
+		function()
+		{
+			var collapsed = this.collapsed;
+			var isStartMakerAlone;
+			var dummySpan;
+
+			var bookmark = this.createBookmark();
+
+			// Create marker tags for the start and end boundaries.
+			var startNode = bookmark.startNode;
+
+			var endNode;
+			if ( !collapsed )
+				endNode = bookmark.endNode;
+
+			// Create the main range which will be used for the selection.
+			var ieRange = this.document.$.body.createTextRange();
+
+			// Position the range at the start boundary.
+			ieRange.moveToElementText( startNode.$ );
+			ieRange.moveStart( 'character', 1 );
+
+			if ( endNode )
+			{
+				// Create a tool range for the end.
+				var ieRangeEnd = this.document.$.body.createTextRange();
+
+				// Position the tool range at the end.
+				ieRangeEnd.moveToElementText( endNode.$ );
+
+				// Move the end boundary of the main range to match the tool range.
+				ieRange.setEndPoint( 'EndToEnd', ieRangeEnd );
+				ieRange.moveEnd( 'character', -1 );
+			}
+			else
+			{
+				isStartMakerAlone = ( !startNode.hasPrevious() || ( startNode.getPrevious().is && startNode.getPrevious().is( 'br' ) ) )
+					&& !startNode.hasNext();
+
+				// Append a temporary <span>&#65279;</span> before the selection.
+				// This is needed to avoid IE destroying selections inside empty
+				// inline elements, like <b></b> (#253).
+				// It is also needed when placing the selection right after an inline
+				// element to avoid the selection moving inside of it.
+				dummySpan = this.document.createElement( 'span' );
+				dummySpan.setHtml( '&#65279;' );	// Zero Width No-Break Space (U+FEFF). See #1359.
+				dummySpan.insertBefore( startNode );
+
+				if ( isStartMakerAlone )
+				{
+					// To expand empty blocks or line spaces after <br>, we need
+					// instead to have any char, which will be later deleted using the
+					// selection.
+					// \ufeff = Zero Width No-Break Space (U+FEFF). See #1359.
+					this.document.createText( '\ufeff' ).insertBefore( startNode );
+				}
+			}
+
+			// Remove the markers (reset the position, because of the changes in the DOM tree).
+			this.setStartBefore( startNode );
+			startNode.remove();
+
+			if ( collapsed )
+			{
+				if ( isStartMakerAlone )
+				{
+					// Move the selection start to include the temporary &#65279;.
+					//ieRange.moveStart( 'character', -1 );
+
+					ieRange.select();
+
+					// Remove our temporary stuff.
+//					this.document.$.selection.clear();
+				}
+				else
+					ieRange.select();
+
+				dummySpan.remove();
+			}
+			else
+			{
+				this.setEndBefore( endNode );
+				endNode.remove();
+				ieRange.select();
+			}
+		}
+	:
+		function()
+		{
+			var startContainer = this.startContainer;
+
+			// If we have a collapsed range, inside an empty element, we must add
+			// something to it, otherwise the caret will not be visible.
+			if ( this.collapsed && startContainer.type == CKEDITOR.NODE_ELEMENT && !startContainer.getChildCount() )
+				startContainer.append( new CKEDITOR.dom.text( '' ) );
+
+			var nativeRange = this.document.$.createRange();
+			nativeRange.setStart( startContainer.$, this.startOffset );
+
+			try
+			{
+				nativeRange.setEnd( this.endContainer.$, this.endOffset );
+			}
+			catch ( e )
+			{
+				// There is a bug in Firefox implementation (it would be too easy
+				// otherwise). The new start can't be after the end (W3C says it can).
+				// So, let's create a new range and collapse it to the desired point.
+				if ( e.toString().indexOf( 'NS_ERROR_ILLEGAL_VALUE' ) >= 0 )
+				{
+					this.collapse( true );
+					nativeRange.setEnd( this.endContainer.$, this.endOffset );
+				}
+				else
+					throw( e );
+			}
+
+			var selection = this.document.getSelection().getNative();
+			selection.removeAllRanges();
+			selection.addRange( nativeRange );
+		};
Index: /CKEditor/tags/3.0 Beta/_source/plugins/smiley/dialogs/smiley.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/plugins/smiley/dialogs/smiley.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/plugins/smiley/dialogs/smiley.js	(revision 3046)
@@ -0,0 +1,97 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+CKEDITOR.dialog.add( 'smiley', function( editor )
+{
+	var config = editor.config,
+		images = config.smiley_images,
+		columns = config.smiley_columns,
+		i;
+
+	// Build the HTML for the smiley images table.
+	var html = [ '<table cellspacing="2" cellpadding="2"><tbody>' ];
+
+	for ( i = 0 ; i < images.length ; i++ )
+	{
+		if ( i % columns === 0 )
+			html.push( '<tr>' );
+
+		html.push(
+			'<td class="dark_background hand centered" style="vertical-align: middle;">' +
+				'<img border="0" class="hand" title="', config.smiley_descriptions[i], '"' +
+					' src="', CKEDITOR.tools.htmlEncode( config.smiley_path + images[ i ] ), '"',
+					// IE BUG: Below is a workaround to an IE image loading bug to ensure the image sizes are correct.
+					( CKEDITOR.env.ie ? ' onload="this.setAttribute(\'width\', 2); this.removeAttribute(\'width\');" ' : '' ),
+				'>' +
+			'</td>' );
+
+		if ( i % columns == columns - 1 )
+			html.push( '</tr>' );
+	}
+
+	if ( i < columns - 1 )
+	{
+		for ( ; i < columns - 1 ; i++ )
+			html.push( '<td></td>' );
+		html.push( '</tr>' );
+	}
+
+	html.push( '</tbody></table>' );
+
+	var smileySelector =
+	{
+		type : 'html',
+		html : html.join( '' ),
+		onClick : function( evt )
+		{
+			var target = evt.data.getTarget(),
+				targetName = target.getName();
+
+			if ( targetName == 'td' )
+				target = target.getChild(0);
+			else if ( targetName != 'img' )
+				return;
+
+			this.getDialog().restoreSelection();
+
+			var src = target.getAttribute( 'src' ),
+				title = target.getAttribute( 'title' );
+
+			var img = editor.document.createElement( 'img',
+				{
+					attributes :
+					{
+						src : src,
+						_cke_saved_src : src,
+						title : title,
+						alt : title
+					}
+				});
+
+			editor.insertElement( img );
+
+			this.getDialog().hide();
+		},
+		style : 'width: 100%; height: 100%; border-collapse: separate;'
+	};
+
+	return {
+		title : editor.lang.smiley.title,
+		minWidth : 320,
+		minHeight : 210,
+		contents : [
+			{
+				id : 'tab1',
+				label : '',
+				title : '',
+				expand : true,
+				elements : [
+						smileySelector
+					]
+			}
+		],
+		buttons : [ CKEDITOR.dialog.cancelButton ]
+	};
+} );
Index: /CKEditor/tags/3.0 Beta/_source/plugins/smiley/plugin.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/plugins/smiley/plugin.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/plugins/smiley/plugin.js	(revision 3046)
@@ -0,0 +1,31 @@
+/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+CKEDITOR.plugins.add( 'smiley',
+{
+	requires : [ 'dialog' ],
+
+	init : function( editor, pluginPath )
+	{
+		editor.addCommand( 'smiley', new CKEDITOR.dialogCommand( 'smiley' ) );
+		editor.ui.addButton( 'Smiley',
+			{
+				label : editor.lang.smiley.toolbar,
+				command : 'smiley'
+			});
+		CKEDITOR.dialog.add( 'smiley', this.path + 'dialogs/smiley.js' );
+	}
+} );
+
+CKEDITOR.config.smiley_path = CKEDITOR.basePath +  '_source/plugins/smiley/images/';
+
+CKEDITOR.config.smiley_images = [ 'regular_smile.gif','sad_smile.gif','wink_smile.gif','teeth_smile.gif','confused_smile.gif','tounge_smile.gif',
+	'embaressed_smile.gif','omg_smile.gif','whatchutalkingabout_smile.gif','angry_smile.gif','angel_smile.gif','shades_smile.gif',
+	'devil_smile.gif','cry_smile.gif','lightbulb.gif','thumbs_down.gif','thumbs_up.gif','heart.gif',
+	'broken_heart.gif','kiss.gif','envelope.gif'];
+
+CKEDITOR.config.smiley_descriptions = [ ':)', ':(', ';)', ':D', ':/', ':P', '', '', '', '', '', '', '', ';(', '', '', '', '', ':kiss', '' ];
+
+CKEDITOR.config.smiley_columns = 8;
Index: /CKEditor/tags/3.0 Beta/_source/plugins/sourcearea/plugin.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/plugins/sourcearea/plugin.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/plugins/sourcearea/plugin.js	(revision 3046)
@@ -0,0 +1,140 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview The "sourcearea" plugin. It registers the "source" editing
+ *		mode, which displays the raw data being edited in the editor.
+ */
+
+CKEDITOR.plugins.add( 'sourcearea',
+{
+	requires : [ 'editingblock' ],
+
+	init : function( editor, pluginPath )
+	{
+		var sourcearea = CKEDITOR.plugins.sourcearea;
+
+		editor.on( 'editingBlockReady', function()
+			{
+				var textarea;
+
+				editor.addMode( 'source',
+					{
+						load : function( holderElement, data )
+						{
+							// Create the source area <textarea>.
+							textarea = new CKEDITOR.dom.element( 'textarea' );
+							textarea.setAttribute( 'dir', 'ltr' );
+							textarea.addClass( 'cke_source' );
+							textarea.setStyles({
+								width	: '100%',
+								height	: '100%',
+								resize	: 'none',
+								outline	: 'none',
+								'text-align' : 'left' });
+
+							// The textarea height/width='100%' doesn't
+							// constraint to the 'td' in IE strick mode
+							if ( CKEDITOR.env.ie )
+							{
+								textarea.setStyles({
+									height : holderElement.$.clientHeight + 'px',
+									width : holderElement.$.clientWidth + 'px' });
+							}
+
+							// By some yet unknown reason, we must stop the
+							// mousedown propagation for the textarea,
+							// otherwise it's not possible to place the caret
+							// inside of it (non IE).
+							if ( !CKEDITOR.env.ie )
+							{
+								textarea.on( 'mousedown', function( evt )
+									{
+										evt = evt.data.$;
+										if ( evt.stopPropagation )
+											evt.stopPropagation();
+									} );
+							}
+
+							// Reset the holder element and append the
+							// <textarea> to it.
+							holderElement.setHtml( '' );
+							holderElement.append( textarea );
+
+							// The editor data "may be dirty" after this point.
+							editor.mayBeDirty = true;
+
+							// Set the <textarea> value.
+							this.loadData( data );
+
+							editor.mode = 'source';
+							editor.fire( 'mode' );
+						},
+
+						loadData : function( data )
+						{
+							textarea.setValue( data );
+						},
+
+						getData : function()
+						{
+							return textarea.getValue();
+						},
+
+						getSnapshotData : function()
+						{
+							return textarea.getValue();
+						},
+
+						unload : function( holderElement )
+						{
+							textarea = null;
+						},
+
+						focus : function()
+						{
+							textarea.focus();
+						}
+					});
+			});
+
+		editor.addCommand( 'source', sourcearea.commands.source );
+
+		if ( editor.ui.addButton )
+		{
+			editor.ui.addButton( 'Source',
+				{
+					label : editor.lang.source,
+					command : 'source'
+				});
+		}
+
+		editor.on( 'mode', function()
+			{
+				var command = editor.getCommand( 'source' );
+				command.state = ( editor.mode == 'source' ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF );
+				command.fire( 'state' );
+			});
+	}
+});
+
+/**
+ * Holds the definition of commands an UI elements included with the sourcearea
+ * plugin.
+ * @example
+ */
+CKEDITOR.plugins.sourcearea =
+{
+	commands :
+	{
+		source :
+		{
+			exec : function( editor )
+			{
+				editor.setMode( editor.mode == 'source' ? 'wysiwyg' : 'source' );
+			}
+		}
+	}
+};
Index: /CKEditor/tags/3.0 Beta/_source/plugins/specialchar/dialogs/specialchar.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/plugins/specialchar/dialogs/specialchar.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/plugins/specialchar/dialogs/specialchar.js	(revision 3046)
@@ -0,0 +1,183 @@
+/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+CKEDITOR.dialog.add( 'specialchar', function( editor )
+{
+	return {
+		title : editor.lang.specialChar.title,
+		minWidth : 450,
+		minHeight : 350,
+		buttons : [ CKEDITOR.dialog.cancelButton ],
+		charColumns : 17,
+		chars :
+			[
+				'!','&quot;','#','$','%','&amp;',"'",'(',')','*','+','-','.','/',
+				'0','1','2','3','4','5','6','7','8','9',':',';',
+				'&lt;','=','&gt;','?','@',
+				'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O',
+				'P','Q','R','S','T','U','V','W','X','Y','Z',
+				'[',']','^','_','`',
+				'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p',
+				'q','r','s','t','u','v','w','x','y','z',
+				'{','|','}','~','&euro;','&lsquo;','&rsquo;','&rsquo;','&ldquo;',
+				'&rdquo;','&ndash;','&mdash;','&iexcl;','&cent;','&pound;',
+				'&curren;','&yen;','&brvbar;','&sect;','&uml;','&copy;','&ordf;',
+				'&laquo;','&not;','&reg;','&macr;','&deg;','&plusmn;','&sup2;',
+				'&sup3;','&acute;','&micro;','&para;','&middot;','&cedil;',
+				'&sup1;','&ordm;','&raquo;','&frac14;','&frac12;','&frac34;',
+				'&iquest;','&Agrave;','&Aacute;','&Acirc;','&Atilde;','&Auml;',
+				'&Aring;','&AElig;','&Ccedil;','&Egrave;','&Eacute;','&Ecirc;',
+				'&Euml;','&Igrave;','&Iacute;','&Icirc;','&Iuml;','&ETH;',
+				'&Ntilde;','&Ograve;','&Oacute;','&Ocirc;','&Otilde;','&Ouml;',
+				'&times;','&Oslash;','&Ugrave;','&Uacute;','&Ucirc;','&Uuml;',
+				'&Yacute;','&THORN;','&szlig;','&agrave;','&aacute;','&acirc;',
+				'&atilde;','&auml;','&aring;','&aelig;','&ccedil;','&egrave;',
+				'&eacute;','&ecirc;','&euml;','&igrave;','&iacute;','&icirc;',
+				'&iuml;','&eth;','&ntilde;','&ograve;','&oacute;','&ocirc;',
+				'&otilde;','&ouml;','&divide;','&oslash;','&ugrave;','&uacute;',
+				'&ucirc;','&uuml;','&uuml;','&yacute;','&thorn;','&yuml;',
+				'&OElig;','&oelig;','&#372;','&#374','&#373','&#375;','&sbquo;',
+				'&#8219;','&bdquo;','&hellip;','&trade;','&#9658;','&bull;',
+				'&rarr;','&rArr;','&hArr;','&diams;','&asymp;'
+			],
+		onLoad :  function()
+		{
+			var columns = this.definition.charColumns,
+				chars = this.definition.chars;
+
+			var html = [ '<table style="width: 320px; height: 100%; border-collapse: separate;" align="center" cellspacing="2" cellpadding="2" border="0">' ];
+
+			var i = 0 ;
+			while ( i < chars.length )
+			{
+				html.push( '<tr>' ) ;
+
+				for( var j = 0 ; j < columns ; j++, i++ )
+				{
+					if ( chars[ i ] )
+					{
+						html.push(
+							'<td width="1%"' +
+							' title="', chars[i].replace( /&/g, '&amp;' ), '"' +
+							' value="', chars[i].replace( /&/g, "&amp;" ), '"' +
+							' class="DarkBackground Hand">');
+						html.push( chars[i] );
+					}
+					else
+						html.push( '<td class="DarkBackground">&nbsp;' );
+
+					html.push( '</td>' );
+				}
+				html.push( '</tr>' );
+			}
+
+			html.push( '</tbody></table>' );
+
+			this.getContentElement( 'info', 'charContainer' ).getElement().setHtml( html.join( '' ) );
+		},
+		contents : [
+			{
+				id : 'info',
+				label : editor.lang.common.generalTab,
+				title : editor.lang.common.generalTab,
+				elements : [
+					{
+						type : 'hbox',
+						align : 'top',
+						widths : [ '300px', '90px' ],
+						children :
+						[
+							{
+								type : 'hbox',
+								align : 'top',
+								padding : 0,
+								widths : [ '350px' ],
+								children :
+								[
+									{
+										type : 'html',
+										id : 'charContainer',
+										html : '',
+										onMouseover : function( evt )
+										{
+											var target = evt.data.getTarget(),
+												targetName = target.getName(),
+												value;
+
+											if ( targetName == 'td' && ( value = target.getAttribute( 'value' ) ) )
+											{
+												var dialog = this.getDialog(),
+													preview = dialog.getContentElement( 'info', 'charPreview' ).getElement(),
+													htmlPreview = dialog.getContentElement( 'info', 'htmlPreview' ).getElement();
+
+												preview.setHtml( value );
+												htmlPreview.setHtml( CKEDITOR.tools.htmlEncode( value ) );
+												target.addClass( "LightBackground" );
+											}
+										},
+										onMouseout : function( evt )
+										{
+											var dialog = this.getDialog();
+											var preview = dialog.getContentElement( 'info', 'charPreview' ).getElement();
+											var htmlPreview = dialog.getContentElement( 'info', 'htmlPreview' ).getElement();
+											var target = evt.data.getTarget();
+											var targetName = target.getName();
+											preview.setHtml( '&nbsp;' );
+											htmlPreview.setHtml( '&nbsp;' );
+
+											if ( targetName == 'td' )
+												target.removeClass( "LightBackground" );
+										},
+										onClick : function( evt )
+										{
+											var target = evt.data.getTarget();
+											var targetName = target.getName();
+											var editor = this.getDialog().getParentEditor();
+											var value;
+
+											if ( targetName == 'td' )
+											{
+												target = target.$;
+												if ( ( value = target.getAttribute( 'value' ) ) )
+												{
+													this.getDialog().restoreSelection();
+													editor.insertHtml( value );
+													this.getDialog().hide();
+												}
+											}
+										}
+									}
+								]
+							},
+							{
+								type : 'vbox',
+								align : 'top',
+								children :
+								[
+									{
+										type : 'html',
+										html : '<div></div>'
+									},
+									{
+										type : 'html',
+										id : 'charPreview',
+										style : 'border:1px solid #eeeeee;background-color:#EAEAD1;font-size:28px;height:40px;padding-top:9px;font-family:\'Microsoft Sans Serif\',Arial,Helvetica,Verdana;text-align:center;',
+										html : '<div>&nbsp;</div>'
+									},
+									{
+										type : 'html',
+										id : 'htmlPreview',
+										style : 'border:1px solid #eeeeee;background-color:#EAEAD1;font-size:14px;height:20px;padding-top:2px;font-family:\'Microsoft Sans Serif\',Arial,Helvetica,Verdana;text-align:center;',
+										html : '<div>&nbsp;</div>'
+									}
+								]
+							}
+						]
+					}
+				]
+			}
+		]
+	};
+} );
Index: /CKEditor/tags/3.0 Beta/_source/plugins/specialchar/plugin.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/plugins/specialchar/plugin.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/plugins/specialchar/plugin.js	(revision 3046)
@@ -0,0 +1,29 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @file Special Character plugin
+ */
+
+CKEDITOR.plugins.add( 'specialchar',
+{
+	init : function( editor, pluginPath )
+	{
+		var pluginName = 'specialchar';
+
+		// Register the dialog.
+		CKEDITOR.dialog.add( pluginName, this.path + 'dialogs/specialchar.js' );
+
+		// Register the command.
+		editor.addCommand( pluginName, new CKEDITOR.dialogCommand( pluginName ) );
+
+		// Register the toolbar button.
+		editor.ui.addButton( 'SpecialChar',
+			{
+				label : editor.lang.specialChar.toolbar,
+				command : pluginName
+			});
+	}
+} );
Index: /CKEditor/tags/3.0 Beta/_source/plugins/styles/plugin.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/plugins/styles/plugin.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/plugins/styles/plugin.js	(revision 3046)
@@ -0,0 +1,606 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+CKEDITOR.plugins.add( 'styles',
+{
+	requires : [ 'selection' ]
+});
+
+/**
+ * Registers a function to be called whenever a style changes its state in the
+ * editing area. The current state is passed to the function. The possible
+ * states are {@link CKEDITOR.TRISTATE_ON} and {@link CKEDITOR.TRISTATE_OFF}.
+ * @param {CKEDITOR.style} The style to be watched.
+ * @param {Function} The function to be called when the style state changes.
+ * @example
+ * // Create a style object for the <b> element.
+ * var style = new CKEDITOR.style( { element : 'b' } );
+ * var editor = CKEDITOR.instances.editor1;
+ * editor.attachStyleStateChange( style, function( state )
+ *     {
+ *         if ( state == CKEDITOR.TRISTATE_ON )
+ *             alert( 'The current state for the B element is ON' );
+ *         else
+ *             alert( 'The current state for the B element is OFF' );
+ *     });
+ */
+CKEDITOR.editor.prototype.attachStyleStateChange = function( style, callback )
+{
+	// Try to get the list of attached callbacks.
+	var styleStateChangeCallbacks = this._.styleStateChangeCallbacks;
+
+	// If it doesn't exist, it means this is the first call. So, let's create
+	// all the structure to manage the style checks and the callback calls.
+	if ( !styleStateChangeCallbacks )
+	{
+		// Create the callbacks array.
+		styleStateChangeCallbacks = this._.styleStateChangeCallbacks = [];
+
+		// Attach to the selectionChange event, so we can check the styles at
+		// that point.
+		this.on( 'selectionChange', function( ev )
+			{
+				// Loop throw all registered callbacks.
+				for ( var i = 0 ; i < styleStateChangeCallbacks.length ; i++ )
+				{
+					var callback = styleStateChangeCallbacks[ i ];
+
+					// Check the current state for the style defined for that
+					// callback.
+					var currentState = callback.style.checkActive( ev.data.path ) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF;
+
+					// If the state changed since the last check.
+					if ( callback.state !== currentState )
+					{
+						// Call the callback function, passing the current
+						// state to it.
+						callback.fn.call( this, currentState );
+
+						// Save the current state, so it can be compared next
+						// time.
+						callback.state !== currentState;
+					}
+				}
+			});
+	}
+
+	// Save the callback info, so it can be checked on the next occurence of
+	// selectionChange.
+	styleStateChangeCallbacks.push( { style : style, fn : callback } );
+};
+
+CKEDITOR.STYLE_BLOCK = 1;
+CKEDITOR.STYLE_INLINE = 2;
+CKEDITOR.STYLE_OBJECT = 3;
+
+(function()
+{
+	var blockElements	= { address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1 };
+	var objectElements	= { a:1,embed:1,hr:1,img:1,li:1,object:1,ol:1,table:1,td:1,tr:1,ul:1 };
+
+	CKEDITOR.style = function( styleDefinition )
+	{
+		var element = this.element = ( styleDefinition.element || '*' ).toLowerCase();
+
+		this.type =
+			( element == '#' || blockElements[ element ] ) ?
+				CKEDITOR.STYLE_BLOCK
+			: objectElements[ element ] ?
+				CKEDITOR.STYLE_OBJECT
+			:
+				CKEDITOR.STYLE_INLINE;
+
+		this._ =
+		{
+			definition : styleDefinition
+		};
+	};
+
+	CKEDITOR.style.prototype =
+	{
+		apply : function( document )
+		{
+			// Get all ranges from the selection.
+			var selection = document.getSelection();
+			var ranges = selection.getRanges();
+
+			// Apply the style to the ranges.
+			for ( var i = 0 ; i < ranges.length ; i++ )
+				this.applyToRange( ranges[ i ] );
+
+			// Select the ranges again.
+			selection.selectRanges( ranges );
+		},
+
+		applyToRange : function( range )
+		{
+			return ( this.applyToRange =
+						this.type == CKEDITOR.STYLE_INLINE ?
+							applyInlineStyle
+						: this.type == CKEDITOR.STYLE_BLOCK ?
+							applyBlockStyle
+						: null ).call( this, range );
+		},
+
+		/**
+		 * Get the style state inside an element path. Returns "true" if the
+		 * element is active in the path.
+		 */
+		checkActive : function( elementPath )
+		{
+			switch ( this.type )
+			{
+				case CKEDITOR.STYLE_BLOCK :
+					return this.checkElementRemovable( elementPath.block || elementPath.blockLimit, true );
+
+				case CKEDITOR.STYLE_INLINE :
+
+					var elements = elementPath.elements;
+
+					for ( var i = 0, element ; i < elements.length ; i++ )
+					{
+						element = elements[i];
+
+						if ( element == elementPath.block || element == elementPath.blockLimit )
+							continue;
+
+						if ( this.checkElementRemovable( element, true ) )
+							return true;
+					}
+			}
+			return false;
+		},
+
+		// Checks if an element, or any of its attributes, is removable by the
+		// current style definition.
+		checkElementRemovable : function( element, fullMatch )
+		{
+			if ( !element || element.getName() != this.element )
+				return false ;
+
+			var def = this._.definition;
+			var attribs = def.attributes;
+			var styles = def.styles;
+
+			// If no attributes are defined in the element.
+			if ( !fullMatch && !element.hasAttributes() )
+				return true ;
+
+			for ( var attName in attribs )
+			{
+				if ( element.getAttribute( attName ) == attribs[ attName ] )
+				{
+					if ( !fullMatch )
+						return true;
+				}
+				else if ( fullMatch )
+					return false;
+			}
+
+			return true;
+		},
+
+		/**
+		 * Sets the value of a variable attribute or style, to be used when
+		 * appliying the style. This function must be called before using any
+		 * other function in this object.
+		 */
+		setVariable : function( name, value )
+		{
+			var variables = this._.variables || ( this._variables = {} );
+			variables[ name ] = value;
+		}
+	};
+
+	var applyInlineStyle = function( range )
+	{
+		var document = range.document;
+
+		if ( range.collapsed )
+		{
+			// Create the element to be inserted in the DOM.
+			var collapsedElement = getElement( this, document );
+
+			// Insert the empty element into the DOM at the range position.
+			range.insertNode( collapsedElement );
+
+			// Place the selection right inside the empty element.
+			range.moveToPosition( collapsedElement, CKEDITOR.POSITION_BEFORE_END );
+
+			return;
+		}
+
+		var elementName = this.element;
+		var def = this._.definition;
+		var isUnknownElement;
+
+		// Get the DTD definition for the element. Defaults to "span".
+		var dtd = CKEDITOR.dtd[ elementName ] || ( isUnknownElement = true, CKEDITOR.dtd.span );
+
+		// Bookmark the range so we can re-select it after processing.
+		var bookmark = range.createBookmark();
+
+		// Expand the range.
+		range.enlarge( CKEDITOR.ENLARGE_ELEMENT );
+		range.trim();
+
+		// Get the first node to be processed and the last, which concludes the
+		// processing.
+		var firstNode = range.startContainer.getChild( range.startOffset ) || range.startContainer.getNextSourceNode();
+		var lastNode = range.endContainer.getChild( range.endOffset ) || ( range.endOffset ? range.endContainer.getNextSourceNode() : range.endContainer );
+
+		var currentNode = firstNode;
+
+		var styleRange;
+
+		// Indicates that that some useful inline content has been found, so
+		// the style should be applied.
+		var hasContents;
+
+		while ( currentNode )
+		{
+			var applyStyle = false;
+
+			if ( currentNode.equals( lastNode ) )
+			{
+				currentNode = null;
+				applyStyle = true;
+			}
+			else
+			{
+				var nodeType = currentNode.type;
+				var nodeName = nodeType == CKEDITOR.NODE_ELEMENT ? currentNode.getName() : null;
+
+				if ( nodeName && currentNode.getAttribute( '_fck_bookmark' ) )
+				{
+					currentNode = currentNode.getNextSourceNode( true );
+					continue;
+				}
+
+				// Check if the current node can be a child of the style element.
+				if ( !nodeName || ( dtd[ nodeName ] && ( currentNode.getPosition( lastNode ) | CKEDITOR.POSITION_PRECEDING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED ) == ( CKEDITOR.POSITION_PRECEDING + CKEDITOR.POSITION_IDENTICAL + CKEDITOR.POSITION_IS_CONTAINED ) ) )
+				{
+					var currentParent = currentNode.getParent();
+
+					// Check if the style element can be a child of the current
+					// node parent or if the element is not defined in the DTD.
+					if ( currentParent && ( ( currentParent.getDtd() || CKEDITOR.dtd.span )[ elementName ] || isUnknownElement ) )
+					{
+						// This node will be part of our range, so if it has not
+						// been started, place its start right before the node.
+						// In the case of an element node, it will be included
+						// only if it is entirely inside the range.
+						if ( !styleRange && ( !nodeName || !CKEDITOR.dtd.$removeEmpty[ nodeName ] || ( currentNode.getPosition( lastNode ) | CKEDITOR.POSITION_PRECEDING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED ) == ( CKEDITOR.POSITION_PRECEDING + CKEDITOR.POSITION_IDENTICAL + CKEDITOR.POSITION_IS_CONTAINED ) ) )
+						{
+							styleRange = new CKEDITOR.dom.range( document );
+							styleRange.setStartBefore( currentNode );
+						}
+
+						// Non element nodes, or empty elements can be added
+						// completely to the range.
+						if ( nodeType == CKEDITOR.NODE_TEXT || ( nodeType == CKEDITOR.NODE_ELEMENT && !currentNode.getChildCount() && currentNode.$.offsetWidth ) )
+						{
+							var includedNode = currentNode;
+							var parentNode;
+
+							// This node is about to be included completelly, but,
+							// if this is the last node in its parent, we must also
+							// check if the parent itself can be added completelly
+							// to the range.
+							while ( !includedNode.$.nextSibling
+								&& ( parentNode = includedNode.getParent(), dtd[ parentNode.getName() ] )
+								&& ( parentNode.getPosition( firstNode ) | CKEDITOR.POSITION_FOLLOWING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED ) == ( CKEDITOR.POSITION_FOLLOWING + CKEDITOR.POSITION_IDENTICAL + CKEDITOR.POSITION_IS_CONTAINED ) )
+							{
+								includedNode = parentNode;
+							}
+
+							styleRange.setEndAfter( includedNode );
+
+							// If the included node still is the last node in its
+							// parent, it means that the parent can't be included
+							// in this style DTD, so apply the style immediately.
+							if ( !includedNode.$.nextSibling )
+								applyStyle = true;
+
+							if ( !hasContents )
+								hasContents = ( nodeType != CKEDITOR.NODE_TEXT || (/[^\s\ufeff]/).test( currentNode.getText() ) );
+						}
+					}
+					else
+						applyStyle = true;
+				}
+				else
+					applyStyle = true;
+
+				// Get the next node to be processed.
+				currentNode = currentNode.getNextSourceNode();
+			}
+
+			// Apply the style if we have something to which apply it.
+			if ( applyStyle && hasContents && styleRange && !styleRange.collapsed )
+			{
+				// Build the style element, based on the style object definition.
+				var styleNode = getElement( this, document );
+
+				var parent = styleRange.getCommonAncestor();
+
+				while ( styleNode && parent )
+				{
+					if ( parent.getName() == elementName )
+					{
+						for ( var attName in def.attribs )
+						{
+							if ( styleNode.getAttribute( attName ) == parent.getAttribute( attName ) )
+								styleNode.removeAttribute( attName );
+						}
+
+						for ( var styleName in def.styles )
+						{
+							if ( styleNode.getStyle( styleName ) == parent.getStyle( styleName ) )
+								styleNode.removeStyle( styleName );
+						}
+
+						if ( !styleNode.hasAttributes() )
+						{
+							styleNode = null;
+							break;
+						}
+					}
+
+					parent = parent.getParent();
+				}
+
+				if ( styleNode )
+				{
+					// Move the contents of the range to the style element.
+					styleRange.extractContents().appendTo( styleNode );
+
+					// Here we do some cleanup, removing all duplicated
+					// elements from the style element.
+					removeFromElement( this, styleNode );
+
+					// Insert it into the range position (it is collapsed after
+					// extractContents.
+					styleRange.insertNode( styleNode );
+
+					// Let's merge our new style with its neighbors, if possible.
+					mergeSiblings( styleNode );
+
+					// As the style system breaks text nodes constantly, let's normalize
+					// things for performance.
+					// With IE, some paragraphs get broken when calling normalize()
+					// repeatedly. Also, for IE, we must normalize body, not documentElement.
+					// IE is also known for having a "crash effect" with normalize().
+					// We should try to normalize with IE too in some way, somewhere.
+					if ( !CKEDITOR.env.ie )
+						styleNode.$.normalize();
+				}
+
+				// Style applied, let's release the range, so it gets
+				// re-initialization in the next loop.
+				styleRange = null;
+			}
+		}
+
+//		this._FixBookmarkStart( startNode );
+
+		range.moveToBookmark( bookmark );
+	};
+
+	var applyBlockStyle = function( range )
+	{
+	};
+
+	// Removes a style from inside an element.
+	var removeFromElement = function( style, element )
+	{
+		var def = style._.definition;
+		var attribs = def.attributes;
+		var styles = def.styles;
+
+		var innerElements = element.getElementsByTag( style.element );
+
+		for ( var i = innerElements.count() ; --i >= 0 ; )
+		{
+			var innerElement = innerElements.getItem( i );
+
+			for ( var attName in attribs )
+			{
+				// The 'class' element value must match (#1318).
+				if ( attName == 'class' && innerElement.getAttribute( 'class' ) != attribs[ attName ] )
+					continue;
+
+				innerElement.removeAttribute( attName );
+			}
+
+			for ( var styleName in styles )
+			{
+				innerElement.removeStyle( styleName );
+			}
+
+			removeNoAttribsElement( innerElement );
+		}
+	};
+
+	// If the element has no more attributes, remove it.
+	var removeNoAttribsElement = function( element )
+	{
+		// If no more attributes remained in the element, remove it,
+		// leaving its children.
+		if ( !element.hasAttributes() )
+		{
+			// Removing elements may open points where merging is possible,
+			// so let's cache the first and last nodes for later checking.
+			var firstChild	= element.getFirst();
+			var lastChild	= element.getLast();
+
+			element.remove( true );
+
+			if ( firstChild )
+			{
+				// Check the cached nodes for merging.
+				mergeSiblings( firstChild );
+
+				if ( lastChild && !firstChild.equals( lastChild ) )
+					mergeSiblings( lastChild );
+			}
+		}
+	};
+
+	// Get the the collection used to compare the attributes defined in this
+	// style with attributes in an element. All information in it is lowercased.
+	// V2
+//	var getAttribsForComparison = function( style )
+//	{
+//		// If we have already computed it, just return it.
+//		var attribs = style._.attribsForComparison;
+//		if ( attribs )
+//			return attribs;
+
+//		attribs = {};
+
+//		var def = style._.definition;
+
+//		// Loop through all defined attributes.
+//		var styleAttribs = def.attributes;
+//		if ( styleAttribs )
+//		{
+//			for ( var styleAtt in styleAttribs )
+//			{
+//				attribs[ styleAtt.toLowerCase() ] = styleAttribs[ styleAtt ].toLowerCase();
+//			}
+//		}
+
+//		// Includes the style definitions.
+//		if ( this._GetStyleText().length > 0 )
+//		{
+//			attribs['style'] = this._GetStyleText().toLowerCase();
+//		}
+
+//		// Appends the "length" information to the object.
+//		FCKTools.AppendLengthProperty( attribs, '_length' );
+
+//		// Return it, saving it to the next request.
+//		return ( this._GetAttribsForComparison_$ = attribs );
+//	},
+
+	var mergeSiblings = function( element )
+	{
+		if ( !element || element.type != CKEDITOR.NODE_ELEMENT || !CKEDITOR.dtd.$removeEmpty[ element.getName() ] )
+			return;
+
+		mergeElements( element, element.getNext(), true );
+		mergeElements( element, element.getPrevious() );
+	};
+
+	var mergeElements = function( element, sibling, isNext )
+	{
+		if ( sibling && sibling.type == CKEDITOR.NODE_ELEMENT )
+		{
+			var hasBookmark = sibling.getAttribute( '_fck_bookmark' );
+
+			if ( hasBookmark )
+				sibling = isNext ? sibling.getNext() : sibling.getPrevious();
+
+			if ( sibling && sibling.type == CKEDITOR.NODE_ELEMENT && sibling.getName() == element.getName() )
+			{
+				// Save the last child to be checked too, to merge things like
+				// <b><i></i></b><b><i></i></b> => <b><i></i></b>
+				var innerSibling = isNext ? element.getLast() : element.getFirst();
+
+				if ( hasBookmark )
+					( isNext ? sibling.getPrevious() : sibling.getNext() ).move( element, !isNext );
+
+				sibling.moveChildren( element, !isNext );
+				sibling.remove();
+
+				// Now check the last inner child (see two comments above).
+				if ( innerSibling )
+					mergeSiblings( innerSibling );
+			}
+		}
+	};
+
+	// Regex used to match all variables defined in an attribute or style
+	// value. The variable name is returned with $2.
+	var styleVariableAttNameRegex = /#\(\s*("|')(.+?)\1[^\)]*\s*\)/g;
+
+	var getElement = function( style, targetDocument )
+	{
+		var el = style._.element;
+
+		if ( el )
+			return el.clone();
+
+		var def = style._.definition;
+		var variables = style._.variables;
+
+		var elementName = style.element;
+		var attributes = def.attributes;
+		var styles = def.styles;
+
+		// The "*" element name will always be a span for this function.
+		if ( elementName == '*' )
+			elementName = 'span';
+
+		// Create the element.
+		el = new CKEDITOR.dom.element( elementName, targetDocument );
+
+		// Assign all defined attributes.
+		if ( attributes )
+		{
+			for ( var att in attributes )
+			{
+				var attValue = attributes[ att ];
+				if ( attValue && variables )
+				{
+					attValue = attValue.replace( styleVariableAttNameRegex, function()
+						{
+							// The second group in the regex is the variable name.
+							return variables[ arguments[2] ] || arguments[0];
+						});
+				}
+				el.setAttribute( att, attValue );
+			}
+		}
+
+		// Assign all defined styles.
+		if ( styles )
+		{
+			for ( var styleName in styles )
+				el.setStyle( styleName, styles[ styleName ] );
+
+			if ( variables )
+			{
+				attValue = el.getAttribute( 'style' ).replace( styleVariableAttNameRegex, function()
+					{
+						// The second group in the regex is the variable name.
+						return variables[ arguments[2] ] || arguments[0];
+					});
+				el.setAttribute( 'style', attValue );
+			}
+		}
+
+		// Save the created element. It will be reused on future calls.
+		return ( style._.element = el );
+	};
+})();
+
+CKEDITOR.styleCommand = function( style )
+{
+	this.style = style;
+};
+
+CKEDITOR.styleCommand.prototype.exec = function( editor )
+{
+	editor.focus();
+
+	var doc = editor.document;
+
+	if ( doc )
+		this.style.apply( doc );
+
+	return !!doc;
+};
Index: /CKEditor/tags/3.0 Beta/_source/plugins/tab/plugin.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/plugins/tab/plugin.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/plugins/tab/plugin.js	(revision 3046)
@@ -0,0 +1,283 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+(function()
+{
+	var blurInternal = function( editor, previous )
+	{
+		var hasContainer = editor.container;
+
+		if ( hasContainer )
+		{
+			// We need an empty element after the container, so the focus don't go to a container child.
+			var tempSpan = new CKEDITOR.dom.element( 'span' );
+			tempSpan.setAttribute( 'tabindex', editor.container.getTabIndex() );
+			tempSpan.hide();
+
+			// Insert the temp element and set the focus.
+			if ( previous )
+			{
+				tempSpan.insertBefore( editor.container );
+				tempSpan.focusPrevious();
+			}
+			else
+			{
+				tempSpan.insertAfter( editor.container );
+				tempSpan.focusNext();
+			}
+
+			// Remove the temporary node.
+			tempSpan.remove();
+		}
+
+		return hasContainer;
+	};
+
+	var blurCommand =
+		{
+			exec : function( editor )
+			{
+				return blurInternal( editor );
+			}
+		};
+
+	var blurBackCommand =
+		{
+			exec : function( editor )
+			{
+				return blurInternal( editor, true );
+			}
+		};
+
+	CKEDITOR.plugins.add( 'tab',
+	{
+		requires : [ 'keystrokes' ],
+
+		init : function( editor, pluginPath )
+		{
+			// Register the keystrokes.
+			var keystrokes = editor.keystrokeHandler.keystrokes;
+			keystrokes[ 9 /* TAB */ ] = 'tab';
+			keystrokes[ CKEDITOR.SHIFT + 9 /* TAB */ ] = 'shiftTab';
+
+			var tabSpaces = editor.config.tabSpaces,
+				tabText = '';
+
+			while ( tabSpaces-- )
+				tabText += '\xa0';
+
+			// Register the "tab" and "shiftTab" commands.
+			editor.addCommand( 'tab',
+				{
+					exec : function( editor )
+					{
+						// Fire the "tab" event, making it possible to
+						// customize the TAB key behavior on specific cases.
+						if ( !editor.fire( 'tab' ) )
+						{
+							if ( tabText.length > 0 )
+							{
+								// TODO
+								/*jsl:pass*/
+							}
+							else
+							{
+								// All browsers jump to the next field on TAB,
+								// except Safari, so we have to do that manually
+								// here.
+								/// https://bugs.webkit.org/show_bug.cgi?id=20597
+								return editor.execCommand( 'blur' );
+							}
+						}
+
+						return true;
+					}
+				});
+
+			editor.addCommand( 'shiftTab',
+				{
+					exec : function( editor )
+					{
+						// Fire the "tab" event, making it possible to
+						// customize the TAB key behavior on specific cases.
+						if ( !editor.fire( 'shiftTab' ) )
+							return editor.execCommand( 'blurBack' );
+
+						return true;
+					}
+				});
+
+			editor.addCommand( 'blur', blurCommand );
+			editor.addCommand( 'blurBack', blurBackCommand );
+		}
+	});
+})();
+
+/**
+ * Moves the UI focus to the element following this element in the tabindex
+ * order.
+ * @example
+ * var element = CKEDITOR.document.getById( 'example' );
+ * element.focusNext();
+ */
+CKEDITOR.dom.element.prototype.focusNext = function()
+{
+	var $ = this.$,
+		curTabIndex = this.getTabIndex(),
+		passedCurrent = false,
+		elected,
+		electedTabIndex;
+
+	var all = document.body.all || document.body.getElementsByTagName( '*' );
+
+	if ( curTabIndex <= 0 )
+	{
+		for ( var i = 0, element ; element = all[ i ] ; i++ )
+		{
+			if ( !passedCurrent )
+			{
+				if ( element == $ )
+					passedCurrent = true;
+				continue;
+			}
+
+			element = new CKEDITOR.dom.element( element );
+
+			if ( element.getComputedStyle( 'display' ) == 'none' || element.getComputedStyle( 'visibility' ) == 'hidden' )
+				continue;
+
+			if ( element.getTabIndex() === 0 )
+			{
+				elected = element;
+				break;
+			}
+		}
+	}
+	else
+	{
+		for ( i = 0, element ; element = all[ i ] ; i++ )
+		{
+			if ( !passedCurrent && element == $ )
+			{
+				passedCurrent = true;
+				continue;
+			}
+
+			element = new CKEDITOR.dom.element( element );
+
+			if ( element.getComputedStyle( 'display' ) == 'none' || element.getComputedStyle( 'visibility' ) == 'hidden' )
+				continue;
+
+			var elementTabIndex = element.getTabIndex();
+
+			if ( passedCurrent && elementTabIndex == curTabIndex )
+			{
+				elected = element;
+				break;
+			}
+			else if ( elementTabIndex > curTabIndex && ( !elected || electedTabIndex > elementTabIndex || electedTabIndex === 0 ) )
+			{
+				elected = element;
+				electedTabIndex = elementTabIndex;
+			}
+			else if ( !elected && elementTabIndex === 0 )
+			{
+				elected = element;
+				electedTabIndex = elementTabIndex;
+			}
+		}
+	}
+
+	if ( elected )
+		elected.focus();
+};
+
+/**
+ * Moves the UI focus to the element before this element in the tabindex order.
+ * @example
+ * var element = CKEDITOR.document.getById( 'example' );
+ * element.focusPrevious();
+ */
+CKEDITOR.dom.element.prototype.focusPrevious = function()
+{
+	var $ = this.$,
+		curTabIndex = this.getTabIndex(),
+		passedCurrent = false,
+		elected,
+		electedTabIndex;
+
+	var all = document.body.all || document.body.getElementsByTagName( '*' );
+
+	if ( curTabIndex <= 0 )
+	{
+		for ( var i = 0, element ; element = all[ i ] ; i++ )
+		{
+			if ( !passedCurrent && element == $ )
+			{
+				if ( elected && electedTabIndex === 0 )
+					break;
+
+				passedCurrent = true;
+				continue;
+			}
+
+			element = new CKEDITOR.dom.element( element );
+
+			if ( element.getComputedStyle( 'display' ) == 'none' || element.getComputedStyle( 'visibility' ) == 'hidden' )
+				continue;
+
+			var elementTabIndex = element.getTabIndex();
+
+			if ( ( !passedCurrent && elementTabIndex === 0 )
+				|| ( elementTabIndex > 0 && ( !elected || ( electedTabIndex > 0 && electedTabIndex <= elementTabIndex ) ) ) )
+			{
+				elected = element;
+				electedTabIndex = elementTabIndex;
+			}
+		}
+	}
+	else
+	{
+		for ( i = 0, element ; element = all[ i ] ; i++ )
+		{
+			if ( !passedCurrent && element == $ )
+			{
+				if ( elected && electedTabIndex == curTabIndex )
+					break;
+
+				passedCurrent = true;
+				continue;
+			}
+
+			element = new CKEDITOR.dom.element( element );
+
+			elementTabIndex = element.getTabIndex();
+
+			if ( elementTabIndex > 0 )
+			{
+				if ( ( !passedCurrent && elementTabIndex == curTabIndex )
+					|| ( elementTabIndex < curTabIndex && ( !elected || electedTabIndex <= elementTabIndex ) ) )
+				{
+					elected = element;
+					electedTabIndex = elementTabIndex;
+				}
+			}
+		}
+	}
+
+	if ( elected )
+		elected.focus();
+};
+
+/**
+ * Intructs the editor to add a number of spaces (&amp;nbsp;) to the text when
+ * hitting the TAB key. If set to zero, the TAB key will have its default
+ * behavior instead (like moving out of the editor).
+ * @type {Number}
+ * @default 0
+ * @example
+ * config.tabSpaces = 4;
+ */
+CKEDITOR.config.tabSpaces = 0 ;
Index: /CKEditor/tags/3.0 Beta/_source/plugins/toolbar/plugin.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/plugins/toolbar/plugin.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/plugins/toolbar/plugin.js	(revision 3046)
@@ -0,0 +1,216 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview The "toolbar" plugin. Renders the default toolbar interface in
+ * the editor.
+ */
+
+(function()
+{
+	var toolbox = function()
+	{
+		this.toolbars = [];
+	};
+
+	toolbox.prototype.focus = function()
+	{
+		for ( var t = 0, toolbar ; toolbar = this.toolbars[ t++ ] ; )
+		{
+			for ( var i = 0, item ; item = toolbar.items[ i++ ] ; )
+			{
+				if ( item.focus )
+				{
+					item.focus();
+					return;
+				}
+			}
+		}
+	};
+
+	var commands =
+	{
+		toolbarFocus :
+		{
+			exec : function( editor )
+			{
+				if ( editor.toolbox )
+					editor.toolbox.focus();
+			}
+		}
+	};
+
+	CKEDITOR.plugins.add( 'toolbar',
+	{
+		init : function( editor, pluginPath )
+		{
+			var itemKeystroke = function( item, keystroke )
+			{
+				switch ( keystroke )
+				{
+					case 39 :					// RIGHT-ARROW
+					case 9 :					// TAB
+						// Look for the next item in the toolbar.
+						while ( ( item = item.next || ( item.toolbar.next && item.toolbar.next.items[ 0 ] ) ) && !item.focus )
+						{ /*jsl:pass*/ }
+
+						// If available, just focus it, otherwise focus the
+						// first one.
+						if ( item )
+							item.focus();
+						else
+							editor.toolbox.focus();
+
+						return false;
+
+					case 37 :					// LEFT-ARROW
+					case CKEDITOR.SHIFT + 9 :	// SHIFT + TAB
+						// Look for the previous item in the toolbar.
+						while ( ( item = item.previous || ( item.toolbar.previous && item.toolbar.previous.items[ item.toolbar.previous.items.length - 1 ] ) ) && !item.focus )
+						{ /*jsl:pass*/ }
+
+						// If available, just focus it, otherwise focus the
+						// last one.
+						if ( item )
+							item.focus();
+						else
+						{
+							var lastToolbarItems = editor.toolbox.toolbars[ editor.toolbox.toolbars.length - 1 ].items;
+							lastToolbarItems[ lastToolbarItems.length - 1 ].focus();
+						}
+
+						return false;
+
+					case 27 :					// ESC
+						editor.focus();
+						return false;
+
+					case 13 :					// ENTER
+					case 32 :					// SPACE
+						item.execute();
+						return false;
+				}
+				return true;
+			};
+
+			editor.on( 'themeSpace', function( event )
+				{
+					if ( event.data.space == editor.config.toolbarLocation )
+					{
+						editor.toolbox = new toolbox();
+
+						var output = [ '<div class="cke_toolbox">' ];
+
+						var toolbars = editor.toolbox.toolbars,
+							toolbar = editor.config.toolbar;
+
+						for ( var r = 0 ; r < toolbar.length ; r++ )
+						{
+							var row = toolbar[ r ],
+								toolbarId = 'cke_' + CKEDITOR.tools.getNextNumber(),
+								toolbarObj = { id : toolbarId, items : [] };
+
+							output.push( '<div id="', toolbarId, '" class="cke_toolbar">' );
+
+							// Add the toolbar to the "editor.toolbox.toolbars"
+							// array.
+							var index = toolbars.push( toolbarObj ) - 1;
+
+							// Create the next/previous reference.
+							if ( index > 0 )
+							{
+								toolbarObj.previous = toolbars[ index - 1 ];
+								toolbarObj.previous.next = toolbarObj;
+							}
+
+							// Create all items defined for this toolbar.
+							for ( var i = 0 ; i < row.length ; i++ )
+							{
+								var item,
+									itemName = row[ i ];
+
+								if ( itemName == '-' )
+									item = CKEDITOR.ui.separator;
+								else
+									item = editor.ui.get( itemName );
+
+								if ( item )
+								{
+									var itemObj = item.render( editor, output );
+									index = toolbarObj.items.push( itemObj ) - 1;
+
+									if ( index > 0 )
+									{
+										itemObj.previous = toolbarObj.items[ index - 1 ];
+										itemObj.previous.next = itemObj;
+									}
+
+									itemObj.toolbar = toolbarObj;
+									itemObj.onkey = itemKeystroke;
+								}
+							}
+
+							output.push( '</div>' );
+						}
+
+						output.push( '</div>' );
+
+						event.data.html += output.join( '' );
+					}
+				});
+
+			editor.addCommand( 'toolbarFocus', commands.toolbarFocus );
+		}
+	});
+})();
+
+/**
+ * The UI element that renders a toolbar separator.
+ * @type Object
+ * @example
+ */
+CKEDITOR.ui.separator =
+{
+	render : function( editor, output )
+	{
+		output.push( '<span class="cke_separator"></span>' );
+		return {};
+	}
+};
+
+/**
+ * The "theme space" to which rendering the toolbar. For the default theme,
+ * the recommended options are "top" and "bottom".
+ * @type String
+ * @default 'top'
+ * @see CKEDITOR.config.theme
+ * @example
+ * config.toolbarLocation = 'bottom';
+ */
+CKEDITOR.config.toolbarLocation = 'top';
+
+/**
+ * The toolbox (alias toolbar) definition. It is an array of toolbars (strips),
+ * each one being also an array, containing a list of UI items.
+ * @type Array
+ * @example
+ * // Defines a toolbar with only one strip containing the "Source" button, a
+ * // separator and the "Bold" and "Italic" buttons.
+ * <b>CKEDITOR.config.toolbar =
+ * [
+ *     [ 'Source', '-', 'Bold', 'Italic' ]
+ * ]</b>;
+ */
+CKEDITOR.config.toolbar =
+[
+	[
+		'Source', '-',
+		'NewPage', '-',
+		'Bold', 'Italic', 'Underline', 'Strike', '-',
+		'Subscript', 'Superscript', '-',
+		'SelectAll', 'RemoveFormat', '-',
+		'Smiley', 'HorizontalRule', 'SpecialChar'
+	]
+];
Index: /CKEditor/tags/3.0 Beta/_source/plugins/wysiwygarea/plugin.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/plugins/wysiwygarea/plugin.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/plugins/wysiwygarea/plugin.js	(revision 3046)
@@ -0,0 +1,437 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview The "wysiwygarea" plugin. It registers the "wysiwyg" editing
+ *		mode, which handles the main editing area space.
+ */
+
+(function()
+{
+	// Matches all self-closing tags that are not defined as empty elements in
+	// the DTD (like &lt;span/&gt;).
+	var invalidSelfCloseTagsRegex = /(<(?!br|hr|base|meta|link|param|img|area|input|col)([a-zA-Z0-9:]+)[^>]*)\/>/gi;
+
+	// #### protectEvents - START
+
+	// Matches all tags that have event attributes (onXYZ).
+	var tagsWithEventRegex = /<[^\>]+ on\w+\s*=[\s\S]+?\>/g;
+
+	// Matches all event attributes.
+	var eventAttributesRegex = /\s(on\w+)(?=\s*=\s*?('|")[\s\S]*?\2)/g;
+
+	// Matches the protected attribute prefix.
+	var protectedEventsRegex = /_cke_pa_/g;
+
+	var protectEvents = function( html )
+	{
+		return html.replace( tagsWithEventRegex, protectEvents_ReplaceTags );
+	};
+
+	var protectEvents_ReplaceTags = function( tagMatch )
+	{
+		// Appends the "_cke_pa_" prefix to the event name.
+		return tagMatch.replace( eventAttributesRegex, ' _cke_pa_$1' );
+	};
+
+	var protectEventsRestore = function( html )
+	{
+		return html.replace( protectedEventsRegex, '' ) ;
+	};
+
+	// #### protectEvents - END
+
+	// #### protectAttributes - START
+	var protectUrlTagRegex = /<(?:a|area|img)(?=\s).*?\s(?:href|src)=((?:(?:\s*)("|').*?\2)|(?:[^"'][^ >]+))/gi,
+		protectUrlAttributeRegex = /\s(href|src)(\s*=\s*?('|")[\s\S]*?\3)/gi,
+		protectedUrlTagRegex = /<(?:a|area|img)(?=\s)(?:"[^"]*"|'[^']*'|[^<])*>/gi,
+		protectedAttributeRegex = /_cke_saved_/gi,
+		protectUrls = function( html )
+		{
+			return html.replace( protectUrlTagRegex, protectUrls_ReplaceTags );
+		},
+		protectUrls_ReplaceTags = function( tagMatch )
+		{
+			return tagMatch.replace( protectUrlAttributeRegex, '$& _cke_saved_$1$2');
+		},
+		protectUrlsRestore = function( html )
+		{
+			return html.replace( protectedUrlTagRegex, protectUrlsRestore_ReplaceTags );
+		},
+		protectUrlsRestore_ReplaceTags = function( tagMatch )
+		{
+			return tagMatch.replace( protectUrlAttributeRegex, '' ).replace( protectedAttributeRegex, '' );
+		};
+	// #### protectAttributes - END
+
+	var onInsertHtml = function( evt )
+	{
+		if ( this.mode == 'wysiwyg' )
+		{
+			var $doc = this.document.$;
+
+			if ( CKEDITOR.env.ie )
+				$doc.selection.createRange().pasteHTML( evt.data );
+			else
+				$doc.execCommand( 'inserthtml', false, evt.data );
+		}
+	};
+
+	var onInsertElement = function( evt )
+	{
+		if ( this.mode == 'wysiwyg' )
+		{
+			var element = evt.data,
+				isBlock = CKEDITOR.dtd.$block[ element.getName() ];
+
+			var selection = this.getSelection(),
+				ranges = selection.getRanges();
+
+			var range, clone, lastElement, bookmark;
+
+			for ( var i = ranges.length - 1 ; i >= 0 ; i-- )
+			{
+				range = ranges[ i ];
+
+				// Remove the original contents.
+				range.deleteContents();
+
+				clone = element.clone( true );
+
+				// If the new node is a block element, split the current block.
+				if ( this.config.enterMode != 'br' && isBlock )
+					range.splitBlock();
+
+				// Insert the new node.
+				range.insertNode( clone );
+
+				// Save the last element reference so we can make the
+				// selection later.
+				if ( !lastElement )
+					lastElement = clone;
+			}
+
+			range.moveToPosition( lastElement, CKEDITOR.POSITION_AFTER_END );
+			selection.selectRanges( [ range ] );
+		}
+	};
+
+	CKEDITOR.plugins.add( 'wysiwygarea',
+	{
+		requires : [ 'editingblock' ],
+
+		init : function( editor, pluginPath )
+		{
+			editor.on( 'editingBlockReady', function()
+				{
+					var mainElement,
+						iframe,
+						isLoadingData,
+						isPendingFocus,
+						fireMode;
+
+					// The following information is needed for IE only.
+					var isCustomDomain = CKEDITOR.env.ie && document.domain != window.location.hostname;
+
+					// Creates the iframe that holds the editable document.
+					var createIFrame = function()
+					{
+						if ( iframe )
+							iframe.remove();
+
+						iframe = new CKEDITOR.dom.element( 'iframe' )
+							.setAttributes({
+								frameBorder : 0,
+								allowTransparency : true })
+							.setStyles({
+								width : '100%',
+								height : '100%' });
+
+						if ( CKEDITOR.env.ie )
+						{
+							if ( isCustomDomain )
+							{
+								// The document domain must be set within the src
+								// attribute.
+								iframe.setAttribute( 'src',
+									'javascript:void( (function(){' +
+										'document.open();' +
+										'document.domain="' + document.domain + '";' +
+										'document.write( window.parent._cke_htmlToLoad_' + editor.name + ' );' +
+										'document.close();' +
+										'window.parent._cke_htmlToLoad_' + editor.name + ' = null;' +
+									'})() )' );
+							}
+							else
+								// To avoid HTTPS warnings.
+								iframe.setAttribute( 'src', 'javascript:void(0)' );
+						}
+
+						// Append the new IFRAME to the main element. For IE, it
+						// must be done after setting the "src", to avoid the
+						// "secure/unsecure" message under HTTPS.
+						mainElement.append( iframe );
+					};
+
+					// The script that is appended to the data being loaded. It
+					// enables editing, and makes some
+					var activationScript =
+						'<script id="cke_actscrpt" type="text/javascript">' +
+							'window.onload = function()' +
+							'{' +
+								// Remove this script from the DOM.
+								'var s = document.getElementById( "cke_actscrpt" );' +
+								's.parentNode.removeChild( s );' +
+
+								// Call the temporary function for the editing
+								// boostrap.
+								'window.parent.CKEDITOR._.contentDomReady' + editor.name + '( window );' +
+							'}' +
+						'</script>';
+
+					// Editing area bootstrap code.
+					var contentDomReady = function( domWindow )
+					{
+						delete CKEDITOR._[ 'contentDomReady' + editor.name ];
+
+						var domDocument = domWindow.document,
+							body = domDocument.body;
+
+						body.spellcheck = !editor.config.disableNativeSpellChecker;
+
+						if ( CKEDITOR.env.ie )
+						{
+							// Don't display the focus border.
+							body.hideFocus = true;
+
+							// Disable and re-enable the body to avoid IE from
+							// taking the editing focus at startup. (#141 / #523)
+							body.disabled = true;
+							body.contentEditable = true;
+							body.removeAttribute( 'disabled' );
+						}
+						else
+							domDocument.designMode = 'on';
+
+						// IE, Opera and Safari may not support it and throw
+						// errors.
+						try { domDocument.execCommand( 'enableObjectResizing', false, !editor.config.disableObjectResizing ) ; } catch(e) {}
+						try { domDocument.execCommand( 'enableInlineTableEditing', false, !editor.config.disableNativeTableHandles ) ; } catch(e) {}
+
+						domWindow	= editor.window		= new CKEDITOR.dom.window( domWindow );
+						domDocument	= editor.document	= new CKEDITOR.dom.document( domDocument );
+
+						var focusTarget = ( CKEDITOR.env.ie || CKEDITOR.env.safari ) ?
+								domWindow : domDocument;
+
+						focusTarget.on( 'blur', function()
+							{
+								editor.focusManager.blur();
+							});
+
+						focusTarget.on( 'focus', function()
+							{
+								editor.focusManager.focus();
+							});
+
+						var keystrokeHandler = editor.keystrokeHandler;
+						if ( keystrokeHandler )
+							keystrokeHandler.attach( domDocument );
+
+						editor.fire( 'contentDom' );
+
+						if ( fireMode )
+						{
+							editor.mode = 'wysiwyg';
+							editor.fire( 'mode' );
+							fireMode = false;
+						}
+
+						isLoadingData = false;
+
+						if ( isPendingFocus )
+							editor.focus();
+					};
+
+					editor.addMode( 'wysiwyg',
+						{
+							load : function( holderElement, data, isSnapshot )
+							{
+								mainElement = holderElement;
+
+								// Create the iframe at load for all browsers
+								// except FF and IE with custom domain.
+								if ( !isCustomDomain || !CKEDITOR.env.gecko )
+									createIFrame();
+
+								// The editor data "may be dirty" after this
+								// point.
+								editor.mayBeDirty = true;
+
+								fireMode = true;
+
+								if ( isSnapshot )
+									this.loadSnapshotData( data );
+								else
+									this.loadData( data );
+							},
+
+							loadData : function( data )
+							{
+								isLoadingData = true;
+
+								// Get the HTML version of the data.
+								if ( editor.dataProcessor )
+									data = editor.dataProcessor.toHtml( data );
+
+								// Fix for invalid self-closing tags (see #152).
+								// TODO: Check if this fix is really needed as
+								// soon as we have the XHTML generator.
+								if ( CKEDITOR.env.ie )
+									data = data.replace( invalidSelfCloseTagsRegex, '$1></$2>' );
+
+								// Prevent event attributes (like "onclick") to
+								// execute while editing.
+								if ( CKEDITOR.env.ie || CKEDITOR.env.webkit )
+									data = protectEvents( data );
+
+								// Protect src or href attributes.
+								data = protectUrls( data );
+
+								// Replace tags with fake elements.
+								if ( editor.fakeobjects )
+									data = editor.fakeobjects.protectHtml( data );
+
+								data =
+									editor.config.docType +
+									'<html dir="' + editor.config.contentsLangDirection + '">' +
+									'<head>' +
+										'<link href="' + editor.config.contentsCss + '" type="text/css" rel="stylesheet" _fcktemp="true"/>' +
+									'</head>' +
+									'<body>' +
+										data +
+									'</body>' +
+									'</html>' +
+									activationScript;
+
+								// For custom domain in IE, set the global variable
+								// that will temporarily hold the editor data. This
+								// reference will be used in the ifram src.
+								if ( isCustomDomain )
+									window[ '_cke_htmlToLoad_' + editor.name ] = data;
+
+								CKEDITOR._[ 'contentDomReady' + editor.name ] = contentDomReady;
+
+								// We need to recreate the iframe in FF for every
+								// data load, otherwise the following spellcheck
+								// and execCommand features will be active only for
+								// the first time.
+								// The same is valid for IE with custom domain,
+								// because the iframe src must be reset every time.
+								if ( isCustomDomain || CKEDITOR.env.gecko )
+									createIFrame();
+
+								// For custom domain in IE, the data loading is
+								// done through the src attribute of the iframe.
+								if ( !isCustomDomain )
+								{
+									var doc = iframe.$.contentWindow.document;
+									doc.open();
+									doc.write( data );
+									doc.close();
+								}
+							},
+
+							getData : function()
+							{
+								var data = iframe.$.contentWindow.document.body;
+
+								if ( editor.dataProcessor )
+									data = editor.dataProcessor.toDataFormat( new CKEDITOR.dom.element( data ) );
+								else
+									data = data.innerHTML;
+
+								// Restore protected attributes.
+								data = protectEventsRestore( data );
+
+								// Restore protected URLs.
+								data = protectUrlsRestore( data );
+
+								// Restore fake elements.
+								if ( editor.fakeobjects )
+									data = editor.fakeobjects.restoreHtml( data );
+
+								return data;
+							},
+
+							getSnapshotData : function()
+							{
+								return iframe.$.contentWindow.document.body.innerHTML;
+							},
+
+							loadSnapshotData : function( data )
+							{
+								iframe.$.contentWindow.document.body.innerHTML = data;
+							},
+
+							unload : function( holderElement )
+							{
+								editor.window = editor.document = iframe = mainElement = isPendingFocus = null;
+
+								editor.fire( 'contentDomUnload' );
+							},
+
+							focus : function()
+							{
+								if ( isLoadingData )
+									isPendingFocus = true;
+								else if ( editor.window )
+									editor.window.focus();
+							}
+						});
+
+					editor.on( 'insertHtml', onInsertHtml, null, null, 20 );
+					editor.on( 'insertElement', onInsertElement, null, null, 20 );
+				});
+		}
+	});
+})();
+
+/**
+ * Disables the ability of resize objects (image and tables) in the editing
+ * area
+ * @type Boolean
+ * @default false
+ * @example
+ * config.disableObjectResizing = true;
+ */
+CKEDITOR.config.disableObjectResizing = false;
+
+/**
+ * Disables the "table tools" offered natively by the browser (currently
+ * Firefox only) to make quick table editing operations, like adding or
+ * deleting rows and columns.
+ * @type Boolean
+ * @default true
+ * @example
+ * config.disableNativeTableHandles = false;
+ */
+CKEDITOR.config.disableNativeTableHandles = true;
+
+/**
+ * Disables the built-in spell checker while typing natively available in the
+ * browser (currently Firefox and Safari only).<br /><br />
+ *
+ * Even if word suggestions will not appear in the FCKeditor context menu, this
+ * feature is useful to help quickly identifying misspelled words.<br /><br />
+ *
+ * This setting is currently compatible with Firefox only due to limitations in
+ * other browsers.
+ * @type Boolean
+ * @default true
+ * @example
+ * config.disableNativeSpellChecker = false;
+ */
+CKEDITOR.config.disableNativeSpellChecker = true;
Index: /CKEditor/tags/3.0 Beta/_source/skins/default/dialog.css
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/skins/default/dialog.css	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/skins/default/dialog.css	(revision 3046)
@@ -0,0 +1,707 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/* Restore the dialog visibility */
+body .cke_dialog
+{
+	visibility: visible;
+}
+
+.cke_skin_default .cke_dialog_tl,
+.cke_skin_default .cke_dialog_t,
+.cke_skin_default .cke_dialog_tr,
+.cke_skin_default .cke_dialog_l,
+.cke_skin_default .cke_dialog_c,
+.cke_skin_default .cke_dialog_r,
+.cke_skin_default .cke_dialog_bl,
+.cke_skin_default .cke_dialog_b,
+.cke_skin_default .cke_dialog_br
+{
+	float: left;
+}
+
+.cke_skin_default .cke_dialog_tl,
+.cke_skin_default .cke_dialog_l,
+.cke_skin_default .cke_dialog_bl
+{
+	clear: left;
+}
+
+.cke_skin_default .cke_dialog_tl,
+.cke_skin_default .cke_dialog_tr,
+.cke_skin_default .cke_dialog_l,
+.cke_skin_default .cke_dialog_r
+{
+	width: 16px;
+}
+
+.cke_skin_default .cke_dialog_tl,
+.cke_skin_default .cke_dialog_t,
+.cke_skin_default .cke_dialog_tr
+{
+	height: 16px;
+}
+
+.cke_skin_default .cke_dialog_tl,
+.cke_skin_default .cke_dialog_t,
+.cke_skin_default .cke_dialog_tr,
+.cke_skin_default .cke_dialog_bl,
+.cke_skin_default .cke_dialog_b,
+.cke_skin_default .cke_dialog_br
+{
+	background-image: url(images/sprites.png);
+	/* IE6 does not support full color transparent PNG. */
+	_background-image: url(images/sprites.gif);
+	background-repeat: no-repeat;
+}
+
+.cke_skin_default .cke_dialog_l,
+.cke_skin_default .cke_dialog_r
+{
+	background-image: url(images/dialog.sides.png);
+	/* IE6 does not support full color transparent PNG. */
+	_background-image: url(images/dialog.sides.gif);
+	background-repeat: repeat-y;
+}
+
+.cke_skin_default.cke_rtl .cke_dialog_l,
+.cke_skin_default.cke_rtl .cke_dialog_r
+{
+	background-image: url(images/dialog.sides.rtl.png);
+	_background-image: url(images/dialog.sides.gif);
+}
+
+.cke_skin_default .cke_dialog_bl,
+.cke_skin_default .cke_dialog_b,
+.cke_skin_default .cke_dialog_br
+{
+	height: 51px;
+}
+
+.cke_skin_default .cke_dialog_bl,
+.cke_skin_default .cke_dialog_br
+{
+	width: 30px;
+}
+
+.cke_skin_default .cke_dialog_tl
+{
+	background-position: -16px -16px;
+}
+
+.cke_skin_default.cke_rtl .cke_dialog_tl
+{
+	background-position: -16px -397px;
+}
+
+.cke_skin_default .cke_dialog_tr
+{
+	background-position: -16px -76px;
+}
+
+.cke_skin_default.cke_rtl .cke_dialog_tr
+{
+	background-position: -16px -457px;
+}
+
+.cke_skin_default .cke_dialog_t
+{
+	background-position: 0px -136px;
+	background-repeat: repeat-x;
+}
+
+.cke_skin_default .cke_dialog_l
+{
+	background-position: 0px 0px;
+}
+
+.cke_skin_default .cke_dialog_r
+{
+	background-position: -16px 0px;
+}
+
+.cke_skin_default .cke_dialog_bl
+{
+	background-position: -16px -196px;
+}
+
+.cke_skin_default.cke_rtl .cke_dialog_bl
+{
+	background-position: -16px -517px;
+}
+
+.cke_skin_default .cke_dialog_b
+{
+	background-position: 0px -330px;
+	background-repeat: repeat-x;
+}
+
+.cke_skin_default .cke_dialog_br
+{
+	background-position: -16px -263px;
+}
+
+.cke_skin_default.cke_rtl .cke_dialog_br
+{
+	background-position: -16px -584px;
+}
+
+.cke_skin_default .cke_dialog_title
+{
+	position: absolute;
+	top: 2px;
+	left: 16px;
+	height: 23px;
+	right: 16px;
+	font-weight: bold;
+	font-size: 14pt;
+	color: #737357;
+	background-color: #e3e3c7;
+	padding: 3px 10px 3px 10px;
+	overflow: hidden;
+	cursor: move;
+}
+
+.cke_skin_default .single_page .cke_dialog_tabs
+{
+	display: none;
+}
+
+.cke_skin_default .cke_dialog_tabs
+{
+	position: absolute;
+	top: 31px;
+	left: 16px;
+	height: 23px;
+	right: 16px;
+	background-color: #e3e3c7;
+	z-index: 1;
+	border-collapse: separate;
+}
+
+.cke_skin_default.cke_browser_ie .cke_dialog_tabs
+{
+	border-collapse: collapse;
+}
+
+.cke_skin_default .cke_dialog_tabs .head_filler
+{
+	padding-left: 10px;
+	border-bottom: 1px solid #D5D59D;
+	line-height: 50%;
+}
+
+.cke_skin_default .cke_dialog_tabs .tail_filler
+{
+	width: 100%;
+	border-bottom: 1px solid #D5D59D;
+	line-height: 50%;
+}
+
+.cke_skin_default .cke_dialog_contents
+{
+	position: absolute;
+	background-color: #f1f1e3;
+	top: 54px;
+	left: 16px;
+	bottom: 51px;
+	right: 16px;
+	border: #d5d59d 1px solid;
+	border-top: none;
+}
+
+.cke_skin_default .single_page .cke_dialog_contents
+{
+	top: 31px;
+	border-top: #d5d59d 1px solid;
+}
+
+.cke_skin_default .cke_dialog_footer
+{
+	position: absolute;
+	background-color: #e3e3c7;
+	height: 31px;
+	left: 16px;
+	right: 16px;
+	bottom: 20px;
+}
+
+.cke_skin_default .cke_dialog_page_contents
+{
+	position: absolute;
+	top: 0px;
+	bottom: 0px;
+	left: 0px;
+	right: 0px;
+	padding: 5px 10px;
+}
+
+.cke_skin_default .cke_dialog_tab_center
+{
+	cursor: pointer;
+}
+
+.cke_skin_default .cke_dialog_tab
+{
+	border-bottom: 1px solid #D5D59D;
+}
+
+.cke_skin_default .cke_dialog_tab_left,
+.cke_skin_default .cke_dialog_tab_right
+{
+	cursor: pointer;
+}
+
+.cke_skin_default .cke_dialog_tab_center
+{
+	color: #737357;
+	border-left: 1px solid #d5d59d;
+	border-right: 1px solid #d5d59d;
+	border-top: 1px solid #d5d59d;
+	height: 15px;
+	padding: 4px 5px;
+}
+
+.cke_skin_default.cke_browser_webkit.cke_mode_quirks .cke_dialog_tab_center
+{
+	padding: 4px 5px 5px 5px;
+}
+
+.cke_skin_default.cke_browser_webkit.cke_mode_standards .cke_dialog_tab_center
+{
+	padding: 4px 5px 2px 5px;
+}
+
+
+.cke_skin_default .cke_dialog_tab_selected
+{
+	border-bottom: 1px solid #F1F1E3;
+}
+
+.cke_skin_default .cke_dialog_tab_selected .cke_dialog_tab_left,
+.cke_skin_default .cke_dialog_tab_selected .cke_dialog_tab_center,
+.cke_skin_default .cke_dialog_tab_selected .cke_dialog_tab_right
+{
+	cursor: default;
+}
+
+.cke_skin_default .cke_dialog_tab_selected .cke_dialog_tab_center
+{
+	background-color: #f1f1e3;
+	font-weight: bold;
+}
+
+.cke_skin_default .cke_dialog_ui_vbox table,
+.cke_skin_default .cke_dialog_ui_hbox table
+{
+	margin: auto;
+}
+
+.cke_skin_default .cke_dialog_ui_vbox_child
+{
+	padding: 5px 0px;
+}
+
+.cke_skin_default input.cke_dialog_ui_input_text,
+.cke_skin_default input.cke_dialog_ui_input_password
+{
+	background-color: white;
+	border: none;
+	padding: 0px;
+	width: 100%;
+	height: 14px;
+}
+
+.cke_skin_default div.cke_dialog_ui_input_text,
+.cke_skin_default div.cke_dialog_ui_input_password
+{
+	background-color: white;
+	border: 1px solid #a0a0a0;
+	padding: 1px 0px;
+}
+
+.cke_skin_default textarea.cke_dialog_ui_input_textarea
+{
+	background-color: white;
+	border: none;
+	padding: 0px;
+	width: 100%;
+	/*
+	 * IE6 BUG: Scrollbars in textareas can overflow even if the outer DIV is set to overflow:hidden.
+	 * So leave 1% width for the scrollbar. In most situations the 1% isn't noticeable by users.
+	 */
+	_width: 99%;
+	overflow: auto;
+}
+
+.cke_skin_default div.cke_dialog_ui_input_textarea
+{
+	background-color: white;
+	border: 1px solid #a0a0a0;
+	padding: 1px 0px;
+}
+
+.cke_skin_default .cke_dialog_ui_hbox
+{
+	width: 100%;
+}
+
+.cke_skin_default.cke_browser_ie .cke_dialog_ui_hbox,
+.cke_skin_default.cke_browser_ie .cke_dialog_ui_vbox,
+.cke_skin_default.cke_browser_webkit .cke_dialog_ui_hbox,
+.cke_skin_default.cke_browser_webkit .cke_dialog_ui_vbox
+{
+	table-layout: fixed;
+}
+
+.cke_skin_default.cke_browser_ie .cke_dialog_footer_buttons
+{
+	table-layout: auto;
+}
+
+.cke_skin_default.cke_ltr .cke_dialog_ui_hbox_first,
+.cke_skin_default.cke_ltr .cke_dialog_ui_hbox_child
+{
+	padding-right: 10px;
+}
+
+.cke_skin_default.cke_rtl .cke_dialog_ui_hbox_first,
+.cke_skin_default.cke_rtl .cke_dialog_ui_hbox_child
+{
+	padding-left: 10px;
+}
+
+.cke_skin_default .cke_dialog_ui_button
+{
+	border: #737357 1px solid;
+}
+
+.cke_skin_default .cke_dialog_ui_button.disabled
+{
+	border: #898980 1px solid;
+}
+
+.cke_skin_default .cke_dialog_ui_button_txt
+{
+	padding: 2px 10px;
+	text-align: center;
+	color: #3b3b1f;
+	background-color: #c7c78f;
+}
+
+.cke_skin_default .cke_dialog_ui_button.disabled .cke_dialog_ui_button_txt
+{
+	color: #5e5e55;
+	background-color: #c5c5b3;
+}
+
+.cke_skin_default .cke_dialog_ui_button.active .cke_dialog_ui_button_txt
+{
+	background-color: #e3e3c7;
+}
+
+.cke_skin_default strong
+{
+	font-weight: bold;
+}
+
+.cke_skin_default .cke_dialog_footer_buttons
+{
+	width: auto;
+	position: absolute;
+	right: 10px;
+	top: 7px;
+}
+
+.cke_skin_default.cke_rtl .cke_dialog_footer_buttons
+{
+	right: auto;
+	left: 10px;
+}
+
+.cke_skin_default .cke_dialog_close_button
+{
+	background-image: url(images/sprites.png);
+	/* IE6 does not support full color transparent PNG. */
+	_background-image: url(images/sprites.gif);
+	background-repeat: no-repeat;
+	background-position: -16px -651px;
+	position: absolute;
+	cursor: pointer;
+	height: 20px;
+	width: 20px;
+	right: 10px;
+	top: 5px;
+}
+
+.cke_skin_default .cke_dialog_close_button:hover
+{
+	background-position: -16px -687px;
+}
+
+.cke_skin_default.cke_rtl .cke_dialog_close_button
+{
+	left: 10px;
+	right: auto;
+}
+
+.cke_skin_default .cke_dialog_tl_resize,
+.cke_skin_default .cke_dialog_t_resize,
+.cke_skin_default .cke_dialog_tr_resize,
+.cke_skin_default .cke_dialog_bl_resize,
+.cke_skin_default .cke_dialog_b_resize,
+.cke_skin_default .cke_dialog_br_resize
+{
+	position: absolute;
+	height: 5px;
+	overflow: hidden;
+	background-color: transparent;
+}
+
+.cke_skin_default .cke_dialog_l_resize,
+.cke_skin_default .cke_dialog_r_resize
+{
+	position: absolute;
+	width: 5px;
+	overflow: hidden;
+	background-color: transparent;
+}
+
+.cke_skin_default .cke_dialog_tl_resize
+{
+	width: 5px;
+	left: 11px;
+	top: -3px;
+	cursor: nw-resize;
+}
+
+.cke_skin_default .cke_dialog_t_resize
+{
+	left: 16px;
+	top: -3px;
+	cursor: n-resize;
+}
+
+.cke_skin_default .cke_dialog_tr_resize
+{
+	width: 5px;
+	right: 14px;
+	top: -3px;
+	cursor: ne-resize;
+}
+
+.cke_skin_default .cke_dialog_l_resize
+{
+	top: 2px;
+	left: 11px;
+	cursor: w-resize;
+}
+
+.cke_skin_default .cke_dialog_r_resize
+{
+	top: 2px;
+	right: 14px;
+	cursor: e-resize;
+}
+
+.cke_skin_default .cke_dialog_bl_resize
+{
+	bottom: 18px;
+	left: 11px;
+	width: 5px;
+	cursor: sw-resize;
+}
+
+.cke_skin_default .cke_dialog_b_resize
+{
+	bottom: 18px;
+	left: 16px;
+	cursor: s-resize;
+}
+
+.cke_skin_default .cke_dialog_br_resize
+{
+	bottom: 18px;
+	right: 14px;
+	width: 8px;
+	height: 8px;
+	cursor: se-resize;
+}
+
+.cke_skin_default .cke_dialog_ui_input_select
+{
+	border: 1px solid #a0a0a0;
+	background-color: white;
+}
+
+.cke_skin_default iframe.cke_dialog_ui_input_file
+{
+	width: 100%;
+	height: 25px;
+}
+
+.cke_skin_default.cke_browser_ie div.cke_dialog_ui_input_file
+{
+	height: 25px;
+}
+
+/*
+ * Safari and Gecko on Mac actually distinguish between single-sided and
+ * double-sided resize cursors. The double-sided resize cursors should be used.
+ */
+.cke_skin_default.cke_browser_gecko .cke_dialog_tl_resize,
+.cke_skin_default.cke_browser_webkit .cke_dialog_tl_resize,
+.cke_skin_default.cke_browser_gecko .cke_dialog_br_resize,
+.cke_skin_default.cke_browser_webkit .cke_dialog_br_resize
+{
+	cursor: nwse-resize;
+}
+
+.cke_skin_default.cke_browser_gecko .cke_dialog_tr_resize,
+.cke_skin_default.cke_browser_webkit .cke_dialog_tr_resize,
+.cke_skin_default.cke_browser_gecko .cke_dialog_bl_resize,
+.cke_skin_default.cke_browser_webkit .cke_dialog_bl_resize
+{
+	cursor: nesw-resize;
+}
+
+.cke_skin_default.cke_browser_gecko .cke_dialog_l_resize,
+.cke_skin_default.cke_browser_webkit .cke_dialog_l_resize,
+.cke_skin_default.cke_browser_gecko .cke_dialog_r_resize,
+.cke_skin_default.cke_browser_webkit .cke_dialog_r_resize
+{
+	cursor: ew-resize;
+}
+
+.cke_skin_default.cke_browser_gecko .cke_dialog_t_resize,
+.cke_skin_default.cke_browser_webkit .cke_dialog_t_resize,
+.cke_skin_default.cke_browser_gecko .cke_dialog_b_resize,
+.cke_skin_default.cke_browser_webkit .cke_dialog_b_resize
+{
+	cursor: ns-resize;
+}
+
+/*
+ * Some utility CSS classes for dialog authors.
+ */
+.cke_skin_default .cke_dialog .dark_background
+{
+	background-color: #eaead1;
+}
+
+.cke_skin_default .cke_dialog .hand
+{
+	cursor: pointer;
+}
+
+.cke_skin_default .cke_dialog .centered
+{
+	text-align: center;
+}
+
+.cke_skin_default .cke_dialog .BtnReset
+{
+	float: right;
+	background-position: center center;
+	background-image: url(images/reset.gif);
+	width: 16px;
+	height: 16px;
+	background-repeat: no-repeat;
+	border: 1px none;
+	font-size: 1px;
+}
+
+.cke_skin_default .cke_dialog .BtnLocked, .BtnUnlocked
+{
+	float: left;
+	background-position: center center;
+	background-image: url(images/locked.gif);
+	width: 16px;
+	height: 16px;
+	background-repeat: no-repeat;
+	border: none 1px;
+	font-size: 1px;
+}
+
+.cke_skin_default .cke_dialog .BtnUnlocked
+{
+	background-image: url(images/unlocked.gif);
+}
+
+.cke_skin_default .cke_dialog .BtnOver
+{
+	border: outset 1px;
+	cursor: pointer;
+	cursor: hand;
+}
+
+.cke_skin_default .cke_dialog  #ImagePreviewBox
+{
+	white-space : normal;
+	border : 2px ridge black;
+	overflow : scroll;
+	height : 160px;
+	width : 230px;
+	padding : 2px;
+	background-color : white;
+}
+.cke_skin_default .cke_dialog  #ImagePreviewLoader
+{
+	position: absolute;
+	white-space : normal;
+	overflow : hidden;
+	height : 160px;
+	width : 230px;
+	margin : 2px;
+	padding : 2px;
+	opacity : 0.9;
+	filter : alpha(opacity=90);
+
+	background-color : #e4e4e4;
+}
+
+.cke_skin_default .cke_dialog  #FlashPreviewBox
+{
+	white-space : normal;
+	border : 2px ridge black;
+	overflow : scroll;
+	height : 160px;
+	width : 390px;
+	padding : 2px;
+	background-color : white;
+}
+
+.cke_skin_default .cke_dialog .loading
+{
+	height : 160px;
+	width : 230px;
+	background-image: url(images/dialog.loading.gif);
+	background-repeat: no-repeat;
+	background-position: 47% 47%;
+}
+
+.cke_skin_default .cke_dialog .DarkBackground
+{
+	text-align : center;
+	background-color: #eaead1;
+	font-size : 14px;
+}
+
+.cke_skin_default .cke_dialog .LightBackground
+{
+	text-align : center;
+	background-color: #ffffbe;
+}
+
+.cke_skin_default .cke_dialog .Hand
+{
+	cursor: pointer;
+	cursor: hand;
+}
+
+.cke_skin_default .disabled
+{
+	color: #a0a0a0;
+}
Index: /CKEditor/tags/3.0 Beta/_source/skins/default/editor.css
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/skins/default/editor.css	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/skins/default/editor.css	(revision 3046)
@@ -0,0 +1,15 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+@import url("reset.css");
+@import url("mainui.css");
+@import url("toolbar.css");
+@import url("elementspath.css");
+
+/* Restore the container visibility */
+body .cke_container
+{
+	visibility: visible;
+}
Index: /CKEditor/tags/3.0 Beta/_source/skins/default/elementspath.css
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/skins/default/elementspath.css	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/skins/default/elementspath.css	(revision 3046)
@@ -0,0 +1,40 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+@media print
+{
+	.cke_path
+	{
+		display: none;
+	}
+}
+
+.cke_skin_default .cke_path
+{
+	padding: 3px;
+}
+
+.cke_skin_default .cke_path a
+{
+	border: solid 1px #efefde;
+	background-color: #efefde;
+	padding-top: 1px;
+	padding-bottom: 1px;
+	padding-left: 4px;
+	padding-right: 4px;
+}
+
+.cke_skin_default .cke_path a:hover,
+.cke_skin_default .cke_path a:focus,
+.cke_skin_default .cke_path a:active	/* IE */
+{
+	border: solid 1px #316ac5;
+	background-color: #dff1ff;
+	padding-top: 1px;
+	padding-bottom: 1px;
+	padding-left: 4px;
+	padding-right: 4px;
+	outline: none;
+}
Index: /CKEditor/tags/3.0 Beta/_source/skins/default/mainui.css
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/skins/default/mainui.css	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/skins/default/mainui.css	(revision 3046)
@@ -0,0 +1,50 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+.cke_skin_default .cke_editor
+{
+/*
+	border: solid 1px #dcdcdc;
+*/
+	display: inline-table;
+}
+
+.cke_skin_default .cke_top, .cke_skin_default .cke_bottom
+{
+	background-color: #efefde;
+}
+
+.cke_skin_default .cke_top
+{
+    border-top: solid 1px #fafaf5;
+    border-left: solid 1px #fafaf5;
+    border-right: solid 1px #696969;
+    border-bottom: solid 2px #696969;
+}
+
+.cke_skin_default .cke_bottom
+{
+    border-left: solid 1px #696969;
+    border-right: solid 1px #696969;
+    border-bottom: solid 1px #696969;
+}
+
+.cke_skin_default .cke_contents
+{
+	border: solid 1px #696969;
+}
+
+.cke_skin_default.cke_focus
+{
+	outline: auto 5px -webkit-focus-ring-color;
+}
+
+.cke_skin_default textarea.cke_source
+{
+	font-family: 'Courier New' , Monospace;
+	font-size: small;
+	white-space: pre;
+	background-color: #fff;
+}
Index: /CKEditor/tags/3.0 Beta/_source/skins/default/reset.css
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/skins/default/reset.css	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/skins/default/reset.css	(revision 3046)
@@ -0,0 +1,51 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * Reset and Default Values
+ */
+.cke_skin_default *,
+.cke_skin_default a:hover,
+.cke_skin_default a:link,
+.cke_skin_default a:visited,
+.cke_skin_default a:active
+{
+	margin: 0;
+	padding: 0;
+	border: 0;
+	background: transparent;
+	text-decoration: none;
+	font: normal normal normal 100% Sans-Serif;
+	width: auto;
+	height: auto;
+	border-collapse: collapse;
+	text-align: left;
+	vertical-align: baseline;
+	white-space: nowrap;
+	cursor: default;
+	color: #000;
+
+    font-size: 11px;
+    font-family: 'Microsoft Sans Serif' , Tahoma, Arial, Verdana, Sans-Serif;
+}
+
+.cke_skin_default.cke_rtl *,
+.cke_skin_default.cke_rtl a:hover,
+.cke_skin_default.cke_rtl a:link,
+.cke_skin_default.cke_rtl a:visited,
+.cke_skin_default.cke_rtl a:active
+{
+	text-align: right;
+}
+
+.cke_skin_default iframe
+{
+	vertical-align: inherit;	/** For IE */
+}
+
+.cke_skin_default textarea
+{
+	white-space: pre;
+}
Index: /CKEditor/tags/3.0 Beta/_source/skins/default/skin.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/skins/default/skin.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/skins/default/skin.js	(revision 3046)
@@ -0,0 +1,110 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+CKEDITOR.skins.add( 'default', (function()
+{
+	var preload = [];
+	var dialogJs = [];
+
+	if ( CKEDITOR.env.ie && CKEDITOR.env.version <= 6 )
+	{
+		// For IE6, we need to preload some images, otherwhise they will be
+		// downloaded several times (CSS background bug).
+		preload.push( 'icons.gif', 'images/sprites.gif', 'images/dialog.sides.gif' );
+
+		// The dialog must be fixed by code in IE6, as it doesn't support
+		// several CSS features (absolute positioning).
+		// dialogJs.push( 'dialog_ie6.js' );
+	}
+
+	return {
+		preload : preload,
+		editor : { css : [ 'editor.css' ] },
+		dialog : { css : [ 'dialog.css' ],  js : dialogJs }
+	};
+})() );
+
+(function()
+{
+	// Define the function for resizing dialog parts at load to speed up
+	// the actual resize operation.
+	var skinName = 'default',
+		setSize = function( dialog, partName, width, height )
+		{
+			var element = partName ? dialog.parts[partName] : dialog._.element.getFirst();
+			if ( width )
+				element.setStyle( 'width', width + 'px' );
+			if ( height )
+				element.setStyle( 'height', height + 'px' );
+		};
+
+	if ( CKEDITOR.dialog )
+	{
+		CKEDITOR.dialog.setMargins( 0, 14, 18, 14 );
+
+		CKEDITOR.dialog.on( 'resize', function( evt )
+			{
+				var data = evt.data,
+					width = data.width,
+					height = data.height,
+					dialog = data.dialog,
+					standardsMode = ( CKEDITOR.document.$.compatMode == 'CSS1Compat' );
+				if ( data.skin != skinName )
+					return;
+
+				// Dialog parts dimensions.
+				//  16x16  |  ?x16  |  16x16
+				//  16x?   |  ?x?   |  16x?
+				//  30x51  |  ?x51  |  30x51
+				setSize( dialog, 't', width - 32, 16 );
+				setSize( dialog, 't_resize', width - 32, null );
+				setSize( dialog, 'l', 16, height - 67 );
+				setSize( dialog, 'l_resize', null, height - 22 );
+				setSize( dialog, 'c', width - 32, height - 67 );
+				setSize( dialog, 'r', 16, height - 67 );
+				setSize( dialog, 'r_resize', null, height - 22 );
+				setSize( dialog, 'b', width - 60, 51 );
+				setSize( dialog, 'b_resize', width - 32, null );
+				setSize( dialog, 'tabs_table', width - 32, null );
+
+				/*
+				 * Although the following fix seems to be for IE6 only, it's also for IE7.
+				 * While IE7 can render DIV nodes with left: and right: defined, it cannot
+				 * put 100% height TABLES correctly inside those DIVs. Unless the width is
+				 * set as well.
+				 */
+				if ( CKEDITOR.env.ie )
+				{
+					var contentWidth = width - 34,
+						contentHeight = dialog.getPageCount() > 1 ? height - 106 : height - 84,
+						contentsLength = dialog.parts.contents.getChildCount();
+
+					if ( !standardsMode )
+					{
+						contentWidth += 2;
+						contentHeight += 2;
+						dialog.parts.tabs.setStyle( 'top', '33px' );
+					}
+
+					setSize( dialog, 'title', standardsMode ? width - 52 : width - 32, standardsMode ? null : 31 );
+					setSize( dialog, 'contents', contentWidth, contentHeight );
+					setSize( dialog, 'footer', width - 32);
+
+					for ( var i = 0 ; i < contentsLength ; i++ )
+					{
+						var child = dialog.parts.contents.getChild( i );
+						if ( ( child instanceof CKEDITOR.dom.element ) && ( child.$.className || '' ).search( 'cke_dialog_page_contents' ) > -1 )
+							child.setStyles(
+								{
+									width : contentWidth - ( standardsMode ? 20 : 0 ) + 'px',
+									height : contentHeight - ( standardsMode ? 20 : 0 ) + 'px'
+								} );
+					}
+				}
+
+				setSize( dialog, null, width, height );
+			});
+	}
+})();
Index: /CKEditor/tags/3.0 Beta/_source/skins/default/toolbar.css
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/skins/default/toolbar.css	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/skins/default/toolbar.css	(revision 3046)
@@ -0,0 +1,307 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+@media print
+{
+	.cke_toolbox
+	{
+		display: none;
+	}
+}
+
+.cke_skin_default .cke_toolbar
+{
+	padding: 5px;
+	display:inline-block;
+}
+
+.cke_skin_default .cke_separator
+{
+	display:block;
+	float:left;
+	border-left: solid 1px #999;
+	margin: 2px;
+	height:20px;
+}
+
+.cke_skin_default.cke_rtl .cke_separator
+{
+	float:right;
+}
+
+.cke_skin_default a.cke_button
+{
+	border: solid 1px #efefde;
+	background-color: #efefde;
+	padding-top: 2px;
+	padding-bottom: 2px;
+	padding-left: 4px;
+	padding-right: 4px;
+	filter: alpha(opacity=70); /* IE */
+	opacity: 0.70; /* Safari, Opera and Mozilla */
+	display:block;
+	float: left;
+	height: 18px;
+}
+
+.cke_skin_default.cke_rtl a.cke_button
+{
+	float: right;
+}
+
+.cke_skin_default a.cke_button.cke_on
+{
+	background-color: #a3d7ff;
+	border: solid 1px #316ac5;
+	filter: alpha(opacity=100); /* IE */
+	opacity: 1; /* Safari, Opera and Mozilla */
+	-moz-border-radius: 3px;
+	-webkit-border-radius: 3px;
+	border-radius: 3px;
+}
+
+.cke_skin_default a.cke_button.cke_disabled
+{
+	filter: alpha(opacity=30); /* IE */
+	opacity : 0.3; /* Safari, Opera and Mozilla */
+}
+
+/* IE6 BUG: Hover removes the padding and border, for some unknown reason. */
+.cke_skin_default.cke_browser_ie a:hover.cke_button.cke_disabled
+{
+	padding: 2px 4px;
+	border: solid 1px #efefde;
+}
+
+.cke_skin_default a:hover.cke_button.cke_on,
+.cke_skin_default a:focus.cke_button.cke_on,
+.cke_skin_default a:active.cke_button.cke_on,	/* IE */
+.cke_skin_default a:hover.cke_button.cke_off,
+.cke_skin_default a:focus.cke_button.cke_off,
+.cke_skin_default a:active.cke_button.cke_off	/* IE */
+{
+	border: solid 1px #316ac5;
+	background-color: #dff1ff;
+	padding-top: 2px;
+	padding-bottom: 2px;
+	padding-left: 4px;
+	padding-right: 4px;
+	filter: alpha(opacity=100); /* IE */
+	opacity: 1; /* Safari, Opera and Mozilla */
+	display:block;
+	float: left;
+	height: 18px;
+	outline: none;
+	-moz-border-radius: 3px;
+	-webkit-border-radius: 3px;
+	border-radius: 3px;
+}
+
+.cke_skin_default.cke_rtl a:hover.cke_button.cke_on,
+.cke_skin_default.cke_rtl a:hover.cke_button.cke_off
+{
+	float: right;
+}
+
+.cke_skin_default a.cke_button .cke_icon
+{
+	background-image: url(icons.gif);
+	background-position: 100px;
+	background-repeat:no-repeat;
+	margin-top:1px;
+	width: 16px;
+	height: 16px;
+	display: block;
+	float: left;
+}
+
+.cke_skin_default.cke_rtl a.cke_button .cke_icon
+{
+	float: right;
+}
+
+.cke_skin_default a.cke_button .cke_label
+{
+	display: none;
+	float: left;
+	height: 14px;
+	padding-left: 3px;
+	padding-top:3px;
+}
+
+.cke_skin_default.cke_rtl a.cke_button .cke_label
+{
+	float: right;
+}
+
+.cke_skin_default a.cke_button_source .cke_icon
+{
+	background-position: 0 0;
+}
+
+.cke_skin_default a.cke_button_source .cke_label
+{
+	display: inline;
+}
+
+.cke_skin_default a.cke_button_newpage .cke_icon
+{
+	background-position: 0 -48px;
+}
+
+.cke_skin_default a.cke_button_find .cke_icon
+{
+	background-position: 0 -240px;
+}
+
+.cke_skin_default a.cke_button_replace .cke_icon
+{
+	background-position: 0 -256px;
+}
+
+.cke_skin_default a.cke_button_selectAll .cke_icon
+{
+	background-position: 0 -272px;
+}
+
+.cke_skin_default a.cke_button_removeFormat .cke_icon
+{
+	background-position: 0 -288px;
+}
+
+.cke_skin_default a.cke_button_bold .cke_icon
+{
+	background-position: 0 -304px;
+}
+
+.cke_skin_default a.cke_button_italic .cke_icon
+{
+	background-position: 0 -320px;
+}
+
+.cke_skin_default a.cke_button_underline .cke_icon
+{
+	background-position: 0 -336px;
+}
+
+.cke_skin_default a.cke_button_strike .cke_icon
+{
+	background-position: 0 -352px;
+}
+
+.cke_skin_default a.cke_button_subscript .cke_icon
+{
+	background-position: 0 -368px;
+}
+
+.cke_skin_default a.cke_button_superscript .cke_icon
+{
+	background-position: 0 -384px;
+}
+
+.cke_skin_default a.cke_button_table .cke_icon
+{
+	background-position: 0 -608px;
+}
+
+.cke_skin_default a.cke_button_horizontalrule .cke_icon
+{
+	background-position: 0 -624px;
+}
+
+.cke_skin_default a.cke_button_smiley .cke_icon
+{
+	background-position: 0 -640px;
+}
+
+.cke_skin_default a.cke_button_link .cke_icon
+{
+	background-position: 0 -528px;
+}
+
+.cke_skin_default a.cke_button_unlink .cke_icon
+{
+	background-position: 0 -544px;
+}
+
+.cke_skin_default a.cke_button_anchor .cke_icon
+{
+	background-position: 0 -560px;
+}
+
+.cke_skin_default a.cke_button_image .cke_icon
+{
+	background-position: 0 -576px;
+}
+
+.cke_skin_default a.cke_button_flash .cke_icon
+{
+	background-position: 0 -592px;
+}
+
+.cke_skin_default a.cke_button_specialchar .cke_icon
+{
+	background-position: 0 -656px;
+}
+
+.cke_skin_default a.cke_button_pagebreak .cke_icon
+{
+	background-position: 0 -672px;
+}
+
+.cke_skin_default a.cke_button_print .cke_icon
+{
+	background-position: 0 -176px;
+}
+
+.cke_skin_default a.cke_button_pagebreak .cke_icon
+{
+	background-position: 0 -672px;
+}
+
+.cke_skin_default a.cke_button_form .cke_icon
+{
+	background-position: 0 -752px;
+}
+
+.cke_skin_default a.cke_button_checkbox .cke_icon
+{
+	background-position: 0 -768px;
+}
+
+.cke_skin_default a.cke_button_radio .cke_icon
+{
+	background-position: 0 -784px;
+}
+
+.cke_skin_default a.cke_button_textfield .cke_icon
+{
+	background-position: 0 -800px;
+}
+
+.cke_skin_default a.cke_button_textarea .cke_icon
+{
+	background-position: 0 -816px;
+}
+
+.cke_skin_default a.cke_button_select .cke_icon
+{
+	background-position: 0 -832px;
+}
+
+.cke_skin_default a.cke_button_button .cke_icon
+{
+	background-position: 0 -848px;
+}
+
+.cke_skin_default a.cke_button_imagebutton .cke_icon
+{
+	background-position: 0 -864px;
+}
+
+.cke_skin_default a.cke_button_hiddenfield .cke_icon
+{
+	background-position: 0 -880px;
+}
Index: /CKEditor/tags/3.0 Beta/_source/tests/_assets/sample.css
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/tests/_assets/sample.css	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/tests/_assets/sample.css	(revision 3046)
@@ -0,0 +1,4 @@
+﻿.sample
+{
+	position: absolute;
+}
Index: /CKEditor/tags/3.0 Beta/_source/tests/_assets/sample.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/tests/_assets/sample.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/tests/_assets/sample.js	(revision 3046)
@@ -0,0 +1,1 @@
+﻿var testVar = 'Test!';
Index: /CKEditor/tags/3.0 Beta/_source/tests/_assets/sample.txt
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/tests/_assets/sample.txt	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/tests/_assets/sample.txt	(revision 3046)
@@ -0,0 +1,1 @@
+Sample Text
Index: /CKEditor/tags/3.0 Beta/_source/tests/_assets/sample.xml
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/tests/_assets/sample.xml	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/tests/_assets/sample.xml	(revision 3046)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<list>
+	<item id="test1" />
+	<item id="test2" />
+</list>
Index: /CKEditor/tags/3.0 Beta/_source/tests/_assets/sample_xml.txt
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/tests/_assets/sample_xml.txt	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/tests/_assets/sample_xml.txt	(revision 3046)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<list>
+	<item id="test1" />
+	<item id="test2" />
+</list>
Index: /CKEditor/tags/3.0 Beta/_source/tests/core/_editor/custom_config_1.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/tests/core/_editor/custom_config_1.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/tests/core/_editor/custom_config_1.js	(revision 3046)
@@ -0,0 +1,10 @@
+/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+CKEDITOR.editorConfig = function( config )
+{
+	config.customConfig = '_editor/custom_config_2.js';
+	config.test_custom1 = 'Ok';
+};
Index: /CKEditor/tags/3.0 Beta/_source/tests/core/_editor/custom_config_2.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/tests/core/_editor/custom_config_2.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/tests/core/_editor/custom_config_2.js	(revision 3046)
@@ -0,0 +1,9 @@
+/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+CKEDITOR.editorConfig = function( config )
+{
+	config.test_custom2 = 'Ok';
+};
Index: /CKEditor/tags/3.0 Beta/_source/tests/core/ajax.html
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/tests/core/ajax.html	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/tests/core/ajax.html	(revision 3046)
@@ -0,0 +1,149 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>CKEDITOR.ajax</title>
+	<link rel="stylesheet" type="text/css" href="../test.css" />
+	<script type="text/javascript" src="../../../ckeditor_source.js"></script> <!-- %REMOVE_LINE%
+	<script type="text/javascript" src="../../ckeditor.js"></script>
+	<script type="text/javascript" src="../../_source/core/loader.js"></script>
+	%REMOVE_LINE% -->
+	<script type="text/javascript" src="../test.js"></script>
+	<script type="text/javascript">
+	//<![CDATA[
+
+CKEDITOR.loader.load( 'core/ajax' );
+
+	//]]>
+	</script>
+	<script type="text/javascript">
+	//<![CDATA[
+
+CKEDITOR.test.addTestCase( (function()
+{
+	// Local reference to the "assert" object.
+	var assert = CKEDITOR.test.assert;
+
+	return {
+		test_load_sync : function()
+		{
+			var data = CKEDITOR.ajax.load( '../_assets/sample.txt' );
+			assert.areSame( 'Sample Text\r\n', data, 'The loaded data doesn\'t match' );
+		},
+
+		test_load_sync_404 : function()
+		{
+			var data = CKEDITOR.ajax.load( '../_assets/404.txt' );
+			assert.isNull( data );
+		},
+
+		test_load_async : function()
+		{
+			var testCase = this;
+			var callback = function( data )
+			{
+				testCase.resume( function()
+					{
+						assert.areSame( 'Sample Text\r\n', data, 'The loaded data doesn\'t match' );
+					} );
+			};
+
+			CKEDITOR.ajax.load( '../_assets/sample.txt', callback );
+			this.wait();
+		},
+
+		test_load_async_404 : function()
+		{
+			var testCase = this;
+			var callback = function( data )
+			{
+				testCase.resume( function()
+					{
+						assert.isNull( data );
+					} );
+			};
+
+			CKEDITOR.ajax.load( '../_assets/404.txt', callback );
+			this.wait();
+		},
+
+		test_loadXml_sync : function()
+		{
+			var data = CKEDITOR.ajax.loadXml( '../_assets/sample.xml' );
+			assert.isInstanceOf( CKEDITOR.xml, data );
+			assert.isNotNull( data.selectSingleNode( '//list/item' ), 'The loaded data doesn\'t match (null)' );
+			assert.isNotUndefined( data.selectSingleNode( '//list/item' ), 'The loaded data doesn\'t match (undefined)' );
+		},
+
+		test_loadXml_sync_404 : function()
+		{
+			var data = CKEDITOR.ajax.loadXml( '../_assets/404.xml' );
+			assert.isNull( data );
+		},
+
+		test_loadXml_async : function()
+		{
+			var testCase = this;
+			var callback = function( data )
+			{
+				testCase.resume( function()
+					{
+						assert.isInstanceOf( CKEDITOR.xml, data );
+						assert.isNotNull( data.selectSingleNode( '//list/item' ), 'The loaded data doesn\'t match (null)' );
+						assert.isNotUndefined( data.selectSingleNode( '//list/item' ), 'The loaded data doesn\'t match (undefined)' );
+					} );
+			};
+
+			CKEDITOR.ajax.loadXml( '../_assets/sample.xml', callback );
+			this.wait();
+		},
+
+		test_loadXml_async_404 : function()
+		{
+			var testCase = this;
+			var callback = function( data )
+			{
+				testCase.resume( function()
+					{
+						assert.isNull( data );
+					} );
+			};
+
+			CKEDITOR.ajax.loadXml( '../_assets/404.xml', callback );
+			this.wait();
+		},
+
+		test_loadXml_sync_txt : function()
+		{
+			var data = CKEDITOR.ajax.loadXml( '../_assets/sample_xml.txt' );
+			assert.isInstanceOf( CKEDITOR.xml, data );
+			assert.isNotNull( data.selectSingleNode( '//list/item' ), 'The loaded data doesn\'t match (null)' );
+			assert.isNotUndefined( data.selectSingleNode( '//list/item' ), 'The loaded data doesn\'t match (undefined)' );
+		},
+
+		test_loadXml_async_txt : function()
+		{
+			var testCase = this;
+			var callback = function( data )
+			{
+				testCase.resume( function()
+					{
+						assert.isInstanceOf( CKEDITOR.xml, data );
+						assert.isNotNull( data.selectSingleNode( '//list/item' ), 'The loaded data doesn\'t match (null)' );
+						assert.isNotUndefined( data.selectSingleNode( '//list/item' ), 'The loaded data doesn\'t match (undefined)' );
+					} );
+			};
+
+			CKEDITOR.ajax.loadXml( '../_assets/sample_xml.txt', callback );
+			this.wait();
+		},
+
+		name : document.title
+	};
+})() );
+
+	//]]>
+	</script>
+</head>
+<body>
+</body>
+</html>
Index: /CKEditor/tags/3.0 Beta/_source/tests/core/ckeditor.html
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/tests/core/ckeditor.html	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/tests/core/ckeditor.html	(revision 3046)
@@ -0,0 +1,148 @@
+﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>CKEDITOR</title>
+	<link rel="stylesheet" type="text/css" href="../test.css" />
+	<script type="text/javascript" src="../../../ckeditor_source.js"></script> <!-- %REMOVE_LINE%
+	<script type="text/javascript" src="../../ckeditor.js"></script>
+	%REMOVE_LINE% -->
+	<script type="text/javascript" src="../test.js"></script>
+	<script type="text/javascript">
+	//<![CDATA[
+
+CKEDITOR.test.addTestCase( (function()
+{
+	// Local reference to the "assert" object.
+	var assert = CKEDITOR.test.assert;
+
+	return {
+		test_replaceClass : function()
+		{
+			// Asserts the default value.
+			assert.areSame( 'ckeditor', CKEDITOR.replaceClass );
+		},
+
+		test_replaceByClassEnabled : function()
+		{
+			// Asserts the default value.
+			assert.isTrue( CKEDITOR.replaceByClassEnabled );
+		},
+
+		test_replaceId : function()
+		{
+			CKEDITOR.replace( 'editor1' );
+			assert.isObject( CKEDITOR.instances.editor1, 'editor instance not found' );
+			assert.areSame( 'editor1', CKEDITOR.instances.editor1.name, 'instance name doesn\'t match' );
+			assert.areSame( document.getElementById( 'editor1' ), CKEDITOR.instances.editor1.element.$, 'instance element doesn\'t match' );
+		},
+
+		test_replaceName : function()
+		{
+			CKEDITOR.replace( 'editor2' );
+			assert.isObject( CKEDITOR.instances.editor2, 'editor instance not found' );
+			assert.areSame( 'editor2', CKEDITOR.instances.editor2.name, 'instance name doesn\'t match' );
+			assert.areSame( document.getElementsByName( 'editor2' )[0], CKEDITOR.instances.editor2.element.$, 'instance element doesn\'t match' );
+		},
+
+		test_replaceElement : function()
+		{
+			CKEDITOR.replace( document.getElementById( 'editor5' ) );
+			assert.isObject( CKEDITOR.instances.editor5, 'editor instance not found' );
+			assert.areSame( 'editor5', CKEDITOR.instances.editor5.name, 'instance name doesn\'t match' );
+			assert.areSame( document.getElementById( 'editor5' ), CKEDITOR.instances.editor5.element.$, 'instance element doesn\'t match' );
+		},
+
+
+		test_replaceError : function()
+		{
+			try
+			{
+				CKEDITOR.replace( 'error' );
+			}
+			catch ( e )
+			{
+				assert.areSame( '[CKEDITOR.editor.replace] The element with id or name "error" was not found.', e );
+			}
+		},
+
+		test_replaceAll_Class : function()
+		{
+			CKEDITOR.replaceAll( 'myclass' );
+
+			assert.isObject( CKEDITOR.instances.editor3, 'editor3 instance not found' );
+			assert.areSame( 'editor3', CKEDITOR.instances.editor3.name, 'editor3 instance name doesn\'t match' );
+			assert.areSame( document.getElementById( 'editor3' ), CKEDITOR.instances.editor3.element.$, 'editor3 instance element doesn\'t match' );
+
+			assert.isObject( CKEDITOR.instances.editor4, 'editor4 instance not found' );
+			assert.areSame( 'editor4', CKEDITOR.instances.editor4.name, 'editor4 instance name doesn\'t match' );
+			assert.areSame( document.getElementsByName( 'editor4' )[0], CKEDITOR.instances.editor4.element.$, 'editor4 instance element doesn\'t match' );
+
+			assert.isUndefined( CKEDITOR.instances.editor6, 'editor6 should be undefined' );
+			assert.isUndefined( CKEDITOR.instances.editor7, 'editor7 should be undefined' );
+			assert.isUndefined( CKEDITOR.instances.editor8, 'editor8 should be undefined' );
+			assert.isUndefined( CKEDITOR.instances.editor8, 'editor9 should be undefined' );
+		},
+
+		test_replaceAll_Function : function()
+		{
+			CKEDITOR.replaceAll( function( textarea )
+				{
+					return ( textarea.id != 'editor6' && textarea.id != 'editor8' );
+				} );
+
+			assert.isObject( CKEDITOR.instances.editor7, 'editor7 instance not found' );
+			assert.areSame( 'editor7', CKEDITOR.instances.editor7.name, 'editor7 instance name doesn\'t match' );
+			assert.areSame( document.getElementById( 'editor7' ), CKEDITOR.instances.editor7.element.$, 'editor7 instance element doesn\'t match' );
+
+			assert.isObject( CKEDITOR.instances.editor9, 'editor9 instance not found' );
+			assert.areSame( 'editor9', CKEDITOR.instances.editor9.name, 'editor9 instance name doesn\'t match' );
+			assert.areSame( document.getElementById( 'editor9' ), CKEDITOR.instances.editor9.element.$, 'editor9 instance element doesn\'t match' );
+
+			assert.isUndefined( CKEDITOR.instances.editor6, 'editor6 should be undefined' );
+			assert.isUndefined( CKEDITOR.instances.editor8, 'editor8 should be undefined' );
+		},
+
+		test_replaceAll : function()
+		{
+			CKEDITOR.replaceAll();
+
+			assert.isObject( CKEDITOR.instances.editor6, 'editor6 instance not found' );
+			assert.areSame( 'editor6', CKEDITOR.instances.editor6.name, 'editor6 instance name doesn\'t match' );
+			assert.areSame( document.getElementById( 'editor6' ), CKEDITOR.instances.editor6.element.$, 'editor6 instance element doesn\'t match' );
+
+			assert.isObject( CKEDITOR.instances.editor8, 'editor8 editor instance not found' );
+			assert.areSame( 'editor8', CKEDITOR.instances.editor8.name, 'editor8 instance name doesn\'t match' );
+			assert.areSame( document.getElementById( 'editor8' ), CKEDITOR.instances.editor8.element.$, 'editor8 instance element doesn\'t match' );
+		},
+
+		test_add : function()
+		{
+			var textarea = CKEDITOR.dom.element.createFromHtml( '<textarea id="test_add">&lt;p&gt;test_add&lt;/p&gt;<\/textarea>' );
+			textarea.appendTo( new CKEDITOR.dom.element( document.body ) );
+
+			var editor = new CKEDITOR.editor( {}, textarea, CKEDITOR.ELEMENT_MODE_REPLACE );
+
+			CKEDITOR.add( editor );
+
+			assert.areSame( editor, CKEDITOR.instances.test_add );
+		},
+
+		name : document.title
+	};
+})() );
+
+	//]]>
+	</script>
+</head>
+<body>
+	<textarea id="editor1" cols="80" rows="10"></textarea>
+	<textarea name="editor2" cols="80" rows="10"></textarea>
+	<textarea id="editor3" name="editor3" class="myclass" cols="80" rows="10"></textarea>
+	<textarea name="editor4" class="myclass" cols="80" rows="10"></textarea>
+	<textarea id="editor5" cols="80" rows="10"></textarea>
+	<textarea id="editor6" cols="80" rows="10"></textarea>
+	<textarea id="editor7" cols="80" rows="10"></textarea>
+	<textarea id="editor8" cols="80" rows="10"></textarea>
+	<textarea id="editor9" cols="80" rows="10"></textarea>
+</body>
+</html>
Index: /CKEditor/tags/3.0 Beta/_source/tests/core/ckeditor2.html
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/tests/core/ckeditor2.html	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/tests/core/ckeditor2.html	(revision 3046)
@@ -0,0 +1,56 @@
+﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>CKEDITOR 2</title>
+	<link rel="stylesheet" type="text/css" href="../test.css" />
+	<script type="text/javascript" src="../../../ckeditor_source.js"></script> <!-- %REMOVE_LINE%
+	<script type="text/javascript" src="../../ckeditor.js"></script>
+	%REMOVE_LINE% -->
+	<script type="text/javascript" src="../test.js"></script>
+	<script type="text/javascript">
+	//<![CDATA[
+
+var before_loadFullCore = CKEDITOR.status;
+
+CKEDITOR.loadFullCore();
+
+	//]]>
+	</script>
+	<script type="text/javascript">
+	//<![CDATA[
+
+CKEDITOR.test.addTestCase( (function()
+{
+	// Local reference to the "assert" object.
+	var assert = CKEDITOR.test.assert;
+
+	return {
+		test_status1 : function()
+		{
+			assert.areSame( 'basic_loaded', before_loadFullCore );
+		},
+
+		test_status2 : function()
+		{
+			var testCase = this;
+			CKEDITOR.on( 'loaded', function()
+				{
+					testCase.resume( function()
+						{
+							assert.areSame( 'loaded', CKEDITOR.status );
+						});
+				});
+
+			this.wait();
+		},
+
+		name : document.title
+	};
+})() );
+
+	//]]>
+	</script>
+</head>
+<body>
+</body>
+</html>
Index: /CKEditor/tags/3.0 Beta/_source/tests/core/dom/document.html
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/tests/core/dom/document.html	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/tests/core/dom/document.html	(revision 3046)
@@ -0,0 +1,103 @@
+﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>CKEDITOR.dom.document</title>
+	<link rel="stylesheet" type="text/css" href="../../test.css" />
+	<script type="text/javascript" src="../../../../ckeditor_source.js"></script> <!-- %REMOVE_LINE%
+	<script type="text/javascript" src="../../../ckeditor.js"></script>
+	%REMOVE_LINE% -->
+	<script type="text/javascript" src="../../test.js"></script>
+	<script type="text/javascript">
+	//<![CDATA[
+
+CKEDITOR.test.addTestCase( (function()
+{
+	// Local reference to the "assert" object.
+	var assert = CKEDITOR.test.assert;
+
+	return {
+		test_$ : function()
+		{
+			var doc = new CKEDITOR.dom.document( document );
+			assert.areSame( document, doc.$ );
+		},
+
+		test_appendStyleSheet : function()
+		{
+			var cssUrl = CKEDITOR.basePath + '_source/tests/_assets/sample.css';
+
+			var doc = new CKEDITOR.dom.document( document );
+			doc.appendStyleSheet( cssUrl );
+
+			var links = document.getElementsByTagName( 'link' );
+
+			for ( var i = 0 ; i < links.length ; i++ )
+			{
+				if ( links[i].href == cssUrl )
+					return ;
+			}
+
+			assert.fail( 'The link element was not found' );
+		},
+
+		test_equals1 : function()
+		{
+			// Actually checks the real need for equals().
+			var doc1 = new CKEDITOR.dom.document( document );
+			assert.isFalse( doc1 == document );
+		},
+
+		test_equals2 : function()
+		{
+			// Actually checks the real need for equals().
+			var doc1 = new CKEDITOR.dom.document( document );
+			var doc2 = new CKEDITOR.dom.document( document );
+			assert.isFalse( doc1 == doc2, 'doc1 == doc2' );
+		},
+
+		test_equals3 : function()
+		{
+			var doc1 = new CKEDITOR.dom.document( document );
+			var doc2 = new CKEDITOR.dom.document( document );
+			assert.isTrue( doc1.equals( doc2 ), 'doc1.equals( doc2 )' );
+			assert.isTrue( doc2.equals( doc1 ), 'doc2.equals( doc1 )' );
+		},
+
+		test_getById1 : function()
+		{
+			var doc = new CKEDITOR.dom.document( document );
+			var element = doc.getById( 'test1' );
+			assert.areSame( document.getElementById( 'test1' ), element.$ );
+		},
+
+		test_getById2 : function()
+		{
+			var doc = new CKEDITOR.dom.document( document );
+			var element = doc.getById( 'test_invalid' );
+			assert.isNull( element );
+		},
+
+		test_getHead : function()
+		{
+			var doc = new CKEDITOR.dom.document( document );
+			assert.areSame( document.getElementsByTagName( 'head' )[0], doc.getHead().$ );
+		},
+
+		test_getBody : function()
+		{
+			var doc = new CKEDITOR.dom.document( document );
+			assert.areSame( document.body, doc.getBody().$, '1st call failed' );
+			assert.areSame( document.body, doc.getBody().$, '2nd call failed' );
+		},
+
+		name : document.title
+	};
+})() );
+
+	//]]>
+	</script>
+</head>
+<body>
+	<div id="test1"></div>
+</body>
+</html>
Index: /CKEditor/tags/3.0 Beta/_source/tests/core/dom/element.html
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/tests/core/dom/element.html	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/tests/core/dom/element.html	(revision 3046)
@@ -0,0 +1,519 @@
+﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>CKEDITOR.dom.element</title>
+	<link rel="stylesheet" type="text/css" href="../../test.css" />
+	<script type="text/javascript" src="../../../../ckeditor_source.js"></script> <!-- %REMOVE_LINE%
+	<script type="text/javascript" src="../../../ckeditor.js"></script>
+	%REMOVE_LINE% -->
+	<script type="text/javascript" src="../../test.js"></script>
+	<script type="text/javascript">
+	//<![CDATA[
+
+CKEDITOR.test.addTestCase( (function()
+{
+	// Local reference to the "assert" object.
+	var assert = CKEDITOR.test.assert;
+	var getInnerHtml = CKEDITOR.test.getInnerHtml;
+
+	return {
+		test_$ : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementById( 'test1' ) );
+			assert.areSame( document.getElementById( 'test1' ), element.$ );
+		},
+
+		test_getId1 : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementById( 'test1' ) );
+			assert.areEqual( 'test1', element.getId() );
+		},
+
+		test_getId2 : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementsByTagName( 'div' )[0] );
+			assert.isNull( element.getId() );
+		},
+
+		test_getNameAtt1 : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementsByName( 'named1' )[0] );
+			assert.areEqual( 'named1', element.getNameAtt() );
+		},
+
+		test_getNameAtt2 : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementById( 'test1' ) );
+			assert.isNull( element.getNameAtt() );
+		},
+
+		test_getName : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementById( 'test1' ) );
+			assert.areEqual( 'textarea', element.getName(), 'First call' );
+			assert.areEqual( 'textarea', element.getName(), 'Second call' );
+		},
+
+		test_hide : function()
+		{
+			var nativeElement = document.getElementById( 'test1' );
+			nativeElement.style.display = '';
+
+			var element = new CKEDITOR.dom.element( nativeElement );
+			element.hide();
+
+			assert.areEqual( 'none', nativeElement.style.display );
+		},
+
+		test_show : function()
+		{
+			var nativeElement = document.getElementById( 'test1' );
+			nativeElement.style.display = '';
+
+			var element = new CKEDITOR.dom.element( nativeElement );
+			element.show();
+
+			assert.areEqual( '', nativeElement.style.display );
+		},
+
+		test_createFromHtml : function()
+		{
+			var element = CKEDITOR.dom.element.createFromHtml( '<p>My test</p>' );
+			assert.areEqual( 'p', element.getName(), 'element name doesn\'t match' );
+			assert.areEqual( 'My test', element.$.innerHTML, 'the innerHTML doesn\'t match' );
+		},
+
+		test_append1 : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementById( 'append' ) );
+			element.append( new CKEDITOR.dom.element( 'b' ) );
+			assert.areEqual( 'b', document.getElementById( 'append' ).firstChild.nodeName.toLowerCase() );
+		},
+
+		test_append2 : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementById( 'append' ) );
+			element.append( 'i' );
+			assert.areEqual( 'i', document.getElementById( 'append' ).lastChild.nodeName.toLowerCase() );
+		},
+
+		test_appendText1 : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementById( 'append' ) );
+			element.setHtml( '' );
+			element.appendText( 'Test appendText' );
+			assert.areEqual( 'Test appendText', document.getElementById( 'append' ).innerHTML );
+		},
+
+		test_appendText2 : function()
+		{
+			var element = new CKEDITOR.dom.element( 'script' );
+			element.appendText( 'Test appendText' );
+			assert.areEqual( 'Test appendText', element.$.text );
+		},
+
+		test_setHtml : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementById( 'append' ) );
+			element.setHtml( '<b>Test</b>' );
+			assert.areEqual( '<b>test</b>', document.getElementById( 'append' ).innerHTML.toLowerCase(), 'First call doesn\'t match' );
+			element.setHtml( 'Another test' );
+			assert.areEqual( 'Another test', document.getElementById( 'append' ).innerHTML, 'Second call doesn\'t match' );
+		},
+
+		test_getDocument1 : function()
+		{
+			var element = new CKEDITOR.dom.element( 'div' );
+			assert.areSame( document, element.getDocument().$, 'First call' );
+			assert.areSame( document, element.getDocument().$, 'Second call' );
+		},
+
+		test_getDocument2 : function()
+		{
+			var element = new CKEDITOR.dom.element( document.body );
+			assert.areSame( document, element.getDocument().$, 'First call' );
+			assert.areSame( document, element.getDocument().$, 'Second call' );
+		},
+
+		test_getFirst1 : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementById( 'append' ) );
+			element.setHtml( '<b>Test</b>' );
+			var first = element.getFirst();
+			assert.areSame( 'b', first.getName() );
+		},
+
+		test_getFirst2 : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementById( 'append' ) );
+			element.setHtml( 'Test' );
+			var first = element.getFirst();
+			assert.areSame( 'Test', first.$.nodeValue );
+		},
+
+		test_getFirst3 : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementById( 'append' ) );
+			element.setHtml( '' );
+			var first = element.getFirst();
+			assert.isNull( first );
+		},
+
+		test_setAttribute1 : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementById( 'test1' ) );
+			element.setAttribute( 'class', 'Test' );
+
+			assert.areSame( 'Test', document.getElementById( 'test1' ).className );
+		},
+
+		test_setAttribute2 : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementById( 'test1' ) );
+			element.setAttribute( 'style', 'position: absolute;' );
+
+			assert.areEqual( 'position:absolute', document.getElementById( 'test1' ).style.cssText.replace( /[\s;]/g, '' ).toLowerCase() );
+		},
+
+		test_setAttribute3 : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementById( 'test1' ) );
+			element.setAttribute( 'name', 'TestName' );
+
+			assert.areEqual( 'TestName', document.getElementById( 'test1' ).name );
+		},
+
+		test_setAttribute4 : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementById( 'test1' ) );
+			element.setAttribute( 'rows', 5 );
+
+			assert.areEqual( 5, document.getElementById( 'test1' ).rows );
+		},
+
+		test_setAttributes : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementById( 'test2' ) );
+			element.setAttributes({
+				'class'	: 'Test',
+				'style'	: 'position: absolute;',
+				'name'	: 'TestName',
+				'rows'	: 5 });
+
+			assert.areSame( 'Test', document.getElementById( 'test1' ).className, 'class is wrong' );
+			assert.areEqual( 'position:absolute', document.getElementById( 'test1' ).style.cssText.replace( /[\s;]/g, '' ).toLowerCase(), 'style is wrong' );
+			assert.areEqual( 'TestName', document.getElementById( 'test1' ).name, 'name is wrong' );
+			assert.areEqual( 5, document.getElementById( 'test1' ).rows, 'rows is wrong' );
+		},
+
+		test_setStyle1 : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementById( 'setStyle' ) );
+			element.setStyle( 'position', 'absolute' );
+
+			assert.areEqual( 'absolute', document.getElementById( 'setStyle' ).style.position );
+		},
+
+		test_setStyle2 : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementById( 'setStyle' ) );
+			element.setStyle( 'float', 'right' );
+
+			assert.areEqual( 'right', document.getElementById( 'setStyle' ).style.cssFloat );
+		},
+
+		test_setStyles : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementById( 'setStyle' ) );
+			element.setStyles({
+					 'position' : 'absolute',
+					 'float' : 'right'
+				});
+
+			assert.areEqual( 'absolute', document.getElementById( 'setStyle' ).style.position );
+			assert.areEqual( 'right', document.getElementById( 'setStyle' ).style.cssFloat );
+		},
+
+		test_setText1 : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementById( 'setText' ) );
+			element.setText( 'A & B' );
+			assert.areSame( 'A &amp; B', document.getElementById( 'setText' ).innerHTML );
+		},
+
+		test_setText2 : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementById( 'setText' ) );
+			element.setText( 'C & D' );
+			assert.areSame( 'C &amp; D', document.getElementById( 'setText' ).innerHTML );
+		},
+
+		test_addClass1 : function()
+		{
+			var element = new CKEDITOR.dom.element( 'div' );
+			element.addClass( 'classA' );
+			assert.areSame( 'classA', element.$.className );
+		},
+
+		test_addClass2 : function()
+		{
+			var element = new CKEDITOR.dom.element( 'div' );
+			element.addClass( 'classA' );
+			element.addClass( 'classA' );
+			assert.areSame( 'classA', element.$.className );
+		},
+
+		test_addClass3 : function()
+		{
+			var element = new CKEDITOR.dom.element( 'div' );
+			element.addClass( 'classA' );
+			element.addClass( 'classB' );
+			element.addClass( 'classC' );
+			assert.areSame( 'classA classB classC', element.$.className );
+		},
+
+		test_addClass4 : function()
+		{
+			var element = new CKEDITOR.dom.element( 'div' );
+			element.addClass( 'classA' );
+			element.addClass( 'classB' );
+			element.addClass( 'classC' );
+			element.addClass( 'classA' );
+			element.addClass( 'classB' );
+			element.addClass( 'classC' );
+			assert.areSame( 'classA classB classC', element.$.className );
+		},
+
+		test_removeClass1 : function()
+		{
+			document.getElementById( 'removeClass' ).innerHTML = '';
+
+			var element = CKEDITOR.dom.element.createFromHtml( '<div class="classA"></div>' );
+			element.appendTo( new CKEDITOR.dom.element( document.getElementById( 'removeClass' ) ) );
+
+			assert.areSame( '<div class="classa"></div>', getInnerHtml( 'removeClass' ) );
+			element.removeClass( 'classA' );
+			assert.areSame( '<div></div>', getInnerHtml( 'removeClass' ) );
+		},
+
+		test_removeClass2 : function()
+		{
+			document.getElementById( 'removeClass' ).innerHTML = '';
+
+			var element = CKEDITOR.dom.element.createFromHtml( '<div class="classA classB classC classD"></div>' );
+			element.appendTo( new CKEDITOR.dom.element( document.getElementById( 'removeClass' ) ) );
+
+			assert.areSame( '<div class="classa classb classc classd"></div>', getInnerHtml( 'removeClass' ) );
+			element.removeClass( 'classA' );
+			assert.areSame( '<div class="classb classc classd"></div>', getInnerHtml( 'removeClass' ) );
+			element.removeClass( 'classC' );
+			assert.areSame( '<div class="classb classd"></div>', getInnerHtml( 'removeClass' ) );
+			element.removeClass( 'classD' );
+			assert.areSame( '<div class="classb"></div>', getInnerHtml( 'removeClass' ) );
+			element.removeClass( 'classB' );
+			assert.areSame( '<div></div>', getInnerHtml( 'removeClass' ) );
+		},
+
+		test_removeClass3 : function()
+		{
+			document.getElementById( 'removeClass' ).innerHTML = '';
+
+			var element = CKEDITOR.dom.element.createFromHtml( '<div class="classA classB"></div>' );
+			element.appendTo( new CKEDITOR.dom.element( document.getElementById( 'removeClass' ) ) );
+
+			assert.areSame( '<div class="classa classb"></div>', getInnerHtml( 'removeClass' ) );
+			element.removeClass( 'classXXX' );
+			assert.areSame( '<div class="classa classb"></div>', getInnerHtml( 'removeClass' ) );
+			element.removeClass( 'classB' );
+			assert.areSame( '<div class="classa"></div>', getInnerHtml( 'removeClass' ) );
+			element.removeClass( 'classYYY' );
+			assert.areSame( '<div class="classa"></div>', getInnerHtml( 'removeClass' ) );
+		},
+
+		test_removeAttribute1 : function()
+		{
+			document.getElementById( 'removeClass' ).innerHTML = '';
+
+			var element = CKEDITOR.dom.element.createFromHtml( '<div class="classA"></div>' );
+			element.appendTo( new CKEDITOR.dom.element( document.getElementById( 'removeClass' ) ) );
+
+			element.removeAttribute( 'class' );
+			assert.areSame( '<div></div>', getInnerHtml( 'removeClass' ) );
+		},
+
+		test_removeAttribute2 : function()
+		{
+			document.getElementById( 'removeClass' ).innerHTML = '';
+
+			var element = CKEDITOR.dom.element.createFromHtml( '<div style="position:absolute"></div>' );
+			element.appendTo( new CKEDITOR.dom.element( document.getElementById( 'removeClass' ) ) );
+
+			element.removeAttribute( 'style' );
+			assert.areSame( '<div></div>', getInnerHtml( 'removeClass' ) );
+		},
+
+		test_removeAttribute3 : function()
+		{
+			document.getElementById( 'removeClass' ).innerHTML = '';
+
+			var element = CKEDITOR.dom.element.createFromHtml( '<div title="Test"></div>' );
+			element.appendTo( new CKEDITOR.dom.element( document.getElementById( 'removeClass' ) ) );
+
+			element.removeAttribute( 'title' );
+			assert.areSame( '<div></div>', getInnerHtml( 'removeClass' ) );
+		},
+
+		test_remove : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementById( 'removeInner' ) );
+			element.remove();
+
+			assert.areSame( '', getInnerHtml( 'removeOuter' ) );
+		},
+
+		test_getAttribute_tabindex1 : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementById( 'tabIndex10' ) );
+			assert.areEqual( 10, element.getAttribute( 'tabindex' ) );
+		},
+
+		test_getAttribute_tabindex2 : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementById( 'tabIndexDef' ) );
+			assert.isNull( element.getAttribute( 'tabindex' ) );
+		},
+
+		test_getAttribute_tabindex3 : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementById( 'tabIndexInputDef' ) );
+			assert.isNull( element.getAttribute( 'tabindex' ) );
+		},
+
+		test_getAttribute_tabindex4 : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementById( 'tabIndexInput20' ) );
+			assert.areEqual( 20, element.getAttribute( 'tabindex' ) );
+		},
+
+		test_getAttribute_tabindex5 : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementById( 'tabIndexScriptDef' ) );
+			assert.areEqual( null, element.getAttribute( 'tabindex' ) );
+		},
+
+		test_getTabIndex1 : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementById( 'tabIndex10' ) );
+			assert.areSame( 10, element.getTabIndex() );
+		},
+
+		test_getTabIndex2 : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementById( 'tabIndexDef' ) );
+			assert.areSame( -1, element.getTabIndex() );
+		},
+
+		test_getTabIndex3 : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementById( 'tabIndexInputDef' ) );
+			assert.areSame( 0, element.getTabIndex() );
+		},
+
+		test_getTabIndex4 : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementById( 'tabIndexInput20' ) );
+			assert.areSame( 20, element.getTabIndex() );
+		},
+
+		test_getTabIndex5 : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementById( 'tabIndexScriptDef' ) );
+			assert.areSame( -1, element.getTabIndex() );
+		},
+
+		test_private1 : function()
+		{
+			var a = new CKEDITOR.dom.element( document.getElementById( 'test1' ) );
+			var b = new CKEDITOR.dom.element( document.getElementById( 'test1' ) );
+
+			assert.areSame( a._, b._ );
+		},
+
+		test_private2 : function()
+		{
+			var a = new CKEDITOR.dom.element( document.getElementById( 'test1' ) );
+			var b = new CKEDITOR.dom.element( document.getElementById( 'test2' ) );
+
+			assert.areNotSame( a._, b._ );
+		},
+
+		test_getText1 : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementById( 'getText' ) );
+
+			// IE gives us a different result, which is ok for us (see code comments).
+			if ( CKEDITOR.env.ie )
+				assert.areSame( 'Some \nsample text for testing', element.getText().replace( /\r\n|\r/g, '\n' ) );
+			else
+				assert.areSame( 'Some  sample text    for    testing', element.getText() );
+		},
+
+		test_getText2 : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementById( 'getText2' ).getElementsByTagName( 'b' )[0] );
+			assert.areSame( ' ', element.getText() );
+		},
+
+		test_getText3 : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementById( 'getText3' ) );
+
+			// IE gives us a different result, which is ok for us (see code comments).
+			if ( CKEDITOR.env.ie )
+				assert.areSame( 'A B', element.getText() );
+			else
+				assert.areSame( 'A\nB', element.getText().replace( /\r\n|\r/g, '\n' ) );
+		},
+
+		test_hasAttributes1 : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementsByTagName( 'big' )[0] );
+			assert.isFalse( element.hasAttributes() );
+		},
+
+		test_hasAttributes2 : function()
+		{
+			var element = new CKEDITOR.dom.element( document.getElementsByTagName( 'small' )[0] );
+			assert.isTrue( element.hasAttributes() );
+		},
+
+		name : document.title
+	};
+})() );
+
+	//]]>
+	</script>
+</head>
+<body>
+	<textarea id="test1" rows="10" cols="80"></textarea>
+	<textarea id="test2" rows="10" cols="80"></textarea>
+	<textarea name="named1" rows="10" cols="80"></textarea>
+	<div>Test</div>
+	<div id="append"></div>
+	<div id="setStyle"></div>
+	<div id="setText"></div>
+	<div id="removeClass"></div>
+	<div id="removeOuter"><b id="removeInner"></b></div>
+	<div id="tabIndex10" tabindex="10"></div>
+	<div id="tabIndexDef"></div>
+	<input id="tabIndexInputDef" />
+	<input id="tabIndexInput20" tabindex="20" />
+	<script id="tabIndexScriptDef" type="text/javascript"></script>
+	<div id="getText">Some <br /><b> sample text</b>    for <i>   testing</i></div>
+	<div id="getText2">A<b> </b>B</div>
+	<div id="getText3">A
+B</div>
+	<big>Test</big>
+	<small title="Testing">Test</small>
+</body>
+</html>
Index: /CKEditor/tags/3.0 Beta/_source/tests/core/dom/node.html
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/tests/core/dom/node.html	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/tests/core/dom/node.html	(revision 3046)
@@ -0,0 +1,128 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>CKEDITOR.dom.node</title>
+	<link rel="stylesheet" type="text/css" href="../../test.css" />
+	<script type="text/javascript" src="../../../../ckeditor_source.js"></script> <!-- %REMOVE_LINE%
+	<script type="text/javascript" src="../../../ckeditor.js"></script>
+	%REMOVE_LINE% -->
+	<script type="text/javascript" src="../../test.js"></script>
+	<script type="text/javascript">
+	//<![CDATA[
+
+CKEDITOR.test.addTestCase( (function()
+{
+	// Local reference to the "assert" object.
+	var assert = CKEDITOR.test.assert;
+
+	return {
+		test_getPosition1 : function()
+		{
+			var node1 = new CKEDITOR.dom.node( document.getElementsByTagName( 'h1' )[0] );
+			var node2 = new CKEDITOR.dom.node( document.getElementsByTagName( 'p' )[0] );
+
+			assert.areSame( CKEDITOR.POSITION_PRECEDING, node1.getPosition( node2 ) );
+		},
+
+		test_getPosition2 : function()
+		{
+			var node1 = new CKEDITOR.dom.node( document.getElementsByTagName( 'h1' )[0] );
+			var node2 = new CKEDITOR.dom.node( document.getElementsByTagName( 'p' )[0] );
+
+			assert.areSame( CKEDITOR.POSITION_FOLLOWING, node2.getPosition( node1 ) );
+		},
+
+		test_getPosition3 : function()
+		{
+			var node1 = new CKEDITOR.dom.node( document.getElementsByTagName( 'p' )[0] );
+			var node2 = new CKEDITOR.dom.node( document.getElementsByTagName( 'b' )[0] );
+
+			assert.areSame( CKEDITOR.POSITION_CONTAINS + CKEDITOR.POSITION_PRECEDING, node1.getPosition( node2 ) );
+		},
+
+		test_getPosition4 : function()
+		{
+			var node1 = new CKEDITOR.dom.node( document.getElementsByTagName( 'p' )[0] );
+			var node2 = new CKEDITOR.dom.node( document.getElementsByTagName( 'b' )[0] );
+
+			assert.areSame( CKEDITOR.POSITION_IS_CONTAINED + CKEDITOR.POSITION_FOLLOWING, node2.getPosition( node1 ) );
+		},
+
+		test_getPosition5 : function()
+		{
+			var node1 = new CKEDITOR.dom.node( document.getElementsByTagName( 'div' )[0] );
+			var node2 = new CKEDITOR.dom.node( document.getElementsByTagName( 'div' )[0] );
+
+			assert.areSame( CKEDITOR.POSITION_IDENTICAL, node1.getPosition( node2 ) );
+		},
+
+		test_getPosition6 : function()
+		{
+			var node1 = new CKEDITOR.dom.node( document.getElementsByTagName( 'h1' )[0] );
+			var node2 = new CKEDITOR.dom.node( document.getElementsByTagName( 'h1' )[0].firstChild );
+
+			assert.areSame( CKEDITOR.POSITION_CONTAINS + CKEDITOR.POSITION_PRECEDING, node1.getPosition( node2 ) );
+		},
+
+		test_getPosition7 : function()
+		{
+			var node1 = new CKEDITOR.dom.node( document.getElementsByTagName( 'h1' )[0] );
+			var node2 = new CKEDITOR.dom.node( document.getElementsByTagName( 'h1' )[0].firstChild );
+
+			assert.areSame( CKEDITOR.POSITION_IS_CONTAINED + CKEDITOR.POSITION_FOLLOWING, node2.getPosition( node1 ) );
+		},
+
+		test_getPosition8 : function()
+		{
+			var node1 = new CKEDITOR.dom.node( document.getElementsByTagName( 'h1' )[0].firstChild );
+			var node2 = new CKEDITOR.dom.node( document.getElementsByTagName( 'b' )[0].firstChild );
+
+			assert.areSame( CKEDITOR.POSITION_PRECEDING, node1.getPosition( node2 ) );
+		},
+
+		test_getPosition9 : function()
+		{
+			var node1 = new CKEDITOR.dom.node( document.getElementsByTagName( 'h1' )[0].firstChild );
+			var node2 = new CKEDITOR.dom.node( document.getElementsByTagName( 'b' )[0].firstChild );
+
+			assert.areSame( CKEDITOR.POSITION_FOLLOWING, node2.getPosition( node1 ) );
+		},
+
+		test_getPosition10 : function()
+		{
+			var node1 = new CKEDITOR.dom.node( document.getElementsByTagName( 'b' )[0] );
+			var node2 = new CKEDITOR.dom.node( document.getElementsByTagName( 'i' )[0] );
+
+			assert.areSame( CKEDITOR.POSITION_PRECEDING, node1.getPosition( node2 ) );
+		},
+
+		test_getPosition11 : function()
+		{
+			var node1 = new CKEDITOR.dom.node( document.getElementsByTagName( 'b' )[0] );
+			var node2 = new CKEDITOR.dom.node( document.getElementsByTagName( 'i' )[0] );
+
+			assert.areSame( CKEDITOR.POSITION_FOLLOWING, node2.getPosition( node1 ) );
+		},
+
+		name : document.title
+	};
+})() );
+
+//window.onload = function()
+//{
+//	var node1 = new CKEDITOR.dom.node( document.getElementsByTagName( 'h1' )[0] );
+//	var node2 = new CKEDITOR.dom.node( document.getElementsByTagName( 'p' )[0] );
+//
+//	alert( node1.getPosition( node2 ) );
+//};
+
+	//]]>
+	</script>
+</head>
+<body>
+	<div>
+		<h1>Title</h1>
+		<p><b>Sample</b> <i>Text</i></p>
+	</div>
+</body>
+</html>
Index: /CKEditor/tags/3.0 Beta/_source/tests/core/dom/range.html
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/tests/core/dom/range.html	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/tests/core/dom/range.html	(revision 3046)
@@ -0,0 +1,1682 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>CKEDITOR.dom.range</title>
+	<link rel="stylesheet" type="text/css" href="../../test.css" />
+	<script type="text/javascript" src="../../../../ckeditor_source.js"></script> <!-- %REMOVE_LINE%
+	<script type="text/javascript" src="../../../ckeditor.js"></script>
+	%REMOVE_LINE% -->
+	<script type="text/javascript" src="../../test.js"></script>
+	<script type="text/javascript">
+	//<![CDATA[
+
+var html1, html2;
+
+CKEDITOR.test.addTestCase( (function()
+{
+	// Local references.
+	var assert			= CKEDITOR.test.assert;
+	var getInnerHtml	= CKEDITOR.test.getInnerHtml;
+
+	var doc = new CKEDITOR.dom.document( document );
+
+	return {
+		test__constructor : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+
+			assert.isNotNull( range, 'range must not be null' );
+
+			assert.isNull( range.startContainer, 'startContainer must be null' );
+			assert.isNull( range.startOffset, 'startOffset must be null' );
+			assert.isNull( range.endContainer, 'endContainer must be null' );
+			assert.isNull( range.endOffset, 'endOffset must be null' );
+
+			assert.isTrue( range.collapsed, 'range must be collapsed' );
+		},
+
+		test_setStart : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( 'playground' ), 1 );
+
+			assert.areSame( document.getElementById( 'playground' ), range.startContainer.$ );
+			assert.areSame( 1, range.startOffset );
+			assert.areSame( document.getElementById( 'playground' ), range.endContainer.$ );
+			assert.areSame( 1, range.endOffset, 'range.endOffset' );
+			assert.isTrue( range.collapsed );
+		},
+
+		test_setEnd : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+			range.setEnd( doc.getById( 'playground' ), 1 );
+
+			assert.areSame( document.getElementById( 'playground' ), range.startContainer.$ );
+			assert.areSame( 1, range.startOffset );
+			assert.areSame( document.getElementById( 'playground' ), range.endContainer.$ );
+			assert.areSame( 1, range.endOffset, 'range.endOffset' );
+			assert.isTrue( range.collapsed );
+		},
+
+		test_setStartAfter : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStartAfter( doc.getById( '_B' ) );
+			range.setStartAfter( doc.getById( '_H1' ).getFirst() );
+
+			assert.areSame( document.getElementById( '_H1' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 1, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_Para' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 2, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_setStartBefore : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStartBefore( doc.getById( '_B' ) );
+			range.setStartBefore( doc.getById( '_H1' ).getFirst() );
+
+			assert.areSame( document.getElementById( '_H1' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 0, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_Para' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 1, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_setEndAfter : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+			range.setEndAfter( doc.getById( '_H1' ).getFirst() );
+			range.setEndAfter( doc.getById( '_B' ) );
+
+			assert.areSame( document.getElementById( '_H1' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 1, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_Para' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 2, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_setEndBefore : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+			range.setEndBefore( doc.getById( '_H1' ).getFirst() );
+			range.setEndBefore( doc.getById( '_B' ) );
+
+			assert.areSame( document.getElementById( '_H1' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 0, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_Para' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 1, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_setStartAt_1 : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStartAt( doc.getById('_Span'), CKEDITOR.POSITION_AFTER_START );
+
+			assert.areSame( document.getElementById('_Span'), range.startContainer.$, 'startContainer' );
+			assert.areSame( document.getElementById('_Span'), range.endContainer.$, 'endContainer' );
+			assert.isTrue( range.collapsed, 'collapsed' );
+		},
+
+		test_setStartAt_2 : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStartAt( doc.getById('_Span'), CKEDITOR.POSITION_BEFORE_END );
+
+			assert.areSame( document.getElementById('_Span'), range.startContainer.$, 'startContainer' );
+			assert.areSame( document.getElementById('_Span'), range.endContainer.$, 'endContainer' );
+			assert.isTrue( range.collapsed, 'collapsed' );
+		},
+
+		test_setStartAt_3 : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStartAt( doc.getById('_Span'), CKEDITOR.POSITION_BEFORE_START );
+
+			assert.areSame( document.getElementById('_P'), range.startContainer.$, 'startContainer' );
+			assert.areSame( document.getElementById('_P'), range.endContainer.$, 'endContainer' );
+			assert.isTrue( range.collapsed, 'collapsed' );
+		},
+
+		test_setStartAt_4 : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStartAt( doc.getById('_Span'), CKEDITOR.POSITION_AFTER_END );
+
+			assert.areSame( document.getElementById('_P'), range.startContainer.$, 'startContainer' );
+			assert.areSame( document.getElementById('_P'), range.endContainer.$, 'endContainer' );
+			assert.isTrue( range.collapsed, 'collapsed' );
+		},
+
+		test_setEndAt_1 : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+			range.setEndAt( doc.getById('_Span'), CKEDITOR.POSITION_AFTER_START );
+
+			assert.areSame( document.getElementById('_Span'), range.startContainer.$, 'startContainer' );
+			assert.areSame( document.getElementById('_Span'), range.endContainer.$, 'endContainer' );
+			assert.isTrue( range.collapsed, 'collapsed' );
+		},
+
+		test_setEndAt_2 : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+			range.setEndAt( doc.getById('_Span'), CKEDITOR.POSITION_BEFORE_END );
+
+			assert.areSame( document.getElementById('_Span'), range.startContainer.$, 'startContainer' );
+			assert.areSame( document.getElementById('_Span'), range.endContainer.$, 'endContainer' );
+			assert.isTrue( range.collapsed, 'collapsed' );
+		},
+
+		test_setEndAt_3 : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+			range.setEndAt( doc.getById('_Span'), CKEDITOR.POSITION_BEFORE_START );
+
+			assert.areSame( document.getElementById('_P'), range.startContainer.$, 'startContainer' );
+			assert.areSame( document.getElementById('_P'), range.endContainer.$, 'endContainer' );
+			assert.isTrue( range.collapsed, 'collapsed' );
+		},
+
+		test_setEndAt_4 : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+			range.setEndAt( doc.getById('_Span'), CKEDITOR.POSITION_AFTER_END );
+
+			assert.areSame( document.getElementById('_P'), range.startContainer.$, 'startContainer' );
+			assert.areSame( document.getElementById('_P'), range.endContainer.$, 'endContainer' );
+			assert.isTrue( range.collapsed, 'collapsed' );
+		},
+
+		test_collapsed : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStartAt( doc.getById( '_P' ), CKEDITOR.POSITION_AFTER_START );
+
+			assert.isTrue( range.collapsed );
+		},
+
+		test_collapse : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStartAt( doc.getById( '_Para' ), CKEDITOR.POSITION_AFTER_START );
+			range.setEndAt( doc.getById( '_Span' ), CKEDITOR.POSITION_BEFORE_END );
+
+			assert.areSame( document.getElementById('_Para'), range.startContainer.$, 'startContainer' );
+			assert.areSame( document.getElementById('_Span'), range.endContainer.$, 'endContainer' );
+			assert.isFalse( range.collapsed, 'collapsed' );
+
+			range.collapse( true );
+
+			assert.areSame( document.getElementById('_Para'), range.startContainer.$, 'startContainer' );
+			assert.areSame( document.getElementById('_Para'), range.endContainer.$, 'endContainer' );
+			assert.isTrue( range.collapsed, 'collapsed' );
+		},
+
+		test_selectNodeContents_Element : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+
+			// Test with an Element node.
+			range.selectNodeContents( doc.getById( '_Para' ) );
+
+			assert.areSame( document.getElementById( '_Para' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 0, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_Para' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 3, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_selectNodeContents_Text : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+
+			// Test with a Text node.
+			range.selectNodeContents( doc.getById( '_Para' ).getFirst() );
+
+			assert.areSame( document.getElementById( '_Para' ).firstChild, range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 0, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_Para' ).firstChild, range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 8, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_collapse_ToStart : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+
+			range.selectNodeContents( doc.getById( '_P' ) );
+			range.collapse( true );
+
+			assert.areSame( document.getElementById( '_P' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 0, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_P' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 0, range.endOffset, 'range.endOffset' );
+			assert.isTrue( range.collapsed, 'range.collapsed' );
+		},
+
+		test_collapse_ToEnd : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+
+			range.selectNodeContents( doc.getById( '_Para' ) );
+			range.collapse( false );
+
+			assert.areSame( document.getElementById( '_Para' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 3, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_Para' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 3, range.endOffset, 'range.endOffset' );
+			assert.isTrue( range.collapsed, 'range.collapsed' );
+		},
+
+		test_insertNode_ElementContents : function()
+		{
+			var newNode = new CKEDITOR.dom.element( 'span' );
+			newNode.setHtml( 'test_' );
+
+			var range = new CKEDITOR.dom.range( doc );
+
+			range.selectNodeContents( doc.getById( '_B' ) );
+			range.insertNode( newNode );
+
+			assert.areSame( document.getElementById( '_B' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 0, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_B' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 2, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_insertNode_ElementCollapsed : function()
+		{
+			var newNode = new CKEDITOR.dom.element( 'span' );
+			newNode.setHtml( 'test_' );
+
+			var range = new CKEDITOR.dom.range( doc );
+
+			range.setStartBefore( doc.getById( '_Para' ) );
+			range.insertNode( newNode );
+
+			assert.areSame( document.getElementById( 'playground' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 1, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( 'playground' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 2, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_insertNode_ElementNotCollapsed : function()
+		{
+			var newNode = new CKEDITOR.dom.element( 'span' );
+			newNode.setHtml( 'test_' );
+
+			var range = new CKEDITOR.dom.range( doc );
+
+			range.setStartBefore( doc.getById( '_Para' ) );
+			range.setStartBefore( doc.getById( '_H1' ) );
+			range.insertNode( newNode );
+
+			assert.areSame( document.getElementById( 'playground' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 0, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( 'playground' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 2, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_insertNode_DiffElements : function()
+		{
+			var newNode = new CKEDITOR.dom.element( 'span' );
+			newNode.setHtml( 'test_' );
+
+			var range = new CKEDITOR.dom.range( doc );
+
+			range.selectNodeContents( doc.getById( '_Para' ) );
+
+			range.setStart( doc.getById( '_H1' ), 0 );
+			range.insertNode( newNode );
+
+			assert.areSame( document.getElementById( '_H1' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 0, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_Para' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 3, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+
+			assert.isTrue( range.startContainer.getChild( range.startOffset ).equals( newNode ), 'Start must be on new node' );
+		},
+
+		test_insertNode_TextCollapsed : function()
+		{
+			var newNode = new CKEDITOR.dom.element( 'span' );
+			newNode.setHtml( 'test_' );
+
+			var range = new CKEDITOR.dom.range( doc );
+
+			range.setStart( doc.getById( '_H1' ).getFirst(), 3 );
+			range.insertNode( newNode );
+
+			assert.areSame( document.getElementById( '_H1' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 1, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_H1' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 2, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_insertNode_TextNotCollapsed : function()
+		{
+			var newNode = new CKEDITOR.dom.element( 'span' );
+			newNode.setHtml( 'test_' );
+
+			var range = new CKEDITOR.dom.range( doc );
+
+			range.setStart( doc.getById( '_H1' ).getFirst(), 3 );
+			range.setEnd( doc.getById( '_H1' ).getFirst(), 5 );
+			range.insertNode( newNode );
+
+			assert.areSame( document.getElementById( '_H1' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 1, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_H1' ).childNodes[2], range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 2, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_insertNode_Mixed : function()
+		{
+			var newNode = new CKEDITOR.dom.element( 'span' );
+			newNode.setHtml( 'test_' );
+
+			var range = new CKEDITOR.dom.range( doc );
+
+			range.setStart( doc.getById( '_H1' ).getFirst(), 0 );
+			range.setEnd( doc.getById( '_P' ), 1 );
+			range.insertNode( newNode );
+
+			assert.areSame( document.getElementById( '_H1' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 0, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_P' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 1, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_getCommonAncestor1 : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_H1' ).getFirst(), 3 );
+
+			assert.areSame( document.getElementById( '_H1' ).firstChild, range.getCommonAncestor().$ );
+		},
+
+		test_getCommonAncestor2 : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_H1' ), 0 );
+
+			assert.areSame( document.getElementById( '_H1' ), range.getCommonAncestor().$ );
+		},
+
+		test_getCommonAncestor3 : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_H1' ), 0 );
+			range.setEnd( doc.getById( '_Para' ), 0 );
+
+			assert.areSame( document.getElementById( 'playground' ), range.getCommonAncestor().$ );
+		},
+
+		test_getCommonAncestor4 : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_Para' ).getFirst(), 1 );
+			range.setEnd( doc.getById( '_B' ), 0 );
+
+			assert.areSame( document.getElementById( '_Para' ), range.getCommonAncestor().$ );
+		},
+
+		test_getCommonAncestor5 : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getBody(), 0 );
+			range.setEnd( doc.getById( '_B' ).getFirst(), 1 );
+
+			assert.areSame( document.body, range.getCommonAncestor().$ );
+		},
+
+		test_getCommonAncestor6 : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_EnlargeI' ).getFirst(), 2 );
+			range.setEnd( doc.getById( '_EnlargeB' ), 3 );
+
+			assert.areSame( document.getElementById( '_EnlargeB' ), range.getCommonAncestor().$ );
+		},
+
+		test_enlarge_element1 : function()
+		{
+			// For IE, see the next test.
+			if ( CKEDITOR.env.ie )
+				return;
+
+			// <p> Test <b> <i>  [Enlarge]</i> this</b>   </p>
+			// <p> Test <b> [<i>  Enlarge</i>] this</b>   </p>
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_EnlargeI' ).getFirst(), 2 );
+			range.setEnd( doc.getById( '_EnlargeI' ), 1 );
+
+			range.enlarge( CKEDITOR.ENLARGE_ELEMENT );
+
+			assert.areSame( document.getElementById( '_EnlargeB' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 1, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_EnlargeB' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 2, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_enlarge_element1_ie : function()
+		{
+			// IE normalizes whitespaces when parsing the HTML, so we need a
+			// specific test for it.
+			if ( !CKEDITOR.env.ie )
+				return;
+
+			// <p>Test <b><i>[Enlarge]</i> this</b></p>
+			// <p>Test <b>[<i>Enlarge</i>] this</b></p>
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_EnlargeI' ).getFirst(), 0 );
+			range.setEnd( doc.getById( '_EnlargeI' ), 1 );
+
+			range.enlarge( CKEDITOR.ENLARGE_ELEMENT );
+
+			assert.areSame( document.getElementById( '_EnlargeB' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 0, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_EnlargeB' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 1, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_enlarge_element2 : function()
+		{
+			// For IE, see the next test.
+			if ( CKEDITOR.env.ie )
+				return;
+
+			// <p> Test <b> <i>  [Enlarge</i> this]</b>   </p>
+			// <p> Test [<b> <i>  Enlarge</i> this</b>]   </p>
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_EnlargeI' ).getFirst(), 2 );
+			range.setEnd( doc.getById( '_EnlargeB' ), 3 );
+
+			range.enlarge( CKEDITOR.ENLARGE_ELEMENT );
+
+			assert.areSame( document.getElementById( '_EnlargeP' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 1, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_EnlargeP' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 2, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_enlarge_element2_ie : function()
+		{
+			// IE normalizes whitespaces when parsing the HTML, so we need a
+			// specific test for it.
+			if ( !CKEDITOR.env.ie )
+				return;
+
+			// <p>Test <b><i>[Enlarge</i> this]</b></p>
+			// <p>Test [<b><i>Enlarge</i> this</b>]</p>
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_EnlargeI' ).getFirst(), 0 );
+			range.setEnd( doc.getById( '_EnlargeB' ), 2 );
+
+			range.enlarge( CKEDITOR.ENLARGE_ELEMENT );
+
+			assert.areSame( document.getElementById( '_EnlargeP' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 1, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_EnlargeP' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 2, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_enlarge_element3 : function()
+		{
+			// For IE, see the next test.
+			if ( CKEDITOR.env.ie )
+				return;
+
+			// <p> [Test <b> <i>  Enlarge]</i> this</b>   </p>
+			// <p> [Test <b> <i>  Enlarge</i>] this</b>   </p>
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_EnlargeP' ).getFirst(), 1 );
+			range.setEnd( doc.getById( '_EnlargeI' ), 1 );
+
+			range.enlarge( CKEDITOR.ENLARGE_ELEMENT );
+
+			assert.areSame( document.getElementById( '_EnlargeP' ).firstChild, range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 1, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_EnlargeB' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 2, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_enlarge_element3_ie : function()
+		{
+			// IE normalizes whitespaces when parsing the HTML, so we need a
+			// specific test for it.
+			if ( !CKEDITOR.env.ie )
+				return;
+
+			// <p>[Test <b><i>Enlarge]</i> this</b></p>
+			// <p>[Test <b><i>Enlarge</i>] this</b></p>
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_EnlargeP' ).getFirst(), 0 );
+			range.setEnd( doc.getById( '_EnlargeI' ), 1 );
+
+			range.enlarge( CKEDITOR.ENLARGE_ELEMENT );
+
+			assert.areSame( document.getElementById( '_EnlargeP' ).firstChild, range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 0, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_EnlargeB' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 1, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_enlarge_element4 : function()
+		{
+			// For IE, see the next test.
+			if ( CKEDITOR.env.ie )
+				return;
+
+			// <p> [Test <b> <i>  Enlarge</i> this]</b>   </p>
+			// [<p> Test <b> <i>  Enlarge</i> this</b>   </p>]
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_EnlargeP' ).getFirst(), 1 );
+			range.setEnd( doc.getById( '_EnlargeB' ).getChild( 2 ), 5 );
+
+			range.enlarge( CKEDITOR.ENLARGE_ELEMENT );
+
+			assert.areSame( document.getElementById( '_EnlargeP' ).parentNode, range.startContainer.$, 'range.startContainer' );
+			assert.areSame( doc.getById( '_EnlargeP' ).getIndex(), range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_EnlargeP' ).parentNode, range.endContainer.$, 'range.endContainer' );
+			assert.areSame( doc.getById( '_EnlargeP' ).getIndex() + 1, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_enlarge_element4_ie : function()
+		{
+			// IE normalizes whitespaces when parsing the HTML, so we need a
+			// specific test for it.
+			if ( !CKEDITOR.env.ie )
+				return;
+
+			// <p>[Test <b><i>Enlarge</i> this]</b></p>
+			// [<p>Test <b><i>Enlarge</i> this</b></p>]
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_EnlargeP' ).getFirst(), 0 );
+			range.setEnd( doc.getById( '_EnlargeB' ).getChild( 1 ), 5 );
+
+			range.enlarge( CKEDITOR.ENLARGE_ELEMENT );
+
+			assert.areSame( document.getElementById( '_EnlargeP' ).parentNode, range.startContainer.$, 'range.startContainer' );
+			assert.areSame( doc.getById( '_EnlargeP' ).getIndex(), range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_EnlargeP' ).parentNode, range.endContainer.$, 'range.endContainer' );
+			assert.areSame( doc.getById( '_EnlargeP' ).getIndex() + 1, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_enlarge_element5 : function()
+		{
+			// For IE, see the next test.
+			if ( CKEDITOR.env.ie )
+				return;
+
+			// <p> Test<b> <i>  [Enlarge</i> this]</b>   </p>
+			// <p> Test<b> [<i>  Enlarge</i> this]</b>   </p>
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_EnlargeI1' ).getFirst(), 2 );
+			range.setEnd( doc.getById( '_EnlargeB1' ).getChild( 2 ), 5 );
+
+			range.enlarge( CKEDITOR.ENLARGE_ELEMENT );
+
+			assert.areSame( document.getElementById( '_EnlargeB1' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 1, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_EnlargeB1' ).childNodes[ 2 ], range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 5, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_enlarge_element5_ie : function()
+		{
+			// IE normalizes whitespaces when parsing the HTML, so we need a
+			// specific test for it.
+			if ( !CKEDITOR.env.ie )
+				return;
+
+			// <p>Test<b> <i>[Enlarge</i> this]</b></p>
+			// <p>Test<b> [<i>Enlarge</i> this]</b></p>
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_EnlargeI1' ).getFirst(), 0 );
+			range.setEnd( doc.getById( '_EnlargeB1' ).getChild( 2 ), 5 );
+
+			range.enlarge( CKEDITOR.ENLARGE_ELEMENT );
+
+			assert.areSame( document.getElementById( '_EnlargeB1' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 1, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_EnlargeB1' ).childNodes[ 2 ], range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 5, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_enlarge_element6 : function()
+		{
+			// For IE, see the next test.
+			if ( CKEDITOR.env.ie )
+				return;
+
+			// <p> <b> <i>  [Enlarge</i>] this</b>   </p>
+			// <p> <b> [<i>  Enlarge</i>] this</b>   </p>
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_EnlargeI2' ).getFirst(), 2 );
+			range.setEnd( doc.getById( '_EnlargeB2' ), 2 );
+
+			range.enlarge( CKEDITOR.ENLARGE_ELEMENT );
+
+			assert.areSame( document.getElementById( '_EnlargeB2' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 1, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_EnlargeB2' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 2, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_enlarge_element6_ie : function()
+		{
+			// IE normalizes whitespaces when parsing the HTML, so we need a
+			// specific test for it.
+			if ( !CKEDITOR.env.ie )
+				return;
+
+			// <p><b><i>[Enlarge</i>] this</b></p>
+			// <p><b>[<i>Enlarge</i>] this</b></p>
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_EnlargeI2' ).getFirst(), 0 );
+			range.setEnd( doc.getById( '_EnlargeB2' ), 1 );
+
+			range.enlarge( CKEDITOR.ENLARGE_ELEMENT );
+
+			assert.areSame( document.getElementById( '_EnlargeB2' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 0, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_EnlargeB2' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 1, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_enlarge_element7 : function()
+		{
+			// For IE, see the next test.
+			if ( CKEDITOR.env.ie )
+				return;
+
+			// <p> <b> <i>  [Enlarge</i> this]</b>   </p>
+			// [<p> <b> <i>  Enlarge</i> this</b>   </p>]
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_EnlargeI2' ).getFirst(), 2 );
+			range.setEnd( doc.getById( '_EnlargeB2' ), 3 );
+
+			range.enlarge( CKEDITOR.ENLARGE_ELEMENT );
+
+			assert.areSame( document.getElementById( '_EnlargeP2' ).parentNode, range.startContainer.$, 'range.startContainer' );
+			assert.areSame( doc.getById( '_EnlargeP2' ).getIndex(), range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_EnlargeP2' ).parentNode, range.endContainer.$, 'range.endContainer' );
+			assert.areSame( doc.getById( '_EnlargeP2' ).getIndex() + 1, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_enlarge_element7_ie : function()
+		{
+			// IE normalizes whitespaces when parsing the HTML, so we need a
+			// specific test for it.
+			if ( !CKEDITOR.env.ie )
+				return;
+
+			// <p><b><i>[Enlarge</i> this]</b></p>
+			// [<p><b><i>Enlarge</i> this</b></p>]
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_EnlargeI2' ).getFirst(), 0 );
+			range.setEnd( doc.getById( '_EnlargeB2' ), 2 );
+
+			range.enlarge( CKEDITOR.ENLARGE_ELEMENT );
+
+			assert.areSame( document.getElementById( '_EnlargeP2' ).parentNode, range.startContainer.$, 'range.startContainer' );
+			assert.areSame( doc.getById( '_EnlargeP2' ).getIndex(), range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_EnlargeP2' ).parentNode, range.endContainer.$, 'range.endContainer' );
+			assert.areSame( doc.getById( '_EnlargeP2' ).getIndex() + 1, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_enlarge_element8 : function()
+		{
+			// For IE, see the next test.
+			if ( CKEDITOR.env.ie )
+				return;
+
+			// <p> Test <b> <i>  [Enlarge</i> this</b>   </p><p> <b> <i>  Enlarge</i> this]</b>   </p>
+			// <p> Test [<b> <i>  Enlarge</i> this</b>   </p><p> <b> <i>  Enlarge</i> this</b>   </p>]
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_EnlargeI' ).getFirst(), 2 );
+			range.setEnd( doc.getById( '_EnlargeB2' ), 3 );
+
+			range.enlarge( CKEDITOR.ENLARGE_ELEMENT );
+
+			assert.areSame( document.getElementById( '_EnlargeP' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 1, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_EnlargeP2' ).parentNode, range.endContainer.$, 'range.endContainer' );
+			assert.areSame( doc.getById( '_EnlargeP2' ).getIndex() + 1, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_enlarge_element8_ie : function()
+		{
+			// IE normalizes whitespaces when parsing the HTML, so we need a
+			// specific test for it.
+			if ( !CKEDITOR.env.ie )
+				return;
+
+			// <p>Test <b><i>[Enlarge</i> this</b></p><p><b><i>Enlarge</i> this]</b></p>
+			// <p>Test [<b><i>Enlarge</i> this</b></p><p><b><i>Enlarge</i> this</b></p>]
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_EnlargeI' ).getFirst(), 0 );
+			range.setEnd( doc.getById( '_EnlargeB2' ), 2 );
+
+			range.enlarge( CKEDITOR.ENLARGE_ELEMENT );
+
+			assert.areSame( document.getElementById( '_EnlargeP' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 1, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_EnlargeP2' ).parentNode, range.endContainer.$, 'range.endContainer' );
+			assert.areSame( doc.getById( '_EnlargeP2' ).getIndex() + 1, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_enlarge_element9 : function()
+		{
+			// <p>Test<i> [Enlarge</i>]</p>
+			// <p>Test<i> [Enlarge</i>]</p>
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_EnlargeI3' ).getFirst(), 1 );
+			range.setEnd( doc.getById( '_EnlargeP3' ), 2 );
+
+			range.enlarge( CKEDITOR.ENLARGE_ELEMENT );
+
+			assert.areSame( document.getElementById( '_EnlargeI3' ).firstChild, range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 1, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_EnlargeP3' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 2, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_enlarge_element10 : function()
+		{
+			// For IE, see the next test.
+			if ( CKEDITOR.env.ie )
+				return;
+
+			// <p>Test <i> [Enlarge</i>]</p>
+			// <p>Test [<i> Enlarge</i>]</p>
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_EnlargeI4' ).getFirst(), 1 );
+			range.setEnd( doc.getById( '_EnlargeP4' ), 2 );
+
+			range.enlarge( CKEDITOR.ENLARGE_ELEMENT );
+
+			assert.areSame( document.getElementById( '_EnlargeP4' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 1, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_EnlargeP4' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 2, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_enlarge_element10_ie : function()
+		{
+			// IE normalizes whitespaces when parsing the HTML, so we need a
+			// specific test for it.
+			if ( !CKEDITOR.env.ie )
+				return;
+
+			// <p>Test <i>[Enlarge</i>]</p>
+			// <p>Test [<i>Enlarge</i>]</p>
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_EnlargeI4' ).getFirst(), 0 );
+			range.setEnd( doc.getById( '_EnlargeP4' ), 2 );
+
+			range.enlarge( CKEDITOR.ENLARGE_ELEMENT );
+
+			assert.areSame( document.getElementById( '_EnlargeP4' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 1, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_EnlargeP4' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 2, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_enlarge_element11 : function()
+		{
+			// <p>Test <i>[Enlarge]</i></p>
+			// <p>Test [<i>Enlarge</i>]</p>
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_EnlargeI5' ), 0 );
+			range.setEnd( doc.getById( '_EnlargeI5' ), 1 );
+
+			range.enlarge( CKEDITOR.ENLARGE_ELEMENT );
+
+			assert.areSame( document.getElementById( '_EnlargeP5' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 1, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_EnlargeP5' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 2, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_enlarge_element12 : function()
+		{
+			// <p>Test <i><b></b>[Enlarge]</i></p>
+			// <p>Test [<i><b></b>Enlarge</i>]</p>
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_EnlargeI6' ), 1 );
+			range.setEnd( doc.getById( '_EnlargeI6' ), 2 );
+
+			range.enlarge( CKEDITOR.ENLARGE_ELEMENT );
+
+			assert.areSame( document.getElementById( '_EnlargeP6' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 1, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_EnlargeP6' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 2, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_enlarge_element13 : function()
+		{
+			// <p>Test <i><b></b>[Enlarge]</i></p>
+			// <p>Test [<i><b></b>Enlarge</i>]</p>
+
+			doc.getById( '_EnlargeP' ).setHtml( 'this <i>is some </i>sample text' );
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_EnlargeP' ), 0 );
+			range.setEnd( doc.getById( '_EnlargeP' ).getChild( 1 ), 0 );
+
+			range.enlarge( CKEDITOR.ENLARGE_ELEMENT );
+
+			assert.areSame( document.getElementById( '_EnlargeP' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 0, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_EnlargeP' ).childNodes[ 1 ], range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 0, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_deleteContents_W3C_1 : function()
+		{
+			// W3C DOM Range Specs - Section 2.6 - Example 1
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_Para' ).getFirst(), 1 );
+			range.setEnd( doc.getById( '_Para' ), 2 );
+
+			range.deleteContents();
+
+			assert.areSame( 't text.', getInnerHtml( '_Para' ), 'HTML after deletion' );
+
+			assert.areSame( document.getElementById( '_Para' ).firstChild, range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 1, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_Para' ).firstChild, range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 1, range.endOffset, 'range.endOffset' );
+			assert.isTrue( range.collapsed, 'range.collapsed' );
+		},
+
+		test_deleteContents_W3C_2 : function()
+		{
+			// W3C DOM Range Specs - Section 2.6 - Example 2
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_B' ).getFirst(), 1 );
+			range.setEnd( doc.getById( '_B' ).getNext(), 1 );
+
+			range.deleteContents();
+
+			assert.areSame( 'this is <b id="_b">s</b>text.', getInnerHtml( '_Para' ) );
+
+			assert.areSame( document.getElementById( '_Para' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 2, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_Para' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 2, range.endOffset, 'range.endOffset' );
+			assert.isTrue( range.collapsed, 'range.collapsed' );
+		},
+
+		test_deleteContents_W3C_3 : function()
+		{
+			// W3C DOM Range Specs - Section 2.6 - Example 3
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_B' ).getPrevious(), 1 );
+			range.setEnd( doc.getById( '_B' ).getFirst(), 1 );
+
+			range.deleteContents();
+
+			assert.areSame( 't<b id="_b">ome</b> text.', getInnerHtml( '_Para' ) );
+
+			assert.areSame( document.getElementById( '_Para' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 1, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_Para' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 1, range.endOffset, 'range.endOffset' );
+			assert.isTrue( range.collapsed, 'range.collapsed' );
+		},
+
+		test_deleteContents_W3C_4 : function()
+		{
+			// W3C DOM Range Specs - Section 2.6 - Example 4
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_H1' ).getFirst(), 1 );
+			range.setEnd( doc.getById( 'playground' ).getLast().getFirst(), 1 );
+
+			range.deleteContents();
+
+			assert.areSame( '<h1 id="_h1">f</h1><p>nother paragraph.</p>', getInnerHtml( 'playground' ) );
+
+			assert.areSame( document.getElementById( 'playground' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 1, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( 'playground' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 1, range.endOffset, 'range.endOffset' );
+			assert.isTrue( range.collapsed, 'range.collapsed' );
+		},
+
+		test_deleteContents_Other : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_H1' ), 0 );
+			range.setEnd( doc.getById( 'playground' ).getLast(), 1 );
+
+			range.deleteContents();
+
+			assert.areSame( '<h1 id="_h1"></h1><p></p>', getInnerHtml( 'playground' ) );
+
+			assert.areSame( document.getElementById( 'playground' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 1, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( 'playground' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 1, range.endOffset, 'range.endOffset' );
+			assert.isTrue( range.collapsed, 'range.collapsed' );
+		},
+
+		test_deleteContents_Other_2 : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( 'playground' ), 0 );
+			range.setEnd( doc.getById( 'playground' ), 2 );
+
+			range.deleteContents();
+
+			assert.areSame( '<p>another paragraph.</p>', getInnerHtml( 'playground' ) );
+
+			assert.areSame( document.getElementById( 'playground' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 0, range.startOffset, 'range.startOffset' );
+			assert.areSame(document.getElementById( 'playground' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 0, range.endOffset, 'range.endOffset' );
+			assert.isTrue( range.collapsed, 'range.collapsed' );
+		},
+
+		test_deleteContents_Other_3 : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+			range.selectNodeContents( doc.getById('_B') );
+
+			range.deleteContents();
+
+			assert.areSame( '', getInnerHtml('_B') );
+
+			assert.areSame( document.getElementById('_B'), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 0, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById('_B'), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 0, range.endOffset, 'range.endOffset' );
+			assert.isTrue( range.collapsed, 'range.collapsed' );
+		},
+
+		test_deleteContents_Other_4 : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+			range.selectNodeContents( doc.getById('_Para') );
+
+			range.deleteContents();
+
+			assert.areSame( '', getInnerHtml('_Para') );
+
+			assert.areSame( document.getElementById('_Para'), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 0, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById('_Para'), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 0, range.endOffset, 'range.endOffset' );
+			assert.isTrue( range.collapsed, 'range.collapsed' );
+		},
+
+		test_extractContents_W3C_1 : function()
+		{
+			// W3C DOM Range Specs - Section 2.7 - Example 1
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_Para' ).getFirst(), 1 );
+			range.setEnd( doc.getById( '_Para' ), 2 );
+
+			var docFrag = range.extractContents();
+
+			var tmpDiv = doc.createElement( 'div' );
+			docFrag.appendTo( tmpDiv );
+
+			assert.areSame( 'his is <b id="_b">some</b>', getInnerHtml( tmpDiv.$ ), 'Extracted HTML' );
+			assert.areSame( 't text.', getInnerHtml( '_Para' ), 'HTML after extraction' );
+
+			assert.areSame( document.getElementById( '_Para' ).firstChild, range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 1, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_Para' ).firstChild, range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 1, range.endOffset, 'range.endOffset' );
+			assert.isTrue( range.collapsed, 'range.collapsed' );
+		},
+
+		test_extractContents_W3C_2 : function()
+		{
+			// W3C DOM Range Specs - Section 2.7 - Example 2
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_B' ).getFirst(), 1 );
+			range.setEnd( doc.getById( '_B' ).getNext(), 2 );
+
+			var docFrag = range.extractContents();
+
+			var tmpDiv = doc.createElement( 'div' );
+			docFrag.appendTo( tmpDiv );
+
+			assert.areSame( '<b id="_b">ome</b> t', getInnerHtml( tmpDiv.$ ), 'Extracted HTML' );
+			assert.areSame( 'this is <b id="_b">s</b>ext.', getInnerHtml( '_Para' ), 'HTML after extraction' );
+
+			assert.areSame( document.getElementById( '_Para' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 2, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_Para' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 2, range.endOffset, 'range.endOffset' );
+			assert.isTrue( range.collapsed, 'range.collapsed' );
+		},
+
+		test_extractContents_W3C_3 : function()
+		{
+			// W3C DOM Range Specs - Section 2.6 - Example 3
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_B' ).getPrevious(), 1 );
+			range.setEnd( doc.getById( '_B' ).getFirst(), 1 );
+
+			var docFrag = range.extractContents();
+
+			var tmpDiv = doc.createElement( 'div' );
+			docFrag.appendTo( tmpDiv );
+
+			assert.areSame( 'his is <b id="_b">s</b>', getInnerHtml( tmpDiv.$ ), 'Extracted HTML' );
+			assert.areSame( 't<b id="_b">ome</b> text.', getInnerHtml( '_Para' ), 'HTML after extraction' );
+
+			assert.areSame( document.getElementById( '_Para' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 1, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_Para' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 1, range.endOffset, 'range.endOffset' );
+			assert.isTrue( range.collapsed, 'range.collapsed' );
+		},
+
+		test_extractContents_W3C_4 : function()
+		{
+			// W3C DOM Range Specs - Section 2.6 - Example 4
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_H1' ).getFirst(), 1 );
+			range.setEnd( doc.getById( 'playground' ).getLast().getFirst(), 1 );
+
+			var docFrag = range.extractContents();
+
+			var tmpDiv = doc.createElement( 'div' );
+			docFrag.appendTo( tmpDiv );
+
+			assert.areSame( '<h1 id="_h1">ckw3crange test</h1><p id="_para">this is <b id="_b">some</b> text.</p><p>a</p>', getInnerHtml( tmpDiv.$ ), 'Extracted HTML' );
+			assert.areSame( '<h1 id="_h1">f</h1><p>nother paragraph.</p>', getInnerHtml( 'playground' ) );
+
+			assert.areSame( document.getElementById( 'playground' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 1, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( 'playground' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 1, range.endOffset, 'range.endOffset' );
+			assert.isTrue( range.collapsed, 'range.collapsed' );
+		},
+
+		test_extractContents_Other : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_H1' ), 0 );
+			range.setEnd( doc.getById( 'playground' ).getLast(), 1 );
+
+			var docFrag = range.extractContents();
+
+			var tmpDiv = doc.createElement( 'div' );
+			docFrag.appendTo( tmpDiv );
+
+			assert.areSame( '<h1 id="_h1">fckw3crange test</h1><p id="_para">this is <b id="_b">some</b> text.</p><p>another paragraph.</p>', getInnerHtml( tmpDiv.$ ), 'Extracted HTML' );
+			assert.areSame( '<h1 id="_h1"></h1><p></p>', getInnerHtml( 'playground' ) );
+
+			assert.areSame( document.getElementById( 'playground' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 1, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( 'playground' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 1, range.endOffset, 'range.endOffset' );
+			assert.isTrue( range.collapsed, 'range.collapsed' );
+		},
+
+		test_extractContents_Other_2 : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( 'playground' ), 0 );
+			range.setEnd( doc.getById( 'playground' ), 2 );
+
+			var docFrag = range.extractContents();
+
+			var tmpDiv = doc.createElement( 'div' );
+			docFrag.appendTo( tmpDiv );
+
+			assert.areSame( '<h1 id="_h1">fckw3crange test</h1><p id="_para">this is <b id="_b">some</b> text.</p>', getInnerHtml( tmpDiv.$ ), 'Extracted HTML' );
+			assert.areSame( '<p>another paragraph.</p>', getInnerHtml( 'playground' ) );
+
+			assert.areSame( document.getElementById( 'playground' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 0, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( 'playground' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 0, range.endOffset, 'range.endOffset' );
+			assert.isTrue( range.collapsed, 'range.collapsed' );
+		},
+
+		test_extractContents_Other_3 : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+
+			range.selectNodeContents( doc.getById('_B') );
+
+			var docFrag = range.extractContents();
+
+			var tmpDiv = doc.createElement( 'div' );
+			docFrag.appendTo( tmpDiv );
+
+			assert.areSame( 'some', getInnerHtml( tmpDiv.$ ), 'Extracted HTML' );
+			assert.areSame( '', getInnerHtml('_B'), 'HTML after extraction' );
+
+			assert.areSame( document.getElementById('_B'), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 0, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById('_B'), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 0, range.endOffset, 'range.endOffset' );
+			assert.isTrue( range.collapsed, 'range.collapsed' );
+		},
+
+		test_extractContents_Other_4 : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+
+			range.selectNodeContents( doc.getById('_Para') );
+
+			var docFrag = range.extractContents();
+
+			var tmpDiv = doc.createElement( 'div' );
+			docFrag.appendTo( tmpDiv );
+
+			assert.areSame( 'this is <b id="_b">some</b> text.', getInnerHtml( tmpDiv.$ ), 'Extracted HTML' );
+			assert.areSame( '', getInnerHtml('_Para'), 'HTML after extraction' );
+
+			assert.areSame( document.getElementById('_Para'), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 0, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById('_Para'), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 0, range.endOffset, 'range.endOffset' );
+			assert.isTrue( range.collapsed, 'range.collapsed' );
+		},
+
+		test_extractContents_Other_5 : function()
+		{
+			document.getElementById( 'playground' ).innerHTML = '<p><b><i>test</i></b></p>';
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStartAfter( new CKEDITOR.dom.element( document.getElementById( 'playground' ).getElementsByTagName('i')[0] ) );
+			range.setEndAfter( new CKEDITOR.dom.element( document.getElementById( 'playground' ).getElementsByTagName('b')[0] ) );
+
+			var docFrag = range.extractContents();
+
+			var tmpDiv = doc.createElement( 'div' );
+			docFrag.appendTo( tmpDiv );
+
+			assert.areSame( '<b></b>', getInnerHtml( tmpDiv.$ ), 'Extracted HTML' );
+			assert.areSame( '<p><b><i>test</i></b></p>', getInnerHtml( 'playground' ), 'HTML after extraction' );
+
+			assert.areSame( document.getElementById( 'playground' ).firstChild, range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 1, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( 'playground' ).firstChild, range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 1, range.endOffset, 'range.endOffset' );
+			assert.isTrue( range.collapsed, 'range.collapsed' );
+		},
+
+		test_extractContents_Other_6 : function()
+		{
+			document.getElementById( 'playground' ).innerHTML = '<p><b><i>test</i></b></p>';
+
+			var range = new CKEDITOR.dom.range( doc );
+
+			range.setStartBefore( new CKEDITOR.dom.element( document.getElementById( 'playground' ).getElementsByTagName('b')[0] ) );
+			range.setEndBefore( new CKEDITOR.dom.element( document.getElementById( 'playground' ).getElementsByTagName('i')[0] ) );
+
+			var docFrag = range.extractContents();
+
+			var tmpDiv = doc.createElement( 'div' );
+			docFrag.appendTo( tmpDiv );
+
+			assert.areSame( '<b></b>', getInnerHtml( tmpDiv.$ ), 'Extracted HTML' );
+			assert.areSame( '<p><b><i>test</i></b></p>', getInnerHtml( 'playground' ), 'HTML after extraction' );
+
+			assert.areSame( document.getElementById( 'playground' ).firstChild, range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 0, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( 'playground' ).firstChild, range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 0, range.endOffset, 'range.endOffset' );
+			assert.isTrue( range.collapsed, 'range.collapsed' );
+		},
+
+		test_cloneContents_W3C_1 : function()
+		{
+			// W3C DOM Range Specs - Section 2.7 - Example 1
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_Para' ).getFirst(), 1 );
+			range.setEnd( doc.getById( '_Para' ), 2 );
+
+			var bodyHtml = document.getElementById( 'playground' ).innerHTML;
+
+			var docFrag = range.cloneContents();
+
+			var tmpDiv = doc.createElement( 'div' );
+			docFrag.appendTo( tmpDiv );
+
+			assert.areSame( 'his is <b id="_b">some</b>', getInnerHtml( tmpDiv.$ ), 'Cloned HTML' );
+
+			// The body HTML must remain unchanged.
+			assert.areSame( bodyHtml.replace( /\s+_cke_expando=["\d]+/g, '' ), document.getElementById( 'playground' ).innerHTML.replace( /\s+_cke_expando=["\d]+/g, '' ), 'The HTML must remain untouched' );
+
+			// The range must also remain unchanged.
+			assert.areSame( document.getElementById( '_Para' ).firstChild, range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 1, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_Para' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 2, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_cloneContents_W3C_2 : function()
+		{
+			// W3C DOM Range Specs - Section 2.7 - Example 2
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_B' ).getFirst(), 1 );
+			range.setEnd( doc.getById( '_B' ).getNext(), 2 );
+
+			var bodyHtml = document.getElementById( 'playground' ).innerHTML;
+
+			var docFrag = range.cloneContents();
+
+			var tmpDiv = doc.createElement( 'div' );
+			docFrag.appendTo( tmpDiv );
+
+			assert.areSame( '<b id="_b">ome</b> t', getInnerHtml( tmpDiv.$ ), 'Cloned HTML' );
+
+			// The body HTML must remain unchanged.
+			assert.areSame( bodyHtml.replace( /\s+_cke_expando=["\d]+/g, '' ), document.getElementById( 'playground' ).innerHTML.replace( /\s+_cke_expando=["\d]+/g, '' ), 'The HTML must remain untouched' );
+
+			// The range must also remain unchanged.
+			assert.areSame( document.getElementById( '_B' ).firstChild, range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 1, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_B' ).nextSibling, range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 2, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_cloneContents_W3C_3 : function()
+		{
+			// W3C DOM Range Specs - Section 2.6 - Example 3
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_B' ).getPrevious(), 1 );
+			range.setEnd( doc.getById( '_B' ).getFirst(), 1 );
+
+			var bodyHtml = document.getElementById( 'playground' ).innerHTML;
+
+			var docFrag = range.cloneContents();
+
+			var tmpDiv = doc.createElement( 'div' );
+			docFrag.appendTo( tmpDiv );
+
+			assert.areSame( 'his is <b id="_b">s</b>', getInnerHtml( tmpDiv.$ ), 'Cloned HTML' );
+
+			// The body HTML must remain unchanged.
+			assert.areSame( bodyHtml.replace( /\s+_cke_expando=["\d]+/g, '' ), document.getElementById( 'playground' ).innerHTML.replace( /\s+_cke_expando=["\d]+/g, '' ), 'The HTML must remain untouched' );
+
+			// The range must also remain unchanged.
+			assert.areSame( document.getElementById( '_B' ).previousSibling, range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 1, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( '_B' ).firstChild, range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 1, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		// W3C DOM Range Specs - Section 2.6 - Example 4
+		test_cloneContents_W3C_4 : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+
+			range.setStart( doc.getById( '_H1' ).getFirst(), 1 );
+			range.setEnd( doc.getById( 'playground' ).getLast().getFirst(), 1 );
+
+			var bodyHtml = document.getElementById( 'playground' ).innerHTML;
+
+			var docFrag = range.cloneContents();
+
+			var tmpDiv = doc.createElement( 'div' );
+			docFrag.appendTo( tmpDiv );
+
+			assert.areSame( '<h1 id="_h1">ckw3crange test</h1><p id="_para">this is <b id="_b">some</b> text.</p><p>a</p>', getInnerHtml( tmpDiv.$ ), 'Cloned HTML' );
+
+			// The body HTML must remain unchanged.
+			assert.areSame( bodyHtml.replace( /\s+_cke_expando=["\d]+/g, '' ), document.getElementById( 'playground' ).innerHTML.replace( /\s+_cke_expando=["\d]+/g, '' ), 'The HTML must remain untouched' );
+
+			// The range must also remain unchanged.
+			assert.areSame( document.getElementById( '_H1' ).firstChild, range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 1, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( 'playground' ).lastChild.firstChild, range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 1, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_cloneContents_Other : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+
+			range.setStart( doc.getById( '_H1' ), 0 );
+			range.setEnd( doc.getById( 'playground' ).getLast(), 1 );
+
+			var bodyHtml = document.getElementById( 'playground' ).innerHTML;
+
+			var docFrag = range.cloneContents();
+
+			var tmpDiv = doc.createElement( 'div' );
+			docFrag.appendTo( tmpDiv );
+
+			assert.areSame( '<h1 id="_h1">fckw3crange test</h1><p id="_para">this is <b id="_b">some</b> text.</p><p>another paragraph.</p>', getInnerHtml( tmpDiv.$ ), 'Cloned HTML' );
+
+			// The body HTML must remain unchanged.
+			assert.areSame( bodyHtml.replace( /\s+_cke_expando=["\d]+/g, '' ), document.getElementById( 'playground' ).innerHTML.replace( /\s+_cke_expando=["\d]+/g, '' ), 'The HTML must remain untouched' );
+
+			// The range must also remain unchanged.
+			assert.areSame( document.getElementById( '_H1' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 0, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( 'playground' ).lastChild, range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 1, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_cloneContents_Other_2 : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+
+			range.setStart( doc.getById( 'playground' ), 0 );
+			range.setEnd( doc.getById( 'playground' ), 2 );
+
+			var bodyHtml = document.getElementById( 'playground' ).innerHTML;
+
+			var docFrag = range.cloneContents();
+
+			var tmpDiv = doc.createElement( 'div' );
+			docFrag.appendTo( tmpDiv );
+
+			assert.areSame( '<h1 id="_h1">fckw3crange test</h1><p id="_para">this is <b id="_b">some</b> text.</p>', getInnerHtml( tmpDiv.$ ), 'Cloned HTML' );
+
+			// The body HTML must remain unchanged.
+			assert.areSame( bodyHtml.replace( /\s+_cke_expando=["\d]+/g, '' ), document.getElementById( 'playground' ).innerHTML.replace( /\s+_cke_expando=["\d]+/g, '' ), 'The HTML must remain untouched' );
+
+			// The range must also remain unchanged.
+			assert.areSame( document.getElementById( 'playground' ), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 0, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById( 'playground' ), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 2, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_cloneContents_Other_3 : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+
+			range.selectNodeContents( doc.getById('_B') );
+
+			var bodyHtml = document.getElementById( 'playground' ).innerHTML;
+
+			var docFrag = range.cloneContents();
+
+			var tmpDiv = doc.createElement( 'div' );
+			docFrag.appendTo( tmpDiv );
+
+			assert.areSame( 'some', getInnerHtml( tmpDiv.$ ), 'Cloned HTML' );
+
+			// The body HTML must remain unchanged.
+			assert.areSame( bodyHtml.replace( /\s+_cke_expando=["\d]+/g, '' ), document.getElementById( 'playground' ).innerHTML.replace( /\s+_cke_expando=["\d]+/g, '' ), 'The HTML must remain untouched' );
+
+			assert.areSame( document.getElementById('_B'), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 0, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById('_B'), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 1, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		test_cloneContents_Other_4 : function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+
+			range.selectNodeContents( doc.getById('_Para') );
+
+			var bodyHtml = document.getElementById( 'playground' ).innerHTML;
+
+			var docFrag = range.cloneContents();
+
+			var tmpDiv = doc.createElement( 'div' );
+			docFrag.appendTo( tmpDiv );
+
+			assert.areSame( 'this is <b id="_b">some</b> text.', getInnerHtml( tmpDiv.$ ), 'Cloned HTML' );
+
+			// The body HTML must remain unchanged.
+			assert.areSame( bodyHtml.replace( /\s+_cke_expando=["\d]+/g, '' ), document.getElementById( 'playground' ).innerHTML.replace( /\s+_cke_expando=["\d]+/g, '' ), 'The HTML must remain untouched' );
+
+			assert.areSame( document.getElementById('_Para'), range.startContainer.$, 'range.startContainer' );
+			assert.areSame( 0, range.startOffset, 'range.startOffset' );
+			assert.areSame( document.getElementById('_Para'), range.endContainer.$, 'range.endContainer' );
+			assert.areSame( 3, range.endOffset, 'range.endOffset' );
+			assert.isFalse( range.collapsed, 'range.collapsed' );
+		},
+
+		/////////////
+
+		setUp : function()
+		{
+			 document.getElementById( 'playground' ).innerHTML = html1;
+			 document.getElementById( 'playground2' ).innerHTML = html2;
+		},
+
+		name : document.title
+	};
+})() );
+
+//window.onload = function()
+//{
+//	// Local references.
+//	var assert			= CKEDITOR.test.assert;
+//	var getInnerHtml	= CKEDITOR.test.getInnerHtml;
+
+//	var doc = new CKEDITOR.dom.document( document );
+
+//			doc.getById( '_EnlargeP' ).setHtml( 'this <i>is some </i>sample text' );
+
+//			var range = new CKEDITOR.dom.range( doc );
+//			range.setStart( doc.getById( '_EnlargeP' ), 0 );
+//			range.setEnd( doc.getById( '_EnlargeP' ).getChild( 1 ), 0 );
+
+//			range.enlarge( CKEDITOR.ENLARGE_ELEMENT );
+//}
+
+	//]]>
+	</script>
+</head>
+<body>
+	<div id="playground" style="visibility:hidden"><h1 id="_H1">FCKW3CRange Test</h1><p id="_Para">This is <b id="_B">some</b> text.</p><p>Another paragraph.</p></div>
+	<div id="playground2" style="visibility: hidden">
+		<h1>
+			Test page for FCKeditor
+		</h1>
+		<p id="_P">
+			This document contains various markup features commonly used by content editors
+			or "<span id="_Span" lang="fr">r&eacute;dacteurs de contenu</span>" as they are
+			called in <a id="_A" href="http://en.wikipedia.org/wiki/France" title="Wikipedia article about France">
+				France</a>.<br />
+			It is important that a <acronym id="_Acronym" title="what you see is what you get">WYSIWYG</acronym>
+			tool has features that are easily available for the editor. If not, there is a risk
+			that content won't receive <strong id="_Strong">proper</strong> markup. Examples
+			of commonly found content are:</p>
+		<p id="_Pnbsp">
+			&nbsp;
+		</p>
+		<p id="_Pspaces">
+		</p>
+		<ol>
+			<li>Headings</li>
+			<li style="color: Red">Links (with optional title) </li>
+			<li>Lists (like this one)
+				<ul>
+					<li>including nested lists </li>
+				</ul>
+			</li>
+			<li>Tables
+				<ul>
+					<li>caption</li>
+					<li>headers</li>
+					<li>summary</li>
+				</ul>
+			</li>
+			<li>Language information</li>
+			<li>Acronyms and abbreviations</li>
+			<li>Emphasis and strong emphasis </li>
+			<li>Quotes, inline and block </li>
+			<li>Images</li>
+		</ol>
+		<hr />
+		<h2 style="background-color: Silver">
+			Test procedure
+		</h2>
+		This text has no block tag. It should be corrected when working with the enter key
+		set to "p" or "div" tags. The "br" configuration should not make changes instead.
+		<p id="_P2">
+			In the test we will try to recreate this document using the editor tools. To make
+			sure tables can be inserted <em id="_Em">properly</em> we re-visit banana import
+			statistics from 1998.
+		</p>
+		<p id="_P3">
+			This paragraph has and image at the very end of its contents.<img id="_Img" src="img.gif"
+				alt="" />
+		</p>
+		This text has no block tag.<br />It should be corrected when working with the enter key
+		set to "p" or "div" tags. The <strong id="_StrongNoPara">"br" configuration</strong>
+		should not make changes instead.<br />It has three lines separated by BR tags.
+		<p>
+			In the test we will try to recreate this document using the editor tools. To make
+			sure tables can be inserted <em>properly</em> we re-visit banana import statistics
+			from 1998.
+		</p>
+		<table summary="Sweden was the top importing country by far in 1998.">
+			<caption>
+				Top banana importers 1998 (value of banana imports in millions of US dollars per
+				million people)<br />
+				<br />
+			</caption>
+			<tr>
+				<th scope="col">
+					Country</th>
+				<th scope="col">
+					Millions of US dollars per million people</th>
+			</tr>
+			<tr>
+				<td>
+					Sweden</td>
+				<td>
+					17.12</td>
+			</tr>
+			<tr>
+				<td>
+					United&nbsp;Kingdom</td>
+				<td>
+					8.88</td>
+			</tr>
+			<tr>
+				<td>
+					Germany</td>
+				<td>
+					8.36</td>
+			</tr>
+			<tr>
+				<td>
+					Italy</td>
+				<td>
+					5.96</td>
+			</tr>
+			<tr>
+				<td>
+					United States</td>
+				<td>
+					4.78</td>
+			</tr>
+		</table>
+		<p>
+			For block quotes we will have a look at <a href="http://fawny.org/rhcp.html">what Joe
+				Clark says about redheads</a>:</p>
+		<blockquote cite="http://fawny.org/rhcp.html#me">
+			<p>
+				"Since boyhood I&rsquo;ve always believed, at the deepest level, that redheads are
+				standard-bearers of the grandest and most wondrous human beauty."</p>
+		</blockquote>
+		<p>
+			<img src="img.gif" alt="" /></p>
+		<p>
+			The above is the FCKeditor logo loaded from the FCKeditor.net web site.</p>
+		<p><b id="_B1">Line 1<br />Line 2<br /><i id="_I1">Line 3</i></b></p>
+		<p id="_EnlargeP"> Test <b id="_EnlargeB"> <i id="_EnlargeI">  Enlarge</i> this</b>   </p>
+		<p id="_EnlargeP1"> Test<b id="_EnlargeB1"> <i id="_EnlargeI1">  Enlarge</i> this</b>   </p>
+		<p id="_EnlargeP2"> <b id="_EnlargeB2"> <i id="_EnlargeI2">  Enlarge</i> this</b>   </p>
+		<p id="_EnlargeP3">Test<i id="_EnlargeI3"> Enlarge</i></p>
+		<p id="_EnlargeP4">Test <i id="_EnlargeI4"> Enlarge</i></p>
+		<p id="_EnlargeP5">Test <i id="_EnlargeI5">Enlarge</i></p>
+		<p id="_EnlargeP6">Test <i id="_EnlargeI6"><b></b>Enlarge</i></p>
+	</div>
+	<script type="text/javascript">
+	//<![CDATA[
+
+html1 = document.getElementById( 'playground' ).innerHTML;
+html2 = document.getElementById( 'playground2' ).innerHTML;
+
+	//]]>
+	</script>
+</body>
+</html>
Index: /CKEditor/tags/3.0 Beta/_source/tests/core/dom/text.html
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/tests/core/dom/text.html	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/tests/core/dom/text.html	(revision 3046)
@@ -0,0 +1,71 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>CKEDITOR.dom.text</title>
+	<link rel="stylesheet" type="text/css" href="../../test.css" />
+	<script type="text/javascript" src="../../../../ckeditor_source.js"></script> <!-- %REMOVE_LINE%
+	<script type="text/javascript" src="../../../ckeditor.js"></script>
+	%REMOVE_LINE% -->
+	<script type="text/javascript" src="../../test.js"></script>
+	<script type="text/javascript">
+	//<![CDATA[
+
+CKEDITOR.test.addTestCase( (function()
+{
+	// Local reference to the "assert" object.
+	var assert = CKEDITOR.test.assert;
+
+	return {
+		test_substring1 : function()
+		{
+			var text = new CKEDITOR.dom.text( '0123456789' );
+
+			assert.areSame( '123', text.substring( 1, 4 ) );
+		},
+
+		test_substring2 : function()
+		{
+			var text = new CKEDITOR.dom.text( '0123456789' );
+
+			assert.areSame( '56789', text.substring( 5 ) );
+		},
+
+		test_substring3 : function()
+		{
+			var text = new CKEDITOR.dom.text( '0123456789' );
+
+			assert.areSame( '', text.substring( 1,1 ) );
+		},
+
+		test_substring4 : function()
+		{
+			var text = new CKEDITOR.dom.text( '0123456789' );
+
+			assert.areSame( '012', text.substring( -10,3 ) );
+		},
+
+		test_substring5 : function()
+		{
+			var text = new CKEDITOR.dom.text( '0123456789' );
+
+			assert.areSame( '89', text.substring( 8,100 ) );
+		},
+
+		test_substring6 : function()
+		{
+			var text = new CKEDITOR.dom.text( '0123456789' );
+
+			assert.areSame( '234', text.substring( 5,2 ) );
+		},
+
+		name : document.title
+	};
+})() );
+
+	//]]>
+	</script>
+</head>
+<body>
+	<p>0123456789</p>
+</body>
+</html>
Index: /CKEditor/tags/3.0 Beta/_source/tests/core/dom/window.html
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/tests/core/dom/window.html	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/tests/core/dom/window.html	(revision 3046)
@@ -0,0 +1,55 @@
+﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>CKEDITOR.dom.window</title>
+	<link rel="stylesheet" type="text/css" href="../../test.css" />
+	<script type="text/javascript" src="../../../../ckeditor_source.js"></script> <!-- %REMOVE_LINE%
+	<script type="text/javascript" src="../../../ckeditor.js"></script>
+	%REMOVE_LINE% -->
+	<script type="text/javascript" src="../../test.js"></script>
+	<script type="text/javascript">
+	//<![CDATA[
+
+var loadCalled;
+
+var testWindow = new CKEDITOR.dom.window( window );
+
+var t;
+
+testWindow.on( 'load', function()
+	{
+		t = document.createElement( 'textarea' );
+		t.id = 'fred';
+
+		document.body.appendChild( t );
+
+		loadCalled = true;
+	});
+
+testWindow.on( 'beforeunload', function()
+	{
+		t.value = new Date();
+	});
+
+CKEDITOR.test.addTestCase( (function()
+{
+	// Local reference to the "assert" object.
+	var assert = CKEDITOR.test.assert;
+
+	return {
+		test_loadEvent : function()
+		{
+			assert.isTrue( loadCalled );
+		},
+
+		name : document.title
+	};
+})() );
+
+	//]]>
+	</script>
+</head>
+<body>
+	<div id="test1"></div>
+</body>
+</html>
Index: /CKEditor/tags/3.0 Beta/_source/tests/core/editor.html
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/tests/core/editor.html	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/tests/core/editor.html	(revision 3046)
@@ -0,0 +1,105 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>CKEDITOR.editor</title>
+	<link rel="stylesheet" type="text/css" href="../test.css" />
+	<script type="text/javascript" src="../../../ckeditor_source.js"></script> <!-- %REMOVE_LINE%
+	<script type="text/javascript" src="../../ckeditor.js"></script>
+	%REMOVE_LINE% -->
+	<script type="text/javascript" src="../test.js"></script>
+	<script type="text/javascript">
+	//<![CDATA[
+
+CKEDITOR.test.addTestCase( (function()
+{
+	// Local reference to the "assert" object.
+	var assert = CKEDITOR.test.assert;
+
+	return {
+		test_name : function()
+		{
+			assert.areSame( 'editor1', CKEDITOR.instances.editor1.name );
+		},
+
+		test_element : function()
+		{
+			assert.areSame( document.getElementById( 'editor1' ), CKEDITOR.instances.editor1.element.$ );
+		},
+
+		test_config : function()
+		{
+			// The instance default config must match the CKEDITOR.config.
+
+			var config = CKEDITOR.instances.editor1.config;
+
+			for ( var prop in CKEDITOR.config )
+				assert.areSame( CKEDITOR.config[ prop ], config[ prop ], '"' + prop + '" doesn\'t match' );
+		},
+
+		test_config_inpage : function()
+		{
+			// Pass in-page settings to the instance.
+			CKEDITOR.replace( 'editor2', { test1 : 'ball', baseHref : 'test' } );
+
+			var config = CKEDITOR.instances.editor2.config;
+
+			assert.areSame( 'ball', config.test1, '"test1" doesn\'t match' );
+			assert.areSame( 'test', config.baseHref, '"baseHref" doesn\'t match' );
+
+			// All other settings must match CKEDITOR.config.
+			for ( var prop in CKEDITOR.config )
+			{
+				if ( prop != 'test1' && prop != 'baseHref' )
+					assert.areSame( CKEDITOR.config[ prop ], config[ prop ], '"' + prop + '" doesn\'t match' );
+			}
+		},
+
+		test_config_customConfig : function()
+		{
+			var testCase = this;
+
+			CKEDITOR.on( 'instanceCreated', function( event )
+				{
+					if ( event.editor.name == 'editor3' )
+					{
+						event.editor.on( 'configLoaded', function()
+							{
+								testCase.resume( function()
+								{
+									var config = event.editor.config;
+
+									assert.areSame( 'Ok', config.test_custom1, '"test_custom1" doesn\'t match' );
+									assert.areSame( 'Ok', config.test_custom2, '"test_custom1" doesn\'t match' );
+									assert.areSame( 'ball', config.test1, '"test1" doesn\'t match' );
+									assert.areSame( 'test', config.baseHref, '"baseHref" doesn\'t match' );
+
+									// All other settings must match CKEDITOR.config.
+									for ( var prop in CKEDITOR.config )
+									{
+										if ( prop != 'customConfig' && prop != 'test_custom1' && prop != 'test_custom2' && prop != 'test1' && prop != 'baseHref' )
+											assert.areSame( CKEDITOR.config[ prop ], config[ prop ], '"' + prop + '" doesn\'t match' );
+									}
+								});
+							});
+					}
+				});
+
+			// Pass in-page settings to the instance.
+			CKEDITOR.replace( 'editor3', { customConfig : '_editor/custom_config_1.js', test1 : 'ball', baseHref : 'test' } );
+
+			this.wait();
+		},
+
+		name : document.title
+	};
+})() );
+
+	//]]>
+	</script>
+</head>
+<body>
+	<textarea id="editor1" class="ckeditor" cols="80" rows="10"></textarea>
+	<textarea id="editor2" cols="80" rows="10"></textarea>
+	<textarea id="editor3" cols="80" rows="10"></textarea>
+</body>
+</html>
Index: /CKEditor/tags/3.0 Beta/_source/tests/core/env.html
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/tests/core/env.html	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/tests/core/env.html	(revision 3046)
@@ -0,0 +1,48 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>CKEDITOR.env</title>
+	<link rel="stylesheet" type="text/css" href="../test.css" />
+	<script type="text/javascript" src="../../../ckeditor_source.js"></script> <!-- %REMOVE_LINE%
+	<script type="text/javascript" src="../../ckeditor.js"></script>
+	%REMOVE_LINE% -->
+	<script type="text/javascript" src="../test.js"></script>
+	<script type="text/javascript">
+	//<![CDATA[
+
+CKEDITOR.test.addTestCase( (function()
+{
+	// Local reference to the "assert" object.
+	var assert = CKEDITOR.test.assert;
+
+	return {
+		test_ie : function()
+		{
+			if ( window.ActiveXObject )
+			{
+				assert.isTrue( CKEDITOR.env.ie		, 'ie should be true' );
+				assert.isFalse( CKEDITOR.env.opera	, 'opera should be false' );
+				assert.isFalse( CKEDITOR.env.webkit	, 'webkit should be false' );
+				assert.isFalse( CKEDITOR.env.air	, 'air should be false' );
+				assert.isFalse( CKEDITOR.env.gecko	, 'gecko should be false' );
+				assert.isFalse( CKEDITOR.env.mac	, 'ismac should be false' );
+			}
+			else
+				assert.isFalse( CKEDITOR.env.ie );
+		},
+
+		test_isCompatible : function()
+		{
+			assert.isTrue( CKEDITOR.env.isCompatible );
+		},
+
+		name : document.title
+	};
+})() );
+
+	//]]>
+	</script>
+</head>
+<body>
+</body>
+</html>
Index: /CKEditor/tags/3.0 Beta/_source/tests/core/event.html
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/tests/core/event.html	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/tests/core/event.html	(revision 3046)
@@ -0,0 +1,461 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>CKEDITOR.event</title>
+	<link rel="stylesheet" type="text/css" href="../test.css" />
+	<script type="text/javascript" src="../../../ckeditor_source.js"></script> <!-- %REMOVE_LINE%
+	<script type="text/javascript" src="../../ckeditor.js"></script>
+	%REMOVE_LINE% -->
+	<script type="text/javascript" src="../test.js"></script>
+	<script type="text/javascript">
+	//<![CDATA[
+
+CKEDITOR.test.addTestCase( (function()
+{
+	// Local reference to the "assert" object.
+	var assert = CKEDITOR.test.assert;
+
+	return {
+		test_inherit : function()
+		{
+			// Create a testClass that inherits from CKEDITOR.event.
+			var testClass = function()
+			{
+				CKEDITOR.event.call( this );
+			};
+			testClass.prototype = CKEDITOR.event.prototype;
+
+			var calls = [];
+
+			var testInstance = new testClass();
+
+			testInstance.on( 'someEvent', function( ev )
+				{
+					assert.areSame( testInstance, this, 'Scope 1 is not valid' );
+
+					assert.areSame( 'someEvent', ev.name, 'ev.name (1) is wrong' );
+					assert.areSame( testInstance, ev.sender, 'ev.sender (1) is wrong' );
+					assert.isUndefined( ev.editor, 'ev.editor (1) is wrong' );
+					assert.isUndefined( ev.data, 'ev.data (1) is wrong' );
+					assert.isUndefined( ev.listenerData, 'ev.listenerData (1) is wrong' );
+
+					calls.push( 'a' );
+				} );
+
+			testInstance.on( 'someEvent', function( ev )
+				{
+					assert.areSame( testInstance, this, 'Scope 2 is not valid' );
+
+					assert.areSame( 'someEvent', ev.name, 'ev.name (2) is wrong' );
+					assert.areSame( testInstance, ev.sender, 'ev.sender (2) is wrong' );
+					assert.isUndefined( ev.editor, 'ev.editor (2) is wrong' );
+					assert.isUndefined( ev.data, 'ev.data (2) is wrong' );
+					assert.isUndefined( ev.listenerData, 'ev.listenerData (2) is wrong' );
+
+					calls.push( 'b' );
+				} );
+
+			assert.areSame( false, testInstance.fire( 'someEvent' ) );
+
+			assert.areSame( 2, calls.length, 'number of calls doesn\'t match' );
+			assert.areSame( 'a,b', calls.toString() );
+		},
+
+		test_implementOn : function()
+		{
+			// Create a testObject and implement CKEDITOR.event on it.
+			var testObject = { someprop : 'Test' };
+			CKEDITOR.event.implementOn( testObject );
+
+			assert.areSame( 'Test', testObject.someprop );
+
+			var calls = [];
+
+			testObject.on( 'someEvent', function( ev )
+				{
+					assert.areSame( testObject, this, 'Scope 1 is not valid' );
+
+					assert.areSame( 'someEvent', ev.name, 'ev.name (1) is wrong' );
+					assert.areSame( testObject, ev.sender, 'ev.sender (1) is wrong' );
+					assert.isUndefined( ev.editor, 'ev.editor (1) is wrong' );
+					assert.isUndefined( ev.data, 'ev.data (1) is wrong' );
+					assert.isUndefined( ev.listenerData, 'ev.listenerData (1) is wrong' );
+
+					calls.push( 'a' );
+				} );
+
+			testObject.on( 'someEvent', function( ev )
+				{
+					assert.areSame( testObject, this, 'Scope 2 is not valid' );
+
+					assert.areSame( 'someEvent', ev.name, 'ev.name (2) is wrong' );
+					assert.areSame( testObject, ev.sender, 'ev.sender (2) is wrong' );
+					assert.isUndefined( ev.editor, 'ev.editor (2) is wrong' );
+					assert.isUndefined( ev.data, 'ev.data (2) is wrong' );
+					assert.isUndefined( ev.listenerData, 'ev.listenerData (2) is wrong' );
+
+					calls.push( 'b' );
+				} );
+
+			assert.areSame( false, testObject.fire( 'someEvent' ) );
+
+			assert.areSame( 2, calls.length, 'number of calls doesn\'t match' );
+			assert.areSame( 'a,b', calls.toString() );
+		},
+
+		test_eventNameCase : function()
+		{
+			// Create a testObject and implement CKEDITOR.event on it.
+			var testObject = {};
+			CKEDITOR.event.implementOn( testObject );
+
+			var counter = 0;
+
+			// Event Names are case sensitive.
+
+			testObject.on( 'someEvent', function( ev )
+				{
+					assert.areSame( 'someEvent', ev.name, 'ev.name (someEvent) is wrong' );
+					counter++;
+				} );
+
+			testObject.on( 'SomeEvent', function( ev )
+				{
+					assert.areSame( 'SomeEvent', ev.name, 'ev.name (SomeEvent) is wrong' );
+					counter++;
+				} );
+
+			testObject.fire( 'someEvent' );
+			assert.areSame( 1, counter, '"someEvent" calls doesn\'t match' );
+
+			counter = 0;
+
+			testObject.fire( 'SomeEvent' );
+			assert.areSame( 1, counter, '"SomeEvent" calls doesn\'t match' );
+		},
+
+		test_scope : function()
+		{
+			// Create a testObject and implement CKEDITOR.event on it.
+			var testObject = {};
+			CKEDITOR.event.implementOn( testObject );
+
+			// Counter used just to check that the calls are effectively done.
+			var counter = 0;
+
+			var testScope = {};
+
+			testObject.on( 'someEvent', function( ev )
+				{
+					assert.areSame( testObject, this, 'scope (testObject) is wrong' );
+					assert.areSame( testObject, ev.sender, 'sender (testObject) is wrong' );
+					counter++;
+				} );
+
+			testObject.on( 'someEvent', function( ev )
+				{
+					assert.areSame( testScope, this, 'scope (testScope) is wrong' );
+					assert.areSame( testObject, ev.sender, 'sender (testScope) is wrong' );
+					counter++;
+				}, testScope );
+
+			testObject.fire( 'someEvent' );
+
+			assert.areSame( 2, counter, 'wrong number of calls' );
+		},
+
+		test_listenerData : function()
+		{
+			// Create a testObject and implement CKEDITOR.event on it.
+			var testObject = {};
+			CKEDITOR.event.implementOn( testObject );
+
+			// Counter used just to check that the calls are effectively done.
+			var counter = 0;
+
+			testObject.on( 'someEvent', function( ev )
+				{
+					assert.areSame( 'Test1', ev.listenerData, 'listenerData (1) is wrong' );
+					counter++;
+				}, null, 'Test1'  );
+
+			testObject.on( 'someEvent', function( ev )
+				{
+					assert.areSame( 'Test2', ev.listenerData, 'listenerData (2) is wrong' );
+					counter++;
+				}, null, 'Test2' );
+
+			testObject.fire( 'someEvent' );
+
+			assert.areSame( 2, counter, 'wrong number of calls' );
+		},
+
+		test_data : function()
+		{
+			// Create a testObject and implement CKEDITOR.event on it.
+			var testObject = {};
+			CKEDITOR.event.implementOn( testObject );
+
+			// Counter used just to check that the calls are effectively done.
+			var counter = 0;
+
+			testObject.on( 'someEvent', function( ev )
+				{
+					assert.areSame( 'Test data', ev.data, 'data (1) is wrong' );
+					counter++;
+				} );
+
+			testObject.on( 'someEvent', function( ev )
+				{
+					assert.areSame( 'Test data', ev.data, 'data (2) is wrong' );
+					counter++;
+				} );
+
+			testObject.fire( 'someEvent', 'Test data' );
+
+			assert.areSame( 2, counter, 'wrong number of calls' );
+		},
+
+		test_editor : function()
+		{
+			// Create a testObject and implement CKEDITOR.event on it.
+			var testObject = {};
+			CKEDITOR.event.implementOn( testObject );
+
+			// Counter used just to check that the calls are effectively done.
+			var counter = 0;
+
+			var editor = {};
+
+			testObject.on( 'someEvent', function( ev )
+				{
+					assert.areSame( editor, ev.editor, 'editor is wrong' );
+					counter++;
+				} );
+
+			testObject.fire( 'someEvent', null, editor );
+
+			assert.areSame( 1, counter, 'wrong number of calls' );
+		},
+
+		test_stop : function()
+		{
+			// Create a testObject and implement CKEDITOR.event on it.
+			var testObject = {};
+			CKEDITOR.event.implementOn( testObject );
+
+			var counter = 0;
+
+			testObject.on( 'someEvent', function( ev )
+				{
+					ev.stop();
+					counter++;
+				} );
+
+			testObject.on( 'someEvent', function( ev )
+				{
+					counter++;
+				} );
+
+			assert.areSame( false, testObject.fire( 'someEvent' ), 'fire must return "false"' );
+			assert.areSame( 1, counter, 'number of calls doesn\'t match' );
+		},
+
+		test_cancel : function()
+		{
+			// Create a testObject and implement CKEDITOR.event on it.
+			var testObject = {};
+			CKEDITOR.event.implementOn( testObject );
+
+			var counter = 0;
+
+			testObject.on( 'someEvent', function( ev )
+				{
+					ev.cancel();
+					counter++;
+				} );
+
+			testObject.on( 'someEvent', function( ev )
+				{
+					counter++;
+				} );
+
+			assert.areSame( true, testObject.fire( 'someEvent' ), 'fire must return "true"' );
+			assert.areSame( 1, counter, 'number of calls doesn\'t match' );
+		},
+
+		test_dataManipulation : function()
+		{
+			// Create a testObject and implement CKEDITOR.event on it.
+			var testObject = {};
+			CKEDITOR.event.implementOn( testObject );
+
+			var counter = 0;
+
+			testObject.on( 'someEvent', function( ev )
+				{
+					assert.areSame( 'Test1', ev.data );
+					ev.data = 'Test2';
+					counter++;
+				} );
+
+			testObject.on( 'someEvent', function( ev )
+				{
+					assert.areSame( 'Test2', ev.data );
+					ev.data = 'Test3';
+					counter++;
+				} );
+
+			testObject.on( 'someEvent', function( ev )
+				{
+					assert.areSame( 'Test3', ev.data );
+					ev.data = 'Test4';
+					counter++;
+				} );
+
+			assert.areSame( 'Test4', testObject.fire( 'someEvent', 'Test1' ), 'fire must return "Test4"' );
+			assert.areSame( 3, counter, 'number of calls doesn\'t match' );
+		},
+
+		test_priority : function()
+		{
+			// Create a testObject and implement CKEDITOR.event on it.
+			var testObject = {};
+			CKEDITOR.event.implementOn( testObject );
+
+			var calls = [];
+
+			testObject.on( 'someEvent', function( ev )
+				{
+					calls.push( 'e' );
+				}, null, null, 11 );
+
+			testObject.on( 'someEvent', function( ev )
+				{
+					calls.push( 'c' );
+				} );
+
+			testObject.on( 'someEvent', function( ev )
+				{
+					calls.push( 'a' );
+				}, null, null, 9 );
+
+			testObject.on( 'someEvent', function( ev )
+				{
+					calls.push( 'f' );
+				}, null, null, 11 );
+
+			testObject.on( 'someEvent', function( ev )
+				{
+					calls.push( 'd' );
+				} );
+
+			testObject.on( 'someEvent', function( ev )
+				{
+					calls.push( 'b' );
+				}, null, null, 9 );
+
+			testObject.fire( 'someEvent', 'Test data' );
+			assert.areSame( 'a,b,c,d,e,f', calls.toString() );
+		},
+
+		test_removeListener : function()
+		{
+			// Create a testObject and implement CKEDITOR.event on it.
+			var testObject = {};
+			CKEDITOR.event.implementOn( testObject );
+
+			var calls = [];
+
+			var listener = function( ev )
+				{
+					calls.push( 'a' );
+				};
+
+			testObject.on( 'someEvent', listener );
+
+			testObject.on( 'someEvent', function( ev )
+				{
+					calls.push( 'b' );
+				} );
+
+			testObject.fire( 'someEvent', 'Test data' );
+			assert.areSame( 'a,b', calls.toString() );
+
+			testObject.removeListener( 'someEvent', listener );
+
+			calls = [];
+
+			testObject.fire( 'someEvent', 'Test data' );
+			assert.areSame( 'b', calls.toString() );
+		},
+
+		test_fireOnce : function()
+		{
+			// Create a testObject and implement CKEDITOR.event on it.
+			var testObject = {};
+			CKEDITOR.event.implementOn( testObject );
+
+			var counter = 0;
+
+			testObject.on( 'someEvent', function( ev )
+				{
+					counter++;
+				} );
+
+			testObject.on( 'someEvent', function( ev )
+				{
+					counter++;
+				} );
+
+			assert.areSame( false, testObject.fireOnce( 'someEvent' ), 'fireOnce must return "false"' );
+			assert.areSame( 2, counter, 'number of calls doesn\'t match' );
+
+			counter = 0;
+
+			assert.areSame( false, testObject.fire( 'someEvent' ), 'fire must return "false"' );
+			assert.areSame( 0, counter, 'number of calls doesn\'t match' );
+		},
+
+		test_nestedCancel : function()
+		{
+			// Create a testObject and implement CKEDITOR.event on it.
+			var testObject = {};
+			CKEDITOR.event.implementOn( testObject );
+
+			var isCanceledA,
+				isCanceledB,
+				isCanceledC;
+
+			testObject.on( 'A', function( ev )
+				{
+					isCanceledB = testObject.fire( 'B' );
+					isCanceledC = testObject.fire( 'C' );
+				});
+
+			testObject.on( 'B', function( ev )
+				{
+					ev.cancel();
+				});
+
+			testObject.on( 'C', function( ev )
+				{
+				});
+
+			isCanceledA = testObject.fire( 'A' );
+
+			assert.areSame( false, isCanceledA, 'event A must not be canceled' );
+			assert.areSame( true, isCanceledB, 'event B must be canceled' );
+			assert.areSame( false, isCanceledC, 'event C must not be canceled' );
+		},
+
+		name : document.title
+	};
+})() );
+
+	//]]>
+	</script>
+</head>
+<body>
+</body>
+</html>
Index: /CKEditor/tags/3.0 Beta/_source/tests/core/htmlparser/fragment.html
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/tests/core/htmlparser/fragment.html	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/tests/core/htmlparser/fragment.html	(revision 3046)
@@ -0,0 +1,37 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>CKEDITOR.htmlParser.fragment</title>
+	<link rel="stylesheet" type="text/css" href="../../test.css" />
+	<script type="text/javascript" src="../../../../ckeditor_source.js"></script> <!-- %REMOVE_LINE%
+	<script type="text/javascript" src="../../../ckeditor.js"></script>
+	%REMOVE_LINE% -->
+	<script type="text/javascript" src="../../test.js"></script>
+	<script type="text/javascript">
+	//<![CDATA[
+
+CKEDITOR.test.addTestCase( (function()
+{
+	// Local reference to the "assert" object.
+	var assert = CKEDITOR.test.assert;
+
+	return {
+		test_fromHtml_1 : function()
+		{
+			var fragment = CKEDITOR.htmlParser.fragment.fromHtml( '<p>Test</p>' );
+
+			assert.areSame( 1, fragment.children.length, 'Wrong size' );
+			assert.areSame( CKEDITOR.NODE_ELEMENT, fragment.children[0].type, 'Wrong child type' );
+			assert.areSame( 'p', fragment.children[0].name, 'Wrong child name' );
+		},
+
+		name : document.title
+	};
+})() );
+
+	//]]>
+	</script>
+</head>
+<body>
+</body>
+</html>
Index: /CKEditor/tags/3.0 Beta/_source/tests/core/scriptloader.html
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/tests/core/scriptloader.html	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/tests/core/scriptloader.html	(revision 3046)
@@ -0,0 +1,54 @@
+﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>CKEDITOR.scriptLoader</title>
+	<link rel="stylesheet" type="text/css" href="../test.css" />
+	<script type="text/javascript" src="../../../ckeditor_source.js"></script> <!-- %REMOVE_LINE%
+	<script type="text/javascript" src="../../ckeditor.js"></script>
+	%REMOVE_LINE% -->
+	<script type="text/javascript" src="../test.js"></script>
+	<script type="text/javascript">
+	//<![CDATA[
+
+CKEDITOR.test.addTestCase( (function()
+{
+	// Local reference to the "assert" object.
+	var assert = CKEDITOR.test.assert;
+
+	return {
+		test_loadCode : function()
+		{
+			CKEDITOR.scriptLoader.loadCode( 'var test="Testing!";' );
+
+			/*jsl:ignore*/
+			assert.areEqual( 'Testing!', test );
+			/*jsl:end*/
+		},
+
+		test_load : function()
+		{
+			var testCase = this;
+			var callback = function( data )
+			{
+				testCase.resume( function()
+					{
+						/*jsl:ignore*/
+						assert.areSame( 'Test!', testVar );
+						/*jsl:end*/
+					} );
+			};
+
+			CKEDITOR.scriptLoader.load( '../_assets/sample.js', callback );
+			this.wait();
+		},
+
+		name : document.title
+	};
+})() );
+
+	//]]>
+	</script>
+</head>
+<body>
+</body>
+</html>
Index: /CKEditor/tags/3.0 Beta/_source/tests/core/tools.html
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/tests/core/tools.html	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/tests/core/tools.html	(revision 3046)
@@ -0,0 +1,138 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>CKEDITOR.tools</title>
+	<link rel="stylesheet" type="text/css" href="../test.css" />
+	<script type="text/javascript" src="../../../ckeditor_source.js"></script> <!-- %REMOVE_LINE%
+	<script type="text/javascript" src="../../ckeditor.js"></script>
+	%REMOVE_LINE% -->
+	<script type="text/javascript" src="../test.js"></script>
+	<script type="text/javascript">
+	//<![CDATA[
+
+CKEDITOR.test.addTestCase( (function()
+{
+	// Local reference to the "assert" object.
+	var assert = CKEDITOR.test.assert;
+
+	return {
+		test_extend : function()
+		{
+			var fakeFn = function() {};
+			var fakeObj = { fake1 : 1, fake2 : 2 };
+			var fakeArray = [ 'Test', 10, fakeFn, fakeObj ];
+
+			var target =
+			{
+				prop1 : 'Test',
+				prop2 : 10,
+				prop3 : fakeFn,
+				prop4 : fakeObj,
+				prop5 : fakeArray
+			};
+
+			CKEDITOR.tools.extend( target,
+				{
+					prop3 : 'Wrong',
+					prop6 : 'Good',
+					prop7 : fakeArray
+				} );
+
+			assert.areSame( 'Test'		, target.prop1, 'prop1 doesn\'t match' );
+			assert.areSame( 10			, target.prop2, 'prop2 doesn\'t match' );
+			assert.areSame( fakeFn		, target.prop3, 'prop3 doesn\'t match' );
+			assert.areSame( fakeObj		, target.prop4, 'prop4 doesn\'t match' );
+			assert.areSame( fakeArray	, target.prop5, 'prop5 doesn\'t match' );
+			assert.areSame( 'Good'		, target.prop6, 'prop6 doesn\'t match' );
+			assert.areSame( fakeArray	, target.prop7, 'prop7 doesn\'t match' );
+		},
+
+		test_isArray1 : function()
+		{
+			assert.isTrue( CKEDITOR.tools.isArray( [] ) );
+		},
+
+		test_isArray2 : function()
+		{
+			assert.isFalse( CKEDITOR.tools.isArray( { length:1 } ) );
+		},
+
+		test_isArray3 : function()
+		{
+			assert.isFalse( CKEDITOR.tools.isArray( null ) );
+		},
+
+		test_isArray4 : function()
+		{
+			assert.isFalse( CKEDITOR.tools.isArray( window.x ) );
+		},
+
+		test_htmlEncode1 : function()
+		{
+			assert.areSame( '&lt;b&gt;Test&lt;/b&gt;', CKEDITOR.tools.htmlEncode( '<b>Test</b>' ) );
+		},
+
+		test_htmlEncode2 : function()
+		{
+			assert.areSame( 'Test\'s &amp; "quote"', CKEDITOR.tools.htmlEncode( 'Test\'s & "quote"' ) );
+		},
+
+		test_cssStyleToDomStyle1 : function()
+		{
+			assert.areSame( 'backgroundColor', CKEDITOR.tools.cssStyleToDomStyle( 'background-color' ) );
+		},
+
+		test_cssStyleToDomStyle2 : function()
+		{
+			assert.areSame( 'cssFloat', CKEDITOR.tools.cssStyleToDomStyle( 'float' ) );
+		},
+
+		test_getNextNumber : function()
+		{
+			var number = CKEDITOR.tools.getNextNumber();
+			assert.areSame( number +  1, CKEDITOR.tools.getNextNumber() );
+			assert.areSame( number +  2, CKEDITOR.tools.getNextNumber() );
+			assert.areSame( number +  3, CKEDITOR.tools.getNextNumber() );
+		},
+
+		test_trim1 : function()
+		{
+			assert.areSame( 'test', CKEDITOR.tools.trim( '    test   ' ) );
+		},
+
+		test_trim2 : function()
+		{
+			assert.areSame( 'test', CKEDITOR.tools.trim( ' \n \t  test\n  \t ' ) );
+		},
+
+		test_ltrim1 : function()
+		{
+			assert.areSame( 'test   ', CKEDITOR.tools.ltrim( '    test   ' ) );
+		},
+
+		test_ltrim2 : function()
+		{
+			assert.areSame( 'test\n  \t ', CKEDITOR.tools.ltrim( ' \n \t  test\n  \t ' ) );
+		},
+
+		test_rtrim1 : function()
+		{
+			assert.areSame( '    test', CKEDITOR.tools.rtrim( '    test   ' ) );
+		},
+
+		test_rtrim2 : function()
+		{
+			assert.areSame( ' \n \t  test', CKEDITOR.tools.rtrim( ' \n \t  test\n  \t ' ) );
+		},
+
+		name : document.title
+	};
+})() );
+
+	//]]>
+	</script>
+</head>
+<body>
+	<iframe></iframe>
+</body>
+</html>
Index: /CKEditor/tags/3.0 Beta/_source/tests/core/xml.html
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/tests/core/xml.html	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/tests/core/xml.html	(revision 3046)
@@ -0,0 +1,152 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>CKEDITOR.xml</title>
+	<link rel="stylesheet" type="text/css" href="../test.css" />
+	<script type="text/javascript" src="../../../ckeditor_source.js"></script> <!-- %REMOVE_LINE%
+	<script type="text/javascript" src="../../ckeditor.js"></script>
+	<script type="text/javascript" src="../../_source/core/loader.js"></script>
+	%REMOVE_LINE% -->
+	<script type="text/javascript" src="../test.js"></script>
+	<script type="text/javascript">
+	//<![CDATA[
+
+CKEDITOR.loader.load( 'core/xml' );
+
+	//]]>
+	</script>
+	<script type="text/javascript">
+	//<![CDATA[
+
+CKEDITOR.test.addTestCase( (function()
+{
+	// Local reference to the "assert" object.
+	var assert = CKEDITOR.test.assert;
+
+	return {
+		test_baseXml : function()
+		{
+			var xml = new CKEDITOR.xml( '<data />' );
+			assert.isObject( xml.baseXml );
+		},
+
+		test_selectSingleNode1a : function()
+		{
+			var xml = new CKEDITOR.xml( '<data><item /></data>' );
+			var node = xml.selectSingleNode( 'data/item' );
+			assert.areEqual( 'item', node.nodeName );
+		},
+
+		test_selectSingleNode1b : function()
+		{
+			var xml = new CKEDITOR.xml( '<data><item /></data>' );
+			var node = xml.selectSingleNode( 'item' );
+			assert.isNull( node );
+		},
+
+		test_selectSingleNode2a : function()
+		{
+			var xml = new CKEDITOR.xml( '<data><item><subitem/></item></data>' );
+			var contextNode = xml.selectSingleNode( 'data' );
+			var node = xml.selectSingleNode( 'item/subitem', contextNode );
+			assert.areEqual( 'subitem', node.nodeName );
+		},
+
+		test_selectSingleNode2b : function()
+		{
+			var xml = new CKEDITOR.xml( '<data><item><subitem/></item></data>' );
+			var contextNode = xml.selectSingleNode( 'data' );
+			var node = xml.selectSingleNode( 'subitem', contextNode );
+			assert.isNull( node );
+		},
+
+		test_selectSingleNode3 : function()
+		{
+			var xml = new CKEDITOR.xml( '<data><item id="x1"/><item id="x2"/></data>' );
+			var node = xml.selectSingleNode( '//item[@id="x2"]' );
+			assert.areEqual( 'item', node.nodeName );
+			assert.areEqual( 'x2', node.getAttribute( 'id' ) );
+		},
+
+		test_selectSingleNode4 : function()
+		{
+			// For may results, the first one must be returned.
+
+			var xml = new CKEDITOR.xml( '<data><item id="x1"/><item id="x2"/></data>' );
+			var node = xml.selectSingleNode( '//item' );
+			assert.areEqual( 'item', node.nodeName );
+			assert.areEqual( 'x1', node.getAttribute( 'id' ) );
+		},
+
+		test_selectNodes1 : function()
+		{
+			var xml = new CKEDITOR.xml( '<data><item /></data>' );
+			var nodes = xml.selectNodes( 'data/item' );
+			assert.areEqual( 1, nodes.length );
+			assert.areEqual( 'item', nodes[0].nodeName );
+		},
+
+		test_selectNodes2a : function()
+		{
+			var xml = new CKEDITOR.xml( '<data><item id="x1"/><item id="x2"/><item id="x3"/></data>' );
+			var nodes = xml.selectNodes( '//item' );
+			assert.areEqual( 3, nodes.length );
+			assert.areEqual( 'x1', nodes[0].getAttribute( 'id' ) );
+			assert.areEqual( 'x2', nodes[1].getAttribute( 'id' ) );
+			assert.areEqual( 'x3', nodes[2].getAttribute( 'id' ) );
+		},
+
+		test_selectNodes2b : function()
+		{
+			var xml = new CKEDITOR.xml( '<data><item id="x1"/><item id="x2"/><item id="x3"/></data>' );
+			var nodes = xml.selectNodes( '//itemX' );
+			assert.areEqual( 0, nodes.length );
+		},
+
+		test_selectNodes3a : function()
+		{
+			var xml = new CKEDITOR.xml( '<data><item id="x1"/><item id="x2"/><item id="x3"/></data>' );
+			var contextNode = xml.selectSingleNode( 'data' );
+			var nodes = xml.selectNodes( 'item', contextNode );
+			assert.areEqual( 3, nodes.length );
+			assert.areEqual( 'x1', nodes[0].getAttribute( 'id' ) );
+			assert.areEqual( 'x2', nodes[1].getAttribute( 'id' ) );
+			assert.areEqual( 'x3', nodes[2].getAttribute( 'id' ) );
+		},
+
+		test_selectNodes3b : function()
+		{
+			var xml = new CKEDITOR.xml( '<data><item id="x1"/><item id="x2"/><item id="x3"/></data>' );
+			var contextNode = xml.selectSingleNode( 'data' );
+			var nodes = xml.selectNodes( 'itemX', contextNode );
+			assert.areEqual( 0, nodes.length );
+		},
+
+		test_getInnerXml1 : function()
+		{
+			var xml = new CKEDITOR.xml( '<data><item/></data>' );
+			assert.areEqual( '<item/>', xml.getInnerXml( 'data' ) );
+		},
+
+		test_getInnerXml2 : function()
+		{
+			var xml = new CKEDITOR.xml( '<data><item id="x1"><subitem name="sub1"/></item></data>' );
+			assert.areEqual( '<subitem name="sub1"/>', xml.getInnerXml( '//item' ) );
+		},
+
+		test_getInnerXml3 : function()
+		{
+			var xml = new CKEDITOR.xml( '<data><item id="x1"/></data>' );
+			assert.isNull( xml.getInnerXml( '//itemX' ) );
+		},
+
+		name : document.title
+	};
+})() );
+
+	//]]>
+	</script>
+</head>
+<body>
+</body>
+</html>
Index: /CKEditor/tags/3.0 Beta/_source/tests/plugins/htmldataprocessor/htmldataprocessor.html
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/tests/plugins/htmldataprocessor/htmldataprocessor.html	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/tests/plugins/htmldataprocessor/htmldataprocessor.html	(revision 3046)
@@ -0,0 +1,102 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>Plugin: htmldataprocessor</title>
+	<link rel="stylesheet" type="text/css" href="../../test.css" />
+	<script type="text/javascript" src="../../../../ckeditor_source.js"></script>
+	<script type="text/javascript" src="../../test.js"></script>
+	<script type="text/javascript">
+
+CKEDITOR.plugins.load( 'htmldataprocessor' );
+
+	</script>
+	<script type="text/javascript">
+	//<![CDATA[
+
+var testCase;
+
+CKEDITOR.test.addTestCase( testCase = (function()
+{
+	// Local references.
+	var assert = CKEDITOR.test.assert;
+
+	// In these tests, we may "reset" the writer rules to avoid it formatting
+	// the output, making the assertion easier to the done. We don't need to
+	// test formatting features here, so this is ok.
+	var getDataProcessor = function()
+	{
+		var dataProcessor = new CKEDITOR.htmlDataProcessor();
+		dataProcessor.writer._.rules = [];
+		return dataProcessor;
+	};
+
+	// These tests go far beyond the strict htmlDataProcessor code testing. We
+	// are actually testing the entire parsing system here. The combination of
+	// htmlParser and htmlWriter inside htmlDataProcessor is useful in this
+	// sense.
+
+	return {
+		test_toDataFormat_1a : function()
+		{
+			var element = new CKEDITOR.dom.element.createFromHtml( '<div><p>Test</p></div>' );
+
+			assert.areSame( '<p>Test</p>', getDataProcessor().toDataFormat( element ) );
+		},
+
+		test_toDataFormat_1b : function()
+		{
+			var element = new CKEDITOR.dom.element.createFromHtml( '<div><x:x>Test</x:x></div>' );
+
+			// IE adds the XML namespace tag.
+			if ( CKEDITOR.env.ie )
+				assert.areSame( '<?xml:namespace prefix="x" /><x:x>Test</x:x>', getDataProcessor().toDataFormat( element ) );
+			else
+				assert.areSame( '<x:x>Test</x:x>', getDataProcessor().toDataFormat( element ) );
+		},
+
+		test_toDataFormat_2a : function()
+		{
+			var element = new CKEDITOR.dom.element.createFromHtml( '<div><br /><p>Test</p></div>' );
+
+			assert.areSame( '<br /><p>Test</p>', getDataProcessor().toDataFormat( element ) );
+		},
+
+		test_toDataFormat_2b : function()
+		{
+			var element = new CKEDITOR.dom.element.createFromHtml( '<div><x:x></x:x><p>Test</p></div>' );
+
+			// IE adds the XML namespace tag.
+			if ( CKEDITOR.env.ie )
+				assert.areSame( '<?xml:namespace prefix="x" /><x:x></x:x><p>Test</p>', getDataProcessor().toDataFormat( element ) );
+			else
+				assert.areSame( '<x:x></x:x><p>Test</p>', getDataProcessor().toDataFormat( element ) );
+		},
+
+		test_toDataFormat_3 : function()
+		{
+			var element = new CKEDITOR.dom.element.createFromHtml( '<div><x:x><p>Test</p></div>' );
+
+			assert.areSame( '<x:x><p>Test</p></x:x>', getDataProcessor().toDataFormat( element ) );
+		},
+
+		test_toDataFormat_ticket_2774 : function()
+		{
+			var element = new CKEDITOR.dom.element.createFromHtml( '<div><P class=MsoNormal><B><I><SPAN lang=EN-US><o:p>Test</o:p></SPAN></I></B></P></div>' );
+
+			// IE adds the XML namespace tag.
+			if ( CKEDITOR.env.ie )
+				assert.areSame( '<p class="MsoNormal"><b><i><span lang="EN-US"><?xml:namespace prefix="o" /><o:p>Test</o:p></span></i></b></p>', getDataProcessor().toDataFormat( element ) );
+			else
+				assert.areSame( '<p class="MsoNormal"><b><i><span lang="EN-US"><o:p>Test</o:p></span></i></b></p>', getDataProcessor().toDataFormat( element ) );
+		},
+
+		name : document.title
+	};
+})() );
+
+	//]]>
+	</script>
+</head>
+<body>
+</body>
+</html>
Index: /CKEditor/tags/3.0 Beta/_source/tests/plugins/styles/styles.html
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/tests/plugins/styles/styles.html	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/tests/plugins/styles/styles.html	(revision 3046)
@@ -0,0 +1,297 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>Plugin: styles</title>
+	<link rel="stylesheet" type="text/css" href="../../test.css" />
+	<script type="text/javascript" src="../../../../ckeditor_source.js"></script>
+	<script type="text/javascript" src="../../test.js"></script>
+	<script type="text/javascript">
+
+CKEDITOR.plugins.load( 'styles' );
+
+	</script>
+	<script type="text/javascript">
+	//<![CDATA[
+
+var testCase;
+
+CKEDITOR.test.addTestCase( testCase = (function()
+{
+	// Local references.
+	var assert			= CKEDITOR.test.assert;
+	var getInnerHtml	= CKEDITOR.test.getInnerHtml;
+
+	var doc = new CKEDITOR.dom.document( document );
+
+	return {
+		test_inline1 : function()
+		{
+			doc.getById( '_P1' ).setHtml( 'this is some sample text' );
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_P1' ).getFirst(), 5 );
+			range.setEnd( doc.getById( '_P1' ).getFirst(), 7 );
+
+			var style = new CKEDITOR.style( { element : 'b' } );
+			style.applyToRange( range );
+
+			assert.areSame( 'this <b>is</b> some sample text', getInnerHtml( '_P1' ) );
+		},
+
+		test_inline2 : function()
+		{
+			doc.getById( '_P1' ).setHtml( 'this <b>is some </b>sample text' );
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_P1' ).getChild( 1 ), 0 );
+			range.setEnd( doc.getById( '_P1' ), 2 );
+
+			var style = new CKEDITOR.style( { element : 'i' } );
+			style.applyToRange( range );
+
+			assert.areSame( 'this <i><b>is some </b></i>sample text', getInnerHtml( '_P1' ) );
+		},
+
+		test_inline3 : function()
+		{
+			doc.getById( '_P1' ).setHtml( 'this <b>is some </b>sample text' );
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_P1' ).getChild( 1 ), 0 );
+			range.setEnd( doc.getById( '_P1' ).getChild( 1 ).getFirst(), 2 );
+
+			var style = new CKEDITOR.style( { element : 'i' } );
+			style.applyToRange( range );
+
+			assert.areSame( 'this <b><i>is</i> some </b>sample text', getInnerHtml( '_P1' ) );
+		},
+
+		// Inline - Remove inner duplicates.
+		test_inline4 : function()
+		{
+			doc.getById( '_P1' ).setHtml( 'this <b>is some </b>sample text' );
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_P1' ), 0 );
+			range.setEnd( doc.getById( '_P1' ), 3 );
+
+			var style = new CKEDITOR.style( { element : 'b' } );
+			style.applyToRange( range );
+
+			assert.areSame( '<b>this is some sample text</b>', getInnerHtml( '_P1' ) );
+		},
+
+		// Inline - Merge with next.
+		test_inline5 : function()
+		{
+			doc.getById( '_P1' ).setHtml( 'this <b>is some </b>sample text' );
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_P1' ), 0 );
+			range.setEnd( doc.getById( '_P1' ), 1 );
+
+			var style = new CKEDITOR.style( { element : 'b' } );
+			style.applyToRange( range );
+
+			assert.areSame( '<b>this is some </b>sample text', getInnerHtml( '_P1' ) );
+		},
+
+		// Inline - Merge with previous.
+		test_inline6 : function()
+		{
+			doc.getById( '_P1' ).setHtml( 'this <b>is some </b>sample text' );
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_P1' ), 2 );
+			range.setEnd( doc.getById( '_P1' ).getChild( 2 ), 6 );
+
+			var style = new CKEDITOR.style( { element : 'b' } );
+			style.applyToRange( range );
+
+			assert.areSame( 'this <b>is some sample</b> text', getInnerHtml( '_P1' ) );
+		},
+
+		// Inline - Merge several with next.
+		test_inline7 : function()
+		{
+			doc.getById( '_P1' ).setHtml( '<i><u>this </u></i><b><i><u>is</u> some</i> sample</b> text' );
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_P1' ), 0 );
+			range.setEnd( doc.getById( '_P1' ), 1 );
+
+			var style = new CKEDITOR.style( { element : 'b' } );
+			style.applyToRange( range );
+
+			assert.areSame( '<b><i><u>this is</u> some</i> sample</b> text', getInnerHtml( '_P1' ) );
+		},
+
+		// Inline - Merge several with previous.
+		test_inline8 : function()
+		{
+			doc.getById( '_P1' ).setHtml( 'this <b>is <i>some <u>sample</u></i></b><i><u> text</u></i>' );
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_P1' ), 2 );
+			range.setEnd( doc.getById( '_P1' ), 3 );
+
+			var style = new CKEDITOR.style( { element : 'b' } );
+			style.applyToRange( range );
+
+			assert.areSame( 'this <b>is <i>some <u>sample text</u></i></b>', getInnerHtml( '_P1' ) );
+		},
+
+		test_inline9 : function()
+		{
+			doc.getById( '_P1' ).setHtml( 'this <i>is some </i>sample text' );
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_P1' ), 0 );
+			range.setEnd( doc.getById( '_P1' ).getChild( 1 ), 0 );
+
+			var style = new CKEDITOR.style( { element : 'b' } );
+			style.applyToRange( range );
+
+			assert.areSame( '<b>this </b><i>is some </i>sample text', getInnerHtml( '_P1' ) );
+		},
+
+		test_inline10 : function()
+		{
+			doc.getById( '_P1' ).setHtml( 'this is some sample text' );
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_P1' ), 0 );
+			range.setEnd( doc.getById( '_P1' ), 1 );
+
+			var style = new CKEDITOR.style(
+				{
+					element : 'b',
+					attributes :
+						{
+							lang : 'it',
+							title : 'test'
+						},
+					styles :
+						{
+							'font-size' : '10pt',
+							'text-decoration' : 'line-through'
+						}
+				} );
+			style.applyToRange( range );
+
+			assert.areSame( '<b lang="it" style="font-size: 10pt; text-decoration: line-through;" title="test">this is some sample text</b>', getInnerHtml( '_P1' ) );
+		},
+
+		test_inline11 : function()
+		{
+			doc.getById( '_P1' ).setHtml( 'this <b lang="it" class="sample">is</b> <b lang="it" style="font-size: 10pt; text-decoration: line-through;" title="test">some sample</b> <b>t</b>ext' );
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_P1' ), 0 );
+			range.setEnd( doc.getById( '_P1' ), 7 );
+
+			var style = new CKEDITOR.style(
+				{
+					element : 'b',
+					attributes :
+						{
+							lang : 'it',
+							title : 'test'
+						},
+					styles :
+						{
+							'font-size' : '10pt',
+							'text-decoration' : 'line-through'
+						}
+				} );
+			style.applyToRange( range );
+
+			assert.areSame( '<b lang="it" style="font-size: 10pt; text-decoration: line-through;" title="test">this <b class="sample">is</b> some sample text</b>', getInnerHtml( '_P1' ) );
+		},
+
+		test_inline11 : function()
+		{
+			doc.getById( '_P1' ).setHtml( 'this <span class="a">is</span> some <span class="b">sample</span> text' );
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_P1' ), 0 );
+			range.setEnd( doc.getById( '_P1' ), 5 );
+
+			var style = new CKEDITOR.style( { element : 'span', attributes : { 'class' : 'b' } } );
+			style.applyToRange( range );
+
+			assert.areSame( '<span class="b">this <span class="a">is</span> some sample text</span>', getInnerHtml( '_P1' ) );
+		},
+
+		test_inline12 : function()
+		{
+			doc.getById( '_P1' ).setHtml( 'this <span style="font-size:12pt; font-weight:600">is</span> some <span style="font-size:10px;">sample</span> text' );
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_P1' ), 0 );
+			range.setEnd( doc.getById( '_P1' ), 5 );
+
+			var style = new CKEDITOR.style( { element : 'span', styles : { 'font-size' : '1.5em' } } );
+			style.applyToRange( range );
+
+			assert.areSame( '<span style="font-size: 1.5em;">this <span style="font-weight: 600;">is</span> some sample text</span>', getInnerHtml( '_P1' ) );
+		},
+
+		test_inline13 : function()
+		{
+			doc.getById( '_P1' ).setHtml( 'this <b>is some sample</b> text' );
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_P1' ).getChild( 1 ).getFirst(), 3 );
+			range.setEnd( doc.getById( '_P1' ), 3 );
+
+			var style = new CKEDITOR.style( { element : 'i' } );
+			style.applyToRange( range );
+
+			assert.areSame( 'this <b>is <i>some sample</i></b><i> text</i>', getInnerHtml( '_P1' ) );
+		},
+
+		test_inline_nobreak1 : function()
+		{
+			doc.getById( '_P1' ).setHtml( 'this is <a href="http://example.com/">some sample</a> text' );
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_P1' ), 0 );
+			range.setEnd( doc.getById( '_P1' ).getChild( 1 ).getFirst(), 4 );
+
+			var style = new CKEDITOR.style( { element : 'b' } );
+			style.applyToRange( range );
+
+			assert.areSame( '<b>this is </b><a href="http://example.com/"><b>some</b> sample</a> text', getInnerHtml( '_P1' ) );
+		},
+
+		test_ticket_2040 : function()
+		{
+			doc.getById( '_P1' ).setHtml( 'This is some <strong>sample text<\/strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor<\/a>.' );
+
+			var range = new CKEDITOR.dom.range( doc );
+			range.setStart( doc.getById( '_P1' ), 1 );
+			range.setEnd( doc.getById( '_P1' ).getChild( 1 ).getFirst(), 6 );
+
+			var style = new CKEDITOR.style( { element : 'i' } );
+			style.applyToRange( range );
+
+			assert.areSame( 'this is some <strong><i>sample</i> text<\/strong>. you are using <a href="http://www.fckeditor.net/">fckeditor<\/a>.', getInnerHtml( '_P1' ) );
+		},
+
+		name : document.title
+	};
+})() );
+
+//window.onload = function()
+//{
+//	testCase.test_inline4();
+//}
+
+	//]]>
+	</script>
+</head>
+<body>
+	<p id="_P1"></p>
+</body>
+</html>
Index: /CKEditor/tags/3.0 Beta/_source/tests/test.css
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/tests/test.css	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/tests/test.css	(revision 3046)
@@ -0,0 +1,81 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+body
+{
+	margin:10px;
+}
+
+#testLogger
+{
+	position: absolute;
+	right: 10px;
+	left: 10px;
+	top: 10px;
+	font-family: Monospace;
+	border: solid 2px black;
+	background: #ffffff;
+	padding: 0px;
+}
+
+/* IE6 */
+* html #testLogger
+{
+	width: 100%;
+}
+
+#testLogger.testAll
+{
+	position: static;
+}
+
+#testLogger pre
+{
+	margin: 0 0 0 40px;
+	background-color: #f0f0f0;
+	padding: 1px 4px 1px 4px;
+}
+
+#testLogger div
+{
+	margin: 2px;
+}
+
+#testLogger div div
+{
+	margin-left: 20px;
+}
+
+.testEntry
+{
+	padding: 5px;
+	margin: 0 !important;
+}
+
+.testEntry:hover
+{
+	background-color: #ffff99;
+}
+
+.testFail, .testPass, .testIgnore
+{
+	padding-left: 3px;
+	padding-right: 3px;
+}
+
+.testFail
+{
+	background-color: #ff0000;
+}
+
+.testPass
+{
+	background-color: #00ff00;
+}
+
+.testIgnore
+{
+	background-color: #f1f100;
+}
Index: /CKEditor/tags/3.0 Beta/_source/tests/test.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/tests/test.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/tests/test.js	(revision 3046)
@@ -0,0 +1,95 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/*jsl:import yuitest.js*/
+
+// Inject the YUI Test files into the page.
+// URLs copied from http://developer.yahoo.com/yui/yuitest/
+document.write(
+	'<script type="text/javascript" src="' +
+	CKEDITOR.basePath +
+	'_source/' +						// %REMOVE_LINE%
+	'tests/yuitest.js"></script>' );	/* %REMOVE_LINE%
+	'_tests/yuitest.js"></script>' );
+%REMOVE_LINE%	*/
+
+document.write(
+	'<script type="text/javascript" src="' +
+	CKEDITOR.basePath +
+	'_source/' +
+	'core/test.js"></script>' );
+
+(function()
+{
+	var createLogger = function()
+	{
+		document.body.appendChild( document.createElement( 'div' ) ).id = 'testLogger';
+	};
+
+	var outputResult = function( text )
+	{
+		var div = document.getElementById('testLogger').appendChild( document.createElement( 'div' ) );
+		div.className = 'testEntry';
+		div.innerHTML = text;
+	};
+
+	var htmlEncode = function( data )
+	{
+		if ( typeof data != 'string' )
+			return data;
+
+		return data.replace(
+			/&/g, '&amp;' ).replace(
+			/</g, '&lt;' ).replace(
+			/>/g, '&gt;' );
+	};
+
+	window.onload = function()
+	{
+		createLogger();
+		var runner = YAHOO.tool.TestRunner;
+
+		var handleTestResult = function( data )
+		{
+			switch( data.type )
+			{
+				case runner.TEST_FAIL_EVENT:
+
+					var expected = data.error.expected;
+					if ( expected && expected.nodeType )
+						expected += ' (' + ( expected.nodeType == 1 ? expected.nodeName : expected.nodeValue ) + ')';
+
+					var actual = data.error.actual;
+					if ( actual && actual.nodeType )
+						actual += ' (' + ( actual.nodeType == 1 ? actual.nodeName : actual.nodeValue ) + ')';
+
+					outputResult(
+						'<span class="testFail">FAIL</span> Test named "' + data.testName +
+						'" failed with message: "' + htmlEncode( data.error.message ) +
+						'".<div>Expected:</div><pre>' + htmlEncode( expected ) +
+						'<br></pre><div>Actual:</div><pre>' + htmlEncode( actual ) + '<br></pre>' );
+					break;
+				case runner.TEST_PASS_EVENT:
+					outputResult( '<span class="testPass">PASS</span> Test named "' + data.testName + '" passed.' );
+					break;
+				case runner.TEST_IGNORE_EVENT:
+					outputResult( '<span class="testIgnore">IGNORE</span> Test named "' + data.testName + '" was ignored.' );
+					break;
+			}
+		};
+
+		runner.subscribe(runner.TEST_FAIL_EVENT, handleTestResult);
+		runner.subscribe(runner.TEST_IGNORE_EVENT, handleTestResult);
+		runner.subscribe(runner.TEST_PASS_EVENT, handleTestResult);
+
+		if ( window.parent && window.parent.onTestStart )
+		{
+			runner.subscribe(runner.TEST_CASE_BEGIN_EVENT, window.parent.onTestStart);
+			runner.subscribe(runner.TEST_CASE_COMPLETE_EVENT, window.parent.onTestComplete);
+		}
+
+		runner.run();
+	};
+})();
Index: /CKEditor/tags/3.0 Beta/_source/tests/testall.html
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/tests/testall.html	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/tests/testall.html	(revision 3046)
@@ -0,0 +1,95 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>CKEditor Core Tests Runner</title>
+	<link rel="stylesheet" type="text/css" href="test.css" />
+	<script type="text/javascript">
+	//<![CDATA[
+
+var testList =
+[
+	'core/ajax',
+	'core/ckeditor',
+//	'core/ckeditor2',
+	'core/editor',
+	'core/env',
+	'core/event',
+	'core/scriptloader',
+	'core/tools',
+	'core/xml',
+	'core/dom/document',
+	'core/dom/element',
+	'core/dom/node',
+	'core/dom/range',
+	'core/dom/window',
+	'core/htmlparser/fragment',
+	'plugins/htmldataprocessor/htmldataprocessor',
+	'plugins/styles/styles'
+];
+
+var currentTest;
+var totalFailed = 0;
+var totalPassed = 0;
+
+function runTest()
+{
+	currentTest = testList.shift();
+
+	if ( currentTest )
+		document.getElementById( 'testFrame' ).src = currentTest + '.html';
+}
+
+function onTestStart( data )
+{
+	var div = document.getElementById('testLogger').appendChild( document.createElement( 'div' ) );
+	div.className = 'testEntry';
+	div.innerHTML = 'Testing "' + data.testCase.name + '"...';
+}
+
+function onTestComplete( data )
+{
+	var failed = data.results.failed;
+	var passed = data.results.passed;
+
+	var html = '<span class="testIgnore">Unknown</span>';
+
+	if ( failed > 0 )
+		html = '<span class="testFail">FAIL</span>';
+	else
+		html = '<span class="testPass">PASS</span>';
+
+	html += ' <a href="' + currentTest + '.html" target="_blank">Test case "' + data.testCase.name + '"</a> (' + failed + ' failed / ' + passed + ' passed)';
+
+	var div = document.getElementById('testLogger').lastChild;
+	div.innerHTML = html;
+
+	totalFailed += failed;
+	totalPassed += passed;
+
+	document.getElementById('testFailed').innerHTML = totalFailed;
+	document.getElementById('testPassed').innerHTML = totalPassed;
+
+	document.title = totalFailed + ' failed / ' + totalPassed + ' passed - CKEditor Core Tests Runner';
+
+	runTest();
+}
+
+window.onload = function()
+{
+	// IE was "caching" the latest logged div on refresh. So, we must clean it
+	// on startup.
+	document.getElementById('testLogger').innerHTML = '';
+
+	runTest();
+};
+
+	//]]>
+	</script>
+</head>
+<body>
+	<h1>CKEditor Core Tests Runner (<span id="testFailed">0</span> failed / <span id="testPassed">0</span> passed)</h1>
+	<iframe id="testFrame" src="javascript:;" style="position: absolute; width: 50px; height: 50px; left: -1000px">
+	</iframe>
+	<div id="testLogger" class="testAll"></div>
+</body>
+</html>
Index: /CKEditor/tags/3.0 Beta/_source/tests/yuitest.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/tests/yuitest.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/tests/yuitest.js	(revision 3046)
@@ -0,0 +1,71 @@
+﻿/*jsl:ignoreall*/
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.2
+
+== BEGIN LICENSE ==
+
+Software License Agreement (BSD License)
+
+Copyright (c) 2008, Yahoo! Inc.
+All rights reserved.
+
+Redistribution and use of this software in source and binary forms, with or without modification, are
+permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above
+  copyright notice, this list of conditions and the
+  following disclaimer.
+
+* Redistributions in binary form must reproduce the above
+  copyright notice, this list of conditions and the
+  following disclaimer in the documentation and/or other
+  materials provided with the distribution.
+
+* Neither the name of Yahoo! Inc. nor the names of its
+  contributors may be used to endorse or promote products
+  derived from this software without specific prior
+  written permission of Yahoo! Inc.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+== END LICENSE ==
+*/
+
+/*
+This file contains the YUI Tester code as well as its dependencies, in the
+order defined at:
+http://developer.yahoo.com/yui/yuitest/
+*/
+
+// yahoo-dom-event/yahoo-dom-event.js
+if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C<A.length;C=C+1){D=A[C].split(".");E=YAHOO;for(B=(D[0]=="YAHOO")?1:0;B<D.length;B=B+1){E[D[B]]=E[D[B]]||{};E=E[D[B]];}}return E;};YAHOO.log=function(D,A,C){var B=YAHOO.widget.Logger;if(B&&B.log){return B.log(D,A,C);}else{return false;}};YAHOO.register=function(A,E,D){var I=YAHOO.env.modules;if(!I[A]){I[A]={versions:[],builds:[]};}var B=I[A],H=D.version,G=D.build,F=YAHOO.env.listeners;B.name=A;B.version=H;B.build=G;B.versions.push(H);B.builds.push(G);B.mainClass=E;for(var C=0;C<F.length;C=C+1){F[C](B);}if(E){E.VERSION=H;E.BUILD=G;}else{YAHOO.log("mainClass is undefined for module "+A,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(A){return YAHOO.env.modules[A]||null;};YAHOO.env.ua=function(){var C={ie:0,opera:0,gecko:0,webkit:0,mobile:null,air:0};var B=navigator.userAgent,A;if((/KHTML/).test(B)){C.webkit=1;}A=B.match(/AppleWebKit\/([^\s]*)/);if(A&&A[1]){C.webkit=parseFloat(A[1]);if(/ Mobile\//.test(B)){C.mobile="Apple";}else{A=B.match(/NokiaN[^\/]*/);if(A){C.mobile=A[0];}}A=B.match(/AdobeAIR\/([^\s]*)/);if(A){C.air=A[0];}}if(!C.webkit){A=B.match(/Opera[\s\/]([^\s]*)/);if(A&&A[1]){C.opera=parseFloat(A[1]);A=B.match(/Opera Mini[^;]*/);if(A){C.mobile=A[0];}}else{A=B.match(/MSIE\s([^;]*)/);if(A&&A[1]){C.ie=parseFloat(A[1]);}else{A=B.match(/Gecko\/([^\s]*)/);if(A){C.gecko=1;A=B.match(/rv:([^\s\)]*)/);if(A&&A[1]){C.gecko=parseFloat(A[1]);}}}}}return C;}();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var B=YAHOO_config.listener,A=YAHOO.env.listeners,D=true,C;if(B){for(C=0;C<A.length;C=C+1){if(A[C]==B){D=false;break;}}if(D){A.push(B);}}}})();YAHOO.lang=YAHOO.lang||{};(function(){var A=YAHOO.lang,C=["toString","valueOf"],B={isArray:function(D){if(D){return A.isNumber(D.length)&&A.isFunction(D.splice);}return false;},isBoolean:function(D){return typeof D==="boolean";},isFunction:function(D){return typeof D==="function";},isNull:function(D){return D===null;},isNumber:function(D){return typeof D==="number"&&isFinite(D);},isObject:function(D){return(D&&(typeof D==="object"||A.isFunction(D)))||false;},isString:function(D){return typeof D==="string";},isUndefined:function(D){return typeof D==="undefined";},_IEEnumFix:(YAHOO.env.ua.ie)?function(F,E){for(var D=0;D<C.length;D=D+1){var H=C[D],G=E[H];if(A.isFunction(G)&&G!=Object.prototype[H]){F[H]=G;}}}:function(){},extend:function(H,I,G){if(!I||!H){throw new Error("extend failed, please check that "+"all dependencies are included.");}var E=function(){};E.prototype=I.prototype;H.prototype=new E();H.prototype.constructor=H;H.superclass=I.prototype;if(I.prototype.constructor==Object.prototype.constructor){I.prototype.constructor=I;}if(G){for(var D in G){if(A.hasOwnProperty(G,D)){H.prototype[D]=G[D];}}A._IEEnumFix(H.prototype,G);}},augmentObject:function(H,G){if(!G||!H){throw new Error("Absorb failed, verify dependencies.");}var D=arguments,F,I,E=D[2];if(E&&E!==true){for(F=2;F<D.length;F=F+1){H[D[F]]=G[D[F]];}}else{for(I in G){if(E||!(I in H)){H[I]=G[I];}}A._IEEnumFix(H,G);}},augmentProto:function(G,F){if(!F||!G){throw new Error("Augment failed, verify dependencies.");}var D=[G.prototype,F.prototype];for(var E=2;E<arguments.length;E=E+1){D.push(arguments[E]);}A.augmentObject.apply(this,D);},dump:function(D,I){var F,H,K=[],L="{...}",E="f(){...}",J=", ",G=" => ";if(!A.isObject(D)){return D+"";}else{if(D instanceof Date||("nodeType" in D&&"tagName" in D)){return D;}else{if(A.isFunction(D)){return E;}}}I=(A.isNumber(I))?I:3;if(A.isArray(D)){K.push("[");for(F=0,H=D.length;F<H;F=F+1){if(A.isObject(D[F])){K.push((I>0)?A.dump(D[F],I-1):L);}else{K.push(D[F]);}K.push(J);}if(K.length>1){K.pop();}K.push("]");}else{K.push("{");for(F in D){if(A.hasOwnProperty(D,F)){K.push(F+G);if(A.isObject(D[F])){K.push((I>0)?A.dump(D[F],I-1):L);}else{K.push(D[F]);}K.push(J);}}if(K.length>1){K.pop();}K.push("}");}return K.join("");},substitute:function(S,E,L){var I,H,G,O,P,R,N=[],F,J="dump",M=" ",D="{",Q="}";for(;;){I=S.lastIndexOf(D);if(I<0){break;}H=S.indexOf(Q,I);if(I+1>=H){break;}F=S.substring(I+1,H);O=F;R=null;G=O.indexOf(M);if(G>-1){R=O.substring(G+1);O=O.substring(0,G);}P=E[O];if(L){P=L(O,P,R);}if(A.isObject(P)){if(A.isArray(P)){P=A.dump(P,parseInt(R,10));}else{R=R||"";var K=R.indexOf(J);if(K>-1){R=R.substring(4);}if(P.toString===Object.prototype.toString||K>-1){P=A.dump(P,parseInt(R,10));}else{P=P.toString();}}}else{if(!A.isString(P)&&!A.isNumber(P)){P="~-"+N.length+"-~";N[N.length]=F;}}S=S.substring(0,I)+P+S.substring(H+1);}for(I=N.length-1;I>=0;I=I-1){S=S.replace(new RegExp("~-"+I+"-~"),"{"+N[I]+"}","g");}return S;},trim:function(D){try{return D.replace(/^\s+|\s+$/g,"");}catch(E){return D;}},merge:function(){var G={},E=arguments;for(var F=0,D=E.length;F<D;F=F+1){A.augmentObject(G,E[F],true);}return G;},later:function(K,E,L,G,H){K=K||0;E=E||{};var F=L,J=G,I,D;if(A.isString(L)){F=E[L];}if(!F){throw new TypeError("method undefined");}if(!A.isArray(J)){J=[G];}I=function(){F.apply(E,J);};D=(H)?setInterval(I,K):setTimeout(I,K);return{interval:H,cancel:function(){if(this.interval){clearInterval(D);}else{clearTimeout(D);}}};},isValue:function(D){return(A.isObject(D)||A.isString(D)||A.isNumber(D)||A.isBoolean(D));}};A.hasOwnProperty=(Object.prototype.hasOwnProperty)?function(D,E){return D&&D.hasOwnProperty(E);}:function(D,E){return !A.isUndefined(D[E])&&D.constructor.prototype[E]!==D[E];};B.augmentObject(A,B,true);YAHOO.util.Lang=A;A.augment=A.augmentProto;YAHOO.augment=A.augmentProto;YAHOO.extend=A.extend;})();YAHOO.register("yahoo",YAHOO,{version:"2.5.2",build:"1076"});YAHOO.util.Get=function(){var M={},L=0,Q=0,E=false,N=YAHOO.env.ua,R=YAHOO.lang;var J=function(V,S,W){var T=W||window,X=T.document,Y=X.createElement(V);for(var U in S){if(S[U]&&YAHOO.lang.hasOwnProperty(S,U)){Y.setAttribute(U,S[U]);}}return Y;};var H=function(S,T,V){var U=V||"utf-8";return J("link",{"id":"yui__dyn_"+(Q++),"type":"text/css","charset":U,"rel":"stylesheet","href":S},T);
+};var O=function(S,T,V){var U=V||"utf-8";return J("script",{"id":"yui__dyn_"+(Q++),"type":"text/javascript","charset":U,"src":S},T);};var A=function(S,T){return{tId:S.tId,win:S.win,data:S.data,nodes:S.nodes,msg:T,purge:function(){D(this.tId);}};};var B=function(S,V){var T=M[V],U=(R.isString(S))?T.win.document.getElementById(S):S;if(!U){P(V,"target node not found: "+S);}return U;};var P=function(V,U){var S=M[V];if(S.onFailure){var T=S.scope||S.win;S.onFailure.call(T,A(S,U));}};var C=function(V){var S=M[V];S.finished=true;if(S.aborted){var U="transaction "+V+" was aborted";P(V,U);return ;}if(S.onSuccess){var T=S.scope||S.win;S.onSuccess.call(T,A(S));}};var G=function(U,Y){var T=M[U];if(T.aborted){var W="transaction "+U+" was aborted";P(U,W);return ;}if(Y){T.url.shift();if(T.varName){T.varName.shift();}}else{T.url=(R.isString(T.url))?[T.url]:T.url;if(T.varName){T.varName=(R.isString(T.varName))?[T.varName]:T.varName;}}var b=T.win,a=b.document,Z=a.getElementsByTagName("head")[0],V;if(T.url.length===0){if(T.type==="script"&&N.webkit&&N.webkit<420&&!T.finalpass&&!T.varName){var X=O(null,T.win,T.charset);X.innerHTML='YAHOO.util.Get._finalize("'+U+'");';T.nodes.push(X);Z.appendChild(X);}else{C(U);}return ;}var S=T.url[0];if(T.type==="script"){V=O(S,b,T.charset);}else{V=H(S,b,T.charset);}F(T.type,V,U,S,b,T.url.length);T.nodes.push(V);if(T.insertBefore){var c=B(T.insertBefore,U);if(c){c.parentNode.insertBefore(V,c);}}else{Z.appendChild(V);}if((N.webkit||N.gecko)&&T.type==="css"){G(U,S);}};var K=function(){if(E){return ;}E=true;for(var S in M){var T=M[S];if(T.autopurge&&T.finished){D(T.tId);delete M[S];}}E=false;};var D=function(Z){var W=M[Z];if(W){var Y=W.nodes,S=Y.length,X=W.win.document,V=X.getElementsByTagName("head")[0];if(W.insertBefore){var U=B(W.insertBefore,Z);if(U){V=U.parentNode;}}for(var T=0;T<S;T=T+1){V.removeChild(Y[T]);}}W.nodes=[];};var I=function(T,S,U){var W="q"+(L++);U=U||{};if(L%YAHOO.util.Get.PURGE_THRESH===0){K();}M[W]=R.merge(U,{tId:W,type:T,url:S,finished:false,nodes:[]});var V=M[W];V.win=V.win||window;V.scope=V.scope||V.win;V.autopurge=("autopurge" in V)?V.autopurge:(T==="script")?true:false;R.later(0,V,G,W);return{tId:W};};var F=function(b,W,V,T,X,Y,a){var Z=a||G;if(N.ie){W.onreadystatechange=function(){var c=this.readyState;if("loaded"===c||"complete"===c){Z(V,T);}};}else{if(N.webkit){if(b==="script"){if(N.webkit>=420){W.addEventListener("load",function(){Z(V,T);});}else{var S=M[V];if(S.varName){var U=YAHOO.util.Get.POLL_FREQ;S.maxattempts=YAHOO.util.Get.TIMEOUT/U;S.attempts=0;S._cache=S.varName[0].split(".");S.timer=R.later(U,S,function(h){var e=this._cache,d=e.length,c=this.win,f;for(f=0;f<d;f=f+1){c=c[e[f]];if(!c){this.attempts++;if(this.attempts++>this.maxattempts){var g="Over retry limit, giving up";S.timer.cancel();P(V,g);}else{}return ;}}S.timer.cancel();Z(V,T);},null,true);}else{R.later(YAHOO.util.Get.POLL_FREQ,null,Z,[V,T]);}}}}else{W.onload=function(){Z(V,T);};}}};return{POLL_FREQ:10,PURGE_THRESH:20,TIMEOUT:2000,_finalize:function(S){R.later(0,null,C,S);},abort:function(T){var U=(R.isString(T))?T:T.tId;var S=M[U];if(S){S.aborted=true;}},script:function(S,T){return I("script",S,T);},css:function(S,T){return I("css",S,T);}};}();YAHOO.register("get",YAHOO.util.Get,{version:"2.5.2",build:"1076"});(function(){var Y=YAHOO,util=Y.util,lang=Y.lang,env=Y.env,PROV="_provides",SUPER="_supersedes",REQ="expanded",AFTER="_after";var YUI={dupsAllowed:{"yahoo":true,"get":true},info:{"base":"http://yui.yahooapis.com/2.5.2/build/","skin":{"defaultSkin":"sam","base":"assets/skins/","path":"skin.css","after":["reset","fonts","grids","base"],"rollup":3},dupsAllowed:["yahoo","get"],"moduleInfo":{"animation":{"type":"js","path":"animation/animation-min.js","requires":["dom","event"]},"autocomplete":{"type":"js","path":"autocomplete/autocomplete-min.js","requires":["dom","event"],"optional":["connection","animation"],"skinnable":true},"base":{"type":"css","path":"base/base-min.css","after":["reset","fonts","grids"]},"button":{"type":"js","path":"button/button-min.js","requires":["element"],"optional":["menu"],"skinnable":true},"calendar":{"type":"js","path":"calendar/calendar-min.js","requires":["event","dom"],"skinnable":true},"charts":{"type":"js","path":"charts/charts-experimental-min.js","requires":["element","json","datasource"]},"colorpicker":{"type":"js","path":"colorpicker/colorpicker-min.js","requires":["slider","element"],"optional":["animation"],"skinnable":true},"connection":{"type":"js","path":"connection/connection-min.js","requires":["event"]},"container":{"type":"js","path":"container/container-min.js","requires":["dom","event"],"optional":["dragdrop","animation","connection"],"supersedes":["containercore"],"skinnable":true},"containercore":{"type":"js","path":"container/container_core-min.js","requires":["dom","event"],"pkg":"container"},"cookie":{"type":"js","path":"cookie/cookie-beta-min.js","requires":["yahoo"]},"datasource":{"type":"js","path":"datasource/datasource-beta-min.js","requires":["event"],"optional":["connection"]},"datatable":{"type":"js","path":"datatable/datatable-beta-min.js","requires":["element","datasource"],"optional":["calendar","dragdrop"],"skinnable":true},"dom":{"type":"js","path":"dom/dom-min.js","requires":["yahoo"]},"dragdrop":{"type":"js","path":"dragdrop/dragdrop-min.js","requires":["dom","event"]},"editor":{"type":"js","path":"editor/editor-beta-min.js","requires":["menu","element","button"],"optional":["animation","dragdrop"],"supersedes":["simpleeditor"],"skinnable":true},"element":{"type":"js","path":"element/element-beta-min.js","requires":["dom","event"]},"event":{"type":"js","path":"event/event-min.js","requires":["yahoo"]},"fonts":{"type":"css","path":"fonts/fonts-min.css"},"get":{"type":"js","path":"get/get-min.js","requires":["yahoo"]},"grids":{"type":"css","path":"grids/grids-min.css","requires":["fonts"],"optional":["reset"]},"history":{"type":"js","path":"history/history-min.js","requires":["event"]},"imagecropper":{"type":"js","path":"imagecropper/imagecropper-beta-min.js","requires":["dom","event","dragdrop","element","resize"],"skinnable":true},"imageloader":{"type":"js","path":"imageloader/imageloader-min.js","requires":["event","dom"]},"json":{"type":"js","path":"json/json-min.js","requires":["yahoo"]},"layout":{"type":"js","path":"layout/layout-beta-min.js","requires":["dom","event","element"],"optional":["animation","dragdrop","resize","selector"],"skinnable":true},"logger":{"type":"js","path":"logger/logger-min.js","requires":["event","dom"],"optional":["dragdrop"],"skinnable":true},"menu":{"type":"js","path":"menu/menu-min.js","requires":["containercore"],"skinnable":true},"profiler":{"type":"js","path":"profiler/profiler-beta-min.js","requires":["yahoo"]},"profilerviewer":{"type":"js","path":"profilerviewer/profilerviewer-beta-min.js","requires":["profiler","yuiloader","element"],"skinnable":true},"reset":{"type":"css","path":"reset/reset-min.css"},"reset-fonts-grids":{"type":"css","path":"reset-fonts-grids/reset-fonts-grids.css","supersedes":["reset","fonts","grids","reset-fonts"],"rollup":4},"reset-fonts":{"type":"css","path":"reset-fonts/reset-fonts.css","supersedes":["reset","fonts"],"rollup":2},"resize":{"type":"js","path":"resize/resize-beta-min.js","requires":["dom","event","dragdrop","element"],"optional":["animation"],"skinnable":true},"selector":{"type":"js","path":"selector/selector-beta-min.js","requires":["yahoo","dom"]},"simpleeditor":{"type":"js","path":"editor/simpleeditor-beta-min.js","requires":["element"],"optional":["containercore","menu","button","animation","dragdrop"],"skinnable":true,"pkg":"editor"},"slider":{"type":"js","path":"slider/slider-min.js","requires":["dragdrop"],"optional":["animation"]},"tabview":{"type":"js","path":"tabview/tabview-min.js","requires":["element"],"optional":["connection"],"skinnable":true},"treeview":{"type":"js","path":"treeview/treeview-min.js","requires":["event"],"skinnable":true},"uploader":{"type":"js","path":"uploader/uploader-experimental.js","requires":["element"]},"utilities":{"type":"js","path":"utilities/utilities.js","supersedes":["yahoo","event","dragdrop","animation","dom","connection","element","yahoo-dom-event","get","yuiloader","yuiloader-dom-event"],"rollup":8},"yahoo":{"type":"js","path":"yahoo/yahoo-min.js"},"yahoo-dom-event":{"type":"js","path":"yahoo-dom-event/yahoo-dom-event.js","supersedes":["yahoo","event","dom"],"rollup":3},"yuiloader":{"type":"js","path":"yuiloader/yuiloader-beta-min.js","supersedes":["yahoo","get"]},"yuiloader-dom-event":{"type":"js","path":"yuiloader-dom-event/yuiloader-dom-event.js","supersedes":["yahoo","dom","event","get","yuiloader","yahoo-dom-event"],"rollup":5},"yuitest":{"type":"js","path":"yuitest/yuitest-min.js","requires":["logger"],"skinnable":true}}},ObjectUtil:{appendArray:function(o,a){if(a){for(var i=0;
+i<a.length;i=i+1){o[a[i]]=true;}}},keys:function(o,ordered){var a=[],i;for(i in o){if(lang.hasOwnProperty(o,i)){a.push(i);}}return a;}},ArrayUtil:{appendArray:function(a1,a2){Array.prototype.push.apply(a1,a2);},indexOf:function(a,val){for(var i=0;i<a.length;i=i+1){if(a[i]===val){return i;}}return -1;},toObject:function(a){var o={};for(var i=0;i<a.length;i=i+1){o[a[i]]=true;}return o;},uniq:function(a){return YUI.ObjectUtil.keys(YUI.ArrayUtil.toObject(a));}}};YAHOO.util.YUILoader=function(o){this._internalCallback=null;this._useYahooListener=false;this.onSuccess=null;this.onFailure=Y.log;this.onProgress=null;this.scope=this;this.data=null;this.insertBefore=null;this.charset=null;this.varName=null;this.base=YUI.info.base;this.ignore=null;this.force=null;this.allowRollup=true;this.filter=null;this.required={};this.moduleInfo=lang.merge(YUI.info.moduleInfo);this.rollups=null;this.loadOptional=false;this.sorted=[];this.loaded={};this.dirty=true;this.inserted={};var self=this;env.listeners.push(function(m){if(self._useYahooListener){self.loadNext(m.name);}});this.skin=lang.merge(YUI.info.skin);this._config(o);};Y.util.YUILoader.prototype={FILTERS:{RAW:{"searchExp":"-min\\.js","replaceStr":".js"},DEBUG:{"searchExp":"-min\\.js","replaceStr":"-debug.js"}},SKIN_PREFIX:"skin-",_config:function(o){if(o){for(var i in o){if(lang.hasOwnProperty(o,i)){if(i=="require"){this.require(o[i]);}else{this[i]=o[i];}}}}var f=this.filter;if(lang.isString(f)){f=f.toUpperCase();if(f==="DEBUG"){this.require("logger");}if(!Y.widget.LogWriter){Y.widget.LogWriter=function(){return Y;};}this.filter=this.FILTERS[f];}},addModule:function(o){if(!o||!o.name||!o.type||(!o.path&&!o.fullpath)){return false;}o.ext=("ext" in o)?o.ext:true;o.requires=o.requires||[];this.moduleInfo[o.name]=o;this.dirty=true;return true;},require:function(what){var a=(typeof what==="string")?arguments:what;this.dirty=true;YUI.ObjectUtil.appendArray(this.required,a);},_addSkin:function(skin,mod){var name=this.formatSkin(skin),info=this.moduleInfo,sinf=this.skin,ext=info[mod]&&info[mod].ext;if(!info[name]){this.addModule({"name":name,"type":"css","path":sinf.base+skin+"/"+sinf.path,"after":sinf.after,"rollup":sinf.rollup,"ext":ext});}if(mod){name=this.formatSkin(skin,mod);if(!info[name]){var mdef=info[mod],pkg=mdef.pkg||mod;this.addModule({"name":name,"type":"css","after":sinf.after,"path":pkg+"/"+sinf.base+skin+"/"+mod+".css","ext":ext});}}return name;},getRequires:function(mod){if(!mod){return[];}if(!this.dirty&&mod.expanded){return mod.expanded;}mod.requires=mod.requires||[];var i,d=[],r=mod.requires,o=mod.optional,info=this.moduleInfo,m;for(i=0;i<r.length;i=i+1){d.push(r[i]);m=info[r[i]];YUI.ArrayUtil.appendArray(d,this.getRequires(m));}if(o&&this.loadOptional){for(i=0;i<o.length;i=i+1){d.push(o[i]);YUI.ArrayUtil.appendArray(d,this.getRequires(info[o[i]]));}}mod.expanded=YUI.ArrayUtil.uniq(d);return mod.expanded;},getProvides:function(name,notMe){var addMe=!(notMe),ckey=(addMe)?PROV:SUPER,m=this.moduleInfo[name],o={};if(!m){return o;}if(m[ckey]){return m[ckey];}var s=m.supersedes,done={},me=this;var add=function(mm){if(!done[mm]){done[mm]=true;lang.augmentObject(o,me.getProvides(mm));}};if(s){for(var i=0;i<s.length;i=i+1){add(s[i]);}}m[SUPER]=o;m[PROV]=lang.merge(o);m[PROV][name]=true;return m[ckey];},calculate:function(o){if(this.dirty){this._config(o);this._setup();this._explode();if(this.allowRollup){this._rollup();}this._reduce();this._sort();this.dirty=false;}},_setup:function(){var info=this.moduleInfo,name,i,j;for(name in info){var m=info[name];if(m&&m.skinnable){var o=this.skin.overrides,smod;if(o&&o[name]){for(i=0;i<o[name].length;i=i+1){smod=this._addSkin(o[name][i],name);}}else{smod=this._addSkin(this.skin.defaultSkin,name);}m.requires.push(smod);}}var l=lang.merge(this.inserted);if(!this._sandbox){l=lang.merge(l,env.modules);}if(this.ignore){YUI.ObjectUtil.appendArray(l,this.ignore);}if(this.force){for(i=0;i<this.force.length;i=i+1){if(this.force[i] in l){delete l[this.force[i]];}}}for(j in l){if(lang.hasOwnProperty(l,j)){lang.augmentObject(l,this.getProvides(j));}}this.loaded=l;},_explode:function(){var r=this.required,i,mod;for(i in r){mod=this.moduleInfo[i];if(mod){var req=this.getRequires(mod);if(req){YUI.ObjectUtil.appendArray(r,req);}}}},_skin:function(){},formatSkin:function(skin,mod){var s=this.SKIN_PREFIX+skin;if(mod){s=s+"-"+mod;}return s;},parseSkin:function(mod){if(mod.indexOf(this.SKIN_PREFIX)===0){var a=mod.split("-");return{skin:a[1],module:a[2]};}return null;},_rollup:function(){var i,j,m,s,rollups={},r=this.required,roll;if(this.dirty||!this.rollups){for(i in this.moduleInfo){m=this.moduleInfo[i];if(m&&m.rollup){rollups[i]=m;}}this.rollups=rollups;}for(;;){var rolled=false;for(i in rollups){if(!r[i]&&!this.loaded[i]){m=this.moduleInfo[i];s=m.supersedes;roll=false;if(!m.rollup){continue;}var skin=(m.ext)?false:this.parseSkin(i),c=0;if(skin){for(j in r){if(i!==j&&this.parseSkin(j)){c++;roll=(c>=m.rollup);if(roll){break;}}}}else{for(j=0;j<s.length;j=j+1){if(this.loaded[s[j]]&&(!YUI.dupsAllowed[s[j]])){roll=false;break;}else{if(r[s[j]]){c++;roll=(c>=m.rollup);if(roll){break;}}}}}if(roll){r[i]=true;rolled=true;this.getRequires(m);}}}if(!rolled){break;}}},_reduce:function(){var i,j,s,m,r=this.required;for(i in r){if(i in this.loaded){delete r[i];}else{var skinDef=this.parseSkin(i);if(skinDef){if(!skinDef.module){var skin_pre=this.SKIN_PREFIX+skinDef.skin;for(j in r){m=this.moduleInfo[j];var ext=m&&m.ext;if(!ext&&j!==i&&j.indexOf(skin_pre)>-1){delete r[j];}}}}else{m=this.moduleInfo[i];s=m&&m.supersedes;if(s){for(j=0;j<s.length;j=j+1){if(s[j] in r){delete r[s[j]];}}}}}}},_sort:function(){var s=[],info=this.moduleInfo,loaded=this.loaded,checkOptional=!this.loadOptional,me=this;var requires=function(aa,bb){if(loaded[bb]){return false;}var ii,mm=info[aa],rr=mm&&mm.expanded,after=mm&&mm.after,other=info[bb],optional=mm&&mm.optional;if(rr&&YUI.ArrayUtil.indexOf(rr,bb)>-1){return true;}if(after&&YUI.ArrayUtil.indexOf(after,bb)>-1){return true;
+}if(checkOptional&&optional&&YUI.ArrayUtil.indexOf(optional,bb)>-1){return true;}var ss=info[bb]&&info[bb].supersedes;if(ss){for(ii=0;ii<ss.length;ii=ii+1){if(requires(aa,ss[ii])){return true;}}}if(mm.ext&&mm.type=="css"&&(!other.ext)){return true;}return false;};for(var i in this.required){s.push(i);}var p=0;for(;;){var l=s.length,a,b,j,k,moved=false;for(j=p;j<l;j=j+1){a=s[j];for(k=j+1;k<l;k=k+1){if(requires(a,s[k])){b=s.splice(k,1);s.splice(j,0,b[0]);moved=true;break;}}if(moved){break;}else{p=p+1;}}if(!moved){break;}}this.sorted=s;},toString:function(){var o={type:"YUILoader",base:this.base,filter:this.filter,required:this.required,loaded:this.loaded,inserted:this.inserted};lang.dump(o,1);},insert:function(o,type){this.calculate(o);if(!type){var self=this;this._internalCallback=function(){self._internalCallback=null;self.insert(null,"js");};this.insert(null,"css");return ;}this._loading=true;this.loadType=type;this.loadNext();},sandbox:function(o,type){if(o){}else{}this._config(o);if(!this.onSuccess){throw new Error("You must supply an onSuccess handler for your sandbox");}this._sandbox=true;var self=this;if(!type||type!=="js"){this._internalCallback=function(){self._internalCallback=null;self.sandbox(null,"js");};this.insert(null,"css");return ;}if(!util.Connect){var ld=new YAHOO.util.YUILoader();ld.insert({base:this.base,filter:this.filter,require:"connection",insertBefore:this.insertBefore,charset:this.charset,onSuccess:function(){this.sandbox(null,"js");},scope:this},"js");return ;}this._scriptText=[];this._loadCount=0;this._stopCount=this.sorted.length;this._xhr=[];this.calculate();var s=this.sorted,l=s.length,i,m,url;for(i=0;i<l;i=i+1){m=this.moduleInfo[s[i]];if(!m){this.onFailure.call(this.scope,{msg:"undefined module "+m,data:this.data});for(var j=0;j<this._xhr.length;j=j+1){this._xhr[j].abort();}return ;}if(m.type!=="js"){this._loadCount++;continue;}url=m.fullpath||this._url(m.path);var xhrData={success:function(o){var idx=o.argument[0],name=o.argument[2];this._scriptText[idx]=o.responseText;if(this.onProgress){this.onProgress.call(this.scope,{name:name,scriptText:o.responseText,xhrResponse:o,data:this.data});}this._loadCount++;if(this._loadCount>=this._stopCount){var v=this.varName||"YAHOO";var t="(function() {\n";var b="\nreturn "+v+";\n})();";var ref=eval(t+this._scriptText.join("\n")+b);this._pushEvents(ref);if(ref){this.onSuccess.call(this.scope,{reference:ref,data:this.data});}else{this.onFailure.call(this.scope,{msg:this.varName+" reference failure",data:this.data});}}},failure:function(o){this.onFailure.call(this.scope,{msg:"XHR failure",xhrResponse:o,data:this.data});},scope:this,argument:[i,url,s[i]]};this._xhr.push(util.Connect.asyncRequest("GET",url,xhrData));}},loadNext:function(mname){if(!this._loading){return ;}if(mname){if(mname!==this._loading){return ;}this.inserted[mname]=true;if(this.onProgress){this.onProgress.call(this.scope,{name:mname,data:this.data});}}var s=this.sorted,len=s.length,i,m;for(i=0;i<len;i=i+1){if(s[i] in this.inserted){continue;}if(s[i]===this._loading){return ;}m=this.moduleInfo[s[i]];if(!m){this.onFailure.call(this.scope,{msg:"undefined module "+m,data:this.data});return ;}if(!this.loadType||this.loadType===m.type){this._loading=s[i];var fn=(m.type==="css")?util.Get.css:util.Get.script,url=m.fullpath||this._url(m.path),self=this,c=function(o){self.loadNext(o.data);};if(env.ua.webkit&&env.ua.webkit<420&&m.type==="js"&&!m.varName){c=null;this._useYahooListener=true;}fn(url,{data:s[i],onSuccess:c,insertBefore:this.insertBefore,charset:this.charset,varName:m.varName,scope:self});return ;}}this._loading=null;if(this._internalCallback){var f=this._internalCallback;this._internalCallback=null;f.call(this);}else{if(this.onSuccess){this._pushEvents();this.onSuccess.call(this.scope,{data:this.data});}}},_pushEvents:function(ref){var r=ref||YAHOO;if(r.util&&r.util.Event){r.util.Event._load();}},_url:function(path){var u=this.base||"",f=this.filter;u=u+path;if(f){u=u.replace(new RegExp(f.searchExp),f.replaceStr);}return u;}};})();(function(){var B=YAHOO.util,K,I,J={},F={},M=window.document;YAHOO.env._id_counter=YAHOO.env._id_counter||0;var C=YAHOO.env.ua.opera,L=YAHOO.env.ua.webkit,A=YAHOO.env.ua.gecko,G=YAHOO.env.ua.ie;var E={HYPHEN:/(-[a-z])/i,ROOT_TAG:/^body|html$/i,OP_SCROLL:/^(?:inline|table-row)$/i};var N=function(P){if(!E.HYPHEN.test(P)){return P;}if(J[P]){return J[P];}var Q=P;while(E.HYPHEN.exec(Q)){Q=Q.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}J[P]=Q;return Q;};var O=function(Q){var P=F[Q];if(!P){P=new RegExp("(?:^|\\s+)"+Q+"(?:\\s+|$)");F[Q]=P;}return P;};if(M.defaultView&&M.defaultView.getComputedStyle){K=function(P,S){var R=null;if(S=="float"){S="cssFloat";}var Q=P.ownerDocument.defaultView.getComputedStyle(P,"");if(Q){R=Q[N(S)];}return P.style[S]||R;};}else{if(M.documentElement.currentStyle&&G){K=function(P,R){switch(N(R)){case"opacity":var T=100;try{T=P.filters["DXImageTransform.Microsoft.Alpha"].opacity;}catch(S){try{T=P.filters("alpha").opacity;}catch(S){}}return T/100;case"float":R="styleFloat";default:var Q=P.currentStyle?P.currentStyle[R]:null;return(P.style[R]||Q);}};}else{K=function(P,Q){return P.style[Q];};}}if(G){I=function(P,Q,R){switch(Q){case"opacity":if(YAHOO.lang.isString(P.style.filter)){P.style.filter="alpha(opacity="+R*100+")";if(!P.currentStyle||!P.currentStyle.hasLayout){P.style.zoom=1;}}break;case"float":Q="styleFloat";default:P.style[Q]=R;}};}else{I=function(P,Q,R){if(Q=="float"){Q="cssFloat";}P.style[Q]=R;};}var D=function(P,Q){return P&&P.nodeType==1&&(!Q||Q(P));};YAHOO.util.Dom={get:function(R){if(R&&(R.nodeType||R.item)){return R;}if(YAHOO.lang.isString(R)||!R){return M.getElementById(R);}if(R.length!==undefined){var S=[];for(var Q=0,P=R.length;Q<P;++Q){S[S.length]=B.Dom.get(R[Q]);}return S;}return R;},getStyle:function(P,R){R=N(R);var Q=function(S){return K(S,R);};return B.Dom.batch(P,Q,B.Dom,true);},setStyle:function(P,R,S){R=N(R);var Q=function(T){I(T,R,S);};B.Dom.batch(P,Q,B.Dom,true);},getXY:function(P){var Q=function(R){if((R.parentNode===null||R.offsetParent===null||this.getStyle(R,"display")=="none")&&R!=R.ownerDocument.body){return false;}return H(R);};return B.Dom.batch(P,Q,B.Dom,true);},getX:function(P){var Q=function(R){return B.Dom.getXY(R)[0];};return B.Dom.batch(P,Q,B.Dom,true);},getY:function(P){var Q=function(R){return B.Dom.getXY(R)[1];};return B.Dom.batch(P,Q,B.Dom,true);},setXY:function(P,S,R){var Q=function(V){var U=this.getStyle(V,"position");if(U=="static"){this.setStyle(V,"position","relative");U="relative";}var X=this.getXY(V);if(X===false){return false;}var W=[parseInt(this.getStyle(V,"left"),10),parseInt(this.getStyle(V,"top"),10)];if(isNaN(W[0])){W[0]=(U=="relative")?0:V.offsetLeft;}if(isNaN(W[1])){W[1]=(U=="relative")?0:V.offsetTop;}if(S[0]!==null){V.style.left=S[0]-X[0]+W[0]+"px";}if(S[1]!==null){V.style.top=S[1]-X[1]+W[1]+"px";}if(!R){var T=this.getXY(V);if((S[0]!==null&&T[0]!=S[0])||(S[1]!==null&&T[1]!=S[1])){this.setXY(V,S,true);}}};B.Dom.batch(P,Q,B.Dom,true);},setX:function(Q,P){B.Dom.setXY(Q,[P,null]);},setY:function(P,Q){B.Dom.setXY(P,[null,Q]);},getRegion:function(P){var Q=function(R){if((R.parentNode===null||R.offsetParent===null||this.getStyle(R,"display")=="none")&&R!=R.ownerDocument.body){return false;}var S=B.Region.getRegion(R);return S;};return B.Dom.batch(P,Q,B.Dom,true);},getClientWidth:function(){return B.Dom.getViewportWidth();},getClientHeight:function(){return B.Dom.getViewportHeight();},getElementsByClassName:function(T,X,U,V){X=X||"*";U=(U)?B.Dom.get(U):null||M;if(!U){return[];}var Q=[],P=U.getElementsByTagName(X),W=O(T);for(var R=0,S=P.length;R<S;++R){if(W.test(P[R].className)){Q[Q.length]=P[R];if(V){V.call(P[R],P[R]);}}}return Q;},hasClass:function(R,Q){var P=O(Q);var S=function(T){return P.test(T.className);};return B.Dom.batch(R,S,B.Dom,true);},addClass:function(Q,P){var R=function(S){if(this.hasClass(S,P)){return false;}S.className=YAHOO.lang.trim([S.className,P].join(" "));return true;};return B.Dom.batch(Q,R,B.Dom,true);},removeClass:function(R,Q){var P=O(Q);var S=function(T){if(!Q||!this.hasClass(T,Q)){return false;}var U=T.className;T.className=U.replace(P," ");if(this.hasClass(T,Q)){this.removeClass(T,Q);}T.className=YAHOO.lang.trim(T.className);return true;};return B.Dom.batch(R,S,B.Dom,true);},replaceClass:function(S,Q,P){if(!P||Q===P){return false;}var R=O(Q);var T=function(U){if(!this.hasClass(U,Q)){this.addClass(U,P);return true;}U.className=U.className.replace(R," "+P+" ");if(this.hasClass(U,Q)){this.replaceClass(U,Q,P);}U.className=YAHOO.lang.trim(U.className);return true;};return B.Dom.batch(S,T,B.Dom,true);},generateId:function(P,R){R=R||"yui-gen";var Q=function(S){if(S&&S.id){return S.id;}var T=R+YAHOO.env._id_counter++;if(S){S.id=T;}return T;};return B.Dom.batch(P,Q,B.Dom,true)||Q.apply(B.Dom,arguments);},isAncestor:function(P,Q){P=B.Dom.get(P);Q=B.Dom.get(Q);if(!P||!Q){return false;}if(P.contains&&Q.nodeType&&!L){return P.contains(Q);}else{if(P.compareDocumentPosition&&Q.nodeType){return !!(P.compareDocumentPosition(Q)&16);}else{if(Q.nodeType){return !!this.getAncestorBy(Q,function(R){return R==P;});}}}return false;},inDocument:function(P){return this.isAncestor(M.documentElement,P);},getElementsBy:function(W,Q,R,T){Q=Q||"*";R=(R)?B.Dom.get(R):null||M;if(!R){return[];}var S=[],V=R.getElementsByTagName(Q);for(var U=0,P=V.length;U<P;++U){if(W(V[U])){S[S.length]=V[U];if(T){T(V[U]);}}}return S;},batch:function(T,W,V,R){T=(T&&(T.tagName||T.item))?T:B.Dom.get(T);if(!T||!W){return false;}var S=(R)?V:window;if(T.tagName||T.length===undefined){return W.call(S,T,V);}var U=[];for(var Q=0,P=T.length;Q<P;++Q){U[U.length]=W.call(S,T[Q],V);}return U;},getDocumentHeight:function(){var Q=(M.compatMode!="CSS1Compat")?M.body.scrollHeight:M.documentElement.scrollHeight;var P=Math.max(Q,B.Dom.getViewportHeight());return P;},getDocumentWidth:function(){var Q=(M.compatMode!="CSS1Compat")?M.body.scrollWidth:M.documentElement.scrollWidth;var P=Math.max(Q,B.Dom.getViewportWidth());return P;},getViewportHeight:function(){var P=self.innerHeight;
+var Q=M.compatMode;if((Q||G)&&!C){P=(Q=="CSS1Compat")?M.documentElement.clientHeight:M.body.clientHeight;}return P;},getViewportWidth:function(){var P=self.innerWidth;var Q=M.compatMode;if(Q||G){P=(Q=="CSS1Compat")?M.documentElement.clientWidth:M.body.clientWidth;}return P;},getAncestorBy:function(P,Q){while(P=P.parentNode){if(D(P,Q)){return P;}}return null;},getAncestorByClassName:function(Q,P){Q=B.Dom.get(Q);if(!Q){return null;}var R=function(S){return B.Dom.hasClass(S,P);};return B.Dom.getAncestorBy(Q,R);},getAncestorByTagName:function(Q,P){Q=B.Dom.get(Q);if(!Q){return null;}var R=function(S){return S.tagName&&S.tagName.toUpperCase()==P.toUpperCase();};return B.Dom.getAncestorBy(Q,R);},getPreviousSiblingBy:function(P,Q){while(P){P=P.previousSibling;if(D(P,Q)){return P;}}return null;},getPreviousSibling:function(P){P=B.Dom.get(P);if(!P){return null;}return B.Dom.getPreviousSiblingBy(P);},getNextSiblingBy:function(P,Q){while(P){P=P.nextSibling;if(D(P,Q)){return P;}}return null;},getNextSibling:function(P){P=B.Dom.get(P);if(!P){return null;}return B.Dom.getNextSiblingBy(P);},getFirstChildBy:function(P,R){var Q=(D(P.firstChild,R))?P.firstChild:null;return Q||B.Dom.getNextSiblingBy(P.firstChild,R);},getFirstChild:function(P,Q){P=B.Dom.get(P);if(!P){return null;}return B.Dom.getFirstChildBy(P);},getLastChildBy:function(P,R){if(!P){return null;}var Q=(D(P.lastChild,R))?P.lastChild:null;return Q||B.Dom.getPreviousSiblingBy(P.lastChild,R);},getLastChild:function(P){P=B.Dom.get(P);return B.Dom.getLastChildBy(P);},getChildrenBy:function(Q,S){var R=B.Dom.getFirstChildBy(Q,S);var P=R?[R]:[];B.Dom.getNextSiblingBy(R,function(T){if(!S||S(T)){P[P.length]=T;}return false;});return P;},getChildren:function(P){P=B.Dom.get(P);if(!P){}return B.Dom.getChildrenBy(P);},getDocumentScrollLeft:function(P){P=P||M;return Math.max(P.documentElement.scrollLeft,P.body.scrollLeft);},getDocumentScrollTop:function(P){P=P||M;return Math.max(P.documentElement.scrollTop,P.body.scrollTop);},insertBefore:function(Q,P){Q=B.Dom.get(Q);P=B.Dom.get(P);if(!Q||!P||!P.parentNode){return null;}return P.parentNode.insertBefore(Q,P);},insertAfter:function(Q,P){Q=B.Dom.get(Q);P=B.Dom.get(P);if(!Q||!P||!P.parentNode){return null;}if(P.nextSibling){return P.parentNode.insertBefore(Q,P.nextSibling);}else{return P.parentNode.appendChild(Q);}},getClientRegion:function(){var R=B.Dom.getDocumentScrollTop(),Q=B.Dom.getDocumentScrollLeft(),S=B.Dom.getViewportWidth()+Q,P=B.Dom.getViewportHeight()+R;return new B.Region(R,S,P,Q);}};var H=function(){if(M.documentElement.getBoundingClientRect){return function(Q){var R=Q.getBoundingClientRect();var P=Q.ownerDocument;return[R.left+B.Dom.getDocumentScrollLeft(P),R.top+B.Dom.getDocumentScrollTop(P)];};}else{return function(R){var S=[R.offsetLeft,R.offsetTop];var Q=R.offsetParent;var P=(L&&B.Dom.getStyle(R,"position")=="absolute"&&R.offsetParent==R.ownerDocument.body);if(Q!=R){while(Q){S[0]+=Q.offsetLeft;S[1]+=Q.offsetTop;if(!P&&L&&B.Dom.getStyle(Q,"position")=="absolute"){P=true;}Q=Q.offsetParent;}}if(P){S[0]-=R.ownerDocument.body.offsetLeft;S[1]-=R.ownerDocument.body.offsetTop;}Q=R.parentNode;while(Q.tagName&&!E.ROOT_TAG.test(Q.tagName)){if(Q.scrollTop||Q.scrollLeft){if(!E.OP_SCROLL.test(B.Dom.getStyle(Q,"display"))){if(!C||B.Dom.getStyle(Q,"overflow")!=="visible"){S[0]-=Q.scrollLeft;S[1]-=Q.scrollTop;}}}Q=Q.parentNode;}return S;};}}();})();YAHOO.util.Region=function(C,D,A,B){this.top=C;this[1]=C;this.right=D;this.bottom=A;this.left=B;this[0]=B;};YAHOO.util.Region.prototype.contains=function(A){return(A.left>=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(E){var C=Math.max(this.top,E.top);var D=Math.min(this.right,E.right);var A=Math.min(this.bottom,E.bottom);var B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B);}else{return null;}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top);var D=Math.max(this.right,E.right);var A=Math.max(this.bottom,E.bottom);var B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D);var C=F[1];var E=F[0]+D.offsetWidth;var A=F[1]+D.offsetHeight;var B=F[0];return new YAHOO.util.Region(C,E,A,B);};YAHOO.util.Point=function(A,B){if(YAHOO.lang.isArray(A)){B=A[1];A=A[0];}this.x=this.right=this.left=this[0]=A;this.y=this.top=this.bottom=this[1]=B;};YAHOO.util.Point.prototype=new YAHOO.util.Region();YAHOO.register("dom",YAHOO.util.Dom,{version:"2.5.2",build:"1076"});YAHOO.util.CustomEvent=function(D,B,C,A){this.type=D;this.scope=B||window;this.silent=C;this.signature=A||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var E="_YUICEOnSubscribe";if(D!==E){this.subscribeEvent=new YAHOO.util.CustomEvent(E,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(B,C,A){if(!B){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(B,C,A);}this.subscribers.push(new YAHOO.util.Subscriber(B,C,A));},unsubscribe:function(D,F){if(!D){return this.unsubscribeAll();}var E=false;for(var B=0,A=this.subscribers.length;B<A;++B){var C=this.subscribers[B];if(C&&C.contains(D,F)){this._delete(B);E=true;}}return E;},fire:function(){this.lastError=null;var K=[],E=this.subscribers.length;if(!E&&this.silent){return true;}var I=[].slice.call(arguments,0),G=true,D,J=false;if(!this.silent){}var C=this.subscribers.slice(),A=YAHOO.util.Event.throwErrors;for(D=0;D<E;++D){var M=C[D];if(!M){J=true;}else{if(!this.silent){}var L=M.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var B=null;if(I.length>0){B=I[0];}try{G=M.fn.call(L,B,M.obj);}catch(F){this.lastError=F;if(A){throw F;}}}else{try{G=M.fn.call(L,this.type,I,M.obj);}catch(H){this.lastError=H;if(A){throw H;}}}if(false===G){if(!this.silent){}break;}}}return(G!==false);},unsubscribeAll:function(){for(var A=this.subscribers.length-1;A>-1;A--){this._delete(A);}this.subscribers=[];return A;},_delete:function(A){var B=this.subscribers[A];if(B){delete B.fn;delete B.obj;}this.subscribers.splice(A,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(B,C,A){this.fn=B;this.obj=YAHOO.lang.isUndefined(C)?null:C;this.override=A;};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}return A;};YAHOO.util.Subscriber.prototype.contains=function(A,B){if(B){return(this.fn==A&&this.obj==B);}else{return(this.fn==A);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var H=false;var I=[];var J=[];var G=[];var E=[];var C=0;var F=[];var B=[];var A=0;var D={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9};return{POLL_RETRYS:2000,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,_dri:null,DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){var K=this;var L=function(){K._tryPreloadAttach();};this._interval=setInterval(L,this.POLL_INTERVAL);}},onAvailable:function(P,M,Q,O,N){var K=(YAHOO.lang.isString(P))?[P]:P;for(var L=0;L<K.length;L=L+1){F.push({id:K[L],fn:M,obj:Q,override:O,checkReady:N});}C=this.POLL_RETRYS;this.startInterval();},onContentReady:function(M,K,N,L){this.onAvailable(M,K,N,L,true);},onDOMReady:function(K,M,L){if(this.DOMReady){setTimeout(function(){var N=window;if(L){if(L===true){N=M;}else{N=L;}}K.call(N,"DOMReady",[],M);},0);}else{this.DOMReadyEvent.subscribe(K,M,L);}},addListener:function(M,K,V,Q,L){if(!V||!V.call){return false;}if(this._isValidCollection(M)){var W=true;for(var R=0,T=M.length;R<T;++R){W=this.on(M[R],K,V,Q,L)&&W;}return W;}else{if(YAHOO.lang.isString(M)){var P=this.getEl(M);if(P){M=P;}else{this.onAvailable(M,function(){YAHOO.util.Event.on(M,K,V,Q,L);});return true;}}}if(!M){return false;}if("unload"==K&&Q!==this){J[J.length]=[M,K,V,Q,L];return true;}var Y=M;if(L){if(L===true){Y=Q;}else{Y=L;}}var N=function(Z){return V.call(Y,YAHOO.util.Event.getEvent(Z,M),Q);};var X=[M,K,V,N,Y,Q,L];var S=I.length;I[S]=X;if(this.useLegacyEvent(M,K)){var O=this.getLegacyIndex(M,K);if(O==-1||M!=G[O][0]){O=G.length;B[M.id+K]=O;G[O]=[M,K,M["on"+K]];E[O]=[];M["on"+K]=function(Z){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(Z),O);};}E[O].push(X);}else{try{this._simpleAdd(M,K,N,false);}catch(U){this.lastError=U;this.removeListener(M,K,V);return false;}}return true;},fireLegacyEvent:function(O,M){var Q=true,K,S,R,T,P;S=E[M].slice();for(var L=0,N=S.length;L<N;++L){R=S[L];if(R&&R[this.WFN]){T=R[this.ADJ_SCOPE];P=R[this.WFN].call(T,O);Q=(Q&&P);}}K=G[M];if(K&&K[2]){K[2](O);}return Q;},getLegacyIndex:function(L,M){var K=this.generateId(L)+M;if(typeof B[K]=="undefined"){return -1;}else{return B[K];}},useLegacyEvent:function(L,M){if(this.webkit&&("click"==M||"dblclick"==M)){var K=parseInt(this.webkit,10);if(!isNaN(K)&&K<418){return true;}}return false;},removeListener:function(L,K,T){var O,R,V;if(typeof L=="string"){L=this.getEl(L);}else{if(this._isValidCollection(L)){var U=true;for(O=L.length-1;O>-1;O--){U=(this.removeListener(L[O],K,T)&&U);}return U;}}if(!T||!T.call){return this.purgeElement(L,false,K);}if("unload"==K){for(O=J.length-1;O>-1;O--){V=J[O];if(V&&V[0]==L&&V[1]==K&&V[2]==T){J.splice(O,1);return true;}}return false;}var P=null;var Q=arguments[3];if("undefined"===typeof Q){Q=this._getCacheIndex(L,K,T);}if(Q>=0){P=I[Q];}if(!L||!P){return false;}if(this.useLegacyEvent(L,K)){var N=this.getLegacyIndex(L,K);var M=E[N];if(M){for(O=0,R=M.length;O<R;++O){V=M[O];if(V&&V[this.EL]==L&&V[this.TYPE]==K&&V[this.FN]==T){M.splice(O,1);break;}}}}else{try{this._simpleRemove(L,K,P[this.WFN],false);}catch(S){this.lastError=S;return false;}}delete I[Q][this.WFN];delete I[Q][this.FN];I.splice(Q,1);return true;},getTarget:function(M,L){var K=M.target||M.srcElement;return this.resolveTextNode(K);},resolveTextNode:function(L){try{if(L&&3==L.nodeType){return L.parentNode;}}catch(K){}return L;},getPageX:function(L){var K=L.pageX;if(!K&&0!==K){K=L.clientX||0;if(this.isIE){K+=this._getScrollLeft();}}return K;},getPageY:function(K){var L=K.pageY;if(!L&&0!==L){L=K.clientY||0;if(this.isIE){L+=this._getScrollTop();}}return L;
+},getXY:function(K){return[this.getPageX(K),this.getPageY(K)];},getRelatedTarget:function(L){var K=L.relatedTarget;if(!K){if(L.type=="mouseout"){K=L.toElement;}else{if(L.type=="mouseover"){K=L.fromElement;}}}return this.resolveTextNode(K);},getTime:function(M){if(!M.time){var L=new Date().getTime();try{M.time=L;}catch(K){this.lastError=K;return L;}}return M.time;},stopEvent:function(K){this.stopPropagation(K);this.preventDefault(K);},stopPropagation:function(K){if(K.stopPropagation){K.stopPropagation();}else{K.cancelBubble=true;}},preventDefault:function(K){if(K.preventDefault){K.preventDefault();}else{K.returnValue=false;}},getEvent:function(M,K){var L=M||window.event;if(!L){var N=this.getEvent.caller;while(N){L=N.arguments[0];if(L&&Event==L.constructor){break;}N=N.caller;}}return L;},getCharCode:function(L){var K=L.keyCode||L.charCode||0;if(YAHOO.env.ua.webkit&&(K in D)){K=D[K];}return K;},_getCacheIndex:function(O,P,N){for(var M=0,L=I.length;M<L;M=M+1){var K=I[M];if(K&&K[this.FN]==N&&K[this.EL]==O&&K[this.TYPE]==P){return M;}}return -1;},generateId:function(K){var L=K.id;if(!L){L="yuievtautoid-"+A;++A;K.id=L;}return L;},_isValidCollection:function(L){try{return(L&&typeof L!=="string"&&L.length&&!L.tagName&&!L.alert&&typeof L[0]!=="undefined");}catch(K){return false;}},elCache:{},getEl:function(K){return(typeof K==="string")?document.getElementById(K):K;},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",this),_load:function(L){if(!H){H=true;var K=YAHOO.util.Event;K._ready();K._tryPreloadAttach();}},_ready:function(L){var K=YAHOO.util.Event;if(!K.DOMReady){K.DOMReady=true;K.DOMReadyEvent.fire();K._simpleRemove(document,"DOMContentLoaded",K._ready);}},_tryPreloadAttach:function(){if(F.length===0){C=0;clearInterval(this._interval);this._interval=null;return ;}if(this.locked){return ;}if(this.isIE){if(!this.DOMReady){this.startInterval();return ;}}this.locked=true;var Q=!H;if(!Q){Q=(C>0&&F.length>0);}var P=[];var R=function(T,U){var S=T;if(U.override){if(U.override===true){S=U.obj;}else{S=U.override;}}U.fn.call(S,U.obj);};var L,K,O,N,M=[];for(L=0,K=F.length;L<K;L=L+1){O=F[L];if(O){N=this.getEl(O.id);if(N){if(O.checkReady){if(H||N.nextSibling||!Q){M.push(O);F[L]=null;}}else{R(N,O);F[L]=null;}}else{P.push(O);}}}for(L=0,K=M.length;L<K;L=L+1){O=M[L];R(this.getEl(O.id),O);}C--;if(Q){for(L=F.length-1;L>-1;L--){O=F[L];if(!O||!O.id){F.splice(L,1);}}this.startInterval();}else{clearInterval(this._interval);this._interval=null;}this.locked=false;},purgeElement:function(O,P,R){var M=(YAHOO.lang.isString(O))?this.getEl(O):O;var Q=this.getListeners(M,R),N,K;if(Q){for(N=Q.length-1;N>-1;N--){var L=Q[N];this.removeListener(M,L.type,L.fn);}}if(P&&M&&M.childNodes){for(N=0,K=M.childNodes.length;N<K;++N){this.purgeElement(M.childNodes[N],P,R);}}},getListeners:function(M,K){var P=[],L;if(!K){L=[I,J];}else{if(K==="unload"){L=[J];}else{L=[I];}}var R=(YAHOO.lang.isString(M))?this.getEl(M):M;for(var O=0;O<L.length;O=O+1){var T=L[O];if(T){for(var Q=0,S=T.length;Q<S;++Q){var N=T[Q];if(N&&N[this.EL]===R&&(!K||K===N[this.TYPE])){P.push({type:N[this.TYPE],fn:N[this.FN],obj:N[this.OBJ],adjust:N[this.OVERRIDE],scope:N[this.ADJ_SCOPE],index:Q});}}}}return(P.length)?P:null;},_unload:function(Q){var K=YAHOO.util.Event,N,M,L,P,O,R=J.slice();for(N=0,P=J.length;N<P;++N){L=R[N];if(L){var S=window;if(L[K.ADJ_SCOPE]){if(L[K.ADJ_SCOPE]===true){S=L[K.UNLOAD_OBJ];}else{S=L[K.ADJ_SCOPE];}}L[K.FN].call(S,K.getEvent(Q,L[K.EL]),L[K.UNLOAD_OBJ]);R[N]=null;L=null;S=null;}}J=null;if(I){for(M=I.length-1;M>-1;M--){L=I[M];if(L){K.removeListener(L[K.EL],L[K.TYPE],L[K.FN],M);}}L=null;}G=null;K._simpleRemove(window,"unload",K._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var K=document.documentElement,L=document.body;if(K&&(K.scrollTop||K.scrollLeft)){return[K.scrollTop,K.scrollLeft];}else{if(L){return[L.scrollTop,L.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(M,N,L,K){M.addEventListener(N,L,(K));};}else{if(window.attachEvent){return function(M,N,L,K){M.attachEvent("on"+N,L);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(M,N,L,K){M.removeEventListener(N,L,(K));};}else{if(window.detachEvent){return function(L,M,K){L.detachEvent("on"+M,K);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;
+/* DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller */
+if(EU.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var n=document.createElement("p");EU._dri=setInterval(function(){try{n.doScroll("left");clearInterval(EU._dri);EU._dri=null;EU._ready();n=null;}catch(ex){}},EU.POLL_INTERVAL);}else{if(EU.webkit&&EU.webkit<525){EU._dri=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._dri);EU._dri=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}}EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(A,C,F,E){this.__yui_events=this.__yui_events||{};var D=this.__yui_events[A];if(D){D.subscribe(C,F,E);}else{this.__yui_subscribers=this.__yui_subscribers||{};var B=this.__yui_subscribers;if(!B[A]){B[A]=[];}B[A].push({fn:C,obj:F,override:E});}},unsubscribe:function(C,E,G){this.__yui_events=this.__yui_events||{};var A=this.__yui_events;if(C){var F=A[C];if(F){return F.unsubscribe(E,G);}}else{var B=true;for(var D in A){if(YAHOO.lang.hasOwnProperty(A,D)){B=B&&A[D].unsubscribe(E,G);}}return B;}return false;},unsubscribeAll:function(A){return this.unsubscribe(A);},createEvent:function(G,D){this.__yui_events=this.__yui_events||{};var A=D||{};var I=this.__yui_events;
+if(I[G]){}else{var H=A.scope||this;var E=(A.silent);var B=new YAHOO.util.CustomEvent(G,H,E,YAHOO.util.CustomEvent.FLAT);I[G]=B;if(A.onSubscribeCallback){B.subscribeEvent.subscribe(A.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var F=this.__yui_subscribers[G];if(F){for(var C=0;C<F.length;++C){B.subscribe(F[C].fn,F[C].obj,F[C].override);}}}return I[G];},fireEvent:function(E,D,A,C){this.__yui_events=this.__yui_events||{};var G=this.__yui_events[E];if(!G){return null;}var B=[];for(var F=1;F<arguments.length;++F){B.push(arguments[F]);}return G.fire.apply(G,B);},hasEvent:function(A){if(this.__yui_events){if(this.__yui_events[A]){return true;}}return false;}};YAHOO.util.KeyListener=function(A,F,B,C){if(!A){}else{if(!F){}else{if(!B){}}}if(!C){C=YAHOO.util.KeyListener.KEYDOWN;}var D=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(typeof A=="string"){A=document.getElementById(A);}if(typeof B=="function"){D.subscribe(B);}else{D.subscribe(B.fn,B.scope,B.correctScope);}function E(J,I){if(!F.shift){F.shift=false;}if(!F.alt){F.alt=false;}if(!F.ctrl){F.ctrl=false;}if(J.shiftKey==F.shift&&J.altKey==F.alt&&J.ctrlKey==F.ctrl){var G;if(F.keys instanceof Array){for(var H=0;H<F.keys.length;H++){G=F.keys[H];if(G==J.charCode){D.fire(J.charCode,J);break;}else{if(G==J.keyCode){D.fire(J.keyCode,J);break;}}}}else{G=F.keys;if(G==J.charCode){D.fire(J.charCode,J);}else{if(G==J.keyCode){D.fire(J.keyCode,J);}}}}}this.enable=function(){if(!this.enabled){YAHOO.util.Event.addListener(A,C,E);this.enabledEvent.fire(F);}this.enabled=true;};this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(A,C,E);this.disabledEvent.fire(F);}this.enabled=false;};this.toString=function(){return"KeyListener ["+F.keys+"] "+A.tagName+(A.id?"["+A.id+"]":"");};};YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.util.KeyListener.KEY={ALT:18,BACK_SPACE:8,CAPS_LOCK:20,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,META:224,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PRINTSCREEN:44,RIGHT:39,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,UP:38};YAHOO.register("event",YAHOO.util.Event,{version:"2.5.2",build:"1076"});YAHOO.register("yuiloader-dom-event", YAHOO, {version: "2.5.2", build: "1076"});
+
+// logger/logger-min.js
+YAHOO.widget.LogMsg=function(A){this.msg=this.time=this.category=this.source=this.sourceDetail=null;if(A&&(A.constructor==Object)){for(var B in A){this[B]=A[B];}}};YAHOO.widget.LogWriter=function(A){if(!A){YAHOO.log("Could not instantiate LogWriter due to invalid source.","error","LogWriter");return ;}this._source=A;};YAHOO.widget.LogWriter.prototype.toString=function(){return"LogWriter "+this._sSource;};YAHOO.widget.LogWriter.prototype.log=function(A,B){YAHOO.widget.Logger.log(A,B,this._source);};YAHOO.widget.LogWriter.prototype.getSource=function(){return this._sSource;};YAHOO.widget.LogWriter.prototype.setSource=function(A){if(!A){YAHOO.log("Could not set source due to invalid source.","error",this.toString());return ;}else{this._sSource=A;}};YAHOO.widget.LogWriter.prototype._source=null;YAHOO.widget.LogReader=function(B,A){this._sName=YAHOO.widget.LogReader._index;YAHOO.widget.LogReader._index++;this._buffer=[];this._filterCheckboxes={};this._lastTime=YAHOO.widget.Logger.getStartTime();if(A&&(A.constructor==Object)){for(var C in A){this[C]=A[C];}}this._initContainerEl(B);if(!this._elContainer){YAHOO.log("Could not instantiate LogReader due to an invalid container element "+B,"error",this.toString());return ;}this._initHeaderEl();this._initConsoleEl();this._initFooterEl();this._initDragDrop();this._initCategories();this._initSources();YAHOO.widget.Logger.newLogEvent.subscribe(this._onNewLog,this);YAHOO.widget.Logger.logResetEvent.subscribe(this._onReset,this);YAHOO.widget.Logger.categoryCreateEvent.subscribe(this._onCategoryCreate,this);YAHOO.widget.Logger.sourceCreateEvent.subscribe(this._onSourceCreate,this);this._filterLogs();YAHOO.log("LogReader initialized",null,this.toString());};YAHOO.lang.augmentObject(YAHOO.widget.LogReader,{_index:0,ENTRY_TEMPLATE:(function(){var A=document.createElement("pre");YAHOO.util.Dom.addClass(A,"yui-log-entry");return A;})(),VERBOSE_TEMPLATE:"<span class='{category}'>{label}</span>{totalTime}ms (+{elapsedTime}) {localTime}:</p><p>{sourceAndDetail}</p><p>{message}</p>",BASIC_TEMPLATE:"<p><span class='{category}'>{label}</span>{totalTime}ms (+{elapsedTime}) {localTime}: {sourceAndDetail}: {message}</p>"});YAHOO.widget.LogReader.prototype={logReaderEnabled:true,width:null,height:null,top:null,left:null,right:null,bottom:null,fontSize:null,footerEnabled:true,verboseOutput:true,entryFormat:null,newestOnTop:true,outputBuffer:100,thresholdMax:500,thresholdMin:100,isCollapsed:false,isPaused:false,draggable:true,toString:function(){return"LogReader instance"+this._sName;},pause:function(){this.isPaused=true;this._btnPause.value="Resume";this._timeout=null;this.logReaderEnabled=false;},resume:function(){this.isPaused=false;this._btnPause.value="Pause";this.logReaderEnabled=true;this._printBuffer();},hide:function(){this._elContainer.style.display="none";},show:function(){this._elContainer.style.display="block";},collapse:function(){this._elConsole.style.display="none";if(this._elFt){this._elFt.style.display="none";}this._btnCollapse.value="Expand";this.isCollapsed=true;},expand:function(){this._elConsole.style.display="block";if(this._elFt){this._elFt.style.display="block";}this._btnCollapse.value="Collapse";this.isCollapsed=false;},getCheckbox:function(A){return this._filterCheckboxes[A];},getCategories:function(){return this._categoryFilters;},showCategory:function(B){var D=this._categoryFilters;if(D.indexOf){if(D.indexOf(B)>-1){return ;}}else{for(var A=0;A<D.length;A++){if(D[A]===B){return ;}}}this._categoryFilters.push(B);this._filterLogs();var C=this.getCheckbox(B);if(C){C.checked=true;}},hideCategory:function(B){var D=this._categoryFilters;for(var A=0;A<D.length;A++){if(B==D[A]){D.splice(A,1);break;}}this._filterLogs();var C=this.getCheckbox(B);if(C){C.checked=false;}},getSources:function(){return this._sourceFilters;},showSource:function(A){var D=this._sourceFilters;if(D.indexOf){if(D.indexOf(A)>-1){return ;}}else{for(var B=0;B<D.length;B++){if(A==D[B]){return ;}}}D.push(A);this._filterLogs();var C=this.getCheckbox(A);if(C){C.checked=true;}},hideSource:function(A){var D=this._sourceFilters;for(var B=0;B<D.length;B++){if(A==D[B]){D.splice(B,1);break;}}this._filterLogs();var C=this.getCheckbox(A);if(C){C.checked=false;}},clearConsole:function(){this._timeout=null;this._buffer=[];this._consoleMsgCount=0;var A=this._elConsole;A.innerHTML="";},setTitle:function(A){this._title.innerHTML=this.html2Text(A);},getLastTime:function(){return this._lastTime;},formatMsg:function(C){var B=YAHOO.widget.LogReader,A=this.entryFormat||(this.verboseOutput?B.VERBOSE_TEMPLATE:B.BASIC_TEMPLATE),D={category:C.category,label:C.category.substring(0,4).toUpperCase(),sourceAndDetail:C.sourceDetail?C.source+" "+C.sourceDetail:C.source,message:this.html2Text(C.msg||C.message||"")};if(C.time&&C.time.getTime){D.localTime=C.time.toLocaleTimeString?C.time.toLocaleTimeString():C.time.toString();D.elapsedTime=C.time.getTime()-this.getLastTime();D.totalTime=C.time.getTime()-YAHOO.widget.Logger.getStartTime();}var E=B.ENTRY_TEMPLATE.cloneNode(true);if(this.verboseOutput){E.className+=" yui-log-verbose";}E.innerHTML=YAHOO.lang.substitute(A,D);return E;},html2Text:function(A){if(A){A+="";return A.replace(/&/g,"&#38;").replace(/</g,"&#60;").replace(/>/g,"&#62;");}return"";},_sName:null,_buffer:null,_consoleMsgCount:0,_lastTime:null,_timeout:null,_filterCheckboxes:null,_categoryFilters:null,_sourceFilters:null,_elContainer:null,_elHd:null,_elCollapse:null,_btnCollapse:null,_title:null,_elConsole:null,_elFt:null,_elBtns:null,_elCategoryFilters:null,_elSourceFilters:null,_btnPause:null,_btnClear:null,_initContainerEl:function(B){B=YAHOO.util.Dom.get(B);if(B&&B.tagName&&(B.tagName.toLowerCase()=="div")){this._elContainer=B;YAHOO.util.Dom.addClass(this._elContainer,"yui-log");}else{this._elContainer=document.body.appendChild(document.createElement("div"));YAHOO.util.Dom.addClass(this._elContainer,"yui-log");YAHOO.util.Dom.addClass(this._elContainer,"yui-log-container");var A=this._elContainer.style;
+if(this.width){A.width=this.width;}if(this.right){A.right=this.right;}if(this.top){A.top=this.top;}if(this.left){A.left=this.left;A.right="auto";}if(this.bottom){A.bottom=this.bottom;A.top="auto";}if(this.fontSize){A.fontSize=this.fontSize;}if(navigator.userAgent.toLowerCase().indexOf("opera")!=-1){document.body.style+="";}}},_initHeaderEl:function(){var A=this;if(this._elHd){YAHOO.util.Event.purgeElement(this._elHd,true);this._elHd.innerHTML="";}this._elHd=this._elContainer.appendChild(document.createElement("div"));this._elHd.id="yui-log-hd"+this._sName;this._elHd.className="yui-log-hd";this._elCollapse=this._elHd.appendChild(document.createElement("div"));this._elCollapse.className="yui-log-btns";this._btnCollapse=document.createElement("input");this._btnCollapse.type="button";this._btnCollapse.className="yui-log-button";this._btnCollapse.value="Collapse";this._btnCollapse=this._elCollapse.appendChild(this._btnCollapse);YAHOO.util.Event.addListener(A._btnCollapse,"click",A._onClickCollapseBtn,A);this._title=this._elHd.appendChild(document.createElement("h4"));this._title.innerHTML="Logger Console";},_initConsoleEl:function(){if(this._elConsole){YAHOO.util.Event.purgeElement(this._elConsole,true);this._elConsole.innerHTML="";}this._elConsole=this._elContainer.appendChild(document.createElement("div"));this._elConsole.className="yui-log-bd";if(this.height){this._elConsole.style.height=this.height;}},_initFooterEl:function(){var A=this;if(this.footerEnabled){if(this._elFt){YAHOO.util.Event.purgeElement(this._elFt,true);this._elFt.innerHTML="";}this._elFt=this._elContainer.appendChild(document.createElement("div"));this._elFt.className="yui-log-ft";this._elBtns=this._elFt.appendChild(document.createElement("div"));this._elBtns.className="yui-log-btns";this._btnPause=document.createElement("input");this._btnPause.type="button";this._btnPause.className="yui-log-button";this._btnPause.value="Pause";this._btnPause=this._elBtns.appendChild(this._btnPause);YAHOO.util.Event.addListener(A._btnPause,"click",A._onClickPauseBtn,A);this._btnClear=document.createElement("input");this._btnClear.type="button";this._btnClear.className="yui-log-button";this._btnClear.value="Clear";this._btnClear=this._elBtns.appendChild(this._btnClear);YAHOO.util.Event.addListener(A._btnClear,"click",A._onClickClearBtn,A);this._elCategoryFilters=this._elFt.appendChild(document.createElement("div"));this._elCategoryFilters.className="yui-log-categoryfilters";this._elSourceFilters=this._elFt.appendChild(document.createElement("div"));this._elSourceFilters.className="yui-log-sourcefilters";}},_initDragDrop:function(){if(YAHOO.util.DD&&this.draggable&&this._elHd){var A=new YAHOO.util.DD(this._elContainer);A.setHandleElId(this._elHd.id);this._elHd.style.cursor="move";}},_initCategories:function(){this._categoryFilters=[];var C=YAHOO.widget.Logger.categories;for(var A=0;A<C.length;A++){var B=C[A];this._categoryFilters.push(B);if(this._elCategoryFilters){this._createCategoryCheckbox(B);}}},_initSources:function(){this._sourceFilters=[];var C=YAHOO.widget.Logger.sources;for(var B=0;B<C.length;B++){var A=C[B];this._sourceFilters.push(A);if(this._elSourceFilters){this._createSourceCheckbox(A);}}},_createCategoryCheckbox:function(B){var A=this;if(this._elFt){var E=this._elCategoryFilters;var D=E.appendChild(document.createElement("span"));D.className="yui-log-filtergrp";var C=document.createElement("input");C.id="yui-log-filter-"+B+this._sName;C.className="yui-log-filter-"+B;C.type="checkbox";C.category=B;C=D.appendChild(C);C.checked=true;YAHOO.util.Event.addListener(C,"click",A._onCheckCategory,A);var F=D.appendChild(document.createElement("label"));F.htmlFor=C.id;F.className=B;F.innerHTML=B;this._filterCheckboxes[B]=C;}},_createSourceCheckbox:function(A){var D=this;if(this._elFt){var F=this._elSourceFilters;var E=F.appendChild(document.createElement("span"));E.className="yui-log-filtergrp";var C=document.createElement("input");C.id="yui-log-filter"+A+this._sName;C.className="yui-log-filter"+A;C.type="checkbox";C.source=A;C=E.appendChild(C);C.checked=true;YAHOO.util.Event.addListener(C,"click",D._onCheckSource,D);var B=E.appendChild(document.createElement("label"));B.htmlFor=C.id;B.className=A;B.innerHTML=A;this._filterCheckboxes[A]=C;}},_filterLogs:function(){if(this._elConsole!==null){this.clearConsole();this._printToConsole(YAHOO.widget.Logger.getStack());}},_printBuffer:function(){this._timeout=null;if(this._elConsole!==null){var B=this.thresholdMax;B=(B&&!isNaN(B))?B:500;if(this._consoleMsgCount<B){var A=[];for(var C=0;C<this._buffer.length;C++){A[C]=this._buffer[C];}this._buffer=[];this._printToConsole(A);}else{this._filterLogs();}if(!this.newestOnTop){this._elConsole.scrollTop=this._elConsole.scrollHeight;}}},_printToConsole:function(I){var B=I.length,M=document.createDocumentFragment(),P=[],Q=this.thresholdMin,C=this._sourceFilters.length,N=this._categoryFilters.length,K,H,G,F,L;if(isNaN(Q)||(Q>this.thresholdMax)){Q=0;}K=(B>Q)?(B-Q):0;for(H=K;H<B;H++){var E=false;var J=false;var O=I[H];var A=O.source;var D=O.category;for(G=0;G<C;G++){if(A==this._sourceFilters[G]){J=true;break;}}if(J){for(G=0;G<N;G++){if(D==this._categoryFilters[G]){E=true;break;}}}if(E){F=this.formatMsg(O);if(typeof F==="string"){P[P.length]=F;}else{M.insertBefore(F,this.newestOnTop?M.firstChild||null:null);}this._consoleMsgCount++;this._lastTime=O.time.getTime();}}if(P.length){P.splice(0,0,this._elConsole.innerHTML);this._elConsole.innerHTML=this.newestOnTop?P.reverse().join(""):P.join("");}else{if(M.firstChild){this._elConsole.insertBefore(M,this.newestOnTop?this._elConsole.firstChild||null:null);}}},_onCategoryCreate:function(D,C,A){var B=C[0];A._categoryFilters.push(B);if(A._elFt){A._createCategoryCheckbox(B);}},_onSourceCreate:function(D,C,A){var B=C[0];A._sourceFilters.push(B);if(A._elFt){A._createSourceCheckbox(B);}},_onCheckCategory:function(A,B){var C=this.category;if(!this.checked){B.hideCategory(C);}else{B.showCategory(C);}},_onCheckSource:function(A,B){var C=this.source;
+if(!this.checked){B.hideSource(C);}else{B.showSource(C);}},_onClickCollapseBtn:function(A,B){if(!B.isCollapsed){B.collapse();}else{B.expand();}},_onClickPauseBtn:function(A,B){if(!B.isPaused){B.pause();}else{B.resume();}},_onClickClearBtn:function(A,B){B.clearConsole();},_onNewLog:function(D,C,A){var B=C[0];A._buffer.push(B);if(A.logReaderEnabled===true&&A._timeout===null){A._timeout=setTimeout(function(){A._printBuffer();},A.outputBuffer);}},_onReset:function(C,B,A){A._filterLogs();}};if(!YAHOO.widget.Logger){YAHOO.widget.Logger={loggerEnabled:true,_browserConsoleEnabled:false,categories:["info","warn","error","time","window"],sources:["global"],_stack:[],maxStackEntries:2500,_startTime:new Date().getTime(),_lastTime:null,_windowErrorsHandled:false,_origOnWindowError:null};YAHOO.widget.Logger.log=function(B,F,G){if(this.loggerEnabled){if(!F){F="info";}else{F=F.toLocaleLowerCase();if(this._isNewCategory(F)){this._createNewCategory(F);}}var C="global";var A=null;if(G){var D=G.indexOf(" ");if(D>0){C=G.substring(0,D);A=G.substring(D,G.length);}else{C=G;}if(this._isNewSource(C)){this._createNewSource(C);}}var H=new Date();var J=new YAHOO.widget.LogMsg({msg:B,time:H,category:F,source:C,sourceDetail:A});var I=this._stack;var E=this.maxStackEntries;if(E&&!isNaN(E)&&(I.length>=E)){I.shift();}I.push(J);this.newLogEvent.fire(J);if(this._browserConsoleEnabled){this._printToBrowserConsole(J);}return true;}else{return false;}};YAHOO.widget.Logger.reset=function(){this._stack=[];this._startTime=new Date().getTime();this.loggerEnabled=true;this.log("Logger reset");this.logResetEvent.fire();};YAHOO.widget.Logger.getStack=function(){return this._stack;};YAHOO.widget.Logger.getStartTime=function(){return this._startTime;};YAHOO.widget.Logger.disableBrowserConsole=function(){YAHOO.log("Logger output to the function console.log() has been disabled.");this._browserConsoleEnabled=false;};YAHOO.widget.Logger.enableBrowserConsole=function(){this._browserConsoleEnabled=true;YAHOO.log("Logger output to the function console.log() has been enabled.");};YAHOO.widget.Logger.handleWindowErrors=function(){if(!YAHOO.widget.Logger._windowErrorsHandled){if(window.error){YAHOO.widget.Logger._origOnWindowError=window.onerror;}window.onerror=YAHOO.widget.Logger._onWindowError;YAHOO.widget.Logger._windowErrorsHandled=true;YAHOO.log("Logger handling of window.onerror has been enabled.");}else{YAHOO.log("Logger handling of window.onerror had already been enabled.");}};YAHOO.widget.Logger.unhandleWindowErrors=function(){if(YAHOO.widget.Logger._windowErrorsHandled){if(YAHOO.widget.Logger._origOnWindowError){window.onerror=YAHOO.widget.Logger._origOnWindowError;YAHOO.widget.Logger._origOnWindowError=null;}else{window.onerror=null;}YAHOO.widget.Logger._windowErrorsHandled=false;YAHOO.log("Logger handling of window.onerror has been disabled.");}else{YAHOO.log("Logger handling of window.onerror had already been disabled.");}};YAHOO.widget.Logger.categoryCreateEvent=new YAHOO.util.CustomEvent("categoryCreate",this,true);YAHOO.widget.Logger.sourceCreateEvent=new YAHOO.util.CustomEvent("sourceCreate",this,true);YAHOO.widget.Logger.newLogEvent=new YAHOO.util.CustomEvent("newLog",this,true);YAHOO.widget.Logger.logResetEvent=new YAHOO.util.CustomEvent("logReset",this,true);YAHOO.widget.Logger._createNewCategory=function(A){this.categories.push(A);this.categoryCreateEvent.fire(A);};YAHOO.widget.Logger._isNewCategory=function(B){for(var A=0;A<this.categories.length;A++){if(B==this.categories[A]){return false;}}return true;};YAHOO.widget.Logger._createNewSource=function(A){this.sources.push(A);this.sourceCreateEvent.fire(A);};YAHOO.widget.Logger._isNewSource=function(A){if(A){for(var B=0;B<this.sources.length;B++){if(A==this.sources[B]){return false;}}return true;}};YAHOO.widget.Logger._printToBrowserConsole=function(C){if(window.console&&console.log){var E=C.category;var D=C.category.substring(0,4).toUpperCase();var G=C.time;var F;if(G.toLocaleTimeString){F=G.toLocaleTimeString();}else{F=G.toString();}var H=G.getTime();var B=(YAHOO.widget.Logger._lastTime)?(H-YAHOO.widget.Logger._lastTime):0;YAHOO.widget.Logger._lastTime=H;var A=F+" ("+B+"ms): "+C.source+": ";console.log(A,C.msg);}};YAHOO.widget.Logger._onWindowError=function(A,C,B){try{YAHOO.widget.Logger.log(A+" ("+C+", line "+B+")","window");if(YAHOO.widget.Logger._origOnWindowError){YAHOO.widget.Logger._origOnWindowError();}}catch(D){return false;}};YAHOO.widget.Logger.log("Logger initialized");}YAHOO.register("logger",YAHOO.widget.Logger,{version:"2.5.2",build:"1076"});
+
+// yuitest/yuitest-min.js
+YAHOO.namespace("tool");YAHOO.tool.TestCase=function(A){this._should={};for(var B in A){this[B]=A[B];}if(!YAHOO.lang.isString(this.name)){this.name=YAHOO.util.Dom.generateId(null,"testCase");}};YAHOO.tool.TestCase.prototype={resume:function(A){YAHOO.tool.TestRunner.resume(A);},wait:function(B,A){throw new YAHOO.tool.TestCase.Wait(B,A);},setUp:function(){},tearDown:function(){}};YAHOO.tool.TestCase.Wait=function(B,A){this.segment=(YAHOO.lang.isFunction(B)?B:null);this.delay=(YAHOO.lang.isNumber(A)?A:0);};YAHOO.namespace("tool");YAHOO.tool.TestSuite=function(A){this.name="";this.items=[];if(YAHOO.lang.isString(A)){this.name=A;}else{if(YAHOO.lang.isObject(A)){YAHOO.lang.augmentObject(this,A,true);}}if(this.name===""){this.name=YAHOO.util.Dom.generateId(null,"testSuite");}};YAHOO.tool.TestSuite.prototype={add:function(A){if(A instanceof YAHOO.tool.TestSuite||A instanceof YAHOO.tool.TestCase){this.items.push(A);}},setUp:function(){},tearDown:function(){}};YAHOO.namespace("tool");YAHOO.tool.TestRunner=(function(){function B(C){this.testObject=C;this.firstChild=null;this.lastChild=null;this.parent=null;this.next=null;this.results={passed:0,failed:0,total:0,ignored:0};if(C instanceof YAHOO.tool.TestSuite){this.results.type="testsuite";this.results.name=C.name;}else{if(C instanceof YAHOO.tool.TestCase){this.results.type="testcase";this.results.name=C.name;}}}B.prototype={appendChild:function(C){var D=new B(C);if(this.firstChild===null){this.firstChild=this.lastChild=D;}else{this.lastChild.next=D;this.lastChild=D;}D.parent=this;return D;}};function A(){A.superclass.constructor.apply(this,arguments);this.masterSuite=new YAHOO.tool.TestSuite("YUI Test Results");this._cur=null;this._root=null;var D=[this.TEST_CASE_BEGIN_EVENT,this.TEST_CASE_COMPLETE_EVENT,this.TEST_SUITE_BEGIN_EVENT,this.TEST_SUITE_COMPLETE_EVENT,this.TEST_PASS_EVENT,this.TEST_FAIL_EVENT,this.TEST_IGNORE_EVENT,this.COMPLETE_EVENT,this.BEGIN_EVENT];for(var C=0;C<D.length;C++){this.createEvent(D[C],{scope:this});}}YAHOO.lang.extend(A,YAHOO.util.EventProvider,{TEST_CASE_BEGIN_EVENT:"testcasebegin",TEST_CASE_COMPLETE_EVENT:"testcasecomplete",TEST_SUITE_BEGIN_EVENT:"testsuitebegin",TEST_SUITE_COMPLETE_EVENT:"testsuitecomplete",TEST_PASS_EVENT:"pass",TEST_FAIL_EVENT:"fail",TEST_IGNORE_EVENT:"ignore",COMPLETE_EVENT:"complete",BEGIN_EVENT:"begin",_addTestCaseToTestTree:function(C,D){var E=C.appendChild(D);for(var F in D){if(F.indexOf("test")===0&&YAHOO.lang.isFunction(D[F])){E.appendChild(F);}}},_addTestSuiteToTestTree:function(C,F){var E=C.appendChild(F);for(var D=0;D<F.items.length;D++){if(F.items[D] instanceof YAHOO.tool.TestSuite){this._addTestSuiteToTestTree(E,F.items[D]);}else{if(F.items[D] instanceof YAHOO.tool.TestCase){this._addTestCaseToTestTree(E,F.items[D]);}}}},_buildTestTree:function(){this._root=new B(this.masterSuite);this._cur=this._root;for(var C=0;C<this.masterSuite.items.length;C++){if(this.masterSuite.items[C] instanceof YAHOO.tool.TestSuite){this._addTestSuiteToTestTree(this._root,this.masterSuite.items[C]);}else{if(this.masterSuite.items[C] instanceof YAHOO.tool.TestCase){this._addTestCaseToTestTree(this._root,this.masterSuite.items[C]);}}}},_handleTestObjectComplete:function(C){if(YAHOO.lang.isObject(C.testObject)){C.parent.results.passed+=C.results.passed;C.parent.results.failed+=C.results.failed;C.parent.results.total+=C.results.total;C.parent.results.ignored+=C.results.ignored;C.parent.results[C.testObject.name]=C.results;if(C.testObject instanceof YAHOO.tool.TestSuite){C.testObject.tearDown();this.fireEvent(this.TEST_SUITE_COMPLETE_EVENT,{testSuite:C.testObject,results:C.results});}else{if(C.testObject instanceof YAHOO.tool.TestCase){this.fireEvent(this.TEST_CASE_COMPLETE_EVENT,{testCase:C.testObject,results:C.results});}}}},_next:function(){if(this._cur.firstChild){this._cur=this._cur.firstChild;}else{if(this._cur.next){this._cur=this._cur.next;}else{while(this._cur&&!this._cur.next&&this._cur!==this._root){this._handleTestObjectComplete(this._cur);this._cur=this._cur.parent;}if(this._cur==this._root){this._cur.results.type="report";this._cur.results.timestamp=(new Date()).toLocaleString();this.fireEvent(this.COMPLETE_EVENT,{results:this._cur.results});this._cur=null;}else{this._handleTestObjectComplete(this._cur);this._cur=this._cur.next;}}}return this._cur;},_run:function(){var E=false;var D=this._next();if(D!==null){var C=D.testObject;if(YAHOO.lang.isObject(C)){if(C instanceof YAHOO.tool.TestSuite){this.fireEvent(this.TEST_SUITE_BEGIN_EVENT,{testSuite:C});C.setUp();}else{if(C instanceof YAHOO.tool.TestCase){this.fireEvent(this.TEST_CASE_BEGIN_EVENT,{testCase:C});}}if(typeof setTimeout!="undefined"){setTimeout(function(){YAHOO.tool.TestRunner._run();},0);}else{this._run();}}else{this._runTest(D);}}},_resumeTest:function(G){var C=this._cur;var H=C.testObject;var E=C.parent.testObject;var K=(E._should.fail||{})[H];var D=(E._should.error||{})[H];var F=false;var I=null;try{G.apply(E);if(K){I=new YAHOO.util.ShouldFail();F=true;}else{if(D){I=new YAHOO.util.ShouldError();F=true;}}}catch(J){if(J instanceof YAHOO.util.AssertionError){if(!K){I=J;F=true;}}else{if(J instanceof YAHOO.tool.TestCase.Wait){if(YAHOO.lang.isFunction(J.segment)){if(YAHOO.lang.isNumber(J.delay)){if(typeof setTimeout!="undefined"){setTimeout(function(){YAHOO.tool.TestRunner._resumeTest(J.segment);},J.delay);}else{throw new Error("Asynchronous tests not supported in this environment.");}}}return ;}else{if(!D){I=new YAHOO.util.UnexpectedError(J);F=true;}else{if(YAHOO.lang.isString(D)){if(J.message!=D){I=new YAHOO.util.UnexpectedError(J);F=true;}}else{if(YAHOO.lang.isFunction(D)){if(!(J instanceof D)){I=new YAHOO.util.UnexpectedError(J);F=true;}}else{if(YAHOO.lang.isObject(D)){if(!(J instanceof D.constructor)||J.message!=D.message){I=new YAHOO.util.UnexpectedError(J);F=true;}}}}}}}}if(F){this.fireEvent(this.TEST_FAIL_EVENT,{testCase:E,testName:H,error:I});}else{this.fireEvent(this.TEST_PASS_EVENT,{testCase:E,testName:H});}E.tearDown();C.parent.results[H]={result:F?"fail":"pass",message:I?I.getMessage():"Test passed",type:"test",name:H};
+if(F){C.parent.results.failed++;}else{C.parent.results.passed++;}C.parent.results.total++;if(typeof setTimeout!="undefined"){setTimeout(function(){YAHOO.tool.TestRunner._run();},0);}else{this._run();}},_runTest:function(F){var C=F.testObject;var D=F.parent.testObject;var G=D[C];var E=(D._should.ignore||{})[C];if(E){F.parent.results[C]={result:"ignore",message:"Test ignored",type:"test",name:C};F.parent.results.ignored++;F.parent.results.total++;this.fireEvent(this.TEST_IGNORE_EVENT,{testCase:D,testName:C});if(typeof setTimeout!="undefined"){setTimeout(function(){YAHOO.tool.TestRunner._run();},0);}else{this._run();}}else{D.setUp();this._resumeTest(G);}},fireEvent:function(C,D){D=D||{};D.type=C;A.superclass.fireEvent.call(this,C,D);},add:function(C){this.masterSuite.add(C);},clear:function(){this.masterSuite.items=[];},resume:function(C){this._resumeTest(C||function(){});},run:function(C){var D=YAHOO.tool.TestRunner;D._buildTestTree();D.fireEvent(D.BEGIN_EVENT);D._run();}});return new A();})();YAHOO.namespace("util");YAHOO.util.Assert={_formatMessage:function(B,A){var C=B;if(YAHOO.lang.isString(B)&&B.length>0){return YAHOO.lang.substitute(B,{message:A});}else{return A;}},fail:function(A){throw new YAHOO.util.AssertionError(this._formatMessage(A,"Test force-failed."));},areEqual:function(B,C,A){if(B!=C){throw new YAHOO.util.ComparisonFailure(this._formatMessage(A,"Values should be equal."),B,C);}},areNotEqual:function(A,C,B){if(A==C){throw new YAHOO.util.UnexpectedValue(this._formatMessage(B,"Values should not be equal."),A);}},areNotSame:function(A,C,B){if(A===C){throw new YAHOO.util.UnexpectedValue(this._formatMessage(B,"Values should not be the same."),A);}},areSame:function(B,C,A){if(B!==C){throw new YAHOO.util.ComparisonFailure(this._formatMessage(A,"Values should be the same."),B,C);}},isFalse:function(B,A){if(false!==B){throw new YAHOO.util.ComparisonFailure(this._formatMessage(A,"Value should be false."),false,B);}},isTrue:function(B,A){if(true!==B){throw new YAHOO.util.ComparisonFailure(this._formatMessage(A,"Value should be true."),true,B);}},isNaN:function(B,A){if(!isNaN(B)){throw new YAHOO.util.ComparisonFailure(this._formatMessage(A,"Value should be NaN."),NaN,B);}},isNotNaN:function(B,A){if(isNaN(B)){throw new YAHOO.util.UnexpectedValue(this._formatMessage(A,"Values should not be NaN."),NaN);}},isNotNull:function(B,A){if(YAHOO.lang.isNull(B)){throw new YAHOO.util.UnexpectedValue(this._formatMessage(A,"Values should not be null."),null);}},isNotUndefined:function(B,A){if(YAHOO.lang.isUndefined(B)){throw new YAHOO.util.UnexpectedValue(this._formatMessage(A,"Value should not be undefined."),undefined);}},isNull:function(B,A){if(!YAHOO.lang.isNull(B)){throw new YAHOO.util.ComparisonFailure(this._formatMessage(A,"Value should be null."),null,B);}},isUndefined:function(B,A){if(!YAHOO.lang.isUndefined(B)){throw new YAHOO.util.ComparisonFailure(this._formatMessage(A,"Value should be undefined."),undefined,B);}},isArray:function(B,A){if(!YAHOO.lang.isArray(B)){throw new YAHOO.util.UnexpectedValue(this._formatMessage(A,"Value should be an array."),B);}},isBoolean:function(B,A){if(!YAHOO.lang.isBoolean(B)){throw new YAHOO.util.UnexpectedValue(this._formatMessage(A,"Value should be a Boolean."),B);}},isFunction:function(B,A){if(!YAHOO.lang.isFunction(B)){throw new YAHOO.util.UnexpectedValue(this._formatMessage(A,"Value should be a function."),B);}},isInstanceOf:function(B,C,A){if(!(C instanceof B)){throw new YAHOO.util.ComparisonFailure(this._formatMessage(A,"Value isn't an instance of expected type."),B,C);}},isNumber:function(B,A){if(!YAHOO.lang.isNumber(B)){throw new YAHOO.util.UnexpectedValue(this._formatMessage(A,"Value should be a number."),B);}},isObject:function(B,A){if(!YAHOO.lang.isObject(B)){throw new YAHOO.util.UnexpectedValue(this._formatMessage(A,"Value should be an object."),B);}},isString:function(B,A){if(!YAHOO.lang.isString(B)){throw new YAHOO.util.UnexpectedValue(this._formatMessage(A,"Value should be a string."),B);}},isTypeOf:function(A,C,B){if(typeof C!=A){throw new YAHOO.util.ComparisonFailure(this._formatMessage(B,"Value should be of type "+expected+"."),expected,typeof actual);}}};YAHOO.util.AssertionError=function(A){arguments.callee.superclass.constructor.call(this,A);this.message=A;this.name="AssertionError";};YAHOO.lang.extend(YAHOO.util.AssertionError,Error,{getMessage:function(){return this.message;},toString:function(){return this.name+": "+this.getMessage();},valueOf:function(){return this.toString();}});YAHOO.util.ComparisonFailure=function(B,A,C){arguments.callee.superclass.constructor.call(this,B);this.expected=A;this.actual=C;this.name="ComparisonFailure";};YAHOO.lang.extend(YAHOO.util.ComparisonFailure,YAHOO.util.AssertionError,{getMessage:function(){return this.message+"\nExpected: "+this.expected+" ("+(typeof this.expected)+")\nActual:"+this.actual+" ("+(typeof this.actual)+")";}});YAHOO.util.UnexpectedValue=function(B,A){arguments.callee.superclass.constructor.call(this,B);this.unexpected=A;this.name="UnexpectedValue";};YAHOO.lang.extend(YAHOO.util.UnexpectedValue,YAHOO.util.AssertionError,{getMessage:function(){return this.message+"\nUnexpected: "+this.unexpected+" ("+(typeof this.unexpected)+") ";}});YAHOO.util.ShouldFail=function(A){arguments.callee.superclass.constructor.call(this,A||"This test should fail but didn't.");this.name="ShouldFail";};YAHOO.lang.extend(YAHOO.util.ShouldFail,YAHOO.util.AssertionError);YAHOO.util.ShouldError=function(A){arguments.callee.superclass.constructor.call(this,A||"This test should have thrown an error but didn't.");this.name="ShouldError";};YAHOO.lang.extend(YAHOO.util.ShouldError,YAHOO.util.AssertionError);YAHOO.util.UnexpectedError=function(A){arguments.callee.superclass.constructor.call(this,"Unexpected error: "+A.message);this.cause=A;this.name="UnexpectedError";this.stack=A.stack;};YAHOO.lang.extend(YAHOO.util.UnexpectedError,YAHOO.util.AssertionError);YAHOO.util.ArrayAssert={contains:function(E,D,B){var C=false;
+var F=YAHOO.util.Assert;for(var A=0;A<D.length&&!C;A++){if(D[A]===E){C=true;}}if(!C){F.fail(F._formatMessage(B,"Value "+E+" ("+(typeof E)+") not found in array ["+D+"]."));}},containsItems:function(C,D,B){for(var A=0;A<C.length;A++){this.contains(C[A],D,B);}},containsMatch:function(E,D,B){if(typeof E!="function"){throw new TypeError("ArrayAssert.containsMatch(): First argument must be a function.");}var C=false;var F=YAHOO.util.Assert;for(var A=0;A<D.length&&!C;A++){if(E(D[A])){C=true;}}if(!C){F.fail(F._formatMessage(B,"No match found in array ["+D+"]."));}},doesNotContain:function(E,D,B){var C=false;var F=YAHOO.util.Assert;for(var A=0;A<D.length&&!C;A++){if(D[A]===E){C=true;}}if(C){F.fail(F._formatMessage(B,"Value found in array ["+D+"]."));}},doesNotContainItems:function(C,D,B){for(var A=0;A<C.length;A++){this.doesNotContain(C[A],D,B);}},doesNotContainMatch:function(E,D,B){if(typeof E!="function"){throw new TypeError("ArrayAssert.doesNotContainMatch(): First argument must be a function.");}var C=false;var F=YAHOO.util.Assert;for(var A=0;A<D.length&&!C;A++){if(E(D[A])){C=true;}}if(C){F.fail(F._formatMessage(B,"Value found in array ["+D+"]."));}},indexOf:function(E,D,A,C){for(var B=0;B<D.length;B++){if(D[B]===E){YAHOO.util.Assert.areEqual(A,B,C||"Value exists at index "+B+" but should be at index "+A+".");return ;}}var F=YAHOO.util.Assert;F.fail(F._formatMessage(C,"Value doesn't exist in array ["+D+"]."));},itemsAreEqual:function(D,F,C){var A=Math.max(D.length,F.length);var E=YAHOO.util.Assert;for(var B=0;B<A;B++){E.areEqual(D[B],F[B],E._formatMessage(C,"Values in position "+B+" are not equal."));}},itemsAreEquivalent:function(E,F,B,D){if(typeof B!="function"){throw new TypeError("ArrayAssert.itemsAreEquivalent(): Third argument must be a function.");}var A=Math.max(E.length,F.length);for(var C=0;C<A;C++){if(!B(E[C],F[C])){throw new YAHOO.util.ComparisonFailure(YAHOO.util.Assert._formatMessage(D,"Values in position "+C+" are not equivalent."),E[C],F[C]);}}},isEmpty:function(C,A){if(C.length>0){var B=YAHOO.util.Assert;B.fail(B._formatMessage(A,"Array should be empty."));}},isNotEmpty:function(C,A){if(C.length===0){var B=YAHOO.util.Assert;B.fail(B._formatMessage(A,"Array should not be empty."));}},itemsAreSame:function(D,F,C){var A=Math.max(D.length,F.length);var E=YAHOO.util.Assert;for(var B=0;B<A;B++){E.areSame(D[B],F[B],E._formatMessage(C,"Values in position "+B+" are not the same."));}},lastIndexOf:function(E,D,A,C){var F=YAHOO.util.Assert;for(var B=D.length;B>=0;B--){if(D[B]===E){F.areEqual(A,B,F._formatMessage(C,"Value exists at index "+B+" but should be at index "+A+"."));return ;}}F.fail(F._formatMessage(C,"Value doesn't exist in array."));}};YAHOO.namespace("util");YAHOO.util.ObjectAssert={propertiesAreEqual:function(D,G,C){var F=YAHOO.util.Assert;var B=[];for(var E in D){B.push(E);}for(var A=0;A<B.length;A++){F.isNotUndefined(G[B[A]],F._formatMessage(C,"Property '"+B[A]+"' expected."));}},hasProperty:function(A,B,C){if(!(A in B)){var D=YAHOO.util.Assert;D.fail(D._formatMessage(C,"Property '"+A+"' not found on object."));}},hasOwnProperty:function(A,B,C){if(!YAHOO.lang.hasOwnProperty(B,A)){var D=YAHOO.util.Assert;D.fail(D._formatMessage(C,"Property '"+A+"' not found on object instance."));}}};YAHOO.util.DateAssert={datesAreEqual:function(B,D,A){if(B instanceof Date&&D instanceof Date){var C=YAHOO.util.Assert;C.areEqual(B.getFullYear(),D.getFullYear(),C._formatMessage(A,"Years should be equal."));C.areEqual(B.getMonth(),D.getMonth(),C._formatMessage(A,"Months should be equal."));C.areEqual(B.getDate(),D.getDate(),C._formatMessage(A,"Day of month should be equal."));}else{throw new TypeError("DateAssert.datesAreEqual(): Expected and actual values must be Date objects.");}},timesAreEqual:function(B,D,A){if(B instanceof Date&&D instanceof Date){var C=YAHOO.util.Assert;C.areEqual(B.getHours(),D.getHours(),C._formatMessage(A,"Hours should be equal."));C.areEqual(B.getMinutes(),D.getMinutes(),C._formatMessage(A,"Minutes should be equal."));C.areEqual(B.getSeconds(),D.getSeconds(),C._formatMessage(A,"Seconds should be equal."));}else{throw new TypeError("DateAssert.timesAreEqual(): Expected and actual values must be Date objects.");}}};YAHOO.namespace("util");YAHOO.util.UserAction={simulateKeyEvent:function(F,J,E,C,L,B,A,K,H,N,M){F=YAHOO.util.Dom.get(F);if(!F){throw new Error("simulateKeyEvent(): Invalid target.");}if(YAHOO.lang.isString(J)){J=J.toLowerCase();switch(J){case"keyup":case"keydown":case"keypress":break;case"textevent":J="keypress";break;default:throw new Error("simulateKeyEvent(): Event type '"+J+"' not supported.");}}else{throw new Error("simulateKeyEvent(): Event type must be a string.");}if(!YAHOO.lang.isBoolean(E)){E=true;}if(!YAHOO.lang.isBoolean(C)){C=true;}if(!YAHOO.lang.isObject(L)){L=window;}if(!YAHOO.lang.isBoolean(B)){B=false;}if(!YAHOO.lang.isBoolean(A)){A=false;}if(!YAHOO.lang.isBoolean(K)){K=false;}if(!YAHOO.lang.isBoolean(H)){H=false;}if(!YAHOO.lang.isNumber(N)){N=0;}if(!YAHOO.lang.isNumber(M)){M=0;}var I=null;if(YAHOO.lang.isFunction(document.createEvent)){try{I=document.createEvent("KeyEvents");I.initKeyEvent(J,E,C,L,B,A,K,H,N,M);}catch(G){try{I=document.createEvent("Events");}catch(D){I=document.createEvent("UIEvents");}finally{I.initEvent(J,E,C);I.view=L;I.altKey=A;I.ctrlKey=B;I.shiftKey=K;I.metaKey=H;I.keyCode=N;I.charCode=M;}}F.dispatchEvent(I);}else{if(YAHOO.lang.isObject(document.createEventObject)){I=document.createEventObject();I.bubbles=E;I.cancelable=C;I.view=L;I.ctrlKey=B;I.altKey=A;I.shiftKey=K;I.metaKey=H;I.keyCode=(M>0)?M:N;F.fireEvent("on"+J,I);}else{throw new Error("simulateKeyEvent(): No event simulation framework present.");}}},simulateMouseEvent:function(K,P,H,E,Q,J,G,F,D,B,C,A,O,M,I,L){K=YAHOO.util.Dom.get(K);if(!K){throw new Error("simulateMouseEvent(): Invalid target.");}if(YAHOO.lang.isString(P)){P=P.toLowerCase();switch(P){case"mouseover":case"mouseout":case"mousedown":case"mouseup":case"click":case"dblclick":case"mousemove":break;default:throw new Error("simulateMouseEvent(): Event type '"+P+"' not supported.");
+}}else{throw new Error("simulateMouseEvent(): Event type must be a string.");}if(!YAHOO.lang.isBoolean(H)){H=true;}if(!YAHOO.lang.isBoolean(E)){E=(P!="mousemove");}if(!YAHOO.lang.isObject(Q)){Q=window;}if(!YAHOO.lang.isNumber(J)){J=1;}if(!YAHOO.lang.isNumber(G)){G=0;}if(!YAHOO.lang.isNumber(F)){F=0;}if(!YAHOO.lang.isNumber(D)){D=0;}if(!YAHOO.lang.isNumber(B)){B=0;}if(!YAHOO.lang.isBoolean(C)){C=false;}if(!YAHOO.lang.isBoolean(A)){A=false;}if(!YAHOO.lang.isBoolean(O)){O=false;}if(!YAHOO.lang.isBoolean(M)){M=false;}if(!YAHOO.lang.isNumber(I)){I=0;}var N=null;if(YAHOO.lang.isFunction(document.createEvent)){N=document.createEvent("MouseEvents");if(N.initMouseEvent){N.initMouseEvent(P,H,E,Q,J,G,F,D,B,C,A,O,M,I,L);}else{N=document.createEvent("UIEvents");N.initEvent(P,H,E);N.view=Q;N.detail=J;N.screenX=G;N.screenY=F;N.clientX=D;N.clientY=B;N.ctrlKey=C;N.altKey=A;N.metaKey=M;N.shiftKey=O;N.button=I;N.relatedTarget=L;}if(L&&!N.relatedTarget){if(P=="mouseout"){N.toElement=L;}else{if(P=="mouseover"){N.fromElement=L;}}}K.dispatchEvent(N);}else{if(YAHOO.lang.isObject(document.createEventObject)){N=document.createEventObject();N.bubbles=H;N.cancelable=E;N.view=Q;N.detail=J;N.screenX=G;N.screenY=F;N.clientX=D;N.clientY=B;N.ctrlKey=C;N.altKey=A;N.metaKey=M;N.shiftKey=O;switch(I){case 0:N.button=1;break;case 1:N.button=4;break;case 2:break;default:N.button=0;}N.relatedTarget=L;K.fireEvent("on"+P,N);}else{throw new Error("simulateMouseEvent(): No event simulation framework present.");}}},fireMouseEvent:function(C,B,A){A=A||{};this.simulateMouseEvent(C,B,A.bubbles,A.cancelable,A.view,A.detail,A.screenX,A.screenY,A.clientX,A.clientY,A.ctrlKey,A.altKey,A.shiftKey,A.metaKey,A.button,A.relatedTarget);},click:function(B,A){this.fireMouseEvent(B,"click",A);},dblclick:function(B,A){this.fireMouseEvent(B,"dblclick",A);},mousedown:function(B,A){this.fireMouseEvent(B,"mousedown",A);},mousemove:function(B,A){this.fireMouseEvent(B,"mousemove",A);},mouseout:function(B,A){this.fireMouseEvent(B,"mouseout",A);},mouseover:function(B,A){this.fireMouseEvent(B,"mouseover",A);},mouseup:function(B,A){this.fireMouseEvent(B,"mouseup",A);},fireKeyEvent:function(B,C,A){A=A||{};this.simulateKeyEvent(C,B,A.bubbles,A.cancelable,A.view,A.ctrlKey,A.altKey,A.shiftKey,A.metaKey,A.keyCode,A.charCode);},keydown:function(B,A){this.fireKeyEvent("keydown",B,A);},keypress:function(B,A){this.fireKeyEvent("keypress",B,A);},keyup:function(B,A){this.fireKeyEvent("keyup",B,A);}};YAHOO.namespace("tool");YAHOO.tool.TestManager={TEST_PAGE_BEGIN_EVENT:"testpagebegin",TEST_PAGE_COMPLETE_EVENT:"testpagecomplete",TEST_MANAGER_BEGIN_EVENT:"testmanagerbegin",TEST_MANAGER_COMPLETE_EVENT:"testmanagercomplete",_curPage:null,_frame:null,_logger:null,_timeoutId:0,_pages:[],_results:null,_handleTestRunnerComplete:function(A){this.fireEvent(this.TEST_PAGE_COMPLETE_EVENT,{page:this._curPage,results:A.results});this._processResults(this._curPage,A.results);this._logger.clearTestRunner();if(this._pages.length){this._timeoutId=setTimeout(function(){YAHOO.tool.TestManager._run();},1000);}else{this.fireEvent(this.TEST_MANAGER_COMPLETE_EVENT,this._results);}},_processResults:function(C,A){var B=this._results;B.passed+=A.passed;B.failed+=A.failed;B.ignored+=A.ignored;B.total+=A.total;if(A.failed){B.failedPages.push(C);}else{B.passedPages.push(C);}A.name=C;A.type="page";B[C]=A;},_run:function(){this._curPage=this._pages.shift();this.fireEvent(this.TEST_PAGE_BEGIN_EVENT,this._curPage);this._frame.location.replace(this._curPage);},load:function(){if(parent.YAHOO.tool.TestManager!==this){parent.YAHOO.tool.TestManager.load();}else{if(this._frame){var A=this._frame.YAHOO.tool.TestRunner;this._logger.setTestRunner(A);A.subscribe(A.COMPLETE_EVENT,this._handleTestRunnerComplete,this,true);A.run();}}},setPages:function(A){this._pages=A;},start:function(){if(!this._initialized){this.createEvent(this.TEST_PAGE_BEGIN_EVENT);this.createEvent(this.TEST_PAGE_COMPLETE_EVENT);this.createEvent(this.TEST_MANAGER_BEGIN_EVENT);this.createEvent(this.TEST_MANAGER_COMPLETE_EVENT);if(!this._frame){var A=document.createElement("iframe");A.style.visibility="hidden";A.style.position="absolute";document.body.appendChild(A);this._frame=A.contentWindow||A.contentDocument.ownerWindow;}if(!this._logger){this._logger=new YAHOO.tool.TestLogger();}this._initialized=true;}this._results={passed:0,failed:0,ignored:0,total:0,type:"report",name:"YUI Test Results",failedPages:[],passedPages:[]};this.fireEvent(this.TEST_MANAGER_BEGIN_EVENT,null);this._run();},stop:function(){clearTimeout(this._timeoutId);}};YAHOO.lang.augmentObject(YAHOO.tool.TestManager,YAHOO.util.EventProvider.prototype);YAHOO.namespace("tool");YAHOO.tool.TestLogger=function(B,A){YAHOO.tool.TestLogger.superclass.constructor.call(this,B,A);this.init();};YAHOO.lang.extend(YAHOO.tool.TestLogger,YAHOO.widget.LogReader,{footerEnabled:true,newestOnTop:false,formatMsg:function(B){var A=B.category;var C=this.html2Text(B.msg);return"<pre><p><span class=\""+A+"\">"+A.toUpperCase()+"</span> "+C+"</p></pre>";},init:function(){if(YAHOO.tool.TestRunner){this.setTestRunner(YAHOO.tool.TestRunner);}this.hideSource("global");this.hideSource("LogReader");this.hideCategory("warn");this.hideCategory("window");this.hideCategory("time");this.clearConsole();},clearTestRunner:function(){if(this._runner){this._runner.unsubscribeAll();this._runner=null;}},setTestRunner:function(A){if(this._runner){this.clearTestRunner();}this._runner=A;A.subscribe(A.TEST_PASS_EVENT,this._handleTestRunnerEvent,this,true);A.subscribe(A.TEST_FAIL_EVENT,this._handleTestRunnerEvent,this,true);A.subscribe(A.TEST_IGNORE_EVENT,this._handleTestRunnerEvent,this,true);A.subscribe(A.BEGIN_EVENT,this._handleTestRunnerEvent,this,true);A.subscribe(A.COMPLETE_EVENT,this._handleTestRunnerEvent,this,true);A.subscribe(A.TEST_SUITE_BEGIN_EVENT,this._handleTestRunnerEvent,this,true);A.subscribe(A.TEST_SUITE_COMPLETE_EVENT,this._handleTestRunnerEvent,this,true);A.subscribe(A.TEST_CASE_BEGIN_EVENT,this._handleTestRunnerEvent,this,true);
+A.subscribe(A.TEST_CASE_COMPLETE_EVENT,this._handleTestRunnerEvent,this,true);},_handleTestRunnerEvent:function(D){var A=YAHOO.tool.TestRunner;var C="";var B="";switch(D.type){case A.BEGIN_EVENT:C="Testing began at "+(new Date()).toString()+".";B="info";break;case A.COMPLETE_EVENT:C="Testing completed at "+(new Date()).toString()+".\nPassed:"+D.results.passed+" Failed:"+D.results.failed+" Total:"+D.results.total;B="info";break;case A.TEST_FAIL_EVENT:C=D.testName+": "+D.error.getMessage();B="fail";break;case A.TEST_IGNORE_EVENT:C=D.testName+": ignored.";B="ignore";break;case A.TEST_PASS_EVENT:C=D.testName+": passed.";B="pass";break;case A.TEST_SUITE_BEGIN_EVENT:C="Test suite \""+D.testSuite.name+"\" started.";B="info";break;case A.TEST_SUITE_COMPLETE_EVENT:C="Test suite \""+D.testSuite.name+"\" completed.\nPassed:"+D.results.passed+" Failed:"+D.results.failed+" Total:"+D.results.total;B="info";break;case A.TEST_CASE_BEGIN_EVENT:C="Test case \""+D.testCase.name+"\" started.";B="info";break;case A.TEST_CASE_COMPLETE_EVENT:C="Test case \""+D.testCase.name+"\" completed.\nPassed:"+D.results.passed+" Failed:"+D.results.failed+" Total:"+D.results.total;B="info";break;default:C="Unexpected event "+D.type;C="info";}YAHOO.log(C,B,"TestRunner");}});YAHOO.namespace("tool.TestFormat");YAHOO.tool.TestFormat.JSON=function(A){return YAHOO.lang.JSON.stringify(A);};YAHOO.tool.TestFormat.XML=function(C){var A=YAHOO.lang;var B="<"+C.type+" name=\""+C.name.replace(/"/g,"&quot;").replace(/'/g,"&apos;")+"\"";if(C.type=="test"){B+=" result=\""+C.result+"\" message=\""+C.message+"\">";}else{B+=" passed=\""+C.passed+"\" failed=\""+C.failed+"\" ignored=\""+C.ignored+"\" total=\""+C.total+"\">";for(var D in C){if(A.hasOwnProperty(C,D)&&A.isObject(C[D])&&!A.isArray(C[D])){B+=arguments.callee(C[D]);}}}B+="</"+C.type+">";return B;};YAHOO.namespace("tool");YAHOO.tool.TestReporter=function(A,B){this.url=A;this.format=B||YAHOO.tool.TestFormat.XML;this._fields=new Object();this._form=null;this._iframe=null;};YAHOO.tool.TestReporter.prototype={constructor:YAHOO.tool.TestReporter,addField:function(A,B){this._fields[A]=B;},clearFields:function(){this._fields=new Object();},destroy:function(){if(this._form){this._form.parentNode.removeChild(this._form);this._form=null;}if(this._iframe){this._iframe.parentNode.removeChild(this._iframe);this._iframe=null;}this._fields=null;},report:function(A){if(!this._form){this._form=document.createElement("form");this._form.method="post";this._form.style.visibility="hidden";this._form.style.position="absolute";this._form.style.top=0;document.body.appendChild(this._form);if(YAHOO.env.ua.ie){this._iframe=document.createElement("<iframe name=\"yuiTestTarget\" />");}else{this._iframe=document.createElement("iframe");this._iframe.name="yuiTestTarget";}this._iframe.src="javascript:false";this._iframe.style.visibility="hidden";this._iframe.style.position="absolute";this._iframe.style.top=0;document.body.appendChild(this._iframe);this._form.target="yuiTestTarget";}this._form.action=this.url;while(this._form.hasChildNodes()){this._form.removeChild(this._form.lastChild);}this._fields.results=this.format(A);this._fields.useragent=navigator.userAgent;this._fields.timestamp=(new Date()).toLocaleString();for(var B in this._fields){if(YAHOO.lang.hasOwnProperty(this._fields,B)&&typeof this._fields[B]!="function"){if(YAHOO.env.ua.ie){input=document.createElement("<input name=\""+B+"\" >");}else{input=document.createElement("input");input.name=B;}input.type="hidden";input.value=this._fields[B];this._form.appendChild(input);}}delete this._fields.results;delete this._fields.useragent;delete this._fields.timestamp;if(arguments[1]!==false){this._form.submit();}}};YAHOO.register("yuitest",YAHOO.tool.TestRunner,{version:"2.5.2",build:"1076"});
Index: /CKEditor/tags/3.0 Beta/_source/themes/default/theme.js
===================================================================
--- /CKEditor/tags/3.0 Beta/_source/themes/default/theme.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/_source/themes/default/theme.js	(revision 3046)
@@ -0,0 +1,184 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+CKEDITOR.themes.add( 'default', (function()
+{
+	// The CSS class to be appended on the main UI containers, making it easy
+	// to apply browser specific styles to it.
+	var browserCssClass =
+			'cke_browser_' + (
+				CKEDITOR.env.ie ? 'ie' :
+				CKEDITOR.env.gecko ? 'gecko' :
+				CKEDITOR.env.opera ? 'opera' :
+				CKEDITOR.env.air ? 'air' :
+				CKEDITOR.env.webkit ? 'webkit' :
+				'unknown' );
+
+	return {
+		build : function( editor, themePath )
+		{
+			var name = editor.name,
+				element = editor.element,
+				elementMode = editor.elementMode;
+
+			if ( !element || elementMode == CKEDITOR.ELEMENT_MODE_NONE )
+				return;
+
+			if ( elementMode == CKEDITOR.ELEMENT_MODE_REPLACE )
+				element.hide();
+
+			// Get the HTML for the predefined spaces.
+			var topHtml			= editor.fire( 'themeSpace', { space : 'top', html : '' } ).html;
+			var contentsHtml	= editor.fire( 'themeSpace', { space : 'contents', html : '' } ).html;
+			var bottomHtml		= editor.fireOnce( 'themeSpace', { space : 'bottom', html : '' } ).html;
+
+			var height	= contentsHtml && editor.config.height;
+			var width	= editor.config.width;
+
+			// The editor height is considered only if the contents space got filled.
+			if ( !contentsHtml )
+				height = 'auto';
+			else if ( !isNaN( height ) )
+				height += 'px';
+
+			if ( !isNaN( width ) )
+				width += 'px';
+
+			// Using a <div> as the outer element container can make IE goes crazy.
+			// The fact is that a <textarea> is an inline element. We aim to
+			// replace it with our structure, but <div> is a block element and it
+			// seems to be the cause of it. Using a <span>, which is inline just
+			// like <textarea>, makes it work.
+			// <table> is also a block element and should not go inside a <span>,
+			// not even in the places where <textarea> is valid. But this doesn't
+			// bring any evident problem as it seems that tables are treated
+			// differently by the browsers ("semi-inline").
+			var container = CKEDITOR.dom.element.createFromHtml( [
+				'<span id="cke_', name, '" onmousedown="return false;" class="cke_container cke_skin_', editor.config.skin, ' ', browserCssClass,
+					' cke_', editor.lang.dir, '" dir="', editor.lang.dir, '">' +
+					'<table class="cke_editor" border="0" cellspacing="0" cellpadding="0" style="width:', width, ';height:', height, '"><tbody>' +
+						'<tr', topHtml		? '' : ' style="display:none"', '><td id="cke_top_'		, name, '" class="cke_top">'		, topHtml		, '</td></tr>' +
+						'<tr', contentsHtml	? '' : ' style="display:none"', '><td id="cke_contents_', name, '" class="cke_contents" style="height:100%">'	, contentsHtml	, '</td></tr>' +
+						'<tr', bottomHtml	? '' : ' style="display:none"', '><td id="cke_bottom_'	, name, '" class="cke_bottom">'		, bottomHtml	, '</td></tr>' +
+					'</tbody></table>' +
+					//Hide the container when loading skins, later restored by skin css.
+					'<style>.cke_container{visibility:hidden;}</style>' +
+				'</span>' ].join( '' ) );
+
+			container.getChild( [0, 0, 0] ).unselectable();
+			container.getChild( [0, 0, 2] ).unselectable();
+
+			if ( elementMode == CKEDITOR.ELEMENT_MODE_REPLACE )
+				container.insertAfter( element );
+			else
+				element.append( container );
+
+			/**
+			 * The DOM element that holds the main editor interface.
+			 * @name CKEDITOR.editor.prototype.container
+			 * @type CKEDITOR.dom.element
+			 * @example
+			 * var editor = CKEDITOR.instances.editor1;
+			 * alert( <b>editor.container</b>.getName() );  "span"
+			 */
+			editor.container = container;
+
+			editor.fireOnce( 'themeLoaded' );
+			editor.fireOnce( 'uiReady' );
+		},
+
+		buildDialog : function( editor )
+		{
+			var baseIdNumber = CKEDITOR.tools.getNextNumber();
+
+			var element = CKEDITOR.dom.element.createFromHtml( [
+					'<div class="cke_skin_', editor.config.skin, ' ', browserCssClass, ' ',
+						CKEDITOR.document.$.compatMode == 'CSS1Compat' ? 'cke_mode_standards' : 'cke_mode_quirks',
+						' cke_', editor.lang.dir,
+						'" dir="', editor.lang.dir, '">' +
+						'<div id="%#" class="cke_dialog" style="position:',
+							( CKEDITOR.env.ie6Compat ? 'absolute;' : 'fixed;' ), '">',
+							'<div>'+
+								'<div id="%tl_#" class="%tl">' +
+									'<div id="%tl_resize_#" class="%tl_resize"></div>' +
+								'</div>' +
+								'<div id="%t_#" class="%t">' +
+									'<div id="%t_resize_#" class="%t_resize"></div>' +
+								'</div>' +
+								'<div id="%tr_#" class="%tr">' +
+									'<div id="%tr_resize_#" class="%tr_resize"></div>' +
+								'</div>' +
+							'</div>' +
+							'<div>' +
+								'<div id="%l_#" class="%l">' +
+									'<div id="%l_resize_#" class="%l_resize"></div>' +
+								'</div>' +
+								'<div id="%c_#" class="%c">' +
+									'<div id="%title_#" class="%title">' +
+										'<div id="%close_button_#" class="%close_button"></div>' +
+									'</div>' +
+									'<table id="%tabs_#" class="%tabs" cellpadding="0" border="0" cellspacing="0"><tbody><tr>' +
+									'<td class="head_filler">&nbsp;</td>' +
+									'<td class="tail_filler">&nbsp;</td>' +
+									'</tr></tbody></table>' +
+									'<div id="%contents_#" class="%contents"></div>' +
+									'<div id="%footer_#" class="%footer"></div>' +
+								'</div>' +
+								'<div id="%r_#" class="%r">' +
+									'<div id="%r_resize_#" class="%r_resize"></div>' +
+								'</div>' +
+							'</div>' +
+							'<div>' +
+								'<div id="%bl_#" class="%bl">' +
+									'<div id="%bl_resize_#" class="%bl_resize"></div>' +
+								'</div>' +
+								'<div id="%b_#" class="%b">' +
+									'<div id="%b_resize_#" class="%b_resize"></div>' +
+								'</div>' +
+								'<div id="%br_#" class="%br">' +
+									'<div id="%br_resize_#" class="%br_resize"></div>' +
+								'</div>' +
+							'</div>' +
+						'</div>',
+						//Hide the container when loading skins, later restored by skin css.
+						( CKEDITOR.env.ie ? '' : '<style>.cke_dialog{visibility:hidden;}</style>' ),
+					'</div>'
+				].join( '' )
+					.replace( /#/g, baseIdNumber )
+					.replace( /%/g, 'cke_dialog_' ) );
+
+			// Make the Title unselectable.
+			element.getChild( [0, 1, 1, 0] ).unselectable();
+
+			return {
+				element : element,
+				titleId : 'cke_dialog_title_' + baseIdNumber,
+				contentsId : 'cke_dialog_contents_' + baseIdNumber,
+				footerId : 'cke_dialog_footer_' + baseIdNumber,
+				closeIds : [ 'cke_dialog_close_button_' + baseIdNumber ],
+				dragIds : [ 'cke_dialog_title_' + baseIdNumber, 'cke_dialog_tabs_' + baseIdNumber ]
+			};
+		},
+
+		destroy : function( editor )
+		{
+			var container = editor.container;
+
+			if ( container )
+				container.remove();
+
+			if ( editor.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE )
+				editor.element.show();
+		}
+	};
+})() );
+
+CKEDITOR.editor.prototype.getThemeSpace = function( spaceName )
+{
+	var spacePrefix = 'cke_' + spaceName;
+	var space = this._[ spacePrefix ] ||
+		( this._[ spacePrefix ] = CKEDITOR.document.getById( spacePrefix + '_' + this.name ) );
+	return space;
+};
Index: /CKEditor/tags/3.0 Beta/ckeditor.pack
===================================================================
--- /CKEditor/tags/3.0 Beta/ckeditor.pack	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/ckeditor.pack	(revision 3046)
@@ -0,0 +1,142 @@
+﻿/*
+ * CKPackager - Sample Package file
+ */
+
+header :
+	'/*'																			+ '\n' +
+	'Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.'	+ '\n' +
+	'For licensing, see LICENSE.html or http://ckeditor.com/license'				+ '\n' +
+	'*/'																			+ '\n' +
+	'\n',
+
+noCheck : false,
+
+constants :
+	{
+		'CKEDITOR.ELEMENT_MODE_NONE' : 0,
+		'CKEDITOR.ELEMENT_MODE_REPLACE' : 1,
+		'CKEDITOR.ELEMENT_MODE_APPENDTO' : 2,
+		'CKEDITOR.CTRL' : 1000,
+		'CKEDITOR.SHIFT' : 2000,
+		'CKEDITOR.ALT' : 4000,
+		'CKEDITOR.NODE_ELEMENT' : 1,
+		'CKEDITOR.NODE_TEXT' : 3,
+		'CKEDITOR.NODE_COMMENT' : 8,
+		'CKEDITOR.NODE_DOCUMENT_FRAGMENT' : 11,
+		'CKEDITOR.POSITION_IDENTICAL' : 0,
+		'CKEDITOR.POSITION_DISCONNECTED' : 1,
+		'CKEDITOR.POSITION_FOLLOWING' : 2,
+		'CKEDITOR.POSITION_PRECEDING' : 4,
+		'CKEDITOR.POSITION_IS_CONTAINED' : 8,
+		'CKEDITOR.POSITION_CONTAINS' : 16,
+		'CKEDITOR.TRISTATE_ON' : 1,
+		'CKEDITOR.TRISTATE_OFF' : 2,
+		'CKEDITOR.TRISTATE_DISABLED' : 0,
+		'CKEDITOR.POSITION_AFTER_START' : 1,
+		'CKEDITOR.POSITION_BEFORE_END' : 2,
+		'CKEDITOR.POSITION_BEFORE_START' : 3,
+		'CKEDITOR.POSITION_AFTER_END' : 4,
+		'CKEDITOR.ENLARGE_ELEMENT' : 1,
+		'CKEDITOR.ENLARGE_BLOCK_CONTENTS' : 2,
+		'CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS' : 3,
+		'CKEDITOR.UI_BUTTON' : 1,
+		'CKEDITOR.STYLE_BLOCK' : 1,
+		'CKEDITOR.STYLE_INLINE' : 2,
+		'CKEDITOR.STYLE_OBJECT' : 3,
+		'CKEDITOR.SELECTION_NONE' : 1,
+		'CKEDITOR.SELECTION_TEXT' : 2,
+		'CKEDITOR.SELECTION_ELEMENT' : 3,
+		'CKEDITOR.DIALOG_RESIZE_NONE' : 0,
+		'CKEDITOR.DIALOG_RESIZE_WIDTH' : 1,
+		'CKEDITOR.DIALOG_RESIZE_HEIGHT' : 2,
+		'CKEDITOR.DIALOG_RESIZE_BOTH' : 3,
+		'CKEDITOR.VALIDATE_OR' : 1,
+		'CKEDITOR.VALIDATE_AND' : 2
+	},
+
+packages :
+	[
+		{
+			output : 'ckeditor_basic.js',
+			wrap : true,
+			files :
+				[
+					'_source/core/ckeditor_base.js',
+					'_source/core/event.js',
+					'_source/core/editor_basic.js',
+					'_source/core/env.js',
+					'_source/core/ckeditor_basic.js'
+				]
+		},
+
+		{
+			output : 'ckeditor.js',
+			wrap : true,
+			files :
+				[
+					'_source/core/ckeditor_base.js',
+					'_source/core/event.js',
+					'_source/core/editor_basic.js',
+					'_source/core/env.js',
+					'_source/core/ckeditor_basic.js',
+					'_source/core/dom.js',
+					'_source/core/tools.js',
+					'_source/core/dtd.js',
+					'_source/core/dom/event.js',
+					'_source/core/dom/domobject.js',
+					'_source/core/dom/node.js',
+					'_source/core/dom/nodelist.js',
+					'_source/core/dom/element.js',
+					'_source/core/dom/window.js',
+					'_source/core/dom/document.js',
+					'_source/core/command.js',
+					'_source/core/config.js',
+					'_source/core/focusmanager.js',
+					'_source/core/lang.js',
+					'_source/core/scriptloader.js',
+					'_source/core/resourcemanager.js',
+					'_source/core/plugins.js',
+					'_source/core/imagecacher.js',
+					'_source/core/skins.js',
+					'_source/core/themes.js',
+					'_source/core/ui.js',
+					'_source/core/editor.js',
+					'_source/core/htmlparser.js',
+					'_source/core/htmlparser/comment.js',
+					'_source/core/htmlparser/text.js',
+					'_source/core/htmlparser/fragment.js',
+					'_source/core/htmlparser/element.js',
+					'_source/core/ckeditor.js',
+					'_source/core/dom/elementpath.js',
+					'_source/core/dom/text.js',
+					'_source/core/dom/documentFragment.js',
+					'_source/core/dom/domwalker.js',
+					'_source/core/dom/range.js',
+					'_source/core/_bootstrap.js',
+//					'_source/lang/en.js',
+					'_source/plugins/basicstyles/plugin.js',
+					'_source/plugins/button/plugin.js',
+					'_source/plugins/editingblock/plugin.js',
+					'_source/plugins/elementspath/plugin.js',
+					'_source/plugins/horizontalrule/plugin.js',
+					'_source/plugins/htmldataprocessor/plugin.js',
+					'_source/plugins/keystrokes/plugin.js',
+					'_source/plugins/newpage/plugin.js',
+					'_source/plugins/removeformat/plugin.js',
+					'_source/plugins/smiley/plugin.js',
+					'_source/plugins/sourcearea/plugin.js',
+					'_source/plugins/specialchar/plugin.js',
+					'_source/plugins/tab/plugin.js',
+					'_source/plugins/toolbar/plugin.js',
+					'_source/plugins/wysiwygarea/plugin.js',
+					'_source/plugins/styles/plugin.js',
+					'_source/plugins/selection/plugin.js',
+					'_source/plugins/htmlwriter/plugin.js',
+					'_source/plugins/dialog/plugin.js',
+					'_source/plugins/dialogui/plugin.js',
+					'_source/skins/default/skin.js',
+					'_source/themes/default/theme.js'
+				]
+		}
+
+	]
Index: /CKEditor/tags/3.0 Beta/ckeditor_basic_source.js
===================================================================
--- /CKEditor/tags/3.0 Beta/ckeditor_basic_source.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/ckeditor_basic_source.js	(revision 3046)
@@ -0,0 +1,20 @@
+/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+// Compressed version of core/ckeditor_base.js. See original for instructions.
+/*jsl:ignore*/
+if (!window.CKEDITOR){window.CKEDITOR=(function(){return/**@lends CKEDITOR*/{_:{},status:'unloaded',timestamp:'',basePath:(function(){var A='';var B=document.getElementsByTagName('script');for (var i=0;i<B.length;i++){var C=B[i].src.match(/(^|.*[\\\/])ckeditor(?:_basic)?(?:_source)?.js(?:\?.*)?$/i);if (C){A=C[1];break;}};if (A.indexOf('://')==-1){if (A.indexOf('/')===0) A=location.href.match(/^.*?:\/\/[^\/]*/)[0]+A;else A=location.href.match(/^[^\?]*\//)[0]+A;};return A;})(),getUrl:function(resource){if (resource.indexOf('://')==-1&&resource.indexOf('/')!==0) resource=this.basePath+resource;if (this.timestamp) resource+=(resource.indexOf('?')>=0?'&':'?')+'t='+this.timestamp;return resource;}};})();};
+/*jsl:end*/
+
+// Uncomment the following line to have a new timestamp generated for each
+// request, having clear cache load of the editor code.
+// CKEDITOR.timestamp = ( new Date() ).valueOf();
+
+// Set the script name to be loaded by the loader.
+CKEDITOR._autoLoad = 'core/ckeditor_basic';
+
+// Include the loader script.
+document.write(
+	'<script type="text/javascript" src="' + CKEDITOR.getUrl( '_source/core/loader.js' ) + '"></script>' );
Index: /CKEditor/tags/3.0 Beta/ckeditor_source.js
===================================================================
--- /CKEditor/tags/3.0 Beta/ckeditor_source.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/ckeditor_source.js	(revision 3046)
@@ -0,0 +1,25 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+// Compressed version of core/ckeditor_base.js. See original for instructions.
+/*jsl:ignore*/
+if (!window.CKEDITOR){window.CKEDITOR=(function(){return/**@lends CKEDITOR*/{_:{},status:'unloaded',timestamp:'',basePath:(function(){var A='';var B=document.getElementsByTagName('script');for (var i=0;i<B.length;i++){var C=B[i].src.match(/(^|.*[\\\/])ckeditor(?:_basic)?(?:_source)?.js(?:\?.*)?$/i);if (C){A=C[1];break;}};if (A.indexOf('://')==-1){if (A.indexOf('/')===0) A=location.href.match(/^.*?:\/\/[^\/]*/)[0]+A;else A=location.href.match(/^[^\?]*\//)[0]+A;};return A;})(),getUrl:function(resource){if (resource.indexOf('://')==-1&&resource.indexOf('/')!==0) resource=this.basePath+resource;if (this.timestamp) resource+=(resource.indexOf('?')>=0?'&':'?')+'t='+this.timestamp;return resource;}};})();};
+/*jsl:end*/
+
+// Uncomment the following line to have a new timestamp generated for each
+// request, having clear cache load of the editor code.
+// CKEDITOR.timestamp = ( new Date() ).valueOf();
+
+if ( CKEDITOR.loader )
+	CKEDITOR.loader.load( 'core/ckeditor' );
+else
+{
+	// Set the script name to be loaded by the loader.
+	CKEDITOR._autoLoad = 'core/ckeditor';
+
+	// Include the loader script.
+	document.write(
+		'<script type="text/javascript" src="' + CKEDITOR.getUrl( '_source/core/loader.js' ) + '"></script>' );
+}
Index: /CKEditor/tags/3.0 Beta/config.js
===================================================================
--- /CKEditor/tags/3.0 Beta/config.js	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/config.js	(revision 3046)
@@ -0,0 +1,11 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+CKEDITOR.editorConfig = function( config )
+{
+	// Define changes to default configuration here. For example:
+	// config.autoLanguage = false;
+	// config.defaultLanguage = 'pt-br';
+};
Index: /CKEditor/tags/3.0 Beta/contents.css
===================================================================
--- /CKEditor/tags/3.0 Beta/contents.css	(revision 3046)
+++ /CKEditor/tags/3.0 Beta/contents.css	(revision 3046)
@@ -0,0 +1,49 @@
+﻿/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+body
+{
+	/* Font */
+	font-family: Arial, Verdana, sans-serif;
+	font-size: 12px;
+
+	/* Remove the background color to make it transparent */
+	background-color: #fff;
+}
+
+/* The following declarations are to be removed from this file (#2786) */
+
+img.cke_fakeobject
+{
+	background-position: center center;
+	background-repeat: no-repeat;
+	border: 1px solid #a9a9a9;
+	width: 80px;
+	height: 80px;
+}
+
+img.cke_fakeobject.flash
+{
+	background-image: url(images/flashlogo.gif);
+}
+
+img.cke_fakeobject.object
+{
+	background-image: url(images/plugin.gif);
+}
+
+img.cke_fakeobject.anchor
+{
+	background-image: url(images/anchor.gif);
+	width: 18px;
+	height: 18px;
+}
+
+img.cke_fakeobject.pagebreak
+{
+	background-image: url(images/pagebreak.gif);
+	width: 100%;
+	height: 7px;
+}
