(no commit message) 1.0.1
authorGreg Burri <greg.burri@gmail.com>
Fri, 6 Jun 2008 20:48:15 +0000 (20:48 +0000)
committerGreg Burri <greg.burri@gmail.com>
Fri, 6 Jun 2008 20:48:15 +0000 (20:48 +0000)
160 files changed:
COPYING [new file with mode: 0644]
README [new file with mode: 0644]
css/1/euphorik.css [new file with mode: 0755]
css/1/pageAbout.css [new file with mode: 0644]
css/1/pageAdmin.css [new file with mode: 0644]
css/1/pageMinichat.css [new file with mode: 0755]
css/1/pageProfileRegister.css [new file with mode: 0755]
css/2/euphorik.css [new file with mode: 0755]
css/2/pageAbout.css [new file with mode: 0644]
css/2/pageAdmin.css [new file with mode: 0644]
css/2/pageMinichat.css [new file with mode: 0755]
css/2/pageProfileRegister.css [new file with mode: 0755]
css/3/euphorik.css [new file with mode: 0755]
css/3/pageMinichat.css [new file with mode: 0755]
css/3/pageProfileRegister.css [new file with mode: 0755]
css/jquery.lightbox.css [new file with mode: 0644]
doc/TODO.txt [new file with mode: 0755]
doc/description.txt [new file with mode: 0644]
doc/graphiques/bouton_smiles.xcf [new file with mode: 0644]
doc/graphiques/couleurs entetes messages css1.svg [new file with mode: 0644]
doc/graphiques/fond.xcf [new file with mode: 0755]
doc/graphiques/fond2.xcf [new file with mode: 0644]
doc/graphiques/fond3.xcf [new file with mode: 0644]
doc/graphiques/icones/ban.xcf [new file with mode: 0644]
doc/graphiques/icones/exclamation.xcf [new file with mode: 0755]
doc/graphiques/icones/fermer.xcf [new file with mode: 0755]
doc/graphiques/icones/information.xcf [new file with mode: 0755]
doc/graphiques/icones/interrogation.xcf [new file with mode: 0755]
doc/graphiques/icones/kick.xcf [new file with mode: 0644]
doc/graphiques/icones/slap.xcf [new file with mode: 0644]
doc/graphiques/logo.png [new file with mode: 0644]
doc/graphiques/logo_1.xcf [new file with mode: 0755]
doc/graphiques/logo_2.xcf [new file with mode: 0755]
doc/graphiques/maquette_1.svg [new file with mode: 0644]
doc/graphiques/old.xcf [new file with mode: 0755]
doc/graphiques/old_piedpage.xcf [new file with mode: 0755]
doc/graphiques/path2383.png [new file with mode: 0644]
doc/graphiques/return.xcf [new file with mode: 0755]
doc/installation.txt [new file with mode: 0644]
doc/profiling/JavaScript Profile Data 2008-04-15.html [new file with mode: 0644]
doc/profiling/JavaScript Profile Data 2008-04-15_files/a [new file with mode: 0644]
doc/profiling/profiling.txt [new file with mode: 0644]
doc/protocole3.txt [new file with mode: 0644]
doc/technique.txt [new file with mode: 0644]
doc/uml.zargo [new file with mode: 0644]
favicon.ico [new file with mode: 0644]
img/ban.gif [new file with mode: 0644]
img/css1/copier_conv.png [new file with mode: 0644]
img/css1/copier_conv_hover.png [new file with mode: 0644]
img/css1/extraction.png [new file with mode: 0644]
img/css1/extraction_hover.png [new file with mode: 0644]
img/css1/fermer_conv.png [new file with mode: 0644]
img/css1/fermer_conv_hover.png [new file with mode: 0644]
img/css1/fleche.png [new file with mode: 0644]
img/css1/fleche_bulle.png [new file with mode: 0644]
img/css1/fleche_reponda.png [new file with mode: 0644]
img/css1/fond.png [new file with mode: 0644]
img/css1/logo.png [new file with mode: 0644]
img/css1/logo_fond.png [new file with mode: 0644]
img/css1/return.png [new file with mode: 0755]
img/css1/triangle.png [new file with mode: 0644]
img/css2/bouton_smiles.png [new file with mode: 0644]
img/css2/fleche_bulle.png [new file with mode: 0644]
img/css2/fond.png [new file with mode: 0755]
img/css2/logo_1.png [new file with mode: 0755]
img/css2/logo_2.png [new file with mode: 0755]
img/css2/return.png [new file with mode: 0755]
img/css3/logo.gif [new file with mode: 0755]
img/css3/logo.png [new file with mode: 0755]
img/css3/piedpage.png [new file with mode: 0755]
img/exclamation.gif [new file with mode: 0755]
img/fermer.gif [new file with mode: 0755]
img/information.gif [new file with mode: 0755]
img/interrogation.gif [new file with mode: 0755]
img/kick.gif [new file with mode: 0644]
img/lightbox-blank.gif [new file with mode: 0644]
img/lightbox-btn-close.gif [new file with mode: 0644]
img/lightbox-btn-next.gif [new file with mode: 0644]
img/lightbox-btn-prev.gif [new file with mode: 0644]
img/lightbox-ico-loading.gif [new file with mode: 0644]
img/loading.gif [new file with mode: 0644]
img/powered-by-yaws.gif [new file with mode: 0755]
img/slap.gif [new file with mode: 0644]
img/smileys/agreed.gif [new file with mode: 0644]
img/smileys/alien.gif [new file with mode: 0755]
img/smileys/argn.gif [new file with mode: 0755]
img/smileys/autres/icon_angry.gif [new file with mode: 0755]
img/smileys/autres/icon_chinese.gif [new file with mode: 0755]
img/smileys/autres/icon_confused.gif [new file with mode: 0755]
img/smileys/autres/icon_cool.gif [new file with mode: 0755]
img/smileys/autres/icon_largesmile.gif [new file with mode: 0755]
img/smileys/autres/icon_lol.gif [new file with mode: 0755]
img/smileys/autres/icon_mrgreen.gif [new file with mode: 0755]
img/smileys/autres/icon_neutral.gif [new file with mode: 0755]
img/smileys/autres/icon_redface.gif [new file with mode: 0755]
img/smileys/autres/icon_rolleyes.gif [new file with mode: 0755]
img/smileys/autres/icon_sad.gif [new file with mode: 0755]
img/smileys/autres/icon_smile.gif [new file with mode: 0755]
img/smileys/autres/icon_surprised.gif [new file with mode: 0755]
img/smileys/autres/icon_tongue.gif [new file with mode: 0755]
img/smileys/autres/icon_whistle.gif [new file with mode: 0755]
img/smileys/autres/icon_wink.gif [new file with mode: 0755]
img/smileys/bigsmile.gif [new file with mode: 0755]
img/smileys/bn.gif [new file with mode: 0644]
img/smileys/boh.gif [new file with mode: 0644]
img/smileys/bunny.gif [new file with mode: 0755]
img/smileys/chat.gif [new file with mode: 0755]
img/smileys/clin.gif [new file with mode: 0755]
img/smileys/cool.gif [new file with mode: 0755]
img/smileys/dodo.gif [new file with mode: 0644]
img/smileys/eheheh.gif [new file with mode: 0755]
img/smileys/heink.gif [new file with mode: 0644]
img/smileys/hum.gif [new file with mode: 0644]
img/smileys/kirby.gif [new file with mode: 0755]
img/smileys/lol.gif [new file with mode: 0755]
img/smileys/oh.gif [new file with mode: 0755]
img/smileys/pascontent.gif [new file with mode: 0755]
img/smileys/redface.gif [new file with mode: 0644]
img/smileys/renne.gif [new file with mode: 0755]
img/smileys/slurp.gif [new file with mode: 0755]
img/smileys/smile.gif [new file with mode: 0755]
img/smileys/sniff.gif [new file with mode: 0755]
img/smileys/spliff.gif [new file with mode: 0755]
img/smileys/star.gif [new file with mode: 0755]
img/smileys/triste.gif [new file with mode: 0755]
index.yaws [new file with mode: 0755]
js/debug.js [new file with mode: 0644]
js/euphorik.js [new file with mode: 0755]
js/jquery.js [new file with mode: 0755]
js/jquery.lightbox.js [new file with mode: 0644]
js/json2.js [new file with mode: 0644]
js/md5.js [new file with mode: 0755]
js/pageAbout.js [new file with mode: 0644]
js/pageAdmin.js [new file with mode: 0644]
js/pageMinichat.js [new file with mode: 0755]
js/pageProfile.js [new file with mode: 0755]
js/pageRegister.js [new file with mode: 0755]
modules/Makefile [new file with mode: 0755]
modules/erl/euphorik_bd.erl [new file with mode: 0755]
modules/erl/euphorik_common.erl [new file with mode: 0644]
modules/erl/euphorik_daemon.erl [new file with mode: 0755]
modules/erl/euphorik_minichat_conversation.erl [new file with mode: 0755]
modules/erl/euphorik_protocole.erl [new file with mode: 0755]
modules/erl/euphorik_requests.erl [new file with mode: 0755]
modules/erl/euphorik_test.erl [new file with mode: 0644]
modules/erl/old/captcha.erl [new file with mode: 0755]
modules/erl/old/euphorik_format.erl [new file with mode: 0755]
modules/include/euphorik_bd.hrl [new file with mode: 0755]
modules/include/euphorik_defines.hrl [new file with mode: 0755]
pages/about.html [new file with mode: 0644]
pages/conditions_utilisation.html [new file with mode: 0644]
sessions/css1.session [new file with mode: 0644]
sessions/css2.session [new file with mode: 0644]
sessions/doc.session [new file with mode: 0755]
sessions/erl.session [new file with mode: 0755]
sessions/js.session [new file with mode: 0755]
tools/jsmin.rb [new file with mode: 0644]
tools/mise_en_prod.erl [new file with mode: 0755]
tools/mise_en_prod.rb [new file with mode: 0755]
tools/start_yaws.sh [new file with mode: 0755]

diff --git a/COPYING b/COPYING
new file mode 100644 (file)
index 0000000..94a9ed0
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,674 @@
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  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
+them 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 prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  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.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                       TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+  1. Source Code.
+
+  The "source code" for a work means the preferred form of the work
+for making modifications to it.  "Object code" means any non-source
+form of a work.
+
+  A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+  2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+  4. Conveying Verbatim Copies.
+
+  You may convey 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;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+  5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+  6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+  7. Additional Terms.
+
+  "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+  8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+  9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+  10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+  11. Patents.
+
+  A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+  12. No Surrender of Others' Freedom.
+
+  If 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 convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+  13. Use with the GNU Affero General Public License.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU 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 that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+  15. Disclaimer of Warranty.
+
+  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.
+
+  16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+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.
+
+  17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+    <program>  Copyright (C) <year>  <name of author>
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+  The GNU General Public License does not permit incorporating your program
+into proprietary programs.  If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.  But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/README b/README
new file mode 100644 (file)
index 0000000..576fb98
--- /dev/null
+++ b/README
@@ -0,0 +1,71 @@
+Ce document a pour but d'introduire le projet Euphorik, de décrire\r
+sa strucure et son utilisation au niveau du développement et de son\r
+utilisation.\r
+\r
+\r
+== Description ==\r
+Euphorik est un site web communautaire développé en Erlang pour le serveur Yaws et utilisant la base de données Mnesia.\r
+Il utilise massivement le javascript et l'AJAX coté client.\r
+\r
+== Installation ==\r
+L'installation de Yaws et sa configuration ainsi que l'initialisation de la base de données\r
+est décrit dans le fichier /doc/installation.txt.\r
+\r
+\r
+== Dossiers / Fichiers ==\r
+ /index.html\r
+   La page principale du site. Elle est statique.\r
+\r
+ /mise_en_prod.rb\r
+   Script permettant la mise en production du site.\r
+   \r
+ /BD\r
+   Contient les fichiers lié à la base de données, initialement vide.\r
+   \r
+ /css\r
+   Contient les feuilles de style de chaque skin contenu dans un dossier représentant le numéro du skin.\r
+   \r
+ /css/common.css\r
+   La feuille de style commune à tous les skins.\r
+   \r
+ /doc\r
+   Contient tous les documents de conception (fonctionnel, technique, etc.).\r
+   \r
+ /img\r
+   Contient les images du site avec un séparation des images propres à chaque skin.\r
+   Certaines images sont issues de document de conception se trouvant dans /doc/graphiques.\r
+   \r
+ /js\r
+   Contient tous les scripts JavaScript. Il existe un script général à Euphorik : euphorik.js ainsi qu'un script par page : page*.js\r
+   \r
+ /lightbox\r
+   Lib JavaScript permettant d'afficher des images sous la forme de pop-up modaux.\r
+   \r
+ /modules\r
+   Contient la partie serveur.\r
+   \r
+ /modules/Makefile\r
+   Règle de compilation des modules du serveur.\r
+   \r
+ /modules/ebin\r
+   Contient les modules compilées, initialement vide.\r
+   \r
+ /module/erl\r
+   Contient le code sources des différents modules Erlang.\r
+   \r
+ /modules/include\r
+   Contient certaines définitions (headers).\r
+   \r
+ /pages\r
+   Contient certaines pages XHTML qui seront chargée via AJAX.\r
+   \r
+ /sessions\r
+   Contient différentes sessions de travail pour le développement avec Scite.\r
+   \r
+ /tool\r
+   Contient des outils diverses permettant l'aide au développement ou la mise en production.\r
+   \r
+ /tool/jsmin.rb\r
+   Permet la minification du javascript utilisé lors de la mise en production\r
+   \r
+   
\ No newline at end of file
diff --git a/css/1/euphorik.css b/css/1/euphorik.css
new file mode 100755 (executable)
index 0000000..5964a11
--- /dev/null
@@ -0,0 +1,236 @@
+/* coding: utf-8 */
+
+@import url(pageMinichat.css);
+@import url(pageAdmin.css);
+@import url(pageProfileRegister.css);
+@import url(pageAbout.css);
+
+* {
+       padding: 0px;
+       margin: 0px;
+}
+
+body {
+       font-family: sans-serif;
+       font-size: 12px;
+       color: #841919;
+       background-color: #f6dfc2;
+}
+
+#container {
+       height: auto;
+       margin: 0px;
+}
+
+/***** Menu *****/
+ul#menu {
+       background-image: url(../../img/css1/logo_fond.png);
+       height:129px;
+       width: 100%;
+       font-size: 11px;
+       list-style-type:none;
+}
+#menu li:first-child {
+       margin-left: 340px;
+}
+#menu li {
+       margin-top: 47px;
+       font-size: 14px;
+       text-align: center;
+       cursor: pointer;        
+       height:30px;
+       z-index: 20;
+       float: left;
+       min-width: 60px;
+       background-color: #f6dfc2;
+       line-height: 32px;
+}
+#menu li.courante {    
+       background-color: #ffffff;
+       background-image: url(../../img/css1/triangle.png);
+       background-repeat: no-repeat;
+       background-position: center bottom
+}
+#menu li:hover {       
+       background-color: #ffffff;
+}
+
+/***** Le menu pour le choix de la CSS *****/
+#menuCss {
+       position: absolute;
+       z-index: 10;
+       left: 550px;    
+       top:0px;
+       font-size: 9px;
+}
+
+/***** Le style du contenu des pages *****/
+#page {
+       font-size: 12px;
+       background-color: #f6dfc2;
+       padding: 10px 10px 15px 10px;
+}
+#page > h1 {
+       margin-top: 10px;
+       margin-left: 0px;
+       font-size: 18px;
+}
+#page > h2 {
+       margin-top: 10px;
+       margin-left: 10px;
+       font-size: 16px;
+}
+#page > h3 {
+       margin-top: 10px;
+       margin-left: 20px;
+       font-size: 14px;
+       background-color : #FFFFFF
+}
+#page > h4 {
+       margin-top: 10px;
+       margin-left: 25px;
+       font-size: 12px;
+}
+#page > p {
+       margin-top: 3px;
+       margin-left: 35px;
+}
+#page > ul {
+       margin-top: 3px;
+       margin-left: 45px;
+}
+#logo {
+       z-index: 10;
+       background-image: url(../../img/css1/logo.png);
+       background-repeat: no-repeat;
+       width: 304px;
+       height: 129px;
+       position: absolute;
+}
+
+/***** Le pied de page *****/
+#footer {
+       background-color: #e19671;
+       text-align: right;
+       font-size: 9px;
+       padding: 2px
+}
+#footer a img{
+       border-style: none;
+       vertical-align: middle;
+       margin-right: 5px;
+}
+#footer span{
+       margin-right: 10px;
+}
+
+/***** La boite d'information (s'apparente à une MessageBox) *****/
+div#info {
+       text-align: center;
+       width:100%;
+       position: fixed;
+       left: 0px;
+       top: 0px;
+       background-color: #841919;
+       border-bottom: 1px solid #FFFFFF;
+       z-index: 20;
+       color: #f0df95
+}
+div#info div.fermer {
+       float:right;
+       cursor: pointer;
+       height:16px;
+       width: 16px;
+       background-image: url(../../img/fermer.gif)
+}
+div#info #icone {
+       float:left;     
+       height:16px;
+       width: 16px;
+}
+div#info #icone.interrogation {
+       background-image: url(../../img/interrogation.gif)
+}
+div#info #icone.information {
+       background-image: url(../../img/information.gif)
+}
+div#info #icone.exclamation {
+       background-image: url(../../img/exclamation.gif)
+}      
+div#info .boutons {
+       padding: 1px;
+}
+div#info .boutons div {
+       cursor: pointer;
+       background-color: #c62929;      
+       display: inline;
+       padding: 0px 5px 0px 5px;
+       margin: 0px 5px 0px 5px;
+}
+div#info .boutons div:hover {
+       background-color: #e84747;      
+}
+
+/***** Les infos bulles *****/
+#flecheBulle {
+       position: absolute;
+       z-index: 50;
+       width: 15px;
+       height: 8px;
+       background-image: url(../../img/css1/fleche_bulle.png);
+       display: none
+}
+#messageBulle {
+       position: absolute;
+       z-index: 50;
+       color: #ffffff;
+       background-color: #841919;
+       display: none;
+       font-size: 10px;
+}
+#messageBulle p {
+       padding: 3px 6px;
+}
+
+/***** Le faux captcha *****/
+.captcha {
+       display:none;
+}
+
+/***** Les formulaires *****/
+form input,
+form button,
+form select {
+       background-color: #f0df95; 
+       border: #841919 1px solid;
+}
+form input:hover, form input:focus,
+form button:hover, form button:focus,
+form select:hover, form select:focus {
+       background-color: #ffffff;
+}
+form input,
+form select {
+       font-size: 12px;
+}
+form button {
+       font-size: 11px;
+}
+form input[readonly] {
+       background-color: #d0c9aa
+}
+
+/***** Les liens *****/
+.lien, a {
+       text-decoration: underline;
+       color: #c62929;
+}
+.lien {
+       cursor: pointer
+}
+a:link, a:visited {
+       color: #c62929;
+}
+.lien:hover, .lien:active, a:hover, a:active {
+       color: #e84747;
+}
diff --git a/css/1/pageAbout.css b/css/1/pageAbout.css
new file mode 100644 (file)
index 0000000..687e6d1
--- /dev/null
@@ -0,0 +1,14 @@
+/* coding: utf-8 */
+
+#page.about {
+}
+
+#page.about .faqCouleurProprietaire {
+       color: #31732f;
+}
+#page.about .faqCouleurReponse {
+       color: #bf2911;
+}
+#page.about .faqCouleurRepondu {
+       color: #84196c;
+}
diff --git a/css/1/pageAdmin.css b/css/1/pageAdmin.css
new file mode 100644 (file)
index 0000000..47272a1
--- /dev/null
@@ -0,0 +1,80 @@
+/* coding: utf-8 */
+/* La page d'administration */
+
+#page.admin p {
+       margin-left : 0px
+}
+
+#page.admin form#nouveauTroll {
+       margin-top : 10px
+}
+
+#page.admin form#nouveauTroll input {
+       width: 80%
+}
+
+#page.admin div.troll,
+#page.admin .ban {
+       margin-top: 5px;
+       padding: 2px 10px 2px 10px;
+       border: 1px solid;
+       background-color: #841919;
+       color: #ffffff;
+}
+
+#page.admin div.troll img {
+       margin: 0px;
+       vertical-align: bottom;
+}
+
+#page.admin div.troll span.content {
+       font-style: italic;
+}
+
+#page.admin div.troll .author {
+       margin-left: 10px;
+}
+
+#page.admin div.troll input {
+       width: 70%
+}
+
+#page.admin div.troll .editTroll,
+#page.admin div.troll .delTroll,
+#page.admin div.troll .modifier,
+#page.admin div.troll .annuler,
+#page.admin div.ban .deban
+{
+       font-size: 10px;
+       margin-left: 10px;
+       cursor: pointer;
+       padding-right: 5px;
+       padding-left: 5px;
+       background-color: #f0df95; 
+       border: #841919 1px solid;
+       color: #841919;
+}
+
+#page.admin div.troll .editTroll:hover,
+#page.admin div.troll .delTroll:hover,
+#page.admin div.troll .modifier:hover,
+#page.admin div.troll .annuler:hover,
+#page.admin div.ban .deban:hover
+{
+       background-color: #ffffff; 
+}
+
+#page.admin #ips .ip {
+       margin-right : 10px;
+       color: #ffffff;
+}
+
+#page.admin #ips .temps,
+#page.admin #ips .pseudo {
+       margin-left : 10px;
+       margin-right : 10px;
+}
+
+#page.admin #ips .login {
+       margin-right : 4px;
+}
diff --git a/css/1/pageMinichat.css b/css/1/pageMinichat.css
new file mode 100755 (executable)
index 0000000..2cc07be
--- /dev/null
@@ -0,0 +1,285 @@
+/* coding: utf-8 */
+
+#page.minichat {
+       padding: 0px;
+}
+
+#page.minichat img {
+       margin: 0px;
+       vertical-align: middle;
+}
+
+/***** La boite de sélection des smiles *****/
+#smiles {
+       text-align: center;
+       border: 1px solid;
+       border-color: #ffffff;
+       background-color: #f6dfc2;
+       margin-bottom: 10px;
+       padding: 1px;
+       width: 140px;
+       position: absolute;
+       display: none
+}
+#smiles img {
+       margin: 1px;
+       cursor: pointer;
+       opacity: 0.5;
+}
+
+/***** La boite permettant de slaper/kicker/bannir une personne *****/
+#outilsBan {
+       border-width: 1px 1px 1px 1px;
+       border-color: #ffffff;
+       border-style: dotted;
+       padding: 2px;
+       position: absolute;
+       display: none;
+}
+#outilsBan img,
+#outilsBan form {
+       float: right;
+       cursor: pointer
+}
+#outilsBan p {
+       font-size: 2px;
+}
+#outilsBan input {
+       font-size: 9px;
+       margin-top: 1px;
+       margin-left: 1px
+}
+
+/***** Le troll courant affiché en haut de la page *****/
+#page.minichat #trollCourant {
+       color: #FFFFFF;
+       position: absolute;
+       z-index: 20;
+       left: 140px;
+       top: 77px;
+       line-height: 32px;
+}
+#page.minichat #trollCourant .troll {
+       cursor: pointer;
+       font-style: italic
+}
+
+/***** Le formulaire pour poster un message *****/
+#page.minichat form#posterMessage {
+       background-color: #e19671;
+       padding-left: 10px;
+       padding-bottom: 10px;
+}
+#page.minichat form#posterMessage p {
+   margin: 0px;
+   padding: 0px;
+}
+#page.minichat form#posterMessage .pseudo {
+   margin-right: 5px;
+   width: 12%
+}
+#page.minichat form#posterMessage .message {
+   margin-right: 5px;
+   width: 75%
+}
+#page.minichat form#posterMessage .return {
+       height: 16px;
+       width: 32px;
+       background-image: url(../../img/css1/return.png);
+       background-repeat: no-repeat;
+       background-position: 5px 2px;
+       vertical-align: top;
+       margin-right: 5px;
+}
+#page.minichat form#posterMessage .smiles {
+       height: 16px;
+       width: 16px;
+       background-image: url(../../img/css2/bouton_smiles.png);
+       background-repeat: no-repeat;
+       background-position: 2px 2px;
+       vertical-align: top;
+       margin-right: 5px;
+}
+
+/***** Les conversations *****/
+/* voir pour l'astuce css "float left" des conversations : http://www.quirksmode.org/css/clearing.html */
+#page.minichat #conversations {        
+       overflow: hidden;
+       width: 100%
+}
+#page.minichat #conversations .conversation {
+       border-width: 0px;
+       border-style: solid;
+       border-color: white;
+       float: left;
+       width: 100%;
+}
+#page.minichat #conversations div.messageImpair {
+   background-color: #fbeede;
+}
+#page.minichat #conversations div.messagePair {
+   background-color: #f6dfc2;
+}
+#page.minichat #conversations div.cache {
+       opacity: 0.3;
+       
+       /* Hack IE 7 */ 
+       filter: alpha(opacity = 30);
+       zoom: 1
+}
+#page.minichat #conversations .titre {
+       text-align: center;
+       padding-right: 8px;
+       background-color: #e19671;
+       color: #ffffff;
+}
+#page.minichat #conversations .titre .fermer {
+       margin-top: 1px;
+       margin-left: 5px;
+       float: right;
+       width: 13px;
+       height: 13px;
+       background-image: url(../../img/css1/fermer_conv.png);
+       cursor: pointer;
+}
+#page.minichat #conversations .titre .fermer:hover {
+       background-image: url(../../img/css1/fermer_conv_hover.png);
+}      
+#page.minichat #conversations .titre .lien {
+       margin-top: 1px;
+       float: right;
+       width: 13px;
+       height: 13px;
+       background-image: url(../../img/css1/copier_conv.png);
+       cursor: pointer;
+}
+#page.minichat #conversations .titre .lien:hover {
+       background-image: url(../../img/css1/copier_conv_hover.png);
+}      
+#page.minichat #conversations .titre .next,
+#page.minichat #conversations .titre .prev {
+       display: none;
+}
+#page.minichat #conversations .titre .next,
+#page.minichat #conversations .titre .prev,
+#page.minichat #conversations .titre .numPage {
+       background-color: #841919;
+       cursor: pointer;
+       padding-right: 5px;
+       padding-left: 5px;
+}
+#page.minichat #conversations .titre .next:hover,
+#page.minichat #conversations .titre .prev:hover,
+#page.minichat #conversations .titre .numPage:hover {
+       background-color: #cb2626
+}
+
+/***** Les messages *****/
+#page.minichat #conversations div.message {
+       padding-right: 5px;
+       cursor: pointer;
+       min-height: 18px;
+       line-height: 18px;
+}
+#page.minichat #conversations div.message.reponse .entete {
+       background-color: #bf2911
+}
+#page.minichat #conversations div.message.reponse .delimitationEntete,
+#page.minichat #conversations div.message.reponse .repondA {
+       background-image: url(../../img/css1/fleche_reponse.png);
+}
+#page.minichat #conversations div.message.repondu .entete {
+       background-color: #84196c
+}
+#page.minichat #conversations div.message.repondu .delimitationEntete,
+#page.minichat #conversations div.message.repondu .repondA {
+       background-image: url(../../img/css1/fleche_repondu.png);
+}
+#page.minichat #conversations div.message.proprietaire .entete {
+       background-color: #31732f
+}
+#page.minichat #conversations div.message.proprietaire .delimitationEntete,
+#page.minichat #conversations div.message.proprietaire .repondA {
+       background-image: url(../../img/css1/fleche_proprietaire.png);
+}
+#page.minichat #conversations div.message.systeme {
+       background-color: #f0df95
+}
+#page.minichat div.message a {
+       font-weight: bold;
+}
+#page.minichat div.message .lienConv {
+       color: #c62929;
+       font-weight: bold;
+       cursor: pointer
+}
+#page.minichat div.message .lienConv:hover {
+       color: #e84747
+}
+#page.minichat .entete {
+       z-index: 20;
+       background-color: #841919;
+       color: #f6dfc2;
+       display: block;
+       float: left;
+       height: 18px;
+}
+#page.minichat .delimitationEntete {
+       z-index: 20;
+       height: 18px;
+       width: 7px;
+       background-image: url(../../img/css1/fleche.png);
+       display: block;
+       float: left;
+}
+#page.minichat .date {
+   margin-right: 3px;
+   margin-left: 3px;
+}
+#page.minichat div.message .pseudo,
+/* FIXME : entre en conflit avec une règle précédente */
+#page.minichat form .pseudo {
+   margin-left: 4px;
+   margin-right: 2px;
+   font-weight: bold;
+}
+#page.minichat div.message.ekMaster .pseudo {
+       color: #f0df95
+}
+#page.minichat div.message .pseudo .login {
+   margin-left: 2px;
+   font-size: 8px;
+}
+#page.minichat #conversations .repondA {
+       z-index: 5;
+       height: 18px;
+       margin-left: -7px;
+       padding-left: 9px;
+       float: left;
+       background-color: #cb2626; 
+       color: #ffffff;
+       display: block;
+       background-image: url(../../img/css1/fleche.png);
+       background-repeat: no-repeat;
+}
+#page.minichat #conversations .delimitationRepondA {
+       z-index: 20;
+       height: 18px;
+       width: 7px;
+       background-image: url(../../img/css1/fleche_reponda.png);
+       display: block;
+       float: left;
+}
+#page.minichat #conversations .contenu {
+       margin-left: 5px;
+}
+#page.minichat #conversations .extraire {
+       float: right;
+       width: 13px;
+       height: 13px;
+       background-image: url(../../img/css1/extraction.png);
+       margin-top: 2px
+}
+#page.minichat #conversations .extraire:hover {
+       background-image: url(../../img/css1/extraction_hover.png);
+}
diff --git a/css/1/pageProfileRegister.css b/css/1/pageProfileRegister.css
new file mode 100755 (executable)
index 0000000..1455823
--- /dev/null
@@ -0,0 +1,7 @@
+/* coding: utf-8 */
+/* Réunit les page Profile et Register car ils ont beaucoup en commun */
+
+#page.register,
+#page.profile {
+       padding-top: 20px
+}
diff --git a/css/2/euphorik.css b/css/2/euphorik.css
new file mode 100755 (executable)
index 0000000..df54431
--- /dev/null
@@ -0,0 +1,230 @@
+/* coding: utf-8 */
+\r
+@import url(pageMinichat.css);
+@import url(pageAdmin.css);\r
+@import url(pageProfileRegister.css);
+@import url(pageAbout.css);
+\r
+* {\r
+       padding: 0px;\r
+       margin: 0px;\r
+}\r
+\r
+body {\r
+   font-family: sans-serif;\r
+   font-size: 12px;
+   color: #EEEEEE;\r
+   background-color: #DFDFDF;\r
+   background-image: url(../../img/css2/fond.png)\r
+}\r
+\r
+#container {\r
+   height: auto;\r
+   margin-left: 10px;\r
+   margin-right: 10px;\r
+   margin-top: 40px;\r
+}
+
+/***** Menu *****/
+ul#menu {
+       padding-left: 300px;
+       height: 23px;
+       font-size: 11px;
+       background-color: #000000;
+       list-style-type:none;
+}
+#menu li {
+       cursor: pointer;        
+       z-index: 20;
+       float: left;
+       padding: 2px;
+       margin-left: 2px;
+       background-color: #4f5519;
+}
+#menu li.courante {    
+       background-color: #818c27;
+}
+#menu li:hover {       
+       background-color: #818c27
+}
+
+/***** Le menu pour le choix de la CSS *****/
+#menuCss {
+       position: absolute;
+       z-index: 10;
+       left: 600px;    
+       top:40px;
+       font-size: 9px;
+}
+
+/***** Le style du contenu des pages *****/
+#page {
+   font-size: 12px;
+   background-color: #000000;
+   padding: 10px 10px 15px 10px;
+}
+#page > h1 {
+   margin-top: 10px;
+   margin-left: 0px;
+   font-size: 18px;
+   color : #a6b80e
+}
+#page > h2 {
+   margin-top: 10px;
+   margin-left: 10px;
+   font-size: 16px;
+   color : #899714;
+}
+#page > h3 {
+   margin-top: 10px;
+   margin-left: 20px;
+   font-size: 14px;
+   color : #79841a;
+   background-color : #1e2201
+}
+#page > h4 {
+   margin-top: 10px;
+   margin-left: 25px;
+   font-size: 12px;
+   color : #646d1d
+}
+#page > p {
+   margin-top: 3px;
+   margin-left: 35px;
+   color : #e9e9e9
+}
+#page > ul {
+   margin-top: 3px;
+   margin-left: 45px;
+   color: #e9e9e9
+}
+#logo {
+   z-index: 10;
+   background-image: url(../../img/css2/logo_2.png);
+   width: 253px;
+   height: 37px;
+   position: absolute;
+   top: 20px;
+   left: 4px;
+}\r
+
+/***** Le pied de page *****/
+#footer {
+       text-align: right;
+       font-size: 9px
+}
+#footer a img{
+       border-style: none;
+       vertical-align: middle;
+       margin-right: 5px;
+}
+#footer span{
+       margin-right: 10px;
+}\r
+
+/***** La boite d'information (s'apparente à une MessageBox) *****/\r
+div#info {
+       text-align: center;\r
+       width:100%;\r
+       position: fixed;\r
+       left: 0px;\r
+       top: 0px;\r
+       background-color: #000000;
+       border-bottom: 1px solid #aeaeae;\r
+       z-index: 20;\r
+}
+div#info div.fermer {
+       float:right;
+       cursor: pointer;
+       height:16px;
+       width: 16px;
+       background-image: url(../../img/fermer.gif)
+}
+div#info #icone {
+       float:left;     
+       height:16px;
+       width: 16px;
+}
+div#info #icone.interrogation {
+       background-image: url(../../img/interrogation.gif)
+}
+div#info #icone.information {
+       background-image: url(../../img/information.gif)
+}
+div#info #icone.exclamation {
+       background-image: url(../../img/exclamation.gif)
+}
+div#info .boutons {
+       padding: 1px;
+}
+div#info .boutons div {
+       cursor: pointer;
+       background-color: #770000;      
+       display: inline;
+       padding: 0px 5px 0px 5px;
+       margin: 0px 5px 0px 5px;
+}
+div#info .boutons div:hover {
+       background-color: #bc0000;      
+}
+
+/***** Les infos bulles *****/
+#flecheBulle {
+       position: absolute;
+       z-index: 50;
+       width: 15px;
+       height: 8px;
+       background-image: url(../../img/css2/fleche_bulle.png);
+       display: none
+}
+#messageBulle {
+       position: absolute;
+       z-index: 50;
+       color: #ffffff;
+       background-color: #164200;
+       display: none;
+       font-size: 10px;
+}
+#messageBulle p {
+       padding: 3px 6px;
+}
+
+/***** Le faux captcha *****/\r
+.captcha {\r
+       display:none\r
+}
+
+/***** Les formulaires *****/
+form input,
+form button,
+form select {
+       background-color: #164200; 
+       border: #2d8800 1px solid;
+       color: #EEEEEE;
+}
+form input,
+form select {
+       font-size: 12px;
+}
+form button {
+       font-size: 11px;
+}
+form input[readonly] {
+       background-color: #484e46
+}
+
+/***** Les liens *****/\r
+.lien, a {\r
+   text-decoration: none;
+       color: #7664ff;\r
+}
+.lien {
+       cursor: pointer;
+}\r
+a:link, a:visited {\r
+       color: #7664ff;\r
+}\r
+.lien:hover, .lien:active, a:hover, a:active {\r
+   color: #ffad0f;\r
+}\r
+\r
diff --git a/css/2/pageAbout.css b/css/2/pageAbout.css
new file mode 100644 (file)
index 0000000..10eeae3
--- /dev/null
@@ -0,0 +1,14 @@
+/* coding: utf-8 */
+
+#page.about {
+}
+
+#page.about .faqCouleurProprietaire {
+       color: #31732f;
+}
+#page.about .faqCouleurReponse {
+       color: #bf2911;
+}
+#page.about .faqCouleurRepondu {
+       color: #84196c;
+}
\ No newline at end of file
diff --git a/css/2/pageAdmin.css b/css/2/pageAdmin.css
new file mode 100644 (file)
index 0000000..371b601
--- /dev/null
@@ -0,0 +1,77 @@
+/* coding: utf-8 */
+/* La page d'administration */
+
+#page.admin p {
+       margin-left : 0px
+}
+
+#page.admin form#nouveauTroll {
+       margin-top : 10px
+}
+
+#page.admin form#nouveauTroll input {
+       width: 80%
+}
+
+#page.admin div.troll,
+#page.admin .ban {
+       margin-top: 10px;
+       padding: 2px 10px 2px 10px;
+       border: 1px solid;
+       border-color: #253f18;
+       background-color: #0c2003;
+}
+
+#page.admin div.troll img {
+       margin: 0px;
+       vertical-align: bottom;
+}
+
+#page.admin div.troll span.content {
+       font-style: italic;
+       color: #FFFF88
+}
+
+#page.admin div.troll .author {
+       margin-left: 10px
+}
+
+#page.admin div.troll input {
+       width: 70%
+}
+
+#page.admin div.troll .editTroll,
+#page.admin div.troll .delTroll,
+#page.admin div.troll .modifier,
+#page.admin div.troll .annuler,
+#page.admin div.ban .deban
+{
+       font-size: 10px;
+       margin-left: 10px;
+       cursor: pointer;
+       padding-right: 5px;
+       padding-left: 5px;
+       background-color: #164200; 
+       border: #2d8800 1px solid;
+       color: #EEEEEE; 
+}
+
+
+#page.admin #ips .ip {
+       margin-right : 10px;
+}
+
+#page.admin #ips .temps,
+#page.admin #ips .pseudo {
+       margin-left : 10px;
+       margin-right : 10px;
+}
+
+#page.admin #ips .login {
+       margin-right : 4px;
+}
+
+
+
+
+
diff --git a/css/2/pageMinichat.css b/css/2/pageMinichat.css
new file mode 100755 (executable)
index 0000000..f0e4785
--- /dev/null
@@ -0,0 +1,253 @@
+/* coding: utf-8 */
+
+#page.minichat {
+       padding-top: 5px;
+   padding-right: 0px;
+   padding-left: 0px
+}
+
+#page.minichat img {
+       margin: 0px;
+       vertical-align: middle;
+}
+
+/***** La boite de sélection des smiles *****/
+#smiles {
+       text-align: center;
+       border: 1px solid;
+       border-color: #253f18;
+       background-color: #0c2003;
+       margin-bottom: 10px;
+       padding: 1px;
+       width: 140px;
+       position: absolute;
+       display: none
+}
+#smiles img {
+       margin: 1px;
+       cursor: pointer;
+       opacity: 0.5;
+}
+
+/***** La boite permettant de slaper/kicker/bannir une personne *****/
+#outilsBan {
+       border-width: 1px 1px 1px 1px;
+       border-color: #253f18;
+       border-style: solid;
+       padding: 2px;
+       position: absolute;
+       display: none;
+}
+#outilsBan img,
+#outilsBan form {
+       float: right;
+       cursor: pointer
+}
+#outilsBan p {
+       font-size: 2px;
+}
+#outilsBan input {
+       font-size: 9px;
+       margin-top: 1px;
+       margin-left: 1px
+}
+
+/***** Le troll courant affiché en haut de la page *****/
+#page.minichat #trollCourant {
+       border-top: 1px solid;
+       border-bottom: 1px solid;
+       border-color: #253f18;
+       background-color: #0c2003;
+       margin-top: 4px;
+       margin-bottom: 8px;
+       padding : 1px 0px 1px 10px
+}
+#page.minichat #trollCourant .troll {
+       font-style: italic;
+       color: #FFFF88;
+       cursor: pointer;
+}
+
+/***** Le formulaire pour poster un message *****/
+#page.minichat form#posterMessage  {
+   margin-bottom: 15px;
+   padding-left: 10px;
+}
+#page.minichat form#posterMessage  p {
+   margin: 0px;
+   padding: 0px;
+}
+#page.minichat form#posterMessage .pseudo {
+   margin-right: 5px;
+   width: 12%
+}
+#page.minichat form#posterMessage .message {
+   margin-right: 5px;
+   width: 75%
+}
+#page.minichat form#posterMessage .return {
+       height: 16px;
+       width: 32px;
+       background-image: url(../../img/css2/return.png);
+       background-repeat: no-repeat;
+       background-position: 5px 2px;
+       vertical-align: top;
+       margin-right: 5px;
+}
+#page.minichat form#posterMessage .smiles {
+       height: 16px;
+       width: 16px;
+       background-image: url(../../img/css2/bouton_smiles.png);
+       background-repeat: no-repeat;
+       background-position: 2px 2px;
+       vertical-align: top;
+       margin-right: 5px;
+}
+
+/***** Les conversations *****/
+/* voir pour l'astuce css "float left" des conversations : http://www.quirksmode.org/css/clearing.html */
+#page.minichat #conversations {        
+       overflow: hidden;
+       width: 100%
+}
+#page.minichat #conversations .conversation {
+       border-width: 0px;
+       border-style: solid;
+       border-color: white;
+       float: left;
+       width: 100%;
+}
+#page.minichat #conversations div.message {
+       border-left-width: 5px;
+       border-left-style: solid;
+       border-color: transparent;
+       padding-right: 5px;
+       padding-left: 4px;
+       cursor: pointer;
+}
+#page.minichat #conversations div.messageImpair {
+   background-color: #05002c;
+}
+#page.minichat #conversations div.messagePair {
+   background-color: #080047;
+}
+#page.minichat #conversations div.cache {
+       opacity: 0.3;
+       
+       /* Hack IE 7 */ 
+       filter: alpha(opacity = 30);
+       zoom: 1
+}
+#page.minichat #conversations div.reponse {
+       border-color: #bf2911
+}
+#page.minichat #conversations div.repondu {
+       border-color: #84196c   
+}
+#page.minichat #conversations div.proprietaire {
+       border-color: #31732f
+}
+#page.minichat #conversations div.systeme {
+       background-color: #555555
+}
+#page.minichat #conversations .titre {
+       text-align: center;
+       padding-right: 8px;
+       background-color: #4b4215
+}
+#page.minichat #conversations .titre .fermer {
+       float: right;
+       padding-right: 5px;
+       padding-left: 5px;
+       background-color: #7d1b1b;
+       cursor: pointer;
+}
+#page.minichat #conversations .titre .fermer:after {
+       content: "x"
+}
+#page.minichat #conversations .titre .fermer:hover {
+       background-color: #c95656
+}      
+#page.minichat #conversations .titre .next,
+#page.minichat #conversations .titre .prev {
+       display: none;
+}
+#page.minichat #conversations .titre .lien {
+       float: right
+}
+#page.minichat #conversations .titre .lien:after {
+       content: "c"
+}
+#page.minichat #conversations .titre .lien,
+#page.minichat #conversations .titre .next,
+#page.minichat #conversations .titre .prev,
+#page.minichat #conversations .titre .numPage {
+       background-color: #42380b;
+       cursor: pointer;
+       padding-right: 5px;
+       padding-left: 5px;
+}
+#page.minichat #conversations .titre .lien:hover,
+#page.minichat #conversations .titre .next:hover,
+#page.minichat #conversations .titre .prev:hover,
+#page.minichat #conversations .titre .numPage:hover {
+       background-color: #7c6e2e
+}
+
+/***** Les messages *****/
+#page.minichat div.message a {
+       font-weight: bold;
+}
+#page.minichat div.message .lienConv {
+       color: #db960f;
+       font-weight: bold;
+       cursor: pointer
+}
+#page.minichat div.message .lienConv:hover {
+       color: #f1c060
+}
+#page.minichat .date {
+   color: #fd913b;
+   margin-right: 3px;
+   margin-left: 3px;
+}
+#page.minichat div.message .pseudo:after {
+       content: ":"
+}
+#page.minichat div.message .pseudo,
+#page.minichat form .pseudo {
+   margin-left: 4px;
+   margin-right: 2px;
+   font-weight: bold;
+   color: #76ff33;
+}
+#page.minichat div.message.ekMaster .pseudo {
+       color: #ffffff;
+}
+#page.minichat div.message .pseudo .login {
+   margin-left: 2px;
+   font-size: 8px;
+   color: #a7d88f;
+}
+#page.minichat div.systeme .pseudo {
+       color: #CCCCCC
+}
+#page.minichat #conversations .repondA {
+   color: #bd7a11;
+   margin-right: 3px;
+}
+#page.minichat #conversations .repondA:after {
+       content: ">"
+}
+#page.minichat #conversations .extraire {
+       float: right;
+       padding-right: 2px;
+       padding-left: 2px;
+       background-color: #4f5519;
+}
+#page.minichat #conversations .extraire:after {
+       content: ">"
+}
+#page.minichat #conversations .extraire:hover {
+       background-color: #818c27
+}
diff --git a/css/2/pageProfileRegister.css b/css/2/pageProfileRegister.css
new file mode 100755 (executable)
index 0000000..d5ff7f1
--- /dev/null
@@ -0,0 +1,7 @@
+/* coding: utf-8 */
+/* Réunit les page Profile et Register car ils ont beaucoup en commun */
+
+#page.register,
+#page.profile {
+   padding-top: 20px
+}
diff --git a/css/3/euphorik.css b/css/3/euphorik.css
new file mode 100755 (executable)
index 0000000..9a45b6e
--- /dev/null
@@ -0,0 +1,171 @@
+\r
+@import url(pageMinichat.css);\r
+@import url(pageProfileRegister.css);\r
+\r
+* {\r
+       padding: 0;\r
+       margin: 0;\r
+}\r
+\r
+body {\r
+   font-family: sans-serif;\r
+   font-size: 10pt;
+   color: #000000;\r
+   text-align: center; /* uniquement pour IE */\r
+   background-color: #837fb7;\r
+}\r
+\r
+#container {
+   position: relative;
+   background-image: url(../../img/css3/logo.png);
+   background-repeat: repeat-x;
+   background-color: #b1b0d4;\r
+   width: 626px;\r
+   height: auto;\r
+   margin-left: auto;\r
+   margin-right: auto;\r
+}
+
+#menu {
+       z-index: 10;
+       left: 503px;
+       top: 5px;
+       position: absolute;
+       font-size: 7pt;
+       text-align: left;
+}
+
+#menu div {    
+       cursor: pointer;
+}
+#menu div.courante {   
+       background-color: #e6e770
+}
+#menu div:hover,
+#menuCss div:hover {   
+       background-color: #e6e770
+}
+
+#menuCss {
+       text-align: right;
+       z-index: 10;
+       position: absolute;
+       left: 570px;
+       top: 5px;
+}
+
+#menuCss div {
+       cursor: pointer;        
+       font-size: 6pt;
+}
+
+#page {
+   position: relative;
+   padding: 130px 0px 3px 0px;
+   font-size: 8pt;
+}
+
+#logo { display: none; }\r
+
+#footer {
+       padding-top: 5px;
+       text-align: center;
+       width: 625px;
+       height: 27px;
+       background-image: url(../../img/css3/piedpage.png);
+       background-repeat: no-repeat;
+}\r
+#footer a img{\r
+       border-style: none;\r
+}\r
+\r
+#info {\r
+       width:100%;\r
+       position: fixed;\r
+       left: 0px;\r
+       top: 0px;\r
+       background-color: #d5d3ef;
+       border-bottom: 1px solid #837fb7;\r
+       z-index: 20;\r
+}
+
+#info .fermer {
+       float:right;
+       cursor: pointer;
+       height:16px;
+       width: 16px;
+       background-image: url(../../img/fermer.gif)
+}
+
+#info #icone {
+       float:left;     
+       height:16px;
+       width: 16px;
+}
+#info #icone.interrogation {
+       background-image: url(../../img/interrogation.gif)
+}
+#info #icone.information {
+       background-image: url(../../img/information.gif)
+}
+#info #icone.exclamation {
+       background-image: url(../../img/exclamation.gif)
+}
+       
+#info .boutons {
+       padding: 1px;
+       margin-bottom: 2px;
+}
+
+#info .boutons div {
+       cursor: pointer;
+       background-color: #b1b0d4;      
+       display: inline;
+       padding: 0px 5px 0px 5px;
+       margin: 0px 5px 0px 5px;
+       border: 1px solid #837fb7;
+}
+#info .boutons div:hover {
+       background-color: #d5d3ef;      
+}
+\r
+.captcha {\r
+       display:none\r
+}\r
+\r
+/* Obsolète
+#captcha {
+       margin-bottom: 5px;
+}
+#captcha input {
+       margin-left: 5px;
+}
+#captcha .captchaImg {
+       background-color: #FFFFFF;
+       vertical-align: bottom;
+}*/
+
+form input,
+form button {
+       background-color: #d5d3ef; 
+       border: #837fb7 1px solid;
+       color: #000000;
+       font-size: 9pt;
+}
+\r
+a {
+       text-decoration: underline;\r
+}\r
+a:link {\r
+       color: #1f15e8;\r
+}\r
+a:visited {\r
+   color: #1f15e8;\r
+}\r
+a:hover {\r
+   color: #645fd4;\r
+}\r
+a:active {\r
+   color: #645fd4;\r
+}\r
+\r
diff --git a/css/3/pageMinichat.css b/css/3/pageMinichat.css
new file mode 100755 (executable)
index 0000000..d8f8706
--- /dev/null
@@ -0,0 +1,155 @@
+
+#page.minichat img {
+       vertical-align: bottom;\r
+       margin-right: 1px;\r
+       margin-left: 1px;
+}
+
+#page.minichat #smiles {
+       position: absolute;
+       top: 90px;
+       left: 104px;
+       margin-bottom: 10px;
+       padding: 1px;
+}
+\r
+#page.minichat #smiles img {\r
+       margin-left: 9px;\r
+       cursor: pointer;\r
+       opacity: 0.5;\r
+}\r
+\r
+#page.minichat form {\r
+   text-align: left;\r
+   margin-bottom: 15px;\r
+   padding-left: 10px;\r
+}\r
+\r
+#page.minichat form .pseudo {\r
+   margin-right: 5px;\r
+}\r
+\r
+#page.minichat form .message {\r
+   margin-right: 5px;\r
+}\r
+\r
+#page.minichat form .return {\r
+       height: 15px;\r
+       width: 32px;\r
+       background-image: url(../../img/css1/return.png);\r
+       background-repeat: no-repeat;\r
+       background-position: 5px 2px;\r
+       vertical-align: top;\r
+}\r
+
+#page.minichat #messages div.message { \r
+       border-left-width: 5px;\r
+       border-left-style: solid;\r
+       border-color: transparent;
+       text-align: left;
+       padding-right: 8px;
+       padding-left: 4px;\r
+       cursor: pointer;
+}
+\r
+#page.minichat #messages div.messageImpair {\r
+   background-color: #9f9cd2;\r
+}\r
+\r
+#page.minichat #messages div.messagePair {\r
+   background-color: #b2afd5;\r
+}
+\r
+/* Il n'y a plus de mise en evidence
+#page.minichat #messages div.miseEnEvidenceReponse {
+       background-color: #bd7a11;
+}
+#page.minichat #messages div.miseEnEvidenceCourant {
+       background-color: #bd1129;
+}
+#page.minichat #messages div.miseEnEvidenceConversation {
+       background-color: #b711bd;
+}*/\r
+       
+#page.minichat #messages div.cache {
+       opacity: 0.3;\r
+       \r
+       /* Hack IE 7 */ \r
+       filter: alpha(opacity = 30);\r
+       zoom: 1
+}
+\r
+#page.minichat #messages div.reponse {\r
+       border-color: #bd7a11\r
+}\r
+#page.minichat #messages div.repondu {\r
+       border-color: #b711bd   \r
+}\r
+#page.minichat #messages div.proprietaire {\r
+       border-color: #bd1129\r
+}
+#page.minichat #messages div.systeme {
+       background-color: #888888
+}\r
+\r
+#page.minichat div.message a {\r
+       font-weight: bold;\r
+}\r
+\r
+#page.minichat .date {\r
+   display: inline;\r
+   color: #8a4106;\r
+   margin-right: 3px;\r
+   margin-left: 3px;\r
+}\r
+\r
+#page.minichat div.message .pseudo,\r
+#page.minichat form .pseudo {\r
+   display: inline;\r
+   margin-left: 4px;\r
+   margin-right: 2px;\r
+   font-weight: bold;\r
+   color: #8f4108;\r
+}
+
+#page.minichat div.systeme .pseudo {
+       color: #CCCCCC
+}\r
+\r
+/* Ca marche pas :(\r
+#page.minichat div.message .pseudo {\r
+       min-width: 50px;\r
+       height:100px;\r
+}*/\r
+
+#page.minichat #messages .repondA {
+   display: inline;
+   margin-left: 4px;
+   color: #704605
+}
+\r
+#page.minichat #messages .contenu {\r
+   display: inline;\r
+}\r
+\r
+#page.minichat #pages {\r
+       margin-top: 5px;\r
+}\r
+\r
+#page.minichat #pages span {\r
+       padding-right : 5px;\r
+       padding-left: 5px;\r
+       color: #1f15e8;\r
+       cursor:pointer;\r
+}\r
+\r
+#page.minichat #pages span.pageCourante {\r
+       font-weight: bold;\r
+       font-size: 150%;\r
+}\r
+\r
+#page.minichat #pages span:hover {\r
+       font-size: 150%;\r
+       color: #645fd4;\r
+}\r
+\r
diff --git a/css/3/pageProfileRegister.css b/css/3/pageProfileRegister.css
new file mode 100755 (executable)
index 0000000..50be113
--- /dev/null
@@ -0,0 +1,8 @@
+/* Réunit les page Profile et Register car ils ont beaucoup en commun */
+
+#page.register,
+#page.profile {
+   text-align: left;\r
+   padding-left: 10px;
+   padding-bottom: 10px;
+}
diff --git a/css/jquery.lightbox.css b/css/jquery.lightbox.css
new file mode 100644 (file)
index 0000000..fea1a99
--- /dev/null
@@ -0,0 +1,101 @@
+/**\r
+ * jQuery lightBox plugin\r
+ * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/)\r
+ * and adapted to me for use like a plugin from jQuery.\r
+ * @name jquery-lightbox-0.5.css\r
+ * @author Leandro Vieira Pinho - http://leandrovieira.com\r
+ * @version 0.5\r
+ * @date April 11, 2008\r
+ * @category jQuery plugin\r
+ * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com)\r
+ * @license CC Attribution-No Derivative Works 2.5 Brazil - http://creativecommons.org/licenses/by-nd/2.5/br/deed.en_US\r
+ * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin\r
+ */\r
+#jquery-overlay {\r
+       position: absolute;\r
+       top: 0;\r
+       left: 0;\r
+       z-index: 90;\r
+       width: 100%;\r
+       height: 500px;\r
+}\r
+#jquery-lightbox {\r
+       position: absolute;\r
+       top: 0;\r
+       left: 0;\r
+       width: 100%;\r
+       z-index: 100;\r
+       text-align: center;\r
+       line-height: 0;\r
+}\r
+#jquery-lightbox a img { border: none; }\r
+#lightbox-container-image-box {\r
+       position: relative;\r
+       background-color: #fff;\r
+       width: 250px;\r
+       height: 250px;\r
+       margin: 0 auto;\r
+}\r
+#lightbox-container-image { padding: 10px; }\r
+#lightbox-loading {\r
+       position: absolute;\r
+       top: 40%;\r
+       left: 0%;\r
+       height: 25%;\r
+       width: 100%;\r
+       text-align: center;\r
+       line-height: 0;\r
+}\r
+#lightbox-nav {\r
+       position: absolute;\r
+       top: 0;\r
+       left: 0;\r
+       height: 100%;\r
+       width: 100%;\r
+       z-index: 10;\r
+}\r
+#lightbox-container-image-box > #lightbox-nav { left: 0; }\r
+#lightbox-nav a { outline: none;}\r
+#lightbox-nav-btnPrev, #lightbox-nav-btnNext {\r
+       width: 49%;\r
+       height: 100%;\r
+       zoom: 1;\r
+       display: block;\r
+}\r
+#lightbox-nav-btnPrev { \r
+       left: 0; \r
+       float: left;\r
+}\r
+#lightbox-nav-btnNext { \r
+       right: 0; \r
+       float: right;\r
+}\r
+#lightbox-container-image-data-box {\r
+       font: 10px Verdana, Helvetica, sans-serif;\r
+       background-color: #fff;\r
+       margin: 0 auto;\r
+       line-height: 1.4em;\r
+       overflow: auto;\r
+       width: 100%;\r
+       padding: 0 10px 0;\r
+}\r
+#lightbox-container-image-data {\r
+       padding: 0 10px; \r
+       color: #666; \r
+}\r
+#lightbox-container-image-data #lightbox-image-details { \r
+       width: 70%; \r
+       float: left; \r
+       text-align: left; \r
+}      \r
+#lightbox-image-details-caption { font-weight: bold; }\r
+#lightbox-image-details-currentNumber {\r
+       display: block; \r
+       clear: left; \r
+       padding-bottom: 1.0em;  \r
+}                      \r
+#lightbox-secNav-btnClose {\r
+       width: 66px; \r
+       float: right;\r
+       padding-bottom: 0.7em;  \r
+}
\ No newline at end of file
diff --git a/doc/TODO.txt b/doc/TODO.txt
new file mode 100755 (executable)
index 0000000..0774986
--- /dev/null
@@ -0,0 +1,356 @@
+== TODO ==\r
+\r
+=== v1.0.1 ===
+* Pouvoir afficher les utilisateurs (print_users(admin)) qui sont admin\r
+* Ne pas pouvoir poster avec "<nick>" -> mettre en constante\r
+* Ajouter euphorik_common.erl au repo !!\r
+* Compilation :\r
+   * Compiler avec le flag +debug_info pour le developpement\r
+   * Compiler avec le flag +native lors de la mise en production\r
+      * Faire d'abord des tests en local pour voir s'il y a vraiment des gains, utiliser le module test_euphorik\r
+      * Regarder également si la comsommation de la mémoire est différentes\r
+      * La compilation DOIT se faire sur la machine cible, il faut donc d'abord copier les fichiers dans /tmp sur euphorik.ch\r
+         puis lancer la compilation à distance et finalement copier les fichiers sur /var/www/euphorik\r
+* Appliquer les flags suivant à Yaws : http://forum.trapexit.org/mailinglists/viewtopic.php?t=6725&sid=8729e02f79c3ef0e0794add77b74b6ce\r
+=== v1.1 ===\r
+* Revoir le système de conversation : \r
+   * Pouvoir extraire "toute la conversation" ou seulement une "sous conversation" (ce qui est actuellement le cas)\r
+   * Tous les messages auquels on répond doivent faire partie de la conversation !!\r
+   * Fermer temporairement une conversation (la réduire sous la forme d'un onglet)\r
+   * lien vers une conversation : http://www.euphorik.ch/?conv=45\r
+* Mettre un icon (genre sablier ou truc qui tourne à la apple) lorsque le chat se charge (également lors d'un changement de page par exemple)\r
+   * L'icon apparait tout en haut (absolute)\r
+   * Simuler un réseau lent\r
+* Mise à jour automatique de la version dans le about en fonction du tag/branche courant (lors de la mise en production) ?\r
+* Tests de monter en charge coté serveur, analyse de la complexité (regarder du coté des TODO dans le code). Utiliser eventuellement Tsung\r
+* Profiling pour améliorer les performances (client et serveur)\r
+   * traitementComplet() de euphorik.js est très très lent à executer\r
+* Pouvoir récupérer son mdp (ou en générer un autre) via son email. Marquer dans le profile que l'email sert à cela et n'est pas visible pas les autres personnes\r
+* (Pouvoir inverser le chat) tester la faisabilité\r
+=== v1.2 ===\r
+* Avoir une liste d'amis dans le profile\r
+   * Pouvoir n'afficher les messages que des amis (et des personnes y répondant)\r
+   * Ajouter une personne à ses amis avec une toolbar similaire à celle de banissement\r
+* Création d'un script ruby dans /tool pour apposer  automatiquement une entête concernant la licence voir : http://www.gnu.org/licenses/gpl-howto.fr.html\r
+   * Eventuellement mettre à jour automatiquement le Copyright (date) et les personnes responsables \r
+* Système de censure par les admins (suppression d'un message)\r
+   * Ne supprime pas réellement le message mais le censure\r
+   * L'admin vois toujours le message (grisé, ou tracé)\r
+   * Les utilisateurs normaux voient à la place "<censuré, raison : blabla>"\r
+* Intégrer les totoz : http://www.totoz.eu/ (avec une limite de 3 par messages par exemple) \r
+   * avoir une option pour les cacher ou les voir\r
+   * Masquer systématiquement ceux qui dépassent une certaine taille en pixel\r
+=== V1.3 ===\r
+* Shift-enter pour ajouter une ligne dans la ligne de saisie (retour à la ligne)\r
+   * Crée un <br /> XHTML (lf -> br coté client)\r
+   * A chaque Shift-enter la textbox s'agrandit d'une ligne\r
+   * Pouvoir activer pas défaut la présentation multi-ligne via le profile\r
+* Système de commande /<commande>\r
+   * /nick : changer de pseudo\r
+   * /me : "*<pseudo> <message>"\r
+   * /blam <login> : permet d'envoyer un blame à qqun (uniquement depuis un modo vers un non-modo)   \r
+   * /+ blabla Pourvoir ajouter du texte (correctif en général) à son dernier message par une commande. Le texte ajouté est mise en évidence. Ceci peut être fait plusieurs fois.\r
+* Ajout des wikilien : [[chien de prairie]] -> http://fr.wikipedia.org/wiki/Chien_de_prairie\r
+=== V1.4 ===\r
+* Elaborer une stratégie de mise à jour de la structure de la BD quand celle ci est modifiée (voir euphorik_bd:vers_version())   \r
+* Ajouter un skin "simple" sans images ni fioritures (éventuellement le proposer par défaut)\r
+* Créer un style "super old school" (couleur 8 bit, pas de smiles/images, font fixe)\r
+=== V1.5 ===\r
+* Gestion de l'historique au niveau du navigateur (pouvoir revenir aux pages précédentes). Utiliser un plugin jQuery si possible.\r
+* gestion des timezone (fuseaux horaire) :\r
+   * L'utilisateur peut simplement définir une timezone dans son profil, les dates sont alors affichées en fonction de sa zone (en option)\r
+* Transfert des messages XML (AJAX) en https et le noter dans la faq (même la mafia chinoise ne peut pas sniffer les messages). En fait il suffit (sauf erreur) de sécuriser euphorik : https://www.euphorik.ch\r
+   * voir : http://cert.startcom.org/ pour un certif gratuit\r
+* Conversations : url vers conversation(s) + également un bouton sur chaque conversation pour obtenir l'url vers celle ci. (genre google map)\r
+\r
+
+[ok] Réaliser la structure suivante :
+   * Table minichat : {id, auteur_id, date, pseudo, contenu, reponses_minichat_id} reponses_minichat_id peut être null
+   * Table reponse_minichat : {id, minichat_id} la clef est (id, minichat_id)
+   * Table user : {id, cookie, pseudo, date_creation, date_derniere_connexion, css}
+[ok] Implémenter le protocole dans 'fonctionnement_minichat.txt'
+[ok] Trier la requête et limiter à N le nombre de messages affichés
+[ok] réaliser un controller sous la forme d'une application pour receptionner tout ce qui vient des formulaires
+[ok] Ajouter un lien minichat.iduser -> user.id
+[ok] Ajouter un id pour les messages qui est un entier auto incrémenté
+[ok] Afficher un captcha le md5 de la valeur est l'envoyer avec
+[ok] Formater les dates
+[ok] Trouver et remplacer les url http://www.youpla.com par <a href="http://www.youpla.com">[url]</a>
+[ok] Traitement des smiles, remplacer :) par "<img src="img/smiles/content.gif" />"
+   * Pour ne pas entrer en conflit avec totoz.eu la notation est la suivante : [=slurp]
+   * La notation totoz.eu est : [:slurp]
+[ok] Afficher les smiles disponibles, on peut clicker dessus pour en ajouter un dans le text
+[ok] Mettre en évidence les posts auquels l'utilisateur courant à répondu ainsi que ses propres posts
+   * Vérifier le captcha
+   * Mettre un cookie
+[ok] Mémoriser le pseudo et le remettre à chaque fois (si cookie)
+[ok] Afficher un <pseudo> et <message> pour renseigner l'utilisateur sur les différents zones de texte. Lorsque l'utilisateur click sur une zone le message disparait. (javascript).
+[ok] Pouvoir répondre à un ou plusieurs messages en cliquant dessus (javascript)
+   * L'utilisateur peut cliquer sur un message, cela appond le nom et l'id du message à son message, exe : "kiki:G3E> " "G3E" et l'id du message en base 36, si l'id est omis alors le dernier message dont le pseudo est kiki est pris en compte
+   * le(s) pseudo(s) de l'auteur du message auquel on répond préfixe notre message
+   * Lorsque l'on passe le curseur sur un message on voit la conversation avec une mise en évidence des réponses (les messages ne faisant pas partie de la conversation sont grisés ou masqués)
+[ok] Maintenir le focus sur la ligne de saisie après l'envoie d'un message
+[ok] Ajouter plusieurs messages d'un coup pour eviter des lenteurs au chargement
+[pas besoin] Catcher les exceptions de parsage de l'xml dans euphorik_request
+[ok] Ne pas virer les balises html mais remplacer les <> par &lt; &gt;
+[ok mais limité] Avoir accès aux archives (par page, par exemple)
+[ok] Interdir les {} dans les pseudo
+[plus besoin] Finir le deamon
+[plus besoin] tester si le captcha_crypt existe (en regardant les fichiers images temporaires)
+[ok] Virer les balises html des messages et pseudo lors du stockage du message (et trimer).
+[ok] afficher les pseudo des messages auquels un message répond (modification du protocole, il faut ajouter une liste de pseudo pour chaque message)
+[ok] Possibilité de logout
+[ok] Filtrer les { et } dans les pseudo sur la page profile
+[ok] différentier [url] [gif] [png] et le reste des url. utiliser lightbox pour les images
+[ok] Déplacer le formatage des messages du coté du client -> permet de demander à lightbox de reparser lors de l'ajout d'une image
+[ok] Demander une confirmation lors d'un logout (are you sure jane ?) (vie la système de messagebox)
+[ok] Possibilité d'enregistrement avec une page dédiée au profil.
+  * Pour se logger il suffit de donner un tuple login + password (le pseudo courant de chat est une données supplémentaire).
+  * La css choisie est une donnée personnelle.
+  * Les personnes enregistrées on un pseudo d'une couleur différente.
+  * (Ajout de smiles personnels)?
+[ok] Ajouter des messages d'erreur ("login impossible", "captcha incorrect")
+[ok] Ajouter des messages systèmes
+[ok] Gérer le flood : si un utilisateur envoie plus de 2 messages par seconde pendant 5 secondes alors il ne peut plus poster pendant 5 secondes
+   * S'il récidive alors il est suspendu pendant 5^2 puis 5^3
+   * Utiliser les messages systèmes pour annonce le flood
+[ok] Pouvoir modifier la css (dark/light)
+ * Créer le style lite
+ * Créer le style old (avec le style de l'ancien site)   
+[ok] Ne pas afficher la css dans le profile
+[ok] Ne pas effacer le message (dans le <input>) si l'on recoit un "pas ok" lors de l'envoie\r
+[ok] Conversations : \r
+   [ok] implémenter coté serveur et client la sauvegarde et la restauration des conversations\r
+   [ok] Supprimer l'envoie de la description des conversations lors du refresh ainsi que modifié la manière de créer les conversations (maj des diagrammes de séquence)\r
+   [ok] Navigation vers les pages précédentes\r
+   [ok] Lien vers une conversation dans les messages sous cette forme {5F}. Le clic dessus ouvre la conversation. Egalement un bouton sur chaque conversation pour insérer son lien dans le message en cours de rédaction\r
+   [ok] Mettre à jour la CSS de chaque skin \r
+[ok] Remplacer l'XML par du JSON. gain en simplicité et en temps d'execution.\r
+   [ok] Tester sur un prototype : l'authentification -> concluant\r
+   [ok] Si concluant passage complet à JSON\r
+   [ok] Les id ne sont plus passés en base 36\r
+   [ok] Flusher le profil lors du déchargement de la page ? -> oui\r
+   [ok] Envoyer les infos des conversations avec l'attente d'events ? -> oui
+[ok] Problème de rafraichissement des couleurs des messages auquels on répond
+[ok] Problème dans l'alternance des couleurs des messages
+[ok] Utiliser une listbox pour la liste des css
+[ok] Changer les noms des css : Light -> Cold, Old -> Classic
+[ok] Faire une page faq et raconter n'importe quoi (entre autre la limitation avec firefox) "pourquoi ce site à des couleurs qui ne veulent rien dire ?"
+[ok] Ralentir volontairement le connexion lors d'un mauvais login (ou après n mauvais login)
+[ok] Pouvoir afficher le login et/ou le pseudo. Avoir dans le profile une liste box avec ces choix :
+   * pseudo
+   * login
+   * pseudo(login)
+* Créer un favicon (joli)
+[ok] Créer une page 'about'
+[ok] Ajouter de nouveaux smiles et changer la syntax pour eviter le conflit avec totoz :
+   * "slurp" : http://forum-images.hardware.fr/images/perso/huit.gif
+   * "agreed" : http://forum-images.hardware.fr/icones/smilies/jap.gif
+   * "dodo" (tete avec un bonnet de nuit et des ZZZZ)
+   * "hum?" : http://forum-images.hardware.fr/icones/smilies/heink.gif
+   * "pas reveillé" avec une tasse de café et des cernes : http://forum-images.hardware.fr/images/perso/elmoricq.gif
+   * "interrogation" genre http://forum-images.hardware.fr/icones/confused.gif
+   * http://forum-images.hardware.fr/images/perso/dao.gif ou http://forum-images.hardware.fr/icones/redface.gif
+   * http://forum-images.hardware.fr/icones/ohwell.gif
+[ok] Tester avec des caractères accentués sur Firefox, Safari, Opera et IE7. Les messages doivent être envoyés en UTF8.
+[ok] Tester avec des caractères exotiques (jap, coréen, etc..)
+[ok] Modifier la syntaxe des smiles actuels (pour pas qu'ils entre en conflit avec totoz)
+[ok] Trouver un moyen pour éviter la création à la suite de plusieurs comptes (via register). 
+[ok] Restructurer le code Erlang : déplacer certaines fonctions d'un module à l'autre (ev. créer des modules)
+[ok] remplacer lightbox par : http://leandrovieira.com/projects/jquery/lightbox/
+[ok] Problème des images dans les trolls
+[ok] Finir l'édition (mémoriser le contenu) des trolls
+[ok] Est-ce que client.dernierMessageErreur est vraiment utile ??
+[ok] marquer <aucun login> lors de l'affichage des login dans le chat pour les personnes n'en ayant pas : finalement il n'affiche tout simplement pas les logins
+[ok] Avoir un thème de discussion affiché en haut des messages genre appellé "troll de la semaine : linux sera-t-il desktop ready en 2008?"
+[ok] Un statut "EK" avec plein de privilège à la con. (avoir une petite étoile à coté de son nick ou le nick d'une certaine couleur)
+   * Une page "admin" avec :
+      * Trolls : La liste des trolls proposés. L'admin peut éditer ses propres trolls.
+      * Les ip bannis : avec la date d'échéance et le pseudo. Un admin peut décider de débannir un utilisateur
+   * Pouvoir kick/ban un user (directement depuis le chat, lors du survol du pseudo d'un user des options sont présentés sous la forme de petits boutons)
+      * Un kick : l'utilisateur (ip) est kické et bannis pour 15 min
+      * Un ban : l'utilisateur (ip) est kické et bannis pour 3 jours
+      * Modification de la BD -> ajouter une relation "banned_ip"\r
+[ok] Passer à jQuery 1.2.4\r
+[ok] La largeur de la ligne de saisie doit corresponde à la largeur de la fenêtre\r
+[ok] Lorsqu'un troll de la semaine est posté un message l'est également par le sys formant la racine de la conversation lié au troll\r
+   * Il est alors possible de voir la conversation lié au troll en cliquant sur le troll de la page principale\r
+[ok] Faire des infos bulles à la facebook\r
+[ok] Mettre les constantes au niveau du serveur dans euphorik_defines.hrl (par exemple les temps lié au flood)\r
+[ok] Créer un style common puis adapter les CSS (classic et cold -> web2.0)\r
+   * Alignement du menu, du troll et des trolls de la partie admin à l'aide de line-height
+[ok] Finir les options d'affichage des bulles et des dates
+[ok] Stocker quelque part la version de la BD
+   * Créer une table "proprietes" contenant des tuples {propriete, nom, val}
+[ok] Définir la bonne feuille de style au chargement de la page pour éviter le "clignotement" pas beau
+   * Le cookie envoyé par le client doit permettre de retrouver le user      
+[ok] Finir le script de mise en production
+   * Make des modules.
+   * Compactage des js lors de la mise en production (afin d'optimiser la bande passante lors de l'accès au site), regarder comment fait jQuery.
+      * Modifier le script pour virer les lignes matchant /^\W*;;.*$/
+   * Virer les commentaires dans les pages HTML
+   * processus :
+      1) copie des fichiers (+minimisation)
+      2) Execution d'un scripte erlang pour recharger tous les modules au sein du noeud
+      3) Executer euphorik_bd:update() pour mettre à jour la BD
+[ok] Ajouter dans la FAQ et/ou dans la page d'enregistrement les conditions d'utilisation, genre "chacun est responsable de ses dires" https://linuxfr.org/bouchot/\r
+[ok] Limiter la mise en évidence de la conversation lorsque le curseur se trouve sur les pseudos\r
+[ok] Cleaner le code (erl, js, xhtml, css) et eventuellement profiler un peu (le refresh est lent sous opera)\r
+[ok] Afficher l'ip dans le print_users().
+[ok] Enlever le petit carré mis en couleur et mettre le pseudo + date en couleur à la place
+[ok] Mettre dans la FAQ la signification des couleurs associées aux messages.
+
+=== Bugs ===
+1 : Critique
+2 : Urgent
+3 : Peu grave\r
+\r
+[1] Il arrive qu'après le poste d'un message le refresh ne se fasse plus, peut-être une "race-condition" dans la classe PageEvent de euphorik.js\r
+   * Observé sur opera et firefox\r
+   * Après quelques analyses il apparait que firefox attend alors que le processus n'existe plus du coté yaws\r
+   * Cela arrive après 5-10min\r
+   * Regarder du coté des paramètres (options) du socket coté yaws s'il n'y a pas un indice, par exemple un timeout\r
+   * solution de secours : timeout de (1 à 5 min) sur la connexion ajax\r
+   * Est-ce que yaws tient compte du "Keep-Alive 300" de l'entête HTTP ? (=5min) (normalement pas puisque HTTP/1.1) après avoir regardé les sources il me semble que non\r
+   * Normalement si le socket est fermé du coté de yaws, le client devrait être avertis... !?\r
+   * Après beaucoup d'investigation il semblerai que se soit le firewall/routeur qui coupe la connexion sans prévenir,\r
+      pour éviter cela il est possible de mettre 'keepalive' à true au niveau du socket, voir : \r
+         - http://erlang.org/doc/man/inet.html#setopts-2\r
+         - http://forums.globalscape.com/tm.aspx?m=4114
+[2] Le minificateur js doit ajouter un espace après une expression régulière sinon il est possible que le caractère qui suit celle ci soit pris pour un modificateur de la regexp
+[2] Le widget select qui permet la sélection des css n'est pas initialisé correctement au chargement du site\r
+[2] Traiter les tags TODO et FIXME dans le code
+[2] Le changement de skin n'est pas mémorisé lorsque l'on est pas connecté (normal puisque le style est mémorisé dans le profil)
+   * solution 1 : permettre le changement de skin uniquement pour les personnes enregistré ?
+   * solution 2 : mémoriser le skin courant dans un cookie\r
+[2] Après l'ajout d'une image il n'est pas possible de naviger depuis celle ci vers les autres images en utilisant Next et Prev de lightbox après l'avoir affich\r
+[2] Plein de bugs sous MS internet explorer 7
+   * click sur le lien du conv insère sont id systématiquement au début du message
+   * le changement de skin foire complétement
+[3] Quand on revient en arrière dans firefox le message en rédaction est perdu
+   * Pas sous Opera, apparemment Firefox recharge toute la page (donc impossible qu'il puisse remettre le message)
+   * Eventuellement sauvegarder le message en rédaction dans le profile...\r
+[3] Le changement de page sous Firefox (pas essayé avec d'autre nav) est plutot moche, le texte est d'abord affiché puis le style est appliqué.
+[3] Quelques fichiers sont encore en iso-8859-1 (Makefile, euphorik_bd.hrl, etc..) tout passer en UTF-8
+[3] Un message envoyé sans être authentifié ne sera pas taggé comme appartenant à l'utilisateur.
+   a) L'utilisateur attend des messages SANS donné de cookie car il n'est pas authentifié
+   b) L'utilisateur envoie un message
+      i) Il s'enregistre sans login/pass (réalisé automatiquement)
+      ii) Il envoie le message (put_message)
+   c) Le serveur réagie au nouveau message et débloque la connexion, à ce moment le serveur n'a pas le cookie car pas donné, voir a)
+[3] Traiter le cas ou le cookie n'existe pas coté serveur (et plus généralement traiter tous les cas d'inputs exeptionnels)\r
+   * Afficher un message dans le cas ou le navigateur du client ne supporte pas les cookies en lui disant que la session ne pourra pas être autmatiquement restoré à la prochaine utilisation
+[3] "Return" ne marche pas sous safari
+[3] Le "cachage" des messages ne marche pas sous Konqueror, voir : "#page.minichat #conversations div.cache {" dans pageMinichat.css.
+       "-khtml-opacity: 0.3;" ne fonctionne pas\r
+[3] Amélioration des requêtes MNESIA, voir : http://mail.google.com/mail/#label/Erlang+mailing-list/117f688280569a58
+[3] la page est completement rechargé après avoir submité le profile dans opera
+[3] après le login un '?' s'ajoute à l'adresse (opera, firefox)
+
+[ok] Comme le json du client est encapsulé dans de l'xml il faut utiliser des xml entities pour les charactères <, > et &. Il faudrait, absolument éviter cette encapsulation moisie.\r
+[ok] Au bout d'un moment opera n'écoute plus rien... et donc n'affiche plus les nouveaux messages..\r
+[ok] La méthod traiterSmiles est très lourde ! (4 secondes pour 80 appels (une page normale))\r
+[ok] Utiliser Alpha truc à la place d'opacity sous explorer\r
+[ok] les heures sont formatées par le serveur avec un espace devant : " 12.30:10", zarb\r
+[ok] un undefined est mis lorsque l'on répond à qqun qui n'a pas de pseudo (traiter ces pseudo par le formateur)\r
+[ok] On ne peut pas réponde aux messages du système\r
+[ok] Apparement les process liés aux connexions ne sont jamais terminé même quand l'utilisateur coupe la connexion à cause de minichat:attends_nouveau_messages()
+[ok] Bug rafraichissement des conversations, exemple :
+   - la page 2 de la conv est affiché (mess 1 à 10) et la conv principale contient les mess de 11 à 2.
+   - lors de l'ajout d'un mess dans la conv celle ci n'est pas rafraichit.
+   - trouver une solution : donné un idDernierMess pour chaque conv ou supprimer cet idDernierMess et jouer sur le fait que l'on recoit un message après l'autre (orientation des messages après attente)
+[ok] En changeant de page puis en revenant sur la page principale les smiles ne sont plus highlightés lorsque le curseur les survol
+   * Plus reproduit
+[ok] Dans certains cas (à déterminer) les message-box (message d'information affiché tout en haut de la page) ne s'affiche plus (on ne voit que un petit bout dépassé)
+   * Plus reproduit\r
+[ok] Après un register le pseudo est effacé - le pseudo n'est pas mémorisé dans le profil lors d'un envoie de mess en l'ayant changé
+[ok] jQuery définit l'option "X-Requested-With" à "XMLHttpRequest dans l'entête HTTP. De ce fait Yaws exige absolument de l'xml...
+   Solution actuelle : jquery.js est modifié pour ne plus définir cette option. Trouver un autre moyen plus élégant.
+[ok] Les smiles ne devraient pas dépasser de la fenêtre lorsqu'ils sont affichés
+[ok] Les processus en attente ne se termine pas lorsque le socket est fermé (pour l'instant un timeout de 1heure est appliqué)
+[ok] Possibilité d'enregistrer plusieurs users avec le même login\r
+[ok] le return ne marche pas sous IE
+[ok] Lors du click sur le bouton slap/kick/ban il faut fermer la mini fenêtre
+[ok] Lors de l'extraction d'une conv il arrive que la conv extractée soit bien créée mais vide, le bouton ne ferme pas la conv (très étrange, bug de firefox?)
+   * Arrive une fois sur 20 environ
+   * Jamais reproduit avec Opera
+   * Peut être un bug lié à jQuery
+   * Reproduit sur Firefox 2 et 3 !
+[ok] Lors d'un logout il faut faire un full refresh (pour mettre à jour les messages auquel on répond par exemple)
+[ok] Après être passé de la page Admin à Chat le client continu de réaliser de temps en temp des requêtes "lists_banned_ips"
+   * action=%7B%22action%22%3A%22list_banned_ips%22%2C%22cookie%22%3A%22<<cookie>>%22%7D
+[ok] Le widget select qui permet la sélection des css n'est pas initialisé correctement au chargement du site
+[ok] Il est possible d'envoyer plusieurs fois le même message en pressant très rapidement plusieurs fois sur ENTER... (à vérifier)
+[ok] griser le login dans le profil pour montrer qu'on ne peut pas l'éditer
+
+=== Idées ===\r
+Une fois l'idée validée elle est déplacée dans une version à venir.\r
+
+1 : A implémenter tout de suite !
+2 : A implémenter dans un futur proche
+3 : Ca peut attendre
+4 : A discuter
+A : Abandonné
+ok : Implémenté
+\r
+[2] Indiquer le nombre de fois qu'un lien a été visité (également pour les images) (Bernie)\r
+   * Afficher quelque part les url les plus cliqués
+[2] Raccourcis pour répondre aux conversations (genre CTRL+2 pour répondre au deuxième)\r
+[2] Système de news/event (Bernie)\r
+[2] Syntaxe avancée des messagees :\r
+   * Possibilité d'utiliser les balises <i>, <b>, <code>, <q> (quoted text)\r
+   * Utiliser la syntaxe de mediaWiki : http://en.wikipedia.org/wiki/Wikipedia:Cheatsheet
+   * La balise <hide> pour mettre des spoilers
+[2] Une option dans le profile pour se délogger automatiquement lorsque l'on quitte le site\r
+[3] Gestion de l'historique (calendrier)
+[3] Idée de bernie :
+   * Pouvoir STFUER des personnes, lorsqu'elle envoie un message un autre truc à la con est écrit à la place
+   * la phrase à la con est prise parmis une liste éditable depuis le panneau d'admin
+   * La stfuation se fait depuis le panel de bannissement (slap, stfu, kick, ban)
+[4] Unifier tout le code en anglais (sauf les commentaires)
+[4] Inscrire le nom de l'image dans les les liens vers des images (à la place de simplement [jpg] ou [gif])
+[4] Réduire les pseudos trop long en mettant un ".." à la fin et permettre de le voir en entier lorsque le curseur le survol.\r
+[4] Compatible OpenID pour l'identification\r
+[4] Outil de localisation des personnes un peu comme ca : http://bouchot.org/cps
+[4] Pouvoir voir le profile des personnes.
+   * Voir leurs derniers messages
+   * Une page de recherche de personne\r
+[4] Chaque user possède un Blog (ne pas utiliser le terme 'Blog') Dans lequel il peut poster des "Troll", sorte de "sujet" de forum.\r
+   * Ce système est utilisé dans le chat principal (avec le troll de la semaine posté par un admin).\r
+   * Chaque troll possède un certain nombre de tag.\r
+   * il est possible de faire une recherche sur l'ensemble des users.\r
+   * Voir description.txt pour plus d'info sur les trolls\r
+[4] Pouvoir privatiser une conversation entre 2 ou plusieurs personnes
+[4] Pouvoir choisir une couleur pour son pseudo
+[4] Créer un gamebot pour lancer des jeux\r
+   * Définir une interface pour la création de nouveau jeu au sein du serveur\r
+   * Jeu d'énigmes\r
+   * jeu du pendu\r
+   * Jeu des chiffres et des lettres : "[Lettres tirées] - E N X U L S Z C M I - (trouvez le mot de plus long avec ces lettres)"
+[4] Image animée à la http://www.google.co.kr/ cf http://www.google.co.kr//ig/f/AaEyQnOaAr4/intl/ALL_kr/svc_sprite_all.gif
+[4] Bot de traduction
+[4] RSS
+[4] Système de vote sur les messages, + ou - qui donne des points aux messages...
+[4] Voir les personnes connectées + un statut
+[4] Avoir une liste d'amis
+[4] Restreindre la consultation d'un message posté à un ou plusieurs utilisateurs définis. Les messages de la conversation ne sont alors vus que par cet ensemble d'utilisateurs.
+[4] Système de trolls. Voir decription.txt.\r
+\r
+[A] smiles personnalisés, on peut en ajouter dans la préférence utilisateur.
+[ok] Pouvoir insérer des tags qui sont des liens vers des conversations, par exemple : {R4S} =~ /\{\w+\}/\r
+[ok] Possibilité d'extraire une conversation, on click (par l'intermediaire d'un petit bouton par exemple) sur un message et l'arbre de réponses correspondant s'affiche dans une colonne sur la gauche.\r
+   * Il est possible d'ouvrir plusieurs conversations\r
+   * Les messages faisant partie des conversations ne sont plus visibles dans le flux général\r
+   * (une colonne peut avoir le focus, dans ce cas on répond automatiquement à la dernière personne qui nous a répondu)\r
+   * Chaque colonne possède une entête avec le message d'origine et trois boutons :\r
+      * un pour copier l'id de la conversation dans la textbox (voir point suivant) \r
+      * un pour fermer la conversation\r
+      * un pour créer une url vers cette conversation (un peu à la manière de google maps)\r
+[ok] Pouvoir cacher les dates
+
+=== Concurrents ===
+http://www.phpfreechat.net/demo.fr.html
+http://moules.org/board
+http://hadoken.free.fr/board/index#b
+http://bouchot.org/tribune#missive\r
+https://linuxfr.org/board/
diff --git a/doc/description.txt b/doc/description.txt
new file mode 100644 (file)
index 0000000..11e1205
--- /dev/null
@@ -0,0 +1,112 @@
+== En bref ==\r
+Euphorik est un site web communautaire principalement basé sur un système d'échange de messages instantanés.\r
+Attention: la description ici ne correspond pas à l'état actuel du projet mais à un but à atteindre.\r
+\r
+== Philosophie ==\r
+Euphorik est un site communaire de niveau supérieur (un truc qui n'existe pas et qui n'existera probablement jamais).\r
+N'importe qui peut poster des messages ou des trolls (un troll étant un super message persistant à caractère trollifique).\r
+Il est possible de s'enregistrer pour garder son identité et sauvegarder certains paramètres.\r
+Pas besoin d'être authentifier pour poster des messages\r
+Il faut être enregistré pour poster des trolls (ouais bein quant on troll on assume)\r
+Il n'y a qu'un seul canal par troll (channel au sens IRC).\r
+Un message peut répondre à un ou plusieurs autres messages, ceci crée automatiquement des arbres de conversation (au sein d'un troll).\r
+Ces arbres de conversation peuvent être extraient de la conversation principal et affichés séparement (toujours au sein d'un troll).\r
+Il existe des êtres supérieures qui ont de grands pouvoirs, ce sont les EkMaster ou [EM] (les admins quoi).\r
+L'interface doit être sobre, simple et un peu retro :)\r
+Il est interdit d'utiliser des technos pourries comme PHP.\r
+\r
+\r
+== Détails ==\r
+=== Pages ===\r
+* Main : Présente les trolls de la semaine\r
+* Trolls : Liste un certain nombre de trolls postés par les utilisateurs. Le rafraichissement est en temps réel. Il est possible de faire une recherche par mot clef.\r
+* People : Permet de rechercher une personne et d'afficher sa page, en particulier ses trolls.\r
+* Profile : Permet d'accèder à ses données. C'est à partir de cette page que l'on peut poster des trolls.\r
+* About : description du site (Faq et cie..)\r
+\r
+=== Le Troll ===\r
+Le troll est un message, une question, une pensée, etc, digne d'intérêt (ou pas) étant la fusion entre un topic de forum et un channel de chat.\r
+Il existe un troll principal concernant le chat principal.\r
+Un troll peut être édité par son auteur.\r
+N'importe qui peut voir l'historique des éditions.\r
+Il est possible de plusser ou moinsser un troll.\r
+Un troll possède de 0 à n tag (mot-clef).\r
+Les trolls sont présentés au sein d'une liste général ordrée en fonction de leur nombre de point et de leur date et aussi tant qu'on y est de la date du dernier message (genre reddit.com)\r
+Les trolls sont également présentés sur le profile du proprio du troll (par ordre anti-chronologique)\r
+\r
+=== Le troll de la semaine ===\r
+Sur la page principale appelé 'chat' il existe un troll qui sera affiché une semaine appellé "troll de la semaine".\r
+Le troll de la semaine est posté par les admins.\r
+Les admins voient les prochains trolls en attente, le nombre en attente est limité 10.\r
+Un admin peut ajouter un troll de la semaine. Il ne peut pas posséder plus d'un troll en attente.\r
+Le troll de la semaine change le lundi à 3h00 du mat' s'il en existe un en attente. Il est choisi au hasard.\r
+Les n derniers trolls des semaines précédentes sont toujours affichés de manière repliés en dessous du troll de la semaine. pour l'instant n = 4.\r
+\r
+=== Le message ===\r
+Un message répond à un troll et peut répondre à d'autres messages de ce troll.\r
+Un message ne peut pas être éditer, il est possible de lui appondre une ou plusieurs corrections " +++ Correction"
+un message dont l'entête est de couleur verte signfie : "un message qui me répond"
+un message dont l'entête est de couleur orange signifie : "mon message"
+Un message dont l'entête est de couleur bleu signifie : "un message auquel je répond"\r
+\r
+\r
+=== Admin ===\r
+L'admin propose des trolls de la semaine, il a le statut de EM (EkMaster)\r
+\r
+\r
+== Reflexions ==\r
+Les types d'information du plus éphémère au plus persistant.\r
+ * Plussage/moinssage\r
+   * Message\r
+ * Message (1-1)\r
+   * Blog\r
+   * Forum\r
+   * Article\r
+ * Question (1-1) | (1-n)\r
+   * Forum\r
+   * Message\r
+ * Billet (1-n)\r
+   * Blog\r
+ * Article (1-n) | (n-n)\r
+   * Wikipedia\r
+   \r
+   \r
+Moyen de communication sur le net :\r
+\r
+* Réseaux sociaux (facebook et cie)\r
+   + Orienté profile\r
+   + Liste d'amis\r
+   + Possibilité de mettre des infos personnels + photos\r
+\r
+* Vidéo (youtube et cie)\r
+   + Orienté vidéo\r
+\r
+* Reddit/Digg\r
+   * Aggrégateur de news/billet de blog/article\r
+   * L'ordre des informations peut changer (en fonction de la note)\r
+\r
+* Blog\r
+   * Orienté billet\r
+   * Géré par une seule personne\r
+   * Système de messages\r
+   + Structuration et recherche par tag (chaque billet possède un ou plusieurs tags)\r
+\r
+* Forum (phpBB, vBulettin, mesDiscussions, etc.)\r
+   * Orienté sujet\r
+   * Organisation hiérachique en thémes, p.e. : Hardware/HDD\r
+   * L'ordre des sujets ne correspond pas à leur date d'écriture mais à la date du dernier message\r
+   * Edition/correction possible\r
+   * Les "réponses" ne sont pas modérer par l'auteur du sujet\r
+   - Pas de système de plussage\r
+   - Par forcément d'arbre de réponses, obligation de quoter -> bordelique\r
+   - Le topic a souvent tendance à dériver\r
+\r
+* Chat (http://www.phpfreechat.net, http://bouchot.org, etc..)\r
+   * Orienté message\r
+   * Ordre figé\r
+   + Scalable grace aux channels\r
+   + Communication temps réel\r
+   - Ca peut devenir le bordel, difficile de suivre\r
+   - L'information est éphemère ou difficilement réutilisable\r
+   - Aucune hiérarchie ou structure en dehors des channels\r
+   
\ No newline at end of file
diff --git a/doc/graphiques/bouton_smiles.xcf b/doc/graphiques/bouton_smiles.xcf
new file mode 100644 (file)
index 0000000..21ac57a
Binary files /dev/null and b/doc/graphiques/bouton_smiles.xcf differ
diff --git a/doc/graphiques/couleurs entetes messages css1.svg b/doc/graphiques/couleurs entetes messages css1.svg
new file mode 100644 (file)
index 0000000..98d261e
--- /dev/null
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="744.09448819"
+   height="1052.3622047"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.46"
+   sodipodi:docname="couleurs entetes messages css1.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape">
+  <defs
+     id="defs4">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       id="perspective10" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="1.4"
+     inkscape:cx="131.32911"
+     inkscape:cy="504.74238"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="652"
+     inkscape:window-height="667"
+     inkscape:window-x="0"
+     inkscape:window-y="133" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <rect
+       style="opacity:1;fill:#31732f;fill-opacity:1;fill-rule:evenodd;stroke:#0d00a8;stroke-width:0.34887081;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="rect3153"
+       width="100.18613"
+       height="75.186127"
+       x="115.62122"
+       y="547.2691" />
+    <rect
+       style="opacity:1;fill:#841919;fill-opacity:1;fill-rule:evenodd;stroke:#0d00a8;stroke-width:0.34887081;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="rect3155"
+       width="100.18613"
+       height="75.186127"
+       x="116.3355"
+       y="465.48337" />
+    <rect
+       style="opacity:1;fill:#bf2911;fill-opacity:1;fill-rule:evenodd;stroke:#0d00a8;stroke-width:0.34887081;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="rect3157"
+       width="100.18613"
+       height="75.186127"
+       x="117.76408"
+       y="383.69766" />
+    <rect
+       style="opacity:1;fill:#84196c;fill-opacity:1;fill-rule:evenodd;stroke:#0d00a8;stroke-width:0.34887081;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="rect3159"
+       width="100.18613"
+       height="75.186127"
+       x="116.3355"
+       y="629.05481" />
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="49.285713"
+       y="507.79028"
+       id="text3181"><tspan
+         sodipodi:role="line"
+         id="tspan3183"
+         x="49.285713"
+         y="507.79028">référence</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="58.356026"
+       y="424.84149"
+       id="text3185"><tspan
+         sodipodi:role="line"
+         id="tspan3187"
+         x="58.356026"
+         y="424.84149">réponse</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="22.215401"
+       y="586.97449"
+       id="text3189"><tspan
+         sodipodi:role="line"
+         id="tspan3191"
+         x="22.215401"
+         y="586.97449">mon message</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="57.225166"
+       y="670.19867"
+       id="text3193"><tspan
+         sodipodi:role="line"
+         id="tspan3195"
+         x="57.225166"
+         y="670.19867">répondu</tspan></text>
+  </g>
+</svg>
diff --git a/doc/graphiques/fond.xcf b/doc/graphiques/fond.xcf
new file mode 100755 (executable)
index 0000000..96e905f
Binary files /dev/null and b/doc/graphiques/fond.xcf differ
diff --git a/doc/graphiques/fond2.xcf b/doc/graphiques/fond2.xcf
new file mode 100644 (file)
index 0000000..902ba65
Binary files /dev/null and b/doc/graphiques/fond2.xcf differ
diff --git a/doc/graphiques/fond3.xcf b/doc/graphiques/fond3.xcf
new file mode 100644 (file)
index 0000000..33cf542
Binary files /dev/null and b/doc/graphiques/fond3.xcf differ
diff --git a/doc/graphiques/icones/ban.xcf b/doc/graphiques/icones/ban.xcf
new file mode 100644 (file)
index 0000000..5819921
Binary files /dev/null and b/doc/graphiques/icones/ban.xcf differ
diff --git a/doc/graphiques/icones/exclamation.xcf b/doc/graphiques/icones/exclamation.xcf
new file mode 100755 (executable)
index 0000000..96381e0
Binary files /dev/null and b/doc/graphiques/icones/exclamation.xcf differ
diff --git a/doc/graphiques/icones/fermer.xcf b/doc/graphiques/icones/fermer.xcf
new file mode 100755 (executable)
index 0000000..9dc1f7b
Binary files /dev/null and b/doc/graphiques/icones/fermer.xcf differ
diff --git a/doc/graphiques/icones/information.xcf b/doc/graphiques/icones/information.xcf
new file mode 100755 (executable)
index 0000000..a44fedb
Binary files /dev/null and b/doc/graphiques/icones/information.xcf differ
diff --git a/doc/graphiques/icones/interrogation.xcf b/doc/graphiques/icones/interrogation.xcf
new file mode 100755 (executable)
index 0000000..8b7cfd8
Binary files /dev/null and b/doc/graphiques/icones/interrogation.xcf differ
diff --git a/doc/graphiques/icones/kick.xcf b/doc/graphiques/icones/kick.xcf
new file mode 100644 (file)
index 0000000..569ef77
Binary files /dev/null and b/doc/graphiques/icones/kick.xcf differ
diff --git a/doc/graphiques/icones/slap.xcf b/doc/graphiques/icones/slap.xcf
new file mode 100644 (file)
index 0000000..ef1af5d
Binary files /dev/null and b/doc/graphiques/icones/slap.xcf differ
diff --git a/doc/graphiques/logo.png b/doc/graphiques/logo.png
new file mode 100644 (file)
index 0000000..cb5fe32
Binary files /dev/null and b/doc/graphiques/logo.png differ
diff --git a/doc/graphiques/logo_1.xcf b/doc/graphiques/logo_1.xcf
new file mode 100755 (executable)
index 0000000..f4993a8
Binary files /dev/null and b/doc/graphiques/logo_1.xcf differ
diff --git a/doc/graphiques/logo_2.xcf b/doc/graphiques/logo_2.xcf
new file mode 100755 (executable)
index 0000000..dc069c9
Binary files /dev/null and b/doc/graphiques/logo_2.xcf differ
diff --git a/doc/graphiques/maquette_1.svg b/doc/graphiques/maquette_1.svg
new file mode 100644 (file)
index 0000000..85a06ab
--- /dev/null
@@ -0,0 +1,605 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="744.09448819"
+   height="1052.3622047"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.46"
+   sodipodi:docname="maquette_1.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   inkscape:export-filename="/home/gburri/projets/euphorik/doc/graphiques/logo_brut2.png"
+   inkscape:export-xdpi="138.63565"
+   inkscape:export-ydpi="138.63565">
+  <defs
+     id="defs4">
+    <linearGradient
+       id="linearGradient3254">
+      <stop
+         style="stop-color:#e36a6a;stop-opacity:1;"
+         offset="0"
+         id="stop3256" />
+      <stop
+         style="stop-color:#7e1818;stop-opacity:1;"
+         offset="1"
+         id="stop3258" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient3226">
+      <stop
+         style="stop-color:#767676;stop-opacity:1;"
+         offset="0"
+         id="stop3228" />
+      <stop
+         style="stop-color:#801f1f;stop-opacity:1;"
+         offset="1"
+         id="stop3230" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient3478">
+      <stop
+         style="stop-color:#e19671;stop-opacity:1;"
+         offset="0"
+         id="stop3480" />
+      <stop
+         style="stop-color:#e19671;stop-opacity:0;"
+         offset="1"
+         id="stop3482" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient3208">
+      <stop
+         style="stop-color:#00009d;stop-opacity:1;"
+         offset="0"
+         id="stop3210" />
+      <stop
+         style="stop-color:#00009d;stop-opacity:0;"
+         offset="1"
+         id="stop3212" />
+    </linearGradient>
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="88.276247 : 1210.1869 : 1"
+       inkscape:vp_y="553.72929 : -450.20981 : 0"
+       inkscape:vp_z="-747.30364 : 545.76797 : 1"
+       inkscape:persp3d-origin="-426.63432 : 956.9414 : 1"
+       id="perspective10" />
+    <filter
+       inkscape:collect="always"
+       id="filter5374">
+      <feGaussianBlur
+         inkscape:collect="always"
+         stdDeviation="2.6490625"
+         id="feGaussianBlur5376" />
+    </filter>
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="9.714905"
+     inkscape:cx="540.88058"
+     inkscape:cy="905.07314"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="1280"
+     inkscape:window-height="800"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     showguides="true"
+     inkscape:guide-bbox="true" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     style="display:inline">
+    <rect
+       style="fill:#f6dfc2;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="rect3458"
+       width="453.62442"
+       height="492.34741"
+       x="46.644756"
+       y="32.944107"
+       ry="0"
+       inkscape:export-filename="/home/gburri/projets/euphorik/doc/graphiques/logo_brut2.png"
+       inkscape:export-xdpi="138.63892"
+       inkscape:export-ydpi="138.63892" />
+    <path
+       style="fill:#e19671;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+       d="M 46.608811,76.256593 C 46.52482,55.815731 59.99113,32.741384 92.653703,32.992192 L 500.79271,33.368404 L 500.79271,526.20678 L 46.608811,526.20678 L 46.608811,76.256593 z"
+       id="rect3450"
+       sodipodi:nodetypes="cccccc"
+       inkscape:export-filename="/home/gburri/projets/euphorik/doc/graphiques/logo_brut2.png"
+       inkscape:export-xdpi="138.63892"
+       inkscape:export-ydpi="138.63892" />
+    <rect
+       style="fill:#f0df95;fill-opacity:1;fill-rule:evenodd;stroke:#841919;stroke-width:0.93;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="rect3474"
+       width="357.56439"
+       height="13.069962"
+       x="138.54781"
+       y="-132.54002"
+       transform="scale(1,-1)"
+       inkscape:export-filename="/home/gburri/projets/euphorik/doc/graphiques/logo_brut2.png"
+       inkscape:export-xdpi="138.63892"
+       inkscape:export-ydpi="138.63892" />
+    <rect
+       style="fill:#f0df95;fill-opacity:1;fill-rule:evenodd;stroke:#841919;stroke-width:0.86572993;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="rect3510"
+       width="82.503021"
+       height="13.13427"
+       x="51.428371"
+       y="119.43791"
+       inkscape:export-filename="/home/gburri/projets/euphorik/doc/graphiques/logo_brut2.png"
+       inkscape:export-xdpi="138.63892"
+       inkscape:export-ydpi="138.63892" />
+    <rect
+       style="fill:#f6dfc2;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+       id="rect2411"
+       width="453.85715"
+       height="366.43207"
+       x="47.071426"
+       y="144.57297"
+       inkscape:export-filename="/home/gburri/projets/euphorik/doc/graphiques/logo_brut2.png"
+       inkscape:export-xdpi="138.63892"
+       inkscape:export-ydpi="138.63892" />
+    <path
+       style="fill:#841919;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1"
+       d="M 46.294131,144.76665 L 138.52377,144.76665 L 143.38513,151.20817 L 138.52377,157.38453 L 46.294131,157.38453 L 46.294131,144.76665 z"
+       id="rect2413"
+       sodipodi:nodetypes="cccccc"
+       inkscape:export-filename="/home/gburri/projets/euphorik/doc/graphiques/logo_brut2.png"
+       inkscape:export-xdpi="138.63892"
+       inkscape:export-ydpi="138.63892" />
+    <text
+       xml:space="preserve"
+       style="font-size:9px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#f6dfc2;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Sans;-inkscape-font-specification:Sans"
+       x="47.904469"
+       y="153.76665"
+       id="text3185"
+       sodipodi:linespacing="125%"
+       inkscape:export-filename="/home/gburri/projets/euphorik/doc/graphiques/logo_brut2.png"
+       inkscape:export-xdpi="138.63892"
+       inkscape:export-ydpi="138.63892"><tspan
+         sodipodi:role="line"
+         id="tspan3189"
+         x="47.904469"
+         y="153.76665">[16:57:11] Pifou</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:9px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Sans;-inkscape-font-specification:Sans"
+       x="145.40186"
+       y="154.32814"
+       id="text3193"
+       sodipodi:linespacing="125%"
+       inkscape:export-filename="/home/gburri/projets/euphorik/doc/graphiques/logo_brut2.png"
+       inkscape:export-xdpi="138.63892"
+       inkscape:export-ydpi="138.63892"><tspan
+         sodipodi:role="line"
+         id="tspan3195"
+         x="145.40186"
+         y="154.32814">What is your favourite colour ?</tspan></text>
+    <rect
+       style="fill:#fbeede;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="rect3219"
+       width="362.08197"
+       height="13.10165"
+       x="138.16286"
+       y="157.23653"
+       inkscape:export-filename="/home/gburri/projets/euphorik/doc/graphiques/logo_brut2.png"
+       inkscape:export-xdpi="138.63892"
+       inkscape:export-ydpi="138.63892" />
+    <path
+       style="fill:#841919;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1"
+       d="M 46.556943,157.67408 L 138.78658,157.67408 L 143.64794,164.1156 L 138.78658,170.29196 L 46.556943,170.29196 L 46.556943,157.67408 z"
+       id="path5397"
+       sodipodi:nodetypes="cccccc"
+       inkscape:export-filename="/home/gburri/projets/euphorik/doc/graphiques/logo_brut2.png"
+       inkscape:export-xdpi="138.63892"
+       inkscape:export-ydpi="138.63892" />
+    <text
+       xml:space="preserve"
+       style="font-size:9px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#f6dfc2;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Sans;-inkscape-font-specification:Sans"
+       x="48.006577"
+       y="167.07393"
+       id="text3211"
+       sodipodi:linespacing="125%"
+       inkscape:export-filename="/home/gburri/projets/euphorik/doc/graphiques/logo_brut2.png"
+       inkscape:export-xdpi="138.63892"
+       inkscape:export-ydpi="138.63892"><tspan
+         sodipodi:role="line"
+         id="tspan3213"
+         x="48.006577"
+         y="167.07393">[16:57:11] Pifou</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:9px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Sans;-inkscape-font-specification:Sans"
+       x="145.50395"
+       y="167.63542"
+       id="text3215"
+       sodipodi:linespacing="125%"
+       inkscape:export-filename="/home/gburri/projets/euphorik/doc/graphiques/logo_brut2.png"
+       inkscape:export-xdpi="138.63892"
+       inkscape:export-ydpi="138.63892"><tspan
+         sodipodi:role="line"
+         id="tspan3217"
+         x="145.50395"
+         y="167.63542">What is your favourite colour ?</tspan></text>
+    <path
+       style="fill:#841919;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1"
+       d="M 46.553376,170.63422 L 138.78303,170.63422 L 143.64439,177.07574 L 138.78303,183.2521 L 46.553376,183.2521 L 46.553376,170.63422 z"
+       id="path5399"
+       sodipodi:nodetypes="cccccc"
+       inkscape:export-filename="/home/gburri/projets/euphorik/doc/graphiques/logo_brut2.png"
+       inkscape:export-xdpi="138.63892"
+       inkscape:export-ydpi="138.63892" />
+    <text
+       xml:space="preserve"
+       style="font-size:9px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#f6dfc2;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Sans;-inkscape-font-specification:Sans"
+       x="48.00658"
+       y="180.22029"
+       id="text3246"
+       sodipodi:linespacing="125%"
+       inkscape:export-filename="/home/gburri/projets/euphorik/doc/graphiques/logo_brut2.png"
+       inkscape:export-xdpi="138.63892"
+       inkscape:export-ydpi="138.63892"><tspan
+         sodipodi:role="line"
+         id="tspan3248"
+         x="48.00658"
+         y="180.22029">[16:57:11] Pifou</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:9px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Sans;-inkscape-font-specification:Sans"
+       x="145.50395"
+       y="180.78178"
+       id="text3250"
+       sodipodi:linespacing="125%"
+       inkscape:export-filename="/home/gburri/projets/euphorik/doc/graphiques/logo_brut2.png"
+       inkscape:export-xdpi="138.63892"
+       inkscape:export-ydpi="138.63892"><tspan
+         sodipodi:role="line"
+         id="tspan3252"
+         x="145.50395"
+         y="180.78178">What is your favourite colour ?</tspan></text>
+    <path
+       style="opacity:1;fill:#841919;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       d="M 493.125,146.28125 C 490.82987,146.28125 488.96875,148.14237 488.96875,150.4375 C 488.96875,152.73263 490.82987,154.59375 493.125,154.59375 C 495.42013,154.59375 497.28125,152.73263 497.28125,150.4375 C 497.28125,148.14237 495.42013,146.28125 493.125,146.28125 z M 491.51535,147.7948 L 496.04661,150.37411 L 491.63548,153.08817 L 491.51535,147.7948 z"
+       id="path5401"
+       inkscape:export-filename="/home/gburri/projets/euphorik/img/css1/extraction.png"
+       inkscape:export-xdpi="138.63892"
+       inkscape:export-ydpi="138.63892"
+       sodipodi:nodetypes="csssccccc" />
+    <path
+       style="opacity:1;fill:#cb2626;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.20000000000000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+       d="M 493.125,159.46845 C 490.82987,159.46845 488.96875,161.32957 488.96875,163.6247 C 488.96875,165.91983 490.82987,167.78095 493.125,167.78095 C 495.42013,167.78095 497.28125,165.91983 497.28125,163.6247 C 497.28125,161.32957 495.42013,159.46845 493.125,159.46845 z M 491.51535,160.982 L 496.04661,163.56131 L 491.63548,166.27537 L 491.51535,160.982 z"
+       id="path3227"
+       inkscape:export-filename="/home/gburri/projets/euphorik/img/css1/extraction_hover.png"
+       inkscape:export-xdpi="138.63892"
+       inkscape:export-ydpi="138.63892"
+       sodipodi:nodetypes="csssccccc" />
+    <path
+       style="opacity:1;fill:#841919;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+       d="M 493.125,172.43822 C 490.82987,172.43822 488.96875,174.29934 488.96875,176.59447 C 488.96875,178.8896 490.82987,180.75072 493.125,180.75072 C 495.42013,180.75072 497.28125,178.8896 497.28125,176.59447 C 497.28125,174.29934 495.42013,172.43822 493.125,172.43822 z M 491.51535,173.95177 L 496.04661,176.53108 L 491.63548,179.24514 L 491.51535,173.95177 z"
+       id="path3229"
+       inkscape:export-filename="/home/gburri/projets/euphorik/img/css1/extraction.png"
+       inkscape:export-xdpi="138.63892"
+       inkscape:export-ydpi="138.63892"
+       sodipodi:nodetypes="csssccccc" />
+    <path
+       style="opacity:1;fill:#841919;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+       d="M 514.87895,145.66173 C 512.58382,145.66173 510.7227,147.52285 510.7227,149.81798 C 510.7227,152.11311 512.58382,153.97423 514.87895,153.97423 C 517.17408,153.97423 519.0352,152.11311 519.0352,149.81798 C 519.0352,147.52285 517.17408,145.66173 514.87895,145.66173 z M 513.2693,147.17528 L 517.80056,149.75459 L 513.38943,152.46865 L 513.2693,147.17528 z"
+       id="path3233"
+       inkscape:export-filename="/home/gburri/projets/euphorik/img/css1/extraction.png"
+       inkscape:export-xdpi="138.63892"
+       inkscape:export-ydpi="138.63892"
+       sodipodi:nodetypes="csssccccc" />
+    <path
+       style="opacity:1;fill:#cb2626;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+       d="M 514.87895,158.43911 C 512.58382,158.43911 510.7227,160.30023 510.7227,162.59536 C 510.7227,164.89049 512.58382,166.75161 514.87895,166.75161 C 517.17408,166.75161 519.0352,164.89049 519.0352,162.59536 C 519.0352,160.30023 517.17408,158.43911 514.87895,158.43911 z M 513.2693,159.95266 L 517.80056,162.53197 L 513.38943,165.24603 L 513.2693,159.95266 z"
+       id="path3235"
+       inkscape:export-filename="/home/gburri/projets/euphorik/img/css1/extraction_hover.png"
+       inkscape:export-xdpi="138.63892"
+       inkscape:export-ydpi="138.63892"
+       sodipodi:nodetypes="csssccccc" />
+    <path
+       style="opacity:1;fill:#841919;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+       d="M 528.46632,145.66173 C 526.17117,145.66174 524.31007,147.52285 524.31007,149.81798 C 524.31005,152.11312 526.17119,153.97423 528.46632,153.97423 C 530.76143,153.97424 532.62257,152.11311 532.62257,149.81798 C 532.62255,147.52286 530.76145,145.66173 528.46632,145.66173 z M 527.06007,147.19298 L 528.46632,148.56798 L 529.87257,147.19298 L 531.12257,148.44298 L 529.71632,149.81798 L 531.12257,151.22423 L 529.87257,152.47423 L 528.46632,151.09923 L 527.06007,152.47423 L 525.81007,151.22423 L 527.21632,149.81798 L 525.81007,148.44298 L 527.06007,147.19298 z"
+       id="path3237"
+       inkscape:export-filename="/home/gburri/projets/euphorik/img/css1/fermer_conv.png"
+       inkscape:export-xdpi="140.75188"
+       inkscape:export-ydpi="140.75188" />
+    <path
+       style="opacity:1;fill:#cb2626;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.20000000000000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+       d="M 528.46632,158.43911 C 526.17117,158.43912 524.31007,160.30023 524.31007,162.59536 C 524.31005,164.8905 526.17119,166.75161 528.46632,166.75161 C 530.76143,166.75162 532.62257,164.89049 532.62257,162.59536 C 532.62255,160.30024 530.76145,158.43911 528.46632,158.43911 z M 527.06007,159.97036 L 528.46632,161.34536 L 529.87257,159.97036 L 531.12257,161.22036 L 529.71632,162.59536 L 531.12257,164.00161 L 529.87257,165.25161 L 528.46632,163.87661 L 527.06007,165.25161 L 525.81007,164.00161 L 527.21632,162.59536 L 525.81007,161.22036 L 527.06007,159.97036 z"
+       id="path3251"
+       inkscape:export-filename="/home/gburri/projets/euphorik/img/css1/fermer_conv_hover.png"
+       inkscape:export-xdpi="140.75"
+       inkscape:export-ydpi="140.75" />
+    <path
+       style="fill:#841919;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;display:inline"
+       d="M 553.40412,143.03283 L 558.26548,149.47435 L 553.40412,155.65071 L 553.40412,143.03283 z"
+       id="path3231"
+       sodipodi:nodetypes="cccc"
+       inkscape:export-filename="/home/gburri/projets/euphorik/img/css1/fleche.png"
+       inkscape:export-xdpi="128.38945"
+       inkscape:export-ydpi="128.38945" />
+    <path
+       style="fill:#cb2626;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;display:inline"
+       d="M 553.19826,159.09062 L 558.05962,165.53214 L 553.19826,171.7085 L 553.19826,159.09062 z"
+       id="path3254"
+       sodipodi:nodetypes="cccc"
+       inkscape:export-filename="/home/gburri/projets/euphorik/img/css1/fleche_reponda.png"
+       inkscape:export-xdpi="128.38945"
+       inkscape:export-ydpi="128.38945" />
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="616.72571"
+       y="19.753452"
+       id="text3256"><tspan
+         sodipodi:role="line"
+         id="tspan3258"
+         x="616.72571"
+         y="19.753452">dpi : 138.64</tspan></text>
+    <path
+       style="opacity:1;fill:#841919;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+       d="M 540.5625 145.8125 C 538.26737 145.81251 536.40625 147.67362 536.40625 149.96875 C 536.40625 152.26389 538.26737 154.125 540.5625 154.125 C 542.85763 154.12501 544.71875 152.26388 544.71875 149.96875 C 544.71875 147.67363 542.85763 145.8125 540.5625 145.8125 z M 540.59375 146.15625 L 541.5625 148.625 L 544.21875 148.8125 L 542.15625 150.5 L 542.8125 153.0625 L 540.59375 151.65625 L 538.34375 153.0625 L 539 150.5 L 536.9375 148.8125 L 539.59375 148.625 L 540.59375 146.15625 z "
+       id="path3260"
+       inkscape:export-filename="/home/gburri/projets/euphorik/doc/graphiques/copier_conv.png"
+       inkscape:export-xdpi="138.64"
+       inkscape:export-ydpi="138.64" />
+    <path
+       style="opacity:1;fill:#cb2626;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.20000000000000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+       d="M 540.20087,159.15964 C 537.90574,159.15965 536.04462,161.02076 536.04462,163.31589 C 536.04462,165.61103 537.90574,167.47214 540.20087,167.47214 C 542.496,167.47215 544.35712,165.61102 544.35712,163.31589 C 544.35712,161.02077 542.496,159.15964 540.20087,159.15964 z M 540.23212,159.50339 L 541.20087,161.97214 L 543.85712,162.15964 L 541.79462,163.84714 L 542.45087,166.40964 L 540.23212,165.00339 L 537.98212,166.40964 L 538.63837,163.84714 L 536.57587,162.15964 L 539.23212,161.97214 L 540.23212,159.50339 z"
+       id="path3274"
+       inkscape:export-filename="/home/gburri/projets/euphorik/doc/graphiques/copier_conv_hover.png"
+       inkscape:export-xdpi="138.64"
+       inkscape:export-ydpi="138.64" />
+    <path
+       style="fill:#31732f;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;display:inline"
+       d="M 561.84882,143.03283 L 566.71018,149.47435 L 561.84882,155.65071 L 561.84882,143.03283 z"
+       id="path3464"
+       sodipodi:nodetypes="cccc"
+       inkscape:export-filename="/home/gburri/projets/euphorik/img/css1/fleche_reponse.png"
+       inkscape:export-xdpi="128.38945"
+       inkscape:export-ydpi="128.38945" />
+    <path
+       style="fill:#bf2911;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;display:inline"
+       d="M 570.29345,143.03283 L 575.15481,149.47435 L 570.29345,155.65071 L 570.29345,143.03283 z"
+       id="path3466"
+       sodipodi:nodetypes="cccc"
+       inkscape:export-filename="/home/gburri/projets/euphorik/img/css1/fleche_proprietaire.png"
+       inkscape:export-xdpi="128.38945"
+       inkscape:export-ydpi="128.38945" />
+    <path
+       style="fill:#84196c;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;display:inline"
+       d="M 578.73815,143.03283 L 583.59951,149.47435 L 578.73815,155.65071 L 578.73815,143.03283 z"
+       id="path3468"
+       sodipodi:nodetypes="cccc"
+       inkscape:export-filename="/home/gburri/projets/euphorik/img/css1/fleche_repondu.png"
+       inkscape:export-xdpi="128.38945"
+       inkscape:export-ydpi="128.38945" />
+  </g>
+  <g
+     inkscape:groupmode="layer"
+     id="layer2"
+     inkscape:label="logo"
+     style="display:inline">
+    <rect
+       style="fill:#841919;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+       id="rect3224"
+       width="453.71909"
+       height="20.843534"
+       x="46.525745"
+       y="82.616722"
+       inkscape:export-filename="/home/gburri/projets/euphorik/doc/graphiques/logo_brut2.png"
+       inkscape:export-xdpi="138.63892"
+       inkscape:export-ydpi="138.63892" />
+    <path
+       style="opacity:0.75;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline;filter:url(#filter5374)"
+       d="M 87.929756,36.448593 C 70.696656,36.448593 56.136941,47.968757 51.554756,63.729843 L 46.617256,63.729843 L 46.617256,82.823589 L 51.023506,82.823589 C 54.891953,99.630647 69.953686,112.16733 87.929756,112.16733 C 105.90583,112.16733 120.93631,99.630647 124.80476,82.823589 L 500.71101,82.823589 L 500.71101,63.729843 L 124.27351,63.729843 C 119.69133,47.968757 105.16286,36.448592 87.929756,36.448593 z"
+       id="path5267"
+       inkscape:export-filename="/home/gburri/projets/euphorik/doc/graphiques/logo_brut.png"
+       inkscape:export-xdpi="138.63892"
+       inkscape:export-ydpi="138.63892" />
+    <path
+       sodipodi:type="arc"
+       style="fill:#f6dfc2;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+       id="path2407"
+       sodipodi:cx="332.84528"
+       sodipodi:cy="399.29855"
+       sodipodi:rx="131.82491"
+       sodipodi:ry="131.82491"
+       d="M 464.67018,399.29855 A 131.82491,131.82491 0 1 1 201.02037,399.29855 A 131.82491,131.82491 0 1 1 464.67018,399.29855 z"
+       inkscape:export-filename="/home/gburri/projets/euphorik/doc/graphiques/logo_brut.png"
+       inkscape:export-xdpi="138.63892"
+       inkscape:export-ydpi="138.63892"
+       transform="matrix(0.2872886,0,0,0.2872886,-7.7117438,-40.627481)" />
+    <rect
+       style="fill:#f6dfc2;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+       id="rect3462"
+       width="454.09647"
+       height="19.081215"
+       x="46.615898"
+       y="63.504051"
+       inkscape:export-filename="/home/gburri/projets/euphorik/doc/graphiques/logo_brut.png"
+       inkscape:export-xdpi="138.63892"
+       inkscape:export-ydpi="138.63892" />
+    <path
+       style="fill:#841919;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.51327449;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+       d="M 88.431816,40.254007 C 69.803625,40.166276 54.045002,54.16218 54.129835,75.22051 C 54.068954,91.274344 68.315564,108.10722 88.431816,107.91672 C 89.549813,107.91672 90.095216,107.88452 91.602061,107.7065 C 91.569653,103.93148 91.348366,91.115934 91.413181,87.162485 C 97.635009,91.828858 101.04085,94.097739 109.07738,100.44919 C 112.18829,97.868223 115.29373,94.591662 117.34476,90.7302 C 112.15991,87.360044 105.10581,81.72326 94.21761,73.68674 C 101.21717,66.557554 108.27196,59.995273 114.88264,53.643826 C 112.57171,50.906043 109.37619,47.542256 106.31623,45.699518 C 101.64986,50.106655 98.437833,52.770497 91.413181,59.441256 C 91.44732,54.651308 91.626799,44.013425 91.602061,40.511312 C 90.556557,40.322656 89.622719,40.270207 88.431816,40.254007 z M 79.801333,51.351275 C 79.779096,59.441488 79.924702,62.872417 79.801333,68.719324 C 74.553306,68.625903 71.396213,68.731631 64.915137,68.602009 C 65.721614,58.462795 72.73505,52.397459 79.801333,51.351275 z M 79.801333,80.324934 C 79.833045,85.530259 79.870744,89.328594 79.984647,96.135618 C 73.101686,95.143127 65.177362,88.021089 64.838379,80.002996 C 68.889043,79.921982 74.6941,80.096459 79.801333,80.324934 z"
+       id="path2383"
+       sodipodi:nodetypes="ccccccccccccccccccccc"
+       inkscape:export-xdpi="138.63892"
+       inkscape:export-ydpi="138.63892"
+       inkscape:export-filename="/home/gburri/projets/euphorik/doc/graphiques/logo_brut.png" />
+    <text
+       xml:space="preserve"
+       style="font-size:28px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#841919;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline;font-family:cmmi10;-inkscape-font-specification:cmmi10"
+       x="131.22978"
+       y="79.663078"
+       id="text3438"
+       sodipodi:linespacing="125%"
+       inkscape:export-filename="/home/gburri/projets/euphorik/doc/graphiques/logo_brut.png"
+       inkscape:export-xdpi="138.63892"
+       inkscape:export-ydpi="138.63892"><tspan
+         sodipodi:role="line"
+         id="tspan5392"
+         x="131.22978"
+         y="79.663078">euphorik</tspan><tspan
+         sodipodi:role="line"
+         id="tspan5394"
+         x="131.22978"
+         y="114.66308" /></text>
+    <rect
+       style="opacity:1;fill:#e19671;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.93000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="rect3280"
+       width="36.5"
+       height="36.5"
+       x="524.58624"
+       y="79.890785"
+       inkscape:export-filename="/tmp/euphorik.png"
+       inkscape:export-xdpi="493.1507"
+       inkscape:export-ydpi="493.1507" />
+    <path
+       sodipodi:type="arc"
+       style="fill:#f6dfc2;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+       id="path3276"
+       sodipodi:cx="332.84528"
+       sodipodi:cy="399.29855"
+       sodipodi:rx="131.82491"
+       sodipodi:ry="131.82491"
+       d="M 464.67018,399.29855 A 131.82491,131.82491 0 1 1 201.02037,399.29855 A 131.82491,131.82491 0 1 1 464.67018,399.29855 z"
+       inkscape:export-filename="/tmp/euphorik.png"
+       inkscape:export-xdpi="493.1507"
+       inkscape:export-ydpi="493.1507"
+       transform="matrix(0.1293766,0,0,0.1293766,499.77383,46.480892)" />
+    <path
+       style="fill:#841919;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.51327449;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+       d="M 543.07082,82.904806 C 534.68186,82.865297 527.58517,89.168168 527.62338,98.651509 C 527.59596,105.88114 534.01173,113.46161 543.07082,113.37582 C 543.5743,113.37582 543.81991,113.36132 544.4985,113.28115 C 544.4839,111.58112 544.38425,105.80981 544.41344,104.02942 C 547.21536,106.13086 548.74914,107.15262 552.36828,110.01292 C 553.76924,108.85061 555.16773,107.37506 556.09139,105.6361 C 553.75646,104.11839 550.57974,101.57994 545.67638,97.960799 C 548.82854,94.750259 552.00557,91.795025 554.9826,88.934735 C 553.94191,87.70181 552.50285,86.186973 551.12483,85.35712 C 549.02339,87.341816 547.5769,88.541442 544.41344,91.545531 C 544.42881,89.388441 544.50964,84.59781 544.4985,83.02068 C 544.02767,82.935721 543.60713,82.912101 543.07082,82.904806 z M 539.1842,87.902314 C 539.17418,91.545635 539.23976,93.090709 539.1842,95.723789 C 536.82082,95.681719 535.39906,95.729329 532.48039,95.670959 C 532.84358,91.104894 536.00199,88.37345 539.1842,87.902314 z M 539.1842,100.95022 C 539.19848,103.29437 539.21546,105.0049 539.26675,108.07036 C 536.1671,107.6234 532.59848,104.41608 532.44583,100.80524 C 534.26999,100.76876 536.88422,100.84733 539.1842,100.95022 z"
+       id="path3278"
+       sodipodi:nodetypes="ccccccccccccccccccccc"
+       inkscape:export-xdpi="493.1507"
+       inkscape:export-ydpi="493.1507"
+       inkscape:export-filename="/tmp/euphorik.png" />
+  </g>
+  <g
+     inkscape:groupmode="layer"
+     id="layer3"
+     inkscape:label="menu"
+     style="display:inline">
+    <rect
+       style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+       id="rect5408"
+       width="33.23402"
+       height="19.003494"
+       x="278.95361"
+       y="63.561737"
+       inkscape:export-filename="/home/gburri/projets/euphorik/doc/graphiques/logo_brut2.png"
+       inkscape:export-xdpi="138.63892"
+       inkscape:export-ydpi="138.63892" />
+    <text
+       xml:space="preserve"
+       style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline;font-family:Standard Symbols L;-inkscape-font-specification:Standard Symbols L"
+       x="284.48007"
+       y="75.487816"
+       id="text3197"
+       sodipodi:linespacing="125%"
+       inkscape:export-filename="/home/gburri/projets/euphorik/doc/graphiques/logo_brut2.png"
+       inkscape:export-xdpi="138.63892"
+       inkscape:export-ydpi="138.63892"><tspan
+         sodipodi:role="line"
+         id="tspan3199"
+         x="284.48007"
+         y="75.487816">chat</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline;font-family:Standard Symbols L;-inkscape-font-specification:Standard Symbols L"
+       x="324.82281"
+       y="75.487816"
+       id="text3201"
+       sodipodi:linespacing="125%"
+       inkscape:export-filename="/home/gburri/projets/euphorik/doc/graphiques/logo_brut2.png"
+       inkscape:export-xdpi="138.63892"
+       inkscape:export-ydpi="138.63892"><tspan
+         sodipodi:role="line"
+         id="tspan3203"
+         x="324.82281"
+         y="75.487816">profile</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline;font-family:Standard Symbols L;-inkscape-font-specification:Standard Symbols L"
+       x="380.86096"
+       y="75.487816"
+       id="text3205"
+       sodipodi:linespacing="125%"
+       inkscape:export-filename="/home/gburri/projets/euphorik/doc/graphiques/logo_brut2.png"
+       inkscape:export-xdpi="138.63892"
+       inkscape:export-ydpi="138.63892"><tspan
+         sodipodi:role="line"
+         id="tspan3207"
+         x="380.86096"
+         y="75.487816">about</tspan></text>
+    <path
+       style="fill:#510f0f;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;display:inline"
+       d="M 294.62095,77.596161 L 300.14691,82.88847 L 288.83185,82.88847 L 294.62095,77.596161 z"
+       id="rect3221"
+       sodipodi:nodetypes="cccc"
+       inkscape:export-filename="/home/gburri/projets/euphorik/doc/graphiques/logo_brut2.png"
+       inkscape:export-xdpi="138.63892"
+       inkscape:export-ydpi="138.63892" />
+    <text
+       xml:space="preserve"
+       style="font-size:9px;font-style:italic;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline;font-family:Standard Symbols L;-inkscape-font-specification:Standard Symbols L Italic"
+       x="132.93362"
+       y="96.410347"
+       id="text3466"
+       sodipodi:linespacing="125%"
+       inkscape:export-filename="/home/gburri/projets/euphorik/doc/graphiques/logo_brut2.png"
+       inkscape:export-xdpi="138.63892"
+       inkscape:export-ydpi="138.63892"><tspan
+         sodipodi:role="line"
+         id="tspan3468"
+         x="132.93362"
+         y="96.410347">troll de la semaine :</tspan></text>
+    <rect
+       style="opacity:1;fill:#f6dfc2;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.8172037;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="rect3222"
+       width="89.202576"
+       height="47.277973"
+       x="304.47925"
+       y="110.74908" />
+    <rect
+       style="opacity:1;fill:#df5050;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.93000001000000021;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="rect3225"
+       width="129.26752"
+       height="124.60923"
+       x="184.00241"
+       y="111.9701" />
+  </g>
+</svg>
diff --git a/doc/graphiques/old.xcf b/doc/graphiques/old.xcf
new file mode 100755 (executable)
index 0000000..ac44d56
Binary files /dev/null and b/doc/graphiques/old.xcf differ
diff --git a/doc/graphiques/old_piedpage.xcf b/doc/graphiques/old_piedpage.xcf
new file mode 100755 (executable)
index 0000000..9975be0
Binary files /dev/null and b/doc/graphiques/old_piedpage.xcf differ
diff --git a/doc/graphiques/path2383.png b/doc/graphiques/path2383.png
new file mode 100644 (file)
index 0000000..6313230
Binary files /dev/null and b/doc/graphiques/path2383.png differ
diff --git a/doc/graphiques/return.xcf b/doc/graphiques/return.xcf
new file mode 100755 (executable)
index 0000000..086db3a
Binary files /dev/null and b/doc/graphiques/return.xcf differ
diff --git a/doc/installation.txt b/doc/installation.txt
new file mode 100644 (file)
index 0000000..4f71285
--- /dev/null
@@ -0,0 +1,79 @@
+-- Description de l'installation de Euphorik --\r
+\r
+Voici les différentes étapes décrivant l'installation du site euphorik. Certaines données sont a adaptées en fonction des besoins. L'installation est décrite pour le système d'exploitation Debian.\r
+\r
+* On admet que le dossier de base est "/euphorik".\r
+* On admet que l'utilisateur courant est "toto" et qu'il possède "/euphorik"\r
+* Tout ce qui commence par un '$' correspond à une ligne de commande tapée dans le shell de l'OS.\r
+* Tout ce qui commence par un '>' correspond à une instruction dans le shell de erlang.\r
+\r
+\r
+1. Installer Yaws\r
+   a) $apt-get install yaws\r
+\r
+2. Configurer Yaws\r
+   a) Ajouter les lignes suivantes dans /etc/yaws/yaws.conf :\r
+      - "ebin_dir = /euphorik/modules/ebin"\r
+      - "include_dir = /euphorik/modules/include"\r
+   b) Le serveur virtuel est définit comme ceci dans /etc/yaws/conf.d/localhost.conf :\r
+      <server localhost>\r
+         port = 8081\r
+         listen = 0.0.0.0\r
+         docroot = /euphorik\r
+         allowed_scripts = [yaws]\r
+         appmods = <request, euphorik_requests>
+         start_mod = euphorik_daemon\r
+      </server>\r
+   c) Editer '/etc/init.d/yaws' et remplacer cette ligne :\r
+      script="$DAEMON -I $YAWS_ID $@"\r
+      par celle ci :\r
+      script="$DAEMON --sname yaws --mnesiadir \"/euphorik/BD\" -I $YAWS_ID $@"\r
+      FIXME : trouver une méthode plus élégante.\r
+\r
+3. Créer la base de donnée\r
+   a) Arreter Yaws (en root) :\r
+      $/etc/init.s/yaws stop\r
+   b) Lancer un noeud Erlang\r
+      - Se placer dans le répertoire /euphorik/modules/ebin\r
+      - Executer : \r
+         $erl -sname yaws -mnesia dir '"/euphorik/BD"'\r
+   c) Charger le module :\r
+      >l(euphorik_bd).\r
+   d) Créer la base :\r
+      >euphorik_bd:create().\r
+   e) Démarrer Yaws (en root) :\r
+      $/etc/init.s/yaws start\r
+   \r
+4. Adminisatration du site Euphorik\r
+   a) Connexion au noeud "yaws"\r
+         erl -sname gb\r
+      puis dans la console :\r
+         CTRL-G\r
+         r yaws@overnux\r
+         c 2\r
+      Pour plus d'infos : http://www.ejabberd.im/interconnect-erl-nodes\r
+      Il est possible de connecter un shell directement sur le noeud de yaws comme ceci :\r
+         erl -sname gb -remsh yaws@overnux\r
+      \r
+   b) Utiliser les outils des modules\r
+      - Par exemple :\r
+         >euphorik_minichat:messages(10).\r
+         pour voir les 10 derniers messages   \r
+      \r
+   c) Ancienne méthode de connexion (plus compliqué)\r
+      - Le cookie de Yaws (/var/run/yaws/.erlang.cookie ou /var/cache/yaws/.erlang.cookie) et celui de l'utilisateur courant (~/.erlang.cookie) doit être le même.\r
+         (si le cookie de yaws est modifié il faut relancer yaws).\r
+      - Se placer dans le répertoire /euphorik/modules/ebin\r
+      - Executer : \r
+         $erl -sname toto\r
+         où "toto" est le nom du noeud (tout sauf "yaws")\r
+      - Charger le module du minichat :\r
+         >l(euphorik_minichat)\r
+      - Se connecter au noeud yaws :\r
+         >euphorik_minichat:connect()\r
+         la valeur retournée doit être : {ok,[yaws@overnux]}\r
+         \r
+   d) Informations sur la mémoire consommée :\r
+      Mémoire totale (ko) :\r
+          trunc(element(2, lists:nth(1, memory())) / 1024).\r
+      voir c:i() également\r
diff --git a/doc/profiling/JavaScript Profile Data 2008-04-15.html b/doc/profiling/JavaScript Profile Data 2008-04-15.html
new file mode 100644 (file)
index 0000000..83ed63c
--- /dev/null
@@ -0,0 +1,2199 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><title>JavaScript Profile Data</title>
+
+  
+    
+  <style>
+    .profile-file-title {
+        font-size  : larger;
+        font-weight: bold;
+    }
+
+    .label {
+        font-weight: bold;
+        color: darkred;
+    }
+
+    .value {
+        color: grey;
+    }
+
+    .graph-box {
+        border        : 1px grey solid;
+        margin-top    : 5px;
+        margin-bottom : 5px;
+        padding-top   : 5px;
+        padding-bottom: 5px;
+        background    : lightgrey;
+        display       : block;
+    }
+    
+    .graph-body {
+        margin-left: 3%;
+        background : white;
+        display    : block;
+        width      : 94%;
+        border     : 1px black solid;
+    }
+
+    .graph-title {
+        display    : block;
+        margin-left: 3%;
+    }
+
+    .left-trough,
+    .below-avg-trough,
+    .above-avg-trough {
+        border : 0px black solid;
+        margin : 0px;
+        padding: 0px;
+        height : 20px;
+    }
+
+    .below-avg-trough {
+        border-right: 1px slategrey solid;
+        border-left : 1px black solid;
+        background  : darkslategrey;
+    }
+
+    .above-avg-trough {
+        border-left : 1px slategrey solid;
+        border-right: 1px black solid;
+        background  : darkslategrey;
+    }
+  </style></head><body>
+    <h1>JavaScript Profile Data</h1>
+    <span class="label">Collection Date:</span>
+    <span class="value">Wed Apr 16 2008 01:35:42 GMT+0200 (CEST)</span><br>
+    <span class="label">User Agent:</span>
+    <span class="value">Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.13) Gecko/20080311 Iceweasel/2.0.0.13 (Debian-2.0.0.13-1)</span><br>
+    <span class="label">JavaScript Debugger Version:</span>
+    <span class="value">Venkman 0.9.87.3 [Mozilla rv:1.8.1.13/2]</span><br>
+    <span class="label">Sorted By:</span>
+    <span class="value">total</span><br>
+    <a name="section0"></a>
+    <hr>
+    <span class="section-box">
+      <a name="section0"></a>
+      <h2 class="section-title"><a class="section-link" href="chrome://global/content/bindings/browser.xml">chrome://global/content/bindings/browser.xml</a></h2>
+      <a name="range0:0"></a>
+      <span class="range-box">
+        <a name="range0:0"></a>
+        <h3>0.09 - 0.25 ms</h3>
+        [ <a href="#section0">Previous File</a> |
+        <a href="#section1">Next File</a> |
+        <a href="#range0:0">Previous Range</a> |
+        <a href="#range0:1">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item0:1:0"></a>
+            <a href="#item0:1:0">0</a>
+            <a class="graph-filename" href="chrome://global/content/bindings/browser.xml">chrome://global/content/bindings/browser.xml</a><br>
+            <span class="graph-summary">onxblmouseup:
+889-895, 1 call(s), 0.09ms total, 0.09ms min, 0.09ms max, 0.09ms avg,
+excluding calls: 0.09ms total, 0.09ms min, 0.09ms max, 0.09ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="32%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item0:1:1"></a>
+            <a href="#item0:1:1">1</a>
+            <a class="graph-filename" href="chrome://global/content/bindings/browser.xml">chrome://global/content/bindings/browser.xml</a><br>
+            <span class="graph-summary">onxblmousedown:
+897-916, 1 call(s), 0.05ms total, 0.05ms min, 0.05ms max, 0.05ms avg,
+excluding calls: 0.05ms total, 0.05ms min, 0.05ms max, 0.05ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="18%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+      </span>
+      <br>
+    </span>
+    <hr>
+    <span class="section-box">
+      <a name="section1"></a>
+      <h2 class="section-title"><a class="section-link" href="chrome://global/content/bindings/button.xml">chrome://global/content/bindings/button.xml</a></h2>
+      <a name="range1:0"></a>
+      <span class="range-box">
+        <a name="range1:0"></a>
+        <h3>0.14 - 0.25 ms</h3>
+        [ <a href="#section0">Previous File</a> |
+        <a href="#section2">Next File</a> |
+        <a href="#range1:0">Previous Range</a> |
+        <a href="#range1:1">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item1:1:0"></a>
+            <a href="#item1:1:0">0</a>
+            <a class="graph-filename" href="chrome://global/content/bindings/button.xml">chrome://global/content/bindings/button.xml</a><br>
+            <span class="graph-summary">onxblcommand:
+127-134, 1 call(s), 0.14ms total, 0.14ms min, 0.14ms max, 0.14ms avg,
+excluding calls: 0.14ms total, 0.14ms min, 0.14ms max, 0.14ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="50%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+      </span>
+      <br>
+    </span>
+    <hr>
+    <span class="section-box">
+      <a name="section2"></a>
+      <h2 class="section-title"><a class="section-link" href="file:///usr/lib/iceweasel/components/nsMicrosummaryService.js">file:/usr/lib/iceweasel/components/nsMicrosummaryService.js</a></h2>
+      <a name="range2:0"></a>
+      <span class="range-box">
+        <a name="range2:0"></a>
+        <h3>0.5 - 0.75 ms</h3>
+        [ <a href="#section1">Previous File</a> |
+        <a href="#section3">Next File</a> |
+        <a href="#range2:0">Previous Range</a> |
+        <a href="#range2:1">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item2:1:0"></a>
+            <a href="#item2:1:0">0</a>
+            <a class="graph-filename" href="file:///usr/lib/iceweasel/components/nsMicrosummaryService.js">file:/usr/lib/iceweasel/components/nsMicrosummaryService.js</a><br>
+            <span class="graph-summary">anonymous:
+205-206, 2 call(s), 0.65ms total, 0.22ms min, 0.43ms max, 0.32ms avg,
+excluding calls: 0.02ms total, 0.01ms min, 0.01ms max, 0.01ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="26%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="12%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="13%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item2:1:1"></a>
+            <a href="#item2:1:1">1</a>
+            <a class="graph-filename" href="file:///usr/lib/iceweasel/components/nsMicrosummaryService.js">file:/usr/lib/iceweasel/components/nsMicrosummaryService.js</a><br>
+            <span class="graph-summary">MSS__updateMicrosummaries:
+219-244, 2 call(s), 0.62ms total, 0.21ms min, 0.42ms max, 0.31ms avg,
+excluding calls: 0.05ms total, 0.02ms min, 0.03ms max, 0.02ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="25%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="12%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="13%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range2:1"></a>
+        <h3>0.25 - 0.5 ms</h3>
+        [ <a href="#section1">Previous File</a> |
+        <a href="#section3">Next File</a> |
+        <a href="#range2:0">Previous Range</a> |
+        <a href="#range2:2">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item2:2:2"></a>
+            <a href="#item2:2:2">2</a>
+            <a class="graph-filename" href="file:///usr/lib/iceweasel/components/nsMicrosummaryService.js">file:/usr/lib/iceweasel/components/nsMicrosummaryService.js</a><br>
+            <span class="graph-summary">MSS__getBookmarks:
+606-626, 2 call(s), 0.4ms total, 0.14ms min, 0.26ms max, 0.2ms avg,
+excluding calls: 0.21ms total, 0.07ms min, 0.14ms max, 0.11ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="25%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="10%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="10%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range2:2"></a>
+        <h3>0.18 - 0.25 ms</h3>
+        [ <a href="#section1">Previous File</a> |
+        <a href="#section3">Next File</a> |
+        <a href="#range2:1">Previous Range</a> |
+        <a href="#range2:3">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item2:3:3"></a>
+            <a href="#item2:3:3">3</a>
+            <a class="graph-filename" href="file:///usr/lib/iceweasel/components/nsMicrosummaryService.js">file:/usr/lib/iceweasel/components/nsMicrosummaryService.js</a><br>
+            <span class="graph-summary">anonymous:
+159-164, 2 call(s), 0.18ms total, 0.06ms min, 0.13ms max, 0.09ms avg,
+excluding calls: 0.03ms total, 0.01ms min, 0.02ms max, 0.01ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="21%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="10%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="14%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item2:3:4"></a>
+            <a href="#item2:3:4">4</a>
+            <a class="graph-filename" href="file:///usr/lib/iceweasel/components/nsMicrosummaryService.js">file:/usr/lib/iceweasel/components/nsMicrosummaryService.js</a><br>
+            <span class="graph-summary">MSS__resource:
+134-136, 4 call(s), 0.18ms total, 0.02ms min, 0.07ms max, 0.04ms avg,
+excluding calls: 0.16ms total, 0.02ms min, 0.07ms max, 0.04ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="7%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="7%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="10%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item2:3:5"></a>
+            <a href="#item2:3:5">5</a>
+            <a class="graph-filename" href="file:///usr/lib/iceweasel/components/nsMicrosummaryService.js">file:/usr/lib/iceweasel/components/nsMicrosummaryService.js</a><br>
+            <span class="graph-summary">getPref:
+2233-2247, 2 call(s), 0.16ms total, 0.05ms min, 0.11ms max, 0.08ms avg,
+excluding calls: 0.16ms total, 0.05ms min, 0.11ms max, 0.08ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="18%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="10%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="10%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item2:3:6"></a>
+            <a href="#item2:3:6">6</a>
+            <a class="graph-filename" href="file:///usr/lib/iceweasel/components/nsMicrosummaryService.js">file:/usr/lib/iceweasel/components/nsMicrosummaryService.js</a><br>
+            <span class="graph-summary">anonymous:
+84-88, 2 call(s), 0.01ms total, 0ms min, 0.01ms max, 0ms avg, excluding
+calls: 0.01ms total, 0ms min, 0.01ms max, 0ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="3%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item2:3:7"></a>
+            <a href="#item2:3:7">7</a>
+            <a class="graph-filename" href="file:///usr/lib/iceweasel/components/nsMicrosummaryService.js">file:/usr/lib/iceweasel/components/nsMicrosummaryService.js</a><br>
+            <span class="graph-summary">anonymous:
+75-80, 4 call(s), 0.01ms total, 0ms min, 0.01ms max, 0ms avg, excluding
+calls: 0.01ms total, 0ms min, 0.01ms max, 0ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="3%">
+          </span>
+        </span>
+      </span>
+      <br>
+    </span>
+    <hr>
+    <span class="section-box">
+      <a name="section3"></a>
+      <h2 class="section-title"><a class="section-link" href="http://localhost:8080/js/euphorik.js">http://localhost:8080/js/euphorik.js</a></h2>
+      <a name="range3:0"></a>
+      <span class="range-box">
+        <a name="range3:0"></a>
+        <h3>500 - 750 ms</h3>
+        [ <a href="#section2">Previous File</a> |
+        <a href="#section4">Next File</a> |
+        <a href="#range3:0">Previous Range</a> |
+        <a href="#range3:1">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item3:1:0"></a>
+            <a href="#item3:1:0">0</a>
+            <a class="graph-filename" href="http://localhost:8080/js/euphorik.js">http://localhost:8080/js/euphorik.js</a><br>
+            <span class="graph-summary">anonymous:
+821-843, 29 call(s), 668.35ms total, 5.23ms min, 146.36ms max, 23.05ms
+avg, excluding calls: 2.41ms total, 0.05ms min, 0.1ms max, 0.08ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="2%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="14%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range3:1"></a>
+        <h3>250 - 500 ms</h3>
+        [ <a href="#section2">Previous File</a> |
+        <a href="#section4">Next File</a> |
+        <a href="#range3:0">Previous Range</a> |
+        <a href="#range3:2">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item3:2:1"></a>
+            <a href="#item3:2:1">1</a>
+            <a class="graph-filename" href="http://localhost:8080/js/euphorik.js">http://localhost:8080/js/euphorik.js</a><br>
+            <span class="graph-summary">anonymous:
+464-479, 15 call(s), 412.6ms total, 14.67ms min, 146.37ms max, 27.51ms
+avg, excluding calls: 0.15ms total, 0.01ms min, 0.01ms max, 0.01ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="2%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="2%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="21%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item3:2:2"></a>
+            <a href="#item3:2:2">2</a>
+            <a class="graph-filename" href="http://localhost:8080/js/euphorik.js">http://localhost:8080/js/euphorik.js</a><br>
+            <span class="graph-summary">anonymous:
+451-457, 14 call(s), 256.03ms total, 5.24ms min, 21.69ms max, 18.29ms
+avg, excluding calls: 0.13ms total, 0.01ms min, 0.01ms max, 0.01ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="2%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range3:2"></a>
+        <h3>100 - 250 ms</h3>
+        [ <a href="#section2">Previous File</a> |
+        <a href="#section4">Next File</a> |
+        <a href="#range3:1">Previous Range</a> |
+        <a href="#range3:3">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item3:3:3"></a>
+            <a href="#item3:3:3">3</a>
+            <a class="graph-filename" href="http://localhost:8080/js/euphorik.js">http://localhost:8080/js/euphorik.js</a><br>
+            <span class="graph-summary">anonymous:
+301-303, 1538 call(s), 235.74ms total, 0.13ms min, 0.65ms max, 0.15ms
+avg, excluding calls: 18.14ms total, 0.01ms min, 0.03ms max, 0.01ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item3:3:4"></a>
+            <a href="#item3:3:4">4</a>
+            <a class="graph-filename" href="http://localhost:8080/js/euphorik.js">http://localhost:8080/js/euphorik.js</a><br>
+            <span class="graph-summary">anonymous:
+309-317, 1538 call(s), 185.68ms total, 0.1ms min, 0.62ms max, 0.12ms
+avg, excluding calls: 185.68ms total, 0.1ms min, 0.62ms max, 0.12ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range3:3"></a>
+        <h3>75 - 100 ms</h3>
+        [ <a href="#section2">Previous File</a> |
+        <a href="#section4">Next File</a> |
+        <a href="#range3:2">Previous Range</a> |
+        <a href="#range3:4">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item3:4:5"></a>
+            <a href="#item3:4:5">5</a>
+            <a class="graph-filename" href="http://localhost:8080/js/euphorik.js">http://localhost:8080/js/euphorik.js</a><br>
+            <span class="graph-summary">anonymous:
+586-634, 29 call(s), 80.97ms total, 0.97ms min, 4.52ms max, 2.79ms avg,
+excluding calls: 43.25ms total, 0.6ms min, 2.47ms max, 1.49ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="1%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="1%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range3:4"></a>
+        <h3>50 - 75 ms</h3>
+        [ <a href="#section2">Previous File</a> |
+        <a href="#section4">Next File</a> |
+        <a href="#range3:3">Previous Range</a> |
+        <a href="#range3:5">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item3:5:6"></a>
+            <a href="#item3:5:6">6</a>
+            <a class="graph-filename" href="http://localhost:8080/js/euphorik.js">http://localhost:8080/js/euphorik.js</a><br>
+            <span class="graph-summary">anonymous:
+129-150, 87 call(s), 64.45ms total, 0.24ms min, 2.81ms max, 0.74ms avg,
+excluding calls: 56.97ms total, 0.24ms min, 1.98ms max, 0.65ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="2%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range3:5"></a>
+        <h3>10 - 25 ms</h3>
+        [ <a href="#section2">Previous File</a> |
+        <a href="#section4">Next File</a> |
+        <a href="#range3:4">Previous Range</a> |
+        <a href="#range3:6">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item3:6:7"></a>
+            <a href="#item3:6:7">7</a>
+            <a class="graph-filename" href="http://localhost:8080/js/euphorik.js">http://localhost:8080/js/euphorik.js</a><br>
+            <span class="graph-summary">anonymous:
+325-340, 1538 call(s), 21.82ms total, 0.01ms min, 0.49ms max, 0.01ms
+avg, excluding calls: 21.82ms total, 0.01ms min, 0.49ms max, 0.01ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="1%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item3:6:8"></a>
+            <a href="#item3:6:8">8</a>
+            <a class="graph-filename" href="http://localhost:8080/js/euphorik.js">http://localhost:8080/js/euphorik.js</a><br>
+            <span class="graph-summary">anonymous:
+153-156, 87 call(s), 12.08ms total, 0.06ms min, 0.26ms max, 0.14ms avg,
+excluding calls: 1.7ms total, 0.01ms min, 0.05ms max, 0.02ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item3:6:9"></a>
+            <a href="#item3:6:9">9</a>
+            <a class="graph-filename" href="http://localhost:8080/js/euphorik.js">http://localhost:8080/js/euphorik.js</a><br>
+            <span class="graph-summary">anonymous:
+120-125, 87 call(s), 10.37ms total, 0.05ms min, 0.22ms max, 0.12ms avg,
+excluding calls: 10.37ms total, 0.05ms min, 0.22ms max, 0.12ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item3:6:10"></a>
+            <a href="#item3:6:10">10</a>
+            <a class="graph-filename" href="http://localhost:8080/js/euphorik.js">http://localhost:8080/js/euphorik.js</a><br>
+            <span class="graph-summary">anonymous:
+320-322, 1538 call(s), 10.09ms total, 0.01ms min, 0.02ms max, 0.01ms
+avg, excluding calls: 10.09ms total, 0.01ms min, 0.02ms max, 0.01ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range3:6"></a>
+        <h3>0.25 - 0.5 ms</h3>
+        [ <a href="#section2">Previous File</a> |
+        <a href="#section4">Next File</a> |
+        <a href="#range3:5">Previous Range</a> |
+        <a href="#range3:7">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item3:7:11"></a>
+            <a href="#item3:7:11">11</a>
+            <a class="graph-filename" href="http://localhost:8080/js/euphorik.js">http://localhost:8080/js/euphorik.js</a><br>
+            <span class="graph-summary">anonymous:
+662-664, 58 call(s), 0.3ms total, 0ms min, 0.01ms max, 0.01ms avg,
+excluding calls: 0.3ms total, 0ms min, 0.01ms max, 0.01ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="1%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range3:7"></a>
+        <h3>0.07 - 0.25 ms</h3>
+        [ <a href="#section2">Previous File</a> |
+        <a href="#section4">Next File</a> |
+        <a href="#range3:6">Previous Range</a> |
+        <a href="#range3:8">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item3:8:12"></a>
+            <a href="#item3:8:12">12</a>
+            <a class="graph-filename" href="http://localhost:8080/js/euphorik.js">http://localhost:8080/js/euphorik.js</a><br>
+            <span class="graph-summary">anonymous:
+836-837, 29 call(s), 0.07ms total, 0ms min, 0ms max, 0ms avg, excluding
+calls: 0.07ms total, 0ms min, 0ms max, 0ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+      </span>
+      <br>
+    </span>
+    <hr>
+    <span class="section-box">
+      <a name="section4"></a>
+      <h2 class="section-title"><a class="section-link" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a></h2>
+      <a name="range4:0"></a>
+      <span class="range-box">
+        <a name="range4:0"></a>
+        <h3>5000 - 1000000 ms</h3>
+        [ <a href="#section3">Previous File</a> |
+        <a href="#section5">Next File</a> |
+        <a href="#range4:0">Previous Range</a> |
+        <a href="#range4:1">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:1:0"></a>
+            <a href="#item4:1:0">0</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+28-30, 19234 call(s), 5693.38ms total, 0.01ms min, 216.95ms max, 0.3ms
+avg, excluding calls: 464.46ms total, 0.01ms min, 24.31ms max, 0.02ms
+avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:1:1"></a>
+            <a href="#item4:1:1">1</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">success:
+29-30, 58 call(s), 5215.49ms total, 0.05ms min, 216.65ms max, 89.92ms
+avg, excluding calls: 2.42ms total, 0.02ms min, 0.07ms max, 0.04ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:1:2"></a>
+            <a href="#item4:1:2">2</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+13-14, 3278 call(s) (max depth 2), 5030.7ms total, 0ms min, 184.61ms
+max, 1.53ms avg, excluding calls: 0.39ms total, 0ms min, 0.02ms max,
+0ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:1:3"></a>
+            <a href="#item4:1:3">3</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+20-23, 13022 call(s) (max depth 3), 5030.3ms total, 0ms min, 184.61ms
+max, 0.39ms avg, excluding calls: 6.27ms total, 0ms min, 0.27ms max,
+0ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range4:1"></a>
+        <h3>2500 - 5000 ms</h3>
+        [ <a href="#section3">Previous File</a> |
+        <a href="#section5">Next File</a> |
+        <a href="#range4:0">Previous Range</a> |
+        <a href="#range4:2">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:2:4"></a>
+            <a href="#item4:2:4">4</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+11-12, 22974 call(s) (max depth 1), 2960.77ms total, 0ms min, 8.68ms
+max, 0.13ms avg, excluding calls: 76.34ms total, 0ms min, 0.4ms max,
+0ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:2:5"></a>
+            <a href="#item4:2:5">5</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+11-14, 22974 call(s) (max depth 1), 2884.44ms total, 0ms min, 8.66ms
+max, 0.13ms avg, excluding calls: 288.02ms total, 0ms min, 0.95ms max,
+0.01ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:2:6"></a>
+            <a href="#item4:2:6">6</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+13-14, 6410 call(s), 2564.3ms total, 0.15ms min, 8.55ms max, 0.4ms avg,
+excluding calls: 118.22ms total, 0.01ms min, 0.51ms max, 0.02ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range4:2"></a>
+        <h3>1000 - 2500 ms</h3>
+        [ <a href="#section3">Previous File</a> |
+        <a href="#section5">Next File</a> |
+        <a href="#range4:1">Previous Range</a> |
+        <a href="#range4:3">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:3:7"></a>
+            <a href="#item4:3:7">7</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+26-27, 6410 call(s), 2189.28ms total, 0.11ms min, 8.37ms max, 0.34ms
+avg, excluding calls: 178.97ms total, 0.02ms min, 0.79ms max, 0.03ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:3:8"></a>
+            <a href="#item4:3:8">8</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+13-14, 6410 call(s), 2010.3ms total, 0.08ms min, 8.32ms max, 0.31ms
+avg, excluding calls: 55.71ms total, 0.01ms min, 0.48ms max, 0.01ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:3:9"></a>
+            <a href="#item4:3:9">9</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+26-27, 6410 call(s), 1954.59ms total, 0.08ms min, 8.3ms max, 0.3ms avg,
+excluding calls: 867.58ms total, 0.07ms min, 1.46ms max, 0.14ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:3:10"></a>
+            <a href="#item4:3:10">10</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+26-27, 89 call(s), 1051.59ms total, 1.58ms min, 153.35ms max, 11.82ms
+avg, excluding calls: 3.74ms total, 0.02ms min, 0.19ms max, 0.04ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="5%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:3:11"></a>
+            <a href="#item4:3:11">11</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+27-28, 91 call(s) (max depth 1), 1047.85ms total, 0ms min, 153.29ms
+max, 11.51ms avg, excluding calls: 9.83ms total, 0ms min, 0.63ms max,
+0.11ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="5%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range4:3"></a>
+        <h3>750 - 1000 ms</h3>
+        [ <a href="#section3">Previous File</a> |
+        <a href="#section5">Next File</a> |
+        <a href="#range4:2">Previous Range</a> |
+        <a href="#range4:4">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:4:12"></a>
+            <a href="#item4:4:12">12</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+26-27, 697 call(s) (max depth 1), 838.45ms total, 0.01ms min, 20.04ms
+max, 1.2ms avg, excluding calls: 5.83ms total, 0.01ms min, 0.03ms max,
+0.01ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="1%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:4:13"></a>
+            <a href="#item4:4:13">13</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+26-27, 522 call(s), 788.81ms total, 1.39ms min, 2.56ms max, 1.51ms avg,
+excluding calls: 125.21ms total, 0.21ms min, 1.17ms max, 0.24ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range4:4"></a>
+        <h3>500 - 750 ms</h3>
+        [ <a href="#section3">Previous File</a> |
+        <a href="#section5">Next File</a> |
+        <a href="#range4:3">Previous Range</a> |
+        <a href="#range4:5">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:5:14"></a>
+            <a href="#item4:5:14">14</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+25-27, 14270 call(s), 744.55ms total, 0ms min, 4.88ms max, 0.05ms avg,
+excluding calls: 744.55ms total, 0ms min, 4.88ms max, 0.05ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:5:15"></a>
+            <a href="#item4:5:15">15</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+28-30, 87 call(s), 701.52ms total, 1.11ms min, 143.5ms max, 8.06ms avg,
+excluding calls: 627.27ms total, 0.87ms min, 141.92ms max, 7.21ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="16%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:5:16"></a>
+            <a href="#item4:5:16">16</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+13-14, 3770 call(s), 534.93ms total, 0.12ms min, 1.41ms max, 0.14ms
+avg, excluding calls: 66.08ms total, 0.01ms min, 0.52ms max, 0.02ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range4:5"></a>
+        <h3>250 - 500 ms</h3>
+        [ <a href="#section3">Previous File</a> |
+        <a href="#section5">Next File</a> |
+        <a href="#range4:4">Previous Range</a> |
+        <a href="#range4:6">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:6:17"></a>
+            <a href="#item4:6:17">17</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+18-19, 116 call(s), 445.58ms total, 0.32ms min, 9.1ms max, 3.84ms avg,
+excluding calls: 1.82ms total, 0.01ms min, 0.02ms max, 0.02ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:6:18"></a>
+            <a href="#item4:6:18">18</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+18-19, 116 call(s), 443.77ms total, 0.31ms min, 9.09ms max, 3.83ms avg,
+excluding calls: 14.32ms total, 0.08ms min, 0.64ms max, 0.12ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:6:19"></a>
+            <a href="#item4:6:19">19</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+13-14, 58 call(s), 426.41ms total, 6.36ms min, 9.12ms max, 7.35ms avg,
+excluding calls: 0.54ms total, 0.01ms min, 0.02ms max, 0.01ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="1%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:6:20"></a>
+            <a href="#item4:6:20">20</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+13-14, 3712 call(s), 421.99ms total, 0.1ms min, 1.37ms max, 0.11ms avg,
+excluding calls: 291.84ms total, 0.07ms min, 1.27ms max, 0.08ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:6:21"></a>
+            <a href="#item4:6:21">21</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+26-27, 3132 call(s), 421.68ms total, 0.06ms min, 0.98ms max, 0.13ms
+avg, excluding calls: 68.25ms total, 0.02ms min, 0.49ms max, 0.02ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:6:22"></a>
+            <a href="#item4:6:22">22</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+26-28, 4176 call(s) (max depth 1), 335.54ms total, 0.04ms min, 0.95ms
+max, 0.08ms avg, excluding calls: 165.83ms total, 0.02ms min, 0.88ms
+max, 0.04ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:6:23"></a>
+            <a href="#item4:6:23">23</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+18-19, 580 call(s), 280.49ms total, 0.11ms min, 1.25ms max, 0.48ms avg,
+excluding calls: 24.47ms total, 0.03ms min, 0.07ms max, 0.04ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:6:24"></a>
+            <a href="#item4:6:24">24</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+13-14, 7512 call(s), 272.46ms total, 0.03ms min, 0.61ms max, 0.04ms
+avg, excluding calls: 146.73ms total, 0.01ms min, 0.59ms max, 0.02ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range4:6"></a>
+        <h3>100 - 250 ms</h3>
+        [ <a href="#section3">Previous File</a> |
+        <a href="#section5">Next File</a> |
+        <a href="#range4:5">Previous Range</a> |
+        <a href="#range4:7">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:7:25"></a>
+            <a href="#item4:7:25">25</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+19-20, 352 call(s) (max depth 1), 245.22ms total, 0.06ms min, 5.42ms
+max, 0.7ms avg, excluding calls: 245.22ms total, 0.06ms min, 5.42ms
+max, 0.7ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="1%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:7:26"></a>
+            <a href="#item4:7:26">26</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+26-27, 349 call(s), 244.7ms total, 0.57ms min, 4.03ms max, 0.7ms avg,
+excluding calls: 244.7ms total, 0.57ms min, 4.03ms max, 0.7ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="1%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:7:27"></a>
+            <a href="#item4:7:27">27</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+13-14, 2178 call(s), 238.1ms total, 0.09ms min, 0.64ms max, 0.11ms avg,
+excluding calls: 46.53ms total, 0.02ms min, 0.5ms max, 0.02ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:7:28"></a>
+            <a href="#item4:7:28">28</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+27-28, 91 call(s), 227.57ms total, 0.56ms min, 5.52ms max, 2.5ms avg,
+excluding calls: 5.5ms total, 0.03ms min, 0.21ms max, 0.06ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="1%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:7:29"></a>
+            <a href="#item4:7:29">29</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+24-25, 2178 call(s), 185.48ms total, 0.05ms min, 0.62ms max, 0.09ms
+avg, excluding calls: 109.63ms total, 0.04ms min, 0.57ms max, 0.05ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:7:30"></a>
+            <a href="#item4:7:30">30</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+28-29, 1044 call(s), 182.47ms total, 0.14ms min, 0.38ms max, 0.17ms
+avg, excluding calls: 4.97ms total, 0ms min, 0.06ms max, 0ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:7:31"></a>
+            <a href="#item4:7:31">31</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+27-28, 1044 call(s), 177.5ms total, 0.14ms min, 0.38ms max, 0.17ms avg,
+excluding calls: 14.07ms total, 0.01ms min, 0.04ms max, 0.01ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:7:32"></a>
+            <a href="#item4:7:32">32</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+27-28, 1044 call(s), 163.43ms total, 0.13ms min, 0.36ms max, 0.16ms
+avg, excluding calls: 16.88ms total, 0.01ms min, 0.05ms max, 0.02ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:7:33"></a>
+            <a href="#item4:7:33">33</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+26-27, 1044 call(s), 146.55ms total, 0.11ms min, 0.35ms max, 0.14ms
+avg, excluding calls: 70.49ms total, 0.05ms min, 0.16ms max, 0.07ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:7:34"></a>
+            <a href="#item4:7:34">34</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+23-25, 116 call(s), 142.21ms total, 0.06ms min, 3.1ms max, 1.23ms avg,
+excluding calls: 3.77ms total, 0.03ms min, 0.06ms max, 0.03ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:7:35"></a>
+            <a href="#item4:7:35">35</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+23-25, 116 call(s), 138.44ms total, 0.03ms min, 3.07ms max, 1.19ms avg,
+excluding calls: 117.14ms total, 0.03ms min, 2.68ms max, 1.01ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:7:36"></a>
+            <a href="#item4:7:36">36</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+13-14, 3712 call(s), 130.15ms total, 0.03ms min, 0.82ms max, 0.04ms
+avg, excluding calls: 130.15ms total, 0.03ms min, 0.82ms max, 0.04ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:7:37"></a>
+            <a href="#item4:7:37">37</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+20-21, 11452 call(s), 116.35ms total, 0ms min, 0.43ms max, 0.01ms avg,
+excluding calls: 116.35ms total, 0ms min, 0.43ms max, 0.01ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range4:7"></a>
+        <h3>75 - 100 ms</h3>
+        [ <a href="#section3">Previous File</a> |
+        <a href="#section5">Next File</a> |
+        <a href="#range4:6">Previous Range</a> |
+        <a href="#range4:8">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:8:38"></a>
+            <a href="#item4:8:38">38</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+26-27, 134 call(s), 92.03ms total, 0.03ms min, 1.92ms max, 0.69ms avg,
+excluding calls: 10ms total, 0.02ms min, 0.76ms max, 0.07ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="1%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:8:39"></a>
+            <a href="#item4:8:39">39</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+14-15, 58 call(s), 88.93ms total, 1.33ms min, 2.04ms max, 1.53ms avg,
+excluding calls: 1.13ms total, 0.02ms min, 0.03ms max, 0.02ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="1%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:8:40"></a>
+            <a href="#item4:8:40">40</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+19-20, 2643 call(s), 87.88ms total, 0.01ms min, 0.56ms max, 0.03ms avg,
+excluding calls: 87.88ms total, 0.01ms min, 0.56ms max, 0.03ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:8:41"></a>
+            <a href="#item4:8:41">41</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+15-16, 1044 call(s), 83.2ms total, 0.06ms min, 0.58ms max, 0.08ms avg,
+excluding calls: 20.65ms total, 0.01ms min, 0.37ms max, 0.02ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:8:42"></a>
+            <a href="#item4:8:42">42</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+14-15, 522 call(s), 76.31ms total, 0.14ms min, 0.5ms max, 0.15ms avg,
+excluding calls: 3.33ms total, 0.01ms min, 0.01ms max, 0.01ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range4:8"></a>
+        <h3>50 - 75 ms</h3>
+        [ <a href="#section3">Previous File</a> |
+        <a href="#section5">Next File</a> |
+        <a href="#range4:7">Previous Range</a> |
+        <a href="#range4:9">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:9:43"></a>
+            <a href="#item4:9:43">43</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+26-28, 1044 call(s), 70.63ms total, 0.06ms min, 0.14ms max, 0.07ms avg,
+excluding calls: 64.65ms total, 0.05ms min, 0.13ms max, 0.06ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:9:44"></a>
+            <a href="#item4:9:44">44</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+13-14, 522 call(s), 70.11ms total, 0.11ms min, 0.67ms max, 0.13ms avg,
+excluding calls: 70.11ms total, 0.11ms min, 0.67ms max, 0.13ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:9:45"></a>
+            <a href="#item4:9:45">45</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+24-25, 8268 call(s), 67.22ms total, 0ms min, 0.67ms max, 0.01ms avg,
+excluding calls: 67.22ms total, 0ms min, 0.67ms max, 0.01ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:9:46"></a>
+            <a href="#item4:9:46">46</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+13-14, 8150 call(s), 64.81ms total, 0.01ms min, 0.06ms max, 0.01ms avg,
+excluding calls: 64.81ms total, 0.01ms min, 0.06ms max, 0.01ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:9:47"></a>
+            <a href="#item4:9:47">47</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+19-20, 8324 call(s), 56.71ms total, 0ms min, 0.52ms max, 0.01ms avg,
+excluding calls: 56.71ms total, 0ms min, 0.52ms max, 0.01ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:9:48"></a>
+            <a href="#item4:9:48">48</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+26-27, 1044 call(s), 55.43ms total, 0.04ms min, 0.25ms max, 0.05ms avg,
+excluding calls: 55.43ms total, 0.04ms min, 0.25ms max, 0.05ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range4:9"></a>
+        <h3>25 - 50 ms</h3>
+        [ <a href="#section3">Previous File</a> |
+        <a href="#section5">Next File</a> |
+        <a href="#range4:8">Previous Range</a> |
+        <a href="#range4:10">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:10:49"></a>
+            <a href="#item4:10:49">49</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+20-21, 6264 call(s) (max depth 1), 41.32ms total, 0ms min, 0.45ms max,
+0.01ms avg, excluding calls: 41.32ms total, 0ms min, 0.45ms max, 0.01ms
+avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:10:50"></a>
+            <a href="#item4:10:50">50</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+24-26, 1827 call(s), 33.86ms total, 0.01ms min, 0.69ms max, 0.02ms avg,
+excluding calls: 33.86ms total, 0.01ms min, 0.69ms max, 0.02ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="1%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:10:51"></a>
+            <a href="#item4:10:51">51</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+26-27, 929 call(s), 31.34ms total, 0.03ms min, 0.12ms max, 0.03ms avg,
+excluding calls: 28.97ms total, 0.03ms min, 0.09ms max, 0.03ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:10:52"></a>
+            <a href="#item4:10:52">52</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+26-27, 465 call(s), 27.76ms total, 0.02ms min, 0.47ms max, 0.06ms avg,
+excluding calls: 15.35ms total, 0.01ms min, 0.25ms max, 0.03ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:10:53"></a>
+            <a href="#item4:10:53">53</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+26-27, 58 call(s), 25.35ms total, 0.41ms min, 0.92ms max, 0.44ms avg,
+excluding calls: 13.07ms total, 0.21ms min, 0.26ms max, 0.23ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range4:10"></a>
+        <h3>10 - 25 ms</h3>
+        [ <a href="#section3">Previous File</a> |
+        <a href="#section5">Next File</a> |
+        <a href="#range4:9">Previous Range</a> |
+        <a href="#range4:11">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:11:54"></a>
+            <a href="#item4:11:54">54</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+27-28, 30 call(s), 22.61ms total, 0.04ms min, 21.5ms max, 0.75ms avg,
+excluding calls: 0.53ms total, 0.01ms min, 0.2ms max, 0.02ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="2%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="74%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:11:55"></a>
+            <a href="#item4:11:55">55</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+13-14, 58 call(s), 20.61ms total, 0.33ms min, 0.7ms max, 0.36ms avg,
+excluding calls: 0.9ms total, 0.01ms min, 0.35ms max, 0.02ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="1%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="1%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:11:56"></a>
+            <a href="#item4:11:56">56</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+13-14, 116 call(s), 18.55ms total, 0.13ms min, 0.22ms max, 0.16ms avg,
+excluding calls: 0.87ms total, 0.01ms min, 0.04ms max, 0.01ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:11:57"></a>
+            <a href="#item4:11:57">57</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+13-14, 1044 call(s), 17.84ms total, 0.01ms min, 0.07ms max, 0.02ms avg,
+excluding calls: 5.21ms total, 0ms min, 0.02ms max, 0ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:11:58"></a>
+            <a href="#item4:11:58">58</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+20-21, 754 call(s), 17.69ms total, 0ms min, 0.34ms max, 0.02ms avg,
+excluding calls: 17.69ms total, 0ms min, 0.34ms max, 0.02ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="1%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:11:59"></a>
+            <a href="#item4:11:59">59</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+29-32, 87 call(s), 16.74ms total, 0.08ms min, 0.66ms max, 0.19ms avg,
+excluding calls: 16.74ms total, 0.08ms min, 0.66ms max, 0.19ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="1%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:11:60"></a>
+            <a href="#item4:11:60">60</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+13-14, 116 call(s), 13.91ms total, 0.1ms min, 0.17ms max, 0.12ms avg,
+excluding calls: 4.57ms total, 0.03ms min, 0.06ms max, 0.04ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:11:61"></a>
+            <a href="#item4:11:61">61</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+26-27, 18 call(s), 12.48ms total, 0.53ms min, 1.86ms max, 0.69ms avg,
+excluding calls: 0.4ms total, 0.02ms min, 0.13ms max, 0.02ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="1%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="4%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:11:62"></a>
+            <a href="#item4:11:62">62</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+22-23, 18 call(s), 12.08ms total, 0.52ms min, 1.84ms max, 0.67ms avg,
+excluding calls: 4.65ms total, 0.18ms min, 1.5ms max, 0.26ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="1%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="4%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range4:11"></a>
+        <h3>7.5 - 10 ms</h3>
+        [ <a href="#section3">Previous File</a> |
+        <a href="#section5">Next File</a> |
+        <a href="#range4:10">Previous Range</a> |
+        <a href="#range4:12">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:12:63"></a>
+            <a href="#item4:12:63">63</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+29-30, 58 call(s), 8.11ms total, 0.08ms min, 0.27ms max, 0.14ms avg,
+excluding calls: 8.11ms total, 0.08ms min, 0.27ms max, 0.14ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="1%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range4:12"></a>
+        <h3>5 - 7.5 ms</h3>
+        [ <a href="#section3">Previous File</a> |
+        <a href="#section5">Next File</a> |
+        <a href="#range4:11">Previous Range</a> |
+        <a href="#range4:13">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:13:64"></a>
+            <a href="#item4:13:64">64</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+27-28, 203 call(s), 6.54ms total, 0.02ms min, 0.08ms max, 0.03ms avg,
+excluding calls: 2.64ms total, 0.01ms min, 0.04ms max, 0.01ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range4:13"></a>
+        <h3>2.5 - 5 ms</h3>
+        [ <a href="#section3">Previous File</a> |
+        <a href="#section5">Next File</a> |
+        <a href="#range4:12">Previous Range</a> |
+        <a href="#range4:14">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:14:65"></a>
+            <a href="#item4:14:65">65</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+22-23, 78 call(s), 4.57ms total, 0.05ms min, 0.08ms max, 0.06ms avg,
+excluding calls: 1.19ms total, 0.01ms min, 0.03ms max, 0.02ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:14:66"></a>
+            <a href="#item4:14:66">66</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+13-14, 58 call(s), 3.94ms total, 0.06ms min, 0.09ms max, 0.07ms avg,
+excluding calls: 3.94ms total, 0.06ms min, 0.09ms max, 0.07ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="1%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:14:67"></a>
+            <a href="#item4:14:67">67</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+22-23, 78 call(s), 3.38ms total, 0.04ms min, 0.05ms max, 0.04ms avg,
+excluding calls: 2.95ms total, 0.04ms min, 0.05ms max, 0.04ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:14:68"></a>
+            <a href="#item4:14:68">68</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">complete:
+29-30, 58 call(s), 3.35ms total, 0.03ms min, 0.11ms max, 0.06ms avg,
+excluding calls: 1.81ms total, 0.02ms min, 0.08ms max, 0.03ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range4:14"></a>
+        <h3>1 - 2.5 ms</h3>
+        [ <a href="#section3">Previous File</a> |
+        <a href="#section5">Next File</a> |
+        <a href="#range4:13">Previous Range</a> |
+        <a href="#range4:15">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:15:69"></a>
+            <a href="#item4:15:69">69</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+27-28, 30 call(s), 1.99ms total, 0.03ms min, 1.02ms max, 0.07ms avg,
+excluding calls: 0.47ms total, 0.01ms min, 0.2ms max, 0.02ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="1%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="1%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="34%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:15:70"></a>
+            <a href="#item4:15:70">70</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+29-30, 58 call(s), 1.97ms total, 0.02ms min, 0.07ms max, 0.03ms avg,
+excluding calls: 1.97ms total, 0.02ms min, 0.07ms max, 0.03ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="1%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:15:71"></a>
+            <a href="#item4:15:71">71</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+28-29, 60 call(s), 1.81ms total, 0.02ms min, 0.19ms max, 0.03ms avg,
+excluding calls: 1.81ms total, 0.02ms min, 0.19ms max, 0.03ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="5%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:15:72"></a>
+            <a href="#item4:15:72">72</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+22-23, 116 call(s), 1.52ms total, 0.01ms min, 0.03ms max, 0.01ms avg,
+excluding calls: 1.25ms total, 0.01ms min, 0.02ms max, 0.01ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:15:73"></a>
+            <a href="#item4:15:73">73</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+26-27, 87 call(s), 1.15ms total, 0.01ms min, 0.02ms max, 0.01ms avg,
+excluding calls: 0.98ms total, 0.01ms min, 0.02ms max, 0.01ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range4:15"></a>
+        <h3>0.25 - 0.5 ms</h3>
+        [ <a href="#section3">Previous File</a> |
+        <a href="#section5">Next File</a> |
+        <a href="#range4:14">Previous Range</a> |
+        <a href="#range4:16">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:16:74"></a>
+            <a href="#item4:16:74">74</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous:
+25-26, 78 call(s), 0.43ms total, 0.01ms min, 0.01ms max, 0.01ms avg,
+excluding calls: 0.43ms total, 0.01ms min, 0.01ms max, 0.01ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="1%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range4:16"></a>
+        <h3>0.17 - 0.25 ms</h3>
+        [ <a href="#section3">Previous File</a> |
+        <a href="#section5">Next File</a> |
+        <a href="#range4:15">Previous Range</a> |
+        <a href="#range4:17">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:17:75"></a>
+            <a href="#item4:17:75">75</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous: 26-27, 87 call(s), 0.17ms total, 0ms min, 0ms max, 0ms avg, excluding calls: 0.17ms total, 0ms min, 0ms max, 0ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item4:17:76"></a>
+            <a href="#item4:17:76">76</a>
+            <a class="graph-filename" href="http://localhost:8080/js/jquery.js">http://localhost:8080/js/jquery.js</a><br>
+            <span class="graph-summary">anonymous: 13-14, 58 call(s), 0.11ms total, 0ms min, 0ms max, 0ms avg, excluding calls: 0.11ms total, 0ms min, 0ms max, 0ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+      </span>
+      <br>
+    </span>
+    <hr>
+    <span class="section-box">
+      <a name="section5"></a>
+      <h2 class="section-title"><a class="section-link" href="http://localhost:8080/js/pageMinichat.js">http://localhost:8080/js/pageMinichat.js</a></h2>
+      <a name="range5:0"></a>
+      <span class="range-box">
+        <a name="range5:0"></a>
+        <h3>5000 - 1000000 ms</h3>
+        [ <a href="#section4">Previous File</a> |
+        <a href="#section6">Next File</a> |
+        <a href="#range5:0">Previous Range</a> |
+        <a href="#range5:1">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item5:1:0"></a>
+            <a href="#item5:1:0">0</a>
+            <a class="graph-filename" href="http://localhost:8080/js/pageMinichat.js">http://localhost:8080/js/pageMinichat.js</a><br>
+            <span class="graph-summary">anonymous:
+732-764, 29 call(s), 5211.07ms total, 172.09ms min, 216.61ms max,
+179.69ms avg, excluding calls: 2.63ms total, 0.08ms min, 0.1ms max,
+0.09ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range5:1"></a>
+        <h3>2500 - 5000 ms</h3>
+        [ <a href="#section4">Previous File</a> |
+        <a href="#section6">Next File</a> |
+        <a href="#range5:0">Previous Range</a> |
+        <a href="#range5:2">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item5:2:1"></a>
+            <a href="#item5:2:1">1</a>
+            <a class="graph-filename" href="http://localhost:8080/js/pageMinichat.js">http://localhost:8080/js/pageMinichat.js</a><br>
+            <span class="graph-summary">anonymous:
+742-759, 58 call(s), 4222.75ms total, 67.28ms min, 117.13ms max,
+72.81ms avg, excluding calls: 6.39ms total, 0.1ms min, 0.37ms max,
+0.11ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="1%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item5:2:2"></a>
+            <a href="#item5:2:2">2</a>
+            <a class="graph-filename" href="http://localhost:8080/js/pageMinichat.js">http://localhost:8080/js/pageMinichat.js</a><br>
+            <span class="graph-summary">anonymous:
+566-570, 58 call(s), 3653.43ms total, 56.72ms min, 108.43ms max,
+62.99ms avg, excluding calls: 4.99ms total, 0.07ms min, 0.17ms max,
+0.09ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="1%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range5:2"></a>
+        <h3>1000 - 2500 ms</h3>
+        [ <a href="#section4">Previous File</a> |
+        <a href="#section6">Next File</a> |
+        <a href="#range5:1">Previous Range</a> |
+        <a href="#range5:3">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item5:3:3"></a>
+            <a href="#item5:3:3">3</a>
+            <a class="graph-filename" href="http://localhost:8080/js/pageMinichat.js">http://localhost:8080/js/pageMinichat.js</a><br>
+            <span class="graph-summary">anonymous:
+579-612, 522 call(s), 2168.82ms total, 3.46ms min, 11.63ms max, 4.15ms
+avg, excluding calls: 57.77ms total, 0.1ms min, 0.61ms max, 0.11ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item5:3:4"></a>
+            <a href="#item5:3:4">4</a>
+            <a class="graph-filename" href="http://localhost:8080/js/pageMinichat.js">http://localhost:8080/js/pageMinichat.js</a><br>
+            <span class="graph-summary">anonymous:
+684-692, 58 call(s), 1479.62ms total, 24.76ms min, 26.69ms max, 25.51ms
+avg, excluding calls: 1.08ms total, 0.02ms min, 0.03ms max, 0.02ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item5:3:5"></a>
+            <a href="#item5:3:5">5</a>
+            <a class="graph-filename" href="http://localhost:8080/js/pageMinichat.js">http://localhost:8080/js/pageMinichat.js</a><br>
+            <span class="graph-summary">anonymous:
+395-437, 58 call(s), 1478.54ms total, 24.74ms min, 26.67ms max, 25.49ms
+avg, excluding calls: 27.6ms total, 0.4ms min, 0.94ms max, 0.48ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range5:3"></a>
+        <h3>750 - 1000 ms</h3>
+        [ <a href="#section4">Previous File</a> |
+        <a href="#section6">Next File</a> |
+        <a href="#range5:2">Previous Range</a> |
+        <a href="#range5:4">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item5:4:6"></a>
+            <a href="#item5:4:6">6</a>
+            <a class="graph-filename" href="http://localhost:8080/js/pageMinichat.js">http://localhost:8080/js/pageMinichat.js</a><br>
+            <span class="graph-summary">anonymous:
+699-704, 29 call(s), 974.37ms total, 31.17ms min, 42.63ms max, 33.6ms
+avg, excluding calls: 0.48ms total, 0.01ms min, 0.08ms max, 0.02ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="2%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item5:4:7"></a>
+            <a href="#item5:4:7">7</a>
+            <a class="graph-filename" href="http://localhost:8080/js/pageMinichat.js">http://localhost:8080/js/pageMinichat.js</a><br>
+            <span class="graph-summary">anonymous:
+384-387, 58 call(s), 973.89ms total, 13.64ms min, 23.81ms max, 16.79ms
+avg, excluding calls: 1.31ms total, 0.02ms min, 0.03ms max, 0.02ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="1%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range5:4"></a>
+        <h3>500 - 750 ms</h3>
+        [ <a href="#section4">Previous File</a> |
+        <a href="#section6">Next File</a> |
+        <a href="#range5:3">Previous Range</a> |
+        <a href="#range5:5">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item5:5:8"></a>
+            <a href="#item5:5:8">8</a>
+            <a class="graph-filename" href="http://localhost:8080/js/pageMinichat.js">http://localhost:8080/js/pageMinichat.js</a><br>
+            <span class="graph-summary">anonymous:
+341-345, 58 call(s), 502.35ms total, 7.43ms min, 10.38ms max, 8.66ms
+avg, excluding calls: 1.87ms total, 0.03ms min, 0.04ms max, 0.03ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range5:5"></a>
+        <h3>250 - 500 ms</h3>
+        [ <a href="#section4">Previous File</a> |
+        <a href="#section6">Next File</a> |
+        <a href="#range5:4">Previous Range</a> |
+        <a href="#range5:6">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item5:6:9"></a>
+            <a href="#item5:6:9">9</a>
+            <a class="graph-filename" href="http://localhost:8080/js/pageMinichat.js">http://localhost:8080/js/pageMinichat.js</a><br>
+            <span class="graph-summary">anonymous:
+363-364, 15 call(s), 474.89ms total, 16.62ms min, 148.74ms max, 31.66ms
+avg, excluding calls: 0.37ms total, 0.01ms min, 0.03ms max, 0.02ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="2%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="2%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="21%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item5:6:10"></a>
+            <a href="#item5:6:10">10</a>
+            <a class="graph-filename" href="http://localhost:8080/js/pageMinichat.js">http://localhost:8080/js/pageMinichat.js</a><br>
+            <span class="graph-summary">anonymous:
+632-635, 15 call(s), 474.53ms total, 16.6ms min, 148.71ms max, 31.64ms
+avg, excluding calls: 1.56ms total, 0.02ms min, 0.43ms max, 0.1ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="2%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="2%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="21%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item5:6:11"></a>
+            <a href="#item5:6:11">11</a>
+            <a class="graph-filename" href="http://localhost:8080/js/pageMinichat.js">http://localhost:8080/js/pageMinichat.js</a><br>
+            <span class="graph-summary">anonymous:
+239-247, 522 call(s), 401.27ms total, 0.28ms min, 2.1ms max, 0.77ms
+avg, excluding calls: 13.46ms total, 0.02ms min, 0.4ms max, 0.03ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item5:6:12"></a>
+            <a href="#item5:6:12">12</a>
+            <a class="graph-filename" href="http://localhost:8080/js/pageMinichat.js">http://localhost:8080/js/pageMinichat.js</a><br>
+            <span class="graph-summary">anonymous:
+360-361, 14 call(s), 310.5ms total, 6.95ms min, 26.81ms max, 22.18ms
+avg, excluding calls: 0.64ms total, 0.01ms min, 0.32ms max, 0.05ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="1%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="2%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item5:6:13"></a>
+            <a href="#item5:6:13">13</a>
+            <a class="graph-filename" href="http://localhost:8080/js/pageMinichat.js">http://localhost:8080/js/pageMinichat.js</a><br>
+            <span class="graph-summary">anonymous:
+627-630, 14 call(s), 309.87ms total, 6.94ms min, 26.78ms max, 22.13ms
+avg, excluding calls: 1.98ms total, 0.02ms min, 0.44ms max, 0.14ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="1%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="2%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range5:6"></a>
+        <h3>100 - 250 ms</h3>
+        [ <a href="#section4">Previous File</a> |
+        <a href="#section6">Next File</a> |
+        <a href="#range5:5">Previous Range</a> |
+        <a href="#range5:7">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item5:7:14"></a>
+            <a href="#item5:7:14">14</a>
+            <a class="graph-filename" href="http://localhost:8080/js/pageMinichat.js">http://localhost:8080/js/pageMinichat.js</a><br>
+            <span class="graph-summary">anonymous:
+246-249, 494 call(s), 225.51ms total, 0.42ms min, 1.26ms max, 0.46ms
+avg, excluding calls: 27.03ms total, 0.05ms min, 0.24ms max, 0.05ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item5:7:15"></a>
+            <a href="#item5:7:15">15</a>
+            <a class="graph-filename" href="http://localhost:8080/js/pageMinichat.js">http://localhost:8080/js/pageMinichat.js</a><br>
+            <span class="graph-summary">anonymous:
+436-465, 522 call(s), 202.38ms total, 0.36ms min, 0.58ms max, 0.39ms
+avg, excluding calls: 9.84ms total, 0.02ms min, 0.03ms max, 0.02ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item5:7:16"></a>
+            <a href="#item5:7:16">16</a>
+            <a class="graph-filename" href="http://localhost:8080/js/pageMinichat.js">http://localhost:8080/js/pageMinichat.js</a><br>
+            <span class="graph-summary">anonymous:
+712-768, 58 call(s), 183.34ms total, 1.69ms min, 6.64ms max, 3.16ms
+avg, excluding calls: 8.97ms total, 0.09ms min, 0.63ms max, 0.15ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="1%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range5:7"></a>
+        <h3>50 - 75 ms</h3>
+        [ <a href="#section4">Previous File</a> |
+        <a href="#section6">Next File</a> |
+        <a href="#range5:6">Previous Range</a> |
+        <a href="#range5:8">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item5:8:17"></a>
+            <a href="#item5:8:17">17</a>
+            <a class="graph-filename" href="http://localhost:8080/js/pageMinichat.js">http://localhost:8080/js/pageMinichat.js</a><br>
+            <span class="graph-summary">anonymous:
+434-435, 522 call(s), 72.97ms total, 0.13ms min, 0.5ms max, 0.14ms avg,
+excluding calls: 11.55ms total, 0.02ms min, 0.37ms max, 0.02ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item5:8:18"></a>
+            <a href="#item5:8:18">18</a>
+            <a class="graph-filename" href="http://localhost:8080/js/pageMinichat.js">http://localhost:8080/js/pageMinichat.js</a><br>
+            <span class="graph-summary">anonymous:
+763-764, 29 call(s), 71.63ms total, 2.01ms min, 6.21ms max, 2.47ms avg,
+excluding calls: 0.51ms total, 0.01ms min, 0.04ms max, 0.02ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="2%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="4%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range5:8"></a>
+        <h3>25 - 50 ms</h3>
+        [ <a href="#section4">Previous File</a> |
+        <a href="#section6">Next File</a> |
+        <a href="#range5:7">Previous Range</a> |
+        <a href="#range5:9">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item5:9:19"></a>
+            <a href="#item5:9:19">19</a>
+            <a class="graph-filename" href="http://localhost:8080/js/pageMinichat.js">http://localhost:8080/js/pageMinichat.js</a><br>
+            <span class="graph-summary">anonymous:
+535-558, 58 call(s), 45.74ms total, 0.42ms min, 1.4ms max, 0.79ms avg,
+excluding calls: 18.72ms total, 0.17ms min, 0.62ms max, 0.32ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="1%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range5:9"></a>
+        <h3>10 - 25 ms</h3>
+        [ <a href="#section4">Previous File</a> |
+        <a href="#section6">Next File</a> |
+        <a href="#range5:8">Previous Range</a> |
+        <a href="#range5:10">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item5:10:20"></a>
+            <a href="#item5:10:20">20</a>
+            <a class="graph-filename" href="http://localhost:8080/js/pageMinichat.js">http://localhost:8080/js/pageMinichat.js</a><br>
+            <span class="graph-summary">anonymous:
+319-322, 1 call(s), 20.55ms total, 20.55ms min, 20.55ms max, 20.55ms
+avg, excluding calls: 0.03ms total, 0.03ms min, 0.03ms max, 0.03ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="73%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range5:10"></a>
+        <h3>5 - 7.5 ms</h3>
+        [ <a href="#section4">Previous File</a> |
+        <a href="#section6">Next File</a> |
+        <a href="#range5:9">Previous Range</a> |
+        <a href="#range5:11">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item5:11:21"></a>
+            <a href="#item5:11:21">21</a>
+            <a class="graph-filename" href="http://localhost:8080/js/pageMinichat.js">http://localhost:8080/js/pageMinichat.js</a><br>
+            <span class="graph-summary">Message:
+220-233, 522 call(s), 5.61ms total, 0.01ms min, 0.08ms max, 0.01ms avg,
+excluding calls: 5.61ms total, 0.01ms min, 0.08ms max, 0.01ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range5:11"></a>
+        <h3>2.5 - 5 ms</h3>
+        [ <a href="#section4">Previous File</a> |
+        <a href="#section6">Next File</a> |
+        <a href="#range5:10">Previous Range</a> |
+        <a href="#range5:12">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item5:12:22"></a>
+            <a href="#item5:12:22">22</a>
+            <a class="graph-filename" href="http://localhost:8080/js/pageMinichat.js">http://localhost:8080/js/pageMinichat.js</a><br>
+            <span class="graph-summary">anonymous:
+371-373, 464 call(s), 3.75ms total, 0.01ms min, 0.02ms max, 0.01ms avg,
+excluding calls: 3.75ms total, 0.01ms min, 0.02ms max, 0.01ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item5:12:23"></a>
+            <a href="#item5:12:23">23</a>
+            <a class="graph-filename" href="http://localhost:8080/js/pageMinichat.js">http://localhost:8080/js/pageMinichat.js</a><br>
+            <span class="graph-summary">anonymous:
+376-381, 522 call(s), 3.65ms total, 0.01ms min, 0.04ms max, 0.01ms avg,
+excluding calls: 3.65ms total, 0.01ms min, 0.04ms max, 0.01ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item5:12:24"></a>
+            <a href="#item5:12:24">24</a>
+            <a class="graph-filename" href="http://localhost:8080/js/pageMinichat.js">http://localhost:8080/js/pageMinichat.js</a><br>
+            <span class="graph-summary">Reponse:
+198-208, 494 call(s), 2.8ms total, 0ms min, 0.2ms max, 0.01ms avg,
+excluding calls: 2.8ms total, 0ms min, 0.2ms max, 0.01ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="3%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range5:12"></a>
+        <h3>1 - 2.5 ms</h3>
+        [ <a href="#section4">Previous File</a> |
+        <a href="#section6">Next File</a> |
+        <a href="#range5:11">Previous Range</a> |
+        <a href="#range5:13">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item5:13:25"></a>
+            <a href="#item5:13:25">25</a>
+            <a class="graph-filename" href="http://localhost:8080/js/pageMinichat.js">http://localhost:8080/js/pageMinichat.js</a><br>
+            <span class="graph-summary">anonymous:
+746-749, 522 call(s), 2.26ms total, 0ms min, 0.03ms max, 0ms avg,
+excluding calls: 2.26ms total, 0ms min, 0.03ms max, 0ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="1%">
+          </span>
+        </span>
+      </span>
+      <span class="range-box">
+        <a name="range5:13"></a>
+        <h3>0 - 0.25 ms</h3>
+        [ <a href="#section4">Previous File</a> |
+        <a href="#section6">Next File</a> |
+        <a href="#range5:12">Previous Range</a> |
+        <a href="#range5:14">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item5:14:26"></a>
+            <a href="#item5:14:26">26</a>
+            <a class="graph-filename" href="http://localhost:8080/js/pageMinichat.js">http://localhost:8080/js/pageMinichat.js</a><br>
+            <span class="graph-summary">anonymous: 317-318, 1 call(s), 0ms total, 0ms min, 0ms max, 0ms avg, excluding calls: 0ms total, 0ms min, 0ms max, 0ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+      </span>
+      <br>
+    </span>
+    <hr>
+    <span class="section-box">
+      <a name="section6"></a>
+      <h2 class="section-title"><a class="section-link" href="http://localhost:8080/lightbox/js/lightbox.js">http://localhost:8080/lightbox/js/lightbox.js</a></h2>
+      <a name="range6:0"></a>
+      <span class="range-box">
+        <a name="range6:0"></a>
+        <h3>10 - 25 ms</h3>
+        [ <a href="#section5">Previous File</a> |
+        <a href="#section7">Next File</a> |
+        <a href="#range6:0">Previous Range</a> |
+        <a href="#range6:1">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item6:1:0"></a>
+            <a href="#item6:1:0">0</a>
+            <a class="graph-filename" href="http://localhost:8080/lightbox/js/lightbox.js">http://localhost:8080/lightbox/js/lightbox.js</a><br>
+            <span class="graph-summary">anonymous:
+337-365, 58 call(s), 15.6ms total, 0.24ms min, 0.65ms max, 0.27ms avg,
+excluding calls: 15.6ms total, 0.24ms min, 0.65ms max, 0.27ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="1%">
+          </span>
+        </span>
+      </span>
+      <br>
+    </span>
+    <hr>
+    <span class="section-box">
+      <a name="section7"></a>
+      <h2 class="section-title"><a class="section-link" href="http://localhost:8080/lightbox/js/prototype.js">http://localhost:8080/lightbox/js/prototype.js</a></h2>
+      <a name="range7:0"></a>
+      <span class="range-box">
+        <a name="range7:0"></a>
+        <h3>0.25 - 0.5 ms</h3>
+        [ <a href="#section6">Previous File</a> |
+        <a href="#section8">Next File</a> |
+        <a href="#range7:0">Previous Range</a> |
+        <a href="#range7:1">Next Range</a> ]
+        <span class="graph-box">
+          <span class="graph-title">
+            <a name="item7:1:0"></a>
+            <a href="#item7:1:0">0</a>
+            <a class="graph-filename" href="http://localhost:8080/lightbox/js/prototype.js">http://localhost:8080/lightbox/js/prototype.js</a><br>
+            <span class="graph-summary">anonymous:
+456-458, 58 call(s), 0.31ms total, 0.01ms min, 0.01ms max, 0.01ms avg,
+excluding calls: 0.31ms total, 0.01ms min, 0.01ms max, 0.01ms avg</span>
+          </span>
+          <span class="graph-body">
+            <img class="left-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="1%"><img class="below-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%"><img class="above-avg-trough" src="JavaScript%20Profile%20Data%202008-04-15_files/a" width="0%">
+          </span>
+        </span>
+      </span>
+      <br>
+    </span>
+    <hr>
+    <a href="http://www.mozilla.org/projects/venkman/">No job is too big, no fee is too big.</a>
+  
+</body></html>
\ No newline at end of file
diff --git a/doc/profiling/JavaScript Profile Data 2008-04-15_files/a b/doc/profiling/JavaScript Profile Data 2008-04-15_files/a
new file mode 100644 (file)
index 0000000..43f0e66
Binary files /dev/null and b/doc/profiling/JavaScript Profile Data 2008-04-15_files/a differ
diff --git a/doc/profiling/profiling.txt b/doc/profiling/profiling.txt
new file mode 100644 (file)
index 0000000..02a18a8
--- /dev/null
@@ -0,0 +1,5 @@
+== Profiling Euphorik ==\r
+Ce fichier décrit les différents profiling réalisés.\r
+\r
+== 2008-04-15 ==\r
+Changement de page.
\ No newline at end of file
diff --git a/doc/protocole3.txt b/doc/protocole3.txt
new file mode 100644 (file)
index 0000000..66f688d
--- /dev/null
@@ -0,0 +1,397 @@
+Euphorik - Protocole v3
+-----------------------
+
+== Introduction ==
+Ce document a pour but de décrire la communication client-serveur du site euphorik.\r
+Les messages échangés sont basés sur le format JSON.
+Ce document remplace 'protocole2.txt'.
+\r
+
+== Principes ==
+Enregistrement:\r
+ * Permet de créer un compte, un cookie est donné en retour. Ce cookie doit être stocké par le client pour pouvoir s'authentifier par la suite.
+
+Authentification:\r
+ * L'authentification (login) se fait soit par un couple <login, mot de passe> soit à l'aide d'un cookie.\r
+ * Permet de récupérer les données d'un profile
+
+Rafraichissement:
+ * Le client envoie une demande au serveur avec l'id du dernier message (via XMLHttpRequest ou un function de JQuery)
+ * Le serveur maintient la connexion bloquée si le client est à jour.
+ * Dès qu'un nouveau message arrive, le serveur débloque la connexion et envoie le ou les messages manquants.
+
+== Protocole ==
+c : client
+s : server
+Les messages client vers serveur sont envoyés par HTTP-POST.
+
+A toutes les requêtes le serveur peut répondre une erreur :
+<error>
+   {
+      "reply" : "error",
+      "error_message" : "blabla"
+   }
+   
+Message ok générique :
+<ok>
+   {
+      "reply" : "ok"
+   }
+
+
+=== Enregistrement et authentification ===
+Permet de créer un nouvel utilisateur.
+"login" et "password" peuvent ne pas être fournis avec un message de type "register", dans ce cas l'utilisateur ne pourra s'authentifier qu'a l'aide de son cookie.
+Le mot de passe est hashé en md5.
+
+c -> s
+   { 
+      "action" : "authentification",
+      "login" : "paul",
+      "password" : "IJKJDHHSAD9081238"
+   }
+ou
+   {
+      "action" : "authentification",
+      "cookie" : "LKJDLAKSJBFLKASN"
+   }
+ou
+   {
+      "action" : "register",
+      "login" : "paul",
+      "password" : "IJKJDHHSAD9081238"
+   }
+   
+s -> c
+   {
+      "reply" : "register" | "authentification",
+      "status" : "auth_not_registered",
+      "cookie" : "LKJDLAKSJBFLKASN",
+      "id" : 193,
+      "css" : "css/1/euphorik.css",
+      "main_page" : 1
+   }
+ou\r
+   {
+      "reply" : "register" | "authentification",\r
+      "status" : "auth_registered",\r
+      "cookie" : "LKJDLAKSJBFLKASN",\r
+      "id" : 193,\r
+      "nick" : "Paul",\r
+      "login" : "paul49",\r
+      "email" : "paul@pierre.com",\r
+      "css" : "css/3/euphorik.css",
+      "nick_format" : "nick" | "login" | "nick_login",
+      "view_times" : true | false,
+      "view_tooltips" : true | false,\r
+      "main_page" : 1,
+      "conversations" : [
+         {
+            "racine" : 123,
+            "page" : 1
+         }
+      ],
+      "ek_master" : true | false\r
+   }
\r
+=== Logout ===
+c -> s\r
+   {\r
+      "action" : "logout",\r
+      "cookie" : "LKJDLAKSJBFLKASN"\r
+   }
\r
+=== Profile ===
+c -> s\r
+   {\r
+      "action" : "set_profile",\r
+      "cookie" : "LKJDLAKSJBFLKASN",\r
+      "login" : "paul49",\r
+      "password" : "IJKJDHHSAD9081238",\r
+      "nick" : "Paul",\r
+      "email" : "paul@pierre.com",\r
+      "css" : "css/3/euphorik.css",
+      "nick_format" : "nick" | "login" | "nick_login",
+      "view_times" : true | false,
+      "view_tooltips" : true | false,\r
+      "main_page" : 1,
+      "conversations" : [
+         {
+            "root" : 123,
+            "page" : 1
+         }
+      ]\r
+   }\r
+      
+s -> c
+   <ok>
+ou
+   <error>
+
+
+=== Wait event (page = chat) ===
+Si "last_message_id" est absent alors le client ne possède pas de message.
+Si "main_page" est absent alors est vaut 1.
+"cookie" n'est pas obligatoire.
+
+c -> s\r
+   {\r
+      "action" : "wait_event",
+      "page" : "chat"\r
+      "cookie" : "LKJDLAKSJBFLKASN",\r
+      "message_count" : 10,
+      "last_message_id" : 163,
+      "main_page" : 1,
+      "troll_id" : 45,
+      "conversations" : [
+         {
+            "racine" : 123,
+            "page" : 1,
+            "last_message_id" : 4 (pas obligatoire)
+         }
+      ]\r
+   }
+s -> c\r
+La première conversation est la principale (main).\r
+L'ordre des conversation est le même que celui des données de l'utilisateur.\r
+Le format de la date n'est pas formel.\r
+   {\r
+      "reply" : "new_message",\r
+      "conversations" : [\r
+         {\r
+            "last_page" : true | false,\r
+            "messages" : [
+               {\r
+                  "id" : 54,
+                  "user_id" : 344,\r
+                  "date" : "Hier 17:26:54",\r
+                  "system" : true | false,\r
+                  "owner" : true | false,\r
+                  "answered" : true | false,\r
+                  "is_a_reply" : true | false,\r
+                  "nick" : "Paul",\r
+                  "login" : "paul_22",\r
+                  "content" : "Salut",\r
+                  "answer_to" : [\r
+                     { "id" : 123, "nick" : "Pierre", "login" : "pierre_45" }\r
+                  ]
+                  "ek_master" : true | false
+               }\r
+            ]\r
+         }
+         ...\r
+      ]\r
+   }
+ou\r
+   {\r
+      "reply" : "message_updated",\r
+      "message_id" : 123,\r
+      "content" : "Salut +++ poulpe"\r
+   }
+ou
+   {
+      "reply" : "new_troll",
+      "troll_id" : 123,
+      "message_id" : 12,
+      "content" : "Linux sera desktop ready en 2008 ?"
+   }
+ou
+   <error>
+
+
+=== Wait event (page = admin) ===
+c -> s
+   {
+      "action" : "wait_event",
+      "page" : "admin",
+      "last_troll" : 5
+   }
+   
+s -> c
+   {
+      "reply" : "troll_modified",
+      "troll_id" : 3,
+      "content" : "plop"
+   }
+ou
+s -> c
+   {
+      "reply" : "troll_added",
+      "trolls" :
+         [
+            {
+               "troll_id" : 5,
+               "content" : "plop",
+               "author" : "<Pseudo>"
+               "author_id" : 2
+            }
+         ]
+   }
+ou
+s -> c
+   {
+      "reply" : "troll_deleted",
+      "troll_id" : 2
+   }
+ou
+indique de mettre à jour la liste d'ips
+s -> c
+   {
+      "reply" : "banned_ips_refresh"
+   }
+\r
+\r
+=== Envoie d'un troll ===\r
+c -> s\r
+   {\r
+      "action" : "put_troll",\r
+      "cookie" : "LKJDLAKSJBFLKASN",\r
+      "content" : "Un bon troll velu !"\r
+   }
+s -> c
+   <ok>
+ou
+   <error>
+   
+   \r
+=== Modification d'un troll ===
+c -> s
+   {
+      "action" : "mod_troll",
+      "cookie" : "LKJDLAKSJBFLKASN",
+      "troll_id" : 3,
+      "content" : "Un bon troll velu 2 !"
+   }
+s -> c
+   <ok>
+ou
+   <error>
+   
+   \r
+=== Suppression d'un troll ===
+c -> s
+   {
+      "action" : "del_troll",
+      "cookie" : "LKJDLAKSJBFLKASN",
+      "troll_id" : 3
+   }
+s -> c
+   <ok>
+ou
+   <error>
+   
+
+=== Envoie message ===
+Le client envoie un message, le message peut répondre à un certain nombre d'autres messages.
+"answer_to" n'est pas obligatoire.\r
+
+c -> s\r
+   {\r
+      "action" : "put_message",\r
+      "cookie" : "LKJDLAKSJBFLKASN",\r
+      "nick" : "Paul",\r
+      "content" : "Bonjour",\r
+      "answer_to" : [ 345, 532, ... ]\r
+   }
+s -> c
+   <ok>
+ou
+   <error>
+
+
+=== Slapage ===
+c -> s
+   {
+      "action" : "slap",
+      "cookie" :  "LKJDLAKSJBFLKASN",
+      "user_id" : 67,
+      "reason" : "blablabla"
+   }
+   
+s -> c
+   <ok>
+ou
+   <error>
+   
+
+=== Bannissement ===
+c -> s
+   {
+      "action" : "ban",
+      "cookie" : "LKJDLAKSJBFLKASN",
+      "duration" : 15, // en minute
+      "user_id" : 67,
+      "reason" : "blablabla"
+   }
+   
+s -> c
+   <ok>
+ou
+   <error>
+   
+   
+=== Liste des ip bannis ===
+c -> s
+   {
+      "action" : "list_banned_ips",
+      "cookie" : "LKJDLAKSJBFLKASN"
+   }
+
+s -> c 
+   {
+      "reply" : "list_banned_ips",
+      "list" : [
+         {
+            ip : "192.168.1.2", 
+            remaining_time : "1h23"
+            users : [
+               {
+                  nick : "Pierre" , 
+                  login : "pierre" 
+               }
+            ]
+         }
+      ]
+   }
+   
+
+=== Débannissement ===
+c -> s
+   {
+      "action" : "unban",
+      "cookie" : "LKJDLAKSJBFLKASN"
+      "ip" : "192.168.1.2"
+   }
+   
+s -> c
+   <ok>
+ou
+   <error>
+\r
\r
+=== Ajout d'une correction d'un messages ===\r
+Le client envoie un correctif sous la forme de texte supplémentaire à appondre au dernier messages.\r
+Le message est appondu avec un " +++ " devant, par exemple :\r
+> Gnome c'est mieux que KDE +++ Euh non ok, c'est faux\r
+\r
+c -> s\r
+   {\r
+      "action" : "correction",\r
+      "cookie" : "LKJDLAKSJBFLKASN",\r
+      "content" : "Euh non ok, c'est faux"\r
+   }\r
+   \r
+s -> c\r
+   {\r
+      "reply" : "correction",\r
+      "status" : "ok" | "error",\r
+      "message_error" : "blabla"\r
+   } 
diff --git a/doc/technique.txt b/doc/technique.txt
new file mode 100644 (file)
index 0000000..74a6360
--- /dev/null
@@ -0,0 +1,58 @@
+Euphorik - doc technique
+
+
+== euphorik.js ==
+Sequences :
+   * Chargement d'une page\r
+   \r
+=== Client ===
+== pageMinichat.js ==
+=== Classes ===
+   * Messages
+   * Conversation
+   * Message
+   
+=== Compilation avec +native ===
+Mesure du temps d'execution pour :
+   * euphorik_test:start(20, 20) : 20 personnes postants 20 messages
+      sans +native : 3:39
+      avec +native : 3.41
+      
+Conclusion : 
+   l'ajout de +native n'a pas de répercussions significatives sur les performances, cela provient
+   surement du fait que le gros du travail est fait du coté de la base de donnée Mnesia.
+   
+=== Séquences ===
+   * Attente de nouveaux messages
+      a) Messages.rafraichirMessages
+      b) pour chaque conversation
+         i) Messages.ajouterMessages(lesMessages, numConv)
+         ii) Conversation.flush
+         
+   * Ajout d'un message
+      PageMinichat.envoyerMessage(pseudo, message) : requête AJAX
+      
+   * Extraction d'une conversation
+      a) Conversation.click
+      b) Client.ajouterConversation(idMess)
+      c) Client.flush(false) // mise à jour du profile de manière synchrone
+      d) Messages.rafraichirMessages(true)
+   
+   * Suppression d'une conversation
+      
+=== Exemple de conversation ===
+Utilisé lors des tests
+
+m1
+m2 -> m1
+m3 -> m1
+m4 -> m2
+m5 -> m3
+m6 -> m3
+m7
+m8 -> m7
+m9 -> m7
+
+
+
+
diff --git a/doc/uml.zargo b/doc/uml.zargo
new file mode 100644 (file)
index 0000000..14e23be
Binary files /dev/null and b/doc/uml.zargo differ
diff --git a/favicon.ico b/favicon.ico
new file mode 100644 (file)
index 0000000..f1ea6b1
Binary files /dev/null and b/favicon.ico differ
diff --git a/img/ban.gif b/img/ban.gif
new file mode 100644 (file)
index 0000000..9a7d412
Binary files /dev/null and b/img/ban.gif differ
diff --git a/img/css1/copier_conv.png b/img/css1/copier_conv.png
new file mode 100644 (file)
index 0000000..be21326
Binary files /dev/null and b/img/css1/copier_conv.png differ
diff --git a/img/css1/copier_conv_hover.png b/img/css1/copier_conv_hover.png
new file mode 100644 (file)
index 0000000..344483e
Binary files /dev/null and b/img/css1/copier_conv_hover.png differ
diff --git a/img/css1/extraction.png b/img/css1/extraction.png
new file mode 100644 (file)
index 0000000..6140ab5
Binary files /dev/null and b/img/css1/extraction.png differ
diff --git a/img/css1/extraction_hover.png b/img/css1/extraction_hover.png
new file mode 100644 (file)
index 0000000..1a33ea3
Binary files /dev/null and b/img/css1/extraction_hover.png differ
diff --git a/img/css1/fermer_conv.png b/img/css1/fermer_conv.png
new file mode 100644 (file)
index 0000000..364bf50
Binary files /dev/null and b/img/css1/fermer_conv.png differ
diff --git a/img/css1/fermer_conv_hover.png b/img/css1/fermer_conv_hover.png
new file mode 100644 (file)
index 0000000..f527f3e
Binary files /dev/null and b/img/css1/fermer_conv_hover.png differ
diff --git a/img/css1/fleche.png b/img/css1/fleche.png
new file mode 100644 (file)
index 0000000..97aab99
Binary files /dev/null and b/img/css1/fleche.png differ
diff --git a/img/css1/fleche_bulle.png b/img/css1/fleche_bulle.png
new file mode 100644 (file)
index 0000000..0676a33
Binary files /dev/null and b/img/css1/fleche_bulle.png differ
diff --git a/img/css1/fleche_reponda.png b/img/css1/fleche_reponda.png
new file mode 100644 (file)
index 0000000..6f2e387
Binary files /dev/null and b/img/css1/fleche_reponda.png differ
diff --git a/img/css1/fond.png b/img/css1/fond.png
new file mode 100644 (file)
index 0000000..973b83b
Binary files /dev/null and b/img/css1/fond.png differ
diff --git a/img/css1/logo.png b/img/css1/logo.png
new file mode 100644 (file)
index 0000000..546676d
Binary files /dev/null and b/img/css1/logo.png differ
diff --git a/img/css1/logo_fond.png b/img/css1/logo_fond.png
new file mode 100644 (file)
index 0000000..3b9d33e
Binary files /dev/null and b/img/css1/logo_fond.png differ
diff --git a/img/css1/return.png b/img/css1/return.png
new file mode 100755 (executable)
index 0000000..51f1983
Binary files /dev/null and b/img/css1/return.png differ
diff --git a/img/css1/triangle.png b/img/css1/triangle.png
new file mode 100644 (file)
index 0000000..2fd067b
Binary files /dev/null and b/img/css1/triangle.png differ
diff --git a/img/css2/bouton_smiles.png b/img/css2/bouton_smiles.png
new file mode 100644 (file)
index 0000000..40a681d
Binary files /dev/null and b/img/css2/bouton_smiles.png differ
diff --git a/img/css2/fleche_bulle.png b/img/css2/fleche_bulle.png
new file mode 100644 (file)
index 0000000..627fed0
Binary files /dev/null and b/img/css2/fleche_bulle.png differ
diff --git a/img/css2/fond.png b/img/css2/fond.png
new file mode 100755 (executable)
index 0000000..2a46fbc
Binary files /dev/null and b/img/css2/fond.png differ
diff --git a/img/css2/logo_1.png b/img/css2/logo_1.png
new file mode 100755 (executable)
index 0000000..06318b0
Binary files /dev/null and b/img/css2/logo_1.png differ
diff --git a/img/css2/logo_2.png b/img/css2/logo_2.png
new file mode 100755 (executable)
index 0000000..0a7da96
Binary files /dev/null and b/img/css2/logo_2.png differ
diff --git a/img/css2/return.png b/img/css2/return.png
new file mode 100755 (executable)
index 0000000..b9d146b
Binary files /dev/null and b/img/css2/return.png differ
diff --git a/img/css3/logo.gif b/img/css3/logo.gif
new file mode 100755 (executable)
index 0000000..92f49bd
Binary files /dev/null and b/img/css3/logo.gif differ
diff --git a/img/css3/logo.png b/img/css3/logo.png
new file mode 100755 (executable)
index 0000000..dc6bd85
Binary files /dev/null and b/img/css3/logo.png differ
diff --git a/img/css3/piedpage.png b/img/css3/piedpage.png
new file mode 100755 (executable)
index 0000000..095fdb7
Binary files /dev/null and b/img/css3/piedpage.png differ
diff --git a/img/exclamation.gif b/img/exclamation.gif
new file mode 100755 (executable)
index 0000000..46bb733
Binary files /dev/null and b/img/exclamation.gif differ
diff --git a/img/fermer.gif b/img/fermer.gif
new file mode 100755 (executable)
index 0000000..3d78493
Binary files /dev/null and b/img/fermer.gif differ
diff --git a/img/information.gif b/img/information.gif
new file mode 100755 (executable)
index 0000000..c75a5d6
Binary files /dev/null and b/img/information.gif differ
diff --git a/img/interrogation.gif b/img/interrogation.gif
new file mode 100755 (executable)
index 0000000..47fd4b0
Binary files /dev/null and b/img/interrogation.gif differ
diff --git a/img/kick.gif b/img/kick.gif
new file mode 100644 (file)
index 0000000..ce127dd
Binary files /dev/null and b/img/kick.gif differ
diff --git a/img/lightbox-blank.gif b/img/lightbox-blank.gif
new file mode 100644 (file)
index 0000000..1d11fa9
Binary files /dev/null and b/img/lightbox-blank.gif differ
diff --git a/img/lightbox-btn-close.gif b/img/lightbox-btn-close.gif
new file mode 100644 (file)
index 0000000..33bcf51
Binary files /dev/null and b/img/lightbox-btn-close.gif differ
diff --git a/img/lightbox-btn-next.gif b/img/lightbox-btn-next.gif
new file mode 100644 (file)
index 0000000..a0d4fcf
Binary files /dev/null and b/img/lightbox-btn-next.gif differ
diff --git a/img/lightbox-btn-prev.gif b/img/lightbox-btn-prev.gif
new file mode 100644 (file)
index 0000000..040ee59
Binary files /dev/null and b/img/lightbox-btn-prev.gif differ
diff --git a/img/lightbox-ico-loading.gif b/img/lightbox-ico-loading.gif
new file mode 100644 (file)
index 0000000..4f1429c
Binary files /dev/null and b/img/lightbox-ico-loading.gif differ
diff --git a/img/loading.gif b/img/loading.gif
new file mode 100644 (file)
index 0000000..166fe85
Binary files /dev/null and b/img/loading.gif differ
diff --git a/img/powered-by-yaws.gif b/img/powered-by-yaws.gif
new file mode 100755 (executable)
index 0000000..8c874d8
Binary files /dev/null and b/img/powered-by-yaws.gif differ
diff --git a/img/slap.gif b/img/slap.gif
new file mode 100644 (file)
index 0000000..2265fda
Binary files /dev/null and b/img/slap.gif differ
diff --git a/img/smileys/agreed.gif b/img/smileys/agreed.gif
new file mode 100644 (file)
index 0000000..b7a08e1
Binary files /dev/null and b/img/smileys/agreed.gif differ
diff --git a/img/smileys/alien.gif b/img/smileys/alien.gif
new file mode 100755 (executable)
index 0000000..b75a32b
Binary files /dev/null and b/img/smileys/alien.gif differ
diff --git a/img/smileys/argn.gif b/img/smileys/argn.gif
new file mode 100755 (executable)
index 0000000..63d39a8
Binary files /dev/null and b/img/smileys/argn.gif differ
diff --git a/img/smileys/autres/icon_angry.gif b/img/smileys/autres/icon_angry.gif
new file mode 100755 (executable)
index 0000000..15f9ccb
Binary files /dev/null and b/img/smileys/autres/icon_angry.gif differ
diff --git a/img/smileys/autres/icon_chinese.gif b/img/smileys/autres/icon_chinese.gif
new file mode 100755 (executable)
index 0000000..b162cfb
Binary files /dev/null and b/img/smileys/autres/icon_chinese.gif differ
diff --git a/img/smileys/autres/icon_confused.gif b/img/smileys/autres/icon_confused.gif
new file mode 100755 (executable)
index 0000000..b20fcb3
Binary files /dev/null and b/img/smileys/autres/icon_confused.gif differ
diff --git a/img/smileys/autres/icon_cool.gif b/img/smileys/autres/icon_cool.gif
new file mode 100755 (executable)
index 0000000..bf0fd09
Binary files /dev/null and b/img/smileys/autres/icon_cool.gif differ
diff --git a/img/smileys/autres/icon_largesmile.gif b/img/smileys/autres/icon_largesmile.gif
new file mode 100755 (executable)
index 0000000..19c523f
Binary files /dev/null and b/img/smileys/autres/icon_largesmile.gif differ
diff --git a/img/smileys/autres/icon_lol.gif b/img/smileys/autres/icon_lol.gif
new file mode 100755 (executable)
index 0000000..ebbec8b
Binary files /dev/null and b/img/smileys/autres/icon_lol.gif differ
diff --git a/img/smileys/autres/icon_mrgreen.gif b/img/smileys/autres/icon_mrgreen.gif
new file mode 100755 (executable)
index 0000000..29280bb
Binary files /dev/null and b/img/smileys/autres/icon_mrgreen.gif differ
diff --git a/img/smileys/autres/icon_neutral.gif b/img/smileys/autres/icon_neutral.gif
new file mode 100755 (executable)
index 0000000..6341536
Binary files /dev/null and b/img/smileys/autres/icon_neutral.gif differ
diff --git a/img/smileys/autres/icon_redface.gif b/img/smileys/autres/icon_redface.gif
new file mode 100755 (executable)
index 0000000..6670542
Binary files /dev/null and b/img/smileys/autres/icon_redface.gif differ
diff --git a/img/smileys/autres/icon_rolleyes.gif b/img/smileys/autres/icon_rolleyes.gif
new file mode 100755 (executable)
index 0000000..b2aab79
Binary files /dev/null and b/img/smileys/autres/icon_rolleyes.gif differ
diff --git a/img/smileys/autres/icon_sad.gif b/img/smileys/autres/icon_sad.gif
new file mode 100755 (executable)
index 0000000..31cdd5f
Binary files /dev/null and b/img/smileys/autres/icon_sad.gif differ
diff --git a/img/smileys/autres/icon_smile.gif b/img/smileys/autres/icon_smile.gif
new file mode 100755 (executable)
index 0000000..71cd97a
Binary files /dev/null and b/img/smileys/autres/icon_smile.gif differ
diff --git a/img/smileys/autres/icon_surprised.gif b/img/smileys/autres/icon_surprised.gif
new file mode 100755 (executable)
index 0000000..3fdfc9d
Binary files /dev/null and b/img/smileys/autres/icon_surprised.gif differ
diff --git a/img/smileys/autres/icon_tongue.gif b/img/smileys/autres/icon_tongue.gif
new file mode 100755 (executable)
index 0000000..5e25f32
Binary files /dev/null and b/img/smileys/autres/icon_tongue.gif differ
diff --git a/img/smileys/autres/icon_whistle.gif b/img/smileys/autres/icon_whistle.gif
new file mode 100755 (executable)
index 0000000..9c20056
Binary files /dev/null and b/img/smileys/autres/icon_whistle.gif differ
diff --git a/img/smileys/autres/icon_wink.gif b/img/smileys/autres/icon_wink.gif
new file mode 100755 (executable)
index 0000000..c9e1a66
Binary files /dev/null and b/img/smileys/autres/icon_wink.gif differ
diff --git a/img/smileys/bigsmile.gif b/img/smileys/bigsmile.gif
new file mode 100755 (executable)
index 0000000..b54cd0f
Binary files /dev/null and b/img/smileys/bigsmile.gif differ
diff --git a/img/smileys/bn.gif b/img/smileys/bn.gif
new file mode 100644 (file)
index 0000000..dba4463
Binary files /dev/null and b/img/smileys/bn.gif differ
diff --git a/img/smileys/boh.gif b/img/smileys/boh.gif
new file mode 100644 (file)
index 0000000..467b7fe
Binary files /dev/null and b/img/smileys/boh.gif differ
diff --git a/img/smileys/bunny.gif b/img/smileys/bunny.gif
new file mode 100755 (executable)
index 0000000..5faa5d5
Binary files /dev/null and b/img/smileys/bunny.gif differ
diff --git a/img/smileys/chat.gif b/img/smileys/chat.gif
new file mode 100755 (executable)
index 0000000..33cb58f
Binary files /dev/null and b/img/smileys/chat.gif differ
diff --git a/img/smileys/clin.gif b/img/smileys/clin.gif
new file mode 100755 (executable)
index 0000000..13d446d
Binary files /dev/null and b/img/smileys/clin.gif differ
diff --git a/img/smileys/cool.gif b/img/smileys/cool.gif
new file mode 100755 (executable)
index 0000000..c3aff9d
Binary files /dev/null and b/img/smileys/cool.gif differ
diff --git a/img/smileys/dodo.gif b/img/smileys/dodo.gif
new file mode 100644 (file)
index 0000000..7a32d09
Binary files /dev/null and b/img/smileys/dodo.gif differ
diff --git a/img/smileys/eheheh.gif b/img/smileys/eheheh.gif
new file mode 100755 (executable)
index 0000000..4fc3e19
Binary files /dev/null and b/img/smileys/eheheh.gif differ
diff --git a/img/smileys/heink.gif b/img/smileys/heink.gif
new file mode 100644 (file)
index 0000000..1bf9963
Binary files /dev/null and b/img/smileys/heink.gif differ
diff --git a/img/smileys/hum.gif b/img/smileys/hum.gif
new file mode 100644 (file)
index 0000000..db24401
Binary files /dev/null and b/img/smileys/hum.gif differ
diff --git a/img/smileys/kirby.gif b/img/smileys/kirby.gif
new file mode 100755 (executable)
index 0000000..19784c5
Binary files /dev/null and b/img/smileys/kirby.gif differ
diff --git a/img/smileys/lol.gif b/img/smileys/lol.gif
new file mode 100755 (executable)
index 0000000..b5e7153
Binary files /dev/null and b/img/smileys/lol.gif differ
diff --git a/img/smileys/oh.gif b/img/smileys/oh.gif
new file mode 100755 (executable)
index 0000000..18d3abb
Binary files /dev/null and b/img/smileys/oh.gif differ
diff --git a/img/smileys/pascontent.gif b/img/smileys/pascontent.gif
new file mode 100755 (executable)
index 0000000..7297a64
Binary files /dev/null and b/img/smileys/pascontent.gif differ
diff --git a/img/smileys/redface.gif b/img/smileys/redface.gif
new file mode 100644 (file)
index 0000000..6e08e7b
Binary files /dev/null and b/img/smileys/redface.gif differ
diff --git a/img/smileys/renne.gif b/img/smileys/renne.gif
new file mode 100755 (executable)
index 0000000..71c6316
Binary files /dev/null and b/img/smileys/renne.gif differ
diff --git a/img/smileys/slurp.gif b/img/smileys/slurp.gif
new file mode 100755 (executable)
index 0000000..ab3ca57
Binary files /dev/null and b/img/smileys/slurp.gif differ
diff --git a/img/smileys/smile.gif b/img/smileys/smile.gif
new file mode 100755 (executable)
index 0000000..3fb63ae
Binary files /dev/null and b/img/smileys/smile.gif differ
diff --git a/img/smileys/sniff.gif b/img/smileys/sniff.gif
new file mode 100755 (executable)
index 0000000..da1895d
Binary files /dev/null and b/img/smileys/sniff.gif differ
diff --git a/img/smileys/spliff.gif b/img/smileys/spliff.gif
new file mode 100755 (executable)
index 0000000..a7338cb
Binary files /dev/null and b/img/smileys/spliff.gif differ
diff --git a/img/smileys/star.gif b/img/smileys/star.gif
new file mode 100755 (executable)
index 0000000..5259b73
Binary files /dev/null and b/img/smileys/star.gif differ
diff --git a/img/smileys/triste.gif b/img/smileys/triste.gif
new file mode 100755 (executable)
index 0000000..0d8abc8
Binary files /dev/null and b/img/smileys/triste.gif differ
diff --git a/index.yaws b/index.yaws
new file mode 100755 (executable)
index 0000000..f345df0
--- /dev/null
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"\r
+"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
+<head>
+   <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+   <title>euphorik.ch</title>
+   <erl>
+      out(A) -> 
+         CSS = case euphorik_bd:css_from_user_cookie(yaws_api:find_cookie_val("cookie", A)) of
+            undefined -> "css/1/euphorik.css";
+            C -> C
+         end,
+         {ehtml, {link ,
+            [
+               {id, "cssPrincipale" },
+               {rel, "stylesheet"},
+               {href, CSS},
+               {type, "text/css"},
+               {media, "screen"}
+            ], []}
+         }.
+   </erl>
+   <link rel="stylesheet" href="css/jquery.lightbox.css" type="text/css" media="screen" ></link>
+   <script type="text/javascript" src="js/jquery.js" ></script>
+   <script type="text/javascript" src="js/jquery.lightbox.js"></script>
+   <script type="text/javascript" src="js/md5.js" ></script>
+   <script type="text/javascript" src="js/json2.js" ></script>
+   <script type="text/javascript" src="js/pageMinichat.js" ></script>
+   <script type="text/javascript" src="js/pageAdmin.js" ></script>
+   <script type="text/javascript" src="js/pageProfile.js" ></script>
+   <script type="text/javascript" src="js/pageRegister.js" ></script>
+   <script type="text/javascript" src="js/pageAbout.js" ></script>
+   <script type="text/javascript" src="js/euphorik.js" ></script>
+</head>
+   <body>
+      <div id="container">
+         <div id="logo"></div>\r
+         <div id="info" style="display:none" ><div id="icone"></div><div class="fermer" ></div><div class="message" ></div><div class="boutons"></div></div>
+         <ul id="menu">
+            <li class="minichat">chat</li><li class="admin" style="display:none">admin</li><li class="profile"></li><li class="register">register</li><li class="logout">logout</li><li class="about">about</li>\r
+         </ul>
+         <form action=""  id="formMenuCss">
+            <p>
+               <select id="menuCss">
+                  <option value="1" selected="selected">Retro</option>
+                  <option value="2">Dark</option>
+               </select>
+            </p>
+         </form> 
+         <div id="page"></div>
+         <div id="footer"><span class="copyright">copyright 2008 euphorik.ch</span><span class="conditions lien">conditions d'utilisation</span><a href="http://yaws.hyber.org"><img src="img/powered-by-yaws.gif" alt="powered by Yaws" /></a></div>
+      </div>
+   </body>
+</html>
\ No newline at end of file
diff --git a/js/debug.js b/js/debug.js
new file mode 100644 (file)
index 0000000..c598eed
--- /dev/null
@@ -0,0 +1,90 @@
+// coding: utf-8\r
+// Copyright 2008 Grégory Burri\r
+//\r
+// This file is part of Euphorik.\r
+//\r
+// Euphorik is free software: you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation, either version 3 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// Euphorik is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with Euphorik.  If not, see <http://www.gnu.org/licenses/>.\r
+\r
+/**
+  * Affiche un objet quelconque sur la sortie du navigateur.
+  */
+var dumpObj = function(obj, name)
+{
+   if (typeof(dump) == "undefined")
+      return
+   
+   dump("---" + (name == undefined ? "" : " : " + name) + "\n")
+   dump(obj2text(obj))
+   dump("\n---\n")
+}
+
+var obj2text = function(obj, curDepth)
+{
+   if (curDepth == undefined)
+      curDepth = 0;
+   
+   var acc = ""
+
+   if (obj == undefined)
+   {
+      acc += "<undefined>"
+   }
+   else if (typeof(obj) == "string")
+   {
+      acc += "\"" + obj + "\""
+   }
+   else if (obj.length != undefined) // array
+   {
+      acc += "["
+      
+      var i = 0
+      for (; i < obj.length; i++)
+      {
+         if (i != 0) acc += ","
+         acc += "\n" + indent(curDepth + 1, obj2text(obj[i], curDepth + 1))
+      }
+      
+      acc += (i == 0 ? "]" : "\n" + indent(curDepth, "]"))
+   }
+   else if (typeof(obj) == "object")
+   {
+      acc += "{"
+      var i = 0
+      for (prop in obj)
+      {
+         if (i != 0) acc += ","
+         acc += "\n" + indent(curDepth + 1, prop + " : " + obj2text(obj[prop], curDepth + 1))
+         i += 1
+      }
+      acc += "\n" + indent(curDepth, "}")
+   }
+   else if (typeof(obj) == "function")
+   {
+      acc += "<function>"
+   }
+   else // value
+   {
+      acc += obj
+   }
+   
+   return acc
+}
+
+var indent = function(depth, text)
+{
+   var indentText = ""
+   for (var i = 0; i < depth * 3; i++)
+      indentText += " "
+   return indentText + text
+}
diff --git a/js/euphorik.js b/js/euphorik.js
new file mode 100755 (executable)
index 0000000..1df73d3
--- /dev/null
@@ -0,0 +1,1176 @@
+// coding: utf-8
+// Copyright 2008 Grégory Burri
+//
+// This file is part of Euphorik.
+//
+// Euphorik is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Euphorik is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Euphorik.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+  * Contient la base javascript pour le site euphorik.ch.
+  * Chaque page possède son propre fichier js nommé "page<nom de la page>.js".
+  * Auteur : GBurri
+  * Date : 6.11.2007
+  */
+  
+
+/**
+  * La configuration.
+  * Normalement 'const' à la place de 'var' mais non supporté par IE7.
+  */
+var conf = {
+   nbMessageAffiche : 40, // (par page)
+   pseudoDefaut : "<nick>",
+   tempsAffichageMessageDialogue : 4000, // en ms
+   tempsKick : 15, // en minute
+   tempsBan : 60 * 24 * 3, // en minutes (3jours)
+   smiles : {   
+      "smile" : [/:\)/g, /:-\)/g],  
+      "bigsmile" : [/:D/g, /:-D/g],
+      "clin" : [/;\)/g, /;-\)/g],
+      "cool" : [/8\)/g, /8-\)/g],
+      "eheheh" : [/:P/g, /:-P/g],
+      "lol" : [/\[-lol\]/g],
+      "spliff" : [/\[-spliff\]/g],
+      "oh" : [/:o/g, /:O/g],
+      "heink" : [/\[-heink\]/g],
+      "hum" : [/\[-hum\]/g],
+      "boh" : [/\[-boh\]/g],
+      "sniff" : [/:\(/g, /:-\(/g],
+      "triste" : [/\[-triste\]/g],
+      "pascontent" : [/>\(/g, /&gt;\(/g],
+      "argn" : [/\[-argn\]/g],
+      "redface" : [/\[-redface\]/g],
+      "bunny" : [/\[-lapin\]/g],
+      "chat" : [/\[-chat\]/g],
+      "renne" : [/\[-renne\]/g],
+      "star" : [/\[-star\]/g],
+      "kirby" : [/\[-kirby\]/g],
+      "slurp" : [/\[-slurp\]/g],
+      "agreed" : [/\[-agreed\]/g],
+      "dodo" : [/\[-dodo\]/g],
+      "bn" : [/\[-bn\]/g]
+   }
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+String.prototype.trim = function()
+{
+       return jQuery.trim(this) // anciennement : this.replace(/^\s+|\s+$/g, "");
+}
+
+String.prototype.ltrim = function()
+{
+       return this.replace(/^\s+/, "");
+}
+
+String.prototype.rtrim = function()
+{
+       return this.replace(/\s+$/, "");
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+  * Cette classe regroupe des fonctions utilitaires (helpers).
+  * @formateur est permet de formater les messages affichés à l'aide de messageDialogue (facultatif)
+  */
+function Util(formateur)
+{
+   $("#info .fermer").click(function(){
+      $("#info").slideUp(50) 
+   })
+   
+   $("body").append('<div id="flecheBulle"></div>').append('<div id="messageBulle"><p></p></div>')
+   
+   this.formateur = formateur
+   this.bulleActive = true
+}
+
+var messageType = {informatif: 0, question: 1, erreur: 2}
+
+/**
+  * Affiche une boite de dialogue avec un message à l'intérieur.
+  * @param message le message (string)
+  * @param type voir 'messageType'. par défaut messageType.informatif
+  * @param les boutons sous la forme d'un objet ou les clefs sont les labels des boutons
+  *        et les valeurs les fonctions executées lorsqu'un bouton est activé.
+  * @param formate faut-il formaté le message ? true par défaut
+  */
+Util.prototype.messageDialogue = function(message, type, boutons, formate)
+{
+   var thisUtil = this
+
+   if (type == undefined)
+      type = messageType.informatif
+      
+   if (formate == undefined)
+      formate = true
+
+   if (this.timeoutMessageDialogue != undefined)
+      clearTimeout(this.timeoutMessageDialogue)
+      
+   var fermer = function(){$("#info").slideUp(100)}
+   fermer()   
+   
+   $("#info .message").html(thisUtil.formateur == undefined || !formate ? message : thisUtil.formateur.traitementComplet(message))
+   switch(type)
+   {
+      case messageType.informatif : $("#info #icone").attr("class", "information"); break
+      case messageType.question : $("#info #icone").attr("class", "interrogation"); break
+      case messageType.erreur : $("#info #icone").attr("class", "exclamation"); break
+   }   
+   $("#info .boutons").html("")
+   for (var b in boutons)
+      $("#info .boutons").append("<div>" + b + "</div>").find("div:last").click(boutons[b]).click(fermer)
+   
+   $("#info").slideDown(200)
+   this.timeoutMessageDialogue = setTimeout(fermer, conf.tempsAffichageMessageDialogue)   
+}
+
+/**
+  * Affiche un info bulle lorsque le curseur survole l'élément donné.
+  * FIXME : le width de element ne tient pas compte du padding !?
+  */
+Util.prototype.infoBulle = function(message, element)
+{
+   var thisUtil = this
+
+   var cacherBulle = function()
+      {   
+         $("#flecheBulle").hide()
+         $("#messageBulle").hide()
+      }
+
+   element.hover(
+      function(e)
+      {
+         if (!thisUtil.bulleActive)
+            return
+                  
+         var m = $("#messageBulle")
+         var f = $("#flecheBulle")
+         
+         // remplie le paragraphe de la bulle avec le message
+         $("p", m).html(message)
+         
+         // réinitialise la position, évite le cas ou la boite est collé à droite et remplie avec un texte la faisant dépassé
+         // dans ce cas la hauteur n'est pas calculé correctement
+         m.css("top", 0).css("left", 0)
+         
+         var positionFleche = {
+            left : element.offset().left + element.width() / 2 - f.width() / 2,
+            top : element.offset().top - f.height()
+         }
+         var positionMessage = {
+            left : element.offset().left + element.width() / 2 - m.width() / 2,
+            top : element.offset().top - f.height() - m.height()
+         }
+         var depassementDroit = (positionMessage.left + m.width()) - $("body").width()
+         if (depassementDroit > 0)
+            positionMessage.left -= depassementDroit
+         else
+         {
+            if (positionMessage.left < 0)
+               positionMessage.left = 0
+         }
+         
+         m.css("top", positionMessage.top).css("left", positionMessage.left).show()
+         f.css("top", positionFleche.top).css("left", positionFleche.left).show()
+      },
+      cacherBulle
+   ).click(cacherBulle)
+}
+
+/**
+  * Utilisé pour l'envoie de donnée avec la méthode ajax de jQuery.
+  */
+Util.prototype.jsonVersAction = function(json)
+{
+   return {action : JSON.stringify(json) }
+}
+
+Util.prototype.md5 = function(chaine)
+{
+   return hex_md5(chaine)
+}
+
+// pompé de http://www.faqts.com/knowledge_base/view.phtml/aid/13562/fid/130
+Util.prototype.setSelectionRange = function(input, selectionStart, selectionEnd)
+{
+   if (input.setSelectionRange)
+   {
+      input.focus()
+      input.setSelectionRange(selectionStart, selectionEnd)
+   }
+   else if (input.createTextRange)
+   {
+      var range = input.createTextRange()
+      range.collapse(true)
+      range.moveEnd('character', selectionEnd)
+      range.moveStart('character', selectionStart)
+      range.select()
+   }
+}
+
+Util.prototype.setCaretToEnd = function(input)
+{
+   this.setSelectionRange(input, input.value.length, input.value.length)
+}
+Util.prototype.setCaretToBegin = function(input)
+{
+   this.setSelectionRange(input, 0, 0)
+}
+Util.prototype.setCaretToPos = function(input, pos)
+{
+   this.setSelectionRange(input, pos, pos)
+}
+Util.prototype.selectString = function(input, string)
+{
+   var match = new RegExp(string, "i").exec(input.value)
+   if (match)
+   {
+      this.setSelectionRange (input, match.index, match.index + match[0].length)
+   }
+}
+Util.prototype.replaceSelection = function(input, replaceString) {
+   if (input.setSelectionRange)
+   {
+      var selectionStart = input.selectionStart
+      var selectionEnd = input.selectionEnd
+      input.value = input.value.substring(0, selectionStart) + replaceString + input.value.substring(selectionEnd)
+      
+      if (selectionStart != selectionEnd) // has there been a selection
+         this.setSelectionRange(input, selectionStart, selectionStart + replaceString.length)
+      else // set caret
+         this.setCaretToPos(input, selectionStart + replaceString.length)
+   }
+   else if (document.selection)
+   {
+      input.focus()
+      var range = document.selection.createRange()
+      if (range.parentElement() == input)
+      {
+         var isCollapsed = range.text == ''
+         range.text = replaceString
+         if (!isCollapsed)
+         {
+            range.moveStart('character', -replaceString.length);
+         }
+      }
+   }
+}
+
+Util.prototype.rot13 = function(chaine)
+{
+   var ACode = 'A'.charCodeAt(0)
+   var aCode = 'a'.charCodeAt(0)
+   var MCode = 'M'.charCodeAt(0)
+   var mCode = 'm'.charCodeAt(0)
+   var ZCode = 'Z'.charCodeAt(0)
+   var zCode = 'z'.charCodeAt(0)
+
+   var f = function(ch, pos) {
+      if (pos == ch.length)
+         return ""
+      
+      var c = ch.charCodeAt(pos);
+      return String.fromCharCode(
+         c +
+         (c >= ACode && c <= MCode || c >= aCode && c <= mCode ? 13 :
+         (c > MCode && c <= ZCode || c > mCode && c <= zCode ? -13 : 0))
+      ) + f(ch, pos + 1)
+   }
+   return f(chaine, 0)
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+function Pages()
+{
+   this.pageCourante = null
+   this.pages = {}
+}
+
+/**
+  * Accepte soit un objet soit un string.
+  * un string correspond au nom de la page, par exemple : "page" -> "page.html"
+  */
+Pages.prototype.ajouterPage = function(page)
+{
+   if (typeof page == "string")
+   {
+      this.pages[page] = page
+   }
+   else
+   {
+      page.pages = this // la magie des langages dynamiques : le foutoire
+      this.pages[page.nom] = page
+   }
+}
+
+Pages.prototype.afficherPage = function(nomPage, forcerChargement)
+{
+   if (forcerChargement == undefined) forcerChargement = false
+
+   var page = this.pages[nomPage]
+   if (page == undefined || (!forcerChargement && page == this.pageCourante)) return
+   
+   if (this.pageCourante != null && this.pageCourante.decharger)
+      this.pageCourante.decharger()
+  
+   $("#menu li").removeClass("courante")
+   $("#menu li." + nomPage).addClass("courante")
+      
+   this.pageCourante = page
+   var contenu = ""
+   if (typeof page == "string")
+      $.ajax({async: false, url: "pages/" + page + ".html", success : function(page) { contenu += page }})
+   else
+      contenu += this.pageCourante.contenu()
+   $("#page").html(contenu).removeClass().addClass(this.pageCourante.nom)
+   
+   if (this.pageCourante.charger)
+      this.pageCourante.charger()
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+  * Classe permettant de formater du texte par exemple pour la substitution des liens dans les
+  * message par "[url]".
+  * TODO : améliorer l'efficacité des méthods notamment lié au smiles.
+  */
+function Formateur()
+{
+   this.smiles = conf.smiles
+   this.protocoles = "http|https|ed2k"
+   
+   this.regexUrl = new RegExp("(?:(?:" + this.protocoles + ")://|www\\.)[^ ]*", "gi")
+   this.regexImg = new RegExp("^.*?\\.(gif|jpg|png|jpeg|bmp|tiff)$", "i")
+   this.regexDomaine = new RegExp("^(?:(?:" + this.protocoles + ")://|www\\.).*?([^/.]+\\.[^/.]+)(?:$|/).*$", "i")
+   this.regexTestProtocoleExiste = new RegExp("^(?:" + this.protocoles + ")://.*$", "i")
+   this.regexNomProtocole = new RegExp("^(.*?)://")
+}
+
+/**
+  * Formate un pseudo saise par l'utilisateur.
+  * @param pseudo le pseudo brut
+  * @return le pseudo filtré
+  */
+Formateur.prototype.filtrerInputPseudo = function(pseudo)
+{
+   return pseudo.replace(/{|}/g, "").trim()
+}
+
+Formateur.prototype.getSmilesHTML = function()
+{
+   var XHTML = ""
+   for (var sNom in this.smiles)
+   {
+      XHTML += "<img class=\"" + sNom + "\" src=\"img/smileys/" + sNom + ".gif\" alt =\"" + sNom + "\" />"
+   }
+   return XHTML
+}
+
+/**
+  * Formatage complet d'un texte.
+  * @M le message
+  * @pseudo facultatif, permet de contruire le label des images sous la forme : "<Pseudo> : <Message>"
+  */
+Formateur.prototype.traitementComplet = function(M, pseudo)
+{
+   return this.traiterLiensConv(this.traiterSmiles(this.traiterURL(this.traiterWikiSyntaxe(this.remplacerBalisesHTML(M)), pseudo)))
+}
+
+/**
+  * Transforme les liens en entités clickables.
+  * Un lien vers une conversation permet d'ouvrire celle ci, elle se marque comme ceci dans un message :
+  * "{5F}" ou 5F est la racine de la conversation.
+  * Ce lien sera transformer en <span class="lienConv">{5F}</span> pouvant être clické pour créer la conv 5F.
+  */
+Formateur.prototype.traiterLiensConv = function(M)
+{
+   return M.replace(
+      /\{\w+\}/g,
+      function(lien)
+      {
+         return "<span class=\"lienConv\">" + lien + "</span>"
+      }
+   )
+}
+
+/**
+  * FIXME : Cette méthode est attrocement lourde ! A optimiser.
+  * moyenne sur échantillon : 234ms
+  */
+Formateur.prototype.traiterSmiles = function(M)
+{  
+   for (var sNom in this.smiles)
+   {
+      ss = this.smiles[sNom]
+      for (var i = 0; i < ss.length; i++)       
+         M = M.replace(ss[i], "<img src=\"img/smileys/" + sNom + ".gif\" alt =\"" + sNom + "\"  />")
+   }
+   return M
+}
+
+Formateur.prototype.remplacerBalisesHTML = function(M)
+{
+   return M.replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;")
+}
+
+Formateur.prototype.traiterURL = function(M, pseudo)
+{
+   thisFormateur = this
+         
+   var traitementUrl = function(url)
+   {    
+      // si ya pas de protocole on rajoute "http://"
+      if (!thisFormateur.regexTestProtocoleExiste.test(url))
+         url = "http://" + url
+      var extension = thisFormateur.getShort(url)
+      return "<a " + (extension[1] ? "title=\"" + (pseudo == undefined ? "" : thisFormateur.traiterPourFenetreLightBox(pseudo, url) + ": ") +  thisFormateur.traiterPourFenetreLightBox(M, url) + "\"" + " rel=\"lightbox\"" : "") + " href=\"" + url + "\" >[" + extension[0] + "]</a>"
+   }
+   return M.replace(this.regexUrl, traitementUrl)
+}
+
+/**
+  * Formatage en utilisant un sous-ensemble des règles de mediwiki.
+  * par exemple ''italic'' devient <i>italic</i>
+  */
+Formateur.prototype.traiterWikiSyntaxe = function(M)
+{
+   return M.replace(
+      /'''(.*?)'''/g,
+      function(texte, capture)
+      {
+         return "<b>" + capture + "</b>"
+      }
+   ).replace(
+      /''(.*?)''/g,
+      function(texte, capture)
+      {
+         return "<i>" + capture + "</i>"
+      }
+   )
+}
+
+/**
+  * Renvoie une version courte de l'url.
+  * par exemple : http://en.wikipedia.org/wiki/Yakov_Smirnoff devient wikipedia.org
+  */
+Formateur.prototype.getShort = function(url)
+{
+      var estUneImage = false
+      var versionShort = null
+      var rechercheImg = this.regexImg.exec(url)
+      
+      if (rechercheImg != null)
+      {
+         versionShort = rechercheImg[1].toLowerCase()
+         if (versionShort == "jpeg") versionShort = "jpg" // jpeg -> jpg
+         estUneImage = true
+      }
+      else
+      {
+         var rechercheDomaine = this.regexDomaine.exec(url)
+         if (rechercheDomaine != null && rechercheDomaine.length >= 2)
+            versionShort = rechercheDomaine[1]
+         else
+         {
+            var nomProtocole = this.regexNomProtocole.exec(url)
+            if (nomProtocole != null && nomProtocole.length >= 2)
+               versionShort = nomProtocole[1]
+         }
+      }
+      
+      return [versionShort == null ? "url" : versionShort, estUneImage]
+ }
+/**
+  * Traite les pseudo et messages à être affiché dans le titre d'une image visualisé avec lightbox.
+  */
+Formateur.prototype.traiterPourFenetreLightBox = function(M, urlCourante)
+{
+   thisFormateur = this
+   var traitementUrl = function(url)
+   {
+      return "[" + thisFormateur.getShort(url)[0] + (urlCourante == url ? "*" : "") + "]"
+   }
+   
+   return this.remplacerBalisesHTML(M).replace(this.regexUrl, traitementUrl)
+}
+
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+// les statuts possibes du client
+var statutType = {
+   // mode enregistré, peut poster des messages et modifier son profile
+   auth_registered : 0,
+   // mode identifié, peut poster des messages mais n'a pas accès au profile
+   auth_not_registered : 1,
+   // mode déconnecté, ne peut pas poster de message
+   deconnected : 2
+}
+
+function Client(util)
+{
+   this.util = util
+   
+   this.cookie = null
+   this.regexCookie = new RegExp("^cookie=([^;]*)")
+   
+   // données personnels
+   this.resetDonneesPersonnelles()
+   
+   this.setStatut(statutType.deconnected)
+   
+   // si true alors chaque modification du client est mémorisé sur le serveur
+   this.autoflush = $.browser["opera"]
+}
+
+Client.prototype.resetDonneesPersonnelles = function()
+{
+   this.id = 0
+   this.pseudo = conf.pseudoDefaut
+   this.login = ""
+   this.password = ""
+   this.email = ""
+   this.css = $("link#cssPrincipale").attr("href")
+   this.nickFormat = "nick"
+   this.viewTimes = true
+   this.viewTooltips = true
+   this.cookie = undefined
+   
+   this.pagePrincipale = 1
+   this.ekMaster = false
+   
+   // les conversations, une conversation est un objet possédant les attributs suivants :
+   // - racine (entier)
+   // - page (entier)
+   this.conversations = new Array()
+}
+
+Client.prototype.setCss = function(css)
+{
+   if (this.css == css || css == "")
+      return
+
+   this.css = css
+   $("link#cssPrincipale").attr("href", this.css)
+   if (this.autoflush) this.flush(true)
+}
+
+Client.prototype.pageSuivante = function(numConv)
+{
+   if (numConv < 0 && this.pagePrincipale > 1)
+      this.pagePrincipale -= 1
+   else if (this.conversations[numConv].page > 1)
+      this.conversations[numConv].page -= 1
+}
+
+Client.prototype.pagePrecedente = function(numConv)
+{
+   if (numConv < 0)
+      this.pagePrincipale += 1
+   else 
+      this.conversations[numConv].page += 1
+}
+
+/**
+  * Définit la première page pour la conversation donnée.
+  * @return true si la page a changé sinon false
+  */
+Client.prototype.goPremierePage = function(numConv)
+{
+   if (numConv < 0)
+   {
+      if (this.pagePrincipale == 1)
+         return false
+      this.pagePrincipale = 1
+   }
+   else
+   {
+      if (this.conversations[numConv].page == 1)
+         return false
+      this.conversations[numConv].page = 1
+   }
+   return true
+}
+
+/**
+  * Ajoute une conversation à la vue de l'utilisateur.
+  * Le profile de l'utilisateur est directement sauvegardé sur le serveur.
+  * @param racines la racine de la conversation (integer)
+  * @return true si la conversation a été créée sinon false (par exemple si la conv existe déjà)
+  */
+Client.prototype.ajouterConversation = function(racine)
+{
+   // vérification s'il elle n'existe pas déjà
+   for (var i = 0; i < this.conversations.length; i++)
+      if (this.conversations[i].root == racine)
+         return false
+         
+   this.conversations.push({root : racine, page : 1})
+   
+   if (this.autoflush) this.flush(true)
+   
+   return true
+}
+
+Client.prototype.supprimerConversation = function(num)
+{
+   if (num < 0 || num >= this.conversations.length) return
+   
+   // décalage TODO : supprimer le dernier élément 
+   for (var i = num; i < this.conversations.length - 1; i++)
+      this.conversations[i] = this.conversations[i+1]
+   this.conversations.pop()
+   
+   if (this.autoflush) this.flush(true)
+}
+
+Client.prototype.getJSONLogin = function(login, password)
+{
+   return {
+      "action" : "authentification",
+      "login" : login,
+      "password" : password
+   }
+}
+
+Client.prototype.getJSONLoginCookie = function()
+{
+   return {
+      "action" : "authentification",
+      "cookie" : this.cookie
+   }
+}  
+
+/**
+  * le couple (login, password) est facultatif. S'il n'est pas fournit alors il ne sera pas possible
+  * de s'autentifier avec (login, password).
+  */
+Client.prototype.getJSONEnregistrement = function(login, password)
+{
+   var mess = { "action" : "register" }
+   
+   if (login != undefined && password != undefined)
+   {
+      mess["login"] = login
+      mess["password"] = password
+   }
+   
+   return mess;
+}
+
+Client.prototype.getJSONConversations = function()
+{
+   var conversations = new Array()
+   for (var i = 0; i < this.conversations.length; i++)
+      conversations.push({ "root" : this.conversations[i].root, "page" : this.conversations[i].page})
+   return conversations
+}
+
+Client.prototype.getJSONProfile = function()
+{
+   return {
+      "action" : "set_profile",
+      "cookie" : this.cookie,
+      "login" : this.login,
+      "password" : this.password,
+      "nick" : this.pseudo,
+      "email" : this.email,
+      "css" : this.css,
+      "nick_format" : this.nickFormat,
+      "view_times" : this.viewTimes,
+      "view_tooltips" : this.viewTooltips,
+      "main_page" : this.pagePrincipale < 1 ? 1 : this.pagePrincipale,
+      "conversations" : this.getJSONConversations()
+   }
+}
+
+/**
+  * Renvoie null si pas définit.
+  */
+Client.prototype.getCookie = function()
+{
+   var cookie = this.regexCookie.exec(document.cookie)
+   if (cookie == null) this.cookie = null
+   else this.cookie = cookie[1]
+}
+
+Client.prototype.delCookie = function()
+{
+   document.cookie = "cookie=; max-age=0"
+}
+
+Client.prototype.setCookie = function()
+{
+   if (this.cookie == null || this.cookie == undefined)
+      return
+      
+   // ne fonctionne pas sous IE....
+   /*document.cookie = "cookie=" + this.cookie + "; max-age="  + (60 * 60 * 24 * 365) */
+   
+   document.cookie = 
+      "cookie="+this.cookie+"; expires=" + new Date(new Date().getTime() + 1000 * 60 * 60 * 24 * 365).toUTCString()
+}
+
+Client.prototype.authentifie = function()
+{
+   return this.statut == statutType.auth_registered || this.statut == statutType.auth_not_registered
+}
+
+Client.prototype.setStatut = function(statut)
+{  
+   // conversation en "enum" si en "string"
+   if (typeof(statut) == "string")
+   {
+      statut =
+         statut == "auth_registered" ?
+            statutType.auth_registered :
+         (statut == "auth_not_registered" ? statutType.auth_not_registered : statutType.deconnected)
+   }   
+   
+   if (statut == this.statut) return
+   
+   this.statut = statut   
+   this.majMenu()
+}
+
+/**
+  * Effectue la connexion vers le serveur.
+  * Cette fonction est bloquante tant que la connexion n'a pas été établie.
+  * S'il existe un cookie en local on s'authentifie directement avec lui.
+  * Si il n'est pas possible de s'authentifier alors on affiche un captcha anti-bot.
+  */
+Client.prototype.connexionCookie = function()
+{
+   this.getCookie()
+   if (this.cookie == null) return false;
+   return this.connexion(this.getJSONLoginCookie())
+}
+
+Client.prototype.connexionLogin = function(login, password)
+{
+   return this.connexion(this.getJSONLogin(login, password))
+}
+
+Client.prototype.enregistrement = function(login, password)
+{ 
+   if (this.authentifie())
+   {
+      this.login = login
+      this.password = password
+      if(this.flush())
+      {
+         this.setStatut(statutType.auth_registered)
+         return true
+      }
+      return false
+   }
+   else
+   {
+      return this.connexion(this.getJSONEnregistrement(login, password))
+   }
+}
+
+Client.prototype.connexion = function(messageJson)
+{
+   ;; dumpObj(messageJson)
+   thisClient = this
+   jQuery.ajax(
+      {
+         async: false,
+         type: "POST",
+         url: "request",
+         dataType: "json",
+         data: this.util.jsonVersAction(messageJson),
+         success:
+            function(data)
+            {
+               ;; dumpObj(data)
+               if (data["reply"] == "error")
+                  thisClient.util.messageDialogue(data["error_message"])
+               else
+                  thisClient.chargerDonnees(data)
+            }
+      }
+   )
+   return this.authentifie()
+}
+
+Client.prototype.deconnexion = function()
+{
+   this.flush(true)
+   this.delCookie()
+   this.resetDonneesPersonnelles()
+   this.setStatut(statutType.deconnected) // deconnexion
+}
+
+Client.prototype.chargerDonnees = function(data)
+{
+   // la modification du statut qui suit met à jour le menu, le menu dépend (page admin)
+   // de l'état ekMaster
+   this.ekMaster = data["ek_master"] != undefined ? data["ek_master"] : false
+   
+   this.setStatut(data["status"]) 
+   
+   if (this.authentifie())
+   {
+      this.cookie = data["cookie"]
+      this.setCookie()
+      
+      this.id = data["id"]
+      this.login = data["login"]
+      this.pseudo = data["nick"]
+      this.email = data["email"]
+      this.setCss(data["css"])
+      this.nickFormat = data["nick_format"]
+      this.viewTimes = data["view_times"]
+      this.viewTooltips = data["view_tooltips"]
+      
+      // la page de la conversation principale
+      this.pagePrincipale = data["main_page"] == undefined ? 1 : data["main_page"]
+      
+      // les conversations
+      this.conversations = data["conversations"]
+      
+      this.majBulle()
+      this.majCssSelectionee()
+   }
+}
+
+/**
+  * Met à jour les données personne sur serveur.
+  * @param async de manière asynchrone ? défaut = true
+  * @return false si le flush n'a pas pû se faire sinon true
+  */
+Client.prototype.flush = function(async)
+{
+   if (async == undefined)
+      async = false
+      
+   if (!this.authentifie())
+      return false
+
+   var thisClient = this
+   var ok = true
+   
+   ;; dumpObj(this.getJSONProfile())
+   jQuery.ajax(
+      {
+         async: async,
+         type: "POST",
+         url: "request",
+         dataType: "json",
+         data: this.util.jsonVersAction(this.getJSONProfile()),
+         success:
+            function(data)
+            {
+               ;; dumpObj(data)
+               if (data["reply"] == "error")
+               {
+                  thisClient.util.messageDialogue(data["error_message"])
+                  ok = false
+               }
+               else
+               {
+                  thisClient.majBulle()
+               }
+            }
+      }
+   )
+   
+   return ok
+}
+
+Client.prototype.majMenu = function()
+{
+   displayType = "block"
+
+   $("#menu .admin").css("display", this.ekMaster ? displayType : "none")
+
+   // met à jour le menu   
+   if (this.statut == statutType.auth_registered)
+   {
+      $("#menu .profile").css("display", displayType).text("profile")
+      $("#menu .logout").css("display", displayType)
+      $("#menu .register").css("display", "none")
+   }
+   else if (this.statut == statutType.auth_not_registered)
+   {
+      $("#menu .profile").css("display", "none")
+      $("#menu .logout").css("display", displayType)
+      $("#menu .register").css("display", displayType)
+   }
+   else
+   {
+      $("#menu .profile").css("display", displayType).text("login")
+      $("#menu .logout").css("display", "none")
+      $("#menu .register").css("display", displayType)
+   }
+}
+
+/**
+  * Met à jour l'affichage des infos bulles en fonction du profile.
+  */
+Client.prototype.majBulle = function()
+{
+   this.util.bulleActive = this.viewTooltips
+}
+
+/**
+  * Met à jour la css sélectionnée, lors du chargement des données.
+  */
+Client.prototype.majCssSelectionee = function()
+{
+   // extraction du numéro de la css courante
+   var numCssCourante = this.css.match(/^.*?\/(\d)\/.*$/)
+   if (numCssCourante[1] != undefined)
+   {
+      $("#menuCss option").removeAttr("selected")
+      $("#menuCss option[value=" + numCssCourante[1]+ "]").attr("selected", "selected")
+   }
+}
+
+Client.prototype.slap = function(userId, raison)
+{
+   var thisClient = this
+   
+   jQuery.ajax({
+      type: "POST",
+      url: "request",
+      dataType: "json",
+      data: this.util.jsonVersAction(
+         {
+            "action" : "slap",
+            "cookie" : thisClient.cookie,
+            "user_id" : userId,
+            "reason" : raison
+         }),
+      success: 
+         function(data)
+         {
+            if (data["reply"] == "error")
+               thisClient.util.messageDialogue(data["error_message"])
+         }
+   })
+}
+
+Client.prototype.ban = function(userId, raison, minutes)
+{
+   var thisClient = this
+
+   // par défaut un ban correspond à 3 jours
+   if (typeof(minutes) == "undefined")
+      minutes = conf.tempsBan;
+      
+   jQuery.ajax({
+      type: "POST",
+      url: "request",
+      dataType: "json",
+      data: this.util.jsonVersAction(
+         {
+            "action" : "ban",
+            "cookie" : thisClient.cookie,
+            "duration" : minutes,
+            "user_id" : userId,
+            "reason" : raison
+         }),
+      success: 
+         function(data)
+         {
+            if (data["reply"] == "error")
+               thisClient.util.messageDialogue(data["error_message"])
+         }
+   })
+}
+
+Client.prototype.kick = function(userId, raison)
+{
+   this.ban(userId, raison, conf.tempsKick)
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+   * classe permettant de gérer les événements (push serveur).
+   * l'information envoyé est sous la forme :
+   *  {
+   *     "action" : "wait_event"
+   *     "page" : <page>
+   *     [..]
+   *  }
+   * l'information reçu est sous la forme :
+   *  {
+   *     "reply" : <reply>
+   *  }
+   * @page la page
+   */
+function PageEvent(page, util)
+{
+   this.page = page
+   this.util = util
+   
+   // l'objet JSONHttpRequest représentant la connexion d'attente
+   this.attenteCourante = null
+   
+   // le multhreading du pauvre, merci javascript de m'offrire autant de primitives pour la gestion de la concurrence...
+   this.stop = false
+}
+
+/**
+  * Arrête l'attente courante s'il y en a une.
+  */
+PageEvent.prototype.stopAttenteCourante = function()
+{
+   this.stop = true
+         
+   if (this.attenteCourante != null)
+   {
+      this.attenteCourante.abort()   
+   }
+}
+
+/**
+  * Attend un événement lié à la page. 
+  * @funSend une fonction renvoyant les données json à envoyer
+  * @funsReceive est un objet comprenant les fonctions à appeler en fonction du "reply"
+  * les fonctions acceptent un paramètre correspondant au données reçues.
+  * exemple : {"new_message" : function(data){ ... }}
+  */
+PageEvent.prototype.waitEvent = function(funSend, funsReceive)
+{
+   this.stopAttenteCourante()
+   
+   this.stop = false
+   
+   var thisPageEvent = this
+      
+   // on doit conserver l'ordre des valeurs de l'objet JSON (le serveur les veut dans l'ordre définit dans le protocole)
+   // TODO : ya pas mieux ?
+   var dataToSend = 
+   {
+      "action" : "wait_event",
+      "page" : this.page
+   }
+   var poulpe = funSend()
+   for (v in poulpe)
+      dataToSend[v] = poulpe[v]
+   
+   ;; dumpObj(dataToSend)
+   
+   this.attenteCourante = jQuery.ajax({
+      type: "POST",
+      url: "request",
+      dataType: "json",
+      // Obsolète (voir TODO)
+      //timeout: 300000, // timeout de 5min. Gros HACK pas beau. FIXME problème décrit ici : http://groups.google.com/group/jquery-en/browse_thread/thread/8724e64af3333a76
+      data: this.util.jsonVersAction(dataToSend),
+      success:
+         function(data)
+         {            
+            ;; dumpObj(data)
+            
+            funsReceive[data["reply"]](data)
+            
+            // rappel de la fonction dans 100 ms
+            setTimeout(function(){ thisPageEvent.waitEvent2(funSend, funsReceive) }, 100)
+         },
+      error:
+         function(XMLHttpRequest, textStatus, errorThrown)
+         {
+            ;; console.log("Connexion perdue dans waitEvent")
+            setTimeout(function(){ thisPageEvent.waitEvent2(funSend, funsReceive) }, 1000)
+         }
+   })
+}
+
+/**
+  * Si un stopAttenteCourante survient un peu n'importe quand il faut imédiatement arreter de boucler.
+  */
+PageEvent.prototype.waitEvent2 = function(funSend, funsReceive)
+{
+   if (this.stop)
+      return
+   this.waitEvent(funSend, funsReceive)
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+function initialiserListeStyles(client)
+{
+   $("#menuCss").change(
+      function()
+      {
+         client.setCss("css/" + $("option:selected", this).attr("value") + "/euphorik.css")
+      }
+   )
+}
+            
+// charge dynamiquement le script de debug
+;; jQuery.ajax({async : false, url : "js/debug.js", dataType : "script"})
+      
+// le main
+$(document).ready(
+   function()
+   {  
+      var formateur = new Formateur()
+      var util = new Util(formateur)
+      var client = new Client(util)
+      var pages = new Pages()
+      
+      // connexion vers le serveur (utilise un cookie qui traine)
+      client.connexionCookie()
+      
+      initialiserListeStyles(client)
+
+      // FIXME : ne fonctionne pas sous opera
+      // voir : http://dev.jquery.com/ticket/2892#preview
+      $(window).unload(function(){client.flush()})
+      
+      $("#menu .minichat").click(function(){ pages.afficherPage("minichat") })
+      $("#menu .admin").click(function(){ pages.afficherPage("admin") })
+      $("#menu .profile").click(function(){ pages.afficherPage("profile") })
+      $("#menu .logout").click(function(){
+         util.messageDialogue("Êtes-vous sur de vouloir vous délogger ?", messageType.question,
+            {"Oui" : function()
+               {
+                  client.deconnexion();
+                  pages.afficherPage("minichat", true)
+               },
+             "Non" : function(){}
+            }
+         )
+      })
+      $("#menu .register").click(function(){ pages.afficherPage("register") })
+      $("#menu .about").click(function(){ pages.afficherPage("about") })
+      
+      // TODO : simplifier et pouvoir créer des liens par exemple : <span class="lien" href="conditions">Conditions d'utilisation</span>
+      $("#footer .conditions").click(function(){ pages.afficherPage("conditions_utilisation") })
+
+      pages.ajouterPage(new PageMinichat(client, formateur, util))
+      pages.ajouterPage(new PageAdmin(client, formateur, util))
+      pages.ajouterPage(new PageProfile(client, formateur, util))
+      pages.ajouterPage(new PageRegister(client, formateur, util))
+      pages.ajouterPage(new PageAbout(client, formateur, util))
+      pages.ajouterPage("conditions_utilisation")
+      
+      pages.afficherPage("minichat")
+   }
+)
diff --git a/js/jquery.js b/js/jquery.js
new file mode 100755 (executable)
index 0000000..88e661e
--- /dev/null
@@ -0,0 +1,3549 @@
+(function(){
+/*
+ * jQuery 1.2.6 - New Wave Javascript
+ *
+ * Copyright (c) 2008 John Resig (jquery.com)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $
+ * $Rev: 5685 $
+ */
+
+// Map over jQuery in case of overwrite
+var _jQuery = window.jQuery,
+// Map over the $ in case of overwrite
+       _$ = window.$;
+
+var jQuery = window.jQuery = window.$ = function( selector, context ) {
+       // The jQuery object is actually just the init constructor 'enhanced'
+       return new jQuery.fn.init( selector, context );
+};
+
+// A simple way to check for HTML strings or ID strings
+// (both of which we optimize for)
+var quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,
+
+// Is it a simple selector
+       isSimple = /^.[^:#\[\.]*$/,
+
+// Will speed up references to undefined, and allows munging its name.
+       undefined;
+
+jQuery.fn = jQuery.prototype = {
+       init: function( selector, context ) {
+               // Make sure that a selection was provided
+               selector = selector || document;
+
+               // Handle $(DOMElement)
+               if ( selector.nodeType ) {
+                       this[0] = selector;
+                       this.length = 1;
+                       return this;
+               }
+               // Handle HTML strings
+               if ( typeof selector == "string" ) {
+                       // Are we dealing with HTML string or an ID?
+                       var match = quickExpr.exec( selector );
+
+                       // Verify a match, and that no context was specified for #id
+                       if ( match && (match[1] || !context) ) {
+
+                               // HANDLE: $(html) -> $(array)
+                               if ( match[1] )
+                                       selector = jQuery.clean( [ match[1] ], context );
+
+                               // HANDLE: $("#id")
+                               else {
+                                       var elem = document.getElementById( match[3] );
+
+                                       // Make sure an element was located
+                                       if ( elem ){
+                                               // Handle the case where IE and Opera return items
+                                               // by name instead of ID
+                                               if ( elem.id != match[3] )
+                                                       return jQuery().find( selector );
+
+                                               // Otherwise, we inject the element directly into the jQuery object
+                                               return jQuery( elem );
+                                       }
+                                       selector = [];
+                               }
+
+                       // HANDLE: $(expr, [context])
+                       // (which is just equivalent to: $(content).find(expr)
+                       } else
+                               return jQuery( context ).find( selector );
+
+               // HANDLE: $(function)
+               // Shortcut for document ready
+               } else if ( jQuery.isFunction( selector ) )
+                       return jQuery( document )[ jQuery.fn.ready ? "ready" : "load" ]( selector );
+
+               return this.setArray(jQuery.makeArray(selector));
+       },
+
+       // The current version of jQuery being used
+       jquery: "1.2.6",
+
+       // The number of elements contained in the matched element set
+       size: function() {
+               return this.length;
+       },
+
+       // The number of elements contained in the matched element set
+       length: 0,
+
+       // Get the Nth element in the matched element set OR
+       // Get the whole matched element set as a clean array
+       get: function( num ) {
+               return num == undefined ?
+
+                       // Return a 'clean' array
+                       jQuery.makeArray( this ) :
+
+                       // Return just the object
+                       this[ num ];
+       },
+
+       // Take an array of elements and push it onto the stack
+       // (returning the new matched element set)
+       pushStack: function( elems ) {
+               // Build a new jQuery matched element set
+               var ret = jQuery( elems );
+
+               // Add the old object onto the stack (as a reference)
+               ret.prevObject = this;
+
+               // Return the newly-formed element set
+               return ret;
+       },
+
+       // Force the current matched set of elements to become
+       // the specified array of elements (destroying the stack in the process)
+       // You should use pushStack() in order to do this, but maintain the stack
+       setArray: function( elems ) {
+               // Resetting the length to 0, then using the native Array push
+               // is a super-fast way to populate an object with array-like properties
+               this.length = 0;
+               Array.prototype.push.apply( this, elems );
+
+               return this;
+       },
+
+       // Execute a callback for every element in the matched set.
+       // (You can seed the arguments with an array of args, but this is
+       // only used internally.)
+       each: function( callback, args ) {
+               return jQuery.each( this, callback, args );
+       },
+
+       // Determine the position of an element within
+       // the matched set of elements
+       index: function( elem ) {
+               var ret = -1;
+
+               // Locate the position of the desired element
+               return jQuery.inArray(
+                       // If it receives a jQuery object, the first element is used
+                       elem && elem.jquery ? elem[0] : elem
+               , this );
+       },
+
+       attr: function( name, value, type ) {
+               var options = name;
+
+               // Look for the case where we're accessing a style value
+               if ( name.constructor == String )
+                       if ( value === undefined )
+                               return this[0] && jQuery[ type || "attr" ]( this[0], name );
+
+                       else {
+                               options = {};
+                               options[ name ] = value;
+                       }
+
+               // Check to see if we're setting style values
+               return this.each(function(i){
+                       // Set all the styles
+                       for ( name in options )
+                               jQuery.attr(
+                                       type ?
+                                               this.style :
+                                               this,
+                                       name, jQuery.prop( this, options[ name ], type, i, name )
+                               );
+               });
+       },
+
+       css: function( key, value ) {
+               // ignore negative width and height values
+               if ( (key == 'width' || key == 'height') && parseFloat(value) < 0 )
+                       value = undefined;
+               return this.attr( key, value, "curCSS" );
+       },
+
+       text: function( text ) {
+               if ( typeof text != "object" && text != null )
+                       return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
+
+               var ret = "";
+
+               jQuery.each( text || this, function(){
+                       jQuery.each( this.childNodes, function(){
+                               if ( this.nodeType != 8 )
+                                       ret += this.nodeType != 1 ?
+                                               this.nodeValue :
+                                               jQuery.fn.text( [ this ] );
+                       });
+               });
+
+               return ret;
+       },
+
+       wrapAll: function( html ) {
+               if ( this[0] )
+                       // The elements to wrap the target around
+                       jQuery( html, this[0].ownerDocument )
+                               .clone()
+                               .insertBefore( this[0] )
+                               .map(function(){
+                                       var elem = this;
+
+                                       while ( elem.firstChild )
+                                               elem = elem.firstChild;
+
+                                       return elem;
+                               })
+                               .append(this);
+
+               return this;
+       },
+
+       wrapInner: function( html ) {
+               return this.each(function(){
+                       jQuery( this ).contents().wrapAll( html );
+               });
+       },
+
+       wrap: function( html ) {
+               return this.each(function(){
+                       jQuery( this ).wrapAll( html );
+               });
+       },
+
+       append: function() {
+               return this.domManip(arguments, true, false, function(elem){
+                       if (this.nodeType == 1)
+                               this.appendChild( elem );
+               });
+       },
+
+       prepend: function() {
+               return this.domManip(arguments, true, true, function(elem){
+                       if (this.nodeType == 1)
+                               this.insertBefore( elem, this.firstChild );
+               });
+       },
+
+       before: function() {
+               return this.domManip(arguments, false, false, function(elem){
+                       this.parentNode.insertBefore( elem, this );
+               });
+       },
+
+       after: function() {
+               return this.domManip(arguments, false, true, function(elem){
+                       this.parentNode.insertBefore( elem, this.nextSibling );
+               });
+       },
+
+       end: function() {
+               return this.prevObject || jQuery( [] );
+       },
+
+       find: function( selector ) {
+               var elems = jQuery.map(this, function(elem){
+                       return jQuery.find( selector, elem );
+               });
+
+               return this.pushStack( /[^+>] [^+>]/.test( selector ) || selector.indexOf("..") > -1 ?
+                       jQuery.unique( elems ) :
+                       elems );
+       },
+
+       clone: function( events ) {
+               // Do the clone
+               var ret = this.map(function(){
+                       if ( jQuery.browser.msie && !jQuery.isXMLDoc(this) ) {
+                               // IE copies events bound via attachEvent when
+                               // using cloneNode. Calling detachEvent on the
+                               // clone will also remove the events from the orignal
+                               // In order to get around this, we use innerHTML.
+                               // Unfortunately, this means some modifications to
+                               // attributes in IE that are actually only stored
+                               // as properties will not be copied (such as the
+                               // the name attribute on an input).
+                               var clone = this.cloneNode(true),
+                                       container = document.createElement("div");
+                               container.appendChild(clone);
+                               return jQuery.clean([container.innerHTML])[0];
+                       } else
+                               return this.cloneNode(true);
+               });
+
+               // Need to set the expando to null on the cloned set if it exists
+               // removeData doesn't work here, IE removes it from the original as well
+               // this is primarily for IE but the data expando shouldn't be copied over in any browser
+               var clone = ret.find("*").andSelf().each(function(){
+                       if ( this[ expando ] != undefined )
+                               this[ expando ] = null;
+               });
+
+               // Copy the events from the original to the clone
+               if ( events === true )
+                       this.find("*").andSelf().each(function(i){
+                               if (this.nodeType == 3)
+                                       return;
+                               var events = jQuery.data( this, "events" );
+
+                               for ( var type in events )
+                                       for ( var handler in events[ type ] )
+                                               jQuery.event.add( clone[ i ], type, events[ type ][ handler ], events[ type ][ handler ].data );
+                       });
+
+               // Return the cloned set
+               return ret;
+       },
+
+       filter: function( selector ) {
+               return this.pushStack(
+                       jQuery.isFunction( selector ) &&
+                       jQuery.grep(this, function(elem, i){
+                               return selector.call( elem, i );
+                       }) ||
+
+                       jQuery.multiFilter( selector, this ) );
+       },
+
+       not: function( selector ) {
+               if ( selector.constructor == String )
+                       // test special case where just one selector is passed in
+                       if ( isSimple.test( selector ) )
+                               return this.pushStack( jQuery.multiFilter( selector, this, true ) );
+                       else
+                               selector = jQuery.multiFilter( selector, this );
+
+               var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType;
+               return this.filter(function() {
+                       return isArrayLike ? jQuery.inArray( this, selector ) < 0 : this != selector;
+               });
+       },
+
+       add: function( selector ) {
+               return this.pushStack( jQuery.unique( jQuery.merge(
+                       this.get(),
+                       typeof selector == 'string' ?
+                               jQuery( selector ) :
+                               jQuery.makeArray( selector )
+               )));
+       },
+
+       is: function( selector ) {
+               return !!selector && jQuery.multiFilter( selector, this ).length > 0;
+       },
+
+       hasClass: function( selector ) {
+               return this.is( "." + selector );
+       },
+
+       val: function( value ) {
+               if ( value == undefined ) {
+
+                       if ( this.length ) {
+                               var elem = this[0];
+
+                               // We need to handle select boxes special
+                               if ( jQuery.nodeName( elem, "select" ) ) {
+                                       var index = elem.selectedIndex,
+                                               values = [],
+                                               options = elem.options,
+                                               one = elem.type == "select-one";
+
+                                       // Nothing was selected
+                                       if ( index < 0 )
+                                               return null;
+
+                                       // Loop through all the selected options
+                                       for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
+                                               var option = options[ i ];
+
+                                               if ( option.selected ) {
+                                                       // Get the specifc value for the option
+                                                       value = jQuery.browser.msie && !option.attributes.value.specified ? option.text : option.value;
+
+                                                       // We don't need an array for one selects
+                                                       if ( one )
+                                                               return value;
+
+                                                       // Multi-Selects return an array
+                                                       values.push( value );
+                                               }
+                                       }
+
+                                       return values;
+
+                               // Everything else, we just grab the value
+                               } else
+                                       return (this[0].value || "").replace(/\r/g, "");
+
+                       }
+
+                       return undefined;
+               }
+
+               if( value.constructor == Number )
+                       value += '';
+
+               return this.each(function(){
+                       if ( this.nodeType != 1 )
+                               return;
+
+                       if ( value.constructor == Array && /radio|checkbox/.test( this.type ) )
+                               this.checked = (jQuery.inArray(this.value, value) >= 0 ||
+                                       jQuery.inArray(this.name, value) >= 0);
+
+                       else if ( jQuery.nodeName( this, "select" ) ) {
+                               var values = jQuery.makeArray(value);
+
+                               jQuery( "option", this ).each(function(){
+                                       this.selected = (jQuery.inArray( this.value, values ) >= 0 ||
+                                               jQuery.inArray( this.text, values ) >= 0);
+                               });
+
+                               if ( !values.length )
+                                       this.selectedIndex = -1;
+
+                       } else
+                               this.value = value;
+               });
+       },
+
+       html: function( value ) {
+               return value == undefined ?
+                       (this[0] ?
+                               this[0].innerHTML :
+                               null) :
+                       this.empty().append( value );
+       },
+
+       replaceWith: function( value ) {
+               return this.after( value ).remove();
+       },
+
+       eq: function( i ) {
+               return this.slice( i, i + 1 );
+       },
+
+       slice: function() {
+               return this.pushStack( Array.prototype.slice.apply( this, arguments ) );
+       },
+
+       map: function( callback ) {
+               return this.pushStack( jQuery.map(this, function(elem, i){
+                       return callback.call( elem, i, elem );
+               }));
+       },
+
+       andSelf: function() {
+               return this.add( this.prevObject );
+       },
+
+       data: function( key, value ){
+               var parts = key.split(".");
+               parts[1] = parts[1] ? "." + parts[1] : "";
+
+               if ( value === undefined ) {
+                       var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
+
+                       if ( data === undefined && this.length )
+                               data = jQuery.data( this[0], key );
+
+                       return data === undefined && parts[1] ?
+                               this.data( parts[0] ) :
+                               data;
+               } else
+                       return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){
+                               jQuery.data( this, key, value );
+                       });
+       },
+
+       removeData: function( key ){
+               return this.each(function(){
+                       jQuery.removeData( this, key );
+               });
+       },
+
+       domManip: function( args, table, reverse, callback ) {
+               var clone = this.length > 1, elems;
+
+               return this.each(function(){
+                       if ( !elems ) {
+                               elems = jQuery.clean( args, this.ownerDocument );
+
+                               if ( reverse )
+                                       elems.reverse();
+                       }
+
+                       var obj = this;
+
+                       if ( table && jQuery.nodeName( this, "table" ) && jQuery.nodeName( elems[0], "tr" ) )
+                               obj = this.getElementsByTagName("tbody")[0] || this.appendChild( this.ownerDocument.createElement("tbody") );
+
+                       var scripts = jQuery( [] );
+
+                       jQuery.each(elems, function(){
+                               var elem = clone ?
+                                       jQuery( this ).clone( true )[0] :
+                                       this;
+
+                               // execute all scripts after the elements have been injected
+                               if ( jQuery.nodeName( elem, "script" ) )
+                                       scripts = scripts.add( elem );
+                               else {
+                                       // Remove any inner scripts for later evaluation
+                                       if ( elem.nodeType == 1 )
+                                               scripts = scripts.add( jQuery( "script", elem ).remove() );
+
+                                       // Inject the elements into the document
+                                       callback.call( obj, elem );
+                               }
+                       });
+
+                       scripts.each( evalScript );
+               });
+       }
+};
+
+// Give the init function the jQuery prototype for later instantiation
+jQuery.fn.init.prototype = jQuery.fn;
+
+function evalScript( i, elem ) {
+       if ( elem.src )
+               jQuery.ajax({
+                       url: elem.src,
+                       async: false,
+                       dataType: "script"
+               });
+
+       else
+               jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
+
+       if ( elem.parentNode )
+               elem.parentNode.removeChild( elem );
+}
+
+function now(){
+       return +new Date;
+}
+
+jQuery.extend = jQuery.fn.extend = function() {
+       // copy reference to target object
+       var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options;
+
+       // Handle a deep copy situation
+       if ( target.constructor == Boolean ) {
+               deep = target;
+               target = arguments[1] || {};
+               // skip the boolean and the target
+               i = 2;
+       }
+
+       // Handle case when target is a string or something (possible in deep copy)
+       if ( typeof target != "object" && typeof target != "function" )
+               target = {};
+
+       // extend jQuery itself if only one argument is passed
+       if ( length == i ) {
+               target = this;
+               --i;
+       }
+
+       for ( ; i < length; i++ )
+               // Only deal with non-null/undefined values
+               if ( (options = arguments[ i ]) != null )
+                       // Extend the base object
+                       for ( var name in options ) {
+                               var src = target[ name ], copy = options[ name ];
+
+                               // Prevent never-ending loop
+                               if ( target === copy )
+                                       continue;
+
+                               // Recurse if we're merging object values
+                               if ( deep && copy && typeof copy == "object" && !copy.nodeType )
+                                       target[ name ] = jQuery.extend( deep, 
+                                               // Never move original objects, clone them
+                                               src || ( copy.length != null ? [ ] : { } )
+                                       , copy );
+
+                               // Don't bring in undefined values
+                               else if ( copy !== undefined )
+                                       target[ name ] = copy;
+
+                       }
+
+       // Return the modified object
+       return target;
+};
+
+var expando = "jQuery" + now(), uuid = 0, windowData = {},
+       // exclude the following css properties to add px
+       exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
+       // cache defaultView
+       defaultView = document.defaultView || {};
+
+jQuery.extend({
+       noConflict: function( deep ) {
+               window.$ = _$;
+
+               if ( deep )
+                       window.jQuery = _jQuery;
+
+               return jQuery;
+       },
+
+       // See test/unit/core.js for details concerning this function.
+       isFunction: function( fn ) {
+               return !!fn && typeof fn != "string" && !fn.nodeName &&
+                       fn.constructor != Array && /^[\s[]?function/.test( fn + "" );
+       },
+
+       // check if an element is in a (or is an) XML document
+       isXMLDoc: function( elem ) {
+               return elem.documentElement && !elem.body ||
+                       elem.tagName && elem.ownerDocument && !elem.ownerDocument.body;
+       },
+
+       // Evalulates a script in a global context
+       globalEval: function( data ) {
+               data = jQuery.trim( data );
+
+               if ( data ) {
+                       // Inspired by code by Andrea Giammarchi
+                       // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
+                       var head = document.getElementsByTagName("head")[0] || document.documentElement,
+                               script = document.createElement("script");
+
+                       script.type = "text/javascript";
+                       if ( jQuery.browser.msie )
+                               script.text = data;
+                       else
+                               script.appendChild( document.createTextNode( data ) );
+
+                       // Use insertBefore instead of appendChild  to circumvent an IE6 bug.
+                       // This arises when a base node is used (#2709).
+                       head.insertBefore( script, head.firstChild );
+                       head.removeChild( script );
+               }
+       },
+
+       nodeName: function( elem, name ) {
+               return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase();
+       },
+
+       cache: {},
+
+       data: function( elem, name, data ) {
+               elem = elem == window ?
+                       windowData :
+                       elem;
+
+               var id = elem[ expando ];
+
+               // Compute a unique ID for the element
+               if ( !id )
+                       id = elem[ expando ] = ++uuid;
+
+               // Only generate the data cache if we're
+               // trying to access or manipulate it
+               if ( name && !jQuery.cache[ id ] )
+                       jQuery.cache[ id ] = {};
+
+               // Prevent overriding the named cache with undefined values
+               if ( data !== undefined )
+                       jQuery.cache[ id ][ name ] = data;
+
+               // Return the named cache data, or the ID for the element
+               return name ?
+                       jQuery.cache[ id ][ name ] :
+                       id;
+       },
+
+       removeData: function( elem, name ) {
+               elem = elem == window ?
+                       windowData :
+                       elem;
+
+               var id = elem[ expando ];
+
+               // If we want to remove a specific section of the element's data
+               if ( name ) {
+                       if ( jQuery.cache[ id ] ) {
+                               // Remove the section of cache data
+                               delete jQuery.cache[ id ][ name ];
+
+                               // If we've removed all the data, remove the element's cache
+                               name = "";
+
+                               for ( name in jQuery.cache[ id ] )
+                                       break;
+
+                               if ( !name )
+                                       jQuery.removeData( elem );
+                       }
+
+               // Otherwise, we want to remove all of the element's data
+               } else {
+                       // Clean up the element expando
+                       try {
+                               delete elem[ expando ];
+                       } catch(e){
+                               // IE has trouble directly removing the expando
+                               // but it's ok with using removeAttribute
+                               if ( elem.removeAttribute )
+                                       elem.removeAttribute( expando );
+                       }
+
+                       // Completely remove the data cache
+                       delete jQuery.cache[ id ];
+               }
+       },
+
+       // args is for internal usage only
+       each: function( object, callback, args ) {
+               var name, i = 0, length = object.length;
+
+               if ( args ) {
+                       if ( length == undefined ) {
+                               for ( name in object )
+                                       if ( callback.apply( object[ name ], args ) === false )
+                                               break;
+                       } else
+                               for ( ; i < length; )
+                                       if ( callback.apply( object[ i++ ], args ) === false )
+                                               break;
+
+               // A special, fast, case for the most common use of each
+               } else {
+                       if ( length == undefined ) {
+                               for ( name in object )
+                                       if ( callback.call( object[ name ], name, object[ name ] ) === false )
+                                               break;
+                       } else
+                               for ( var value = object[0];
+                                       i < length && callback.call( value, i, value ) !== false; value = object[++i] ){}
+               }
+
+               return object;
+       },
+
+       prop: function( elem, value, type, i, name ) {
+               // Handle executable functions
+               if ( jQuery.isFunction( value ) )
+                       value = value.call( elem, i );
+
+               // Handle passing in a number to a CSS property
+               return value && value.constructor == Number && type == "curCSS" && !exclude.test( name ) ?
+                       value + "px" :
+                       value;
+       },
+
+       className: {
+               // internal only, use addClass("class")
+               add: function( elem, classNames ) {
+                       jQuery.each((classNames || "").split(/\s+/), function(i, className){
+                               if ( elem.nodeType == 1 && !jQuery.className.has( elem.className, className ) )
+                                       elem.className += (elem.className ? " " : "") + className;
+                       });
+               },
+
+               // internal only, use removeClass("class")
+               remove: function( elem, classNames ) {
+                       if (elem.nodeType == 1)
+                               elem.className = classNames != undefined ?
+                                       jQuery.grep(elem.className.split(/\s+/), function(className){
+                                               return !jQuery.className.has( classNames, className );
+                                       }).join(" ") :
+                                       "";
+               },
+
+               // internal only, use hasClass("class")
+               has: function( elem, className ) {
+                       return jQuery.inArray( className, (elem.className || elem).toString().split(/\s+/) ) > -1;
+               }
+       },
+
+       // A method for quickly swapping in/out CSS properties to get correct calculations
+       swap: function( elem, options, callback ) {
+               var old = {};
+               // Remember the old values, and insert the new ones
+               for ( var name in options ) {
+                       old[ name ] = elem.style[ name ];
+                       elem.style[ name ] = options[ name ];
+               }
+
+               callback.call( elem );
+
+               // Revert the old values
+               for ( var name in options )
+                       elem.style[ name ] = old[ name ];
+       },
+
+       css: function( elem, name, force ) {
+               if ( name == "width" || name == "height" ) {
+                       var val, props = { position: "absolute", visibility: "hidden", display:"block" }, which = name == "width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ];
+
+                       function getWH() {
+                               val = name == "width" ? elem.offsetWidth : elem.offsetHeight;
+                               var padding = 0, border = 0;
+                               jQuery.each( which, function() {
+                                       padding += parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0;
+                                       border += parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0;
+                               });
+                               val -= Math.round(padding + border);
+                       }
+
+                       if ( jQuery(elem).is(":visible") )
+                               getWH();
+                       else
+                               jQuery.swap( elem, props, getWH );
+
+                       return Math.max(0, val);
+               }
+
+               return jQuery.curCSS( elem, name, force );
+       },
+
+       curCSS: function( elem, name, force ) {
+               var ret, style = elem.style;
+
+               // A helper method for determining if an element's values are broken
+               function color( elem ) {
+                       if ( !jQuery.browser.safari )
+                               return false;
+
+                       // defaultView is cached
+                       var ret = defaultView.getComputedStyle( elem, null );
+                       return !ret || ret.getPropertyValue("color") == "";
+               }
+
+               // We need to handle opacity special in IE
+               if ( name == "opacity" && jQuery.browser.msie ) {
+                       ret = jQuery.attr( style, "opacity" );
+
+                       return ret == "" ?
+                               "1" :
+                               ret;
+               }
+               // Opera sometimes will give the wrong display answer, this fixes it, see #2037
+               if ( jQuery.browser.opera && name == "display" ) {
+                       var save = style.outline;
+                       style.outline = "0 solid black";
+                       style.outline = save;
+               }
+
+               // Make sure we're using the right name for getting the float value
+               if ( name.match( /float/i ) )
+                       name = styleFloat;
+
+               if ( !force && style && style[ name ] )
+                       ret = style[ name ];
+
+               else if ( defaultView.getComputedStyle ) {
+
+                       // Only "float" is needed here
+                       if ( name.match( /float/i ) )
+                               name = "float";
+
+                       name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase();
+
+                       var computedStyle = defaultView.getComputedStyle( elem, null );
+
+                       if ( computedStyle && !color( elem ) )
+                               ret = computedStyle.getPropertyValue( name );
+
+                       // If the element isn't reporting its values properly in Safari
+                       // then some display: none elements are involved
+                       else {
+                               var swap = [], stack = [], a = elem, i = 0;
+
+                               // Locate all of the parent display: none elements
+                               for ( ; a && color(a); a = a.parentNode )
+                                       stack.unshift(a);
+
+                               // Go through and make them visible, but in reverse
+                               // (It would be better if we knew the exact display type that they had)
+                               for ( ; i < stack.length; i++ )
+                                       if ( color( stack[ i ] ) ) {
+                                               swap[ i ] = stack[ i ].style.display;
+                                               stack[ i ].style.display = "block";
+                                       }
+
+                               // Since we flip the display style, we have to handle that
+                               // one special, otherwise get the value
+                               ret = name == "display" && swap[ stack.length - 1 ] != null ?
+                                       "none" :
+                                       ( computedStyle && computedStyle.getPropertyValue( name ) ) || "";
+
+                               // Finally, revert the display styles back
+                               for ( i = 0; i < swap.length; i++ )
+                                       if ( swap[ i ] != null )
+                                               stack[ i ].style.display = swap[ i ];
+                       }
+
+                       // We should always get a number back from opacity
+                       if ( name == "opacity" && ret == "" )
+                               ret = "1";
+
+               } else if ( elem.currentStyle ) {
+                       var camelCase = name.replace(/\-(\w)/g, function(all, letter){
+                               return letter.toUpperCase();
+                       });
+
+                       ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ];
+
+                       // From the awesome hack by Dean Edwards
+                       // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
+
+                       // If we're not dealing with a regular pixel number
+                       // but a number that has a weird ending, we need to convert it to pixels
+                       if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) {
+                               // Remember the original values
+                               var left = style.left, rsLeft = elem.runtimeStyle.left;
+
+                               // Put in the new values to get a computed value out
+                               elem.runtimeStyle.left = elem.currentStyle.left;
+                               style.left = ret || 0;
+                               ret = style.pixelLeft + "px";
+
+                               // Revert the changed values
+                               style.left = left;
+                               elem.runtimeStyle.left = rsLeft;
+                       }
+               }
+
+               return ret;
+       },
+
+       clean: function( elems, context ) {
+               var ret = [];
+               context = context || document;
+               // !context.createElement fails in IE with an error but returns typeof 'object'
+               if (typeof context.createElement == 'undefined')
+                       context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
+
+               jQuery.each(elems, function(i, elem){
+                       if ( !elem )
+                               return;
+
+                       if ( elem.constructor == Number )
+                               elem += '';
+
+                       // Convert html string into DOM nodes
+                       if ( typeof elem == "string" ) {
+                               // Fix "XHTML"-style tags in all browsers
+                               elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){
+                                       return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ?
+                                               all :
+                                               front + "></" + tag + ">";
+                               });
+
+                               // Trim whitespace, otherwise indexOf won't work as expected
+                               var tags = jQuery.trim( elem ).toLowerCase(), div = context.createElement("div");
+
+                               var wrap =
+                                       // option or optgroup
+                                       !tags.indexOf("<opt") &&
+                                       [ 1, "<select multiple='multiple'>", "</select>" ] ||
+
+                                       !tags.indexOf("<leg") &&
+                                       [ 1, "<fieldset>", "</fieldset>" ] ||
+
+                                       tags.match(/^<(thead|tbody|tfoot|colg|cap)/) &&
+                                       [ 1, "<table>", "</table>" ] ||
+
+                                       !tags.indexOf("<tr") &&
+                                       [ 2, "<table><tbody>", "</tbody></table>" ] ||
+
+                                       // <thead> matched above
+                                       (!tags.indexOf("<td") || !tags.indexOf("<th")) &&
+                                       [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ] ||
+
+                                       !tags.indexOf("<col") &&
+                                       [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ] ||
+
+                                       // IE can't serialize <link> and <script> tags normally
+                                       jQuery.browser.msie &&
+                                       [ 1, "div<div>", "</div>" ] ||
+
+                                       [ 0, "", "" ];
+
+                               // Go to html and back, then peel off extra wrappers
+                               div.innerHTML = wrap[1] + elem + wrap[2];
+
+                               // Move to the right depth
+                               while ( wrap[0]-- )
+                                       div = div.lastChild;
+
+                               // Remove IE's autoinserted <tbody> from table fragments
+                               if ( jQuery.browser.msie ) {
+
+                                       // String was a <table>, *may* have spurious <tbody>
+                                       var tbody = !tags.indexOf("<table") && tags.indexOf("<tbody") < 0 ?
+                                               div.firstChild && div.firstChild.childNodes :
+
+                                               // String was a bare <thead> or <tfoot>
+                                               wrap[1] == "<table>" && tags.indexOf("<tbody") < 0 ?
+                                                       div.childNodes :
+                                                       [];
+
+                                       for ( var j = tbody.length - 1; j >= 0 ; --j )
+                                               if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length )
+                                                       tbody[ j ].parentNode.removeChild( tbody[ j ] );
+
+                                       // IE completely kills leading whitespace when innerHTML is used
+                                       if ( /^\s/.test( elem ) )
+                                               div.insertBefore( context.createTextNode( elem.match(/^\s*/)[0] ), div.firstChild );
+
+                               }
+
+                               elem = jQuery.makeArray( div.childNodes );
+                       }
+
+                       if ( elem.length === 0 && (!jQuery.nodeName( elem, "form" ) && !jQuery.nodeName( elem, "select" )) )
+                               return;
+
+                       if ( elem[0] == undefined || jQuery.nodeName( elem, "form" ) || elem.options )
+                               ret.push( elem );
+
+                       else
+                               ret = jQuery.merge( ret, elem );
+
+               });
+
+               return ret;
+       },
+
+       attr: function( elem, name, value ) {
+               // don't set attributes on text and comment nodes
+               if (!elem || elem.nodeType == 3 || elem.nodeType == 8)
+                       return undefined;
+
+               var notxml = !jQuery.isXMLDoc( elem ),
+                       // Whether we are setting (or getting)
+                       set = value !== undefined,
+                       msie = jQuery.browser.msie;
+
+               // Try to normalize/fix the name
+               name = notxml && jQuery.props[ name ] || name;
+
+               // Only do all the following if this is a node (faster for style)
+               // IE elem.getAttribute passes even for style
+               if ( elem.tagName ) {
+
+                       // These attributes require special treatment
+                       var special = /href|src|style/.test( name );
+
+                       // Safari mis-reports the default selected property of a hidden option
+                       // Accessing the parent's selectedIndex property fixes it
+                       if ( name == "selected" && jQuery.browser.safari )
+                               elem.parentNode.selectedIndex;
+
+                       // If applicable, access the attribute via the DOM 0 way
+                       if ( name in elem && notxml && !special ) {
+                               if ( set ){
+                                       // We can't allow the type property to be changed (since it causes problems in IE)
+                                       if ( name == "type" && jQuery.nodeName( elem, "input" ) && elem.parentNode )
+                                               throw "type property can't be changed";
+
+                                       elem[ name ] = value;
+                               }
+
+                               // browsers index elements by id/name on forms, give priority to attributes.
+                               if( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) )
+                                       return elem.getAttributeNode( name ).nodeValue;
+
+                               return elem[ name ];
+                       }
+
+                       if ( msie && notxml &&  name == "style" )
+                               return jQuery.attr( elem.style, "cssText", value );
+
+                       if ( set )
+                               // convert the value to a string (all browsers do this but IE) see #1070
+                               elem.setAttribute( name, "" + value );
+
+                       var attr = msie && notxml && special
+                                       // Some attributes require a special call on IE
+                                       ? elem.getAttribute( name, 2 )
+                                       : elem.getAttribute( name );
+
+                       // Non-existent attributes return null, we normalize to undefined
+                       return attr === null ? undefined : attr;
+               }
+
+               // elem is actually elem.style ... set the style
+
+               // IE uses filters for opacity
+               if ( msie && name == "opacity" ) {
+                       if ( set ) {
+                               // IE has trouble with opacity if it does not have layout
+                               // Force it by setting the zoom level
+                               elem.zoom = 1;
+
+                               // Set the alpha filter to set the opacity
+                               elem.filter = (elem.filter || "").replace( /alpha\([^)]*\)/, "" ) +
+                                       (parseInt( value ) + '' == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")");
+                       }
+
+                       return elem.filter && elem.filter.indexOf("opacity=") >= 0 ?
+                               (parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100) + '':
+                               "";
+               }
+
+               name = name.replace(/-([a-z])/ig, function(all, letter){
+                       return letter.toUpperCase();
+               });
+
+               if ( set )
+                       elem[ name ] = value;
+
+               return elem[ name ];
+       },
+
+       trim: function( text ) {
+               return (text || "").replace( /^\s+|\s+$/g, "" );
+       },
+
+       makeArray: function( array ) {
+               var ret = [];
+
+               if( array != null ){
+                       var i = array.length;
+                       //the window, strings and functions also have 'length'
+                       if( i == null || array.split || array.setInterval || array.call )
+                               ret[0] = array;
+                       else
+                               while( i )
+                                       ret[--i] = array[i];
+               }
+
+               return ret;
+       },
+
+       inArray: function( elem, array ) {
+               for ( var i = 0, length = array.length; i < length; i++ )
+               // Use === because on IE, window == document
+                       if ( array[ i ] === elem )
+                               return i;
+
+               return -1;
+       },
+
+       merge: function( first, second ) {
+               // We have to loop this way because IE & Opera overwrite the length
+               // expando of getElementsByTagName
+               var i = 0, elem, pos = first.length;
+               // Also, we need to make sure that the correct elements are being returned
+               // (IE returns comment nodes in a '*' query)
+               if ( jQuery.browser.msie ) {
+                       while ( elem = second[ i++ ] )
+                               if ( elem.nodeType != 8 )
+                                       first[ pos++ ] = elem;
+
+               } else
+                       while ( elem = second[ i++ ] )
+                               first[ pos++ ] = elem;
+
+               return first;
+       },
+
+       unique: function( array ) {
+               var ret = [], done = {};
+
+               try {
+
+                       for ( var i = 0, length = array.length; i < length; i++ ) {
+                               var id = jQuery.data( array[ i ] );
+
+                               if ( !done[ id ] ) {
+                                       done[ id ] = true;
+                                       ret.push( array[ i ] );
+                               }
+                       }
+
+               } catch( e ) {
+                       ret = array;
+               }
+
+               return ret;
+       },
+
+       grep: function( elems, callback, inv ) {
+               var ret = [];
+
+               // Go through the array, only saving the items
+               // that pass the validator function
+               for ( var i = 0, length = elems.length; i < length; i++ )
+                       if ( !inv != !callback( elems[ i ], i ) )
+                               ret.push( elems[ i ] );
+
+               return ret;
+       },
+
+       map: function( elems, callback ) {
+               var ret = [];
+
+               // Go through the array, translating each of the items to their
+               // new value (or values).
+               for ( var i = 0, length = elems.length; i < length; i++ ) {
+                       var value = callback( elems[ i ], i );
+
+                       if ( value != null )
+                               ret[ ret.length ] = value;
+               }
+
+               return ret.concat.apply( [], ret );
+       }
+});
+
+var userAgent = navigator.userAgent.toLowerCase();
+
+// Figure out what browser is being used
+jQuery.browser = {
+       version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [])[1],
+       safari: /webkit/.test( userAgent ),
+       opera: /opera/.test( userAgent ),
+       msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),
+       mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent )
+};
+
+var styleFloat = jQuery.browser.msie ?
+       "styleFloat" :
+       "cssFloat";
+
+jQuery.extend({
+       // Check to see if the W3C box model is being used
+       boxModel: !jQuery.browser.msie || document.compatMode == "CSS1Compat",
+
+       props: {
+               "for": "htmlFor",
+               "class": "className",
+               "float": styleFloat,
+               cssFloat: styleFloat,
+               styleFloat: styleFloat,
+               readonly: "readOnly",
+               maxlength: "maxLength",
+               cellspacing: "cellSpacing"
+       }
+});
+
+jQuery.each({
+       parent: function(elem){return elem.parentNode;},
+       parents: function(elem){return jQuery.dir(elem,"parentNode");},
+       next: function(elem){return jQuery.nth(elem,2,"nextSibling");},
+       prev: function(elem){return jQuery.nth(elem,2,"previousSibling");},
+       nextAll: function(elem){return jQuery.dir(elem,"nextSibling");},
+       prevAll: function(elem){return jQuery.dir(elem,"previousSibling");},
+       siblings: function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},
+       children: function(elem){return jQuery.sibling(elem.firstChild);},
+       contents: function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}
+}, function(name, fn){
+       jQuery.fn[ name ] = function( selector ) {
+               var ret = jQuery.map( this, fn );
+
+               if ( selector && typeof selector == "string" )
+                       ret = jQuery.multiFilter( selector, ret );
+
+               return this.pushStack( jQuery.unique( ret ) );
+       };
+});
+
+jQuery.each({
+       appendTo: "append",
+       prependTo: "prepend",
+       insertBefore: "before",
+       insertAfter: "after",
+       replaceAll: "replaceWith"
+}, function(name, original){
+       jQuery.fn[ name ] = function() {
+               var args = arguments;
+
+               return this.each(function(){
+                       for ( var i = 0, length = args.length; i < length; i++ )
+                               jQuery( args[ i ] )[ original ]( this );
+               });
+       };
+});
+
+jQuery.each({
+       removeAttr: function( name ) {
+               jQuery.attr( this, name, "" );
+               if (this.nodeType == 1)
+                       this.removeAttribute( name );
+       },
+
+       addClass: function( classNames ) {
+               jQuery.className.add( this, classNames );
+       },
+
+       removeClass: function( classNames ) {
+               jQuery.className.remove( this, classNames );
+       },
+
+       toggleClass: function( classNames ) {
+               jQuery.className[ jQuery.className.has( this, classNames ) ? "remove" : "add" ]( this, classNames );
+       },
+
+       remove: function( selector ) {
+               if ( !selector || jQuery.filter( selector, [ this ] ).r.length ) {
+                       // Prevent memory leaks
+                       jQuery( "*", this ).add(this).each(function(){
+                               jQuery.event.remove(this);
+                               jQuery.removeData(this);
+                       });
+                       if (this.parentNode)
+                               this.parentNode.removeChild( this );
+               }
+       },
+
+       empty: function() {
+               // Remove element nodes and prevent memory leaks
+               jQuery( ">*", this ).remove();
+
+               // Remove any remaining nodes
+               while ( this.firstChild )
+                       this.removeChild( this.firstChild );
+       }
+}, function(name, fn){
+       jQuery.fn[ name ] = function(){
+               return this.each( fn, arguments );
+       };
+});
+
+jQuery.each([ "Height", "Width" ], function(i, name){
+       var type = name.toLowerCase();
+
+       jQuery.fn[ type ] = function( size ) {
+               // Get window width or height
+               return this[0] == window ?
+                       // Opera reports document.body.client[Width/Height] properly in both quirks and standards
+                       jQuery.browser.opera && document.body[ "client" + name ] ||
+
+                       // Safari reports inner[Width/Height] just fine (Mozilla and Opera include scroll bar widths)
+                       jQuery.browser.safari && window[ "inner" + name ] ||
+
+                       // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
+                       document.compatMode == "CSS1Compat" && document.documentElement[ "client" + name ] || document.body[ "client" + name ] :
+
+                       // Get document width or height
+                       this[0] == document ?
+                               // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
+                               Math.max(
+                                       Math.max(document.body["scroll" + name], document.documentElement["scroll" + name]),
+                                       Math.max(document.body["offset" + name], document.documentElement["offset" + name])
+                               ) :
+
+                               // Get or set width or height on the element
+                               size == undefined ?
+                                       // Get width or height on the element
+                                       (this.length ? jQuery.css( this[0], type ) : null) :
+
+                                       // Set the width or height on the element (default to pixels if value is unitless)
+                                       this.css( type, size.constructor == String ? size : size + "px" );
+       };
+});
+
+// Helper function used by the dimensions and offset modules
+function num(elem, prop) {
+       return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0;
+}var chars = jQuery.browser.safari && parseInt(jQuery.browser.version) < 417 ?
+               "(?:[\\w*_-]|\\\\.)" :
+               "(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",
+       quickChild = new RegExp("^>\\s*(" + chars + "+)"),
+       quickID = new RegExp("^(" + chars + "+)(#)(" + chars + "+)"),
+       quickClass = new RegExp("^([#.]?)(" + chars + "*)");
+
+jQuery.extend({
+       expr: {
+               "": function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},
+               "#": function(a,i,m){return a.getAttribute("id")==m[2];},
+               ":": {
+                       // Position Checks
+                       lt: function(a,i,m){return i<m[3]-0;},
+                       gt: function(a,i,m){return i>m[3]-0;},
+                       nth: function(a,i,m){return m[3]-0==i;},
+                       eq: function(a,i,m){return m[3]-0==i;},
+                       first: function(a,i){return i==0;},
+                       last: function(a,i,m,r){return i==r.length-1;},
+                       even: function(a,i){return i%2==0;},
+                       odd: function(a,i){return i%2;},
+
+                       // Child Checks
+                       "first-child": function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},
+                       "last-child": function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},
+                       "only-child": function(a){return !jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},
+
+                       // Parent Checks
+                       parent: function(a){return a.firstChild;},
+                       empty: function(a){return !a.firstChild;},
+
+                       // Text Check
+                       contains: function(a,i,m){return (a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},
+
+                       // Visibility
+                       visible: function(a){return "hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},
+                       hidden: function(a){return "hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},
+
+                       // Form attributes
+                       enabled: function(a){return !a.disabled;},
+                       disabled: function(a){return a.disabled;},
+                       checked: function(a){return a.checked;},
+                       selected: function(a){return a.selected||jQuery.attr(a,"selected");},
+
+                       // Form elements
+                       text: function(a){return "text"==a.type;},
+                       radio: function(a){return "radio"==a.type;},
+                       checkbox: function(a){return "checkbox"==a.type;},
+                       file: function(a){return "file"==a.type;},
+                       password: function(a){return "password"==a.type;},
+                       submit: function(a){return "submit"==a.type;},
+                       image: function(a){return "image"==a.type;},
+                       reset: function(a){return "reset"==a.type;},
+                       button: function(a){return "button"==a.type||jQuery.nodeName(a,"button");},
+                       input: function(a){return /input|select|textarea|button/i.test(a.nodeName);},
+
+                       // :has()
+                       has: function(a,i,m){return jQuery.find(m[3],a).length;},
+
+                       // :header
+                       header: function(a){return /h\d/i.test(a.nodeName);},
+
+                       // :animated
+                       animated: function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}
+               }
+       },
+
+       // The regular expressions that power the parsing engine
+       parse: [
+               // Match: [@value='test'], [@foo]
+               /^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,
+
+               // Match: :contains('foo')
+               /^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,
+
+               // Match: :even, :last-child, #id, .class
+               new RegExp("^([:.#]*)(" + chars + "+)")
+       ],
+
+       multiFilter: function( expr, elems, not ) {
+               var old, cur = [];
+
+               while ( expr && expr != old ) {
+                       old = expr;
+                       var f = jQuery.filter( expr, elems, not );
+                       expr = f.t.replace(/^\s*,\s*/, "" );
+                       cur = not ? elems = f.r : jQuery.merge( cur, f.r );
+               }
+
+               return cur;
+       },
+
+       find: function( t, context ) {
+               // Quickly handle non-string expressions
+               if ( typeof t != "string" )
+                       return [ t ];
+
+               // check to make sure context is a DOM element or a document
+               if ( context && context.nodeType != 1 && context.nodeType != 9)
+                       return [ ];
+
+               // Set the correct context (if none is provided)
+               context = context || document;
+
+               // Initialize the search
+               var ret = [context], done = [], last, nodeName;
+
+               // Continue while a selector expression exists, and while
+               // we're no longer looping upon ourselves
+               while ( t && last != t ) {
+                       var r = [];
+                       last = t;
+
+                       t = jQuery.trim(t);
+
+                       var foundToken = false,
+
+                       // An attempt at speeding up child selectors that
+                       // point to a specific element tag
+                               re = quickChild,
+
+                               m = re.exec(t);
+
+                       if ( m ) {
+                               nodeName = m[1].toUpperCase();
+
+                               // Perform our own iteration and filter
+                               for ( var i = 0; ret[i]; i++ )
+                                       for ( var c = ret[i].firstChild; c; c = c.nextSibling )
+                                               if ( c.nodeType == 1 && (nodeName == "*" || c.nodeName.toUpperCase() == nodeName) )
+                                                       r.push( c );
+
+                               ret = r;
+                               t = t.replace( re, "" );
+                               if ( t.indexOf(" ") == 0 ) continue;
+                               foundToken = true;
+                       } else {
+                               re = /^([>+~])\s*(\w*)/i;
+
+                               if ( (m = re.exec(t)) != null ) {
+                                       r = [];
+
+                                       var merge = {};
+                                       nodeName = m[2].toUpperCase();
+                                       m = m[1];
+
+                                       for ( var j = 0, rl = ret.length; j < rl; j++ ) {
+                                               var n = m == "~" || m == "+" ? ret[j].nextSibling : ret[j].firstChild;
+                                               for ( ; n; n = n.nextSibling )
+                                                       if ( n.nodeType == 1 ) {
+                                                               var id = jQuery.data(n);
+
+                                                               if ( m == "~" && merge[id] ) break;
+
+                                                               if (!nodeName || n.nodeName.toUpperCase() == nodeName ) {
+                                                                       if ( m == "~" ) merge[id] = true;
+                                                                       r.push( n );
+                                                               }
+
+                                                               if ( m == "+" ) break;
+                                                       }
+                                       }
+
+                                       ret = r;
+
+                                       // And remove the token
+                                       t = jQuery.trim( t.replace( re, "" ) );
+                                       foundToken = true;
+                               }
+                       }
+
+                       // See if there's still an expression, and that we haven't already
+                       // matched a token
+                       if ( t && !foundToken ) {
+                               // Handle multiple expressions
+                               if ( !t.indexOf(",") ) {
+                                       // Clean the result set
+                                       if ( context == ret[0] ) ret.shift();
+
+                                       // Merge the result sets
+                                       done = jQuery.merge( done, ret );
+
+                                       // Reset the context
+                                       r = ret = [context];
+
+                                       // Touch up the selector string
+                                       t = " " + t.substr(1,t.length);
+
+                               } else {
+                                       // Optimize for the case nodeName#idName
+                                       var re2 = quickID;
+                                       var m = re2.exec(t);
+
+                                       // Re-organize the results, so that they're consistent
+                                       if ( m ) {
+                                               m = [ 0, m[2], m[3], m[1] ];
+
+                                       } else {
+                                               // Otherwise, do a traditional filter check for
+                                               // ID, class, and element selectors
+                                               re2 = quickClass;
+                                               m = re2.exec(t);
+                                       }
+
+                                       m[2] = m[2].replace(/\\/g, "");
+
+                                       var elem = ret[ret.length-1];
+
+                                       // Try to do a global search by ID, where we can
+                                       if ( m[1] == "#" && elem && elem.getElementById && !jQuery.isXMLDoc(elem) ) {
+                                               // Optimization for HTML document case
+                                               var oid = elem.getElementById(m[2]);
+
+                                               // Do a quick check for the existence of the actual ID attribute
+                                               // to avoid selecting by the name attribute in IE
+                                               // also check to insure id is a string to avoid selecting an element with the name of 'id' inside a form
+                                               if ( (jQuery.browser.msie||jQuery.browser.opera) && oid && typeof oid.id == "string" && oid.id != m[2] )
+                                                       oid = jQuery('[@id="'+m[2]+'"]', elem)[0];
+
+                                               // Do a quick check for node name (where applicable) so
+                                               // that div#foo searches will be really fast
+                                               ret = r = oid && (!m[3] || jQuery.nodeName(oid, m[3])) ? [oid] : [];
+                                       } else {
+                                               // We need to find all descendant elements
+                                               for ( var i = 0; ret[i]; i++ ) {
+                                                       // Grab the tag name being searched for
+                                                       var tag = m[1] == "#" && m[3] ? m[3] : m[1] != "" || m[0] == "" ? "*" : m[2];
+
+                                                       // Handle IE7 being really dumb about <object>s
+                                                       if ( tag == "*" && ret[i].nodeName.toLowerCase() == "object" )
+                                                               tag = "param";
+
+                                                       r = jQuery.merge( r, ret[i].getElementsByTagName( tag ));
+                                               }
+
+                                               // It's faster to filter by class and be done with it
+                                               if ( m[1] == "." )
+                                                       r = jQuery.classFilter( r, m[2] );
+
+                                               // Same with ID filtering
+                                               if ( m[1] == "#" ) {
+                                                       var tmp = [];
+
+                                                       // Try to find the element with the ID
+                                                       for ( var i = 0; r[i]; i++ )
+                                                               if ( r[i].getAttribute("id") == m[2] ) {
+                                                                       tmp = [ r[i] ];
+                                                                       break;
+                                                               }
+
+                                                       r = tmp;
+                                               }
+
+                                               ret = r;
+                                       }
+
+                                       t = t.replace( re2, "" );
+                               }
+
+                       }
+
+                       // If a selector string still exists
+                       if ( t ) {
+                               // Attempt to filter it
+                               var val = jQuery.filter(t,r);
+                               ret = r = val.r;
+                               t = jQuery.trim(val.t);
+                       }
+               }
+
+               // An error occurred with the selector;
+               // just return an empty set instead
+               if ( t )
+                       ret = [];
+
+               // Remove the root context
+               if ( ret && context == ret[0] )
+                       ret.shift();
+
+               // And combine the results
+               done = jQuery.merge( done, ret );
+
+               return done;
+       },
+
+       classFilter: function(r,m,not){
+               m = " " + m + " ";
+               var tmp = [];
+               for ( var i = 0; r[i]; i++ ) {
+                       var pass = (" " + r[i].className + " ").indexOf( m ) >= 0;
+                       if ( !not && pass || not && !pass )
+                               tmp.push( r[i] );
+               }
+               return tmp;
+       },
+
+       filter: function(t,r,not) {
+               var last;
+
+               // Look for common filter expressions
+               while ( t && t != last ) {
+                       last = t;
+
+                       var p = jQuery.parse, m;
+
+                       for ( var i = 0; p[i]; i++ ) {
+                               m = p[i].exec( t );
+
+                               if ( m ) {
+                                       // Remove what we just matched
+                                       t = t.substring( m[0].length );
+
+                                       m[2] = m[2].replace(/\\/g, "");
+                                       break;
+                               }
+                       }
+
+                       if ( !m )
+                               break;
+
+                       // :not() is a special case that can be optimized by
+                       // keeping it out of the expression list
+                       if ( m[1] == ":" && m[2] == "not" )
+                               // optimize if only one selector found (most common case)
+                               r = isSimple.test( m[3] ) ?
+                                       jQuery.filter(m[3], r, true).r :
+                                       jQuery( r ).not( m[3] );
+
+                       // We can get a big speed boost by filtering by class here
+                       else if ( m[1] == "." )
+                               r = jQuery.classFilter(r, m[2], not);
+
+                       else if ( m[1] == "[" ) {
+                               var tmp = [], type = m[3];
+
+                               for ( var i = 0, rl = r.length; i < rl; i++ ) {
+                                       var a = r[i], z = a[ jQuery.props[m[2]] || m[2] ];
+
+                                       if ( z == null || /href|src|selected/.test(m[2]) )
+                                               z = jQuery.attr(a,m[2]) || '';
+
+                                       if ( (type == "" && !!z ||
+                                                type == "=" && z == m[5] ||
+                                                type == "!=" && z != m[5] ||
+                                                type == "^=" && z && !z.indexOf(m[5]) ||
+                                                type == "$=" && z.substr(z.length - m[5].length) == m[5] ||
+                                                (type == "*=" || type == "~=") && z.indexOf(m[5]) >= 0) ^ not )
+                                                       tmp.push( a );
+                               }
+
+                               r = tmp;
+
+                       // We can get a speed boost by handling nth-child here
+                       } else if ( m[1] == ":" && m[2] == "nth-child" ) {
+                               var merge = {}, tmp = [],
+                                       // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
+                                       test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
+                                               m[3] == "even" && "2n" || m[3] == "odd" && "2n+1" ||
+                                               !/\D/.test(m[3]) && "0n+" + m[3] || m[3]),
+                                       // calculate the numbers (first)n+(last) including if they are negative
+                                       first = (test[1] + (test[2] || 1)) - 0, last = test[3] - 0;
+
+                               // loop through all the elements left in the jQuery object
+                               for ( var i = 0, rl = r.length; i < rl; i++ ) {
+                                       var node = r[i], parentNode = node.parentNode, id = jQuery.data(parentNode);
+
+                                       if ( !merge[id] ) {
+                                               var c = 1;
+
+                                               for ( var n = parentNode.firstChild; n; n = n.nextSibling )
+                                                       if ( n.nodeType == 1 )
+                                                               n.nodeIndex = c++;
+
+                                               merge[id] = true;
+                                       }
+
+                                       var add = false;
+
+                                       if ( first == 0 ) {
+                                               if ( node.nodeIndex == last )
+                                                       add = true;
+                                       } else if ( (node.nodeIndex - last) % first == 0 && (node.nodeIndex - last) / first >= 0 )
+                                               add = true;
+
+                                       if ( add ^ not )
+                                               tmp.push( node );
+                               }
+
+                               r = tmp;
+
+                       // Otherwise, find the expression to execute
+                       } else {
+                               var fn = jQuery.expr[ m[1] ];
+                               if ( typeof fn == "object" )
+                                       fn = fn[ m[2] ];
+
+                               if ( typeof fn == "string" )
+                                       fn = eval("false||function(a,i){return " + fn + ";}");
+
+                               // Execute it against the current filter
+                               r = jQuery.grep( r, function(elem, i){
+                                       return fn(elem, i, m, r);
+                               }, not );
+                       }
+               }
+
+               // Return an array of filtered elements (r)
+               // and the modified expression string (t)
+               return { r: r, t: t };
+       },
+
+       dir: function( elem, dir ){
+               var matched = [],
+                       cur = elem[dir];
+               while ( cur && cur != document ) {
+                       if ( cur.nodeType == 1 )
+                               matched.push( cur );
+                       cur = cur[dir];
+               }
+               return matched;
+       },
+
+       nth: function(cur,result,dir,elem){
+               result = result || 1;
+               var num = 0;
+
+               for ( ; cur; cur = cur[dir] )
+                       if ( cur.nodeType == 1 && ++num == result )
+                               break;
+
+               return cur;
+       },
+
+       sibling: function( n, elem ) {
+               var r = [];
+
+               for ( ; n; n = n.nextSibling ) {
+                       if ( n.nodeType == 1 && n != elem )
+                               r.push( n );
+               }
+
+               return r;
+       }
+});
+/*
+ * A number of helper functions used for managing events.
+ * Many of the ideas behind this code orignated from
+ * Dean Edwards' addEvent library.
+ */
+jQuery.event = {
+
+       // Bind an event to an element
+       // Original by Dean Edwards
+       add: function(elem, types, handler, data) {
+               if ( elem.nodeType == 3 || elem.nodeType == 8 )
+                       return;
+
+               // For whatever reason, IE has trouble passing the window object
+               // around, causing it to be cloned in the process
+               if ( jQuery.browser.msie && elem.setInterval )
+                       elem = window;
+
+               // Make sure that the function being executed has a unique ID
+               if ( !handler.guid )
+                       handler.guid = this.guid++;
+
+               // if data is passed, bind to handler
+               if( data != undefined ) {
+                       // Create temporary function pointer to original handler
+                       var fn = handler;
+
+                       // Create unique handler function, wrapped around original handler
+                       handler = this.proxy( fn, function() {
+                               // Pass arguments and context to original handler
+                               return fn.apply(this, arguments);
+                       });
+
+                       // Store data in unique handler
+                       handler.data = data;
+               }
+
+               // Init the element's event structure
+               var events = jQuery.data(elem, "events") || jQuery.data(elem, "events", {}),
+                       handle = jQuery.data(elem, "handle") || jQuery.data(elem, "handle", function(){
+                               // Handle the second event of a trigger and when
+                               // an event is called after a page has unloaded
+                               if ( typeof jQuery != "undefined" && !jQuery.event.triggered )
+                                       return jQuery.event.handle.apply(arguments.callee.elem, arguments);
+                       });
+               // Add elem as a property of the handle function
+               // This is to prevent a memory leak with non-native
+               // event in IE.
+               handle.elem = elem;
+
+               // Handle multiple events separated by a space
+               // jQuery(...).bind("mouseover mouseout", fn);
+               jQuery.each(types.split(/\s+/), function(index, type) {
+                       // Namespaced event handlers
+                       var parts = type.split(".");
+                       type = parts[0];
+                       handler.type = parts[1];
+
+                       // Get the current list of functions bound to this event
+                       var handlers = events[type];
+
+                       // Init the event handler queue
+                       if (!handlers) {
+                               handlers = events[type] = {};
+
+                               // Check for a special event handler
+                               // Only use addEventListener/attachEvent if the special
+                               // events handler returns false
+                               if ( !jQuery.event.special[type] || jQuery.event.special[type].setup.call(elem) === false ) {
+                                       // Bind the global event handler to the element
+                                       if (elem.addEventListener)
+                                               elem.addEventListener(type, handle, false);
+                                       else if (elem.attachEvent)
+                                               elem.attachEvent("on" + type, handle);
+                               }
+                       }
+
+                       // Add the function to the element's handler list
+                       handlers[handler.guid] = handler;
+
+                       // Keep track of which events have been used, for global triggering
+                       jQuery.event.global[type] = true;
+               });
+
+               // Nullify elem to prevent memory leaks in IE
+               elem = null;
+       },
+
+       guid: 1,
+       global: {},
+
+       // Detach an event or set of events from an element
+       remove: function(elem, types, handler) {
+               // don't do events on text and comment nodes
+               if ( elem.nodeType == 3 || elem.nodeType == 8 )
+                       return;
+
+               var events = jQuery.data(elem, "events"), ret, index;
+
+               if ( events ) {
+                       // Unbind all events for the element
+                       if ( types == undefined || (typeof types == "string" && types.charAt(0) == ".") )
+                               for ( var type in events )
+                                       this.remove( elem, type + (types || "") );
+                       else {
+                               // types is actually an event object here
+                               if ( types.type ) {
+                                       handler = types.handler;
+                                       types = types.type;
+                               }
+
+                               // Handle multiple events seperated by a space
+                               // jQuery(...).unbind("mouseover mouseout", fn);
+                               jQuery.each(types.split(/\s+/), function(index, type){
+                                       // Namespaced event handlers
+                                       var parts = type.split(".");
+                                       type = parts[0];
+
+                                       if ( events[type] ) {
+                                               // remove the given handler for the given type
+                                               if ( handler )
+                                                       delete events[type][handler.guid];
+
+                                               // remove all handlers for the given type
+                                               else
+                                                       for ( handler in events[type] )
+                                                               // Handle the removal of namespaced events
+                                                               if ( !parts[1] || events[type][handler].type == parts[1] )
+                                                                       delete events[type][handler];
+
+                                               // remove generic event handler if no more handlers exist
+                                               for ( ret in events[type] ) break;
+                                               if ( !ret ) {
+                                                       if ( !jQuery.event.special[type] || jQuery.event.special[type].teardown.call(elem) === false ) {
+                                                               if (elem.removeEventListener)
+                                                                       elem.removeEventListener(type, jQuery.data(elem, "handle"), false);
+                                                               else if (elem.detachEvent)
+                                                                       elem.detachEvent("on" + type, jQuery.data(elem, "handle"));
+                                                       }
+                                                       ret = null;
+                                                       delete events[type];
+                                               }
+                                       }
+                               });
+                       }
+
+                       // Remove the expando if it's no longer used
+                       for ( ret in events ) break;
+                       if ( !ret ) {
+                               var handle = jQuery.data( elem, "handle" );
+                               if ( handle ) handle.elem = null;
+                               jQuery.removeData( elem, "events" );
+                               jQuery.removeData( elem, "handle" );
+                       }
+               }
+       },
+
+       trigger: function(type, data, elem, donative, extra) {
+               // Clone the incoming data, if any
+               data = jQuery.makeArray(data);
+
+               if ( type.indexOf("!") >= 0 ) {
+                       type = type.slice(0, -1);
+                       var exclusive = true;
+               }
+
+               // Handle a global trigger
+               if ( !elem ) {
+                       // Only trigger if we've ever bound an event for it
+                       if ( this.global[type] )
+                               jQuery("*").add([window, document]).trigger(type, data);
+
+               // Handle triggering a single element
+               } else {
+                       // don't do events on text and comment nodes
+                       if ( elem.nodeType == 3 || elem.nodeType == 8 )
+                               return undefined;
+
+                       var val, ret, fn = jQuery.isFunction( elem[ type ] || null ),
+                               // Check to see if we need to provide a fake event, or not
+                               event = !data[0] || !data[0].preventDefault;
+
+                       // Pass along a fake event
+                       if ( event ) {
+                               data.unshift({
+                                       type: type,
+                                       target: elem,
+                                       preventDefault: function(){},
+                                       stopPropagation: function(){},
+                                       timeStamp: now()
+                               });
+                               data[0][expando] = true; // no need to fix fake event
+                       }
+
+                       // Enforce the right trigger type
+                       data[0].type = type;
+                       if ( exclusive )
+                               data[0].exclusive = true;
+
+                       // Trigger the event, it is assumed that "handle" is a function
+                       var handle = jQuery.data(elem, "handle");
+                       if ( handle )
+                               val = handle.apply( elem, data );
+
+                       // Handle triggering native .onfoo handlers (and on links since we don't call .click() for links)
+                       if ( (!fn || (jQuery.nodeName(elem, 'a') && type == "click")) && elem["on"+type] && elem["on"+type].apply( elem, data ) === false )
+                               val = false;
+
+                       // Extra functions don't get the custom event object
+                       if ( event )
+                               data.shift();
+
+                       // Handle triggering of extra function
+                       if ( extra && jQuery.isFunction( extra ) ) {
+                               // call the extra function and tack the current return value on the end for possible inspection
+                               ret = extra.apply( elem, val == null ? data : data.concat( val ) );
+                               // if anything is returned, give it precedence and have it overwrite the previous value
+                               if (ret !== undefined)
+                                       val = ret;
+                       }
+
+                       // Trigger the native events (except for clicks on links)
+                       if ( fn && donative !== false && val !== false && !(jQuery.nodeName(elem, 'a') && type == "click") ) {
+                               this.triggered = true;
+                               try {
+                                       elem[ type ]();
+                               // prevent IE from throwing an error for some hidden elements
+                               } catch (e) {}
+                       }
+
+                       this.triggered = false;
+               }
+
+               return val;
+       },
+
+       handle: function(event) {
+               // returned undefined or false
+               var val, ret, namespace, all, handlers;
+
+               event = arguments[0] = jQuery.event.fix( event || window.event );
+
+               // Namespaced event handlers
+               namespace = event.type.split(".");
+               event.type = namespace[0];
+               namespace = namespace[1];
+               // Cache this now, all = true means, any handler
+               all = !namespace && !event.exclusive;
+
+               handlers = ( jQuery.data(this, "events") || {} )[event.type];
+
+               for ( var j in handlers ) {
+                       var handler = handlers[j];
+
+                       // Filter the functions by class
+                       if ( all || handler.type == namespace ) {
+                               // Pass in a reference to the handler function itself
+                               // So that we can later remove it
+                               event.handler = handler;
+                               event.data = handler.data;
+
+                               ret = handler.apply( this, arguments );
+
+                               if ( val !== false )
+                                       val = ret;
+
+                               if ( ret === false ) {
+                                       event.preventDefault();
+                                       event.stopPropagation();
+                               }
+                       }
+               }
+
+               return val;
+       },
+
+       fix: function(event) {
+               if ( event[expando] == true )
+                       return event;
+
+               // store a copy of the original event object
+               // and "clone" to set read-only properties
+               var originalEvent = event;
+               event = { originalEvent: originalEvent };
+               var props = "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");
+               for ( var i=props.length; i; i-- )
+                       event[ props[i] ] = originalEvent[ props[i] ];
+
+               // Mark it as fixed
+               event[expando] = true;
+
+               // add preventDefault and stopPropagation since
+               // they will not work on the clone
+               event.preventDefault = function() {
+                       // if preventDefault exists run it on the original event
+                       if (originalEvent.preventDefault)
+                               originalEvent.preventDefault();
+                       // otherwise set the returnValue property of the original event to false (IE)
+                       originalEvent.returnValue = false;
+               };
+               event.stopPropagation = function() {
+                       // if stopPropagation exists run it on the original event
+                       if (originalEvent.stopPropagation)
+                               originalEvent.stopPropagation();
+                       // otherwise set the cancelBubble property of the original event to true (IE)
+                       originalEvent.cancelBubble = true;
+               };
+
+               // Fix timeStamp
+               event.timeStamp = event.timeStamp || now();
+
+               // Fix target property, if necessary
+               if ( !event.target )
+                       event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either
+
+               // check if target is a textnode (safari)
+               if ( event.target.nodeType == 3 )
+                       event.target = event.target.parentNode;
+
+               // Add relatedTarget, if necessary
+               if ( !event.relatedTarget && event.fromElement )
+                       event.relatedTarget = event.fromElement == event.target ? event.toElement : event.fromElement;
+
+               // Calculate pageX/Y if missing and clientX/Y available
+               if ( event.pageX == null && event.clientX != null ) {
+                       var doc = document.documentElement, body = document.body;
+                       event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc.clientLeft || 0);
+                       event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc.clientTop || 0);
+               }
+
+               // Add which for key events
+               if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) )
+                       event.which = event.charCode || event.keyCode;
+
+               // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
+               if ( !event.metaKey && event.ctrlKey )
+                       event.metaKey = event.ctrlKey;
+
+               // Add which for click: 1 == left; 2 == middle; 3 == right
+               // Note: button is not normalized, so don't use it
+               if ( !event.which && event.button )
+                       event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
+
+               return event;
+       },
+
+       proxy: function( fn, proxy ){
+               // Set the guid of unique handler to the same of original handler, so it can be removed
+               proxy.guid = fn.guid = fn.guid || proxy.guid || this.guid++;
+               // So proxy can be declared as an argument
+               return proxy;
+       },
+
+       special: {
+               ready: {
+                       setup: function() {
+                               // Make sure the ready event is setup
+                               bindReady();
+                               return;
+                       },
+
+                       teardown: function() { return; }
+               },
+
+               mouseenter: {
+                       setup: function() {
+                               if ( jQuery.browser.msie ) return false;
+                               jQuery(this).bind("mouseover", jQuery.event.special.mouseenter.handler);
+                               return true;
+                       },
+
+                       teardown: function() {
+                               if ( jQuery.browser.msie ) return false;
+                               jQuery(this).unbind("mouseover", jQuery.event.special.mouseenter.handler);
+                               return true;
+                       },
+
+                       handler: function(event) {
+                               // If we actually just moused on to a sub-element, ignore it
+                               if ( withinElement(event, this) ) return true;
+                               // Execute the right handlers by setting the event type to mouseenter
+                               event.type = "mouseenter";
+                               return jQuery.event.handle.apply(this, arguments);
+                       }
+               },
+
+               mouseleave: {
+                       setup: function() {
+                               if ( jQuery.browser.msie ) return false;
+                               jQuery(this).bind("mouseout", jQuery.event.special.mouseleave.handler);
+                               return true;
+                       },
+
+                       teardown: function() {
+                               if ( jQuery.browser.msie ) return false;
+                               jQuery(this).unbind("mouseout", jQuery.event.special.mouseleave.handler);
+                               return true;
+                       },
+
+                       handler: function(event) {
+                               // If we actually just moused on to a sub-element, ignore it
+                               if ( withinElement(event, this) ) return true;
+                               // Execute the right handlers by setting the event type to mouseleave
+                               event.type = "mouseleave";
+                               return jQuery.event.handle.apply(this, arguments);
+                       }
+               }
+       }
+};
+
+jQuery.fn.extend({
+       bind: function( type, data, fn ) {
+               return type == "unload" ? this.one(type, data, fn) : this.each(function(){
+                       jQuery.event.add( this, type, fn || data, fn && data );
+               });
+       },
+
+       one: function( type, data, fn ) {
+               var one = jQuery.event.proxy( fn || data, function(event) {
+                       jQuery(this).unbind(event, one);
+                       return (fn || data).apply( this, arguments );
+               });
+               return this.each(function(){
+                       jQuery.event.add( this, type, one, fn && data);
+               });
+       },
+
+       unbind: function( type, fn ) {
+               return this.each(function(){
+                       jQuery.event.remove( this, type, fn );
+               });
+       },
+
+       trigger: function( type, data, fn ) {
+               return this.each(function(){
+                       jQuery.event.trigger( type, data, this, true, fn );
+               });
+       },
+
+       triggerHandler: function( type, data, fn ) {
+               return this[0] && jQuery.event.trigger( type, data, this[0], false, fn );
+       },
+
+       toggle: function( fn ) {
+               // Save reference to arguments for access in closure
+               var args = arguments, i = 1;
+
+               // link all the functions, so any of them can unbind this click handler
+               while( i < args.length )
+                       jQuery.event.proxy( fn, args[i++] );
+
+               return this.click( jQuery.event.proxy( fn, function(event) {
+                       // Figure out which function to execute
+                       this.lastToggle = ( this.lastToggle || 0 ) % i;
+
+                       // Make sure that clicks stop
+                       event.preventDefault();
+
+                       // and execute the function
+                       return args[ this.lastToggle++ ].apply( this, arguments ) || false;
+               }));
+       },
+
+       hover: function(fnOver, fnOut) {
+               return this.bind('mouseenter', fnOver).bind('mouseleave', fnOut);
+       },
+
+       ready: function(fn) {
+               // Attach the listeners
+               bindReady();
+
+               // If the DOM is already ready
+               if ( jQuery.isReady )
+                       // Execute the function immediately
+                       fn.call( document, jQuery );
+
+               // Otherwise, remember the function for later
+               else
+                       // Add the function to the wait list
+                       jQuery.readyList.push( function() { return fn.call(this, jQuery); } );
+
+               return this;
+       }
+});
+
+jQuery.extend({
+       isReady: false,
+       readyList: [],
+       // Handle when the DOM is ready
+       ready: function() {
+               // Make sure that the DOM is not already loaded
+               if ( !jQuery.isReady ) {
+                       // Remember that the DOM is ready
+                       jQuery.isReady = true;
+
+                       // If there are functions bound, to execute
+                       if ( jQuery.readyList ) {
+                               // Execute all of them
+                               jQuery.each( jQuery.readyList, function(){
+                                       this.call( document );
+                               });
+
+                               // Reset the list of functions
+                               jQuery.readyList = null;
+                       }
+
+                       // Trigger any bound ready events
+                       jQuery(document).triggerHandler("ready");
+               }
+       }
+});
+
+var readyBound = false;
+
+function bindReady(){
+       if ( readyBound ) return;
+       readyBound = true;
+
+       // Mozilla, Opera (see further below for it) and webkit nightlies currently support this event
+       if ( document.addEventListener && !jQuery.browser.opera)
+               // Use the handy event callback
+               document.addEventListener( "DOMContentLoaded", jQuery.ready, false );
+
+       // If IE is used and is not in a frame
+       // Continually check to see if the document is ready
+       if ( jQuery.browser.msie && window == top ) (function(){
+               if (jQuery.isReady) return;
+               try {
+                       // If IE is used, use the trick by Diego Perini
+                       // http://javascript.nwbox.com/IEContentLoaded/
+                       document.documentElement.doScroll("left");
+               } catch( error ) {
+                       setTimeout( arguments.callee, 0 );
+                       return;
+               }
+               // and execute any waiting functions
+               jQuery.ready();
+       })();
+
+       if ( jQuery.browser.opera )
+               document.addEventListener( "DOMContentLoaded", function () {
+                       if (jQuery.isReady) return;
+                       for (var i = 0; i < document.styleSheets.length; i++)
+                               if (document.styleSheets[i].disabled) {
+                                       setTimeout( arguments.callee, 0 );
+                                       return;
+                               }
+                       // and execute any waiting functions
+                       jQuery.ready();
+               }, false);
+
+       if ( jQuery.browser.safari ) {
+               var numStyles;
+               (function(){
+                       if (jQuery.isReady) return;
+                       if ( document.readyState != "loaded" && document.readyState != "complete" ) {
+                               setTimeout( arguments.callee, 0 );
+                               return;
+                       }
+                       if ( numStyles === undefined )
+                               numStyles = jQuery("style, link[rel=stylesheet]").length;
+                       if ( document.styleSheets.length != numStyles ) {
+                               setTimeout( arguments.callee, 0 );
+                               return;
+                       }
+                       // and execute any waiting functions
+                       jQuery.ready();
+               })();
+       }
+
+       // A fallback to window.onload, that will always work
+       jQuery.event.add( window, "load", jQuery.ready );
+}
+
+jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," +
+       "mousedown,mouseup,mousemove,mouseover,mouseout,change,select," +
+       "submit,keydown,keypress,keyup,error").split(","), function(i, name){
+
+       // Handle event binding
+       jQuery.fn[name] = function(fn){
+               return fn ? this.bind(name, fn) : this.trigger(name);
+       };
+});
+
+// Checks if an event happened on an element within another element
+// Used in jQuery.event.special.mouseenter and mouseleave handlers
+var withinElement = function(event, elem) {
+       // Check if mouse(over|out) are still within the same parent element
+       var parent = event.relatedTarget;
+       // Traverse up the tree
+       while ( parent && parent != elem ) try { parent = parent.parentNode; } catch(error) { parent = elem; }
+       // Return true if we actually just moused on to a sub-element
+       return parent == elem;
+};
+
+// Prevent memory leaks in IE
+// And prevent errors on refresh with events like mouseover in other browsers
+// Window isn't included so as not to unbind existing unload events
+jQuery(window).bind("unload", function() {
+       jQuery("*").add(document).unbind();
+});
+jQuery.fn.extend({
+       // Keep a copy of the old load
+       _load: jQuery.fn.load,
+
+       load: function( url, params, callback ) {
+               if ( typeof url != 'string' )
+                       return this._load( url );
+
+               var off = url.indexOf(" ");
+               if ( off >= 0 ) {
+                       var selector = url.slice(off, url.length);
+                       url = url.slice(0, off);
+               }
+
+               callback = callback || function(){};
+
+               // Default to a GET request
+               var type = "GET";
+
+               // If the second parameter was provided
+               if ( params )
+                       // If it's a function
+                       if ( jQuery.isFunction( params ) ) {
+                               // We assume that it's the callback
+                               callback = params;
+                               params = null;
+
+                       // Otherwise, build a param string
+                       } else {
+                               params = jQuery.param( params );
+                               type = "POST";
+                       }
+
+               var self = this;
+
+               // Request the remote document
+               jQuery.ajax({
+                       url: url,
+                       type: type,
+                       dataType: "html",
+                       data: params,
+                       complete: function(res, status){
+                               // If successful, inject the HTML into all the matched elements
+                               if ( status == "success" || status == "notmodified" )
+                                       // See if a selector was specified
+                                       self.html( selector ?
+                                               // Create a dummy div to hold the results
+                                               jQuery("<div/>")
+                                                       // inject the contents of the document in, removing the scripts
+                                                       // to avoid any 'Permission Denied' errors in IE
+                                                       .append(res.responseText.replace(/<script(.|\s)*?\/script>/g, ""))
+
+                                                       // Locate the specified elements
+                                                       .find(selector) :
+
+                                               // If not, just inject the full result
+                                               res.responseText );
+
+                               self.each( callback, [res.responseText, status, res] );
+                       }
+               });
+               return this;
+       },
+
+       serialize: function() {
+               return jQuery.param(this.serializeArray());
+       },
+       serializeArray: function() {
+               return this.map(function(){
+                       return jQuery.nodeName(this, "form") ?
+                               jQuery.makeArray(this.elements) : this;
+               })
+               .filter(function(){
+                       return this.name && !this.disabled &&
+                               (this.checked || /select|textarea/i.test(this.nodeName) ||
+                                       /text|hidden|password/i.test(this.type));
+               })
+               .map(function(i, elem){
+                       var val = jQuery(this).val();
+                       return val == null ? null :
+                               val.constructor == Array ?
+                                       jQuery.map( val, function(val, i){
+                                               return {name: elem.name, value: val};
+                                       }) :
+                                       {name: elem.name, value: val};
+               }).get();
+       }
+});
+
+// Attach a bunch of functions for handling common AJAX events
+jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i,o){
+       jQuery.fn[o] = function(f){
+               return this.bind(o, f);
+       };
+});
+
+var jsc = now();
+
+jQuery.extend({
+       get: function( url, data, callback, type ) {
+               // shift arguments if data argument was ommited
+               if ( jQuery.isFunction( data ) ) {
+                       callback = data;
+                       data = null;
+               }
+
+               return jQuery.ajax({
+                       type: "GET",
+                       url: url,
+                       data: data,
+                       success: callback,
+                       dataType: type
+               });
+       },
+
+       getScript: function( url, callback ) {
+               return jQuery.get(url, null, callback, "script");
+       },
+
+       getJSON: function( url, data, callback ) {
+               return jQuery.get(url, data, callback, "json");
+       },
+
+       post: function( url, data, callback, type ) {
+               if ( jQuery.isFunction( data ) ) {
+                       callback = data;
+                       data = {};
+               }
+
+               return jQuery.ajax({
+                       type: "POST",
+                       url: url,
+                       data: data,
+                       success: callback,
+                       dataType: type
+               });
+       },
+
+       ajaxSetup: function( settings ) {
+               jQuery.extend( jQuery.ajaxSettings, settings );
+       },
+
+       ajaxSettings: {
+               url: location.href,
+               global: true,
+               type: "GET",
+               timeout: 0,
+               contentType: "application/x-www-form-urlencoded",
+               processData: true,
+               async: true,
+               data: null,
+               username: null,
+               password: null,
+               accepts: {
+                       xml: "application/xml, text/xml",
+                       html: "text/html",
+                       script: "text/javascript, application/javascript",
+                       json: "application/json, text/javascript",
+                       text: "text/plain",
+                       _default: "*/*"
+               }
+       },
+
+       // Last-Modified header cache for next request
+       lastModified: {},
+
+       ajax: function( s ) {
+               // Extend the settings, but re-extend 's' so that it can be
+               // checked again later (in the test suite, specifically)
+               s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s));
+
+               var jsonp, jsre = /=\?(&|$)/g, status, data,
+                       type = s.type.toUpperCase();
+
+               // convert data if not already a string
+               if ( s.data && s.processData && typeof s.data != "string" )
+                       s.data = jQuery.param(s.data);
+
+               // Handle JSONP Parameter Callbacks
+               if ( s.dataType == "jsonp" ) {
+                       if ( type == "GET" ) {
+                               if ( !s.url.match(jsre) )
+                                       s.url += (s.url.match(/\?/) ? "&" : "?") + (s.jsonp || "callback") + "=?";
+                       } else if ( !s.data || !s.data.match(jsre) )
+                               s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
+                       s.dataType = "json";
+               }
+
+               // Build temporary JSONP function
+               if ( s.dataType == "json" && (s.data && s.data.match(jsre) || s.url.match(jsre)) ) {
+                       jsonp = "jsonp" + jsc++;
+
+                       // Replace the =? sequence both in the query string and the data
+                       if ( s.data )
+                               s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
+                       s.url = s.url.replace(jsre, "=" + jsonp + "$1");
+
+                       // We need to make sure
+                       // that a JSONP style response is executed properly
+                       s.dataType = "script";
+
+                       // Handle JSONP-style loading
+                       window[ jsonp ] = function(tmp){
+                               data = tmp;
+                               success();
+                               complete();
+                               // Garbage collect
+                               window[ jsonp ] = undefined;
+                               try{ delete window[ jsonp ]; } catch(e){}
+                               if ( head )
+                                       head.removeChild( script );
+                       };
+               }
+
+               if ( s.dataType == "script" && s.cache == null )
+                       s.cache = false;
+
+               if ( s.cache === false && type == "GET" ) {
+                       var ts = now();
+                       // try replacing _= if it is there
+                       var ret = s.url.replace(/(\?|&)_=.*?(&|$)/, "$1_=" + ts + "$2");
+                       // if nothing was replaced, add timestamp to the end
+                       s.url = ret + ((ret == s.url) ? (s.url.match(/\?/) ? "&" : "?") + "_=" + ts : "");
+               }
+
+               // If data is available, append data to url for get requests
+               if ( s.data && type == "GET" ) {
+                       s.url += (s.url.match(/\?/) ? "&" : "?") + s.data;
+
+                       // IE likes to send both get and post data, prevent this
+                       s.data = null;
+               }
+
+               // Watch for a new set of requests
+               if ( s.global && ! jQuery.active++ )
+                       jQuery.event.trigger( "ajaxStart" );
+
+               // Matches an absolute URL, and saves the domain
+               var remote = /^(?:\w+:)?\/\/([^\/?#]+)/;
+
+               // If we're requesting a remote document
+               // and trying to load JSON or Script with a GET
+               if ( s.dataType == "script" && type == "GET"
+                               && remote.test(s.url) && remote.exec(s.url)[1] != location.host ){
+                       var head = document.getElementsByTagName("head")[0];
+                       var script = document.createElement("script");
+                       script.src = s.url;
+                       if (s.scriptCharset)
+                               script.charset = s.scriptCharset;
+
+                       // Handle Script loading
+                       if ( !jsonp ) {
+                               var done = false;
+
+                               // Attach handlers for all browsers
+                               script.onload = script.onreadystatechange = function(){
+                                       if ( !done && (!this.readyState ||
+                                                       this.readyState == "loaded" || this.readyState == "complete") ) {
+                                               done = true;
+                                               success();
+                                               complete();
+                                               head.removeChild( script );
+                                       }
+                               };
+                       }
+
+                       head.appendChild(script);
+
+                       // We handle everything using the script element injection
+                       return undefined;
+               }
+
+               var requestDone = false;
+
+               // Create the request object; Microsoft failed to properly
+               // implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available
+               var xhr = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
+
+               // Open the socket
+               // Passing null username, generates a login popup on Opera (#2865)
+               if( s.username )
+                       xhr.open(type, s.url, s.async, s.username, s.password);
+               else
+                       xhr.open(type, s.url, s.async);
+
+               // Need an extra try/catch for cross domain requests in Firefox 3
+               try {
+                       // Set the correct header, if data is being sent
+                       if ( s.data )
+                               xhr.setRequestHeader("Content-Type", s.contentType);
+
+                       // Set the If-Modified-Since header, if ifModified mode.
+                       if ( s.ifModified )
+                               xhr.setRequestHeader("If-Modified-Since",
+                                       jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT" );
+
+                       // Set header so the called script knows that it's an XMLHttpRequest
+                       xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
+
+                       // Set the Accepts header for the server, depending on the dataType
+                       xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
+                               s.accepts[ s.dataType ] + ", */*" :
+                               s.accepts._default );
+               } catch(e){}
+
+               // Allow custom headers/mimetypes
+               if ( s.beforeSend && s.beforeSend(xhr, s) === false ) {
+                       // cleanup active request counter
+                       s.global && jQuery.active--;
+                       // close opended socket
+                       xhr.abort();
+                       return false;
+               }
+
+               if ( s.global )
+                       jQuery.event.trigger("ajaxSend", [xhr, s]);
+
+               // Wait for a response to come back
+               var onreadystatechange = function(isTimeout){
+                       // The transfer is complete and the data is available, or the request timed out
+                       if ( !requestDone && xhr && (xhr.readyState == 4 || isTimeout == "timeout") ) {
+                               requestDone = true;
+
+                               // clear poll interval
+                               if (ival) {
+                                       clearInterval(ival);
+                                       ival = null;
+                               }
+
+                               status = isTimeout == "timeout" && "timeout" ||
+                                       !jQuery.httpSuccess( xhr ) && "error" ||
+                                       s.ifModified && jQuery.httpNotModified( xhr, s.url ) && "notmodified" ||
+                                       "success";
+
+                               if ( status == "success" ) {
+                                       // Watch for, and catch, XML document parse errors
+                                       try {
+                                               // process the data (runs the xml through httpData regardless of callback)
+                                               data = jQuery.httpData( xhr, s.dataType, s.dataFilter );
+                                       } catch(e) {
+                                               status = "parsererror";
+                                       }
+                               }
+
+                               // Make sure that the request was successful or notmodified
+                               if ( status == "success" ) {
+                                       // Cache Last-Modified header, if ifModified mode.
+                                       var modRes;
+                                       try {
+                                               modRes = xhr.getResponseHeader("Last-Modified");
+                                       } catch(e) {} // swallow exception thrown by FF if header is not available
+
+                                       if ( s.ifModified && modRes )
+                                               jQuery.lastModified[s.url] = modRes;
+
+                                       // JSONP handles its own success callback
+                                       if ( !jsonp )
+                                               success();
+                               } else
+                                       jQuery.handleError(s, xhr, status);
+
+                               // Fire the complete handlers
+                               complete();
+
+                               // Stop memory leaks
+                               if ( s.async )
+                                       xhr = null;
+                       }
+               };
+
+               if ( s.async ) {
+                       // don't attach the handler to the request, just poll it instead
+                       var ival = setInterval(onreadystatechange, 13);
+
+                       // Timeout checker
+                       if ( s.timeout > 0 )
+                               setTimeout(function(){
+                                       // Check to see if the request is still happening
+                                       if ( xhr ) {
+                                               // Cancel the request
+                                               xhr.abort();
+
+                                               if( !requestDone )
+                                                       onreadystatechange( "timeout" );
+                                       }
+                               }, s.timeout);
+               }
+
+               // Send the data
+               try {
+                       xhr.send(s.data);
+               } catch(e) {
+                       jQuery.handleError(s, xhr, null, e);
+               }
+
+               // firefox 1.5 doesn't fire statechange for sync requests
+               if ( !s.async )
+                       onreadystatechange();
+
+               function success(){
+                       // If a local callback was specified, fire it and pass it the data
+                       if ( s.success )
+                               s.success( data, status );
+
+                       // Fire the global callback
+                       if ( s.global )
+                               jQuery.event.trigger( "ajaxSuccess", [xhr, s] );
+               }
+
+               function complete(){
+                       // Process result
+                       if ( s.complete )
+                               s.complete(xhr, status);
+
+                       // The request was completed
+                       if ( s.global )
+                               jQuery.event.trigger( "ajaxComplete", [xhr, s] );
+
+                       // Handle the global AJAX counter
+                       if ( s.global && ! --jQuery.active )
+                               jQuery.event.trigger( "ajaxStop" );
+               }
+
+               // return XMLHttpRequest to allow aborting the request etc.
+               return xhr;
+       },
+
+       handleError: function( s, xhr, status, e ) {
+               // If a local callback was specified, fire it
+               if ( s.error ) s.error( xhr, status, e );
+
+               // Fire the global callback
+               if ( s.global )
+                       jQuery.event.trigger( "ajaxError", [xhr, s, e] );
+       },
+
+       // Counter for holding the number of active queries
+       active: 0,
+
+       // Determines if an XMLHttpRequest was successful or not
+       httpSuccess: function( xhr ) {
+               try {
+                       // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
+                       return !xhr.status && location.protocol == "file:" ||
+                               ( xhr.status >= 200 && xhr.status < 300 ) || xhr.status == 304 || xhr.status == 1223 ||
+                               jQuery.browser.safari && xhr.status == undefined;
+               } catch(e){}
+               return false;
+       },
+
+       // Determines if an XMLHttpRequest returns NotModified
+       httpNotModified: function( xhr, url ) {
+               try {
+                       var xhrRes = xhr.getResponseHeader("Last-Modified");
+
+                       // Firefox always returns 200. check Last-Modified date
+                       return xhr.status == 304 || xhrRes == jQuery.lastModified[url] ||
+                               jQuery.browser.safari && xhr.status == undefined;
+               } catch(e){}
+               return false;
+       },
+
+       httpData: function( xhr, type, filter ) {
+               var ct = xhr.getResponseHeader("content-type"),
+                       xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0,
+                       data = xml ? xhr.responseXML : xhr.responseText;
+
+               if ( xml && data.documentElement.tagName == "parsererror" )
+                       throw "parsererror";
+                       
+               // Allow a pre-filtering function to sanitize the response
+               if( filter )
+                       data = filter( data, type );
+
+               // If the type is "script", eval it in global context
+               if ( type == "script" )
+                       jQuery.globalEval( data );
+
+               // Get the JavaScript object, if JSON is used.
+               if ( type == "json" )
+                       data = eval("(" + data + ")");
+
+               return data;
+       },
+
+       // Serialize an array of form elements or a set of
+       // key/values into a query string
+       param: function( a ) {
+               var s = [];
+
+               // If an array was passed in, assume that it is an array
+               // of form elements
+               if ( a.constructor == Array || a.jquery )
+                       // Serialize the form elements
+                       jQuery.each( a, function(){
+                               s.push( encodeURIComponent(this.name) + "=" + encodeURIComponent( this.value ) );
+                       });
+
+               // Otherwise, assume that it's an object of key/value pairs
+               else
+                       // Serialize the key/values
+                       for ( var j in a )
+                               // If the value is an array then the key names need to be repeated
+                               if ( a[j] && a[j].constructor == Array )
+                                       jQuery.each( a[j], function(){
+                                               s.push( encodeURIComponent(j) + "=" + encodeURIComponent( this ) );
+                                       });
+                               else
+                                       s.push( encodeURIComponent(j) + "=" + encodeURIComponent( jQuery.isFunction(a[j]) ? a[j]() : a[j] ) );
+
+               // Return the resulting serialization
+               return s.join("&").replace(/%20/g, "+");
+       }
+
+});
+jQuery.fn.extend({
+       show: function(speed,callback){
+               return speed ?
+                       this.animate({
+                               height: "show", width: "show", opacity: "show"
+                       }, speed, callback) :
+
+                       this.filter(":hidden").each(function(){
+                               this.style.display = this.oldblock || "";
+                               if ( jQuery.css(this,"display") == "none" ) {
+                                       var elem = jQuery("<" + this.tagName + " />").appendTo("body");
+                                       this.style.display = elem.css("display");
+                                       // handle an edge condition where css is - div { display:none; } or similar
+                                       if (this.style.display == "none")
+                                               this.style.display = "block";
+                                       elem.remove();
+                               }
+                       }).end();
+       },
+
+       hide: function(speed,callback){
+               return speed ?
+                       this.animate({
+                               height: "hide", width: "hide", opacity: "hide"
+                       }, speed, callback) :
+
+                       this.filter(":visible").each(function(){
+                               this.oldblock = this.oldblock || jQuery.css(this,"display");
+                               this.style.display = "none";
+                       }).end();
+       },
+
+       // Save the old toggle function
+       _toggle: jQuery.fn.toggle,
+
+       toggle: function( fn, fn2 ){
+               return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ?
+                       this._toggle.apply( this, arguments ) :
+                       fn ?
+                               this.animate({
+                                       height: "toggle", width: "toggle", opacity: "toggle"
+                               }, fn, fn2) :
+                               this.each(function(){
+                                       jQuery(this)[ jQuery(this).is(":hidden") ? "show" : "hide" ]();
+                               });
+       },
+
+       slideDown: function(speed,callback){
+               return this.animate({height: "show"}, speed, callback);
+       },
+
+       slideUp: function(speed,callback){
+               return this.animate({height: "hide"}, speed, callback);
+       },
+
+       slideToggle: function(speed, callback){
+               return this.animate({height: "toggle"}, speed, callback);
+       },
+
+       fadeIn: function(speed, callback){
+               return this.animate({opacity: "show"}, speed, callback);
+       },
+
+       fadeOut: function(speed, callback){
+               return this.animate({opacity: "hide"}, speed, callback);
+       },
+
+       fadeTo: function(speed,to,callback){
+               return this.animate({opacity: to}, speed, callback);
+       },
+
+       animate: function( prop, speed, easing, callback ) {
+               var optall = jQuery.speed(speed, easing, callback);
+
+               return this[ optall.queue === false ? "each" : "queue" ](function(){
+                       if ( this.nodeType != 1)
+                               return false;
+
+                       var opt = jQuery.extend({}, optall), p,
+                               hidden = jQuery(this).is(":hidden"), self = this;
+
+                       for ( p in prop ) {
+                               if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden )
+                                       return opt.complete.call(this);
+
+                               if ( p == "height" || p == "width" ) {
+                                       // Store display property
+                                       opt.display = jQuery.css(this, "display");
+
+                                       // Make sure that nothing sneaks out
+                                       opt.overflow = this.style.overflow;
+                               }
+                       }
+
+                       if ( opt.overflow != null )
+                               this.style.overflow = "hidden";
+
+                       opt.curAnim = jQuery.extend({}, prop);
+
+                       jQuery.each( prop, function(name, val){
+                               var e = new jQuery.fx( self, opt, name );
+
+                               if ( /toggle|show|hide/.test(val) )
+                                       e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop );
+                               else {
+                                       var parts = val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),
+                                               start = e.cur(true) || 0;
+
+                                       if ( parts ) {
+                                               var end = parseFloat(parts[2]),
+                                                       unit = parts[3] || "px";
+
+                                               // We need to compute starting value
+                                               if ( unit != "px" ) {
+                                                       self.style[ name ] = (end || 1) + unit;
+                                                       start = ((end || 1) / e.cur(true)) * start;
+                                                       self.style[ name ] = start + unit;
+                                               }
+
+                                               // If a +=/-= token was provided, we're doing a relative animation
+                                               if ( parts[1] )
+                                                       end = ((parts[1] == "-=" ? -1 : 1) * end) + start;
+
+                                               e.custom( start, end, unit );
+                                       } else
+                                               e.custom( start, val, "" );
+                               }
+                       });
+
+                       // For JS strict compliance
+                       return true;
+               });
+       },
+
+       queue: function(type, fn){
+               if ( jQuery.isFunction(type) || ( type && type.constructor == Array )) {
+                       fn = type;
+                       type = "fx";
+               }
+
+               if ( !type || (typeof type == "string" && !fn) )
+                       return queue( this[0], type );
+
+               return this.each(function(){
+                       if ( fn.constructor == Array )
+                               queue(this, type, fn);
+                       else {
+                               queue(this, type).push( fn );
+
+                               if ( queue(this, type).length == 1 )
+                                       fn.call(this);
+                       }
+               });
+       },
+
+       stop: function(clearQueue, gotoEnd){
+               var timers = jQuery.timers;
+
+               if (clearQueue)
+                       this.queue([]);
+
+               this.each(function(){
+                       // go in reverse order so anything added to the queue during the loop is ignored
+                       for ( var i = timers.length - 1; i >= 0; i-- )
+                               if ( timers[i].elem == this ) {
+                                       if (gotoEnd)
+                                               // force the next step to be the last
+                                               timers[i](true);
+                                       timers.splice(i, 1);
+                               }
+               });
+
+               // start the next in the queue if the last step wasn't forced
+               if (!gotoEnd)
+                       this.dequeue();
+
+               return this;
+       }
+
+});
+
+var queue = function( elem, type, array ) {
+       if ( elem ){
+
+               type = type || "fx";
+
+               var q = jQuery.data( elem, type + "queue" );
+
+               if ( !q || array )
+                       q = jQuery.data( elem, type + "queue", jQuery.makeArray(array) );
+
+       }
+       return q;
+};
+
+jQuery.fn.dequeue = function(type){
+       type = type || "fx";
+
+       return this.each(function(){
+               var q = queue(this, type);
+
+               q.shift();
+
+               if ( q.length )
+                       q[0].call( this );
+       });
+};
+
+jQuery.extend({
+
+       speed: function(speed, easing, fn) {
+               var opt = speed && speed.constructor == Object ? speed : {
+                       complete: fn || !fn && easing ||
+                               jQuery.isFunction( speed ) && speed,
+                       duration: speed,
+                       easing: fn && easing || easing && easing.constructor != Function && easing
+               };
+
+               opt.duration = (opt.duration && opt.duration.constructor == Number ?
+                       opt.duration :
+                       jQuery.fx.speeds[opt.duration]) || jQuery.fx.speeds.def;
+
+               // Queueing
+               opt.old = opt.complete;
+               opt.complete = function(){
+                       if ( opt.queue !== false )
+                               jQuery(this).dequeue();
+                       if ( jQuery.isFunction( opt.old ) )
+                               opt.old.call( this );
+               };
+
+               return opt;
+       },
+
+       easing: {
+               linear: function( p, n, firstNum, diff ) {
+                       return firstNum + diff * p;
+               },
+               swing: function( p, n, firstNum, diff ) {
+                       return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
+               }
+       },
+
+       timers: [],
+       timerId: null,
+
+       fx: function( elem, options, prop ){
+               this.options = options;
+               this.elem = elem;
+               this.prop = prop;
+
+               if ( !options.orig )
+                       options.orig = {};
+       }
+
+});
+
+jQuery.fx.prototype = {
+
+       // Simple function for setting a style value
+       update: function(){
+               if ( this.options.step )
+                       this.options.step.call( this.elem, this.now, this );
+
+               (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
+
+               // Set display property to block for height/width animations
+               if ( this.prop == "height" || this.prop == "width" )
+                       this.elem.style.display = "block";
+       },
+
+       // Get the current size
+       cur: function(force){
+               if ( this.elem[this.prop] != null && this.elem.style[this.prop] == null )
+                       return this.elem[ this.prop ];
+
+               var r = parseFloat(jQuery.css(this.elem, this.prop, force));
+               return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0;
+       },
+
+       // Start an animation from one number to another
+       custom: function(from, to, unit){
+               this.startTime = now();
+               this.start = from;
+               this.end = to;
+               this.unit = unit || this.unit || "px";
+               this.now = this.start;
+               this.pos = this.state = 0;
+               this.update();
+
+               var self = this;
+               function t(gotoEnd){
+                       return self.step(gotoEnd);
+               }
+
+               t.elem = this.elem;
+
+               jQuery.timers.push(t);
+
+               if ( jQuery.timerId == null ) {
+                       jQuery.timerId = setInterval(function(){
+                               var timers = jQuery.timers;
+
+                               for ( var i = 0; i < timers.length; i++ )
+                                       if ( !timers[i]() )
+                                               timers.splice(i--, 1);
+
+                               if ( !timers.length ) {
+                                       clearInterval( jQuery.timerId );
+                                       jQuery.timerId = null;
+                               }
+                       }, 13);
+               }
+       },
+
+       // Simple 'show' function
+       show: function(){
+               // Remember where we started, so that we can go back to it later
+               this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
+               this.options.show = true;
+
+               // Begin the animation
+               this.custom(0, this.cur());
+
+               // Make sure that we start at a small width/height to avoid any
+               // flash of content
+               if ( this.prop == "width" || this.prop == "height" )
+                       this.elem.style[this.prop] = "1px";
+
+               // Start by showing the element
+               jQuery(this.elem).show();
+       },
+
+       // Simple 'hide' function
+       hide: function(){
+               // Remember where we started, so that we can go back to it later
+               this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
+               this.options.hide = true;
+
+               // Begin the animation
+               this.custom(this.cur(), 0);
+       },
+
+       // Each step of an animation
+       step: function(gotoEnd){
+               var t = now();
+
+               if ( gotoEnd || t > this.options.duration + this.startTime ) {
+                       this.now = this.end;
+                       this.pos = this.state = 1;
+                       this.update();
+
+                       this.options.curAnim[ this.prop ] = true;
+
+                       var done = true;
+                       for ( var i in this.options.curAnim )
+                               if ( this.options.curAnim[i] !== true )
+                                       done = false;
+
+                       if ( done ) {
+                               if ( this.options.display != null ) {
+                                       // Reset the overflow
+                                       this.elem.style.overflow = this.options.overflow;
+
+                                       // Reset the display
+                                       this.elem.style.display = this.options.display;
+                                       if ( jQuery.css(this.elem, "display") == "none" )
+                                               this.elem.style.display = "block";
+                               }
+
+                               // Hide the element if the "hide" operation was done
+                               if ( this.options.hide )
+                                       this.elem.style.display = "none";
+
+                               // Reset the properties, if the item has been hidden or shown
+                               if ( this.options.hide || this.options.show )
+                                       for ( var p in this.options.curAnim )
+                                               jQuery.attr(this.elem.style, p, this.options.orig[p]);
+                       }
+
+                       if ( done )
+                               // Execute the complete function
+                               this.options.complete.call( this.elem );
+
+                       return false;
+               } else {
+                       var n = t - this.startTime;
+                       this.state = n / this.options.duration;
+
+                       // Perform the easing function, defaults to swing
+                       this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration);
+                       this.now = this.start + ((this.end - this.start) * this.pos);
+
+                       // Perform the next step of the animation
+                       this.update();
+               }
+
+               return true;
+       }
+
+};
+
+jQuery.extend( jQuery.fx, {
+       speeds:{
+               slow: 600,
+               fast: 200,
+               // Default speed
+               def: 400
+       },
+       step: {
+               scrollLeft: function(fx){
+                       fx.elem.scrollLeft = fx.now;
+               },
+
+               scrollTop: function(fx){
+                       fx.elem.scrollTop = fx.now;
+               },
+
+               opacity: function(fx){
+                       jQuery.attr(fx.elem.style, "opacity", fx.now);
+               },
+
+               _default: function(fx){
+                       fx.elem.style[ fx.prop ] = fx.now + fx.unit;
+               }
+       }
+});
+// The Offset Method
+// Originally By Brandon Aaron, part of the Dimension Plugin
+// http://jquery.com/plugins/project/dimensions
+jQuery.fn.offset = function() {
+       var left = 0, top = 0, elem = this[0], results;
+
+       if ( elem ) with ( jQuery.browser ) {
+               var parent       = elem.parentNode,
+                   offsetChild  = elem,
+                   offsetParent = elem.offsetParent,
+                   doc          = elem.ownerDocument,
+                   safari2      = safari && parseInt(version) < 522 && !/adobeair/i.test(userAgent),
+                   css          = jQuery.curCSS,
+                   fixed        = css(elem, "position") == "fixed";
+
+               // Use getBoundingClientRect if available
+               if ( elem.getBoundingClientRect ) {
+                       var box = elem.getBoundingClientRect();
+
+                       // Add the document scroll offsets
+                       add(box.left + Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft),
+                               box.top  + Math.max(doc.documentElement.scrollTop,  doc.body.scrollTop));
+
+                       // IE adds the HTML element's border, by default it is medium which is 2px
+                       // IE 6 and 7 quirks mode the border width is overwritable by the following css html { border: 0; }
+                       // IE 7 standards mode, the border is always 2px
+                       // This border/offset is typically represented by the clientLeft and clientTop properties
+                       // However, in IE6 and 7 quirks mode the clientLeft and clientTop properties are not updated when overwriting it via CSS
+                       // Therefore this method will be off by 2px in IE while in quirksmode
+                       add( -doc.documentElement.clientLeft, -doc.documentElement.clientTop );
+
+               // Otherwise loop through the offsetParents and parentNodes
+               } else {
+
+                       // Initial element offsets
+                       add( elem.offsetLeft, elem.offsetTop );
+
+                       // Get parent offsets
+                       while ( offsetParent ) {
+                               // Add offsetParent offsets
+                               add( offsetParent.offsetLeft, offsetParent.offsetTop );
+
+                               // Mozilla and Safari > 2 does not include the border on offset parents
+                               // However Mozilla adds the border for table or table cells
+                               if ( mozilla && !/^t(able|d|h)$/i.test(offsetParent.tagName) || safari && !safari2 )
+                                       border( offsetParent );
+
+                               // Add the document scroll offsets if position is fixed on any offsetParent
+                               if ( !fixed && css(offsetParent, "position") == "fixed" )
+                                       fixed = true;
+
+                               // Set offsetChild to previous offsetParent unless it is the body element
+                               offsetChild  = /^body$/i.test(offsetParent.tagName) ? offsetChild : offsetParent;
+                               // Get next offsetParent
+                               offsetParent = offsetParent.offsetParent;
+                       }
+
+                       // Get parent scroll offsets
+                       while ( parent && parent.tagName && !/^body|html$/i.test(parent.tagName) ) {
+                               // Remove parent scroll UNLESS that parent is inline or a table to work around Opera inline/table scrollLeft/Top bug
+                               if ( !/^inline|table.*$/i.test(css(parent, "display")) )
+                                       // Subtract parent scroll offsets
+                                       add( -parent.scrollLeft, -parent.scrollTop );
+
+                               // Mozilla does not add the border for a parent that has overflow != visible
+                               if ( mozilla && css(parent, "overflow") != "visible" )
+                                       border( parent );
+
+                               // Get next parent
+                               parent = parent.parentNode;
+                       }
+
+                       // Safari <= 2 doubles body offsets with a fixed position element/offsetParent or absolutely positioned offsetChild
+                       // Mozilla doubles body offsets with a non-absolutely positioned offsetChild
+                       if ( (safari2 && (fixed || css(offsetChild, "position") == "absolute")) ||
+                               (mozilla && css(offsetChild, "position") != "absolute") )
+                                       add( -doc.body.offsetLeft, -doc.body.offsetTop );
+
+                       // Add the document scroll offsets if position is fixed
+                       if ( fixed )
+                               add(Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft),
+                                       Math.max(doc.documentElement.scrollTop,  doc.body.scrollTop));
+               }
+
+               // Return an object with top and left properties
+               results = { top: top, left: left };
+       }
+
+       function border(elem) {
+               add( jQuery.curCSS(elem, "borderLeftWidth", true), jQuery.curCSS(elem, "borderTopWidth", true) );
+       }
+
+       function add(l, t) {
+               left += parseInt(l, 10) || 0;
+               top += parseInt(t, 10) || 0;
+       }
+
+       return results;
+};
+
+
+jQuery.fn.extend({
+       position: function() {
+               var left = 0, top = 0, results;
+
+               if ( this[0] ) {
+                       // Get *real* offsetParent
+                       var offsetParent = this.offsetParent(),
+
+                       // Get correct offsets
+                       offset       = this.offset(),
+                       parentOffset = /^body|html$/i.test(offsetParent[0].tagName) ? { top: 0, left: 0 } : offsetParent.offset();
+
+                       // Subtract element margins
+                       // note: when an element has margin: auto the offsetLeft and marginLeft 
+                       // are the same in Safari causing offset.left to incorrectly be 0
+                       offset.top  -= num( this, 'marginTop' );
+                       offset.left -= num( this, 'marginLeft' );
+
+                       // Add offsetParent borders
+                       parentOffset.top  += num( offsetParent, 'borderTopWidth' );
+                       parentOffset.left += num( offsetParent, 'borderLeftWidth' );
+
+                       // Subtract the two offsets
+                       results = {
+                               top:  offset.top  - parentOffset.top,
+                               left: offset.left - parentOffset.left
+                       };
+               }
+
+               return results;
+       },
+
+       offsetParent: function() {
+               var offsetParent = this[0].offsetParent;
+               while ( offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && jQuery.css(offsetParent, 'position') == 'static') )
+                       offsetParent = offsetParent.offsetParent;
+               return jQuery(offsetParent);
+       }
+});
+
+
+// Create scrollLeft and scrollTop methods
+jQuery.each( ['Left', 'Top'], function(i, name) {
+       var method = 'scroll' + name;
+       
+       jQuery.fn[ method ] = function(val) {
+               if (!this[0]) return;
+
+               return val != undefined ?
+
+                       // Set the scroll offset
+                       this.each(function() {
+                               this == window || this == document ?
+                                       window.scrollTo(
+                                               !i ? val : jQuery(window).scrollLeft(),
+                                                i ? val : jQuery(window).scrollTop()
+                                       ) :
+                                       this[ method ] = val;
+                       }) :
+
+                       // Return the scroll offset
+                       this[0] == window || this[0] == document ?
+                               self[ i ? 'pageYOffset' : 'pageXOffset' ] ||
+                                       jQuery.boxModel && document.documentElement[ method ] ||
+                                       document.body[ method ] :
+                               this[0][ method ];
+       };
+});
+// Create innerHeight, innerWidth, outerHeight and outerWidth methods
+jQuery.each([ "Height", "Width" ], function(i, name){
+
+       var tl = i ? "Left"  : "Top",  // top or left
+               br = i ? "Right" : "Bottom"; // bottom or right
+
+       // innerHeight and innerWidth
+       jQuery.fn["inner" + name] = function(){
+               return this[ name.toLowerCase() ]() +
+                       num(this, "padding" + tl) +
+                       num(this, "padding" + br);
+       };
+
+       // outerHeight and outerWidth
+       jQuery.fn["outer" + name] = function(margin) {
+               return this["inner" + name]() +
+                       num(this, "border" + tl + "Width") +
+                       num(this, "border" + br + "Width") +
+                       (margin ?
+                               num(this, "margin" + tl) + num(this, "margin" + br) : 0);
+       };
+
+});})();
diff --git a/js/jquery.lightbox.js b/js/jquery.lightbox.js
new file mode 100644 (file)
index 0000000..41c425f
--- /dev/null
@@ -0,0 +1,472 @@
+/**\r
+ * jQuery lightBox plugin\r
+ * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/)\r
+ * and adapted to me for use like a plugin from jQuery.\r
+ * @name jquery-lightbox-0.5.js\r
+ * @author Leandro Vieira Pinho - http://leandrovieira.com\r
+ * @version 0.5\r
+ * @date April 11, 2008\r
+ * @category jQuery plugin\r
+ * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com)\r
+ * @license CC Attribution-No Derivative Works 2.5 Brazil - http://creativecommons.org/licenses/by-nd/2.5/br/deed.en_US\r
+ * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin\r
+ */\r
+\r
+// Offering a Custom Alias suport - More info: http://docs.jquery.com/Plugins/Authoring#Custom_Alias\r
+(function($) {\r
+       /**\r
+        * $ is an alias to jQuery object\r
+        *\r
+        */\r
+       $.fn.lightBox = function(settings) {\r
+               // Settings to configure the jQuery lightBox plugin how you like\r
+               settings = jQuery.extend({\r
+                       // Configuration related to overlay\r
+                       overlayBgColor:                 '#000',         // (string) Background color to overlay; inform a hexadecimal value like: #RRGGBB. Where RR, GG, and BB are the hexadecimal values for the red, green, and blue values of the color.\r
+                       overlayOpacity:                 0.8,            // (integer) Opacity value to overlay; inform: 0.X. Where X are number from 0 to 9\r
+                       // Configuration related to navigation\r
+                       fixedNavigation:                false,          // (boolean) Boolean that informs if the navigation (next and prev button) will be fixed or not in the interface.\r
+                       // Configuration related to images\r
+                       imageLoading:                   'img/lightbox-ico-loading.gif',         // (string) Path and the name of the loading icon\r
+                       imageBtnPrev:                   'img/lightbox-btn-prev.gif',                    // (string) Path and the name of the prev button image\r
+                       imageBtnNext:                   'img/lightbox-btn-next.gif',                    // (string) Path and the name of the next button image\r
+                       imageBtnClose:                  'img/lightbox-btn-close.gif',           // (string) Path and the name of the close btn\r
+                       imageBlank:                             'img/lightbox-blank.gif',                       // (string) Path and the name of a blank image (one pixel)\r
+                       // Configuration related to container image box\r
+                       containerBorderSize:    10,                     // (integer) If you adjust the padding in the CSS for the container, #lightbox-container-image-box, you will need to update this value\r
+                       containerResizeSpeed:   400,            // (integer) Specify the resize duration of container image. These number are miliseconds. 400 is default.\r
+                       // Configuration related to texts in caption. For example: Image 2 of 8. You can alter either "Image" and "of" texts.\r
+                       txtImage:                               'Image',        // (string) Specify text "Image"\r
+                       txtOf:                                  'of',           // (string) Specify text "of"\r
+                       // Configuration related to keyboard navigation\r
+                       keyToClose:                             'c',            // (string) (c = close) Letter to close the jQuery lightBox interface. Beyond this letter, the letter X and the SCAPE key is used to.\r
+                       keyToPrev:                              'p',            // (string) (p = previous) Letter to show the previous image\r
+                       keyToNext:                              'n',            // (string) (n = next) Letter to show the next image.\r
+                       // Don´t alter these variables in any way\r
+                       imageArray:                             [],\r
+                       activeImage:                    0\r
+               },settings);\r
+               // Caching the jQuery object with all elements matched\r
+               var jQueryMatchedObj = this; // This, in this context, refer to jQuery object\r
+               /**\r
+                * Initializing the plugin calling the start function\r
+                *\r
+                * @return boolean false\r
+                */\r
+               function _initialize() {\r
+                       _start(this,jQueryMatchedObj); // This, in this context, refer to object (link) which the user have clicked\r
+                       return false; // Avoid the browser following the link\r
+               }\r
+               /**\r
+                * Start the jQuery lightBox plugin\r
+                *\r
+                * @param object objClicked The object (link) whick the user have clicked\r
+                * @param object jQueryMatchedObj The jQuery object with all elements matched\r
+                */\r
+               function _start(objClicked,jQueryMatchedObj) {\r
+                       // Hime some elements to avoid conflict with overlay in IE. These elements appear above the overlay.\r
+                       $('embed, object, select').css({ 'visibility' : 'hidden' });\r
+                       // Call the function to create the markup structure; style some elements; assign events in some elements.\r
+                       _set_interface();\r
+                       // Unset total images in imageArray\r
+                       settings.imageArray.length = 0;\r
+                       // Unset image active information\r
+                       settings.activeImage = 0;\r
+                       // We have an image set? Or just an image? Let´s see it.\r
+                       if ( jQueryMatchedObj.length == 1 ) {\r
+                               settings.imageArray.push(new Array(objClicked.getAttribute('href'),objClicked.getAttribute('title')));\r
+                       } else {\r
+                               // Add an Array (as many as we have), with href and title atributes, inside the Array that storage the images references                \r
+                               for ( var i = 0; i < jQueryMatchedObj.length; i++ ) {\r
+                                       settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('href'),jQueryMatchedObj[i].getAttribute('title')));\r
+                               }\r
+                       }\r
+                       while ( settings.imageArray[settings.activeImage][0] != objClicked.getAttribute('href') ) {\r
+                               settings.activeImage++;\r
+                       }\r
+                       // Call the function that prepares image exibition\r
+                       _set_image_to_view();\r
+               }\r
+               /**\r
+                * Create the jQuery lightBox plugin interface\r
+                *\r
+                * The HTML markup will be like that:\r
+                       <div id="jquery-overlay"></div>\r
+                       <div id="jquery-lightbox">\r
+                               <div id="lightbox-container-image-box">\r
+                                       <div id="lightbox-container-image">\r
+                                               <img src="../fotos/XX.jpg" id="lightbox-image">\r
+                                               <div id="lightbox-nav">\r
+                                                       <a href="#" id="lightbox-nav-btnPrev"></a>\r
+                                                       <a href="#" id="lightbox-nav-btnNext"></a>\r
+                                               </div>\r
+                                               <div id="lightbox-loading">\r
+                                                       <a href="#" id="lightbox-loading-link">\r
+                                                               <img src="../img/lightbox-ico-loading.gif">\r
+                                                       </a>\r
+                                               </div>\r
+                                       </div>\r
+                               </div>\r
+                               <div id="lightbox-container-image-data-box">\r
+                                       <div id="lightbox-container-image-data">\r
+                                               <div id="lightbox-image-details">\r
+                                                       <span id="lightbox-image-details-caption"></span>\r
+                                                       <span id="lightbox-image-details-currentNumber"></span>\r
+                                               </div>\r
+                                               <div id="lightbox-secNav">\r
+                                                       <a href="#" id="lightbox-secNav-btnClose">\r
+                                                               <img src="../img/lightbox-btn-close.gif">\r
+                                                       </a>\r
+                                               </div>\r
+                                       </div>\r
+                               </div>\r
+                       </div>\r
+                *\r
+                */\r
+               function _set_interface() {\r
+                       // Apply the HTML markup into body tag\r
+                       $('body').append('<div id="jquery-overlay"></div><div id="jquery-lightbox"><div id="lightbox-container-image-box"><div id="lightbox-container-image"><img id="lightbox-image"><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="' + settings.imageLoading + '"></a></div></div></div><div id="lightbox-container-image-data-box"><div id="lightbox-container-image-data"><div id="lightbox-image-details"><span id="lightbox-image-details-caption"></span><span id="lightbox-image-details-currentNumber"></span></div><div id="lightbox-secNav"><a href="#" id="lightbox-secNav-btnClose"><img src="' + settings.imageBtnClose + '"></a></div></div></div></div>');       \r
+                       // Get page sizes\r
+                       var arrPageSizes = ___getPageSize();\r
+                       // Style overlay and show it\r
+                       $('#jquery-overlay').css({\r
+                               backgroundColor:        settings.overlayBgColor,\r
+                               opacity:                        settings.overlayOpacity,\r
+                               width:                          arrPageSizes[0],\r
+                               height:                         arrPageSizes[1]\r
+                       }).fadeIn();\r
+                       // Get page scroll\r
+                       var arrPageScroll = ___getPageScroll();\r
+                       // Calculate top and left offset for the jquery-lightbox div object and show it\r
+                       $('#jquery-lightbox').css({\r
+                               top:    arrPageScroll[1] + (arrPageSizes[3] / 10),\r
+                               left:   arrPageScroll[0]\r
+                       }).show();\r
+                       // Assigning click events in elements to close overlay\r
+                       $('#jquery-overlay,#jquery-lightbox').click(function() {\r
+                               _finish();                                                                      \r
+                       });\r
+                       // Assign the _finish function to lightbox-loading-link and lightbox-secNav-btnClose objects\r
+                       $('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function() {\r
+                               _finish();\r
+                               return false;\r
+                       });\r
+                       // If window was resized, calculate the new overlay dimensions\r
+                       $(window).resize(function() {\r
+                               // Get page sizes\r
+                               var arrPageSizes = ___getPageSize();\r
+                               // Style overlay and show it\r
+                               $('#jquery-overlay').css({\r
+                                       width:          arrPageSizes[0],\r
+                                       height:         arrPageSizes[1]\r
+                               });\r
+                               // Get page scroll\r
+                               var arrPageScroll = ___getPageScroll();\r
+                               // Calculate top and left offset for the jquery-lightbox div object and show it\r
+                               $('#jquery-lightbox').css({\r
+                                       top:    arrPageScroll[1] + (arrPageSizes[3] / 10),\r
+                                       left:   arrPageScroll[0]\r
+                               });\r
+                       });\r
+               }\r
+               /**\r
+                * Prepares image exibition; doing a image´s preloader to calculate it´s size\r
+                *\r
+                */\r
+               function _set_image_to_view() { // show the loading\r
+                       // Show the loading\r
+                       $('#lightbox-loading').show();\r
+                       if ( settings.fixedNavigation ) {\r
+                               $('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();\r
+                       } else {\r
+                               // Hide some elements\r
+                               $('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();\r
+                       }\r
+                       // Image preload process\r
+                       var objImagePreloader = new Image();\r
+                       objImagePreloader.onload = function() {\r
+                               $('#lightbox-image').attr('src',settings.imageArray[settings.activeImage][0]);\r
+                               // Perfomance an effect in the image container resizing it\r
+                               _resize_container_image_box(objImagePreloader.width,objImagePreloader.height);\r
+                               //      clear onLoad, IE behaves irratically with animated gifs otherwise\r
+                               objImagePreloader.onload=function(){};\r
+                       };\r
+                       objImagePreloader.src = settings.imageArray[settings.activeImage][0];\r
+               };\r
+               /**\r
+                * Perfomance an effect in the image container resizing it\r
+                *\r
+                * @param integer intImageWidth The image´s width that will be showed\r
+                * @param integer intImageHeight The image´s height that will be showed\r
+                */\r
+               function _resize_container_image_box(intImageWidth,intImageHeight) {\r
+                       // Get current width and height\r
+                       var intCurrentWidth = $('#lightbox-container-image-box').width();\r
+                       var intCurrentHeight = $('#lightbox-container-image-box').height();\r
+                       // Get the width and height of the selected image plus the padding\r
+                       var intWidth = (intImageWidth + (settings.containerBorderSize * 2)); // Plus the image´s width and the left and right padding value\r
+                       var intHeight = (intImageHeight + (settings.containerBorderSize * 2)); // Plus the image´s height and the left and right padding value\r
+                       // Diferences\r
+                       var intDiffW = intCurrentWidth - intWidth;\r
+                       var intDiffH = intCurrentHeight - intHeight;\r
+                       // Perfomance the effect\r
+                       $('#lightbox-container-image-box').animate({ width: intWidth, height: intHeight },settings.containerResizeSpeed,function() { _show_image(); });\r
+                       if ( ( intDiffW == 0 ) && ( intDiffH == 0 ) ) {\r
+                               if ( $.browser.msie ) {\r
+                                       ___pause(250);\r
+                               } else {\r
+                                       ___pause(100);  \r
+                               }\r
+                       } \r
+                       $('#lightbox-container-image-data-box').css({ width: intImageWidth });\r
+                       $('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ height: intImageHeight + (settings.containerBorderSize * 2) });\r
+               };\r
+               /**\r
+                * Show the prepared image\r
+                *\r
+                */\r
+               function _show_image() {\r
+                       $('#lightbox-loading').hide();\r
+                       $('#lightbox-image').fadeIn(function() {\r
+                               _show_image_data();\r
+                               _set_navigation();\r
+                       });\r
+                       _preload_neighbor_images();\r
+               };\r
+               /**\r
+                * Show the image information\r
+                *\r
+                */\r
+               function _show_image_data() {\r
+                       $('#lightbox-container-image-data-box').slideDown('fast');\r
+                       $('#lightbox-image-details-caption').hide();\r
+                       if ( settings.imageArray[settings.activeImage][1] ) {\r
+                               $('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show();\r
+                       }\r
+                       // If we have a image set, display 'Image X of X'\r
+                       if ( settings.imageArray.length > 1 ) {\r
+                               $('#lightbox-image-details-currentNumber').html(settings.txtImage + ' ' + ( settings.activeImage + 1 ) + ' ' + settings.txtOf + ' ' + settings.imageArray.length).show();\r
+                       }               \r
+               }\r
+               /**\r
+                * Display the button navigations\r
+                *\r
+                */\r
+               function _set_navigation() {\r
+                       $('#lightbox-nav').show();\r
+\r
+                       // Instead to define this configuration in CSS file, we define here. And it´s need to IE. Just.\r
+                       $('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });\r
+                       \r
+                       // Show the prev button, if not the first image in set\r
+                       if ( settings.activeImage != 0 ) {\r
+                               if ( settings.fixedNavigation ) {\r
+                                       $('#lightbox-nav-btnPrev').css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' })\r
+                                               .unbind()\r
+                                               .bind('click',function() {\r
+                                                       settings.activeImage = settings.activeImage - 1;\r
+                                                       _set_image_to_view();\r
+                                                       return false;\r
+                                               });\r
+                               } else {\r
+                                       // Show the images button for Next buttons\r
+                                       $('#lightbox-nav-btnPrev').unbind().hover(function() {\r
+                                               $(this).css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' });\r
+                                       },function() {\r
+                                               $(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });\r
+                                       }).show().bind('click',function() {\r
+                                               settings.activeImage = settings.activeImage - 1;\r
+                                               _set_image_to_view();\r
+                                               return false;\r
+                                       });\r
+                               }\r
+                       }\r
+                       \r
+                       // Show the next button, if not the last image in set\r
+                       if ( settings.activeImage != ( settings.imageArray.length -1 ) ) {\r
+                               if ( settings.fixedNavigation ) {\r
+                                       $('#lightbox-nav-btnNext').css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' })\r
+                                               .unbind()\r
+                                               .bind('click',function() {\r
+                                                       settings.activeImage = settings.activeImage + 1;\r
+                                                       _set_image_to_view();\r
+                                                       return false;\r
+                                               });\r
+                               } else {\r
+                                       // Show the images button for Next buttons\r
+                                       $('#lightbox-nav-btnNext').unbind().hover(function() {\r
+                                               $(this).css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' });\r
+                                       },function() {\r
+                                               $(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });\r
+                                       }).show().bind('click',function() {\r
+                                               settings.activeImage = settings.activeImage + 1;\r
+                                               _set_image_to_view();\r
+                                               return false;\r
+                                       });\r
+                               }\r
+                       }\r
+                       // Enable keyboard navigation\r
+                       _enable_keyboard_navigation();\r
+               }\r
+               /**\r
+                * Enable a support to keyboard navigation\r
+                *\r
+                */\r
+               function _enable_keyboard_navigation() {\r
+                       $(document).keydown(function(objEvent) {\r
+                               _keyboard_action(objEvent);\r
+                       });\r
+               }\r
+               /**\r
+                * Disable the support to keyboard navigation\r
+                *\r
+                */\r
+               function _disable_keyboard_navigation() {\r
+                       $(document).unbind();\r
+               }\r
+               /**\r
+                * Perform the keyboard actions\r
+                *\r
+                */\r
+               function _keyboard_action(objEvent) {\r
+                       // To ie\r
+                       if ( objEvent == null ) {\r
+                               keycode = event.keyCode;\r
+                               escapeKey = 27;\r
+                       // To Mozilla\r
+                       } else {\r
+                               keycode = objEvent.keyCode;\r
+                               escapeKey = objEvent.DOM_VK_ESCAPE;\r
+                       }\r
+                       // Get the key in lower case form\r
+                       key = String.fromCharCode(keycode).toLowerCase();\r
+                       // Verify the keys to close the ligthBox\r
+                       if ( ( key == settings.keyToClose ) || ( key == 'x' ) || ( keycode == escapeKey ) ) {\r
+                               _finish();\r
+                       }\r
+                       // Verify the key to show the previous image\r
+                       if ( ( key == settings.keyToPrev ) || ( keycode == 37 ) ) {\r
+                               // If we´re not showing the first image, call the previous\r
+                               if ( settings.activeImage != 0 ) {\r
+                                       settings.activeImage = settings.activeImage - 1;\r
+                                       _set_image_to_view();\r
+                                       _disable_keyboard_navigation();\r
+                               }\r
+                       }\r
+                       // Verify the key to show the next image\r
+                       if ( ( key == settings.keyToNext ) || ( keycode == 39 ) ) {\r
+                               // If we´re not showing the last image, call the next\r
+                               if ( settings.activeImage != ( settings.imageArray.length - 1 ) ) {\r
+                                       settings.activeImage = settings.activeImage + 1;\r
+                                       _set_image_to_view();\r
+                                       _disable_keyboard_navigation();\r
+                               }\r
+                       }\r
+               }\r
+               /**\r
+                * Preload prev and next images being showed\r
+                *\r
+                */\r
+               function _preload_neighbor_images() {\r
+                       if ( (settings.imageArray.length -1) > settings.activeImage ) {\r
+                               objNext = new Image();\r
+                               objNext.src = settings.imageArray[settings.activeImage + 1][0];\r
+                       }\r
+                       if ( settings.activeImage > 0 ) {\r
+                               objPrev = new Image();\r
+                               objPrev.src = settings.imageArray[settings.activeImage -1][0];\r
+                       }\r
+               }\r
+               /**\r
+                * Remove jQuery lightBox plugin HTML markup\r
+                *\r
+                */\r
+               function _finish() {\r
+                       $('#jquery-lightbox').remove();\r
+                       $('#jquery-overlay').fadeOut(function() { $('#jquery-overlay').remove(); });\r
+                       // Show some elements to avoid conflict with overlay in IE. These elements appear above the overlay.\r
+                       $('embed, object, select').css({ 'visibility' : 'visible' });\r
+               }\r
+               /**\r
+                / THIRD FUNCTION\r
+                * getPageSize() by quirksmode.com\r
+                *\r
+                * @return Array Return an array with page width, height and window width, height\r
+                */\r
+               function ___getPageSize() {\r
+                       var xScroll, yScroll;\r
+                       if (window.innerHeight && window.scrollMaxY) {  \r
+                               xScroll = window.innerWidth + window.scrollMaxX;\r
+                               yScroll = window.innerHeight + window.scrollMaxY;\r
+                       } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac\r
+                               xScroll = document.body.scrollWidth;\r
+                               yScroll = document.body.scrollHeight;\r
+                       } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari\r
+                               xScroll = document.body.offsetWidth;\r
+                               yScroll = document.body.offsetHeight;\r
+                       }\r
+                       var windowWidth, windowHeight;\r
+                       if (self.innerHeight) { // all except Explorer\r
+                               if(document.documentElement.clientWidth){\r
+                                       windowWidth = document.documentElement.clientWidth; \r
+                               } else {\r
+                                       windowWidth = self.innerWidth;\r
+                               }\r
+                               windowHeight = self.innerHeight;\r
+                       } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode\r
+                               windowWidth = document.documentElement.clientWidth;\r
+                               windowHeight = document.documentElement.clientHeight;\r
+                       } else if (document.body) { // other Explorers\r
+                               windowWidth = document.body.clientWidth;\r
+                               windowHeight = document.body.clientHeight;\r
+                       }       \r
+                       // for small pages with total height less then height of the viewport\r
+                       if(yScroll < windowHeight){\r
+                               pageHeight = windowHeight;\r
+                       } else { \r
+                               pageHeight = yScroll;\r
+                       }\r
+                       // for small pages with total width less then width of the viewport\r
+                       if(xScroll < windowWidth){      \r
+                               pageWidth = xScroll;            \r
+                       } else {\r
+                               pageWidth = windowWidth;\r
+                       }\r
+                       arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);\r
+                       return arrayPageSize;\r
+               };\r
+               /**\r
+                / THIRD FUNCTION\r
+                * getPageScroll() by quirksmode.com\r
+                *\r
+                * @return Array Return an array with x,y page scroll values.\r
+                */\r
+               function ___getPageScroll() {\r
+                       var xScroll, yScroll;\r
+                       if (self.pageYOffset) {\r
+                               yScroll = self.pageYOffset;\r
+                               xScroll = self.pageXOffset;\r
+                       } else if (document.documentElement && document.documentElement.scrollTop) {     // Explorer 6 Strict\r
+                               yScroll = document.documentElement.scrollTop;\r
+                               xScroll = document.documentElement.scrollLeft;\r
+                       } else if (document.body) {// all other Explorers\r
+                               yScroll = document.body.scrollTop;\r
+                               xScroll = document.body.scrollLeft;     \r
+                       }\r
+                       arrayPageScroll = new Array(xScroll,yScroll);\r
+                       return arrayPageScroll;\r
+               };\r
+                /**\r
+                 * Stop the code execution from a escified time in milisecond\r
+                 *\r
+                 */\r
+                function ___pause(ms) {\r
+                       var date = new Date(); \r
+                       curDate = null;\r
+                       do { var curDate = new Date(); }\r
+                       while ( curDate - date < ms);\r
+                };\r
+               // Return the jQuery object for chaining. The unbind method is used to avoid click conflict when the plugin is called more than once\r
+               return this.unbind('click').click(_initialize);\r
+       };\r
+})(jQuery); // Call and execute the function immediately passing the jQuery object
\ No newline at end of file
diff --git a/js/json2.js b/js/json2.js
new file mode 100644 (file)
index 0000000..25ff1ec
--- /dev/null
@@ -0,0 +1,461 @@
+/*
+    http://www.JSON.org/json2.js
+    2008-03-24
+
+    Public Domain.
+
+    NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
+
+    See http://www.JSON.org/js.html
+
+    This file creates a global JSON object containing three methods: stringify,
+    parse, and quote.
+
+
+        JSON.stringify(value, replacer, space)
+            value       any JavaScript value, usually an object or array.
+
+            replacer    an optional parameter that determines how object
+                        values are stringified for objects without a toJSON
+                        method. It can be a function or an array.
+
+            space       an optional parameter that specifies the indentation
+                        of nested structures. If it is omitted, the text will
+                        be packed without extra whitespace. If it is a number,
+                        it will specify the number of spaces to indent at each
+                        level. If it is a string (such as '\t'), it contains the
+                        characters used to indent at each level.
+
+            This method produces a JSON text from a JavaScript value.
+
+            When an object value is found, if the object contains a toJSON
+            method, its toJSON method will be called and the result will be
+            stringified. A toJSON method does not serialize: it returns the
+            value represented by the name/value pair that should be serialized,
+            or undefined if nothing should be serialized. The toJSON method will
+            be passed the key associated with the value, and this will be bound
+            to the object holding the key.
+
+            This is the toJSON method added to Dates:
+
+                function toJSON(key) {
+                    return this.getUTCFullYear()   + '-' +
+                         f(this.getUTCMonth() + 1) + '-' +
+                         f(this.getUTCDate())      + 'T' +
+                         f(this.getUTCHours())     + ':' +
+                         f(this.getUTCMinutes())   + ':' +
+                         f(this.getUTCSeconds())   + 'Z';
+                }
+
+            You can provide an optional replacer method. It will be passed the
+            key and value of each member, with this bound to the containing
+            object. The value that is returned from your method will be
+            serialized. If your method returns undefined, then the member will
+            be excluded from the serialization.
+
+            If no replacer parameter is provided, then a default replacer
+            will be used:
+
+                function replacer(key, value) {
+                    return Object.hasOwnProperty.call(this, key) ?
+                        value : undefined;
+                }
+
+            The default replacer is passed the key and value for each item in
+            the structure. It excludes inherited members.
+
+            If the replacer parameter is an array, then it will be used to
+            select the members to be serialized. It filters the results such
+            that only members with keys listed in the replacer array are
+            stringified.
+
+            Values that do not have JSON representaions, such as undefined or
+            functions, will not be serialized. Such values in objects will be
+            dropped; in arrays they will be replaced with null. You can use
+            a replacer function to replace those with JSON values.
+            JSON.stringify(undefined) returns undefined.
+
+            The optional space parameter produces a stringification of the value
+            that is filled with line breaks and indentation to make it easier to
+            read.
+
+            If the space parameter is a non-empty string, then that string will
+            be used for indentation. If the space parameter is a number, then
+            then indentation will be that many spaces.
+
+            Example:
+
+            text = JSON.stringify(['e', {pluribus: 'unum'}]);
+            // text is '["e",{"pluribus":"unum"}]'
+
+
+            text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
+            // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
+
+
+        JSON.parse(text, reviver)
+            This method parses a JSON text to produce an object or array.
+            It can throw a SyntaxError exception.
+
+            The optional reviver parameter is a function that can filter and
+            transform the results. It receives each of the keys and values,
+            and its return value is used instead of the original value.
+            If it returns what it received, then the structure is not modified.
+            If it returns undefined then the member is deleted.
+
+            Example:
+
+            // Parse the text. Values that look like ISO date strings will
+            // be converted to Date objects.
+
+            myData = JSON.parse(text, function (key, value) {
+                var a;
+                if (typeof value === 'string') {
+                    a =
+/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
+                    if (a) {
+                        return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
+                            +a[5], +a[6]));
+                    }
+                }
+                return value;
+            });
+
+
+        JSON.quote(text)
+            This method wraps a string in quotes, escaping some characters
+            as needed.
+
+
+    This is a reference implementation. You are free to copy, modify, or
+    redistribute.
+
+    USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD THIRD PARTY
+    CODE INTO YOUR PAGES.
+*/
+
+/*jslint regexp: true, forin: true, evil: true */
+
+/*global JSON */
+
+/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
+    call, charCodeAt, floor, getUTCDate, getUTCFullYear, getUTCHours,
+    getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join, length,
+    parse, propertyIsEnumerable, prototype, push, quote, replace, stringify,
+    test, toJSON, toString
+*/
+
+if (!this.JSON) {
+
+// Create a JSON object only if one does not already exist. We create the
+// object in a closure to avoid global variables.
+
+    JSON = function () {
+
+        function f(n) {    // Format integers to have at least two digits.
+            return n < 10 ? '0' + n : n;
+        }
+
+        Date.prototype.toJSON = function () {
+
+// Eventually, this method will be based on the date.toISOString method.
+
+            return this.getUTCFullYear()   + '-' +
+                 f(this.getUTCMonth() + 1) + '-' +
+                 f(this.getUTCDate())      + 'T' +
+                 f(this.getUTCHours())     + ':' +
+                 f(this.getUTCMinutes())   + ':' +
+                 f(this.getUTCSeconds())   + 'Z';
+        };
+
+
+        var escapeable = /["\\\x00-\x1f\x7f-\x9f]/g,
+            gap,
+            indent,
+            meta = {    // table of character substitutions
+                '\b': '\\b',
+                '\t': '\\t',
+                '\n': '\\n',
+                '\f': '\\f',
+                '\r': '\\r',
+                '"' : '\\"',
+                '\\': '\\\\'
+            },
+            rep;
+
+
+        function quote(string) {
+
+// If the string contains no control characters, no quote characters, and no
+// backslash characters, then we can safely slap some quotes around it.
+// Otherwise we must also replace the offending characters with safe escape
+// sequences.
+
+            return escapeable.test(string) ?
+                '"' + string.replace(escapeable, function (a) {
+                    var c = meta[a];
+                    if (typeof c === 'string') {
+                        return c;
+                    }
+                    c = a.charCodeAt();
+                    return '\\u00' + Math.floor(c / 16).toString(16) +
+                                               (c % 16).toString(16);
+                }) + '"' :
+                '"' + string + '"';
+        }
+
+
+        function str(key, holder) {
+
+// Produce a string from holder[key].
+
+            var i,          // The loop counter.
+                k,          // The member key.
+                v,          // The member value.
+                length,
+                mind = gap,
+                partial,
+                value = holder[key];
+
+// If the value has a toJSON method, call it to obtain a replacement value.
+
+            if (value && typeof value === 'object' &&
+                    typeof value.toJSON === 'function') {
+                value = value.toJSON(key);
+            }
+
+// If we were called with a replacer function, then call the replacer to
+// obtain a replacement value.
+
+            if (typeof rep === 'function') {
+                value = rep.call(holder, key, value);
+            }
+
+// What happens next depends on the value's type.
+
+            switch (typeof value) {
+            case 'string':
+                return quote(value);
+
+            case 'number':
+
+// JSON numbers must be finite. Encode non-finite numbers as null.
+
+                return isFinite(value) ? String(value) : 'null';
+
+            case 'boolean':
+            case 'null':
+
+// If the value is a boolean or null, convert it to a string. Note:
+// typeof null does not produce 'null'. The case is included here in
+// the remote chance that this gets fixed someday.
+
+                return String(value);
+
+// If the type is 'object', we might be dealing with an object or an array or
+// null.
+
+            case 'object':
+
+// Due to a specification blunder in ECMAScript, typeof null is 'object',
+// so watch out for that case.
+
+                if (!value) {
+                    return 'null';
+                }
+
+// Make an array to hold the partial results of stringifying this object value.
+
+                gap += indent;
+                partial = [];
+
+// If the object has a dontEnum length property, we'll treat it as an array.
+
+                if (typeof value.length === 'number' &&
+                        !(value.propertyIsEnumerable('length'))) {
+
+// The object is an array. Stringify every element. Use null as a placeholder
+// for non-JSON values.
+
+                    length = value.length;
+                    for (i = 0; i < length; i += 1) {
+                        partial[i] = str(i, value) || 'null';
+                    }
+
+// Join all of the elements together, separated with commas, and wrap them in
+// brackets.
+
+                    v = partial.length === 0 ? '[]' :
+                        gap ? '[\n' + gap + partial.join(',\n' + gap) +
+                                  '\n' + mind + ']' :
+                              '[' + partial.join(',') + ']';
+                    gap = mind;
+                    return v;
+                }
+
+// If the replacer is an array, use it to select the members to be stringified.
+
+                if (typeof rep === 'object') {
+                    length = rep.length;
+                    for (i = 0; i < length; i += 1) {
+                        k = rep[i];
+                        if (typeof k === 'string') {
+                            v = str(k, value, rep);
+                            if (v) {
+                                partial.push(quote(k) + (gap ? ': ' : ':') + v);
+                            }
+                        }
+                    }
+                } else {
+
+// Otherwise, iterate through all of the keys in the object.
+
+                    for (k in value) {
+                        v = str(k, value, rep);
+                        if (v) {
+                            partial.push(quote(k) + (gap ? ': ' : ':') + v);
+                        }
+                    }
+                }
+
+// Join all of the member texts together, separated with commas,
+// and wrap them in braces.
+
+                v = partial.length === 0 ? '{}' :
+                    gap ? '{\n' + gap + partial.join(',\n' + gap) +
+                              '\n' + mind + '}' :
+                          '{' + partial.join(',') + '}';
+                gap = mind;
+                return v;
+            }
+        }
+
+
+// Return the JSON object containing the stringify, parse, and quote methods.
+
+        return {
+            stringify: function (value, replacer, space) {
+
+// The stringify method takes a value and an optional replacer, and an optional
+// space parameter, and returns a JSON text. The replacer can be a function
+// that can replace values, or an array of strings that will select the keys.
+// A default replacer method can be provided. Use of the space parameter can
+// produce text that is more easily readable.
+
+                var i;
+                gap = '';
+                indent = '';
+                if (space) {
+
+// If the space parameter is a number, make an indent string containing that
+// many spaces.
+
+                    if (typeof space === 'number') {
+                        for (i = 0; i < space; i += 1) {
+                            indent += ' ';
+                        }
+
+// If the space parameter is a string, it will be used as the indent string.
+
+                    } else if (typeof space === 'string') {
+                        indent = space;
+                    }
+                }
+
+// If there is no replacer parameter, use the default replacer.
+
+                if (!replacer) {
+                    rep = function (key, value) {
+                        if (!Object.hasOwnProperty.call(this, key)) {
+                            return undefined;
+                        }
+                        return value;
+                    };
+
+// The replacer can be a function or an array. Otherwise, throw an error.
+
+                } else if (typeof replacer === 'function' ||
+                        (typeof replacer === 'object' &&
+                         typeof replacer.length === 'number')) {
+                    rep = replacer;
+                } else {
+                    throw new Error('JSON.stringify');
+                }
+
+// Make a fake root object containing our value under the key of ''.
+// Return the result of stringifying the value.
+
+                return str('', {'': value});
+            },
+
+
+            parse: function (text, reviver) {
+
+// The parse method takes a text and an optional reviver function, and returns
+// a JavaScript value if the text is a valid JSON text.
+
+                var j;
+
+                function walk(holder, key) {
+
+// The walk method is used to recursively walk the resulting structure so
+// that modifications can be made.
+
+                    var k, v, value = holder[key];
+                    if (value && typeof value === 'object') {
+                        for (k in value) {
+                            if (Object.hasOwnProperty.call(value, k)) {
+                                v = walk(value, k);
+                                if (v !== undefined) {
+                                    value[k] = v;
+                                } else {
+                                    delete value[k];
+                                }
+                            }
+                        }
+                    }
+                    return reviver.call(holder, key, value);
+                }
+
+
+// Parsing happens in three stages. In the first stage, we run the text against
+// regular expressions that look for non-JSON patterns. We are especially
+// concerned with '()' and 'new' because they can cause invocation, and '='
+// because it can cause mutation. But just to be safe, we want to reject all
+// unexpected forms.
+
+// We split the first stage into 4 regexp operations in order to work around
+// crippling inefficiencies in IE's and Safari's regexp engines. First we
+// replace all backslash pairs with '@' (a non-JSON character). Second, we
+// replace all simple value tokens with ']' characters. Third, we delete all
+// open brackets that follow a colon or comma or that begin the text. Finally,
+// we look to see that the remaining characters are only whitespace or ']' or
+// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
+
+                if (/^[\],:{}\s]*$/.test(text.replace(/\\["\\\/bfnrtu]/g, '@').
+replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').
+replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
+
+// In the second stage we use the eval function to compile the text into a
+// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
+// in JavaScript: it can begin a block or an object literal. We wrap the text
+// in parens to eliminate the ambiguity.
+
+                    j = eval('(' + text + ')');
+
+// In the optional third stage, we recursively walk the new structure, passing
+// each name/value pair to a reviver function for possible transformation.
+
+                    return typeof reviver === 'function' ?
+                        walk({'': j}, '') : j;
+                }
+
+// If the text is not JSON parseable, then a SyntaxError is thrown.
+
+                throw new SyntaxError('JSON.parse');
+            },
+
+            quote: quote
+        };
+    }();
+}
diff --git a/js/md5.js b/js/md5.js
new file mode 100755 (executable)
index 0000000..36fc1c2
--- /dev/null
+++ b/js/md5.js
@@ -0,0 +1,256 @@
+/*\r
+ * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\r
+ * Digest Algorithm, as defined in RFC 1321.\r
+ * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.\r
+ * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\r
+ * Distributed under the BSD License\r
+ * See http://pajhome.org.uk/crypt/md5 for more info.\r
+ */\r
+\r
+/*\r
+ * Configurable variables. You may need to tweak these to be compatible with\r
+ * the server-side, but the defaults work in most cases.\r
+ */\r
+var hexcase = 0;  /* hex output format. 0 - lowercase; 1 - uppercase        */\r
+var b64pad  = ""; /* base-64 pad character. "=" for strict RFC compliance   */\r
+var chrsz   = 8;  /* bits per input character. 8 - ASCII; 16 - Unicode      */\r
+\r
+/*\r
+ * These are the functions you'll usually want to call\r
+ * They take string arguments and return either hex or base-64 encoded strings\r
+ */\r
+function hex_md5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));}\r
+function b64_md5(s){ return binl2b64(core_md5(str2binl(s), s.length * chrsz));}\r
+function str_md5(s){ return binl2str(core_md5(str2binl(s), s.length * chrsz));}\r
+function hex_hmac_md5(key, data) { return binl2hex(core_hmac_md5(key, data)); }\r
+function b64_hmac_md5(key, data) { return binl2b64(core_hmac_md5(key, data)); }\r
+function str_hmac_md5(key, data) { return binl2str(core_hmac_md5(key, data)); }\r
+\r
+/*\r
+ * Perform a simple self-test to see if the VM is working\r
+ */\r
+function md5_vm_test()\r
+{\r
+  return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72";\r
+}\r
+\r
+/*\r
+ * Calculate the MD5 of an array of little-endian words, and a bit length\r
+ */\r
+function core_md5(x, len)\r
+{\r
+  /* append padding */\r
+  x[len >> 5] |= 0x80 << ((len) % 32);\r
+  x[(((len + 64) >>> 9) << 4) + 14] = len;\r
+\r
+  var a =  1732584193;\r
+  var b = -271733879;\r
+  var c = -1732584194;\r
+  var d =  271733878;\r
+\r
+  for(var i = 0; i < x.length; i += 16)\r
+  {\r
+    var olda = a;\r
+    var oldb = b;\r
+    var oldc = c;\r
+    var oldd = d;\r
+\r
+    a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);\r
+    d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);\r
+    c = md5_ff(c, d, a, b, x[i+ 2], 17,  606105819);\r
+    b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);\r
+    a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);\r
+    d = md5_ff(d, a, b, c, x[i+ 5], 12,  1200080426);\r
+    c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);\r
+    b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);\r
+    a = md5_ff(a, b, c, d, x[i+ 8], 7 ,  1770035416);\r
+    d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);\r
+    c = md5_ff(c, d, a, b, x[i+10], 17, -42063);\r
+    b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);\r
+    a = md5_ff(a, b, c, d, x[i+12], 7 ,  1804603682);\r
+    d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);\r
+    c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);\r
+    b = md5_ff(b, c, d, a, x[i+15], 22,  1236535329);\r
+\r
+    a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);\r
+    d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);\r
+    c = md5_gg(c, d, a, b, x[i+11], 14,  643717713);\r
+    b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);\r
+    a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);\r
+    d = md5_gg(d, a, b, c, x[i+10], 9 ,  38016083);\r
+    c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);\r
+    b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);\r
+    a = md5_gg(a, b, c, d, x[i+ 9], 5 ,  568446438);\r
+    d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);\r
+    c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);\r
+    b = md5_gg(b, c, d, a, x[i+ 8], 20,  1163531501);\r
+    a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);\r
+    d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);\r
+    c = md5_gg(c, d, a, b, x[i+ 7], 14,  1735328473);\r
+    b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);\r
+\r
+    a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);\r
+    d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);\r
+    c = md5_hh(c, d, a, b, x[i+11], 16,  1839030562);\r
+    b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);\r
+    a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);\r
+    d = md5_hh(d, a, b, c, x[i+ 4], 11,  1272893353);\r
+    c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);\r
+    b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);\r
+    a = md5_hh(a, b, c, d, x[i+13], 4 ,  681279174);\r
+    d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);\r
+    c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);\r
+    b = md5_hh(b, c, d, a, x[i+ 6], 23,  76029189);\r
+    a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);\r
+    d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);\r
+    c = md5_hh(c, d, a, b, x[i+15], 16,  530742520);\r
+    b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);\r
+\r
+    a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);\r
+    d = md5_ii(d, a, b, c, x[i+ 7], 10,  1126891415);\r
+    c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);\r
+    b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);\r
+    a = md5_ii(a, b, c, d, x[i+12], 6 ,  1700485571);\r
+    d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);\r
+    c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);\r
+    b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);\r
+    a = md5_ii(a, b, c, d, x[i+ 8], 6 ,  1873313359);\r
+    d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);\r
+    c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);\r
+    b = md5_ii(b, c, d, a, x[i+13], 21,  1309151649);\r
+    a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);\r
+    d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);\r
+    c = md5_ii(c, d, a, b, x[i+ 2], 15,  718787259);\r
+    b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);\r
+\r
+    a = safe_add(a, olda);\r
+    b = safe_add(b, oldb);\r
+    c = safe_add(c, oldc);\r
+    d = safe_add(d, oldd);\r
+  }\r
+  return Array(a, b, c, d);\r
+\r
+}\r
+\r
+/*\r
+ * These functions implement the four basic operations the algorithm uses.\r
+ */\r
+function md5_cmn(q, a, b, x, s, t)\r
+{\r
+  return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);\r
+}\r
+function md5_ff(a, b, c, d, x, s, t)\r
+{\r
+  return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);\r
+}\r
+function md5_gg(a, b, c, d, x, s, t)\r
+{\r
+  return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);\r
+}\r
+function md5_hh(a, b, c, d, x, s, t)\r
+{\r
+  return md5_cmn(b ^ c ^ d, a, b, x, s, t);\r
+}\r
+function md5_ii(a, b, c, d, x, s, t)\r
+{\r
+  return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);\r
+}\r
+\r
+/*\r
+ * Calculate the HMAC-MD5, of a key and some data\r
+ */\r
+function core_hmac_md5(key, data)\r
+{\r
+  var bkey = str2binl(key);\r
+  if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);\r
+\r
+  var ipad = Array(16), opad = Array(16);\r
+  for(var i = 0; i < 16; i++)\r
+  {\r
+    ipad[i] = bkey[i] ^ 0x36363636;\r
+    opad[i] = bkey[i] ^ 0x5C5C5C5C;\r
+  }\r
+\r
+  var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);\r
+  return core_md5(opad.concat(hash), 512 + 128);\r
+}\r
+\r
+/*\r
+ * Add integers, wrapping at 2^32. This uses 16-bit operations internally\r
+ * to work around bugs in some JS interpreters.\r
+ */\r
+function safe_add(x, y)\r
+{\r
+  var lsw = (x & 0xFFFF) + (y & 0xFFFF);\r
+  var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r
+  return (msw << 16) | (lsw & 0xFFFF);\r
+}\r
+\r
+/*\r
+ * Bitwise rotate a 32-bit number to the left.\r
+ */\r
+function bit_rol(num, cnt)\r
+{\r
+  return (num << cnt) | (num >>> (32 - cnt));\r
+}\r
+\r
+/*\r
+ * Convert a string to an array of little-endian words\r
+ * If chrsz is ASCII, characters >255 have their hi-byte silently ignored.\r
+ */\r
+function str2binl(str)\r
+{\r
+  var bin = Array();\r
+  var mask = (1 << chrsz) - 1;\r
+  for(var i = 0; i < str.length * chrsz; i += chrsz)\r
+    bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32);\r
+  return bin;\r
+}\r
+\r
+/*\r
+ * Convert an array of little-endian words to a string\r
+ */\r
+function binl2str(bin)\r
+{\r
+  var str = "";\r
+  var mask = (1 << chrsz) - 1;\r
+  for(var i = 0; i < bin.length * 32; i += chrsz)\r
+    str += String.fromCharCode((bin[i>>5] >>> (i % 32)) & mask);\r
+  return str;\r
+}\r
+\r
+/*\r
+ * Convert an array of little-endian words to a hex string.\r
+ */\r
+function binl2hex(binarray)\r
+{\r
+  var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";\r
+  var str = "";\r
+  for(var i = 0; i < binarray.length * 4; i++)\r
+  {\r
+    str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +\r
+           hex_tab.charAt((binarray[i>>2] >> ((i%4)*8  )) & 0xF);\r
+  }\r
+  return str;\r
+}\r
+\r
+/*\r
+ * Convert an array of little-endian words to a base-64 string\r
+ */\r
+function binl2b64(binarray)\r
+{\r
+  var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\r
+  var str = "";\r
+  for(var i = 0; i < binarray.length * 4; i += 3)\r
+  {\r
+    var triplet = (((binarray[i   >> 2] >> 8 * ( i   %4)) & 0xFF) << 16)\r
+                | (((binarray[i+1 >> 2] >> 8 * ((i+1)%4)) & 0xFF) << 8 )\r
+                |  ((binarray[i+2 >> 2] >> 8 * ((i+2)%4)) & 0xFF);\r
+    for(var j = 0; j < 4; j++)\r
+    {\r
+      if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;\r
+      else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);\r
+    }\r
+  }\r
+  return str;\r
+}\r
diff --git a/js/pageAbout.js b/js/pageAbout.js
new file mode 100644 (file)
index 0000000..4ed1bd0
--- /dev/null
@@ -0,0 +1,39 @@
+// coding: utf-8\r
+// Copyright 2008 Grégory Burri\r
+//\r
+// This file is part of Euphorik.\r
+//\r
+// Euphorik is free software: you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation, either version 3 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// Euphorik is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with Euphorik.  If not, see <http://www.gnu.org/licenses/>.
+
+function PageAbout(client, formateur, util)
+{
+   this.nom = "about"
+   
+   this.client = client
+   this.formateur = formateur
+   this.util = util
+}
+
+PageAbout.prototype.contenu = function()
+{
+   var contenu = ""
+   $.ajax({async: false, url: "pages/about.html", success : function(page) { contenu += page }})
+   
+   var email = this.util.rot13("znvygb:tert.oheev@tznvy.pbz")
+   return contenu.replace("{EMAIL}", "<a href=\"" + email+ "\">" + email + "</a>").replace("{EMAIL_LIEN}", email)
+}
+
+PageAbout.prototype.charger = function()
+{
+}
diff --git a/js/pageAdmin.js b/js/pageAdmin.js
new file mode 100644 (file)
index 0000000..db50c4b
--- /dev/null
@@ -0,0 +1,471 @@
+// coding: utf-8
+// Copyright 2008 Grégory Burri
+//
+// This file is part of Euphorik.
+//
+// Euphorik is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Euphorik is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Euphorik.  If not, see <http://www.gnu.org/licenses/>.
+// 
+// La page d'administation, ne peut être accédée que par les ekMaster (admins)
+
+function PageAdmin(client, formateur, util)
+{
+   this.nom = "admin"
+   
+   this.client = client
+   this.formateur = formateur
+   this.util = util
+   
+   this.pageEvent = new PageEvent("admin", this.util)
+   
+   // le timer qui rappelle periodiquement le rafraichissement des IP bannies
+   this.timeoutIDmajIPs = null
+}
+
+/**
+  * Interface des pages.
+  */
+PageAdmin.prototype.contenu = function()
+{
+   return '\
+   <h1>Trolls</h1>\
+   <p>Un troll est un sujet à débat, en général une question, affiché sur la page principale.</p>\
+   <p>Chaque semaine un troll est choisi au hasard parmis les trolls proposés et devient le troll de la semaine.</p>\
+   <form action="" id="nouveauTroll">\
+      <p>\
+         <input class="troll" name="troll" type="text" maxlength="500" value=""></input>\
+         <button class="return" value="return">poster</button>\
+      </p>\
+   </form>\
+   <div id="trolls"></div>\
+   <h1>IPs bannies</h1>\
+   <div id="ips"></div>'
+}
+
+/**
+  * Interface des pages.
+  */
+PageAdmin.prototype.charger = function()
+{      
+   $("#page form#nouveauTroll").submit(function(){return false})
+      
+   var thisPage = this
+   
+   // la liste des trolls proposés par les ekMasters
+   this.trolls = new Trolls(this.client, this.util, this.formateur)
+   
+   this.waitEvent()
+   
+   this.majIPs()
+   
+   $("#page form#nouveauTroll  input.troll").focus()
+   
+   $("#page form#nouveauTroll button.return").click(
+      function()
+      {
+         thisPage.posterTroll()
+      }
+   )
+}
+
+/**
+  * Interface des pages.
+  */
+PageAdmin.prototype.decharger = function()
+{
+   this.pageEvent.stopAttenteCourante()
+   
+   // supprime le rafraichissement période des ips
+   if (this.timeoutIDmajIPs)
+      clearTimeout(this.timeoutIDmajIPs)
+}
+
+/**
+  * Post un troll, le contenu est lu à partir de "input.troll".
+  */
+PageAdmin.prototype.posterTroll = function()
+{
+   var thisPageAdmin = this
+   
+   var content = $("#page form#nouveauTroll input.troll").val()
+   
+   content = content.trim()
+   if (content == "")
+   {
+      this.util.messageDialogue("Le troll est vide")
+      return
+   }
+
+   var dataToSend = 
+      {
+         "action" : "put_troll", 
+         "cookie" : this.client.cookie,
+         "content" : content
+      }
+
+   ;; dumpObj(dataToSend)
+   jQuery.ajax(
+      {
+         type: "POST",
+         url: "request",
+         dataType: "json",
+         data: this.util.jsonVersAction(dataToSend),
+         success:
+            function(data)
+            {
+               ;; dumpObj(data)
+               
+               if (data["reply"] == "ok")
+               {
+                  $("#page form#nouveauTroll input.troll").val("")
+               }
+               else if (data["reply"] == "error")
+               {
+                  thisPageAdmin.util.messageDialogue(data["error_message"])
+               }
+            }
+      }
+   )
+}
+
+/**
+  * Met à jour la liste des IP bannies.
+  */
+PageAdmin.prototype.majIPs = function()
+{
+   if (this.timeoutIDmajIPs)
+      clearTimeout(this.timeoutIDmajIPs)
+
+   var thisPageAdmin = this
+
+   var dataToSend = 
+      {
+         "action" : "list_banned_ips", 
+         "cookie" : this.client.cookie
+      }
+
+   ;; dumpObj(dataToSend)
+   jQuery.ajax(
+      {
+         type: "POST",
+         url: "request",
+         dataType: "json",
+         data: this.util.jsonVersAction(dataToSend),
+         success:
+            function(data)
+            {
+               ;; dumpObj(data)
+               
+               if (data["reply"] == "list_banned_ips")
+               {
+                  var XHTML = ""
+                  for(var i = 0; i < data["list"].length; i++)
+                  {
+                     var ip = data["list"][i]
+                     XHTML += '<div class="ban"><span class="ip">' + ip["ip"] + '</span>|' +
+                        '<span class="temps">' +
+                        ip["remaining_time"] +
+                        '</span>|'
+                     for(var j = 0; j < ip["users"].length; j++)
+                     {
+                        var user = ip["users"][j]
+                        XHTML += (j > 0 ? ", " : "") +
+                           '<span class="pseudo">' + thisPageAdmin.formateur.traitementComplet(user["nick"]) + '</span>' +
+                           (user["login"] == "" ? "" : '<span class="login">(' + thisPageAdmin.formateur.traitementComplet(user["login"]) + ')</span>')
+                     }
+                     XHTML += '<span class="deban">débannir</span></div>'
+                  }
+                  
+                  if (data["list"].length == 0)
+                     XHTML += '<p>Aucune IP bannie</p>'
+                     
+                  $("#ips").html(XHTML)
+                  
+                  $(".ban").each(
+                     function()
+                     {
+                        var ip = $(".ip", this).html()
+                        $(".deban", this).click(
+                           function()
+                           {
+                              thisPageAdmin.util.messageDialogue("Êtes-vous sur de vouloir débannir l'IP ''" + ip + "'' ?", messageType.question,
+                                 {"Oui" : function()
+                                    {
+                                       thisPageAdmin.deban(ip)
+                                    },
+                                  "Non" : function(){}
+                                 }
+                              )
+                           }
+                        )
+                     }
+                  )
+               }
+               else if (data["reply"] == "error")
+               {
+                  thisPageAdmin.util.messageDialogue(data["error_message"])
+               }
+               
+               // rafraichissement toutes les minutes (je sais c'est mal)
+               // le problème est le rafraichissement des temps restant de bannissement qui doit être fait du coté client
+               thisPageAdmin.timeoutIDmajIPs = setTimeout(function(){ thisPageAdmin.majIPs() }, 60 * 1000)
+            }
+      }
+   )
+}
+
+/**
+  * Débannie une ip donnée.
+  */
+PageAdmin.prototype.deban = function(ip)
+{
+   var thisPageAdmin = this
+
+   var dataToSend = 
+      {
+         "action" : "unban", 
+         "cookie" : this.client.cookie,
+         "ip" : ip
+      }
+
+   ;; dumpObj(dataToSend)
+   jQuery.ajax(
+      {
+         type: "POST",
+         url: "request",
+         dataType: "json",
+         data: this.util.jsonVersAction(dataToSend),
+         success:
+            function(data)
+            {
+               ;; dumpObj(data)
+               if(data["reply"] == "error")
+               {
+                  thisPageAdmin.util.messageDialogue(data["error_message"])
+               }
+            }
+      }
+   )
+}
+
+/**
+  * Attente d'événement de la part du serveur.
+  */
+PageAdmin.prototype.waitEvent = function()
+{
+   var thisPageAdmin = this
+         
+   this.pageEvent.waitEvent(
+      function() { return { "last_troll" : thisPageAdmin.trolls.dernierTroll }},
+      {
+         "troll_added" : function(data){ thisPageAdmin.trolls.ajouterTrollEvent(data) },
+         "troll_modified" : function(data){ thisPageAdmin.trolls.modifierTrollEvent },
+         "troll_deleted" : function(data){ thisPageAdmin.trolls.supprimerTrollEvent },
+         "banned_ips_refresh" : function(data){ thisPageAdmin.majIPs() },
+         "error" :
+            function(data)
+            {
+               thisTrolls.util.messageDialogue(data["error_message"])
+            }
+      }
+   )
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+  * Représente un troll, pas grand chose finalement.
+  */
+function Troll(content, author)
+{
+   this.content = content
+   this.author = author
+}
+
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+
+function Trolls(client, util, formateur)
+{
+   this.client = client
+   this.util = util
+   this.formateur = formateur
+   this.dernierTroll = 0
+   
+   this.trolls = {}
+}
+
+Trolls.prototype.ajouterTrollEvent = function(data)
+{
+   var thisTrolls = this
+
+   var XHTML = ""
+   for (var i = 0; i < data["trolls"].length; i++)
+   {
+      var troll = new Troll(data["trolls"][i]["content"], data["trolls"][i]["author"])
+      var trollId = data["trolls"][i]["troll_id"]
+      thisTrolls.trolls[trollId] = troll
+   
+      XHTML +=
+         '<div id="troll' + trollId + '" class="troll">' +
+         '<span class="content">' + thisTrolls.formateur.traitementComplet(troll.content, troll.author) + '</span>' +
+         '<span class="author"> - ' + thisTrolls.formateur.traitementComplet(troll.author) + '</span>' +
+         (data["trolls"][i]["author_id"] == thisTrolls.client.id ? '<span class="editTroll">éditer</span><span class="delTroll">Supprimer</span>' : '') +
+         '</div>'
+   }
+   $("#trolls").append(XHTML)
+   $("#trolls .troll").filter(function(){return parseInt($(this).attr("id").substr(5)) > thisTrolls.dernierTroll}).each(
+      function()
+      {
+         var troll = this
+         var id = parseInt($(this).attr("id").substr(5))
+         
+         $("a[@rel*=lightbox]", this).lightBox()
+         
+         $(this).keypress(
+            function(e)
+            {
+               if (e.which == 13) // return
+                  $(".modifier", this).click()
+            }
+         )
+         $(".delTroll", this).click(
+            function()
+            {
+               thisTrolls.util.messageDialogue(
+                  "Êtes-vous sur de vouloir supprimer le troll \"" + thisTrolls.trolls[id].content + "\" ?",
+                  messageType.question,
+                  {
+                     "oui" : function()
+                        {
+                           thisTrolls.supprimer(id)
+                        },
+                     "non" : function(){}
+                  }
+               )
+            }
+         )
+         $(".editTroll", this).click(
+            function()
+            {
+               $("span", troll).css("display", "none")
+               $(troll).append(
+                  '<form><p><input class="content" type="text" size="50" maxlength="500" value="' +
+                  thisTrolls.trolls[id].content +
+                  '"></input><span class="modifier">modifier</span><span class="annuler">annuler</span></p></form>'
+               )
+               $("form input.content").focus()
+               
+               var virerLeFormulaire = function()
+               {
+                  $('form', troll).remove()
+                  $('span', troll).css("display", "inline")
+               }
+               $("span.modifier", troll).click(
+                  function()
+                  {
+                     var content = $("form input.content", troll).val()
+                     virerLeFormulaire()
+                     thisTrolls.modifier(id, content)
+                  }
+               )
+               $("span.annuler", troll).click( virerLeFormulaire )
+               $("form", troll).submit(function(){ return false})
+            }  
+         )
+      }
+   )
+   
+   if (data["trolls"].length > 0)
+      thisTrolls.dernierTroll = data["trolls"][data["trolls"].length - 1]["troll_id"]
+}
+
+Trolls.prototype.modifierTrollEvent = function(data)
+{
+   var thisTrolls = this
+   $("#trolls #troll" + data["troll_id"] + " .content").html(thisTrolls.formateur.traitementComplet(data["content"], thisTrolls.trolls[data["troll_id"]].author))
+   $("#trolls #troll" + data["troll_id"] + " a[@rel*=lightbox]").lightBox()
+   thisTrolls.trolls[data["troll_id"]].content = data["content"]
+}
+
+Trolls.prototype.supprimerTrollEvent = function(data)
+{
+   $("#trolls #troll"+data["troll_id"]).remove()
+}
+
+Trolls.prototype.modifier = function(id, content)
+{
+   var thisTrolls = this
+   
+   var dataToSend =
+      {
+         "action" : "mod_troll",
+         "cookie" : this.client.cookie,
+         "troll_id" : id,
+         "content" : content
+      }
+
+   ;; dumpObj(dataToSend)
+   jQuery.ajax(
+      {
+         type: "POST",
+         url: "request",
+         dataType: "json",
+         data: this.util.jsonVersAction(dataToSend),
+         success:
+            function(data)
+            {
+               ;; dumpObj(data)
+               if (data["reply"] == "error")
+               {
+                  thisTrolls.util.messageDialogue(data["error_message"])
+               }
+            }
+      }
+   )
+}
+
+/**
+  * Supprime un troll en fonction de son id.
+  */
+Trolls.prototype.supprimer = function(id) 
+{
+   var thisTrolls = this
+
+   var dataToSend =
+      {
+         "action" : "del_troll",
+         "cookie" : this.client.cookie,
+         "troll_id" : id
+      }
+
+   ;; dumpObj(dataToSend)
+   jQuery.ajax(
+      {
+         type: "POST",
+         url: "request",
+         dataType: "json",
+         data: this.util.jsonVersAction(dataToSend),
+         success:
+            function(data)
+            {
+               ;; dumpObj(data)
+               if (data["reply"] == "error")
+               {
+                  thisTrolls.util.messageDialogue(data["error_message"])
+               }
+            }
+      }
+   )
+}
diff --git a/js/pageMinichat.js b/js/pageMinichat.js
new file mode 100755 (executable)
index 0000000..24d6336
--- /dev/null
@@ -0,0 +1,1031 @@
+// coding: utf-8
+// Copyright 2008 Grégory Burri
+//
+// This file is part of Euphorik.
+//
+// Euphorik is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Euphorik is distributed in the hope that it will be useful,
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Euphorik.  If not, see <http://www.gnu.org/licenses/>.
+function PageMinichat(client, formateur, util)
+{
+   this.nom = "minichat"
+   
+   this.client = client
+   this.formateur = formateur
+   this.util = util
+   
+   // permet d'éviter d'envoyer plusieurs messages simultanément en pressant
+   // rapidement sur "enter" par exemple
+   this.envoieMessageEnCours = false
+   
+   this.regexMessageTagMatch = /\{.*?\}>/g
+   this.regexMessageTagReplace =  /^(.*?\{.*?\}>)*/
+}
+
+PageMinichat.prototype.contenu = function()
+{
+   return '\
+<div id="trollCourant">Troll de la semaine : <span class="troll"></span></div>\
+<form method="post" action="" id ="posterMessage">\
+   <p>\
+      <input class="captcha" name="captcha" type="text" size="8" maxlength="8"></input>\
+      <input class="pseudo" name="pseudo" type="text" maxlength="50" value="&lt;nick&gt;"></input>\
+      <input class="message" name="message" type="text" maxlength="500" value=""></input>\
+      <button class="smiles"></button>\
+      <button class="return"></button>\
+   </p>\
+</form>\
+<div id="conversations"></div>'
+}
+
+PageMinichat.prototype.charger = function()
+{   
+   thisPage = this
+
+   $("form input.pseudo").val(this.client.pseudo)
+   
+   // cet appel ne doit pas être fait avant l'appel à 'charger'
+   this.messages = new Messages(this.client, this.formateur, this.util)
+   
+   this.messages.rafraichirMessages(true)
+   
+   this.util.setCaretToEnd($("form input.message")[0])
+
+   // les outils de bannissement (uniquement pour les ekMaster)
+   if (this.client.ekMaster)
+   {    
+      this.util.outilsBan = $(
+         '<span id="outilsBan">' +
+         '<form action=""><p><input id="raison" name="raison" type="text" size="10" maxlength="200"></input></p></form>' +
+         '<img id="ban" src="img/ban.gif" alt="Ban de 3 jours" />' +
+         '<img id="kick" src="img/kick.gif" alt="Ban de 15min" />' +
+         '<img id="slap" src="img/slap.gif" alt="Avertissement" />' +
+         '</span>'
+      )
+      
+      this.util.infoBulle("Slap", $("#slap", this.util.outilsBan))
+      this.util.infoBulle("Kick (" + conf.tempsKick + "min)", $("#kick", this.util.outilsBan))
+      this.util.infoBulle("Ban (" + conf.tempsBan / 24 / 60 + " jours)", $("#ban", this.util.outilsBan))
+      this.util.infoBulle("La raison", $("input", this.util.outilsBan))
+   }
+   
+   this.util.infoBulle("Ouvrir la conversation liée au troll de la semaine", $("#trollCourant .troll")) 
+
+   // <smiles>
+   $("body").append("<div id=\"smiles\"></div>")
+   // affichage des smiles
+   $("#smiles").append(this.formateur.getSmilesHTML()).children().each(
+      function(i)
+      {
+         var opacityBase = $(this).css("opacity")
+         $(this).click(
+            function(event)
+            {
+               thisPage.util.replaceSelection($("form#posterMessage input.message")[0], thisPage.formateur.smiles[$(this).attr("class")][0].source.replace(/\\/g, ""))
+            }
+         ).hover(
+            function() { $(this).animate({opacity: 1}, 200) },
+            function() { $(this).animate({opacity: opacityBase}, 200) }
+         )
+      }
+   )
+   $("form button.smiles").hover(
+      function(e)
+      {
+         var position = $(e.target).offset()
+         // le décalage pour ne pas dépasser à droite (10 correspond à la marge pour éviter de coller le bord)
+         var decalage = $("body").width() - $("#smiles").width() - position.left - 10
+         decalage = decalage > 0 ? 0 : decalage
+         
+         $("#smiles").css("top", position.top).css("left", position.left + decalage).show()
+      },
+      function(e){}
+   )
+   $("#smiles").hover(
+      function(){},
+      function(e)
+      {
+         $("#smiles").hide()
+      }
+   )
+   // </smiles>
+   
+   // événements
+   var nouveauMessage = 
+      function()
+      {  
+         // captcha anti bot
+         if ($("form input.captcha").val() != "") return
+      
+         thisPage.envoyerMessage(
+            $("form input.pseudo").val(), 
+            $("form input.message").val()
+         )
+            
+         $("form input.message").focus()
+      }
+      
+   $("form").keypress(
+      function(e)
+      {
+         if (e.which == 13) // return
+            nouveauMessage()
+      }
+   )
+   
+   $("form button.return").click(nouveauMessage)
+   
+   // interdiction de submiter le formulaire
+   $("form").submit(function(){ return false})
+   
+   $("input.pseudo").click(
+      function()
+      {
+         var input = $("input.pseudo")[0]
+         if (input.value == conf.pseudoDefaut)
+            input.value = ""
+      }
+   )
+}
+
+PageMinichat.prototype.decharger = function()
+{
+   this.messages.pageEvent.stopAttenteCourante()
+   
+   $("body #smiles").remove()
+}
+
+PageMinichat.prototype.getJSONMessage = function(pseudo, message, repondA)
+{
+   return {
+      "action" : "put_message",
+      "cookie" : this.client.cookie,
+      "nick" : pseudo,
+      "content" : message,
+      "answer_to" : repondA
+   }
+}
+
+PageMinichat.prototype.envoyerMessage = function(pseudo, message)
+{   
+   var thisPageMinichat = this
+
+   // (un pseudo vide est autorisé)
+   pseudo = this.formateur.filtrerInputPseudo(pseudo)
+
+   // extraction des id des messages (en base 36 évidemment) auquels le user répond
+   var repondA = []
+   var tags = message.match(this.regexMessageTagMatch)
+   if (tags != null)
+   {
+      for(var i = 0; i < tags.length; i++)
+         repondA.push(parseInt(/\{(.*?)\}>/.exec(tags[i])[1], 36))
+      message = message.replace(this.regexMessageTagReplace, "")
+   }
+   
+   message = message.trim()
+   if (message == "")
+   {
+      this.util.messageDialogue("Le message est vide")
+      return
+   }
+
+   if (!this.client.authentifie())
+      if (!this.client.enregistrement())
+      {
+         this.util.messageDialogue("login impossible")
+         return
+      }
+      
+   this.client.pseudo = pseudo
+   
+   // évite le double post
+   if (this.envoieMessageEnCours)
+   {
+      this.util.messageDialogue("Message en cours d'envoie...")
+      return
+   }
+   this.envoieMessageEnCours = true
+   
+   ;; dumpObj(this.getJSONMessage(pseudo, message, repondA))
+   jQuery.ajax(
+      {
+         url : "request", 
+         type: "POST",
+         data : this.util.jsonVersAction(this.getJSONMessage(pseudo, message, repondA)),
+         dataType : "json",
+         beforeSend : function(xmlHttpRequest)
+         {
+            // TODO : ça marche ça ??
+            xmlHttpRequest.setRequestHeader("X-Requested-With", "")
+         },
+         success : function(data, textStatus)
+         {
+            ;; dumpObj(data)
+         
+            if(data["reply"] == "ok")
+            {  
+               $("form input.message").val("")
+                        
+               // met à jour la classe des messages auquel repond celui ci (c'est un peu de la triche) TODO : ya mieux ?
+               for (var i = 0; i < repondA.length; i++)
+               {
+                  for (var j = 0; j < thisPageMinichat.messages.conversations.length; j++)
+                  {
+                     var mess = thisPageMinichat.messages.conversations[j].messagesParId[repondA[i]]
+                     if (mess != undefined)
+                        mess.clientARepondu = true
+                  }
+                  $("#conversations div#mess" + repondA[i].toString(36)).addClass("repondu")
+               }
+            }
+            else if (data["reply"] == "error")
+            {
+               thisPageMinichat.util.messageDialogue(data["error_message"])
+            }
+            thisPageMinichat.envoieMessageEnCours = false
+         },
+         error : function()
+         {
+            thisPageMinichat.envoieMessageEnCours = false         
+         }
+      }
+   )
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+function Reponse(id, pseudo, login)
+{
+   this.id = id
+   this.pseudo = pseudo
+   this.login = login
+   
+   if (this.pseudo == undefined)
+      this.pseudo = ""
+   
+   if (this.login == undefined)
+      this.login = ""
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+  * Représente un message.
+  * @param id (string)
+  * @param date (string)
+  * @param pseudo
+  * @param contenu
+  */
+function Message(id, auteurId, date, pseudo, login, contenu)
+{
+   this.id = id
+   this.auteurId = auteurId
+   this.date = date
+   this.pseudo = pseudo
+   this.login = login
+   this.contenu = contenu
+   
+   this.appartientAuClient = false
+   this.clientARepondu = false
+   this.estUneReponse = false
+   this.ekMaster = false
+   
+   this.systeme = false // est-ce un message 'système' ?
+   
+   this.repondA = {} // un ensemble de reponse (voir Reponse) indexé par l'id du message de la reponses
+}
+
+/**
+  *
+  */
+Message.prototype.setRepondA = function(repondAJSON)
+{
+   var thisMessage = this
+   this.repondA = {}
+   
+   for(var i = 0; i < repondAJSON.length; i++)
+   {
+      thisMessage.repondA[repondAJSON[i]["id"]] = new Reponse(
+         repondAJSON[i]["id"],
+         repondAJSON[i]["nick"],
+         repondAJSON[i]["login"]
+      )
+   }
+}
+
+/**
+  * Renvoie les messages faisant partie d'une conversation.
+  * @param messages l'ensemble des messages de la conversation
+  * @return les id des messages qui ont été mis en evidence sous la forme
+  *   d'un hash (object) {id => 0 | 1 | 2 | 3}. 1 : proprietaire, 2 : reponse directe, 3 : message repondu
+  */
+Message.prototype.getConversation = function(messages)
+{
+   var thisMessage = this
+
+   // les messages faisant partie de la conversation
+   var messagesEnEvidence = {}
+   
+   messagesEnEvidence[this.id] = 1
+   
+   // recherche les réponses (O(n))
+   for (var i = 0; i < messages.messages.length; i++)
+      if (messages.messages[i].repondA.hasOwnProperty(this.id))
+         messagesEnEvidence[messages.messages[i].id] = messages.messages[i].auteurId == this.auteurId ? 1 : 2
+   
+   var premierNiveau = true
+   var f = function(tabIds)
+   {
+      for(var id in tabIds)
+      {
+         var message = messages.messagesParId[id]
+         if (message != undefined)
+         {         
+            messagesEnEvidence[id] = message.auteurId == thisMessage.auteurId ? 1 : ( premierNiveau ? 3 : 0 )
+            premierNiveau = false
+            f (message.repondA)
+         }
+      }
+   }
+   f(this.repondA)
+   
+   return messagesEnEvidence
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+  * Représente une conversation.
+  * @param numConv le numéro (appelé id) de la conversation
+  * @param formateur outil permettant la mise en forme du texte des messages
+  */
+function Conversation(num, util, formateur, client)
+{
+   var thisConversation = this
+   
+   this.num = num // peut changer au cours de la vie de la conversation
+   this.id = Math.floor(Math.random() * 1000000).toString(36)
+   this.util = util
+   this.formateur = formateur
+   this.client = client
+   this.idDernierMessageAffiche = 0
+   
+   this.messages = new Array()
+   this.messagesParId = new Object()
+   
+   this.nbMessageMax = conf.nbMessageAffiche // Le nombre de message affiché par page
+
+   $("#conversations").append(
+      '<div id="' + this.getId() + '" class="conversation">\
+      <div class="titre">' +
+         (num == 0 ? '' : '<div class="fermer"></div><div class="lien"></div>') +
+         '<span class="next">&lt;</span><span class="numPage">1</span><span class="prev">&gt;</span>\
+         </div>\
+      </div>'
+   )
+   
+   this.util.infoBulle("Aller à la première page", $("#conversations #" + this.getId() + " .numPage"))
+   if (num != 0)
+   {
+      this.util.infoBulle("Créer un lien vers la conversation", $("#conversations #" + this.getId() + " .lien"))
+      this.util.infoBulle("Fermer la conversation", $("#conversations #" + this.getId() + " .fermer"))   
+   }
+}
+
+/**
+  *
+  */
+Conversation.prototype.enleverMiseEnEvidence = function()
+{
+   $("#conversations .message").removeClass("cache")
+}
+
+Conversation.prototype.colorerEntetes = function()
+{
+   var messagesReponse = ""
+   var messagesRepondu = ""
+   var messagesProprietaire = ""
+   for (var i = 0; i < this.messages.length; i++)
+   {
+      if (this.messages[i].appartientAuClient)
+         messagesProprietaire += "#mess" + this.messages[i].id.toString(36) + ","
+      else if (this.messages[i].estUneReponse)
+         messagesReponse += "#mess" + this.messages[i].id.toString(36) + ","
+      else if (this.messages[i].clientARepondu)
+         messagesRepondu += "#mess" + this.messages[i].id.toString(36) + ","
+   }
+   $(messagesReponse).addClass("reponse")
+   $(messagesRepondu).addClass("repondu")
+   $(messagesProprietaire).addClass("proprietaire")
+}
+
+Conversation.prototype.decolorerEntetes = function()
+{
+   $("#" + this.getId() + " .message")
+      .removeClass("reponse")
+      .removeClass("repondu")
+      .removeClass("proprietaire")   
+}
+
+/**
+  * Défini la page courante et s'il l'on se trouve sur la dernière page.
+  * @pageCourante la page courante
+  * @dernierePage true si c'est la dernière page sinon false
+  */
+Conversation.prototype.setPage = function(pageCourante, dernierePage)
+{
+   $("#conversations #" + this.getId() + " .numPage").text(pageCourante)
+   $("#conversations #" + this.getId() + " .next").css("display", pageCourante == 1 ? "none" : "inline")
+   $("#conversations #" + this.getId() + " .prev").css("display", dernierePage ? "none" : "inline")
+}
+
+/**
+  * Evenement déclanché lors de l'insertion du lien de la conversation dans le message courant.
+  */
+Conversation.prototype.eventLien = function(fun)
+{
+   var thisConversation = this
+   
+   $("#conversations #" + this.getId() + " .titre .lien").click(
+      function()
+      {
+         fun(thisConversation.num)
+      }
+   )
+}
+
+/**
+  * Evenement déclanché lors de la fermeture de la conversation.
+  */
+Conversation.prototype.eventFermer = function(fun)
+{
+   var thisConversation = this
+   
+   $("#conversations #" + this.getId() + " .titre .fermer").click(
+      function()
+      {
+         fun(thisConversation.num)
+      }
+   )
+}
+
+/**
+  * @funNext appelé lorsque l'on passe à la page suivante (de 2 à 1 par exemple)
+  * @funPrev appelé lorsque l'on passe à la page précédente (de 1 à 2 par exemple)
+  * @funReset appelé lorsque l'on souhaite revenir à la page une
+  */
+Conversation.prototype.setFunPage = function(funNext, funPrev, funReset)
+{
+   var thisConversation = this
+   
+   $("#conversations #" + this.getId() + " .next").click(
+      function() { funNext(thisConversation.num) }
+   )
+   $("#conversations #" + this.getId() + " .prev").click(
+      function() { funPrev(thisConversation.num) }
+   )
+   $("#conversations #" + this.getId() + " .numPage").click(
+      function() { funReset(thisConversation.num) }
+   )
+}
+
+/**
+  * Retourne l'id de la conversation sous la forme (par exemple) "conv3".
+  */
+Conversation.prototype.getId = function()
+{
+   return "conv" + this.id
+}
+
+Conversation.prototype.ajouterMessage = function(message)
+{
+   this.messages.push(message)
+   this.messagesParId[message.id] = message
+   if (this.messages.length > this.nbMessageMax)
+      delete this.messagesParId[this.messages.shift().id]
+}
+
+/**
+  * FIXME : méthode très lourde. ne serait-ce pas mieux de virer d'un coup l'élément conversation et d'en remettre un vide ?
+  */
+Conversation.prototype.viderMessages = function()
+{
+   this.messages = new Array()
+   this.idDernierMessageAffiche = 0
+   $("#conversations #" + this.getId() + " .message").remove()
+}
+
+/**
+  * Après l'ajout d'un ou plusieurs message cette méthode est appelée afin
+  * d'afficher les messages non-affichés.
+  * FIXME : méthode super lourde, à optimiser.
+  * @param funClickExtract fonction (fun(numMess)) appellée lors du clic sur un bouton "extraire"
+  */
+Conversation.prototype.flush = function(funClickOuvrirConv)
+{
+   var thisConversation = this
+
+   // est-ce que le prochain message est pair ? (permet d'alterner le style des messages)
+   var messagePair = (this.idDernierMessageAffiche == 0 ? true :
+      ($("#conversations #" + this.getId() + " div:first").attr("class").search("messagePair") == -1)
+   )
+      
+   // construction de l'XHTML des messages
+   var XHTML = ""
+   for (var i = 0; i < this.messages.length; i++)
+      if (this.messages[i].id > this.idDernierMessageAffiche)
+      {      
+         var message = this.messages[i]
+        
+         // construit l'identifiant de la personne
+         var identifiant = 
+            this.client.nickFormat == "nick" || message.login == "" ? this.formateur.traitementComplet(message.pseudo) : 
+            (this.client.nickFormat == "login" ? this.formateur.traitementComplet(message.login) : 
+            this.formateur.traitementComplet(message.pseudo) + "<span class=\"login\">(" + this.formateur.traitementComplet(message.login) +")</span>" )
+         
+         var XHTMLrepondA = ""
+         var debut = true
+         for (var id in message.repondA)
+         {
+            if (!debut) XHTMLrepondA += ", "
+            ;; dumpObj(message.repondA.count)
+            XHTMLrepondA += this.formateur.traitementComplet(message.repondA[id].pseudo)
+            debut = false
+         }
+         if (XHTMLrepondA != "")
+            XHTMLrepondA = "<span class=\"repondA\">" + XHTMLrepondA + "</span><span class=\"delimitationRepondA\"></span>"
+         
+         XHTML += 
+            "<div id=\"mess" + message.id.toString(36) + "\" class=\"" + (messagePair ? "messagePair" : "messageImpair") + " message" +
+               (this.messages[i].appartientAuClient ? " proprietaire" : "")  +
+               (this.messages[i].clientARepondu ? " repondu" : "") +
+               (this.messages[i].estUneReponse ? " reponse" : "") +
+               (this.messages[i].systeme ? " systeme" : "") +
+               (this.messages[i].ekMaster ? " ekMaster" : "") +
+            "\">" +
+               "<div class=\"extraire\"></div><span class=\"entete\">" +
+               "<span class=\"dateComplete\">[<span class=\"date\">" + message.date + "</span>]</span>" +
+               "<span class=\"pseudo\"><span class=\"id\" style=\"display: none\">" + message.auteurId + "</span class=\"ident\">" + identifiant + "</span></span><span class=\"delimitationEntete\"></span>" +
+               XHTMLrepondA +
+               "<span class=\"contenu\">" + this.formateur.traitementComplet(message.contenu, message.pseudo) + "</span>" +
+            "</div>"
+            
+         messagePair = !messagePair
+      }
+   
+   var DOM = $(XHTML)
+   DOM.each(
+      function()
+      {      
+         $(".lienConv", this).click(
+            function(event)
+            {          
+               // FIXME : ya pas mieux ?
+               var racine = $(event.target).text()
+               funClickOuvrirConv(parseInt(racine.substring(1, racine.length - 1), 36))
+               return false
+            }
+         )         
+         
+         thisConversation.util.infoBulle("Extraction de la conversation", $(".extraire", this))
+         
+         // l'id du message
+         var idMess36 = $(this).attr("id").substr(4)
+         var idMess = parseInt(idMess36, 36)
+         
+         $(this).click(
+            function(event)
+            {
+               if ($(event.target).is("a") || $(event.target).parents("#outilsBan").length > 0) return
+                              
+               // extraction d'une conversation
+               if ($(event.target).is(".extraire"))
+               {
+                  funClickOuvrirConv(idMess)
+                  return
+               }
+            
+               var valCourant = $("input.message").val()
+               if (valCourant == undefined) valCourant = ""
+               var tag = $(".pseudo span.ident", this).text()  + "{" + idMess36 + "}" + ">"
+               if (valCourant.indexOf(tag, 0) == -1)
+                  $("input.message").val(tag + " " + valCourant)
+               thisConversation.util.setCaretToEnd($("form input.message")[0])
+            }
+         )
+         
+         // mise en évidence de la conversation
+         $(".entete", this).hover(
+            function()
+            {
+               thisConversation.decolorerEntetes()
+               thisConversation.afficherConversation(idMess)
+            },
+            // quand on sort de l'entête du message la mise en évidence est enlevée
+            function()
+            {
+               thisConversation.enleverMiseEnEvidence()
+               thisConversation.decolorerEntetes()
+               thisConversation.colorerEntetes()
+            }
+         )
+         
+         if (thisConversation.client.viewTimes)
+            $(".dateComplete", this).show()
+         else
+            $(".dateComplete", this).hide()
+         
+         $("a[@rel*=lightbox]", this).lightBox()
+         
+         // les outils de bannissement (uniquement pour les ekMaster)
+         if (thisConversation.client.ekMaster)
+            $(".pseudo", this).hover(
+               function(e)
+               {     
+                  var userId =  parseInt($(".id", this).text())
+                  var element = $(this)
+                  var h = element.height()
+                  var offset = element.offset()
+                  thisConversation.util.outilsBan.css("top", offset.top - 2).css("left", offset.left - 2).height(h < 16 ? 16 : h).width(element.width() + 16 * 3 + 4 + 64).prependTo(this).show()
+                  $("img", thisConversation.util.outilsBan).unbind("click")
+                  $("#slap", thisConversation.util.outilsBan).click(
+                     function(e)
+                     {
+                        thisConversation.client.slap(userId, $("#outilsBan input").val())
+                        $("#outilsBan input").val("")
+                        $("#outilsBan").hide()
+                     }
+                  )
+                  $("#kick", thisConversation.util.outilsBan).click(
+                     function(e)
+                     {
+                        thisConversation.client.kick(userId, $("#outilsBan input").val())
+                        $("#outilsBan input").val("")
+                        $("#outilsBan").hide()
+                     }
+                  )
+                  $("#ban", thisConversation.util.outilsBan).click(
+                     function(e)
+                     {
+                        thisConversation.client.ban(userId, $("#outilsBan input").val())
+                        $("#outilsBan input").val("")
+                        $("#outilsBan").hide()
+                     }
+                  )
+               },
+               function(e)
+               {
+                  $("#outilsBan", this).hide()
+               }
+            )
+      }
+   )
+   DOM.prependTo("#conversations #" + this.getId())
+   
+   // enlève les messages exedentaires
+   var nbMessagesAffiche = $("#conversations #" + this.getId() + " .message").size()   
+   if (nbMessagesAffiche > this.nbMessageMax)
+      $("#conversations #" + this.getId() + " .message").slice(this.nbMessageMax, nbMessagesAffiche).remove()
+   
+   if (this.messages.length > 0)
+      this.idDernierMessageAffiche = this.messages[this.messages.length-1].id
+}
+
+/**
+  * Etablit une liste des messages à mettre en evidence et des messages à cacher.
+  * Puis applique un plan diabolique.
+  * @param id l'id du message
+  */
+Conversation.prototype.afficherConversation = function(id)
+{   
+   var message = this.messagesParId[id]
+   if (message == undefined) return
+      
+   mess = message.getConversation(this)
+   
+   // FIXME : cet appel est très lent
+   $("#conversations #" + this.getId() + " .message").each(
+      function()
+      {
+         var jq = $(this)
+         var statut = mess[parseInt(jq.attr("id").substr(4), 36)]
+         if (statut == undefined)
+            jq.addClass("cache")
+         else
+         {
+            jq.removeClass("cache")
+            switch (statut)
+            {
+               case 1 :
+                  jq.addClass("proprietaire")
+                  break;
+               case 2 :
+                  jq.addClass("reponse")
+                  break;
+               case 3 :
+                  jq.addClass("repondu")
+                  break;
+            }
+         }
+      }
+   )
+}
+
+/**
+  * Supprime une conversation.
+  */
+Conversation.prototype.supprimer = function()
+{
+   $("#conversations #" + this.getId()).remove()
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+  * Représente l'ensemble des messages affichés.
+  */
+function Messages(client, formateur, util)
+{
+   var thisMessages = this
+
+   this.client = client
+   this.formateur = formateur
+   this.util = util
+   
+   this.conversations = new Array() // les conversations, la première représente la conversation principale
+   this.nouvelleConversation(0)
+   
+   this.trollIdCourant = 0
+   
+   this.pageEvent = new PageEvent("chat", this.util)
+}
+
+/**
+  * Crée un message JSON contenant le message demandant un rafraichissement.
+  */
+Messages.prototype.getJSONrafraichirMessages = function()
+{
+   var mess =  {
+      "message_count" : conf.nbMessageAffiche,
+      "main_page" : this.client.pagePrincipale,
+      "conversations" : this.getJSONConversations(),
+      "troll_id" : this.trollIdCourant
+   }
+   
+   if (this.client.cookie != null) mess["cookie"] = this.client.cookie
+   mess["last_message_id"] = this.conversations[0].idDernierMessageAffiche
+   
+   return mess
+}
+
+Messages.prototype.getJSONConversations = function()
+{
+   var clientConv = this.client.getJSONConversations()
+   for (var i = 1; i < this.conversations.length; i++)
+   {
+      clientConv[i-1]["last_message_id"] = this.conversations[i].idDernierMessageAffiche
+   }
+   return clientConv
+}
+
+/**
+  * Ajoute un ensemble de messages puis les affiches.
+  * @param elements un tableau d'éléments JSON représentant les messages, voir protocole.txt
+  * @param numConversation le numéro de la conversation auquel appartiennent les messages
+  * @return true si les messages on été ajoutés, false si la conversation n'existe pas et qu'il n'y a pas de message
+  */
+Messages.prototype.ajouterMessages = function(elements, numConversation)
+{
+   if (elements["messages"].length == 0)
+      return this.conversations[numConversation] != undefined
+
+   for (var i = 0; i < elements["messages"].length; i++)
+      this.ajouterMessage(elements["messages"][i], numConversation)
+   this.flush(numConversation)
+   
+   // renseigne la conversation sur la page courante et si c'est la dernière
+   this.conversations[numConversation].setPage(
+      numConversation == 0 ? this.client.pagePrincipale : this.client.conversations[numConversation - 1].page,
+      elements["last_page"]
+   )
+   
+   return true
+}
+
+/**
+  * Création d'un nouveau message.
+  * Les message sont données dans l'ordre de leur id.
+  * @param element un element JSON représentant le message
+  * @param numConversation le numéro de la conversation, 0 = principale
+  */
+Messages.prototype.ajouterMessage = function(element, numConversation)
+{
+   var thisMessages = this
+
+   // pas d'utilisation de jquery pour des raisons de performance
+   var id = element["id"]
+   
+   var message = new Message(
+      id,      
+      element["user_id"],
+      element["date"],
+      element["nick"],
+      element["login"],
+      element["content"]
+   )   
+   
+   message.appartientAuClient = element["owner"]
+   message.clientARepondu = element["answered"]
+   message.estUneReponse = element["is_a_reply"]
+   message.systeme = element["system"] 
+   message.setRepondA(element["answer_to"])
+   message.ekMaster = element["ek_master"]
+   
+   if (this.conversations[numConversation] == null)
+   {
+      this.nouvelleConversation(
+         numConversation,
+         function(num) // fermeture de la conversation
+         {
+            thisMessages.supprimerConversation(num)
+         },
+         function(num) // insertion du lien vers la conversation
+         {
+               thisPage.util.replaceSelection(
+                  $("form#posterMessage input.message")[0],
+                  "{" + thisMessages.client.conversations[num-1].root.toString(36) + "}"
+               )
+         }
+      )
+   }
+
+   this.conversations[numConversation].ajouterMessage(message)
+}
+
+Messages.prototype.nouvelleConversation = function(num, funFermer, funLien)
+{
+   var thisMessages = this
+
+   this.conversations[num] = new Conversation(num, this.util, this.formateur, this.client)
+   if (funFermer != undefined)
+      this.conversations[num].eventFermer(funFermer)
+   if (funLien != undefined)
+      this.conversations[num].eventLien(funLien)
+
+   this.conversations[num].setFunPage(
+      function(num) // page suivante
+      {
+         thisMessages.client.pageSuivante(num - 1)
+         thisMessages.rafraichirMessages(true)
+      },
+      function(num) // page précédente
+      {
+         thisMessages.client.pagePrecedente(num - 1)
+         thisMessages.rafraichirMessages(true)
+      },
+      function(num) // retour à la page une
+      {
+         if (thisMessages.client.goPremierePage(num - 1))
+            thisMessages.rafraichirMessages(true)
+      }
+   )
+   
+   this.ajusterLargeurConversations()
+}
+
+/**
+  * Enlève une conversation.
+  */
+Messages.prototype.supprimerConversation = function(num)
+{
+   if (num <= 0 || num >= this.conversations.length) return // la numéro 0 ne peut être supprimé
+   this.conversations[num].supprimer()
+   
+   // décalage TODO : supprimer le dernier élément 
+   for (var i = num; i < this.conversations.length - 1; i++)
+   {
+      this.conversations[i] = this.conversations[i+1]
+      this.conversations[i].num -= 1
+   }
+   this.conversations.pop()
+   this.ajusterLargeurConversations()
+      
+   this.client.supprimerConversation(num-1)   
+      
+   this.rafraichirMessages(true)
+}
+
+/**
+  * Ajuste la largeur des conversations en fonction de leur nombre. modifie l'attribut CSS 'width'.
+  */
+Messages.prototype.ajusterLargeurConversations = function()
+{
+   var largeurPourcent = (100 / this.conversations.length)   
+   // le "- 0.01" evite que IE se chie dessus lamentablement et affiche les conversations les unes au dessus des autres
+   if($.browser["msie"])
+      largeurPourcent -= 0.05
+   $("#conversations .conversation").css("width", largeurPourcent + "%")
+}
+
+/**
+  * Demande à toutes les conversations de se flusher (afficher les messages non-affichés).
+  */
+Messages.prototype.flushAll = function()
+{
+   for (var i = 0; i < this.conversations.length; i++)
+      this.flush(i)
+}
+
+/**
+  * Demande à une conversation de se flusher.
+  */
+Messages.prototype.flush = function(numConv)
+{
+   var thisMessages = this
+   
+   this.conversations[numConv].flush(
+      function(racine) // appelé lorsqu'un utilisateur click sur un lien vers une conversation
+      {
+         thisMessages.ouvrirConversation(racine)
+      }
+   )
+}
+
+Messages.prototype.ouvrirConversation = function(racine)
+{
+   if (this.client.ajouterConversation(racine))
+      this.rafraichirMessages(true)
+   else
+      this.util.messageDialogue("Cette conversation est déjà ouverte")
+}
+
+Messages.prototype.viderMessages = function()
+{
+   for (var i = 0; i < this.conversations.length; i++)
+      this.conversations[i].viderMessages()
+}
+
+/**
+  * Met à jour les messages de manière continue.
+  * (AJAX-Comet-style proof)
+  * @param vider vide tous les messages avant d'afficher les nouveaux
+  */
+Messages.prototype.rafraichirMessages = function(vider)
+{
+   var thisMessages = this
+   
+   if (vider == undefined)
+      vider = false
+   
+   if (vider)
+      for (var i = 0; i < this.conversations.length; i++)
+         this.conversations[i].idDernierMessageAffiche = 0
+   
+   this.pageEvent.waitEvent(
+      function() { return thisMessages.getJSONrafraichirMessages() },
+      {
+         "new_troll" :
+            function(data)
+            {   
+               thisMessages.trollIdCourant = data["troll_id"]
+               $("#trollCourant .troll").html(thisMessages.formateur.traitementComplet(data["content"])).unbind("click").click(
+                  function()
+                  {
+                     thisMessages.ouvrirConversation(data["message_id"])
+                  }
+               )
+               
+               $("#trollCourant .troll a[@rel*=lightbox]").lightBox()
+            },
+         "new_messages" :   
+            function(data)
+            {
+               if (vider)
+               {
+                  thisMessages.viderMessages()
+                  vider = false
+               }
+               // ajoute les messages reçus à leur conversation respective
+               for (var numConv = 0; numConv < data["conversations"].length; numConv++)
+               {
+                  if (!thisMessages.ajouterMessages(data["conversations"][numConv], numConv))
+                  {
+                     thisMessages.util.messageDialogue("La conversation {" + thisMessages.client.conversations[numConv -1].root.toString(36) + "} n'existe pas")
+                     thisMessages.client.supprimerConversation(numConv - 1) 
+                  }
+               }
+            }
+      }
+   )
+}
diff --git a/js/pageProfile.js b/js/pageProfile.js
new file mode 100755 (executable)
index 0000000..5c78846
--- /dev/null
@@ -0,0 +1,157 @@
+// coding: utf-8\r
+// Copyright 2008 Grégory Burri\r
+//\r
+// This file is part of Euphorik.\r
+//\r
+// Euphorik is free software: you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation, either version 3 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// Euphorik is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with Euphorik.  If not, see <http://www.gnu.org/licenses/>.
+
+function PageProfile(client, formateur, util)
+{
+   this.nom = "profile"
+   
+   this.client = client
+   this.formateur = formateur
+   this.util = util
+}
+
+PageProfile.prototype.contenu = function()
+{
+   // pourquoi ?
+   return ""
+}
+
+PageProfile.prototype.charger = function()
+{
+   $("#page").html(this.getHTML())
+   
+   // en fonction du statut
+   if (this.client.authentifie())
+      this.chargerProfile()
+   else
+      this.chargerLogin()
+      
+   $("#page form#profile").submit(function(){return false})
+}
+
+PageProfile.prototype.chargerProfile = function()
+{ \r
+   var thisPage = this\r
+   \r
+   $("form#profile input.login").val(this.client.login)\r
+   $("form#profile input.pseudo").val(this.client.pseudo)\r
+   $("form#profile input.email").val(this.client.email)
+   $("form#profile input#viewTooltips").attr("checked", this.client.viewTooltips)
+   $("form#profile input#viewTimes").attr("checked", this.client.viewTimes)
+   
+   $("form#profile select#affichagePseudo option").removeAttr("selected")
+   $("form#profile select#affichagePseudo option[value=" + this.client.nickFormat + "]").attr("selected", "selected")
+   \r
+\r
+   $("form#profile button").click(\r
+      function()\r
+      {\r
+         thisPage.client.pseudo = thisPage.formateur.filtrerInputPseudo($("form#profile input.pseudo").val())\r
+         thisPage.client.email = $("form#profile input.email").val()
+         thisPage.client.nickFormat = $("form#profile select#affichagePseudo option:selected").attr("value") 
+         thisPage.client.viewTooltips = $("form#profile input#viewTooltips").attr("checked")
+         thisPage.client.viewTimes = $("form#profile input#viewTimes").attr("checked")
+         \r
+         var password = $("form#profile input.password").val()\r
+         var passwordRe = $("form#profile input.passwordRe").val()  \r
+         if (password != "" || passwordRe != "")\r
+         {\r
+            if (password != passwordRe)\r
+            {            \r
+               thisPage.util.messageDialogue("Les mots de passes ne correspondent pas")\r
+               return\r
+            }\r
+            thisPage.client.password = thisPage.util.md5(password)\r
+         }\r
+         \r
+         if(!thisPage.client.flush())\r
+            thisPage.util.messageDialogue("Impossible de mettre à jour votre profile, causes inconnues", messageType.erreur)\r
+         else
+            thisPage.util.messageDialogue("Votre profile a été mis à jour")\r
+      }\r
+   )
+}
+
+PageProfile.prototype.chargerLogin = function()
+{   
+   var thisPage = this
+
+   $("#page form#profile button").click(
+      function()
+      {
+         if(thisPage.client.connexionLogin($("form#profile input.login").val(), thisPage.util.md5($("form#profile input.password").val())))
+         {\r
+            // TODO afficher un message "ok"
+            thisPage.pages.afficherPage("minichat")
+         }
+      }
+   )
+}
+
+PageProfile.prototype.getHTML = function()
+{
+return '\
+<form action="" id="profile" >\
+ <table>\
+  <tr>\
+   <td>login</td>\
+   <td><input class="login" type="text" size="20" maxlength="20" ' + (this.client.authentifie() ? 'readonly="readonly"' : '') + ' /></td>\
+  </tr>\
+  <tr>\
+   <td>password</td>\
+   <td><input class="password" type="password" size="20" maxlength="20"/></td>\
+  </tr>' + 
+  (this.client.authentifie() ? '\
+  <tr>\
+   <td>password re</td>\
+   <td><input class="passwordRe" type="password" size="20" maxlength="20"/></td>\
+  </tr>\
+  <tr>\
+   <td>pseudo</td>\
+   <td><input class="pseudo" type="text" size="40" maxlength="20"/></td>\
+  </tr>\
+  <tr>\
+   <td>e-mail</td>\
+   <td><input class="email" type="text" size="40" maxlength="100"/></td>\
+  </tr>\
+  <tr>\
+   <td>Affichage des identifiants</td>\
+   <td>\
+    <select id="affichagePseudo">\
+     <option value="nick">Pseudo</option>\
+     <option value="login">Login</option>\
+     <option value="nick_login">Pseudo(Login)</option>\
+    </select>\
+   </td>\
+  </tr>\
+  <tr>\
+   <td>Afficher les infos bulles</td>\
+   <td><input type="checkbox" id="viewTooltips" /></td>\
+  </tr>\
+  <tr>\
+   <td>Afficher les dates</td>\
+   <td><input type="checkbox" id="viewTimes" /></td>\
+  </tr>' : '') + '\
+  <tr>\
+   <td></td>\
+   <td><button>Valider</button>\
+  </tr>\
+ </table>\
+</form>' 
+}
+
diff --git a/js/pageRegister.js b/js/pageRegister.js
new file mode 100755 (executable)
index 0000000..4d107e9
--- /dev/null
@@ -0,0 +1,82 @@
+// coding: utf-8\r
+// Copyright 2008 Grégory Burri\r
+//\r
+// This file is part of Euphorik.\r
+//\r
+// Euphorik is free software: you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation, either version 3 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// Euphorik is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with Euphorik.  If not, see <http://www.gnu.org/licenses/>.
+
+function PageRegister(client, formateur, util)
+{
+   this.nom = "register"
+   
+   this.client = client
+   this.formateur = formateur
+   this.util = util
+}
+
+PageRegister.prototype.contenu = function()
+{
+   return '\
+<form action="" id="register" >\
+ <table>\
+  <tr>\
+   <td>login</td>\
+   <td><input class="login" type="text" size="20" maxlength="20"/><input class="captcha" name="captcha" type="text" size="12"></input></td>\
+  </tr>\
+  <tr>\
+   <td>password</td>\
+   <td><input class="password" type="password" size="20" maxlength="20"/></td>\
+  </tr>\
+  <tr>\
+   <td>password re</td>\
+   <td><input class="passwordRe" type="password" size="20" maxlength="20"/></td>\
+  </tr>\
+  <tr>\
+  <td></td>\
+  <td><button>valider</button>\
+  </tr>\
+ </table>\
+</form>'
+}
+
+PageRegister.prototype.charger = function()
+{      
+   $("#page form#register").submit(function(){return false})
+      
+   var thisPage = this
+   
+   $("#page form#register button").click(
+      function()
+      {         \r
+         if ($("#page form#register input.captcha").val() != "") return\r
+         
+         var login = $("#page form#register input.login").val().trim()
+         var password = $("#page form#register input.password").val()
+         var passwordRe = $("#page form#register input.passwordRe").val()         
+         
+         if (login == "")
+            thisPage.util.messageDialogue("Le login ne doit pas être vide")
+         else if (password == "" && passwordRe == "")
+            thisPage.util.messageDialogue("Un mot de passe est obligatoire")
+         else if (password != passwordRe)
+            thisPage.util.messageDialogue("Les mots de passes ne correspondent pas")
+         else if(thisPage.client.enregistrement(login, thisPage.util.md5(password)))
+         {   
+            // TODO : avertir que l'enregistrement s'est bien déroulé
+            thisPage.util.messageDialogue("Enregistrement réussi")
+            thisPage.pages.afficherPage("minichat")
+         }
+      }
+   )
+}
\ No newline at end of file
diff --git a/modules/Makefile b/modules/Makefile
new file mode 100755 (executable)
index 0000000..731cd71
--- /dev/null
@@ -0,0 +1,56 @@
+# Répertoire dans lequel se trouve les modules compilés (beam)\r
+rep_ebin = ebin\r
+\r
+# Répertoire dans lequel se trouve les fichiers sources\r
+rep_erl = erl\r
+\r
+# Répertoire dans lequel se trouve les fichier hrl (définition de record)\r
+rep_include = include\r
+\r
+# Paramètre du compilateur\r
+erlc_params = -I $(rep_include) -o $(rep_ebin) $<\r
+\r
+# Compilation de toute l'application euphorik\r
+all: $(rep_ebin)/euphorik_bd.beam \
+$(rep_ebin)/euphorik_minichat_conversation.beam \\r
+$(rep_ebin)/euphorik_requests.beam \\r
+$(rep_ebin)/euphorik_protocole.beam \
+$(rep_ebin)/euphorik_daemon.beam \
+$(rep_ebin)/euphorik_common.beam \
+$(rep_ebin)/euphorik_test.beam
+\r
+# Module pour la gestion des données persistante la BD\r
+$(rep_ebin)/euphorik_bd.beam: $(rep_erl)/euphorik_bd.erl $(rep_include)/euphorik_bd.hrl $(rep_include)/euphorik_defines.hrl\r
+       erlc $(erlc_params)\r
+
+# Module permettant l'extraction des conversations du minichat
+$(rep_ebin)/euphorik_minichat_conversation.beam: $(rep_erl)/euphorik_minichat_conversation.erl $(rep_include)/euphorik_bd.hrl
+       erlc $(erlc_params)\r
+       \r
+# Module traitant les requêtes AJAX du client javascript d'euphorik\r
+$(rep_ebin)/euphorik_requests.beam: $(rep_erl)/euphorik_requests.erl\r
+       erlc $(erlc_params)\r
+       \r
+# Module interpretant les messages XML du client\r
+$(rep_ebin)/euphorik_protocole.beam: $(rep_erl)/euphorik_protocole.erl $(rep_include)/euphorik_defines.hrl\r
+       erlc $(erlc_params)
+   
+# Module pour la génération du captcha\r
+#$(rep_ebin)/captcha.beam: $(rep_erl)/captcha.erl\r
+#      erlc $(erlc_params)
+      \r
+# Module effectuant periodiquement certaines tâches\r
+$(rep_ebin)/euphorik_daemon.beam: $(rep_erl)/euphorik_daemon.erl $(rep_include)/euphorik_defines.hrl\r
+       erlc $(erlc_params)
+   
+# Module avec plein de bordel dedant
+$(rep_ebin)/euphorik_common.beam: $(rep_erl)/euphorik_common.erl
+       erlc $(erlc_params)
+   
+# Module dédié au tests
+$(rep_ebin)/euphorik_test.beam: $(rep_erl)/euphorik_test.erl $(rep_erl)/euphorik_bd.erl $(rep_include)/euphorik_bd.hrl
+       erlc $(erlc_params)\r
+\r
+# Suppression des modules compilés\r
+clean:\r
+       rm ebin/*.beam
diff --git a/modules/erl/euphorik_bd.erl b/modules/erl/euphorik_bd.erl
new file mode 100755 (executable)
index 0000000..b72d7a8
--- /dev/null
@@ -0,0 +1,948 @@
+% coding: utf-8\r
+% Copyright 2008 Grégory Burri\r
+%\r
+% This file is part of Euphorik.\r
+%\r
+% Euphorik is free software: you can redistribute it and/or modify\r
+% it under the terms of the GNU General Public License as published by\r
+% the Free Software Foundation, either version 3 of the License, or\r
+% (at your option) any later version.\r
+%\r
+% Euphorik is distributed in the hope that it will be useful,\r
+% but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+% GNU General Public License for more details.\r
+%\r
+% You should have received a copy of the GNU General Public License\r
+% along with Euphorik.  If not, see <http://www.gnu.org/licenses/>.\r
+% 
+% Ce module permet de gérer les données persistantes lié au site d'euphorik.ch.
+% Il permet d'ajouter des message, de demande les messages sur une page donnée, etc..
+% Ce module utilise une base mnesia.
+% @author G.Burri\r
+
+
+-module(euphorik_bd).\r
+-export([
+   % gestion :
+   create/0,
+   connect/0,
+   connect/1,
+   reset/0,
+   update/0,
+   
+   % users :
+   nouveau_user/2,
+   nouveau_user/3,
+   set_profile/11,
+   update_date_derniere_connexion/1,
+   update_ip/2,
+   update_pseudo_user/2,
+   print_users/0,
+   print_users/1,
+   print_user/1,
+   user_by_cookie/1,   
+   user_by_id/1,   
+   user_by_login/1,
+   user_by_login_password/2,
+   user_by_mess/1,
+   toggle_ek_master/1,
+   css_from_user_cookie/1,
+   
+   % messages :
+   nouveau_message/3,
+   nouveau_message_sys/1,
+   nouveau_message_sys/2,
+   messages/1,
+   messages/2,\r
+   messages/3,
+   message_by_id/1,
+   messages_by_ids/1,
+   message_existe/1,
+   reponses/0,
+   repond_a/1,
+   est_une_reponse_a_user/2,
+   a_repondu_a_message/2,
+   possede_message/2,
+   
+   % ip :
+   list_ban/0,
+   ban/2,
+   deban/1,
+   est_banni/1,
+   can_register/1,
+   
+   % trolls :
+   trolls/0,
+   trolls/1,
+   put_troll/2,
+   mod_troll/2,
+   del_troll/1,
+   troll_by_id/1,
+   current_troll/0,
+   elire_troll/0,
+   message_id_associe/1,
+   
+   % versions :
+   update_version/1,
+   
+   % utiles :
+   resultat_transaction/1\r
+]).
+-import(qlc, [e/2, q/1, cursor/2]).\r
+-include("../include/euphorik_bd.hrl").
+-include("../include/euphorik_defines.hrl").\r
+-include_lib("stdlib/include/qlc.hrl").\r
+
+
+% Instructions pour créer une nouvelle base : 
+% $erl -sname yaws -mnesia dir '"/projets/euphorik/BD"'
+% voir doc/installation.txt
+% >l(euphorik_bd).
+% >euphorik_bd:create().
+create() ->
+   mnesia:stop(),
+   mnesia:delete_schema([node()]),
+   mnesia:create_schema([node()]), % nécessaire pour les tables sur disc
+   mnesia:start(),
+   create_tables(),
+   reset().
+   
+create_tables() ->
+   mnesia:create_table(counter, [
+      {attributes, record_info(fields, counter)},
+      {disc_copies, [node()]}
+   ]),
+   mnesia:create_table(proprietes, [
+      {attributes, record_info(fields, proprietes)},
+      {disc_copies, [node()]}
+   ]),
+   mnesia:create_table(minichat, [
+      {attributes, record_info(fields, minichat)},
+      {index, [auteur_id, troll_id]},
+      {disc_copies, [node()]}
+   ]),
+   mnesia:create_table(reponse_minichat, [
+      {type, bag},
+      {attributes, record_info(fields, reponse_minichat)},
+      {index, [cible]},
+      {disc_copies, [node()]}
+   ]),
+   mnesia:create_table(user, [
+      {attributes, record_info(fields, user)},
+      {index, [cookie, login]},
+      {disc_copies, [node()]}
+   ]),
+   mnesia:create_table(ip_table, [
+      {attributes, record_info(fields, ip_table)},
+      {disc_copies, [node()]}
+   ]),
+   mnesia:create_table(troll, [
+      {attributes, record_info(fields, troll)},
+      {index, [date_post]},
+      {disc_copies, [node()]}
+   ]).
+   
+   
+% Connexion à la base de données de yaws sur overnux
+connect() ->
+   connect(yaws@flynux).
+connect(Node) ->
+   mnesia:start(),
+   mnesia:change_config(extra_db_nodes, [Node]).
+
+
+% Efface tous les users, minichat_reponse et minichat.\r
+reset() ->\r
+   mnesia:clear_table(counter),
+   mnesia:clear_table(proprietes),\r
+   mnesia:clear_table(user),\r
+   mnesia:clear_table(reponse_minichat),\r
+   mnesia:clear_table(minichat),
+   mnesia:clear_table(troll),
+   mnesia:clear_table(ip_table),\r
+   % crée l'utilisateur root\r
+   mnesia:transaction(fun() ->
+      mnesia:write(#proprietes{nom = version, valeur = ?VERSION_BD}),\r
+      User = #user{id = 0, pseudo = "Sys", login = "Sys", date_creation = now(), date_derniere_connexion = now(), ek_master = true},\r
+      mnesia:write(User),\r
+      User\r
+   end).
+
+
+% Met à jour la bd, compare ?VERSION_BD avec la version dans la table 'proprietes'
+% et exécute les patchs nécessaires.
+update() ->
+   mnesia:transaction(
+      fun() ->
+         case mnesia:read({proprietes, version}) of
+            [#proprietes{nom = Version}] ->
+               update(Version);
+            _ ->
+               erreur
+         end
+      end
+   ).
+   
+
+% Mise à jour de la BD.
+% attention : il est nécessaire de se trouver dans une transaction.
+update(?VERSION_BD) -> fini;
+update(Version) ->
+   patch(Version),
+   update(Version + 1).
+   
+   
+% Applique une modification de la BD pour passer d'une version à la suivante.
+% 1 -> 2
+patch(1) ->
+   ok.
+% 2 -> 3
+%patch(2) ->
+
+
+% Ajoute un nouveau user et le renvoie
+nouveau_user(Pseudo, Cookie) ->
+   F = fun() ->
+      Id = nouvel_id(user),
+      User = #user{id = Id, cookie = Cookie, pseudo = Pseudo, date_creation = now(), date_derniere_connexion = now()},
+      mnesia:write(User),
+      User
+   end,
+  resultat_transaction(mnesia:transaction(F)).
+  
+  
+% Ajoute un nouveau user et le renvoie
+nouveau_user(Login, Password, Cookie) ->
+   F = fun() ->
+      Id = nouvel_id(user),
+      User = #user{id = Id, cookie = Cookie, pseudo = Login, login = Login, password = Password, date_creation = now(), date_derniere_connexion = now()},
+      mnesia:write(User),
+      User
+   end,
+  resultat_transaction(mnesia:transaction(F)).
+
+
+% Mise à par Cookie les autres peuvent être undefined ce qui veut dire qu'ils ne seront pas modifié.
+set_profile(Cookie, Login, Password, Pseudo, Email, Css, Nick_format, View_times, View_tooltips, Page_principale, Conversations) ->
+   if Nick_format =:= nick; Nick_format =:= login; Nick_format =:= nick_login ->
+         resultat_transaction(mnesia:transaction(
+            fun() ->
+               case user_by_cookie(Cookie) of
+                  {ok, User} ->
+                     case user_by_login(Login) of
+                        {ok, U} when Login =/= [], U#user.id =/= User#user.id ->
+                           login_deja_pris;
+                        _ ->
+                           User_modifie = User#user{
+                              % TODO : pourquoi ne pas tester avec la valeur "undefined" plutôt qu'avec "is_list" ?
+                              % TODO : validation plus strict des données (pas de page négative dans les conv par exemple)
+                              login = if is_list(Login) -> Login; true -> User#user.login end,
+                              password = if is_list(Password) andalso Password =/= [] -> Password; true -> User#user.password end,
+                              pseudo = if is_list(Pseudo) -> Pseudo; true -> User#user.pseudo end,
+                              email = if is_list(Email) -> Email; true -> User#user.email end,
+                              css = if is_list(Css) -> Css; true -> User#user.css end,
+                              nick_format = Nick_format,
+                              view_times = View_times,
+                              view_tooltips = View_tooltips,
+                              page_principale = if is_integer(Page_principale), Page_principale > 0 -> Page_principale; true -> User#user.page_principale end,
+                              conversations = if is_list(Conversations) -> Conversations; true -> User#user.conversations end
+                           },
+                           mnesia:write(User_modifie),
+                           ok
+                     end;
+                  _ -> erreur
+               end
+            end
+         ));
+      true ->
+         erreur
+   end.
+
+
+% Met à jour la date de la dernière connexion d'un utilisateur à maintenant
+update_date_derniere_connexion(User_id) ->
+   mnesia:transaction(
+      fun() ->
+         case mnesia:wread({user, User_id}) of
+            [User] ->
+               mnesia:write(User#user{date_derniere_connexion = now()});
+            _ ->
+               mnesia:abort("update_date_derniere_connexion: User inconnu")
+          end
+      end
+   ).   
+
+
+% Met à jour l'ip d'un user
+update_ip(User_id, IP) ->
+   mnesia:transaction(
+      fun() ->
+         case mnesia:wread({user, User_id}) of
+            [User] ->
+               mnesia:write(User#user{last_ip = IP});
+            _ ->
+               mnesia:abort("update_ip: User inconnu")
+          end
+      end
+   ).   
+   
+  
+% Met à jour le pseudo du user
+update_pseudo_user(UserId, Pseudo) ->
+   mnesia:transaction(
+      fun() ->      
+         case mnesia:wread({user, UserId}) of
+            [User] when User#user.pseudo =/= Pseudo ->
+               mnesia:write(User#user{pseudo = Pseudo});
+            _ ->
+               mnesia:abort("update_pseudo_user: User inconnu ou pseudo deja à jour")
+          end
+      end
+   ).
+   
+   
+% Affiche N user trié par leur date de dernière connexion.
+% Opt est une liste d'option d'affichage :
+%  * ekmaster : n'affiche que les admins
+print_users(N, Opt) ->
+   AfficheQueLesEkMaster = lists:any(fun(O) -> O =:= ekmaster end, Opt),
+   resultat_transaction(mnesia:transaction(fun() ->
+      C = cursor(
+         qlc:keysort(
+            #user.date_derniere_connexion, 
+            if AfficheQueLesEkMaster ->
+               q([E || E <- mnesia:table(user), E#user.ek_master =:= true]);
+            true ->
+               q([E || E <- mnesia:table(user)])
+            end,
+            [{order, descending}]
+         ),
+         [{tmpdir, ?KEY_SORT_TEMP_DIR}]
+      ),
+      Users = qlc:next_answers(C, N),
+      lists:foreach(
+         fun(U) ->
+            print_user(U)
+         end,
+         Users
+      ),
+      qlc:delete_cursor(C)
+   end)).
+   
+   
+% Affiche tous les users.
+print_users(Opt) ->
+   print_users(all_remaining, Opt).
+
+% Affiche tous les users.
+print_users() ->
+   print_users(all_remaining, []).
+   
+print_user(User) when is_record(User, user) ->
+   #user{id = Id, pseudo = Pseudo, login = Login, ek_master = Ek_master, date_derniere_connexion = Date, last_ip = IP} = User,
+   {{Annee, Mois, Jour}, {Heure, Min, _}} = calendar:now_to_local_time(Date),
+   io:format(
+      % id        pseudo     (login)        IP  Jour  Mois   Année  Heure Minute
+      "~4w : ~10.10..s(~10.10..s) ~s ~2w.~2.2.0w.~w - ~2wh~2.2.0w~n",
+      [  
+         Id,
+         if Ek_master -> "*"; true -> "" end ++ Pseudo,
+         Login,
+         euphorik_common:serialize_ip(IP),
+         Jour, Mois, Annee, Heure, Min
+      ]
+   );
+% Affichage d'un user en fonction de son login
+print_user(Login) when is_list(Login) ->
+   case user_by_login(Login) of
+      {ok, User} ->
+         print_user(User);
+      _ ->
+         {erreur, "Login pas trouvé : " ++ Login}
+   end;
+% Affichage d'un user en fonction de son id
+print_user(Id) when is_integer(Id) -> 
+   case user_by_id(Id) of 
+      {ok, User} ->
+         print_user(User);
+      _ ->
+         {erreur, "Id pas trouvé : " ++ integer_to_list(Id)}
+   end.
+   
+
+% Est-ce qu'un utilisateur existe en fonction de son cookie ?
+% Renvoie {ok, User} ou erreur
+user_by_cookie(Cookie) ->
+   resultat_transaction(mnesia:transaction(
+      fun() ->
+         case e(q([E || E <- mnesia:table(user), E#user.cookie =:= Cookie]), [{tmpdir, ?KEY_SORT_TEMP_DIR}]) of
+            [User] -> {ok, User};
+            _ -> erreur
+         end
+      end
+   )).
+   
+   
+user_by_id(ID) ->
+   resultat_transaction(mnesia:transaction(
+      fun() ->
+         case e(q([E || E <- mnesia:table(user), E#user.id =:= ID]), [{tmpdir, ?KEY_SORT_TEMP_DIR}]) of
+            [User] -> {ok, User};
+            _ -> erreur
+         end
+      end
+   )).
+   \r
+   \r
+user_by_login(Login) ->\r
+   resultat_transaction(mnesia:transaction(\r
+      fun() ->\r
+         Users = e(q([E || E <- mnesia:table(user), E#user.login =:= Login]), [{tmpdir, ?KEY_SORT_TEMP_DIR}]),\r
+         case Users of\r
+            [User] -> {ok, User};\r
+            _ -> erreur\r
+         end\r
+      end\r
+   )).\r
+   
+   
+toggle_ek_master(User_id) ->
+   resultat_transaction(mnesia:transaction(
+      fun() ->
+         Users = e(q([E || E <- mnesia:table(user), E#user.id =:= User_id]), [{tmpdir, ?KEY_SORT_TEMP_DIR}]),
+         case Users of
+            [User] ->
+               mnesia:write(User#user{ek_master = not User#user.ek_master});
+            _ -> erreur
+         end
+      end
+   )).
+   
+
+% Renvoie une chaine représentant le cookie ou undefined si pas trouvé.
+css_from_user_cookie(Cookie) ->
+   case user_by_cookie(Cookie) of 
+      {ok, User} ->
+         User#user.css;
+      _ ->
+         undefined
+   end.
+   
+
+user_by_login_password(Login, Password) ->
+   resultat_transaction(mnesia:transaction(
+      fun() ->
+         case e(q([E || E <- mnesia:table(user), E#user.login =:= Login, E#user.password =:= Password]), [{tmpdir, ?KEY_SORT_TEMP_DIR}]) of
+            [User | _] -> {ok, User};
+            _ -> erreur
+         end
+      end
+   )).
+   
+   
+% Renvoie {ok, User} où User est un #user possédant le message donné.
+user_by_mess(Id) ->
+   resultat_transaction(mnesia:transaction(
+      fun() ->
+         case e(q([U || U <- mnesia:table(user), M <- mnesia:table(minichat), M#minichat.id =:= Id, M#minichat.auteur_id =:= U#user.id]), [{tmpdir, ?KEY_SORT_TEMP_DIR}]) of
+            [User | _] -> {ok, User};
+            _ -> erreur
+         end
+      end
+   )).\r
+   \r
+   
+% Ajoute un message. Repond_A est une liste d'id auquel le message répond
+% retourne soit l'id du message soit {erreur, <raison>}.
+nouveau_message(Mess, Auteur_id, Repond_A) ->
+   % regarde si les id 'Repond_A' existent
+   F = fun() ->   
+      Nb_id_trouve = length(e(q([E#minichat.id || E <- mnesia:table(minichat), lists:member(E#minichat.id, Repond_A)]), [{tmpdir, ?KEY_SORT_TEMP_DIR}])),
+      % est-ce que l'auteur existe ?
+      Auteur = case e(q([E || E <- mnesia:table(user), E#user.id =:= Auteur_id]), [{tmpdir, ?KEY_SORT_TEMP_DIR}]) of
+         [A] -> A;
+         _ -> {erreur, "L'auteur du message est introuvable"}
+      end,
+      if Nb_id_trouve =/= length(Repond_A) ->
+            {erreur, "Un ou plusieurs messages introuvable"};
+         true ->
+            % comparaison entre la date du dernier poste et maintenant (gestion du flood)
+            Delta = delta_date_ms(Auteur#user.date_derniere_connexion, now()),
+            Nouvel_indice_flood = Auteur#user.indice_flood + if Delta =< ?DUREE_SPAM -> 2; true -> -1 end,
+            Auteur_maj = Auteur#user{
+               indice_flood = if Nouvel_indice_flood > ?INDICE_SPAM_MAX -> ?INDICE_SPAM_MAX; Nouvel_indice_flood < 0 -> 0; true -> Nouvel_indice_flood end,
+               date_derniere_connexion = now()
+            },
+            % est-ce que l'auteur à trop floodé ?
+            if Auteur#user.indice_flood =/= ?INDICE_SPAM_MAX, Auteur_maj#user.indice_flood =:= ?INDICE_SPAM_MAX, Delta =< ?DUREE_BLOCAGE_SPAM ->
+               mnesia:write(Auteur#user{indice_flood = Auteur_maj#user.indice_flood}),
+               nouveau_message_sys("''" ++ Auteur#user.pseudo ++ if Auteur#user.login =/= [] -> " (" ++ Auteur#user.login ++ ")"; true -> "" end ++ "'' est bloqué pour " ++ integer_to_list(trunc(?DUREE_BLOCAGE_SPAM / 1000)) ++ " secondes pour cause de flood.");
+            Auteur#user.indice_flood =:= ?INDICE_SPAM_MAX, Delta =< ?DUREE_BLOCAGE_SPAM ->
+               {erreur, "Bloqué pour cause de flood"};
+            true ->     
+               mnesia:write(Auteur_maj),
+               Id = nouvel_id(minichat),
+               inserer_reponses(Id, Repond_A),
+               mnesia:write(#minichat{id=Id, auteur_id=Auteur#user.id, date=now(), pseudo=Auteur#user.pseudo, contenu=Mess}),
+               Id
+            end
+      end
+   end,
+   resultat_transaction(mnesia:transaction(F)).
+   
+% Définit Id_repondant comme étant la réponse à Ids. Ids est une liste d'id.
+inserer_reponses(Id_repondant, [Id_mess | Reste]) ->
+   mnesia:write(#reponse_minichat{repondant = Id_repondant, cible = Id_mess}),
+   inserer_reponses(Id_repondant, Reste);
+inserer_reponses(_, []) ->
+   ok.
+   
+% Permet de créer un message système.
+% Renvoie l'id du message système
+nouveau_message_sys(Mess) ->
+   nouveau_message_sys(Mess, undefined).
+   
+
+% Création d'un message système lié à un troll.
+nouveau_message_sys(Mess, Troll_id) ->
+   {ok, Root} = user_by_id(0),
+   resultat_transaction(mnesia:transaction(
+      fun() ->
+         Id = nouvel_id(minichat),
+         mnesia:write(#minichat{id=Id, auteur_id=0, date=now(), pseudo=Root#user.pseudo, contenu=Mess, troll_id=Troll_id}),
+         Id
+      end
+   )).
+   
+   
+% Renvoie N messages se trouvant sur la première page
+messages(N) ->  
+   messages(N, 1).
+
+
+% Renvoie N messages se trouvant sur la page P
+messages(N, P) ->
+   F = fun() ->
+      C = cursor(
+         qlc:keysort(
+            #minichat.id, 
+            q([E#minichat{contenu = contenu_message(E)} || E <- mnesia:table(minichat)]),
+            [{order, descending}]
+         ),
+         [{tmpdir, ?KEY_SORT_TEMP_DIR}]
+      ),
+      if P > 1 -> qlc:next_answers(C, N * (P - 1));
+         true -> ok
+      end,
+      R = qlc:next_answers(C, N),
+      qlc:delete_cursor(C),
+      lists:reverse(R)
+   end,
+   resultat_transaction(mnesia:transaction(F)).
+
+
+% Renvoie les messages manquants pour la page P en sachant qu'il y a N message
+% par page et que le dernier message que l'on possède est Id
+messages(Id, N, P) ->
+   lists:filter(fun (M) -> M#minichat.id > Id end, messages(N, P)).
+   
+   
+% Renvoie {ok, #minichat} (voir #minichat de euphorik_bd.hrl) à partir de son id.
+message_by_id(Id) ->
+   resultat_transaction(mnesia:transaction(
+      fun() ->
+         case mnesia:read({minichat, Id}) of
+            [] -> erreur;
+            [M] ->
+               {ok, M#minichat{contenu = contenu_message(M)}}
+         end
+      end
+   )).
+   
+   
+% Renvoie le contenu d'un message donnée, à utiliser à l'intérieur d'une transaction.
+% TODO : Cette fonction pourrait être remplacé par un "outer-join", est-ce possible avec qlc ?
+contenu_message(E) ->
+   case mnesia:read({troll, E#minichat.troll_id}) of
+      [] -> E#minichat.contenu;
+      [T] -> E#minichat.contenu ++ T#troll.content
+   end.
+  
+
+% Renvoie une liste de message (voir #minichat de euphorik_bd.hrl) à partir d'une liste d'id (Ids).
+% TODO : optimisations ? serait-ce du O(n) ?
+% Bon de toutes façons on s'en fout c'est pas utilisé :)
+messages_by_ids(Ids) ->
+   resultat_transaction(mnesia:transaction(
+      fun() ->
+         e(qlc:keysort(
+            #minichat.id,
+            q([E || E <- mnesia:table(minichat), lists:any(fun(Id) -> Id =:= E#minichat.id end, Ids)]),
+            [{order, ascending}]
+         ),[{tmpdir, ?KEY_SORT_TEMP_DIR}])
+      end
+   )).
+   
+
+% Est-ce qu'un message existe ? Renvoie un boolean.
+% TODO : ya pas plus simple ?
+message_existe(Id) ->
+   resultat_transaction(mnesia:transaction(fun() ->
+      length(e(q([E#minichat.id || E <- mnesia:table(minichat), E#minichat.id =:= Id]), [{tmpdir, ?KEY_SORT_TEMP_DIR}])) =:= 1
+   end)).
+   
+   
+% Renvoie les reponses (utilisé normalement uniquement pendant le debug).
+reponses() ->
+   F = fun() ->
+      e(q([E || E <- mnesia:table(reponse_minichat)]), [{tmpdir, ?KEY_SORT_TEMP_DIR}])
+   end,
+   resultat_transaction(mnesia:transaction(F)).
+   
+   
+% Renvoie les messages auquel M_id répond.
+repond_a(M_id) ->
+   resultat_transaction(mnesia:transaction(
+      fun() ->
+         e(q(
+            [M || E <- mnesia:table(reponse_minichat),
+            M <- mnesia:table(minichat),
+            E#reponse_minichat.repondant =:= M_id,
+            M#minichat.id =:= E#reponse_minichat.cible]), [{tmpdir, ?KEY_SORT_TEMP_DIR}])
+      end
+   )).
+   
+
+% Est-ce que le message Id_mess est une réponse d'une message de Id_user ?
+est_une_reponse_a_user(Id_user, Id_mess) ->
+   case mnesia:transaction(
+            fun() ->
+               e(q([
+                  M#minichat.auteur_id || M <- mnesia:table(minichat), R <- mnesia:table(reponse_minichat),
+                  M#minichat.auteur_id =:= Id_user, M#minichat.id =:= R#reponse_minichat.cible, R#reponse_minichat.repondant =:= Id_mess
+               ]), [{unique_all, true}, {tmpdir, ?KEY_SORT_TEMP_DIR}])
+            end
+         ) of
+      {atomic, [_]} -> true;
+      _ -> false
+   end.
+
+   
+% Est-ce que Id_user à répondu au message Id_mess
+a_repondu_a_message(Id_user, Id_mess) ->
+   case mnesia:transaction(
+            fun() ->
+               e(q([
+                  M#minichat.auteur_id || M <- mnesia:table(minichat), R <- mnesia:table(reponse_minichat),
+                  R#reponse_minichat.cible =:= Id_mess, R#reponse_minichat.repondant =:= M#minichat.id, M#minichat.auteur_id =:= Id_user
+               ]), [{unique_all, true}, {tmpdir, ?KEY_SORT_TEMP_DIR}])
+            end
+         ) of
+      {atomic, [_]} -> true;
+      _ -> false
+   end.
+   
+   \r
+% Est-ce que Id_user possède Id_mess ?
+possede_message(Id_user, Id_mess) ->
+   case mnesia:transaction(
+            fun() ->
+               e(q([E#minichat.auteur_id || E <- mnesia:table(minichat), E#minichat.id =:= Id_mess]), [{tmpdir, ?KEY_SORT_TEMP_DIR}])
+            end
+         ) of
+      {atomic, [Id_user | []]} -> true;
+      _ -> false
+   end.
+   
+   
+% renvoie la liste des ip bannies
+% liste de {ip, temps_restant(en minutes), Users} ou Users est une liste de {pseudo, login}
+% TODO : déterminer la complexité de cette fonction. (Il n'y a pas d'index sur #user.last_ip)
+list_ban() ->
+   resultat_transaction(mnesia:transaction(
+      fun() ->
+         Now = now(),
+         e(qlc:keysort(1, q([
+            {
+               IP#ip_table.ip,
+               delta_date_minute(date_plus_minutes(IP#ip_table.ban, IP#ip_table.ban_duration), Now),
+               e(q([{U#user.pseudo, U#user.login} || U <- mnesia:table(user), U#user.last_ip =:= IP#ip_table.ip]), [{tmpdir, ?KEY_SORT_TEMP_DIR}])
+            } ||
+            IP <- mnesia:table(ip_table),
+            if IP#ip_table.ban =:= undefined -> false; true -> date_plus_minutes(IP#ip_table.ban, IP#ip_table.ban_duration) > Now end
+         ])), [{tmpdir, ?KEY_SORT_TEMP_DIR}])
+      end
+   )).
+
+
+% Bannie une ip pour un certain temps (en minute).
+ban(IP, Duration) ->
+   mnesia:transaction(
+      fun() ->
+         case mnesia:wread({ip_table, IP}) of
+            [IP_tuple] ->
+               mnesia:write(IP_tuple#ip_table{ban = now(), ban_duration = Duration});
+            _ ->
+               mnesia:write(#ip_table{ip = IP, ban = now(), ban_duration = Duration})
+          end
+      end
+   ).
+   
+
+% Débanni une ip
+deban(IP) ->
+   ban(IP, 0).
+
+   
+% Renvoie soit {true, Temps} où Temps est le temps en minutes pendant lequel le user est encore banni
+% ou false.
+est_banni(User_id) ->
+   resultat_transaction(mnesia:transaction(
+      fun() ->
+         case e(q([
+            {IP#ip_table.ban, IP#ip_table.ban_duration} ||
+            U <- mnesia:table(user),
+            U#user.id =:= User_id,
+            IP <- mnesia:table(ip_table),
+            IP#ip_table.ip =:= U#user.last_ip
+         ]), [{tmpdir, ?KEY_SORT_TEMP_DIR}]) of
+            [{Ban, Ban_duration}] ->
+               Echeance = date_plus_minutes(Ban, Ban_duration),
+               Now = now(),
+               if Echeance < Now -> % l'échéance est passée
+                     false;
+                  true ->
+                     {true, delta_date_minute(Echeance, Now)}
+               end;
+            _ ->
+               false
+         end
+      end
+   )).
+   
+   
+% Ban est une date tel que retourner par now().
+% Ban_duration est un temps en minutes.
+% retourne une date.
+date_plus_minutes(Ban, Ban_duration) ->
+   Duration_sec = Ban_duration * 60,
+   {MegaSec, Sec, MicroSec} = Ban,
+   {MegaSec + if Sec + Duration_sec >= 1000000 -> 1; true -> 0 end,(Sec + Duration_sec) rem 1000000, MicroSec}.
+   
+
+% Si deux enregistrements consequtifs de la même IP sont fait en moins d'une seconde alors 
+% ip_table.nb_try_register est incrémenté de 1 sinon il est décrémenté de 1 (jusqu'a 0).
+% Si ip_table.nb_try_register vaut 5 alors l'ip ne peux plus s'enregistrer pour une heure.
+can_register(IP) ->
+   resultat_transaction(mnesia:transaction(
+      fun() ->
+         case e(q([I || I <- mnesia:table(ip_table), I#ip_table.ip =:= IP]), [{tmpdir, ?KEY_SORT_TEMP_DIR}]) of
+            [] -> 
+               mnesia:write(#ip_table{ip = IP, date_last_try_register = now()}),
+               true;
+            [T] ->
+               Delta = delta_date_ms(T#ip_table.date_last_try_register, now()),
+               if T#ip_table.nb_try_register =:= ?NB_MAX_FLOOD_REGISTER, Delta < ?TEMPS_BAN_FLOOD_REGISTER ->
+                     false;
+                  true ->
+                     mnesia:write(#ip_table{
+                        ip = IP,
+                        date_last_try_register = now(),
+                        nb_try_register = T#ip_table.nb_try_register + if Delta < ?TEMPS_FLOOD_REGISTER -> 1; T#ip_table.nb_try_register > 0 -> -1; true -> 0 end
+                     }),
+                     true
+               end
+         end
+      end
+   )).
+   
+
+% Renvoie tous les trolls
+trolls() ->
+   resultat_transaction(mnesia:transaction(
+      fun() ->
+         e(qlc:keysort(#troll.id, q([T || T <- mnesia:table(troll)])), [{tmpdir, ?KEY_SORT_TEMP_DIR}])
+      end
+   )).
+   
+   
+% Renvoie les trolls manquants posté après Last_id.
+trolls(Last_id) ->
+   resultat_transaction(mnesia:transaction(
+      fun() ->
+         e(qlc:keysort(#troll.id, q([T || T <- mnesia:table(troll), T#troll.id > Last_id, T#troll.date_post =:= undefined])), [{tmpdir, ?KEY_SORT_TEMP_DIR}])
+      end
+   )).
+   
+ % Crée un nouveau troll.
+ % Renvoie l'id du nouveau troll
+ % ou max_troll_reached_per_user si le nombre de troll posté par l'utilisateur max a été atteind
+ % ou max_troll_reached si le nombre de troll posté max a été atteind
+ % ou user_unknown
+put_troll(User_id, Content) ->
+   resultat_transaction(mnesia:transaction(
+      fun() ->
+         % control le nombre de troll déjà posté
+         Nb_troll_poste_par_user = length(e(q(
+            [
+               E#troll.id || E <- mnesia:table(troll),
+               E#troll.id_user =:= User_id,
+               E#troll.date_post =:= undefined
+            ]
+         ), [{tmpdir, ?KEY_SORT_TEMP_DIR}])),
+         Nb_troll_poste_total = length(e(q(
+            [
+               E#troll.id || E <- mnesia:table(troll),
+               E#troll.date_post =:= undefined
+            ]
+         ), [{tmpdir, ?KEY_SORT_TEMP_DIR}])),
+         User = user_by_id(User_id),
+         case User of
+            {ok, _} ->
+               if Nb_troll_poste_par_user >= ?NB_MAX_TROLL_WAITING_BY_USER ->
+                     max_troll_reached_per_user;
+                  Nb_troll_poste_total >= ?NB_MAX_TROLL_WAITING ->
+                     max_troll_reached;
+                  true ->
+                     Id = nouvel_id(minichat),
+                     mnesia:write(#troll{id = Id, id_user = User_id, date_create = now(), content = Content}),
+                     Id
+               end;
+            _ ->
+               user_unknown
+         end
+      end
+   )).
+
+
+% renvoie ok | erreur
+mod_troll(Troll_id, Content) ->
+   mnesia:transaction(
+      fun() ->
+         case mnesia:wread({troll, Troll_id}) of
+            [Troll = #troll{date_post = undefined}] ->
+               mnesia:write(Troll#troll{content = Content});
+            _ ->
+               mnesia:abort("mod_troll: Troll inconnu ou déjà posté")
+          end
+      end
+   ).
+   
+   
+del_troll(Troll_id) ->
+   mnesia:transaction(
+      fun() ->
+         case mnesia:wread({troll, Troll_id}) of
+            [#troll{date_post = undefined}] ->
+               mnesia:delete({troll, Troll_id});
+            _ ->
+               mnesia:abort("mod_troll: Troll inconnu ou déjà posté")
+          end
+      end
+   ).
+troll_by_id(Troll_id) ->
+   resultat_transaction(mnesia:transaction(
+      fun() ->
+         case e(q([T || T <- mnesia:table(troll), T#troll.id =:= Troll_id]), [{tmpdir, ?KEY_SORT_TEMP_DIR}]) of
+            [T] -> {ok, T};
+            _ ->
+               erreur
+         end
+      end
+   )).
+   
+
+% Renvoie le troll actuel qui se trouve sur la page principale.
+% Renvois aucun si pas de troll courant.
+current_troll() ->
+   resultat_transaction(mnesia:transaction(
+      fun() ->
+         C = cursor(qlc:keysort(#troll.date_post, q([T || T <- mnesia:table(troll), T#troll.date_post =/= undefined]), [{order, descending}]), [{tmpdir, ?KEY_SORT_TEMP_DIR}]),
+         R = case qlc:next_answers(C, 1) of
+            [T] -> T;
+            _ -> aucun
+         end,
+         qlc:delete_cursor(C),
+         R
+      end
+   )).
+
+
+% Elit un troll au hasard parmis les trolls en attente (leur date_post =:= undefined)
+% Un message est posté par 'Sys' et le troll elu est lié à ce message
+% met à jour sa date de post.
+% renvoie plus_de_trolls si il n'y a aucun troll en attente.
+elire_troll() ->       
+   {A1,A2,A3} = now(),
+   random:seed(A1, A2, A3),
+   mnesia:transaction(
+      fun() ->
+         case e(q([T || T <- mnesia:table(troll), T#troll.date_post =:= undefined]), [{tmpdir, ?KEY_SORT_TEMP_DIR}]) of
+            [] ->
+               plus_de_trolls;
+            Trolls ->
+               Troll = lists:nth(random:uniform(length(Trolls)), Trolls),
+               Troll2 = Troll#troll{date_post = now()},
+               mnesia:write(Troll2),
+               nouveau_message_sys("Troll de la semaine : ", Troll2#troll.id)
+         end
+      end
+   ).
+   
+
+% Renvoie l'id du message associé au troll dont l'id est donnée.
+% Renvoie undefined si il n'y en a pas.
+message_id_associe(Troll_id) ->
+   resultat_transaction(mnesia:transaction(
+      fun() ->
+         case e(q([M#minichat.id || M <- mnesia:table(minichat), M#minichat.troll_id =:= Troll_id]), [{tmpdir, ?KEY_SORT_TEMP_DIR}]) of
+            [Id] -> Id;
+            _ -> undefined
+         end
+      end
+   )).
+      
+   
+update_version(1) ->
+   mnesia:transform_table(
+      ip_table,
+      fun() -> null end,
+      record_info(fields, ip_table),
+      ip_table
+   ).
+   
+   
+% Renvoie le résultat d'une transaction (en décomposant le tuple fournit)
+resultat_transaction({_, T}) ->
+   T.
+   
+
+% Retourne la difference entre deux timestamp (erlang:now()) en miliseconde
+delta_date_ms(D1, D2) ->
+   1000000000 * abs(element(1, D1) - element(1, D2)) + 1000 * abs(element(2, D1) - element(2, D2)) + trunc(abs(element(3, D1) - element(3, D2)) / 1000).
+
+% Retourne la différence entre deux timestamp (erlang:now) en minutes
+delta_date_minute(D1, D2) ->
+   trunc(delta_date_ms(D1, D2) / 1000 / 60).
+
+
+% Bizarre, cette fonction n'existe pas dans la stdlib.
+% Pas utilisé mais bon ca me fait de la peine de l'enlever.
+ceiling(X) ->
+   T = trunc(X),
+   case (X - T) of
+      Neg when Neg < 0 -> T;
+      Pos when Pos > 0 -> T + 1;
+      _ -> T
+   end.
+
+
+% Renvoie un nouvel id pour une table donnée
+nouvel_id(Table) ->
+   mnesia:dirty_update_counter(counter, Table, 1).\r
+   
\ No newline at end of file
diff --git a/modules/erl/euphorik_common.erl b/modules/erl/euphorik_common.erl
new file mode 100644 (file)
index 0000000..12ac9cb
--- /dev/null
@@ -0,0 +1,36 @@
+% coding: utf-8
+% Copyright 2008 Grégory Burri
+%
+% This file is part of Euphorik.
+%
+% Euphorik is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% Euphorik is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with Euphorik.  If not, see <http://www.gnu.org/licenses/>.
+% 
+% Module avec plein de bordel utile à l'intérieur
+% @author G.Burri
+
+-module(euphorik_common).
+-export([serialize_ip/1, unserialize_ip/1]).
+
+
+serialize_ip(undefined) ->
+   "<unknown IP>";
+serialize_ip(IP) ->
+   lists:flatten(io_lib:format("~w.~w.~w.~w", tuple_to_list(IP))).
+   
+   
+unserialize_ip(IP) ->
+   case io_lib:fread("~d.~d.~d.~d", IP) of
+      {ok, [A, B, C, D], []} -> {A, B, C, D};
+      _  -> erreur
+   end.
diff --git a/modules/erl/euphorik_daemon.erl b/modules/erl/euphorik_daemon.erl
new file mode 100755 (executable)
index 0000000..1813e0e
--- /dev/null
@@ -0,0 +1,63 @@
+% coding: utf-8\r
+% Copyright 2008 Grégory Burri\r
+%\r
+% This file is part of Euphorik.\r
+%\r
+% Euphorik is free software: you can redistribute it and/or modify\r
+% it under the terms of the GNU General Public License as published by\r
+% the Free Software Foundation, either version 3 of the License, or\r
+% (at your option) any later version.\r
+%\r
+% Euphorik is distributed in the hope that it will be useful,\r
+% but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+% GNU General Public License for more details.\r
+%\r
+% You should have received a copy of the GNU General Public License\r
+% along with Euphorik.  If not, see <http://www.gnu.org/licenses/>.\r
+% \r
+% Module tournant en background s'occupant periodiquement de certaines tâches :
+%  - sélection du prochain troll chaque semaine\r
+% Date : 05.11.2007
+% @author G.Burri\r
+\r
+\r
+-module(euphorik_daemon).
+-export([start/1, reload_euphorik/0]).
+-include("../include/euphorik_defines.hrl").
+
+
+% Démarre le démon
+start(_A) ->\r
+   loop().
+   \r
+   
+loop() ->
+   % on attend une minute de plus pour prevenir une dérive négative
+   timer:sleep(1000 * trunc(temps_prochaine_election() + 60)),
+   euphorik_bd:elire_troll(),\r
+   euphorik_daemon:loop().
+
+   
+% Renvoie le nombre de seconde qu'il reste jusque au prochain lundi à l'heure donnée (l'heure est sur 24heures)
+% 86400 est le nombre de seconde dans un jour
+temps_prochaine_election() ->
+   {Date, {H,M,S}} = calendar:local_time(),
+   Delta = (?JOUR_ELECTION_TROLL - 1) * 86400 + ?HEURE_ELECTION_TROLL * 60 * 60
+   -((calendar:day_of_the_week(Date) - 1) * 86400 + H * 60 * 60 + M * 60 + S),
+   % attention au cas où deux dates (maintenant et la date d'éction) ne se trouvent pas dans la même semaine.
+   if Delta =< 0 -> Delta + 7 * 86400; true -> Delta end.
+
+
+% Recharge tous les modules euphorik.
+% Appelé lors d'une mise en prod.
+% TODO : récupérer les noms à partir des .beam dans /modules/ebin
+reload_euphorik() ->
+   lists:foreach(
+      fun(M) ->
+         code:purge(M),
+         code:load_file(M)
+      end,
+      [euphorik_minichat_conversation, euphorik_protocole, euphorik_requests, euphorik_bd, euphorik_daemon]
+   ).
+   
\ No newline at end of file
diff --git a/modules/erl/euphorik_minichat_conversation.erl b/modules/erl/euphorik_minichat_conversation.erl
new file mode 100755 (executable)
index 0000000..6f2f2be
--- /dev/null
@@ -0,0 +1,241 @@
+% coding: utf-8\r
+% Copyright 2008 Grégory Burri\r
+%\r
+% This file is part of Euphorik.\r
+%\r
+% Euphorik is free software: you can redistribute it and/or modify\r
+% it under the terms of the GNU General Public License as published by\r
+% the Free Software Foundation, either version 3 of the License, or\r
+% (at your option) any later version.\r
+%\r
+% Euphorik is distributed in the hope that it will be useful,\r
+% but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+% GNU General Public License for more details.\r
+%\r
+% You should have received a copy of the GNU General Public License\r
+% along with Euphorik.  If not, see <http://www.gnu.org/licenses/>.\r
+% 
+% Ce module permet la gestion des conversations du minichat d'euphorik.
+% Un message (enfant) peut répondre à des messages (ses parents).
+% Un message (parent) peut avoir plusieurs réponses (enfants)
+% @author G.Burri
+% 
+% @type Message() = {integer(), [integer()]}
+% @type Conversation_detailee() = {[integer()], [integer()], [integer()], bool()}
+% @type Conversation = {[Message()] , bool()} bool() : si true alors il y a encore des messages dans les pages suivantes.
+\r
+
+-module(euphorik_minichat_conversation).\r
+-export([\r
+   conversations/4\r
+]).
+-include("../include/euphorik_bd.hrl").
+-include("../include/euphorik_defines.hrl").
+-include_lib("stdlib/include/qlc.hrl").
+-import(lists, [reverse/1, any/2, map/2, sublist/3, filter/2]).
+-import(euphorik_bd, [resultat_transaction/1]).
+-import(qlc, [e/2, q/1]).
+-import(mnesia, [table/1, transaction/1]).
+  
+   
+% Renvoie les conversations sous la forme d'une liste de conversation.
+% Chaque conversation est un tuple {[{Message, Parents}], Plus} où
+% Message est le message de type #minichat et Parents une liste d'Id.
+% Plus est un bool. Si Plus vaut true alors il y a encore des messages.
+% Si il n'y a pas de nouveaux message alors vide est renvoyé.
+% Chaque racine est un tuple {N, P,  D}
+% N : le nombre de message
+% D : le dernier message connu, 0 si aucun
+% P : la page souhaité, la premier est la 1
+% @spec conversations([{integer(), integer(), integer()}], integer(), integer(), integer()) -> [Conversation()]
+conversations(Racines, N, D, P) ->
+      Conversations = conversations_detailees(Racines, N, D, P),
+      % si les conversations sont vides alors on attend un nouveau message
+      Vide = not any(
+         fun(C) ->
+            case C of
+               {[], _} -> false;
+               {_, [], _, _} -> false;
+               _ -> true
+            end
+         end,
+         Conversations
+      ),
+      if Vide ->
+            vide;
+         true ->
+            mise_en_forme_conversations(Conversations)
+      end.
+     
+
+% Mise en forme des conversations pour l'utilisateur du module.
+% @spec mise_en_forme_conversations([[integer()] | Conversation_detailee()]) -> [Conversation()]
+mise_en_forme_conversations([]) -> [];
+mise_en_forme_conversations([{Principale, Plus_principale} | Conversations]) ->
+   [{mise_en_forme_conversation(Principale), Plus_principale} | map(fun({_, Cn, _, Plus}) -> {mise_en_forme_conversation(Cn), Plus} end, Conversations)].
+   
+   
+% Mise en forme d'une liste d'id de messages : [4, 5, 8, ...] -> [{4, [5, 6]}, ...].
+% Ajoute les parents de chaque message.
+% @spec mise_en_forme_conversation([integer()]) -> [{integer(), [integer()]}]
+mise_en_forme_conversation(Messages) ->
+   resultat_transaction(mnesia:transaction(
+      fun() ->
+         lists:foldr(
+            fun(Id, Acc) ->
+               case euphorik_bd:message_by_id(Id) of
+                  {ok, Message} ->
+                     [{Message, parents(Id)} | Acc];
+                  _ ->
+                     Acc
+               end
+            end,
+            [],
+            Messages
+         )
+      end
+   )).
+
+   
+% Renvoie une liste de conversations, le première élément correspond à la conversation principale.
+% Les autres éléments sont des tuples {C, Cn, X}, voir conversation/4 pour plus d'infos.
+% Racines est une liste de tuple {Id, P} des racines des conversations ou P est la page et Id l'id du message.
+% @spec conversations_detailees([{integer(), integer()}], integer(), integer(), integer()) -> [[integer()] | Conversation_detailee()]
+conversations_detailees(Racines, N, D, P) ->   
+   Conversations = map(fun({Racine, P_conv, Dernier}) -> conversation(Racine, N, Dernier, P_conv) end, Racines),
+   Conversation_principale = resultat_transaction(transaction(fun() ->
+      Curseur = qlc:cursor(
+         qlc:sort(q([E#minichat.id || E <- table(minichat)]), [{order, descending}]),
+         [{tmpdir, ?KEY_SORT_TEMP_DIR}]
+      ),
+      {CP, Plus} = conversation_principale(Curseur, Conversations, N, P),
+      qlc:delete_cursor(Curseur),
+      {[M || M <- CP, M > D], Plus} % filtre en fonction de D
+   end)),
+   [Conversation_principale | Conversations].
+   
+
+% Construit la conversation principale en fonction d'un curseur C initialement placé sur le dernier message
+% et la liste de conversations.
+% N est le nombre de messages que l'on souhaite.
+% P est le numéro de la page (1, 2, 3...)
+% @spec conversation_principale(qlc:QueryCursor(), [Conversation_detailee()], integer(), integer()) -> {[Id], Plus}
+conversation_principale(C, Conversations, N, P) ->
+   % on prend en message de plus pour savoir s'il y en a plus que ce que l'on désire
+   CP = reverse(conversation_principale2(C, lists:flatten(map(fun({C2, _, X, _}) -> C2 -- X end, Conversations)), N + 1, (P - 1) * N)),
+   Plus = length(CP) =:= N + 1,
+   {
+      if Plus ->
+         [_| Suivants] = CP,
+         Suivants;
+      true ->
+         CP
+      end,
+      Plus
+   }.
+      
+      
+% C est le curseur (voir ci dessus)
+% 'Messages' sont les messages que l'on doit enlever de la conversation
+% S est le nombre de messages qu'il faut sauter.
+% @spec conversation_principale2(qlc:QueryCursor(), [integer()], integer(), integer())
+conversation_principale2(_, _, 0, _) ->
+   [];
+conversation_principale2(C, Messages, N, S) ->
+   case qlc:next_answers(C, 1) of
+      [] -> [];
+      [M] -> % traitement message par message (pas des plus performant :/)
+         Doit_etre_saute = any(fun(E) -> E == M end, Messages),
+         if  Doit_etre_saute -> 
+               conversation_principale2(C, Messages, N, S); % le message ne fait pas partie de la conversation
+            S =:= 0 ->
+               [M | conversation_principale2(C, Messages, N - 1, S)]; % ok : le message fait partie de la conversation
+            true ->
+               conversation_principale2(C, Messages, N, S - 1) % on n'a pas encore atteint le début de la page
+         end
+   end.
+   
+   
+% Renvoie un tuple {C, Cn, X, Plus} où
+% C : La conversation complète
+% Cn : La conversation tronqué en fonction de N, D et P
+% X : La liste des messages répondant à des mess qui ne font pas partie de la conversation
+% Plus : true s'il y a encore des messages après
+% Inputs :
+% R : l'id d'un message représentant la racine de la conversation
+% N : le nombre de message par page
+% D : Le dernier message connu 0 si aucun de connu
+% P : La page désirée
+% @spec conversation([integer()], integer(), integer(), integer()) -> Conversation_detailee()
+conversation(R, N, D, P) ->
+   {C, X} = conversation([], [R], []),
+   Decalage = N * (P - 1) + 1,
+   {
+      reverse(C),
+      if Decalage > length(C) ->
+            [];
+         true ->
+            filter(
+               fun(E) -> E > D end,
+               reverse(sublist(C, Decalage, N))
+            )
+      end,
+      reverse(X),
+      Decalage + N - 1 < length(C) 
+   }.
+   
+   
+% Renvoie un tuple {C, X} où C est la conversation complète et X les messages répondant à des mess qui ne font pas partie de la conversation
+% Attention : les messages de C et de X sont ordrés du plus grand Id au plus petit.
+% @spec conversation([integer()], [integer()], [integer()]) -> {}
+conversation(Conv, [M | Reste], X) ->
+   Est_deja_traite = any(fun(E) -> E =:= M end, Conv),
+   if  Est_deja_traite ->
+         conversation(Conv, Reste, X);
+      true ->
+         Enfants = enfants(M),
+         Parents = parents(M),
+         % un message est dit externe si un de ses parent ne fait pas partie de la conversation ou si un de ses parents fait partie de X
+         Est_message_externe =  Parents -- Conv =/= [] orelse intersection(Parents, X) =/= [],
+         conversation([M | Conv], lists:merge(Reste, Enfants), if Est_message_externe -> [M | X]; true -> X end)
+   end;
+conversation(Messages, [], X) ->
+   {Messages, X}.
+   
+   
+% Renvoie les enfants d'un message M (les messages qui répondent à M)
+% ordrés du plus petit au plus grand.
+% @spec enfants(integer()) -> [integer()]
+enfants(M) ->
+   resultat_transaction(transaction(fun() ->
+      e(
+         qlc:sort(
+            q([E#reponse_minichat.repondant || E <- table(reponse_minichat), E#reponse_minichat.cible =:= M]),
+            [{order, ascending}]
+         ),
+         [{tmpdir, ?KEY_SORT_TEMP_DIR}]
+      )
+   end)).
+   
+   
+% Renvoie les parents d'un message M (les messages auquels répond M)
+% ordrés du plus petit au plus grand..
+% @spec parents(integer()) -> [integer()]
+parents(M) ->
+   resultat_transaction(transaction(fun() ->
+      e(
+         qlc:sort(
+            q([E#reponse_minichat.cible || E <- table(reponse_minichat), E#reponse_minichat.repondant =:= M]),
+            [{order, ascending}]
+         ),
+         [{tmpdir, ?KEY_SORT_TEMP_DIR}]
+      )
+   end)).
+   
+
+% Intersection entre deux listes : [1, 3, 4] n [2, 4, 7] = [4]
+% @spec intersection(list(term()), list(term())) -> list(term())
+intersection(L1, L2) ->
+   filter(fun(X) -> lists:member(X, L1) end, L2).
+
diff --git a/modules/erl/euphorik_protocole.erl b/modules/erl/euphorik_protocole.erl
new file mode 100755 (executable)
index 0000000..72a9157
--- /dev/null
@@ -0,0 +1,688 @@
+% coding: utf-8\r
+% Copyright 2008 Grégory Burri\r
+%\r
+% This file is part of Euphorik.\r
+%\r
+% Euphorik is free software: you can redistribute it and/or modify\r
+% it under the terms of the GNU General Public License as published by\r
+% the Free Software Foundation, either version 3 of the License, or\r
+% (at your option) any later version.\r
+%\r
+% Euphorik is distributed in the hope that it will be useful,\r
+% but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+% GNU General Public License for more details.\r
+%\r
+% You should have received a copy of the GNU General Public License\r
+% along with Euphorik.  If not, see <http://www.gnu.org/licenses/>.\r
+% 
+% Ce module gére les différents messages envoyés par le client (javascript) via AJAX.
+% Les messages donnés ainsi que les réponses sont au format JSON.
+% @author G.Burri
+\r
+
+-module(euphorik_protocole).
+-export([
+   register/2,
+   login/2,
+   logout/1,
+   profile/1,
+   wait_event/1,
+   put_message/1,
+   ban/1,
+   slap/1,
+   put_troll/1,
+   mod_troll/1,
+   del_troll/1,
+   unban_ip/1,
+   list_banned_ips/1,
+   erreur/1
+]).
+-include("../include/euphorik_bd.hrl").\r
+-include("../include/euphorik_defines.hrl").\r
+
+
+% Une utilisateur s'enregistre avec un tuple {Login, Password}.
+register([{login, Login}, {password, Password}], IP) ->
+   Can_register = euphorik_bd:can_register(IP),
+   if Can_register ->
+         case euphorik_bd:user_by_login(Login) of
+            {ok, _} ->
+               erreur("Login déjà existant");
+            _ ->
+               User = euphorik_bd:nouveau_user(Login, Password, generer_cookie()),
+               euphorik_bd:update_ip(User#user.id, IP),
+               json_reponse_login_ok(User)
+         end;
+      true ->
+         erreur_register_flood()
+   end;
+% Enregistrement sans {Login, Password}
+register([], IP) ->   
+   Can_register = euphorik_bd:can_register(IP),
+   if Can_register ->
+         User = euphorik_bd:nouveau_user("<nick>", generer_cookie()),
+         euphorik_bd:update_ip(User#user.id, IP),
+         json_reponse_login_ok(User);
+      true ->
+         erreur_register_flood()
+   end.
+   
+erreur_register_flood() ->
+   erreur("Trop de register (flood)").
+   
+\r
+% Un utilisateur se logge (avec un couple {login, mot de passe})
+login([{login, Login}, {password, Password}], IP) ->
+   loginUser(euphorik_bd:user_by_login_password(Login, Password), IP);
+% Un utilisateur se logge (avec un cookie)
+login([{cookie, Cookie}], IP) ->
+   loginUser(euphorik_bd:user_by_cookie(Cookie), IP).
+   
+loginUser({ok, User}, IP) ->
+   euphorik_bd:update_ip(User#user.id, IP),
+   euphorik_bd:update_date_derniere_connexion(User#user.id),
+   json_reponse_login_ok(User);
+loginUser(_, _) ->
+   % ajoute un délais d'attente
+   timer:sleep(?TEMPS_ATTENTE_ERREUR_LOGIN),
+   erreur("Couple login/pass introuvable").
+   
+   \r
+% Renvoie un string() représentant un cookie en base 36. Il y a 10^32 possibillités.\r
+generer_cookie() ->
+   {A1, A2, A3} = now(),
+   random:seed(A1, A2, A3),\r
+   erlang:integer_to_list(random:uniform(math:pow(10, 32)), 36).\r
+
+
+% Un utilisateur se délogge.
+logout(_) ->
+   do_nothing.
+
+
+% Modification du profile.
+profile(
+   [
+      {cookie, Cookie},
+      {login, Login},
+      {password, Password},
+      {nick, Pseudo},
+      {email, Email},
+      {css, Css},
+      {nick_format, Nick_format_str},
+      {view_times, View_times},
+      {view_tooltips, View_tooltips},
+      {main_page, Main_page},
+      {conversations, {array, Conversations_json}}
+   ]
+) ->
+   % est-ce que les messages auquel on répond existent ?
+   Conversations = lists:foldr(
+      fun({struct, [{root, Root}, {page, Page}]}, Acc) ->
+         Message_existe = euphorik_bd:message_existe(Root),
+         if  Message_existe ->
+            [{Root, Page} | Acc];
+            true ->
+               Acc
+         end
+      end,
+      [],
+      Conversations_json
+   ),
+   %  TODO : pas très beau, mieux vaut construire un #user
+   case euphorik_bd:set_profile(
+         Cookie,
+         Login,
+         Password,
+         Pseudo,
+         Email,
+         Css,
+         list_to_atom(Nick_format_str),
+         View_times,
+         View_tooltips,
+         Main_page,
+         Conversations) of
+      ok ->
+         json_reponse_ok();
+      login_deja_pris ->
+         erreur("Login déjà pris");
+      _ ->
+         erreur("Impossible de mettre à jour le profile")
+   end.
+
+
+% Renvoie les messages appropriés.
+% last_message id et cookie sont facultatifs
+wait_event([{page, "chat"} | Data]) ->
+   % traitement des inputs
+   Cookie = case lists:keysearch(cookie, 1, Data) of {value, {_, C}} -> C; _ -> inconnu end,
+   Last_message_id = case lists:keysearch(last_message_id, 1, Data) of {value, {_, Id}} -> Id; _ -> 0 end,
+   {value, {_, Message_count}} = lists:keysearch(message_count, 1, Data),
+   Main_page = case lists:keysearch(main_page, 1, Data) of {value, {_, P}} -> P; _ -> 1 end,
+   Troll_id = case lists:keysearch(troll_id, 1, Data) of {value, {_, T}} -> T; _ -> 0 end,
+   {value, {_, {array, Conversations_json}}} = lists:keysearch(conversations, 1, Data),
+   Racines_conversations = lists:map(
+      fun({struct, [{root, Racine}, {page, Page} | Reste]}) ->
+         Last_mess_conv  = case Reste of [{last_message_id, L}] -> L; _ -> 0 end,
+         {Racine, Page, Last_mess_conv}
+      end,
+      Conversations_json
+   ),
+   User = case euphorik_bd:user_by_cookie(Cookie) of\r
+      {ok, U} -> U;\r
+      _ -> inconnu\r
+   end,
+   case {mnesia:subscribe({table, minichat, detailed}), mnesia:subscribe({table, troll, detailed})} of
+      {{error, E}, _} -> E;
+      {_, {error, E}} -> E;
+      _ ->
+         % attente d'événements
+         R = wait_event_page_chat(User, Racines_conversations, Message_count, Last_message_id, Main_page, Troll_id),
+         mnesia:unsubscribe({table, minichat, detailed}),
+         mnesia:unsubscribe({table, troll, detailed}),
+         R
+   end;
+wait_event([{page, "admin"}, {last_troll, Last_troll}]) ->
+   case wait_event_page_admin(Last_troll) of
+      banned_ips_refresh ->
+         {struct, 
+            [
+               {reply, "banned_ips_refresh"}
+            ]
+         };
+      {mod, Troll} ->
+         {struct,
+            [
+               {reply, "troll_modified"},
+               {troll_id, Troll#troll.id},
+               {content, Troll#troll.content}
+            ]
+         };
+      {add, Trolls} ->
+         {struct,
+            [
+               {reply, "troll_added"},
+               {trolls, {array, 
+                  lists:map(
+                     fun(T) ->                        
+                        {ok, User} = euphorik_bd:user_by_id(T#troll.id_user),
+                        {struct,
+                           [
+                              {troll_id, T#troll.id},
+                              {content, T#troll.content},
+                              {author, User#user.pseudo},
+                              {author_id, User#user.id}
+                           ]
+                        }
+                     end,
+                     Trolls
+                  )
+               }}
+            ]
+         };         
+      {del, Troll_id} ->
+         {struct,
+            [
+               {reply, "troll_deleted"},
+               {troll_id, Troll_id}
+            ]
+         };                  
+      _ ->
+         erreur("timeout")
+   end;
+wait_event(_) ->
+   erreur("Page inconnue").
+
+
+wait_event_page_chat(User, Racines_conversations, Message_count, Last_message_id, Main_page, Troll_id) ->
+   % est-ce que le troll est à jour ?
+   case euphorik_bd:current_troll() of
+      Current when is_record(Current, troll), Current#troll.id =/= Troll_id ->
+         {struct, [
+            {reply, "new_troll"},
+            {troll_id, Current#troll.id},
+            {message_id, euphorik_bd:message_id_associe(Current#troll.id)},
+            {content, Current#troll.content}
+         ]};
+      _ ->
+         % est-ce qu'il y a des nouveaux messages ?
+         case euphorik_minichat_conversation:conversations(Racines_conversations, Message_count, Last_message_id, Main_page) of
+            vide ->            
+               wait_event_bd_page_chat(),
+               % TODO : l'appel est-il bien tail-recursive  ?
+               wait_event_page_chat(User, Racines_conversations, Message_count, Last_message_id, Main_page, Troll_id);
+            Conversations ->
+               % accrochez-vous ca va siouxer ;)
+               {struct, [
+                  {reply, "new_messages"},
+                  {conversations, {array,
+                     lists:map(
+                        fun({Conv, Plus}) ->
+                           {struct, [
+                              {last_page, not Plus},
+                              {messages, {array, 
+                                 lists:map(
+                                    fun({Mess, Repond_a}) ->                                 
+                                       Est_proprietaire = User =/= inconnu andalso User#user.id =:= Mess#minichat.auteur_id,
+                                       A_repondu_a_message = User =/= inconnu andalso euphorik_bd:a_repondu_a_message(User#user.id, Mess#minichat.id),
+                                       Est_une_reponse_a_user = User =/= inconnu andalso euphorik_bd:est_une_reponse_a_user(User#user.id, Mess#minichat.id),
+                                       {ok, User_mess } = euphorik_bd:user_by_id(Mess#minichat.auteur_id),
+                                       {struct, [
+                                          {id, Mess#minichat.id},
+                                          {user_id, User_mess#user.id},
+                                          {date, format_date(Mess#minichat.date)},
+                                          {system, Mess#minichat.auteur_id =:= 0},
+                                          {owner, Est_proprietaire},
+                                          {answered, A_repondu_a_message},
+                                          {is_a_reply, Est_une_reponse_a_user},
+                                          {nick, Mess#minichat.pseudo},
+                                          {login, User_mess#user.login},
+                                          {content, Mess#minichat.contenu},
+                                          {answer_to, {array, lists:map(
+                                             fun(Id_mess) ->                   
+                                                {ok, M} = euphorik_bd:message_by_id(Id_mess),
+                                                {ok, User_reponse} = euphorik_bd:user_by_mess(M#minichat.id),
+                                                {struct, [{id, M#minichat.id}, {nick, M#minichat.pseudo}, {login, User_reponse#user.login}]}
+                                             end,
+                                             Repond_a
+                                          )}},
+                                          {ek_master, User_mess#user.ek_master}
+                                       ]}
+                                    end,
+                                    Conv
+                                 )
+                              }}
+                           ]}
+                        end,
+                        Conversations
+                     )
+                  }}
+               ]}
+         end
+   end.
+
+
+% Attend un événement lié à la page 'chat'.
+wait_event_bd_page_chat() ->
+   receive % attente d'un post
+      {mnesia_table_event, {write, minichat, _Message, [], _}} ->
+         ok;
+      {mnesia_table_event, {write, troll, Troll, [Old_troll | _], _}} when Troll#troll.date_post =/= undefined, Old_troll#troll.date_post == undefined ->
+         ok;
+      {tcp_closed, _} ->
+         exit(normal);
+      _ ->
+         wait_event_bd_page_chat()
+   % 60 minutes de timeout (on ne sais jamais)
+   % Après 60 minutes de connexion, le client doit donc reétablir une connexion
+   after 1000 * 60 * 60 -> 
+      timeout
+   end.
+
+
+% Attent un événement concernant la page admin
+% Renvoie les trolls manquants posté après Last_id ou banned_ips_refresh.
+% Si pas de trolls alors attend un événement tel qu'un ajout, une modification ou une suppression.
+% renvoie :
+%  {mod, Troll}
+% ou {add, [Trolls]}
+% ou {del, Troll_id}
+% ou banned_ips_refresh
+% ou timeout
+wait_event_page_admin(Last_id) ->
+   case {mnesia:subscribe({table, troll, detailed}), mnesia:subscribe({table, ip_table, detailed})} of
+      {{error, E}, _ } -> E;
+      {_, {error, E}} -> E;
+      _ ->
+         R = case euphorik_bd:trolls(Last_id) of
+               [] -> % pas de trolls
+                  wait_event_page_admin();
+               Trolls ->
+                  {add, Trolls}
+         end,
+         mnesia:unsubscribe({table, troll, detailed}),
+         mnesia:unsubscribe({table, ip_table, detailed}),
+         R
+   end.
+   
+wait_event_page_admin() ->
+   % s'il n'y a pas de trolls que l'utilisateur n'a pas connaissance alors on attend un événement
+   receive
+      % cas où un troll est choisit comme courant
+      {mnesia_table_event, {write, troll, Troll, [Old_troll | _], _}}
+         when Old_troll#troll.date_post =:= undefined, Troll#troll.date_post =/= undefined ->
+         {del, Troll#troll.id};
+      {mnesia_table_event, {write, troll, Troll, [_Old_troll | _], _}} ->
+         {mod, Troll};
+      {mnesia_table_event, {write, troll, Troll, [], _}} ->
+         {add, [Troll]};
+      {mnesia_table_event, {delete, troll, {troll, Id}, _, _}} ->
+         {del, Id};
+      {mnesia_table_event, {write, ip_table, IP, [Old_IP | _], _}}
+         when Old_IP#ip_table.ban =/= IP#ip_table.ban; Old_IP#ip_table.ban_duration =/= IP#ip_table.ban_duration ->
+         banned_ips_refresh;
+      {tcp_closed, _} ->
+         exit(normal);
+      _ ->
+         wait_event_page_admin()
+   % 60 minutes de timeout (on ne sais jamais)
+   % Après 60 minutes de connexion, le client doit donc reétablir une connexion
+   after 1000 * 60 * 60 -> 
+      timeout
+   end.
+         
+         
+% Un utilisateur envoie un message
+put_message(
+   [
+      {cookie, Cookie},
+      {nick, Nick},
+      {content, Content},
+      {answer_to, {array, Answer_to}}
+   ]
+) ->
+   case euphorik_bd:user_by_cookie(Cookie) of
+      {ok, User} ->
+         case euphorik_bd:est_banni(User#user.id) of
+            {true, Temps_restant} ->
+               erreur("Vous êtes banni pour encore " ++ format_minutes(Temps_restant));
+            _ ->
+               Strip_content = string:strip(Content),
+               if Strip_content =:= [] ->
+                     erreur("Message vide");
+                  true ->
+                     % TODO : non-atomique (update_pseudo+nouveau_message)
+                     euphorik_bd:update_pseudo_user(User#user.id, Nick),
+                     case euphorik_bd:nouveau_message(Strip_content, User#user.id, Answer_to) of
+                        {erreur, R} -> erreur("Impossible d'ajouter un nouveau message. Raison : " ++ R);
+                        _ ->
+                           json_reponse_ok()
+                     end
+               end
+         end;
+   _ ->
+      erreur("Utilisateur inconnu")
+   end.
+
+
+% bannissement d'un utilisateur (son ip est bannie)
+ban(
+   [
+      {cookie, Cookie},
+      {duration, Duration},
+      {user_id, User_id},
+      {reason, Reason}
+   ]) ->
+      % controle que l'utilisateur est un admin
+      case euphorik_bd:user_by_cookie(Cookie) of
+         {ok, User1 = #user{ek_master = true}} ->
+            case euphorik_bd:user_by_id(User_id) of
+               {ok, User1} ->
+                  erreur("Il n'est pas possible de s'auto bannir");
+               {ok, User2 = #user{ek_master = false}} ->
+                  euphorik_bd:ban(User2#user.last_ip, Duration),
+                  euphorik_bd:nouveau_message_sys(lists:flatten(io_lib:format("''~s~s'' est ~s pour ~s.~s",
+                     [
+                        User2#user.pseudo,
+                        if User2#user.login =:= [] -> ""; true -> " (" ++ User2#user.login ++ ")" end,
+                        if Duration =< 15 -> "kické"; true -> "banni" end,
+                        format_minutes(Duration),
+                        if Reason =/= [] -> " - Raison: " ++ Reason; true -> "" end ++ "."
+                     ]
+                  ))),
+                  json_reponse_ok();
+               {ok, _} ->
+                  erreur("L'utilisateur est lui même un ekMaster");
+               _ ->
+                  erreur("Utilisateur à bannir inconnu")
+            end;
+         _ ->
+            erreur("Utilisateur inconnu ou non ek master")
+      end.
+      
+
+% slapage d'un user (avertissement)
+slap(
+   [
+      {cookie, Cookie},
+      {user_id, User_id},
+      {reason, Reason}
+   ]) ->
+      % controle que l'utilisateur est un admin
+      case euphorik_bd:user_by_cookie(Cookie) of
+         {ok, User1 = #user{ek_master = true}} ->
+            case euphorik_bd:user_by_id(User_id) of
+               {ok, User1} ->
+                  euphorik_bd:nouveau_message_sys(lists:flatten(io_lib:format("~s s'auto slap~s.", 
+                     [
+                        User1#user.pseudo,
+                        if Reason =/= [] -> " - Raison: " ++ Reason; true -> "" end
+                     ]
+                  ))),
+                  json_reponse_ok();
+               {ok, User2 = #user{ek_master = false}} ->
+                  euphorik_bd:nouveau_message_sys(lists:flatten(io_lib:format("~s se fait slaper par ~s.~s",
+                     [
+                        User2#user.pseudo,
+                        User1#user.pseudo,
+                        if Reason =/= [] -> " - Raison: " ++ Reason; true -> "" end ++ "."
+                     ]
+                  ))),
+                  json_reponse_ok();
+               {ok, _} ->
+                  erreur("L'utilisateur est lui même un ekMaster");
+               _ ->
+                  erreur("Utilisateur à slaper inconnu")
+            end;
+         _ ->
+            erreur("Utilisateur inconnu ou non ek master")
+      end.
+      
+put_troll(
+   [
+      {cookie, Cookie},
+      {content, Content}
+   ]
+) ->
+   % controle que l'utilisateur est un admin
+   case euphorik_bd:user_by_cookie(Cookie) of
+      {ok, User = #user{ek_master = true}} ->
+         case euphorik_bd:put_troll(User#user.id, Content) of
+            max_troll_reached_per_user ->
+               erreur(lists:flatten(io_lib:format("Le nombre de troll maximum par utilisateur est atteint : ~w ", [?NB_MAX_TROLL_WAITING_BY_USER])));
+            max_troll_reached ->
+               erreur(lists:flatten(io_lib:format("Le nombre de troll maximum en attente est atteint : ~w ", [?NB_MAX_TROLL_WAITING])));
+            _Id ->
+               json_reponse_ok()
+         end;
+      _ ->
+         erreur("Seul les ekMaster peuvent proposer des trolls")
+   end.
+   
+   
+mod_troll(
+   [
+      {cookie, Cookie},
+      {troll_id, Troll_id},
+      {content, Content}
+   ]
+) ->
+   % controle que l'utilisateur est un admin
+   case euphorik_bd:user_by_cookie(Cookie) of
+      {ok, User = #user{ek_master = true}} ->
+         User_id = User#user.id,
+         case euphorik_bd:troll_by_id(Troll_id) of
+            {ok, #troll{id_user = User_id}} ->
+               euphorik_bd:mod_troll(Troll_id, Content),
+               json_reponse_ok();
+            _ ->
+               erreur("Vous ne posséder pas ce troll")
+         end;
+      _ ->
+         erreur("Seul les ekMaster peuvent proposer des trolls")
+      end.
+
+   
+del_troll(
+   [
+      {cookie, Cookie},
+      {troll_id, Troll_id}
+   ]
+) -> 
+   % controle que l'utilisateur est un admin
+   case euphorik_bd:user_by_cookie(Cookie) of
+      {ok, User = #user{ek_master = true}} ->
+         User_id = User#user.id,
+         case euphorik_bd:troll_by_id(Troll_id) of
+            {ok, #troll{id_user = User_id}} ->
+               euphorik_bd:del_troll(Troll_id),
+               json_reponse_ok();
+            _ ->
+               erreur("Vous ne posséder pas ce troll")
+         end;
+      _ ->
+         erreur("Seul les ekMaster peuvent proposer des trolls")
+   end.
+   
+   
+unban_ip(
+   [
+      {cookie, Cookie},
+      {ip, IP}
+   ]
+) ->
+   case euphorik_bd:user_by_cookie(Cookie) of
+      {ok, #user{ek_master = true}} ->
+         euphorik_bd:deban(euphorik_common:unserialize_ip(IP)),
+         json_reponse_ok();
+      _ ->
+         erreur("Seul les ekMaster peuvent connaitre la liste des ips bannies")
+   end.
+   
+   
+list_banned_ips(
+   [
+      {cookie, Cookie}
+   ]
+) ->
+   case euphorik_bd:user_by_cookie(Cookie) of
+      {ok, #user{ek_master = true}} ->
+         {
+            struct,
+            [
+               {reply, "list_banned_ips"},
+               {list, {array, lists:map(
+                  fun({IP, T, Users}) ->
+                     {struct,
+                        [
+                           {ip, euphorik_common:serialize_ip(IP)},
+                           {remaining_time, format_minutes(T)},
+                           {users, {array, lists:map(
+                              fun({Pseudo, Login}) ->
+                                 {struct,
+                                    [
+                                       {nick, Pseudo},
+                                       {login, Login}
+                                    ]
+                                 }
+                              end,
+                              Users
+                           )}}
+                        ]
+                     }
+                  end,
+                  euphorik_bd:list_ban()
+               )}}
+            ]
+         };
+      _ ->
+         erreur("Seul les ekMaster peuvent connaitre la liste des ips bannies")
+   end.
+
+
+% Construit une erreur
+erreur(Message) ->
+   {
+      struct, [
+         {reply, "error"},
+         {error_message, Message}
+      ]
+   }.
+   
+   
+% Formatage de minutes.
+% par exemple : "1min", "45min", "1h23min", "1jour 2h34min"
+format_minutes(Min) ->
+   Jours = Min div (60 * 24),
+   Heures = Min rem (60 * 24) div 60,
+   Minutes = Min rem (60),
+   if Jours =/= 0 -> integer_to_list(Jours) ++ " Jour" ++ if Jours > 1 -> "s"; true -> "" end ++ " "; true -> "" end ++
+   if Heures =/= 0 -> integer_to_list(Heures) ++ " heure"  ++ if Heures > 1 -> "s"; true -> "" end; true -> "" end ++
+   if Minutes == 0 ->
+         "";
+      true ->
+         " " ++ integer_to_list(Minutes) ++ " minute"  ++ if Minutes > 1 -> "s"; true -> "" end
+   end.
+   
+   \r
+% Formatage d'une heure\r
+% local_time() -> string\r
+format_date(Date) ->\r
+   DateLocal = calendar:now_to_local_time(Date),\r
+   DateNowLocal = calendar:local_time(),\r
+   {{Annee, Mois, Jour}, {Heure, Minute, Seconde}} = DateLocal,\r
+   {{AnneeNow, _, _}, {_, _, _}} = DateNowLocal,\r
+   Hier = calendar:date_to_gregorian_days(element(1, DateLocal)) =:=  calendar:date_to_gregorian_days(element(1, DateNowLocal)) - 1,\r
+   lists:flatten(
+      if element(1, DateLocal) =:= element(1, DateNowLocal) ->\r
+         "";\r
+         Hier ->\r
+            "Hier ";\r
+         Annee =:= AnneeNow ->\r
+            io_lib:format("~2.10.0B/~2.10.0B ", [Jour, Mois]);         \r
+         true ->\r
+            io_lib:format("~2.10.0B/~2.10.0B/~B ", [Jour, Mois, Annee])\r
+      end ++\r
+      io_lib:format("~2.10.0B:~2.10.0B:~2.10.0B", [Heure, Minute, Seconde])
+   ).
+
+
+json_reponse_ok() ->
+   {struct, [{reply, "ok"}]}.
+   
+   
+json_reponse_login_ok(User) ->
+   {
+      struct, [
+         {reply, "login"},
+         {status, if (User#user.password =/= []) and (User#user.login =/= []) -> "auth_registered"; true -> "auth_not_registered" end},
+         {cookie, User#user.cookie},
+         {id, User#user.id},
+         {nick, User#user.pseudo},
+         {login, User#user.login},
+         {email, User#user.email},
+         {css, User#user.css},
+         {nick_format, atom_to_list(User#user.nick_format)},
+         {view_times, User#user.view_times},
+         {view_tooltips, User#user.view_tooltips},
+         {main_page, User#user.page_principale},
+         {conversations, 
+            {array,
+               lists:map(
+                  fun(C) ->
+                     {struct,
+                        [
+                           {root, element(1, C)},
+                           {page, element(2, C)}
+                        ]
+                     }
+                  end,
+                  User#user.conversations
+               )
+            }
+         },
+      {ek_master, User#user.ek_master}
+      ]
+   }.
diff --git a/modules/erl/euphorik_requests.erl b/modules/erl/euphorik_requests.erl
new file mode 100755 (executable)
index 0000000..28019da
--- /dev/null
@@ -0,0 +1,83 @@
+% coding: utf-8\r
+% Copyright 2008 Grégory Burri\r
+%\r
+% This file is part of Euphorik.\r
+%\r
+% Euphorik is free software: you can redistribute it and/or modify\r
+% it under the terms of the GNU General Public License as published by\r
+% the Free Software Foundation, either version 3 of the License, or\r
+% (at your option) any later version.\r
+%\r
+% Euphorik is distributed in the hope that it will be useful,\r
+% but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+% GNU General Public License for more details.\r
+%\r
+% You should have received a copy of the GNU General Public License\r
+% along with Euphorik.  If not, see <http://www.gnu.org/licenses/>.\r
+% \r
+% Ce module est fait pour répondre à des requêtes 'AJAX'.\r
+% Il est définit comme 'appmods' pour l'url "request" dans yaws.\r
+% Par exemple http://www.euphorik.ch/request abouti sur la fonction out() de ce module.
+% @author G.Burri
+\r
+
+-module(euphorik_requests).\r
+-export([out/1]).\r
+-include_lib("xmerl/include/xmerl.hrl").\r
+-include_lib("yaws/include/yaws_api.hrl").
+
+\r
+out(A) ->
+   %io:format("~p~n", [A]), % utilisé parfois pendant le debug
+   IP = case inet:peername(A#arg.clisock) of
+      {ok, {Adresse, _Port}} -> Adresse;
+      _ -> inconnue
+   end,
+   % passive -> active, permet de recevoir {tcp_closed, _} lorsque le socket se ferme
+   % keepalive -> true, evite que des firewalls coupe la connexion TCP sans prévenir\r
+   inet:setopts(A#arg.clisock, [{active, true}, {keepalive, true}]),\r
+   {value, {_, Contenu}} = lists:keysearch("action", 1, yaws_api:parse_post(A)),\r
+   Ret = traiter_donnees(Contenu, IP),
+   {content, "application/json", Ret}.\r
+
+\r
+traiter_donnees(Contenu, IP) ->
+   case json:decode_string(Contenu) of
+      {ok, {struct, [{action, Action}| Reste]}} ->
+         json:encode(traiter_action(Action, Reste, IP));
+      _ ->
+         error
+   end.
+   
+
+% authentification d'un client
+traiter_action("authentification", JSON, IP) ->
+   euphorik_protocole:login(JSON, IP);
+% un client s'enregistre (pseudo + password)
+traiter_action("register", JSON, IP) ->
+   euphorik_protocole:register(JSON, IP);
+% modification du profile
+traiter_action("set_profile", JSON, _) ->
+   euphorik_protocole:profile(JSON);
+% un utilisateur attend un événement (par exemple l'arrivé d'un nouveau message)
+traiter_action("wait_event", JSON, _) ->
+   euphorik_protocole:wait_event(JSON);
+% un utilisateur envoie un message
+traiter_action("put_message", JSON, _) ->
+   euphorik_protocole:put_message(JSON);
+traiter_action("ban", JSON, _) ->
+   euphorik_protocole:ban(JSON);
+traiter_action("slap", JSON, _) ->
+   euphorik_protocole:slap(JSON);
+traiter_action("put_troll", JSON, _) ->
+   euphorik_protocole:put_troll(JSON);
+traiter_action("mod_troll", JSON, _) ->
+   euphorik_protocole:mod_troll(JSON);
+traiter_action("del_troll", JSON, _) ->
+   euphorik_protocole:del_troll(JSON);
+traiter_action("list_banned_ips", JSON, _) ->
+   euphorik_protocole:list_banned_ips(JSON);
+traiter_action("unban", JSON, _) ->
+   euphorik_protocole:unban_ip(JSON).
\ No newline at end of file
diff --git a/modules/erl/euphorik_test.erl b/modules/erl/euphorik_test.erl
new file mode 100644 (file)
index 0000000..d319997
--- /dev/null
@@ -0,0 +1,116 @@
+% coding: utf-8
+% Copyright 2008 Grégory Burri
+%
+% This file is part of Euphorik.
+%
+% Euphorik is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% Euphorik is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with Euphorik.  If not, see <http://www.gnu.org/licenses/>.
+%
+% Module de test de euphorik.
+% Crée un certain nombre d'utilisateur et post des messages aléatoire.
+
+
+-module(euphorik_test).
+-export([start/2, stop/1]).
+-include("../include/euphorik_bd.hrl").
+
+
+% N est le nombre d'utilisateur
+% M est le nombre de message que chaque utilisateur va poster
+start(N, M) ->
+   Ids = creer_users(N),
+   lists:map(
+      fun(Id) ->
+         timer:sleep(100),
+         spawn(
+            fun() -> 
+               {A1, A2, A3} = now(),
+               random:seed(A1, A2, A3),
+               loop(Id, M)
+            end
+         )
+      end,
+      Ids
+   ).
+   
+stop(Pids) ->
+   lists:foreach(fun(Pid) -> exit(Pid, kill) end, Pids).
+   
+   
+% Crée N user avec des noms aléatoires et renvoie la liste des id.
+creer_users(N) ->
+   creer_users(N, []).
+creer_users(0, Ids) -> lists:map(fun(#user{id = Id}) -> Id end, Ids);
+creer_users(N, Ids) ->
+   creer_users(N - 1, [euphorik_bd:nouveau_user(mot_rand(random:uniform(4) + 4), "", "") | Ids ]).
+
+
+% crée un message aléatoire et le renvoie
+message_rand() ->
+   lists:flatten(message_rand(random:uniform(10), [])).
+message_rand(0, Mots) -> Mots;
+message_rand(N, Mots) -> 
+   message_rand(N - 1, [mot_rand(random:uniform(2) + 5), $  | Mots]).
+
+
+% Renvoie une succession de lettre aléatoire
+mot_rand(L) ->
+   mot_rand(L, []).
+mot_rand(0, Mot) -> Mot;
+mot_rand(L, Mot) ->
+   mot_rand(L - 1, [random:uniform($z - $a + 1) + $a - 1 | Mot]).
+   
+
+% Tire au hasard de 0 à 3 messages sur les 10 derniers postés, renvoie une liste de int()
+% répartition : 
+%  0 : 0.5
+%  1 : 0.3
+%  2 : 0.15
+%  3 : 0.05
+messages_id_rand() ->
+   Messages = lists:map(fun(#minichat{id = Id}) -> Id end, euphorik_bd:messages(30)),
+   R = random:uniform(),
+   if R =< 0.5 -> [];
+      R > 0.5 andalso R =< 0.8 ->
+         tire_element_rand(1, Messages);
+      R > 0.8 andalso R =< 0.95 ->
+         tire_element_rand(2, Messages);
+      true ->
+         tire_element_rand(3, Messages)
+   end.
+
+
+% tire N element distinct parmis la liste L proposée
+tire_element_rand(N, L) when N =< length(L) ->
+   tire_element_rand(N, L, []).
+tire_element_rand(0, _, Elements) -> Elements;
+tire_element_rand(N, L, Elements) ->
+   E = lists:nth(random:uniform(length(L)), L),
+   E_se_trouve_dans_Elements = lists:any(fun(E2) -> E2 =:= E end, Elements),
+   if E_se_trouve_dans_Elements -> % si E a déjà été tiré on recommence sans rien changer
+         tire_element_rand(N, L, Elements);
+      true ->
+         tire_element_rand(N-1, L, [E | Elements])
+   end.
+
+loop(User_id, 0) ->
+   io:format("~p a fini~n", [User_id]);
+loop(User_id, M) -> 
+   % attend un temp aléatoire compris entre 1 sec et 5 sec
+   timer:sleep(1000 * random:uniform(5)),
+   % poste un message aléatoire par une personne aléatoire répondant à des messages aléatoires
+   {Message, Repond_a} = {message_rand(), messages_id_rand()},
+   io:format("~p poste ~p et repond a ~w~n", [User_id, Message, Repond_a]),
+   euphorik_bd:nouveau_message(Message, User_id, Repond_a),
+   loop(User_id, M - 1).
+   
\ No newline at end of file
diff --git a/modules/erl/old/captcha.erl b/modules/erl/old/captcha.erl
new file mode 100755 (executable)
index 0000000..e885239
--- /dev/null
@@ -0,0 +1,31 @@
+% Module permettant la génération de captcha.\r
+% Dépend de la lib 'erlycairo', il faut que son c-node soit démarré.\r
+% Auteur : G.Burri\r
+% Date : 05.11.2007\r
+\r
+-module(captcha).
+-export([create/2]).
+\r
+-include("../include/euphorik_defines.hrl").\r
+\r
+
+% Crée un captcha de longueur L dans le dossier Dossier.\r
+% renvoie {Mot crypté:string(), Nom du fichier:string()}
+create(L, Dossier) ->\r
+   Mot = common:generer_mot(L),\r
+   Mot_crypt = common:crypt(Mot),\r
+   Nom_fichier = Mot_crypt ++ ".png",
+   erlycairo:new_image_blank(length(Mot) * 8, 14),
+   erlycairo:set_source_rgba(0, 0, 0, 1),
+   erlycairo:select_font_face("Courier", 0, 1),
+   erlycairo:set_font_size(12),
+   erlycairo:move_to(2, 10),
+   erlycairo:show_text(Mot),
+   erlycairo:move_to(2, 10),
+   erlycairo:line_to(length(Mot) * 8 - 2, 10),
+   erlycairo:set_line_width(1),
+   erlycairo:stroke(),
+   erlycairo:write_to_png(Dossier ++ "/" ++ Nom_fichier),
+   erlycairo:close_image(),\r
+   {Mot_crypt, Nom_fichier}.\r
+   
\ No newline at end of file
diff --git a/modules/erl/old/euphorik_format.erl b/modules/erl/old/euphorik_format.erl
new file mode 100755 (executable)
index 0000000..3d60eb1
--- /dev/null
@@ -0,0 +1,67 @@
+% Attention : Ce module n'est plus utilisé, les fonctions ont été déportées vers le client
+% Ce module permet de formater le contenu d'un message :
+%  - Ajout de balise HTML pour les URL
+%  - Substitution des smiles par des images
+%  - Cleanage du contenu des balises HTML
+% 
+% Auteur : G.Burri
+% Date : 12.11.2007
+
+-module(euphorik_format).
+-export([smiles/0, formater_contenu_message/1]).
+   
+smiles() ->
+   [
+      {":\\)", "smile"},
+      {":D", "bigsmile"},
+      {"\\[:argn\\]", "argn"},
+      {"\\[:lapin\\]", "bunny"},
+      {"\\[:chat\\]", "chat"},
+      {";\\)", "clin"},
+      {"8\\)", "cool"},
+      {":P", "eheheh"},
+      {"\\[:lol\\]", "lol"},
+      {":o", "oh"},
+      {">\\(", "pascontent"},
+      {"\\[:renne\\]", "renne"},
+      {":\\(", "sniff"},
+      {"\\[:spliff\\]", "spliff"},
+      {"\\[:star\\]", "star"},
+      {"\\[:triste\\]", "triste"}
+   ].
+   
+   
+traiter_smiles(M) ->
+   lists:foldr(
+      fun({Symbole, Nom}, A) ->
+         case regexp:gsub(A, Symbole, "<img src=\"img/smileys/" ++ Nom ++ ".gif\" />") of   
+            {ok, R, _} -> R;
+            _ -> "ERREUR"
+         end
+      end,
+      M,
+      smiles()
+   ).
+   
+   
+   
+virer_balises_html(M) ->
+   case regexp:gsub(M, "</?[^>]*>", "") of
+      {ok, R, _} -> R;
+      _ -> erreur
+   end.
+   
+   
+traiter_url(M) ->
+   case regexp:gsub(M, "http://[^ ]*", "<a href=\"\&\" >[url]</a>") of
+      {ok, R, _} -> R;
+      _ -> erreur
+   end.
+
+
+formater_contenu_message(M) ->
+   string:strip(traiter_smiles(traiter_url(virer_balises_html(M)))).
+   
+   
+
diff --git a/modules/include/euphorik_bd.hrl b/modules/include/euphorik_bd.hrl
new file mode 100755 (executable)
index 0000000..d7cdd8a
--- /dev/null
@@ -0,0 +1,105 @@
+% Copyright 2008 Grégory Burri\r
+%\r
+% This file is part of Euphorik.\r
+%\r
+% Euphorik is free software: you can redistribute it and/or modify\r
+% it under the terms of the GNU General Public License as published by\r
+% the Free Software Foundation, either version 3 of the License, or\r
+% (at your option) any later version.\r
+%\r
+% Euphorik is distributed in the hope that it will be useful,\r
+% but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+% GNU General Public License for more details.\r
+%\r
+% You should have received a copy of the GNU General Public License\r
+% along with Euphorik.  If not, see <http://www.gnu.org/licenses/>.\r
+%\r
+% @author GBurri\r
+
+
+% Version de la BD
+-define(VERSION_BD, 1).
+
+
+% Pour générer des id\r
+-record(counter,\r
+   {\r
+      key,\r
+      value\r
+   }).\r
+   
+   
+% Mémorse toutes les propriétés, entre autre la version des données
+-record(proprietes,
+   {
+      nom,
+      valeur
+   }).\r
+
+\r
+% décrit un enregistrement d'un message\r
+-record(minichat,
+   {\r
+      id, % integer\r
+      auteur_id, % -> #user.id
+      date, % erlang:now()
+      pseudo, % chaine de caractère
+      contenu, % chaine de caractère
+      troll_id = undefined % l'id du troll associé correspondant
+   }).\r
+   
+   \r
+% type bag\r
+% 'repondant' repond à 'cible'\r
+-record(reponse_minichat,\r
+   {\r
+      repondant, % -> #minichat.id\r
+      cible % -> #minichat.id\r
+   }). \r
+
+\r
+-record(user,\r
+   {\r
+      id,\r
+      cookie, % string()\r
+      pseudo = [], % string()
+      login = [], % string()
+      password = [], % string() (md5)
+      email = [], % string()\r
+      date_creation, % erlang:now()\r
+      date_derniere_connexion, % erlang:now(), est mis à jour lors de n'importe quelle activitée (envoie de message par exemple)\r
+      css = [], % string()
+      nick_format = nick, %atom(), peut valoir 'nick', 'login' ou 'nick_login'
+      view_times = true,
+      view_tooltips = true,
+      indice_flood = 0, % integer() est incrémenté lorsque l'utilisateur envoie trop rapidement des messages.
+      page_principale = 1, % la page de la conversation principale
+      conversations = [], % [{integer(), integer()}], la liste des messages correspondant au conversation ainsi que la page affichée
+      ek_master = false,
+      last_ip = undefined % integer(), undefined si inconnu\r
+   }).
+
+
+% identificateur : (ip)
+-record(ip_table,
+   {
+      ip, % {integer(), integer(), integer(), integer()}
+      ban = undefined, % la date du dernier bannissement
+      ban_duration = 0, % le temps de ban en minute
+      nb_try_register = 0,
+      nb_try_login = 0, % pour l'instant pas utilisé
+      date_last_try_register,
+      date_last_try_login % pour l'instant pas utilisé
+   }).
+   
+   
+-record(troll,
+   {
+      id,
+      id_user,
+      date_create, % erlang:now()
+      date_post = undefined, % date à laquelle le troll est affiché sur la page principale. undefined initialement puis erlang:now() quand affiché
+      content % chaine de caractère
+   }).
+   
\ No newline at end of file
diff --git a/modules/include/euphorik_defines.hrl b/modules/include/euphorik_defines.hrl
new file mode 100755 (executable)
index 0000000..c0791b5
--- /dev/null
@@ -0,0 +1,51 @@
+% Copyright 2008 Grégory Burri\r
+%\r
+% This file is part of Euphorik.\r
+%\r
+% Euphorik is free software: you can redistribute it and/or modify\r
+% it under the terms of the GNU General Public License as published by\r
+% the Free Software Foundation, either version 3 of the License, or\r
+% (at your option) any later version.\r
+%\r
+% Euphorik is distributed in the hope that it will be useful,\r
+% but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+% GNU General Public License for more details.\r
+%\r
+% You should have received a copy of the GNU General Public License\r
+% along with Euphorik.  If not, see <http://www.gnu.org/licenses/>.\r
+
+\r
+% Le temps d'attente après une erreur de login (mauvais login/pass) : une demie seconde\r
+% Permet d'éviter (limiter) les attaques par dictionnaire\r
+-define(TEMPS_ATTENTE_ERREUR_LOGIN, 500). % ms
+
+% Un message est considéré comme du spam s'il est posté 1 seconde ou moins après le dernier posté
+-define(DUREE_SPAM, 1000). % ms
+% Lorsque l'indice de spam d'un utilisateur atteind cette valeur alors il ne peut plus poster pendant un moment
+-define(INDICE_SPAM_MAX, 6).
+% Un utilisateur ayant trop spamé est bloqué pendant ce temps 
+-define(DUREE_BLOCAGE_SPAM, 20000). % ms
+
+
+% le temps qu'une ip est bannie après avoir voulu s'etre enregistré trop de fois trop rapidement
+-define(TEMPS_BAN_FLOOD_REGISTER, 60 * 60 * 1000). % 1 heure : en ms
+% le temps entre deux tentatives de register pour compter un flood
+-define(TEMPS_FLOOD_REGISTER, 1500). % 1500 ms
+% après 5 flood l'ip fautive est considérée comme bannie
+-define(NB_MAX_FLOOD_REGISTER, 5). 
+
+
+% le nombre max de troll qui peuvent être en attente d'être posté (tous les utilisateurs réunis)
+-define(NB_MAX_TROLL_WAITING, 10).
+% chaque admin peut proposer 1 seul troll à la fois
+-define(NB_MAX_TROLL_WAITING_BY_USER, 2).
+
+
+% Le jour ainsi que l'heure à laquelle est élu un nouveau troll (lundi à 3 heure du mat)
+-define(JOUR_ELECTION_TROLL, 1). % 1 = lundi
+-define(HEURE_ELECTION_TROLL, 3). % 3 heure du matin
+
+
+% Le dossier utilisé pour le trie (qlc:keysort())
+-define(KEY_SORT_TEMP_DIR, "/tmp").
diff --git a/pages/about.html b/pages/about.html
new file mode 100644 (file)
index 0000000..12f162e
--- /dev/null
@@ -0,0 +1,113 @@
+<!-- encoding: utf-8 -->\r
+\r
+<h1>euphorik.ch</h1>\r
+<p>Version : 1.0.1</p>\r
+<p>Auteur : <a href="{EMAIL_LIEN}">Pifou</a></p>
+
+<h2>FAQ</h2>
+
+<h3>C'est quoi ce site ? Pis ça sert à quoi ?</h3>
+<p>Ce site est un chat géant servant parfois à communiquer.</p>
+
+
+<!-- h3>Coment insérer des smiles autres que ceux par défaut ?</h3>
+<p>Les smiles de <a href="http://totoz.eu">totoz.eu</a> peuvent être utilisés en insérant leur tag dans un message, par exemple [:beuh].</p -->
+\r
+\r
+<h3>C'est quoi un "troll de la semaine" ?</h3>\r
+<p>Simplement un sujet de débat à tendance trollifique. Chaque lundi à 3 heure du matin un nouveau troll est choisi au hasard parmis ceux proposés par les administrateurs.</p>\r
+
+<h3>A quoi correspondent les couleurs liés aux messages ?</h3>
+<ul>
+   <li><span class="faqCouleurProprietaire">Vert</span> : messages appartenant à l'utilisateur courant.</li>
+   <li><span class="faqCouleurReponse">Rouge</span> : messages répondant à l'utilisateur courant.</li>
+   <li><span class="faqCouleurRepondu">Bleu</span> : messages auquels l'utilisateur courant à répondu.</li>
+</ul>\r
+
+<h3>Quels-sont les navigateurs supportés ?</h3>
+<p>Le site a été testé sous "Firefox 2 et 3", "Safari 3" et "Opera 9".
+Il est fortement déconseillé d'utiliser Microsoft Internet Explorer pour des raisons d'incompatibilités.</p>
+
+
+<h3>Le site se bloque sous Microsoft Internet Explorer 7 !</h3>
+<p>Internet Explorer gère assez mal les connexions persitantes de type Comet/AJAX. Il est conseillé d'utiliser un vrai navigateur comme ceux cités au point précédent.</p>
+
+
+<h3>Ce site n'est pas du tout <a href="http://fr.wikipedia.org/wiki/Representational_state_transfer">RESTful</a>!?</h3>
+<p>Effectivement, l'AJAX, Le COMET et les effets de bords dans tous les sens font qu'effectivement ce site ne suit pas du tout le principe d'un architecture REST.</p>
+<h4>Ouais mais ça sux grave !</h4>
+<p>Ouais effectivement.. mais je fais ce que je veux pis d'abord.</p>
+
+
+<h3>Est-ce possible d'avoir les sources du site ?</h3>
+<p>Oui, un repository subversion accessible en lecture existe ici : svn://svn.euphorik.ch/euphorik</p>
+<p>Un accès web existe également <a href="http://svn.euphorik.ch/index.cgi/euphorik/browse/trunk">ici</a>.</p>\r
+\r
+<h3>Ouais mais c'est libre au moins ?</h3>\r
+<p>Oui, euphorik.ch n'est développé qu'avec des logiciels et technologies libres et son code est proposé sous licence GPLv3.</p>
+
+
+<h3>Je voudrais apporter une contribution à ce magnifique chat.</h3>
+<p>Pas de problème il suffit de me décrire la modification et je vous donne un accès en écriture sur le repository ou simplement d'envoyer un <a href="http://www.gnu.org/software/diffutils/diffutils.html">diff</a>.<br/>
+voici mon email/jabberID : {EMAIL}</p>
+
+
+<h3>Quels-sont les technologies utilisées ?</h3>
+<h4>Coté client</h4>
+<ul>
+   <li>Structuration du document : <a href="http://www.w3.org/TR/xhtml11/">XHTML 1.1</a></li>
+   <li>Présentation du document : <a href="http://www.w3.org/TR/CSS21/">CSS 2.1</a></li>
+   <li>Programmation de la partie dynamique : <a href="http://fr.wikipedia.org/wiki/JavaScript">JavaScript</a></li>
+   <li>Méthode de communication avec le serveur : <a href="http://en.wikipedia.org/wiki/Ajax_(programming)">AJAX</a>/<a href="http://en.wikipedia.org/wiki/Comet_(programming)">COMET</a></li>
+   <li>Bibliothèques JavaScript : <a href="http://jquery.com">jQuery</a> et <a href="http://leandrovieira.com/projects/jquery/lightbox/">jQuery lightBox plugin</a></li>
+</ul>
+<h4>Coté serveur</h4>
+<ul>
+   <li>Langage de programmation : <a href="http://www.erlang.org">Erlang</a></li>
+   <li>Serveur Web : <a href="http://yaws.hyber.org">Yaws</a></li>
+   <li>Base de données : <a href="http://erlang.org/doc/apps/mnesia/index.html">Mnesia</a></li>
+   <li>Système d'exploitation : <a href="http://www.debian.org">Debian</a></li>
+</ul>
+<h4>Outils</h4>
+<ul>
+   <li>Editeur de texte : <a href="http://www.scintilla.org/SciTE.html">SciTE</a></li>
+   <li>Navigateur web : <a href="http://fr.wikipedia.org/wiki/IceWeasel">IceWeasel</a></li>
+   <li>Manipulation d'images : <a href="http://www.gimp.org">GNU Image Manipulation Program</a></li>\r
+   <li>Dessin vectoriel : <a href="http://www.inkscape.org/">Inkscape</a></li>
+   <li>Analyse HTML/CSS/JS : <a href="http://www.getfirebug.com/">Firebug</a></li>
+   <li>Minificateur JavaScript : <a href="http://www.crockford.com/javascript/jsmin.rb">jsmin.rb</a></li>
+</ul>
+
+<h3>Comment est appelé le petit du gnou ?</h3>
+<p>Le gaou.</p>
+
+
+<h2>Versions à venir</h2>
+<p>Liste non-exaustive des fonctionnalités à venir.</p>\r
+
+<h3>1.1</h3>
+<ul>\r
+   <li>Possibilité de récupérer son login/password via son email.</li>\r
+   <li>Possibilité d'inverser le chat.</li>\r
+   <li>Révision du système de conversation.\r
+      <ul>\r
+         <li>Impossibilité de répondre à plusieurs messages de conversations différentes.</li>\r
+         <li>Possibilité d'extraire complétement une conversation.</li>\r
+         <li>Possibilité de réduire une conversation (la cacher temporairement).</li>\r
+         <li>Possibilité de créer un lien vers une conversation, par exemple : http://www.euphorik.ch/?conv=34\r
+      </ul>\r
+   </li>\r
+</ul>\r
+
+<h3>1.2</h3>
+<ul>\r
+   <li>Intégration des <a href="http://totoz.eu">totoz</a>.</li>\r
+   <li>Un admin pourra censurer un message.</li>\r
+</ul>\r
+
+<h3>1.3</h3>
+<ul><li>Possibilité d'ajouter une correction à son dernier message.</li></ul>\r
+
+<h3>1.4</h3>
+<ul><li>Ajout de nouveaux styles.</li></ul>
+   
diff --git a/pages/conditions_utilisation.html b/pages/conditions_utilisation.html
new file mode 100644 (file)
index 0000000..e714d0a
--- /dev/null
@@ -0,0 +1,8 @@
+<!-- encoding: utf-8 -->\r
+\r
+<h1>Conditions d'utilisation</h1>\r
+<ul>\r
+   <li>L'utilisateur d'euphorik.ch s'engage à prendre connaissance et à respecter ces conditions d'utilisation.</li>\r
+   <li>L'utilisateur est propriétaire de ses dires. Euphorik.ch n'est en aucun cas responsable des messages postés par l' utilisateur.</li>\r
+   <li>L'utilisateur s'engage à se conformer au droit suisse.</li>\r
+</ul>
\ No newline at end of file
diff --git a/sessions/css1.session b/sessions/css1.session
new file mode 100644 (file)
index 0000000..b206b00
--- /dev/null
@@ -0,0 +1,20 @@
+# SciTE session file
+
+buffer.1.path=/home/gburri/projets/euphorik/css/1/euphorik.css
+buffer.1.position=377
+
+buffer.2.path=/home/gburri/projets/euphorik/css/1/pageAbout.css
+buffer.2.position=1
+
+buffer.3.path=/home/gburri/projets/euphorik/css/1/pageAdmin.css
+buffer.3.position=1
+
+buffer.4.path=/home/gburri/projets/euphorik/css/1/pageMinichat.css
+buffer.4.position=1
+
+buffer.5.path=/home/gburri/projets/euphorik/css/1/pageProfileRegister.css
+buffer.5.position=130
+
+buffer.6.path=/home/gburri/projets/euphorik/index.yaws
+buffer.6.position=1
+buffer.6.current=1
diff --git a/sessions/css2.session b/sessions/css2.session
new file mode 100644 (file)
index 0000000..6a6b5f0
--- /dev/null
@@ -0,0 +1,17 @@
+# SciTE session file
+
+buffer.1.path=/home/gburri/projets/euphorik/css/2/euphorik.css
+buffer.1.position=1
+buffer.1.current=1
+
+buffer.2.path=/home/gburri/projets/euphorik/css/2/pageAbout.css
+buffer.2.position=1
+
+buffer.3.path=/home/gburri/projets/euphorik/css/2/pageAdmin.css
+buffer.3.position=1
+
+buffer.4.path=/home/gburri/projets/euphorik/css/2/pageMinichat.css
+buffer.4.position=1
+
+buffer.5.path=/home/gburri/projets/euphorik/css/2/pageProfileRegister.css
+buffer.5.position=130
diff --git a/sessions/doc.session b/sessions/doc.session
new file mode 100755 (executable)
index 0000000..f576177
--- /dev/null
@@ -0,0 +1,17 @@
+# SciTE session file
+
+buffer.1.path=/home/gburri/projets/euphorik/doc/technique.txt
+buffer.1.position=572
+
+buffer.2.path=/home/gburri/projets/euphorik/doc/TODO.txt
+buffer.2.position=181
+buffer.2.current=1
+
+buffer.3.path=/home/gburri/projets/euphorik/doc/protocole3.txt
+buffer.3.position=248
+
+buffer.4.path=/home/gburri/projets/euphorik/doc/description.txt
+buffer.4.position=1
+
+buffer.5.path=/home/gburri/projets/euphorik/doc/installation.txt
+buffer.5.position=1231
diff --git a/sessions/erl.session b/sessions/erl.session
new file mode 100755 (executable)
index 0000000..ce6313a
--- /dev/null
@@ -0,0 +1,23 @@
+# SciTE session file
+
+buffer.1.path=/home/gburri/projets/euphorik/modules/erl/euphorik_minichat_conversation.erl
+buffer.1.position=580
+
+buffer.2.path=/home/gburri/projets/euphorik/modules/erl/euphorik_protocole.erl
+buffer.2.position=1
+
+buffer.3.path=/home/gburri/projets/euphorik/modules/erl/euphorik_requests.erl
+buffer.3.position=1
+
+buffer.4.path=/home/gburri/projets/euphorik/modules/include/euphorik_bd.hrl
+buffer.4.position=1
+
+buffer.5.path=/home/gburri/projets/euphorik/modules/include/euphorik_defines.hrl
+buffer.5.position=336
+
+buffer.6.path=/home/gburri/projets/euphorik/modules/erl/euphorik_bd.erl
+buffer.6.position=1
+
+buffer.7.path=/home/gburri/projets/euphorik/modules/erl/euphorik_daemon.erl
+buffer.7.position=1
+buffer.7.current=1
diff --git a/sessions/js.session b/sessions/js.session
new file mode 100755 (executable)
index 0000000..5eab12e
--- /dev/null
@@ -0,0 +1,20 @@
+# SciTE session file
+
+buffer.1.path=/home/gburri/projets/euphorik/js/euphorik.js
+buffer.1.position=22818
+
+buffer.2.path=/home/gburri/projets/euphorik/js/pageMinichat.js
+buffer.2.position=7496
+
+buffer.3.path=/home/gburri/projets/euphorik/js/pageProfile.js
+buffer.3.position=1
+
+buffer.4.path=/home/gburri/projets/euphorik/js/pageRegister.js
+buffer.4.position=1
+
+buffer.5.path=/home/gburri/projets/euphorik/js/pageAbout.js
+buffer.5.position=1
+
+buffer.6.path=/home/gburri/projets/euphorik/js/pageAdmin.js
+buffer.6.position=1
+buffer.6.current=1
diff --git a/tools/jsmin.rb b/tools/jsmin.rb
new file mode 100644 (file)
index 0000000..83e2e40
--- /dev/null
@@ -0,0 +1,216 @@
+#!/usr/bin/ruby
+# jsmin.rb 2007-07-20
+# Author: Uladzislau Latynski
+# This work is a translation from C to Ruby of jsmin.c published by
+# Douglas Crockford.  Permission is hereby granted to use the Ruby
+# version under the same conditions as the jsmin.c on which it is
+# based.
+#
+# /* jsmin.c
+#    2003-04-21
+#
+# Copyright (c) 2002 Douglas Crockford  (www.crockford.com)
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy of
+# this software and associated documentation files (the "Software"), to deal in
+# the Software without restriction, including without limitation the rights to
+# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+# of the Software, and to permit persons to whom the Software is furnished to do
+# so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# The Software shall be used for Good, not Evil.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+EOF = -1
+$theA = ""
+$theB = ""
+
+# isAlphanum -- return true if the character is a letter, digit, underscore,
+# dollar sign, or non-ASCII character
+def isAlphanum(c)
+   return false if !c || c == EOF
+   return ((c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') ||
+           (c >= 'A' && c <= 'Z') || c == '_' || c == '$' ||
+           c == '\\' || c[0] > 126)
+end
+
+# get -- return the next character from stdin. Watch out for lookahead. If
+# the character is a control character, translate it to a space or linefeed.
+def get()
+  c = $stdin.getc
+  return EOF if(!c)
+  c = c.chr
+  return c if (c >= " " || c == "\n" || c.unpack("c") == EOF)
+  return "\n" if (c == "\r")
+  return " "
+end
+
+# Get the next character without getting it.
+def peek()
+    lookaheadChar = $stdin.getc
+    $stdin.ungetc(lookaheadChar)
+    return lookaheadChar.chr
+end
+
+# mynext -- get the next character, excluding comments.
+# peek() is used to see if a '/' is followed by a '/' or '*'.
+def mynext()
+    c = get
+    # saute les commentaires (également les lignes commencant pas ;;)
+    
+    if (c == ";" and peek == ";")
+      while(true)
+          c = get
+          if (c[0] <= "\n"[0])
+            return c
+          end
+      end
+    end
+    if (c == "/")
+       prochain = peek
+        if(prochain  == "/")
+            while(true)
+                c = get
+                if (c[0] <= "\n"[0])
+                  return c
+                end
+            end
+        end
+        if(peek == "*")
+            get
+            while(true)
+                case get
+                when "*"
+                   if (peek == "/")
+                        get
+                        return " "
+                    end
+                when EOF
+                    raise "Unterminated comment"
+                end
+            end
+        end
+    end
+    return c
+end
+
+
+# action -- do something! What you do is determined by the argument: 1
+# Output A. Copy B to A. Get the next B. 2 Copy B to A. Get the next B.
+# (Delete A). 3 Get the next B. (Delete B). action treats a string as a
+# single character. Wow! action recognizes a regular expression if it is
+# preceded by ( or , or =.
+def action(a)
+    if(a==1)
+        $stdout.write $theA
+    end
+    if(a==1 || a==2)
+        $theA = $theB
+        if ($theA == "\'" || $theA == "\"")
+            while (true)
+                $stdout.write $theA
+                $theA = get
+                break if ($theA == $theB)
+                raise "Unterminated string literal" if ($theA <= "\n")
+                if ($theA == "\\")
+                    $stdout.write $theA
+                    $theA = get
+                end
+            end
+        end
+    end
+    if(a==1 || a==2 || a==3)
+        $theB = mynext
+        if ($theB == "/" && ($theA == "(" || $theA == "," || $theA == "=" ||
+                             $theA == ":" || $theA == "[" || $theA == "!" ||
+                             $theA == "&" || $theA == "|" || $theA == "?" ||
+                             $theA == "{" || $theA == "}" || $theA == ";" ||
+                             $theA == "\n"))
+            $stdout.write $theA
+            $stdout.write $theB
+            while (true)
+                $theA = get
+                if ($theA == "/")
+                    break
+                elsif ($theA == "\\")
+                    $stdout.write $theA
+                    $theA = get
+                elsif ($theA <= "\n")
+                    raise "Unterminated RegExp Literal"
+                end
+                $stdout.write $theA
+            end
+            $theB = mynext
+        end
+    end
+end
+
+# jsmin -- Copy the input to the output, deleting the characters which are
+# insignificant to JavaScript. Comments will be removed. Tabs will be
+# replaced with spaces. Carriage returns will be replaced with linefeeds.
+# Most spaces and linefeeds will be removed.
+def jsmin
+    $theA = "\n"
+    action(3)
+    while ($theA != EOF)
+        case $theA
+        when " "
+            if (isAlphanum($theB))
+                action(1)
+            else
+                action(2)
+            end
+        when "\n"
+            case ($theB)
+            when "{","[","(","+","-"
+                action(1)
+            when " "
+                action(3)
+            else
+                if (isAlphanum($theB))
+                    action(1)
+                else
+                    action(2)
+                end
+            end
+        else
+            case ($theB)
+            when " "
+                if (isAlphanum($theA))
+                    action(1)
+                else
+                    action(3)
+                end
+            when "\n"
+                case ($theA)
+                when "}","]",")","+","-","\"","\\", "'", '"'
+                    action(1)
+                else
+                    if (isAlphanum($theA))
+                        action(1)
+                    else
+                        action(3)
+                    end
+                end
+            else
+                action(1)
+            end
+        end
+    end
+end
+
+ARGV.each do |anArg|
+    $stdout.write "// #{anArg}\n"
+end
+
+jsmin
\ No newline at end of file
diff --git a/tools/mise_en_prod.erl b/tools/mise_en_prod.erl
new file mode 100755 (executable)
index 0000000..4b0c685
--- /dev/null
@@ -0,0 +1,17 @@
+#!/usr/bin/env escript
+% coding: utf-8
+
+% Executé sur le serveur après la copie des fichiers lors de la mise en production.
+% Recharge les modules de euphorik et met à jour la BD.
+% TODO : construire le nom du noeud en fonction du nom de l'host
+
+main(_) -> 
+   net_kernel:start([flynux, shortnames]),
+   io:format("rechargement des modules..~n"),
+   _Pid = spawn_link(yaws@overnux, euphorik_daemon, reload_euphorik, []),
+   receive
+      {'EXIT', _, _} ->
+         io:format("mise à jour de la BD..~n"),
+         spawn(yaws@overnux, euphorik_bd, update, [])
+   end.
+
diff --git a/tools/mise_en_prod.rb b/tools/mise_en_prod.rb
new file mode 100755 (executable)
index 0000000..ae0bb8f
--- /dev/null
@@ -0,0 +1,73 @@
+#!/usr/bin/ruby
+=begin
+Copyright 2008 Grégory Burri
+
+This file is part of Euphorik.
+
+Euphorik is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Euphorik is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Euphorik.  If not, see <http://www.gnu.org/licenses/>.
+=end
+
+$rep_remote = '/var/www/euphorik'
+$host = 'euphorik.ch'
+$opt_rsync = ''
+
+def creer_remote_rep(rep)
+   begin
+      `ssh #{$host} "mkdir #{$rep_remote}/#{rep}"`
+   rescue
+   end
+end
+
+
+# Compilation de la partie serveur
+Dir.chdir('../modules')
+puts `make`
+if $?.exitstatus != 0
+   puts "Echec de compilation de la partie serveuse"
+   exit 1
+end
+Dir.chdir('..')
+
+# création du repertoire BD
+creer_remote_rep('BD')
+`ssh #{$host} "chmod g+w #{$rep_remote}/BD"`
+
+# copie de la partie statique : css, images, html, etc..
+print `rsync #{$opt_rsync} index.yaws #{$host}:#{$rep_remote}`
+print `rsync #{$opt_rsync} favicon.ico #{$host}:#{$rep_remote}`
+print `rsync #{$opt_rsync} -r css #{$host}:#{$rep_remote}`
+print `rsync #{$opt_rsync} -r pages #{$host}:#{$rep_remote}`
+print `rsync #{$opt_rsync} -r --exclude 'autres' img #{$host}:#{$rep_remote}`
+
+# copie des js avec minification
+rep_js = 'js'
+creer_remote_rep(rep_js)
+Dir.entries(rep_js).each{|fichier|
+   if fichier[0..0] != "." and fichier != "debug.js"
+      puts "Minimisation et copie de #{fichier}"
+      print `tools/jsmin.rb < #{rep_js}/#{fichier} | ssh #{$host} "cat > #{$rep_remote}/#{rep_js}/#{fichier}"`
+   end
+}
+
+# copie des modules erlang
+creer_remote_rep('modules')
+`rsync #{$opt_rsync} -r --exclude 'euphorik_test.beam' modules/ebin #{$host}:#{$rep_remote}/modules`
+`rsync #{$opt_rsync} -r modules/include #{$host}:#{$rep_remote}/modules`
+
+# attribution des droits
+`ssh #{$host} "chmod -R g+rx #{$rep_remote}"`
+
+# execution du script de mise à jour
+print `cat tools/mise_en_prod.erl | ssh #{$host} "cat > /tmp/mise_en_prod.erl"`
+print `ssh #{$host} "chmod u+x /tmp/mise_en_prod.erl; /tmp/mise_en_prod.erl; rm /tmp/mise_en_prod.erl"`
diff --git a/tools/start_yaws.sh b/tools/start_yaws.sh
new file mode 100755 (executable)
index 0000000..062413a
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/bash
+yaws --conf /etc/yaws/yaws.conf --sname yaws --mnesiadir "../BD/" -I debian_yaws