diff --git a/wp-content/plugins/nextgen-gallery/changelog.txt b/wp-content/plugins/nextgen-gallery/changelog.txt
index 015c0b9fd170ec1d74115ed13f74e4f09f3d6bd0..fcb96679d55ce715ea516514ed73ab0b4ec84451 100644
--- a/wp-content/plugins/nextgen-gallery/changelog.txt
+++ b/wp-content/plugins/nextgen-gallery/changelog.txt
@@ -1,6 +1,180 @@
 NextGEN Gallery
 by Photocrati Media
 
+= V2.0.33 - 10.21.2013 =
+* NEW:     Requests /ngg_tag/[tagname] will create a displayed gallery
+* NEW:     Option added to "Import Gallery" tab to use original images
+* Fixed:   Links are broken on the ngg_tags-sitemap.xml file by WordPress SEO
+* Fixed:   PHP notice: Attempt to assign property of non-object
+* Fixed:   Undefined property warnings when using NextGEN Basic Thumbnails
+* Fixed:   Detect if an applying a transient to a displayed gallery was successful
+* Fixed:   Compatibility issues with BJ-Lazy-Load and Colorbox
+* Fixed:   Pagination conflicts for multiple Imagebrowsers on the same page
+* Fixed:   Ability to display previous exception with debug mode
+* Fixed:   Tagclouds not working in multisite instances
+* Fixed:   Load widgets.css when a widget is being used
+* Fixed:   Installer should remove all instances of the component factory
+* Fixed:   Widget settings interface not intuitive
+* Fixed:   Inability to upload images in some Windows host environments
+* Fixed:   Sorting images/galleries using the Attach To Post interface
+* Fixed:   Fix detection of HTTPS (pull request by Leonhardt Wille)
+* Fixed:   Compilation errors of regular expressions
+* Fixed:   Pro galleries wouldn't display in environments using PHP 5.3.3 or less
+* Fixed:   Scanning of router slug is now limited to the uri, not the url
+* Fixed:   Show slideshow link isn't required for thumbnail/imagebrowser integration
+* Fixed:   WordPress media-upload with 'singlepic' image size
+* Fixed:   Use target=_blank when the link setting is provided for NextGEN Basic Singlepic
+* Fixed:   Only display rendering errors if WP_DEBUG is enabled
+
+
+= V2.0.31 - 10.03.2013 =
+* NEW:     Restored AJAX pagination for NextGEN Basic ImageBrowser display type
+* Fixed:   Compatibility with WordPress Local SEO by Yoast
+* Fixed:   Inability to upload images if image_slug field was missing in database
+* Fixed:   Integration of NextGEN Basic Thumbnail and NextGEN Basic Slideshow display types
+* Fixed:   Photocrati Resource Manager further adjusted to be third-party friendly
+* Fixed:   Added the ability to find legacy templates in both the child/parent theme directories
+* Fixed:   JavaScript errors in Attach to Post interface
+* Fixed:   Router can handle port numbers in urls
+* Fixed:   Carousel template was linking to NextGEN Basic ImageBrowser view
+* Fixed:   SQL query generated for displayed galleries using tags as source
+* Fixed:   3rd party compat: raise & never lower pcre.backtrack_limit
+
+= V2.0.30 - 09.25.2013 =
+* NEW:     Restored the ability to use imagebrowser display type instead of a lightbox effect
+* Changed: Displayed galleries are no longer rendered in RSS feeds
+* Changed: Removed "Plugin Check" widget from overview page
+* Fixed:   Silence PHP warnings/errors in an output buffer for AJAX actions
+* Fixed:   Compatibility issue with WordPress SEO and broken site maps (and large error_logs)
+* Fixed:   Compatibility issue with AJAX Event Calendar (and possibly others)
+* Fixed:   Adjusted Photocrati Resource Manager to be third-party friendly
+* Fixed:   Fixed empty result set for displayed galleries selecting 'All' tags
+* Fixed:   URL generation for imagebrowser pagination links
+* Fixed:   Ensure that image meta is imported on creation
+* Fixed:   Ensure that transients are removed when an external object cache is used
+* Fixed:   Don't load pluggable.php. This will fix plugin conflicts
+* Fixed:   In Attach to Post interface, galleries created in one tab weren't showing in another
+* Fixed:   Don't output frame events cookie for XML-RPC requests
+
+= V2.0.27 - 09.18.2013 =
+* Fixed:   Reduce performance impact of purging displayed gallery transients
+
+= V2.0.25 - 09.18.2013 =
+* Changed: Reverting to the 2.0.21 codebase, due to major performance issues in 2.0.23 and 2.0.24
+
+= V2.0.24 - 09.18.2013 =
+* WARNING: Broken release. Uses wp_clear_scheduled_hooks() to purge cron records
+
+= V2.0.23 - 09.12.2013 =
+* WARNING: Broken release. Major bug creates redundant cron jobs
+* NEW:     WP-Cron job to periodically clean-up displayed gallery transients
+* NEW:     Added "excluded_container_ids" as parameter for ngg_images shortcode
+* Fixed:   Lightbox effect is honoured by all display types
+* Fixed:   Highslide displays images from the correct displayed galleries
+* Fixed:   Ensure that sub-albums display correctly when the word "album" is part of a slug
+* Fixed:   Ensure that sub-albums display correctly when numerical slugs are used
+* Fixed:   Related images heading only added when Related Images functionality is enabled
+* Fixed:   PHP Warning about undefined index when viewing basic albums
+* Fixed:   AJAX handling is third-party compatible
+* Fixed:   Image date is no longer overwritten when an image is modified
+* Fixed:   Fixed issue with displayed galleries using source='tags'
+* Fixed:   Problem with transient cache not getting flushed properly from Other Options page
+* Fixed:   Use correct gallery/transient ID when ajax pagination is used
+
+= V2.0.21 - 09.09.2013 =
+* NEW:	   Multisite support
+* Changed: Default image quality set to 100 for generated images
+* Changed: Removed dependence on simplehtmldom library
+* Fixed:   Related images functionality works as it did in 1.9.x
+* Fixed:   Don't compress inline JavaScript in post/page content
+* Fixed:   Click-to-advance slideshow behavior for slideshows
+* Fixed:   Security warnings from VaultPress
+* Fixed:   View as Slideshow link works with AJAX pagination
+* Fixed:   Broken links on Overview page
+* Fixed:   Backup images option
+* Fixed:   Stylesheet url generated correctly for Windows hosts
+* Fixed:   Compatibility with NextGen Custom Fields plugin
+* Fixed:   Compatibility with Adsense Explosion plugin
+* Fixed:   Suppress wp_footer notices unless WP_DEBUG is set to TRUE
+
+= V2.0.17 - 08.30.2013 =
+Fixed:     Match legacy behaviour when changing gallery path, i.e. don't move files
+
+= V2.0.14 - 08.27.2013 =
+* NEW:     Added the ability to override thumbnail settings for NextGEN Basic Albums
+* NEW:     Shortcode Manager API, which ensures that shortcodes are outputted as intended
+* Changed: Re-added the ability to select the original image size for widgets
+* Fixed:   Ensure that stylesheet url returned is correct for Windows hosts
+* Fixed:   Broken links and lightbox effects with AJAX pagination
+* Fixed:   Try to ensure that third party plugins don't add content to our dynamic JS
+* Fixed:   Improved reliability of iframely.js
+* Fixed:   Ensure that urls are generated correctly in HTTPs environments
+* Fixed:   Datamapper works correctly in environments where temporary tables aren't supported
+* Fixed:   Fixed an issue with thickbox loading animation when home url differs from site url
+
+= V2.0.11 - 08.19.2013 =
+* NEW:     Added "run_ngg_resource_manager" hook to by-pass our resource manager
+* Changed: Removed "Reset & Uninstall" tab, for now
+* Fixed:   Compatibility with W3 Total Cache. Please flush cache after updating.
+* Fixed:   Conflicts with Photocrati Theme Galleries
+* Fixed:   Blank Attach to Post interface window
+* Fixed:   Fixed ability to change Lightbox Effect settings
+* Fixed:   Implemented techniques to ensure WP_Query variables aren't overwritten
+* Fixed:   Enqueuing AJAX JS libraries twice in wp-admin
+* Fixed:   Encoding issues
+* Fixed:   PHP warnings caused by accessing unserialized data as array
+* Fixed:   Fixed installer issues
+
+= V2.0.7 - 08.09.2013 =
+* NEW:     New resource manager that fixes many plugin and theme incompatibilities
+* NEW:     Styles (custom stylesheets) should reside in wp-content/ngg_styles
+* NEW:     Added option to "Other Options -> Misc" to control maximum images returned
+* Secured: Removed default connector for jQuery FileTree library
+* Changed: Updated the simplehtmldom library to version 1.5
+* Changed: jQuery is now enqueued at the beginning of every request
+* Fixed:   Incompatibilities with BuddyPress
+* Fixed:   Incompatibilities with Events+, bbPress, Custom Permalinks, and many other plugins
+* Fixed:   Incompcatibilities with Member Access, AMember, Magic Fields, and More Fields
+* Fixed:   Incompatibilities with Elegant Themes, Oxygen, Responsive, and many other themes
+* Fixed:   Ensure that gallery images don't have a border by default
+* Fixed:   Conflict between imagebrowser and album urls
+* Fixed:   Reverted default gallerypath to wp-content/gallery/
+* Fixed:   Upgrade-safe way of overriding Styles
+* Fixed:   Generation of AJAX url is now based on slug
+* Fixed:   Restore nggShowGallery and nggShowSlideshow as wrappers to new API
+* Fixed:   Always use domain as specified by WordPress Site URL
+* Fixed:   Use WordPress Home URL over Site URL when appropriate
+* Fixed:   Numerous pagination issues
+* Fixed:   Adjusted our forms to comply with WordPress Firewalls
+* Fixed:   Correct use of select2 DOM selector for maximum compatibility
+* Fixed:   Path and URL calculations for Windows and UNIX environments
+* Fixed:   Ensure that pluggable.php is loaded at the start of every request
+* Fixed:   Fancybox: adjust CSS for further box-sizing protection from themes
+* Fixed:   Use PHP 5.2.1 compatible named pattern matching syntax
+* Fixed:   Remove usage of __DIR__ constant not supported by PHP 5.2.x
+* Fixed:   Removed dependency on mb_string PHP module
+* Fixed:   Allow "No Lightbox" as an option for Lightbox Effects
+* Fixed:   Warning: "Invalid CRT parameters detected" for Windows environments
+
+= V2.0 - 07.30.2013 =
+* NEW:	   Improved user experience throughout the plugin, settings and usage.
+* NEW:     Plupload queue uploader that allows for bulk and zip uploads within the same interface.
+* NEW:     Complete redesign of the NextGEN options panel
+* NEW:     Added new interface for adding galleries from pages and posts.
+* NEW:     Galleries are now mobile friendly and responsive, which is most noticeable with a responsive theme.
+* NEW:     Streamlined functionality for displaying galleries based on tags.
+* NEW:     Architecture based on Pope Framework (http://bitbucket.org/photocrati/pope-framework)
+* NEW:     New shortcode, “ngg_images”, and corresponding Attach to Post interface
+* NEW:     Galleries have now global and instance settings
+* NEW:     Support for FastCGI environments
+* Changed: Replaces shortcodes with placeholder images, however still supports legacy shortcodes.
+* Changed: Introduced new Growl-like notifications
+* Changed: The container and it’s images are centered for slideshows
+* Changed: NextGEN styles now override vs replace default styles
+* Changed: NextGEN legacy templates have been deprecated (but still function)
+* FIXED:   The ability to use NextGEN image as a Featured Image.
+* FIXED:   Many bugs and annoyances, such as PHP warnings, errors, etc.
+
 = V1.9.13 - 06.11.2013 =
 * NEW:     Slideshows are now centered to their content area     
 * Secured: Ensure that only logged in users can upload images
@@ -31,6 +205,7 @@ by Photocrati Media
 * Fixed:   Deleted galleries within an album are handed gracefully without warning messages
 * Fixed:   Correct use of register_uninstall_hook
 * Fixed:   CSS and usability issues with the TinyMCE window used to display galleries
+* Fixed:   Inability to generate new image slugs
 
 = V1.9.9 - 12.14.2012 =
 * NEW:	   JW ImageRotator v3.17 is now bundled with the plugin and used by default.
diff --git a/wp-content/plugins/nextgen-gallery/license.txt b/wp-content/plugins/nextgen-gallery/license.txt
new file mode 100644
index 0000000000000000000000000000000000000000..1f963da0d1ca40ea60730c03befcbbc6771740c3
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/license.txt
@@ -0,0 +1,340 @@
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+                            NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+                     END OF TERMS AND CONDITIONS
+
+            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
+convey 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 2 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, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision 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, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This 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.
+
diff --git a/wp-content/plugins/nextgen-gallery/nggallery.php b/wp-content/plugins/nextgen-gallery/nggallery.php
index 41a895cf9e73d6a1c5ff6bdeccd24e8e3f486020..01e4f91fead84f21d3362ca36de2cd1250e3911e 100644
--- a/wp-content/plugins/nextgen-gallery/nggallery.php
+++ b/wp-content/plugins/nextgen-gallery/nggallery.php
@@ -1,593 +1,506 @@
 <?php
-/*
-Plugin Name: NextGEN Gallery
-Plugin URI: http://www.nextgen-gallery.com/
-Description: A NextGENeration Photo Gallery for WordPress
-Author: Photocrati
-Author URI: http://www.photocrati.com/
-Version: 1.9.13
-
-Copyright (c) 2007-2011 by Alex Rabe & NextGEN DEV-Team
-Copyright (c) 2012 Photocrati Media
-
-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 2 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, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-// Stop direct call
 if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
 
 /**
- * Indicates that a clean exit occured. Handled by set_exception_handler
+ * Plugin Name: NextGEN Gallery by Photocrati
+ * Description: The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 7 million downloads.
+ * Version: 2.0.33
+ * Author: Photocrati Media
+ * Plugin URI: http://www.nextgen-gallery.com
+ * Author URI: http://www.photocrati.com
+ * License: GPLv2
  */
-if (!class_exists('E_Clean_Exit')) {
-	class E_Clean_Exit extends RuntimeException
-	{
-
-	}
-}
 
+if (!class_exists('E_Clean_Exit')) { class E_Clean_Exit extends RuntimeException {} }
 
 /**
- * Loads the NextGEN plugin
+ * NextGEN Gallery is built on top of the Photocrati Pope Framework:
+ * https://bitbucket.org/photocrati/pope-framework
+ *
+ * Pope constructs applications by assembling modules.
+ *
+ * The Bootstrapper. This class performs the following:
+ * 1) Loads the Pope Framework
+ * 2) Adds a path to the C_Component_Registry instance to search for products
+ * 3) Loads all found Products. A Product is a collection of modules with some
+ * additional meta data. A Product is responsible for loading any modules it
+ * requires.
+ * 4) Once all Products (and their associated modules) have been loaded (or in
+ * otherwords, "included"), the modules are initialized.
  */
-if (!class_exists('nggLoader')) {
-	class nggLoader {
-
-		var $version     = '1.9.13';
-		var $dbversion   = '1.8.1';
-		var $minimum_WP  = '3.5';
-		var $donators    = 'http://www.nextgen-gallery.com/donators.php';
-		var $options     = '';
-		var $manage_page;
-		var $add_PHP5_notice = false;
-
-		function nggLoader() {
-
-			// Stop the plugin if we missed the requirements
-			if ( ( !$this->required_version() ) || ( !$this->check_memory_limit() ) )
-				return;
-
-			// Set error handler
-			set_exception_handler(array(&$this, 'exception_handler'));
-
-			// Get some constants first
-			$this->load_options();
-			$this->define_constant();
-			$this->define_tables();
-			$this->load_dependencies();
-			$this->start_rewrite_module();
-
-			$this->plugin_name = basename(dirname(__FILE__)).'/'.basename(__FILE__);
-
-			// Init options & tables during activation & deregister init option
-			register_activation_hook( $this->plugin_name, array(&$this, 'activate') );
-			register_deactivation_hook( $this->plugin_name, array(&$this, 'deactivate') );
-
-			// Register a uninstall hook to remove all tables & option automatic
-			register_uninstall_hook( $this->plugin_name, array(__CLASS__, 'uninstall') );
-
-			// Start this plugin once all other plugins are fully loaded
-			add_action( 'plugins_loaded', array(&$this, 'start_plugin') );
+class C_NextGEN_Bootstrap
+{
+	var $_registry = NULL;
+	var $_settings_option_name = 'ngg_options';
+	var $_pope_loaded = FALSE;
+	static $debug = WP_DEBUG;
+
+	static function shutdown($exception=NULL)
+	{
+		if (is_null($exception)) {
+			throw new E_Clean_Exit;
+		}
+		elseif (!($exception instanceof E_Clean_Exit)) {
+			ob_end_clean();
+			self::print_exception($exception);
+		}
 
-			// Register_taxonomy must be used during the init
-			add_action( 'init', array(&$this, 'register_taxonomy') );
-			add_action( 'wpmu_new_blog', array(&$this, 'multisite_new_blog'), 10, 6);
+	}
 
-			// Add a message for PHP4 Users, can disable the update message later on
-			if (version_compare(PHP_VERSION, '5.0.0', '<'))
-				add_filter('transient_update_plugins', array(&$this, 'disable_upgrade'));
+	static function print_exception($exception)
+	{
+		$klass = get_class($exception);
+		echo "<h1>{$klass} thrown</h1>";
+		echo "<p>{$exception->getMessage()}</p>";
+		if (self::$debug OR (defined('NEXTGEN_GALLERY_DEBUG') AND NEXTGEN_GALLERY_DEBUG == TRUE)) {
+			echo "<h3>Where:</h3>";
+			echo "<p>On line <strong>{$exception->getLine()}</strong> of <strong>{$exception->getFile()}</strong></p>";
+			echo "<h3>Trace:</h3>";
+			echo "<pre>{$exception->getTraceAsString()}</pre>";
+			if (method_exists($exception, 'getPrevious')) {
+				if (($previous = $exception->getPrevious())) {
+					self::print_exception($previous);
+				}
+			}
+		}
+	}
 
-			//Add some links on the plugin page
-			add_filter('plugin_row_meta', array(&$this, 'add_plugin_links'), 10, 2);
+	function __construct()
+	{
+		// Boostrap
+		set_exception_handler(__CLASS__.'::shutdown');
 
-			// Check for the header / footer
-			add_action( 'init', array(&$this, 'test_head_footer_init' ) );
+		$this->_define_constants();
+		$this->_load_non_pope();
+		$this->_register_hooks();
+		$this->_load_pope();
 
-			// Show NextGEN version in header
-			add_action('wp_head', array('nggGallery', 'nextgen_version') );
+	}
 
-			// Handle upload requests
-			add_action('init', array(&$this, 'handle_upload_request'));
+	function _load_non_pope()
+	{
+		// Load caching component
+		include_once('non_pope/class.photocrati_cache.php');
+		C_Photocrati_Cache::get_instance();
+		C_Photocrati_Cache::get_instance('displayed_galleries');
+		C_Photocrati_Cache::$enabled = TRUE;
+
+		if (isset($_REQUEST['ngg_flush'])) {
+			C_Photocrati_Cache::flush('all');
+			$_SERVER['QUERY_STRING'] = str_replace('ngg_flush=1', '', $_SERVER['QUERY_STRING']);
+		}
+		elseif (isset($_REQUEST['ngg_force_update'])) {
+			C_Photocrati_Cache::$do_not_lookup = TRUE;
+			C_Photocrati_Cache::$force_update = TRUE;
+			$_SERVER['QUERY_STRING'] = str_replace('ngg_force_update=1', '', $_SERVER['QUERY_STRING']);
+		}
+		elseif (isset($_REQUEST['ngg_flush_expired'])) {
+			C_Photocrati_Cache::flush('all', TRUE);
+			$_SERVER['QUERY_STRING'] = str_replace('ngg_flush_expired=1', '', $_SERVER['QUERY_STRING']);
 		}
 
-		function start_plugin() {
-
-			global $nggRewrite;
-
-			// Load the language file
-			$this->load_textdomain();
+		// Load Settings Manager
+		include_once('non_pope/class.photocrati_settings_manager.php');
+		include_once('non_pope/class.nextgen_settings.php');
+		C_Photocrati_Global_Settings_Manager::$option_name = $this->_settings_option_name;
+		C_Photocrati_Settings_Manager::$option_name = $this->_settings_option_name;
 
-			// All credits to the tranlator
-			$this->translator  = '<p class="hint">'. __('<strong>Translation by : </strong><a target="_blank" href="http://alexrabe.de/wordpress-plugins/nextgen-gallery/languages/">See here</a>', 'nggallery') . '</p>';
-			$this->translator .= '<p class="hint">'. __('<strong>This translation is not yet updated for Version 1.9.0</strong>. If you would like to help with translation, download the current po from the plugin folder and read <a href="http://alexrabe.de/wordpress-plugins/wordtube/translation-of-plugins/">here</a> how you can translate the plugin.', 'nggallery') . '</p>';
+		// Load the installer
+		include_once('non_pope/class.photocrati_installer.php');
 
-			// Content Filters
-			add_filter('ngg_gallery_name', 'sanitize_title');
+		// Load the resource manager
+		include_once('non_pope/class.photocrati_resource_manager.php');
+		C_Photocrati_Resource_Manager::init();
 
-			// Check if we are in the admin area
-			if ( is_admin() ) {
+		// Load the style manager
+		include_once('non_pope/class.nextgen_style_manager.php');
 
-				// Pass the init check or show a message
-				if (get_option( 'ngg_init_check' ) != false )
-					add_action( 'admin_notices', create_function('', 'echo \'<div id="message" class="error"><p><strong>' . get_option( "ngg_init_check" ) . '</strong></p></div>\';') );
+		// Load the shortcode manager
+		include_once('non_pope/class.nextgen_shortcode_manager.php');
+	}
 
-			} else {
+	/**
+	 * Loads the Pope Framework
+	 */
+	function _load_pope()
+	{
+		// No need to initialize pope again
+		if ($this->_pope_loaded) return;
 
-				// Add MRSS to wp_head
-				if ( $this->options['useMediaRSS'] )
-					add_action('wp_head', array('nggMediaRss', 'add_mrss_alternate_link'));
+		// Pope requires a a higher limit
+        	$tmp = ini_get('xdebug.max_nesting_level');
+	        if ($tmp && (int)$tmp <= 300) @ini_set('xdebug.max_nesting_level', 300);
 
-				// Look for XML request, before page is render
-				add_action('parse_request',  array(&$this, 'check_request') );
+		// Include pope framework
+		require_once(path_join(NEXTGEN_GALLERY_PLUGIN_DIR, implode(
+			DIRECTORY_SEPARATOR, array('pope','lib','autoload.php')
+		)));
 
-				// Add the script and style files
-				add_action('wp_enqueue_scripts', array(&$this, 'load_scripts') );
-				add_action('wp_enqueue_scripts', array(&$this, 'load_styles') );
+		// Get the component registry
+		$this->_registry = C_Component_Registry::get_instance();
 
-			}
-		}
+		// Add the default Pope factory utility, C_Component_Factory
+		$this->_registry->add_utility('I_Component_Factory', 'C_Component_Factory');
 
-		function check_request( $wp ) {
+		// Load embedded products. Each product is expected to load any
+		// modules required
+		$this->_registry->add_module_path(NEXTGEN_GALLERY_PRODUCT_DIR, true, false);
+		$this->_registry->load_all_products();
 
-			if ( !array_key_exists('callback', $wp->query_vars) )
-				return;
+	        // Give third-party plugins that opportunity to include their own products
+        	// and modules
+	        do_action('load_nextgen_gallery_modules', $this->_registry);
 
-			if ( $wp->query_vars['callback'] == 'imagerotator') {
-				require_once (dirname (__FILE__) . '/xml/imagerotator.php');
-				exit();
-			}
+		// Initializes all loaded modules
+		$this->_registry->initialize_all_modules();
 
-			if ( $wp->query_vars['callback'] == 'json') {
-				require_once (dirname (__FILE__) . '/xml/json.php');
-				exit();
-			}
+		// Set the document root
+		$this->_registry->get_utility('I_Fs')->set_document_root(ABSPATH);
 
-			if ( $wp->query_vars['callback'] == 'image') {
-				require_once (dirname (__FILE__) . '/nggshow.php');
-				exit();
-			}
+		$this->_pope_loaded = TRUE;
+	}
 
-			//TODO:see trac #12400 could be an option for WP3.0
-			if ( $wp->query_vars['callback'] == 'ngg-ajax') {
-				require_once (dirname (__FILE__) . '/xml/ajax.php');
-				exit();
-			}
 
+	/**
+	 * Registers hooks for the WordPress framework necessary for instantiating
+	 * the plugin
+	 */
+	function _register_hooks()
+	{
+		// Load text domain
+		load_plugin_textdomain(
+			NEXTGEN_GALLERY_I8N_DOMAIN,
+			false,
+			$this->directory_path('lang')
+		);
+
+		// Register the activation routines
+		add_action('activate_'.NEXTGEN_GALLERY_PLUGIN_BASENAME, array(get_class(), 'activate'));
+
+		// Register the deactivation routines
+		add_action('deactivate_'.NEXTGEN_GALLERY_PLUGIN_BASENAME, array(get_class(), 'deactivate'));
+
+		// Register our test suite
+		add_filter('simpletest_suites', array(&$this, 'add_testsuite'));
+
+		// Ensure that settings manager is saved as an array
+		add_filter('pre_update_option_'.$this->_settings_option_name, array(&$this, 'persist_settings'));
+		add_filter('pre_update_site_option_'.$this->_settings_option_name, array(&$this, 'persist_settings'));
+
+		// This plugin uses jQuery extensively
+		add_action('init', array(&$this, 'enqueue_jquery'), 1);
+		add_action('wp_print_scripts', array(&$this, 'fix_jquery'));
+		add_action('admin_print_scripts', array(&$this, 'fix_jquery'));
+
+		// If the selected stylesheet is using an unsafe path, then notify the user
+		if (C_NextGen_Style_Manager::get_instance()->is_directory_unsafe()) {
+			add_action('all_admin_notices', array(&$this, 'display_stylesheet_notice'));
 		}
 
-		function required_version() {
-
-			global $wp_version;
-
-			// Check for WP version installation
-			$wp_ok  =  version_compare($wp_version, $this->minimum_WP, '>=');
-
-			if ( ($wp_ok == FALSE) ) {
-				add_action(
-					'admin_notices',
-					create_function(
-						'',
-						'global $ngg; printf (\'<div id="message" class="error"><p><strong>\' . __(\'Sorry, NextGEN Gallery works only under WordPress %s or higher\', "nggallery" ) . \'</strong></p></div>\', $ngg->minimum_WP );'
-					)
-				);
-				return false;
-			}
-
-			return true;
-
+		// Delete displayed gallery transients periodically
+		add_action('ngg_delete_expired_transients', array(&$this, 'delete_expired_transients'));
+		if (!wp_next_scheduled('ngg_delete_expired_transients')) {
+			wp_schedule_event(time(), 'hourly', 'ngg_delete_expired_transients');
 		}
 
-		function check_memory_limit() {
+		// Update modules
+		add_action('init', array(&$this, 'update'), PHP_INT_MAX);
 
-			// get the real memory limit before some increase it
-			$this->memory_limit = ini_get('memory_limit');
+		// Start the plugin!
+		add_action('init', array(&$this, 'route'), PHP_INT_MAX);
+	}
 
-			// PHP docs : Note that to have no memory limit, set this directive to -1.
-			if ($this->memory_limit == -1 ) return true;
+	function delete_expired_transients()
+	{
+		C_Photocrati_Cache::flush('displayed_galleries', TRUE);
+	}
 
-			// Yes, we reached Gigabyte limits, so check if it's a megabyte limit
-			if (strtolower( substr($this->memory_limit, -1) ) == 'm') {
+	/**
+	 * Ensure that C_Photocrati_Settings_Manager gets persisted as an array
+	 * @param $settings
+	 * @return array
+	 */
+	function persist_settings($settings)
+	{
+		if (is_object($settings) && $settings instanceof C_Photocrati_Settings_Manager_Base) {
+			$settings = $settings->to_array();
+		}
+		return $settings;
+	}
 
-				$this->memory_limit = (int) substr( $this->memory_limit, 0, -1);
+	/**
+	 * Enqueues jQuery
+	 */
+	function enqueue_jquery()
+	{
+		wp_enqueue_script('jquery');
+	}
 
-				//This works only with enough memory, 16MB is silly, wordpress requires already 16MB :-)
-				if ( ($this->memory_limit != 0) && ($this->memory_limit < 16 ) ) {
-					add_action(
-						'admin_notices',
-						create_function(
-							'',
-							'echo \'<div id="message" class="error"><p><strong>' . __('Sorry, NextGEN Gallery works only with a Memory Limit of 16 MB or higher', 'nggallery') . '</strong></p></div>\';'
-						)
-					);
-					return false;
-				}
+	/**
+	 * Ensures that the latest version of jQuery bundled with WordPress is used
+	 */
+	function fix_jquery()
+	{
+		global $wp_scripts;
+
+		if (isset($wp_scripts->registered['jquery'])) {
+			$jquery = $wp_scripts->registered['jquery'];
+			if (!isset($jquery->ver) OR version_compare('1.8', $jquery->ver) == 1) {
+				ob_start();
+				wp_deregister_script('jquery');
+				ob_end_clean();
+				wp_register_script('jquery', false, array( 'jquery-core', 'jquery-migrate' ), '1.10.0' );
 			}
-
-			return true;
-
 		}
+		else wp_register_script( 'jquery', false, array( 'jquery-core', 'jquery-migrate' ), '1.10.0' );
 
-		function define_tables() {
-			global $wpdb;
-
-			// add database pointer
-			$wpdb->nggpictures					= $wpdb->prefix . 'ngg_pictures';
-			$wpdb->nggallery					= $wpdb->prefix . 'ngg_gallery';
-			$wpdb->nggalbum						= $wpdb->prefix . 'ngg_album';
+		wp_enqueue_script('jquery');
+	}
 
-		}
+	/**
+	 * Displays a notice to the user that the current stylesheet location is unsafe
+	 */
+	function display_stylesheet_notice()
+	{
+		$styles		= C_NextGen_Style_Manager::get_instance();
+		$filename	= $styles->get_selected_stylesheet();
+		$abspath	= $styles->find_selected_stylesheet_abspath();
+		$newpath	= $styles->new_dir;
+
+		echo "<div class='updated error'>
+			<h3>WARNING: NextGEN Gallery Stylesheet NOT Upgrade-safe</h3>
+			<p>
+			<strong>{$filename}</strong> is currently stored in <strong>{$abspath}</strong>, which isn't upgrade-safe. Please move the stylesheet to
+			<strong>{$newpath}</strong> to ensure that your customizations persist after updates.
+		</p></div>";
+	}
 
-		function register_taxonomy() {
-			global $wp_rewrite;
+	/**
+	 * Updates all modules
+	 */
+	function update()
+	{
+		$this->_load_pope();
 
-			// Register the NextGEN taxonomy
-			$args = array(
-					'label' => __('Picture tag', 'nggallery'),
-					'template' => __('Picture tag: %2$l.', 'nggallery'),
-					'helps' => __('Separate picture tags with commas.', 'nggallery'),
-					'sort' => true,
-					'args' => array('orderby' => 'term_order')
-					);
+		// Try updating all modules
+		C_Photocrati_Installer::update();
+	}
 
-			register_taxonomy( 'ngg_tag', 'nggallery', $args );
+	/**
+	 * Routes access points using the Pope Router
+	 * @return boolean
+	 */
+	function route()
+	{
+		$this->_load_pope();
+		$router = $this->_registry->get_utility('I_Router');
+		if (!$router->serve_request() && $router->has_parameter_segments()) {
+			return $router->passthru();
 		}
+	}
 
-		function define_constant() {
-
-			global $wp_version;
-
-			//TODO:SHOULD BE REMOVED LATER
-			define('NGGVERSION', $this->version);
-			// Minimum required database version
-			define('NGG_DBVERSION', $this->dbversion);
+	/**
+	 * Run the installer
+	 */
+	static function activate($network=FALSE)
+	{
+		C_Photocrati_Installer::update();
+	}
 
-			// required for Windows & XAMPP
-			define('WINABSPATH', str_replace("\\", "/", ABSPATH) );
+	/**
+	 * Run the uninstaller
+	 */
+	static function deactivate()
+	{
+		C_Photocrati_Installer::uninstall(NEXTGEN_GALLERY_PLUGIN_BASENAME);
+	}
 
-			// define URL
-			define('NGGFOLDER', basename( dirname(__FILE__) ) );
+	/**
+	 * Defines necessary plugins for the plugin to load correctly
+	 */
+	function _define_constants()
+	{
+		// NextGEN by Photocrati Constants
+		define('NEXTGEN_GALLERY_PLUGIN', basename($this->directory_path()));
+		define('NEXTGEN_GALLERY_PLUGIN_BASENAME', plugin_basename(__FILE__));
+		define('NEXTGEN_GALLERY_PLUGIN_DIR', $this->directory_path());
+		define('NEXTGEN_GALLERY_PLUGIN_URL', $this->path_uri());
+		define('NEXTGEN_GALLERY_I8N_DOMAIN', 'nggallery');
+		define('NEXTGEN_GALLERY_TESTS_DIR', path_join(NEXTGEN_GALLERY_PLUGIN_DIR, 'tests'));
+		define('NEXTGEN_GALLERY_PRODUCT_DIR', path_join(NEXTGEN_GALLERY_PLUGIN_DIR, 'products'));
+		define('NEXTGEN_GALLERY_PRODUCT_URL', path_join(NEXTGEN_GALLERY_PLUGIN_URL, 'products'));
+		define('NEXTGEN_GALLERY_MODULE_DIR', path_join(NEXTGEN_GALLERY_PRODUCT_DIR, 'photocrati_nextgen/modules'));
+		define('NEXTGEN_GALLERY_MODULE_URL', path_join(NEXTGEN_GALLERY_PRODUCT_URL, 'photocrati_nextgen/modules'));
+		define('NEXTGEN_GALLERY_PLUGIN_CLASS', path_join(NEXTGEN_GALLERY_PLUGIN_DIR, 'module.NEXTGEN_GALLERY_PLUGIN.php'));
+		define('NEXTGEN_GALLERY_PLUGIN_STARTED_AT', microtime());
+		define('NEXTGEN_GALLERY_PLUGIN_VERSION', '2.0.33');
+	}
 
-			define('NGGALLERY_ABSPATH', trailingslashit( str_replace("\\","/", WP_PLUGIN_DIR . '/' . NGGFOLDER ) ) );
-			define('NGGALLERY_URLPATH', trailingslashit( plugins_url( NGGFOLDER ) ) );
 
-			// look for imagerotator
-			define('NGGALLERY_IREXIST', !empty( $this->options['irURL'] ));
+	/**
+	 * Defines the NextGEN Test Suite
+	 * @param array $suites
+	 * @return array
+	 */
+	function add_testsuite($suites=array())
+	{
+		$tests_dir = NEXTGEN_GALLERY_TESTS_DIR;
 
-			// get value for safe mode
-			if ( (gettype( ini_get('safe_mode') ) == 'string') ) {
-				// if sever did in in a other way
-				if ( ini_get('safe_mode') == 'off' ) define('SAFE_MODE', FALSE);
-				else define( 'SAFE_MODE', ini_get('safe_mode') );
-			} else
-			define( 'SAFE_MODE', ini_get('safe_mode') );
+		if (file_exists($tests_dir)) {
 
-			if ( version_compare($wp_version, '3.2.999', '>') )
-				define('IS_WP_3_3', TRUE);
+			// Include mock objects
+			// TODO: These mock objects should be moved to the appropriate
+			// test folder
+			require_once(path_join($tests_dir, 'mocks.php'));
 
-		}
+			// Define the NextGEN Test Suite
+            $suites['nextgen'] = array(
+//                path_join($tests_dir, 'mvc'),
+                path_join($tests_dir, 'datamapper'),
+                path_join($tests_dir, 'nextgen_data'),
+                path_join($tests_dir, 'gallery_display')
+            );
+        }
 
-		function load_dependencies() {
-
-			// Load global libraries												// average memory usage (in bytes)
-			require_once (dirname (__FILE__) . '/lib/core.php');					//  94.840
-			require_once (dirname (__FILE__) . '/lib/ngg-db.php');					// 132.400
-			require_once (dirname (__FILE__) . '/lib/image.php');					//  59.424
-			require_once (dirname (__FILE__) . '/lib/tags.php');				    // 117.136
-			require_once (dirname (__FILE__) . '/lib/post-thumbnail.php');			//  n.a.
-			require_once (dirname (__FILE__) . '/widgets/widgets.php');				// 298.792
-			require_once (dirname (__FILE__) . '/lib/multisite.php');
-			require_once (dirname (__FILE__) . '/lib/sitemap.php');
-
-			// Load frontend libraries
-			require_once (dirname (__FILE__) . '/lib/navigation.php');		        // 242.016
-			require_once (dirname (__FILE__) . '/nggfunctions.php');		        // n.a.
-			require_once (dirname (__FILE__) . '/lib/shortcodes.php'); 		        // 92.664
-
-			//Just needed if you access remote to WordPress
-			if ( defined('XMLRPC_REQUEST') )
-				require_once (dirname (__FILE__) . '/lib/xmlrpc.php');
-
-			// We didn't need all stuff during a AJAX operation
-			if ( defined('DOING_AJAX') )
-				require_once (dirname (__FILE__) . '/admin/ajax.php');
-			else {
-				require_once (dirname (__FILE__) . '/lib/meta.php');				// 131.856
-				require_once (dirname (__FILE__) . '/lib/media-rss.php');			//  82.768
-				require_once (dirname (__FILE__) . '/lib/rewrite.php');				//  71.936
-				include_once (dirname (__FILE__) . '/admin/tinymce/tinymce.php'); 	//  22.408
-
-				// Load backend libraries
-				if ( is_admin() ) {
-					require_once (dirname (__FILE__) . '/admin/admin.php');
-					require_once (dirname (__FILE__) . '/admin/media-upload.php');
-					$this->nggAdminPanel = new nggAdminPanel();
-				}
-			}
-		}
+		return $suites;
+	}
 
-		function load_textdomain() {
 
-			load_plugin_textdomain('nggallery', false, NGGFOLDER . '/lang');
+	/**
+	 * Returns the path to a file within the plugin root folder
+	 * @param type $file_name
+	 * @return type
+	 */
+	function file_path($file_name=NULL)
+	{
+		$path = dirname(__FILE__);
 
+		if ($file_name != null)
+		{
+			$path .= '/' . $file_name;
 		}
 
-		function load_scripts() {
-
-			// if you don't want that NGG load the scripts, add this constant
-			if ( defined('NGG_SKIP_LOAD_SCRIPTS') )
-				return;
-
-			//	activate Thickbox
-			if ($this->options['thumbEffect'] == 'thickbox') {
-				wp_enqueue_script( 'thickbox' );
-				// Load the thickbox images after all other scripts
-				add_action( 'wp_footer', array(&$this, 'load_thickbox_images'), 11 );
+		return str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $path);
+	}
 
-			}
 
-			// activate jquery.lightbox
-			if ($this->options['thumbEffect'] == 'lightbox') {
-				wp_enqueue_script('jquery');
-			}
+	/**
+	 * Gets the directory path used by the plugin
+	 * @return string
+	 */
+	function directory_path($dir=NULL)
+	{
+		return $this->file_path($dir);
+	}
 
-			// activate modified Shutter reloaded if not use the Shutter plugin
-			if ( ($this->options['thumbEffect'] == "shutter") && !function_exists('srel_makeshutter') ) {
-				wp_register_script('shutter', NGGALLERY_URLPATH .'shutter/shutter-reloaded.js', false ,'1.3.3');
-				wp_localize_script('shutter', 'shutterSettings', array(
-							'msgLoading' => __('L O A D I N G', 'nggallery'),
-							'msgClose' => __('Click to Close', 'nggallery'),
-							'imageCount' => '1'
-				) );
-				wp_enqueue_script( 'shutter' );
-			}
 
-			// required for the slideshow
-			if ( NGGALLERY_IREXIST == true && $this->options['enableIR'] == '1' && nggGallery::detect_mobile_phone() === false )
-				wp_enqueue_script('swfobject');
-			else {
-				wp_register_script('jquery-cycle', NGGALLERY_URLPATH .'js/jquery.cycle.all.min.js', array('jquery'), '2.9995');
-				wp_enqueue_script('ngg-slideshow', NGGALLERY_URLPATH .'js/ngg.slideshow.min.js', array('jquery-cycle'), '1.06');
+	/**
+	 * Determines the location of the plugin - within a theme or plugin
+	 * @return string
+	 */
+	function get_plugin_location()
+	{
+		$path = dirname(__FILE__);
+		$gallery_dir = strtolower($path);
+		$gallery_dir = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $gallery_dir);
 
-			}
+		$theme_dir = strtolower(get_stylesheet_directory());
+		$theme_dir = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $theme_dir);
 
-			// Load AJAX navigation script, works only with shutter script as we need to add the listener
-			if ( $this->options['galAjaxNav'] ) {
-				if ( ($this->options['thumbEffect'] == "shutter") || function_exists('srel_makeshutter') ) {
-					wp_enqueue_script ( 'ngg_script', NGGALLERY_URLPATH . 'js/ngg.js', array('jquery'), '2.1');
-					wp_localize_script( 'ngg_script', 'ngg_ajax', array('path'		=> NGGALLERY_URLPATH,
-																		'callback'  => trailingslashit( home_url() ) . 'index.php?callback=ngg-ajax',
-																		'loading'	=> __('loading', 'nggallery'),
-					) );
-				}
-			}
+		$plugin_dir = strtolower(WP_PLUGIN_DIR);
+		$plugin_dir = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $plugin_dir);
 
-			// If activated, add PicLens/Cooliris javascript to footer
-			if ( $this->options['usePicLens'] )
-				nggMediaRss::add_piclens_javascript();
+		$common_dir_theme = substr($gallery_dir, 0, strlen($theme_dir));
+		$common_dir_plugin = substr($gallery_dir, 0, strlen($plugin_dir));
 
+		if ($common_dir_theme == $theme_dir)
+		{
+			return 'theme';
 		}
 
-		function load_thickbox_images() {
-			// WP core reference relative to the images. Bad idea
-			echo "\n" . '<script type="text/javascript">tb_pathToImage = "' . site_url() . '/wp-includes/js/thickbox/loadingAnimation.gif";tb_closeImage = "' . site_url() . '/wp-includes/js/thickbox/tb-close.png";</script>'. "\n";
+		if ($common_dir_plugin == $plugin_dir)
+		{
+			return 'plugin';
 		}
 
-		function load_styles() {
-
-			// check first the theme folder for a nggallery.css
-			if ( nggGallery::get_theme_css_file() )
-				wp_enqueue_style('NextGEN', nggGallery::get_theme_css_file() , false, '1.0.0', 'screen');
-			else if ($this->options['activateCSS'])
-				wp_enqueue_style('NextGEN', NGGALLERY_URLPATH . 'css/' . $this->options['CSSfile'], false, '1.0.0', 'screen');
+		$parent_dir = dirname($path);
 
-			//	activate Thickbox
-			if ($this->options['thumbEffect'] == 'thickbox')
-				wp_enqueue_style( 'thickbox');
-
-			// activate modified Shutter reloaded if not use the Shutter plugin
-			if ( ($this->options['thumbEffect'] == 'shutter') && !function_exists('srel_makeshutter') )
-				wp_enqueue_style('shutter', NGGALLERY_URLPATH .'shutter/shutter-reloaded.css', false, '1.3.4', 'screen');
-
-		}
-
-		function load_options() {
-			// Load the options
-			$this->options = get_option('ngg_options');
+		if (file_exists($parent_dir . DIRECTORY_SEPARATOR . 'style.css'))
+		{
+			return 'theme';
 		}
 
-		// Add rewrite rules
-		function start_rewrite_module() {
-			global $nggRewrite;
-
-			if ( class_exists('nggRewrite') )
-				$nggRewrite = new nggRewrite();
-		}
+		return 'plugin';
+	}
 
-		// THX to Shiba for the code
-		// See: http://shibashake.com/wordpress-theme/write-a-plugin-for-wordpress-multi-site
-		function multisite_new_blog($blog_id, $user_id, $domain, $path, $site_id, $meta ) {
-			global $wpdb;
 
-			include_once (dirname (__FILE__) . '/admin/install.php');
+	/**
+	 * Gets the URI for a particular path
+	 * @param string $path
+	 * @param boolean $url_encode
+	 * @return string
+	 */
+	function path_uri($path = null, $url_encode = false)
+	{
+		$location = $this->get_plugin_location();
+		$uri = null;
 
-			if (is_plugin_active_for_network( $this->plugin_name )) {
-				$current_blog = $wpdb->blogid;
-				switch_to_blog($blog_id);
-				nggallery_install();
-				switch_to_blog($current_blog);
-			}
-		}
+		$path = str_replace(array('/', '\\'), '/', $path);
 
-		/**
-		 * Removes all transients created by NextGEN. Called during activation
-		 * and deactivation routines
-		 */
-		static function remove_transients()
+		if ($url_encode)
 		{
-			global $wpdb, $_wp_using_ext_object_cache;
-
-			// Fetch all transients
-			$query = "
-				SELECT option_name FROM {$wpdb->options}
-				WHERE option_name LIKE '%ngg_request%'
-			";
-			$transient_names = $wpdb->get_col($query);;
-
-			// Delete all transients in the database
-			$query = "
-				DELETE FROM {$wpdb->options}
-				WHERE option_name LIKE '%ngg_request%'
-			";
-			$wpdb->query($query);
-
-			// If using an external caching mechanism, delete the cached items
-			if ($_wp_using_ext_object_cache) {
-				foreach ($transient_names as $transient) {
-					wp_cache_delete($transient, 'transient');
-					wp_cache_delete(substr($transient, 11), 'transient');
-				}
-			}
-		}
-
-		function activate() {
-			global $wpdb;
-			//Starting from version 1.8.0 it's works only with PHP5.2
-			if (version_compare(PHP_VERSION, '5.2.0', '<')) {
-					deactivate_plugins($this->plugin_name); // Deactivate ourself
-					wp_die("Sorry, but you can't run this plugin, it requires PHP 5.2 or higher.");
-					return;
-			}
+			$path_list = explode('/', $path);
 
-			// Clean up transients
-			self::remove_transients();
-
-			include_once (dirname (__FILE__) . '/admin/install.php');
-
-			if (is_multisite()) {
-				$network=isset($_SERVER['SCRIPT_NAME'])?$_SERVER['SCRIPT_NAME']:"";
-				$activate=isset($_GET['action'])?$_GET['action']:"";
-				$isNetwork=($network=='/wp-admin/network/plugins.php')?true:false;
-				$isActivation=($activate=='deactivate')?false:true;
-
-				if ($isNetwork and $isActivation){
-					$old_blog = $wpdb->blogid;
-					$blogids = $wpdb->get_col($wpdb->prepare("SELECT blog_id FROM $wpdb->blogs", NULL));
-					foreach ($blogids as $blog_id) {
-						switch_to_blog($blog_id);
-						nggallery_install();
-					}
-					switch_to_blog($old_blog);
-					return;
-				}
+			foreach ($path_list as $index => $path_item)
+			{
+				$path_list[$index] = urlencode($path_item);
 			}
 
-			// check for tables
-			nggallery_install();
-			// remove the update message
-			delete_option( 'ngg_update_exists' );
-
-		}
-
-		function deactivate() {
-
-			// remove & reset the init check option
-			delete_option( 'ngg_init_check' );
-			delete_option( 'ngg_update_exists' );
-
-			// Clean up transients
-			self::remove_transients();
-		}
-
-		function uninstall() {
-			// Clean up transients
-			self::remove_transients();
-
-			include_once (dirname (__FILE__) . '/admin/install.php');
-			nggallery_uninstall();
+			$path = implode('/', $path_list);
 		}
 
-		function disable_upgrade($option){
-
-			// PHP5.2 is required for NGG V1.4.0
-			if ( version_compare($option->response[ $this->plugin_name ]->new_version, '1.4.0', '>=') )
-				return $option;
+		if ($location == 'theme')
+		{
+			$theme_uri = get_stylesheet_directory_uri();
 
-			if( isset($option->response[ $this->plugin_name ]) ){
-				//Clear it''s download link
-				$option->response[ $this->plugin_name ]->package = '';
+			$uri = $theme_uri . 'nextgen-gallery';
 
-				//Add a notice message
-				if ($this->add_PHP5_notice == false){
-					add_action( "in_plugin_update_message-$this->plugin_name", create_function('', 'echo \'<br /><span style="color:red">Please update to PHP5.2 as soon as possible, the plugin is not tested under PHP4 anymore</span>\';') );
-					$this->add_PHP5_notice = true;
-				}
+			if ($path != null)
+			{
+				$uri .= '/' . $path;
 			}
-			return $option;
 		}
+		else
+		{
+			// XXX Note, paths could not match but STILL being contained in the theme (i.e. WordPress returns the wrong path for the theme directory, either with wrong formatting or wrong encoding)
+			$base = basename(dirname(__FILE__));
 
-		// Add links to Plugins page
-		function add_plugin_links($links, $file) {
-
-			if ( $file == $this->plugin_name ) {
-				$plugin_name = plugin_basename(NGGALLERY_ABSPATH);
-				$links[] = "<a href='admin.php?page={$plugin_name}'>" . __('Overview', 'nggallery') . '</a>';
-				$links[] = '<a href="http://wordpress.org/tags/nextgen-gallery?forum_id=10">' . __('Get help', 'nggallery') . '</a>';
-				$links[] = '<a href="https://bitbucket.org/photocrati/nextgen-gallery">' . __('Contribute', 'nggallery') . '</a>';
+			if ($base != 'nextgen-gallery')
+			{
+				// XXX this is needed when using symlinks, if the user renames the plugin folder everything will break though
+				$base = 'nextgen-gallery';
 			}
-			return $links;
-		}
-
-		// Check for the header / footer, parts taken from Matt Martz (http://sivel.net/)
-		function test_head_footer_init() {
 
-			// If test-head query var exists hook into wp_head
-			if ( isset( $_GET['test-head'] ) )
-				add_action( 'wp_head', create_function('', 'echo \'<!--wp_head-->\';'), 99999 );
-
-			// If test-footer query var exists hook into wp_footer
-			if ( isset( $_GET['test-footer'] ) )
-				add_action( 'wp_footer', create_function('', 'echo \'<!--wp_footer-->\';'), 99999 );
-		}
-
-		/**
-		* Handles upload requests
-		*/
-		function handle_upload_request()
-		{
-			if (isset($_GET['nggupload'])) {
-				require_once(implode(DIRECTORY_SEPARATOR, array(
-					NGGALLERY_ABSPATH,
-					'admin',
-					'upload.php'
-				)));
-				throw new E_Clean_Exit();
+			if ($path != null)
+			{
+				$base .= '/' . $path;
 			}
-		}
 
-		/**
-		* Handles clean exits gracefully. Re-raises anything else
-		* @param Exception $ex
-		*/
-		function exception_handler($ex)
-		{
-			if (get_class($ex) != 'E_Clean_Exit') throw $ex;
+			$uri = plugins_url($base);
 		}
+
+		return $uri;
 	}
 
-	// Let's start the holy plugin
-	global $ngg;
-	$ngg = new nggLoader();
+	/**
+	 * Returns the URI for a particular file
+	 * @param string $file_name
+	 * @return string
+	 */
+	function file_uri($file_name = NULL)
+	{
+		return $this->path($file_name);
+	}
 }
-?>
+
+new C_NextGEN_Bootstrap();
diff --git a/wp-content/plugins/nextgen-gallery/non_pope/class.nextgen_settings.php b/wp-content/plugins/nextgen-gallery/non_pope/class.nextgen_settings.php
new file mode 100644
index 0000000000000000000000000000000000000000..bb84062b5774138e68686fa112c0e9987d4abd18
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/non_pope/class.nextgen_settings.php
@@ -0,0 +1,29 @@
+<?php
+
+
+if (!class_exists('C_NextGen_Settings')) {
+	class C_NextGen_Settings {
+		static function get_instance()
+		{
+            return C_Photocrati_Settings_Manager::get_instance();
+		}
+
+		static function add_option_handler($klass, $options=array())
+		{
+			$instance = self::get_instance();
+			return $instance->add_option_handler($klass, $options);
+		}
+	}
+}
+
+if (!class_exists('C_NextGen_Global_Settings')) {
+	class C_NextGen_Global_Settings extends C_NextGen_Settings {
+		static function get_instance()
+		{
+            if (is_multisite())
+                return C_Photocrati_Global_Settings_Manager::get_instance();
+            else
+                return C_Photocrati_Settings_Manager::get_instance();
+		}
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/non_pope/class.nextgen_shortcode_manager.php b/wp-content/plugins/nextgen-gallery/non_pope/class.nextgen_shortcode_manager.php
new file mode 100644
index 0000000000000000000000000000000000000000..4f71a4a047d0530c2d926b5cb5ac1a8db9a99d2f
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/non_pope/class.nextgen_shortcode_manager.php
@@ -0,0 +1,125 @@
+<?php
+
+class C_NextGen_Shortcode_Manager
+{
+	private static $_instance = NULL;
+	private $_shortcodes = array();
+
+	/**
+	 * Gets an instance of the class
+	 * @return C_NextGen_Shortcode_Manager
+	 */
+	static function get_instance()
+	{
+		if (is_null(self::$_instance)) {
+			$klass = get_class();
+			self::$_instance = new $klass;
+		}
+		return self::$_instance;
+	}
+
+	/**
+	 * Adds a shortcode
+	 * @param $name
+	 * @param $callback
+	 */
+	static function add($name, $callback)
+	{
+		$manager = self::get_instance();
+		$manager->add_shortcode($name, $callback);
+	}
+
+	/**
+	 * Removes a previously added shortcode
+	 * @param $name
+	 */
+	static function remove($name)
+	{
+		$manager = self::get_instance();
+		$manager->remove_shortcode($name);
+	}
+
+	/**
+	 * Constructor
+	 */
+	private function __construct()
+	{
+		add_filter('the_content', array(&$this, 'deactivate_all'), 1);
+		add_filter('the_content', array(&$this, 'parse_content'), PHP_INT_MAX-1);
+	}
+
+	/**
+	 * Deactivates all shortcodes
+	 */
+	function deactivate_all($content)
+	{
+		foreach (array_keys($this->_shortcodes) as $shortcode) {
+			$this->deactivate($shortcode);
+		}
+
+		return $content;
+	}
+
+	/**
+	 * Activates all registered shortcodes
+	 */
+	function activate_all()
+	{
+		foreach (array_keys($this->_shortcodes) as $shortcode) {
+			$this->activate($shortcode);
+		}
+	}
+
+	/**
+	 * Parses the content for shortcodes and returns the substituted content
+	 * @param $content
+	 * @return string
+	 */
+	function parse_content($content)
+	{
+		$this->activate_all();
+		return do_shortcode($content);
+	}
+
+	/**
+	 * Adds a shortcode
+	 * @param $name
+	 * @param $callback
+	 */
+	function add_shortcode($name, $callback)
+	{
+		$this->_shortcodes[$name] = $callback;
+		$this->activate($name);
+	}
+
+	/**
+	 * Activates a particular shortcode
+	 * @param $shortcode
+	 */
+	function activate($shortcode)
+	{
+		if (isset($this->_shortcodes[$shortcode])) {
+			add_shortcode($shortcode, $this->_shortcodes[$shortcode]);
+		}
+	}
+
+	/**
+	 * Removes a shortcode
+	 * @param $name
+	 */
+	function remove_shortcode($name)
+	{
+		unset($this->_shortcodes[$name]);
+		$this->deactivate($name);
+	}
+
+	/**
+	 * De-activates a shortcode
+	 * @param $shortcode
+	 */
+	function deactivate($shortcode)
+	{
+		if (isset($this->_shortcodes[$shortcode]))
+			remove_shortcode($shortcode);
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/non_pope/class.nextgen_style_manager.php b/wp-content/plugins/nextgen-gallery/non_pope/class.nextgen_style_manager.php
new file mode 100644
index 0000000000000000000000000000000000000000..9992c1a67cf6782c7dcf3298d0341725c79828ec
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/non_pope/class.nextgen_style_manager.php
@@ -0,0 +1,286 @@
+<?php
+
+class C_NextGen_Style_Manager
+{
+	static $_instance 		= NULL;
+	var $directories 		= array();
+	var $unsafe_directories = array();
+	var $default_dir        = '';
+	var $new_dir			= '';
+
+	function __construct()
+	{
+		$this->default_dir = realpath((implode(DIRECTORY_SEPARATOR, array(
+			untrailingslashit(dirname(__FILE__)),
+			'..',
+			'products',
+			'photocrati_nextgen',
+			'modules',
+			'ngglegacy',
+			'css'
+		))));
+
+		$this->new_dir = implode(DIRECTORY_SEPARATOR, array(
+			untrailingslashit(WP_CONTENT_DIR),
+			'ngg_styles'
+		));
+
+		// The last place we look for a stylesheet is in ngglegacy
+		$this->add_directory($this->default_dir);
+
+		// This is where all stylesheets should be stored
+		$this->add_directory($this->new_dir);
+
+		// We check the parent theme directory. Needed for child themes
+		$this->add_directory(implode(DIRECTORY_SEPARATOR, array(
+			untrailingslashit(get_template_directory()),
+		)), TRUE);
+
+		// We also check parent_theme/nggallery
+		$this->add_directory(implode(DIRECTORY_SEPARATOR, array(
+			untrailingslashit(get_template_directory()),
+			'nggallery'
+		)), TRUE);
+
+		// We also check parent_theme/ngg_styles
+		$this->add_directory(implode(DIRECTORY_SEPARATOR, array(
+			untrailingslashit(get_template_directory()),
+			'ngg_styles'
+		)), TRUE);
+
+		// We check the root directory of the theme. Users shouldn't store here,
+		// but they might
+		$this->add_directory(implode(DIRECTORY_SEPARATOR, array(
+			untrailingslashit(get_stylesheet_directory()),
+		)), TRUE);
+
+		// We also check the theme/nggallery directory
+		$this->add_directory(implode(DIRECTORY_SEPARATOR, array(
+			untrailingslashit(get_stylesheet_directory()),
+			'nggallery'
+		)), TRUE);
+
+		// We also check the theme/ngg_styles directory
+		$this->add_directory(implode(DIRECTORY_SEPARATOR, array(
+			untrailingslashit(get_stylesheet_directory()),
+			'ngg_styles'
+		)), TRUE);
+	}
+
+	/**
+	 * Add a directory to search for stylesheets
+	 * @param $dir
+	 * @param bool $unsafe
+	 */
+	function add_directory($dir, $unsafe=FALSE)
+	{
+		array_unshift($this->directories, $dir);
+		if ($unsafe) {
+			$this->unsafe_directories[] = $dir;
+		}
+	}
+
+	/**
+	 * Determines if a directory is upgrade-safe or not
+	 * @param $dir
+	 * @return bool
+	 */
+	function is_directory_unsafe($dir=FALSE)
+	{
+		if (!$dir) $dir = dirname($this->find_selected_stylesheet_abspath());
+
+		return in_array($dir, $this->unsafe_directories);
+	}
+
+	/**
+	 * Determines if the directory is the default ngglegacy path
+	 * @param $dir
+	 * @return bool
+	 */
+	function is_default_dir($dir)
+	{
+		return untrailingslashit($dir) == $this->default_dir;
+	}
+
+	function get_new_dir($filename)
+	{
+		return implode(DIRECTORY_SEPARATOR, array(
+			untrailingslashit($this->new_dir),
+			$filename
+		));
+	}
+
+	/**
+	 * Gets the location where the selected stylesheet will be saved to
+	 * @param bool|string $selected
+	 * @return string
+	 */
+	function get_selected_stylesheet_saved_abspath($selected=FALSE)
+	{
+		if (!$selected) $selected = $this->get_selected_stylesheet();
+
+		$abspath = $this->find_selected_stylesheet_abspath($selected);
+		if ($this->is_default_dir(dirname($abspath))) {
+			$abspath = $this->get_new_dir(basename($abspath));
+		}
+
+		return $abspath;
+	}
+
+	function save($contents, $selected=FALSE)
+	{
+		$retval = FALSE;
+
+		if (!$selected) $selected = $this->get_selected_stylesheet();
+		$abspath = $this->get_selected_stylesheet_saved_abspath($selected);
+
+		wp_mkdir_p(dirname($abspath));
+		if (is_writable($abspath) OR (!@file_exists($abspath) && is_writable(dirname($abspath)))) {
+			$retval = file_put_contents($abspath, $contents);
+		}
+		return $retval;
+	}
+
+	/**
+	 * Gets the selected stylesheet from the user
+	 * @return mixed
+	 */
+	function get_selected_stylesheet()
+	{
+        $settings = C_NextGen_Settings::get_instance();
+
+        // use the same css resource for all subsites when wpmuStyle=true
+        if (!is_multisite() || (is_multisite() && $settings->get('wpmuStyle')))
+            return $settings->get('CSSfile', 'nggallery.css');
+        else
+            return C_Nextgen_Global_Settings::get_instance()->get('wpmuCSSfile');
+
+	}
+
+	/**
+	 * Finds the location of the selected stylesheet
+	 */
+	function find_selected_stylesheet_abspath($selected=FALSE)
+	{
+		if (!$selected) $selected = $this->get_selected_stylesheet();
+
+		$retval = implode(DIRECTORY_SEPARATOR, array(
+			untrailingslashit($this->default_dir),
+			$selected
+		));
+
+		foreach ($this->directories as $dir) {
+			$path = implode(DIRECTORY_SEPARATOR, array(
+				untrailingslashit($dir),
+				$selected
+			));
+
+			if (@file_exists($path)) {
+				$retval = $path;
+				break;
+			}
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Returns the url to the selected stylesheet
+	 * @return mixed
+	 */
+	function get_selected_stylesheet_url($selected=FALSE)
+	{
+		if (!$selected) $selected = $this->get_selected_stylesheet();
+
+		$retval =  str_replace(
+			trailingslashit(ABSPATH),
+			trailingslashit(site_url()),
+			$this->find_selected_stylesheet_abspath($selected)
+		);
+
+		return str_replace('\\', '/', $retval);
+	}
+
+
+	function find_all_stylesheets()
+	{
+		$retval = array();
+
+		foreach (array_reverse($this->directories) as $dir) {
+			$path = implode(DIRECTORY_SEPARATOR, array(
+				untrailingslashit($dir),
+				'*.css'
+			));
+			$files = glob($path);
+			if (is_array($files)) foreach ($files as $abspath) {
+				if (($meta = $this->get_stylesheet_metadata($abspath))) {
+					$filename = $meta['filename'];
+					$retval[$filename] = $meta;
+				}
+			}
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Gets the metadata for a particular stylesheet
+	 * @param $abspath
+	 * @return array
+	 */
+	function get_stylesheet_metadata($abspath)
+	{
+		$retval 	= array();
+		$contents	= file_get_contents($abspath);
+		$name 		= '';
+		$desc 		= '';
+		$version	= '';
+		$author		= '';
+
+		// Find the name of the stylesheet
+		if (preg_match("/CSS Name:(.*)/i", $contents, $match)) {
+			$name = trim($match[1]);
+		}
+
+		// Find the description of the stylesheet
+		if (preg_match("/Description:(.*)/", $contents, $match)) {
+			$desc = trim($match[1]);
+		}
+
+		// Find the author of the stylesheet
+		if (preg_match("/Author:(.*)/", $contents, $match)) {
+			$author = trim($match[1]);
+		}
+
+		// Find the version of the stylesheet
+		if (preg_match("/Version:(.*)/", $contents, $match)) {
+			$version = trim($match[1]);
+		}
+
+		if ($name) {
+			$retval = array(
+				'filename'		=>	basename($abspath),
+				'abspath'		=>	$abspath,
+				'name'			=>	$name,
+				'description'	=>	$desc,
+				'author'		=>	$author,
+				'version'		=>	$version
+			);
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Gets an instance of the class
+	 * @return C_NextGen_Style_Manager
+	 */
+	static function get_instance()
+	{
+		if (is_null(self::$_instance)){
+			$klass = get_class();
+			self::$_instance = new $klass();
+		}
+		return self::$_instance;
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/non_pope/class.photocrati_cache.php b/wp-content/plugins/nextgen-gallery/non_pope/class.photocrati_cache.php
new file mode 100644
index 0000000000000000000000000000000000000000..928395fd34a57d906e7ed15b21770d7b0ac9ab78
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/non_pope/class.photocrati_cache.php
@@ -0,0 +1,220 @@
+<?php
+
+class C_Photocrati_Cache
+{
+	static $enabled       = TRUE;
+	static $do_not_lookup = FALSE;
+	static $force_update  = FALSE;
+	static $hits		  = 0;
+	static $_instances	  = array();
+	public $group	  	  = NULL;
+
+	/**
+	 * Gets an instance of the Cache
+	 * @return C_Photocrati_Cache
+	 */
+	static function &get_instance($group=NULL)
+	{
+		if (!$group) $group = 'ngg_cache_';
+		if (substr($group, -1) != '_') $group .= '_';
+		if (!isset(self::$_instances[$group])) {
+			$klass = get_class();
+			self::$_instances[$group] = new $klass($group);
+		}
+
+		return self::$_instances[$group];
+	}
+
+	/**
+	 * Create a new cache for the specified group
+	 * @param $group
+	 */
+	function __construct($group)
+	{
+		$this->group = $group;
+	}
+
+	/**
+	 * Gets an item from the cache
+	 * @param $key
+	 * @param null $default
+	 * @return mixed
+	 */
+	static function get($key, $default=NULL, $group=NULL)
+	{
+		return self::get_instance($group)->lookup($key, $default);
+	}
+
+	/**
+	 * Caches an item
+	 * @param $key
+	 * @param null $value
+	 * @return bool|int
+	 */
+	static function set($key, $value=NULL, $group=NULL, $ttl=3600)
+	{
+		return self::get_instance($group)->update($key, $value, $ttl);
+	}
+
+	/**
+	 * Removes an item from the cache
+	 * @param $key
+	 */
+	static function remove($key, $group=NULL)
+	{
+		return self::get_instance($group)->delete($key);
+	}
+
+	/**
+	 * Generate a unique key from params
+	 * @param $params
+	 * @return string
+	 */
+	static function generate_key($params)
+	{
+		if (!self::$enabled) return NULL;
+		if (is_object($params)) $params = (array) $params;
+		if (is_array($params)) {
+			foreach ($params as &$param) $param = json_encode($param);
+			$params = implode('', $params);
+		}
+
+		return md5($params);
+	}
+
+	/**
+	 * Flush the entire cache
+	 */
+	static function flush($group=NULL, $expired_only=FALSE)
+	{
+		$retval = 0;
+
+		if (self::$enabled) {
+
+			// Delete all caches
+			if ($group == 'all') {
+				foreach (self::$_instances as $cache) {
+					$retval += self::flush($cache->group, $expired_only);
+				}
+			}
+
+			// Delete items from a single cache in particular
+			else {
+				$cache = self::get_instance($group);
+
+				// Determine if the object cache is external, and not stored in the DB
+				// If it's external, we have to delete each transient, one by one
+				global $_wp_using_ext_object_cache, $wpdb;
+				if ($_wp_using_ext_object_cache) {
+					$keys = ($expired_only ? self::get_expired_key_list($group) : self::get_key_list($group));
+					foreach ($keys as $key) $cache->delete($key, FALSE);
+					$sql = $wpdb->prepare("DELETE FROM {$wpdb->options} WHERE option_name LIKE %s", "%%{$cache->group}%%");
+					if ($expired_only) $sql .= " AND option_value < ".time();
+					$retval = $wpdb->query($sql);
+				}
+
+				// Transients are stored in the database
+				else {
+					$keys = ($expired_only ? self::get_expired_key_list($group) : self::get_key_list($group));
+					if ($keys) {
+						$all_keys = array();
+						foreach ($keys as $value) {
+							$all_keys[] = "'{$cache->group}{$value}'";
+							$all_keys[] = "'_transient_timeout_{$value}'";
+							$all_keys[] = "'_transient_{$value}'";
+						}
+						unset($keys);
+						$all_keys = implode(',', $all_keys);
+						$sql = "DELETE FROM {$wpdb->options} WHERE option_name IN (". $all_keys. ')';
+						$retval = $wpdb->query($sql);
+					}
+				}
+			}
+		}
+
+		return $retval;
+	}
+
+	static function get_key_list($group=NULL, $strip_group_name=TRUE, $expired_only=FALSE)
+	{
+		global $wpdb;
+
+		$cache = self::get_instance($group);
+
+		$sql = '';
+		if ($strip_group_name) {
+			$sql = $wpdb->prepare(
+				"SELECT REPLACE(option_name, %s, '') FROM {$wpdb->options} WHERE option_name LIKE %s",
+				$cache->group, '%'.$cache->group.'%'
+			);
+		}
+		else {
+			$sql = $wpdb->prepare(
+				"SELECT option_name FROM {$wpdb->options} WHERE option_name LIKE %s",
+				'%'.$cache->group.'%'
+			);
+		}
+
+		if ($expired_only) $sql .= " AND option_value < ".time();
+
+		return $wpdb->get_col($sql);
+	}
+
+	static function get_expired_key_list($group=NULL, $strip_group_name=TRUE)
+	{
+		return self::get_key_list($group, $strip_group_name, TRUE);
+	}
+
+
+	/**
+	 * Gets an item using a particular key
+	 * @param $key
+	 * @param $default
+	 * @return mixed
+	 */
+	function lookup($key, $default=NULL)
+	{
+		$retval = $default;
+
+		if (self::$enabled && self::$do_not_lookup === FALSE) {
+			if (is_array($key)) $key = self::generate_key($key);
+			if (!($retval = get_transient($key))) $retval = $default;
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Set an item in the cache using a particular key
+	 * @param $key
+	 * @param $value
+	 * @return bool|int
+	 */
+	function update($key, $value, $ttl=3600)
+	{
+		$retval = FALSE;
+		if (self::$enabled) {
+			if (is_array($key)) $key = self::generate_key($key);
+			if (self::$force_update OR $this->lookup($key, FALSE) === FALSE) {
+				set_transient($key, $value, $ttl);
+				update_option($this->group.$key, time()+$ttl);
+				$retval = $key;
+			}
+		}
+		return $retval;
+	}
+
+	function delete($key, $delete_ack=TRUE)
+	{
+		if (self::$enabled) {
+			delete_transient($key);
+			if ($delete_ack) {
+				global $wpdb;
+				$sql = $wpdb->prepare("DELETE FROM {$wpdb->options} WHERE option_name LIKE %s", $this->group.$key);
+				$wpdb->query($sql);
+			}
+			return TRUE;
+		}
+		else return FALSE;
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/non_pope/class.photocrati_installer.php b/wp-content/plugins/nextgen-gallery/non_pope/class.photocrati_installer.php
new file mode 100644
index 0000000000000000000000000000000000000000..52daf97b9e0f557617687a1b0a28634b994ed1ff
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/non_pope/class.photocrati_installer.php
@@ -0,0 +1,186 @@
+<?php
+
+if (!class_exists('C_Photocrati_Installer'))
+{
+	class C_Photocrati_Installer
+	{
+		static $_instance = NULL;
+		static function get_instance()
+		{
+			if (is_null(self::$_instance)) {
+				$klass = get_class();
+				self::$_instance = new $klass();
+			}
+			return self::$_instance;
+		}
+
+
+		/**
+		 * Each product and module will register it's own handler (a class, with an install() and uninstall() method)
+		 * to be used for install/uninstall routines
+		 * @param $name
+		 * @param $handler
+		 */
+		static function add_handler($name, $handler)
+		{
+			self::get_instance()->_installers[$name] = $handler;
+		}
+
+		/**
+		 * Gets an instance of an installation handler
+		 * @param $name
+		 * @return mixed
+		 */
+		static function get_handler_instance($name)
+		{
+			$installers = $handler = self::get_instance()->_installers;
+			if (isset($installers[$name])) {
+				$klass = $installers[$name];
+				return new $klass;
+			}
+			else return NULL;
+		}
+
+
+		/**
+		 * Uninstalls a product
+		 * @param $product
+		 * @param bool $hard
+		 * @return mixed
+		 */
+		static function uninstall($product, $hard=FALSE)
+		{
+			$handler = self::get_handler_instance($product);
+			if (method_exists($handler, 'uninstall')) return $handler->uninstall($hard);
+
+			if ($hard) {
+				C_NextGen_Settings::get_instance()->destroy();
+                C_NextGen_Global_Settings::get_instance()->destroy();
+			}
+		}
+
+		static function update($reset=FALSE)
+		{
+			$local_settings     = C_NextGen_Settings::get_instance();
+            $global_settings    = C_NextGen_Global_Settings::get_instance();
+
+            // This is a specific hack/work-around/fix and can probably be removed sometime after 2.0.20's release
+            //
+            // NextGen 2x was not multisite compatible until 2.0.18. Users that upgraded before this
+            // will have nearly all of their settings stored globally (network wide) in wp_sitemeta. If
+            // pope_module_list (which should always be a local setting) exists site-wide we wipe the current
+            // global ngg_options and restore from defaults. This should only ever run once.
+            if (is_multisite() && isset($global_settings->pope_module_list))
+            {
+                // Setting this to TRUE will wipe current settings for display types, but also
+                // allows the display type installer to run correctly
+                $reset = TRUE;
+
+                $settings_installer = new C_NextGen_Settings_Installer();
+                $global_defaults = $settings_installer->get_global_defaults();
+
+                // Preserve the network options we honor by restoring them after calling $global_settings->reset()
+                $global_settings_to_keep = array();
+                foreach ($global_defaults as $key => $val) {
+                    $global_settings_to_keep[$key] = $global_settings->$key;
+                }
+
+                // Resets internal options to an empty array
+                $global_settings->reset();
+
+                // Restore the defaults, then our saved values. This must be done again later because
+                // we've set $reset to TRUE.
+                $settings_installer->install_global_settings();
+                foreach ($global_settings_to_keep as $key => $val) {
+                    $global_settings->$key = $val;
+                }
+            }
+
+            $last_module_list    = $reset ? array() : $local_settings->get('pope_module_list', array());
+			$current_module_list = self::_generate_module_info();
+
+            if (count(($modules = array_diff($current_module_list, $last_module_list))) > 0)
+            {
+				// The cache should be flushed
+				C_Photocrati_Cache::flush();
+
+				// Remove all NGG created cron jobs
+				self::refresh_cron();
+
+				// Delete auto-update cache
+				update_option('photocrati_auto_update_admin_update_list', null);
+				update_option('photocrati_auto_update_admin_check_date', '');
+
+				// Other Pope applications might be loaded, and therefore
+				// all singletons should be destroyed, so that they can be
+				// adapted as necessary. For now, we'll just assume that the factory
+				// is the only singleton that will be used by other Pope applications
+				C_Component_Factory::$_instances = array();
+
+				foreach ($modules as $module_name) {
+					if (($handler = self::get_handler_instance(array_shift(explode('|', $module_name))))) {
+						if (method_exists($handler, 'install'))
+                            $handler->install($reset);
+					}
+				}
+
+				// Update the module list
+				$local_settings->set('pope_module_list', $current_module_list);
+
+                // NOTE & TODO: if the above section that declares $global_settings_to_keep is removed this should also
+                // Since a hard-reset of the settings was forced we must again re-apply our previously saved values
+                if (isset($global_settings_to_keep)) {
+                    foreach ($global_settings_to_keep as $key => $val) {
+                        $global_settings->$key = $val;
+                    }
+                }
+
+				// Save any changes settings
+				$global_settings->save();
+				$local_settings->save();
+            }
+
+            // Another workaround to an issue caused by NextGen's lack of multisite compatibility. It's possible
+            // the string substitation wasn't performed, so if a '%' symbol exists in gallerypath we reset it. It's
+            // another db call, but again this should only ever run once.
+            //
+            // Remove this when removing the above reset-global-settings code
+            if (strpos($local_settings->gallerypath, '%'))
+            {
+                $settings_installer = new C_NextGen_Settings_Installer();
+                $local_settings->gallerypath = $settings_installer->gallerypath_replace($global_settings->gallerypath);
+                $local_settings->save();
+            }
+		}
+
+		static function _generate_module_info()
+		{
+			$retval = array();
+			$registry = C_Component_Registry::get_instance();
+			foreach ($registry->get_module_list() as $module_id) {
+				$module_version = $registry->get_module($module_id)->module_version;
+				$retval[$module_id] = "{$module_id}|{$module_version}";
+			}
+			return $retval;
+		}
+
+		static function refresh_cron()
+		{
+			@ini_set('memory_limit', -1);
+
+			// Remove all cron jobs created by NextGEN Gallery
+			$cron = _get_cron_array();
+			if (is_array($cron)) {
+				foreach ($cron as $timestamp => $job) {
+					if (is_array($job)) {
+						unset($cron[$timestamp]['ngg_delete_expired_transients']);
+						if (empty($cron[$timestamp])) {
+							unset($cron[$timestamp]);
+						}
+					}
+				}
+			}
+			_set_cron_array($cron);
+		}
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/non_pope/class.photocrati_resource_manager.php b/wp-content/plugins/nextgen-gallery/non_pope/class.photocrati_resource_manager.php
new file mode 100644
index 0000000000000000000000000000000000000000..6687f5f95fd2c48863d8c6a2ee17e58131a14307
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/non_pope/class.photocrati_resource_manager.php
@@ -0,0 +1,199 @@
+<?php
+
+class C_Photocrati_Resource_Manager
+{
+	static $instance = NULL;
+
+	var $buffer = '';
+	var $styles = '';
+	var $scripts = '';
+	var $other_output = '';
+	var $wrote_footer =  FALSE;
+	var $run_shutdown =  FALSE;
+	var $valid_request = TRUE;
+
+	/**
+	 * Start buffering all generated output. We'll then do two things with the buffer
+	 * 1) Find stylesheets lately enqueued and move them to the header
+	 * 2) Ensure that wp_print_footer_scripts() is called
+	 */
+	function __construct()
+	{
+		// Validate the request
+		$this->validate_request();
+
+		add_action('init',array(&$this, 'start_buffer'), 1);
+	}
+
+	/**
+	 * Determines if the resource manager should perform it's routines for this request
+	 * @return bool
+	 */
+	function validate_request()
+	{
+		$retval = TRUE;
+
+		if (is_admin()) {
+			if (isset($_REQUEST['page']) && !preg_match("#^(ngg|nextgen)#", $_REQUEST['page'])) $retval = FALSE;
+		}
+
+		if (strpos($_SERVER['REQUEST_URI'], 'wp-admin/update') !== FALSE) $retval = FALSE;
+		else if (isset($_GET['display_gallery_iframe'])) 				  $retval = FALSE;
+        else if (defined('WP_ADMIN') && WP_ADMIN && defined('DOING_AJAX') && DOING_AJAX) $retval = FALSE;
+		else if (preg_match("/(js|css|xsl|xml|kml)$/", $_SERVER['REQUEST_URI'])) $retval = FALSE;
+		elseif (preg_match("/\\.(\\w{3,4})$/", $_SERVER['REQUEST_URI'], $match)) {
+			if (!in_array($match[1], array('htm', 'html', 'php'))) {
+				$retval = FALSE;
+			}
+		}
+
+		$this->valid_request = $retval;
+	}
+
+	/**
+	 * Start the output buffers
+	 */
+	function start_buffer()
+	{
+		if (apply_filters('run_ngg_resource_manager', $this->valid_request)) {
+			ob_start(array(&$this, 'output_buffer_handler'));
+			ob_start(array(&$this, 'get_buffer'));
+
+			add_action('wp_print_footer_scripts', array(&$this, 'get_resources'), 1);
+			add_action('admin_print_footer_scripts', array(&$this, 'get_resources'), 1);
+			add_action('shutdown', array(&$this, 'shutdown'));
+		}
+	}
+
+	/**
+	 *
+	 **/
+	function get_resources()
+	{
+		ob_start();
+		wp_print_styles();
+		print_admin_styles();
+		$this->styles = ob_get_clean();
+
+		if (!is_admin()) {
+			ob_start();
+			wp_print_scripts();
+			$this->scripts = ob_get_clean();
+		}
+
+		$this->wrote_footer = TRUE;
+	}
+
+	/**
+	 * Output the buffer after PHP execution has ended (but before shutdown)
+	 * @param $content
+	 * @return string
+	 */
+	function output_buffer_handler($content)
+	{
+		return $this->output_buffer();
+	}
+
+	/**
+	 * Removes the closing </html> tag from the output buffer. We'll then write our own closing tag
+	 * in the shutdown function after running wp_print_footer_scripts()
+	 * @param $content
+	 * @return mixed
+	 */
+	function get_buffer($content)
+	{
+		$this->buffer = $content;
+		return '';
+	}
+
+	/**
+	 * Moves resources to their appropriate place
+	 */
+	function move_resources()
+	{
+		if ($this->valid_request) {
+			// Move stylesheets to head
+			if ($this->styles) {
+				$this->buffer = str_ireplace('</head>', $this->styles.'</head>', $this->buffer);
+			}
+
+			// Move the scripts to the bottom of the page
+			if ($this->scripts) {
+				$this->buffer = str_ireplace('</body>', $this->scripts.'</body>', $this->buffer);
+			}
+
+			if ($this->other_output) {
+				$this->buffer = str_replace('</body>', $this->other_output.'</body>', $this->buffer);
+			}
+		}
+	}
+
+	/**
+	 * When PHP has finished, we output the footer scripts and closing tags
+	 */
+	function output_buffer($in_shutdown=FALSE)
+	{
+		// If the footer scripts haven't been outputted, then
+		// we need to take action - as they're required
+		if (!$this->wrote_footer) {
+
+			// If W3TC is installed and activated, we can't output the
+			// scripts and manipulate the buffer, so we can only provide a warning
+			if (defined('W3TC') && defined('WP_DEBUG') && WP_DEBUG) {
+				if (defined('DONOTCACHEPAGE')) define('DONOTCACHEPAGE', TRUE);
+				if (!did_action('wp_footer')) {
+					error_log("We're sorry, but your theme's page template didn't make a call to wp_footer(), which is required by NextGEN Gallery. Please add this call to your page templates.");
+				}
+				else {
+					error_log("We're sorry, but your theme's page template didn't make a call to wp_print_footer_scripts(), which is required by NextGEN Gallery. Please add this call to your page templates.");
+				}
+			}
+
+			// We don't want to manipulate the buffer if it doesn't contain HTML
+			elseif (strpos($this->buffer, '</body>') === FALSE) {
+				$this->valid_request = FALSE;
+			}
+
+			// The output_buffer() function has been called in the PHP shutdown callback
+			// This will allow us to print the scripts ourselves and manipulate the buffer
+			if ($in_shutdown === TRUE) {
+				ob_start();
+				if (!did_action('wp_footer')) {
+					wp_footer();
+				}
+				else {
+					wp_print_footer_scripts();
+				}
+				$this->other_output = ob_get_clean();
+
+			}
+
+			// W3TC isn't activated and we're not in the shutdown callback.
+			// We'll therefore add a shutdown callback to print the scripts
+			else {
+				$this->run_shutdown = TRUE;
+				return '';
+			}
+		}
+
+		// Once we have the footer scripts, we can modify the buffer and
+		// move the resources around
+		if ($this->wrote_footer) $this->move_resources();
+
+		return $this->buffer;
+	}
+
+	/**
+	 * PHP shutdown callback. Manipulate and output the buffer
+	 */
+	function shutdown()
+	{
+		if ($this->run_shutdown) echo $this->output_buffer(TRUE);
+	}
+
+	static function init()
+	{
+		$klass = get_class();
+		return self::$instance = new $klass;
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/non_pope/class.photocrati_settings_manager.php b/wp-content/plugins/nextgen-gallery/non_pope/class.photocrati_settings_manager.php
new file mode 100644
index 0000000000000000000000000000000000000000..7cf2375d6e7d8763952664b7f59c6eb77c182efa
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/non_pope/class.photocrati_settings_manager.php
@@ -0,0 +1,299 @@
+<?php
+
+if (!class_exists('C_Photocrati_Settings_Manager_Base')) {
+	/**
+	 * Provides a base abstraction for a Settings Manager
+	 * Class C_Settings_Manager_Base
+	 */
+	abstract class C_Photocrati_Settings_Manager_Base implements ArrayAccess
+	{
+		static $option_name			= 'pope_settings';
+		protected $_options			= array();
+		protected $_defaults		= array();
+		protected $_option_handlers = array();
+
+		abstract function save();
+		abstract function destroy();
+		abstract function load();
+
+		protected function __construct()
+		{
+			$this->load();
+		}
+
+		/**
+		 * Adds a class to handle dynamic options
+		 * @param string $klass
+		 * @param array $options
+		 */
+		function add_option_handler($klass, $options=array())
+		{
+			if (!is_array($options)) $options = array($options);
+			foreach ($options as $option_name) {
+				$this->_option_handlers[$option_name] = $klass;
+			}
+		}
+
+		/**
+		 * Gets a handler used to provide a dynamic option
+		 * @param string $option_name
+		 * @return null|mixed
+		 */
+		protected function _get_option_handler($option_name, $method='get')
+		{
+			$retval = NULL;
+
+			if (isset($this->_option_handlers[$option_name])) {
+				if (!is_object($this->_option_handlers[$option_name])) {
+					$klass = $this->_option_handlers[$option_name];
+					$this->_option_handlers[$option_name] = new $klass;
+				}
+				$retval = $this->_option_handlers[$option_name];
+				if (!method_exists($retval, $method)) $retval = NULL;
+			}
+			return $retval;
+		}
+
+		/**
+		 * Gets the value of a particular setting
+		 * @param $key
+		 * @param null $default
+		 * @return null
+		 */
+		function get($key, $default=NULL)
+		{
+			$retval = $default;
+
+			if (isset($this->_options[$key]))
+				$retval =  $this->_options[$key];
+			elseif (($handler = $this->_get_option_handler($key, 'get'))) {
+				$retval = $handler->get($key, $default);
+			}
+
+			// In case a stdObject has been passed in as a value, we
+			// want to only return scalar values or arrays
+			if (is_object($retval)) $retval = (array) $retval;
+
+			return $retval;
+		}
+
+		/**
+		 * Sets a setting to a particular value
+		 * @param string $key
+		 * @param mixed $value
+		 * @return mixed
+		 */
+		function set($key, $value=NULL, $skip_handlers=FALSE)
+		{
+			if (is_object($value)) $value = (array) $value;
+
+			if (is_array($key)) {
+				foreach ($key as $k=>$v) $this->set($k, $v);
+			}
+			elseif (!$skip_handlers && ($handler = $this->_get_option_handler($key, 'set'))) {
+				$handler->set($key, $value);
+			}
+			else $this->_options[$key] = $value;
+
+			return $this;
+		}
+
+		/**
+		 * Deletes a setting
+		 * @param string $key
+		 */
+		function delete($key)
+		{
+			if (($handler = $this->_get_option_handler($key, 'delete'))) {
+				$handler->delete($key);
+			}
+			else {
+				unset($this->_options[$key]);
+			}
+		}
+
+		/**
+		 * Determines if a setting exists or not
+		 * @param $key
+		 * @return bool
+		 */
+		function is_set($key)
+		{
+			return array_key_exists($key, $this->_options);
+		}
+
+		/**
+		 * Alias to is_set()
+		 * @param $key
+		 * @return bool
+		 */
+		function exists($key)
+		{
+			return $this->is_set($key);
+		}
+
+		function does_not_exist($key)
+		{
+			return !$this->exists($key);
+		}
+
+		function reset()
+		{
+			$this->_options = array();
+		}
+
+		/**
+		 * This function does two things:
+		 * a) If a value hasn't been set for the specified key, or it's been set to a previously set
+		 *    default value, then set this key to the value specified
+		 * b) Sets a new default value for this key
+		 */
+		function set_default_value($key, $default)
+		{
+			if (!isset($this->_defaults[$key])) $this->_defaults[$key] = $default;
+			if (is_null($this->get($key, NULL)) OR $this->get($key) == $this->_defaults[$key]) {
+				$this->set($key, $default);
+			}
+			$this->_defaults[$key] = $default;
+			return $this->get($key);
+		}
+
+		function offsetExists($key)
+		{
+			return $this->is_set($key);
+		}
+
+		function offsetGet($key)
+		{
+			return $this->get($key);
+		}
+
+		function offsetSet($key, $value)
+		{
+			return $this->set($key, $value);
+		}
+
+		function offsetUnset($key)
+		{
+			return $this->delete($key);
+		}
+
+		function __get($key)
+		{
+			return $this->get($key);
+		}
+
+		function __set($key, $value)
+		{
+			return $this->set($key, $value);
+		}
+
+		function __isset($key)
+		{
+			return $this->is_set($key);
+		}
+
+		function __toString()
+		{
+			return json_encode($this->_options);
+		}
+
+		function __toArray()
+		{
+			return $this->_options;
+		}
+
+		function to_array()
+		{
+			return $this->__toArray();
+		}
+
+		function to_json()
+		{
+			return json_encode($this->_options);
+		}
+
+		function from_json($json)
+		{
+			$this->_options = (array)json_decode($json);
+		}
+	}
+}
+
+if (!class_exists('C_Photocrati_Global_Settings_Manager')) {
+	class C_Photocrati_Global_Settings_Manager extends C_Photocrati_Settings_Manager_Base
+	{
+		public static function get_instance()
+		{
+			static $_instance = NULL;
+			if (is_null($_instance)) {
+				$klass = get_class();
+				$_instance = new $klass();
+			}
+			return $_instance;
+		}
+
+		function save()
+		{
+			return update_site_option(self::$option_name, $this->to_array());
+		}
+
+		function load()
+		{
+			$this->_options = get_site_option(self::$option_name, $this->to_array());
+			if (!$this->_options) $this->_options = array();
+			else if (is_string($this->_options)) $this->_options = unserialize($this->_options);
+		}
+
+		function destroy()
+		{
+			return delete_site_option(self::$option_name);
+		}
+	}
+}
+
+
+if (!class_exists('C_Photocrati_Settings_Manager')) {
+	class C_Photocrati_Settings_Manager extends C_Photocrati_Settings_Manager_Base
+	{
+		public static function get_instance()
+		{
+			static $_instance = NULL;
+			if (is_null($_instance)) {
+				$klass = get_class();
+				$_instance = new $klass();
+			}
+			return $_instance;
+		}
+
+		function get($key, $default=NULL)
+		{
+			$retval = parent::get($key, NULL);
+
+			if (is_null($retval)) {
+				$retval = C_Photocrati_Global_Settings_Manager::get_instance()->get($key, $default);
+			}
+			return $retval;
+		}
+
+		function save()
+		{
+			return update_option(self::$option_name, $this->to_array());
+		}
+
+		function load()
+		{
+			$this->_options = get_option(self::$option_name, array());
+			if (!$this->_options) $this->_options = array();
+			else if (is_string($this->_options)) $this->_options = unserialize($this->_options);
+		}
+
+		function destroy()
+		{
+			delete_option(self::$option_name);
+		}
+
+
+	}
+}
+
diff --git a/wp-content/plugins/nextgen-gallery/pope/README.txt b/wp-content/plugins/nextgen-gallery/pope/README.txt
new file mode 100644
index 0000000000000000000000000000000000000000..4d4bb62707464c47e250cf2393bd70c59450679f
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/pope/README.txt
@@ -0,0 +1,93 @@
+==============
+POPE FRAMEWORK
+==============
+
+WHY "POPE"?
+-----------
+Pope is an attempt to provide a component framework, similiar to Python's Zope 3
+framework. In otherwords, Pope is PHP's version of Zope.
+See: http://wiki.zope.org/zope3/ComponentArchitectureOverview
+
+In short it adds polymorphism or plugin-like functionality into your PHP classes.
+With it you can build applications with plugins, plugins to existing applications,
+and extend or change third party libraries without modifying their source.
+
+The unit tests in the "tests" directory double as a tutorial to Pope and how to use
+it. For best clarity read the source in this order:
+* core
+* pre_hooks
+* registry
+* factories
+* modules
+* wrappers
+* advanced
+* method_properties
+To run the tests yourself modify run_tests.php to point to your own SimpleTest
+checkout.
+
+A component framework puts a strong emphasis on interface design, and designing
+by contract. However, Pope also tries to be less restrictive by adopting duck typing
+and the philosophy, "if it walks like a duck and talks like a duck then it is
+a duck". This is sometimes also referred to as "monkey patching".
+
+A component frameworks relies on the following:
+
+- Interfaces: 
+    
+    Interfaces define the contracts which the design must follow.
+    See: http://en.wikipedia.org/wiki/Design_by_contract
+
+- Components:
+
+    Components implement interfaces to provide specific functionality in a
+    desired context. The context of an object is important, as a component
+    can behave differently when used in a different context.
+
+- Adapters:
+
+    Adapters modify the behavior of a component to adapt to a particular context.
+    For example, in a component framework there might be difference between an
+    image and a thumbnail - they are both images, but used in different contexts.
+    Adapters would be used to make a thumbnail image behave differently.
+
+- Utilities:
+    
+    Utilities are registered implementations of a particular interface. An
+    example of a utility is an object factory, based on the factory pattern.
+
+- Factory:
+
+    Factories create objects.
+    See: http://en.wikipedia.org/wiki/Factory_method_pattern
+
+
+
+EXTENSIBLE OBJECT
+-----------------
+Pope is able to use duck typing and monkey patching through the use of a class
+called ExtensibleObject, which provides these capabilities. ExtensibleObject
+provides a means of polymorphism and multiple inheritance using something
+called "mixins".
+See: http://en.wikipedia.org/wiki/Mixin
+
+An understanding of how to use ExtensibleObject is fundamental to the understanding
+of how to use Pope, and what makes it a unique and powerful tool.
+
+ExtensibleObject is quite unique in that it brings a lot of features to PHP 5.2
+that are only available in PHP 5.3 and above. It inherits a lot of it's design
+from Ruby. For example,
+
+i) Methods can be added and removed from objects at runtime through the use of
+Pope extensions
+ 
+ii) Pre-executed and post-executed hooks can be registered at runtime, which are 
+methods that are executed when a particular method has been called on an 
+ExtensibleObject instance.
+
+iii) Method implementations can be replaced and restored at runtime.
+
+To get a better understanding of how these things can truly benefit you as a
+programmer and a designer, please watch David Heinemeier Hansson's keynote about
+Ruby: http://vimeo.com/17420638
+
+
diff --git a/wp-content/plugins/nextgen-gallery/pope/lib/autoload.php b/wp-content/plugins/nextgen-gallery/pope/lib/autoload.php
new file mode 100644
index 0000000000000000000000000000000000000000..f57214b2ae152cbbb57ac445d5d50bc9148df55c
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/pope/lib/autoload.php
@@ -0,0 +1,14 @@
+<?php
+
+if (!defined('POPE_VERSION')) {
+	define('POPE_VERSION', '0.4');
+	require_once('class.extensibleobject.php');
+	require_once('interface.component.php');
+	require_once('class.component.php');
+	require_once('interface.component_factory.php');
+	require_once('class.component_factory.php');
+	require_once('class.component_registry.php');
+	require_once('interface.pope_module.php');
+	require_once('class.base_module.php');
+	require_once('class.base_product.php');
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/pope/lib/class.base_module.php b/wp-content/plugins/nextgen-gallery/pope/lib/class.base_module.php
new file mode 100644
index 0000000000000000000000000000000000000000..fc113d2ef9fac77e37e1d155461f49c682ed589b
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/pope/lib/class.base_module.php
@@ -0,0 +1,184 @@
+<?php
+
+if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
+
+/**
+ * A Module will register utilities and adapters to provide it's functionality,
+ * and usually provide some classes for business logic.
+ *
+ * Registered an adapter for the I_Component_Factory interface to add new
+ * factory methods is the most common use of an adapter.
+ */
+abstract class C_Base_Module extends C_Component
+{
+    var $module_id;
+    var $module_name;
+    var $module_description;
+    var $module_version;
+    var $module_uri;
+    var $module_author;
+    var $module_author_uri;
+    var $module_type_list = null;
+
+    function __construct($context=FALSE)
+    {
+    	if ($context)	{
+    		parent::__construct(__EXTOBJ_NO_INIT__, $context);
+    	}
+    	else {
+    		parent::__construct(__EXTOBJ_NO_INIT__);
+    	}
+    }
+
+    /**
+     * Defines the module
+     */
+    function define($id, $name, $description='', $version='', $uri='', $author='', $author_uri='', $context=FALSE)
+    {
+		parent::define($context);
+		$this->implement('I_Pope_Module');
+		$this->module_id = $id;
+		$this->module_name = $name;
+		$this->module_description = $description;
+		$this->module_version = $version;
+		$this->module_uri = $uri;
+		$this->module_author = $author;
+		$this->module_author_uri = $author_uri;
+
+		$this->get_registry()->add_module($this->module_id, $this);
+
+		$this->_register_utilities();
+		$this->_register_adapters();
+		$this->_register_hooks();
+    }
+
+    /**
+     * I/O can be expensive to run repeatedly, so when a module is created we cache a listing of every file provided
+     *
+     * @return array List of types => files belonging to this module
+     */
+    function get_type_list()
+    {
+    	// XXX small hack to skip photocrati theme modules scans
+    	$except_modules = array(
+    	'photocrati-gallery_legacy' => array(), 
+    	'photocrati-theme_bulk' => array(), 
+    	'photocrati-theme_admin' => array(), 
+    	'photocrati-auto_update' => array(
+        'A_Autoupdate_Settings' => 'adapter.autoupdate_settings.php'
+      ),
+    	'photocrati-auto_update-admin' => array(
+        'A_Autoupdate_Admin_Ajax' => 'adapter.autoupdate_admin_ajax.php',
+        'A_Autoupdate_Admin_Factory' => 'adapter.autoupdate_admin_factory.php',
+        'C_Autoupdate_Admin_Ajax' => 'class.autoupdate_admin_ajax.php',
+        'C_Autoupdate_Admin_Controller' => 'class.autoupdate_admin_controller.php'
+      ));
+      
+      if (isset($except_modules[$this->module_id]))
+      {
+      	return $except_modules[$this->module_id];
+      }
+      
+    	if ($this->module_type_list === null)
+    	{    		
+				$map = array(
+					'C_'		=> 'class',
+					'A_'		=> 'adapter',
+					'I_'		=> 'interface',
+					'Mixin_'	=> 'mixin',
+					'M_'		=> 'module',
+					'Hook_'		=> 'hook',
+				);
+		      
+		  	$type_list = array();
+		    $dir = $this->get_registry()->get_module_dir($this->module_id) . DIRECTORY_SEPARATOR;
+		    $iterator = new RecursiveIteratorIterator(
+		        new RecursiveDirectoryIterator($dir)
+		    );
+		    foreach ($iterator as $filename) {
+		        if (in_array(basename($filename->getPathname()), array('.', '..')))
+		            continue;
+		      
+		      $filename = str_replace($dir, '', $filename->getPathname());
+		    	$file_parts = explode('.', $filename);
+		    	$prefix = $file_parts[0];
+		    	$name = (!empty($file_parts[1]) ? $file_parts[1] : '');
+		    	$name_prefix = array_search($prefix, $map);
+		    	
+		    	if ($name_prefix)
+		    	{
+				  	$type_name = $name_prefix . $name;
+				  	
+				  	$type_list[$type_name] = $filename;
+		    	}
+		    }
+		    
+		    $this->module_type_list = $type_list;
+    	}
+      
+      return $this->module_type_list;
+    }
+   
+    /**
+     * Provides a reliable means of determining if the current request is in the
+     * wp-admin panel
+     * @return boolean
+     */
+    function is_admin()
+    {
+        return (is_admin() OR preg_match('/wp-admin/', $_SERVER['REQUEST_URI']));
+    }
+
+    /**
+     * Join two filesystem paths together (e.g. 'give me $path relative to $base').
+     *
+     * If the $path is absolute, then the full path is returned.
+     * Taken from wordpress 3.4.1
+     *
+     * @param string $base
+     * @param string $path
+     * @return string The path with the base or absolute path
+     */
+    function _path_join($base, $path)
+    {
+        if ($this->_path_is_absolute($path))
+        {
+            return $path;
+        }
+        return trim($base, '/') . '/' . ltrim($path, '/');
+    }
+
+    /**
+     * Test if a give filesystem path is absolute ('/foo/bar', 'c:\windows').
+     *
+     * Taken from wordpress 3.4.1
+     * @param string $path File path
+     * @return bool True if path is absolute, false is not absolute.
+     */
+    function _path_is_absolute($path)
+    {
+        // this is definitive if true but fails if $path does not exist or contains a symbolic link
+        if (realpath($path) == $path)
+        {
+            return true;
+        }
+
+        if (strlen($path) == 0 || $path[0] == '.')
+        {
+            return false;
+        }
+
+        // windows allows absolute paths like this
+        if (preg_match('#^[a-zA-Z]:\\\\#', $path))
+        {
+            return true;
+        }
+
+        // a path starting with / or \ is absolute; anything else is relative
+        return ($path[0] == '/' || $path[0] == '\\');
+    }
+
+    function _register_hooks() {}
+    function _register_adapters() {}
+    function _register_utilities() {}
+}
diff --git a/wp-content/plugins/nextgen-gallery/pope/lib/class.base_product.php b/wp-content/plugins/nextgen-gallery/pope/lib/class.base_product.php
new file mode 100644
index 0000000000000000000000000000000000000000..6b14cd4f35347bf4d014b02d6d1ee9a7e5eaffbb
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/pope/lib/class.base_product.php
@@ -0,0 +1,36 @@
+<?php
+
+if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
+
+/**
+ * A Product is a collection of modules with some meta data.
+ *
+ * Products are responsible for including and loading any modules required
+ * for the functionality of the product.
+ *
+ * Module initialization is handled by the bootstrap procedure.
+ */
+abstract class C_Base_Product extends C_Base_Module
+{
+	function define($id, $name, $description='', $version='', $uri='', $author='', $author_uri='')
+	{
+		parent::define($id, $name, $description, $version, $uri, $author, $author_uri);
+
+		$this->get_registry()->add_product($this->module_id, $this);
+	}
+
+  function get_type_list()
+  {
+      return array();
+  }
+
+	function is_background_product()
+	{
+		return false;
+	}
+
+	function get_dashboard_message($type = null)
+	{
+		return false;
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/pope/lib/class.component.php b/wp-content/plugins/nextgen-gallery/pope/lib/class.component.php
new file mode 100644
index 0000000000000000000000000000000000000000..a02db5d8020026941e9ed3f95aa0a4faafa8c062
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/pope/lib/class.component.php
@@ -0,0 +1,113 @@
+<?php
+
+/**
+ * Pope is a component-based framework. All classes should inherit this class.
+ */
+class C_Component extends ExtensibleObject
+{
+    /**
+     * @var string
+     */
+    var $context;
+	var $adapted = FALSE;
+
+	/**
+	 * Many components will execute parent::define()
+	 */
+	function define($context=FALSE)
+	{
+		$this->context = is_null($context) ? FALSE : $context;
+		$this->implement('I_Component');
+	}
+
+    // Initializes the state of the object
+    function initialize()
+    {
+		$this->get_registry()->apply_adapters($this);
+		$this->adapted = TRUE;
+    }
+
+	/**
+	 * Determines if the component has one or more particular contexts assigned
+	 * @param string|array $context
+	 * @return boolean
+	 */
+	function has_context($context)
+	{
+		$retval = TRUE;
+		$current_context = is_array($this->context) ? $this->context : array($this->context);
+		if (!is_array($context)) $context = array($context);
+		foreach ($context as $c) {
+			if (!in_array($c, $current_context)) {
+				$retval = FALSE;
+				break;
+			}
+		}
+		return $retval;
+	}
+
+	/**
+	 * Assigns a particular context to the component
+	 * @param type $context
+	 */
+	function add_context($context)
+	{
+		if (!is_array($context)) $context = array($context);
+		if (!is_array($this->context)) $this->context = array($this->context);
+		foreach ($context as $c) {
+			if (in_array($c, $this->context)) continue;
+			else $context[] = $c;
+		}
+	}
+
+	/**
+	 * Assigns one or more contexts to the component
+	 * @param type $context
+	 */
+	function assign_context($context)
+	{
+		$this->add_context($context);
+	}
+
+	/**
+	 * Un-assigns one or more contexts from the component
+	 * @param type $context
+	 */
+	function remove_context($context)
+	{
+		if (!is_array($context)) $context = array($context);
+		if (!is_array($this->context)) $this->context = array($this->context);
+		foreach ($context as $c) {
+			if (($index = array_search($c, $this->context)) !== FALSE) {
+				unset($this->context[$index]);
+			}
+		}
+	}
+
+	/**
+	 * Assigns one or more contexts to the component
+	 * @param type $context
+	 */
+	function unassign_context($context)
+	{
+		$this->remove_context($context);
+	}
+
+	/**
+	 * Gets the component registry
+	 * @return 	C_Component_Registry
+	 */
+	function get_registry()
+	{
+		return C_Component_Registry::get_instance();
+	}
+
+	/**
+	 * Gets the component registry -- backward compatibility
+	 * @return 	C_Component_Registry
+	 */
+	function _get_registry()
+	{
+		return C_Component_Registry::get_instance();
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/pope/lib/class.component_factory.php b/wp-content/plugins/nextgen-gallery/pope/lib/class.component_factory.php
new file mode 100644
index 0000000000000000000000000000000000000000..046def6d80fe2fc13b411afaae3520ac6d114b11
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/pope/lib/class.component_factory.php
@@ -0,0 +1,35 @@
+<?php
+
+/**
+ * A factory for hatching (instantiating) components
+ */
+class C_Component_Factory extends C_Component
+{
+    static $_instances = array();
+
+    function define()
+    {
+		parent::define();
+        $this->implement('I_Component_Factory');
+    }
+
+    function create($method, $args=array())
+    {
+        // Format the arguments for the method call
+        $args = func_get_args();
+        array_shift($args);
+
+        // Create the component and apply the adapters
+        $component = $this->call_method($method, $args);
+
+        return $component;
+    }
+
+    static function &get_instance($context = False)
+    {
+		if (!isset(self::$_instances[$context])) {
+			self::$_instances[$context] = new C_Component_Factory($context);
+		}
+		return self::$_instances[$context];
+    }
+}
diff --git a/wp-content/plugins/nextgen-gallery/pope/lib/class.component_registry.php b/wp-content/plugins/nextgen-gallery/pope/lib/class.component_registry.php
new file mode 100644
index 0000000000000000000000000000000000000000..6658520fd7964769bca8790a39e48f5c1ea999c1
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/pope/lib/class.component_registry.php
@@ -0,0 +1,943 @@
+<?php
+
+/**
+ *  A registry of registered products, modules, adapters, and utilities.
+ */
+class C_Component_Registry
+{
+    static  $_instance = NULL;
+    var     $_meta_info = array(); /* Contains a cached mapping of module_id -> module_info (including the path the module was installed to) */
+    var     $_default_path = NULL;
+    var     $_modules = array();
+    var     $_products = array();
+    var     $_adapters = array();
+    var     $_utilities = array();
+    var     $_module_type_cache = array();
+    var     $_module_type_cache_count = 0;
+
+
+    /**
+     * This is a singleton object
+     */
+    private function __construct()
+    {
+			// Create an autoloader
+			spl_autoload_register(array($this, '_module_autoload'), TRUE);
+    }
+
+
+    /**
+     * Returns a singleton
+     * @return C_Component_Registry()
+     */
+    static function &get_instance()
+    {
+        if (is_null(self::$_instance)) {
+            $klass = get_class();
+            self::$_instance = new $klass();
+        }
+        return self::$_instance;
+    }
+
+    /**
+     * Saves the registry to disk
+     * @param string $config_file
+     */
+    function save($config_file)
+    {
+        $fp = FALSE;
+        $retval = TRUE;
+
+        try {
+            $fp = fopen($config_file, 'w');
+            fwrite($fp, json_encode(array(
+                'modules' => $this->_modules,
+                'products' => $this->_products,
+                'adapters' => $this->_adapters,
+                'utilities'=> $this->_utilities
+            )));
+        }
+        catch (Exception $e) {
+            if ($fp) fclose($fp);
+            $retval = FALSE;
+        }
+        if ($fp) fclose($fp);
+
+        return $retval;
+    }
+
+
+    function load($config_file)
+    {
+        $fp = FALSE;
+        $retval = TRUE;
+
+        try {
+            $fp = fopen($config_file);
+            $json = json_decode(fread($fp), TRUE);
+            $this->_modules = array_merge($this->_modules, $json['modules']);
+            $this->_products = array_merge($this->_products, $json['products']);
+            $this->_adapters = array_merge($this->_adapters, $json['adapters']);
+            $this->_utilities = array_merge($this->_utilities, $json['utilities']);
+        }
+        catch (Exception $e) {
+            if ($fp) fclose($fp);
+            $retval = FALSE;
+        }
+        if ($fp) fclose($fp);
+
+        return $retval;
+    }
+
+
+    /**
+     * Adds a path in the search paths for loading modules
+     * @param string $path
+     * @param bool $recurse - note, it will only recurse 1 level in the hierarchy
+     * @param bool $load_all - loads all modules found in the path
+     */
+    function add_module_path($path, $recurse = false, $load_all = false)
+    {
+    	if ($this->get_default_module_path() == null)
+    	{
+    		$this->set_default_module_path($path);
+    	}
+
+    	$scan = $this->_scan_module_path($path, $recurse);
+
+    	if ($scan != null)
+    	{
+    		$this->_meta_info = array_merge($this->_meta_info, $scan);
+
+    		if ($load_all)
+    		{
+    			$module_list = array_keys($scan);
+    			$load_list = array();
+    			$count = count($module_list);
+    			$ret = true;
+
+    			for ($i = 0; $i < $count; $i++)
+    			{
+    				$module_id = $module_list[$i];
+    				$info = isset($scan[$module_id]) ? $scan[$module_id] : null;
+  					$before_index = null;
+
+    				if (isset($info['before-list']))
+    				{
+    					$before_list = $info['before-list'];
+
+    					foreach ($before_list as $before_module)
+    					{
+    						$load_index = array_search($before_module, $load_list);
+
+    						if ($load_index !== false)
+    						{
+    							if ($before_index === null || $load_index < $before_index)
+    							{
+    								$before_index = $load_index;
+    							}
+    						}
+    					}
+    				}
+
+  					if ($before_index !== null)
+  					{
+  						array_splice($load_list, $before_index, 0, array($module_id));
+  					}
+  					else
+  					{
+  						$load_list[] = $module_id;
+  					}
+    			}
+
+    			foreach ($load_list as $module_id)
+    			{
+    			  $loaded = $this->load_module($module_id);
+    				$ret = $ret && $loaded;
+    			}
+
+    			return $ret;
+    		}
+
+    		return true;
+    	}
+
+    	return false;
+    }
+
+
+    /**
+     * Retrieves the default module path (Note: this is just the generic root container path for modules)
+     * @return string
+     */
+    function get_default_module_path()
+    {
+    	return $this->_default_path;
+    }
+
+
+    /**
+     * Sets the default module path (Note: this is just the generic root container path for modules)
+     * @param string $path
+     */
+    function set_default_module_path($path)
+    {
+    	$this->_default_path = $path;
+    }
+
+
+    /**
+     * Retrieves the module path
+     * @param string $module_id
+     * @return string
+     */
+    function get_module_path($module_id)
+    {
+    	if (isset($this->_meta_info[$module_id])) {
+    		$info = $this->_meta_info[$module_id];
+
+    		if (isset($info['path'])) {
+    			return $info['path'];
+    		}
+    	}
+
+    	return null;
+    }
+
+
+    /**
+     * Retrieves the module installation directory
+     * @param string $module_id
+     * @return string
+     */
+    function get_module_dir($module_id)
+    {
+    	$path = $this->get_module_path($module_id);
+
+    	if ($path != null) {
+    		return dirname($path);
+    	}
+
+    	return null;
+    }
+
+
+    /**
+     * Loads a module's code according to its dependency list
+     * @param string $module_id
+     */
+    function load_module($module_id)
+    {
+    	return $this->_load_module_internal($module_id);
+    }
+
+    function load_all_modules($type = null)
+    {
+    	$modules = $this->get_known_module_list();
+    	$ret = true;
+
+    	foreach ($modules as $module_id)
+    	{
+    		if ($type == null || $this->get_module_meta($module_id, 'type') == $type) {
+    			$ret = $this->load_module($module_id) && $ret;
+    		}
+    	}
+
+    	return $ret;
+    }
+
+
+    /**
+     * Initializes a previously loaded module
+     * @param string $module_id
+     */
+    function initialize_module($module_id)
+    {
+		$retval = FALSE;
+    	if (isset($this->_modules[$module_id])) {
+    		$module = $this->_modules[$module_id];
+
+    		if (!$module->initialized) {
+				if ($module->has_method('initialize'))
+					$module->initialize();
+
+    			$module->initialized = true;
+    		}
+			$retval = TRUE;
+    	}
+		return $retval;
+    }
+
+
+	/**
+	 * Initializes an already loaded product
+	 * @param string $product_id
+	 * @return bool
+	 */
+	function initialize_product($product_id)
+	{
+		return $this->initialize_module($product_id);
+	}
+
+
+    /**
+     * Initializes all previously loaded modules
+     */
+    function initialize_all_modules()
+    {
+    	$module_list = $this->get_module_list();
+
+    	foreach ($module_list as $module_id)
+    	{
+    		$this->initialize_module($module_id);
+    	}
+    }
+
+
+    /**
+     * Adds an already loaded module to the registry
+     * @param string $module_id
+     * @param C_Base_Module $module_object
+     */
+    function add_module($module_id, $module_object)
+    {
+    	if (!isset($this->_modules[$module_id])) {
+    		$this->_modules[$module_id] = $module_object;
+    	}
+    }
+
+
+    /**
+     * Deletes an already loaded module from the registry
+     * @param string $module_id
+     */
+    function del_module($module_id)
+    {
+    	if (isset($this->_modules[$module_id])) {
+    		unset($this->_modules[$module_id]);
+    	}
+    }
+
+
+    /**
+     * Retrieves the instance of the registered module. Note: it's the instance of the module object, so the module needs to be loaded or this function won't return anything. For module info returned by scanning (with add_module_path), look at get_module_meta
+     * @param string $module_id
+     * @return C_Base_Module
+     */
+    function get_module($module_id)
+    {
+    	if (isset($this->_modules[$module_id])) {
+    		return $this->_modules[$module_id];
+    	}
+
+    	return null;
+    }
+
+    function get_module_meta($module_id, $meta_name)
+    {
+    	$meta = $this->get_module_meta_list($module_id);
+
+    	if (isset($meta[$meta_name])) {
+    		return $meta[$meta_name];
+    	}
+
+    	return null;
+    }
+
+    function get_module_meta_list($module_id)
+    {
+    	if (isset($this->_meta_info[$module_id])) {
+    		return $this->_meta_info[$module_id];
+    	}
+
+    	return null;
+    }
+
+    /**
+     * Retrieves a list of instantiated module ids
+     * @return array
+     */
+    function get_module_list()
+    {
+    	return array_keys($this->_modules);
+    }
+
+    /**
+     * Retrieves a list of registered module ids, including those that aren't loaded (i.e. get_module() call with those unloaded ids will fail)
+     * @return array
+     */
+    function get_known_module_list()
+    {
+    	return array_keys($this->_meta_info);
+    }
+
+
+    function load_product($product_id)
+    {
+    	return $this->load_module($product_id);
+    }
+
+    function load_all_products()
+    {
+    	return $this->load_all_modules('product');
+    }
+
+    /**
+     * Adds an already loaded product in the registry
+     * @param string $product_id
+     * @param C_Base_Module $product_object
+     */
+    function add_product($product_id, $product_object)
+    {
+    	if (!isset($this->_products[$product_id])) {
+    		$this->_products[$product_id] = $product_object;
+    	}
+    }
+
+
+    /**
+     * Deletes an already loaded product from the registry
+     * @param string $product_id
+     */
+    function del_product($product_id)
+    {
+    	if (isset($this->_products[$product_id])) {
+    		unset($this->_products[$product_id]);
+    	}
+    }
+
+
+    /**
+     * Retrieves the instance of the registered product
+     * @param string $product_id
+     * @return C_Base_Module
+     */
+    function get_product($product_id)
+    {
+    	if (isset($this->_products[$product_id])) {
+    		return $this->_products[$product_id];
+    	}
+
+    	return null;
+    }
+
+    function get_product_meta($product_id, $meta_name)
+    {
+    	$meta = $this->get_product_meta_list($product_id);
+
+    	if (isset($meta[$meta_name])) {
+    		return $meta[$meta_name];
+    	}
+
+    	return null;
+    }
+
+    function get_product_meta_list($product_id)
+    {
+    	if (isset($this->_meta_info[$product_id]) && $this->_meta_info[$product_id]['type'] == 'product') {
+    		return $this->_meta_info[$product_id];
+    	}
+
+    	return null;
+    }
+
+
+    /**
+     * Retrieves the module installation path for a specific product (Note: this is just the generic root container path for modules of this product)
+     * @param string $product_id
+     * @return string
+     */
+    function get_product_module_path($product_id)
+    {
+    	if (isset($this->_meta_info[$product_id])) {
+    		$info = $this->_meta_info[$product_id];
+
+    		if (isset($info['product-module-path'])) {
+    			return $info['product-module-path'];
+    		}
+    	}
+
+    	return null;
+    }
+
+
+    /**
+     * Sets the module installation path for a specific product (Note: this is just the generic root container path for modules of this product)
+     * @param string $product_id
+     * @param string $module_path
+     */
+    function set_product_module_path($product_id, $module_path)
+    {
+    	if (isset($this->_meta_info[$product_id])) {
+    		$this->_meta_info[$product_id]['product-module-path'] = $module_path;
+    	}
+    }
+
+
+    /**
+     * Retrieves a list of instantiated product ids
+     * @return array
+     */
+    function get_product_list()
+    {
+    	return array_keys($this->_products);
+    }
+
+    /**
+     * Retrieves a list of registered product ids, including those that aren't loaded (i.e. get_product() call with those unloaded ids will fail)
+     * @return array
+     */
+    function get_known_product_list()
+    {
+    	$list = array_keys($this->_meta_info);
+    	$return = array();
+
+    	foreach ($list as $module_id)
+    	{
+    		if ($this->get_product_meta_list($module_id) != null)
+    		{
+    			$return[] = $module_id;
+    		}
+    	}
+
+    	return $return;
+    }
+
+
+    /**
+     * Registers an adapter for an interface with specific contexts
+     * @param string $interface
+     * @param string $class
+     * @param array $contexts
+     */
+    function add_adapter($interface, $class, $contexts=FALSE)
+    {
+        // If no specific contexts are given, then we assume
+        // that the adapter is to be applied in ALL contexts
+        if (!$contexts) $contexts = array('all');
+        if (!is_array($contexts)) $contexts = array($contexts);
+
+        if (!isset($this->_adapters[$interface])) {
+            $this->_adapters[$interface] = array();
+        }
+
+        // Iterate through each specific context
+        foreach ($contexts as $context) {
+            if (!isset($this->_adapters[$interface][$context])) {
+                $this->_adapters[$interface][$context] = array();
+            }
+            $this->_adapters[$interface][$context][] = $class;
+        }
+    }
+
+
+    /**
+     * Removes an adapter for an interface. May optionally specifify what
+     * contexts to remove the adapter from, leaving the rest intact
+     * @param string $interface
+     * @param string $class
+     * @param array $contexts
+     */
+    function del_adapter($interface, $class, $contexts=FALSE)
+    {
+        // Ensure that contexts is an array of contexts
+        if (!$contexts) $contexts = array('all');
+        if (!is_array($contexts)) $contexts = array($contexts);
+
+        // Iterate through each context for an adapter
+        foreach ($this->_adapters[$interface] as $context => $classes) {
+            if (!$context OR in_array($context, $contexts)) {
+                $index = array_search($class, $classes);
+                unset($this->_adapters[$interface][$context][$index]);
+            }
+        }
+    }
+
+
+    /**
+     * Apply adapters registered for the component
+     * @param C_Component $component
+     * @return C_Component
+     */
+    function &apply_adapters(C_Component &$component)
+    {
+        // Iterate through each adapted interface. If the component implements
+        // the interface, then apply the adapters
+        foreach ($this->_adapters as $interface => $contexts) {
+            if ($component->implements_interface($interface)) {
+
+
+                // Determine what context apply to the current component
+                $applied_contexts = array('all');
+                if ($component->context) {
+					$applied_contexts[] = $component->context;
+					$applied_contexts = $this->_flatten_array($applied_contexts);
+                }
+
+                // Iterate through each of the components contexts and apply the
+                // registered adapters
+                foreach ($applied_contexts as $context) {
+                    if (isset($contexts[$context])) {
+                        foreach ($contexts[$context] as $adapter) {
+                            $component->add_mixin($adapter, TRUE);
+                        }
+                    }
+
+                }
+            }
+        }
+
+        return $component;
+    }
+
+
+    /**
+     * Adds a utility for an interface, to be used in particular contexts
+     * @param string $interface
+     * @param string $class
+     * @param array $contexts
+     */
+    function add_utility($interface, $class, $contexts=FALSE)
+    {
+        // If no specific contexts are given, then we assume
+        // that the utility is for ALL contexts
+        if (!$contexts) $contexts = array('all');
+        if (!is_array($contexts)) $contexts = array($contexts);
+
+        if (!isset($this->_utilities[$interface])) {
+            $this->_utilities[$interface] = array();
+        }
+
+        // Add the utility for each appropriate context
+        foreach ($contexts as $context) {
+            $this->_utilities[$interface][$context] = $class;
+        }
+    }
+
+
+    /**
+     * Deletes a registered utility for a particular interface.
+     * @param string $interface
+     * @param array $contexts
+     */
+    function del_utility($interface, $contexts=FALSE)
+    {
+        if (!$contexts) $contexts = array('all');
+        if (!is_array($contexts)) $contexts = array($contexts);
+
+        // Iterate through each context for an interface
+        foreach ($this->_utilities[$interface] as $context => $class) {
+            if (!$context OR in_array($context, $contexts)) {
+                unset($this->_utilities[$interface][$context]);
+            }
+        }
+    }
+
+	/**
+	 * Gets the class name of the component providing a utility implementation
+	 * @param string $interface
+	 * @param string|array $context
+	 * @return string
+	 */
+	function get_utility_class_name($interface, $context=FALSE)
+	{
+		return $this->_retrieve_utility_class($interface, $context);
+	}
+
+
+    /**
+     * Retrieves an instantiates the registered utility for the provided instance.
+     * The instance is a singleton and must provide the get_instance() method
+     * @param string $interface
+     * @param string $context
+     * @return C_Component
+     */
+    function get_utility($interface, $context=FALSE)
+    {
+        if (!$context) $context='all';
+        $class = $this->_retrieve_utility_class($interface, $context);
+		return call_user_func("{$class}::get_instance", $context);
+    }
+
+
+	/**
+	 * Flattens an array of arrays to a single array
+	 * @param array $array
+	 * @param array $parent (optional)
+	 * @param bool $exclude_duplicates (optional - defaults to TRUE)
+	 * @return array
+	 */
+	function _flatten_array($array, $parent=NULL, $exclude_duplicates=TRUE)
+	{
+		if (is_array($array)) {
+
+			// We're to add each element to the parent array
+			if ($parent) {
+				foreach ($array as $index => $element) {
+					foreach ($this->_flatten_array($array) as $sub_element) {
+						if ($exclude_duplicates) {
+							if (!in_array($sub_element, $parent)) {
+								$parent[] = $sub_element;
+							}
+						}
+						else $parent[] = $sub_element;
+					}
+				}
+				$array = $parent;
+			}
+
+			// We're starting the process..
+			else {
+				$index = 0;
+				while (isset($array[$index])) {
+					$element = $array[$index];
+					if (is_array($element)) {
+						$array = $this->_flatten_array($element, $array);
+						unset($array[$index]);
+					}
+					$index += 1;
+				}
+				$array = array_values($array);
+			}
+		}
+		else {
+			$array = array($array);
+		}
+
+		return $array;
+	}
+
+
+    /**
+     * Returns a list of paths under a specific location, optionally by regex matching their names
+     * @param string $path starting path
+     * @param string $regex matched against file basename, not full path
+     * @param int $recurse recurse level
+     */
+		function _get_file_list($path, $recurse = null, $regex = null)
+		{
+			$path = str_replace(array('\\', '/'), DIRECTORY_SEPARATOR, $path);
+			$file_list = array();
+
+			if (is_dir($path)) {
+
+				if ($dh = opendir($path)) {
+
+					if (substr($path, -1) != DIRECTORY_SEPARATOR) {
+						$path .= DIRECTORY_SEPARATOR;
+					}
+
+					rewinddir($dh);
+
+					while (($file = readdir($dh)) !== false) {
+						if ($file != '.' && $file != '..') {
+							$file_path = $path . $file;
+
+							if ($regex == null || preg_match($regex, $file)) {
+								$file_list[] = $file_path;
+							}
+
+							if ($recurse > 0) {
+								$file_list = array_merge($file_list, $this->_get_file_list($file_path, $recurse - 1, $regex));
+							}
+						}
+					}
+
+					closedir($dh);
+				}
+			}
+
+			return $file_list;
+		}
+
+    /**
+     * Searches a path for valid module definitions and stores their dependency lists
+     * @param string $path
+     * @param bool $recurse - note, it will only recurse 1 level in the hierarchy
+     */
+    function _scan_module_path($path, $recurse = false)
+    {
+	  	$path = str_replace(array('\\', '/'), DIRECTORY_SEPARATOR, $path);
+	  	$base = basename($path);
+	  	$regex = '/^(?:module|product)\\..*\\.php$/';
+    	$result = array();
+
+    	if (is_file($path) && preg_match($regex, $base))
+    	{
+    		$result[] = $path;
+    	}
+    	else
+    	{
+    		$result = $this->_get_file_list($path, $recurse ? 1 : 0, $regex);
+    	}
+
+    	if ($result != null)
+    	{
+    		$scan = array();
+
+    		foreach ($result as $module_path)
+    		{
+    			$module_dir = basename(dirname($module_path));
+
+    			if (strpos($module_dir, '__') === 0)
+    			{
+    				continue;
+    			}
+
+    			// XXX might be necessary to use fopen/fread for very large module files
+    			$module_content = file_get_contents($module_path);
+    			$match = null;
+
+    			if (preg_match('/\/(?:\*)+\s*\{\s*(?P<type>Module|Product):\s*(?P<id>[\w-_]+)\s*(?:,\s*Depends:\s*\{(?P<depends>.*)\})?\s*(,\s*Before:\s*\{(?P<before>.*)\})?\s*\}/m', $module_content, $match) > 0)
+    			{
+    				$module_type = $match['type'];
+    				$module_id = $match['id'];
+    				$module_deps = isset($match['depends']) ? $match['depends'] : null;
+    				$module_before = isset($match['before']) ? $match['before'] : null;
+    				$module_info = array('type' => strtolower($module_type), 'id' => $module_id, 'path' => $module_path);
+
+    				if ($module_deps != null)
+    				{
+    					$module_deps = array_map('trim', explode(',', $module_deps));
+    					$module_info['dependency-list'] = $module_deps;
+    				}
+
+    				if ($module_before != null)
+    				{
+    					$module_before = array_map('trim', explode(',', $module_before));
+    					$module_info['before-list'] = $module_before;
+    				}
+
+    				$scan[$module_id] = $module_info;
+    			}
+				else die("{$module_path} is not a valid Pope module");
+    		}
+
+    		return $scan;
+    	}
+
+    	return null;
+    }
+
+
+    /**
+     * Loads a module's code according to its dependency list and taking into consideration circular references
+     * @param string $module_id
+     * @param array $load_path
+     */
+    function _load_module_internal($module_id, $load_path = null)
+    {
+    	if ($this->get_module($module_id) != null)
+    	{
+    		// Module already loaded
+    		return true;
+    	}
+
+    	if (!is_array($load_path))
+    	{
+    		$load_path = (array) $load_path;
+    	}
+
+    	if (isset($this->_meta_info[$module_id]))
+    	{
+    		$module_info = $this->_meta_info[$module_id];
+
+    		if (isset($module_info['dependency-list']))
+    		{
+    			$module_deps = $module_info['dependency-list'];
+                        $load_path[] = $module_id;
+
+    			foreach ($module_deps as $module_dep_id)
+    			{
+    				if (in_array($module_dep_id, $load_path))
+    				{
+    					// Circular reference
+    					continue;
+    				}
+
+    				if (!$this->_load_module_internal($module_dep_id, $load_path))
+    				{
+    					return false;
+    				}
+    			}
+    		}
+                if (isset($module_info['path']))
+                {
+                        $module_path = $module_info['path'];
+
+                        if (is_file($module_path))
+                        {
+                                include_once($module_path);
+
+                                return true;
+                        }
+                }
+    	}
+
+    	return false;
+    }
+
+
+    /**
+     * Private API method. Retrieves the class which currently provides the utility
+     * @param string $interface
+     * @param string $context
+     */
+    function _retrieve_utility_class($interface, $context='all')
+    {
+        $class = FALSE;
+
+        if (!$context) $context = 'all';
+        if (isset($this->_utilities[$interface])) {
+            if (isset($this->_utilities[$interface][$context])) {
+                $class = $this->_utilities[$interface][$context];
+            }
+
+            // No utility defined for the specified interface
+            else {
+                if ($context == 'all') $context = 'default';
+                $class = $this->_retrieve_utility_class($interface, FALSE);
+                if (!$class)
+                    throw new Exception("No utility registered for `{$interface}` with the `{$context}` context.");
+
+            }
+        }
+        else throw new Exception("No utilities registered for `{$interface}`");
+
+        return $class;
+    }
+    /**
+     * Autoloads any classes, interfaces, or adapters needed by this module
+     */
+    function _module_autoload($name)
+    {
+    	if ($this->_module_type_cache == null || count($this->_modules) > $this->_module_type_cache_count)
+    	{
+    		$this->_module_type_cache_count = count($this->_modules);
+      	$modules = $this->_modules;
+      	
+      	foreach ($modules as $module_id => $module)
+      	{
+      		$dir = $this->get_module_dir($module_id);
+      		$type_list = $module->get_type_list();
+      		
+      		foreach ($type_list as $type => $filename)
+      		{
+      			$this->_module_type_cache[strtolower($type)] = $dir . DIRECTORY_SEPARATOR . $filename;
+      		}
+      	}
+    	}
+    	
+    	$name = strtolower($name);
+    	
+    	if (isset($this->_module_type_cache[$name]))
+    	{
+    		$module_filename = $this->_module_type_cache[$name];
+    		
+    		if (file_exists($module_filename))
+    		{
+					include_once($module_filename);
+    		}
+    	}
+    }
+}
diff --git a/wp-content/plugins/nextgen-gallery/pope/lib/class.extensibleobject.php b/wp-content/plugins/nextgen-gallery/pope/lib/class.extensibleobject.php
new file mode 100644
index 0000000000000000000000000000000000000000..2a45dac8f06b0ae9be066fb172ddf0d4d72b3140
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/pope/lib/class.extensibleobject.php
@@ -0,0 +1,1377 @@
+<?php
+define('__EXTOBJ_STATIC__', '__STATICALLY_CALLED__');
+define('__EXTOBJ_NO_INIT__', '__NO_INIT__');
+
+
+/**
+ * Provides helper methods for Pope objects
+ */
+class PopeHelpers
+{
+    /**
+     * Merges two associative arrays
+     * @param array $a1
+     * @param array $a2
+     * @return array
+     */
+    function array_merge_assoc($a1, $a2, $skip_empty=FALSE)
+    {
+		if ($a2) {
+			foreach ($a2 as $key => $value) {
+				if ($skip_empty && $value === '' OR is_null($value)) continue;
+				if (isset($a1[$key])) {
+
+					if (is_array($value)) {
+						$a1[$key] = $this->array_merge_assoc($a1[$key], $value);
+
+					}
+					else {
+						$a1[$key] = $value;
+					}
+
+				}
+				else $a1[$key] = $value;
+			}
+		}
+		return $a1;
+    }
+
+
+    /**
+     * Returns TRUE if a property is empty
+     * @param string $var
+     * @return boolean
+     */
+    function is_empty($var, $element=FALSE)
+    {
+       if (is_array($var) && $element) {
+           if (isset($var[$element])) $var = $var[$element];
+           else $var = FALSE;
+       }
+
+       return (is_null($var) OR (is_string($var) AND strlen($var) == 0) OR $var === FALSE);
+    }
+}
+
+
+/**
+ * An ExtensibleObject can be extended at runtime with methods from another
+ * class.
+ *
+ * - Mixins may be added or removed at any time during runtime
+ * - The path to the mixin is cached so that subsequent method calls are
+ *   faster
+ * - Pre and post hooks can be added or removed at any time during runtime.
+ * - Each method call has a list of associated properties that can be modified
+ *   by pre/post hooks, such as: return_value, run_pre_hooks, run_post_hooks, etc
+ * - Methods can be replaced by other methods at runtime
+ * - Objects can implement interfaces, and are constrained to implement all
+ *   methods as defined by the interface
+ * - All methods are public. There's no added security by having private/protected
+ *   members, as monkeypatching can always expose any method. Instead, protect
+ *   your methods using obscurity. Conventionally, use an underscore to define
+ *   a method that's private to an API
+ */
+class ExtensibleObject extends PopeHelpers
+{
+    const METHOD_PROPERTY_RUN='run';
+    const METHOD_PROPERTY_RUN_POST_HOOKS='run_post_hooks';
+    const METHOD_PROPERTY_RUN_PRE_HOOKS='run_pre_hooks';
+    const METHOD_PROPERTY_RETURN_VALUE='return_value';
+
+    var  $_mixins = array();
+    var  $_mixin_priorities = array();
+    var  $_pre_hooks = array();
+    var  $_global_pre_hooks = array();
+    var  $_global_post_hooks= array();
+    var  $_post_hooks = array();
+    var  $_method_map_cache = array();
+    var  $_interfaces = array();
+    var  $_overrides = array();
+    var  $_aliases = array();
+    var  $_method_properties = array();
+    var  $_throw_error = TRUE;
+    var  $_wrapped_instance = FALSE;
+	var	 $object = NULL;
+	var  $_disabled_pre_hooks = array();
+	var  $_disabled_post_hooks = array();
+	var  $_disabled_mixins = array();
+
+
+    /**
+     * Defines a new ExtensibleObject. Any subclass should call this constructor.
+     * Subclasses are expected to provide the following:
+     * define_instance() - adds extensions which provide instance methods
+     * define_class() - adds extensions which provide static methods
+     * initialize() - used to initialize the state of the object
+     */
+    function __construct()
+    {
+		// Mixins access their parent class by accessing $this->object.
+		// Sometimes users mistakenly use $this->object within the parent object
+		// itself. As it's becoming a common mistake, we define a $this->object
+		// property which points to the current instance (itself)
+		$this->object = $this;
+
+        $args = func_get_args();
+        $define_instance = TRUE;
+        $init_instance = TRUE;
+
+        // The first argument could be a flag to ExtensibleObject
+        // which indicates that only static-like methods will be called
+        if (count($args) >= 1) {
+            $first_arg = $args[0];
+            if (is_string($first_arg)) {
+            	switch ($first_arg) {
+            		case __EXTOBJ_STATIC__:
+            		{
+		              $define_instance = FALSE;
+		              $init_instance = FALSE;
+
+		              if (method_exists($this, 'define_class')) {
+						  $this->call_callback($this, 'define_class', $args);
+		              }
+		              elseif (method_exists($this, 'define_static')) {
+						  $this->call_callback($this, 'define_static', $args);
+		              }
+
+					  break;
+            		}
+            		case __EXTOBJ_NO_INIT__:
+            		{
+		              $init_instance = FALSE;
+
+            			break;
+            		}
+            	}
+            }
+        }
+
+        // Are we to define instance methods?
+        if ($define_instance)
+        {
+            if (method_exists($this, 'define_instance'))
+            {
+                $reflection = new ReflectionMethod($this, 'define_instance');
+                $reflection->invokeArgs($this, $args);
+                // call_user_func_array(array($this, 'define_instance'), $args);
+            }
+            elseif (method_exists($this, 'define')) {
+                $reflection = new ReflectionMethod($this, 'define');
+                $reflection->invokeArgs($this, $args);
+                // call_user_func_array(array($this, 'define'), $args);
+            }
+
+            $this->_enforce_interface_contracts();
+
+			if ($init_instance)
+            {
+                // Initialize the state of the object
+                if (method_exists($this, 'initialize')) {
+                    $reflection = new ReflectionMethod($this, 'initialize');
+                    $reflection->invokeArgs($this, $args);
+                    // call_user_func_array(array($this, 'initialize'), $args);
+                }
+            }
+        }
+    }
+
+	/**
+	 * Disabled prehooks for a particular method
+	 * @param string $method
+	 */
+	function disable_pre_hooks($method)
+	{
+		$this->_disabled_pre_hooks[] = $method;
+		return $this;
+	}
+
+
+	/**
+	 * Enable prehooks for a particular method
+	 * @param string $method
+	 */
+	function enable_pre_hooks($method)
+	{
+		$index = array_search($method, $this->_disabled_pre_hooks);
+		if ($index !== FALSE) {
+			unset($this->_disabled_pre_hooks[$index]);
+		}
+		return $this;
+	}
+
+	/**
+	 * Disabled posthooks for a particular method
+	 * @param string $method
+	 */
+	function disable_post_hooks($method)
+	{
+		$this->_disabled_post_hooks[] = $method;
+		return $this;
+	}
+
+
+	/**
+	 * Enable post-hooks for a particular method
+	 * @param string $method
+	 */
+	function enable_post_hooks($method)
+	{
+		$index = array_search($method, $this->_disabled_post_hooks);
+		if ($index !== FALSE) {
+			unset($this->_disabled_post_hooks[$index]);
+		}
+		return $this;
+	}
+
+	/**
+	 * Determines if post hooks are enabled for a particular method
+	 * @param string $method
+	 * @return bool
+	 */
+	function are_post_hooks_enabled($method)
+	{
+		return !empty($this->_post_hooks) && (!in_array($method, $this->_disabled_post_hooks));
+	}
+
+
+	/**
+	 * Determines if pre hooks are enabled for a particular method
+	 * @param string $method
+	 * @return bool
+	 */
+	function are_pre_hooks_enabled($method)
+	{
+		return !empty($this->_pre_hooks) && (!in_array($method, $this->_disabled_pre_hooks));
+	}
+
+
+    /**
+     * Adds an extension class to the object. The extension provides
+     * methods for this class to expose as it's own
+     * @param string $class
+     */
+    function add_mixin($class, $instantiate=FALSE)
+    {
+		$retval = TRUE;
+
+		if (!$this->has_mixin($class)) {
+			// We used to instantiate the class, but I figure
+			// we might as well wait till the method is called to
+			// save memory. Instead, the _call() method calls the
+			// _instantiate_mixin() method below.
+			$this->_mixins[$class] = FALSE; // new $class();
+			array_unshift($this->_mixin_priorities, $class);
+			$this->_flush_cache();
+
+			// Should we instantiate the object now?
+			if ($instantiate) $this->_instantiate_mixin($class);
+		}
+		else $retval = FALSE;
+
+		return $retval;
+    }
+
+
+	/**
+	 * Determines if a mixin has been added to this class
+	 * @param string $klass
+	 * @return bool
+	 */
+	function has_mixin($klass)
+	{
+		return (isset($this->_mixins[$klass]));
+	}
+
+
+    /**
+     * Stores the instantiated class
+     * @param string $class
+     * @return mixed
+     */
+    function _instantiate_mixin($class)
+    {
+        $retval = FALSE;
+        if ($this->_mixins[$class])
+            $retval = $this->_mixins[$class];
+        else {
+            $obj= new $class();
+            $obj->object = &$this;
+            $retval = $this->_mixins[$class] = &$obj;
+            if (method_exists($obj, 'initialize')) $obj->initialize();
+        }
+
+
+        return $retval;
+    }
+
+
+    /**
+     * Deletes an extension from the object. The methods provided by that
+     * extension are no longer available for the object
+     * @param string $class
+     */
+    function del_mixin($class)
+    {
+        unset($this->_mixins[$class]);
+        $index = array_search($class, $this->_mixin_priorities);
+        if ($index !== FALSE) {
+            unset($this->_mixin_priorities[$index]);
+			foreach ($this->_disabled_mixins as $method => $disabled_mixins) {
+				$index = array_search($class, $disabled_mixins);
+				if (is_int($index)) unset($this->_disabled_mixins[$method][$index]);
+			}
+            $this->_flush_cache();
+        }
+
+    }
+
+
+    function remove_mixin($class)
+    {
+        $this->del_mixin($class);
+    }
+
+
+    /**
+     * Replaces an extension methods with that of another class.
+     * @param string $method
+     * @param string $class
+     * @param string $new_method
+     */
+    function replace_method($method, $class, $new_method=FALSE)
+    {
+        if (!$new_method) $new_method = $method;
+        $this->_overrides[$method] = $class;
+        $this->add_pre_hook($method, "replacement_{$method}_{$class}_{$new_method}", $class, $new_method);
+        $this->_flush_cache();
+
+    }
+
+
+    /**
+     * Restores a method that was replaced by a former call to replace_method()
+     * @param string $method
+     */
+    function restore_method($method)
+    {
+        $class = $this->_overrides[$method];
+        unset($this->_overrides[$method]);
+        $this->del_pre_hook($method, $class);
+        $this->_flush_cache();
+    }
+
+
+	/**
+	 * Returns the Mixin which provides the specified method
+	 * @param string $method
+	 */
+	function get_mixin_providing($method, $return_obj=FALSE)
+	{
+		$retval = FALSE;
+
+		// If it's cached, then we've got it easy
+		if ($this->is_cached($method)) {
+
+			$object = $this->_method_map_cache[$method];
+			$retval = get_class($object);
+		}
+
+		// Otherwise, we have to look it up
+		else {
+            foreach ($this->get_mixin_priorities($method) as $klass) {
+                $object = $this->_instantiate_mixin($klass);
+                if (method_exists($object, $method)) {
+                    $retval = $return_obj ? $object : get_class($object);
+                    $this->_cache_method($object, $method);
+                    break;
+                }
+            }
+		}
+
+		return $retval;
+	}
+
+
+    /**
+     * When an ExtensibleObject is instantiated, it checks whether all
+     * the registered extensions combined provide the implementation as required
+     * by the interfaces registered for this object
+     */
+    function _enforce_interface_contracts()
+    {
+        $errors = array();
+
+        foreach ($this->_interfaces as $i) {
+            $r = new ReflectionClass($i);
+            foreach ($r->getMethods() as $m) {
+                if (!$this->has_method($m->name)) {
+					$klass = $this->get_class_name($this);
+                    $errors[] = "`{$klass}` does not implement `{$m->name}` as required by `{$i}`";
+                }
+            }
+        }
+
+        if ($errors) throw new Exception(implode(". ", $errors));
+    }
+
+
+    /**
+     * Implement a defined interface. Does the same as the 'implements' keyword
+     * for PHP, except this method takes into account extensions
+     * @param string $interface
+     */
+    function implement($interface)
+    {
+        $this->_interfaces[] = $interface;
+    }
+
+
+    /**
+     * Adds a hook that gets executed before every method call
+     * @param string $name
+     * @param string $class
+     * @param string $hook_method
+     */
+    function add_global_pre_hook($name, $class, $hook_method)
+    {
+        $this->add_pre_hook('*', $name, $class, $hook_method);
+    }
+
+    /**
+     * Adds a hook that gets executed after every method call
+     *
+     * @param string $name
+     * @param string $class
+     * @param string $hook_method
+     */
+    function add_global_post_hook($name, $class, $hook_method)
+    {
+        $this->add_pre_hook('*', $name, $class, $hook_method);
+    }
+
+
+    /**
+     * Adds a hook that will get executed before a particular method call
+     * @param string $method
+     * @param string $name
+     * @param string $class
+     * @param string $hook_method
+     */
+    function add_pre_hook($method, $name, $class, $hook_method=FALSE)
+    {
+        if (!$hook_method) $hook_method = $method;
+
+        // Is this a global pre hook?
+        if ($method == '*') {
+            $this->_global_pre_hooks[$name] = array(
+                new $class,
+                $hook_method
+            );
+        }
+
+        // This is a method-specific pre hook
+        else {
+            if (!isset($this->_pre_hooks[$method])) {
+                $this->_pre_hooks[$method] = array();
+            }
+
+            $this->_pre_hooks[$method][$name] = array(
+                new $class,
+                $hook_method
+            );
+        }
+    }
+
+
+    /**
+     * Adds a hook to be called after a particular method call
+     * @param string $method
+     * @param string $hook_name
+     * @param string $class
+     * @param string $hook_method
+     */
+    function add_post_hook($method, $hook_name, $class, $hook_method=FALSE)
+    {
+        // Is this a global post hook?
+        if ($method == '*') {
+            $this->_post_hooks[$hook_name] = array(
+              new $class,
+                $hook_method
+            );
+        }
+
+        // This is a method-specific post hook
+        else {
+            if (!$hook_method) $hook_method = $method;
+
+            if (!isset($this->_post_hooks[$method])) {
+                $this->_post_hooks[$method] = array();
+            }
+
+            $this->_post_hooks[$method][$hook_name] = array(
+                new $class,
+                $hook_method
+            );
+        }
+    }
+
+
+    /**
+     * Deletes a hook that's executed before the specified method
+     * @param string $method
+     * @param string $name
+     */
+    function del_pre_hook($method, $name)
+    {
+
+        unset($this->_pre_hooks[$method][$name]);
+    }
+
+    /**
+     * Deletes all pre hooks registered
+    **/
+    function del_pre_hooks($method=FALSE)
+    {
+        if (!$method)
+            $this->_pre_hooks = array();
+        else
+            unset($this->_pre_hooks[$method]);
+    }
+
+
+    /**
+     * Deletes a hook that's executed after the specified method
+     * @param string $method
+     * @param string $name
+     */
+    function del_post_hook($method, $name)
+    {
+        unset($this->_post_hooks[$method][$name]);
+    }
+
+    /**
+     * Deletes all post hooks
+     */
+    function del_post_hooks($method=FALSE)
+    {
+        if (!$method)
+            $this->_post_hooks = array();
+        else
+            unset($this->_post_hooks[$method]);
+    }
+
+
+    /**
+     * Wraps a class within an ExtensibleObject class.
+     * @param string $klass
+     * @param array callback, used to tell ExtensibleObject how to instantiate
+     * the wrapped class
+     */
+    function wrap($klass, $callback=FALSE, $args=array())
+    {
+        if ($callback) {
+            $this->_wrapped_instance = call_user_func($callback, $args);
+        }
+        else {
+            $this->_wrapped_instance = new $klass();
+        }
+    }
+
+
+    /**
+     * Determines if the ExtensibleObject is a wrapper for an existing class
+     */
+    function is_wrapper()
+    {
+        return $this->_wrapped_instance ? TRUE : FALSE;
+    }
+
+
+    /**
+     * Returns the name of the class which this ExtensibleObject wraps
+     * @return object
+     */
+    function &get_wrapped_instance()
+    {
+        return $this->_wrapped_instance;
+    }
+
+
+    /**
+     * Returns TRUE if the wrapped class provides the specified method
+     */
+    function wrapped_class_provides($method)
+    {
+        $retval = FALSE;
+
+        // Determine if the wrapped class is another ExtensibleObject
+        if (method_exists($this->_wrapped_instance, 'has_method')) {
+			$retval = $this->_wrapped_instance->has_method($method);
+        }
+        elseif (method_exists($this->_wrapped_instance, $method)){
+            $retval = TRUE;
+        }
+
+        return $retval;
+    }
+
+
+    /**
+     * Provides a means of calling static methods, provided by extensions
+     * @param string $method
+     * @return mixed
+     */
+    static function get_class()
+    {
+		// Note: this function is static so $this is not defined
+        $klass = self::get_class_name();
+        $obj = new $klass(__EXTOBJ_STATIC__);
+        return $obj;
+    }
+
+
+	/**
+	 * Gets the name of the ExtensibleObject
+	 * @return string
+	 */
+	static function get_class_name($obj = null)
+	{
+		if ($obj)
+			return get_class($obj);
+		elseif (function_exists('get_called_class'))
+			return get_called_class();
+		else
+			return get_class();
+	}
+
+	/**
+     * Gets a property from a wrapped object
+     * @param string $property
+     * @return mixed
+     */
+    function &__get($property)
+    {
+		$retval = NULL;
+        if ($this->is_wrapper()) {
+			try {
+				$reflected_prop = new ReflectionProperty($this->_wrapped_instance, $property);
+
+				// setAccessible method is only available for PHP 5.3 and above
+				if (method_exists($reflected_prop, 'setAccessible')) {
+					$reflected_prop->setAccessible(TRUE);
+				}
+
+				$retval = $reflected_prop->getValue($this->_wrapped_instance);
+			}
+			catch (ReflectionException $ex)
+			{
+				$retval = $this->_wrapped_instance->$property;
+			}
+        }
+
+		return $retval;
+    }
+
+	/**
+	 * Determines if a property (dynamic or not) exists for the object
+	 * @param string $property
+	 * @return boolean
+	 */
+	function __isset($property)
+	{
+		$retval = FALSE;
+
+		if (property_exists($this, $property)) {
+			$retval = isset($this->$property);
+		}
+		elseif ($this->is_wrapper() && property_exists($this->_wrapped_instance, $property)) {
+			$retval = isset($this->$property);
+		}
+
+		return $retval;
+	}
+
+
+    /**
+     * Sets a property on a wrapped object
+     * @param string $property
+     * @param mixed $value
+     * @return mixed
+     */
+    function &__set($property, $value)
+    {
+		$retval = NULL;
+        if ($this->is_wrapper()) {
+			try {
+				$reflected_prop = new ReflectionProperty($this->_wrapped_instance, $property);
+
+				// The property must be accessible, but this is only available
+				// on PHP 5.3 and above
+				if (method_exists($reflected_prop, 'setAccessible')) {
+					$reflected_prop->setAccessible(TRUE);
+				}
+
+				$retval = &$reflected_prop->setValue($this->_wrapped_instance, $value);
+			}
+
+			// Sometimes reflection can fail. In that case, we need
+			// some ingenuity as a failback
+			catch (ReflectionException $ex) {
+				$this->_wrapped_instance->$property = $value;
+				$retval = &$this->_wrapped_instance->$property;
+			}
+
+        }
+		else {
+			$this->$property = $value;
+			$retval = &$this->$property;
+		}
+        return $retval;
+    }
+
+
+    /**
+     * Finds a method defined by an extension and calls it. However, execution
+     * is a little more in-depth:
+     * 1) Execute all global pre-hooks and any pre-hooks specific to the requested
+     *    method. Each method call has instance properties that can be set by
+     *    other hooks to modify the execution. For example, a pre hook can
+     *    change the 'run_pre_hooks' property to be false, which will ensure that
+     *    all other pre hooks will NOT be executed.
+     * 2) Runs the method. Checks whether the path to the method has been cached
+     * 3) Execute all global post-hooks and any post-hooks specific to the
+     *    requested method. Post hooks can access method properties as well. A
+     *    common usecase is to return the value of a post hook instead of the
+     *    actual method call. To do this, set the 'return_value' property.
+     * @param string $method
+     * @param array $args
+     * @return mixed
+     */
+    function __call($method, $args)
+    {
+        $this->clear_method_properties($method, $args);
+
+        // Run pre hooks?
+        if ($this->are_pre_hooks_enabled($method) && $this->get_method_property($method, self::METHOD_PROPERTY_RUN_PRE_HOOKS)) {
+
+            // Combine global and method-specific pre hooks
+            $prehooks = $this->_global_pre_hooks;
+            if (isset($this->_pre_hooks[$method])) {
+                $prehooks = array_merge($prehooks, $this->_pre_hooks[$method]);
+            }
+
+            // Apply each hook
+            foreach ($prehooks as $hook_name => $hook) {
+				$method_args = $this->get_method_property($method, 'arguments', $args);
+                $this->_run_prehook(
+					$hook_name,
+					$method,
+					$hook[0],
+					$hook[1],
+					$method_args
+				);
+            }
+        }
+
+        // Are we to run the actual method? A pre hook might have told us
+        // not to
+        if ($this->get_method_property($method, self::METHOD_PROPERTY_RUN) && !isset($this->_overrides[$method]))
+        {
+            if (($this->get_mixin_providing($method))) {
+                $this->set_method_property(
+                    $method,
+                    self::METHOD_PROPERTY_RETURN_VALUE,
+                    $this->_exec_cached_method($method, $this->get_method_property($method, 'arguments'))
+                );
+            }
+
+            // This is NOT a wrapped class, and no extensions provide the method
+            else {
+                // Perhaps this is a wrapper and the wrapped object
+                // provides this method
+                if ($this->is_wrapper() && $this->wrapped_class_provides($method))
+                {
+                    $object = $this->add_wrapped_instance_method($method);
+                    $this->set_method_property(
+                        $method,
+                        self::METHOD_PROPERTY_RETURN_VALUE,
+                        call_user_func_array(
+                            array(&$object, $method),
+                            $this->get_method_property($method, 'arguments')
+                        )
+                    );
+                }
+                elseif ($this->_throw_error) {
+                    throw new Exception("`{$method}` not defined for " . get_class());
+                }
+                else {
+                    return FALSE;
+                }
+            }
+        }
+
+        // Are we to run post hooks? A pre hook might have told us not to
+        if ($this->are_post_hooks_enabled($method) && $this->get_method_property($method, self::METHOD_PROPERTY_RUN_POST_HOOKS)) {
+
+            // Combine global and method-specific post hooks
+            $posthooks = $this->_global_post_hooks;
+            if (isset($this->_post_hooks[$method])) {
+                $posthooks = array_merge($posthooks, $this->_post_hooks[$method]);
+            }
+
+            // Apply each hook
+            foreach ($posthooks as $hook_name => $hook) {
+				$method_args = $this->get_method_property($method, 'arguments', $args);
+                $this->_run_post_hook(
+					$hook_name,
+					$method,
+					$hook[0],
+					$hook[1],
+					$method_args
+				);
+            }
+        }
+
+        return $this->get_method_property($method, self::METHOD_PROPERTY_RETURN_VALUE);
+    }
+
+
+	/**
+	 * Adds the implementation of a wrapped instance method to the ExtensibleObject
+	 * @param string $method
+	 * @return Mixin
+	 */
+	function add_wrapped_instance_method($method)
+	{
+		$retval = $this->get_wrapped_instance();
+
+		// If the wrapped instance is an ExtensibleObject, then we don't need
+		// to use reflection
+		if (!is_subclass_of($this->get_wrapped_instance(), 'ExtensibleObject')) {
+			$func	= new ReflectionMethod($this->get_wrapped_instance(), $method);
+
+			// Get the entire method definition
+			$filename = $func->getFileName();
+			$start_line = $func->getStartLine() - 1; // it's actually - 1, otherwise you wont get the function() block
+			$end_line = $func->getEndLine();
+			$length = $end_line - $start_line;
+			$source = file($filename);
+			$body = implode("", array_slice($source, $start_line, $length));
+            $body = preg_replace("/^\s{0,}private|protected\s{0,}/", '', $body);
+
+			// Change the context
+			$body = str_replace('$this', '$this->object', $body);
+			$body = str_replace('$this->object->object', '$this->object', $body);
+			$body = str_replace('$this->object->$', '$this->object->', $body);
+
+			// Define method for mixin
+			$wrapped_klass = get_class($this->get_wrapped_instance());
+			$mixin_klass = "Mixin_AutoGen_{$wrapped_klass}_{$method}";
+			if (!class_exists($mixin_klass)) {
+				eval("class {$mixin_klass} extends Mixin{
+					{$body}
+				}");
+			}
+			$this->add_mixin($mixin_klass);
+			$retval = $this->_instantiate_mixin($mixin_klass);
+			$this->_cache_method($retval, $method);
+
+		}
+
+		return $retval;
+	}
+
+
+    /**
+     * Provides an alternative way to call methods
+     */
+    function call_method($method, $args=array())
+    {
+        if (method_exists($this, $method))
+        {
+            $reflection = new ReflectionMethod($this, $method);
+            return $reflection->invokeArgs($this, array($args));
+        }
+        else {
+            return $this->__call($method, $args);
+        }
+    }
+
+
+    /**
+     * Returns TRUE if the method in particular has been cached
+     * @param string $method
+     * @return type
+     */
+    function is_cached($method)
+    {
+        return isset($this->_method_map_cache[$method]);
+    }
+
+
+    /**
+     * Caches the path to the extension which provides a particular method
+     * @param string $object
+     * @param string $method
+     */
+    function _cache_method($object, $method)
+    {
+        $this->_method_map_cache[$method] = $object;
+    }
+
+
+	/**
+	 * Gets a list of mixins by their priority, excluding disabled mixins
+	 * @param string $method
+	 * @return array
+	 */
+	function get_mixin_priorities($method)
+	{
+		$retval = array();
+		foreach ($this->_mixin_priorities as $mixin) {
+			if ($this->is_mixin_disabled($method, $mixin))
+                continue;
+			$retval[] = $mixin;
+		}
+		return $retval;
+	}
+
+
+	/**
+	 * Determines if a mixin is disabled for a particular method
+	 * @param string $method
+	 * @param string $mixin
+	 * @return boolean
+	 */
+	function is_mixin_disabled($method, $mixin)
+	{
+		$retval = FALSE;
+		if (isset($this->_disabled_mixins[$method]))
+			if (in_array($mixin, $this->_disabled_mixins[$method]) !== FALSE)
+				$retval = TRUE;
+		return $retval;
+	}
+
+
+    /**
+     * Flushes the method cache
+     */
+    function _flush_cache()
+    {
+        $this->_method_map_cache = array();
+    }
+
+
+    /**
+     * Returns TRUE if the object provides the particular method
+     * @param string $method
+     * @return boolean
+     */
+    function has_method($method)
+    {
+        $retval = FALSE;
+
+        // Have we looked up this method before successfully?
+        if ($this->is_cached($method)) {
+            $retval = TRUE;
+        }
+
+        // Is this a local PHP method?
+        elseif (method_exists($this, $method)) {
+            $retval = TRUE;
+        }
+
+        // Is a mixin providing this method
+        elseif ($this->get_mixin_providing($method)) {
+            $retval = TRUE;
+        }
+
+        elseif ($this->is_wrapper() && $this->wrapped_class_provides($method)) {
+            $retval = TRUE;
+        }
+
+        return $retval;
+    }
+
+
+    /**
+     * Runs a particular pre hook for the specified method. The return value
+     * is assigned to the "[hook_name]_prehook_retval" method property
+     * @param string $hook_name
+     * @param string $method_called
+     * @param Ext $object
+     * @param string $hook_method
+     *
+     */
+    function _run_prehook($hook_name, $method_called, $object, $hook_method, &$args)
+    {
+        $object->object = &$this;
+        $object->method_called = $method_called;
+
+        // Are we STILL to execute pre hooks? A pre-executed hook might have changed this
+        if ($this->get_method_property($method_called, 'run_pre_hooks'))
+        {
+            $reflection = new ReflectionMethod($object, $hook_method);
+            $this->set_method_property(
+                $method_called,
+                $hook_name . '_prehook_retval',
+                $reflection->invokeArgs($object, $args)
+            );
+        }
+    }
+
+    /**
+     * Runs the specified post hook for the specified method
+     * @param string $hook_name
+     * @param string $method_called
+     * @param Ext $object
+     * @param string $hook_method
+     */
+    function _run_post_hook($hook_name, $method_called, $object, $hook_method, &$args)
+    {
+        $object->object = &$this;
+        $object->method_called = $method_called;
+
+        // Are we STILL to execute post hooks? A post-executed hook might have changed this
+        if ($this->get_method_property($method_called, 'run_post_hooks'))
+        {
+            $reflection = new ReflectionMethod($object, $hook_method);
+            $this->set_method_property(
+                $method_called,
+                $hook_name . '_post_hook_retval',
+                $reflection->invokeArgs($object, $args)
+            );
+        }
+    }
+
+    /**
+     * Returns TRUE if a pre-hook has been registered for the specified method
+     * @param string $method
+     * @return boolean
+     */
+    function have_prehook_for($method, $name = null)
+    {
+        if (is_null($name)) {
+            return isset($this->_pre_hooks[$method]);
+        } else {
+            return isset($this->_pre_hooks[$method][$name]);
+        }
+
+    }
+
+
+    /**
+     * Returns TRUE if a posthook has been registered for the specified method
+     * @param string $method
+     * @return boolean
+     */
+    function have_posthook_for($method, $name = null)
+    {
+        $retval = FALSE;
+
+        if (isset($this->_post_hooks[$method])) {
+            if (!$name) $retval = TRUE;
+            else $retval = isset($this->_post_hooks[$method][$name]);
+        }
+
+        return $retval;
+    }
+
+	/**
+	 * Disables a mixin for a particular method. This ensures that even though
+	 * mixin provides a particular method, it won't be used to provide the
+	 * implementation
+	 * @param string $method
+	 * @param string $klass
+	 */
+	function disable_mixin($method, $klass)
+	{
+		unset($this->_method_map_cache[$method]);
+		if (!isset($this->_disabled_mixins[$method])) {
+			$this->_disabled_mixins[$method] = array();
+		}
+		$this->_disabled_mixins[$method][] = $klass;
+	}
+
+
+	/**
+	 * Enable a mixin for a particular method, that was previously disabled
+	 * @param string $method
+	 * @param string $klass
+	 */
+	function enable_mixin($method, $klass)
+	{
+		unset($this->_method_map_cache[$method]);
+		if (isset($this->_disabled_mixins[$method])) {
+			$index = array_search($klass, $this->_disabled_mixins[$method]);
+			if ($index !== FALSE) unset($this->_disabled_mixins[$method][$index]);
+		}
+	}
+
+
+	/**
+	 * Gets a list of mixins that are currently disabled for a particular method
+	 * @see disable_mixin()
+	 * @param string $method
+	 * @return array
+	 */
+	function get_disabled_mixins_for($method)
+	{
+		$retval = array();
+		if (isset($this->_disabled_mixins[$method])) {
+			$retval =  $this->_disabled_mixins[$method];
+		}
+		return $retval;
+	}
+
+
+    /**
+     * Executes a cached method
+     * @param string $method
+     * @param array $args
+     * @return mixed
+     */
+    function _exec_cached_method($method, $args=array())
+    {
+        $object = $this->_method_map_cache[$method];
+        $object->object = &$this;
+        $reflection = new ReflectionMethod($object, $method);
+        return $reflection->invokeArgs($object, $args);
+    }
+
+
+    /**
+     * Sets the value of a method property
+     * @param string $method
+     * @param string $property
+     * @param mixed $value
+     */
+    function set_method_property($method, $property, $value)
+    {
+        if (!isset($this->_method_properties[$method])) {
+            $this->_method_properties[$method] = array();
+        }
+
+        return $this->_method_properties[$method][$property] = $value;
+    }
+
+
+    /**
+     * Gets the value of a method property
+     * @param string $method
+     * @param string $property
+     */
+    function get_method_property($method, $property, $default=NULL)
+    {
+        $retval = NULL;
+
+        if (isset($this->_method_properties[$method][$property])) {
+            $retval = $this->_method_properties[$method][$property];
+        }
+
+		if (is_null($retval)) $retval=$default;
+
+        return $retval;
+    }
+
+
+    /**
+     * Clears all method properties to have their default values. This is called
+     * before every method call (before pre-hooks)
+     * @param string $method
+     */
+    function clear_method_properties($method, $args=array())
+    {
+        $this->_method_properties[$method] = array(
+            'run'               => TRUE,
+            'run_pre_hooks'     => TRUE,
+            'run_post_hooks'    => TRUE,
+			'arguments'			=> $args
+        );
+    }
+
+
+    /**
+     * Returns TRUE if the ExtensibleObject has decided to implement a
+     * particular interface
+     * @param string $interface
+     * @return boolean
+     */
+    function implements_interface($interface)
+    {
+        return in_array($interface, $this->_interfaces);
+    }
+
+    function get_class_definition_dir($parent=FALSE)
+    {
+        return dirname($this->get_class_definition_file($parent));
+    }
+
+    function get_class_definition_file($parent=FALSE)
+    {
+		$klass = $this->get_class_name($this);
+        $r = new ReflectionClass($klass);
+        if ($parent) {
+            $parent = $r->getParentClass();
+            return $parent->getFileName();
+        }
+        return $r->getFileName();
+    }
+
+    /**
+     * Returns get_class_methods() optionally limited by Mixin
+     *
+     * @param string (optional) Only show functions provided by a mixin
+     * @return array Results from get_class_methods()
+     */
+    public function get_instance_methods($name = null)
+    {
+        if (is_string($name))
+        {
+            $methods = array();
+            foreach ($this->_method_map_cache as $method => $mixin) {
+                if ($name == get_class($mixin))
+                {
+                    $methods[] = $method;
+                }
+            }
+            return $methods;
+        } else {
+            $methods = get_class_methods($this);
+            foreach ($this->_mixins as $mixin) {
+                $methods = array_unique(array_merge($methods, get_class_methods($mixin)));
+                sort($methods);
+            }
+
+            return $methods;
+        }
+    }
+}
+
+
+/**
+ * An mixin provides methods for an ExtensibleObject to use
+ */
+class Mixin extends PopeHelpers
+{
+    /**
+     * The ExtensibleObject which called the extension's method
+     * @var ExtensibleObject
+     */
+    var $object;
+
+    /**
+     * The name of the method called on the ExtensibleObject
+     * @var type
+     */
+    var $method_called;
+
+    /**
+     * There really isn't any concept of 'parent' method. An ExtensibleObject
+     * instance contains an ordered array of extension classes, which provides
+     * the method implementations for the instance to use. Suppose that an
+     * ExtensibleObject has two extension, and both have the same methods.The
+     * last extension appears to 'override' the first extension. So, instead of calling
+     * a 'parent' method, we're actually just calling an extension that was added sooner than
+     * the one that is providing the current method implementation.
+     */
+    function call_parent($method)
+    {
+        $retval = NULL;
+
+        // To simulate a 'parent' call, we remove the current extension from the
+        // ExtensibleObject that is providing the method's implementation, re-emit
+        // the call on the instance to trigger the implementation from the previously
+        // added extension, and then restore things by re-adding the current extension.
+        // It's complicated, but it works.
+
+        // We need to determine the name of the extension. Because PHP 5.2 is
+        // missing get_called_class(), we have to look it up in the backtrace
+        $backtrace = debug_backtrace();
+        $klass = get_class($backtrace[0]['object']);
+
+		// Perform the routine described above...
+		$this->object->disable_pre_hooks($method);
+		$this->object->disable_post_hooks($method);
+		$this->object->disable_mixin($method, $klass);
+
+        // Call anchor
+        $args = func_get_args();
+
+        // Remove $method parameter
+        array_shift($args);
+        $retval = $this->object->call_method($method, $args);
+
+		// Re-enable hooks
+		$this->object->enable_pre_hooks($method);
+		$this->object->enable_post_hooks($method);
+		$this->object->enable_mixin($method, $klass);
+
+        return $retval;
+    }
+
+    /**
+     * Although is is preferrable to call $this->object->method(), sometimes
+     * it's nice to use $this->method() instead.
+     * @param string $method
+     * @param array $args
+     * @return mixed
+     */
+    function __call($method, $args)
+    {
+        if ($this->object->has_method($method)) {
+            return call_user_func_array(array(&$this->object, $method), $args);
+        }
+    }
+
+    /**
+     * Although extensions can have state, it's probably more desirable to maintain
+     * the state in the parent object to keep a sane environment
+     * @param string $property
+     * @return mixed
+     */
+    function __get($property)
+    {
+        return $this->object->$property;
+    }
+}
+
+/**
+ * An extension which has the purpose of being used as a hook
+ */
+class Hook extends Mixin
+{
+    // Similiar to a mixin's call_parent method.
+    // If a hook needs to call the method that it applied the
+    // Hook n' Anchor pattern to, then this method should be called
+    function call_anchor()
+    {
+		// Disable hooks, so that we call the anchor point
+		$this->object->disable_pre_hooks($this->method_called);
+		$this->object->disable_post_hooks($this->method_called);
+
+        // Call anchor
+        $args = func_get_args();
+        $retval = $this->object->call_method($this->method_called, $args);
+
+		// Re-enable hooks
+		$this->object->enable_pre_hooks($this->method_called);
+		$this->object->enable_post_hooks($this->method_called);
+
+		return $retval;
+    }
+
+    /**
+     * Provides an alias for call_anchor, as there's no parent
+     * to call in the context of a hook.
+     */
+    function call_parent()
+    {
+        $args = func_get_args();
+        return call_user_func_array(
+            array(&$this, 'call_anchor'),
+            $args
+        );
+    }
+};
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/pope/lib/interface.component.php b/wp-content/plugins/nextgen-gallery/pope/lib/interface.component.php
new file mode 100644
index 0000000000000000000000000000000000000000..b054d3f3888da3e73901f259f24e4a43aef2fb56
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/pope/lib/interface.component.php
@@ -0,0 +1,10 @@
+<?php
+
+/**
+ * Provides a generic interface to be registered with an adapter to modify any
+ * component (within a particular context, if desired)
+ */
+interface I_Component
+{
+
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/pope/lib/interface.component_factory.php b/wp-content/plugins/nextgen-gallery/pope/lib/interface.component_factory.php
new file mode 100644
index 0000000000000000000000000000000000000000..57cf3f2b66e8ed22a8f770b779aae56ffb5afca1
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/pope/lib/interface.component_factory.php
@@ -0,0 +1,6 @@
+<?php
+
+interface I_Component_Factory
+{
+    
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/pope/lib/interface.pope_module.php b/wp-content/plugins/nextgen-gallery/pope/lib/interface.pope_module.php
new file mode 100644
index 0000000000000000000000000000000000000000..cfa5c5c5e79fb41f0b7cd384b7b39becebbd191f
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/pope/lib/interface.pope_module.php
@@ -0,0 +1,6 @@
+<?php
+
+interface I_Pope_Module
+{
+	
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/class.nextgen_product_installer.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/class.nextgen_product_installer.php
new file mode 100644
index 0000000000000000000000000000000000000000..0cac1bef7efe9e81534eaa58f821e9ac8dd09d1f
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/class.nextgen_product_installer.php
@@ -0,0 +1,13 @@
+<?php
+
+class C_NextGen_Product_Installer
+{
+	function uninstall($hard)
+	{
+		foreach (P_Photocrati_NextGen::$modules as $module_name) {
+			if (($handler = C_Photocrati_Installer::get_handler_instance($module_name))) {
+				if (method_exists($handler, 'uninstall')) $handler->uninstall($hard);
+			}
+		}
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/README.txt b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/README.txt
new file mode 100644
index 0000000000000000000000000000000000000000..7c4bfc37d769cbe5766042ab95c4fa20857263de
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/README.txt
@@ -0,0 +1,30 @@
+AJAX MODULE
+======================
+
+ == Introduction ==
+-------------------
+
+This module provides a means for executing AJAX actions through the C_Ajax_Controller class.
+This controller is registed as a route, trigged by "/photocrati_ajax" It's designed in mind 
+with the intention that other modules will adapt this controller to provide custom AJAX
+actions.
+
+This module also adds some client-side variables to assist with executing your AJAX actions:
+=> 	photocrati_ajax.url, the url used to post your AJAX requests to
+=>  photacrati_ajax.wp_site_url, the url of the WordPress site
+
+To call an AJAX method using jQuery, you'd do the following:
+
+	jQuery.post(photocrati_ajax.url, {action: "get_gallery", id: 1}, function(response){
+		if (typeof response != 'object) response = JSON.parse(response);
+	});
+	
+The above AJAX request will execute C_Ajax_Controller->get_gallery_action(), which is 
+expected to return valid JSON (even if there is an error)
+
+
+== Caveats ==
+-------------
+
+This module does not currently have any built-in security mechanisms. Any actions you
+mixin using an adapter need to perform their own authorization checks.
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/adapter.ajax_routes.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/adapter.ajax_routes.php
new file mode 100644
index 0000000000000000000000000000000000000000..09ec69892fd04f9dbfd9182582cd30c1a3e1c576
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/adapter.ajax_routes.php
@@ -0,0 +1,21 @@
+<?php
+
+class A_Ajax_Routes extends Mixin
+{
+	function initialize()
+	{
+		// We need to add the route after the router has been fully instantiated
+		$this->object->add_pre_hook(
+			'serve_request',
+			get_class(),
+			get_class(),
+			'add_ajax_routes'
+		);
+	}
+
+	function add_ajax_routes()
+	{
+		$app = $this->object->create_app('/photocrati_ajax');
+		$app->route('/', 'I_Ajax_Controller#index');
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/adapter.ajax_settings.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/adapter.ajax_settings.php
new file mode 100644
index 0000000000000000000000000000000000000000..01734b6e6d4b7c3018e7b7120940d1e7ade9ed06
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/adapter.ajax_settings.php
@@ -0,0 +1,15 @@
+<?php
+
+class A_Ajax_Settings extends Mixin
+{
+    // TODO: Investigate this code. The router uses the I_Settings_Manager utility, but it looks like the..
+    // I_Settings_Manager utility requires the router. Ugh.
+	function initialize()
+	{
+		$router = $this->get_registry()->get_utility('I_Router');
+		$slug = 'photocrati_ajax';
+        $this->object->set_default('ajax_slug',     $slug);
+		$this->object->set_default('ajax_url',		$router->get_url($slug, FALSE));
+		$this->object->set_default('ajax_js_url',	$router->get_url($slug.'/js', FALSE));
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/class.ajax_controller.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/class.ajax_controller.php
new file mode 100644
index 0000000000000000000000000000000000000000..a426c8aaaea6ecbc1ae74e88be7e2d8648381bd7
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/class.ajax_controller.php
@@ -0,0 +1,53 @@
+<?php
+
+class C_Ajax_Controller extends C_MVC_Controller
+{
+	static $_instances = array();
+
+	function define($context=FALSE)
+	{
+		parent::define($context);
+		$this->implement('I_Ajax_Controller');
+	}
+
+	function index_action()
+	{
+		// Start an output buffer to avoid displaying any PHP warnings/errors
+		ob_start();
+
+		// Inform the MVC framework what type of content we're returning
+		$this->set_content_type('json');
+
+		// Get the action requested & find and execute the related method
+		if (($action = $this->param('action'))) {
+			$method = "{$action}_action";
+			if ($this->has_method($method)) {
+				$retval = $this->call_method($method);
+			}
+		}
+
+		// If no retval has been set, then return an error
+		if (!$retval)
+			$retval = array('error' => 'Not a valid AJAX action');
+
+		// Flush the buffer
+		ob_end_clean();
+
+		// Return the JSON to the browser
+		echo json_encode($retval);
+	}
+
+	/**
+	 * Returns an instance of this class
+	 * @param string $context
+	 * @return C_Ajax_Controller
+	 */
+	static function get_instance($context=FALSE)
+	{
+		if (!isset(self::$_instances[$context])) {
+			$klass = get_class();
+			self::$_instances[$context] = new $klass($context);
+		}
+		return self::$_instances[$context];
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/class.ajax_installer.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/class.ajax_installer.php
new file mode 100644
index 0000000000000000000000000000000000000000..01ba549dcee0c8baa548923ffcfd14fa09c76b09
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/class.ajax_installer.php
@@ -0,0 +1,13 @@
+<?php
+
+class C_Ajax_Installer
+{
+	function install()
+	{
+		// Delete cached values. Needed for 2.0.7 and less
+		$settings = C_NextGen_Settings::get_instance();
+		$settings->delete('ajax_url');
+		$settings->delete('ajax_slug');
+		$settings->delete('ajax_js_url');
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/class.ajax_option_handler.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/class.ajax_option_handler.php
new file mode 100644
index 0000000000000000000000000000000000000000..3fcec3073295187e688b32eddf2a87e9de2527e3
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/class.ajax_option_handler.php
@@ -0,0 +1,29 @@
+<?php
+
+class C_Ajax_Option_Handler
+{
+	private $slug = 'photocrati_ajax';
+
+	function get_router()
+	{
+		return C_Component_Registry::get_instance()->get_utility('I_Router');
+	}
+
+	function get($key, $default=NULL)
+	{
+		$retval = $default;
+
+		switch($key) {
+			case 'ajax_slug':
+				$retval = $this->slug;
+				break;
+			case 'ajax_url':
+				$retval = $this->get_router()->get_url($this->slug, FALSE);
+				break;
+			case 'ajax_js_url':
+				$retval = $this->get_router()->get_static_url('photocrati-ajax#ajax.js');
+				break;
+		}
+		return $retval;
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/interface.ajax_controller.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/interface.ajax_controller.php
new file mode 100644
index 0000000000000000000000000000000000000000..9217362973d651dacd94c496a3b94b9ddcdb20fb
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/interface.ajax_controller.php
@@ -0,0 +1,6 @@
+<?php
+
+interface I_Ajax_Controller extends I_MVC_Controller
+{
+	
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/module.ajax.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/module.ajax.php
new file mode 100644
index 0000000000000000000000000000000000000000..3fc151f4ae8317274f405eaf03a5f6fc5b3452ac
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/module.ajax.php
@@ -0,0 +1,88 @@
+<?php
+
+/*
+ {
+		Module: photocrati-ajax,
+		Depends: { photocrati-mvc }
+ }
+ */
+class M_Ajax extends C_Base_Module
+{
+	function define()
+	{
+		parent::define(
+			'photocrati-ajax',
+			'AJAX',
+			'Provides AJAX functionality',
+			'0.4',
+			'http://www.photocrati.com',
+			'Photocrati Media',
+			'http://www.photocrati.com'
+		);
+
+		include_once('class.ajax_option_handler.php');
+		C_NextGen_Settings::add_option_handler('C_Ajax_Option_Handler', array(
+			'ajax_slug',
+			'ajax_url',
+			'ajax_js_url'
+		));
+
+		include_once('class.ajax_installer.php');
+		C_Photocrati_Installer::add_handler($this->module_id, 'C_Ajax_Installer');
+	}
+
+	function _register_adapters()
+	{
+		$this->get_registry()->add_adapter('I_Router', 'A_Ajax_Routes');
+	}
+
+	function _register_utilities()
+	{
+		$this->get_registry()->add_utility('I_Ajax_Controller', 'C_Ajax_Controller');
+
+	}
+
+	/**
+	 * Hooks into the WordPress framework
+	 */
+	function _register_hooks()
+	{
+		add_action('init', array(&$this, 'enqueue_scripts'));
+	}
+
+
+	/**
+	 * Loads a single script to provide the photocrati_ajax settings to the web browser
+	 */
+	function enqueue_scripts()
+	{
+        $settings = C_NextGen_Settings::get_instance();
+        $router   = $this->get_registry()->get_utility('I_Router');
+
+        $site_url = $router->get_base_url(TRUE);
+        $home_url = $router->get_base_url();
+
+        wp_register_script('photocrati_ajax', $settings->ajax_js_url);
+        wp_enqueue_script('photocrati_ajax');
+
+        $vars = array(
+            'url' => $router->get_url($settings->ajax_slug, FALSE),
+            'wp_site_url' => $home_url,
+            'wp_site_static_url' => str_replace('/index.php', '', $site_url)
+        );
+        wp_localize_script('photocrati_ajax', 'photocrati_ajax', $vars);
+	}
+
+    function get_type_list()
+    {
+        return array(
+            'A_Ajax_Routes' => 'adapter.ajax_routes.php',
+            'C_Ajax_Installer' => 'class.ajax_installer.php',
+            'C_Ajax_Controller' => 'class.ajax_controller.php',
+            'I_Ajax_Controller' => 'interface.ajax_controller.php',
+            'M_Ajax' => 'module.ajax.php'
+        );
+    }
+}
+
+new M_Ajax();
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/static/ajax.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/static/ajax.js
new file mode 100644
index 0000000000000000000000000000000000000000..795fa4385c1ac3c45a7ce7eac73c5dba750482da
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/static/ajax.js
@@ -0,0 +1 @@
+// ajax.js is intentionally empty
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/adapter.attach_to_post_ajax.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/adapter.attach_to_post_ajax.php
new file mode 100644
index 0000000000000000000000000000000000000000..e548fc3bd2c530e2499d273b9fbe7c23f37b82f0
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/adapter.attach_to_post_ajax.php
@@ -0,0 +1,235 @@
+<?php
+
+/**
+ * Provides AJAX actions for the Attach To Post interface
+ * TODO: Need to add authorization checks to each action
+ */
+class A_Attach_To_Post_Ajax extends Mixin
+{
+	var $attach_to_post = NULL;
+
+	/**
+	 * Retrieves the attach to post controller
+	 */
+    function get_attach_to_post()
+    {
+        if (is_null($this->attach_to_post))
+            $this->attach_to_post = $this->object->get_registry()->get_utility('I_Attach_To_Post_Controller');
+        return $this->attach_to_post;
+    }
+
+
+	/**
+	 * Returns a list of image sources for the Attach to Post interface
+	 * @return type
+	 */
+	function get_attach_to_post_sources_action()
+	{
+		$response = array();
+
+		if ($this->object->validate_ajax_request())
+		{
+			$response['sources'] = $this->get_attach_to_post()->get_sources();
+		}
+
+		return $response;
+	}
+
+
+	/**
+	 * Gets existing galleries
+	 * @return array
+	 */
+	function get_existing_galleries_action()
+	{
+		$response = array();
+
+		if ($this->object->validate_ajax_request())
+		{
+			$limit = $this->object->param('limit');
+			$offset = $this->object->param('offset');
+
+			// We return the total # of galleries, so that the client can make
+			// pagination requests
+			$mapper = $this->object->get_registry()->get_utility('I_Gallery_Mapper');
+			$response['total'] = $mapper->count();
+			$response['limit'] = $limit = $limit ? $limit : 0;
+			$response['offset'] = $offset = $offset ? $offset : 0;
+
+			// Get the galleries
+			$mapper->select();
+			if ($limit) $mapper->limit($limit, $offset);
+			$response['items'] = $mapper->run_query();
+		}
+
+		return $response;
+	}
+
+
+    /**
+     * Gets existing albums
+     * @return array
+     */
+    function get_existing_albums_action()
+    {
+        $response = array();
+
+		if ($this->object->validate_ajax_request())
+		{
+		    $limit  = $this->object->param('limit');
+		    $offset = $this->object->param('offset');
+
+		    // We return the total # of albums, so that the client can make pagination requests
+		    $mapper = $this->object->get_registry()->get_utility('I_Album_Mapper');
+		    $response['total'] = $mapper->count();
+		    $response['limit'] = $limit = $limit ? $limit : 0;
+		    $response['offset']= $offset = $offset ? $offset : 0;
+
+		    // Get the albums
+		    $mapper->select();
+		    if ($limit) $mapper->limit($limit, $offset);
+		    $response['items'] = $mapper->run_query();
+		}
+
+        return $response;
+    }
+
+	/**
+	 * Gets existing image tags
+	 * @return array
+	 */
+	function get_existing_image_tags_action()
+	{
+		$response = array();
+
+		if ($this->object->validate_ajax_request())
+		{
+			$limit = $this->object->param('limit');
+			$offset = $this->object->param('offset');
+			$response['limit'] = $limit = $limit ? $limit : 0;
+			$response['offset'] = $offset = $offset ? $offset : 0;
+			$response['items'] = array();
+			$params = array(
+				'number'	=>	$limit,
+				'offset'	=>	$offset,
+				'fields'	=>	'names'
+			);
+			foreach (get_terms('ngg_tag', $params) as $term) {
+				$response['items'][] = array(
+					'id'	=>	$term,
+					'title'	=>	$term,
+                    'name'  =>  $term
+				);
+			}
+			$response['total'] = count(get_terms('ngg_tag', array('fields' => 'ids')));
+		}
+
+		return $response;
+	}
+
+	/**
+	 * Gets entities (such as images) for a displayed gallery (attached gallery)
+	 */
+	function get_displayed_gallery_entities_action()
+	{
+		$response = array();
+		if ($this->object->validate_ajax_request() && ($params = $this->object->param('displayed_gallery'))) {
+			$limit	 = $this->object->param('limit');
+			$offset  = $this->object->param('offset');
+			$factory = $this->object->get_registry()->get_utility('I_Component_Factory');
+			$displayed_gallery = $factory->create('displayed_gallery');
+			foreach ($params as $key => $value) $displayed_gallery->$key = $value;
+			$response['limit']	= $limit = $limit ? $limit : 0;
+			$response['offset'] = $offset = $offset ? $offset : 0;
+			$response['total']	= $displayed_gallery->get_entity_count('both');
+			$response['items'] = $displayed_gallery->get_entities($limit, $offset, FALSE, 'both');
+            $controller   = $this->object->get_registry()->get_utility('I_Display_Type_Controller');
+			$storage	  = $this->object->get_registry()->get_utility('I_Gallery_Storage');
+			$image_mapper = $this->object->get_registry()->get_utility('I_Image_Mapper');
+			$settings	  = C_NextGen_Settings::get_instance();
+			foreach ( $response['items'] as &$entity) {
+                $image = $entity;
+                if (in_array($displayed_gallery->source, array('album','albums'))) {
+                    // Set the alttext of the preview image to the
+					// name of the gallery or album
+					if (($image = $image_mapper->find($entity->previewpic))) {
+						if ($entity->is_album)
+							$image->alttext = _('Album: ').$entity->name;
+						else
+							$image->alttext = _('Gallery: ').$entity->title;
+					}
+
+					// Prefix the id of an album with 'a'
+                    if ($entity->is_album) {
+                        $id = $entity->{$entity->id_field};
+                        $entity->{$entity->id_field} = 'a'.$id;
+                    }
+                }
+
+				// Get the thumbnail
+				$entity->thumb_url = $storage->get_image_url($image, 'thumb');
+				$entity->thumb_html	= $storage->get_image_html($image, 'thumb');
+				$entity->max_width  = $settings->thumbwidth;
+				$entity->max_height = $settings->thumbheight;
+			}
+		}
+		else {
+			$response['error'] = _('Missing parameters');
+		}
+		return $response;
+	}
+
+
+	/**
+	 * Saves the displayed gallery
+	 */
+	function save_displayed_gallery_action()
+	{
+		$response = array();
+		$mapper = $this->object->get_registry()->get_utility('I_Displayed_Gallery_Mapper');
+
+		// Do we have fields to work with?
+		if ($this->object->validate_ajax_request(true) && ($params = $this->object->param('displayed_gallery'))) {
+
+			// Existing displayed gallery ?
+			if (($id = $this->object->param('id'))) {
+				$displayed_gallery = $mapper->find($id, TRUE);
+				if ($displayed_gallery) {
+					foreach ($params as $key => $value) $displayed_gallery->$key = $value;
+				}
+			}
+			else {
+				$factory = $this->object->get_registry()->get_utility('I_Component_Factory');
+				$displayed_gallery = $factory->create('displayed_gallery', $mapper, $params);
+			}
+
+			// Save the changes
+			if ($displayed_gallery) {
+				if ($displayed_gallery->save()) $response['displayed_gallery'] = $displayed_gallery->get_entity();
+				else $response['validation_errors'] = $this->get_attach_to_post()->show_errors_for($displayed_gallery, TRUE);
+			}
+			else
+			{
+				$response['error'] = _('Displayed gallery does not exist');
+			}
+		}
+		else $response['error'] = _('Invalid request');
+
+		return $response;
+	}
+
+	function validate_ajax_request($check_token = false)
+	{
+		$valid_request = false;
+		$security = $this->get_registry()->get_utility('I_Security_Manager');
+		$sec_token = $security->get_request_token('nextgen_edit_displayed_gallery');
+		$sec_actor = $security->get_current_actor();
+
+		if ($sec_actor->is_allowed('nextgen_edit_displayed_gallery') && (!$check_token || $sec_token->check_current_request()))
+		{
+			$valid_request = true;
+		}
+
+		return $valid_request;
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/adapter.attach_to_post_routes.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/adapter.attach_to_post_routes.php
new file mode 100644
index 0000000000000000000000000000000000000000..d3d9a99be45ddab427385bc6a46bf70c08a624a4
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/adapter.attach_to_post_routes.php
@@ -0,0 +1,24 @@
+<?php
+
+class A_Attach_To_Post_Routes extends Mixin
+{
+	function initialize()
+	{
+		$this->object->add_pre_hook(
+			'serve_request',
+			'Adds Attach To Post Routes',
+			get_class(),
+			'add_attach_to_post_routes'
+		);
+	}
+
+	function add_attach_to_post_routes()
+	{
+		$app = $this->object->create_app('/nextgen-attach_to_post');
+		$app->rewrite('/preview/{id}',			'/preview/id--{id}');
+		$app->rewrite('/display_tab_js/{id}',	'/display_tab_js/id--{id}');
+		$app->route('/preview',			'I_Attach_To_Post_Controller#preview');
+		$app->route('/display_tab_js',	'I_Attach_To_Post_Controller#display_tab_js');
+		$app->route('/',				'I_Attach_To_Post_Controller#index');
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/adapter.gallery_storage_frame_event.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/adapter.gallery_storage_frame_event.php
new file mode 100644
index 0000000000000000000000000000000000000000..400850ae9176de904e31fd99d0a2d9463d2e70dc
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/adapter.gallery_storage_frame_event.php
@@ -0,0 +1,39 @@
+<?php
+
+class A_Gallery_Storage_Frame_Event extends Mixin
+{
+	function initialize()
+	{
+		$this->object->add_post_hook(
+			'generate_thumbnail',
+			'After a new thumbnail has been generated, emits a frame event',
+			get_class(),
+			'emit_modified_thumbnail_event'
+		);
+	}
+
+	function emit_modified_thumbnail_event($image)
+	{
+        $controller = $this->get_registry()->get_utility('I_Display_Type_Controller');
+		$events     = $this->get_registry()->get_utility('I_Frame_Event_Publisher', 'attach_to_post');
+		$mapper	    = $this->get_registry()->get_utility('I_Image_Mapper');
+		$storage    = $this->get_registry()->get_utility('I_Gallery_Storage');
+        $app        = $this->get_registry()->get_utility('I_Router')->get_routed_app();
+
+		$image	= $mapper->find($image);
+        $image->thumb_url = $controller->set_param_for(
+            $app->get_routed_url(TRUE),
+            'timestamp',
+            time(),
+            NULL,
+            $storage->get_thumb_url($image)
+        );
+
+        $events->add_event(
+            array(
+                'event' => 'thumbnail_modified',
+                'image' => $image,
+            )
+        );
+    }
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/class.attach_controller.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/class.attach_controller.php
new file mode 100644
index 0000000000000000000000000000000000000000..321c10584c59bccb875899578d6dae5352cd2a3a
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/class.attach_controller.php
@@ -0,0 +1,295 @@
+<?php
+
+class C_Attach_Controller extends C_NextGen_Admin_Page_Controller
+{
+	static $_instances = array();
+	var	   $_displayed_gallery;
+
+	static function &get_instance($context)
+	{
+		if (!isset(self::$_instances[$context])) {
+			$klass = get_class();
+			self::$_instances[$context] = new $klass($context);
+		}
+		return self::$_instances[$context];
+	}
+
+	function define($context)
+	{
+		if (!is_array($context)) $context = array($context);
+		array_unshift($context, 'ngg_attach_to_post');
+		parent::define($context);
+		$this->add_mixin('Mixin_Attach_To_Post');
+		$this->add_mixin('Mixin_Attach_To_Post_Display_Tab');
+		$this->implement('I_Attach_To_Post_Controller');
+	}
+
+	function initialize()
+	{
+		parent::initialize();
+		$this->_load_displayed_gallery();
+	}
+}
+
+class Mixin_Attach_To_Post extends Mixin
+{
+	function _load_displayed_gallery()
+	{
+		$mapper = $this->get_registry()->get_utility('I_Displayed_Gallery_Mapper');
+		if (!($this->object->_displayed_gallery = $mapper->find($this->object->param('id'), TRUE))) {
+			$this->object->_displayed_gallery = $mapper->create();
+		}
+	}
+
+	function enqueue_backend_resources()
+	{
+		$this->call_parent('enqueue_backend_resources');
+
+        // Enqueue frame event publishing
+		wp_enqueue_script('frame_event_publisher');
+
+		// Enqueue JQuery UI libraries
+		wp_enqueue_script('jquery-ui-tabs');
+		wp_enqueue_script('jquery-ui-sortable');
+        wp_enqueue_script('jquery-ui-tooltip');
+		wp_enqueue_script('ngg_tabs', $this->get_static_url('photocrati-attach_to_post#ngg_tabs.js'));
+
+		// Ensure select2
+		wp_enqueue_style('select2');
+		wp_enqueue_script('select2');
+
+		// Ensure that the Photocrati AJAX library is loaded
+		wp_enqueue_script('photocrati_ajax');
+
+		// Enqueue logic for the Attach to Post interface as a whole
+		wp_enqueue_script(
+			'ngg_attach_to_post', $this->get_static_url('photocrati-attach_to_post#attach_to_post.js')
+		);
+		wp_enqueue_style(
+			'ngg_attach_to_post', $this->get_static_url('photocrati-attach_to_post#attach_to_post.css')
+		);
+
+		// Enqueue backbone.js library, required by the Attach to Post display tab
+		wp_enqueue_script('backbone'); // provided by WP
+
+		// Ensure underscore sting, a helper utility
+		wp_enqueue_script(
+			'underscore.string',
+			$this->get_static_url('photocrati-attach_to_post#underscore.string.js'),
+			array('underscore'),
+			'2.3.0'
+		);
+
+		// Enqueue the backbone app for the display tab
+		$settings			= C_NextGen_Settings::get_instance();
+		$preview_url		= $settings->gallery_preview_url;
+		$display_tab_js_url	= $settings->attach_to_post_display_tab_js_url;
+		if ($this->object->_displayed_gallery->id()) {
+			$display_tab_js_url .= '/id--'.$this->object->_displayed_gallery->id();
+		}
+
+		wp_enqueue_script(
+			'ngg_display_tab',
+			$display_tab_js_url,
+			array('backbone', 'underscore.string')
+		);
+		wp_localize_script(
+			'ngg_display_tab',
+			'ngg_displayed_gallery_preview_url',
+			$settings->gallery_preview_url
+		);
+	}
+
+	/**
+	 * Renders the interface
+	 */
+	function index_action($return=FALSE)
+	{
+        if ($this->object->_displayed_gallery->is_new()) $this->object->expires("+2 hour");
+
+		// Enqueue resources
+		return $this->object->render_view('photocrati-attach_to_post#attach_to_post', array(
+			'page_title'	=>	$this->object->_get_page_title(),
+			'tabs'			=>	$this->object->_get_main_tabs()
+		), $return);
+	}
+
+
+	/**
+	 * Displays a preview image for the displayed gallery
+	 */
+	function preview_action()
+	{
+		$found_preview_pic = FALSE;
+
+		$dyn_thumbs		= $this->object->get_registry()->get_utility('I_Dynamic_Thumbnails_Manager');
+		$storage		= $this->object->get_registry()->get_utility('I_Gallery_Storage');
+		$image_mapper	= $this->object->get_registry()->get_utility('I_Image_Mapper');
+
+		// Get the first entity from the displayed gallery. We will use this
+		// for a preview pic
+		$entity = array_pop($this->object->_displayed_gallery->get_included_entities(1));
+		$image = FALSE;
+		if ($entity) {
+			// This is an album or gallery
+			if (isset($entity->previewpic)) {
+				$image = (int)$entity->previewpic;
+				if (($image = $image_mapper->find($image))) {
+						$found_preview_pic = TRUE;
+				}
+			}
+
+			// Is this an image
+			else if (isset($entity->galleryid)) {
+				$image = $entity;
+				$found_preview_pic = TRUE;
+			}
+		}
+
+		// Were we able to find a preview pic? If so, then render it
+        $image_size = $dyn_thumbs->get_size_name(array(
+            'width'     =>  200,
+            'height'    =>  200,
+            'quality'   =>  90,
+            'type'		=>	'jpg'
+        ));;
+		$found_preview_pic = $storage->render_image($image, $image_size, TRUE);
+
+		// Render invalid image if no preview pic is found
+		if (!$found_preview_pic) {
+            $filename = $this->object->get_static_abspath('photocrati-attach_to_post#invalid_image.png');
+			$this->set_content_type('image/png');
+			readfile($filename);
+			$this->render();
+		}
+	}
+
+	/**
+	 * Returns the page title of the Attach to Post interface
+	 * @return string
+	 */
+	function _get_page_title()
+	{
+		return _('NextGEN Gallery - Attach To Post');
+	}
+
+
+	/**
+	 * Returns the main tabs displayed on the Attach to Post interface
+	 * @returns array
+	 */
+	function _get_main_tabs()
+	{
+        $retval = array();
+
+        $security   = $this->get_registry()->get_utility('I_Security_Manager');
+        $sec_actor  = $security->get_current_actor();
+
+        if ($sec_actor->is_allowed('NextGEN Manage gallery')) {
+            $retval['displayed_tab']    = array(
+                'content'   => $this->object->_render_display_tab(),
+                'title'     => _('Display Galleries')
+            );
+        }
+
+        if ($sec_actor->is_allowed('NextGEN Upload images')) {
+            $retval['create_tab']       = array(
+                'content'   =>  $this->object->_render_create_tab(),
+                'title'     =>  _('Add Gallery / Images')
+            );
+        }
+
+        if ($sec_actor->is_allowed('NextGEN Manage others gallery') && $sec_actor->is_allowed('NextGEN Manage gallery')) {
+            $retval['galleries_tab']    = array(
+                'content'   =>  $this->object->_render_galleries_tab(),
+                'title'     =>  _('Manage Galleries')
+            );
+        }
+
+        if ($sec_actor->is_allowed('NextGEN Edit album')) {
+            $retval['albums_tab']       = array(
+                'content'   =>  $this->object->_render_albums_tab(),
+                'title'     =>  _('Manage Albums')
+            );
+        }
+
+        if ($sec_actor->is_allowed('NextGEN Manage tags')) {
+            $retval['tags_tab']         = array(
+                'content'   =>  $this->object->_render_tags_tab(),
+                'title'     =>  _('Manage Tags')
+            );
+        }
+
+		return $retval;
+	}
+
+	/**
+	 * Renders a NextGen Gallery page in an iframe, suited for the attach to post
+	 * interface
+	 * @param string $page
+	 * @return string
+	 */
+	function _render_ngg_page_in_frame($page, $tab_id = null)
+	{
+		$frame_url = admin_url("/admin.php?page={$page}&attach_to_post");
+		$frame_url = esc_url($frame_url);
+
+		if ($tab_id) {
+			$tab_id = " id='ngg-iframe-{$tab_id}'";
+		}
+
+		return "<iframe name='{$page}' frameBorder='0'{$tab_id} class='ngg-attach-to-post ngg-iframe-page-{$page}' scrolling='no' src='{$frame_url}'></iframe>";
+	}
+
+	/**
+	 * Renders the display tab for adjusting how images/galleries will be
+	 * displayed
+	 * @return type
+	 */
+	function _render_display_tab()
+	{
+		return $this->object->render_partial('photocrati-attach_to_post#display_tab', array(
+			'messages'	=>	array(),
+			'tabs'		=>	$this->object->_get_display_tabs()
+		), TRUE);
+	}
+
+
+	/**
+	 * Renders the tab used primarily for Gallery and Image creation
+	 * @return type
+	 */
+	function _render_create_tab()
+	{
+		return $this->object->_render_ngg_page_in_frame('ngg_addgallery', 'create_tab');
+	}
+
+
+	/**
+	 * Renders the tab used for Managing Galleries
+	 * @return string
+	 */
+	function _render_galleries_tab()
+	{
+		return $this->object->_render_ngg_page_in_frame('nggallery-manage-gallery', 'galleries_tab');
+	}
+
+
+	/**
+	 * Renders the tab used for Managing Albums
+	 */
+	function _render_albums_tab()
+	{
+		return $this->object->_render_ngg_page_in_frame('nggallery-manage-album', 'albums_tab');
+	}
+
+
+	/**
+	 * Renders the tab used for Managing Albums
+	 * @return string
+	 */
+	function _render_tags_tab()
+	{
+		return $this->object->_render_ngg_page_in_frame('nggallery-tags', 'tags_tab');
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/class.attach_to_post_installer.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/class.attach_to_post_installer.php
new file mode 100644
index 0000000000000000000000000000000000000000..f805e92d0ec2c83aa286fcdeb82a70272719cc9b
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/class.attach_to_post_installer.php
@@ -0,0 +1,13 @@
+<?php
+
+class C_Attach_To_Post_Installer
+{
+	function install()
+	{
+		// Delete cached values. Needed for 2.0.7 and less
+		$settings = C_NextGen_Settings::get_instance();
+		$settings->delete('attach_to_post_url');
+		$settings->delete('gallery_preview_url');
+		$settings->delete('attach_to_post_display_tab_js_url');
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/class.attach_to_post_option_handler.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/class.attach_to_post_option_handler.php
new file mode 100644
index 0000000000000000000000000000000000000000..ac006fb08e84e55b9e6dc06a399dc3c32aa0fe0b
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/class.attach_to_post_option_handler.php
@@ -0,0 +1,28 @@
+<?php
+
+class C_Attach_To_Post_Option_Handler
+{
+	function get_router()
+	{
+		return C_Component_Registry::get_instance()->get_utility('I_Router');
+	}
+
+	function get($key, $default=NULL)
+	{
+		$retval = $default;
+
+		switch ($key) {
+			case 'attach_to_post_url':
+				$retval = $this->get_router()->get_url('/nextgen-attach_to_post', FALSE);
+				break;
+			case 'gallery_preview_url':
+				$retval = $this->get_router()->get_url('/nextgen-attach_to_post/preview', FALSE);
+				break;
+			case 'attach_to_post_display_tab_js_url':
+				$retval = $this->get_router()->get_url('/nextgen-attach_to_post/display_tab_js', FALSE);
+				break;
+		}
+
+		return $retval;
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/class.attach_to_post_proxy_controller.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/class.attach_to_post_proxy_controller.php
new file mode 100644
index 0000000000000000000000000000000000000000..749f1ec4560ced677e2f1bd0b10d1cbbbba69f59
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/class.attach_to_post_proxy_controller.php
@@ -0,0 +1,62 @@
+<?php
+
+/**
+ * Work in progress. This won't quite work as expected
+ * as we can't cache the Attach to post interface since
+ * it needs to be invalided when the displayed gallery changes
+ * Class C_Attach_To_Post_Proxy_Controller
+ */
+class C_Attach_To_Post_Proxy_Controller
+{
+	static $_instance = NULL;
+
+	static function get_instance()
+	{
+		if (is_null(self::$_instance)) {
+			$klass = get_class();
+			self::$_instance = new $klass();
+		}
+		return self::$_instance;
+	}
+
+	function index_action()
+	{
+		$url = C_Router::get_instance()->get_routed_app()->get_routed_url(TRUE);
+		$key = C_Photocrati_Cache::generate_key($url);
+
+		// Try fetching the contents from the cache
+		if (($html = C_Photocrati_Cache::get($key, FALSE))) {
+			echo $html;
+		}
+		else {
+			$controller = C_Attach_Controller::get_instance(FALSE);
+			$html = $controller->index_action(TRUE);
+			C_Photocrati_Cache::set($key, $html);
+			echo $html;
+		}
+
+	}
+
+	function display_tab_js_action()
+	{
+		$url = C_Router::get_instance()->get_routed_app()->get_routed_url(TRUE);
+		$key = C_Photocrati_Cache::generate_key($url);
+
+		// Try fetching the contents from the cache
+		if (($html = C_Photocrati_Cache::get($key, FALSE))) {
+			echo $html;
+		}
+		else {
+			$html = C_Attach_Controller::get_instance(FALSE)->display_tab_js_action(TRUE);
+			C_Photocrati_Cache::set($key, $html);
+			echo $html;
+		}
+	}
+
+	function preview_action()
+	{
+		return C_Attach_Controller::get_instance(FALSE)->preview_action();
+	}
+
+	private function __construct() {}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/interface.attach_to_post_controller.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/interface.attach_to_post_controller.php
new file mode 100644
index 0000000000000000000000000000000000000000..07c575752841da89d36b18584ffda59035d431d9
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/interface.attach_to_post_controller.php
@@ -0,0 +1,6 @@
+<?php
+
+interface I_Attach_To_Post_Controller
+{
+	function index_action();
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/mixin.attach_to_post_display_tab.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/mixin.attach_to_post_display_tab.php
new file mode 100644
index 0000000000000000000000000000000000000000..a49f335e52cb28345dab64b4da52fa77431878f3
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/mixin.attach_to_post_display_tab.php
@@ -0,0 +1,283 @@
+<?php
+
+/**
+ * Provides the "Display Tab" for the Attach To Post interface/controller
+ */
+class Mixin_Attach_To_Post_Display_Tab extends Mixin
+{
+	/**
+	 * Renders the JS required for the Backbone-based Display Tab
+	 */
+	function display_tab_js_action($return=FALSE)
+	{
+        // Cache appropriately
+        $this->object->do_not_cache();
+
+        // Ensure that JS is returned
+        $this->object->set_content_type('javascript');
+				    
+				while (ob_get_level() > 0) {
+					ob_end_clean();
+				}
+
+        // Get all entities used by the display tab
+        $context = 'attach_to_post';
+        $gallery_mapper		= $this->get_registry()->get_utility('I_Gallery_Mapper',		$context);
+        $album_mapper		= $this->get_registry()->get_utility('I_Album_Mapper',			$context);
+        $display_type_mapper= $this->get_registry()->get_utility('I_Display_Type_Mapper',	$context);
+        $source_mapper		= $this->get_registry()->get_utility('I_Displayed_Gallery_Source_Mapper', $context);
+        $security			= $this->get_registry()->get_utility('I_Security_Manager');
+
+        // Get the nextgen tags
+        global $wpdb;
+        $tags = $wpdb->get_results(
+                        "SELECT DISTINCT name AS 'id', name FROM {$wpdb->terms}
+                        WHERE term_id IN (
+                                SELECT term_id FROM {$wpdb->term_taxonomy}
+                                WHERE taxonomy = 'ngg_tag'
+                        )");
+        $all_tags = new stdClass;
+        $all_tags->name = "All";
+        $all_tags->id   = "All";
+        array_unshift($tags, $all_tags);
+        
+        $display_types = $display_type_mapper->find_all();
+        
+        usort($display_types, array($this->object, '_display_type_list_sort'));
+
+        $output = $this->object->render_view('photocrati-attach_to_post#display_tab_js', array(
+                'displayed_gallery'		=>	json_encode($this->object->_displayed_gallery->get_entity()),
+                'sources'				=>	json_encode($source_mapper->select()->order_by('title')->run_query()),
+                'gallery_primary_key'	=>	$gallery_mapper->get_primary_key_column(),
+                'galleries'				=>	json_encode($gallery_mapper->find_all()),
+                'albums'				=>	json_encode($album_mapper->find_all()),
+                'tags'					=>	json_encode($tags),
+                'display_types'			=>	json_encode($display_types),
+                'sec_token'				=>	$security->get_request_token('nextgen_edit_displayed_gallery')->get_json()
+        ), $return);
+        
+        return $output;
+	}
+	
+	function _display_type_list_sort($type_1, $type_2)
+	{
+		$order_1 = $type_1->view_order;
+		$order_2 = $type_2->view_order;
+		
+		if ($order_1 == null) {
+			$order_1 = NEXTGEN_DISPLAY_PRIORITY_BASE;
+		}
+		
+		if ($order_2 == null) {
+			$order_2 = NEXTGEN_DISPLAY_PRIORITY_BASE;
+		}
+		
+		if ($order_1 > $order_2) {
+			return 1;
+		}
+		
+		if ($order_1 < $order_2) {
+			return -1;
+		}
+		
+		return 0;
+	}
+
+
+	/**
+	 * Gets a list of tabs to render for the "Display" tab
+	 */
+	function _get_display_tabs()
+	{
+		// The ATP requires more memmory than some applications, somewhere around 60MB.
+		// Because it's such an important feature of NextGEN Gallery, we temporarily disable
+		// any memory limits
+		@ini_set('memory_limit', -1);
+
+		return array(
+			$this->object->_render_display_types_tab(),
+			$this->object->_render_display_source_tab(),
+			$this->object->_render_display_settings_tab(),
+			$this->object->_render_preview_tab()
+		);
+	}
+
+
+	/**
+	 * Renders the accordion tab, "What would you like to display?"
+	 */
+	function _render_display_source_tab()
+	{
+		return $this->object->render_partial('photocrati-attach_to_post#accordion_tab', array(
+			'id'			=> 'source_tab',
+			'title'		=>	_('What would you like to display?'),
+			'content'	=>	$this->object->_render_display_source_tab_contents()
+		), TRUE);
+	}
+
+
+	/**
+	 * Renders the contents of the source tab
+	 * @return string
+	 */
+	function _render_display_source_tab_contents()
+	{
+		return $this->object->render_partial('photocrati-attach_to_post#display_tab_source', array(),TRUE);
+	}
+
+
+	/**
+	 * Renders the accordion tab for selecting a display type
+	 * @return string
+	 */
+	function _render_display_types_tab()
+	{
+		return $this->object->render_partial('photocrati-attach_to_post#accordion_tab', array(
+			'id'			=> 'display_type_tab',
+			'title'		=>	_('Select a display type'),
+			'content'	=>	$this->object->_render_display_type_tab_contents()
+		), TRUE);
+	}
+
+
+	/**
+	 * Renders the contents of the display type tab
+	 */
+	function _render_display_type_tab_contents()
+	{
+		return $this->object->render_partial('photocrati-attach_to_post#display_tab_type', array(), TRUE);
+	}
+
+
+	/**
+	 * Renders the display settings tab for the Attach to Post interface
+	 * @return type
+	 */
+	function _render_display_settings_tab()
+	{
+		return $this->object->render_partial('photocrati-attach_to_post#accordion_tab', array(
+			'id'			=> 'display_settings_tab',
+			'title'		=>	_('Customize the display settings'),
+			'content'	=>	$this->object->_render_display_settings_contents()
+		), TRUE);
+	}
+
+	/**
+	 * If editing an existing displayed gallery, retrieves the name
+	 * of the display type
+	 * @return string
+	 */
+	function _get_selected_display_type_name()
+	{
+		$retval = '';
+
+		if ($this->object->_displayed_gallery)
+			$retval = $this->object->_displayed_gallery->display_type;
+
+		return $retval;
+	}
+
+
+	/**
+	 * Is the displayed gallery that's being edited using the specified display
+	 * type?
+	 * @param string $name	name of the display type
+	 * @return bool
+	 */
+	function is_displayed_gallery_using_display_type($name)
+	{
+		$retval = FALSE;
+
+		if ($this->object->_displayed_gallery) {
+			$retval = $this->object->_displayed_gallery->display_type == $name;
+		}
+
+		return $retval;
+	}
+
+
+	/**
+	 * Renders the contents of the display settings tab
+	 * @return string
+	 */
+	function _render_display_settings_contents()
+	{
+		$retval = array();
+
+		// Get all display setting forms
+        $form_manager = C_Form_Manager::get_instance();
+		$forms		  = $form_manager->get_forms(
+			NEXTGEN_DISPLAY_SETTINGS_SLUG, TRUE
+		);
+
+		// Display each form
+		foreach ($forms as $form) {
+
+			// Enqueue the form's static resources
+			$form->enqueue_static_resources();
+
+			// Determine which classes to use for the form's "class" attribute
+			$model = $form->get_model();
+			$current = $this->object->is_displayed_gallery_using_display_type($model->name);
+			$css_class =  $current ? 'display_settings_form' : 'display_settings_form hidden';
+
+			// If this form is used to provide the display settings for the current
+			// displayed gallery, then we need to override the forms settings
+			// with the displayed gallery settings
+			if ($current) {
+				$settings = $this->array_merge_assoc(
+					$model->settings,
+					$this->object->_displayed_gallery->display_settings,
+					TRUE
+				);
+				
+				$model->settings = $settings;
+			}
+			
+			// Output the display settings form
+			$retval[] = $this->object->render_partial('photocrati-attach_to_post#display_settings_form', array(
+				'settings'				=>	$form->render(),
+				'display_type_name'		=>	$model->name,
+				'css_class'				=>	$css_class
+			), TRUE);
+		}
+
+		// In addition, we'll render a form that will be displayed when no
+		// display type has been selected in the Attach to Post interface
+		// Render the default "no display type selected" view
+		$css_class = $this->object->_get_selected_display_type_name() ?
+			'display_settings_form hidden' : 'display_settings_form';
+		$retval[] = $this->object->render_partial('photocrati-attach_to_post#no_display_type_selected', array(
+			'no_display_type_selected'	=>	_('No display type selected'),
+			'css_class'					=>	$css_class
+
+		), TRUE);
+
+		// Return all display setting forms
+		return implode("\n", $retval);
+	}
+
+
+	/**
+	 * Renders the tab used to preview included images
+	 * @return string
+	 */
+	function _render_preview_tab()
+	{
+		return $this->object->render_partial('photocrati-attach_to_post#accordion_tab', array(
+			'id'			=> 'preview_tab',
+			'title'		=>	_('Sort or Exclude Images'),
+			'content'	=>	$this->object->_render_preview_tab_contents()
+		), TRUE);
+	}
+
+
+	/**
+	 * Renders the contents of the "Preview" tab.
+	 * @return string
+	 */
+	function _render_preview_tab_contents()
+	{
+		return $this->object->render_partial('photocrati-attach_to_post#preview_tab', array(), TRUE);
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/module.attach_to_post.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/module.attach_to_post.php
new file mode 100644
index 0000000000000000000000000000000000000000..d24f0f3c6776fe79355d3976faf47282ab3a25f9
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/module.attach_to_post.php
@@ -0,0 +1,365 @@
+<?php
+/**
+ {
+	Module:		photocrati-attach_to_post,
+	Depends:	{ photocrati-nextgen_gallery_display }
+ }
+ */
+
+define('NEXTGEN_GALLERY_ATTACH_TO_POST_SLUG', 'ngg_attach_to_post');
+
+class M_Attach_To_Post extends C_Base_Module
+{
+	var $attach_to_post_tinymce_plugin  = 'NextGEN_AttachToPost';
+    var $_event_publisher               = NULL;
+
+	/**
+	 * Defines the module
+	 * @param string|bool $context
+	 */
+    function define($context=FALSE)
+    {
+        parent::define(
+			'photocrati-attach_to_post',
+			'Attach To Post',
+			'Provides the "Attach to Post" interface for displaying galleries and albums',
+			'0.7',
+			'http://www.nextgen-gallery.com',
+			'Photocrati Media',
+			'http://www.photocrati.com',
+		    $context
+		);
+
+		include_once('class.attach_to_post_option_handler.php');
+		C_NextGen_Settings::add_option_handler('C_Attach_To_Post_Option_Handler', array(
+			'attach_to_post_url',
+			'gallery_preview_url',
+			'attach_to_post_display_tab_js_url'
+		));
+
+		include_once('class.attach_to_post_installer.php');
+		C_Photocrati_Installer::add_handler($this->module_id, 'C_Attach_To_Post_Installer');
+		
+		$uri = strtolower($_SERVER['REQUEST_URI']);
+		
+		if (strpos($uri, '/nextgen-attach_to_post') !== false) {
+			define('WP_ADMIN', true);
+		}
+    }
+
+    /**
+     * Gets the Frame Event Publisher
+     * @return C_Component
+     */
+    function _get_frame_event_publisher()
+    {
+        if (is_null($this->_event_publisher)) {
+            $this->_event_publisher = $this->get_registry()->get_utility('I_Frame_Event_Publisher', 'attach_to_post');
+        }
+
+        return $this->_event_publisher;
+    }
+
+
+	/**
+	 * Registers requires the utilites that this module provides
+	 */
+	function _register_utilities()
+	{
+		// This utility provides a controller that renders the
+		// Attach to Post interface, used to manage Displayed Galleries
+		$this->get_registry()->add_utility(
+			'I_Attach_To_Post_Controller',
+			'C_Attach_Controller'
+//			'C_Attach_To_Post_Proxy_Controller'
+		);
+	}
+
+	/**
+	 * Registers the adapters that this module provides
+	 */
+	function _register_adapters()
+	{
+		// Installs the Attach to Post module
+		$this->get_registry()->add_adapter(
+			'I_Installer', 'A_Attach_To_Post_Installer'
+		);
+
+		// Provides routing for the Attach To Post interface
+		$this->get_registry()->add_adapter(
+			'I_Router', 'A_Attach_To_Post_Routes'
+		);
+
+		// Provides AJAX actions for the Attach To Post interface
+		$this->get_registry()->add_adapter(
+			'I_Ajax_Controller',   'A_Attach_To_Post_Ajax'
+		);
+
+		// Applies a post hook to the generate_thumbnail method of the
+		// gallery storage component
+		$this->get_registry()->add_adapter(
+			'I_Gallery_Storage', 'A_Gallery_Storage_Frame_Event'
+		);
+	}
+
+
+	function _register_hooks()
+	{
+		if (is_admin()) {
+			add_action(
+				'admin_enqueue_scripts',
+				array(&$this, 'enqueue_static_resources'),
+				1
+			);
+		}
+
+		// Add hook to delete displayed galleries when removed from a post
+		add_action('pre_post_update', array(&$this, 'locate_stale_displayed_galleries'));
+		add_action('before_delete_post', array(&$this, 'locate_stale_displayed_galleries'));
+		add_action('post_updated',	array(&$this, 'cleanup_displayed_galleries'));
+		add_action('after_delete_post', array(&$this, 'cleanup_displayed_galleries'));
+
+		// Add hook to subsitute displayed gallery placeholders
+		add_filter('the_content', array(&$this, 'substitute_placeholder_imgs'), PHP_INT_MAX, 1);
+
+		// Emit frame communication events
+		add_action('ngg_created_new_gallery',	array(&$this, 'new_gallery_event'));
+		add_action('ngg_after_new_images_added',array(&$this, 'images_added_event'));
+		add_action('ngg_page_event',			array(&$this, 'nextgen_page_event'));
+        add_action('ngg_manage_tags',           array(&$this, 'manage_tags_event'));
+	}
+
+	/**
+     * Substitutes the gallery placeholder content with the gallery type frontend
+     * view, returns a list of static resources that need to be loaded
+     * @param string $content
+     */
+    function substitute_placeholder_imgs($content)
+    {
+		// Get some utilities
+		$mapper = $this->get_registry()->get_utility('I_Displayed_Gallery_Mapper');
+		$router	= $this->get_registry()->get_utility('I_Router');
+
+		// To match ATP entries we compare the stored url against a generic path
+		// We must check HTTP and HTTPS as well as permalink and non-permalink forms
+		$preview_url = parse_url($router->join_paths(
+			$router->remove_url_segment('index.php', $router->get_base_url()),
+			'/nextgen-attach_to_post/preview'
+		));
+		$preview_url = preg_quote($preview_url['host'] . $preview_url['path'], '#');
+
+		$alt_preview_url = parse_url($router->join_paths(
+			$router->remove_url_segment('index.php', $router->get_base_url()),
+			'index.php/nextgen-attach_to_post/preview'
+		));
+		$alt_preview_url = preg_quote($alt_preview_url['host'] . $alt_preview_url['path'], '#');
+
+		// The placeholder MUST have a gallery instance id
+		if (preg_match_all("#<img.*http(s)?://({$preview_url}|{$alt_preview_url})/id--(\\d+).*\\/>#mi", $content, $matches, PREG_SET_ORDER)) {
+			foreach ($matches as $match) {
+				// Find the displayed gallery
+				$displayed_gallery_id = $match[3];
+				$displayed_gallery = $mapper->find($displayed_gallery_id, TRUE);
+
+				// Get the content for the displayed gallery
+				$retval = '<p>'._('Invalid Displayed Gallery').'</p>';
+				if ($displayed_gallery) {
+					$renderer = $this->get_registry()->get_utility('I_Displayed_Gallery_Renderer');
+					$retval = $renderer->render($displayed_gallery, TRUE);
+				}
+				$content = str_replace($match[0], $retval, $content);
+			}
+		}
+
+		return $content;
+    }
+
+	/**
+	 * Enqueues static resources required by the Attach to Post interface
+	 */
+	function enqueue_static_resources()
+	{
+		$router = $this->get_registry()->get_utility('I_Router');
+
+		// Enqueue resources needed at post/page level
+		if (preg_match("/\/wp-admin\/(post|post-new)\.php$/", $_SERVER['SCRIPT_NAME'])) {
+			$this->_enqueue_tinymce_resources();
+			wp_enqueue_style(
+				'ngg_attach_to_post_dialog', $router->get_static_url('photocrati-attach_to_post#attach_to_post_dialog.css')
+			);
+		}
+
+		elseif (isset($_REQUEST['attach_to_post']) OR
+		  (isset($_REQUEST['page']) && strpos($_REQUEST['page'], 'nggallery') !== FALSE)) {
+			wp_enqueue_script('iframely', $router->get_static_url('photocrati-attach_to_post#iframely.js'));
+			wp_enqueue_style('iframely',  $router->get_static_url('photocrati-attach_to_post#iframely.css'));
+		}
+	}
+
+
+	/**
+	 * Enqueues resources needed by the TinyMCE editor
+	 */
+	function _enqueue_tinymce_resources()
+	{
+        wp_localize_script(
+			'media-editor',
+			'nextgen_gallery_attach_to_post_url',
+			C_NextGen_Settings::get_instance()->attach_to_post_url
+		);
+
+		// Registers our tinymce button and plugin for attaching galleries
+        $security   = $this->get_registry()->get_utility('I_Security_Manager');
+        $sec_actor  = $security->get_current_actor();
+        $checks = array(
+            $sec_actor->is_allowed('NextGEN Attach Interface'),
+            $sec_actor->is_allowed('NextGEN Use TinyMCE')
+        );
+        if (!in_array(FALSE, $checks)) {
+            if (get_user_option('rich_editing') == 'true') {
+                add_filter('mce_buttons', array(&$this, 'add_attach_to_post_button'));
+                add_filter('mce_external_plugins', array(&$this, 'add_attach_to_post_tinymce_plugin'));
+            }
+        }
+	}
+
+
+	/**
+	 * Adds a TinyMCE button for the Attach To Post plugin
+	 * @param array $buttons
+	 * @returns array
+	 */
+	function add_attach_to_post_button($buttons)
+	{
+		array_push(
+            $buttons,
+            'separator',
+            $this->attach_to_post_tinymce_plugin
+        );
+        return $buttons;
+	}
+
+
+	/**
+	 * Adds the Attach To Post TinyMCE plugin
+	 * @param array $plugins
+	 * @return array
+	 * @uses mce_external_plugins filter
+	 */
+	function add_attach_to_post_tinymce_plugin($plugins)
+	{
+		$router = $this->get_registry()->get_utility('I_Router');
+		$plugins[$this->attach_to_post_tinymce_plugin] = $router->get_static_url('photocrati-attach_to_post#ngg_attach_to_post_tinymce_plugin.js');
+		return $plugins;
+	}
+
+
+	/**
+	 * Locates the ids of displayed galleries that have been
+	 * removed from the post, and flags then for cleanup (deletion)
+	 * @global array $displayed_galleries_to_cleanup
+	 * @param int $post_id
+	 */
+	function locate_stale_displayed_galleries($post_id)
+	{
+		global $displayed_galleries_to_cleanup;
+		$displayed_galleries_to_cleanup	= array();
+		$post							= get_post($post_id);
+		$gallery_preview_url			= C_NextGen_Settings::get_instance()->get('gallery_preview_url');
+		$preview_url = preg_quote($gallery_preview_url, '#');
+		if (preg_match_all("#{$preview_url}/id--(\d+)#", html_entity_decode($post->post_content), $matches, PREG_SET_ORDER)) {
+			foreach ($matches as $match) {
+				$preview_url = preg_quote($match[0], '/');
+				// The post was edited, and the displayed gallery placeholder was removed
+				if (isset($_REQUEST['post_content']) && (!preg_match("/{$preview_url}/", $_POST['post_content']))) {
+					$displayed_galleries_to_cleanup[] = intval($match[1]);
+				}
+				// The post was deleted
+				elseif (!isset($_REQUEST['action'])) {
+					$displayed_galleries_to_cleanup[] = intval($match[1]);
+				}
+			}
+		}
+	}
+
+	/**
+	 * Deletes any displayed galleries that are no longer associated with
+	 * a post/page
+	 * @global array $displayed_galleries_to_cleanup
+	 * @param int $post_id
+	 */
+	function cleanup_displayed_galleries($post_id)
+	{
+		global $displayed_galleries_to_cleanup;
+		$mapper = $this->get_registry()->get_utility('I_Displayed_Gallery_Mapper');
+		foreach ($displayed_galleries_to_cleanup as $id) $mapper->destroy($id);
+	}
+
+
+	/**
+	 * Notify frames that a new gallery has been created
+	 * @param int $gallery_id
+	 */
+	function new_gallery_event($gallery_id)
+	{
+        $gallery = $this->get_registry()->get_utility('I_Gallery_Mapper')->find($gallery_id);
+
+        $this->_get_frame_event_publisher()->add_event(array(
+			'event'		=>	'new_gallery',
+			'gallery_id'=>	intval($gallery_id),
+            'gallery_title'   =>  $gallery->title
+		));
+	}
+
+	/**
+	 * Notifies a frame that images have been added to a gallery
+	 * @param int $gallery_id
+	 * @param array $image_ids
+	 */
+	function images_added_event($gallery_id, $image_ids=array())
+	{
+        $this->_get_frame_event_publisher()->add_event(array(
+			'event'			=>	'images_added',
+			'gallery_id'		=>	intval($gallery_id)
+		));
+	}
+
+    /**
+     * Notifies a frame that the tags have changed
+     *
+     * @param array $tags
+     */
+    function manage_tags_event($tags = array())
+    {
+        $this->_get_frame_event_publisher()->add_event(array(
+            'event' => 'manage_tags',
+            'tags' => $tags
+        ));
+    }
+
+	/**
+	 * Notifies a frame that an action has been performed on a particular
+	 * NextGEN page
+	 * @param array $event
+	 */
+	function nextgen_page_event($event)
+	{
+        $this->_get_frame_event_publisher()->add_event($event);
+	}
+
+    function get_type_list()
+    {
+        return array(
+            'A_Attach_To_Post_Ajax' => 'adapter.attach_to_post_ajax.php',
+            'C_Attach_To_Post_Installer' => 'class.attach_to_post_installer.php',
+            'A_Attach_To_Post_Routes' => 'adapter.attach_to_post_routes.php',
+            'A_Gallery_Storage_Frame_Event' => 'adapter.gallery_storage_frame_event.php',
+            'C_Attach_Controller' => 'class.attach_controller.php',
+			'C_Attach_To_Post_Proxy_Controller' => 'class.attach_to_post_proxy_controller.php',
+            'I_Attach_To_Post_Controller' => 'interface.attach_to_post_controller.php',
+            'Mixin_Attach_To_Post_Display_Tab' => 'mixin.attach_to_post_display_tab.php'
+        );
+    }
+}
+
+new M_Attach_To_Post();
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post.css
new file mode 100644
index 0000000000000000000000000000000000000000..ed61fc02b222025b43dc8a4852b432811d3eee43
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post.css
@@ -0,0 +1,279 @@
+html,body {
+	width: 100%;
+	min-height: 100%;
+	padding: 0px;
+	margin: 0px;
+	font-size: 13px;
+}
+
+body {
+	position: absolute;
+	visibility: hidden;
+	-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
+	filter: alpha(opacity=0);
+	opacity: 0.0;
+}
+
+.entity_errors {
+	color: red;
+}
+
+.entity_errors ul {
+	margin-left: 30px;
+}
+.entity_errors ul li{
+	list-style-type: disc;
+}
+
+.ui-helper-reset {
+	font-size: 13px;
+}
+
+#attach_to_post_tabs {
+	border: 0px;
+	background: none;
+	min-height: 100%;
+}
+
+.ui-tabs-panel {
+	min-height: 100%;
+}
+
+.ui-widget-header {
+	border: 0px;
+	border-bottom: 1px solid #dfdfdf;
+	background: none;
+}
+
+iframe {
+	width: 100%;
+	min-height: 100%;
+	border: none;
+	padding: 0px;
+	margin: 0px;
+	background: transparent;
+}
+
+#displayed_gallery_source {
+	width: 400px;
+}
+
+/** Would would you like to display tab? **/
+#source_configuration td {
+	vertical-align: top;
+}
+
+#source_configuration .chzn-choices input[type=text] {
+	height: auto !important;
+}
+
+#slug_configuration #slug_label {
+    width: 52px;
+}
+
+#slug_configuration #slug_column input[type=text] {
+    width: 498px;
+}
+
+/** Select a display type tab **/
+.display_type_preview {
+	float: left;
+	width: 25%;
+}
+.display_type_preview .image_container {
+	width: 100%;
+	vertical-align: middle;
+	text-align: center;
+	font-size: 12px;
+	font-weight: 600;
+}
+.display_type_preview .image_container p {
+	display: inline-block;
+}
+
+/** Display Tab **/
+#preview_tab_content .previewed_entity {
+	width: 100%;
+	border-bottom: solid 1px #E0E0D6;
+	background-color: #FAFAF0;
+}
+
+#preview_tab_content .previewed_entity .container {
+	padding-top: 15px;
+}
+
+#preview_tab_content .previewed_entity.header {
+	background-color: #F0F0E6;
+	padding-bottom: 5px;
+	padding-top: 5px;
+}
+
+#preview_tab_content .header label {
+	font-size: 12px;
+	color: rgb(100,150,100);
+	font-weight: 600;
+}
+
+#preview_tab_content .ui-sortable-helper {
+	background: none;
+}
+
+#preview_tab_content ul {
+	list-style-type: none;
+	display: block;
+	border: solid 2px #E0E0D6;
+	padding: 0px;
+	position: relative;
+}
+
+
+#preview_tab_content .inclusion_checkbox {
+	margin-right: 7px;
+	display: block;
+	float: left;
+}
+
+#preview_tab_content .image_container {
+	background-color: white;
+	background-repeat: no-repeat;
+	background-position: center center;
+	padding: 19px;
+	margin: 7px;
+	border: solid 1px black;
+	display: block;
+	vertical-align: middle;
+	text-align: center;
+	position: relative;
+}
+
+#preview_tab_content .image_container img {
+	border: 0px;
+}
+
+#preview_tab_content #entity_list  li{
+	float: left;
+}
+
+#preview_tab_content #entity_list .ui-state-default {
+	background: none;
+	border: none;
+}
+
+#preview_tab_content .placeholder{
+	background-color: #e0ddc1;
+	position: relative;
+}
+
+#preview_tab_content #entity_list .exclude_container {
+	display: block;
+	text-align: center;
+	margin: 0 auto;
+	color: black;
+	font-weight: normal;
+	position: absolute;
+	bottom: 2px;
+	left: 0px;
+	width: 100%;
+}
+
+#preview_tab_content .header_row {
+	margin-bottom: 5px;
+}
+#preview_tab_content .header_row strong {
+	width: 70px;
+	display: inline-block;
+}
+#preview_tab_content .header_row .separator {
+	display: inline-block;
+	margin: 0px 5px;
+}
+
+#preview_tab_content .header_row .selected {
+	font-weight: bold;
+}
+
+#preview_tab_content #entity_list li.clear {
+	float: none;
+	clear: both;
+}
+
+.clear {
+	clear: both;
+	float: none;
+}
+
+table {
+	font-size: 13px;
+}
+
+#display_settings_form table tr td:first-child {
+    vertical-align: top;
+    text-align: right;
+    padding-right: 7px;
+    width: 180px;
+}
+
+#display_settings_form table td {
+    text-align: left;
+}
+
+#display_settings_form table textarea {
+    height: 60px;
+}
+
+#display_settings_form textarea,
+#display_settings_form input[type=text],
+#display_settings_form input[type=number],
+#display_settings_form select {
+    width: 157px;
+}
+
+#display_settings_form .ngg_slideshow_gallery_width,
+#display_settings_form .ngg_slideshow_gallery_height,
+#display_settings_form .ngg_thumbnail_dimension_width,
+#display_settings_form .ngg_thumbnail_dimension_height {
+    width: 65px !important;
+}
+
+#display_settings_form .nextgen_settings_colorpicker {
+    width: 85px !important;
+    text-align: center;
+}
+
+/**
+ * Hacks used to ensure that Firefox can calculate the height of hidden content
+ * in iframes
+**/
+.ui-tabs {
+	visibility: visible;
+	position: relative;
+}
+.ui-tabs
+.ui-tabs-hide {
+	display: block !important;
+	visibility: hidden;
+	position: absolute;
+	top: -5000px;
+}
+.ui-tabs .main_menu_tab {
+	overflow: visible;
+}
+/**
+ * Make the active tab still clickable
+ **/
+.ui-tabs .ui-tabs-nav li.ui-tabs-active a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-tabs-loading a {
+	cursor: pointer;
+}
+
+.select2-result-label {
+	white-space: nowrap;
+}
+.select2-results {
+	font-family: 'segoe ui', Arial, sans-serif;
+	font-size: 13px;
+}
+
+/** Refresh button in the preview area **/
+.refresh_button {
+	float: right;
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post.js
new file mode 100644
index 0000000000000000000000000000000000000000..dbc0e8d6f86454279a81f638fc9b5f8268804cb0
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post.js
@@ -0,0 +1,124 @@
+// Provides a function to close the TinyMCE popup window
+function close_attach_to_post_window()
+{
+	parent.tinyMCE.activeEditor.windowManager.close(window);
+}
+
+// Adjusts the height of a frame on the page, and then executes
+// the specified callback
+function adjust_height_for_frame(frame, callback)
+{
+	// Adjust height of the frame
+	var $frame			= jQuery(frame);
+	var new_height		= $frame.contents().find('#wpbody').height();
+    var parent_height   = jQuery(parent.document).height();
+	var current_height	= $frame.height();
+
+    // If the height is less than the parent window height, then use
+    // the parent window height instead
+    if (new_height < parent_height) new_height = parent_height;
+
+    // If the height has changed, then use the new height
+	if (current_height != new_height) {
+		var frame_id = $frame.attr('id');
+		
+		$frame.height(new_height);
+		
+		if (frame_id && frame_id.indexOf('ngg-iframe-') == 0) {
+			var tab_id = frame_id.substr(11);
+			
+			if (tab_id) {
+				jQuery('#' + tab_id).height(new_height);
+			}
+		}
+	} 
+
+	if (callback != undefined)
+		return callback.call(frame, new_height);
+	else
+		return true;
+}
+
+function ngg_get_measures_for_frame(frame)
+{
+	var $frame			= jQuery(frame);
+	var frame_id = $frame.attr('id');
+	var measures = {};
+
+	if (frame_id && frame_id.indexOf('ngg-iframe-') == 0) {
+		var tab_id = frame_id.substr(11);
+		
+		if (tab_id) {
+			var jDoc = jQuery(document);
+			
+			measures.scrollTop = jDoc.scrollTop() - 40; // remove around 40 for tabs and padding
+			
+			if (window.parent) {
+				var jparDoc = jQuery(window.parent.document);
+				
+				measures.scrollHeight = jparDoc.find('.ngg_attach_to_post_window').height() - 40; // remove around 40 for tabs and padding
+			}
+			else {
+				measures.scrollHeight = jDoc.height();
+			}
+
+            if (typeof(window.console) != 'undefined') {
+                console.log(measures);
+            }
+		}
+	}
+	
+	return measures;
+}
+
+// Activates the attach to post screen elements
+jQuery(function($){
+	// Activate horizontal tabs
+	$('#attach_to_post_tabs').ngg_tabs();
+
+	// If the preview area is being displayed, emit an event for that
+	$('.accordion h3').bind('click', function(e){
+		if ($(this).attr('id') == 'preview_tab') {
+			$('#preview_area').trigger('opened');
+		}
+	});
+
+	// Activate accordion for display tab
+	$('.accordion').accordion({
+        clearStyle: true,
+        autoHeight: false,
+        heightStyle: 'content'
+    });
+
+	// If the active display tab is clicked, then we assume that the user
+	// wants to display the original tab content
+	$('.ui-tabs-nav a').click(function(e){
+
+		var element = e.target ? e.target : e.srcElement;
+
+		// If the accordion tab is used to display an iframe, ensure when
+		// clicked that the original iframe content is always displayed
+		if ($(element).parent().hasClass('ui-state-active')) {
+			var iframe = $(element.hash+' iframe');
+			if (iframe.length > 0) {
+				if (iframe[0].contentDocument.location != iframe.attr('src')) {
+					iframe[0].contentDocument.location = iframe.attr('src');
+				}
+			}
+		}
+	});
+
+	// Close the window when the escape key is pressed
+	$(this).keydown(function(e){
+		if (e.keyCode == 27) close_attach_to_post_window();
+		return;
+	});
+
+	// Fade in now that all GUI elements are intact
+	$('body').css({
+		position: 'static',
+		visibility: 'visible'
+	}).animate({
+		opacity: 1.0
+	});
+});
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post_dialog.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post_dialog.css
new file mode 100644
index 0000000000000000000000000000000000000000..8a20724e692fcb209e0347e48bce23796bb5762b
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post_dialog.css
@@ -0,0 +1,39 @@
+
+.ngg_attach_to_post_window {
+	position: relative;
+	border: none !important;
+}
+
+.ngg_attach_to_post_window .mceResize,
+.ngg_attach_to_post_window .mceTop,
+.ngg_attach_to_post_window .mceBottom,
+.ngg_attach_to_post_window .mceLeft,
+.ngg_attach_to_post_window .mceRight,
+.ngg_attach_to_post_window .mceCenter  {
+	background: transparent !important;
+	border: none !important;
+}
+
+.ngg_attach_to_post_window .mceMiddle span  {
+	padding-top: 6px !important;
+}
+
+.ngg_attach_to_post_window .mceTop {
+	display: block !important;
+	height: 0px !important;
+	font-size: 0px !important;
+}
+
+.ngg_attach_to_post_window .mceClose {
+	background: url('uploader-icons.png') !important;
+	display: block !important;
+	margin: 0 !important;
+	padding: 0 !important;
+	width: 15px !important;
+	height: 15px !important;
+	background-position: -100px 0 !important;
+	position: absolute !important;
+	top: 44px !important;
+	right: 30px !important;
+}
+
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/iframely.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/iframely.css
new file mode 100644
index 0000000000000000000000000000000000000000..86285cf416feaf1ebd6363ab6e5f413c0fa6287c
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/iframely.css
@@ -0,0 +1,25 @@
+#iframely, #iframely body{
+	padding: 0px;
+	width: 100%;
+	height: 100%;
+}
+
+#iframely {
+    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
+	filter: alpha(opacity=0);
+	opacity: 0.0;
+	background-position: center center;
+	background-repeat: no-repeat;
+	position: absolute;
+	visibility: hidden;
+}
+
+#iframely #wpbody-content {
+	float: none;
+	padding: 0px;
+}
+
+#iframely h2,
+#iframely #icon-nextgen-gallery {
+    display: none;
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/iframely.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/iframely.js
new file mode 100644
index 0000000000000000000000000000000000000000..97efd79970921412398f48c358f37e7b35eb05ec
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/iframely.js
@@ -0,0 +1,33 @@
+if (window.frameElement) {
+	document.getElementsByTagName('html')[0].id = 'iframely';
+	jQuery(function($){
+		// Concentrate only on the content of the page
+		$('#wpwrap').html($('#wpbody').html($('#wpbody-content').html($('#ngg_page_content'))));
+
+		// We need to ensure that any POST operation includes the "attach_to_post"
+		// parameter, to display subsequent clicks in iframely.
+		$('form').each(function(){
+			$(this).append("<input type='hidden' name='attach_to_post' value='1'/>");
+		});
+		
+		var parent = window.parent;
+		
+		if (parent == null || typeof(parent.adjust_height_for_frame) == "undefined") {
+			if (window != null && typeof(window.adjust_height_for_frame) != "undefined") {
+				parent = window;
+			}
+		}
+		
+		if (typeof(parent.adjust_height_for_frame) != "undefined") {
+			// Adjust the height of the frame
+			parent.adjust_height_for_frame(window.frameElement, function(){
+				$('#iframely').css({
+					position: 'static',
+					visibility: 'visible'
+				}).animate({
+					opacity: 1.0
+				});
+			});
+		}
+	});
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/invalid_image.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/invalid_image.png
new file mode 100644
index 0000000000000000000000000000000000000000..28ad61bfcb29d31f649315119259faf3a45ef64b
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/invalid_image.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/nextgen.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/nextgen.gif
new file mode 100644
index 0000000000000000000000000000000000000000..24d0f2b520d60a60a2ec82a6dd7b9bbe093c0389
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/nextgen.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/ngg_attach_to_post_tinymce_plugin.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/ngg_attach_to_post_tinymce_plugin.js
new file mode 100644
index 0000000000000000000000000000000000000000..82dc223734303facb6dc9f0adaf9137edd8422e9
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/ngg_attach_to_post_tinymce_plugin.js
@@ -0,0 +1,207 @@
+// Self-executing function to create and register the TinyMCE plugin
+(function(siteurl) {
+
+	// Create the plugin. We'll register it afterwards
+	tinymce.create('tinymce.plugins.NextGEN_AttachToPost', {
+
+		/**
+		 * The WordPress Site URL
+		**/
+		siteurl:	siteurl,
+
+		/**
+		 * Returns metadata about this plugin
+		 */
+		getInfo: function() {
+			return {
+				longname:	'NextGen - Attach Gallery',
+				author:		'Photocrati Media',
+				authorurl:	'http://www.photocrati.com',
+				infourl:	'http://www.nextgen-gallery.com',
+				version:	'0.1'
+			};
+		},
+
+
+		/**
+		 * Initializes the plugin, this will be executed after the plugin has been created.
+		 */
+		init: function(editor, plugin_url) {
+
+			// Register a new TinyMCE command
+			editor.addCommand('ngg_attach_to_post', this.render_attach_to_post_interface, {
+				editor: editor,
+				plugin:	editor.plugins.NextGEN_AttachToPost
+			});
+
+			// Add a button to trigger the above command
+			editor.addButton('NextGEN_AttachToPost', {
+				title:	'NextGEN Gallery - Attach To Post',
+				cmd:	'ngg_attach_to_post',
+				image:	plugin_url+'/nextgen.gif'
+			});
+
+			// When the shortcode is clicked, open the attach to post interface
+			editor.settings.extended_valid_elements += ",shortcode";
+			editor.settings.custom_elements = "shortcode";
+			var self = this;
+            var drag_in_progress = false;
+            var click_timer;
+
+            editor.onMouseDown.addToTop(function(editor, e) {
+                if (e.target.tagName == 'IMG') {
+					if (self.get_class_name(e.target).indexOf('ngg_displayed_gallery') >= 0) {
+						click_timer = setTimeout(function() {
+							drag_in_progress = true;
+						}, 250);
+					}
+				}
+            });
+
+            editor.onMouseUp.addToTop(function(editor, e) {
+				if (!drag_in_progress &&  e.target.tagName == 'IMG') {
+					if (self.get_class_name(e.target).indexOf('ngg_displayed_gallery') >= 0) {
+						editor.dom.events.cancel(e);
+						editor.dom.events.stop(e);
+						var id = e.target.src.match(/\d+$/);
+						if (id) id = id.pop();
+						var obj = tinymce.extend(self, {
+							editor: editor,
+							plugin: editor.plugins.NextGEN_AttachToPost,
+							id:		id
+						});
+						self.render_attach_to_post_interface.call(obj);
+					}
+				}
+                clearTimeout(click_timer);
+                drag_in_progress = false;
+			});
+		},
+
+		get_class_name: function(node) {
+			var class_name = node.getAttribute('class') ?
+				node.getAttribute('class') : node.className;
+
+			if (class_name) return class_name;
+			else return "";
+		},
+
+
+		/**
+		 * Renders the attach to post interface
+		 */
+		render_attach_to_post_interface:	function(id) {
+
+			// Determine the attach to post url
+			var attach_to_post_url = nextgen_gallery_attach_to_post_url;
+			if (typeof(this.id) != 'undefined') {
+				attach_to_post_url += "?id="+this.id;
+			}
+
+			// We're going to open a dialog window. TinyMCE doesn't
+			// get the positioning exactly right, so we add an event
+			// handler to make adjustments
+			//
+			// We also make the parent window unscrollable, to avoid
+			// multiple scrollbars
+			this.editor.windowManager.onOpen.add(function(win){
+
+				// Assign the window the "ngg_attach_to_post_window" so that
+				// we can style it
+				var window_selector = '#';
+				if (win.params && win.params.mce_window_id)
+					window_selector += win.params.mce_window_id;
+				else if (win.features && win.features.id)
+					window_selector += win.features.id;
+				
+				var callback = function(selector, callback){
+					var obj = jQuery(selector);
+					if (obj.length == 0) {
+						setTimeout(function(){
+							callback.call(null, selector, callback);
+						}, 5);
+					}
+					else {
+						obj.addClass('ngg_attach_to_post_window');
+					}
+				}
+				setTimeout(function(){
+					callback.call(null, window_selector, callback);
+				},5);
+
+				jQuery('html,body').css('overflow', 'hidden');
+			});
+
+			// Restore scrolling for the main content window
+			// when the attach to post interface is closed
+			this.editor.windowManager.onClose.add(function(win){
+				jQuery('html,body').css('overflow', 'auto');
+                tinyMCE.activeEditor.selection.select(tinyMCE.activeEditor.dom.select('p')[0]);
+                tinyMCE.activeEditor.selection.collapse(0);
+			});
+			
+			var popupDialog = jQuery('<div style="display:none;"><div id="ngg_attach_to_post_dialog" tabindex="-1" action=""></div></div>');
+			popupDialog.appendTo(jQuery(document.body));
+			
+			var win = window;
+			
+			while (win.parent != null && win.parent != win) {
+				win = win.parent;
+			}
+			
+			win = jQuery(win);
+			var winWidth = win.width();
+			var winHeight = win.height();
+			var popupWidth = 1200;
+			var popupHeight = 600;
+			var minWidth = 800;
+			var minHeight = 600;
+			var maxWidth = winWidth - (winWidth * 0.05);
+			var maxHeight = winHeight - (winHeight * 0.05);
+			
+			if (maxWidth < minWidth) {
+				maxWidth = winWidth - 10;
+			}
+			
+			if (maxHeight < minHeight) {
+				maxHeight = winHeight - 10;
+			}
+			
+			if (popupWidth > maxWidth) {
+				popupWidth = maxWidth;
+			}
+			
+			if (popupHeight > maxHeight) {
+				popupHeight = maxHeight;
+			}
+
+			// Open a window, occupying 90% of the screen real estate
+			var popup = this.editor.windowManager.open({
+				file:		attach_to_post_url,
+//				wpDialog: true,
+				id: 'ngg_attach_to_post_dialog',
+				width:		popupWidth,
+				height:		popupHeight,
+				inline:		true,
+				title:		"NextGEN Gallery - Attach To Post"
+			});
+//			popupDialog.wpdialog({
+//				title: "NextGEN Gallery - Attach To Post",
+//				width: 1200,
+//				height: 600,
+//				modal: true,
+//				dialogClass: 'wp-dialog',
+//				zIndex: 300000
+//			});
+
+			// Ensure that the window cannot be scrolled - XXX actually allow scrolling in the main window and disable it for the inner-windows/frames/elements as to create a single scrollbar
+			jQuery('#'+popup.id+'_ifr').css('overflow-y', 'auto');
+			jQuery('#'+popup.id+'_ifr').css('overflow-x', 'hidden');
+			//jQuery('#'+popup.id+'_ifr').mCustomScrollbar();
+			//jQuery('#'+popup.id).addClass('wp-dialog');
+		}
+	});
+
+	// Register plugin
+	tinymce.PluginManager.add('NextGEN_AttachToPost', tinymce.plugins.NextGEN_AttachToPost);
+})(photocrati_ajax.wp_site_url);
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/ngg_tabs.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/ngg_tabs.js
new file mode 100644
index 0000000000000000000000000000000000000000..265b1415e66f72d3fc20569cb6e3b01e319b40cf
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/ngg_tabs.js
@@ -0,0 +1,57 @@
+jQuery(function($){
+
+	// Creates a Firefox-friendly wrapper around jQuery Tabs
+	$.fn.ngg_tabs = function(options){
+
+		// Create jQuery tabs
+		this.tabs(options);
+
+		// Change from display:none to visbibility:hidden
+		var i = 0;
+		this.find('.main_menu_tab').each(function(){
+			if (i == 0) $.fn.ngg_tabs.show_tab(this);
+			else		$.fn.ngg_tabs.hide_tab(this);
+			i++;
+		});
+
+		// When the selected tab changes, then we need to re-adjust
+		this.bind('tabsactivate', function(event, ui){
+
+			// Ensure that all tabs are still displayed, but hidden ;)
+			$.fn.ngg_tabs.hide_tab($.fn.ngg_tabs.get_tab_by_li(ui.oldTab));
+			$.fn.ngg_tabs.show_tab($.fn.ngg_tabs.get_tab_by_li(ui.newTab));
+		});
+	};
+
+	$.fn.ngg_tabs.hide_tab = function(tab){
+		tab = $(tab);
+		setTimeout(function(){
+			tab.css({
+				display:	'block',
+				position:	'absolute',
+				top:		-1000,
+				visibility:	'hidden',
+				height:     0
+			});
+		}, 0);
+	};
+
+	$.fn.ngg_tabs.show_tab = function(tab){
+		tab = $(tab);
+		setTimeout(function(){
+			tab.css({
+				display:	'block',
+				position:	'static',
+				top:		0,
+				visibility: 'visible',
+				height:		'100%'
+			});
+		}, 0);
+	};
+
+	$.fn.ngg_tabs.get_tab_by_li = function(list_item){
+		var active_id = list_item.attr('aria-labelledby');
+		var active_tab = list_item.parents('div').find('.main_menu_tab[aria-labelledby="'+active_id+'"]');
+		return active_tab;
+	}
+});
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/spinner.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/spinner.gif
new file mode 100644
index 0000000000000000000000000000000000000000..5b33f7e54f4e55b6b8774d86d96895db9af044b4
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/spinner.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/underscore.string.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/underscore.string.js
new file mode 100644
index 0000000000000000000000000000000000000000..965a477b7029e70de0ef30f4325093fd6eb35543
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/underscore.string.js
@@ -0,0 +1,600 @@
+//  Underscore.string
+//  (c) 2010 Esa-Matti Suuronen <esa-matti aet suuronen dot org>
+//  Underscore.string is freely distributable under the terms of the MIT license.
+//  Documentation: https://github.com/epeli/underscore.string
+//  Some code is borrowed from MooTools and Alexandru Marasteanu.
+//  Version '2.3.0'
+
+!function(root, String){
+  'use strict';
+
+  // Defining helper functions.
+
+  var nativeTrim = String.prototype.trim;
+  var nativeTrimRight = String.prototype.trimRight;
+  var nativeTrimLeft = String.prototype.trimLeft;
+
+  var parseNumber = function(source) { return source * 1 || 0; };
+
+  var strRepeat = function(str, qty){
+    if (qty < 1) return '';
+    var result = '';
+    while (qty > 0) {
+      if (qty & 1) result += str;
+      qty >>= 1, str += str;
+    }
+    return result;
+  };
+
+  var slice = [].slice;
+
+  var defaultToWhiteSpace = function(characters) {
+    if (characters == null)
+      return '\\s';
+    else if (characters.source)
+      return characters.source;
+    else
+      return '[' + _s.escapeRegExp(characters) + ']';
+  };
+
+  var escapeChars = {
+    lt: '<',
+    gt: '>',
+    quot: '"',
+    apos: "'",
+    amp: '&'
+  };
+
+  var reversedEscapeChars = {};
+  for(var key in escapeChars){ reversedEscapeChars[escapeChars[key]] = key; }
+
+  // sprintf() for JavaScript 0.7-beta1
+  // http://www.diveintojavascript.com/projects/javascript-sprintf
+  //
+  // Copyright (c) Alexandru Marasteanu <alexaholic [at) gmail (dot] com>
+  // All rights reserved.
+
+  var sprintf = (function() {
+    function get_type(variable) {
+      return Object.prototype.toString.call(variable).slice(8, -1).toLowerCase();
+    }
+
+    var str_repeat = strRepeat;
+
+    var str_format = function() {
+      if (!str_format.cache.hasOwnProperty(arguments[0])) {
+        str_format.cache[arguments[0]] = str_format.parse(arguments[0]);
+      }
+      return str_format.format.call(null, str_format.cache[arguments[0]], arguments);
+    };
+
+    str_format.format = function(parse_tree, argv) {
+      var cursor = 1, tree_length = parse_tree.length, node_type = '', arg, output = [], i, k, match, pad, pad_character, pad_length;
+      for (i = 0; i < tree_length; i++) {
+        node_type = get_type(parse_tree[i]);
+        if (node_type === 'string') {
+          output.push(parse_tree[i]);
+        }
+        else if (node_type === 'array') {
+          match = parse_tree[i]; // convenience purposes only
+          if (match[2]) { // keyword argument
+            arg = argv[cursor];
+            for (k = 0; k < match[2].length; k++) {
+              if (!arg.hasOwnProperty(match[2][k])) {
+                throw new Error(sprintf('[_.sprintf] property "%s" does not exist', match[2][k]));
+              }
+              arg = arg[match[2][k]];
+            }
+          } else if (match[1]) { // positional argument (explicit)
+            arg = argv[match[1]];
+          }
+          else { // positional argument (implicit)
+            arg = argv[cursor++];
+          }
+
+          if (/[^s]/.test(match[8]) && (get_type(arg) != 'number')) {
+            throw new Error(sprintf('[_.sprintf] expecting number but found %s', get_type(arg)));
+          }
+          switch (match[8]) {
+            case 'b': arg = arg.toString(2); break;
+            case 'c': arg = String.fromCharCode(arg); break;
+            case 'd': arg = parseInt(arg, 10); break;
+            case 'e': arg = match[7] ? arg.toExponential(match[7]) : arg.toExponential(); break;
+            case 'f': arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg); break;
+            case 'o': arg = arg.toString(8); break;
+            case 's': arg = ((arg = String(arg)) && match[7] ? arg.substring(0, match[7]) : arg); break;
+            case 'u': arg = Math.abs(arg); break;
+            case 'x': arg = arg.toString(16); break;
+            case 'X': arg = arg.toString(16).toUpperCase(); break;
+          }
+          arg = (/[def]/.test(match[8]) && match[3] && arg >= 0 ? '+'+ arg : arg);
+          pad_character = match[4] ? match[4] == '0' ? '0' : match[4].charAt(1) : ' ';
+          pad_length = match[6] - String(arg).length;
+          pad = match[6] ? str_repeat(pad_character, pad_length) : '';
+          output.push(match[5] ? arg + pad : pad + arg);
+        }
+      }
+      return output.join('');
+    };
+
+    str_format.cache = {};
+
+    str_format.parse = function(fmt) {
+      var _fmt = fmt, match = [], parse_tree = [], arg_names = 0;
+      while (_fmt) {
+        if ((match = /^[^\x25]+/.exec(_fmt)) !== null) {
+          parse_tree.push(match[0]);
+        }
+        else if ((match = /^\x25{2}/.exec(_fmt)) !== null) {
+          parse_tree.push('%');
+        }
+        else if ((match = /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(_fmt)) !== null) {
+          if (match[2]) {
+            arg_names |= 1;
+            var field_list = [], replacement_field = match[2], field_match = [];
+            if ((field_match = /^([a-z_][a-z_\d]*)/i.exec(replacement_field)) !== null) {
+              field_list.push(field_match[1]);
+              while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') {
+                if ((field_match = /^\.([a-z_][a-z_\d]*)/i.exec(replacement_field)) !== null) {
+                  field_list.push(field_match[1]);
+                }
+                else if ((field_match = /^\[(\d+)\]/.exec(replacement_field)) !== null) {
+                  field_list.push(field_match[1]);
+                }
+                else {
+                  throw new Error('[_.sprintf] huh?');
+                }
+              }
+            }
+            else {
+              throw new Error('[_.sprintf] huh?');
+            }
+            match[2] = field_list;
+          }
+          else {
+            arg_names |= 2;
+          }
+          if (arg_names === 3) {
+            throw new Error('[_.sprintf] mixing positional and named placeholders is not (yet) supported');
+          }
+          parse_tree.push(match);
+        }
+        else {
+          throw new Error('[_.sprintf] huh?');
+        }
+        _fmt = _fmt.substring(match[0].length);
+      }
+      return parse_tree;
+    };
+
+    return str_format;
+  })();
+
+
+
+  // Defining underscore.string
+
+  var _s = {
+
+    VERSION: '2.3.0',
+
+    isBlank: function(str){
+      if (str == null) str = '';
+      return (/^\s*$/).test(str);
+    },
+
+    stripTags: function(str){
+      if (str == null) return '';
+      return String(str).replace(/<\/?[^>]+>/g, '');
+    },
+
+    capitalize : function(str){
+      str = str == null ? '' : String(str);
+      return str.charAt(0).toUpperCase() + str.slice(1);
+    },
+
+    chop: function(str, step){
+      if (str == null) return [];
+      str = String(str);
+      step = ~~step;
+      return step > 0 ? str.match(new RegExp('.{1,' + step + '}', 'g')) : [str];
+    },
+
+    clean: function(str){
+      return _s.strip(str).replace(/\s+/g, ' ');
+    },
+
+    count: function(str, substr){
+      if (str == null || substr == null) return 0;
+      return String(str).split(substr).length - 1;
+    },
+
+    chars: function(str) {
+      if (str == null) return [];
+      return String(str).split('');
+    },
+
+    swapCase: function(str) {
+      if (str == null) return '';
+      return String(str).replace(/\S/g, function(c){
+        return c === c.toUpperCase() ? c.toLowerCase() : c.toUpperCase();
+      });
+    },
+
+    escapeHTML: function(str) {
+      if (str == null) return '';
+      return String(str).replace(/[&<>"']/g, function(m){ return '&' + reversedEscapeChars[m] + ';'; });
+    },
+
+    unescapeHTML: function(str) {
+      if (str == null) return '';
+      return String(str).replace(/\&([^;]+);/g, function(entity, entityCode){
+        var match;
+
+        if (entityCode in escapeChars) {
+          return escapeChars[entityCode];
+        } else if (match = entityCode.match(/^#x([\da-fA-F]+)$/)) {
+          return String.fromCharCode(parseInt(match[1], 16));
+        } else if (match = entityCode.match(/^#(\d+)$/)) {
+          return String.fromCharCode(~~match[1]);
+        } else {
+          return entity;
+        }
+      });
+    },
+
+    escapeRegExp: function(str){
+      if (str == null) return '';
+      return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
+    },
+
+    splice: function(str, i, howmany, substr){
+      var arr = _s.chars(str);
+      arr.splice(~~i, ~~howmany, substr);
+      return arr.join('');
+    },
+
+    insert: function(str, i, substr){
+      return _s.splice(str, i, 0, substr);
+    },
+
+    include: function(str, needle){
+      if (needle === '') return true;
+      if (str == null) return false;
+      return String(str).indexOf(needle) !== -1;
+    },
+
+    join: function() {
+      var args = slice.call(arguments),
+        separator = args.shift();
+
+      if (separator == null) separator = '';
+
+      return args.join(separator);
+    },
+
+    lines: function(str) {
+      if (str == null) return [];
+      return String(str).split("\n");
+    },
+
+    reverse: function(str){
+      return _s.chars(str).reverse().join('');
+    },
+
+    startsWith: function(str, starts){
+      if (starts === '') return true;
+      if (str == null || starts == null) return false;
+      str = String(str); starts = String(starts);
+      return str.length >= starts.length && str.slice(0, starts.length) === starts;
+    },
+
+    endsWith: function(str, ends){
+      if (ends === '') return true;
+      if (str == null || ends == null) return false;
+      str = String(str); ends = String(ends);
+      return str.length >= ends.length && str.slice(str.length - ends.length) === ends;
+    },
+
+    succ: function(str){
+      if (str == null) return '';
+      str = String(str);
+      return str.slice(0, -1) + String.fromCharCode(str.charCodeAt(str.length-1) + 1);
+    },
+
+    titleize: function(str){
+      if (str == null) return '';
+      return String(str).replace(/(?:^|\s)\S/g, function(c){ return c.toUpperCase(); });
+    },
+
+    camelize: function(str){
+      return _s.trim(str).replace(/[-_\s]+(.)?/g, function(match, c){ return c.toUpperCase(); });
+    },
+
+    underscored: function(str){
+      return _s.trim(str).replace(/([a-z\d])([A-Z]+)/g, '$1_$2').replace(/[-\s]+/g, '_').toLowerCase();
+    },
+
+    dasherize: function(str){
+      return _s.trim(str).replace(/([A-Z])/g, '-$1').replace(/[-_\s]+/g, '-').toLowerCase();
+    },
+
+    classify: function(str){
+      return _s.titleize(String(str).replace(/_/g, ' ')).replace(/\s/g, '');
+    },
+
+    humanize: function(str){
+      return _s.capitalize(_s.underscored(str).replace(/_id$/,'').replace(/_/g, ' '));
+    },
+
+    trim: function(str, characters){
+      if (str == null) return '';
+      if (!characters && nativeTrim) return nativeTrim.call(str);
+      characters = defaultToWhiteSpace(characters);
+      return String(str).replace(new RegExp('\^' + characters + '+|' + characters + '+$', 'g'), '');
+    },
+
+    ltrim: function(str, characters){
+      if (str == null) return '';
+      if (!characters && nativeTrimLeft) return nativeTrimLeft.call(str);
+      characters = defaultToWhiteSpace(characters);
+      return String(str).replace(new RegExp('^' + characters + '+'), '');
+    },
+
+    rtrim: function(str, characters){
+      if (str == null) return '';
+      if (!characters && nativeTrimRight) return nativeTrimRight.call(str);
+      characters = defaultToWhiteSpace(characters);
+      return String(str).replace(new RegExp(characters + '+$'), '');
+    },
+
+    truncate: function(str, length, truncateStr){
+      if (str == null) return '';
+      str = String(str); truncateStr = truncateStr || '...';
+      length = ~~length;
+      return str.length > length ? str.slice(0, length) + truncateStr : str;
+    },
+
+    /**
+     * _s.prune: a more elegant version of truncate
+     * prune extra chars, never leaving a half-chopped word.
+     * @author github.com/rwz
+     */
+    prune: function(str, length, pruneStr){
+      if (str == null) return '';
+
+      str = String(str); length = ~~length;
+      pruneStr = pruneStr != null ? String(pruneStr) : '...';
+
+      if (str.length <= length) return str;
+
+      var tmpl = function(c){ return c.toUpperCase() !== c.toLowerCase() ? 'A' : ' '; },
+        template = str.slice(0, length+1).replace(/.(?=\W*\w*$)/g, tmpl); // 'Hello, world' -> 'HellAA AAAAA'
+
+      if (template.slice(template.length-2).match(/\w\w/))
+        template = template.replace(/\s*\S+$/, '');
+      else
+        template = _s.rtrim(template.slice(0, template.length-1));
+
+      return (template+pruneStr).length > str.length ? str : str.slice(0, template.length)+pruneStr;
+    },
+
+    words: function(str, delimiter) {
+      if (_s.isBlank(str)) return [];
+      return _s.trim(str, delimiter).split(delimiter || /\s+/);
+    },
+
+    pad: function(str, length, padStr, type) {
+      str = str == null ? '' : String(str);
+      length = ~~length;
+
+      var padlen  = 0;
+
+      if (!padStr)
+        padStr = ' ';
+      else if (padStr.length > 1)
+        padStr = padStr.charAt(0);
+
+      switch(type) {
+        case 'right':
+          padlen = length - str.length;
+          return str + strRepeat(padStr, padlen);
+        case 'both':
+          padlen = length - str.length;
+          return strRepeat(padStr, Math.ceil(padlen/2)) + str
+                  + strRepeat(padStr, Math.floor(padlen/2));
+        default: // 'left'
+          padlen = length - str.length;
+          return strRepeat(padStr, padlen) + str;
+        }
+    },
+
+    lpad: function(str, length, padStr) {
+      return _s.pad(str, length, padStr);
+    },
+
+    rpad: function(str, length, padStr) {
+      return _s.pad(str, length, padStr, 'right');
+    },
+
+    lrpad: function(str, length, padStr) {
+      return _s.pad(str, length, padStr, 'both');
+    },
+
+    sprintf: sprintf,
+
+    vsprintf: function(fmt, argv){
+      argv.unshift(fmt);
+      return sprintf.apply(null, argv);
+    },
+
+    toNumber: function(str, decimals) {
+      if (str == null || str == '') return 0;
+      str = String(str);
+      var num = parseNumber(parseNumber(str).toFixed(~~decimals));
+      return num === 0 && !str.match(/^0+$/) ? Number.NaN : num;
+    },
+
+    numberFormat : function(number, dec, dsep, tsep) {
+      if (isNaN(number) || number == null) return '';
+
+      number = number.toFixed(~~dec);
+      tsep = tsep || ',';
+
+      var parts = number.split('.'), fnums = parts[0],
+        decimals = parts[1] ? (dsep || '.') + parts[1] : '';
+
+      return fnums.replace(/(\d)(?=(?:\d{3})+$)/g, '$1' + tsep) + decimals;
+    },
+
+    strRight: function(str, sep){
+      if (str == null) return '';
+      str = String(str); sep = sep != null ? String(sep) : sep;
+      var pos = !sep ? -1 : str.indexOf(sep);
+      return ~pos ? str.slice(pos+sep.length, str.length) : str;
+    },
+
+    strRightBack: function(str, sep){
+      if (str == null) return '';
+      str = String(str); sep = sep != null ? String(sep) : sep;
+      var pos = !sep ? -1 : str.lastIndexOf(sep);
+      return ~pos ? str.slice(pos+sep.length, str.length) : str;
+    },
+
+    strLeft: function(str, sep){
+      if (str == null) return '';
+      str = String(str); sep = sep != null ? String(sep) : sep;
+      var pos = !sep ? -1 : str.indexOf(sep);
+      return ~pos ? str.slice(0, pos) : str;
+    },
+
+    strLeftBack: function(str, sep){
+      if (str == null) return '';
+      str += ''; sep = sep != null ? ''+sep : sep;
+      var pos = str.lastIndexOf(sep);
+      return ~pos ? str.slice(0, pos) : str;
+    },
+
+    toSentence: function(array, separator, lastSeparator, serial) {
+      separator = separator || ', '
+      lastSeparator = lastSeparator || ' and '
+      var a = array.slice(), lastMember = a.pop();
+
+      if (array.length > 2 && serial) lastSeparator = _s.rtrim(separator) + lastSeparator;
+
+      return a.length ? a.join(separator) + lastSeparator + lastMember : lastMember;
+    },
+
+    toSentenceSerial: function() {
+      var args = slice.call(arguments);
+      args[3] = true;
+      return _s.toSentence.apply(_s, args);
+    },
+
+    slugify: function(str) {
+      if (str == null) return '';
+
+      var from  = "ąà áäâãåæćęèéëêìíïîłńòóöôõøùúüûñçżź",
+          to    = "aaaaaaaaceeeeeiiiilnoooooouuuunczz",
+          regex = new RegExp(defaultToWhiteSpace(from), 'g');
+
+      str = String(str).toLowerCase().replace(regex, function(c){
+        var index = from.indexOf(c);
+        return to.charAt(index) || '-';
+      });
+
+      return _s.dasherize(str.replace(/[^\w\s-]/g, ''));
+    },
+
+    surround: function(str, wrapper) {
+      return [wrapper, str, wrapper].join('');
+    },
+
+    quote: function(str) {
+      return _s.surround(str, '"');
+    },
+
+    exports: function() {
+      var result = {};
+
+      for (var prop in this) {
+        if (!this.hasOwnProperty(prop) || prop.match(/^(?:include|contains|reverse)$/)) continue;
+        result[prop] = this[prop];
+      }
+
+      return result;
+    },
+
+    repeat: function(str, qty, separator){
+      if (str == null) return '';
+
+      qty = ~~qty;
+
+      // using faster implementation if separator is not needed;
+      if (separator == null) return strRepeat(String(str), qty);
+
+      // this one is about 300x slower in Google Chrome
+      for (var repeat = []; qty > 0; repeat[--qty] = str) {}
+      return repeat.join(separator);
+    },
+
+    levenshtein: function(str1, str2) {
+      if (str1 == null && str2 == null) return 0;
+      if (str1 == null) return String(str2).length;
+      if (str2 == null) return String(str1).length;
+
+      str1 = String(str1); str2 = String(str2);
+
+      var current = [], prev, value;
+
+      for (var i = 0; i <= str2.length; i++)
+        for (var j = 0; j <= str1.length; j++) {
+          if (i && j)
+            if (str1.charAt(j - 1) === str2.charAt(i - 1))
+              value = prev;
+            else
+              value = Math.min(current[j], current[j - 1], prev) + 1;
+          else
+            value = i + j;
+
+          prev = current[j];
+          current[j] = value;
+        }
+
+      return current.pop();
+    }
+  };
+
+  // Aliases
+
+  _s.strip    = _s.trim;
+  _s.lstrip   = _s.ltrim;
+  _s.rstrip   = _s.rtrim;
+  _s.center   = _s.lrpad;
+  _s.rjust    = _s.lpad;
+  _s.ljust    = _s.rpad;
+  _s.contains = _s.include;
+  _s.q        = _s.quote;
+
+  // CommonJS module is defined
+  if (typeof exports !== 'undefined') {
+    if (typeof module !== 'undefined' && module.exports) {
+      // Export module
+      module.exports = _s;
+    }
+    exports._s = _s;
+
+  } else if (typeof define === 'function' && define.amd) {
+    // Register as a named module with AMD.
+    define('underscore.string', [], function() {
+      return _s;
+    });
+
+  } else {
+    // Integrate with Underscore.js if defined
+    // or create our own underscore object.
+    root._ = root._ || {};
+    root._.string = root._.str = _s;
+  }
+
+}(this, String);
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/uploader-icons-2x.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/uploader-icons-2x.png
new file mode 100644
index 0000000000000000000000000000000000000000..d40389c7639683d37cdc5eb2b0461933d515b573
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/uploader-icons-2x.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/uploader-icons.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/uploader-icons.png
new file mode 100644
index 0000000000000000000000000000000000000000..b72a074b08cb52bc860946ca71085ed2e42ae729
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/uploader-icons.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/accordion_tab.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/accordion_tab.php
new file mode 100644
index 0000000000000000000000000000000000000000..3c34314231b45fccce7cf962ef29d6fe0fb58e48
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/accordion_tab.php
@@ -0,0 +1,4 @@
+<h3 class="accordion_tab" id="<?php echo esc_attr($id) ?>"><a href="#"><?php echo_h($title) ?></a></h3>
+<div id="<?php echo esc_attr($id) ?>_content">
+	<?php echo $content ?>
+</div>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/attach_to_post.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/attach_to_post.php
new file mode 100644
index 0000000000000000000000000000000000000000..8b3767debab3f3c262bfc2383474feb6b420089a
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/attach_to_post.php
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <title><?php echo_h($page_title)?></title>
+		<?php
+			wp_print_styles();
+			wp_print_scripts();
+		?>
+    </head>
+	<body>
+		<div id="attach_to_post_tabs">
+            <div class='ui-tabs-icon'><span class="nextgen_logo"><?php echo_h('NextGEN')?></span> <span class="nextgen_logo_sub"><?php echo_h('Gallery')?></span></div>
+			<ul>
+            <?php foreach ($tabs as $id => $tab_params): ?>
+				<li>
+					<a href='#<?php echo esc_attr($id)?>'>
+						<?php echo_h($tab_params['title']) ?>
+					</a>
+				</li>
+			<?php endforeach ?>
+			</ul>
+			<?php reset($tabs); foreach ($tabs as $id => $tab_params): ?>
+			<div class="main_menu_tab" id="<?php echo esc_attr($id) ?>"><?php echo $tab_params['content'] ?></div>
+			<?php endforeach ?>
+		</div>
+
+		<?php wp_print_footer_scripts() ?>
+	</body>
+</html>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/display_settings_form.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/display_settings_form.php
new file mode 100644
index 0000000000000000000000000000000000000000..9defe7b5e7090b3ba5197b2454894e2295ba755c
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/display_settings_form.php
@@ -0,0 +1,3 @@
+<form rel="<?php echo esc_attr($display_type_name) ?>" class="<?php echo esc_attr($css_class) ?>" method='POST' action='<?php echo esc_attr($_SERVER['REQUEST_URI'])?>'>
+	<?php echo $settings ?>
+</form>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/display_tab.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/display_tab.php
new file mode 100644
index 0000000000000000000000000000000000000000..e5f17e3ae6bdb88f21a392567fcf0b569e94bf38
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/display_tab.php
@@ -0,0 +1,11 @@
+<div id="errors">
+	
+</div>
+<div class="accordion" id="display_settings_accordion">
+<?php foreach($tabs as $tab): ?>
+	<?php echo $tab ?>
+<?php endforeach ?>
+</div>
+<p>
+	<input type="button" id="save_displayed_gallery" value="Save"/>
+</p>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/display_tab_js.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/display_tab_js.php
new file mode 100644
index 0000000000000000000000000000000000000000..aa79ce57e13417cba1042573f75013aa57009eff
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/display_tab_js.php
@@ -0,0 +1,1669 @@
+jQuery(function($){
+
+    /*****************************************************************************
+     ** NGG DEFINITION
+    ***/
+
+    /**
+     Setup a namespace for NextGEN-offered Backbone components
+    **/
+    var Ngg = {
+        Models: {},
+        Views: {}
+    };
+
+    /*****************************************************************************
+     ** NGG MODELS
+    ***/
+
+    /**
+     * Ngg.Models.SelectableItems
+     * A collection of items that can be selectable. Commonly used with the
+     * Ngg.Views.SelectTag widget (view)
+    **/
+    Ngg.Models.SelectableItems = Backbone.Collection.extend({
+        selected: function(){
+            return this.filter(function(item){
+                return item.get('selected') == true;
+            });
+        },
+
+		deselect_all: function(){
+			this.each(function(item){
+				item.set('selected', false);
+			});
+		},
+
+        selected_ids: function(){
+			return _.pluck(this.selected(), 'id');
+        },
+
+		select: function(ids){
+			if (!_.isArray(ids)) ids = [ids];
+			this.each(function(item){
+				if (_.indexOf(ids, item.id) >= 0) {
+					item.set('selected', true);
+				}
+			});
+			this.trigger('selected');
+		}
+    });
+
+
+    /*****************************************************************************
+     ** NGG VIEWS
+    ***/
+
+    /**
+     * Ngg.Views.SelectTag
+     * Used to render a Select tag (drop-down list)
+    **/
+    Ngg.Views.SelectTag                    = Backbone.View.extend({
+        tagName: 'select',
+
+        collection: null,
+
+		multiple: false,
+
+		value_field: 'id',
+
+		text_field: 'title',
+
+        initialize: function(){
+			_.each(this.options, function(value, key){
+				this[key] = value;
+			}, this);
+			this.collection.on('add', this.render_new_option, this);
+			this.collection.on('remove', this.remove_existing_option, this);
+			this.collection.on('reset', this.empty_list, this);
+        },
+
+        events: {
+            'change': 'selection_changed'
+        },
+
+		empty_list: function(){
+			this.$el.empty();
+		},
+
+		render_new_option: function(item){
+			this.$el.append(new this.Option({
+				model: item,
+				value_field: this.value_field,
+				text_field: this.text_field
+			}).render().el);
+		},
+
+		remove_existing_option: function(item){
+			this.$el.find("option[value='"+item.id+"']").remove();
+		},
+
+        /**
+         * After a selection has changed, set the 'selected' property for each item in the
+         * collection
+         * @triggers 'selected'
+        **/
+        selection_changed: function(){
+            // Get selected options from DOM
+            var selections = _.map(this.$el.find(':selected'), function(element){
+                return $(element).val();
+            });
+
+            // Set the 'selected' attribute for each item in the collection
+            this.collection.each(function(item){
+                if (_.indexOf(selections, item.id) >= 0 || _.indexOf(selections, item.id.toString()) >= 0)
+                    item.set('selected', true);
+                else
+                    item.set('selected', false);
+            });
+            this.collection.trigger('selected');
+        },
+
+        render: function(){
+			this.$el.empty();
+			if (this.options.include_blank) {
+				this.$el.append("<option></option>");
+			}
+            this.collection.each(function(item){
+                var option = new this.Option({
+					model: item,
+					value_field: this.value_field,
+					text_field: this.text_field
+				});
+                this.$el.append(option.render().el);
+            }, this);
+			if (this.multiple) this.$el.prop('multiple', true);
+			if (this.width) this.$el.width(this.width);
+            return this;
+        },
+
+        /**
+         * Represents an option in the Select drop-down
+        **/
+        Option: Backbone.View.extend({
+            tagName: 'option',
+
+            model: null,
+
+            initialize: function(){
+				_.each(this.options, function(value, key){
+					this[key] = value;
+				}, this);
+                this.model.on('change', this.render, this);
+            },
+
+            render: function(){
+                var self = this;
+                this.$el.html(this.model.get(this.text_field).replace(/\\&/g, '&').replace(/\\'/g, "'"));
+                this.$el.prop({
+                    value:    this.value_field == 'id' ? this.model.id : this.model.get(this.value_field),
+                });
+                if (self.model.get('selected') == true) {
+                    this.$el.attr('selected', 'selected');
+                }
+                return this;
+            }
+        })
+    });
+
+
+	Ngg.Views.Chosen								= Backbone.View.extend({
+		tagName: 'span',
+
+		initialize: function(){
+			this.collection = this.options.collection;
+			if (!this.options.multiple) this.options.include_blank = true;
+			this.select_tag = new Ngg.Views.SelectTag(this.options);
+			this.collection.on('change', this.selection_changed, this);
+		},
+
+		selection_changed: function(e){
+			if (_.isUndefined(e.changed['selected'])) this.render();
+		},
+
+		render: function(){
+
+			this.$el.append(this.select_tag.render().$el);
+			if (this.options.width)
+				this.select_tag.$el.width(this.options.width);
+
+			// Configure select2 options
+			this.select2_opts = {
+				placeholder: this.options.placeholder
+			};
+
+			// Create the select2 drop-down
+			if (this.$el.parent().length == 0) {
+				$('body').append(this.$el);
+				this.select_tag.$el.select2(this.select2_opts);
+				var container = this.select_tag.$el.select2('container').detach();
+				this.$el.append(container);
+				this.$el.detach();
+
+			}
+			else this.select_tag.$el.select2(this.select2_opts);
+
+			// Hack for multi-select elements
+			if (this.options.multiple && this.collection.selected().length == 0)
+				this.select_tag.$el.select2('val', '');
+
+			// For IE, ensure that the text field has a width
+			this.$el.find('.select2-input').width(this.options.width-20);
+
+			// For IE8, ensure that the selection is being displayed
+			if (!this.options.multiple) {
+				var selected_value = this.$el.find('.select2-choice span:first');
+				if (selected_value.text().length == 0 && this.collection.selected().length > 0) {
+					var selected_item = this.collection.selected().pop();
+					selected_value.text(selected_item.get(this.select_tag.text_field));
+				}
+			}
+			else {
+				var selected_values = this.$el.find('.select2-search-choice');
+				if (this.collection.selected().length > 0 && selected_values.length == 0) {
+					this.select_tag.$el.select2('val', '');
+					var data = [];
+					var value_field = this.select_tag.value_field;
+					_.each(this.collection.selected(), function(item){
+						var value = value_field == 'id' ? item.id : item.get(value_field);
+						data.push({
+							id: 	value,
+							text: 	item.get(this.select_tag.text_field)
+						});
+					}, this);
+					this.select_tag.$el.select2('data', data);
+				}
+			}
+
+			return this;
+		}
+	});
+
+    /*****************************************************************************
+     ** DISPLAY TAB DEFINITION
+    ***/
+
+    /**
+     * Setup a namespace
+    **/
+    Ngg.DisplayTab = {
+        Models: {},
+        Views: {},
+        App: {}
+    };
+
+    /*****************************************************************************
+     * MODEL CLASSES
+    **/
+
+	/**
+	 * A collection that can fetch it's entities from the server
+	**/
+	Ngg.Models.Remote_Collection			= Ngg.Models.SelectableItems.extend({
+		fetch_limit: 5000,
+		in_progress: false,
+		fetch_url:   photocrati_ajax.url,
+		action: 	 '',
+		extra_data:  {},
+
+		_create_request: function(limit, offset) {
+			var request = <?php echo $sec_token?>;
+			request = _.extend(request, {
+				action: this.action,
+				limit: limit ? limit : this.fetch_limit,
+				offset: offset ? offset : 0
+
+			});
+			for (var index in this.extra_data) {
+				var value = this.extra_data[index];
+				if (typeof(request[index]) == 'undefined') {
+					request[index] = {};
+				}
+				if (typeof(value['toJSON']) != 'undefined') {
+					value = value.toJSON();
+				}
+				request[index] = _.extend(request[index], value);
+			}
+			return request;
+		},
+
+		_add_item: function(item) {
+			this.push(item);
+		},
+
+		fetch: 	function(limit, offset){
+			// Request the entities from the server
+			var self = this;
+			this.in_progress = true;
+			$.post(this.fetch_url, this._create_request(limit, offset), function(response){
+				if (!_.isObject(response)) response = JSON.parse(response);
+
+				if (response.items) {
+					_.each(response.items, function(item){
+						self._add_item(item);
+					});
+
+					// Continue fetching ?
+					if (response.total >= response.limit+response.offset) {
+						self.fetch(response.limit, response.offset+response.limit);
+					}
+					else {
+						self.in_progress = false;
+						self.trigger('finished_fetching');
+					}
+				}
+			});
+		}
+	});
+
+
+    /**
+     * Ngg.DisplayTab.Models.Displayed_Gallery
+     * Represents the displayed gallery being edited or created by the Display Tab
+    **/
+    Ngg.DisplayTab.Models.Displayed_Gallery        = Backbone.Model.extend({
+        defaults: {
+            source: null,
+            container_ids: [],
+            entity_ids: [],
+            display_type: null,
+            display_settings: {},
+            exclusions: [],
+            sortorder: [],
+            slug: null
+        }
+    });
+
+    /**
+     * Ngg.DisplayTab.Models.Source
+     * Represents an individual source used to collect displayable entities from
+    **/
+    Ngg.DisplayTab.Models.Source                = Backbone.Model.extend({
+		idAttribute: 'name',
+        defaults: {
+            title: '',
+			name: '',
+            selected: false
+        }
+    });
+
+    /**
+     * Ngg.DisplayTab.Models.Source_Collection
+     * Used as a collection of all the available sources for entities
+    **/
+    Ngg.DisplayTab.Models.Source_Collection        = Ngg.Models.SelectableItems.extend({
+        model: Ngg.DisplayTab.Models.Source,
+
+		selected_value: function(){
+			var retval = null;
+			var selected = this.selected();
+			if (selected.length > 0) {
+				retval = selected[0].get('name');
+			}
+			return retval;
+		}
+    });
+
+    /**
+     * Ngg.DisplayTab.Models.Gallery
+     * Represents an individual gallery entity
+    **/
+    Ngg.DisplayTab.Models.Gallery                = Backbone.Model.extend({
+		idAttribute: '<?php echo $gallery_primary_key ?>',
+        defaults: {
+            title:     '',
+            name:   ''
+        }
+    });
+
+    /**
+     * Ngg.DisplayTab.Models.Gallery_Collection
+     * Collection of gallery objects
+    **/
+    Ngg.DisplayTab.Models.Gallery_Collection    = Ngg.Models.Remote_Collection.extend({
+        model: Ngg.DisplayTab.Models.Gallery,
+
+		action: 'get_existing_galleries'
+    });
+
+    /**
+     * Ngg.DisplayTab.Models.Album
+     * Represents an individual Album object
+    **/
+    Ngg.DisplayTab.Models.Album                    = Backbone.Model.extend({
+        defaults: {
+            title: '',
+            name:  ''
+        }
+    });
+
+    /**
+     * Ngg.DisplayTab.Models.Album_Collection
+     * Used as a collection of album objects
+    **/
+    Ngg.DisplayTab.Models.Album_Collection        = Ngg.Models.Remote_Collection.extend({
+        model: Ngg.DisplayTab.Models.Album,
+
+		action: 'get_existing_albums'
+    });
+
+    /**
+     * Ngg.DisplayTab.Models.Tag
+     * Represents an individual tag object
+    **/
+    Ngg.DisplayTab.Models.Tag                    = Backbone.Model.extend({
+        defaults: {
+            title: ''
+        }
+    });
+
+    /**
+     * Ngg.DisplayTab.Models.Tag_Collection
+     * Represents a collection of tag objects
+    **/
+    Ngg.DisplayTab.Models.Tag_Collection        = Ngg.Models.Remote_Collection.extend({
+        model: Ngg.DisplayTab.Models.Tag,
+        /*
+		selected_ids: function(){
+			return this.selected().map(function(item){
+				return item.get('name');
+			});
+		},
+        */
+
+		action: 'get_existing_image_tags'
+    });
+
+	/**
+	 * Ngg.DisplayTab.Models.Display_Type
+	 * Represents an individual display type
+	**/
+	Ngg.DisplayTab.Models.Display_Type			= Backbone.Model.extend({
+		idAttribute: 'name',
+		defaults: {
+			title: ''
+		},
+
+		is_compatible_with_source: function(source){
+			var success = true;
+			for (index in source.get('returns')) {
+				var returned_entity_type = source.get('returns')[index];
+				if (_.indexOf(this.get('entity_types'), returned_entity_type) < 0) {
+					success = false;
+					break;
+				}
+			}
+			return success;
+		}
+	});
+
+	/**
+	 * Ngg.DisplayTab.Models.Display_Type_Collection
+	 * Represents a collection of display type objects
+	**/
+	Ngg.DisplayTab.Models.Display_Type_Collection = Ngg.Models.SelectableItems.extend({
+		model: Ngg.DisplayTab.Models.Display_Type,
+
+		selected_value: function(){
+			var retval = null;
+			var selected = this.selected();
+			if (selected.length > 0) {
+				return selected[0].get('name');
+			}
+			return retval;
+		}
+	});
+
+	/**
+	 * Ngg.DisplayTab.Models.Entity
+	 * Represents an entity to display on the front-end
+	**/
+	Ngg.DisplayTab.Models.Entity				= Backbone.Model.extend({
+		entity_id: function(){
+			return this.get(this.get('id_field'));
+		},
+
+		is_excluded: function() {
+			current_value = this.get('exclude');
+			if (_.isUndefined(current_value)) return false;
+			else if (_.isBoolean(current_value)) return current_value;
+			else return parseInt(current_value) == 0 ? false : true;
+		},
+
+		is_included: function(){
+			return !this.is_excluded();
+		},
+
+		is_gallery: function(){
+			retval = false;
+			if (this.get('is_gallery') == true) retval = true;
+			return retval;
+		},
+
+		is_album: function(){
+			retval = false;
+			if (this.get('is_album') == true) retval = true;
+			return retval;
+		},
+
+		is_image: function(){
+			return !this.is_album() && !this.is_gallery();
+		},
+
+		alttext: function(){
+			if (this.is_image()) {
+				return this.get('alttext');
+			}
+			else if (this.is_gallery()) {
+				return this.get('title');
+			}
+			else if (this.is_album()) {
+				return this.get('name');
+			}
+		}
+	});
+
+	/**
+	 * Ngg.DisplayTab.Models.Entity_Collection
+	 * Represents a collection of entities
+	**/
+	Ngg.DisplayTab.Models.Entity_Collection		= Ngg.Models.Remote_Collection.extend({
+		model: Ngg.DisplayTab.Models.Entity,
+
+		action: 'get_displayed_gallery_entities',
+
+		_add_item: function(item){
+			item.exclude = parseInt(item.exclude) == 1 ? true : false;
+			item.is_gallery = parseInt(item.is_gallery) == 1 ? true : false;
+			item.is_album = parseInt(item.is_album) == 1 ? true : false;
+			this.push(item);
+		},
+
+		entity_ids: function(){
+			return this.map(function(item){
+				return item.entity_id();
+			});
+		},
+
+		included_ids: function(){
+			return _.compact(this.map(function(item){
+				if (item.is_included()) return item.entity_id();
+			}));
+		},
+
+        excluded_ids: function() {
+            return _.compact(this.map(function(item) {
+                if (!item.is_included()) {
+                    return item.entity_id();
+                }
+            }));
+        }
+	});
+
+
+	Ngg.DisplayTab.Models.SortOrder				= Backbone.Model.extend({
+	});
+
+	Ngg.DisplayTab.Models.SortOrder_Options		= Ngg.Models.SelectableItems.extend({
+		model: Ngg.DisplayTab.Models.SortOrder
+	});
+	Ngg.DisplayTab.Models.SortDirection			= Backbone.Model.extend({
+
+	});
+	Ngg.DisplayTab.Models.SortDirection_Options = Backbone.Collection.extend({
+		model: Ngg.DisplayTab.Models.SortDirection
+	});
+
+     Ngg.DisplayTab.Models.Slug = Backbone.Model.extend({});
+
+    /*****************************************************************************
+     * VIEW CLASSES
+    **/
+
+    /**
+     * Ngg.DisplayTab.Views.Source_Config
+     * Used to populate the source configuration tab
+    **/
+    Ngg.DisplayTab.Views.Source_Config             = Backbone.View.extend({
+        el: '#source_configuration',
+
+        selected_view: null,
+
+        /**
+         * Bind to the "sources" collection to know when a selection has been made
+         * and determine what sub-view to render
+        **/
+        initialize: function(){
+            this.sources = Ngg.DisplayTab.instance.sources;
+            this.sources.on('selected', this.render, this);
+            _.bindAll(this, 'render');
+            this.render();
+        },
+
+        render: function(){
+			var chosen = new Ngg.Views.Chosen({
+				id: 'source_select',
+				collection: this.sources,
+				placeholder: 'Select a source',
+				width: 500
+			});
+
+            this.$el.html('<tr><td><label>Sources</label></td><td id="source_column"></td></tr>');
+            this.$el.find('#source_column').append(chosen.render().el);
+
+            var selected = this.sources.selected();
+			if (selected.length) {
+				var view_name = _.str.capitalize(selected.pop().id)+"Source";
+				if (typeof(Ngg.DisplayTab.Views[view_name]) != 'undefined') {
+				   var selected_view = new Ngg.DisplayTab.Views[view_name];
+				   this.$el.append(selected_view.render().el);
+				}
+			}
+
+            return this;
+        }
+    });
+
+    Ngg.DisplayTab.Views.Slug_Config = Backbone.View.extend({
+        el: '#slug_configuration',
+
+        selected_view: null,
+
+        initialize: function() {
+            this.displayed_gallery = Ngg.DisplayTab.instance.displayed_gallery;
+            this.slug = Ngg.DisplayTab.instance.displayed_gallery.get('slug');
+            this.render();
+        },
+
+        render: function() {
+            var self = this;
+
+            var input = $('<input>').prop({
+                type: 'text',
+                name: 'slug',
+                value: this.slug,
+                placeholder: '(optional)',
+                id: 'field_slug'
+            });
+
+            input.change(function() {
+                self.displayed_gallery.set('slug', $(this).val());
+            });
+
+            var tooltip = 'Sets an SEO-friendly name to this gallery for URLs. Currently only in use by the Pro Lightbox.';
+            this.$el.append('<tr><td id="slug_label"><label for="field_slug" class="tooltip" title="' + tooltip + '">Slug</label></td><td id="slug_column"></td></tr>');
+            this.$el.find('#slug_column').append(input);
+
+            return this;
+        }
+    });
+
+	Ngg.DisplayTab.Views.Display_Type_Selector = Backbone.View.extend({
+		el: '#display_type_selector',
+
+		initialize: function(){
+			this.display_types	= Ngg.DisplayTab.instance.display_types;
+			this.display_type_order_base	= Ngg.DisplayTab.instance.display_type_order_base;
+			this.display_type_order_step	= Ngg.DisplayTab.instance.display_type_order_step;
+			this.sources		= Ngg.DisplayTab.instance.sources;
+			this.render();
+		},
+
+		selection_changed: function(value){
+			var selected_type = null;
+			this.display_types.each(function(item){
+				if (item.get('name') == value) {
+					selected_type = item;
+					item.set('selected', true);
+				}
+				else {
+					item.set('selected', false);
+				}
+			});
+
+			if (selected_type) {
+				var selected_source = this.sources.selected_value();
+				var default_source = selected_type.get('default_source');
+
+				// If the default source isn't selected, then select it
+				if (default_source && selected_source != default_source) {
+
+					// Get the default source object by name
+					default_source = this.sources.where({
+						name: default_source
+					});
+
+					// Does the default source exist ?
+					if (default_source.length > 0) {
+						default_source = default_source[0];
+						this.sources.deselect_all();
+						this.sources.select(default_source.id);
+					}
+				}
+			}
+
+			$('.display_settings_form').each(function(){
+				$this = $(this);
+				if ($this.attr('rel') == value) $this.removeClass('hidden');
+				else $this.addClass('hidden');
+			});
+		},
+
+		render: function(){
+			var selected_source = this.sources.selected();
+			var current_step = 0;
+			selected_source = selected_source.length > 0 ? selected_source[0] : false;
+			this.$el.empty();
+			
+			var order_base = this.display_type_order_base;
+			var order_step = this.display_type_order_step;
+			
+			this.display_types.each(function(item){
+				if (selected_source && !item.is_compatible_with_source(selected_source)) {
+
+				    // Show all display types if we're viewing the display type
+					// selector tab
+					var display_tab =  $('#display_type_tab_content:visible');
+					if (display_tab.length == 0) return;
+					else if (display_tab.css('visibility') == 'hidden') return;
+				}
+				var display_type = new this.DisplayType;
+				display_type.model = item;
+				display_type.on('selected', this.selection_changed, this);
+				if (!this.display_types.selected_value()) {
+					item.set('selected', true);
+					this.selection_changed(item.id);
+				}
+				var display_order = item.get('view_order');
+				if (!display_order)
+					display_order = order_base;
+				var display_step = Math.floor(display_order / order_step);
+				if (current_step > 0 && display_step > current_step) {
+					this.$el.append('<li class="clear" style="height: 10px" />');
+				}
+				current_step = display_step;
+				this.$el.append(display_type.render().el);
+			}, this);
+			return this;
+		},
+
+		DisplayType: Backbone.View.extend({
+			className: 'display_type_preview',
+
+			events: {
+				click: 'clicked'
+			},
+
+			clicked: function(e){
+				this.trigger('selected', this.model.get('name'));
+			},
+
+			render: function() {
+				// Create all elements
+				var image_container = $('<div/>').addClass('image_container');
+				var img = $('<img/>').attr({
+					src: photocrati_ajax.wp_site_static_url + '/' + this.model.get('preview_image_relpath'),
+					title: this.model.get('title'),
+					alt: this.model.get('alt')
+				});
+				var inner_div = $('<div/>');
+				var radio_button = $('<input/>').prop({
+ 					type: 'radio',
+					value: this.model.get('name'),
+					title: this.model.get('title'),
+					name: 'display_type',
+					checked: this.model.get('selected')
+				});
+				image_container.append(inner_div);
+				image_container.append(img);
+				inner_div.append(radio_button);
+				inner_div.append(this.model.get('title'));
+				this.$el.append(image_container);
+				return this;
+			}
+		})
+	});
+
+	Ngg.DisplayTab.Views.Preview_Area = Backbone.View.extend({
+		el: '#preview_area',
+
+		initialize: function(){
+			this.entities			= Ngg.DisplayTab.instance.entities;
+			this.sources			= Ngg.DisplayTab.instance.sources;
+			this.displayed_gallery	= Ngg.DisplayTab.instance.displayed_gallery;
+
+			// Create the entity list
+			this.entity_list		= $('<ul/>').attr('id', 'entity_list').append('<li class="clear"/>');
+
+			// When an entity is added/removed to the collection, we'll add/remove it on the DOM
+			this.entities.on('add', this.render_entity, this);
+			this.entities.on('remove', this.remove_entity, this);
+
+			// When the collection is reset, we add a list item to clear the float. This is important -
+			// jQuery sortable() will break without the cleared element.
+			this.entities.on('reset', this.entities_reset, this);
+
+			// When jQuery sortable() is finished sorting, we need to adjust the order of models in the collection
+			this.entities.on('change:sortorder', function(model){
+				this.entities.remove(model, {silent: true});
+				this.entities.add(model, {at: model.changed.sortorder, silent: true});
+				this.displayed_gallery.set('sortorder', this.entities.entity_ids());
+				this.displayed_gallery.set('order_by', 'sortorder');
+			}, this);
+
+			// Reset when the source changes
+			this.sources.on('selected', this.render, this);
+
+			this.render();
+		},
+
+		events: {
+			opened: 'entities_reset'
+		},
+
+		entities_reset: function(e){
+			this.entities.reset(null, {silent: true});
+			this.entity_list.empty().append('<li class="clear"/>');
+			if (!this.entities.in_progress) this.entities.fetch();
+		},
+
+		render_entity: function(model){
+			var entity_element = new this.EntityElement({model: model});
+			this.entity_list.find('.clear').before(entity_element.render().$el);
+			entity_element.$el.css('visibility', 'hidden');
+			setTimeout(function(){
+				entity_element.$el.css('visibility', 'visible');
+			}, 0);
+			if (this.$el.find('.no_entities').length == 1) {
+				this.render();
+			}
+			else if (this.entities.length > 1) {
+				this.entity_list.sortable('refresh');
+			}
+		},
+
+		remove_entity: function(model){
+			var id = this.id = model.get('id_field')+'_'+model.entity_id();
+			var entity = this.entity_list.find('#'+id).remove();
+			this.entity_list.sortable('refresh');
+			if (this.entities.length == 0) {
+				this.render_no_images_notice();
+			}
+		},
+
+		render_no_images_notice: function(){
+			this.$el.empty();
+			this.$el.append("<p class='no_entities'>No entities to display for this source.</p>");
+		},
+
+		render: function(){
+			this.$el.empty();
+			if (this.entities.length > 0 && this.displayed_gallery.get('container_ids').length > 0) {
+
+				// Render header rows
+				this.$el.append(new this.RefreshButton({
+					entities: this.entities
+				}).render().el);
+				this.$el.append(new this.SortButtons({
+					entities: this.entities,
+					displayed_gallery: this.displayed_gallery,
+					sources: this.sources
+				}).render().el);
+				this.$el.append(new this.ExcludeButtons({
+					entities: this.entities
+				}).render().el);
+
+				this.$el.append(this.entity_list);
+
+				// Activate jQuery Sortable for the entity list
+				this.entity_list.sortable({
+					placeholder: 'placeholder',
+					forcePlaceholderSize: true,
+					containment: 'parent',
+					opacity: 0.7,
+					revert: true,
+					dropOnEmpty: true,
+					start: function(e, ui){
+						ui.placeholder.css({
+							height: ui.item.height()
+						});
+						return true;
+					},
+					stop: function(e, ui) {
+						ui.item.trigger('drop', ui.item.index());
+					}
+				});
+				this.entity_list.disableSelection();
+			}
+			else {
+				this.render_no_images_notice();
+			}
+			return this;
+		},
+
+		RefreshButton: Backbone.View.extend({
+			className: 'refresh_button',
+
+			tagName: 'input',
+
+			label: 'Refresh',
+
+			events: {
+				click: 'clicked'
+			},
+
+			clicked: function(){
+				this.entities.reset();
+			},
+
+			initialize: function(){
+				_.each(this.options, function(value, key){
+					this[key] = value;
+				}, this);
+			},
+
+			render: function(){
+				this.$el.attr({
+					value: this.label,
+					type:  'button'
+				});
+				return this;
+			}
+		}),
+
+		ExcludeButtons: Backbone.View.extend({
+			className: 'header_row',
+
+			initialize: function(){
+				_.each(this.options, function(value, key){
+					this[key] = value;
+				}, this);
+			},
+
+			render: function(){
+				this.$el.empty();
+				this.$el.append('<strong>Exclude:</strong>');
+				var all_button = new this.Button({
+					value: true,
+					text: 'All',
+					entities: this.entities
+				});
+				this.$el.append(all_button.render().el);
+				this.$el.append('<span class="separator">|</span>');
+				var none_button = new this.Button({
+					value: false,
+					text: 'None',
+					entities: this.entities
+				});
+				this.$el.append(none_button.render().el);
+				return this;
+			},
+
+			Button: Backbone.View.extend({
+				tagName: 'a',
+
+				value: 1,
+
+				text: '',
+
+				events: {
+					click: 'clicked'
+				},
+
+				initialize: function(){
+					_.each(this.options, function(value, key){
+						this[key] = value;
+					}, this);
+				},
+
+				clicked: function(e){
+					e.preventDefault();
+					this.entities.each(function(item){
+						item.set('exclude', this.value);
+					}, this);
+				},
+
+				render: function(){
+					this.$el.text(this.text).attr('href', '#');
+					return this;
+				}
+			})
+		}),
+
+		SortButtons: Backbone.View.extend({
+			className: 'header_row',
+
+			initialize: 		function(){
+				_.each(this.options, function(value, key){
+					this[key] = value;
+				}, this);
+				this.sortorder_options = new Ngg.DisplayTab.Models.SortOrder_Options();
+				this.sortorder_options.on('change:selected', this.sortoption_changed, this);
+
+				// Create sort directions and listen for selection changes
+				this.sortdirection_options = new Ngg.DisplayTab.Models.SortDirection_Options([
+					{
+						value: 'ASC',
+						title: 'Ascending',
+						selected: this.displayed_gallery.get('order_direction') == 'ASC'
+					},
+					{
+						value: 'DESC',
+						title: 'Descending',
+						selected: this.displayed_gallery.get('order_direction') == 'DESC'
+					}
+				]);
+				this.sortdirection_options.on('change:selected', this.sortdirection_changed, this);
+			},
+
+			populate_sorting_fields: function(){
+				// We display difference sorting buttons depending on what type of entities we're dealing with.
+				var entity_types = this.sources.selected().pop().get('returns');
+				if (_.indexOf(entity_types, 'image') !== -1) {
+					this.fill_image_sortorder_options();
+				}
+				else {
+					this.fill_gallery_sortorder_options();
+				}
+			},
+
+			create_sortorder_option: function(name, title){
+				return new Ngg.DisplayTab.Models.SortOrder({
+					name: name,
+					title: title,
+					value: name,
+					selected: this.displayed_gallery.get('order_by') == name
+				});
+			},
+
+			fill_image_sortorder_options: function(){
+				this.sortorder_options.reset();
+				this.sortorder_options.push(this.create_sortorder_option('', 'None'));
+				this.sortorder_options.push(this.create_sortorder_option('sortorder', 'Custom'));
+				this.sortorder_options.push(this.create_sortorder_option(Ngg.DisplayTab.instance.image_key, 'Image ID'));
+				this.sortorder_options.push(this.create_sortorder_option('filename', 'Filename'));
+				this.sortorder_options.push(this.create_sortorder_option('alttext', 'Alt/Title Text'));
+				this.sortorder_options.push(this.create_sortorder_option('imagedate', 'Date/Time'));
+			},
+
+			fill_gallery_sortorder_options: function(){
+				this.sortorder_options.reset();
+				this.sortorder_options.push(this.create_sortorder_option('', 'None'));
+				this.sortorder_options.push(this.create_sortorder_option('sortorder' ,'Custom'));
+				this.sortorder_options.push(this.create_sortorder_option('name', 'Name'));
+				this.sortorder_options.push(this.create_sortorder_option('galdesc', 'Description'));
+			},
+
+			sortoption_changed: function(model){
+				this.sortorder_options.each(function(item){
+					item.set('selected', model.get('value') == item.get('value') ? true : false, {silent: true});
+				});
+
+				this.displayed_gallery.set('sortorder', []);
+
+				var sort_by = model.get('value');
+
+				// If "None" was selected, then clear the "sortorder" property
+				if (model.get('value').length == 0) {
+					sort_by = 'sortorder';
+				}
+
+				// Change the "sort by" parameter
+				this.displayed_gallery.set('order_by', sort_by);
+
+				this.entities.reset();
+				this.$el.find('a.sortorder').each(function(){
+					var $item = $(this);
+					if ($item.attr('value') == model.get('value'))
+						$item.addClass('selected');
+					else
+						$item.removeClass('selected');
+				});
+			},
+
+			sortdirection_changed: function(model){
+
+				this.sortdirection_options.each(function(item){
+					item.set('selected', model.get('value') == item.get('value') ? true : false, {silent: true});
+				});
+				this.displayed_gallery.set('order_direction', model.get('value'));
+				this.entities.reset();
+				this.$el.find('a.sortdirection').each(function(){
+					var $item = $(this);
+					if ($item.attr('value') == model.get('value'))
+						$item.addClass('selected');
+					else
+						$item.removeClass('selected');
+				});
+			},
+
+			render: function(){
+				this.$el.empty();
+				this.populate_sorting_fields();
+				this.$el.append('<strong>Sort By:</strong>');
+				this.sortorder_options.each(function(item, index){
+					var button = new this.Button({model: item, className: 'sortorder'});
+					this.$el.append(button.render().el);
+					if (this.sortorder_options.length-1 > index) {
+						this.$el.append('<span class="separator">|</span>');
+					}
+				}, this);
+				this.$el.append('<strong style="margin-left: 30px;">Order By:</strong>');
+				this.sortdirection_options.each(function(item, index){
+					var button = new this.Button({model: item, className: 'sortdirection'});
+					this.$el.append(button.render().el);
+					if (this.sortdirection_options.length-1 > index) {
+						this.$el.append('<span class="separator">|</span>');
+					}
+				}, this);
+				return this;
+			},
+
+			Button: Backbone.View.extend({
+				tagName: 'a',
+
+				initialize: function(){
+					_.each(this.options, function(value, key){
+						this[key] = value;
+					}, this);
+				},
+
+				events: {
+					click: 'clicked'
+				},
+
+				clicked: function(e){
+					e.preventDefault();
+					this.model.set('selected', true);
+				},
+
+				render: function(){
+					this.$el.prop({
+						value: this.model.get('value'),
+						href: '#'
+					});
+					this.$el.text(this.model.get('title'));
+					if (this.model.get('selected')) this.$el.addClass('selected');
+					return this;
+				}
+			})
+		}),
+
+		// Individual entity in the preview area
+		EntityElement: Backbone.View.extend({
+			tagName: 'li',
+
+			events: {
+				drop: 'item_dropped'
+			},
+
+			initialize: function(){
+				_.each(this.options, function(value, key){
+					this[key] = value;
+				}, this);
+				this.model.on('change', this.render, this);
+				this.id = this.model.get('id_field')+'_'+this.model.entity_id()
+			},
+
+			item_dropped: function(e, index){
+				this.model.set('sortorder', index);
+			},
+
+			render: function(){
+				this.$el.empty();
+				var image_container = $('<div/>').addClass('image_container');
+				var alt_text = this.model.alttext().replace(/\\&/g, '&').replace(/\\'/g, "'");
+				var timestamp = new Date().getTime();
+				image_container.attr({
+					title: alt_text,
+					style: "background-image: url('"+this.model.get('thumb_url')+"?timestamp"+timestamp+"')"
+				}).css({
+					width:			this.model.get('max_width'),
+					height:			this.model.get('max_height'),
+					'max-width':	this.model.get('max_width'),
+					'max-height':	this.model.get('max_height')
+				});
+
+				this.$el.append(image_container).addClass('ui-state-default');
+
+				// Add exclude checkbox
+				var exclude_container = $('<div/>').addClass('exclude_container');
+				exclude_container.append('Exclude?');
+				var exclude_checkbox = new this.ExcludeCheckbox({model: this.model});
+				exclude_container.append(exclude_checkbox.render().el);
+				image_container.append(exclude_container);
+				return this;
+			},
+
+			ExcludeCheckbox: Backbone.View.extend({
+				tagName: 'input',
+
+				events: {
+					'change': 'entity_excluded'
+				},
+
+				type_set: false,
+
+				entity_excluded: function(e){
+					this.model.set('exclude', e.target.checked);
+				},
+
+				initialize: function(){
+					_.each(this.options, function(value, key){
+						this[key] = value;
+					}, this);
+					this.model.on('change:exclude', this.render, this);
+				},
+
+				render: function(){
+					if (!this.type_set) {
+						this.$el.attr('type', 'checkbox');
+						this.type_set = true;
+					}
+					if (this.model.is_excluded()) this.$el.prop('checked', true);
+					else this.$el.prop('checked', false);
+					return this;
+				}
+			})
+		})
+	});
+
+
+	// Additional source configuration views. These will be rendered dynamically by PHP.
+	// Adapters will add them.
+	Ngg.DisplayTab.Views.GalleriesSource = Backbone.View.extend({
+		tagName: 'tbody',
+
+		initialize: function(){
+			this.galleries = Ngg.DisplayTab.instance.galleries;
+		},
+
+		render: function(){
+			var select = new Ngg.Views.Chosen({
+				collection: this.galleries,
+				placeholder: 'Select a gallery',
+				multiple: true,
+				width: 500
+			});
+			var html = $('<tr><td><label>Galleries</label></td><td class="galleries_column"></td></tr>');
+			this.$el.empty();
+			this.$el.append(html);
+			this.$el.find('.galleries_column').append(select.render().el);
+			return this;
+		}
+	});
+
+	Ngg.DisplayTab.Views.AlbumsSource = Backbone.View.extend({
+		tagName: 'tbody',
+
+		initialize: function(){
+			this.albums 	= Ngg.DisplayTab.instance.albums;
+		},
+
+		render: function(){
+			var album_select = new Ngg.Views.Chosen({
+				collection: this.albums,
+				multiple: true,
+				placeholder: 'Select an album',
+				text_field: 'name',
+				width: 500
+			});
+			this.$el.empty();
+			this.$el.append('<tr><td><label>Albums</label></td><td class="albums_column"></td></tr>');
+			this.$el.find('.albums_column').append(album_select.render().el);
+			return this;
+		}
+	});
+
+	Ngg.DisplayTab.Views.TagsSource = Backbone.View.extend({
+		tagName: 'tbody',
+
+		initialize: function(){
+			this.tags	= Ngg.DisplayTab.instance.tags;
+		},
+
+		render: function(){
+			var tag_select = new Ngg.Views.Chosen({
+				collection: this.tags,
+				multiple: true,
+				placeholder: 'Select a tag',
+				text_field: 'name',
+				width: 500
+			});
+			this.$el.empty();
+			this.$el.append('<tr><td><label>Tags</label></td><td class="tags_column"></td></tr>');
+			this.$el.find('.tags_column').append(tag_select.render().el);
+			return this;
+		}
+	});
+
+	Ngg.DisplayTab.Views.Recent_imagesSource = Backbone.View.extend({
+		tagName: 'tbody',
+
+		initialize: function(){
+			this.displayed_gallery		= Ngg.DisplayTab.instance.displayed_gallery;
+			this.maximum_entity_count	= Ngg.DisplayTab.instance.displayed_gallery.get('maximum_entity_count');
+			this.displayed_gallery.set('container_ids', []);
+		},
+
+		render: function(){
+			var self = this;
+			var edit_field = $('<input/>').prop({
+				type: 'text',
+				value: this.maximum_entity_count,
+				name: 'maximum_entity_count'
+			});
+
+			edit_field.change(function () {
+				self.displayed_gallery.set('maximum_entity_count', $(this).val());
+			});
+
+			this.$el.empty();
+			this.$el.append('<tr><td><label># of Images To Display</label></td><td class="recent_images_column"></td></tr>');
+			this.$el.find('.recent_images_column').append(edit_field);
+			return this;
+		}
+	});
+
+	Ngg.DisplayTab.Views.Random_imagesSource = Backbone.View.extend({
+		tagName: 'tbody',
+
+		initialize: function(){
+			this.displayed_gallery		= Ngg.DisplayTab.instance.displayed_gallery;
+			this.maximum_entity_count	= Ngg.DisplayTab.instance.displayed_gallery.get('maximum_entity_count');
+			this.displayed_gallery.set('container_ids', []);
+		},
+
+		render: function(){
+			var self = this;
+			var edit_field = $('<input/>').prop({
+				type: 'text',
+				value: this.maximum_entity_count,
+				name: 'maximum_entity_count'
+			});
+
+			edit_field.change(function () {
+				self.displayed_gallery.set('maximum_entity_count', $(this).val());
+			});
+
+			this.$el.empty();
+			this.$el.append('<tr><td><label># of Images To Display</label></td><td class="random_images_column"></td></tr>');
+			this.$el.find('.random_images_column').append(edit_field);
+			return this;
+		}
+	});
+
+	Ngg.DisplayTab.Views.SaveButton = Backbone.View.extend({
+		el: '#save_displayed_gallery',
+
+		errors_el: '#errors',
+
+		displayed_gallery: null,
+
+		events: {
+			click: 'clicked'
+		},
+
+		initialize: function(){
+			this.displayed_gallery	= Ngg.DisplayTab.instance.displayed_gallery;
+			this.entities			= Ngg.DisplayTab.instance.entities;
+			this.render();
+		},
+
+		clicked: function(){
+			this.set_display_settings();
+			var request = <?php echo $sec_token?>;
+			request = _.extend(request, {
+				action: 'save_displayed_gallery',
+				displayed_gallery: this.displayed_gallery.toJSON()
+			});
+
+			var self = this;
+			$.post(photocrati_ajax.url, request, function(response){
+				if (!_.isObject(response)) response = JSON.parse(response);
+				if (response['validation_errors'] != undefined) {
+					$(self.errors_el).empty().append(response.validation_errors);
+				}
+				else if (response['error'] != undefined) {
+					alert(response.error);
+				}
+				else {
+					var id_field = response.displayed_gallery.id_field;
+					var id = response.displayed_gallery[id_field];
+					self.displayed_gallery.set('id', id);
+					var editor = parent.tinyMCE.activeEditor;
+					var preview_url = ngg_displayed_gallery_preview_url + '/id--'+id;
+					var snippet = "<img class='ngg_displayed_gallery mceItem' src='" + preview_url + "'/>";
+					if (editor.getContent().indexOf(preview_url) < 0)
+						editor.execCommand('mceInsertContent', false, snippet);
+					else {
+						$(editor.contentDocument).find(".ngg_displayed_gallery[src='"+preview_url+"']").attr('src', preview_url);
+					}
+					close_attach_to_post_window();
+				}
+			});
+		},
+
+		set_display_settings: function(){
+			var display_type = this.displayed_gallery.get('display_type');
+			if (display_type) {
+				// Collect display settings
+				var form = $("form[rel='"+display_type+"']");
+				var display_settings	= (function(item){
+					var obj = {};
+                    $.each(item.serializeArray(), function(key, item) {
+						var parts = item.name.split('[');
+						var current_obj = obj;
+						for (var i=0; i<parts.length; i++) {
+							var part = parts[i].replace(/\]$/, '');
+							if (!current_obj[part]) {
+								if (i == parts.length-1)
+									current_obj[part] = item.value;
+								else
+									current_obj[part] = {};
+							}
+							current_obj = current_obj[part];
+						}
+					});
+					return obj;
+				})(form);
+
+				// Set display settings for displayed gallery
+				this.displayed_gallery.set('display_settings', display_settings[display_type]);
+			}
+		},
+
+		render: function(){
+			return this;
+		}
+	});
+
+    /*****************************************************************************
+     * APPLICATION
+    **/
+    Ngg.DisplayTab.App = Backbone.View.extend({
+        /**
+         * Initializes the DisplayTab object
+        **/
+        initialize: function(){
+			// TODO: We're currently fetching ALL galleries, albums, and tags
+			// in one shot. Instead, we should display the displayed_gallery's
+			// containers, if there are any, otherwise get the first 100 or so.
+			// We can then use AJAX to fetch the rest of batches.
+            this.displayed_gallery = new Ngg.DisplayTab.Models.Displayed_Gallery(
+				<?php echo $displayed_gallery ?>
+			);
+
+			this.original_displayed_gallery = new Ngg.DisplayTab.Models.Displayed_Gallery(
+				<?php echo $displayed_gallery ?>
+			);
+            this.galleries = new Ngg.DisplayTab.Models.Gallery_Collection(
+				<?php echo $galleries ?>
+			);
+            this.albums = new Ngg.DisplayTab.Models.Album_Collection(
+				<?php echo $albums ?>
+			);
+            this.tags = new Ngg.DisplayTab.Models.Tag_Collection(
+				<?php echo $tags ?>
+			);
+            this.sources = new Ngg.DisplayTab.Models.Source_Collection(
+				<?php echo $sources ?>
+			)
+			this.display_types = new Ngg.DisplayTab.Models.Display_Type_Collection(
+				<?php echo $display_types ?>
+			);
+			this.display_type_order_base = <?php echo NEXTGEN_DISPLAY_PRIORITY_BASE; ?>;
+			this.display_type_order_step = <?php echo NEXTGEN_DISPLAY_PRIORITY_STEP; ?>;
+			this.entities = new Ngg.DisplayTab.Models.Entity_Collection();
+			this.entities.extra_data.displayed_gallery = this.displayed_gallery;
+
+			// Pre-select current displayed gallery values
+			if (this.displayed_gallery.get('source')) {
+
+				// Pre-select source
+				if (this.displayed_gallery.get('source')) {
+					var source = this.sources.find(function(item){
+						return item.get('name') == this.displayed_gallery.get('source');
+					}, this);
+					if (source) source.set('selected', true);
+				}
+
+				// Pre-select containers
+				if (this.displayed_gallery.get('container_ids')) {
+					_.each(this.displayed_gallery.get('container_ids'), function(id){
+						var container = this[this.displayed_gallery.get('source')].find(function(item){
+							return item.id == id;
+						}, this);
+						if (container) container.set('selected', true);
+					}, this);
+				}
+
+				// Pre-select display type
+				if (this.displayed_gallery.get('display_type')) {
+					var display_type = this.display_types.find(function(item){
+						return item.get('name') == this.displayed_gallery.get('display_type');
+					}, this);
+					if (display_type) display_type.set('selected', true);
+				}
+			}
+
+            // Bind to the 'selected' event for each of the collections, and update the displayed
+            // gallery object's 'container_ids' attribute when something has changed
+            collections = ['galleries', 'albums', 'tags'];
+            _.each(collections, function(collection){
+                this[collection].on('selected', function(){this.update_selected_containers(collection);}, this);
+            }, this);
+
+			// Bind to the 'selected' event for the display types collection, updating the displayed gallery
+			this.display_types.on('change:selected', function(){
+				this.displayed_gallery.set('display_type', this.display_types.selected_value());
+			}, this);
+
+			// Bind to the 'selected' event for the source, updating the displayed gallery
+			this.sources.on('selected', function(){
+				this.displayed_gallery.set('source', this.sources.selected_value());
+
+				// If the source changed, and it's not the set to the original value, then
+				// exclusions get's set to []
+				if (this.sources.selected_value() != this.original_displayed_gallery.get('source'))
+					this.displayed_gallery.set('exclusions', this.entities.excluded_ids());
+
+				// Otherwise, we revert to the original exclusions
+				else
+					this.displayed_gallery.set('exclusions', this.original_displayed_gallery.get('exclusions'));
+
+                // special exemption: these should default to a reasonable limit
+                if (this.sources.selected_value() == 'random_images' || this.sources.selected_value() == 'recent_images') {
+                    this.displayed_gallery.set('maximum_entity_count', 20);
+                }
+
+				// Reset everything else
+				this.galleries.deselect_all();
+				this.albums.deselect_all();
+				this.tags.deselect_all();
+
+				// If the selected source is incompatible with the current display type, then
+				// display a new list
+				var selected_display_type = this.display_types.selected();
+				var selected_source		  = this.sources.selected();
+				if (selected_display_type.length > 0 && selected_source.length > 0) {
+					selected_display_type = selected_display_type[0];
+					selected_source       = selected_source[0];
+					if (!selected_display_type.is_compatible_with_source(selected_source))
+						this.display_types.deselect_all();
+						if (this.display_type_selector) this.display_type_selector.render();
+				}
+				if (this.preview_area) this.preview_area.render();
+			}, this);
+
+			// Synchronize changes made to entities with the displayed gallery
+			this.entities.on('change:exclude finished_fetching', function(){
+				//this.displayed_gallery.set('sortorder', this.entities.entity_ids());
+				this.displayed_gallery.set('exclusions', this.entities.excluded_ids());
+			}, this);
+
+			// Monitor events in other tabs and respond as appropriate
+			if (window.Frame_Event_Publisher) {
+				var app = this;
+
+				// New gallery event
+				Frame_Event_Publisher.listen_for('attach_to_post:new_gallery', function(){
+					app.galleries.reset();
+					app.galleries.fetch();
+				});
+
+				// A change has been made using the "Manage Galleries" page
+				Frame_Event_Publisher.listen_for('attach_to_post:manage_galleries attach_to_post:manage_images', function(data){
+
+					// Refresh the list of galleries
+					app.galleries.reset();
+					app.galleries.fetch();
+
+					// If we're viewing galleries or images, then we need to refresh the entity list
+					var selected_source = app.sources.selected().pop();
+					if (selected_source) {
+						if (_.indexOf(selected_source.get('returns'), 'image') >= 0 ||
+							_.indexOf(selected_source.get('returns'), 'gallery')) {
+							app.entities.reset();
+						}
+					}
+				});
+
+				// A change has been made using the "Manage Albums" page
+				Frame_Event_Publisher.listen_for('attach_to_post:manage_album', function(data){
+					// Refresh the list of albums
+					app.albums.reset();
+					app.albums.fetch();
+
+					// If we're viewing albums, then we need to refresh the entity list
+					var selected_source = app.sources.selected().pop();
+					if (selected_source) {
+						if (_.indexOf(selected_source.get('returns'), 'album') >= 0) {
+							app.entities.reset();
+						}
+					}
+				});
+
+				// A change has been made using the "Manage Tags" page
+				Frame_Event_Publisher.listen_for('attach_to_post:manage_tags attach_to_post:manage_images', function(data){
+					// Refresh the list of tags
+					app.tags.reset();
+					app.tags.fetch();
+
+					// If we're viewing galleries or images, then we need to refresh the entity list
+					var selected_source = app.sources.selected().pop();
+					if (selected_source) {
+						if (_.indexOf(selected_source.get('returns'), 'image') >= 0 ||
+							_.indexOf(selected_source.get('returns'), 'gallery')) {
+							app.entities.reset();
+						}
+					}
+				});
+
+				// Thumbnail modified event
+				Frame_Event_Publisher.listen_for('attach_to_post:thumbnail_modified', function(data){
+					var selected_source = app.sources.selected().pop();
+					var image_id = data.image[data.image.id_field];
+
+					if (selected_source) {
+
+						// Does the currently selected source return images? If so,
+						// check refresh the modified image's thumbnail
+						if(_.indexOf(selected_source.get('returns'), 'image') >= 0) {
+							var image = app.entities.find(function(item){
+								return parseInt(item.entity_id()) == parseInt(image_id);
+							}, this);
+							if (image) image.set('thumb_url', data.image.thumb_url);
+						}
+
+						// It must be an album or gallery
+						else {
+							var entity = app.entities.find(function(item){
+								return parseInt(item.get('previewpic')) == image_id;
+							}, this);
+							if (entity) entity.trigger('change');
+						}
+					}
+				});
+			}
+        },
+
+        // Updates the selected container_ids for the displayed gallery
+        update_selected_containers: function(collection){
+			this.displayed_gallery.set('container_ids', this[collection].selected_ids());
+        },
+
+        render: function(){
+			this.display_type_selector = new Ngg.DisplayTab.Views.Display_Type_Selector();
+			new Ngg.DisplayTab.Views.Source_Config();
+            new Ngg.DisplayTab.Views.Slug_Config();
+			this.preview_area = new Ngg.DisplayTab.Views.Preview_Area();
+			new Ngg.DisplayTab.Views.SaveButton();
+        }
+    });
+    Ngg.DisplayTab.instance = new Ngg.DisplayTab.App();
+    Ngg.DisplayTab.instance.render();
+
+    // Invoke styling libraries
+    $('span.tooltip, label.tooltip').tooltip();
+});
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/display_tab_source.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/display_tab_source.php
new file mode 100644
index 0000000000000000000000000000000000000000..2a00bece7f1412ce34cb69154f48952a55c44ce9
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/display_tab_source.php
@@ -0,0 +1,2 @@
+<table id="source_configuration"></table>
+<table id='slug_configuration'></table>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/display_tab_type.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/display_tab_type.php
new file mode 100644
index 0000000000000000000000000000000000000000..32bf167b775de5f0ec84d58a24877e2aca9cf704
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/display_tab_type.php
@@ -0,0 +1,3 @@
+<div id="display_type_selector">
+	
+</div>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/no_display_type_selected.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/no_display_type_selected.php
new file mode 100644
index 0000000000000000000000000000000000000000..445f2fb651466aaa79e45aeedaa2c1db17873922
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/no_display_type_selected.php
@@ -0,0 +1,3 @@
+<p class="<?php echo esc_attr($css_class) ?>">
+	<?php echo_h($no_display_type_selected)?>
+</p>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/preview_tab.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/preview_tab.php
new file mode 100644
index 0000000000000000000000000000000000000000..47d94fc03ef5ee61616a7701d31c9462faf176d6
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/preview_tab.php
@@ -0,0 +1,3 @@
+<div id="preview_area">
+	
+</div>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/cache/class.cache.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/cache/class.cache.php
new file mode 100644
index 0000000000000000000000000000000000000000..85d03dfddb8e891ae49c5c92eb1d40c73ef1e5c4
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/cache/class.cache.php
@@ -0,0 +1,85 @@
+<?php
+
+class C_Cache extends C_Component
+{
+    public static $_instances = array();
+
+	function define($context = FALSE)
+	{
+		parent::define($context);
+		$this->add_mixin('Mixin_Cache');
+        $this->implement('I_Cache');
+	}
+
+    public static function get_instance($context = False)
+    {
+        if (!isset(self::$_instances[$context]))
+        {
+            self::$_instances[$context] = new C_Cache($context);
+        }
+        return self::$_instances[$context];
+    }
+}
+
+class Mixin_Cache extends Mixin
+{
+    /**
+     * Empties a directory of all of its content
+     *
+     * @param string $directory Absolute path
+     * @param bool $recursive Remove files from subdirectories of the cache
+     * @param string $regex (optional) Only remove files matching pattern; '/^.+\.png$/i' will match all .png
+     */
+    public function flush_directory($directory, $recursive = TRUE, $regex = NULL)
+    {
+        // It is possible that the cache directory has not been created yet
+        if (!is_dir($directory))
+        {
+            return;
+        }
+
+        if ($recursive)
+        {
+            $directory = new DirectoryIterator($directory);
+        }
+        else {
+            $directory = new RecursiveIteratorIterator(
+                new RecursiveDirectoryIterator($directory),
+                RecursiveIteratorIterator::CHILD_FIRST
+            );
+        }
+
+        if (!is_null($regex))
+        {
+            $iterator = RegexIterator($directory, $regex, RecursiveRegexIterator::GET_MATCH);
+        }
+        else {
+            $iterator = $directory;
+        }
+
+        foreach ($iterator as $file) {
+            if ($file->isFile() || $file->isLink()) {
+                unlink($file->getPathname());
+            }
+            elseif ($file->isDir() && !$file->isDot() && $recursive) {
+                rmdir($file->getPathname());
+            }
+        }
+    }
+
+    /**
+     * Flushes cache from all available galleries
+     *
+     * @param array $galleries When provided only the requested galleries' cache is flushed
+     */
+    public function flush_galleries($galleries = array())
+    {
+        if (empty($galleries))
+            $galleries = $this->object->get_registry()->get_utility('I_Gallery_Mapper')->find_all();
+
+        foreach ($galleries as $gallery) {
+            $this->object->get_registry()->get_utility('I_Gallery_Storage')->flush_cache($gallery);
+        }
+    }
+
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/cache/interface.cache.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/cache/interface.cache.php
new file mode 100644
index 0000000000000000000000000000000000000000..40340a81670b96ab1561031d9bbeee06d02b41e2
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/cache/interface.cache.php
@@ -0,0 +1,7 @@
+<?php
+
+interface I_Cache
+{
+	function flush_directory($directory, $recursive = TRUE, $regex = NULL);
+    function flush_galleries($galleries = array());
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/cache/module.cache.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/cache/module.cache.php
new file mode 100644
index 0000000000000000000000000000000000000000..f31fa81f82f0fc4737ca5f4022b1560c8b2f7414
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/cache/module.cache.php
@@ -0,0 +1,42 @@
+<?php
+/***
+{
+		Module: photocrati-cache
+}
+***/
+class M_Cache extends C_Base_Module
+{
+    /**
+     * Defines the module name & version
+     */
+    function define()
+	{
+		parent::define(
+			'photocrati-cache',
+			'Cache',
+			'Handles clearing of NextGen caches',
+			'0.1',
+			'http://www.nextgen-gallery.com',
+			'Photocrati Media',
+			'http://www.photocrati.com'
+		);
+	}
+
+    /**
+     * Register utilities
+     */
+    function _register_utilities()
+    {
+        $this->get_registry()->add_utility('I_Cache', 'C_Cache');
+    }
+
+    function get_type_list()
+    {
+        return array(
+            'C_Cache' => 'class.cache.php',
+            'I_Cache' => 'interface.cache.php'
+        );
+    }
+}
+
+new M_Cache();
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/README.txt b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/README.txt
new file mode 100644
index 0000000000000000000000000000000000000000..4b1f6eb0157cb9eb39121fce926298065ecfef36
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/README.txt
@@ -0,0 +1 @@
+See the datamapper unit tests for details about the API
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/adapter.datamapper_factory.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/adapter.datamapper_factory.php
new file mode 100644
index 0000000000000000000000000000000000000000..a9b40bbffa9d0f0925fbf7095e8d4891dcb13485
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/adapter.datamapper_factory.php
@@ -0,0 +1,24 @@
+<?php
+
+class A_DataMapper_Factory extends Mixin
+{
+	function datamapper_model($mapper, $properties=array(), $context=FALSE)
+	{
+		return new C_DataMapper_Model($mapper, $properties=array(), $context);
+	}
+
+	function datamapper($object_name, $context=FALSE)
+	{
+		return new C_DataMapper($object_name, $context);
+	}
+
+	function custom_table_datamapper($object_name, $context=FALSE)
+	{
+		return new C_CustomTable_DataMapper_Driver($object_name, $context);
+	}
+
+	function custom_post_datamapper($object_name, $context=FALSE)
+	{
+		return new C_CustomPost_DataMapper_Driver($object_name, $context);
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/class.custompost_datamapper_driver.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/class.custompost_datamapper_driver.php
new file mode 100644
index 0000000000000000000000000000000000000000..2d96435b8046a7b687426d32e8445f34a175f136
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/class.custompost_datamapper_driver.php
@@ -0,0 +1,547 @@
+<?php
+
+class Mixin_CustomPost_DataMapper_Driver extends Mixin
+{
+
+	/**
+	 * Returns a list of querable table columns for posts
+	 * @return array
+	 */
+	function _get_querable_table_columns()
+	{
+		return array('name', 'author', 'date', 'title', 'modified', 'menu_order', 'parent', 'ID', 'rand', 'comment_count');
+	}
+
+	/**
+	 * Used to select which fields should be returned. NOT currently used by
+	 * this implementation of the datamapper driver
+	 * @param type $fields
+	 * @return C_DataMapper_Driver_Base
+	 */
+	function select($fields='*')
+	{
+		$this->object->_query_args = array(
+			'post_type'		=> $this->object->get_object_name(),
+			'paged'			=> FALSE,
+			'fields'		=> $fields,
+			'post_status'	=> 'any',
+			'datamapper'	=>	TRUE,
+			'posts_per_page'=> -1,
+			'is_select'		=>	TRUE,
+			'is_delete'		=>	FALSE
+		);
+		return $this->object;
+	}
+
+
+	/**
+	 * Specifies an order clause
+	 * @param type $order_by
+	 * @param type $direction
+	 * @return C_DataMapper_Driver_Base
+	 */
+	function order_by($order_by, $direction='ASC')
+	{
+		// Make an exception for the rand() method
+		$order_by = preg_replace("/rand\(\s*\)/", 'rand', $order_by);
+
+		if (in_array($order_by, $this->object->_get_querable_table_columns())) {
+			$this->object->_query_args['orderby'] = $order_by;
+		}
+		else { // ordering by a meta value
+			$this->object->_query_args['orderby'] = 'meta_value';
+			$this->object->_query_args['meta_key'] = $order_by;
+		}
+		$this->object->_query_args['order'] = $direction;
+
+		return $this->object;
+	}
+
+	/**
+	 * Specifies a limit and optional offset
+	 * @param integer $max
+	 * @param integer $offset
+	 * @return C_DataMapper_Driver_Base
+	 */
+	function limit($max, $offset=FALSE)
+	{
+		if ($max) {
+			$this->object->_query_args['paged'] = TRUE;
+			$this->object->_query_args['offset'] = $offset;
+			$this->object->_query_args['posts_per_page'] = $max;
+		}
+
+		return $this->object;
+	}
+
+
+    /**
+     * Specifies a list of columns to group by
+     * @param array|string $columns
+     */
+    function group_by($columns=array())
+    {
+        if (!isset($this->object->_query_args['group_by_columns']))
+            $this->object->_query_args['group_by_columns'] = $columns;
+        else {
+            $this->object->_query_args['group_by_columns'] = array_merge(
+              $this->object->_query_args['group_by_columns'],
+              $columns
+            );
+        }
+
+        return $this->object;
+    }
+
+	/**
+	 * Adds a WP_Query where clause
+	 * @param array $where_clauses
+	 * @param string $join
+	 */
+	function _add_where_clause($where_clauses, $join)
+	{
+		foreach ($where_clauses as $clause) {
+			// $clause => array(
+			// 'column' => 'ID',
+			// 'value'  =>	1210,
+			// 'compare' => '='
+			// )
+
+			// Determine where what the where clause is comparing
+			switch($clause['column']) {
+				case 'author':
+			    case 'author_id':
+					$this->object->_query_args['author'] = $clause['value'];
+					break;
+				case 'author_name':
+					$this->object->_query_args['author_name'] = $clause['value'];
+					break;
+				case 'cat':
+				case 'cat_id':
+				case 'category_id':
+					switch($clause['compare']) {
+						case '=':
+						case 'BETWEEN';
+						case 'IN';
+							if (!isset($this->object->_query_args['category__in'])) {
+								$this->object->_query_args['category__in'] = array();
+							}
+							$this->object->_query_args['category__in'][] = $clause['value'];
+							break;
+						case '!=':
+						case 'NOT BETWEEN';
+						case 'NOT IN';
+							if (!isset($this->object->_query_args['category__not_in'])) {
+								$this->object->_query_args['category__not_in'] = array();
+							}
+							$this->object->_query_args['category__not_in'][] = $clause['value'];
+							break;
+					}
+					break;
+				case 'category_name':
+					$this->object->_query_args['category_name'] = $clause['value'];
+					break;
+				case 'post_id':
+				case $this->object->get_primary_key_column():
+					switch ($clause['compare']) {
+						case '=':
+						case 'IN';
+						case 'BETWEEN';
+							if (!isset($this->object->_query_args['post__in'])) {
+								$this->object->_query_args['post__in'] = array();
+							}
+							$this->object->_query_args['post__in'][] = $clause['value'];
+							break;
+						default:
+							if (!isset($this->object->_query_args['post__not_in'])) {
+								$this->object->_query_args['post__not_in'] = array();
+							}
+							$this->object->_query_args['post__not_in'][] = $clause['value'];
+							break;
+					}
+					break;
+				case 'pagename':
+				case 'postname':
+				case 'page_name':
+				case 'post_name':
+					if ($clause['compare'] == 'LIKE')
+						$this->object->_query_args['page_name__like'] = $clause['value'];
+					elseif ($clause['compare'] == '=')
+						$this->object->_query_args['pagename'] = $clause['value'];
+					elseif ($clause['compare'] == 'IN')
+						$this->object->_query_args['page_name__in'] = $clause['value'];
+					break;
+				case 'post_title':
+					// Post title uses custom WHERE clause
+					if ($clause['compare'] == 'LIKE')
+						$this->object->_query_args['post_title__like'] = $clause['value'];
+					else
+						$this->object->_query_args['post_title'] = $clause['value'];
+					break;
+				default:
+					// Must be metadata
+					$clause['key'] = $clause['column'];
+					unset($clause['column']);
+
+					// Convert values to array, when required
+					if (in_array($clause['compare'], array('IN', 'BETWEEN'))) {
+						$clause['value'] = explode(',', $clause['value']);
+						foreach ($clause['value'] as &$val) {
+							if (!is_numeric($val)) {
+
+								// In the _parse_where_clause() method, we
+								// quote the strings and add slashes
+								$val = stripslashes($val);
+								$val = substr($val, 1, strlen($val)-2);
+							}
+						}
+					}
+
+					if (!isset($this->object->_query_args['meta_query'])) {
+						$this->object->_query_args['meta_query'] = array();
+					}
+					$this->object->_query_args['meta_query'][] = $clause;
+					break;
+			}
+		}
+
+		// If any where clauses have been added, specify how the conditions
+		// will be conbined/joined
+		if (isset($this->object->_query_args['meta_query'])) {
+			$this->object->_query_args['meta_query']['relation'] = $join;
+		}
+
+	}
+
+
+	/**
+	 * Destroys/deletes an entity from the database
+	 * @param stdObject|C_DataMapper_Model $entity
+	 * @return type
+	 */
+	function destroy($entity, $skip_trash=TRUE)
+	{
+		$retval = FALSE;
+
+		$key = $this->object->get_primary_key_column();
+
+		// Find the id of the entity
+		if (is_object($entity) && isset($entity->$key)) {
+			$id = (int)$entity->$key;
+		}
+		else {
+			$id = (int)$entity;
+		}
+
+		// If we have an ID, then delete the post
+		if (is_integer($id)) {
+
+			// TODO: We assume that we can skip the trash. Is that correct?
+			// FYI, Deletes postmeta as wells
+			if (is_object(wp_delete_post($id, TRUE))) $retval = TRUE;
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Converts a post to an entity
+	 * @param \stdClass $post
+	 * @param boolean $model
+	 * @return \stdClass
+	 */
+	function convert_post_to_entity($post, $model=FALSE)
+	{
+
+		$entity = new stdClass();
+		foreach ($post as $key => $value) {
+			if ($key == 'post_content') {
+				$post_content = $this->object->unserialize($value);
+				if ($post_content) {
+					foreach ($post_content as $key2 => $value2) {
+						$entity->$key2 = $value2;
+					}
+				}
+			}
+			else $entity->$key = $value;
+		}
+        $this->object->_convert_to_entity($entity);
+		return $model? $this->object->convert_to_model($entity) : $entity;
+	}
+
+
+	/**
+	 * Converts an entity to a post
+	 * @param type $entity
+	 * @return type
+	 */
+	function _convert_entity_to_post($entity)
+	{
+		// Was a model passed instead of an entity?
+		$post = $entity;
+		if (!($entity instanceof stdClass)) $post = $entity->get_entity();
+
+		// Create the post content
+		unset($post->id_field);
+		unset($post->post_content_filtered);
+		unset($post->post_content);
+		$post->post_content = $this->object->serialize($post);
+		$post->post_content_filtered = $post->post_content;
+		$post->post_type = $this->object->get_object_name();
+
+		// Sometimes an entity can contain a data stored in an array or object
+		// Those will be removed from the post, and serialized in the
+		// post_content field
+		foreach ($post as $key => $value) {
+			if (in_array(strtolower(gettype($value)), array('object','array')))
+				unset($post->$key);
+		}
+
+		// A post required a title
+		if (!property_exists($post, 'post_title')) {
+			$post->post_title = $this->object->get_post_title($post);
+		}
+
+		// A post also requires an excerpt
+		if (!property_exists($post, 'post_excerpt')) {
+			$post->post_excerpt = $this->object->get_post_excerpt($post);
+		}
+
+		return $post;
+	}
+
+	/**
+	 * Returns the WordPress database class
+	 * @global wpdb $wpdb
+	 * @return wpdb
+	 */
+	function _wpdb()
+	{
+		global $wpdb;
+		return $wpdb;
+	}
+
+
+	/**
+	 * Flush and update all postmeta for a particular post
+	 * @param int $post_id
+	 */
+	function _flush_and_update_postmeta($post_id, $entity, $omit=array())
+	{
+		// We need to insert post meta data for each property
+		// Unfortunately, that means flushing all existing postmeta
+		// and then inserting new values. Depending on the number of
+		// properties, this could be slow. So, we directly access the database
+		/* @var $wpdb wpdb */
+		global $wpdb;
+		if (!is_array($omit)) $omit = array($omit);
+		$wpdb->query($wpdb->prepare("DELETE FROM {$wpdb->postmeta} WHERE post_id = %s", $post_id));
+		$sql_parts = array();
+		foreach($entity as $key => $value) {
+			if (in_array($key, $omit)) continue;
+			if (is_array($value) or is_object($value)) {
+				$value = $this->object->serialize($value);
+			}
+			$sql_parts[] = $wpdb->prepare("(%s, %s, %s)", $post_id, $key, $value);
+		}
+		$wpdb->query("INSERT INTO {$wpdb->postmeta} (post_id, meta_key, meta_value) VALUES ".implode(',', $sql_parts));
+	}
+
+
+	/**
+	 * Saves an entity to the database
+	 * @param stdObject $entity
+	 */
+	function _save_entity($entity)
+	{
+        $post = $this->object->_convert_entity_to_post($entity);
+		$primary_key = $this->object->get_primary_key_column();
+
+		if (($post_id = wp_insert_post($post))) {
+
+			$new_entity = $this->object->find($post_id, TRUE);
+			foreach ($new_entity->get_entity() as $key => $value) $entity->$key = $value;
+
+			// Save properties as post meta
+			$this->object->_flush_and_update_postmeta(
+				$post_id,
+				$entity instanceof stdClass ? $entity : $entity->get_entity()
+			);
+		}
+
+		$entity->id_field = $primary_key;
+
+		return $post_id;
+	}
+
+
+	/**
+	 * Determines whether the current statement is SELECT
+	 * @return boolean
+	 */
+	function is_select_statement()
+	{
+		return isset($this->object->_query_args['is_select']) && $this->object->_query_args['is_select'];
+	}
+
+
+	/**
+	 * Determines whether the current statement is DELETE
+	 * @return type
+	 */
+	function is_delete_statement()
+	{
+		return isset($this->object->_query_args['is_delete']) && $this->object->_query_args['is_delete'];
+	}
+
+
+	/**
+	 * Starts a new DELETE statement
+	 */
+	function delete()
+	{
+		$this->object->select();
+		$this->object->_query_args['is_select'] = FALSE;
+		$this->object->_query_args['is_delete'] = TRUE;
+		return $this->object;
+	}
+
+
+	/**
+	 * Runs the query
+	 * @param  string $sql optionally run the specified query
+	 * @return array
+	 */
+	function run_query($sql=FALSE, $model=FALSE)
+	{
+		$retval = array();
+
+		if ($sql)
+        {
+			$this->object->_query_args['cache_results'] = FALSE;
+			$this->object->_query_args['custom_sql'] = $sql;
+		}
+
+		// Execute the query
+		$query = new WP_Query();
+		$query->query_vars = $this->object->_query_args;
+		add_action('pre_get_posts', array(&$this, 'set_query_args'), PHP_INT_MAX-1, 1);
+		foreach ($query->get_posts() as $row) {
+			$row = $this->object->convert_post_to_entity($this->scrub_result($row), $model);
+			if (!$model)
+                $row->id_field = $this->object->get_primary_key_column();
+			$retval[] = $row;
+		}
+		remove_action('pre_get_posts', array(&$this, 'set_query_args'), PHP_INT_MAX-1, 1);
+
+		return $retval;
+	}
+
+	/**
+	 * Ensure that the query args are set. We need to do this in case a third-party
+	 * plugin overrides our query
+	 * @param $query
+	 */
+	function set_query_args($query)
+	{
+		if ($query->get('datamapper')) $query->query_vars = $this->object->_query_args;
+	}
+
+		/**
+	 * Fetches the last row
+	 * @param array $conditions
+	 * @return C_DataMapper_Entity
+	 */
+	function find_last($conditions=array(), $model=FALSE)
+	{
+		$retval = NULL;
+
+		// Get row number for the last row
+		$table_name = $this->object->_clean_column($this->object->get_table_name());
+		$object_name = $this->object->_clean_column($this->object->get_object_name());
+		$sql = $this->_wpdb()->prepare("SELECT COUNT(*) FROM {$table_name} WHERE post_type = %s", $object_name);
+		$count = $this->_wpdb()->get_var($sql);
+		$offset = $count-1;
+		$results = $this->select()->where_and($conditions)->limit(1, $offset)->run_query();
+		if ($results) {
+			$retval = $model? $this->object->convert_to_model($results[0]) : $results[0];
+		}
+
+		return $retval;
+	}
+
+
+
+	/**
+	 * Returns the number of total records/entities that exist
+	 * @return int
+	 */
+	function count()
+	{
+		$retval = 0;
+
+		global $wpdb;
+		$key = $this->object->get_primary_key_column();
+		$sql = $wpdb->prepare(
+			"SELECT COUNT({$key}) FROM {$wpdb->posts} WHERE post_type = %s",
+			$this->object->get_object_name()
+		);
+		$results = $this->object->run_query($sql);
+		if ($results && isset($results[0]->$key))
+			$retval = (int)$results[0]->$key;
+
+		return $retval;
+	}
+
+
+	/**
+	 * Returns the title of the post. Used when post_title is not set
+	 * @param stdClass $entity
+	 * @return string
+	 */
+	function get_post_title($entity)
+	{
+		return "Untitled {$this->object->get_object_name()}";
+	}
+
+	/**
+	 * Returns the excerpt of the post. Used when post_excerpt is not set
+	 * @param stdClass $entity
+	 * @return string
+	 */
+	function get_post_excerpt($entity)
+	{
+		return '';
+	}
+}
+
+class C_CustomPost_DataMapper_Driver extends C_DataMapper_Driver_Base
+{
+	var $_query_args = array();
+	var $_primary_key_column = 'ID';
+
+	function define($object_name, $context=FALSE)
+	{
+		parent::define($object_name, $context);
+		$this->add_mixin('Mixin_CustomPost_DataMapper_Driver');
+		$this->implement('I_CustomPost_DataMapper');
+	}
+
+	function initialize($object_name)
+	{
+		if (strlen($object_name) > 20) throw new Exception("The custom post name can be no longer than 20 characters long");
+		parent::initialize($object_name);
+	}
+
+
+	/**
+	 * Gets the name of the table
+	 * @global string $table_prefix
+	 * @return string
+	 */
+	function get_table_name()
+	{
+		global $table_prefix;
+		return $table_prefix.'posts';
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/class.customtable_datamapper_driver.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/class.customtable_datamapper_driver.php
new file mode 100644
index 0000000000000000000000000000000000000000..39d50d59ad28b23f54be92a74659c4fbccefc732
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/class.customtable_datamapper_driver.php
@@ -0,0 +1,486 @@
+<?php
+
+class C_CustomTable_DataMapper_Driver_Mixin extends Mixin
+{
+	/**
+	 * Gets the name of the primary key column
+	 * @return string
+	 */
+	function get_primary_key_column()
+	{
+		return $this->object->_primary_key_column;
+	}
+
+
+	/**
+	 * Selects which fields to collect from the table.
+	 * NOTE: Not protected from SQL injection - DO NOT let your users
+	 * specify DB columns
+	 * @param string $fields
+	 */
+	function select($fields='*')
+	{
+		// Create a fresh slate
+		$this->object->_init();
+		$this->object->_select_clause = "SELECT {$fields}";
+
+		return $this->object;
+	}
+
+	/**
+	 * Determines whether we're going to execute a SELECT statement
+	 * @return boolean
+	 */
+	function is_select_statement()
+	{
+		return ($this->object->_select_clause) ? TRUE : FALSE;
+	}
+
+	/**
+	 * Determines if we're going to be executing a DELETE statement
+	 * @return type
+	 */
+	function is_delete_statement()
+	{
+		return $this->object->_delete_clause ? TRUE : FALSE;
+	}
+
+
+	/**
+	 * Start a delete statement
+	 */
+	function delete()
+	{
+		// Create a fresh slate
+		$this->object->_init();
+		$this->object->_delete_clause = "DELETE";
+		return $this->object;
+	}
+
+
+	/**
+	 * Orders the results of the query
+	 * This method may be used multiple of times to order by more than column
+	 * @param $order_by
+	 * @param $direction
+	 */
+	function order_by($order_by, $direction='ASC')
+	{
+		// We treat the rand() function as an exception
+		if (preg_match("/rand\(\s*\)/", $order_by)) {
+			$order = 'rand()';
+		}
+		else {
+			$order_by	= $this->object->_clean_column($order_by);
+
+			// If the order by clause is a column, then it should be backticked
+			if ($this->object->has_column($order_by)) $order_by = "`{$order_by}`";
+
+			$direction	= $this->object->_clean_column($direction);
+			$order		= "{$order_by} {$direction}";
+		}
+
+		$this->object->_order_clauses[] = $order;
+
+		return $this->object;
+	}
+
+	/**
+	 * Specifies a limit and optional offset
+	 * @param integer $max
+	 * @param integer $offset
+	 */
+	function limit($max, $offset=0)
+	{
+		if ($offset)
+			$limit = $this->_wpdb()->prepare("LIMIT %d, %d",$offset,$max);
+		else
+			$limit = $this->_wpdb()->prepare("LIMIT %d", $max);
+		if ($limit) $this->object->_limit_clause = $limit;
+
+		return $this->object;
+	}
+
+
+    /**
+     * Specifics a group by clause for one or more columns
+     * @param array|string $columns
+     */
+    function group_by($columns=array())
+    {
+        if (!is_array($columns)) $columns = array($columns);
+        $this->object->_group_by_columns = array_merge($this->object->_group_by_columns, $columns);
+        return $this->object;
+    }
+
+
+	/**
+	 * Adds a where clause to the driver
+	 * @param array $where_clauses
+	 * @param string $join
+	 */
+	function _add_where_clause($where_clauses, $join)
+	{
+		$clauses = array();
+
+		foreach ($where_clauses as $clause) {
+			extract($clause);
+			if ($this->object->has_column($column)) $column = "`{$column}`";
+			if (!is_array($value)) $value = array($value);
+			foreach ($value as $index => $v) {
+				$v = $clause['type'] == 'numeric' ? $v : "'{$v}'";
+				$value[$index] = $v;
+			}
+			if ($compare == 'BETWEEN') {
+				$value = "{$value[0]} AND {$value[1]}";
+			}
+			else {
+				$value = implode(', ', $value);
+				if (strpos($compare, 'IN') !== FALSE) $value = "({$value})";
+			}
+
+			$clauses[] = "{$column} {$compare} {$value}";
+		}
+
+		$this->object->_where_clauses[] = implode(" {$join} ", $clauses);
+	}
+
+
+	/**
+	 * Returns the total number of entities known
+	 * @return type
+	 */
+	function count()
+	{
+		$retval = 0;
+
+		$key = $this->object->get_primary_key_column();
+		$results = $this->object->run_query(
+			"SELECT COUNT(`{$key}`) AS `{$key}` FROM `{$this->object->get_table_name()}`"
+		);
+		if ($results && isset($results[0]->$key))
+			$retval = (int)$results[0]->$key;
+
+		return $retval;
+	}
+
+	/**
+	 * Returns the generated SQL query to be executed
+	 * @return string
+	 */
+	function get_generated_query()
+	{
+		$sql = array();
+
+		if	   ($this->object->is_select_statement()) $sql[] = $this->object->_select_clause;
+		elseif ($this->object->is_delete_statement()) $sql[] = $this->object->_delete_clause;
+		$sql[] = 'FROM `'.$this->object->get_table_name().'`';
+		$where_clauses = array();
+		foreach ($this->object->_where_clauses as $where) {
+			$where_clauses[] = '('.$where.')';
+		}
+		if ($where_clauses) $sql[] = 'WHERE '.implode(' AND ', $where_clauses);
+
+		if ($this->object->is_select_statement()) {
+			if ($this->object->_order_clauses) $sql[] = 'ORDER BY '.implode(', ', $this->object->_order_clauses);
+			if ($this->object->_group_by_columns) $sql[] = 'GROUP BY '.implode(', ', $this->object->_group_by_columns);
+			if ($this->object->_limit_clause) $sql[] = $this->object->_limit_clause;
+		}
+		return implode(' ', $sql);
+	}
+
+
+	/**
+	 * Run the query
+	 * @param $sql optionally run the specified SQL insteads
+	 * return
+	 */
+	function run_query($sql=FALSE, $no_entities=FALSE)
+	{
+		$retval = array();
+
+		// Or generate SQL query
+		if (!$sql)
+            $sql = $this->object->get_generated_query();
+
+		// If we have a SQL statement to execute, then heck, execute it!
+		if ($sql)
+        {
+            if ($this->object->debug)
+                var_dump($sql);
+
+			$this->_wpdb()->query($sql);
+
+			if ($this->_wpdb()->last_result)
+            {
+				$retval = array();
+				// For each row, create an entity, update it's properties, and add it to the result set
+				if ($no_entities)
+                {
+                    $retval = $this->_wpdb()->last_result;
+                }
+				else {
+                    foreach ($this->_wpdb()->last_result as $row) {
+                        $retval[] = $this->_convert_to_entity($this->scrub_result($row));
+                    }
+                }
+			}
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Stores the entity
+	 * @param stdClass $entity
+	 */
+	function _save_entity($entity)
+	{
+		$retval = FALSE;
+
+		unset($entity->id_field);
+		$primary_key = $this->object->get_primary_key_column();
+		if (isset($entity->$primary_key)) {
+			if($this->object->_update($entity)) $retval = intval($entity->$primary_key);
+		}
+		else {
+			$retval = $this->object->_create($entity);
+			if ($retval) {
+				$new_entity = $this->object->find($retval);
+				foreach ($new_entity as $key => $value) $entity->$key = $value;
+			}
+		}
+		$entity->id_field = $primary_key;
+
+		return $retval;
+	}
+
+	/**
+	 * Converts an entity to something suitable for inserting into
+	 * a database column
+	 * @param stdObject $entity
+	 * @return array
+	 */
+	function _convert_to_table_data($entity)
+	{
+		$data = (array) $entity;
+		foreach ($data as $key => $value) {
+			if (is_array($value)) $data[$key] = $this->object->serialize($value);
+		}
+
+		return $data;
+	}
+
+
+	/**
+	 * Destroys/deletes an entity
+	 * @param stdObject|C_DataMapper_Model|int $entity
+	 * @return boolean
+	 */
+	function destroy($entity)
+	{
+		$retval = FALSE;
+		$key = $this->object->get_primary_key_column();
+
+		// Find the id of the entity
+		if (is_object($entity) && isset($entity->$key)) {
+			$id = (int)$entity->$key;
+		}
+		else {
+			$id = (int)$entity;
+		}
+
+		// If we have an ID, then delete the post
+		if (is_numeric($id)) {
+			$sql = $this->object->_wpdb()->prepare(
+		      "DELETE FROM `{$this->object->get_table_name()}` WHERE {$key} = %s",
+			  $id
+			);
+			$retval = $this->object->_wpdb()->query($sql);
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Creates a new record in the database
+	 * @param stdObject $entity
+	 * @return boolean
+	 */
+	function _create($entity)
+	{
+		$retval = FALSE;
+		$id =  $this->object->_wpdb()->insert(
+			$this->object->get_table_name(),
+			$this->object->_convert_to_table_data($entity)
+		);
+		if ($id) {
+			$key = $this->object->get_primary_key_column();
+			$retval = $entity->$key = intval($this->object->_wpdb()->insert_id);
+		}
+		return $retval;
+	}
+
+
+	/**
+	 * Updates a record in the database
+	 * @param stdObject $entity
+	 */
+	function _update($entity)
+	{
+		$key = $this->object->get_primary_key_column();
+
+		return $this->object->_wpdb()->update(
+			$this->object->get_table_name(),
+			$this->object->_convert_to_table_data($entity),
+			array($key => $entity->$key)
+		);
+	}
+
+
+	/**
+	 * Fetches the last row
+	 * @param array $conditions
+	 * @return C_DataMapper_Entity
+	 */
+	function find_last($conditions=array(), $model=FALSE)
+	{
+		$retval = NULL;
+
+		// Get row number for the last row
+		$table_name = $this->object->_clean_column($this->object->get_table_name());
+		$count = $this->_wpdb()->get_var("SELECT COUNT(*) FROM `{$table_name}`");
+		$offset = $count-1;
+		$results = $this->select()->where_and($conditions)->limit(1, $offset)->run_query();
+		if ($results) {
+			$retval = $model? $this->object->convert_to_model($results[0]) : $results[0];
+		}
+
+		return $retval;
+	}
+
+
+	/**
+	 * Looks up using SQL the columns existing in the database
+	 */
+	function lookup_columns()
+	{
+		$this->object->_columns = array();
+		$sql = "SHOW COLUMNS FROM `{$this->object->get_table_name()}`";
+		foreach ($this->object->run_query($sql, TRUE) as $row) {
+			$this->object->_columns[] = $row->Field;
+		}
+		return $this->object->_columns;
+	}
+
+	/**
+	 * Determines whether a column is present for the table
+	 * @param string $column_name
+	 * @return string
+	 */
+	function has_column($column_name)
+	{
+		if (empty($this->object->_columns)) $this->object->lookup_columns();
+		return array_search($column_name, $this->object->_columns);
+	}
+
+	/**
+	 * Defines a column for this table
+	 * @param string $column_name
+	 * @param string $datatype
+	 */
+	function define_column($column_name, $datatype)
+	{
+		$this->object->_defined_columns[$column_name] = $datatype;
+	}
+
+	function add_column($column_name, $datatype=FALSE)
+	{
+		// If no datatype was specified, perhaps the column was already defined
+		if (!$datatype && isset($this->object->_defined_columns[$column_name])) {
+			$datatype = $this->object->_defined_columns[$column_name];
+		}
+
+		// Ensure that we have a datatype before continuing...
+		if ($datatype) {
+			$sql = "ALTER TABLE `{$this->get_table_name()}` ADD COLUMN ``{$column_name}` {$datatype}";
+			$this->object->run_query($sql);
+		}
+
+		$this->object->lookup_columns();
+	}
+
+	/**
+	 * Migrates the schema of the database
+	 */
+	function migrate()
+	{
+		if (empty($this->object->_columns)) $this->object->lookup_columns();
+		foreach ($this->object->_columns as $column_name) {
+			if (!$this->object->has_column($column_name)) {
+				$this->object->add_column($column_name);
+			}
+		}
+	}
+
+
+	function _init()
+	{
+		$this->object->_where_clauses = array();
+		$this->object->_order_clauses = array();
+        $this->object->_group_by_columns = array();
+		$this->object->_limit_clause = '';
+		$this->object->_select_clause = '';
+	}
+}
+
+class C_CustomTable_DataMapper_Driver extends C_DataMapper_Driver_Base
+{
+	/**
+	 * The WordPress Database Connection
+	 * @var wpdb
+	 */
+	var $_where_clauses = array();
+	var $_order_clauses = array();
+    var $_group_by_columns = array();
+	var $_limit_clause = '';
+	var $_select_clause = '';
+	var $_delete_clause = '';
+	var $_columns = array();
+	var $_defined_columns = array();
+
+	function define($object_name, $context=FALSE)
+	{
+		parent::define($context);
+		$this->add_mixin('C_CustomTable_DataMapper_Driver_Mixin');
+		$this->implement('I_CustomTable_DataMapper');
+	}
+
+	function initialize($object_name)
+	{
+		parent::initialize($object_name);
+		if (!isset($this->_primary_key_column))
+			$this->_primary_key_column = $this->_lookup_primary_key_column();
+	}
+
+	/**
+	 * Returns the database connection object for WordPress
+	 * @global wpdb $wpdb
+	 * @return wpdb
+	 */
+	function _wpdb()
+	{
+		global $wpdb;
+		return $wpdb;
+	}
+
+	/**
+	 * Looks up the primary key column for this table
+	 */
+	function _lookup_primary_key_column()
+	{
+		$key = $this->_wpdb()->get_row("SHOW INDEX FROM {$this->get_table_name()} WHERE Key_name='PRIMARY'", ARRAY_A);
+		if (!$key) throw new Exception("Please specify the primary key for {$this->get_table_name ()}");
+		return $key['Column_name'];
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/class.datamapper_driver_base.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/class.datamapper_driver_base.php
new file mode 100644
index 0000000000000000000000000000000000000000..635b61dafe47766e1ac54923109211db39f49af9
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/class.datamapper_driver_base.php
@@ -0,0 +1,609 @@
+<?php
+
+/**
+ * Thrown when an entity does not exist
+ */
+class E_EntityNotFoundException extends RuntimeException
+{
+
+}
+
+/**
+ * Thrown when an invalid data type is used as an entity, such as an associative
+ * array which is not yet supported due to a problem with references and the
+ * call_user_func_array() function.
+ */
+class E_InvalidEntityException extends RuntimeException
+{
+	function __construct($message_or_previous=FALSE, $code=0, $previous=NULL)
+	{
+		// We don't know if we have been passed a message yet or not
+		$message = FALSE;
+
+		// Determine if the first parameter is a string or exception
+		if ($message_or_previous) {
+			if (is_string($message_or_previous))
+				$message = $message_or_previous;
+			else {
+				$previous = $message_or_previous;
+			}
+		}
+
+		// If no message was provided, create a default message
+		if (!$message) {
+			$message =  "Invalid data type used for entity. Please use stdClass
+				or a subclass of C_DataMapper_Model. Arrays will be supported in
+				the future.";
+		}
+		parent::__construct($message, $code);
+	}
+}
+
+
+class Mixin_DataMapper_Driver_Base extends Mixin
+{
+	/**
+	 * Used to clean column or table names in a SQL query
+	 * @param string $val
+	 * @return string
+	 */
+	function _clean_column($val)
+	{
+		return str_replace(
+			array(';', "'", '"', '`'),
+			array(''),
+			$val
+		);
+	}
+
+	/**
+	 * Serializes the data
+	 * @param mixed $value
+	 * @return string
+	 */
+	function serialize($value)
+	{
+		//Using json_encode here because PHP's serialize is not Unicode safe
+		return base64_encode(json_encode($value));
+	}
+
+
+	/**
+	 * Unserializes data using our proprietary format
+	 * @param string $value
+	 * @return mixed
+	 */
+	function unserialize($value)
+	{
+		$retval = NULL;
+		if (is_string($value))
+		{
+			$retval = stripcslashes($value);
+
+			if (strlen($value) > 1)
+			{
+				//Using json_decode here because PHP's unserialize is not Unicode safe
+				$retval = json_decode(base64_decode($retval), TRUE);
+
+				// JSON Decoding failed. Perhaps it's PHP serialized data?
+				if ($retval === NULL) {
+					$er = error_reporting(0);
+					$retval = unserialize($value);
+					error_reporting($er);
+				}
+			}
+		}
+
+		return $retval;
+	}
+
+
+	/**
+	 * Finds a partiular entry by id
+	 * @param int|stdClass|C_DataMapper_Model $entity
+	 * @return C_DataMapper_Entity
+	 */
+	function find($entity, $model=FALSE)
+	{
+        $retval = NULL;
+
+        // Get primary key of the entity
+		$pkey = $this->object->get_primary_key_column();
+		if (!is_numeric($entity)) {
+            $entity = isset($entity->$pkey) ? intval($entity->$pkey) : FALSE;
+        }
+
+        // If we have an entity ID, then get the record
+        if ($entity) {
+            $results = $this->object->select()->where_and(
+                array("{$pkey} = %d", $entity)
+            )->limit(1,0)->run_query();
+
+            if ($results) $retval = $model ? $this->object->convert_to_model($results[0]) :  $results[0];
+        }
+
+        return $retval;
+	}
+
+	/**
+	 * Fetches the first row
+	 * @param array $conditions
+	 * @return C_DataMapper_Entity
+	 */
+	function find_first($conditions=array(), $model=FALSE)
+	{
+		$results = $this->object->select()->where_and($conditions)->limit(1,0)->run_query();
+		if ($results)
+			return $model? $this->object->convert_to_model($results[0]) : $results[0];
+		else
+			return NULL;
+	}
+
+
+	/**
+	 * Queries all rows
+	 * @param array $conditions
+	 * @return array
+	 */
+	function find_all($conditions=array(), $model=FALSE)
+	{
+		// Sometimes users will forget that the first parameter is conditions, and think it's $model instead
+		if ($conditions === TRUE)
+        {
+			$conditions = array();
+			$model = TRUE;
+		}
+
+        if ($conditions === FALSE)
+        {
+            $conditions = array();
+            $model = FALSE;
+        }
+
+		$results = $this->object->select()->where_and($conditions)->run_query();
+		if ($results && $model)
+        {
+			foreach ($results as &$r) {
+				$r = $this->object->convert_to_model($r);
+			}
+		}
+
+        return $results;
+	}
+
+
+	/**
+	 * Filters the query using conditions:
+	 * E.g.
+	 *		array("post_title = %s", "Foo")
+	 *		array(
+	 *			array("post_title = %s", "Foo"),
+	 *
+	 *		)
+	 */
+	function where_and($conditions=array())
+	{
+		return $this->object->_where($conditions, 'AND');
+	}
+
+	function where_or($conditions=array())
+	{
+		return $this->object->where($conditions, 'OR');
+	}
+
+
+	function where($conditions=array())
+	{
+		return $this->object->_where($conditions, 'AND');
+	}
+
+
+	/** Parses the where clauses
+	 * They could look like the following:
+	 *
+	 * array(
+	 *  "post_id = 1"
+	 *  array("post_id = %d", 1),
+	 * )
+	 *
+	 * or simply "post_id = 1"
+	 * @param array|string $conditions
+	 * @param string $operator
+	 * @return ExtensibleObject
+	 */
+	function _where($conditions=array(), $operator)
+	{
+		$where_clauses = array();
+
+		// If conditions is not an array, make it one
+		if (!is_array($conditions)) $conditions = array($conditions);
+		elseif (!empty($conditions) && !is_array($conditions[0])) {
+			// Just a single condition was passed, but with a bind
+			$conditions = array($conditions);
+		}
+
+		// Iterate through each condition
+		foreach ($conditions as $condition) {
+			if (is_string($condition)) {
+				$clause = $this->object->_parse_where_clause($condition);
+				if ($clause) $where_clauses[] = $clause;
+			}
+			else {
+				$clause = array_shift($condition);
+				$clause = $this->object->_parse_where_clause($clause, $condition);
+				if ($clause) $where_clauses[] = $clause;
+			}
+		}
+
+		// Add where clause to query
+		if ($where_clauses) $this->object->_add_where_clause($where_clauses, $operator);
+
+		return $this->object;
+	}
+
+	/**
+	 * Parses a where clause and returns an associative array
+	 * representing the query
+	 *
+	 * E.g. parse_where_clause("post_title = %s", "Foo Bar")
+	 *
+	 * @global wpdb $wpdb
+	 * @param string $condition
+	 * @return array
+	 */
+	function _parse_where_clause($condition)
+	{
+		$column = '';
+		$operator = '';
+		$value = '';
+		$numeric = TRUE;
+
+		// Substitute any placeholders
+		global $wpdb;
+		$binds = func_get_args();
+		$binds = $binds[1]; // first argument is the condition
+		foreach ($binds as &$bind) {
+
+			// A bind could be an array, used for the 'IN' operator
+			// or a simple scalar value. We need to convert arrays
+			// into scalar values
+			if (is_object($bind))
+                $bind = (array)$bind;
+
+			if (is_array($bind) && !empty($bind)) {
+				foreach ($bind as &$val) {
+					if (!is_numeric($val)) {
+						$val = '"'.addslashes($val).'"';
+						$numeric = FALSE;
+					}
+				}
+				$bind = implode(',', $bind);
+			}
+            else if (is_array($bind) && empty($bind)) {
+                $bind = 'NULL';
+            }
+			else if(!is_numeric($bind)) {
+                $numeric = FALSE;
+            }
+		}
+		$condition = $wpdb->prepare($condition, $binds);
+
+		// Parse the where clause
+		if (preg_match("/^[^\s]+/", $condition, $match)) {
+			$column = trim(array_shift($match));
+			$condition = str_replace($column, '', $condition);
+		}
+
+		if (preg_match("/(NOT )?IN|(NOT )?LIKE|(NOT )?BETWEEN|[=!<>]+/i", $condition, $match)) {
+			$operator = trim(array_shift($match));
+			$condition = str_replace($operator, '', $condition);
+			$operator = strtolower($operator);
+			$value = trim($condition);
+		}
+
+		// Values will automatically be quoted, so remove them
+		// If the value is part of an IN clause or BETWEEN clause and
+		// has multiple values, we attempt to split the values apart into an
+		// array and iterate over them individually
+		if ($operator == 'in') {
+			$values = preg_split("/'?\s?(,)\s?'?/i", $value);
+		}
+		elseif ($operator == 'between') {
+			$values = preg_split("/'?\s?(AND)\s?'?/i", $value);
+		}
+
+		// If there's a single value, treat it as an array so that we
+		// can still iterate
+		if (empty($values)) $values = array($value);
+		foreach ($values as $index => $value) {
+			$value = preg_replace("/^(\()?'/", '', $value);
+			$value = preg_replace("/'(\))?$/", '', $value);
+			$values[$index] = $value;
+		}
+		if (count($values)>1) $value = $values;
+
+		// Return the WP Query meta query parameters
+		$retval = array(
+			'column'	=> $column,
+			'value'		=> $value,
+			'compare'	=> strtoupper($operator),
+			'type'		=> $numeric ? 'numeric' : 'string',
+		);
+
+		return $retval;
+	}
+
+	/**
+	 * Converts a stdObject to an Entity
+	 * @param stdObject $stdObject
+	 * @return stdObject
+	 */
+	function _convert_to_entity($stdObject)
+	{
+		// Add name of the id_field to the entity, and convert
+		// the ID to an integer
+		$stdObject->id_field = $key = $this->object->get_primary_key_column();
+		if (isset($stdObject->$key)) {
+			$stdObject->$key = (int) $stdObject->$key;
+		}
+
+		// Set defaults for this entity
+		$this->object->set_defaults($stdObject);
+
+		return $stdObject;
+	}
+
+	/**
+	 * Converts a stdObject entity to a model
+	 * @param stdObject $stdObject
+	 */
+	function convert_to_model($stdObject, $context=FALSE)
+	{
+		// Create a factory
+		$retval = NULL;
+
+		try {
+			$this->object->_convert_to_entity($stdObject);
+		}
+		catch (Exception $ex) {
+			throw new E_InvalidEntityException($ex);
+		}
+		$retval = $this->object->create($stdObject, $context);
+
+		return $retval;
+	}
+
+	/**
+	 * Creates a new model
+	 * @param stdClass|array $properties
+	 * @return C_DataMapper_Model
+	 */
+	function create($properties=array(), $context=FALSE)
+	{
+		$entity = $properties;
+		$factory = $this->object->get_registry()->get_utility('I_Component_Factory');
+		if (!is_object($properties)) {
+			$entity = new stdClass;
+			foreach ($properties as $k=>$v) $entity->$k = $v;
+		}
+		return $factory->create($this->object->get_model_factory_method(), $this->object, $entity, $context);
+	}
+
+
+	/**
+	 * Determines whether an object is actually a model
+	 * @param mixed $obj
+	 * @return bool
+	 */
+	function is_model($obj)
+	{
+		return is_subclass_of($obj, 'C_DataMapper_Model') or get_class($obj) == 'C_DataMapper_Model';
+	}
+
+	/**
+	 * Saves an entity
+	 * @param stdClass|C_DataMapper_Model $entity
+	 * @return bool
+	 */
+	function save($entity)
+	{
+		$retval = FALSE;
+		$model  = $entity;
+
+		// Attempt to use something else, most likely an associative array
+		// TODO: Support assocative arrays. The trick is to support references
+		// with dynamic calls using __call() and call_user_func_array().
+		if (is_array($entity)) throw new E_InvalidEntityException();
+
+		// We can work with what we have. But we need to ensure that we've got
+		// a model
+		elseif (!$this->object->is_model($entity)) {
+			$model = $this->object->convert_to_model($entity);
+		}
+
+		// Validate the model
+		$model->validate();
+
+		if ($model->is_valid()) {
+			$saved_entity = $model->get_entity();
+			unset($saved_entity->_errors);
+			$retval = $this->object->_save_entity($saved_entity);
+		}
+
+		// We always return the same type of entity that we given
+		if (get_class($entity) == 'stdClass') $model->get_entity();
+
+		return $retval;
+	}
+
+
+    /**
+     * Gets validation errors for the entity
+     * @param stdClass|C_DataMapper_Model $entity
+     * @return array
+     */
+    function get_errors($entity)
+    {
+        $model = $entity;
+        if (!$this->object->is_model($entity)) {
+            $model = $this->object->convert_to_model($entity);
+        }
+        $model->validate();
+        return $model->get_errors();
+    }
+
+	/**
+	 * Called to set defaults for the record/model/entity.
+	 * Subclasses and adapters should extend this method to provide their
+	 * implementation. The implementation should make use of the
+	 * _set_default_value() method
+	 */
+	function set_defaults()
+	{
+
+	}
+
+	/**
+	 * If a field has no value, then use the default value.
+	 * @param stdClass|C_DataMapper_Model $object
+	 */
+	function _set_default_value($object)
+	{
+		$array			= NULL;
+		$field			= NULL;
+		$default_value	= NULL;
+
+		// The first argument MUST be an object
+		if (!is_object($object)) throw new E_InvalidEntityException();
+
+		// This method has two signatures:
+		// 1) _set_default_value($object, $field, $default_value)
+		// 2) _set_default_value($object, $array_field, $field, $default_value)
+
+		// Handle #1
+		$args = func_get_args();
+		if (count($args) == 4) {
+			list($object, $array, $field, $default_value) = $args;
+			if (!isset($object->{$array})) {
+				$object->{$array} = array();
+				$object->{$array}[$field] = NULL;
+			}
+			else {
+				$arr = &$object->{$array};
+				if (!isset($arr[$field])) $arr[$field] = NULL;
+			}
+			$array = &$object->{$array};
+			$value = &$array[$field];
+			if ($value === '' OR is_null($value)) $value = $default_value;
+		}
+
+		// Handle #2
+		else {
+			list($object, $field, $default_value) = $args;
+			if (!isset($object->$field)) {
+				$object->$field = NULL;
+			}
+			$value = $object->$field;
+			if ($value === '' OR is_null($value)) $object->$field = $default_value;
+		}
+	}
+
+    function scrub_result($result)
+    {
+        if (is_object($result))
+        {
+            $new_result = new stdClass();
+            foreach ($result as $key => $value) {
+                $new_value = $this->scrub_result($value);
+                $new_result->$key = $new_value;
+            }
+            return $new_result;
+        }
+        else if (is_array($result)) {
+            $new_array = array();
+            foreach ($result as $key => $value) {
+                $new_array[$key] = $this->scrub_result($value);
+            }
+            return $new_array;
+        } else {
+            return stripslashes($result);
+        }
+    }
+}
+
+class C_DataMapper_Driver_Base extends C_Component
+{
+	var $_object_name;
+	var $_model_factory_method = FALSE;
+
+	function define($object_name, $context=FALSE)
+	{
+		parent::define($context);
+		$this->add_mixin('Mixin_DataMapper_Driver_Base');
+		$this->implement('I_DataMapper_Driver');
+	}
+
+	function initialize($object_name)
+	{
+		parent::initialize();
+		$this->_object_name = $object_name;
+	}
+
+	/**
+	 * Gets the object name
+	 * @return string
+	 */
+	function get_object_name()
+	{
+		return $this->_object_name;
+	}
+
+	/**
+	 * Gets the name of the table
+	 * @global string $table_prefix
+	 * @return string
+	 */
+	function get_table_name()
+	{
+		global $table_prefix;
+		return $table_prefix.$this->_object_name;
+	}
+
+	/**
+	 * Sets the name of the factory method used to create a model for this entity
+	 * @param string $method_name
+	 */
+	function set_model_factory_method($method_name)
+	{
+		$this->_model_factory_method = $method_name;
+	}
+
+
+	/**
+	 * Gets the name of the factory method used to create a model for this entity
+	 */
+	function get_model_factory_method()
+	{
+		return $this->_model_factory_method;
+	}
+
+
+	/**
+	 * Gets the name of the primary key column
+	 * @return string
+	 */
+	function get_primary_key_column()
+	{
+		return $this->_primary_key_column;
+	}
+
+
+	/**
+	 * Gets the class name of the driver used
+	 * @return string
+	 */
+	function get_driver_class_name()
+	{
+		return get_called_class();
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/class.datamapper_installer.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/class.datamapper_installer.php
new file mode 100644
index 0000000000000000000000000000000000000000..f41b322932547b33c03c2493ffe612ecb844fbdb
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/class.datamapper_installer.php
@@ -0,0 +1,14 @@
+<?php
+
+class C_DataMapper_Installer
+{
+	function __construct()
+	{
+		$this->settings = C_NextGen_Settings::get_instance();
+	}
+
+	function install()
+	{
+		$this->settings->set_default_value('datamapper_driver', 'custom_post_datamapper');
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/class.datamapper_model.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/class.datamapper_model.php
new file mode 100644
index 0000000000000000000000000000000000000000..3e16760f466600a07936122a91ea1e4db15f2e71
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/class.datamapper_model.php
@@ -0,0 +1,157 @@
+<?php
+
+class C_DataMapper_Model extends C_Component
+{
+	var $_mapper;
+	var $_stdObject;
+
+	/**
+	 * Define the model
+	 */
+	function define($mapper, $properties, $context=FALSE)
+	{
+		parent::define($context);
+		$this->add_mixin('Mixin_Validation');
+        $this->add_mixin('Mixin_DataMapper_Model_Instance_Methods');
+		$this->add_mixin('Mixin_DataMapper_Model_Validation');
+		$this->implement('I_DataMapper_Model');
+	}
+
+	/**
+	 * Creates a new entity for the specified mapper
+	 * @param C_DataMapper_Driver_Base $mapper
+	 * @param array|stdClass $properties
+	 * @param string $context
+	 */
+	function initialize($mapper, $properties=FALSE)
+	{
+		$this->_mapper = $mapper;
+		$this->_stdObject = $properties ? (object)$properties  : new stdClass();
+		parent::initialize();
+		$this->set_defaults();
+	}
+
+	/**
+	 * Gets the data mapper for the entity
+	 * @return C_DataMapper_Driver_Base
+	 */
+	function get_mapper()
+	{
+		return $this->_mapper;
+	}
+
+
+	/**
+	 * Gets a property of the model
+	 */
+	function &__get($property_name)
+	{
+		if (isset($this->_stdObject->$property_name)) {
+			$retval = &$this->_stdObject->$property_name;
+			return $retval;
+		}
+		else {
+			// We need to assign NULL to a variable first, since only
+			// variables can be returned by reference
+			$retval = NULL;
+			return $retval;
+		}
+	}
+
+	/**
+	 * Sets a property for the model
+	 */
+	function __set($property_name, $value)
+	{
+		return $this->_stdObject->$property_name = $value;
+	}
+
+
+	function __isset($property_name)
+	{
+		return isset($this->_stdObject->$property_name);
+	}
+
+
+	/**
+	 * Saves the entity
+	 * @param type $updated_attributes
+	 */
+	function save($updated_attributes=array())
+	{
+		$this->update_attributes($updated_attributes);
+		return $this->get_mapper()->save($this->get_entity());
+	}
+
+	/**
+	 * Updates the attributes for an object
+	 */
+	function update_attributes($array=array())
+	{
+		foreach ($array as $key => $value) $this->_stdObject->$key = $value;
+	}
+
+
+	/**
+	 * Sets the default values for this model
+	 */
+	function set_defaults()
+	{
+		$this->get_mapper()->set_defaults($this);
+	}
+
+	/**
+	 * Destroys or deletes the entity
+	 */
+	function destroy()
+	{
+		$this->get_mapper()->destroy($this->_stdObject);
+	}
+
+
+	/**
+	 * Determines whether the object is new or existing
+	 * @return type
+	 */
+	function is_new()
+	{
+		return $this->id() ? FALSE: TRUE;
+	}
+
+	/**
+	 * Gets/sets the primary key
+	 */
+	function id()
+	{
+		$key = $this->get_mapper()->get_primary_key_column();
+		$args = func_get_args();
+		if ($args) {
+			return $this->__set($key, $args[0]);
+		}
+		else {
+			return $this->__get($key);
+		}
+	}
+}
+
+/**
+ * This mixin should be overwritten by other modules
+ */
+class Mixin_DataMapper_Model_Validation extends Mixin
+{
+	function validation()
+	{
+		return $this->object->is_valid();
+	}
+}
+
+class Mixin_DataMapper_Model_Instance_Methods extends Mixin
+{
+    /**
+     * Returns the associated entity
+     */
+    function &get_entity()
+    {
+        return $this->object->_stdObject;
+    }
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/interface.custompost_datamapper.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/interface.custompost_datamapper.php
new file mode 100644
index 0000000000000000000000000000000000000000..0018b1814a8775f000f84c0ceda5d2847601f375
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/interface.custompost_datamapper.php
@@ -0,0 +1,6 @@
+<?php
+
+interface I_CustomPost_DataMapper
+{
+	
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/interface.customtable_datamapper.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/interface.customtable_datamapper.php
new file mode 100644
index 0000000000000000000000000000000000000000..9c384dbf182947c4799c4db141fdae68e3616f37
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/interface.customtable_datamapper.php
@@ -0,0 +1,6 @@
+<?php
+
+interface I_CustomTable_DataMapper
+{
+	
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/interface.datamapper_driver.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/interface.datamapper_driver.php
new file mode 100644
index 0000000000000000000000000000000000000000..77cbf1326cba131ca9bc8a27b1da8799b37430a4
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/interface.datamapper_driver.php
@@ -0,0 +1,29 @@
+<?php
+
+interface I_DataMapper_Driver
+{
+	function select($fields='*');
+	function order_by($order_by, $direction);
+	function limit($offset, $limit);
+	function where_and($conditions=array());
+	function where($conditions=array());
+	function where_or($conditions=array());
+    function group_by($columns=array());
+	function find($id=NULL);
+	function find_first();
+	function find_last();
+	function find_all();
+	function run_query();
+	function get_table_name();
+	function get_object_name();
+	function _save_entity($entity);
+	function get_primary_key_column();
+	function get_model_factory_method();
+	function set_model_factory_method($method_name);
+	function count();
+	function convert_to_model($stdObject, $context=FALSE);
+	function get_driver_class_name();
+	function is_select_statement();
+	function is_delete_statement();
+	function delete();
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/interface.datamapper_model.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/interface.datamapper_model.php
new file mode 100644
index 0000000000000000000000000000000000000000..b20cf28016559b68a5489a1ba98284bdec1f6a06
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/interface.datamapper_model.php
@@ -0,0 +1,9 @@
+<?php
+
+interface I_DataMapper_Model
+{
+	function save($attributes=array());
+	function destroy();
+	function update_attributes();
+	function is_new();
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/module.datamapper.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/module.datamapper.php
new file mode 100644
index 0000000000000000000000000000000000000000..e5836bb953bc11b8adacffa62bbd48f3a629771d
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/module.datamapper.php
@@ -0,0 +1,210 @@
+<?php
+
+/***
+ {
+	Module: photocrati-datamapper,
+	Depends: { photocrati-validation }
+ }
+***/
+class M_DataMapper extends C_Base_Module
+{
+	function define()
+	{
+		parent::define(
+			'photocrati-datamapper',
+			'DataMapper',
+			'Provides a database abstraction layer following the DataMapper pattern',
+			'0.3',
+			'http://www.photocrati.com',
+			'Photocrati Media',
+			'http://www.photocrati.com'
+		);
+
+		include_once('class.datamapper_installer.php');
+		C_Photocrati_Installer::add_handler($this->module_id, 'C_Datamapper_Installer');
+	}
+
+	function _register_adapters()
+	{
+		$this->get_registry()->add_adapter('I_Component_Factory', 'A_DataMapper_Factory');
+	}
+
+
+	function _register_hooks()
+	{
+		add_filter('posts_request', array(&$this, 'set_custom_wp_query'), 50, 2);
+		add_filter('posts_fields', array(&$this, 'set_custom_wp_query_fields'), 50, 2);
+		add_filter('posts_where', array(&$this, 'set_custom_wp_query_where'), 50, 2);
+        add_filter('posts_groupby', array(&$this, 'set_custom_wp_query_groupby'), 50, 2);
+	}
+
+
+	/**
+	 * Sets a custom SQL query for the WP_Query class, when the Custom Post
+	 * DataMapper implementation is used
+	 * @param string $sql
+	 * @param WP_Query $wp_query
+	 * @return string
+	 */
+	function set_custom_wp_query($sql, &$wp_query)
+	{
+		if ($wp_query->get('datamapper')) {
+			// Set the custom query
+			if (($custom_sql = $wp_query->get('custom_sql'))) {
+				$sql = $custom_sql;
+			}
+
+			// Perhaps we're to initiate a delete query instead?
+			elseif ($wp_query->get('is_delete')) {
+				$sql = preg_replace("/^SELECT.*FROM/i", "DELETE FROM", $sql);
+			}
+		}
+		
+		return $sql;
+	}
+
+	/**
+	 * Sets custom fields to select from the database
+	 * @param string $fields
+	 * @param WP_Query $wp_query
+	 * @return string
+	 */
+	function set_custom_wp_query_fields($fields, &$wp_query)
+	{
+		if ($wp_query->get('datmapper')) {
+			if (($custom_fields = $wp_query->get('fields'))) {
+				$fields = $custom_fields;
+			}
+		}
+
+		return $fields;
+	}
+
+
+	/**
+	 * Sets custom where clauses for a query
+	 * @param string $where
+	 * @param WP_Query $wp_query
+	 * @return string
+	 */
+	function set_custom_wp_query_where($where, &$wp_query)
+	{
+		if ($wp_query->get('datamapper')) {
+			$this->add_post_title_where_clauses($where, $wp_query);
+			$this->add_post_name_where_clauses($where, $wp_query);
+		}
+
+		return $where;
+	}
+
+
+    /**
+     * Adds additional group by clauses to the SQL query
+     * @param string $groupby
+     * @param WP_Query $wp_query
+     * @return string
+     */
+    function set_custom_wp_query_groupby($groupby, &$wp_query)
+    {
+        $retval = $groupby;
+        $group_by_columns = $wp_query->get('group_by_columns');
+        if ($group_by_columns) {
+            $retval = str_replace('GROUP BY', '', $retval);
+            $columns = explode(',', $retval);
+            foreach (array_reverse($columns) as $column) {
+                array_unshift($group_by_columns, trim($column));
+            }
+            $retval = "GROUP BY ".implode(', ', $group_by_columns);
+        }
+        // Not all mysql servers allow access to create temporary tables which are used when doing GROUP BY
+        // statements; this can potentially ruin basic queries. If no group_by_columns is set AND the query originates
+        // within the datamapper we strip the "GROUP BY" clause entirely in this filter.
+        else if ($wp_query->get('datamapper')) {
+            $retval = '';
+        }
+        return $retval;
+    }
+
+
+	/**
+	 * Formats the value of used in a WHERE IN
+	 * SQL clause for use in the WP_Query where clause
+	 * @param string|array $values
+	 * @return string
+	 */
+	function format_where_in_value($values)
+	{
+		if (is_string($values) && strpos($values, ',') !== FALSE)
+			$values = explode(", ", $values);
+		elseif (!is_array($values))
+			$values = array($values);
+
+		// Quote the titles
+		foreach ($values as $index => $value) {
+			$values[$index] = "'{$value}'";
+		}
+
+		return implode(', ', $values);
+	}
+
+
+	/**
+	 * Adds post_title to the where clause
+	 * @param string $where
+	 * @param WP_Query $wp_query
+	 * @return string
+	 */
+	function add_post_title_where_clauses(&$where, &$wp_query)
+	{
+		global $wpdb;
+
+		// Handle post_title query var
+		if (($titles = $wp_query->get('post_title'))) {
+			$titles = $this->format_where_in_value($titles);
+			$where .= " AND {$wpdb->posts}.post_title IN ({$titles})";
+		}
+
+		// Handle post_title_like query var
+		elseif (($value = $wp_query->get('post_title__like'))) {
+			$where .= " AND {$wpdb->posts}.post_title LIKE '{$value}'";
+		}
+	}
+
+
+	/**
+	 * Adds post_name to the where clause
+	 * @param type $where
+	 * @param type $wp_query
+	 */
+	function add_post_name_where_clauses(&$where, &$wp_query)
+	{
+		global $wpdb;
+
+		if (($name = $wp_query->get('page_name__like'))) {
+			$where .= " AND {$wpdb->posts}.post_name LIKE '{$name}'";
+		}
+		elseif (($names = $wp_query->get('page_name__in'))) {
+			$names = $this->format_where_in_value($names);
+			$where .= " AND {$wpdb->posts}.post_name IN ({$names})";
+		}
+	}
+
+    function get_type_list()
+    {
+        return array(
+            'A_Datamapper_Factory' 		=> 'adapter.datamapper_factory.php',
+            'C_Datamapper_Installer'	=> 'class.datamapper_installer.php',
+            'C_Datamapper' 					=> 'class.datamapper.php',
+            'C_Custompost_Datamapper_Driver' => 'class.custompost_datamapper_driver.php',
+            'C_Customtable_Datamapper_Driver' => 'class.customtable_datamapper_driver.php',
+            'C_Datamapper_Driver_Base'	=> 'class.datamapper_driver_base.php',
+            'C_Datamapper_Model' 		=> 'class.datamapper_model.php',
+            'I_Custompost_Datamapper'	=> 'interface.custompost_datamapper.php',
+            'I_Customtable_Datamapper' 	=> 'interface.customtable_datamapper.php',
+            'I_Datamapper_Driver' 		=> 'interface.datamapper_driver.php',
+            'I_Datamapper_Model' 		=> 'interface.datamapper_model.php',
+            'M_Datamapper' 				=> 'module.datamapper.php'
+        );
+    }
+}
+new M_DataMapper();
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_stylesheet/adapter.dynamic_stylesheet_routes.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_stylesheet/adapter.dynamic_stylesheet_routes.php
new file mode 100644
index 0000000000000000000000000000000000000000..50a91b2c979c6c7d36efb70153dfd030e36b296a
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_stylesheet/adapter.dynamic_stylesheet_routes.php
@@ -0,0 +1,21 @@
+<?php
+
+class A_Dynamic_Stylesheet_Routes extends Mixin
+{
+	function initialize()
+	{
+		$this->object->add_pre_hook(
+			'serve_request',
+			'Add Dynamic Stylesheet Route',
+			get_class(),
+			'add_dynamic_stylesheet_route'
+		);
+	}
+
+	function add_dynamic_stylesheet_route()
+	{
+		$app = $this->create_app('/nextgen-dcss');
+		$app->rewrite('/{\d}/{*}', '/index--{1}/data--{2}');
+		$app->route('/', 'I_Dynamic_Stylesheet#index');
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_stylesheet/class.dynamic_stylesheet_controller.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_stylesheet/class.dynamic_stylesheet_controller.php
new file mode 100644
index 0000000000000000000000000000000000000000..ff99ceb6a85b77fac8f6a5f55a4a2c34bda658cd
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_stylesheet/class.dynamic_stylesheet_controller.php
@@ -0,0 +1,128 @@
+<?php
+
+class C_Dynamic_Stylesheet_Controller extends C_MVC_Controller
+{
+	static	$_instances				= array();
+	var		$_known_templates		= array();
+	var		$_app					= NULL;
+
+	function define($context=FALSE)
+	{
+		parent::define($context);
+		$this->add_mixin('Mixin_Dynamic_Stylesheet_Instance_Methods');
+		$this->add_mixin('Mixin_Dynamic_Stylesheet_Actions');
+		$this->implement('I_Dynamic_Stylesheet');
+	}
+
+	function initialize()
+	{
+		parent::initialize();
+		$this->_app = C_NextGen_Settings::get_instance()->dynamic_stylesheet_slug;
+	}
+
+	static function &get_instance($context=FALSE)
+	{
+		if (!isset(self::$_instances[$context])) {
+			$klass = get_class();
+			self::$_instances[$context] = new $klass($context);
+		}
+		return self::$_instances[$context];
+	}
+}
+
+/**
+ * Provides instance methods for the dynamic stylesheet utility
+ */
+class Mixin_Dynamic_Stylesheet_Instance_Methods extends Mixin
+{
+	/**
+	 * Registers a template with the dynamic stylesheet utility. A template
+	 * must be registered before it can be loaded
+	 * @param string $name
+	 * @param string $template
+	 */
+	function register($name, $template)
+	{
+		$this->object->_known_templates[$name] = $template;
+	}
+
+	/**
+	 * Finds a registered template by name
+	 * @param string $name
+	 * @return int
+	 */
+	function get_css_template_index($name)
+	{
+		return array_search($name, array_keys($this->object->_known_templates));
+	}
+
+	function get_css_template($index)
+	{
+		$keys = array_keys($this->object->_known_templates);
+		return $this->object->_known_templates[$keys[$index]];
+	}
+
+	/**
+	 * Loads a template, along with the dynamic variables to be interpolated
+	 * @param string $name
+	 * @param array $vars
+	 */
+	function enqueue($name, $data=array())
+	{
+		if (($index = $this->object->get_css_template_index($name)) !== FALSE)
+        {
+            if (is_subclass_of($data, 'C_DataMapper_Model'))
+                $data = $data->get_entity();
+			$data = $this->object->encode($data);
+            wp_enqueue_style(
+                'dyncss-' . $index . $data . '@dynamic',
+                $this->object->get_router()->get_url("/{$this->object->_app}", FALSE) . "/{$index}/{$data}"
+            );
+		}
+	}
+
+    /**
+     * Encodes $data
+     *
+     * base64 encoding uses '==' to denote the end of the sequence, but keep it out of the url
+     * @param $data
+     * @return string
+     */
+    function encode($data)
+	{
+		$data = json_encode($data);
+		$data = base64_encode($data);
+		$data = str_replace('/', '\\', $data);
+        $data = rtrim($data, '=');
+		return $data;
+	}
+
+    /**
+     * Decodes $data
+     *
+     * @param $data
+     * @return array|mixed
+     */
+    function decode($data)
+	{
+		$data = str_replace('\\', '/', $data);
+		$data = base64_decode($data . '==');
+		$data = json_decode($data);
+		return $data;
+	}
+}
+
+/**
+ * Provides controller actions for the dynamic stylesheet
+ */
+class Mixin_Dynamic_Stylesheet_Actions extends Mixin
+{
+	function index_action()
+	{
+		$this->set_content_type('css');
+		if (($data = $this->param('data')) !== FALSE && ($index = $this->param('index')) !== FALSE) {
+			$data = $this->object->decode($data);
+			$this->render_view($this->object->get_css_template($index), $data);
+		}
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_stylesheet/class.dynamic_stylesheet_installer.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_stylesheet/class.dynamic_stylesheet_installer.php
new file mode 100644
index 0000000000000000000000000000000000000000..7a531ecd94f7d55a8fc4b159965a075ed0951b4e
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_stylesheet/class.dynamic_stylesheet_installer.php
@@ -0,0 +1,14 @@
+<?php
+
+class C_Dynamic_Stylesheet_Installer
+{
+	function __construct()
+	{
+		$this->settings = C_NextGen_Settings::get_instance();
+	}
+
+	function install()
+	{
+		$this->settings->set_default_value('dynamic_stylesheet_slug', 'nextgen-dcss');
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_stylesheet/interface.dynamic_stylesheet.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_stylesheet/interface.dynamic_stylesheet.php
new file mode 100644
index 0000000000000000000000000000000000000000..cab06fbd2e29c855876c97e625ee3c3d71bffa51
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_stylesheet/interface.dynamic_stylesheet.php
@@ -0,0 +1,7 @@
+<?php
+
+interface I_Dynamic_Stylesheet
+{
+	function register($name, $template);
+	function enqueue($name, $vars);
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_stylesheet/module.dynamic_stylesheet.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_stylesheet/module.dynamic_stylesheet.php
new file mode 100644
index 0000000000000000000000000000000000000000..f7e349d902b7e4b43913fc99b96dda54bf6fa1fb
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_stylesheet/module.dynamic_stylesheet.php
@@ -0,0 +1,53 @@
+<?php
+
+/*
+{
+	Module: photocrati-dynamic_stylesheet,
+	Depends: { photocrati-mvc, photocrati-lzw }
+}
+ */
+class M_Dynamic_Stylesheet extends C_Base_Module
+{
+	function define($context=FALSE)
+	{
+		parent::define(
+			'photocrati-dynamic_stylesheet',
+			'Dynamic Stylesheet',
+			'Provides the ability to generate and enqueue a dynamic stylesheet',
+			'0.3',
+			'http://www.nextgen-gallery.com',
+			'Photocrati Media',
+			'http://www.photocrati.com',
+			$context
+		);
+
+		include_once('class.dynamic_stylesheet_installer.php');
+		C_Photocrati_Installer::add_handler($this->module_id, 'C_Dynamic_Stylesheet_Installer');
+	}
+
+	function _register_utilities()
+	{
+		$this->get_registry()->add_utility(
+			"I_Dynamic_Stylesheet", 'C_Dynamic_Stylesheet_Controller'
+		);
+	}
+
+	function _register_adapters()
+	{
+		$this->get_registry()->add_adapter(
+			'I_Router', 'A_Dynamic_Stylesheet_Routes'
+		);
+	}
+
+    function get_type_list()
+    {
+        return array(
+            'A_Dynamic_Stylesheet_Routes' 		=> 'adapter.dynamic_stylesheet_routes.php',
+			'C_Dynamic_Stylesheet_Installer'	=> 'class.dynamic_stylesheet_installer.php',
+            'C_Dynamic_Stylesheet_Controller' 	=> 'class.dynamic_stylesheet_controller.php',
+            'I_Dynamic_Stylesheet' 				=> 'interface.dynamic_stylesheet.php'
+        );
+    }
+}
+
+new M_Dynamic_Stylesheet;
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_thumbnails/adapter.dynamic_thumbnail_routes.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_thumbnails/adapter.dynamic_thumbnail_routes.php
new file mode 100644
index 0000000000000000000000000000000000000000..63a9191cbe3d780bcff3438bc92db47aeb386a04
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_thumbnails/adapter.dynamic_thumbnail_routes.php
@@ -0,0 +1,28 @@
+<?php
+
+class A_Dynamic_Thumbnail_Routes extends Mixin
+{
+	function initialize()
+	{
+		$this->object->add_pre_hook(
+			'serve_request',
+			'Adds Dynamic Thumbnail routes',
+			get_class(),
+			'add_dynamic_thumbnail_routes'
+		);
+	}
+
+	function add_dynamic_thumbnail_routes()
+	{
+        $app = $this->create_app('/nextgen-image');
+
+		// The C_Dynamic_Thumbnails Controller was created before the new
+		// router implementation was conceptualized. It uses it's own mechanism
+		// to parse the REQUEST_URI. It should be refactored to use the router's
+		// parameter mechanism, but for now - we'll just removed the segments
+		// from the router's visibility, and let the Dynamic Thumbnails Controller
+		// do it's own parsing
+		$app->rewrite('/{*}', '/');
+        $app->route('/', 'I_Dynamic_Thumbnails_Controller#index');
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_thumbnails/adapter.dynamic_thumbnails_storage_driver.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_thumbnails/adapter.dynamic_thumbnails_storage_driver.php
new file mode 100644
index 0000000000000000000000000000000000000000..a0ffa133244d6cf01ab6aef0ad613d1c8eb97215
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_thumbnails/adapter.dynamic_thumbnails_storage_driver.php
@@ -0,0 +1,104 @@
+<?php
+
+class A_Dynamic_Thumbnails_Storage_Driver extends Mixin
+{
+	function get_image_abspath($image, $size=FALSE, $check_existance=FALSE)
+	{
+		$retval = NULL;
+		$dynthumbs = $this->object->get_registry()->get_utility('I_Dynamic_Thumbnails_Manager');
+
+		if ($dynthumbs && $dynthumbs->is_size_dynamic($size))
+		{
+			// If we have the id, get the actual image entity
+			if (is_numeric($image)) {
+				$image = $this->object->_image_mapper->find($image);
+			}
+
+			// Ensure we have the image entity - user could have passed in an
+			// incorrect id
+			if (is_object($image)) {
+				if ($folder_path = $this->object->get_cache_abspath($image->galleryid))
+                {
+					$params = $dynthumbs->get_params_from_name($size, true);
+					$image_filename = $dynthumbs->get_image_name($image, $params);
+
+					$image_path = path_join($folder_path, $image_filename);
+
+					if ($check_existance)
+					{
+						if (@file_exists($image_path))
+						{
+							$retval = $image_path;
+						}
+					}
+					else
+					{
+						$retval = $image_path;
+					}
+				}
+			}
+		}
+		else  {
+			$retval = $this->call_parent('get_image_abspath', $image, $size, $check_existance);
+		}
+
+		return $retval;
+	}
+
+	function get_image_url($image, $size='full')
+	{
+		$retval = NULL;
+		$dynthumbs = $this->object->get_registry()->get_utility('I_Dynamic_Thumbnails_Manager');
+
+		if ($dynthumbs && $dynthumbs->is_size_dynamic($size)) {
+
+			$abspath = $this->object->get_image_abspath($image, $size, true);
+
+		if ($abspath == null) {
+				$params = $dynthumbs->get_params_from_name($size, true);
+				$retval = $dynthumbs->get_image_url($image, $params);
+			}
+		}
+
+		if ($retval == null) {
+			$retval = $this->call_parent('get_image_url', $image, $size);
+		}
+
+		return $retval;
+	}
+
+  function get_image_dimensions($image, $size = 'full')
+  {
+		$retval = $this->call_parent('get_image_dimensions', $image, $size);
+
+		if ($retval == null) {
+			$dynthumbs = $this->object->get_registry()->get_utility('I_Dynamic_Thumbnails_Manager');
+
+			if ($dynthumbs && $dynthumbs->is_size_dynamic($size))
+			{
+				$new_dims = $this->object->calculate_image_size_dimensions($image, $size);
+
+				$retval = array('width' => $new_dims['real_width'], 'height' => $new_dims['real_height']);
+			}
+		}
+
+		return $retval;
+  }
+
+	function get_image_size_params($image, $size, $params = null, $skip_defaults = false)
+	{
+		$dynthumbs = $this->object->get_registry()->get_utility('I_Dynamic_Thumbnails_Manager');
+
+		if ($dynthumbs && $dynthumbs->is_size_dynamic($size))
+		{
+			$named_params = $dynthumbs->get_params_from_name($size, true);
+
+			foreach ($named_params as $param_name => $param_value)
+			{
+				$params[$param_name] = $param_value;
+			}
+		}
+
+		return $this->call_parent('get_image_size_params', $image, $size, $params, $skip_defaults);
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_thumbnails/class.dynamic_thumbnails_controller.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_thumbnails/class.dynamic_thumbnails_controller.php
new file mode 100644
index 0000000000000000000000000000000000000000..d51f8b1e8f627d22aaabddfe05f0b824cee5fbcd
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_thumbnails/class.dynamic_thumbnails_controller.php
@@ -0,0 +1,72 @@
+<?php
+
+class C_Dynamic_Thumbnails_Controller extends C_MVC_Controller
+{
+    static $_instances = array();
+
+	function define($context=FALSE)
+	{
+		parent::define($context);
+        $this->implement('I_Dynamic_Thumbnails_Controller');
+	}
+
+    /**
+     * Returns an instance of this class
+     *
+     * @param string $context
+     * @return C_Dynamic_Thumbnails_Controller
+     */
+    static function get_instance($context=FALSE)
+    {
+        if (!isset(self::$_instances[$context])) {
+            $klass = get_class();
+            self::$_instances[$context] = new $klass($context);
+        }
+        return self::$_instances[$context];
+    }
+
+	function index_action()
+	{
+		$dynthumbs = $this->get_registry()->get_utility('I_Dynamic_Thumbnails_Manager');
+		
+		$uri = $_SERVER['REQUEST_URI'];
+		$params = $dynthumbs->get_params_from_uri($uri);
+		$request_params = $params;
+
+		if ($params != null)
+		{
+			$storage = $this->get_registry()->get_utility('I_Gallery_Storage');
+			
+			// Note, URLs should always include quality setting when returned by Gallery Storage component
+			// this sanity check is mostly for manually testing URLs
+			if (!isset($params['quality'])) {
+				// Note: there's a problem when doing this as using the same set of parameters to *retrieve* the image path/URL will lead to a different filename than the one tha was used to *generate* it (which went through here) 
+				// The statement above about URLs always containing quality setting is not true anymore, this is because we need to retrieve default quality from the imgQuality and thumbquality settings, depending on "full" or "thumbnail" request in the ngglegacy storage
+				//$params['quality'] = 100;
+			}
+			
+			$image_id = $params['image'];
+			$size = $dynthumbs->get_size_name($params);
+			$abspath = $storage->get_image_abspath($image_id, $size, true);
+			$valid = true;
+			
+			// Render invalid image if hash check fails
+			if ($abspath == null) {
+				$uri_plain = $dynthumbs->get_uri_from_params($request_params);
+				$hash = wp_hash($uri_plain);
+				
+				if (strpos($uri, $hash) === false) {
+					$valid = false;
+					$filename = $this->object->find_static_file('invalid_image.png');
+					$this->set_content_type('image/png');
+					readfile($filename);
+					$this->render();
+				}
+			}
+			
+			if ($valid) {
+				$storage->render_image($image_id, $size);
+			}
+		}
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_thumbnails/class.dynamic_thumbnails_installer.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_thumbnails/class.dynamic_thumbnails_installer.php
new file mode 100644
index 0000000000000000000000000000000000000000..7963a3f05e1c6dedaccc1826a152721e184e467f
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_thumbnails/class.dynamic_thumbnails_installer.php
@@ -0,0 +1,14 @@
+<?php
+
+class C_Dynamic_Thumbnails_Installer
+{
+	function __construct()
+	{
+		$this->settings = C_NextGen_Settings::get_instance();
+	}
+
+	function install()
+	{
+		$this->settings->set_default_value('dynamic_thumbnail_slug', 'nextgen-image');
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_thumbnails/class.dynamic_thumbnails_manager.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_thumbnails/class.dynamic_thumbnails_manager.php
new file mode 100644
index 0000000000000000000000000000000000000000..52e6ad3f71a84222cb1cfe86f97a51ea7c4a6091
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_thumbnails/class.dynamic_thumbnails_manager.php
@@ -0,0 +1,517 @@
+<?php
+
+class Mixin_Dynamic_Thumbnails_Manager extends Mixin
+{
+	function get_route_name()
+	{
+		return C_NextGen_Settings::get_instance()->get('dynamic_thumbnail_slug');
+	}
+
+	function _get_params_sanitized($params)
+	{
+		if (isset($params['rotation']))
+		{
+			$rotation = intval($params['rotation']);
+
+			if ($rotation && in_array(abs($rotation), array(90, 180, 270)))
+			{
+				$rotation = $rotation % 360;
+
+				if ($rotation < 0)
+				{
+					$rotation = 360 - $rotation;
+				}
+
+				$params['rotation'] = $rotation;
+			}
+			else
+			{
+				unset($params['rotation']);
+			}
+		}
+
+		if (isset($params['flip']))
+		{
+			$flip = strtolower($params['flip']);
+
+			if (in_array($flip, array('h', 'v', 'hv')))
+			{
+				$params['flip'] = $flip;
+			}
+			else
+			{
+				unset($params['flip']);
+			}
+		}
+
+		return $params;
+	}
+
+	function get_uri_from_params($params)
+	{
+		$params = $this->object->_get_params_sanitized($params);
+
+		$image = isset($params['image']) ? $params['image'] : null;
+		$image_id = is_scalar($image) ? ((int)$image) : $image->pid;
+		$image_width = isset($params['width']) ? $params['width'] : null;
+		$image_height = isset($params['height']) ? $params['height'] : null;
+		$image_quality = isset($params['quality']) ? $params['quality'] : null;
+		$image_type = isset($params['type']) ? $params['type'] : null;
+		$image_crop = isset($params['crop']) ? $params['crop'] : null;
+		$image_watermark = isset($params['watermark']) ? $params['watermark'] : null;
+		$image_rotation = isset($params['rotation']) ? $params['rotation'] : null;
+		$image_flip = isset($params['flip']) ? $params['flip'] : null;
+		$image_reflection = isset($params['reflection']) ? $params['reflection'] : null;
+
+		$router = $this->get_registry()->get_utility('I_Router');
+
+		$uri = null;
+
+		$uri .= '/';
+		$uri .= $this->object->get_route_name() . '/';
+		$uri .= strval($image_id) . '/';
+
+		$uri .= strval($image_width) . 'x' . strval($image_height);
+
+		if ($image_quality != null)
+		{
+			$uri .= 'x' . strval($image_quality);
+		}
+
+		$uri .= '/';
+
+		if ($image_type != null)
+		{
+			$uri .= $image_type . '/';
+		}
+
+		if ($image_crop)
+		{
+			$uri .= 'crop/';
+		}
+
+		if ($image_watermark)
+		{
+			$uri .= 'watermark/';
+		}
+
+		if ($image_rotation)
+		{
+			$uri .= 'rotation-' . $image_rotation . '/';
+		}
+
+		if ($image_flip)
+		{
+			$uri .= 'flip-' . $image_flip . '/';
+		}
+
+		if ($image_reflection)
+		{
+			$uri .= 'reflection/';
+		}
+
+		return $uri;
+	}
+
+	function get_image_uri($image, $params)
+	{
+		$params['image'] = $image;
+		$uri = $this->object->get_uri_from_params($params);
+
+		if (substr($uri, -1) != '/')
+		{
+			$uri .= '/';
+		}
+
+		$uri .= wp_hash($uri) . '/';
+
+		return $uri;
+	}
+
+	function get_image_url($image, $params)
+	{
+		$router = $this->get_registry()->get_utility('I_Router');
+
+		return $router->get_url($this->object->get_image_uri($image, $params), FALSE);
+	}
+
+	function get_params_from_uri($uri)
+	{
+		$regex = '/\\/?' . $this->object->get_route_name() . '\\/(\\d+)(?:\\/(.*))?/';
+		$match = null;
+
+		// XXX move this URL clean up to I_Router?
+    $uri = preg_replace('/\\/index.php\\//', '/', $uri, 1);
+    $uri = trim($uri, '/');
+
+		if (@preg_match($regex, $uri, $match) > 0)
+		{
+			$image_id = $match[1];
+			$uri_args = isset($match[2]) ? explode('/', $match[2]) : array();
+			$params = array(
+				'image' => $image_id,
+			);
+
+			foreach ($uri_args as $uri_arg)
+			{
+				$uri_arg_set = explode('-', $uri_arg);
+				$uri_arg_name = array_shift($uri_arg_set);
+				$uri_arg_value = $uri_arg_set ? array_shift($uri_arg_set) : null;
+				$size_match = null;
+
+				if ($uri_arg == 'watermark')
+				{
+					$params['watermark'] = true;
+				}
+				else if ($uri_arg_name == 'rotation')
+				{
+					$params['rotation'] = $uri_arg_value;
+				}
+				else if ($uri_arg_name == 'flip')
+				{
+					$params['flip'] = $uri_arg_value;
+				}
+				else if ($uri_arg == 'reflection')
+				{
+					$params['reflection'] = true;
+				}
+				else if ($uri_arg == 'crop')
+				{
+					$params['crop'] = true;
+				}
+				else if (in_array(strtolower($uri_arg), array('gif', 'jpg', 'png')))
+				{
+					$params['type'] = $uri_arg;
+				}
+				else if (preg_match('/(\\d+)x(\\d+)(?:x(\\d+))?/i', $uri_arg, $size_match) > 0)
+				{
+					$params['width'] = $size_match[1];
+					$params['height'] = $size_match[2];
+
+					if (isset($size_match[3]))
+					{
+						$params['quality'] = $size_match[3];
+					}
+				}
+			}
+
+			return $this->object->_get_params_sanitized($params);
+		}
+
+		return null;
+	}
+
+	function _get_name_prefix_list()
+	{
+		return array(
+			'id' => 'nggid0',
+			'size' => 'ngg0dyn-',
+			'flags' => '00f0',
+			'flag' => array('w0' => 'watermark', 'c0' => 'crop', 'r1' => 'rotation', 'f1' => 'flip', 'r0' => 'reflection', 't0' => 'type'),
+			'flag_len' => 2,
+			'max_value_length' => 15, // Note: this can't be increased beyond 15, as a single hexadecimal character is used to encode the value length in names. Increasing it over 15 requires changing the algorithm to use an arbitrary letter instead of a hexadecimal digit (this would bump max length to 35, 9 numbers + 26 letters)
+		);
+	}
+
+	function get_name_from_params($params, $only_size_name = false, $id_in_name = true)
+	{
+		$prefix_list = $this->object->_get_name_prefix_list();
+		$id_prefix = $prefix_list['id'];
+		$size_prefix = $prefix_list['size'];
+		$flags_prefix = $prefix_list['flags'];
+		$flags = $prefix_list['flag'];
+		$max_value_length = $prefix_list['max_value_length'];
+
+		$params = $this->object->_get_params_sanitized($params);
+		$image = isset($params['image']) ? $params['image'] : null;
+		$image_width = isset($params['width']) ? $params['width'] : null;
+		$image_height = isset($params['height']) ? $params['height'] : null;
+		$image_quality = isset($params['quality']) ? $params['quality'] : null;
+
+		$extension = null;
+		$name = null;
+
+		// if $only_size_name is false then we include the file name and image id for the image
+		if (!$only_size_name)
+		{
+			if (is_int($image))
+			{
+        $imap = $this->object->get_registry()->get_utility('I_Image_Mapper');
+        $image = $imap->find($image);
+			}
+
+			if ($image != null)
+			{
+				// this is used to remove the extension and then add it back at the end of the name
+				$extension = pathinfo($image->filename, PATHINFO_EXTENSION);
+
+				if ($extension != null)
+				{
+					$extension = '.' . $extension;
+				}
+
+				$name .= basename($image->filename, $extension);
+				$name .= '-';
+
+				if ($id_in_name)
+				{
+					$image_id = strval($image->pid);
+					$id_len = min($max_value_length, strlen($image_id));
+					$id_len_hex = dechex($id_len);
+
+					// sanity check, should never occurr if $max_value_length is not messed up, ensure only 1 character is used to encode length or else skip parameter
+					if (strlen($id_len_hex) == 1)
+					{
+						$name .= $id_prefix . $id_len . substr($image_id, 0, $id_len);
+						$name .= '-';
+					}
+				}
+			}
+		}
+
+		$name .= $size_prefix;
+		$name .= strval($image_width) . 'x' . strval($image_height);
+
+		if ($image_quality != null)
+		{
+			$name .= 'x' . $image_quality;
+		}
+
+		$name .= '-';
+
+		$name .= $flags_prefix;
+
+		foreach ($flags as $flag_prefix => $flag_name)
+		{
+			$flag_value = 0;
+
+			if (isset($params[$flag_name]))
+			{
+				$flag_value = $params[$flag_name];
+
+				if (!is_string($flag_value))
+				{
+					// only strings or ints allowed, sprintf is required because intval(0) returns '' and not '0'
+					$flag_value = intval($flag_value);
+					$flag_value = sprintf('%d', $flag_value);
+				}
+			}
+
+			$flag_value = strval($flag_value);
+			$flag_len = min($max_value_length, strlen($flag_value));
+			$flag_len_hex = dechex($flag_len);
+
+			// sanity check, should never occurr if $max_value_length is not messed up, ensure only 1 character is used to encode length or else skip parameter
+			if (strlen($flag_len_hex) == 1)
+			{
+				$name .= $flag_prefix . $flag_len . substr($flag_value, 0, $flag_len);
+			}
+		}
+
+		$name .= $extension;
+
+		return $name;
+	}
+
+	function get_size_name($params)
+	{
+		$name = $this->object->get_name_from_params($params, true);
+
+		return $name;
+	}
+
+	function get_image_name($image, $params)
+	{
+		$params['image'] = $image;
+		$name = $this->object->get_name_from_params($params);
+
+		return $name;
+	}
+
+	function get_params_from_name($name, $is_only_size_name = false)
+	{
+		$prefix_list = $this->object->_get_name_prefix_list();
+		$id_prefix = $prefix_list['id'];
+		$size_prefix = $prefix_list['size'];
+		$flags_prefix = $prefix_list['flags'];
+		$max_value_length = $prefix_list['max_value_length'];
+		$size_name = null;
+		$id_name = null;
+		$params = array();
+
+		if (!$is_only_size_name)
+		{
+			$extension = pathinfo($name, PATHINFO_EXTENSION);
+
+			if ($extension != null)
+			{
+				$extension = '.' . $extension;
+			}
+
+			$name = basename($name, $extension);
+		}
+
+		$size_index = strrpos($name, $size_prefix);
+
+		if ($size_index > 0 || $size_index === 0)
+		{
+			// check if name contains dynamic size/params info by looking for prefix
+			$size_name = substr($name, $size_index);
+		}
+
+		if (!$is_only_size_name)
+		{
+			// name should contain the image id, search for prefix
+			$id_index = strrpos($name, $id_prefix);
+
+			if ($id_index > 0 || $id_index === 0)
+			{
+				if ($size_index > 0 && $size_index > $id_index)
+				{
+					$id_name = substr($name, $id_index, ($size_index - $id_index));
+				}
+				else
+				{
+					$id_name = substr($name, $id_index);
+				}
+			}
+		}
+
+		// Double check we got a correct dynamic size/params string
+		if (substr($size_name, 0, strlen($size_prefix)) == $size_prefix)
+		{
+			$flags = $prefix_list['flag'];
+			// get the length of the flag id (the key in the $flags array) in the string (how many characters to consume)
+			$flag_id_len = $prefix_list['flag_len'];
+			$params_str = substr($size_name, strlen($size_prefix));
+			$params_parts = explode('-', $params_str);
+
+			// $param_part is a single param, separated by '-'
+			foreach ($params_parts as $param_part)
+			{
+				// Parse WxHxQ - Q=quality
+				$param_size = explode('x', $param_part);
+				$param_size_count = count($param_size);
+
+				if (substr($param_part, 0, strlen($flags_prefix)) == $flags_prefix)
+				{
+					/* Set flags, using $flags keys as prefixes */
+
+					// move string pointer up (after the main flags prefix)
+					$param_flags = substr($param_part, strlen($flags_prefix));
+					$param_flags_len = strlen($param_flags);
+					$flags_todo = $flags;
+
+					while (true)
+					{
+						// ensure we don't run into an infinite loop ;)
+						if (count($flags_todo) == 0 || strlen($param_flags) == 0)
+						{
+							break;
+						}
+
+						// get the flag prefix (a key in the $flags array) using flag id length
+						$flag_prefix = substr($param_flags, 0, $flag_id_len);
+						// move string pointer up (after the single flag prefix)
+						$param_flags = substr($param_flags, $flag_id_len);
+
+						// get the length of the flag value in the string (how many characters to consume)
+						// flag value length is stored in a single hexadecimal character next to the flag prefix
+						$flag_value_len = min(hexdec(substr($param_flags, 0, 1)), min($max_value_length, strlen($param_flags) - 1));
+						// get the flag value
+						$flag_value = substr($param_flags, 1, $flag_value_len);
+						// move string pointer up (after the entire flag)
+						$param_flags = substr($param_flags, $flag_value_len + 1);
+
+						// make sure the flag is supported
+						if (isset($flags[$flag_prefix]))
+						{
+							$flag_name = $flags[$flag_prefix];
+
+							if (is_numeric($flag_value))
+							{
+								// convert numerical flags to integers
+								$flag_value = intval($flag_value);
+							}
+
+							$params[$flag_name] = $flag_value;
+
+							if (isset($flags_todo[$flag_prefix]))
+							{
+								unset($flags_todo[$flag_prefix]);
+							}
+						}
+						else
+						{
+							// XXX unknown flag?
+						}
+					}
+				}
+				else if ($param_size_count == 2 || $param_size_count == 3)
+				{
+					// Set W H Q
+					$params['width'] = intval($param_size[0]);
+					$params['height'] = intval($param_size[1]);
+
+					if (isset($param_size[2]) && intval($param_size[2]) > 0)
+					{
+						$params['quality'] = intval($param_size[2]);
+					}
+				}
+			}
+		}
+
+		// Double check we got a correct id string
+		if (substr($id_name, 0, strlen($id_prefix)) == $id_prefix)
+		{
+			// move string pointer up (after the prefix)
+			$id_name = substr($id_name, strlen($id_prefix));
+			// get the length of the image id in the string (how many characters to consume)
+			$id_len = min(hexdec(substr($id_name, 0, 1)), min($max_value_length, strlen($id_name) - 1));
+			// get the id based on old position and id length
+			$image_id = intval(substr($id_name, 1, $id_len));
+
+			if ($image_id > 0)
+			{
+				$params['image'] = $image_id;
+			}
+		}
+
+		return $this->object->_get_params_sanitized($params);
+	}
+
+	function is_size_dynamic($name, $is_only_size_name = false)
+	{
+		$params = $this->object->get_params_from_name($name, $is_only_size_name);
+
+		if (isset($params['width']) && isset($params['height']))
+		{
+			return true;
+		}
+
+		return false;
+	}
+}
+
+class C_Dynamic_Thumbnails_Manager extends C_Component
+{
+    static $_instances = array();
+
+    function define($context=FALSE)
+    {
+			parent::define($context);
+
+			$this->implement('I_Dynamic_Thumbnails_Manager');
+			$this->add_mixin('Mixin_Dynamic_Thumbnails_Manager');
+    }
+
+    static function get_instance($context = False)
+    {
+			if (!isset(self::$_instances[$context]))
+			{
+					self::$_instances[$context] = new C_Dynamic_Thumbnails_Manager($context);
+			}
+
+			return self::$_instances[$context];
+    }
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_thumbnails/interface.dynamic_thumbnails_controller.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_thumbnails/interface.dynamic_thumbnails_controller.php
new file mode 100644
index 0000000000000000000000000000000000000000..19fa02276fde5761f6ebf2fe20debe4e07fd46da
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_thumbnails/interface.dynamic_thumbnails_controller.php
@@ -0,0 +1,5 @@
+<?php
+
+interface I_Dynamic_Thumbnails_Controller
+{
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_thumbnails/interface.dynamic_thumbnails_manager.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_thumbnails/interface.dynamic_thumbnails_manager.php
new file mode 100644
index 0000000000000000000000000000000000000000..b0e881ee33d6bb6383b27dd7bddcfe319a8b1487
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_thumbnails/interface.dynamic_thumbnails_manager.php
@@ -0,0 +1,24 @@
+<?php
+
+interface I_Dynamic_Thumbnails_Manager
+{
+	function get_route_name();
+	
+	function get_uri_from_params($params);
+	
+	function get_image_uri($image, $params);
+	
+	function get_image_url($image, $params);
+	
+	function get_params_from_uri($uri);
+	
+	function get_name_from_params($params, $only_size_name = false, $id_in_name = true);
+	
+	function get_size_name($params);
+	
+	function get_image_name($image, $params);
+	
+	function get_params_from_name($name, $is_only_size_name = false);
+	
+	function is_size_dynamic($name, $is_only_size_name = false);
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_thumbnails/module.dynamic_thumbnails.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_thumbnails/module.dynamic_thumbnails.php
new file mode 100644
index 0000000000000000000000000000000000000000..b5e116ab661288c614fe4290cb4b83ddd8c37bf6
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_thumbnails/module.dynamic_thumbnails.php
@@ -0,0 +1,53 @@
+<?php
+
+/***
+ {
+	Module: photocrati-dynamic_thumbnails
+ }
+ ***/
+class M_Dynamic_Thumbnails extends C_Base_Module
+{
+	function define()
+	{
+		parent::define(
+			'photocrati-dynamic_thumbnails',
+			'Dynamic Thumbnails',
+			'Adds support for dynamic thumbnails',
+			'0.3',
+			'http://www.nextgen-gallery.com',
+			'Photocrati Media',
+			'http://www.photocrati.com'
+		);
+
+		include_once('class.dynamic_thumbnails_installer.php');
+		C_Photocrati_Installer::add_handler($this->module_id, 'C_Dynamic_Thumbnails_Installer');
+	}
+
+	function _register_adapters()
+	{
+		$this->get_registry()->add_adapter('I_Router', 'A_Dynamic_Thumbnail_Routes');
+		$this->get_registry()->add_adapter('I_GalleryStorage_Driver', 'A_Dynamic_Thumbnails_Storage_Driver');
+	}
+
+	function _register_utilities()
+	{
+        $this->get_registry()->add_utility('I_Dynamic_Thumbnails_Manager', 'C_Dynamic_Thumbnails_Manager');
+        $this->get_registry()->add_utility('I_Dynamic_Thumbnails_Controller', 'C_Dynamic_Thumbnails_Controller');
+	}
+
+    function get_type_list()
+    {
+        return array(
+            'A_Dynamic_Thumbnails_Storage_Driver'	=> 'adapter.dynamic_thumbnails_storage_driver.php',
+            'A_Dynamic_Thumbnail_Routes' 			=> 'adapter.dynamic_thumbnail_routes.php',
+            'C_Dynamic_Thumbnails_Installer'		=> 'class.dynamic_thumbnails_installer.php',
+            'C_Dynamic_Thumbnails_Controller' 		=> 'class.dynamic_thumbnails_controller.php',
+            'C_Dynamic_Thumbnails_Manager' 			=> 'class.dynamic_thumbnails_manager.php',
+            'I_Dynamic_Thumbnails_Controller' 		=> 'interface.dynamic_thumbnails_controller.php',
+            'I_Dynamic_Thumbnails_Manager' 			=> 'interface.dynamic_thumbnails_manager.php'
+        );
+    }
+
+}
+
+new M_Dynamic_Thumbnails();
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_thumbnails/static/invalid_image.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_thumbnails/static/invalid_image.png
new file mode 100644
index 0000000000000000000000000000000000000000..c7c5af285befadb65f76cd447376e76c6119ec65
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_thumbnails/static/invalid_image.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/frame_communication/class.frame_communication_installer.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/frame_communication/class.frame_communication_installer.php
new file mode 100644
index 0000000000000000000000000000000000000000..e810156488457db3968f40a67163ce08b6504de2
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/frame_communication/class.frame_communication_installer.php
@@ -0,0 +1,14 @@
+<?php
+
+class C_Frame_Communication_Installer
+{
+	function __construct()
+	{
+		$this->settings = C_NextGen_Settings::get_instance();
+	}
+
+	function install()
+	{
+		$this->settings->set_default_value('frame_communication_option_name', 'X-Frame-Events');
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/frame_communication/class.frame_event_publisher.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/frame_communication/class.frame_event_publisher.php
new file mode 100644
index 0000000000000000000000000000000000000000..63a15508d3dbb9930cd5ce22c6906be4f5810f25
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/frame_communication/class.frame_event_publisher.php
@@ -0,0 +1,79 @@
+<?php
+
+class C_Frame_Event_Publisher extends C_Component
+{
+	static $_instances	= array();
+	var $setting_name	= NULL;
+
+	function define($context=FALSE)
+	{
+		parent::define($context);
+		$this->add_mixin('Mixin_Frame_Event_Publisher');
+		$this->implement('I_Frame_Event_Publisher');
+	}
+
+	function initialize()
+	{
+		parent::initialize();
+		$this->setting_name = C_NextGen_Settings::get_instance()->frame_communication_option_name;
+	}
+
+	/**
+	 * Gets an instance of the publisher
+	 * @param string $context
+	 * @return C_Frame_Event_Publisher
+	 */
+	static function get_instance($context=FALSE)
+	{
+		if (!isset(self::$_instances[$context])) {
+			$klass = get_class();
+			self::$_instances[$context] = new $klass($context);
+		}
+		return self::$_instances[$context];
+	}
+}
+
+class Mixin_Frame_Event_Publisher extends Mixin
+{
+	/**
+	 * Encodes data for a setting
+	 * @param array $data
+	 * @return string
+	 */
+	function _encode($data)
+	{
+		return rawurlencode(json_encode($data));
+	}
+
+	/**
+	 * Decodes data from a setting
+	 * @param string $data
+	 * @return array
+	 */
+	function _decode($data)
+	{
+		return (array)json_decode(rawurldecode($data));
+	}
+
+	/**
+	 * Adds a setting to the frame events
+	 * @param type $data
+	 * @return type
+	 */
+	function add_event($data)
+	{
+		$id			= md5(serialize($data));
+		$data['context'] = $this->object->context;
+
+		$write_cookie = TRUE;
+		if (defined('XMLRPC_REQUEST')) {
+			$write_cookie = XMLRPC_REQUEST == FALSE;
+		}
+
+		if ($write_cookie) {
+			setrawcookie($this->object->setting_name.'_'.$id,$this->object->_encode($data));
+		}
+
+		return $data;
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/frame_communication/interface.frame_event_publisher.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/frame_communication/interface.frame_event_publisher.php
new file mode 100644
index 0000000000000000000000000000000000000000..a861a87354550b30073b8c40fa648588d3b602a0
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/frame_communication/interface.frame_event_publisher.php
@@ -0,0 +1,6 @@
+<?php
+
+interface I_Frame_Event_Publisher
+{
+	
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/frame_communication/module.frame_communication.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/frame_communication/module.frame_communication.php
new file mode 100644
index 0000000000000000000000000000000000000000..211dce039359a59effd82d82a3ad36e2cf5f4b2a
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/frame_communication/module.frame_communication.php
@@ -0,0 +1,66 @@
+<?php
+
+/***
+    {
+        Module: photocrati-frame_communication,
+		Depends: { photocrati-router }
+    }
+***/
+
+class M_Frame_Communication extends C_Base_Module
+{
+	function define($context=FALSE)
+	{
+		parent::define(
+			'photocrati-frame_communication',
+			'Frame/iFrame Inter-Communication',
+			'Provides a means for HTML frames to share server-side events with each other',
+			'0.2',
+			'http://www.nextgen-gallery.com',
+			'Photocrati Media',
+			'http://www.photocrati.com',
+			$context
+		);
+
+		include_once('class.frame_communication_installer.php');
+		C_Photocrati_Installer::add_handler($this->module_id, 'C_Frame_Communication_Installer');
+	}
+
+	function _register_utilities()
+	{
+		$this->get_registry()->add_utility(
+			'I_Frame_Event_Publisher', 'C_Frame_Event_Publisher'
+		);
+	}
+
+	function _register_hooks()
+	{
+		add_action('init', array($this, 'enqueue_admin_scripts'));
+
+	}
+
+	function enqueue_admin_scripts()
+	{
+		$router = $this->get_registry()->get_utility('I_Router');
+
+		wp_register_script(
+			'frame_event_publisher',
+			$router->get_static_url('photocrati-frame_communication#frame_event_publisher.js'),
+			array('jquery')
+		);
+		
+		if (is_admin())
+			wp_enqueue_script('frame_event_publisher');
+	}
+
+    function get_type_list()
+    {
+        return array(
+            'C_Frame_Communication_Installer'	=> 'class.frame_communication_installer.php',
+            'C_Frame_Event_Publisher' 			=> 'class.frame_event_publisher.php',
+            'I_Frame_Event_Publisher' 			=> 'interface.frame_event_publisher.php'
+        );
+    }
+}
+
+new M_Frame_Communication();
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/frame_communication/static/frame_event_publisher.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/frame_communication/static/frame_event_publisher.js
new file mode 100644
index 0000000000000000000000000000000000000000..2246c85b205b20d74b31affe9094190fee18f2ac
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/frame_communication/static/frame_event_publisher.js
@@ -0,0 +1,162 @@
+window.Frame_Event_Publisher = {
+	id: window.name,
+	cookie_name: 'X-Frame-Events',
+	received: [],
+	initialized: false,
+	children: {},
+
+	is_parent: function(){
+		return self.parent.document === self.document;
+	},
+
+	is_child: function(){
+		return !this.is_parent();
+	},
+
+	setup_ajax_handlers: function() {
+		var publisher = this;
+		jQuery(document).ajaxComplete(function(e, xhr, settings) {
+			setTimeout(function() {
+				publisher.ajax_handler();
+			}, 0);
+		});
+	},
+
+    ajax_handler: function() {
+        this.broadcast(this.get_events(document.cookie));
+    },
+
+	initialize: function(){
+		this.setup_ajax_handlers();
+		if (this.id.length == 0) this.id = "Unknown";
+		this.received = this.get_events(document.cookie);
+		this.initialized = true;
+		if (this.is_parent()) this.emit(this.received, true);
+		return this.received;
+	},
+
+	register_child: function(child) {
+		this.children[child.id] = child;
+	},
+
+	broadcast: function(events, child){
+		if (!this.initialized) events = this.initialize();
+		if (this.is_child()) {
+			if (arguments.length <= 1) child = window;
+			this.find_parent(child).register_child(child.Frame_Event_Publisher);
+			this.notify_parent(events, child);
+		}
+		else {
+			if (arguments.length == 0) events = this.received;
+			this.notify_children(events);
+		}
+
+	},
+
+	/**
+	 * Notifies the parent with a list of events to broadcast
+	 */
+	notify_parent: function(events, child){
+		this.find_parent(child).broadcast(events, child);
+	},
+
+	/**
+	 * Notifies (broadcasts) to children the list of available events
+	 */
+	notify_children: function(events){
+		this.emit(events);
+		for (var index in this.children) {
+			var child = this.children[index];
+			try {
+				child.emit(events);
+			}
+			catch (ex) {
+				if (typeof(console) != "undefined") console.log(ex);
+				delete this.children.index;
+			}
+		}
+	},
+
+	/**
+	 * Finds the parent window for the current child window
+	 */
+	find_parent: function(child){
+		var retval = child;
+		try {
+			while (retval.document !== retval.parent.document) retval = retval.parent;
+		}
+		catch (ex){
+			if (typeof(console) != "undefined") console.log(ex);
+		}
+		return retval.Frame_Event_Publisher;
+	},
+
+	/**
+	 * Emits all known events to all children
+	 */
+	emit: function(events, forced){
+		if (typeof(forced) == "undefined") forced = false;
+		for (var event_id in events) {
+			var event = events[event_id];
+			if (!forced && !this.has_received_event(event_id)) {
+				if (typeof(console) != "undefined") console.log("Emitting "+event_id+":"+event.event+" to "+this.id);
+				this.trigger_event(event_id, events[event_id]);
+			}
+		}
+	},
+
+	has_received_event: function(id){
+		return this.received[id] != undefined;
+	},
+
+	trigger_event: function(id, event){
+		var signal = event.context+':'+event.event;
+		event.id = id;
+		if (typeof(window) != "undefined") jQuery(window).trigger(signal, event);
+		this.received[id] = event;
+	},
+
+	/**
+	 * Parses the events found in the cookie
+	 */
+	get_events: function(cookie){
+		var frame_events = {};
+		var cookies = cookie.split(' ');
+		try {
+			for (var i=0; i<cookies.length; i++) {
+				var current_cookie = cookies[i];
+				var parts = current_cookie.match(/X-Frame-Events_([^=]+)=(.*)/);
+				if (parts) {
+					var event_id = parts[1];
+					var event_data = parts[2].replace(/;$/, '');
+					frame_events[event_id] = JSON.parse(unescape(event_data));
+					var cookie_name = 'X-Frame-Events_'+event_id;
+					this.delete_cookie(cookie_name);
+				}
+			}
+		}
+		catch (Exception) {}
+		return frame_events;
+	},
+
+	delete_cookie: function(cookie){
+		var date = new Date();
+		document.cookie = cookie+'=; expires='+date.toGMTString()+';';
+	},
+
+	listen_for: function(signal, callback){
+		var publisher = this;
+		jQuery(window).bind(signal, function(e, event){
+			var context = event.context;
+			var event_id = event.id;
+			if (!publisher.has_received_event(event_id)) {
+				callback.call(publisher, event);
+				publisher.received[event_id] = event;
+			}
+		});
+	}
+}
+
+jQuery(function($){
+	Frame_Event_Publisher.broadcast();
+});
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/fs/class.fs.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/fs/class.fs.php
new file mode 100644
index 0000000000000000000000000000000000000000..e6b4a055202a518f2be24f041f1cb28da44a05a9
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/fs/class.fs.php
@@ -0,0 +1,368 @@
+<?php
+
+class C_Fs extends C_Component
+{
+	static	$_instances = array();
+	var		$_document_root;
+
+	/**
+	 * Gets an instance of the FS utility
+	 * @param mixed $context
+	 * @return C_Fs
+	 */
+	static function &get_instance($context=FALSE)
+	{
+		if (!isset(self::$_instances[$context])) {
+			$klass = get_class();
+			self::$_instances[$context] = new $klass($context);
+		}
+		return self::$_instances[$context];
+	}
+
+	/**
+	 * Defines the instance of the FS utility
+	 * @param mixed $context	the context in this case is the product
+	 */
+	function define($context=FALSE)
+	{
+		parent::define($context);
+		$this->add_mixin('Mixin_Fs_Instance_Methods');
+		$this->implement('I_Fs');
+	}
+
+	function initialize()
+	{
+		parent::initialize();
+		$this->_document_root = $this->set_document_root($_SERVER['DOCUMENT_ROOT']);
+	}
+}
+
+class Mixin_Fs_Instance_Methods extends Mixin
+{
+    
+        function add_trailing_slash($path)
+        {
+            if (substr($path, -1) != '/') $path .= '/';
+            return $path;
+        }
+    
+    
+        /**
+         * Returns a calculated path to a file
+         * @param string $path
+         * @param string $module
+         * @param boolean $relpath
+         * @returns string
+         */
+        function get_abspath($path, $module=FALSE, $relpath=FALSE)
+        {
+            // Wel'l assume that we're to calculate the path relative to
+            // the site document root
+            $retval = $path;
+            if (strpos($path, $this->get_document_root()) === FALSE) {
+                $retval = $this->join_paths(
+                    $this->get_document_root(),
+                    $path
+                );
+            }
+            
+            // If a module is provided, then we should calculate the path
+            // relative to the module directory
+            if ($module) {
+                if (($module_dir = $this->get_registry()->get_module_dir($module))) {
+                    $retval = $this->join_paths($module_dir, $path);
+                }
+                else {
+                    $retval = $this->join_path(
+                        $this->get_document_root(), $module, $path
+                    );
+                }
+            }
+            
+            // Return the calculated path relative to the document root
+            if ($relpath) $retval = $this->object->remove_path_segment(
+                $retval, $this->get_document_root()
+            );
+            
+            return $retval;
+        }
+        
+        
+        /**
+         * Returns a calculated relpath to a particular file
+         * @param string $path
+         * @param string $module
+         * @return string
+         */
+        function get_relpath($path, $module=FALSE)
+        {
+            return $this->object->get_abspath($path, $module, TRUE);
+        }
+        
+        /**
+         * Removes a path segment from a url or filesystem path
+         * @param string $path
+         * @param string $segment
+         * @return string
+         */
+        function remove_path_segment($path, $segment)
+        {
+            if (substr($segment, -1) == '/') $segment = substr($segment, 0, -1);
+            $parts = explode($segment, $path);
+            return $this->join_paths($parts);
+        }
+    
+    
+	/**
+	 * Gets the absolute path to a file/directory for a specific Pope product
+     *
+     * If the path doesn't exist, then NULL is returned
+	 * @param string $path
+	 * @param string $module
+     * @returns string|NULL
+	 */
+	function find_abspath($path, $module=FALSE, $relpath=FALSE, $search_paths=array())
+	{
+		$retval = NULL;
+
+        // Ensure that we weren't passed a module id in the path
+        if (!$module)
+            list($path, $module) = $this->object->parse_formatted_path($path);
+
+		if (@file_exists($path))
+        {
+            $retval = $path;
+        }
+		else {
+
+			// Ensure that we know where to search for the file
+			if (!$search_paths)
+                $search_paths = $this->object->get_search_paths($path, $module);
+
+            // See if the file is located under one of the search paths directly
+            foreach ($search_paths as $dir) {
+                if (@file_exists($this->join_paths($dir, $path))) {
+                    $retval = $this->join_paths($dir, $path);
+                    break;
+                }
+            }
+
+            // Use rglob to find the file
+            if (!$retval) foreach ($search_paths as $dir) {
+                if (($retval = $this->object->_rglob($dir, $path))) {
+                    break;
+                }
+            }
+
+            // Return the relative path if we're to do so
+            if ($relpath) {
+                $retval = $this->object->remove_path_segment($retval, $this->get_document_root());
+            }
+        }
+
+        return $retval;
+    }
+
+	/**
+	 * Returns a list of directories to search for a particular filename
+	 * @param string $path
+	 * @param string $module
+	 * @return array
+	 */
+	function get_search_paths($path, $module=FALSE)
+	{
+		$append_module = FALSE;
+
+		// Ensure that we weren't passed a module id in the path
+		if (!$module) list($path, $module) = $this->object->parse_formatted_path($path);
+
+		// Directories to search
+		$directories = array();
+
+		// If a name of a module has been provided, then we need to search within
+		// that directory first
+		if ($module) {
+
+			// Were we given a module id?
+			if (($module_dir = $this->get_registry()->get_module_dir($module))) {
+				$directories[] = $module_dir;
+			}
+			else {
+				$append_module = TRUE;
+			}
+		}
+
+		// Add product's module directories
+		foreach ($this->get_registry()->get_product_list() as $product_id) {
+			$product_dir = $this->get_registry()->get_product_module_path($product_id);
+			if ($append_module) $directories[] = $this->join_paths(
+				$product_dir, $module
+			);
+			$directories[] = $product_dir;
+		}
+
+		// If all else fails, we search from the document root
+		$directories[] = $this->get_document_root();
+
+		return $directories;
+	}
+
+	/**
+	 * Searches for a file recursively
+     *
+	 * @param string $base_path
+	 * @param string $file
+	 * @return string
+	 */
+	function _rglob($base_path, $file)
+	{
+		$retval = NULL;
+
+		$results = @file_exists($this->join_paths($base_path, $file));
+
+		// Must be located in a sub-directory
+		if (!$results)
+        {
+            // the modules cache a list of all their files when they are initialized. Ask POPE for our current
+            // modules and inspect their file listing to determine which module provides what we need
+            $modules = $this->object->get_registry()->get_module_list();
+            foreach ($modules as $module) {
+                $module_file_list = array_values($this->object->get_registry()->get_module($module)->get_type_list());
+                $module_dir = $this->object->get_registry()->get_module_dir($module);
+
+                $variations = array(
+                    $file,
+                    ltrim($file, DIRECTORY_SEPARATOR)
+                );
+
+                foreach ($variations as $variant) {
+                    if (in_array($variant, $module_file_list))
+                    {
+                        $retval = $this->join_paths($module_dir, $variant);
+                        break 2;
+                    }
+                }
+            }
+		}
+		else {
+            $retval = $this->join_paths($base_path, $file);
+        }
+
+		return $retval;
+	}
+
+	/**
+	 * Gets the relative path to a file/directory for a specific Pope product.
+         * If the path doesn't exist, then NULL is returned
+	 * @param type $path
+	 * @param type $module
+         * @returns string|NULL
+	 */
+	function find_relpath($path, $module=FALSE)
+	{
+		return $this->object->find_abspath($path, $module, TRUE);
+	}
+
+
+	/**
+	 * Joins multiple path segments together
+	 * @return string
+	 */
+	function join_paths()
+	{
+		$segments = array();
+		$retval = array();
+        $protocol = NULL;
+		$params = func_get_args();
+		$this->_flatten_array($params, $segments);
+
+        // if a protocol exists strip it from the string and store it for later
+        $pattern = "#^[a-zA-Z].+://#i";
+        preg_match($pattern, $segments[0], $matches);
+        if (!empty($matches)) {
+            $protocol = reset($matches);
+            $segments[0] = preg_replace($pattern, '', $segments[0], 1);
+        }
+
+		foreach ($segments as $segment) {
+            $segment = trim($segment, '/\\');
+            $pieces = array_values(preg_split('/[\/\\\\]/', $segment));
+
+            // determine if each piece should be appended to $retval
+            foreach ($pieces as $ndx => $val) {
+                if ($val === '') continue;
+                $one = array_search($val, $retval);
+                $two = array_search($val, $pieces);
+                $one = (FALSE === $one ? 0 : count($one) + 1);
+                $two = (FALSE === $two ? 0 : count($two) + 1);
+                if (!empty($protocol)) {
+					$existing_val = isset($retval[$ndx]) ? $retval[$ndx] : NULL;
+                    if ($existing_val !== $val || $two >= $one)
+                        $retval[] = $val;
+                }
+                else {
+					$existing_val = isset($retval[$ndx]) ? $retval[$ndx] : NULL;
+                    if ($existing_val !== $val && $two >= $one)
+                        $retval[] = $val;
+                }
+            }
+
+		}
+
+		$retval = $protocol . implode('/', $retval);
+
+        if ((empty($protocol) && 'WINNT' !== PHP_OS)
+            && strpos($retval, '/') !== 0
+            && is_null($protocol)
+            && !@file_exists($retval))
+        {
+            $retval = '/' . $retval;
+        }
+
+		return $retval;
+	}
+
+	function _flatten_array($obj, &$arr)
+	{
+		if (is_array($obj)) {
+			foreach ($obj as $inner_obj) $this->_flatten_array($inner_obj, $arr);
+		}
+		elseif ($obj) $arr[] = $obj;
+	}
+
+	/**
+	 * Parses the path for a module and filename
+	 * @param string $str
+	 */
+	function parse_formatted_path($str)
+	{
+		$module = FALSE;
+		$path	= $str;
+		$parts	= explode('#', $path);
+		if (count($parts) > 1) {
+			$module = array_shift($parts);
+			$path   = array_shift($parts);
+		}
+		return array($path, $module);
+	}
+
+	/**
+	 * Gets the document root for this application
+	 * @return string
+	 */
+	function get_document_root()
+	{
+		return $this->_document_root;
+	}
+
+	/**
+	 * Sets the document root for this application
+	 * @param type $value
+	 * @return type
+	 */
+	function set_document_root($value)
+	{
+        // Even for windows hosts we force '/' as the path separator
+		return $this->_document_root = untrailingslashit(str_replace('\\', '/', $value));
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/fs/interface.fs.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/fs/interface.fs.php
new file mode 100644
index 0000000000000000000000000000000000000000..4e8325329b120f19f0003d636084b58b852820de
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/fs/interface.fs.php
@@ -0,0 +1,6 @@
+<?php
+
+interface I_Fs
+{
+	
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/fs/module.fs.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/fs/module.fs.php
new file mode 100644
index 0000000000000000000000000000000000000000..b2c5fba69d5d74d56163a97c82ce88cb31a24ec0
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/fs/module.fs.php
@@ -0,0 +1,36 @@
+<?php
+/*
+{
+	Module: photocrati-fs
+}
+ */
+class M_Fs extends C_Base_Module
+{
+	function define()
+	{
+		parent::define(
+			'photocrati-fs',
+			'Filesystem',
+			'Provides a filesystem abstraction layer for Pope modules',
+			'0.2',
+			'http://www.photocrati.com',
+			'Photocrati Media',
+			'http://www.photocrati.com'
+		);
+	}
+
+	function _register_utilities()
+	{
+		$this->get_registry()->add_utility('I_Fs', 'C_Fs');
+	}
+
+    function get_type_list()
+    {
+        return array(
+            'C_Fs' => 'class.fs.php',
+            'I_Fs' => 'interface.fs.php'
+        );
+    }
+}
+
+new M_Fs;
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/adapter.lightbox_factory.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/adapter.lightbox_factory.php
new file mode 100644
index 0000000000000000000000000000000000000000..11bb2da5755422c05d9323ee04c39ef3e3c85ff2
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/adapter.lightbox_factory.php
@@ -0,0 +1,14 @@
+<?php
+
+class A_Lightbox_Factory extends Mixin
+{
+	function lightbox_library($mapper=FALSE, $properties=array(), $context=FALSE)
+	{
+		return new C_Lightbox_Library($mapper, $properties, $context);
+	}
+
+	function lightbox($mapper=FALSE, $properties=array(), $context=FALSE)
+	{
+		return $this->object->lightbox_library($mapper, $properties, $context);
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/adapter.lightbox_library_form.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/adapter.lightbox_library_form.php
new file mode 100644
index 0000000000000000000000000000000000000000..1bf00c46476e21c5f70bcfb08120d3b7286b4c59
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/adapter.lightbox_library_form.php
@@ -0,0 +1,66 @@
+<?php
+
+class A_Lightbox_Library_Form extends Mixin
+{
+    function get_model()
+    {
+        return $this->object
+                    ->get_registry()
+                    ->get_utility('I_Lightbox_Library_Mapper')
+                    ->find_by_name($this->object->context, TRUE);
+    }
+
+    /**
+     * Returns a list of fields to render on the settings page
+     */
+    function _get_field_names()
+    {
+        return array(
+            'lightbox_library_code',
+            'lightbox_library_css_stylesheets',
+            'lightbox_library_scripts'
+        );
+    }
+
+    /**
+     * @param $lightbox
+     * @return mixed
+     */
+    function _render_lightbox_library_code_field($lightbox)
+    {
+        return $this->_render_text_field(
+            $lightbox,
+            'code',
+            'Code',
+            $lightbox->code
+        );
+    }
+
+    /**
+     * @param $lightbox
+     * @return mixed
+     */
+    function _render_lightbox_library_css_stylesheets_field($lightbox)
+    {
+        return $this->_render_textarea_field(
+            $lightbox,
+            'css_stylesheets',
+            'Stylesheet URL',
+            $lightbox->css_stylesheets
+        );
+    }
+
+    /**
+     * @param $lightbox
+     * @return mixed
+     */
+    function _render_lightbox_library_scripts_field($lightbox)
+    {
+        return $this->_render_textarea_field(
+            $lightbox,
+            'scripts',
+            'Javascript URL',
+            $lightbox->scripts
+        );
+    }
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php
new file mode 100644
index 0000000000000000000000000000000000000000..4074eeb438b7c2b49d44b7c43212038fa6f04e86
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php
@@ -0,0 +1,176 @@
+<?php
+
+class C_Lightbox_Installer
+{
+	function __construct()
+	{
+		$this->registry = C_Component_Registry::get_instance();
+		$this->router   = $this->registry->get_utility('I_Router');
+		$this->mapper   = $this->registry->get_utility('I_Lightbox_Library_Mapper');
+	}
+
+
+	function set_attr(&$obj, $key, $val)
+	{
+		if (!isset($obj->$key))
+			$obj->$key = $val;
+	}
+
+	/**
+	 * Installs a lightbox library
+	 * @param string $name
+	 * @param string $code
+	 * @param array $stylesheet_paths
+	 * @param array $script_paths
+	 * @param array $values
+	 */
+	function install_lightbox($name, $title, $code, $stylesheet_paths=array(), $script_paths=array(), $values=array())
+	{
+		// Try to find the existing lightbox. If we can't find it, we'll create
+		$lightbox		= $this->mapper->find_by_name($name);
+		if (!$lightbox)
+			$lightbox = new stdClass;
+
+		$styles  = array();
+		foreach ($stylesheet_paths as $stylesheet) {
+			if (preg_match("/http(s)?/", $stylesheet))
+				$styles[] = $stylesheet;
+			else
+				$styles[] = $this->router->get_static_url($stylesheet);
+		}
+
+		$scripts = array();
+		foreach ($script_paths as $script) {
+			if (preg_match("/http(s)?/", $script))
+				$scripts[] = $script;
+			else
+				$scripts[] = $this->router->get_static_url($script);
+		}
+
+		// Set properties
+		$lightbox->name	= $name;
+        $this->set_attr($lightbox, 'title', $title);
+		$this->set_attr($lightbox, 'code', $code);
+		$this->set_attr($lightbox, 'values', $values);
+		$this->set_attr($lightbox, 'css_stylesheets', implode("\n", $styles));
+		$this->set_attr($lightbox, 'scripts', implode("\n", $scripts));
+
+		// Save the lightbox
+		$this->mapper->save($lightbox);
+	}
+
+	/**
+	 * Uninstalls an existing lightbox
+	 * @param string $name
+	 */
+	function uninstall_lightbox($name)
+	{
+		if (($lightbox = $this->mapper->find_by_name($name))) {
+			$this->mapper->destroy($lightbox);
+		}
+	}
+
+	/**
+	 * Installs all of the lightbox provided by this module
+	 */
+	function install()
+	{
+        // Install "None" option
+        $this->install_lightbox(
+            'none',
+            'No lightbox',
+            '',
+            array(),
+            array()
+        );
+
+		$this->install_lightbox(
+			'lightbox',
+            'Lightbox',
+			"class='ngg_lightbox'",
+			array('photocrati-lightbox#jquery.lightbox/jquery.lightbox-0.5.css'),
+			array(
+				'photocrati-lightbox#jquery.lightbox/jquery.lightbox-0.5.min.js',
+				'photocrati-lightbox#jquery.lightbox/nextgen_lightbox_init.js'
+			),
+			array(
+				'nextgen_lightbox_loading_img_url'	=>
+				$this->router->get_static_url('photocrati-lightbox#jquery.lightbox/lightbox-ico-loading.gif'),
+
+				'nextgen_lightbox_close_btn_url'	=>
+				$this->router->get_static_url('photocrati-lightbox#jquery.lightbox/lightbox-btn-close.gif'),
+
+				'nextgen_lightbox_btn_prev_url'		=>
+				$this->router->get_static_url('photocrati-lightbox#jquery.lightbox/lightbox-btn-prev.gif'),
+
+				'nextgen_lightbox_btn_next_url'		=>
+				$this->router->get_static_url('photocrati-lightbox#jquery.lightbox/lightbox-btn-next.gif'),
+
+				'nextgen_lightbox_blank_img_url'	=>
+				$this->router->get_static_url('photocrati-lightbox#jquery.lightbox/lightbox-blank.gif')
+			)
+		);
+
+		// Install Fancybox 1.3.4
+		$this->install_lightbox(
+			'fancybox',
+            'Fancybox',
+			'class="ngg-fancybox" rel="%GALLERY_NAME%"',
+			array('photocrati-lightbox#fancybox/jquery.fancybox-1.3.4.css'),
+			array(
+				'photocrati-lightbox#fancybox/jquery.easing-1.3.pack.js',
+				'photocrati-lightbox#fancybox/jquery.fancybox-1.3.4.pack.js',
+				'photocrati-lightbox#fancybox/nextgen_fancybox_init.js'
+			)
+		);
+
+		// Install highslide
+		$this->install_lightbox(
+			'highslide',
+            'Highslide',
+			'class="highslide" onclick="return hs.expand(this, {slideshowGroup: ' . "'%GALLERY_NAME%'" . '});"',
+			array('photocrati-lightbox#highslide/highslide.css'),
+			array('photocrati-lightbox#highslide/highslide-full.packed.js', 'photocrati-lightbox#highslide/nextgen_highslide_init.js'),
+			array('nextgen_highslide_graphics_dir' => $this->router->get_static_url('photocrati-lightbox#highslide/graphics'))
+		);
+
+		// Install Shutter
+		$this->install_lightbox(
+			'shutter',
+            'Shutter',
+			'class="shutterset_%GALLERY_NAME%"',
+			array('photocrati-lightbox#shutter/shutter.css'),
+			array('photocrati-lightbox#shutter/shutter.js', 'photocrati-lightbox#shutter/nextgen_shutter.js'),
+			array(
+				'msgLoading'	=>	'L O A D I N G',
+				'msgClose'		=>	'Click to Close',
+			)
+		);
+
+		// Install Shutter Reloaded
+		$this->install_lightbox(
+			'shutter2',
+            'Shutter 2',
+			'class="shutterset_%GALLERY_NAME%"',
+			array('photocrati-lightbox#shutter_reloaded/shutter.css'),
+			array('photocrati-lightbox#shutter_reloaded/shutter.js', 'photocrati-lightbox#shutter_reloaded/nextgen_shutter_reloaded.js')
+		);
+
+		// Install Thickbox
+		$this->install_lightbox(
+			'thickbox',
+            'Thickbox',
+			"class='thickbox' rel='%GALLERY_NAME%'",
+			array(includes_url('/js/thickbox/thickbox.css')),
+			array('photocrati-lightbox#thickbox/nextgen_thickbox_init.js', includes_url('/js/thickbox/thickbox.js'))
+		);
+	}
+
+	/**
+	 * Uninstalls all lightboxes
+	 */
+	function uninstall($hard = FALSE)
+	{
+        $this->mapper->delete()->run_query();
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/class.lightbox_library.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/class.lightbox_library.php
new file mode 100644
index 0000000000000000000000000000000000000000..e0fabafed7772cfa4ceaa915b9b8c4ae0919505e
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/class.lightbox_library.php
@@ -0,0 +1,31 @@
+<?php
+
+/**
+ * Provides an entity for Lightbox Libraries.
+ *
+ * Properties:
+ * - name
+ * - code
+ * - css_stylesheets
+ * - scripts
+ */
+class C_Lightbox_Library extends C_DataMapper_Model
+{
+	function define($mapper, $properties, $context=FALSE)
+	{
+		parent::define($mapper, $properties, $context);
+		$this->add_mixin('Mixin_Lightbox_Library_Validation');
+		$this->implement('I_Lightbox_Library');
+	}
+}
+
+class Mixin_Lightbox_Library_Validation extends Mixin
+{
+	function validation()
+	{
+		$this->object->validates_presence_of('name');
+		$this->object->validates_uniqueness_of('name');
+
+		return $this->object->is_valid();
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/class.lightbox_library_mapper.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/class.lightbox_library_mapper.php
new file mode 100644
index 0000000000000000000000000000000000000000..61d57022cdcf17b6a371f3acf766d43188160ab1
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/class.lightbox_library_mapper.php
@@ -0,0 +1,83 @@
+<?php
+
+/**
+ * Provides CRUD operations for lightbox libraries
+ */
+class C_Lightbox_Library_Mapper extends C_CustomPost_DataMapper_Driver
+{
+	static $_instances = array();
+
+	/**
+	 * Defines the lightbox library datamapper
+	 * @param type $context
+	 */
+	function define($context = FALSE)
+	{
+		if (!is_array($context)) $context = array($context);
+		array_push($context, 'lightbox_library');
+		parent::define('lightbox_library', $context);
+		$this->add_mixin('Mixin_Lightbox_Library_Mapper');
+		$this->implement('I_Lightbox_Library_Mapper');
+		$this->set_model_factory_method('lightbox_library');
+	}
+
+	/**
+	 * Initializes the datamapper
+	 */
+	function initialize()
+	{
+		parent::initialize('lightbox_library');
+	}
+
+	/**
+	 * Returns an instance of the mapper
+	 * @param string|FALSE $context
+	 * @return C_Lightbox_Library_Mapper
+	 */
+	static function get_instance($context=FALSE)
+	{
+		$klass = get_class();
+		if (!isset(self::$_instances[$context])) {
+			self::$_instances[$context] = new $klass($context);
+		}
+		return self::$_instances[$context];
+	}
+}
+
+class Mixin_Lightbox_Library_Mapper
+{
+	/**
+	 * Uses the name property as the post title when the Custom Post driver
+	 * is used
+	 * @param stdClass $entity
+	 * @return string
+	 */
+	function get_post_title($entity)
+	{
+		return $entity->name;
+	}
+
+
+	/**
+	 * Selects a lightbox library by name
+	 * @param string $name
+	 * @param type $model
+	 */
+	function find_by_name($name, $model=FALSE)
+	{
+		$results = $this->object->select()->where(array('name = %s', $name))->run_query(FALSE, $model);
+		if ($results) $results = $results[0];
+		return $results;
+	}
+
+	/**
+	 * Sets default values for the lightbox library
+	 * @param stdClass|C_DataMapper_Model $entity
+	 */
+	function set_defaults($entity)
+	{
+		$this->object->_set_default_value($entity, 'css_stylesheets', '');
+		$this->object->_set_default_value($entity, 'scripts', '');
+        $this->object->_set_default_value($entity, 'display_settings', array());
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/interface.lightbox_library.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/interface.lightbox_library.php
new file mode 100644
index 0000000000000000000000000000000000000000..3fd5de31a592ce7de87c3c0fe750354f322aa1a1
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/interface.lightbox_library.php
@@ -0,0 +1,6 @@
+<?php
+
+interface I_Lightbox_Library extends I_DataMapper_Model
+{
+	
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/interface.lightbox_library_mapper.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/interface.lightbox_library_mapper.php
new file mode 100644
index 0000000000000000000000000000000000000000..8f8ec61d8c792b14ceb171e9d4a74413ca924abb
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/interface.lightbox_library_mapper.php
@@ -0,0 +1,6 @@
+<?php
+
+interface I_Lightbox_Library_Mapper
+{
+
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/module.lightbox.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/module.lightbox.php
new file mode 100644
index 0000000000000000000000000000000000000000..8e856dba957bae306a3a4a501fd192bfffd1847e
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/module.lightbox.php
@@ -0,0 +1,82 @@
+<?php
+
+/***
+    {
+        Module: photocrati-lightbox,
+        Depends: { photocrati-nextgen_admin }
+    }
+***/
+
+define('NEXTGEN_LIGHTBOX_OPTIONS_SLUG', 'ngg_lightbox_options');
+define('NEXTGEN_LIGHTBOX_ADVANCED_OPTIONS_SLUG', 'ngg_lightbox_advanced_options');
+
+class M_Lightbox extends C_Base_Module
+{
+    function define()
+    {
+        parent::define(
+            'photocrati-lightbox',
+            'Lightbox',
+            _("Provides integration with JQuery's lightbox plugin"),
+            '0.4',
+            'http://leandrovieira.com/projects/jquery/lightbox/',
+            'Photocrati Media',
+            'http://www.photocrati.com'
+        );
+
+		include_once('class.lightbox_installer.php');
+		C_Photocrati_Installer::add_handler($this->module_id, 'C_Lightbox_Installer');
+    }
+
+    function initialize()
+    {
+        parent::initialize();
+        if (is_admin()) {
+			add_action('admin_init', array(&$this, 'add_all_lightbox_forms'));
+		}
+    }
+
+    /**
+     * Adds a configuration form to each library
+     */
+    function add_all_lightbox_forms()
+    {
+        foreach ($this->get_registry()->get_utility('I_Lightbox_Library_Mapper')->find_all() as $lib) {
+            $this->get_registry()->add_adapter('I_Form', 'A_Lightbox_Library_Form', $lib->name);
+            C_Form_Manager::get_instance()->add_form(NEXTGEN_LIGHTBOX_ADVANCED_OPTIONS_SLUG, $lib->name);
+        }
+    }
+
+	function _register_utilities()
+	{
+        // Provides a utility to perform CRUD operations for Lightbox libraries
+		$this->get_registry()->add_utility(
+			'I_Lightbox_Library_Mapper',
+			'C_Lightbox_Library_Mapper'
+		);
+	}
+
+    function _register_adapters()
+    {
+        // Provides factory methods for instantiating lightboxes
+		$this->get_registry()->add_adapter('I_Component_Factory', 'A_Lightbox_Factory');
+
+        // Provides an installer for lightbox libraries
+        $this->get_registry()->add_adapter('I_Installer', 'A_Lightbox_Installer');
+    }
+
+    function get_type_list()
+    {
+        return array(
+            'A_Lightbox_Factory' => 'adapter.lightbox_factory.php',
+            'C_Lightbox_Installer' => 'class.lightbox_installer.php',
+            'A_Lightbox_Library_Form' => 'adapter.lightbox_library_form.php',
+            'C_Lightbox_Library' => 'class.lightbox_library.php',
+            'C_Lightbox_Library_Mapper' => 'class.lightbox_library_mapper.php',
+            'I_Lightbox_Library' => 'interface.lightbox_library.php',
+            'I_Lightbox_Library_Mapper' => 'interface.lightbox_library_mapper.php'
+        );
+    }
+}
+
+new M_Lightbox();
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/blank.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/blank.gif
new file mode 100644
index 0000000000000000000000000000000000000000..35d42e808f0a8017b8d52a06be2f8fec0b466a66
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/blank.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_close.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_close.png
new file mode 100644
index 0000000000000000000000000000000000000000..07035307ad435f8f2f8eedf0bce50f7ec8a858c2
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_close.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_loading.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_loading.png
new file mode 100644
index 0000000000000000000000000000000000000000..2503017960b3972499d3aa92f89953935ae40934
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_loading.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_nav_left.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_nav_left.png
new file mode 100644
index 0000000000000000000000000000000000000000..ebaa6a4fd34e51575a01da366312c20618985cbc
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_nav_left.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_nav_right.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_nav_right.png
new file mode 100644
index 0000000000000000000000000000000000000000..873294e969db9160f5ddd4e1ab498ff60b080e3f
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_nav_right.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_shadow_e.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_shadow_e.png
new file mode 100644
index 0000000000000000000000000000000000000000..2eda0893649371f8d92b92976d8542cdd1b601ed
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_shadow_e.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_shadow_n.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_shadow_n.png
new file mode 100644
index 0000000000000000000000000000000000000000..69aa10e233b039077e7dc600177ddb1eb46217e3
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_shadow_n.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_shadow_ne.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_shadow_ne.png
new file mode 100644
index 0000000000000000000000000000000000000000..79f6980a3ba5c43de120d963dbba2516b8f27ac7
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_shadow_ne.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_shadow_nw.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_shadow_nw.png
new file mode 100644
index 0000000000000000000000000000000000000000..7182cd938ae98e7e28c65a0bc55df576042ff9f5
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_shadow_nw.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_shadow_s.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_shadow_s.png
new file mode 100644
index 0000000000000000000000000000000000000000..d8858bfb78efb8d7268736920efa1eae8873f89c
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_shadow_s.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_shadow_se.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_shadow_se.png
new file mode 100644
index 0000000000000000000000000000000000000000..541e3ffd3e88224b34a4d2097c66a780e6060aeb
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_shadow_se.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_shadow_sw.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_shadow_sw.png
new file mode 100644
index 0000000000000000000000000000000000000000..b451689fa7b57b7432820e4c06d0864c143c79ab
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_shadow_sw.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_shadow_w.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_shadow_w.png
new file mode 100644
index 0000000000000000000000000000000000000000..8a4e4a887f18384a204563c0048c9cd1328f7faa
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_shadow_w.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_title_left.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_title_left.png
new file mode 100644
index 0000000000000000000000000000000000000000..6049223d1ec6af46e100499c01f6489c9e2c6240
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_title_left.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_title_main.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_title_main.png
new file mode 100644
index 0000000000000000000000000000000000000000..8044271f29b5d4e4471570e75cdce90bf9a1497c
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_title_main.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_title_over.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_title_over.png
new file mode 100644
index 0000000000000000000000000000000000000000..d9f458f4bb8770466e44ba97dd8fe1f2936090db
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_title_over.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_title_right.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_title_right.png
new file mode 100644
index 0000000000000000000000000000000000000000..e36d9db2a7c6e570aec993d3665cbc13620115e2
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancy_title_right.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancybox-x.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancybox-x.png
new file mode 100644
index 0000000000000000000000000000000000000000..c2130f8698f682d68b1550bffedecfe19eaa1a81
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancybox-x.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancybox-y.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancybox-y.png
new file mode 100644
index 0000000000000000000000000000000000000000..7ef399b9908976fc36f760fad7876a4d9c38e006
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancybox-y.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancybox.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancybox.png
new file mode 100644
index 0000000000000000000000000000000000000000..65e14f68fd83b87f75c22c0c074e7b20bf20a133
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/fancybox.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/jquery.easing-1.3.pack.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/jquery.easing-1.3.pack.js
new file mode 100644
index 0000000000000000000000000000000000000000..9028179e7bde19e3c0fdbf9f422c35c4a0d95034
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/jquery.easing-1.3.pack.js
@@ -0,0 +1,72 @@
+/*
+ * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
+ *
+ * Uses the built in easing capabilities added In jQuery 1.1
+ * to offer multiple easing options
+ *
+ * TERMS OF USE - jQuery Easing
+ * 
+ * Open source under the BSD License. 
+ * 
+ * Copyright © 2008 George McGinley Smith
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without modification, 
+ * are permitted provided that the following conditions are met:
+ * 
+ * Redistributions of source code must retain the above copyright notice, this list of 
+ * conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list 
+ * of conditions and the following disclaimer in the documentation and/or other materials 
+ * provided with the distribution.
+ * 
+ * Neither the name of the author nor the names of contributors may be used to endorse 
+ * or promote products derived from this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ *
+*/
+
+// t: current time, b: begInnIng value, c: change In value, d: duration
+eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('h.i[\'1a\']=h.i[\'z\'];h.O(h.i,{y:\'D\',z:9(x,t,b,c,d){6 h.i[h.i.y](x,t,b,c,d)},17:9(x,t,b,c,d){6 c*(t/=d)*t+b},D:9(x,t,b,c,d){6-c*(t/=d)*(t-2)+b},13:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t+b;6-c/2*((--t)*(t-2)-1)+b},X:9(x,t,b,c,d){6 c*(t/=d)*t*t+b},U:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t+1)+b},R:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t+b;6 c/2*((t-=2)*t*t+2)+b},N:9(x,t,b,c,d){6 c*(t/=d)*t*t*t+b},M:9(x,t,b,c,d){6-c*((t=t/d-1)*t*t*t-1)+b},L:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t+b;6-c/2*((t-=2)*t*t*t-2)+b},K:9(x,t,b,c,d){6 c*(t/=d)*t*t*t*t+b},J:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t*t*t+1)+b},I:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t*t+b;6 c/2*((t-=2)*t*t*t*t+2)+b},G:9(x,t,b,c,d){6-c*8.C(t/d*(8.g/2))+c+b},15:9(x,t,b,c,d){6 c*8.n(t/d*(8.g/2))+b},12:9(x,t,b,c,d){6-c/2*(8.C(8.g*t/d)-1)+b},Z:9(x,t,b,c,d){6(t==0)?b:c*8.j(2,10*(t/d-1))+b},Y:9(x,t,b,c,d){6(t==d)?b+c:c*(-8.j(2,-10*t/d)+1)+b},W:9(x,t,b,c,d){e(t==0)6 b;e(t==d)6 b+c;e((t/=d/2)<1)6 c/2*8.j(2,10*(t-1))+b;6 c/2*(-8.j(2,-10*--t)+2)+b},V:9(x,t,b,c,d){6-c*(8.o(1-(t/=d)*t)-1)+b},S:9(x,t,b,c,d){6 c*8.o(1-(t=t/d-1)*t)+b},Q:9(x,t,b,c,d){e((t/=d/2)<1)6-c/2*(8.o(1-t*t)-1)+b;6 c/2*(8.o(1-(t-=2)*t)+1)+b},P:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6-(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b},H:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6 a*8.j(2,-10*t)*8.n((t*d-s)*(2*8.g)/p)+c+b},T:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d/2)==2)6 b+c;e(!p)p=d*(.3*1.5);e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);e(t<1)6-.5*(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b;6 a*8.j(2,-10*(t-=1))*8.n((t*d-s)*(2*8.g)/p)*.5+c+b},F:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*(t/=d)*t*((s+1)*t-s)+b},E:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},16:9(x,t,b,c,d,s){e(s==u)s=1.l;e((t/=d/2)<1)6 c/2*(t*t*(((s*=(1.B))+1)*t-s))+b;6 c/2*((t-=2)*t*(((s*=(1.B))+1)*t+s)+2)+b},A:9(x,t,b,c,d){6 c-h.i.v(x,d-t,0,c,d)+b},v:9(x,t,b,c,d){e((t/=d)<(1/2.k)){6 c*(7.q*t*t)+b}m e(t<(2/2.k)){6 c*(7.q*(t-=(1.5/2.k))*t+.k)+b}m e(t<(2.5/2.k)){6 c*(7.q*(t-=(2.14/2.k))*t+.11)+b}m{6 c*(7.q*(t-=(2.18/2.k))*t+.19)+b}},1b:9(x,t,b,c,d){e(t<d/2)6 h.i.A(x,t*2,0,c,d)*.5+b;6 h.i.v(x,t*2-d,0,c,d)*.5+c*.5+b}});',62,74,'||||||return||Math|function|||||if|var|PI|jQuery|easing|pow|75|70158|else|sin|sqrt||5625|asin|||undefined|easeOutBounce|abs||def|swing|easeInBounce|525|cos|easeOutQuad|easeOutBack|easeInBack|easeInSine|easeOutElastic|easeInOutQuint|easeOutQuint|easeInQuint|easeInOutQuart|easeOutQuart|easeInQuart|extend|easeInElastic|easeInOutCirc|easeInOutCubic|easeOutCirc|easeInOutElastic|easeOutCubic|easeInCirc|easeInOutExpo|easeInCubic|easeOutExpo|easeInExpo||9375|easeInOutSine|easeInOutQuad|25|easeOutSine|easeInOutBack|easeInQuad|625|984375|jswing|easeInOutBounce'.split('|'),0,{}))
+
+/*
+ *
+ * TERMS OF USE - EASING EQUATIONS
+ * 
+ * Open source under the BSD License. 
+ * 
+ * Copyright © 2001 Robert Penner
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without modification, 
+ * are permitted provided that the following conditions are met:
+ * 
+ * Redistributions of source code must retain the above copyright notice, this list of 
+ * conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list 
+ * of conditions and the following disclaimer in the documentation and/or other materials 
+ * provided with the distribution.
+ * 
+ * Neither the name of the author nor the names of contributors may be used to endorse 
+ * or promote products derived from this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ *
+ */
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/jquery.fancybox-1.3.4.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/jquery.fancybox-1.3.4.css
new file mode 100644
index 0000000000000000000000000000000000000000..bc0f15fd1631c27f675a4fe77c46ad12d9b7d0b6
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/jquery.fancybox-1.3.4.css
@@ -0,0 +1,366 @@
+/*
+ * FancyBox - jQuery Plugin
+ * Simple and fancy lightbox alternative
+ *
+ * Examples and documentation at: http://fancybox.net
+ * 
+ * Copyright (c) 2008 - 2010 Janis Skarnelis
+ * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
+ * 
+ * Version: 1.3.4 (11/11/2010)
+ * Requires: jQuery v1.3+
+ *
+ * Dual licensed under the MIT and GPL licenses:
+ *   http://www.opensource.org/licenses/mit-license.php
+ *   http://www.gnu.org/licenses/gpl.html
+ */
+
+#fancybox-loading {
+	position: fixed;
+	top: 50%;
+	left: 50%;
+	width: 40px;
+	height: 40px;
+	margin-top: -20px;
+	margin-left: -20px;
+	cursor: pointer;
+	overflow: hidden;
+	z-index: 1104;
+	display: none;
+}
+
+#fancybox-loading div {
+	position: absolute;
+	top: 0;
+	left: 0;
+	width: 40px;
+	height: 480px;
+	background-image: url('fancybox.png');
+}
+
+#fancybox-overlay {
+	position: absolute;
+	top: 0;
+	left: 0;
+	width: 100%;
+	z-index: 1100;
+	display: none;
+}
+
+#fancybox-tmp {
+	padding: 0;
+	margin: 0;
+	border: 0;
+	overflow: auto;
+	display: none;
+}
+
+#fancybox-wrap {
+	position: absolute;
+	top: 0;
+	left: 0;
+	padding: 20px;
+	z-index: 1101;
+	outline: none;
+	display: none;
+}
+
+#fancybox-outer {
+	position: relative;
+	width: 100%;
+	height: 100%;
+	background: #fff;
+}
+
+#fancybox-content {
+	width: 0;
+	height: 0;
+	padding: 0;
+	outline: none;
+	position: relative;
+	overflow: hidden;
+	z-index: 1102;
+	border: 0px solid #fff;
+}
+
+#fancybox-hide-sel-frame {
+	position: absolute;
+	top: 0;
+	left: 0;
+	width: 100%;
+	height: 100%;
+	background: transparent;
+	z-index: 1101;
+}
+
+#fancybox-close {
+	position: absolute;
+	top: -15px;
+	right: -15px;
+	width: 30px;
+	height: 30px;
+	background: transparent url('fancybox.png') -40px 0px;
+	cursor: pointer;
+	z-index: 1103;
+	display: none;
+}
+
+#fancybox-error {
+	color: #444;
+	font: normal 12px/20px Arial;
+	padding: 14px;
+	margin: 0;
+}
+
+#fancybox-img {
+	width: 100%;
+	height: 100%;
+	padding: 0;
+	margin: 0;
+	border: none;
+	outline: none;
+	line-height: 0;
+	vertical-align: top;
+}
+
+#fancybox-frame {
+	width: 100%;
+	height: 100%;
+	border: none;
+	display: block;
+}
+
+#fancybox-left, #fancybox-right {
+	position: absolute;
+	bottom: 0px;
+	height: 100%;
+	width: 35%;
+	cursor: pointer;
+	outline: none;
+	background: transparent url('blank.gif');
+	z-index: 1102;
+	display: none;
+}
+
+#fancybox-left {
+	left: 0px;
+}
+
+#fancybox-right {
+	right: 0px;
+}
+
+#fancybox-left-ico, #fancybox-right-ico {
+	position: absolute;
+	top: 50%;
+	left: -9999px;
+	width: 30px;
+	height: 30px;
+	margin-top: -15px;
+	cursor: pointer;
+	z-index: 1102;
+	display: block;
+}
+
+#fancybox-left-ico {
+	background-image: url('fancybox.png');
+	background-position: -40px -30px;
+}
+
+#fancybox-right-ico {
+	background-image: url('fancybox.png');
+	background-position: -40px -60px;
+}
+
+#fancybox-left:hover, #fancybox-right:hover {
+	visibility: visible; /* IE6 */
+}
+
+#fancybox-left:hover span {
+	left: 20px;
+}
+
+#fancybox-right:hover span {
+	left: auto;
+	right: 20px;
+}
+
+.fancybox-bg {
+	position: absolute;
+	padding: 0;
+	margin: 0;
+	border: 0;
+	width: 20px;
+	height: 20px;
+	z-index: 1001;
+}
+
+#fancybox-bg-n {
+	top: -20px;
+	left: 0;
+	width: 100%;
+	background-image: url('fancybox-x.png');
+}
+
+#fancybox-bg-ne {
+	top: -20px;
+	right: -20px;
+	background-image: url('fancybox.png');
+	background-position: -40px -162px;
+}
+
+#fancybox-bg-e {
+	top: 0;
+	right: -20px;
+	height: 100%;
+	background-image: url('fancybox-y.png');
+	background-position: -20px 0px;
+}
+
+#fancybox-bg-se {
+	bottom: -20px;
+	right: -20px;
+	background-image: url('fancybox.png');
+	background-position: -40px -182px; 
+}
+
+#fancybox-bg-s {
+	bottom: -20px;
+	left: 0;
+	width: 100%;
+	background-image: url('fancybox-x.png');
+	background-position: 0px -20px;
+}
+
+#fancybox-bg-sw {
+	bottom: -20px;
+	left: -20px;
+	background-image: url('fancybox.png');
+	background-position: -40px -142px;
+}
+
+#fancybox-bg-w {
+	top: 0;
+	left: -20px;
+	height: 100%;
+	background-image: url('fancybox-y.png');
+}
+
+#fancybox-bg-nw {
+	top: -20px;
+	left: -20px;
+	background-image: url('fancybox.png');
+	background-position: -40px -122px;
+}
+
+#fancybox-title {
+	font-family: Helvetica;
+	font-size: 12px;
+	z-index: 1102;
+}
+
+.fancybox-title-inside {
+	padding-bottom: 10px;
+	text-align: center;
+	color: #333;
+	background: #fff;
+	position: relative;
+}
+
+.fancybox-title-outside {
+	padding-top: 10px;
+	color: #fff;
+}
+
+.fancybox-title-over {
+	position: absolute;
+	bottom: 0;
+	left: 0;
+	color: #FFF;
+	text-align: left;
+}
+
+#fancybox-title-over {
+	padding: 10px;
+	background-image: url('fancy_title_over.png');
+	display: block;
+}
+
+.fancybox-title-float {
+	position: absolute;
+	left: 0;
+	bottom: -20px;
+	height: 32px;
+}
+
+#fancybox-title-float-wrap {
+	border: none;
+	border-collapse: collapse;
+	width: auto;
+}
+
+#fancybox-title-float-wrap td {
+	border: none;
+	white-space: nowrap;
+}
+
+#fancybox-title-float-left {
+	padding: 0 0 0 15px;
+	background: url('fancybox.png') -40px -90px no-repeat;
+}
+
+#fancybox-title-float-main {
+	color: #FFF;
+	line-height: 29px;
+	font-weight: bold;
+	padding: 0 0 3px 0;
+	background: url('fancybox-x.png') 0px -40px;
+}
+
+#fancybox-title-float-right {
+	padding: 0 0 0 15px;
+	background: url('fancybox.png') -55px -90px no-repeat;
+}
+
+/* IE6 */
+
+.fancybox-ie6 #fancybox-close { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_close.png', sizingMethod='scale'); }
+
+.fancybox-ie6 #fancybox-left-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_left.png', sizingMethod='scale'); }
+.fancybox-ie6 #fancybox-right-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_right.png', sizingMethod='scale'); }
+
+.fancybox-ie6 #fancybox-title-over { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_over.png', sizingMethod='scale'); zoom: 1; }
+.fancybox-ie6 #fancybox-title-float-left { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_left.png', sizingMethod='scale'); }
+.fancybox-ie6 #fancybox-title-float-main { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_main.png', sizingMethod='scale'); }
+.fancybox-ie6 #fancybox-title-float-right { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_right.png', sizingMethod='scale'); }
+
+.fancybox-ie6 #fancybox-bg-w, .fancybox-ie6 #fancybox-bg-e, .fancybox-ie6 #fancybox-left, .fancybox-ie6 #fancybox-right, #fancybox-hide-sel-frame {
+	height: expression(this.parentNode.clientHeight + "px");
+}
+
+#fancybox-loading.fancybox-ie6 {
+	position: absolute; margin-top: 0;
+	top: expression( (-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px');
+}
+
+#fancybox-loading.fancybox-ie6 div	{ background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_loading.png', sizingMethod='scale'); }
+
+/* IE6, IE7, IE8 */
+
+.fancybox-ie .fancybox-bg { background: transparent !important; }
+
+.fancybox-ie #fancybox-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_n.png', sizingMethod='scale'); }
+.fancybox-ie #fancybox-bg-ne { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_ne.png', sizingMethod='scale'); }
+.fancybox-ie #fancybox-bg-e { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_e.png', sizingMethod='scale'); }
+.fancybox-ie #fancybox-bg-se { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_se.png', sizingMethod='scale'); }
+.fancybox-ie #fancybox-bg-s { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_s.png', sizingMethod='scale'); }
+.fancybox-ie #fancybox-bg-sw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_sw.png', sizingMethod='scale'); }
+.fancybox-ie #fancybox-bg-w { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_w.png', sizingMethod='scale'); }
+.fancybox-ie #fancybox-bg-nw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_nw.png', sizingMethod='scale'); }
+
+/* Note: Prevents issues with "style resets" or themes that apply 'box-sizing: border-box' to everything */
+#fancybox-wrap, #fancybox-content, #fancybox-outer {
+    box-sizing: content-box;
+    -moz-box-sizing: content-box;
+    -webkit-box-sizing: content-box;
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/jquery.fancybox-1.3.4.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/jquery.fancybox-1.3.4.js
new file mode 100644
index 0000000000000000000000000000000000000000..a8520051dc780846e034c9c5ef7a72ce107e9c6c
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/jquery.fancybox-1.3.4.js
@@ -0,0 +1,1156 @@
+/*
+ * FancyBox - jQuery Plugin
+ * Simple and fancy lightbox alternative
+ *
+ * Examples and documentation at: http://fancybox.net
+ *
+ * Copyright (c) 2008 - 2010 Janis Skarnelis
+ * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
+ *
+ * Version: 1.3.4 (11/11/2010)
+ * Requires: jQuery v1.3+
+ *
+ * Dual licensed under the MIT and GPL licenses:
+ *   http://www.opensource.org/licenses/mit-license.php
+ *   http://www.gnu.org/licenses/gpl.html
+ */
+
+;(function($) {
+	var tmp, loading, overlay, wrap, outer, content, close, title, nav_left, nav_right,
+
+		selectedIndex = 0, selectedOpts = {}, selectedArray = [], currentIndex = 0, currentOpts = {}, currentArray = [],
+
+		ajaxLoader = null, imgPreloader = new Image(), imgRegExp = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i, swfRegExp = /[^\.]\.(swf)\s*$/i,
+
+		loadingTimer, loadingFrame = 1,
+
+		titleHeight = 0, titleStr = '', start_pos, final_pos, busy = false, fx = $.extend($('<div/>')[0], { prop: 0 }),
+
+		isIE6 = $.browser.msie && $.browser.version < 7 && !window.XMLHttpRequest,
+
+		/*
+		 * Private methods 
+		 */
+
+		_abort = function() {
+			loading.hide();
+
+			imgPreloader.onerror = imgPreloader.onload = null;
+
+			if (ajaxLoader) {
+				ajaxLoader.abort();
+			}
+
+			tmp.empty();
+		},
+
+		_error = function() {
+			if (false === selectedOpts.onError(selectedArray, selectedIndex, selectedOpts)) {
+				loading.hide();
+				busy = false;
+				return;
+			}
+
+			selectedOpts.titleShow = false;
+
+			selectedOpts.width = 'auto';
+			selectedOpts.height = 'auto';
+
+			tmp.html( '<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>' );
+
+			_process_inline();
+		},
+
+		_start = function() {
+			var obj = selectedArray[ selectedIndex ],
+				href, 
+				type, 
+				title,
+				str,
+				emb,
+				ret;
+
+			_abort();
+
+			selectedOpts = $.extend({}, $.fn.fancybox.defaults, (typeof $(obj).data('fancybox') == 'undefined' ? selectedOpts : $(obj).data('fancybox')));
+
+			ret = selectedOpts.onStart(selectedArray, selectedIndex, selectedOpts);
+
+			if (ret === false) {
+				busy = false;
+				return;
+			} else if (typeof ret == 'object') {
+				selectedOpts = $.extend(selectedOpts, ret);
+			}
+
+			title = selectedOpts.title || (obj.nodeName ? $(obj).attr('title') : obj.title) || '';
+
+			if (obj.nodeName && !selectedOpts.orig) {
+				selectedOpts.orig = $(obj).children("img:first").length ? $(obj).children("img:first") : $(obj);
+			}
+
+			if (title === '' && selectedOpts.orig && selectedOpts.titleFromAlt) {
+				title = selectedOpts.orig.attr('alt');
+			}
+
+			href = selectedOpts.href || (obj.nodeName ? $(obj).attr('href') : obj.href) || null;
+
+			if ((/^(?:javascript)/i).test(href) || href == '#') {
+				href = null;
+			}
+
+			if (selectedOpts.type) {
+				type = selectedOpts.type;
+
+				if (!href) {
+					href = selectedOpts.content;
+				}
+
+			} else if (selectedOpts.content) {
+				type = 'html';
+
+			} else if (href) {
+				if (href.match(imgRegExp)) {
+					type = 'image';
+
+				} else if (href.match(swfRegExp)) {
+					type = 'swf';
+
+				} else if ($(obj).hasClass("iframe")) {
+					type = 'iframe';
+
+				} else if (href.indexOf("#") === 0) {
+					type = 'inline';
+
+				} else {
+					type = 'ajax';
+				}
+			}
+
+			if (!type) {
+				_error();
+				return;
+			}
+
+			if (type == 'inline') {
+				obj	= href.substr(href.indexOf("#"));
+				type = $(obj).length > 0 ? 'inline' : 'ajax';
+			}
+
+			selectedOpts.type = type;
+			selectedOpts.href = href;
+			selectedOpts.title = title;
+
+			if (selectedOpts.autoDimensions) {
+				if (selectedOpts.type == 'html' || selectedOpts.type == 'inline' || selectedOpts.type == 'ajax') {
+					selectedOpts.width = 'auto';
+					selectedOpts.height = 'auto';
+				} else {
+					selectedOpts.autoDimensions = false;	
+				}
+			}
+
+			if (selectedOpts.modal) {
+				selectedOpts.overlayShow = true;
+				selectedOpts.hideOnOverlayClick = false;
+				selectedOpts.hideOnContentClick = false;
+				selectedOpts.enableEscapeButton = false;
+				selectedOpts.showCloseButton = false;
+			}
+
+			selectedOpts.padding = parseInt(selectedOpts.padding, 10);
+			selectedOpts.margin = parseInt(selectedOpts.margin, 10);
+
+			tmp.css('padding', (selectedOpts.padding + selectedOpts.margin));
+
+			$('.fancybox-inline-tmp').unbind('fancybox-cancel').bind('fancybox-change', function() {
+				$(this).replaceWith(content.children());				
+			});
+
+			switch (type) {
+				case 'html' :
+					tmp.html( selectedOpts.content );
+					_process_inline();
+				break;
+
+				case 'inline' :
+					if ( $(obj).parent().is('#fancybox-content') === true) {
+						busy = false;
+						return;
+					}
+
+					$('<div class="fancybox-inline-tmp" />')
+						.hide()
+						.insertBefore( $(obj) )
+						.bind('fancybox-cleanup', function() {
+							$(this).replaceWith(content.children());
+						}).bind('fancybox-cancel', function() {
+							$(this).replaceWith(tmp.children());
+						});
+
+					$(obj).appendTo(tmp);
+
+					_process_inline();
+				break;
+
+				case 'image':
+					busy = false;
+
+					$.fancybox.showActivity();
+
+					imgPreloader = new Image();
+
+					imgPreloader.onerror = function() {
+						_error();
+					};
+
+					imgPreloader.onload = function() {
+						busy = true;
+
+						imgPreloader.onerror = imgPreloader.onload = null;
+
+						_process_image();
+					};
+
+					imgPreloader.src = href;
+				break;
+
+				case 'swf':
+					selectedOpts.scrolling = 'no';
+
+					str = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"><param name="movie" value="' + href + '"></param>';
+					emb = '';
+
+					$.each(selectedOpts.swf, function(name, val) {
+						str += '<param name="' + name + '" value="' + val + '"></param>';
+						emb += ' ' + name + '="' + val + '"';
+					});
+
+					str += '<embed src="' + href + '" type="application/x-shockwave-flash" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"' + emb + '></embed></object>';
+
+					tmp.html(str);
+
+					_process_inline();
+				break;
+
+				case 'ajax':
+					busy = false;
+
+					$.fancybox.showActivity();
+
+					selectedOpts.ajax.win = selectedOpts.ajax.success;
+
+					ajaxLoader = $.ajax($.extend({}, selectedOpts.ajax, {
+						url	: href,
+						data : selectedOpts.ajax.data || {},
+						error : function(XMLHttpRequest, textStatus, errorThrown) {
+							if ( XMLHttpRequest.status > 0 ) {
+								_error();
+							}
+						},
+						success : function(data, textStatus, XMLHttpRequest) {
+							var o = typeof XMLHttpRequest == 'object' ? XMLHttpRequest : ajaxLoader;
+							if (o.status == 200) {
+								if ( typeof selectedOpts.ajax.win == 'function' ) {
+									ret = selectedOpts.ajax.win(href, data, textStatus, XMLHttpRequest);
+
+									if (ret === false) {
+										loading.hide();
+										return;
+									} else if (typeof ret == 'string' || typeof ret == 'object') {
+										data = ret;
+									}
+								}
+
+								tmp.html( data );
+								_process_inline();
+							}
+						}
+					}));
+
+				break;
+
+				case 'iframe':
+					_show();
+				break;
+			}
+		},
+
+		_process_inline = function() {
+			var
+				w = selectedOpts.width,
+				h = selectedOpts.height;
+
+			if (w.toString().indexOf('%') > -1) {
+				w = parseInt( ($(window).width() - (selectedOpts.margin * 2)) * parseFloat(w) / 100, 10) + 'px';
+
+			} else {
+				w = w == 'auto' ? 'auto' : w + 'px';	
+			}
+
+			if (h.toString().indexOf('%') > -1) {
+				h = parseInt( ($(window).height() - (selectedOpts.margin * 2)) * parseFloat(h) / 100, 10) + 'px';
+
+			} else {
+				h = h == 'auto' ? 'auto' : h + 'px';	
+			}
+
+			tmp.wrapInner('<div style="width:' + w + ';height:' + h + ';overflow: ' + (selectedOpts.scrolling == 'auto' ? 'auto' : (selectedOpts.scrolling == 'yes' ? 'scroll' : 'hidden')) + ';position:relative;"></div>');
+
+			selectedOpts.width = tmp.width();
+			selectedOpts.height = tmp.height();
+
+			_show();
+		},
+
+		_process_image = function() {
+			selectedOpts.width = imgPreloader.width;
+			selectedOpts.height = imgPreloader.height;
+
+			$("<img />").attr({
+				'id' : 'fancybox-img',
+				'src' : imgPreloader.src,
+				'alt' : selectedOpts.title
+			}).appendTo( tmp );
+
+			_show();
+		},
+
+		_show = function() {
+			var pos, equal;
+
+			loading.hide();
+
+			if (wrap.is(":visible") && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
+				$.event.trigger('fancybox-cancel');
+
+				busy = false;
+				return;
+			}
+
+			busy = true;
+
+			$(content.add( overlay )).unbind();
+
+			$(window).unbind("resize.fb scroll.fb");
+			$(document).unbind('keydown.fb');
+
+			if (wrap.is(":visible") && currentOpts.titlePosition !== 'outside') {
+				wrap.css('height', wrap.height());
+			}
+
+			currentArray = selectedArray;
+			currentIndex = selectedIndex;
+			currentOpts = selectedOpts;
+
+			if (currentOpts.overlayShow) {
+				overlay.css({
+					'background-color' : currentOpts.overlayColor,
+					'opacity' : currentOpts.overlayOpacity,
+					'cursor' : currentOpts.hideOnOverlayClick ? 'pointer' : 'auto',
+					'height' : $(document).height()
+				});
+
+				if (!overlay.is(':visible')) {
+					if (isIE6) {
+						$('select:not(#fancybox-tmp select)').filter(function() {
+							return this.style.visibility !== 'hidden';
+						}).css({'visibility' : 'hidden'}).one('fancybox-cleanup', function() {
+							this.style.visibility = 'inherit';
+						});
+					}
+
+					overlay.show();
+				}
+			} else {
+				overlay.hide();
+			}
+
+			final_pos = _get_zoom_to();
+
+			_process_title();
+
+			if (wrap.is(":visible")) {
+				$( close.add( nav_left ).add( nav_right ) ).hide();
+
+				pos = wrap.position(),
+
+				start_pos = {
+					top	 : pos.top,
+					left : pos.left,
+					width : wrap.width(),
+					height : wrap.height()
+				};
+
+				equal = (start_pos.width == final_pos.width && start_pos.height == final_pos.height);
+
+				content.fadeTo(currentOpts.changeFade, 0.3, function() {
+					var finish_resizing = function() {
+						content.html( tmp.contents() ).fadeTo(currentOpts.changeFade, 1, _finish);
+					};
+
+					$.event.trigger('fancybox-change');
+
+					content
+						.empty()
+						.removeAttr('filter')
+						.css({
+							'border-width' : currentOpts.padding,
+							'width'	: final_pos.width - currentOpts.padding * 2,
+							'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
+						});
+
+					if (equal) {
+						finish_resizing();
+
+					} else {
+						fx.prop = 0;
+
+						$(fx).animate({prop: 1}, {
+							 duration : currentOpts.changeSpeed,
+							 easing : currentOpts.easingChange,
+							 step : _draw,
+							 complete : finish_resizing
+						});
+					}
+				});
+
+				return;
+			}
+
+			wrap.removeAttr("style");
+
+			content.css('border-width', currentOpts.padding);
+
+			if (currentOpts.transitionIn == 'elastic') {
+				start_pos = _get_zoom_from();
+
+				content.html( tmp.contents() );
+
+				wrap.show();
+
+				if (currentOpts.opacity) {
+					final_pos.opacity = 0;
+				}
+
+				fx.prop = 0;
+
+				$(fx).animate({prop: 1}, {
+					 duration : currentOpts.speedIn,
+					 easing : currentOpts.easingIn,
+					 step : _draw,
+					 complete : _finish
+				});
+
+				return;
+			}
+
+			if (currentOpts.titlePosition == 'inside' && titleHeight > 0) {	
+				title.show();	
+			}
+
+			content
+				.css({
+					'width' : final_pos.width - currentOpts.padding * 2,
+					'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
+				})
+				.html( tmp.contents() );
+
+			wrap
+				.css(final_pos)
+				.fadeIn( currentOpts.transitionIn == 'none' ? 0 : currentOpts.speedIn, _finish );
+		},
+
+		_format_title = function(title) {
+			if (title && title.length) {
+				if (currentOpts.titlePosition == 'float') {
+					return '<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">' + title + '</td><td id="fancybox-title-float-right"></td></tr></table>';
+				}
+
+				return '<div id="fancybox-title-' + currentOpts.titlePosition + '">' + title + '</div>';
+			}
+
+			return false;
+		},
+
+		_process_title = function() {
+			titleStr = currentOpts.title || '';
+			titleHeight = 0;
+
+			title
+				.empty()
+				.removeAttr('style')
+				.removeClass();
+
+			if (currentOpts.titleShow === false) {
+				title.hide();
+				return;
+			}
+
+			titleStr = $.isFunction(currentOpts.titleFormat) ? currentOpts.titleFormat(titleStr, currentArray, currentIndex, currentOpts) : _format_title(titleStr);
+
+			if (!titleStr || titleStr === '') {
+				title.hide();
+				return;
+			}
+
+			title
+				.addClass('fancybox-title-' + currentOpts.titlePosition)
+				.html( titleStr )
+				.appendTo( 'body' )
+				.show();
+
+			switch (currentOpts.titlePosition) {
+				case 'inside':
+					title
+						.css({
+							'width' : final_pos.width - (currentOpts.padding * 2),
+							'marginLeft' : currentOpts.padding,
+							'marginRight' : currentOpts.padding
+						});
+
+					titleHeight = title.outerHeight(true);
+
+					title.appendTo( outer );
+
+					final_pos.height += titleHeight;
+				break;
+
+				case 'over':
+					title
+						.css({
+							'marginLeft' : currentOpts.padding,
+							'width'	: final_pos.width - (currentOpts.padding * 2),
+							'bottom' : currentOpts.padding
+						})
+						.appendTo( outer );
+				break;
+
+				case 'float':
+					title
+						.css('left', parseInt((title.width() - final_pos.width - 40)/ 2, 10) * -1)
+						.appendTo( wrap );
+				break;
+
+				default:
+					title
+						.css({
+							'width' : final_pos.width - (currentOpts.padding * 2),
+							'paddingLeft' : currentOpts.padding,
+							'paddingRight' : currentOpts.padding
+						})
+						.appendTo( wrap );
+				break;
+			}
+
+			title.hide();
+		},
+
+		_set_navigation = function() {
+			if (currentOpts.enableEscapeButton || currentOpts.enableKeyboardNav) {
+				$(document).bind('keydown.fb', function(e) {
+					if (e.keyCode == 27 && currentOpts.enableEscapeButton) {
+						e.preventDefault();
+						$.fancybox.close();
+
+					} else if ((e.keyCode == 37 || e.keyCode == 39) && currentOpts.enableKeyboardNav && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') {
+						e.preventDefault();
+						$.fancybox[ e.keyCode == 37 ? 'prev' : 'next']();
+					}
+				});
+			}
+
+			if (!currentOpts.showNavArrows) { 
+				nav_left.hide();
+				nav_right.hide();
+				return;
+			}
+
+			if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex !== 0) {
+				nav_left.show();
+			}
+
+			if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex != (currentArray.length -1)) {
+				nav_right.show();
+			}
+		},
+
+		_finish = function () {
+			if (!$.support.opacity) {
+				content.get(0).style.removeAttribute('filter');
+				wrap.get(0).style.removeAttribute('filter');
+			}
+
+			if (selectedOpts.autoDimensions) {
+				content.css('height', 'auto');
+			}
+
+			wrap.css('height', 'auto');
+
+			if (titleStr && titleStr.length) {
+				title.show();
+			}
+
+			if (currentOpts.showCloseButton) {
+				close.show();
+			}
+
+			_set_navigation();
+	
+			if (currentOpts.hideOnContentClick)	{
+				content.bind('click', $.fancybox.close);
+			}
+
+			if (currentOpts.hideOnOverlayClick)	{
+				overlay.bind('click', $.fancybox.close);
+			}
+
+			$(window).bind("resize.fb", $.fancybox.resize);
+
+			if (currentOpts.centerOnScroll) {
+				$(window).bind("scroll.fb", $.fancybox.center);
+			}
+
+			if (currentOpts.type == 'iframe') {
+				$('<iframe id="fancybox-frame" name="fancybox-frame' + new Date().getTime() + '" frameborder="0" hspace="0" ' + ($.browser.msie ? 'allowtransparency="true""' : '') + ' scrolling="' + selectedOpts.scrolling + '" src="' + currentOpts.href + '"></iframe>').appendTo(content);
+			}
+
+			wrap.show();
+
+			busy = false;
+
+			$.fancybox.center();
+
+			currentOpts.onComplete(currentArray, currentIndex, currentOpts);
+
+			_preload_images();
+		},
+
+		_preload_images = function() {
+			var href, 
+				objNext;
+
+			if ((currentArray.length -1) > currentIndex) {
+				href = currentArray[ currentIndex + 1 ].href;
+
+				if (typeof href !== 'undefined' && href.match(imgRegExp)) {
+					objNext = new Image();
+					objNext.src = href;
+				}
+			}
+
+			if (currentIndex > 0) {
+				href = currentArray[ currentIndex - 1 ].href;
+
+				if (typeof href !== 'undefined' && href.match(imgRegExp)) {
+					objNext = new Image();
+					objNext.src = href;
+				}
+			}
+		},
+
+		_draw = function(pos) {
+			var dim = {
+				width : parseInt(start_pos.width + (final_pos.width - start_pos.width) * pos, 10),
+				height : parseInt(start_pos.height + (final_pos.height - start_pos.height) * pos, 10),
+
+				top : parseInt(start_pos.top + (final_pos.top - start_pos.top) * pos, 10),
+				left : parseInt(start_pos.left + (final_pos.left - start_pos.left) * pos, 10)
+			};
+
+			if (typeof final_pos.opacity !== 'undefined') {
+				dim.opacity = pos < 0.5 ? 0.5 : pos;
+			}
+
+			wrap.css(dim);
+
+			content.css({
+				'width' : dim.width - currentOpts.padding * 2,
+				'height' : dim.height - (titleHeight * pos) - currentOpts.padding * 2
+			});
+		},
+
+		_get_viewport = function() {
+			return [
+				$(window).width() - (currentOpts.margin * 2),
+				$(window).height() - (currentOpts.margin * 2),
+				$(document).scrollLeft() + currentOpts.margin,
+				$(document).scrollTop() + currentOpts.margin
+			];
+		},
+
+		_get_zoom_to = function () {
+			var view = _get_viewport(),
+				to = {},
+				resize = currentOpts.autoScale,
+				double_padding = currentOpts.padding * 2,
+				ratio;
+
+			if (currentOpts.width.toString().indexOf('%') > -1) {
+				to.width = parseInt((view[0] * parseFloat(currentOpts.width)) / 100, 10);
+			} else {
+				to.width = currentOpts.width + double_padding;
+			}
+
+			if (currentOpts.height.toString().indexOf('%') > -1) {
+				to.height = parseInt((view[1] * parseFloat(currentOpts.height)) / 100, 10);
+			} else {
+				to.height = currentOpts.height + double_padding;
+			}
+
+			if (resize && (to.width > view[0] || to.height > view[1])) {
+				if (selectedOpts.type == 'image' || selectedOpts.type == 'swf') {
+					ratio = (currentOpts.width ) / (currentOpts.height );
+
+					if ((to.width ) > view[0]) {
+						to.width = view[0];
+						to.height = parseInt(((to.width - double_padding) / ratio) + double_padding, 10);
+					}
+
+					if ((to.height) > view[1]) {
+						to.height = view[1];
+						to.width = parseInt(((to.height - double_padding) * ratio) + double_padding, 10);
+					}
+
+				} else {
+					to.width = Math.min(to.width, view[0]);
+					to.height = Math.min(to.height, view[1]);
+				}
+			}
+
+			to.top = parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - to.height - 40) * 0.5)), 10);
+			to.left = parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - to.width - 40) * 0.5)), 10);
+
+			return to;
+		},
+
+		_get_obj_pos = function(obj) {
+			var pos = obj.offset();
+
+			pos.top += parseInt( obj.css('paddingTop'), 10 ) || 0;
+			pos.left += parseInt( obj.css('paddingLeft'), 10 ) || 0;
+
+			pos.top += parseInt( obj.css('border-top-width'), 10 ) || 0;
+			pos.left += parseInt( obj.css('border-left-width'), 10 ) || 0;
+
+			pos.width = obj.width();
+			pos.height = obj.height();
+
+			return pos;
+		},
+
+		_get_zoom_from = function() {
+			var orig = selectedOpts.orig ? $(selectedOpts.orig) : false,
+				from = {},
+				pos,
+				view;
+
+			if (orig && orig.length) {
+				pos = _get_obj_pos(orig);
+
+				from = {
+					width : pos.width + (currentOpts.padding * 2),
+					height : pos.height + (currentOpts.padding * 2),
+					top	: pos.top - currentOpts.padding - 20,
+					left : pos.left - currentOpts.padding - 20
+				};
+
+			} else {
+				view = _get_viewport();
+
+				from = {
+					width : currentOpts.padding * 2,
+					height : currentOpts.padding * 2,
+					top	: parseInt(view[3] + view[1] * 0.5, 10),
+					left : parseInt(view[2] + view[0] * 0.5, 10)
+				};
+			}
+
+			return from;
+		},
+
+		_animate_loading = function() {
+			if (!loading.is(':visible')){
+				clearInterval(loadingTimer);
+				return;
+			}
+
+			$('div', loading).css('top', (loadingFrame * -40) + 'px');
+
+			loadingFrame = (loadingFrame + 1) % 12;
+		};
+
+	/*
+	 * Public methods 
+	 */
+
+	$.fn.fancybox = function(options) {
+		if (!$(this).length) {
+			return this;
+		}
+
+		$(this)
+			.data('fancybox', $.extend({}, options, ($.metadata ? $(this).metadata() : {})))
+			.unbind('click.fb')
+			.bind('click.fb', function(e) {
+				e.preventDefault();
+
+				if (busy) {
+					return;
+				}
+
+				busy = true;
+
+				$(this).blur();
+
+				selectedArray = [];
+				selectedIndex = 0;
+
+				var rel = $(this).attr('rel') || '';
+
+				if (!rel || rel == '' || rel === 'nofollow') {
+					selectedArray.push(this);
+
+				} else {
+					selectedArray = $("a[rel=" + rel + "], area[rel=" + rel + "]");
+					selectedIndex = selectedArray.index( this );
+				}
+
+				_start();
+
+				return;
+			});
+
+		return this;
+	};
+
+	$.fancybox = function(obj) {
+		var opts;
+
+		if (busy) {
+			return;
+		}
+
+		busy = true;
+		opts = typeof arguments[1] !== 'undefined' ? arguments[1] : {};
+
+		selectedArray = [];
+		selectedIndex = parseInt(opts.index, 10) || 0;
+
+		if ($.isArray(obj)) {
+			for (var i = 0, j = obj.length; i < j; i++) {
+				if (typeof obj[i] == 'object') {
+					$(obj[i]).data('fancybox', $.extend({}, opts, obj[i]));
+				} else {
+					obj[i] = $({}).data('fancybox', $.extend({content : obj[i]}, opts));
+				}
+			}
+
+			selectedArray = jQuery.merge(selectedArray, obj);
+
+		} else {
+			if (typeof obj == 'object') {
+				$(obj).data('fancybox', $.extend({}, opts, obj));
+			} else {
+				obj = $({}).data('fancybox', $.extend({content : obj}, opts));
+			}
+
+			selectedArray.push(obj);
+		}
+
+		if (selectedIndex > selectedArray.length || selectedIndex < 0) {
+			selectedIndex = 0;
+		}
+
+		_start();
+	};
+
+	$.fancybox.showActivity = function() {
+		clearInterval(loadingTimer);
+
+		loading.show();
+		loadingTimer = setInterval(_animate_loading, 66);
+	};
+
+	$.fancybox.hideActivity = function() {
+		loading.hide();
+	};
+
+	$.fancybox.next = function() {
+		return $.fancybox.pos( currentIndex + 1);
+	};
+
+	$.fancybox.prev = function() {
+		return $.fancybox.pos( currentIndex - 1);
+	};
+
+	$.fancybox.pos = function(pos) {
+		if (busy) {
+			return;
+		}
+
+		pos = parseInt(pos);
+
+		selectedArray = currentArray;
+
+		if (pos > -1 && pos < currentArray.length) {
+			selectedIndex = pos;
+			_start();
+
+		} else if (currentOpts.cyclic && currentArray.length > 1) {
+			selectedIndex = pos >= currentArray.length ? 0 : currentArray.length - 1;
+			_start();
+		}
+
+		return;
+	};
+
+	$.fancybox.cancel = function() {
+		if (busy) {
+			return;
+		}
+
+		busy = true;
+
+		$.event.trigger('fancybox-cancel');
+
+		_abort();
+
+		selectedOpts.onCancel(selectedArray, selectedIndex, selectedOpts);
+
+		busy = false;
+	};
+
+	// Note: within an iframe use - parent.$.fancybox.close();
+	$.fancybox.close = function() {
+		if (busy || wrap.is(':hidden')) {
+			return;
+		}
+
+		busy = true;
+
+		if (currentOpts && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
+			busy = false;
+			return;
+		}
+
+		_abort();
+
+		$(close.add( nav_left ).add( nav_right )).hide();
+
+		$(content.add( overlay )).unbind();
+
+		$(window).unbind("resize.fb scroll.fb");
+		$(document).unbind('keydown.fb');
+
+		content.find('iframe').attr('src', isIE6 && /^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank');
+
+		if (currentOpts.titlePosition !== 'inside') {
+			title.empty();
+		}
+
+		wrap.stop();
+
+		function _cleanup() {
+			overlay.fadeOut('fast');
+
+			title.empty().hide();
+			wrap.hide();
+
+			$.event.trigger('fancybox-cleanup');
+
+			content.empty();
+
+			currentOpts.onClosed(currentArray, currentIndex, currentOpts);
+
+			currentArray = selectedOpts	= [];
+			currentIndex = selectedIndex = 0;
+			currentOpts = selectedOpts	= {};
+
+			busy = false;
+		}
+
+		if (currentOpts.transitionOut == 'elastic') {
+			start_pos = _get_zoom_from();
+
+			var pos = wrap.position();
+
+			final_pos = {
+				top	 : pos.top ,
+				left : pos.left,
+				width :	wrap.width(),
+				height : wrap.height()
+			};
+
+			if (currentOpts.opacity) {
+				final_pos.opacity = 1;
+			}
+
+			title.empty().hide();
+
+			fx.prop = 1;
+
+			$(fx).animate({ prop: 0 }, {
+				 duration : currentOpts.speedOut,
+				 easing : currentOpts.easingOut,
+				 step : _draw,
+				 complete : _cleanup
+			});
+
+		} else {
+			wrap.fadeOut( currentOpts.transitionOut == 'none' ? 0 : currentOpts.speedOut, _cleanup);
+		}
+	};
+
+	$.fancybox.resize = function() {
+		if (overlay.is(':visible')) {
+			overlay.css('height', $(document).height());
+		}
+
+		$.fancybox.center(true);
+	};
+
+	$.fancybox.center = function() {
+		var view, align;
+
+		if (busy) {
+			return;	
+		}
+
+		align = arguments[0] === true ? 1 : 0;
+		view = _get_viewport();
+
+		if (!align && (wrap.width() > view[0] || wrap.height() > view[1])) {
+			return;	
+		}
+
+		wrap
+			.stop()
+			.animate({
+				'top' : parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - content.height() - 40) * 0.5) - currentOpts.padding)),
+				'left' : parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - content.width() - 40) * 0.5) - currentOpts.padding))
+			}, typeof arguments[0] == 'number' ? arguments[0] : 200);
+	};
+
+	$.fancybox.init = function() {
+		if ($("#fancybox-wrap").length) {
+			return;
+		}
+
+		$('body').append(
+			tmp	= $('<div id="fancybox-tmp"></div>'),
+			loading	= $('<div id="fancybox-loading"><div></div></div>'),
+			overlay	= $('<div id="fancybox-overlay"></div>'),
+			wrap = $('<div id="fancybox-wrap"></div>')
+		);
+
+		outer = $('<div id="fancybox-outer"></div>')
+			.append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>')
+			.appendTo( wrap );
+
+		outer.append(
+			content = $('<div id="fancybox-content"></div>'),
+			close = $('<a id="fancybox-close"></a>'),
+			title = $('<div id="fancybox-title"></div>'),
+
+			nav_left = $('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),
+			nav_right = $('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>')
+		);
+
+		close.click($.fancybox.close);
+		loading.click($.fancybox.cancel);
+
+		nav_left.click(function(e) {
+			e.preventDefault();
+			$.fancybox.prev();
+		});
+
+		nav_right.click(function(e) {
+			e.preventDefault();
+			$.fancybox.next();
+		});
+
+		if ($.fn.mousewheel) {
+			wrap.bind('mousewheel.fb', function(e, delta) {
+				if (busy) {
+					e.preventDefault();
+
+				} else if ($(e.target).get(0).clientHeight == 0 || $(e.target).get(0).scrollHeight === $(e.target).get(0).clientHeight) {
+					e.preventDefault();
+					$.fancybox[ delta > 0 ? 'prev' : 'next']();
+				}
+			});
+		}
+
+		if (!$.support.opacity) {
+			wrap.addClass('fancybox-ie');
+		}
+
+		if (isIE6) {
+			loading.addClass('fancybox-ie6');
+			wrap.addClass('fancybox-ie6');
+
+			$('<iframe id="fancybox-hide-sel-frame" src="' + (/^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank' ) + '" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(outer);
+		}
+	};
+
+	$.fn.fancybox.defaults = {
+		padding : 10,
+		margin : 40,
+		opacity : false,
+		modal : false,
+		cyclic : false,
+		scrolling : 'auto',	// 'auto', 'yes' or 'no'
+
+		width : 560,
+		height : 340,
+
+		autoScale : true,
+		autoDimensions : true,
+		centerOnScroll : false,
+
+		ajax : {},
+		swf : { wmode: 'transparent' },
+
+		hideOnOverlayClick : true,
+		hideOnContentClick : false,
+
+		overlayShow : true,
+		overlayOpacity : 0.7,
+		overlayColor : '#777',
+
+		titleShow : true,
+		titlePosition : 'float', // 'float', 'outside', 'inside' or 'over'
+		titleFormat : null,
+		titleFromAlt : false,
+
+		transitionIn : 'fade', // 'elastic', 'fade' or 'none'
+		transitionOut : 'fade', // 'elastic', 'fade' or 'none'
+
+		speedIn : 300,
+		speedOut : 300,
+
+		changeSpeed : 300,
+		changeFade : 'fast',
+
+		easingIn : 'swing',
+		easingOut : 'swing',
+
+		showCloseButton	 : true,
+		showNavArrows : true,
+		enableEscapeButton : true,
+		enableKeyboardNav : true,
+
+		onStart : function(){},
+		onCancel : function(){},
+		onComplete : function(){},
+		onCleanup : function(){},
+		onClosed : function(){},
+		onError : function(){}
+	};
+
+	$(document).ready(function() {
+		$.fancybox.init();
+	});
+
+})(jQuery);
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/jquery.fancybox-1.3.4.pack.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/jquery.fancybox-1.3.4.pack.js
new file mode 100644
index 0000000000000000000000000000000000000000..1373ed0838bc1be6841339fef703a07c1ee7267f
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/jquery.fancybox-1.3.4.pack.js
@@ -0,0 +1,46 @@
+/*
+ * FancyBox - jQuery Plugin
+ * Simple and fancy lightbox alternative
+ *
+ * Examples and documentation at: http://fancybox.net
+ * 
+ * Copyright (c) 2008 - 2010 Janis Skarnelis
+ * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
+ * 
+ * Version: 1.3.4 (11/11/2010)
+ * Requires: jQuery v1.3+
+ *
+ * Dual licensed under the MIT and GPL licenses:
+ *   http://www.opensource.org/licenses/mit-license.php
+ *   http://www.gnu.org/licenses/gpl.html
+ */
+
+;(function(b){var m,t,u,f,D,j,E,n,z,A,q=0,e={},o=[],p=0,d={},l=[],G=null,v=new Image,J=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,W=/[^\.]\.(swf)\s*$/i,K,L=1,y=0,s="",r,i,h=false,B=b.extend(b("<div/>")[0],{prop:0}),M=b.browser.msie&&b.browser.version<7&&!window.XMLHttpRequest,N=function(){t.hide();v.onerror=v.onload=null;G&&G.abort();m.empty()},O=function(){if(false===e.onError(o,q,e)){t.hide();h=false}else{e.titleShow=false;e.width="auto";e.height="auto";m.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>');
+F()}},I=function(){var a=o[q],c,g,k,C,P,w;N();e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));w=e.onStart(o,q,e);if(w===false)h=false;else{if(typeof w=="object")e=b.extend(e,w);k=e.title||(a.nodeName?b(a).attr("title"):a.title)||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(k===""&&e.orig&&e.titleFromAlt)k=e.orig.attr("alt");c=e.href||(a.nodeName?b(a).attr("href"):a.href)||null;if(/^(?:javascript)/i.test(c)||
+c=="#")c=null;if(e.type){g=e.type;if(!c)c=e.content}else if(e.content)g="html";else if(c)g=c.match(J)?"image":c.match(W)?"swf":b(a).hasClass("iframe")?"iframe":c.indexOf("#")===0?"inline":"ajax";if(g){if(g=="inline"){a=c.substr(c.indexOf("#"));g=b(a).length>0?"inline":"ajax"}e.type=g;e.href=c;e.title=k;if(e.autoDimensions)if(e.type=="html"||e.type=="inline"||e.type=="ajax"){e.width="auto";e.height="auto"}else e.autoDimensions=false;if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=
+false;e.enableEscapeButton=false;e.showCloseButton=false}e.padding=parseInt(e.padding,10);e.margin=parseInt(e.margin,10);m.css("padding",e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(j.children())});switch(g){case "html":m.html(e.content);F();break;case "inline":if(b(a).parent().is("#fancybox-content")===true){h=false;break}b('<div class="fancybox-inline-tmp" />').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(j.children())}).bind("fancybox-cancel",
+function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity();v=new Image;v.onerror=function(){O()};v.onload=function(){h=true;v.onerror=v.onload=null;e.width=v.width;e.height=v.height;b("<img />").attr({id:"fancybox-img",src:v.src,alt:e.title}).appendTo(m);Q()};v.src=c;break;case "swf":e.scrolling="no";C='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+c+
+'"></param>';P="";b.each(e.swf,function(x,H){C+='<param name="'+x+'" value="'+H+'"></param>';P+=" "+x+'="'+H+'"'});C+='<embed src="'+c+'" type="application/x-shockwave-flash" width="'+e.width+'" height="'+e.height+'"'+P+"></embed></object>";m.html(C);F();break;case "ajax":h=false;b.fancybox.showActivity();e.ajax.win=e.ajax.success;G=b.ajax(b.extend({},e.ajax,{url:c,data:e.ajax.data||{},error:function(x){x.status>0&&O()},success:function(x,H,R){if((typeof R=="object"?R:G).status==200){if(typeof e.ajax.win==
+"function"){w=e.ajax.win(c,x,H,R);if(w===false){t.hide();return}else if(typeof w=="string"||typeof w=="object")x=w}m.html(x);F()}}}));break;case "iframe":Q()}}else O()}},F=function(){var a=e.width,c=e.height;a=a.toString().indexOf("%")>-1?parseInt((b(window).width()-e.margin*2)*parseFloat(a)/100,10)+"px":a=="auto"?"auto":a+"px";c=c.toString().indexOf("%")>-1?parseInt((b(window).height()-e.margin*2)*parseFloat(c)/100,10)+"px":c=="auto"?"auto":c+"px";m.wrapInner('<div style="width:'+a+";height:"+c+
+";overflow: "+(e.scrolling=="auto"?"auto":e.scrolling=="yes"?"scroll":"hidden")+';position:relative;"></div>');e.width=m.width();e.height=m.height();Q()},Q=function(){var a,c;t.hide();if(f.is(":visible")&&false===d.onCleanup(l,p,d)){b.event.trigger("fancybox-cancel");h=false}else{h=true;b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");f.is(":visible")&&d.titlePosition!=="outside"&&f.css("height",f.height());l=o;p=q;d=e;if(d.overlayShow){u.css({"background-color":d.overlayColor,
+opacity:d.overlayOpacity,cursor:d.hideOnOverlayClick?"pointer":"auto",height:b(document).height()});if(!u.is(":visible")){M&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});u.show()}}else u.hide();i=X();s=d.title||"";y=0;n.empty().removeAttr("style").removeClass();if(d.titleShow!==false){if(b.isFunction(d.titleFormat))a=d.titleFormat(s,l,p,d);else a=s&&s.length?
+d.titlePosition=="float"?'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+s+'</td><td id="fancybox-title-float-right"></td></tr></table>':'<div id="fancybox-title-'+d.titlePosition+'">'+s+"</div>":false;s=a;if(!(!s||s==="")){n.addClass("fancybox-title-"+d.titlePosition).html(s).appendTo("body").show();switch(d.titlePosition){case "inside":n.css({width:i.width-d.padding*2,marginLeft:d.padding,marginRight:d.padding});
+y=n.outerHeight(true);n.appendTo(D);i.height+=y;break;case "over":n.css({marginLeft:d.padding,width:i.width-d.padding*2,bottom:d.padding}).appendTo(D);break;case "float":n.css("left",parseInt((n.width()-i.width-40)/2,10)*-1).appendTo(f);break;default:n.css({width:i.width-d.padding*2,paddingLeft:d.padding,paddingRight:d.padding}).appendTo(f)}}}n.hide();if(f.is(":visible")){b(E.add(z).add(A)).hide();a=f.position();r={top:a.top,left:a.left,width:f.width(),height:f.height()};c=r.width==i.width&&r.height==
+i.height;j.fadeTo(d.changeFade,0.3,function(){var g=function(){j.html(m.contents()).fadeTo(d.changeFade,1,S)};b.event.trigger("fancybox-change");j.empty().removeAttr("filter").css({"border-width":d.padding,width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2});if(c)g();else{B.prop=0;b(B).animate({prop:1},{duration:d.changeSpeed,easing:d.easingChange,step:T,complete:g})}})}else{f.removeAttr("style");j.css("border-width",d.padding);if(d.transitionIn=="elastic"){r=V();j.html(m.contents());
+f.show();if(d.opacity)i.opacity=0;B.prop=0;b(B).animate({prop:1},{duration:d.speedIn,easing:d.easingIn,step:T,complete:S})}else{d.titlePosition=="inside"&&y>0&&n.show();j.css({width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2}).html(m.contents());f.css(i).fadeIn(d.transitionIn=="none"?0:d.speedIn,S)}}}},Y=function(){if(d.enableEscapeButton||d.enableKeyboardNav)b(document).bind("keydown.fb",function(a){if(a.keyCode==27&&d.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if((a.keyCode==
+37||a.keyCode==39)&&d.enableKeyboardNav&&a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.target.tagName!=="SELECT"){a.preventDefault();b.fancybox[a.keyCode==37?"prev":"next"]()}});if(d.showNavArrows){if(d.cyclic&&l.length>1||p!==0)z.show();if(d.cyclic&&l.length>1||p!=l.length-1)A.show()}else{z.hide();A.hide()}},S=function(){if(!b.support.opacity){j.get(0).style.removeAttribute("filter");f.get(0).style.removeAttribute("filter")}e.autoDimensions&&j.css("height","auto");f.css("height","auto");
+s&&s.length&&n.show();d.showCloseButton&&E.show();Y();d.hideOnContentClick&&j.bind("click",b.fancybox.close);d.hideOnOverlayClick&&u.bind("click",b.fancybox.close);b(window).bind("resize.fb",b.fancybox.resize);d.centerOnScroll&&b(window).bind("scroll.fb",b.fancybox.center);if(d.type=="iframe")b('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" '+(b.browser.msie?'allowtransparency="true""':"")+' scrolling="'+e.scrolling+'" src="'+d.href+'"></iframe>').appendTo(j);
+f.show();h=false;b.fancybox.center();d.onComplete(l,p,d);var a,c;if(l.length-1>p){a=l[p+1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}if(p>0){a=l[p-1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}},T=function(a){var c={width:parseInt(r.width+(i.width-r.width)*a,10),height:parseInt(r.height+(i.height-r.height)*a,10),top:parseInt(r.top+(i.top-r.top)*a,10),left:parseInt(r.left+(i.left-r.left)*a,10)};if(typeof i.opacity!=="undefined")c.opacity=a<0.5?0.5:a;f.css(c);
+j.css({width:c.width-d.padding*2,height:c.height-y*a-d.padding*2})},U=function(){return[b(window).width()-d.margin*2,b(window).height()-d.margin*2,b(document).scrollLeft()+d.margin,b(document).scrollTop()+d.margin]},X=function(){var a=U(),c={},g=d.autoScale,k=d.padding*2;c.width=d.width.toString().indexOf("%")>-1?parseInt(a[0]*parseFloat(d.width)/100,10):d.width+k;c.height=d.height.toString().indexOf("%")>-1?parseInt(a[1]*parseFloat(d.height)/100,10):d.height+k;if(g&&(c.width>a[0]||c.height>a[1]))if(e.type==
+"image"||e.type=="swf"){g=d.width/d.height;if(c.width>a[0]){c.width=a[0];c.height=parseInt((c.width-k)/g+k,10)}if(c.height>a[1]){c.height=a[1];c.width=parseInt((c.height-k)*g+k,10)}}else{c.width=Math.min(c.width,a[0]);c.height=Math.min(c.height,a[1])}c.top=parseInt(Math.max(a[3]-20,a[3]+(a[1]-c.height-40)*0.5),10);c.left=parseInt(Math.max(a[2]-20,a[2]+(a[0]-c.width-40)*0.5),10);return c},V=function(){var a=e.orig?b(e.orig):false,c={};if(a&&a.length){c=a.offset();c.top+=parseInt(a.css("paddingTop"),
+10)||0;c.left+=parseInt(a.css("paddingLeft"),10)||0;c.top+=parseInt(a.css("border-top-width"),10)||0;c.left+=parseInt(a.css("border-left-width"),10)||0;c.width=a.width();c.height=a.height();c={width:c.width+d.padding*2,height:c.height+d.padding*2,top:c.top-d.padding-20,left:c.left-d.padding-20}}else{a=U();c={width:d.padding*2,height:d.padding*2,top:parseInt(a[3]+a[1]*0.5,10),left:parseInt(a[2]+a[0]*0.5,10)}}return c},Z=function(){if(t.is(":visible")){b("div",t).css("top",L*-40+"px");L=(L+1)%12}else clearInterval(K)};
+b.fn.fancybox=function(a){if(!b(this).length)return this;b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(c){c.preventDefault();if(!h){h=true;b(this).blur();o=[];q=0;c=b(this).attr("rel")||"";if(!c||c==""||c==="nofollow")o.push(this);else{o=b("a[rel="+c+"], area[rel="+c+"]");q=o.index(this)}I()}});return this};b.fancybox=function(a,c){var g;if(!h){h=true;g=typeof c!=="undefined"?c:{};o=[];q=parseInt(g.index,10)||0;if(b.isArray(a)){for(var k=
+0,C=a.length;k<C;k++)if(typeof a[k]=="object")b(a[k]).data("fancybox",b.extend({},g,a[k]));else a[k]=b({}).data("fancybox",b.extend({content:a[k]},g));o=jQuery.merge(o,a)}else{if(typeof a=="object")b(a).data("fancybox",b.extend({},g,a));else a=b({}).data("fancybox",b.extend({content:a},g));o.push(a)}if(q>o.length||q<0)q=0;I()}};b.fancybox.showActivity=function(){clearInterval(K);t.show();K=setInterval(Z,66)};b.fancybox.hideActivity=function(){t.hide()};b.fancybox.next=function(){return b.fancybox.pos(p+
+1)};b.fancybox.prev=function(){return b.fancybox.pos(p-1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a);o=l;if(a>-1&&a<l.length){q=a;I()}else if(d.cyclic&&l.length>1){q=a>=l.length?0:l.length-1;I()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");N();e.onCancel(o,q,e);h=false}};b.fancybox.close=function(){function a(){u.fadeOut("fast");n.empty().hide();f.hide();b.event.trigger("fancybox-cleanup");j.empty();d.onClosed(l,p,d);l=e=[];p=q=0;d=e={};h=false}if(!(h||f.is(":hidden"))){h=
+true;if(d&&false===d.onCleanup(l,p,d))h=false;else{N();b(E.add(z).add(A)).hide();b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");j.find("iframe").attr("src",M&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");d.titlePosition!=="inside"&&n.empty();f.stop();if(d.transitionOut=="elastic"){r=V();var c=f.position();i={top:c.top,left:c.left,width:f.width(),height:f.height()};if(d.opacity)i.opacity=1;n.empty().hide();B.prop=1;
+b(B).animate({prop:0},{duration:d.speedOut,easing:d.easingOut,step:T,complete:a})}else f.fadeOut(d.transitionOut=="none"?0:d.speedOut,a)}}};b.fancybox.resize=function(){u.is(":visible")&&u.css("height",b(document).height());b.fancybox.center(true)};b.fancybox.center=function(a){var c,g;if(!h){g=a===true?1:0;c=U();!g&&(f.width()>c[0]||f.height()>c[1])||f.stop().animate({top:parseInt(Math.max(c[3]-20,c[3]+(c[1]-j.height()-40)*0.5-d.padding)),left:parseInt(Math.max(c[2]-20,c[2]+(c[0]-j.width()-40)*0.5-
+d.padding))},typeof a=="number"?a:200)}};b.fancybox.init=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b('<div id="fancybox-tmp"></div>'),t=b('<div id="fancybox-loading"><div></div></div>'),u=b('<div id="fancybox-overlay"></div>'),f=b('<div id="fancybox-wrap"></div>'));D=b('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(f);
+D.append(j=b('<div id="fancybox-content"></div>'),E=b('<a id="fancybox-close"></a>'),n=b('<div id="fancybox-title"></div>'),z=b('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),A=b('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));E.click(b.fancybox.close);t.click(b.fancybox.cancel);z.click(function(a){a.preventDefault();b.fancybox.prev()});A.click(function(a){a.preventDefault();b.fancybox.next()});
+b.fn.mousewheel&&f.bind("mousewheel.fb",function(a,c){if(h)a.preventDefault();else if(b(a.target).get(0).clientHeight==0||b(a.target).get(0).scrollHeight===b(a.target).get(0).clientHeight){a.preventDefault();b.fancybox[c>0?"prev":"next"]()}});b.support.opacity||f.addClass("fancybox-ie");if(M){t.addClass("fancybox-ie6");f.addClass("fancybox-ie6");b('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank")+'" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(D)}}};
+b.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",
+easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};b(document).ready(function(){b.fancybox.init()})})(jQuery);
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/jquery.mousewheel-3.0.4.pack.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/jquery.mousewheel-3.0.4.pack.js
new file mode 100644
index 0000000000000000000000000000000000000000..cb66588e29c237d80f5a944c7f0d47bc97dd9a39
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/jquery.mousewheel-3.0.4.pack.js
@@ -0,0 +1,14 @@
+/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
+* Licensed under the MIT License (LICENSE.txt).
+*
+* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
+* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
+* Thanks to: Seamus Leahy for adding deltaX and deltaY
+*
+* Version: 3.0.4
+*
+* Requires: 1.2.2+
+*/
+
+(function(d){function g(a){var b=a||window.event,i=[].slice.call(arguments,1),c=0,h=0,e=0;a=d.event.fix(b);a.type="mousewheel";if(a.wheelDelta)c=a.wheelDelta/120;if(a.detail)c=-a.detail/3;e=c;if(b.axis!==undefined&&b.axis===b.HORIZONTAL_AXIS){e=0;h=-1*c}if(b.wheelDeltaY!==undefined)e=b.wheelDeltaY/120;if(b.wheelDeltaX!==undefined)h=-1*b.wheelDeltaX/120;i.unshift(a,c,h,e);return d.event.handle.apply(this,i)}var f=["DOMMouseScroll","mousewheel"];d.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=
+f.length;a;)this.addEventListener(f[--a],g,false);else this.onmousewheel=g},teardown:function(){if(this.removeEventListener)for(var a=f.length;a;)this.removeEventListener(f[--a],g,false);else this.onmousewheel=null}};d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/nextgen_fancybox_init.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/nextgen_fancybox_init.js
new file mode 100644
index 0000000000000000000000000000000000000000..4dd03fca16009b7f7cda20534352090c5f28f7e7
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/nextgen_fancybox_init.js
@@ -0,0 +1,13 @@
+jQuery(function($) {
+    var nextgen_fancybox_init = function() {
+        $(".ngg-fancybox").fancybox({
+            titlePosition: 'inside',
+            // Needed for twenty eleven
+            onComplete: function() {
+                $('#fancybox-wrap').css('z-index', 10000);
+            }
+        });
+    };
+    $(this).bind('refreshed', nextgen_fancybox_init);
+    nextgen_fancybox_init();
+});
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/close.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/close.png
new file mode 100644
index 0000000000000000000000000000000000000000..4de4396d4a09677774f79289de2a09511baeea22
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/close.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/closeX.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/closeX.png
new file mode 100644
index 0000000000000000000000000000000000000000..cf5d018172d784bd44896127e4d252dc35880dc8
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/closeX.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/controlbar-black-border.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/controlbar-black-border.gif
new file mode 100644
index 0000000000000000000000000000000000000000..e2403fe83a93608b4d944b0d2c92f3b82d27a33d
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/controlbar-black-border.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/controlbar-text-buttons.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/controlbar-text-buttons.png
new file mode 100644
index 0000000000000000000000000000000000000000..d2f72e0a817c601e48dfcf27f8e1c5b38ee9c355
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/controlbar-text-buttons.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/controlbar-white-small.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/controlbar-white-small.gif
new file mode 100644
index 0000000000000000000000000000000000000000..462fce751415eec173b073494a6016fc45e7d8ec
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/controlbar-white-small.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/controlbar-white.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/controlbar-white.gif
new file mode 100644
index 0000000000000000000000000000000000000000..1f143f5b854c9ec603974dbbd8e0a9735fe7cb68
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/controlbar-white.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/controlbar2.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/controlbar2.gif
new file mode 100644
index 0000000000000000000000000000000000000000..39ad65218c2cdb03f4680c90e78780007b8c6919
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/controlbar2.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/controlbar3.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/controlbar3.gif
new file mode 100644
index 0000000000000000000000000000000000000000..3eebb8110e175065ccb344819598d0dd48233eab
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/controlbar3.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/controlbar4-hover.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/controlbar4-hover.gif
new file mode 100644
index 0000000000000000000000000000000000000000..ca08b59c22a9c970396d85a341423850ff08da3b
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/controlbar4-hover.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/controlbar4.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/controlbar4.gif
new file mode 100644
index 0000000000000000000000000000000000000000..7a3ad34421a038f582fc82762c9cf2311ad90230
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/controlbar4.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/fullexpand.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/fullexpand.gif
new file mode 100644
index 0000000000000000000000000000000000000000..26d9ed02ba5245846bb424bb02d3a31a334f112a
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/fullexpand.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/geckodimmer.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/geckodimmer.png
new file mode 100644
index 0000000000000000000000000000000000000000..309bb27838e57efe124ed123a1892dfc56992957
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/geckodimmer.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/icon.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/icon.gif
new file mode 100644
index 0000000000000000000000000000000000000000..b74a073c13b0ffe7e970c3402396e89be9ee9113
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/icon.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/loader.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/loader.gif
new file mode 100644
index 0000000000000000000000000000000000000000..0b31f6f9e20b112f99ff0551d787ccea44cea3cd
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/loader.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/loader.white.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/loader.white.gif
new file mode 100644
index 0000000000000000000000000000000000000000..f2a1bc0c6f545e20e631a96e8e92f9822e75d046
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/loader.white.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/outlines/Outlines.psd b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/outlines/Outlines.psd
new file mode 100644
index 0000000000000000000000000000000000000000..540565151015ca3714d732147896bc2250404e60
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/outlines/Outlines.psd differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/outlines/beveled.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/outlines/beveled.png
new file mode 100644
index 0000000000000000000000000000000000000000..fc428f415ca5017a82c42e568e6d75f17789bd9d
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/outlines/beveled.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/outlines/drop-shadow.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/outlines/drop-shadow.png
new file mode 100644
index 0000000000000000000000000000000000000000..0186c2ee472a79b1076f2ac5f4b639d885b30cf4
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/outlines/drop-shadow.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/outlines/glossy-dark.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/outlines/glossy-dark.png
new file mode 100644
index 0000000000000000000000000000000000000000..3c64c0d41c6a223bca4d0ccd9fff8ab5566e5b6c
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/outlines/glossy-dark.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/outlines/outer-glow.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/outlines/outer-glow.png
new file mode 100644
index 0000000000000000000000000000000000000000..288d43feffd656511f5b1f5189b5b0047dc146ae
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/outlines/outer-glow.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/outlines/rounded-black.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/outlines/rounded-black.png
new file mode 100644
index 0000000000000000000000000000000000000000..a77e65d8f3fdca14bc002a40a90cf58e8b117784
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/outlines/rounded-black.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/outlines/rounded-white.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/outlines/rounded-white.png
new file mode 100644
index 0000000000000000000000000000000000000000..0d4b8176f57c44f41071c8cff7b86ece9c8c1f9a
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/outlines/rounded-white.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/resize.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/resize.gif
new file mode 100644
index 0000000000000000000000000000000000000000..9100de776d506f8b9f061d475beed274b550aa29
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/resize.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/scrollarrows.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/scrollarrows.png
new file mode 100644
index 0000000000000000000000000000000000000000..b3d55756dc7339e1a04ec07be5068d4a12ef27e2
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/scrollarrows.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/zoomin.cur b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/zoomin.cur
new file mode 100644
index 0000000000000000000000000000000000000000..cb7912438f010fb05b72f31563d88e24b6639dbd
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/zoomin.cur differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/zoomout.cur b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/zoomout.cur
new file mode 100644
index 0000000000000000000000000000000000000000..acf61999635514eac804c124d24b447a33bbfae9
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/graphics/zoomout.cur differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide-full.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide-full.js
new file mode 100644
index 0000000000000000000000000000000000000000..7f58786ae38b7f9598516afc2a8b461b6c6b3fff
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide-full.js
@@ -0,0 +1,3320 @@
+/** 
+ * Name:    Highslide JS
+ * Version: 4.1.13 (2011-10-06)
+ * Config:  default +events +unobtrusive +imagemap +slideshow +positioning +transitions +viewport +thumbstrip +inline +ajax +iframe +flash
+ * Author:  Torstein Hønsi
+ * Support: www.highslide.com/support
+ * License: www.highslide.com/#license
+ */
+if (!hs) { var hs = {
+// Language strings
+lang : {
+	cssDirection: 'ltr',
+	loadingText : 'Loading...',
+	loadingTitle : 'Click to cancel',
+	focusTitle : 'Click to bring to front',
+	fullExpandTitle : 'Expand to actual size (f)',
+	creditsText : 'Powered by <i>Highslide JS</i>',
+	creditsTitle : 'Go to the Highslide JS homepage',
+	previousText : 'Previous',
+	nextText : 'Next', 
+	moveText : 'Move',
+	closeText : 'Close', 
+	closeTitle : 'Close (esc)', 
+	resizeTitle : 'Resize',
+	playText : 'Play',
+	playTitle : 'Play slideshow (spacebar)',
+	pauseText : 'Pause',
+	pauseTitle : 'Pause slideshow (spacebar)',
+	previousTitle : 'Previous (arrow left)',
+	nextTitle : 'Next (arrow right)',
+	moveTitle : 'Move',
+	fullExpandText : '1:1',
+	number: 'Image %1 of %2',
+	restoreTitle : 'Click to close image, click and drag to move. Use arrow keys for next and previous.'
+},
+// See http://highslide.com/ref for examples of settings  
+graphicsDir : 'highslide/graphics/',
+expandCursor : 'zoomin.cur', // null disables
+restoreCursor : 'zoomout.cur', // null disables
+expandDuration : 250, // milliseconds
+restoreDuration : 250,
+marginLeft : 15,
+marginRight : 15,
+marginTop : 15,
+marginBottom : 15,
+zIndexCounter : 10001, // adjust to other absolutely positioned elements
+loadingOpacity : 0.75,
+allowMultipleInstances: true,
+numberOfImagesToPreload : 5,
+outlineWhileAnimating : 2, // 0 = never, 1 = always, 2 = HTML only 
+outlineStartOffset : 3, // ends at 10
+padToMinWidth : false, // pad the popup width to make room for wide caption
+fullExpandPosition : 'bottom right',
+fullExpandOpacity : 1,
+showCredits : true, // you can set this to false if you want
+creditsHref : 'http://highslide.com/',
+creditsTarget : '_self',
+enableKeyListener : true,
+openerTagNames : ['a', 'area'], // Add more to allow slideshow indexing
+transitions : [],
+transitionDuration: 250,
+dimmingOpacity: 0, // Lightbox style dimming background
+dimmingDuration: 50, // 0 for instant dimming
+
+allowWidthReduction : false,
+allowHeightReduction : true,
+preserveContent : true, // Preserve changes made to the content and position of HTML popups.
+objectLoadTime : 'before', // Load iframes 'before' or 'after' expansion.
+cacheAjax : true, // Cache ajax popups for instant display. Can be overridden for each popup.
+anchor : 'auto', // where the image expands from
+align : 'auto', // position in the client (overrides anchor)
+targetX: null, // the id of a target element
+targetY: null,
+dragByHeading: true,
+minWidth: 200,
+minHeight: 200,
+allowSizeReduction: true, // allow the image to reduce to fit client size. If false, this overrides minWidth and minHeight
+outlineType : 'drop-shadow', // set null to disable outlines
+skin : {
+	controls:
+		'<div class="highslide-controls"><ul>'+
+			'<li class="highslide-previous">'+
+				'<a href="#" title="{hs.lang.previousTitle}">'+
+				'<span>{hs.lang.previousText}</span></a>'+
+			'</li>'+
+			'<li class="highslide-play">'+
+				'<a href="#" title="{hs.lang.playTitle}">'+
+				'<span>{hs.lang.playText}</span></a>'+
+			'</li>'+
+			'<li class="highslide-pause">'+
+				'<a href="#" title="{hs.lang.pauseTitle}">'+
+				'<span>{hs.lang.pauseText}</span></a>'+
+			'</li>'+
+			'<li class="highslide-next">'+
+				'<a href="#" title="{hs.lang.nextTitle}">'+
+				'<span>{hs.lang.nextText}</span></a>'+
+			'</li>'+
+			'<li class="highslide-move">'+
+				'<a href="#" title="{hs.lang.moveTitle}">'+
+				'<span>{hs.lang.moveText}</span></a>'+
+			'</li>'+
+			'<li class="highslide-full-expand">'+
+				'<a href="#" title="{hs.lang.fullExpandTitle}">'+
+				'<span>{hs.lang.fullExpandText}</span></a>'+
+			'</li>'+
+			'<li class="highslide-close">'+
+				'<a href="#" title="{hs.lang.closeTitle}" >'+
+				'<span>{hs.lang.closeText}</span></a>'+
+			'</li>'+
+		'</ul></div>'
+	,
+	contentWrapper:
+		'<div class="highslide-header"><ul>'+
+			'<li class="highslide-previous">'+
+				'<a href="#" title="{hs.lang.previousTitle}" onclick="return hs.previous(this)">'+
+				'<span>{hs.lang.previousText}</span></a>'+
+			'</li>'+
+			'<li class="highslide-next">'+
+				'<a href="#" title="{hs.lang.nextTitle}" onclick="return hs.next(this)">'+
+				'<span>{hs.lang.nextText}</span></a>'+
+			'</li>'+
+			'<li class="highslide-move">'+
+				'<a href="#" title="{hs.lang.moveTitle}" onclick="return false">'+
+				'<span>{hs.lang.moveText}</span></a>'+
+			'</li>'+
+			'<li class="highslide-close">'+
+				'<a href="#" title="{hs.lang.closeTitle}" onclick="return hs.close(this)">'+
+				'<span>{hs.lang.closeText}</span></a>'+
+			'</li>'+
+		'</ul></div>'+
+		'<div class="highslide-body"></div>'+
+		'<div class="highslide-footer"><div>'+
+			'<span class="highslide-resize" title="{hs.lang.resizeTitle}"><span></span></span>'+
+		'</div></div>'
+},
+// END OF YOUR SETTINGS
+
+
+// declare internal properties
+preloadTheseImages : [],
+continuePreloading: true,
+expanders : [],
+overrides : [
+	'allowSizeReduction',
+	'useBox',
+	'anchor',
+	'align',
+	'targetX',
+	'targetY',
+	'outlineType',
+	'outlineWhileAnimating',
+	'captionId',
+	'captionText',
+	'captionEval',
+	'captionOverlay',
+	'headingId',
+	'headingText',
+	'headingEval',
+	'headingOverlay',
+	'creditsPosition',
+	'dragByHeading',
+	'autoplay',
+	'numberPosition',
+	'transitions',
+	'dimmingOpacity',
+	
+	'width',
+	'height',
+	
+	'contentId',
+	'allowWidthReduction',
+	'allowHeightReduction',
+	'preserveContent',
+	'maincontentId',
+	'maincontentText',
+	'maincontentEval',
+	'objectType',	
+	'cacheAjax',	
+	'objectWidth',
+	'objectHeight',
+	'objectLoadTime',	
+	'swfOptions',
+	'wrapperClassName',
+	'minWidth',
+	'minHeight',
+	'maxWidth',
+	'maxHeight',
+	'pageOrigin',
+	'slideshowGroup',
+	'easing',
+	'easingClose',
+	'fadeInOut',
+	'src'
+],
+overlays : [],
+idCounter : 0,
+oPos : {
+	x: ['leftpanel', 'left', 'center', 'right', 'rightpanel'],
+	y: ['above', 'top', 'middle', 'bottom', 'below']
+},
+mouse: {},
+headingOverlay: {},
+captionOverlay: {},
+swfOptions: { flashvars: {}, params: {}, attributes: {} },
+timers : [],
+
+slideshows : [],
+
+pendingOutlines : {},
+sleeping : [],
+preloadTheseAjax : [],
+cacheBindings : [],
+cachedGets : {},
+clones : {},
+onReady: [],
+uaVersion: /Trident\/4\.0/.test(navigator.userAgent) ? 8 :
+	parseFloat((navigator.userAgent.toLowerCase().match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1]),
+ie : (document.all && !window.opera),
+//ie : navigator && /MSIE [678]/.test(navigator.userAgent), // ie9 compliant?
+safari : /Safari/.test(navigator.userAgent),
+geckoMac : /Macintosh.+rv:1\.[0-8].+Gecko/.test(navigator.userAgent),
+
+$ : function (id) {
+	if (id) return document.getElementById(id);
+},
+
+push : function (arr, val) {
+	arr[arr.length] = val;
+},
+
+createElement : function (tag, attribs, styles, parent, nopad) {
+	var el = document.createElement(tag);
+	if (attribs) hs.extend(el, attribs);
+	if (nopad) hs.setStyles(el, {padding: 0, border: 'none', margin: 0});
+	if (styles) hs.setStyles(el, styles);
+	if (parent) parent.appendChild(el);	
+	return el;
+},
+
+extend : function (el, attribs) {
+	for (var x in attribs) el[x] = attribs[x];
+	return el;
+},
+
+setStyles : function (el, styles) {
+	for (var x in styles) {
+		if (hs.ieLt9 && x == 'opacity') {
+			if (styles[x] > 0.99) el.style.removeAttribute('filter');
+			else el.style.filter = 'alpha(opacity='+ (styles[x] * 100) +')';
+		}
+		else el.style[x] = styles[x];		
+	}
+},
+animate: function(el, prop, opt) {
+	var start,
+		end,
+		unit;
+	if (typeof opt != 'object' || opt === null) {
+		var args = arguments;
+		opt = {
+			duration: args[2],
+			easing: args[3],
+			complete: args[4]
+		};
+	}
+	if (typeof opt.duration != 'number') opt.duration = 250;
+	opt.easing = Math[opt.easing] || Math.easeInQuad;
+	opt.curAnim = hs.extend({}, prop);
+	for (var name in prop) {
+		var e = new hs.fx(el, opt , name );
+		
+		start = parseFloat(hs.css(el, name)) || 0;
+		end = parseFloat(prop[name]);
+		unit = name != 'opacity' ? 'px' : '';
+		
+		e.custom( start, end, unit );
+	}	
+},
+css: function(el, prop) {
+	if (el.style[prop]) {
+		return el.style[prop];
+	} else if (document.defaultView) {
+		return document.defaultView.getComputedStyle(el, null).getPropertyValue(prop);
+
+	} else {
+		if (prop == 'opacity') prop = 'filter';
+		var val = el.currentStyle[prop.replace(/\-(\w)/g, function (a, b){ return b.toUpperCase(); })];
+		if (prop == 'filter') 
+			val = val.replace(/alpha\(opacity=([0-9]+)\)/, 
+				function (a, b) { return b / 100 });
+		return val === '' ? 1 : val;
+	} 
+},
+
+getPageSize : function () {
+	var d = document, w = window, iebody = d.compatMode && d.compatMode != 'BackCompat' 
+		? d.documentElement : d.body,
+		ieLt9 = hs.ie && (hs.uaVersion < 9 || typeof pageXOffset == 'undefined');
+	
+	var width = ieLt9 ? iebody.clientWidth : 
+			(d.documentElement.clientWidth || self.innerWidth),
+		height = ieLt9 ? iebody.clientHeight : self.innerHeight;
+	hs.page = {
+		width: width,
+		height: height,		
+		scrollLeft: ieLt9 ? iebody.scrollLeft : pageXOffset,
+		scrollTop: ieLt9 ? iebody.scrollTop : pageYOffset
+	};
+	return hs.page;
+},
+
+getPosition : function(el)	{
+	if (/area/i.test(el.tagName)) {
+		var imgs = document.getElementsByTagName('img');
+		for (var i = 0; i < imgs.length; i++) {
+			var u = imgs[i].useMap;
+			if (u && u.replace(/^.*?#/, '') == el.parentNode.name) {
+				el = imgs[i];
+				break;
+			}
+		}
+	}
+	var p = { x: el.offsetLeft, y: el.offsetTop };
+	while (el.offsetParent)	{
+		el = el.offsetParent;
+		p.x += el.offsetLeft;
+		p.y += el.offsetTop;
+		if (el != document.body && el != document.documentElement) {
+			p.x -= el.scrollLeft;
+			p.y -= el.scrollTop;
+		}
+	}
+	return p;
+},
+
+expand : function(a, params, custom, type) {
+	if (!a) a = hs.createElement('a', null, { display: 'none' }, hs.container);
+	if (typeof a.getParams == 'function') return params;
+	if (type == 'html') {
+		for (var i = 0; i < hs.sleeping.length; i++) {
+			if (hs.sleeping[i] && hs.sleeping[i].a == a) {
+				hs.sleeping[i].awake();
+				hs.sleeping[i] = null;
+				return false;
+			}
+		}
+		hs.hasHtmlExpanders = true;
+	}	
+	try {	
+		new hs.Expander(a, params, custom, type);
+		return false;
+	} catch (e) { return true; }
+},
+
+htmlExpand : function(a, params, custom) {
+	return hs.expand(a, params, custom, 'html');
+},
+
+getSelfRendered : function() {
+	return hs.createElement('div', { 
+		className: 'highslide-html-content', 
+		innerHTML: hs.replaceLang(hs.skin.contentWrapper) 
+	});
+},
+getElementByClass : function (el, tagName, className) {
+	var els = el.getElementsByTagName(tagName);
+	for (var i = 0; i < els.length; i++) {
+    	if ((new RegExp(className)).test(els[i].className)) {
+			return els[i];
+		}
+	}
+	return null;
+},
+replaceLang : function(s) {
+	s = s.replace(/\s/g, ' ');
+	var re = /{hs\.lang\.([^}]+)\}/g,
+		matches = s.match(re),
+		lang;
+	if (matches) for (var i = 0; i < matches.length; i++) {
+		lang = matches[i].replace(re, "$1");
+		if (typeof hs.lang[lang] != 'undefined') s = s.replace(matches[i], hs.lang[lang]);
+	}
+	return s;
+},
+
+
+setClickEvents : function () {
+	var els = document.getElementsByTagName('a');
+	for (var i = 0; i < els.length; i++) {
+		var type = hs.isUnobtrusiveAnchor(els[i]);
+		if (type && !els[i].hsHasSetClick) {
+			(function(){
+				var t = type;
+				if (hs.fireEvent(hs, 'onSetClickEvent', { element: els[i], type: t })) {
+					els[i].onclick =(type == 'image') ?function() { return hs.expand(this) }:
+						function() { return hs.htmlExpand(this, { objectType: t } );};
+				}
+			})();
+			els[i].hsHasSetClick = true;	
+		}
+	}
+	hs.getAnchors();
+},
+isUnobtrusiveAnchor: function(el) {
+	if (el.rel == 'highslide') return 'image';
+	else if (el.rel == 'highslide-ajax') return 'ajax';
+	else if (el.rel == 'highslide-iframe') return 'iframe';
+	else if (el.rel == 'highslide-swf') return 'swf';
+},
+
+getCacheBinding : function (a) {
+	for (var i = 0; i < hs.cacheBindings.length; i++) {
+		if (hs.cacheBindings[i][0] == a) {
+			var c = hs.cacheBindings[i][1];
+			hs.cacheBindings[i][1] = c.cloneNode(1);
+			return c;
+		}
+	}
+	return null;
+},
+
+preloadAjax : function (e) {
+	var arr = hs.getAnchors();
+	for (var i = 0; i < arr.htmls.length; i++) {
+		var a = arr.htmls[i];
+		if (hs.getParam(a, 'objectType') == 'ajax' && hs.getParam(a, 'cacheAjax'))
+			hs.push(hs.preloadTheseAjax, a);
+	}
+	
+	hs.preloadAjaxElement(0);
+},
+
+preloadAjaxElement : function (i) {
+	if (!hs.preloadTheseAjax[i]) return;
+	var a = hs.preloadTheseAjax[i];
+	var cache = hs.getNode(hs.getParam(a, 'contentId'));
+	if (!cache) cache = hs.getSelfRendered();
+	var ajax = new hs.Ajax(a, cache, 1);	
+   	ajax.onError = function () { };
+   	ajax.onLoad = function () {
+   		hs.push(hs.cacheBindings, [a, cache]);
+   		hs.preloadAjaxElement(i + 1);
+   	};
+   	ajax.run();
+},
+
+focusTopmost : function() {
+	var topZ = 0, 
+		topmostKey = -1,
+		expanders = hs.expanders,
+		exp,
+		zIndex;
+	for (var i = 0; i < expanders.length; i++) {
+		exp = expanders[i];
+		if (exp) {
+			zIndex = exp.wrapper.style.zIndex;
+			if (zIndex && zIndex > topZ) {
+				topZ = zIndex;				
+				topmostKey = i;
+			}
+		}
+	}
+	if (topmostKey == -1) hs.focusKey = -1;
+	else expanders[topmostKey].focus();
+},
+
+getParam : function (a, param) {
+	a.getParams = a.onclick;
+	var p = a.getParams ? a.getParams() : null;
+	a.getParams = null;
+	
+	return (p && typeof p[param] != 'undefined') ? p[param] : 
+		(typeof hs[param] != 'undefined' ? hs[param] : null);
+},
+
+getSrc : function (a) {
+	var src = hs.getParam(a, 'src');
+	if (src) return src;
+	return a.href;
+},
+
+getNode : function (id) {
+	var node = hs.$(id), clone = hs.clones[id], a = {};
+	if (!node && !clone) return null;
+	if (!clone) {
+		clone = node.cloneNode(true);
+		clone.id = '';
+		hs.clones[id] = clone;
+		return node;
+	} else {
+		return clone.cloneNode(true);
+	}
+},
+
+discardElement : function(d) {
+	if (d) hs.garbageBin.appendChild(d);
+	hs.garbageBin.innerHTML = '';
+},
+dim : function(exp) {
+	if (!hs.dimmer) {
+		isNew = true;
+		hs.dimmer = hs.createElement ('div', {
+				className: 'highslide-dimming highslide-viewport-size',
+				owner: '',
+				onclick: function() {
+					if (hs.fireEvent(hs, 'onDimmerClick'))
+					
+						hs.close();
+				}
+			}, {
+                visibility: 'visible',
+				opacity: 0
+			}, hs.container, true);
+			
+		if (/(Android|iPad|iPhone|iPod)/.test(navigator.userAgent)) {
+			var body = document.body;
+			function pixDimmerSize() {
+				hs.setStyles(hs.dimmer, {
+					width: body.scrollWidth +'px',
+					height: body.scrollHeight +'px'
+				});
+			}
+			pixDimmerSize();
+			hs.addEventListener(window, 'resize', pixDimmerSize);
+		}
+	}
+	hs.dimmer.style.display = '';
+
+	var isNew = hs.dimmer.owner == '';
+	hs.dimmer.owner += '|'+ exp.key;
+	
+	if (isNew) {
+		if (hs.geckoMac && hs.dimmingGeckoFix)
+			hs.setStyles(hs.dimmer, {
+				background: 'url('+ hs.graphicsDir + 'geckodimmer.png)',
+				opacity: 1
+			});
+		else
+			hs.animate(hs.dimmer, { opacity: exp.dimmingOpacity }, hs.dimmingDuration);
+	}
+},
+undim : function(key) {
+	if (!hs.dimmer) return;
+	if (typeof key != 'undefined') hs.dimmer.owner = hs.dimmer.owner.replace('|'+ key, '');
+
+	if (
+		(typeof key != 'undefined' && hs.dimmer.owner != '')
+		|| (hs.upcoming && hs.getParam(hs.upcoming, 'dimmingOpacity'))
+	) return;
+
+	if (hs.geckoMac && hs.dimmingGeckoFix) hs.dimmer.style.display = 'none';
+	else hs.animate(hs.dimmer, { opacity: 0 }, hs.dimmingDuration, null, function() {
+		hs.dimmer.style.display = 'none';
+	});
+},
+transit : function (adj, exp) {
+	var last = exp || hs.getExpander();
+	exp = last;
+	if (hs.upcoming) return false;
+	else hs.last = last;
+	hs.removeEventListener(document, window.opera ? 'keypress' : 'keydown', hs.keyHandler);
+	try {
+		hs.upcoming = adj;
+		adj.onclick(); 		
+	} catch (e){
+		hs.last = hs.upcoming = null;
+	}
+	try {
+		if (!adj || exp.transitions[1] != 'crossfade')
+		exp.close();
+	} catch (e) {}
+	return false;
+},
+
+previousOrNext : function (el, op) {
+	var exp = hs.getExpander(el);
+	if (exp) return hs.transit(exp.getAdjacentAnchor(op), exp);
+	else return false;
+},
+
+previous : function (el) {
+	return hs.previousOrNext(el, -1);
+},
+
+next : function (el) {
+	return hs.previousOrNext(el, 1);	
+},
+
+keyHandler : function(e) {
+	if (!e) e = window.event;
+	if (!e.target) e.target = e.srcElement; // ie
+	if (typeof e.target.form != 'undefined') return true; // form element has focus
+	if (!hs.fireEvent(hs, 'onKeyDown', e)) return true;
+	var exp = hs.getExpander();
+	
+	var op = null;
+	switch (e.keyCode) {
+		case 70: // f
+			if (exp) exp.doFullExpand();
+			return true;
+		case 32: // Space
+			op = 2;
+			break;
+		case 34: // Page Down
+		case 39: // Arrow right
+		case 40: // Arrow down
+			op = 1;
+			break;
+		case 8:  // Backspace
+		case 33: // Page Up
+		case 37: // Arrow left
+		case 38: // Arrow up
+			op = -1;
+			break;
+		case 27: // Escape
+		case 13: // Enter
+			op = 0;
+	}
+	if (op !== null) {if (op != 2)hs.removeEventListener(document, window.opera ? 'keypress' : 'keydown', hs.keyHandler);
+		if (!hs.enableKeyListener) return true;
+		
+		if (e.preventDefault) e.preventDefault();
+    	else e.returnValue = false;
+    	if (exp) {
+			if (op == 0) {
+				exp.close();
+			} else if (op == 2) {
+				if (exp.slideshow) exp.slideshow.hitSpace();
+			} else {
+				if (exp.slideshow) exp.slideshow.pause();
+				hs.previousOrNext(exp.key, op);
+			}
+			return false;
+		}
+	}
+	return true;
+},
+
+
+registerOverlay : function (overlay) {
+	hs.push(hs.overlays, hs.extend(overlay, { hsId: 'hsId'+ hs.idCounter++ } ));
+},
+
+
+addSlideshow : function (options) {
+	var sg = options.slideshowGroup;
+	if (typeof sg == 'object') {
+		for (var i = 0; i < sg.length; i++) {
+			var o = {};
+			for (var x in options) o[x] = options[x];
+			o.slideshowGroup = sg[i];
+			hs.push(hs.slideshows, o);
+		}
+	} else {
+		hs.push(hs.slideshows, options);
+	}
+},
+
+getWrapperKey : function (element, expOnly) {
+	var el, re = /^highslide-wrapper-([0-9]+)$/;
+	// 1. look in open expanders
+	el = element;
+	while (el.parentNode)	{
+		if (el.hsKey !== undefined) return el.hsKey;
+		if (el.id && re.test(el.id)) return el.id.replace(re, "$1");
+		el = el.parentNode;
+	}
+	// 2. look in thumbnail
+	if (!expOnly) {
+		el = element;
+		while (el.parentNode)	{
+			if (el.tagName && hs.isHsAnchor(el)) {
+				for (var key = 0; key < hs.expanders.length; key++) {
+					var exp = hs.expanders[key];
+					if (exp && exp.a == el) return key;
+				}
+			}
+			el = el.parentNode;
+		}
+	}
+	return null; 
+},
+
+getExpander : function (el, expOnly) {
+	if (typeof el == 'undefined') return hs.expanders[hs.focusKey] || null;
+	if (typeof el == 'number') return hs.expanders[el] || null;
+	if (typeof el == 'string') el = hs.$(el);
+	return hs.expanders[hs.getWrapperKey(el, expOnly)] || null;
+},
+
+isHsAnchor : function (a) {
+	return (a.onclick && a.onclick.toString().replace(/\s/g, ' ').match(/hs.(htmlE|e)xpand/));
+},
+
+reOrder : function () {
+	for (var i = 0; i < hs.expanders.length; i++)
+		if (hs.expanders[i] && hs.expanders[i].isExpanded) hs.focusTopmost();
+},
+fireEvent : function (obj, evt, args) {
+	return obj && obj[evt] ? (obj[evt](obj, args) !== false) : true;
+},
+
+mouseClickHandler : function(e) 
+{	
+	if (!e) e = window.event;
+	if (e.button > 1) return true;
+	if (!e.target) e.target = e.srcElement;
+	
+	var el = e.target;
+	while (el.parentNode
+		&& !(/highslide-(image|move|html|resize)/.test(el.className)))
+	{
+		el = el.parentNode;
+	}
+	var exp = hs.getExpander(el);
+	if (exp && (exp.isClosing || !exp.isExpanded)) return true;
+		
+	if (exp && e.type == 'mousedown') {
+		if (e.target.form) return true;
+		var match = el.className.match(/highslide-(image|move|resize)/);
+		if (match) {
+			hs.dragArgs = { 
+				exp: exp , 
+				type: match[1], 
+				left: exp.x.pos, 
+				width: exp.x.size, 
+				top: exp.y.pos, 
+				height: exp.y.size, 
+				clickX: e.clientX, 
+				clickY: e.clientY
+			};
+			
+			
+			hs.addEventListener(document, 'mousemove', hs.dragHandler);
+			if (e.preventDefault) e.preventDefault(); // FF
+			
+			if (/highslide-(image|html)-blur/.test(exp.content.className)) {
+				exp.focus();
+				hs.hasFocused = true;
+			}
+			return false;
+		}
+		else if (/highslide-html/.test(el.className) && hs.focusKey != exp.key) {
+			exp.focus();
+			exp.doShowHide('hidden');
+		}
+	} else if (e.type == 'mouseup') {
+		
+		hs.removeEventListener(document, 'mousemove', hs.dragHandler);
+		
+		if (hs.dragArgs) {
+			if (hs.styleRestoreCursor && hs.dragArgs.type == 'image') 
+				hs.dragArgs.exp.content.style.cursor = hs.styleRestoreCursor;
+			var hasDragged = hs.dragArgs.hasDragged;
+			
+			if (!hasDragged &&!hs.hasFocused && !/(move|resize)/.test(hs.dragArgs.type)) {
+				if (hs.fireEvent(exp, 'onImageClick'))
+				exp.close();
+			} 
+			else if (hasDragged || (!hasDragged && hs.hasHtmlExpanders)) {
+				hs.dragArgs.exp.doShowHide('hidden');
+			}
+			
+			if (hs.dragArgs.exp.releaseMask) 
+				hs.dragArgs.exp.releaseMask.style.display = 'none';
+			
+			if (hasDragged) hs.fireEvent(hs.dragArgs.exp, 'onDrop', hs.dragArgs);
+			hs.hasFocused = false;
+			hs.dragArgs = null;
+		
+		} else if (/highslide-image-blur/.test(el.className)) {
+			el.style.cursor = hs.styleRestoreCursor;		
+		}
+	}
+	return false;
+},
+
+dragHandler : function(e)
+{
+	if (!hs.dragArgs) return true;
+	if (!e) e = window.event;
+	var a = hs.dragArgs, exp = a.exp;
+	if (exp.iframe) {		
+		if (!exp.releaseMask) exp.releaseMask = hs.createElement('div', null, 
+			{ position: 'absolute', width: exp.x.size+'px', height: exp.y.size+'px', 
+				left: exp.x.cb+'px', top: exp.y.cb+'px', zIndex: 4,	background: (hs.ieLt9 ? 'white' : 'none'), 
+				opacity: 0.01 }, 
+			exp.wrapper, true);
+		if (exp.releaseMask.style.display == 'none')
+			exp.releaseMask.style.display = '';
+	}
+	
+	a.dX = e.clientX - a.clickX;
+	a.dY = e.clientY - a.clickY;	
+	
+	var distance = Math.sqrt(Math.pow(a.dX, 2) + Math.pow(a.dY, 2));
+	if (!a.hasDragged) a.hasDragged = (a.type != 'image' && distance > 0)
+		|| (distance > (hs.dragSensitivity || 5));
+	
+	if (a.hasDragged && e.clientX > 5 && e.clientY > 5) {
+		if (!hs.fireEvent(exp, 'onDrag', a)) return false;
+		
+		if (a.type == 'resize') exp.resize(a);
+		else {
+			exp.moveTo(a.left + a.dX, a.top + a.dY);
+			if (a.type == 'image') exp.content.style.cursor = 'move';
+		}
+	}
+	return false;
+},
+
+wrapperMouseHandler : function (e) {
+	try {
+		if (!e) e = window.event;
+		var over = /mouseover/i.test(e.type); 
+		if (!e.target) e.target = e.srcElement; // ie
+		if (!e.relatedTarget) e.relatedTarget = 
+			over ? e.fromElement : e.toElement; // ie
+		var exp = hs.getExpander(e.target);
+		if (!exp.isExpanded) return;
+		if (!exp || !e.relatedTarget || hs.getExpander(e.relatedTarget, true) == exp 
+			|| hs.dragArgs) return;
+		hs.fireEvent(exp, over ? 'onMouseOver' : 'onMouseOut', e);
+		for (var i = 0; i < exp.overlays.length; i++) (function() {
+			var o = hs.$('hsId'+ exp.overlays[i]);
+			if (o && o.hideOnMouseOut) {
+				if (over) hs.setStyles(o, { visibility: 'visible', display: '' });
+				hs.animate(o, { opacity: over ? o.opacity : 0 }, o.dur);
+			}
+		})();	
+	} catch (e) {}
+},
+addEventListener : function (el, event, func) {
+	if (el == document && event == 'ready') {
+		hs.push(hs.onReady, func);
+	}
+	try {
+		el.addEventListener(event, func, false);
+	} catch (e) {
+		try {
+			el.detachEvent('on'+ event, func);
+			el.attachEvent('on'+ event, func);
+		} catch (e) {
+			el['on'+ event] = func;
+		}
+	} 
+},
+
+removeEventListener : function (el, event, func) {
+	try {
+		el.removeEventListener(event, func, false);
+	} catch (e) {
+		try {
+			el.detachEvent('on'+ event, func);
+		} catch (e) {
+			el['on'+ event] = null;
+		}
+	}
+},
+
+preloadFullImage : function (i) {
+	if (hs.continuePreloading && hs.preloadTheseImages[i] && hs.preloadTheseImages[i] != 'undefined') {
+		var img = document.createElement('img');
+		img.onload = function() { 
+			img = null;
+			hs.preloadFullImage(i + 1);
+		};
+		img.src = hs.preloadTheseImages[i];
+	}
+},
+preloadImages : function (number) {
+	if (number && typeof number != 'object') hs.numberOfImagesToPreload = number;
+	
+	var arr = hs.getAnchors();
+	for (var i = 0; i < arr.images.length && i < hs.numberOfImagesToPreload; i++) {
+		hs.push(hs.preloadTheseImages, hs.getSrc(arr.images[i]));
+	}
+	
+	// preload outlines
+	if (hs.outlineType)	new hs.Outline(hs.outlineType, function () { hs.preloadFullImage(0)} );
+	else
+	
+	hs.preloadFullImage(0);
+	
+	// preload cursor
+	if (hs.restoreCursor) var cur = hs.createElement('img', { src: hs.graphicsDir + hs.restoreCursor });
+},
+
+
+init : function () {
+	if (!hs.container) {
+	
+		hs.ieLt7 = hs.ie && hs.uaVersion < 7;
+		hs.ieLt9 = hs.ie && hs.uaVersion < 9;
+		
+		hs.getPageSize();
+		hs.ie6SSL = hs.ieLt7 && location.protocol == 'https:';
+		for (var x in hs.langDefaults) {
+			if (typeof hs[x] != 'undefined') hs.lang[x] = hs[x];
+			else if (typeof hs.lang[x] == 'undefined' && typeof hs.langDefaults[x] != 'undefined') 
+				hs.lang[x] = hs.langDefaults[x];
+		}
+		
+		hs.container = hs.createElement('div', {
+				className: 'highslide-container'
+			}, {
+				position: 'absolute',
+				left: 0, 
+				top: 0, 
+				width: '100%', 
+				zIndex: hs.zIndexCounter,
+				direction: 'ltr'
+			}, 
+			document.body,
+			true
+		);
+		hs.loading = hs.createElement('a', {
+				className: 'highslide-loading',
+				title: hs.lang.loadingTitle,
+				innerHTML: hs.lang.loadingText,
+				href: 'javascript:;'
+			}, {
+				position: 'absolute',
+				top: '-9999px',
+				opacity: hs.loadingOpacity,
+				zIndex: 1
+			}, hs.container
+		);
+		hs.garbageBin = hs.createElement('div', null, { display: 'none' }, hs.container);
+		hs.viewport = hs.createElement('div', {
+				className: 'highslide-viewport highslide-viewport-size'
+			}, {
+				visibility: (hs.safari && hs.uaVersion < 525) ? 'visible' : 'hidden'
+			}, hs.container, 1
+		);
+		hs.clearing = hs.createElement('div', null, 
+			{ clear: 'both', paddingTop: '1px' }, null, true);
+		
+		// http://www.robertpenner.com/easing/ 
+		Math.linearTween = function (t, b, c, d) {
+			return c*t/d + b;
+		};
+		Math.easeInQuad = function (t, b, c, d) {
+			return c*(t/=d)*t + b;
+		};
+		Math.easeOutQuad = function (t, b, c, d) {
+			return -c *(t/=d)*(t-2) + b;
+		};
+		
+		hs.hideSelects = hs.ieLt7;
+		hs.hideIframes = ((window.opera && hs.uaVersion < 9) || navigator.vendor == 'KDE' 
+			|| (hs.ieLt7 && hs.uaVersion < 5.5));
+		hs.fireEvent(this, 'onActivate');
+	}
+},
+ready : function() {
+	if (hs.isReady) return;
+	hs.isReady = true;
+	for (var i = 0; i < hs.onReady.length; i++) hs.onReady[i]();
+},
+
+updateAnchors : function() {
+	var el, els, all = [], images = [], htmls = [],groups = {}, re;
+		
+	for (var i = 0; i < hs.openerTagNames.length; i++) {
+		els = document.getElementsByTagName(hs.openerTagNames[i]);
+		for (var j = 0; j < els.length; j++) {
+			el = els[j];
+			re = hs.isHsAnchor(el);
+			if (re) {
+				hs.push(all, el);
+				if (re[0] == 'hs.expand') hs.push(images, el);
+				else if (re[0] == 'hs.htmlExpand') hs.push(htmls, el);
+				var g = hs.getParam(el, 'slideshowGroup') || 'none';
+				if (!groups[g]) groups[g] = [];
+				hs.push(groups[g], el);
+			}
+		}
+	}
+	hs.anchors = { all: all, groups: groups, images: images, htmls: htmls };
+	return hs.anchors;
+	
+},
+
+getAnchors : function() {
+	return hs.anchors || hs.updateAnchors();
+},
+
+
+close : function(el) {
+	var exp = hs.getExpander(el);
+	if (exp) exp.close();
+	return false;
+}
+}; // end hs object
+hs.fx = function( elem, options, prop ){
+	this.options = options;
+	this.elem = elem;
+	this.prop = prop;
+
+	if (!options.orig) options.orig = {};
+};
+hs.fx.prototype = {
+	update: function(){
+		(hs.fx.step[this.prop] || hs.fx.step._default)(this);
+		
+		if (this.options.step)
+			this.options.step.call(this.elem, this.now, this);
+
+	},
+	custom: function(from, to, unit){
+		this.startTime = (new Date()).getTime();
+		this.start = from;
+		this.end = to;
+		this.unit = unit;// || this.unit || "px";
+		this.now = this.start;
+		this.pos = this.state = 0;
+
+		var self = this;
+		function t(gotoEnd){
+			return self.step(gotoEnd);
+		}
+
+		t.elem = this.elem;
+
+		if ( t() && hs.timers.push(t) == 1 ) {
+			hs.timerId = setInterval(function(){
+				var timers = hs.timers;
+
+				for ( var i = 0; i < timers.length; i++ )
+					if ( !timers[i]() )
+						timers.splice(i--, 1);
+
+				if ( !timers.length ) {
+					clearInterval(hs.timerId);
+				}
+			}, 13);
+		}
+	},
+	step: function(gotoEnd){
+		var t = (new Date()).getTime();
+		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.complete) this.options.complete.call(this.elem);
+			}
+			return false;
+		} else {
+			var n = t - this.startTime;
+			this.state = n / this.options.duration;
+			this.pos = this.options.easing(n, 0, 1, this.options.duration);
+			this.now = this.start + ((this.end - this.start) * this.pos);
+			this.update();
+		}
+		return true;
+	}
+
+};
+
+hs.extend( hs.fx, {
+	step: {
+
+		opacity: function(fx){
+			hs.setStyles(fx.elem, { opacity: fx.now });
+		},
+
+		_default: function(fx){
+			try {
+				if ( fx.elem.style && fx.elem.style[ fx.prop ] != null )
+					fx.elem.style[ fx.prop ] = fx.now + fx.unit;
+				else
+					fx.elem[ fx.prop ] = fx.now;
+			} catch (e) {}
+		}
+	}
+});
+
+hs.Outline =  function (outlineType, onLoad) {
+	this.onLoad = onLoad;
+	this.outlineType = outlineType;
+	var v = hs.uaVersion, tr;
+	
+	this.hasAlphaImageLoader = hs.ie && hs.uaVersion < 7;
+	if (!outlineType) {
+		if (onLoad) onLoad();
+		return;
+	}
+	
+	hs.init();
+	this.table = hs.createElement(
+		'table', { 
+			cellSpacing: 0 
+		}, {
+			visibility: 'hidden',
+			position: 'absolute',
+			borderCollapse: 'collapse',
+			width: 0
+		},
+		hs.container,
+		true
+	);
+	var tbody = hs.createElement('tbody', null, null, this.table, 1);
+	
+	this.td = [];
+	for (var i = 0; i <= 8; i++) {
+		if (i % 3 == 0) tr = hs.createElement('tr', null, { height: 'auto' }, tbody, true);
+		this.td[i] = hs.createElement('td', null, null, tr, true);
+		var style = i != 4 ? { lineHeight: 0, fontSize: 0} : { position : 'relative' };
+		hs.setStyles(this.td[i], style);
+	}
+	this.td[4].className = outlineType +' highslide-outline';
+	
+	this.preloadGraphic(); 
+};
+
+hs.Outline.prototype = {
+preloadGraphic : function () {
+	var src = hs.graphicsDir + (hs.outlinesDir || "outlines/")+ this.outlineType +".png";
+				
+	var appendTo = hs.safari && hs.uaVersion < 525 ? hs.container : null;
+	this.graphic = hs.createElement('img', null, { position: 'absolute', 
+		top: '-9999px' }, appendTo, true); // for onload trigger
+	
+	var pThis = this;
+	this.graphic.onload = function() { pThis.onGraphicLoad(); };
+	
+	this.graphic.src = src;
+},
+
+onGraphicLoad : function () {
+	var o = this.offset = this.graphic.width / 4,
+		pos = [[0,0],[0,-4],[-2,0],[0,-8],0,[-2,-8],[0,-2],[0,-6],[-2,-2]],
+		dim = { height: (2*o) +'px', width: (2*o) +'px' };
+	for (var i = 0; i <= 8; i++) {
+		if (pos[i]) {
+			if (this.hasAlphaImageLoader) {
+				var w = (i == 1 || i == 7) ? '100%' : this.graphic.width +'px';
+				var div = hs.createElement('div', null, { width: '100%', height: '100%', position: 'relative', overflow: 'hidden'}, this.td[i], true);
+				hs.createElement ('div', null, { 
+						filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale, src='"+ this.graphic.src + "')", 
+						position: 'absolute',
+						width: w, 
+						height: this.graphic.height +'px',
+						left: (pos[i][0]*o)+'px',
+						top: (pos[i][1]*o)+'px'
+					}, 
+				div,
+				true);
+			} else {
+				hs.setStyles(this.td[i], { background: 'url('+ this.graphic.src +') '+ (pos[i][0]*o)+'px '+(pos[i][1]*o)+'px'});
+			}
+			
+			if (window.opera && (i == 3 || i ==5)) 
+				hs.createElement('div', null, dim, this.td[i], true);
+			
+			hs.setStyles (this.td[i], dim);
+		}
+	}
+	this.graphic = null;
+	if (hs.pendingOutlines[this.outlineType]) hs.pendingOutlines[this.outlineType].destroy();
+	hs.pendingOutlines[this.outlineType] = this;
+	if (this.onLoad) this.onLoad();
+},
+	
+setPosition : function (pos, offset, vis, dur, easing) {
+	var exp = this.exp,
+		stl = exp.wrapper.style,
+		offset = offset || 0,
+		pos = pos || {
+			x: exp.x.pos + offset,
+			y: exp.y.pos + offset,
+			w: exp.x.get('wsize') - 2 * offset,
+			h: exp.y.get('wsize') - 2 * offset
+		};
+	if (vis) this.table.style.visibility = (pos.h >= 4 * this.offset) 
+		? 'visible' : 'hidden';
+	hs.setStyles(this.table, {
+		left: (pos.x - this.offset) +'px',
+		top: (pos.y - this.offset) +'px',
+		width: (pos.w + 2 * this.offset) +'px'
+	});
+	
+	pos.w -= 2 * this.offset;
+	pos.h -= 2 * this.offset;
+	hs.setStyles (this.td[4], {
+		width: pos.w >= 0 ? pos.w +'px' : 0,
+		height: pos.h >= 0 ? pos.h +'px' : 0
+	});
+	if (this.hasAlphaImageLoader) this.td[3].style.height 
+		= this.td[5].style.height = this.td[4].style.height;	
+	
+},
+	
+destroy : function(hide) {
+	if (hide) this.table.style.visibility = 'hidden';
+	else hs.discardElement(this.table);
+}
+};
+
+hs.Dimension = function(exp, dim) {
+	this.exp = exp;
+	this.dim = dim;
+	this.ucwh = dim == 'x' ? 'Width' : 'Height';
+	this.wh = this.ucwh.toLowerCase();
+	this.uclt = dim == 'x' ? 'Left' : 'Top';
+	this.lt = this.uclt.toLowerCase();
+	this.ucrb = dim == 'x' ? 'Right' : 'Bottom';
+	this.rb = this.ucrb.toLowerCase();
+	this.p1 = this.p2 = 0;
+};
+hs.Dimension.prototype = {
+get : function(key) {
+	switch (key) {
+		case 'loadingPos':
+			return this.tpos + this.tb + (this.t - hs.loading['offset'+ this.ucwh]) / 2;
+		case 'loadingPosXfade':
+			return this.pos + this.cb+ this.p1 + (this.size - hs.loading['offset'+ this.ucwh]) / 2;
+		case 'wsize':
+			return this.size + 2 * this.cb + this.p1 + this.p2;
+		case 'fitsize':
+			return this.clientSize - this.marginMin - this.marginMax;
+		case 'maxsize':
+			return this.get('fitsize') - 2 * this.cb - this.p1 - this.p2 ;
+		case 'opos':
+			return this.pos - (this.exp.outline ? this.exp.outline.offset : 0);
+		case 'osize':
+			return this.get('wsize') + (this.exp.outline ? 2*this.exp.outline.offset : 0);
+		case 'imgPad':
+			return this.imgSize ? Math.round((this.size - this.imgSize) / 2) : 0;
+		
+	}
+},
+calcBorders: function() {
+	// correct for borders
+	this.cb = (this.exp.content['offset'+ this.ucwh] - this.t) / 2;
+	
+	this.marginMax = hs['margin'+ this.ucrb];
+},
+calcThumb: function() {
+	this.t = this.exp.el[this.wh] ? parseInt(this.exp.el[this.wh]) : 
+		this.exp.el['offset'+ this.ucwh];
+	this.tpos = this.exp.tpos[this.dim];
+	this.tb = (this.exp.el['offset'+ this.ucwh] - this.t) / 2;
+	if (this.tpos == 0 || this.tpos == -1) {
+		this.tpos = (hs.page[this.wh] / 2) + hs.page['scroll'+ this.uclt];		
+	};
+},
+calcExpanded: function() {
+	var exp = this.exp;
+	this.justify = 'auto';
+	
+	// get alignment
+	if (exp.align == 'center') this.justify = 'center';
+	else if (new RegExp(this.lt).test(exp.anchor)) this.justify = null;
+	else if (new RegExp(this.rb).test(exp.anchor)) this.justify = 'max';
+	
+	
+	// size and position
+	this.pos = this.tpos - this.cb + this.tb;
+	
+	if (this.maxHeight && this.dim == 'x')
+		exp.maxWidth = Math.min(exp.maxWidth || this.full, exp.maxHeight * this.full / exp.y.full); 
+		
+	this.size = Math.min(this.full, exp['max'+ this.ucwh] || this.full);
+	this.minSize = exp.allowSizeReduction ? 
+		Math.min(exp['min'+ this.ucwh], this.full) :this.full;
+	if (exp.isImage && exp.useBox)	{
+		this.size = exp[this.wh];
+		this.imgSize = this.full;
+	}
+	if (this.dim == 'x' && hs.padToMinWidth) this.minSize = exp.minWidth;
+	this.target = exp['target'+ this.dim.toUpperCase()];
+	this.marginMin = hs['margin'+ this.uclt];
+	this.scroll = hs.page['scroll'+ this.uclt];
+	this.clientSize = hs.page[this.wh];
+},
+setSize: function(i) {
+	var exp = this.exp;
+	if (exp.isImage && (exp.useBox || hs.padToMinWidth)) {
+		this.imgSize = i;
+		this.size = Math.max(this.size, this.imgSize);
+		exp.content.style[this.lt] = this.get('imgPad')+'px';
+	} else
+	this.size = i;
+	
+	exp.content.style[this.wh] = i +'px';
+	exp.wrapper.style[this.wh] = this.get('wsize') +'px';
+	if (exp.outline) exp.outline.setPosition();
+	if (exp.releaseMask) exp.releaseMask.style[this.wh] = i +'px';
+	if (this.dim == 'y' && exp.iDoc && exp.body.style.height != 'auto') try {
+		exp.iDoc.body.style.overflow = 'auto';
+	} catch (e) {}
+	if (exp.isHtml) {
+		var d = exp.scrollerDiv;
+		if (this.sizeDiff === undefined)
+			this.sizeDiff = exp.innerContent['offset'+ this.ucwh] - d['offset'+ this.ucwh];
+		d.style[this.wh] = (this.size - this.sizeDiff) +'px';
+			
+		if (this.dim == 'x') exp.mediumContent.style.width = 'auto';
+		if (exp.body) exp.body.style[this.wh] = 'auto';
+	}
+	if (this.dim == 'x' && exp.overlayBox) exp.sizeOverlayBox(true);
+	if (this.dim == 'x' && exp.slideshow && exp.isImage) {
+		if (i == this.full) exp.slideshow.disable('full-expand');
+		else exp.slideshow.enable('full-expand');
+	}
+},
+setPos: function(i) {
+	this.pos = i;
+	this.exp.wrapper.style[this.lt] = i +'px';	
+	
+	if (this.exp.outline) this.exp.outline.setPosition();
+	
+}
+};
+
+hs.Expander = function(a, params, custom, contentType) {
+	if (document.readyState && hs.ie && !hs.isReady) {
+		hs.addEventListener(document, 'ready', function() {
+			new hs.Expander(a, params, custom, contentType);
+		});
+		return;
+	} 
+	this.a = a;
+	this.custom = custom;
+	this.contentType = contentType || 'image';
+	this.isHtml = (contentType == 'html');
+	this.isImage = !this.isHtml;
+	
+	hs.continuePreloading = false;
+	this.overlays = [];
+	this.last = hs.last;
+	hs.last = null;
+	hs.init();
+	var key = this.key = hs.expanders.length;
+	// override inline parameters
+	for (var i = 0; i < hs.overrides.length; i++) {
+		var name = hs.overrides[i];
+		this[name] = params && typeof params[name] != 'undefined' ?
+			params[name] : hs[name];
+	}
+	if (!this.src) this.src = a.href;
+	
+	// get thumb
+	var el = (params && params.thumbnailId) ? hs.$(params.thumbnailId) : a;
+	el = this.thumb = el.getElementsByTagName('img')[0] || el;
+	this.thumbsUserSetId = el.id || a.id;
+	if (!hs.fireEvent(this, 'onInit')) return true;
+	
+	// check if already open
+	for (var i = 0; i < hs.expanders.length; i++) {
+		if (hs.expanders[i] && hs.expanders[i].a == a 
+			&& !(this.last && this.transitions[1] == 'crossfade')) {
+			hs.expanders[i].focus();
+			return false;
+		}
+	}	
+
+	// cancel other
+	if (!hs.allowSimultaneousLoading) for (var i = 0; i < hs.expanders.length; i++) {
+		if (hs.expanders[i] && hs.expanders[i].thumb != el && !hs.expanders[i].onLoadStarted) {
+			hs.expanders[i].cancelLoading();
+		}
+	}
+	hs.expanders[key] = this;
+	if (!hs.allowMultipleInstances && !hs.upcoming) {
+		if (hs.expanders[key-1]) hs.expanders[key-1].close();
+		if (typeof hs.focusKey != 'undefined' && hs.expanders[hs.focusKey])
+			hs.expanders[hs.focusKey].close();
+	}
+	
+	// initiate metrics
+	this.el = el;
+	this.tpos = this.pageOrigin || hs.getPosition(el);
+	hs.getPageSize();
+	var x = this.x = new hs.Dimension(this, 'x');
+	x.calcThumb();
+	var y = this.y = new hs.Dimension(this, 'y');
+	y.calcThumb();
+	if (/area/i.test(el.tagName)) this.getImageMapAreaCorrection(el);
+	this.wrapper = hs.createElement(
+		'div', {
+			id: 'highslide-wrapper-'+ this.key,
+			className: 'highslide-wrapper '+ this.wrapperClassName
+		}, {
+			visibility: 'hidden',
+			position: 'absolute',
+			zIndex: hs.zIndexCounter += 2
+		}, null, true );
+	
+	this.wrapper.onmouseover = this.wrapper.onmouseout = hs.wrapperMouseHandler;
+	if (this.contentType == 'image' && this.outlineWhileAnimating == 2)
+		this.outlineWhileAnimating = 0;
+	
+	// get the outline
+	if (!this.outlineType 
+		|| (this.last && this.isImage && this.transitions[1] == 'crossfade')) {
+		this[this.contentType +'Create']();
+	
+	} else if (hs.pendingOutlines[this.outlineType]) {
+		this.connectOutline();
+		this[this.contentType +'Create']();
+	
+	} else {
+		this.showLoading();
+		var exp = this;
+		new hs.Outline(this.outlineType, 
+			function () {
+				exp.connectOutline();
+				exp[exp.contentType +'Create']();
+			} 
+		);
+	}
+	return true;
+};
+
+hs.Expander.prototype = {
+error : function(e) {
+	if (hs.debug) alert ('Line '+ e.lineNumber +': '+ e.message);
+	else window.location.href = this.src;
+},
+
+connectOutline : function() {
+	var outline = this.outline = hs.pendingOutlines[this.outlineType];
+	outline.exp = this;
+	outline.table.style.zIndex = this.wrapper.style.zIndex - 1;
+	hs.pendingOutlines[this.outlineType] = null;
+},
+
+showLoading : function() {
+	if (this.onLoadStarted || this.loading) return;
+	
+	this.loading = hs.loading;
+	var exp = this;
+	this.loading.onclick = function() {
+		exp.cancelLoading();
+	};
+	
+	
+	if (!hs.fireEvent(this, 'onShowLoading')) return;
+	var exp = this, 
+		l = this.x.get('loadingPos') +'px',
+		t = this.y.get('loadingPos') +'px';
+	if (!tgt && this.last && this.transitions[1] == 'crossfade') 
+		var tgt = this.last; 
+	if (tgt) {
+		l = tgt.x.get('loadingPosXfade') +'px';
+		t = tgt.y.get('loadingPosXfade') +'px';
+		this.loading.style.zIndex = hs.zIndexCounter++;
+	}
+	setTimeout(function () { 
+		if (exp.loading) hs.setStyles(exp.loading, { left: l, top: t, zIndex: hs.zIndexCounter++ })}
+	, 100);
+},
+
+imageCreate : function() {
+	var exp = this;
+	
+	var img = document.createElement('img');
+    this.content = img;
+    img.onload = function () {
+    	if (hs.expanders[exp.key]) exp.contentLoaded(); 
+	};
+    if (hs.blockRightClick) img.oncontextmenu = function() { return false; };
+    img.className = 'highslide-image';
+    hs.setStyles(img, {
+    	visibility: 'hidden',
+    	display: 'block',
+    	position: 'absolute',
+		maxWidth: '9999px',
+		zIndex: 3
+	});
+    img.title = hs.lang.restoreTitle;
+	if (hs.safari && hs.uaVersion < 525) hs.container.appendChild(img);
+    if (hs.ie && hs.flushImgSize) img.src = null;
+	img.src = this.src;
+	
+	this.showLoading();
+},
+
+htmlCreate : function () {
+	if (!hs.fireEvent(this, 'onBeforeGetContent')) return;
+	
+	this.content = hs.getCacheBinding(this.a);
+	if (!this.content) 
+		this.content = hs.getNode(this.contentId);
+	if (!this.content) 
+		this.content = hs.getSelfRendered();
+	this.getInline(['maincontent']);
+	if (this.maincontent) {
+		var body = hs.getElementByClass(this.content, 'div', 'highslide-body');
+		if (body) body.appendChild(this.maincontent);
+		this.maincontent.style.display = 'block';
+	}
+	hs.fireEvent(this, 'onAfterGetContent');
+	
+	var innerContent = this.innerContent = this.content;
+	
+	if (/(swf|iframe)/.test(this.objectType)) this.setObjContainerSize(innerContent);
+	
+	// the content tree
+	hs.container.appendChild(this.wrapper);
+	hs.setStyles( this.wrapper, { 
+		position: 'static',
+		padding: '0 '+ hs.marginRight +'px 0 '+ hs.marginLeft +'px'
+	});
+	this.content = hs.createElement(
+    	'div', {
+    		className: 'highslide-html' 
+    	}, {
+			position: 'relative',
+			zIndex: 3,
+			height: 0,
+			overflow: 'hidden'
+		},
+		this.wrapper
+	);
+	this.mediumContent = hs.createElement('div', null, null, this.content, 1);
+	this.mediumContent.appendChild(innerContent);
+	
+	hs.setStyles (innerContent, { 
+		position: 'relative',
+		display: 'block',
+		direction: hs.lang.cssDirection || ''
+	});
+	if (this.width) innerContent.style.width = this.width +'px';
+	if (this.height) hs.setStyles(innerContent, {
+		height: this.height +'px',
+		overflow: 'hidden'
+	});
+	if (innerContent.offsetWidth < this.minWidth)
+		innerContent.style.width = this.minWidth +'px';
+		
+	
+    
+	if (this.objectType == 'ajax' && !hs.getCacheBinding(this.a)) {
+		this.showLoading();
+    	var exp = this;
+    	var ajax = new hs.Ajax(this.a, innerContent);
+		ajax.src = this.src;
+    	ajax.onLoad = function () {	if (hs.expanders[exp.key]) exp.contentLoaded(); };
+    	ajax.onError = function () { location.href = exp.src; };
+    	ajax.run();
+	}
+    else
+    
+    if (this.objectType == 'iframe' && this.objectLoadTime == 'before') {
+		this.writeExtendedContent();
+	}
+    else
+    	this.contentLoaded();
+},
+
+contentLoaded : function() {
+	try {	
+		if (!this.content) return;
+		this.content.onload = null;
+		if (this.onLoadStarted) return;
+		else this.onLoadStarted = true;
+		
+		var x = this.x, y = this.y;
+		
+		if (this.loading) {
+			hs.setStyles(this.loading, { top: '-9999px' });
+			this.loading = null;
+			hs.fireEvent(this, 'onHideLoading');
+		}
+		if (this.isImage) {	
+			x.full = this.content.width;
+			y.full = this.content.height;
+			
+			hs.setStyles(this.content, {
+				width: x.t +'px',
+				height: y.t +'px'
+			});
+			this.wrapper.appendChild(this.content);
+			hs.container.appendChild(this.wrapper);
+		} else if (this.htmlGetSize) this.htmlGetSize();
+		
+		x.calcBorders();
+		y.calcBorders();
+		
+		hs.setStyles (this.wrapper, {
+			left: (x.tpos + x.tb - x.cb) +'px',
+			top: (y.tpos + x.tb - y.cb) +'px'
+		});
+		
+		
+		this.initSlideshow();
+		this.getOverlays();
+		
+		var ratio = x.full / y.full;
+		x.calcExpanded();
+		this.justify(x);
+		
+		y.calcExpanded();
+		this.justify(y);
+		if (this.isHtml) this.htmlSizeOperations();
+		if (this.overlayBox) this.sizeOverlayBox(0, 1);
+
+		
+		if (this.allowSizeReduction) {
+			if (this.isImage)
+				this.correctRatio(ratio);
+			else this.fitOverlayBox();
+			var ss = this.slideshow;			
+			if (ss && this.last && ss.controls && ss.fixedControls) {
+				var pos = ss.overlayOptions.position || '', p;
+				for (var dim in hs.oPos) for (var i = 0; i < 5; i++) {
+					p = this[dim];
+					if (pos.match(hs.oPos[dim][i])) {
+						p.pos = this.last[dim].pos 
+							+ (this.last[dim].p1 - p.p1)
+							+ (this.last[dim].size - p.size) * [0, 0, .5, 1, 1][i];
+						if (ss.fixedControls == 'fit') {
+							if (p.pos + p.size + p.p1 + p.p2 > p.scroll + p.clientSize - p.marginMax)
+								p.pos = p.scroll + p.clientSize - p.size - p.marginMin - p.marginMax - p.p1 - p.p2;
+							if (p.pos < p.scroll + p.marginMin) p.pos = p.scroll + p.marginMin; 
+						} 
+					}
+				}
+			}
+			if (this.isImage && this.x.full > (this.x.imgSize || this.x.size)) {
+				this.createFullExpand();
+				if (this.overlays.length == 1) this.sizeOverlayBox();
+			}
+		}
+		this.show();
+		
+	} catch (e) {
+		this.error(e);
+	}
+},
+
+
+setObjContainerSize : function(parent, auto) {
+	var c = hs.getElementByClass(parent, 'DIV', 'highslide-body');
+	if (/(iframe|swf)/.test(this.objectType)) {
+		if (this.objectWidth) c.style.width = this.objectWidth +'px';
+		if (this.objectHeight) c.style.height = this.objectHeight +'px';
+	}
+},
+
+writeExtendedContent : function () {
+	if (this.hasExtendedContent) return;
+	var exp = this;
+	this.body = hs.getElementByClass(this.innerContent, 'DIV', 'highslide-body');
+	if (this.objectType == 'iframe') {
+		this.showLoading();
+		var ruler = hs.clearing.cloneNode(1);
+		this.body.appendChild(ruler);
+		this.newWidth = this.innerContent.offsetWidth;
+		if (!this.objectWidth) this.objectWidth = ruler.offsetWidth;
+		var hDiff = this.innerContent.offsetHeight - this.body.offsetHeight,
+			h = this.objectHeight || hs.page.height - hDiff - hs.marginTop - hs.marginBottom,
+			onload = this.objectLoadTime == 'before' ? 
+				' onload="if (hs.expanders['+ this.key +']) hs.expanders['+ this.key +'].contentLoaded()" ' : '';
+		this.body.innerHTML += '<iframe name="hs'+ (new Date()).getTime() +'" frameborder="0" key="'+ this.key +'" '
+			+' style="width:'+ this.objectWidth +'px; height:'+ h +'px" '
+			+ onload +' src="'+ this.src +'" ></iframe>';
+		this.ruler = this.body.getElementsByTagName('div')[0];
+		this.iframe = this.body.getElementsByTagName('iframe')[0];
+		
+		if (this.objectLoadTime == 'after') this.correctIframeSize();
+		
+	}
+	if (this.objectType == 'swf') {
+		this.body.id = this.body.id || 'hs-flash-id-' + this.key;
+		var a = this.swfOptions;
+		if (!a.params) a.params = {};
+		if (typeof a.params.wmode == 'undefined') a.params.wmode = 'transparent';
+		if (swfobject) swfobject.embedSWF(this.src, this.body.id, this.objectWidth, this.objectHeight, 
+			a.version || '7', a.expressInstallSwfurl, a.flashvars, a.params, a.attributes);
+	}
+	this.hasExtendedContent = true;
+},
+htmlGetSize : function() {
+	if (this.iframe && !this.objectHeight) { // loadtime before
+		this.iframe.style.height = this.body.style.height = this.getIframePageHeight() +'px';
+	}
+	this.innerContent.appendChild(hs.clearing);
+	if (!this.x.full) this.x.full = this.innerContent.offsetWidth;
+    this.y.full = this.innerContent.offsetHeight;
+    this.innerContent.removeChild(hs.clearing);
+    if (hs.ie && this.newHeight > parseInt(this.innerContent.currentStyle.height)) { // ie css bug
+		this.newHeight = parseInt(this.innerContent.currentStyle.height);
+	}
+	hs.setStyles( this.wrapper, { position: 'absolute',	padding: '0'});
+	hs.setStyles( this.content, { width: this.x.t +'px', height: this.y.t +'px'});
+	
+},
+
+getIframePageHeight : function() {
+	var h;
+	try {
+		var doc = this.iDoc = this.iframe.contentDocument || this.iframe.contentWindow.document;
+		var clearing = doc.createElement('div');
+		clearing.style.clear = 'both';
+		doc.body.appendChild(clearing);
+		h = clearing.offsetTop;
+		if (hs.ie) h += parseInt(doc.body.currentStyle.marginTop) 
+			+ parseInt(doc.body.currentStyle.marginBottom) - 1;
+	} catch (e) { // other domain
+		h = 300;
+	}
+	return h;
+},
+correctIframeSize : function () {
+	var wDiff = this.innerContent.offsetWidth - this.ruler.offsetWidth;
+	hs.discardElement(this.ruler);
+	if (wDiff < 0) wDiff = 0;
+	
+	var hDiff = this.innerContent.offsetHeight - this.iframe.offsetHeight;
+	if (this.iDoc && !this.objectHeight && !this.height && this.y.size == this.y.full) try {
+		this.iDoc.body.style.overflow = 'hidden';
+	} catch (e) {}
+	hs.setStyles(this.iframe, { 
+		width: Math.abs(this.x.size - wDiff) +'px', 
+		height: Math.abs(this.y.size - hDiff) +'px'
+	});
+    hs.setStyles(this.body, { 
+		width: this.iframe.style.width, 
+    	height: this.iframe.style.height
+	});
+    	
+    this.scrollingContent = this.iframe;
+    this.scrollerDiv = this.scrollingContent;
+	
+},
+htmlSizeOperations : function () {
+	
+	this.setObjContainerSize(this.innerContent);
+	
+	
+	if (this.objectType == 'swf' && this.objectLoadTime == 'before') this.writeExtendedContent();	
+	
+    // handle minimum size
+    if (this.x.size < this.x.full && !this.allowWidthReduction) this.x.size = this.x.full;
+    if (this.y.size < this.y.full && !this.allowHeightReduction) this.y.size = this.y.full;
+	this.scrollerDiv = this.innerContent;
+    hs.setStyles(this.mediumContent, { 
+		position: 'relative',
+		width: this.x.size +'px'
+	});
+    hs.setStyles(this.innerContent, { 
+    	border: 'none',
+    	width: 'auto',
+    	height: 'auto'
+    });
+	var node = hs.getElementByClass(this.innerContent, 'DIV', 'highslide-body');
+    if (node && !/(iframe|swf)/.test(this.objectType)) {
+    	var cNode = node; // wrap to get true size
+    	node = hs.createElement(cNode.nodeName, null, {overflow: 'hidden'}, null, true);
+    	cNode.parentNode.insertBefore(node, cNode);
+    	node.appendChild(hs.clearing); // IE6
+    	node.appendChild(cNode);
+    	
+    	var wDiff = this.innerContent.offsetWidth - node.offsetWidth;
+    	var hDiff = this.innerContent.offsetHeight - node.offsetHeight;
+		node.removeChild(hs.clearing);
+    	
+    	var kdeBugCorr = hs.safari || navigator.vendor == 'KDE' ? 1 : 0; // KDE repainting bug
+    	hs.setStyles(node, { 
+    			width: (this.x.size - wDiff - kdeBugCorr) +'px', 
+    			height: (this.y.size - hDiff) +'px',
+    			overflow: 'auto', 
+    			position: 'relative' 
+    		} 
+    	);
+		if (kdeBugCorr && cNode.offsetHeight > node.offsetHeight)	{
+    		node.style.width = (parseInt(node.style.width) + kdeBugCorr) + 'px';
+		}
+    	this.scrollingContent = node;
+    	this.scrollerDiv = this.scrollingContent;
+	}
+    if (this.iframe && this.objectLoadTime == 'before') this.correctIframeSize();
+    if (!this.scrollingContent && this.y.size < this.mediumContent.offsetHeight) this.scrollerDiv = this.content;
+	
+	if (this.scrollerDiv == this.content && !this.allowWidthReduction && !/(iframe|swf)/.test(this.objectType)) {
+		this.x.size += 17; // room for scrollbars
+	}
+	if (this.scrollerDiv && this.scrollerDiv.offsetHeight > this.scrollerDiv.parentNode.offsetHeight) {
+		setTimeout("try { hs.expanders["+ this.key +"].scrollerDiv.style.overflow = 'auto'; } catch(e) {}",
+			 hs.expandDuration);
+	}
+},
+
+getImageMapAreaCorrection : function(area) {
+	var c = area.coords.split(',');
+	for (var i = 0; i < c.length; i++) c[i] = parseInt(c[i]);
+	
+	if (area.shape.toLowerCase() == 'circle') {
+		this.x.tpos += c[0] - c[2];
+		this.y.tpos += c[1] - c[2];
+		this.x.t = this.y.t = 2 * c[2];
+	} else {
+		var maxX, maxY, minX = maxX = c[0], minY = maxY = c[1];
+		for (var i = 0; i < c.length; i++) {
+			if (i % 2 == 0) {
+				minX = Math.min(minX, c[i]);
+				maxX = Math.max(maxX, c[i]);
+			} else {
+				minY = Math.min(minY, c[i]);
+				maxY = Math.max(maxY, c[i]);
+			}
+		}
+		this.x.tpos += minX;
+		this.x.t = maxX - minX;
+		this.y.tpos += minY;
+		this.y.t = maxY - minY;
+	}
+},
+justify : function (p, moveOnly) {
+	var tgtArr, tgt = p.target, dim = p == this.x ? 'x' : 'y';
+	
+	if (tgt && tgt.match(/ /)) {
+		tgtArr = tgt.split(' ');
+		tgt = tgtArr[0];
+	}
+	if (tgt && hs.$(tgt)) {
+		p.pos = hs.getPosition(hs.$(tgt))[dim];
+		if (tgtArr && tgtArr[1] && tgtArr[1].match(/^[-]?[0-9]+px$/)) 
+			p.pos += parseInt(tgtArr[1]);
+		if (p.size < p.minSize) p.size = p.minSize;
+		
+	} else if (p.justify == 'auto' || p.justify == 'center') {
+	
+		var hasMovedMin = false;
+		
+		var allowReduce = p.exp.allowSizeReduction;
+		if (p.justify == 'center')
+			p.pos = Math.round(p.scroll + (p.clientSize + p.marginMin - p.marginMax - p.get('wsize')) / 2);
+		else
+			p.pos = Math.round(p.pos - ((p.get('wsize') - p.t) / 2));
+		if (p.pos < p.scroll + p.marginMin) {
+			p.pos = p.scroll + p.marginMin;
+			hasMovedMin = true;		
+		}
+		if (!moveOnly && p.size < p.minSize) {
+			p.size = p.minSize;
+			allowReduce = false;
+		}
+		if (p.pos + p.get('wsize') > p.scroll + p.clientSize - p.marginMax) {
+			if (!moveOnly && hasMovedMin && allowReduce) {
+				p.size = Math.min(p.size, p.get(dim == 'y' ? 'fitsize' : 'maxsize'));
+			} else if (p.get('wsize') < p.get('fitsize')) {
+				p.pos = p.scroll + p.clientSize - p.marginMax - p.get('wsize');
+			} else { // image larger than viewport
+				p.pos = p.scroll + p.marginMin;
+				if (!moveOnly && allowReduce) p.size = p.get(dim == 'y' ? 'fitsize' : 'maxsize');
+			}			
+		}
+		
+		if (!moveOnly && p.size < p.minSize) {
+			p.size = p.minSize;
+			allowReduce = false;
+		}
+		
+	
+	} else if (p.justify == 'max') {
+		p.pos = Math.floor(p.pos - p.size + p.t);
+	}
+	
+		
+	if (p.pos < p.marginMin) {
+		var tmpMin = p.pos;
+		p.pos = p.marginMin; 
+		
+		if (allowReduce && !moveOnly) p.size = p.size - (p.pos - tmpMin);
+		
+	}
+},
+
+correctRatio : function(ratio) {
+	var x = this.x, 
+		y = this.y,
+		changed = false,
+		xSize = Math.min(x.full, x.size),
+		ySize = Math.min(y.full, y.size),
+		useBox = (this.useBox || hs.padToMinWidth);
+	
+	if (xSize / ySize > ratio) { // width greater
+		xSize = ySize * ratio;
+		if (xSize < x.minSize) { // below minWidth
+			xSize = x.minSize;
+			ySize = xSize / ratio;
+		}
+		changed = true;
+	
+	} else if (xSize / ySize < ratio) { // height greater
+		ySize = xSize / ratio;
+		changed = true;
+	}
+	
+	if (hs.padToMinWidth && x.full < x.minSize) {
+		x.imgSize = x.full;
+		y.size = y.imgSize = y.full;
+	} else if (this.useBox) {
+		x.imgSize = xSize;
+		y.imgSize = ySize;
+	} else {
+		x.size = xSize;
+		y.size = ySize;
+	}
+	changed = this.fitOverlayBox(this.useBox ? null : ratio, changed);
+	if (useBox && y.size < y.imgSize) {
+		y.imgSize = y.size;
+		x.imgSize = y.size * ratio;
+	}
+	if (changed || useBox) {
+		x.pos = x.tpos - x.cb + x.tb;
+		x.minSize = x.size;
+		this.justify(x, true);
+	
+		y.pos = y.tpos - y.cb + y.tb;
+		y.minSize = y.size;
+		this.justify(y, true);
+		if (this.overlayBox) this.sizeOverlayBox();
+	}
+	
+	
+},
+fitOverlayBox : function(ratio, changed) {
+	var x = this.x, y = this.y;
+	if (this.overlayBox && (this.isImage || this.allowHeightReduction)) {
+		while (y.size > this.minHeight && x.size > this.minWidth 
+				&&  y.get('wsize') > y.get('fitsize')) {
+			y.size -= 10;
+			if (ratio) x.size = y.size * ratio;
+			this.sizeOverlayBox(0, 1);
+			changed = true;
+		}
+	}
+	return changed;
+},
+
+reflow : function () {
+	if (this.scrollerDiv) {
+		var h = /iframe/i.test(this.scrollerDiv.tagName) ? (this.getIframePageHeight() + 1) +'px' : 'auto';
+		if (this.body) this.body.style.height = h;
+		this.scrollerDiv.style.height = h;
+		this.y.setSize(this.innerContent.offsetHeight);
+	}
+},
+
+show : function () {
+	var x = this.x, y = this.y;
+	this.doShowHide('hidden');
+	hs.fireEvent(this, 'onBeforeExpand');
+	if (this.slideshow && this.slideshow.thumbstrip) this.slideshow.thumbstrip.selectThumb();
+	
+	// Apply size change
+	this.changeSize(
+		1, {
+			wrapper: {
+				width : x.get('wsize'),
+				height : y.get('wsize'),
+				left: x.pos,
+				top: y.pos
+			},
+			content: {
+				left: x.p1 + x.get('imgPad'),
+				top: y.p1 + y.get('imgPad'),
+				width:x.imgSize ||x.size,
+				height:y.imgSize ||y.size
+			}
+		},
+		hs.expandDuration
+	);
+},
+
+changeSize : function(up, to, dur) {
+	// transition
+	var trans = this.transitions,
+	other = up ? (this.last ? this.last.a : null) : hs.upcoming,
+	t = (trans[1] && other 
+			&& hs.getParam(other, 'transitions')[1] == trans[1]) ?
+		trans[1] : trans[0];
+		
+	if (this[t] && t != 'expand') {
+		this[t](up, to);
+		return;
+	}
+	
+	if (this.outline && !this.outlineWhileAnimating) {
+		if (up) this.outline.setPosition();
+		else this.outline.destroy(
+				(this.isHtml && this.preserveContent));
+	}
+	
+	
+	if (!up) this.destroyOverlays();
+	
+	var exp = this,
+		x = exp.x,
+		y = exp.y,
+		easing = this.easing;
+	if (!up) easing = this.easingClose || easing;
+	var after = up ?
+		function() {
+				
+			if (exp.outline) exp.outline.table.style.visibility = "visible";
+			setTimeout(function() {
+				exp.afterExpand();
+			}, 50);
+		} :
+		function() {
+			exp.afterClose();
+		};
+	if (up) hs.setStyles( this.wrapper, {
+		width: x.t +'px',
+		height: y.t +'px'
+	});
+	if (up && this.isHtml) {
+		hs.setStyles(this.wrapper, {
+			left: (x.tpos - x.cb + x.tb) +'px',
+			top: (y.tpos - y.cb + y.tb) +'px'
+		});
+	}
+	if (this.fadeInOut) {
+		hs.setStyles(this.wrapper, { opacity: up ? 0 : 1 });
+		hs.extend(to.wrapper, { opacity: up });
+	}
+	hs.animate( this.wrapper, to.wrapper, {
+		duration: dur,
+		easing: easing,
+		step: function(val, args) {
+			if (exp.outline && exp.outlineWhileAnimating && args.prop == 'top') {
+				var fac = up ? args.pos : 1 - args.pos;
+				var pos = {
+					w: x.t + (x.get('wsize') - x.t) * fac,
+					h: y.t + (y.get('wsize') - y.t) * fac,
+					x: x.tpos + (x.pos - x.tpos) * fac,
+					y: y.tpos + (y.pos - y.tpos) * fac
+				};
+				exp.outline.setPosition(pos, 0, 1);				
+			}
+			if (exp.isHtml) {	
+				if (args.prop == 'left') 
+					exp.mediumContent.style.left = (x.pos - val) +'px';
+				if (args.prop == 'top') 
+					exp.mediumContent.style.top = (y.pos - val) +'px';
+			}
+		}
+	});
+	hs.animate( this.content, to.content, dur, easing, after);
+	if (up) {
+		this.wrapper.style.visibility = 'visible';
+		this.content.style.visibility = 'visible';
+		if (this.isHtml) this.innerContent.style.visibility = 'visible';
+		this.a.className += ' highslide-active-anchor';
+	}
+},
+
+
+
+fade : function(up, to) {
+	this.outlineWhileAnimating = false;
+	var exp = this,	t = up ? hs.expandDuration : 0;
+	
+	if (up) {
+		hs.animate(this.wrapper, to.wrapper, 0);
+		hs.setStyles(this.wrapper, { opacity: 0, visibility: 'visible' });
+		hs.animate(this.content, to.content, 0);
+		this.content.style.visibility = 'visible';
+
+		hs.animate(this.wrapper, { opacity: 1 }, t, null, 
+			function() { exp.afterExpand(); });
+	}
+	
+	if (this.outline) {
+		this.outline.table.style.zIndex = this.wrapper.style.zIndex;
+		var dir = up || -1, 
+			offset = this.outline.offset,
+			startOff = up ? 3 : offset,
+			endOff = up? offset : 3;
+		for (var i = startOff; dir * i <= dir * endOff; i += dir, t += 25) {
+			(function() {
+				var o = up ? endOff - i : startOff - i;
+				setTimeout(function() {
+					exp.outline.setPosition(0, o, 1);
+				}, t);
+			})();
+		}
+	}
+	
+	
+	if (up) {}//setTimeout(function() { exp.afterExpand(); }, t+50);
+	else {
+		setTimeout( function() {
+			if (exp.outline) exp.outline.destroy(exp.preserveContent);
+			
+			exp.destroyOverlays();
+	
+			hs.animate( exp.wrapper, { opacity: 0 }, hs.restoreDuration, null, function(){
+				exp.afterClose();
+			});
+		}, t);		
+	}
+},
+crossfade : function (up, to, from) {
+	if (!up) return;
+	var exp = this, 
+		last = this.last,
+		x = this.x,
+		y = this.y,
+		lastX = last.x,
+		lastY = last.y,
+		wrapper = this.wrapper,
+		content = this.content,
+		overlayBox = this.overlayBox;
+	hs.removeEventListener(document, 'mousemove', hs.dragHandler);
+	
+	hs.setStyles(content, { 
+		width: (x.imgSize || x.size) +'px', 
+		height: (y.imgSize || y.size) +'px'		
+	});
+	if (overlayBox) overlayBox.style.overflow = 'visible';
+	this.outline = last.outline;
+	if (this.outline) this.outline.exp = exp;
+	last.outline = null;
+	var fadeBox = hs.createElement('div', {
+			className: 'highslide-'+ this.contentType
+		}, { 
+			position: 'absolute', 
+			zIndex: 4,
+			overflow: 'hidden',
+			display: 'none'
+		}
+	);
+	var names = { oldImg: last, newImg: this };
+	for (var n in names) { 	
+		this[n] = names[n].content.cloneNode(1);
+		hs.setStyles(this[n], {
+			position: 'absolute',
+			border: 0,
+			visibility: 'visible'
+		});
+		fadeBox.appendChild(this[n]);
+	}
+	wrapper.appendChild(fadeBox);
+	if (this.isHtml) hs.setStyles(this.mediumContent, { 
+		left: 0,
+		top: 0
+	});
+	if (overlayBox) {
+		overlayBox.className = '';
+		wrapper.appendChild(overlayBox);
+	}
+	fadeBox.style.display = '';
+	last.content.style.display = 'none';
+	
+	
+	if (hs.safari && hs.uaVersion < 525) {
+		this.wrapper.style.visibility = 'visible';
+	}
+	hs.animate(wrapper, {
+		width: x.size
+	}, {
+		duration: hs.transitionDuration, 
+		step: function(val, args) {
+			var pos = args.pos,
+				invPos = 1 - pos;
+			var prop,
+				size = {}, 
+				props = ['pos', 'size', 'p1', 'p2'];
+			for (var n in props) {
+				prop = props[n];
+				size['x'+ prop] = Math.round(invPos * lastX[prop] + pos * x[prop]);
+				size['y'+ prop] = Math.round(invPos * lastY[prop] + pos * y[prop]);
+				size.ximgSize = Math.round(
+					invPos * (lastX.imgSize || lastX.size) + pos * (x.imgSize || x.size));
+				size.ximgPad = Math.round(invPos * lastX.get('imgPad') + pos * x.get('imgPad'));
+				size.yimgSize = Math.round(
+					invPos * (lastY.imgSize || lastY.size) + pos * (y.imgSize || y.size));
+				size.yimgPad = Math.round(invPos * lastY.get('imgPad') + pos * y.get('imgPad'));
+			}
+			if (exp.outline) exp.outline.setPosition({ 
+				x: size.xpos, 
+				y: size.ypos, 
+				w: size.xsize + size.xp1 + size.xp2 + 2 * x.cb, 
+				h: size.ysize + size.yp1 + size.yp2 + 2 * y.cb
+			});
+			last.wrapper.style.clip = 'rect('
+				+ (size.ypos - lastY.pos)+'px, '
+				+ (size.xsize + size.xp1 + size.xp2 + size.xpos + 2 * lastX.cb - lastX.pos) +'px, '
+				+ (size.ysize + size.yp1 + size.yp2 + size.ypos + 2 * lastY.cb - lastY.pos) +'px, '
+				+ (size.xpos - lastX.pos)+'px)';
+				
+			hs.setStyles(content, {
+				top: (size.yp1 + y.get('imgPad')) +'px',
+				left: (size.xp1 + x.get('imgPad')) +'px',
+				marginTop: (y.pos - size.ypos) +'px',
+				marginLeft: (x.pos - size.xpos) +'px'
+			});
+			hs.setStyles(wrapper, {
+				top: size.ypos +'px',
+				left: size.xpos +'px',
+				width: (size.xp1 + size.xp2 + size.xsize + 2 * x.cb)+ 'px',
+				height: (size.yp1 + size.yp2 + size.ysize + 2 * y.cb) + 'px'
+			});
+			hs.setStyles(fadeBox, {
+				width: (size.ximgSize || size.xsize) + 'px',
+				height: (size.yimgSize || size.ysize) +'px',
+				left: (size.xp1 + size.ximgPad)  +'px',
+				top: (size.yp1 + size.yimgPad) +'px',
+				visibility: 'visible'
+			});
+			
+			hs.setStyles(exp.oldImg, {
+				top: (lastY.pos - size.ypos + lastY.p1 - size.yp1 + lastY.get('imgPad') - size.yimgPad)+'px',
+				left: (lastX.pos - size.xpos + lastX.p1 - size.xp1 + lastX.get('imgPad') - size.ximgPad)+'px'
+			});		
+			
+			hs.setStyles(exp.newImg, {
+				opacity: pos,
+				top: (y.pos - size.ypos + y.p1 - size.yp1 + y.get('imgPad') - size.yimgPad) +'px',
+				left: (x.pos - size.xpos + x.p1 - size.xp1 + x.get('imgPad') - size.ximgPad) +'px'
+			});
+			if (overlayBox) hs.setStyles(overlayBox, {
+				width: size.xsize + 'px',
+				height: size.ysize +'px',
+				left: (size.xp1 + x.cb)  +'px',
+				top: (size.yp1 + y.cb) +'px'
+			});
+		},
+		complete: function () {
+			wrapper.style.visibility = content.style.visibility = 'visible';
+			content.style.display = 'block';
+			hs.discardElement(fadeBox);
+			exp.afterExpand();
+			last.afterClose();
+			exp.last = null;
+		}
+		
+	});
+},
+reuseOverlay : function(o, el) {
+	if (!this.last) return false;
+	for (var i = 0; i < this.last.overlays.length; i++) {
+		var oDiv = hs.$('hsId'+ this.last.overlays[i]);
+		if (oDiv && oDiv.hsId == o.hsId) {
+			this.genOverlayBox();
+			oDiv.reuse = this.key;
+			hs.push(this.overlays, this.last.overlays[i]);
+			return true;
+		}
+	}
+	return false;
+},
+
+
+afterExpand : function() {
+	this.isExpanded = true;	
+	this.focus();
+	
+	if (this.isHtml && this.objectLoadTime == 'after') this.writeExtendedContent();
+	if (this.iframe) {
+		try {
+			var exp = this,
+				doc = this.iframe.contentDocument || this.iframe.contentWindow.document;
+			hs.addEventListener(doc, 'mousedown', function () {
+				if (hs.focusKey != exp.key) exp.focus();
+			});
+		} catch(e) {}
+		if (hs.ie && typeof this.isClosing != 'boolean') // first open 
+			this.iframe.style.width = (this.objectWidth - 1) +'px'; // hasLayout
+	}
+	if (this.dimmingOpacity) hs.dim(this);
+	if (hs.upcoming && hs.upcoming == this.a) hs.upcoming = null;
+	this.prepareNextOutline();
+	var p = hs.page, mX = hs.mouse.x + p.scrollLeft, mY = hs.mouse.y + p.scrollTop;
+	this.mouseIsOver = this.x.pos < mX && mX < this.x.pos + this.x.get('wsize')
+		&& this.y.pos < mY && mY < this.y.pos + this.y.get('wsize');	
+	if (this.overlayBox) this.showOverlays();
+	hs.fireEvent(this, 'onAfterExpand');
+	
+},
+
+
+prepareNextOutline : function() {
+	var key = this.key;
+	var outlineType = this.outlineType;
+	new hs.Outline(outlineType, 
+		function () { try { hs.expanders[key].preloadNext(); } catch (e) {} });
+},
+
+
+preloadNext : function() {
+	var next = this.getAdjacentAnchor(1);
+	if (next && next.onclick.toString().match(/hs\.expand/)) 
+		var img = hs.createElement('img', { src: hs.getSrc(next) });
+},
+
+
+getAdjacentAnchor : function(op) {
+	var current = this.getAnchorIndex(), as = hs.anchors.groups[this.slideshowGroup || 'none'];
+	if (as && !as[current + op] && this.slideshow && this.slideshow.repeat) {
+		if (op == 1) return as[0];
+		else if (op == -1) return as[as.length-1];
+	}
+	return (as && as[current + op]) || null;
+},
+
+getAnchorIndex : function() {
+	var arr = hs.getAnchors().groups[this.slideshowGroup || 'none'];
+	if (arr) for (var i = 0; i < arr.length; i++) {
+		if (arr[i] == this.a) return i; 
+	}
+	return null;
+},
+
+
+getNumber : function() {
+	if (this[this.numberPosition]) {
+		var arr = hs.anchors.groups[this.slideshowGroup || 'none'];
+		if (arr) {
+			var s = hs.lang.number.replace('%1', this.getAnchorIndex() + 1).replace('%2', arr.length);
+			this[this.numberPosition].innerHTML = 
+				'<div class="highslide-number">'+ s +'</div>'+ this[this.numberPosition].innerHTML;
+		}
+	}
+},
+initSlideshow : function() {
+	if (!this.last) {
+		for (var i = 0; i < hs.slideshows.length; i++) {
+			var ss = hs.slideshows[i], sg = ss.slideshowGroup;
+			if (typeof sg == 'undefined' || sg === null || sg === this.slideshowGroup) 
+				this.slideshow = new hs.Slideshow(this.key, ss);
+		} 
+	} else {
+		this.slideshow = this.last.slideshow;
+	}
+	var ss = this.slideshow;
+	if (!ss) return;
+	var key = ss.expKey = this.key;
+	
+	ss.checkFirstAndLast();
+	ss.disable('full-expand');
+	if (ss.controls) {
+		this.createOverlay(hs.extend(ss.overlayOptions || {}, {
+			overlayId: ss.controls,
+			hsId: 'controls',
+			zIndex: 5
+		}));
+	}
+	if (ss.thumbstrip) ss.thumbstrip.add(this);
+	if (!this.last && this.autoplay) ss.play(true);
+	if (ss.autoplay) {
+		ss.autoplay = setTimeout(function() {
+			hs.next(key);
+		}, (ss.interval || 500));
+	}
+},
+
+cancelLoading : function() {
+	hs.discardElement (this.wrapper);
+	hs.expanders[this.key] = null;
+	if (hs.upcoming == this.a) hs.upcoming = null;
+	hs.undim(this.key);
+	if (this.loading) hs.loading.style.left = '-9999px';
+	hs.fireEvent(this, 'onHideLoading');
+},
+
+writeCredits : function () {
+	if (this.credits) return;
+	this.credits = hs.createElement('a', {
+		href: hs.creditsHref,
+		target: hs.creditsTarget,
+		className: 'highslide-credits',
+		innerHTML: hs.lang.creditsText,
+		title: hs.lang.creditsTitle
+	});
+	this.createOverlay({ 
+		overlayId: this.credits, 
+		position: this.creditsPosition || 'top left', 
+		hsId: 'credits' 
+	});
+},
+
+getInline : function(types, addOverlay) {
+	for (var i = 0; i < types.length; i++) {
+		var type = types[i], s = null;
+		if (type == 'caption' && !hs.fireEvent(this, 'onBeforeGetCaption')) return;
+		else if (type == 'heading' && !hs.fireEvent(this, 'onBeforeGetHeading')) return;
+		if (!this[type +'Id'] && this.thumbsUserSetId)  
+			this[type +'Id'] = type +'-for-'+ this.thumbsUserSetId;
+		if (this[type +'Id']) this[type] = hs.getNode(this[type +'Id']);
+		if (!this[type] && !this[type +'Text'] && this[type +'Eval']) try {
+			s = eval(this[type +'Eval']);
+		} catch (e) {}
+		if (!this[type] && this[type +'Text']) {
+			s = this[type +'Text'];
+		}
+		if (!this[type] && !s) {
+			this[type] = hs.getNode(this.a['_'+ type + 'Id']);
+			if (!this[type]) {
+				var next = this.a.nextSibling;
+				while (next && !hs.isHsAnchor(next)) {
+					if ((new RegExp('highslide-'+ type)).test(next.className || null)) {
+						if (!next.id) this.a['_'+ type + 'Id'] = next.id = 'hsId'+ hs.idCounter++;
+						this[type] = hs.getNode(next.id);
+						break;
+					}
+					next = next.nextSibling;
+				}
+			}
+		}
+		if (!this[type] && !s && this.numberPosition == type) s = '\n';
+		
+		if (!this[type] && s) this[type] = hs.createElement('div', 
+				{ className: 'highslide-'+ type, innerHTML: s } );
+		
+		if (addOverlay && this[type]) {
+			var o = { position: (type == 'heading') ? 'above' : 'below' };
+			for (var x in this[type+'Overlay']) o[x] = this[type+'Overlay'][x];
+			o.overlayId = this[type];
+			this.createOverlay(o);
+		}
+	}
+},
+
+
+// on end move and resize
+doShowHide : function(visibility) {
+	if (hs.hideSelects) this.showHideElements('SELECT', visibility);
+	if (hs.hideIframes) this.showHideElements('IFRAME', visibility);
+	if (hs.geckoMac) this.showHideElements('*', visibility);
+},
+showHideElements : function (tagName, visibility) {
+	var els = document.getElementsByTagName(tagName);
+	var prop = tagName == '*' ? 'overflow' : 'visibility';
+	for (var i = 0; i < els.length; i++) {
+		if (prop == 'visibility' || (document.defaultView.getComputedStyle(
+				els[i], "").getPropertyValue('overflow') == 'auto'
+				|| els[i].getAttribute('hidden-by') != null)) {
+			var hiddenBy = els[i].getAttribute('hidden-by');
+			if (visibility == 'visible' && hiddenBy) {
+				hiddenBy = hiddenBy.replace('['+ this.key +']', '');
+				els[i].setAttribute('hidden-by', hiddenBy);
+				if (!hiddenBy) els[i].style[prop] = els[i].origProp;
+			} else if (visibility == 'hidden') { // hide if behind
+				var elPos = hs.getPosition(els[i]);
+				elPos.w = els[i].offsetWidth;
+				elPos.h = els[i].offsetHeight;
+				if (!this.dimmingOpacity) { // hide all if dimming
+				
+					var clearsX = (elPos.x + elPos.w < this.x.get('opos') 
+						|| elPos.x > this.x.get('opos') + this.x.get('osize'));
+					var clearsY = (elPos.y + elPos.h < this.y.get('opos') 
+						|| elPos.y > this.y.get('opos') + this.y.get('osize'));
+				}
+				var wrapperKey = hs.getWrapperKey(els[i]);
+				if (!clearsX && !clearsY && wrapperKey != this.key) { // element falls behind image
+					if (!hiddenBy) {
+						els[i].setAttribute('hidden-by', '['+ this.key +']');
+						els[i].origProp = els[i].style[prop];
+						els[i].style[prop] = 'hidden';
+						
+					} else if (hiddenBy.indexOf('['+ this.key +']') == -1) {
+						els[i].setAttribute('hidden-by', hiddenBy + '['+ this.key +']');
+					}
+				} else if ((hiddenBy == '['+ this.key +']' || hs.focusKey == wrapperKey)
+						&& wrapperKey != this.key) { // on move
+					els[i].setAttribute('hidden-by', '');
+					els[i].style[prop] = els[i].origProp || '';
+				} else if (hiddenBy && hiddenBy.indexOf('['+ this.key +']') > -1) {
+					els[i].setAttribute('hidden-by', hiddenBy.replace('['+ this.key +']', ''));
+				}
+						
+			}
+		}
+	}
+},
+
+focus : function() {
+	this.wrapper.style.zIndex = hs.zIndexCounter += 2;
+	// blur others
+	for (var i = 0; i < hs.expanders.length; i++) {
+		if (hs.expanders[i] && i == hs.focusKey) {
+			var blurExp = hs.expanders[i];
+			blurExp.content.className += ' highslide-'+ blurExp.contentType +'-blur';
+			if (blurExp.isImage) {
+				blurExp.content.style.cursor = hs.ieLt7 ? 'hand' : 'pointer';
+				blurExp.content.title = hs.lang.focusTitle;	
+			}	
+			hs.fireEvent(blurExp, 'onBlur');
+		}
+	}
+	
+	// focus this
+	if (this.outline) this.outline.table.style.zIndex 
+		= this.wrapper.style.zIndex - 1;
+	this.content.className = 'highslide-'+ this.contentType;
+	if (this.isImage) {
+		this.content.title = hs.lang.restoreTitle;
+		
+		if (hs.restoreCursor) {
+			hs.styleRestoreCursor = window.opera ? 'pointer' : 'url('+ hs.graphicsDir + hs.restoreCursor +'), pointer';
+			if (hs.ieLt7 && hs.uaVersion < 6) hs.styleRestoreCursor = 'hand';
+			this.content.style.cursor = hs.styleRestoreCursor;
+		}
+	}
+	hs.focusKey = this.key;	
+	hs.addEventListener(document, window.opera ? 'keypress' : 'keydown', hs.keyHandler);	
+	hs.fireEvent(this, 'onFocus');	
+},
+moveTo: function(x, y) {
+	this.x.setPos(x);
+	this.y.setPos(y);
+},
+resize : function (e) {
+	var w, h, r = e.width / e.height;
+	w = Math.max(e.width + e.dX, Math.min(this.minWidth, this.x.full));
+	if (this.isImage && Math.abs(w - this.x.full) < 12) w = this.x.full;
+	h = this.isHtml ? e.height + e.dY : w / r;
+	if (h < Math.min(this.minHeight, this.y.full)) {
+		h = Math.min(this.minHeight, this.y.full);
+		if (this.isImage) w = h * r;
+	}
+	this.resizeTo(w, h);
+},
+resizeTo: function(w, h) {
+	this.y.setSize(h);
+	this.x.setSize(w);
+	this.wrapper.style.height = this.y.get('wsize') +'px';
+},
+
+close : function() {
+	if (this.isClosing || !this.isExpanded) return;
+	if (this.transitions[1] == 'crossfade' && hs.upcoming) {
+		hs.getExpander(hs.upcoming).cancelLoading();
+		hs.upcoming = null;
+	}
+	if (!hs.fireEvent(this, 'onBeforeClose')) return;
+	this.isClosing = true;
+	if (this.slideshow && !hs.upcoming) this.slideshow.pause();
+	
+	hs.removeEventListener(document, window.opera ? 'keypress' : 'keydown', hs.keyHandler);
+	
+	try {
+		if (this.isHtml) this.htmlPrepareClose();
+		this.content.style.cursor = 'default';
+		this.changeSize(
+			0, {
+				wrapper: {
+					width : this.x.t,
+					height : this.y.t,
+					left: this.x.tpos - this.x.cb + this.x.tb,
+					top: this.y.tpos - this.y.cb + this.y.tb
+				},
+				content: {
+					left: 0,
+					top: 0,
+					width: this.x.t,
+					height: this.y.t
+				}
+			}, hs.restoreDuration
+		);
+	} catch (e) { this.afterClose(); }
+},
+
+htmlPrepareClose : function() {
+	if (hs.geckoMac) { // bad redraws
+		if (!hs.mask) hs.mask = hs.createElement('div', null, 
+			{ position: 'absolute' }, hs.container);
+		hs.setStyles(hs.mask, { width: this.x.size +'px', height: this.y.size +'px', 
+			left: this.x.pos +'px', top: this.y.pos +'px', display: 'block' });			
+	}
+	if (this.objectType == 'swf') try { hs.$(this.body.id).StopPlay(); } catch (e) {}
+	
+	if (this.objectLoadTime == 'after' && !this.preserveContent) this.destroyObject();		
+	if (this.scrollerDiv && this.scrollerDiv != this.scrollingContent) 
+		this.scrollerDiv.style.overflow = 'hidden';
+},
+
+destroyObject : function () {
+	if (hs.ie && this.iframe)
+		try { this.iframe.contentWindow.document.body.innerHTML = ''; } catch (e) {}
+	if (this.objectType == 'swf') swfobject.removeSWF(this.body.id);
+	this.body.innerHTML = '';
+},
+
+sleep : function() {
+	if (this.outline) this.outline.table.style.display = 'none';
+	this.releaseMask = null;
+	this.wrapper.style.display = 'none';
+	this.isExpanded = false;
+	hs.push(hs.sleeping, this);
+},
+
+awake : function() {try {
+	
+	hs.expanders[this.key] = this;
+	
+	if (!hs.allowMultipleInstances &&hs.focusKey != this.key) {	
+		try { hs.expanders[hs.focusKey].close(); } catch (e){}
+	}
+	
+	var z = hs.zIndexCounter++, stl = { display: '', zIndex: z };
+	hs.setStyles (this.wrapper, stl);
+	this.isClosing = false;
+	
+	var o = this.outline || 0;
+	if (o) {
+		if (!this.outlineWhileAnimating) stl.visibility = 'hidden';
+		hs.setStyles (o.table, stl);		
+	}
+	if (this.slideshow) {
+		this.initSlideshow();
+	}
+		
+	this.show();
+} catch (e) {}
+
+
+},
+
+createOverlay : function (o) {
+	var el = o.overlayId, 
+		relToVP = (o.relativeTo == 'viewport' && !/panel$/.test(o.position));
+	if (typeof el == 'string') el = hs.getNode(el);
+	if (o.html) el = hs.createElement('div', { innerHTML: o.html });
+	if (!el || typeof el == 'string') return;
+	if (!hs.fireEvent(this, 'onCreateOverlay', { overlay: el })) return;
+	el.style.display = 'block';
+	o.hsId = o.hsId || o.overlayId; 
+	if (this.transitions[1] == 'crossfade' && this.reuseOverlay(o, el)) return;
+	this.genOverlayBox();
+	var width = o.width && /^[0-9]+(px|%)$/.test(o.width) ? o.width : 'auto';
+	if (/^(left|right)panel$/.test(o.position) && !/^[0-9]+px$/.test(o.width)) width = '200px';
+	var overlay = hs.createElement(
+		'div', {
+			id: 'hsId'+ hs.idCounter++,
+			hsId: o.hsId
+		}, {
+			position: 'absolute',
+			visibility: 'hidden',
+			width: width,
+			direction: hs.lang.cssDirection || '',
+			opacity: 0
+		},
+		relToVP ? hs.viewport :this.overlayBox,
+		true
+	);
+	if (relToVP) overlay.hsKey = this.key;
+	
+	overlay.appendChild(el);
+	hs.extend(overlay, {
+		opacity: 1,
+		offsetX: 0,
+		offsetY: 0,
+		dur: (o.fade === 0 || o.fade === false || (o.fade == 2 && hs.ie)) ? 0 : 250
+	});
+	hs.extend(overlay, o);
+	
+		
+	if (this.gotOverlays) {
+		this.positionOverlay(overlay);
+		if (!overlay.hideOnMouseOut || this.mouseIsOver) 
+			hs.animate(overlay, { opacity: overlay.opacity }, overlay.dur);
+	}
+	hs.push(this.overlays, hs.idCounter - 1);
+},
+positionOverlay : function(overlay) {
+	var p = overlay.position || 'middle center',
+		relToVP = (overlay.relativeTo == 'viewport'),
+		offX = overlay.offsetX,
+		offY = overlay.offsetY;
+	if (relToVP) {
+		hs.viewport.style.display = 'block';
+		overlay.hsKey = this.key;
+		if (overlay.offsetWidth > overlay.parentNode.offsetWidth)
+			overlay.style.width = '100%';
+	} else
+	if (overlay.parentNode != this.overlayBox) this.overlayBox.appendChild(overlay);
+	if (/left$/.test(p)) overlay.style.left = offX +'px'; 
+	
+	if (/center$/.test(p))	hs.setStyles (overlay, { 
+		left: '50%',
+		marginLeft: (offX - Math.round(overlay.offsetWidth / 2)) +'px'
+	});	
+	
+	if (/right$/.test(p)) overlay.style.right = - offX +'px';
+		
+	if (/^leftpanel$/.test(p)) { 
+		hs.setStyles(overlay, {
+			right: '100%',
+			marginRight: this.x.cb +'px',
+			top: - this.y.cb +'px',
+			bottom: - this.y.cb +'px',
+			overflow: 'auto'
+		});		 
+		this.x.p1 = overlay.offsetWidth;
+	
+	} else if (/^rightpanel$/.test(p)) {
+		hs.setStyles(overlay, {
+			left: '100%',
+			marginLeft: this.x.cb +'px',
+			top: - this.y.cb +'px',
+			bottom: - this.y.cb +'px',
+			overflow: 'auto'
+		});
+		this.x.p2 = overlay.offsetWidth;
+	}
+	var parOff = overlay.parentNode.offsetHeight;
+	overlay.style.height = 'auto';
+	if (relToVP && overlay.offsetHeight > parOff)
+		overlay.style.height = hs.ieLt7 ? parOff +'px' : '100%';
+
+	if (/^top/.test(p)) overlay.style.top = offY +'px'; 
+	if (/^middle/.test(p))	hs.setStyles (overlay, { 
+		top: '50%', 
+		marginTop: (offY - Math.round(overlay.offsetHeight / 2)) +'px'
+	});	
+	if (/^bottom/.test(p)) overlay.style.bottom = - offY +'px';
+	if (/^above$/.test(p)) {
+		hs.setStyles(overlay, {
+			left: (- this.x.p1 - this.x.cb) +'px',
+			right: (- this.x.p2 - this.x.cb) +'px',
+			bottom: '100%',
+			marginBottom: this.y.cb +'px',
+			width: 'auto'
+		});
+		this.y.p1 = overlay.offsetHeight;
+	
+	} else if (/^below$/.test(p)) {
+		hs.setStyles(overlay, {
+			position: 'relative',
+			left: (- this.x.p1 - this.x.cb) +'px',
+			right: (- this.x.p2 - this.x.cb) +'px',
+			top: '100%',
+			marginTop: this.y.cb +'px',
+			width: 'auto'
+		});
+		this.y.p2 = overlay.offsetHeight;
+		overlay.style.position = 'absolute';
+	}
+},
+
+getOverlays : function() {	
+	this.getInline(['heading', 'caption'], true);
+	this.getNumber();
+	if (this.caption) hs.fireEvent(this, 'onAfterGetCaption');
+	if (this.heading) hs.fireEvent(this, 'onAfterGetHeading');
+	if (this.heading && this.dragByHeading) this.heading.className += ' highslide-move';
+	if (hs.showCredits) this.writeCredits();
+	for (var i = 0; i < hs.overlays.length; i++) {
+		var o = hs.overlays[i], tId = o.thumbnailId, sg = o.slideshowGroup;
+		if ((!tId && !sg) || (tId && tId == this.thumbsUserSetId)
+				|| (sg && sg === this.slideshowGroup)) {
+			if (this.isImage || (this.isHtml && o.useOnHtml))
+			this.createOverlay(o);
+		}
+	}
+	var os = [];
+	for (var i = 0; i < this.overlays.length; i++) {
+		var o = hs.$('hsId'+ this.overlays[i]);
+		if (/panel$/.test(o.position)) this.positionOverlay(o);
+		else hs.push(os, o);
+	}
+	for (var i = 0; i < os.length; i++) this.positionOverlay(os[i]);
+	this.gotOverlays = true;
+},
+genOverlayBox : function() {
+	if (!this.overlayBox) this.overlayBox = hs.createElement (
+		'div', {
+			className: this.wrapperClassName
+		}, {
+			position : 'absolute',
+			width: (this.x.size || (this.useBox ? this.width : null) 
+				|| this.x.full) +'px',
+			height: (this.y.size || this.y.full) +'px',
+			visibility : 'hidden',
+			overflow : 'hidden',
+			zIndex : hs.ie ? 4 : 'auto'
+		},
+		hs.container,
+		true
+	);
+},
+sizeOverlayBox : function(doWrapper, doPanels) {
+	var overlayBox = this.overlayBox, 
+		x = this.x,
+		y = this.y;
+	hs.setStyles( overlayBox, {
+		width: x.size +'px', 
+		height: y.size +'px'
+	});
+	if (doWrapper || doPanels) {
+		for (var i = 0; i < this.overlays.length; i++) {
+			var o = hs.$('hsId'+ this.overlays[i]);
+			var ie6 = (hs.ieLt7 || document.compatMode == 'BackCompat');
+			if (o && /^(above|below)$/.test(o.position)) {
+				if (ie6) {
+					o.style.width = (overlayBox.offsetWidth + 2 * x.cb
+						+ x.p1 + x.p2) +'px';
+				}
+				y[o.position == 'above' ? 'p1' : 'p2'] = o.offsetHeight;
+			}
+			if (o && ie6 && /^(left|right)panel$/.test(o.position)) {
+				o.style.height = (overlayBox.offsetHeight + 2* y.cb) +'px';
+			}
+		}
+	}
+	if (doWrapper) {
+		hs.setStyles(this.content, {
+			top: y.p1 +'px'
+		});
+		hs.setStyles(overlayBox, {
+			top: (y.p1 + y.cb) +'px'
+		});
+	}
+},
+
+showOverlays : function() {
+	var b = this.overlayBox;
+	b.className = '';
+	hs.setStyles(b, {
+		top: (this.y.p1 + this.y.cb) +'px',
+		left: (this.x.p1 + this.x.cb) +'px',
+		overflow : 'visible'
+	});
+	if (hs.safari) b.style.visibility = 'visible';
+	this.wrapper.appendChild (b);
+	for (var i = 0; i < this.overlays.length; i++) {
+		var o = hs.$('hsId'+ this.overlays[i]);
+		o.style.zIndex = o.zIndex || 4;
+		if (!o.hideOnMouseOut || this.mouseIsOver) {
+			o.style.visibility = 'visible';
+			hs.setStyles(o, { visibility: 'visible', display: '' });
+			hs.animate(o, { opacity: o.opacity }, o.dur);
+		}
+	}
+},
+
+destroyOverlays : function() {
+	if (!this.overlays.length) return;
+	if (this.slideshow) {
+		var c = this.slideshow.controls;
+		if (c && hs.getExpander(c) == this) c.parentNode.removeChild(c);
+	}
+	for (var i = 0; i < this.overlays.length; i++) {
+		var o = hs.$('hsId'+ this.overlays[i]);
+		if (o && o.parentNode == hs.viewport && hs.getExpander(o) == this) hs.discardElement(o);
+	}
+	if (this.isHtml && this.preserveContent) {
+		this.overlayBox.style.top = '-9999px';
+		hs.container.appendChild(this.overlayBox);
+	} else
+	hs.discardElement(this.overlayBox);
+},
+
+
+
+createFullExpand : function () {
+	if (this.slideshow && this.slideshow.controls) {
+		this.slideshow.enable('full-expand');
+		return;
+	}
+	this.fullExpandLabel = hs.createElement(
+		'a', {
+			href: 'javascript:hs.expanders['+ this.key +'].doFullExpand();',
+			title: hs.lang.fullExpandTitle,
+			className: 'highslide-full-expand'
+		}
+	);
+	if (!hs.fireEvent(this, 'onCreateFullExpand')) return;
+	
+	this.createOverlay({ 
+		overlayId: this.fullExpandLabel, 
+		position: hs.fullExpandPosition, 
+		hideOnMouseOut: true, 
+		opacity: hs.fullExpandOpacity
+	});
+},
+
+doFullExpand : function () {
+	try {
+		if (!hs.fireEvent(this, 'onDoFullExpand')) return;
+		if (this.fullExpandLabel) hs.discardElement(this.fullExpandLabel);
+		
+		this.focus();
+		var xSize = this.x.size,
+        	ySize = this.y.size;
+        this.resizeTo(this.x.full, this.y.full);
+       
+        var xpos = this.x.pos - (this.x.size - xSize) / 2;
+        if (xpos < hs.marginLeft) xpos = hs.marginLeft;
+       
+        var ypos = this.y.pos - (this.y.size - ySize) / 2;
+        if (ypos < hs.marginTop) ypos = hs.marginTop;
+       
+        this.moveTo(xpos, ypos);
+		this.doShowHide('hidden');
+	
+	} catch (e) {
+		this.error(e);
+	}
+},
+
+
+afterClose : function () {
+	this.a.className = this.a.className.replace('highslide-active-anchor', '');
+	
+	this.doShowHide('visible');	
+	
+	if (this.isHtml && this.preserveContent
+			 && this.transitions[1] != 'crossfade') {
+		this.sleep();
+	} else {
+		if (this.outline && this.outlineWhileAnimating) this.outline.destroy();
+	
+		hs.discardElement(this.wrapper);
+	}
+	if (hs.mask) hs.mask.style.display = 'none';
+	this.destroyOverlays();
+	if (!hs.viewport.childNodes.length) hs.viewport.style.display = 'none';
+	
+	if (this.dimmingOpacity) hs.undim(this.key);
+	hs.fireEvent(this, 'onAfterClose');
+	hs.expanders[this.key] = null;		
+	hs.reOrder();
+}
+
+};
+
+
+// hs.Ajax object prototype
+hs.Ajax = function (a, content, pre) {
+	this.a = a;
+	this.content = content;
+	this.pre = pre;
+};
+
+hs.Ajax.prototype = {
+run : function () {
+	var xhr;
+	if (!this.src) this.src = hs.getSrc(this.a);
+	if (this.src.match('#')) {
+		var arr = this.src.split('#');
+		this.src = arr[0];
+		this.id = arr[1];
+	}
+	if (hs.cachedGets[this.src]) {
+		this.cachedGet = hs.cachedGets[this.src];
+		if (this.id) this.getElementContent();
+		else this.loadHTML();
+		return;
+	}
+	try { xhr = new XMLHttpRequest(); }
+	catch (e) {
+		try { xhr = new ActiveXObject("Msxml2.XMLHTTP"); }
+		catch (e) {
+			try { xhr = new ActiveXObject("Microsoft.XMLHTTP"); }
+			catch (e) { this.onError(); }
+		}
+	}
+	var pThis = this; 
+	xhr.onreadystatechange = function() {
+		if(pThis.xhr.readyState == 4) {
+			if (pThis.id) pThis.getElementContent();
+			else pThis.loadHTML();
+		}
+	};
+	var src = this.src;
+	this.xhr = xhr;
+	if (hs.forceAjaxReload) 
+		src = src.replace(/$/, (/\?/.test(src) ? '&' : '?') +'dummy='+ (new Date()).getTime());
+	xhr.open('GET', src, true);
+	xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
+	xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
+	xhr.send(null);
+},
+
+getElementContent : function() {
+	hs.init();
+	var attribs = window.opera || hs.ie6SSL ? { src: 'about:blank' } : null;
+	
+	this.iframe = hs.createElement('iframe', attribs, 
+		{ position: 'absolute', top: '-9999px' }, hs.container);
+		
+	this.loadHTML();
+},
+
+loadHTML : function() {
+	var s = this.cachedGet || this.xhr.responseText,
+		regBody;
+	if (this.pre) hs.cachedGets[this.src] = s;
+	if (!hs.ie || hs.uaVersion >= 5.5) {
+		s = s.replace(new RegExp('<link[^>]*>', 'gi'), '')
+			.replace(new RegExp('<script[^>]*>.*?</script>', 'gi'), '');
+		if (this.iframe) {
+			var doc = this.iframe.contentDocument;
+			if (!doc && this.iframe.contentWindow) doc = this.iframe.contentWindow.document;
+			if (!doc) { // Opera
+				var pThis = this;
+				setTimeout(function() {	pThis.loadHTML(); }, 25);
+				return;
+			}
+			doc.open();
+			doc.write(s);
+			doc.close();
+			try { s = doc.getElementById(this.id).innerHTML; } catch (e) {
+				try { s = this.iframe.document.getElementById(this.id).innerHTML; } catch (e) {} // opera
+			}
+			hs.discardElement(this.iframe);
+		} else {
+			regBody = /(<body[^>]*>|<\/body>)/ig;
+			if (regBody.test(s)) s = s.split(regBody)[hs.ieLt9 ? 1 : 2];
+			
+		}
+	}
+	hs.getElementByClass(this.content, 'DIV', 'highslide-body').innerHTML = s;
+	this.onLoad();
+	for (var x in this) this[x] = null;
+}
+};
+
+
+hs.Slideshow = function (expKey, options) {
+	if (hs.dynamicallyUpdateAnchors !== false) hs.updateAnchors();
+	this.expKey = expKey;
+	for (var x in options) this[x] = options[x];
+	if (this.useControls) this.getControls();
+	if (this.thumbstrip) this.thumbstrip = hs.Thumbstrip(this);
+};
+hs.Slideshow.prototype = {
+getControls: function() {
+	this.controls = hs.createElement('div', { innerHTML: hs.replaceLang(hs.skin.controls) }, 
+		null, hs.container);
+	
+	var buttons = ['play', 'pause', 'previous', 'next', 'move', 'full-expand', 'close'];
+	this.btn = {};
+	var pThis = this;
+	for (var i = 0; i < buttons.length; i++) {
+		this.btn[buttons[i]] = hs.getElementByClass(this.controls, 'li', 'highslide-'+ buttons[i]);
+		this.enable(buttons[i]);
+	}
+	this.btn.pause.style.display = 'none';
+	//this.disable('full-expand');
+},
+checkFirstAndLast: function() {
+	if (this.repeat || !this.controls) return;
+	var exp = hs.expanders[this.expKey],
+		cur = exp.getAnchorIndex(), 
+		re = /disabled$/;
+	if (cur == 0) 
+		this.disable('previous');
+	else if (re.test(this.btn.previous.getElementsByTagName('a')[0].className))
+		this.enable('previous');
+	if (cur + 1 == hs.anchors.groups[exp.slideshowGroup || 'none'].length) {
+		this.disable('next');
+		this.disable('play');
+	} else if (re.test(this.btn.next.getElementsByTagName('a')[0].className)) {
+		this.enable('next');
+		this.enable('play');
+	}
+},
+enable: function(btn) {
+	if (!this.btn) return;
+	var sls = this, a = this.btn[btn].getElementsByTagName('a')[0], re = /disabled$/;
+	a.onclick = function() {
+		sls[btn]();
+		return false;
+	};
+	if (re.test(a.className)) a.className = a.className.replace(re, '');
+},
+disable: function(btn) {
+	if (!this.btn) return;
+	var a = this.btn[btn].getElementsByTagName('a')[0];
+	a.onclick = function() { return false; };
+	if (!/disabled$/.test(a.className)) a.className += ' disabled';
+},
+hitSpace: function() {
+	if (this.autoplay) this.pause();
+	else this.play();
+},
+play: function(wait) {
+	if (this.btn) {
+		this.btn.play.style.display = 'none';
+		this.btn.pause.style.display = '';
+	}
+	
+	this.autoplay = true;	
+	if (!wait) hs.next(this.expKey);
+},
+pause: function() {
+	if (this.btn) {
+		this.btn.pause.style.display = 'none';
+		this.btn.play.style.display = '';
+	}
+	
+	clearTimeout(this.autoplay);
+	this.autoplay = null;
+},
+previous: function() {
+	this.pause();
+	hs.previous(this.btn.previous);
+},
+next: function() {
+	this.pause();
+	hs.next(this.btn.next);
+},
+move: function() {},
+'full-expand': function() {
+	hs.getExpander().doFullExpand();
+},
+close: function() {
+	hs.close(this.btn.close);
+}
+};
+hs.Thumbstrip = function(slideshow) {
+	function add (exp) {
+		hs.extend(options || {}, {
+			overlayId: dom,
+			hsId: 'thumbstrip',
+			className: 'highslide-thumbstrip-'+ mode +'-overlay ' + (options.className || '')
+		});
+		if (hs.ieLt7) options.fade = 0;
+		exp.createOverlay(options);
+		hs.setStyles(dom.parentNode, { overflow: 'hidden' });
+	};
+	
+	function scroll (delta) {	
+		selectThumb(undefined, Math.round(delta * dom[isX ? 'offsetWidth' : 'offsetHeight'] * 0.7));
+	};
+	
+	function selectThumb (i, scrollBy) {
+		if (i === undefined) for (var j = 0; j < group.length; j++) {
+			if (group[j] == hs.expanders[slideshow.expKey].a) {
+				i = j;
+				break;
+			}
+		}
+		if (i === undefined) return;
+		var as = dom.getElementsByTagName('a'),
+			active = as[i],
+			cell = active.parentNode,
+			left = isX ? 'Left' : 'Top',
+			right = isX ? 'Right' : 'Bottom',
+			width = isX ? 'Width' : 'Height',
+			offsetLeft = 'offset' + left,
+			offsetWidth = 'offset' + width,
+			overlayWidth = div.parentNode.parentNode[offsetWidth],
+			minTblPos = overlayWidth - table[offsetWidth],
+			curTblPos = parseInt(table.style[isX ? 'left' : 'top']) || 0,
+			tblPos = curTblPos,
+			mgnRight = 20;
+		if (scrollBy !== undefined) {
+			tblPos = curTblPos - scrollBy;
+			
+			if (minTblPos > 0) minTblPos = 0;
+			if (tblPos > 0) tblPos = 0;
+			if (tblPos < minTblPos) tblPos = minTblPos;
+			
+	
+		} else {
+			for (var j = 0; j < as.length; j++) as[j].className = '';
+			active.className = 'highslide-active-anchor';
+			var activeLeft = i > 0 ? as[i - 1].parentNode[offsetLeft] : cell[offsetLeft],
+				activeRight = cell[offsetLeft] + cell[offsetWidth] + 
+					(as[i + 1] ? as[i + 1].parentNode[offsetWidth] : 0);
+			if (activeRight > overlayWidth - curTblPos) tblPos = overlayWidth - activeRight;
+			else if (activeLeft < -curTblPos) tblPos = -activeLeft;
+		}
+		var markerPos = cell[offsetLeft] + (cell[offsetWidth] - marker[offsetWidth]) / 2 + tblPos;
+		hs.animate(table, isX ? { left: tblPos } : { top: tblPos }, null, 'easeOutQuad');
+		hs.animate(marker, isX ? { left: markerPos } : { top: markerPos }, null, 'easeOutQuad');
+		scrollUp.style.display = tblPos < 0 ? 'block' : 'none';
+		scrollDown.style.display = (tblPos > minTblPos)  ? 'block' : 'none';
+		
+	};
+	
+
+	// initialize
+	var group = hs.anchors.groups[hs.expanders[slideshow.expKey].slideshowGroup || 'none'],
+		options = slideshow.thumbstrip,
+		mode = options.mode || 'horizontal',
+		floatMode = (mode == 'float'),
+		tree = floatMode ? ['div', 'ul', 'li', 'span'] : ['table', 'tbody', 'tr', 'td'],
+		isX = (mode == 'horizontal'),
+		dom = hs.createElement('div', {
+				className: 'highslide-thumbstrip highslide-thumbstrip-'+ mode,
+				innerHTML:
+					'<div class="highslide-thumbstrip-inner">'+
+					'<'+ tree[0] +'><'+ tree[1] +'></'+ tree[1] +'></'+ tree[0] +'></div>'+
+					'<div class="highslide-scroll-up"><div></div></div>'+
+					'<div class="highslide-scroll-down"><div></div></div>'+
+					'<div class="highslide-marker"><div></div></div>'
+			}, {
+				display: 'none'
+			}, hs.container),
+		domCh = dom.childNodes,
+		div = domCh[0],
+		scrollUp = domCh[1],
+		scrollDown = domCh[2],
+		marker = domCh[3],
+		table = div.firstChild,
+		tbody = dom.getElementsByTagName(tree[1])[0],
+		tr;
+	for (var i = 0; i < group.length; i++) {
+		if (i == 0 || !isX) tr = hs.createElement(tree[2], null, null, tbody);
+		(function(){
+			var a = group[i],
+				cell = hs.createElement(tree[3], null, null, tr),
+				pI = i;
+			hs.createElement('a', {
+				href: a.href,
+				title: a.title,
+				onclick: function() {
+					if (/highslide-active-anchor/.test(this.className)) return false;
+					hs.getExpander(this).focus();
+					return hs.transit(a);
+				},
+				innerHTML: hs.stripItemFormatter ? hs.stripItemFormatter(a) : a.innerHTML
+			}, null, cell);
+		})();
+	}
+	if (!floatMode) {
+		scrollUp.onclick = function () { scroll(-1); };
+		scrollDown.onclick = function() { scroll(1); };
+		hs.addEventListener(tbody, document.onmousewheel !== undefined ? 
+				'mousewheel' : 'DOMMouseScroll', function(e) {        
+			var delta = 0;
+	        e = e || window.event;
+	        if (e.wheelDelta) {
+				delta = e.wheelDelta/120;
+				if (hs.opera) delta = -delta;
+	        } else if (e.detail) {
+				delta = -e.detail/3;
+	        }
+	        if (delta) scroll(-delta * 0.2);
+			if (e.preventDefault) e.preventDefault();
+			e.returnValue = false;
+		});
+	}
+	
+	return {
+		add: add,
+		selectThumb: selectThumb
+	}
+};
+hs.langDefaults = hs.lang;
+// history
+var HsExpander = hs.Expander;
+if (hs.ie && window == window.top) {
+	(function () {
+		try {
+			document.documentElement.doScroll('left');
+		} catch (e) {
+			setTimeout(arguments.callee, 50);
+			return;
+		}
+		hs.ready();
+	})();
+}
+hs.addEventListener(document, 'DOMContentLoaded', hs.ready);
+hs.addEventListener(window, 'load', hs.ready);
+
+// set handlers
+hs.addEventListener(document, 'ready', function() {
+	if (hs.expandCursor || hs.dimmingOpacity) {
+		var style = hs.createElement('style', { type: 'text/css' }, null, 
+			document.getElementsByTagName('HEAD')[0]), 
+			backCompat = document.compatMode == 'BackCompat';
+			
+		
+		function addRule(sel, dec) {
+			if (hs.ie && (hs.uaVersion < 9 || backCompat)) {
+				var last = document.styleSheets[document.styleSheets.length - 1];
+				if (typeof(last.addRule) == "object") last.addRule(sel, dec);
+			} else {
+				style.appendChild(document.createTextNode(sel + " {" + dec + "}"));
+			}
+		}
+		function fix(prop) {
+			return 'expression( ( ( ignoreMe = document.documentElement.'+ prop +
+				' ? document.documentElement.'+ prop +' : document.body.'+ prop +' ) ) + \'px\' );';
+		}
+		if (hs.expandCursor) addRule ('.highslide img', 
+			'cursor: url('+ hs.graphicsDir + hs.expandCursor +'), pointer !important;');
+		addRule ('.highslide-viewport-size',
+			hs.ie && (hs.uaVersion < 7 || backCompat) ?
+				'position: absolute; '+
+				'left:'+ fix('scrollLeft') +
+				'top:'+ fix('scrollTop') +
+				'width:'+ fix('clientWidth') +
+				'height:'+ fix('clientHeight') :
+				'position: fixed; width: 100%; height: 100%; left: 0; top: 0');
+	}
+});
+hs.addEventListener(window, 'resize', function() {
+	hs.getPageSize();
+	if (hs.viewport) for (var i = 0; i < hs.viewport.childNodes.length; i++) {
+		var node = hs.viewport.childNodes[i],
+			exp = hs.getExpander(node);
+		exp.positionOverlay(node);
+		if (node.hsId == 'thumbstrip') exp.slideshow.thumbstrip.selectThumb();
+	}
+});
+hs.addEventListener(document, 'mousemove', function(e) {
+	hs.mouse = { x: e.clientX, y: e.clientY	};
+});
+hs.addEventListener(document, 'mousedown', hs.mouseClickHandler);
+hs.addEventListener(document, 'mouseup', hs.mouseClickHandler);
+hs.addEventListener(document, 'ready', hs.setClickEvents);
+hs.addEventListener(window, 'load', hs.preloadImages);
+hs.addEventListener(window, 'load', hs.preloadAjax);
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide-full.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide-full.min.js
new file mode 100644
index 0000000000000000000000000000000000000000..8674ad9b2fa9b67a83ea7849fa9940d69619230f
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide-full.min.js
@@ -0,0 +1,9 @@
+/** 
+ * Name:    Highslide JS
+ * Version: 4.1.13 (2011-10-06)
+ * Config:  default +events +unobtrusive +imagemap +slideshow +positioning +transitions +viewport +thumbstrip +inline +ajax +iframe +flash
+ * Author:  Torstein Hønsi
+ * Support: www.highslide.com/support
+ * License: www.highslide.com/#license
+ */
+if(!hs){var hs={lang:{cssDirection:"ltr",loadingText:"Loading...",loadingTitle:"Click to cancel",focusTitle:"Click to bring to front",fullExpandTitle:"Expand to actual size (f)",creditsText:"Powered by <i>Highslide JS</i>",creditsTitle:"Go to the Highslide JS homepage",previousText:"Previous",nextText:"Next",moveText:"Move",closeText:"Close",closeTitle:"Close (esc)",resizeTitle:"Resize",playText:"Play",playTitle:"Play slideshow (spacebar)",pauseText:"Pause",pauseTitle:"Pause slideshow (spacebar)",previousTitle:"Previous (arrow left)",nextTitle:"Next (arrow right)",moveTitle:"Move",fullExpandText:"1:1",number:"Image %1 of %2",restoreTitle:"Click to close image, click and drag to move. Use arrow keys for next and previous."},graphicsDir:"highslide/graphics/",expandCursor:"zoomin.cur",restoreCursor:"zoomout.cur",expandDuration:250,restoreDuration:250,marginLeft:15,marginRight:15,marginTop:15,marginBottom:15,zIndexCounter:10001,loadingOpacity:0.75,allowMultipleInstances:true,numberOfImagesToPreload:5,outlineWhileAnimating:2,outlineStartOffset:3,padToMinWidth:false,fullExpandPosition:"bottom right",fullExpandOpacity:1,showCredits:true,creditsHref:"http://highslide.com/",creditsTarget:"_self",enableKeyListener:true,openerTagNames:["a","area"],transitions:[],transitionDuration:250,dimmingOpacity:0,dimmingDuration:50,allowWidthReduction:false,allowHeightReduction:true,preserveContent:true,objectLoadTime:"before",cacheAjax:true,anchor:"auto",align:"auto",targetX:null,targetY:null,dragByHeading:true,minWidth:200,minHeight:200,allowSizeReduction:true,outlineType:"drop-shadow",skin:{controls:'<div class="highslide-controls"><ul><li class="highslide-previous"><a href="#" title="{hs.lang.previousTitle}"><span>{hs.lang.previousText}</span></a></li><li class="highslide-play"><a href="#" title="{hs.lang.playTitle}"><span>{hs.lang.playText}</span></a></li><li class="highslide-pause"><a href="#" title="{hs.lang.pauseTitle}"><span>{hs.lang.pauseText}</span></a></li><li class="highslide-next"><a href="#" title="{hs.lang.nextTitle}"><span>{hs.lang.nextText}</span></a></li><li class="highslide-move"><a href="#" title="{hs.lang.moveTitle}"><span>{hs.lang.moveText}</span></a></li><li class="highslide-full-expand"><a href="#" title="{hs.lang.fullExpandTitle}"><span>{hs.lang.fullExpandText}</span></a></li><li class="highslide-close"><a href="#" title="{hs.lang.closeTitle}" ><span>{hs.lang.closeText}</span></a></li></ul></div>',contentWrapper:'<div class="highslide-header"><ul><li class="highslide-previous"><a href="#" title="{hs.lang.previousTitle}" onclick="return hs.previous(this)"><span>{hs.lang.previousText}</span></a></li><li class="highslide-next"><a href="#" title="{hs.lang.nextTitle}" onclick="return hs.next(this)"><span>{hs.lang.nextText}</span></a></li><li class="highslide-move"><a href="#" title="{hs.lang.moveTitle}" onclick="return false"><span>{hs.lang.moveText}</span></a></li><li class="highslide-close"><a href="#" title="{hs.lang.closeTitle}" onclick="return hs.close(this)"><span>{hs.lang.closeText}</span></a></li></ul></div><div class="highslide-body"></div><div class="highslide-footer"><div><span class="highslide-resize" title="{hs.lang.resizeTitle}"><span></span></span></div></div>'},preloadTheseImages:[],continuePreloading:true,expanders:[],overrides:["allowSizeReduction","useBox","anchor","align","targetX","targetY","outlineType","outlineWhileAnimating","captionId","captionText","captionEval","captionOverlay","headingId","headingText","headingEval","headingOverlay","creditsPosition","dragByHeading","autoplay","numberPosition","transitions","dimmingOpacity","width","height","contentId","allowWidthReduction","allowHeightReduction","preserveContent","maincontentId","maincontentText","maincontentEval","objectType","cacheAjax","objectWidth","objectHeight","objectLoadTime","swfOptions","wrapperClassName","minWidth","minHeight","maxWidth","maxHeight","pageOrigin","slideshowGroup","easing","easingClose","fadeInOut","src"],overlays:[],idCounter:0,oPos:{x:["leftpanel","left","center","right","rightpanel"],y:["above","top","middle","bottom","below"]},mouse:{},headingOverlay:{},captionOverlay:{},swfOptions:{flashvars:{},params:{},attributes:{}},timers:[],slideshows:[],pendingOutlines:{},sleeping:[],preloadTheseAjax:[],cacheBindings:[],cachedGets:{},clones:{},onReady:[],uaVersion:/Trident\/4\.0/.test(navigator.userAgent)?8:parseFloat((navigator.userAgent.toLowerCase().match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1]),ie:(document.all&&!window.opera),safari:/Safari/.test(navigator.userAgent),geckoMac:/Macintosh.+rv:1\.[0-8].+Gecko/.test(navigator.userAgent),$:function(a){if(a){return document.getElementById(a)}},push:function(a,b){a[a.length]=b},createElement:function(a,f,e,d,c){var b=document.createElement(a);if(f){hs.extend(b,f)}if(c){hs.setStyles(b,{padding:0,border:"none",margin:0})}if(e){hs.setStyles(b,e)}if(d){d.appendChild(b)}return b},extend:function(b,c){for(var a in c){b[a]=c[a]}return b},setStyles:function(b,c){for(var a in c){if(hs.ieLt9&&a=="opacity"){if(c[a]>0.99){b.style.removeAttribute("filter")}else{b.style.filter="alpha(opacity="+(c[a]*100)+")"}}else{b.style[a]=c[a]}}},animate:function(f,a,d){var c,g,j;if(typeof d!="object"||d===null){var i=arguments;d={duration:i[2],easing:i[3],complete:i[4]}}if(typeof d.duration!="number"){d.duration=250}d.easing=Math[d.easing]||Math.easeInQuad;d.curAnim=hs.extend({},a);for(var b in a){var h=new hs.fx(f,d,b);c=parseFloat(hs.css(f,b))||0;g=parseFloat(a[b]);j=b!="opacity"?"px":"";h.custom(c,g,j)}},css:function(a,c){if(a.style[c]){return a.style[c]}else{if(document.defaultView){return document.defaultView.getComputedStyle(a,null).getPropertyValue(c)}else{if(c=="opacity"){c="filter"}var b=a.currentStyle[c.replace(/\-(\w)/g,function(e,d){return d.toUpperCase()})];if(c=="filter"){b=b.replace(/alpha\(opacity=([0-9]+)\)/,function(e,d){return d/100})}return b===""?1:b}}},getPageSize:function(){var f=document,b=window,e=f.compatMode&&f.compatMode!="BackCompat"?f.documentElement:f.body,g=hs.ie&&(hs.uaVersion<9||typeof pageXOffset=="undefined");var c=g?e.clientWidth:(f.documentElement.clientWidth||self.innerWidth),a=g?e.clientHeight:self.innerHeight;hs.page={width:c,height:a,scrollLeft:g?e.scrollLeft:pageXOffset,scrollTop:g?e.scrollTop:pageYOffset};return hs.page},getPosition:function(c){if(/area/i.test(c.tagName)){var e=document.getElementsByTagName("img");for(var b=0;b<e.length;b++){var a=e[b].useMap;if(a&&a.replace(/^.*?#/,"")==c.parentNode.name){c=e[b];break}}}var d={x:c.offsetLeft,y:c.offsetTop};while(c.offsetParent){c=c.offsetParent;d.x+=c.offsetLeft;d.y+=c.offsetTop;if(c!=document.body&&c!=document.documentElement){d.x-=c.scrollLeft;d.y-=c.scrollTop}}return d},expand:function(b,h,f,d){if(!b){b=hs.createElement("a",null,{display:"none"},hs.container)}if(typeof b.getParams=="function"){return h}if(d=="html"){for(var c=0;c<hs.sleeping.length;c++){if(hs.sleeping[c]&&hs.sleeping[c].a==b){hs.sleeping[c].awake();hs.sleeping[c]=null;return false}}hs.hasHtmlExpanders=true}try{new hs.Expander(b,h,f,d);return false}catch(g){return true}},htmlExpand:function(b,d,c){return hs.expand(b,d,c,"html")},getSelfRendered:function(){return hs.createElement("div",{className:"highslide-html-content",innerHTML:hs.replaceLang(hs.skin.contentWrapper)})},getElementByClass:function(e,c,d){var b=e.getElementsByTagName(c);for(var a=0;a<b.length;a++){if((new RegExp(d)).test(b[a].className)){return b[a]}}return null},replaceLang:function(c){c=c.replace(/\s/g," ");var b=/{hs\.lang\.([^}]+)\}/g,d=c.match(b),e;if(d){for(var a=0;a<d.length;a++){e=d[a].replace(b,"$1");if(typeof hs.lang[e]!="undefined"){c=c.replace(d[a],hs.lang[e])}}}return c},setClickEvents:function(){var b=document.getElementsByTagName("a");for(var a=0;a<b.length;a++){var c=hs.isUnobtrusiveAnchor(b[a]);if(c&&!b[a].hsHasSetClick){(function(){var d=c;if(hs.fireEvent(hs,"onSetClickEvent",{element:b[a],type:d})){b[a].onclick=(c=="image")?function(){return hs.expand(this)}:function(){return hs.htmlExpand(this,{objectType:d})}}})();b[a].hsHasSetClick=true}}hs.getAnchors()},isUnobtrusiveAnchor:function(a){if(a.rel=="highslide"){return"image"}else{if(a.rel=="highslide-ajax"){return"ajax"}else{if(a.rel=="highslide-iframe"){return"iframe"}else{if(a.rel=="highslide-swf"){return"swf"}}}}},getCacheBinding:function(b){for(var d=0;d<hs.cacheBindings.length;d++){if(hs.cacheBindings[d][0]==b){var e=hs.cacheBindings[d][1];hs.cacheBindings[d][1]=e.cloneNode(1);return e}}return null},preloadAjax:function(f){var b=hs.getAnchors();for(var d=0;d<b.htmls.length;d++){var c=b.htmls[d];if(hs.getParam(c,"objectType")=="ajax"&&hs.getParam(c,"cacheAjax")){hs.push(hs.preloadTheseAjax,c)}}hs.preloadAjaxElement(0)},preloadAjaxElement:function(d){if(!hs.preloadTheseAjax[d]){return}var b=hs.preloadTheseAjax[d];var c=hs.getNode(hs.getParam(b,"contentId"));if(!c){c=hs.getSelfRendered()}var e=new hs.Ajax(b,c,1);e.onError=function(){};e.onLoad=function(){hs.push(hs.cacheBindings,[b,c]);hs.preloadAjaxElement(d+1)};e.run()},focusTopmost:function(){var c=0,b=-1,a=hs.expanders,e,f;for(var d=0;d<a.length;d++){e=a[d];if(e){f=e.wrapper.style.zIndex;if(f&&f>c){c=f;b=d}}}if(b==-1){hs.focusKey=-1}else{a[b].focus()}},getParam:function(b,d){b.getParams=b.onclick;var c=b.getParams?b.getParams():null;b.getParams=null;return(c&&typeof c[d]!="undefined")?c[d]:(typeof hs[d]!="undefined"?hs[d]:null)},getSrc:function(b){var c=hs.getParam(b,"src");if(c){return c}return b.href},getNode:function(e){var c=hs.$(e),d=hs.clones[e],b={};if(!c&&!d){return null}if(!d){d=c.cloneNode(true);d.id="";hs.clones[e]=d;return c}else{return d.cloneNode(true)}},discardElement:function(a){if(a){hs.garbageBin.appendChild(a)}hs.garbageBin.innerHTML=""},dim:function(d){if(!hs.dimmer){a=true;hs.dimmer=hs.createElement("div",{className:"highslide-dimming highslide-viewport-size",owner:"",onclick:function(){if(hs.fireEvent(hs,"onDimmerClick")){hs.close()}}},{visibility:"visible",opacity:0},hs.container,true);if(/(Android|iPad|iPhone|iPod)/.test(navigator.userAgent)){var b=document.body;function c(){hs.setStyles(hs.dimmer,{width:b.scrollWidth+"px",height:b.scrollHeight+"px"})}c();hs.addEventListener(window,"resize",c)}}hs.dimmer.style.display="";var a=hs.dimmer.owner=="";hs.dimmer.owner+="|"+d.key;if(a){if(hs.geckoMac&&hs.dimmingGeckoFix){hs.setStyles(hs.dimmer,{background:"url("+hs.graphicsDir+"geckodimmer.png)",opacity:1})}else{hs.animate(hs.dimmer,{opacity:d.dimmingOpacity},hs.dimmingDuration)}}},undim:function(a){if(!hs.dimmer){return}if(typeof a!="undefined"){hs.dimmer.owner=hs.dimmer.owner.replace("|"+a,"")}if((typeof a!="undefined"&&hs.dimmer.owner!="")||(hs.upcoming&&hs.getParam(hs.upcoming,"dimmingOpacity"))){return}if(hs.geckoMac&&hs.dimmingGeckoFix){hs.dimmer.style.display="none"}else{hs.animate(hs.dimmer,{opacity:0},hs.dimmingDuration,null,function(){hs.dimmer.style.display="none"})}},transit:function(a,d){var b=d||hs.getExpander();d=b;if(hs.upcoming){return false}else{hs.last=b}hs.removeEventListener(document,window.opera?"keypress":"keydown",hs.keyHandler);try{hs.upcoming=a;a.onclick()}catch(c){hs.last=hs.upcoming=null}try{if(!a||d.transitions[1]!="crossfade"){d.close()}}catch(c){}return false},previousOrNext:function(a,c){var b=hs.getExpander(a);if(b){return hs.transit(b.getAdjacentAnchor(c),b)}else{return false}},previous:function(a){return hs.previousOrNext(a,-1)},next:function(a){return hs.previousOrNext(a,1)},keyHandler:function(a){if(!a){a=window.event}if(!a.target){a.target=a.srcElement}if(typeof a.target.form!="undefined"){return true}if(!hs.fireEvent(hs,"onKeyDown",a)){return true}var b=hs.getExpander();var c=null;switch(a.keyCode){case 70:if(b){b.doFullExpand()}return true;case 32:c=2;break;case 34:case 39:case 40:c=1;break;case 8:case 33:case 37:case 38:c=-1;break;case 27:case 13:c=0}if(c!==null){if(c!=2){hs.removeEventListener(document,window.opera?"keypress":"keydown",hs.keyHandler)}if(!hs.enableKeyListener){return true}if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}if(b){if(c==0){b.close()}else{if(c==2){if(b.slideshow){b.slideshow.hitSpace()}}else{if(b.slideshow){b.slideshow.pause()}hs.previousOrNext(b.key,c)}}return false}}return true},registerOverlay:function(a){hs.push(hs.overlays,hs.extend(a,{hsId:"hsId"+hs.idCounter++}))},addSlideshow:function(b){var d=b.slideshowGroup;if(typeof d=="object"){for(var c=0;c<d.length;c++){var e={};for(var a in b){e[a]=b[a]}e.slideshowGroup=d[c];hs.push(hs.slideshows,e)}}else{hs.push(hs.slideshows,b)}},getWrapperKey:function(c,b){var e,d=/^highslide-wrapper-([0-9]+)$/;e=c;while(e.parentNode){if(e.hsKey!==undefined){return e.hsKey}if(e.id&&d.test(e.id)){return e.id.replace(d,"$1")}e=e.parentNode}if(!b){e=c;while(e.parentNode){if(e.tagName&&hs.isHsAnchor(e)){for(var a=0;a<hs.expanders.length;a++){var f=hs.expanders[a];if(f&&f.a==e){return a}}}e=e.parentNode}}return null},getExpander:function(b,a){if(typeof b=="undefined"){return hs.expanders[hs.focusKey]||null}if(typeof b=="number"){return hs.expanders[b]||null}if(typeof b=="string"){b=hs.$(b)}return hs.expanders[hs.getWrapperKey(b,a)]||null},isHsAnchor:function(b){return(b.onclick&&b.onclick.toString().replace(/\s/g," ").match(/hs.(htmlE|e)xpand/))},reOrder:function(){for(var a=0;a<hs.expanders.length;a++){if(hs.expanders[a]&&hs.expanders[a].isExpanded){hs.focusTopmost()}}},fireEvent:function(c,a,b){return c&&c[a]?(c[a](c,b)!==false):true},mouseClickHandler:function(d){if(!d){d=window.event}if(d.button>1){return true}if(!d.target){d.target=d.srcElement}var b=d.target;while(b.parentNode&&!(/highslide-(image|move|html|resize)/.test(b.className))){b=b.parentNode}var f=hs.getExpander(b);if(f&&(f.isClosing||!f.isExpanded)){return true}if(f&&d.type=="mousedown"){if(d.target.form){return true}var a=b.className.match(/highslide-(image|move|resize)/);if(a){hs.dragArgs={exp:f,type:a[1],left:f.x.pos,width:f.x.size,top:f.y.pos,height:f.y.size,clickX:d.clientX,clickY:d.clientY};hs.addEventListener(document,"mousemove",hs.dragHandler);if(d.preventDefault){d.preventDefault()}if(/highslide-(image|html)-blur/.test(f.content.className)){f.focus();hs.hasFocused=true}return false}else{if(/highslide-html/.test(b.className)&&hs.focusKey!=f.key){f.focus();f.doShowHide("hidden")}}}else{if(d.type=="mouseup"){hs.removeEventListener(document,"mousemove",hs.dragHandler);if(hs.dragArgs){if(hs.styleRestoreCursor&&hs.dragArgs.type=="image"){hs.dragArgs.exp.content.style.cursor=hs.styleRestoreCursor}var c=hs.dragArgs.hasDragged;if(!c&&!hs.hasFocused&&!/(move|resize)/.test(hs.dragArgs.type)){if(hs.fireEvent(f,"onImageClick")){f.close()}}else{if(c||(!c&&hs.hasHtmlExpanders)){hs.dragArgs.exp.doShowHide("hidden")}}if(hs.dragArgs.exp.releaseMask){hs.dragArgs.exp.releaseMask.style.display="none"}if(c){hs.fireEvent(hs.dragArgs.exp,"onDrop",hs.dragArgs)}hs.hasFocused=false;hs.dragArgs=null}else{if(/highslide-image-blur/.test(b.className)){b.style.cursor=hs.styleRestoreCursor}}}}return false},dragHandler:function(c){if(!hs.dragArgs){return true}if(!c){c=window.event}var b=hs.dragArgs,d=b.exp;if(d.iframe){if(!d.releaseMask){d.releaseMask=hs.createElement("div",null,{position:"absolute",width:d.x.size+"px",height:d.y.size+"px",left:d.x.cb+"px",top:d.y.cb+"px",zIndex:4,background:(hs.ieLt9?"white":"none"),opacity:0.01},d.wrapper,true)}if(d.releaseMask.style.display=="none"){d.releaseMask.style.display=""}}b.dX=c.clientX-b.clickX;b.dY=c.clientY-b.clickY;var f=Math.sqrt(Math.pow(b.dX,2)+Math.pow(b.dY,2));if(!b.hasDragged){b.hasDragged=(b.type!="image"&&f>0)||(f>(hs.dragSensitivity||5))}if(b.hasDragged&&c.clientX>5&&c.clientY>5){if(!hs.fireEvent(d,"onDrag",b)){return false}if(b.type=="resize"){d.resize(b)}else{d.moveTo(b.left+b.dX,b.top+b.dY);if(b.type=="image"){d.content.style.cursor="move"}}}return false},wrapperMouseHandler:function(c){try{if(!c){c=window.event}var b=/mouseover/i.test(c.type);if(!c.target){c.target=c.srcElement}if(!c.relatedTarget){c.relatedTarget=b?c.fromElement:c.toElement}var d=hs.getExpander(c.target);if(!d.isExpanded){return}if(!d||!c.relatedTarget||hs.getExpander(c.relatedTarget,true)==d||hs.dragArgs){return}hs.fireEvent(d,b?"onMouseOver":"onMouseOut",c);for(var a=0;a<d.overlays.length;a++){(function(){var e=hs.$("hsId"+d.overlays[a]);if(e&&e.hideOnMouseOut){if(b){hs.setStyles(e,{visibility:"visible",display:""})}hs.animate(e,{opacity:b?e.opacity:0},e.dur)}})()}}catch(c){}},addEventListener:function(a,c,b){if(a==document&&c=="ready"){hs.push(hs.onReady,b)}try{a.addEventListener(c,b,false)}catch(d){try{a.detachEvent("on"+c,b);a.attachEvent("on"+c,b)}catch(d){a["on"+c]=b}}},removeEventListener:function(a,c,b){try{a.removeEventListener(c,b,false)}catch(d){try{a.detachEvent("on"+c,b)}catch(d){a["on"+c]=null}}},preloadFullImage:function(b){if(hs.continuePreloading&&hs.preloadTheseImages[b]&&hs.preloadTheseImages[b]!="undefined"){var a=document.createElement("img");a.onload=function(){a=null;hs.preloadFullImage(b+1)};a.src=hs.preloadTheseImages[b]}},preloadImages:function(c){if(c&&typeof c!="object"){hs.numberOfImagesToPreload=c}var a=hs.getAnchors();for(var b=0;b<a.images.length&&b<hs.numberOfImagesToPreload;b++){hs.push(hs.preloadTheseImages,hs.getSrc(a.images[b]))}if(hs.outlineType){new hs.Outline(hs.outlineType,function(){hs.preloadFullImage(0)})}else{hs.preloadFullImage(0)}if(hs.restoreCursor){var d=hs.createElement("img",{src:hs.graphicsDir+hs.restoreCursor})}},init:function(){if(!hs.container){hs.ieLt7=hs.ie&&hs.uaVersion<7;hs.ieLt9=hs.ie&&hs.uaVersion<9;hs.getPageSize();hs.ie6SSL=hs.ieLt7&&location.protocol=="https:";for(var a in hs.langDefaults){if(typeof hs[a]!="undefined"){hs.lang[a]=hs[a]}else{if(typeof hs.lang[a]=="undefined"&&typeof hs.langDefaults[a]!="undefined"){hs.lang[a]=hs.langDefaults[a]}}}hs.container=hs.createElement("div",{className:"highslide-container"},{position:"absolute",left:0,top:0,width:"100%",zIndex:hs.zIndexCounter,direction:"ltr"},document.body,true);hs.loading=hs.createElement("a",{className:"highslide-loading",title:hs.lang.loadingTitle,innerHTML:hs.lang.loadingText,href:"javascript:;"},{position:"absolute",top:"-9999px",opacity:hs.loadingOpacity,zIndex:1},hs.container);hs.garbageBin=hs.createElement("div",null,{display:"none"},hs.container);hs.viewport=hs.createElement("div",{className:"highslide-viewport highslide-viewport-size"},{visibility:(hs.safari&&hs.uaVersion<525)?"visible":"hidden"},hs.container,1);hs.clearing=hs.createElement("div",null,{clear:"both",paddingTop:"1px"},null,true);Math.linearTween=function(f,e,h,g){return h*f/g+e};Math.easeInQuad=function(f,e,h,g){return h*(f/=g)*f+e};Math.easeOutQuad=function(f,e,h,g){return -h*(f/=g)*(f-2)+e};hs.hideSelects=hs.ieLt7;hs.hideIframes=((window.opera&&hs.uaVersion<9)||navigator.vendor=="KDE"||(hs.ieLt7&&hs.uaVersion<5.5));hs.fireEvent(this,"onActivate")}},ready:function(){if(hs.isReady){return}hs.isReady=true;for(var a=0;a<hs.onReady.length;a++){hs.onReady[a]()}},updateAnchors:function(){var a,d,l=[],h=[],k=[],b={},m;for(var e=0;e<hs.openerTagNames.length;e++){d=document.getElementsByTagName(hs.openerTagNames[e]);for(var c=0;c<d.length;c++){a=d[c];m=hs.isHsAnchor(a);if(m){hs.push(l,a);if(m[0]=="hs.expand"){hs.push(h,a)}else{if(m[0]=="hs.htmlExpand"){hs.push(k,a)}}var f=hs.getParam(a,"slideshowGroup")||"none";if(!b[f]){b[f]=[]}hs.push(b[f],a)}}}hs.anchors={all:l,groups:b,images:h,htmls:k};return hs.anchors},getAnchors:function(){return hs.anchors||hs.updateAnchors()},close:function(a){var b=hs.getExpander(a);if(b){b.close()}return false}};hs.fx=function(b,a,c){this.options=a;this.elem=b;this.prop=c;if(!a.orig){a.orig={}}};hs.fx.prototype={update:function(){(hs.fx.step[this.prop]||hs.fx.step._default)(this);if(this.options.step){this.options.step.call(this.elem,this.now,this)}},custom:function(e,d,c){this.startTime=(new Date()).getTime();this.start=e;this.end=d;this.unit=c;this.now=this.start;this.pos=this.state=0;var a=this;function b(f){return a.step(f)}b.elem=this.elem;if(b()&&hs.timers.push(b)==1){hs.timerId=setInterval(function(){var g=hs.timers;for(var f=0;f<g.length;f++){if(!g[f]()){g.splice(f--,1)}}if(!g.length){clearInterval(hs.timerId)}},13)}},step:function(d){var c=(new Date()).getTime();if(d||c>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var a=true;for(var b in this.options.curAnim){if(this.options.curAnim[b]!==true){a=false}}if(a){if(this.options.complete){this.options.complete.call(this.elem)}}return false}else{var e=c-this.startTime;this.state=e/this.options.duration;this.pos=this.options.easing(e,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};hs.extend(hs.fx,{step:{opacity:function(a){hs.setStyles(a.elem,{opacity:a.now})},_default:function(a){try{if(a.elem.style&&a.elem.style[a.prop]!=null){a.elem.style[a.prop]=a.now+a.unit}else{a.elem[a.prop]=a.now}}catch(b){}}}});hs.Outline=function(g,e){this.onLoad=e;this.outlineType=g;var a=hs.uaVersion,f;this.hasAlphaImageLoader=hs.ie&&hs.uaVersion<7;if(!g){if(e){e()}return}hs.init();this.table=hs.createElement("table",{cellSpacing:0},{visibility:"hidden",position:"absolute",borderCollapse:"collapse",width:0},hs.container,true);var b=hs.createElement("tbody",null,null,this.table,1);this.td=[];for(var c=0;c<=8;c++){if(c%3==0){f=hs.createElement("tr",null,{height:"auto"},b,true)}this.td[c]=hs.createElement("td",null,null,f,true);var d=c!=4?{lineHeight:0,fontSize:0}:{position:"relative"};hs.setStyles(this.td[c],d)}this.td[4].className=g+" highslide-outline";this.preloadGraphic()};hs.Outline.prototype={preloadGraphic:function(){var b=hs.graphicsDir+(hs.outlinesDir||"outlines/")+this.outlineType+".png";var a=hs.safari&&hs.uaVersion<525?hs.container:null;this.graphic=hs.createElement("img",null,{position:"absolute",top:"-9999px"},a,true);var c=this;this.graphic.onload=function(){c.onGraphicLoad()};this.graphic.src=b},onGraphicLoad:function(){var d=this.offset=this.graphic.width/4,f=[[0,0],[0,-4],[-2,0],[0,-8],0,[-2,-8],[0,-2],[0,-6],[-2,-2]],c={height:(2*d)+"px",width:(2*d)+"px"};for(var b=0;b<=8;b++){if(f[b]){if(this.hasAlphaImageLoader){var a=(b==1||b==7)?"100%":this.graphic.width+"px";var e=hs.createElement("div",null,{width:"100%",height:"100%",position:"relative",overflow:"hidden"},this.td[b],true);hs.createElement("div",null,{filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale, src='"+this.graphic.src+"')",position:"absolute",width:a,height:this.graphic.height+"px",left:(f[b][0]*d)+"px",top:(f[b][1]*d)+"px"},e,true)}else{hs.setStyles(this.td[b],{background:"url("+this.graphic.src+") "+(f[b][0]*d)+"px "+(f[b][1]*d)+"px"})}if(window.opera&&(b==3||b==5)){hs.createElement("div",null,c,this.td[b],true)}hs.setStyles(this.td[b],c)}}this.graphic=null;if(hs.pendingOutlines[this.outlineType]){hs.pendingOutlines[this.outlineType].destroy()}hs.pendingOutlines[this.outlineType]=this;if(this.onLoad){this.onLoad()}},setPosition:function(g,e,c,b,f){var d=this.exp,a=d.wrapper.style,e=e||0,g=g||{x:d.x.pos+e,y:d.y.pos+e,w:d.x.get("wsize")-2*e,h:d.y.get("wsize")-2*e};if(c){this.table.style.visibility=(g.h>=4*this.offset)?"visible":"hidden"}hs.setStyles(this.table,{left:(g.x-this.offset)+"px",top:(g.y-this.offset)+"px",width:(g.w+2*this.offset)+"px"});g.w-=2*this.offset;g.h-=2*this.offset;hs.setStyles(this.td[4],{width:g.w>=0?g.w+"px":0,height:g.h>=0?g.h+"px":0});if(this.hasAlphaImageLoader){this.td[3].style.height=this.td[5].style.height=this.td[4].style.height}},destroy:function(a){if(a){this.table.style.visibility="hidden"}else{hs.discardElement(this.table)}}};hs.Dimension=function(b,a){this.exp=b;this.dim=a;this.ucwh=a=="x"?"Width":"Height";this.wh=this.ucwh.toLowerCase();this.uclt=a=="x"?"Left":"Top";this.lt=this.uclt.toLowerCase();this.ucrb=a=="x"?"Right":"Bottom";this.rb=this.ucrb.toLowerCase();this.p1=this.p2=0};hs.Dimension.prototype={get:function(a){switch(a){case"loadingPos":return this.tpos+this.tb+(this.t-hs.loading["offset"+this.ucwh])/2;case"loadingPosXfade":return this.pos+this.cb+this.p1+(this.size-hs.loading["offset"+this.ucwh])/2;case"wsize":return this.size+2*this.cb+this.p1+this.p2;case"fitsize":return this.clientSize-this.marginMin-this.marginMax;case"maxsize":return this.get("fitsize")-2*this.cb-this.p1-this.p2;case"opos":return this.pos-(this.exp.outline?this.exp.outline.offset:0);case"osize":return this.get("wsize")+(this.exp.outline?2*this.exp.outline.offset:0);case"imgPad":return this.imgSize?Math.round((this.size-this.imgSize)/2):0}},calcBorders:function(){this.cb=(this.exp.content["offset"+this.ucwh]-this.t)/2;this.marginMax=hs["margin"+this.ucrb]},calcThumb:function(){this.t=this.exp.el[this.wh]?parseInt(this.exp.el[this.wh]):this.exp.el["offset"+this.ucwh];this.tpos=this.exp.tpos[this.dim];this.tb=(this.exp.el["offset"+this.ucwh]-this.t)/2;if(this.tpos==0||this.tpos==-1){this.tpos=(hs.page[this.wh]/2)+hs.page["scroll"+this.uclt]}},calcExpanded:function(){var a=this.exp;this.justify="auto";if(a.align=="center"){this.justify="center"}else{if(new RegExp(this.lt).test(a.anchor)){this.justify=null}else{if(new RegExp(this.rb).test(a.anchor)){this.justify="max"}}}this.pos=this.tpos-this.cb+this.tb;if(this.maxHeight&&this.dim=="x"){a.maxWidth=Math.min(a.maxWidth||this.full,a.maxHeight*this.full/a.y.full)}this.size=Math.min(this.full,a["max"+this.ucwh]||this.full);this.minSize=a.allowSizeReduction?Math.min(a["min"+this.ucwh],this.full):this.full;if(a.isImage&&a.useBox){this.size=a[this.wh];this.imgSize=this.full}if(this.dim=="x"&&hs.padToMinWidth){this.minSize=a.minWidth}this.target=a["target"+this.dim.toUpperCase()];this.marginMin=hs["margin"+this.uclt];this.scroll=hs.page["scroll"+this.uclt];this.clientSize=hs.page[this.wh]},setSize:function(a){var f=this.exp;if(f.isImage&&(f.useBox||hs.padToMinWidth)){this.imgSize=a;this.size=Math.max(this.size,this.imgSize);f.content.style[this.lt]=this.get("imgPad")+"px"}else{this.size=a}f.content.style[this.wh]=a+"px";f.wrapper.style[this.wh]=this.get("wsize")+"px";if(f.outline){f.outline.setPosition()}if(f.releaseMask){f.releaseMask.style[this.wh]=a+"px"}if(this.dim=="y"&&f.iDoc&&f.body.style.height!="auto"){try{f.iDoc.body.style.overflow="auto"}catch(b){}}if(f.isHtml){var c=f.scrollerDiv;if(this.sizeDiff===undefined){this.sizeDiff=f.innerContent["offset"+this.ucwh]-c["offset"+this.ucwh]}c.style[this.wh]=(this.size-this.sizeDiff)+"px";if(this.dim=="x"){f.mediumContent.style.width="auto"}if(f.body){f.body.style[this.wh]="auto"}}if(this.dim=="x"&&f.overlayBox){f.sizeOverlayBox(true)}if(this.dim=="x"&&f.slideshow&&f.isImage){if(a==this.full){f.slideshow.disable("full-expand")}else{f.slideshow.enable("full-expand")}}},setPos:function(a){this.pos=a;this.exp.wrapper.style[this.lt]=a+"px";if(this.exp.outline){this.exp.outline.setPosition()}}};hs.Expander=function(k,f,b,l){if(document.readyState&&hs.ie&&!hs.isReady){hs.addEventListener(document,"ready",function(){new hs.Expander(k,f,b,l)});return}this.a=k;this.custom=b;this.contentType=l||"image";this.isHtml=(l=="html");this.isImage=!this.isHtml;hs.continuePreloading=false;this.overlays=[];this.last=hs.last;hs.last=null;hs.init();var m=this.key=hs.expanders.length;for(var g=0;g<hs.overrides.length;g++){var c=hs.overrides[g];this[c]=f&&typeof f[c]!="undefined"?f[c]:hs[c]}if(!this.src){this.src=k.href}var d=(f&&f.thumbnailId)?hs.$(f.thumbnailId):k;d=this.thumb=d.getElementsByTagName("img")[0]||d;this.thumbsUserSetId=d.id||k.id;if(!hs.fireEvent(this,"onInit")){return true}for(var g=0;g<hs.expanders.length;g++){if(hs.expanders[g]&&hs.expanders[g].a==k&&!(this.last&&this.transitions[1]=="crossfade")){hs.expanders[g].focus();return false}}if(!hs.allowSimultaneousLoading){for(var g=0;g<hs.expanders.length;g++){if(hs.expanders[g]&&hs.expanders[g].thumb!=d&&!hs.expanders[g].onLoadStarted){hs.expanders[g].cancelLoading()}}}hs.expanders[m]=this;if(!hs.allowMultipleInstances&&!hs.upcoming){if(hs.expanders[m-1]){hs.expanders[m-1].close()}if(typeof hs.focusKey!="undefined"&&hs.expanders[hs.focusKey]){hs.expanders[hs.focusKey].close()}}this.el=d;this.tpos=this.pageOrigin||hs.getPosition(d);hs.getPageSize();var j=this.x=new hs.Dimension(this,"x");j.calcThumb();var h=this.y=new hs.Dimension(this,"y");h.calcThumb();if(/area/i.test(d.tagName)){this.getImageMapAreaCorrection(d)}this.wrapper=hs.createElement("div",{id:"highslide-wrapper-"+this.key,className:"highslide-wrapper "+this.wrapperClassName},{visibility:"hidden",position:"absolute",zIndex:hs.zIndexCounter+=2},null,true);this.wrapper.onmouseover=this.wrapper.onmouseout=hs.wrapperMouseHandler;if(this.contentType=="image"&&this.outlineWhileAnimating==2){this.outlineWhileAnimating=0}if(!this.outlineType||(this.last&&this.isImage&&this.transitions[1]=="crossfade")){this[this.contentType+"Create"]()}else{if(hs.pendingOutlines[this.outlineType]){this.connectOutline();this[this.contentType+"Create"]()}else{this.showLoading();var e=this;new hs.Outline(this.outlineType,function(){e.connectOutline();e[e.contentType+"Create"]()})}}return true};hs.Expander.prototype={error:function(a){if(hs.debug){alert("Line "+a.lineNumber+": "+a.message)}else{window.location.href=this.src}},connectOutline:function(){var a=this.outline=hs.pendingOutlines[this.outlineType];a.exp=this;a.table.style.zIndex=this.wrapper.style.zIndex-1;hs.pendingOutlines[this.outlineType]=null},showLoading:function(){if(this.onLoadStarted||this.loading){return}this.loading=hs.loading;var c=this;this.loading.onclick=function(){c.cancelLoading()};if(!hs.fireEvent(this,"onShowLoading")){return}var c=this,a=this.x.get("loadingPos")+"px",b=this.y.get("loadingPos")+"px";if(!d&&this.last&&this.transitions[1]=="crossfade"){var d=this.last}if(d){a=d.x.get("loadingPosXfade")+"px";b=d.y.get("loadingPosXfade")+"px";this.loading.style.zIndex=hs.zIndexCounter++}setTimeout(function(){if(c.loading){hs.setStyles(c.loading,{left:a,top:b,zIndex:hs.zIndexCounter++})}},100)},imageCreate:function(){var b=this;var a=document.createElement("img");this.content=a;a.onload=function(){if(hs.expanders[b.key]){b.contentLoaded()}};if(hs.blockRightClick){a.oncontextmenu=function(){return false}}a.className="highslide-image";hs.setStyles(a,{visibility:"hidden",display:"block",position:"absolute",maxWidth:"9999px",zIndex:3});a.title=hs.lang.restoreTitle;if(hs.safari&&hs.uaVersion<525){hs.container.appendChild(a)}if(hs.ie&&hs.flushImgSize){a.src=null}a.src=this.src;this.showLoading()},htmlCreate:function(){if(!hs.fireEvent(this,"onBeforeGetContent")){return}this.content=hs.getCacheBinding(this.a);if(!this.content){this.content=hs.getNode(this.contentId)}if(!this.content){this.content=hs.getSelfRendered()}this.getInline(["maincontent"]);if(this.maincontent){var a=hs.getElementByClass(this.content,"div","highslide-body");if(a){a.appendChild(this.maincontent)}this.maincontent.style.display="block"}hs.fireEvent(this,"onAfterGetContent");var d=this.innerContent=this.content;if(/(swf|iframe)/.test(this.objectType)){this.setObjContainerSize(d)}hs.container.appendChild(this.wrapper);hs.setStyles(this.wrapper,{position:"static",padding:"0 "+hs.marginRight+"px 0 "+hs.marginLeft+"px"});this.content=hs.createElement("div",{className:"highslide-html"},{position:"relative",zIndex:3,height:0,overflow:"hidden"},this.wrapper);this.mediumContent=hs.createElement("div",null,null,this.content,1);this.mediumContent.appendChild(d);hs.setStyles(d,{position:"relative",display:"block",direction:hs.lang.cssDirection||""});if(this.width){d.style.width=this.width+"px"}if(this.height){hs.setStyles(d,{height:this.height+"px",overflow:"hidden"})}if(d.offsetWidth<this.minWidth){d.style.width=this.minWidth+"px"}if(this.objectType=="ajax"&&!hs.getCacheBinding(this.a)){this.showLoading();var c=this;var b=new hs.Ajax(this.a,d);b.src=this.src;b.onLoad=function(){if(hs.expanders[c.key]){c.contentLoaded()}};b.onError=function(){location.href=c.src};b.run()}else{if(this.objectType=="iframe"&&this.objectLoadTime=="before"){this.writeExtendedContent()}else{this.contentLoaded()}}},contentLoaded:function(){try{if(!this.content){return}this.content.onload=null;if(this.onLoadStarted){return}else{this.onLoadStarted=true}var j=this.x,g=this.y;if(this.loading){hs.setStyles(this.loading,{top:"-9999px"});this.loading=null;hs.fireEvent(this,"onHideLoading")}if(this.isImage){j.full=this.content.width;g.full=this.content.height;hs.setStyles(this.content,{width:j.t+"px",height:g.t+"px"});this.wrapper.appendChild(this.content);hs.container.appendChild(this.wrapper)}else{if(this.htmlGetSize){this.htmlGetSize()}}j.calcBorders();g.calcBorders();hs.setStyles(this.wrapper,{left:(j.tpos+j.tb-j.cb)+"px",top:(g.tpos+j.tb-g.cb)+"px"});this.initSlideshow();this.getOverlays();var f=j.full/g.full;j.calcExpanded();this.justify(j);g.calcExpanded();this.justify(g);if(this.isHtml){this.htmlSizeOperations()}if(this.overlayBox){this.sizeOverlayBox(0,1)}if(this.allowSizeReduction){if(this.isImage){this.correctRatio(f)}else{this.fitOverlayBox()}var k=this.slideshow;if(k&&this.last&&k.controls&&k.fixedControls){var h=k.overlayOptions.position||"",a;for(var c in hs.oPos){for(var b=0;b<5;b++){a=this[c];if(h.match(hs.oPos[c][b])){a.pos=this.last[c].pos+(this.last[c].p1-a.p1)+(this.last[c].size-a.size)*[0,0,0.5,1,1][b];if(k.fixedControls=="fit"){if(a.pos+a.size+a.p1+a.p2>a.scroll+a.clientSize-a.marginMax){a.pos=a.scroll+a.clientSize-a.size-a.marginMin-a.marginMax-a.p1-a.p2}if(a.pos<a.scroll+a.marginMin){a.pos=a.scroll+a.marginMin}}}}}}if(this.isImage&&this.x.full>(this.x.imgSize||this.x.size)){this.createFullExpand();if(this.overlays.length==1){this.sizeOverlayBox()}}}this.show()}catch(d){this.error(d)}},setObjContainerSize:function(a,d){var b=hs.getElementByClass(a,"DIV","highslide-body");if(/(iframe|swf)/.test(this.objectType)){if(this.objectWidth){b.style.width=this.objectWidth+"px"}if(this.objectHeight){b.style.height=this.objectHeight+"px"}}},writeExtendedContent:function(){if(this.hasExtendedContent){return}var f=this;this.body=hs.getElementByClass(this.innerContent,"DIV","highslide-body");if(this.objectType=="iframe"){this.showLoading();var g=hs.clearing.cloneNode(1);this.body.appendChild(g);this.newWidth=this.innerContent.offsetWidth;if(!this.objectWidth){this.objectWidth=g.offsetWidth}var c=this.innerContent.offsetHeight-this.body.offsetHeight,d=this.objectHeight||hs.page.height-c-hs.marginTop-hs.marginBottom,e=this.objectLoadTime=="before"?' onload="if (hs.expanders['+this.key+"]) hs.expanders["+this.key+'].contentLoaded()" ':"";this.body.innerHTML+='<iframe name="hs'+(new Date()).getTime()+'" frameborder="0" key="'+this.key+'"  style="width:'+this.objectWidth+"px; height:"+d+'px" '+e+' src="'+this.src+'" ></iframe>';this.ruler=this.body.getElementsByTagName("div")[0];this.iframe=this.body.getElementsByTagName("iframe")[0];if(this.objectLoadTime=="after"){this.correctIframeSize()}}if(this.objectType=="swf"){this.body.id=this.body.id||"hs-flash-id-"+this.key;var b=this.swfOptions;if(!b.params){b.params={}}if(typeof b.params.wmode=="undefined"){b.params.wmode="transparent"}if(swfobject){swfobject.embedSWF(this.src,this.body.id,this.objectWidth,this.objectHeight,b.version||"7",b.expressInstallSwfurl,b.flashvars,b.params,b.attributes)}}this.hasExtendedContent=true},htmlGetSize:function(){if(this.iframe&&!this.objectHeight){this.iframe.style.height=this.body.style.height=this.getIframePageHeight()+"px"}this.innerContent.appendChild(hs.clearing);if(!this.x.full){this.x.full=this.innerContent.offsetWidth}this.y.full=this.innerContent.offsetHeight;this.innerContent.removeChild(hs.clearing);if(hs.ie&&this.newHeight>parseInt(this.innerContent.currentStyle.height)){this.newHeight=parseInt(this.innerContent.currentStyle.height)}hs.setStyles(this.wrapper,{position:"absolute",padding:"0"});hs.setStyles(this.content,{width:this.x.t+"px",height:this.y.t+"px"})},getIframePageHeight:function(){var a;try{var d=this.iDoc=this.iframe.contentDocument||this.iframe.contentWindow.document;var b=d.createElement("div");b.style.clear="both";d.body.appendChild(b);a=b.offsetTop;if(hs.ie){a+=parseInt(d.body.currentStyle.marginTop)+parseInt(d.body.currentStyle.marginBottom)-1}}catch(c){a=300}return a},correctIframeSize:function(){var b=this.innerContent.offsetWidth-this.ruler.offsetWidth;hs.discardElement(this.ruler);if(b<0){b=0}var a=this.innerContent.offsetHeight-this.iframe.offsetHeight;if(this.iDoc&&!this.objectHeight&&!this.height&&this.y.size==this.y.full){try{this.iDoc.body.style.overflow="hidden"}catch(c){}}hs.setStyles(this.iframe,{width:Math.abs(this.x.size-b)+"px",height:Math.abs(this.y.size-a)+"px"});hs.setStyles(this.body,{width:this.iframe.style.width,height:this.iframe.style.height});this.scrollingContent=this.iframe;this.scrollerDiv=this.scrollingContent},htmlSizeOperations:function(){this.setObjContainerSize(this.innerContent);if(this.objectType=="swf"&&this.objectLoadTime=="before"){this.writeExtendedContent()}if(this.x.size<this.x.full&&!this.allowWidthReduction){this.x.size=this.x.full}if(this.y.size<this.y.full&&!this.allowHeightReduction){this.y.size=this.y.full}this.scrollerDiv=this.innerContent;hs.setStyles(this.mediumContent,{position:"relative",width:this.x.size+"px"});hs.setStyles(this.innerContent,{border:"none",width:"auto",height:"auto"});var e=hs.getElementByClass(this.innerContent,"DIV","highslide-body");if(e&&!/(iframe|swf)/.test(this.objectType)){var b=e;e=hs.createElement(b.nodeName,null,{overflow:"hidden"},null,true);b.parentNode.insertBefore(e,b);e.appendChild(hs.clearing);e.appendChild(b);var c=this.innerContent.offsetWidth-e.offsetWidth;var a=this.innerContent.offsetHeight-e.offsetHeight;e.removeChild(hs.clearing);var d=hs.safari||navigator.vendor=="KDE"?1:0;hs.setStyles(e,{width:(this.x.size-c-d)+"px",height:(this.y.size-a)+"px",overflow:"auto",position:"relative"});if(d&&b.offsetHeight>e.offsetHeight){e.style.width=(parseInt(e.style.width)+d)+"px"}this.scrollingContent=e;this.scrollerDiv=this.scrollingContent}if(this.iframe&&this.objectLoadTime=="before"){this.correctIframeSize()}if(!this.scrollingContent&&this.y.size<this.mediumContent.offsetHeight){this.scrollerDiv=this.content}if(this.scrollerDiv==this.content&&!this.allowWidthReduction&&!/(iframe|swf)/.test(this.objectType)){this.x.size+=17}if(this.scrollerDiv&&this.scrollerDiv.offsetHeight>this.scrollerDiv.parentNode.offsetHeight){setTimeout("try { hs.expanders["+this.key+"].scrollerDiv.style.overflow = 'auto'; } catch(e) {}",hs.expandDuration)}},getImageMapAreaCorrection:function(d){var h=d.coords.split(",");for(var b=0;b<h.length;b++){h[b]=parseInt(h[b])}if(d.shape.toLowerCase()=="circle"){this.x.tpos+=h[0]-h[2];this.y.tpos+=h[1]-h[2];this.x.t=this.y.t=2*h[2]}else{var f,e,a=f=h[0],g=e=h[1];for(var b=0;b<h.length;b++){if(b%2==0){a=Math.min(a,h[b]);f=Math.max(f,h[b])}else{g=Math.min(g,h[b]);e=Math.max(e,h[b])}}this.x.tpos+=a;this.x.t=f-a;this.y.tpos+=g;this.y.t=e-g}},justify:function(f,b){var g,h=f.target,e=f==this.x?"x":"y";if(h&&h.match(/ /)){g=h.split(" ");h=g[0]}if(h&&hs.$(h)){f.pos=hs.getPosition(hs.$(h))[e];if(g&&g[1]&&g[1].match(/^[-]?[0-9]+px$/)){f.pos+=parseInt(g[1])}if(f.size<f.minSize){f.size=f.minSize}}else{if(f.justify=="auto"||f.justify=="center"){var d=false;var a=f.exp.allowSizeReduction;if(f.justify=="center"){f.pos=Math.round(f.scroll+(f.clientSize+f.marginMin-f.marginMax-f.get("wsize"))/2)}else{f.pos=Math.round(f.pos-((f.get("wsize")-f.t)/2))}if(f.pos<f.scroll+f.marginMin){f.pos=f.scroll+f.marginMin;d=true}if(!b&&f.size<f.minSize){f.size=f.minSize;a=false}if(f.pos+f.get("wsize")>f.scroll+f.clientSize-f.marginMax){if(!b&&d&&a){f.size=Math.min(f.size,f.get(e=="y"?"fitsize":"maxsize"))}else{if(f.get("wsize")<f.get("fitsize")){f.pos=f.scroll+f.clientSize-f.marginMax-f.get("wsize")}else{f.pos=f.scroll+f.marginMin;if(!b&&a){f.size=f.get(e=="y"?"fitsize":"maxsize")}}}}if(!b&&f.size<f.minSize){f.size=f.minSize;a=false}}else{if(f.justify=="max"){f.pos=Math.floor(f.pos-f.size+f.t)}}}if(f.pos<f.marginMin){var c=f.pos;f.pos=f.marginMin;if(a&&!b){f.size=f.size-(f.pos-c)}}},correctRatio:function(c){var a=this.x,g=this.y,e=false,d=Math.min(a.full,a.size),b=Math.min(g.full,g.size),f=(this.useBox||hs.padToMinWidth);if(d/b>c){d=b*c;if(d<a.minSize){d=a.minSize;b=d/c}e=true}else{if(d/b<c){b=d/c;e=true}}if(hs.padToMinWidth&&a.full<a.minSize){a.imgSize=a.full;g.size=g.imgSize=g.full}else{if(this.useBox){a.imgSize=d;g.imgSize=b}else{a.size=d;g.size=b}}e=this.fitOverlayBox(this.useBox?null:c,e);if(f&&g.size<g.imgSize){g.imgSize=g.size;a.imgSize=g.size*c}if(e||f){a.pos=a.tpos-a.cb+a.tb;a.minSize=a.size;this.justify(a,true);g.pos=g.tpos-g.cb+g.tb;g.minSize=g.size;this.justify(g,true);if(this.overlayBox){this.sizeOverlayBox()}}},fitOverlayBox:function(b,c){var a=this.x,d=this.y;if(this.overlayBox&&(this.isImage||this.allowHeightReduction)){while(d.size>this.minHeight&&a.size>this.minWidth&&d.get("wsize")>d.get("fitsize")){d.size-=10;if(b){a.size=d.size*b}this.sizeOverlayBox(0,1);c=true}}return c},reflow:function(){if(this.scrollerDiv){var a=/iframe/i.test(this.scrollerDiv.tagName)?(this.getIframePageHeight()+1)+"px":"auto";if(this.body){this.body.style.height=a}this.scrollerDiv.style.height=a;this.y.setSize(this.innerContent.offsetHeight)}},show:function(){var a=this.x,b=this.y;this.doShowHide("hidden");hs.fireEvent(this,"onBeforeExpand");if(this.slideshow&&this.slideshow.thumbstrip){this.slideshow.thumbstrip.selectThumb()}this.changeSize(1,{wrapper:{width:a.get("wsize"),height:b.get("wsize"),left:a.pos,top:b.pos},content:{left:a.p1+a.get("imgPad"),top:b.p1+b.get("imgPad"),width:a.imgSize||a.size,height:b.imgSize||b.size}},hs.expandDuration)},changeSize:function(d,i,b){var k=this.transitions,e=d?(this.last?this.last.a:null):hs.upcoming,j=(k[1]&&e&&hs.getParam(e,"transitions")[1]==k[1])?k[1]:k[0];if(this[j]&&j!="expand"){this[j](d,i);return}if(this.outline&&!this.outlineWhileAnimating){if(d){this.outline.setPosition()}else{this.outline.destroy((this.isHtml&&this.preserveContent))}}if(!d){this.destroyOverlays()}var c=this,h=c.x,g=c.y,f=this.easing;if(!d){f=this.easingClose||f}var a=d?function(){if(c.outline){c.outline.table.style.visibility="visible"}setTimeout(function(){c.afterExpand()},50)}:function(){c.afterClose()};if(d){hs.setStyles(this.wrapper,{width:h.t+"px",height:g.t+"px"})}if(d&&this.isHtml){hs.setStyles(this.wrapper,{left:(h.tpos-h.cb+h.tb)+"px",top:(g.tpos-g.cb+g.tb)+"px"})}if(this.fadeInOut){hs.setStyles(this.wrapper,{opacity:d?0:1});hs.extend(i.wrapper,{opacity:d})}hs.animate(this.wrapper,i.wrapper,{duration:b,easing:f,step:function(n,l){if(c.outline&&c.outlineWhileAnimating&&l.prop=="top"){var m=d?l.pos:1-l.pos;var o={w:h.t+(h.get("wsize")-h.t)*m,h:g.t+(g.get("wsize")-g.t)*m,x:h.tpos+(h.pos-h.tpos)*m,y:g.tpos+(g.pos-g.tpos)*m};c.outline.setPosition(o,0,1)}if(c.isHtml){if(l.prop=="left"){c.mediumContent.style.left=(h.pos-n)+"px"}if(l.prop=="top"){c.mediumContent.style.top=(g.pos-n)+"px"}}}});hs.animate(this.content,i.content,b,f,a);if(d){this.wrapper.style.visibility="visible";this.content.style.visibility="visible";if(this.isHtml){this.innerContent.style.visibility="visible"}this.a.className+=" highslide-active-anchor"}},fade:function(f,h){this.outlineWhileAnimating=false;var c=this,j=f?hs.expandDuration:0;if(f){hs.animate(this.wrapper,h.wrapper,0);hs.setStyles(this.wrapper,{opacity:0,visibility:"visible"});hs.animate(this.content,h.content,0);this.content.style.visibility="visible";hs.animate(this.wrapper,{opacity:1},j,null,function(){c.afterExpand()})}if(this.outline){this.outline.table.style.zIndex=this.wrapper.style.zIndex;var b=f||-1,d=this.outline.offset,a=f?3:d,g=f?d:3;for(var e=a;b*e<=b*g;e+=b,j+=25){(function(){var i=f?g-e:a-e;setTimeout(function(){c.outline.setPosition(0,i,1)},j)})()}}if(f){}else{setTimeout(function(){if(c.outline){c.outline.destroy(c.preserveContent)}c.destroyOverlays();hs.animate(c.wrapper,{opacity:0},hs.restoreDuration,null,function(){c.afterClose()})},j)}},crossfade:function(g,m,o){if(!g){return}var f=this,p=this.last,l=this.x,k=this.y,d=p.x,b=p.y,a=this.wrapper,i=this.content,c=this.overlayBox;hs.removeEventListener(document,"mousemove",hs.dragHandler);hs.setStyles(i,{width:(l.imgSize||l.size)+"px",height:(k.imgSize||k.size)+"px"});if(c){c.style.overflow="visible"}this.outline=p.outline;if(this.outline){this.outline.exp=f}p.outline=null;var h=hs.createElement("div",{className:"highslide-"+this.contentType},{position:"absolute",zIndex:4,overflow:"hidden",display:"none"});var j={oldImg:p,newImg:this};for(var e in j){this[e]=j[e].content.cloneNode(1);hs.setStyles(this[e],{position:"absolute",border:0,visibility:"visible"});h.appendChild(this[e])}a.appendChild(h);if(this.isHtml){hs.setStyles(this.mediumContent,{left:0,top:0})}if(c){c.className="";a.appendChild(c)}h.style.display="";p.content.style.display="none";if(hs.safari&&hs.uaVersion<525){this.wrapper.style.visibility="visible"}hs.animate(a,{width:l.size},{duration:hs.transitionDuration,step:function(u,r){var x=r.pos,q=1-x;var w,s={},t=["pos","size","p1","p2"];for(var v in t){w=t[v];s["x"+w]=Math.round(q*d[w]+x*l[w]);s["y"+w]=Math.round(q*b[w]+x*k[w]);s.ximgSize=Math.round(q*(d.imgSize||d.size)+x*(l.imgSize||l.size));s.ximgPad=Math.round(q*d.get("imgPad")+x*l.get("imgPad"));s.yimgSize=Math.round(q*(b.imgSize||b.size)+x*(k.imgSize||k.size));s.yimgPad=Math.round(q*b.get("imgPad")+x*k.get("imgPad"))}if(f.outline){f.outline.setPosition({x:s.xpos,y:s.ypos,w:s.xsize+s.xp1+s.xp2+2*l.cb,h:s.ysize+s.yp1+s.yp2+2*k.cb})}p.wrapper.style.clip="rect("+(s.ypos-b.pos)+"px, "+(s.xsize+s.xp1+s.xp2+s.xpos+2*d.cb-d.pos)+"px, "+(s.ysize+s.yp1+s.yp2+s.ypos+2*b.cb-b.pos)+"px, "+(s.xpos-d.pos)+"px)";hs.setStyles(i,{top:(s.yp1+k.get("imgPad"))+"px",left:(s.xp1+l.get("imgPad"))+"px",marginTop:(k.pos-s.ypos)+"px",marginLeft:(l.pos-s.xpos)+"px"});hs.setStyles(a,{top:s.ypos+"px",left:s.xpos+"px",width:(s.xp1+s.xp2+s.xsize+2*l.cb)+"px",height:(s.yp1+s.yp2+s.ysize+2*k.cb)+"px"});hs.setStyles(h,{width:(s.ximgSize||s.xsize)+"px",height:(s.yimgSize||s.ysize)+"px",left:(s.xp1+s.ximgPad)+"px",top:(s.yp1+s.yimgPad)+"px",visibility:"visible"});hs.setStyles(f.oldImg,{top:(b.pos-s.ypos+b.p1-s.yp1+b.get("imgPad")-s.yimgPad)+"px",left:(d.pos-s.xpos+d.p1-s.xp1+d.get("imgPad")-s.ximgPad)+"px"});hs.setStyles(f.newImg,{opacity:x,top:(k.pos-s.ypos+k.p1-s.yp1+k.get("imgPad")-s.yimgPad)+"px",left:(l.pos-s.xpos+l.p1-s.xp1+l.get("imgPad")-s.ximgPad)+"px"});if(c){hs.setStyles(c,{width:s.xsize+"px",height:s.ysize+"px",left:(s.xp1+l.cb)+"px",top:(s.yp1+k.cb)+"px"})}},complete:function(){a.style.visibility=i.style.visibility="visible";i.style.display="block";hs.discardElement(h);f.afterExpand();p.afterClose();f.last=null}})},reuseOverlay:function(d,c){if(!this.last){return false}for(var b=0;b<this.last.overlays.length;b++){var a=hs.$("hsId"+this.last.overlays[b]);if(a&&a.hsId==d.hsId){this.genOverlayBox();a.reuse=this.key;hs.push(this.overlays,this.last.overlays[b]);return true}}return false},afterExpand:function(){this.isExpanded=true;this.focus();if(this.isHtml&&this.objectLoadTime=="after"){this.writeExtendedContent()}if(this.iframe){try{var g=this,f=this.iframe.contentDocument||this.iframe.contentWindow.document;hs.addEventListener(f,"mousedown",function(){if(hs.focusKey!=g.key){g.focus()}})}catch(d){}if(hs.ie&&typeof this.isClosing!="boolean"){this.iframe.style.width=(this.objectWidth-1)+"px"}}if(this.dimmingOpacity){hs.dim(this)}if(hs.upcoming&&hs.upcoming==this.a){hs.upcoming=null}this.prepareNextOutline();var c=hs.page,b=hs.mouse.x+c.scrollLeft,a=hs.mouse.y+c.scrollTop;this.mouseIsOver=this.x.pos<b&&b<this.x.pos+this.x.get("wsize")&&this.y.pos<a&&a<this.y.pos+this.y.get("wsize");if(this.overlayBox){this.showOverlays()}hs.fireEvent(this,"onAfterExpand")},prepareNextOutline:function(){var a=this.key;var b=this.outlineType;new hs.Outline(b,function(){try{hs.expanders[a].preloadNext()}catch(c){}})},preloadNext:function(){var b=this.getAdjacentAnchor(1);if(b&&b.onclick.toString().match(/hs\.expand/)){var a=hs.createElement("img",{src:hs.getSrc(b)})}},getAdjacentAnchor:function(c){var b=this.getAnchorIndex(),a=hs.anchors.groups[this.slideshowGroup||"none"];if(a&&!a[b+c]&&this.slideshow&&this.slideshow.repeat){if(c==1){return a[0]}else{if(c==-1){return a[a.length-1]}}}return(a&&a[b+c])||null},getAnchorIndex:function(){var a=hs.getAnchors().groups[this.slideshowGroup||"none"];if(a){for(var b=0;b<a.length;b++){if(a[b]==this.a){return b}}}return null},getNumber:function(){if(this[this.numberPosition]){var a=hs.anchors.groups[this.slideshowGroup||"none"];if(a){var b=hs.lang.number.replace("%1",this.getAnchorIndex()+1).replace("%2",a.length);this[this.numberPosition].innerHTML='<div class="highslide-number">'+b+"</div>"+this[this.numberPosition].innerHTML}}},initSlideshow:function(){if(!this.last){for(var c=0;c<hs.slideshows.length;c++){var b=hs.slideshows[c],d=b.slideshowGroup;if(typeof d=="undefined"||d===null||d===this.slideshowGroup){this.slideshow=new hs.Slideshow(this.key,b)}}}else{this.slideshow=this.last.slideshow}var b=this.slideshow;if(!b){return}var a=b.expKey=this.key;b.checkFirstAndLast();b.disable("full-expand");if(b.controls){this.createOverlay(hs.extend(b.overlayOptions||{},{overlayId:b.controls,hsId:"controls",zIndex:5}))}if(b.thumbstrip){b.thumbstrip.add(this)}if(!this.last&&this.autoplay){b.play(true)}if(b.autoplay){b.autoplay=setTimeout(function(){hs.next(a)},(b.interval||500))}},cancelLoading:function(){hs.discardElement(this.wrapper);hs.expanders[this.key]=null;if(hs.upcoming==this.a){hs.upcoming=null}hs.undim(this.key);if(this.loading){hs.loading.style.left="-9999px"}hs.fireEvent(this,"onHideLoading")},writeCredits:function(){if(this.credits){return}this.credits=hs.createElement("a",{href:hs.creditsHref,target:hs.creditsTarget,className:"highslide-credits",innerHTML:hs.lang.creditsText,title:hs.lang.creditsTitle});this.createOverlay({overlayId:this.credits,position:this.creditsPosition||"top left",hsId:"credits"})},getInline:function(types,addOverlay){for(var i=0;i<types.length;i++){var type=types[i],s=null;if(type=="caption"&&!hs.fireEvent(this,"onBeforeGetCaption")){return}else{if(type=="heading"&&!hs.fireEvent(this,"onBeforeGetHeading")){return}}if(!this[type+"Id"]&&this.thumbsUserSetId){this[type+"Id"]=type+"-for-"+this.thumbsUserSetId}if(this[type+"Id"]){this[type]=hs.getNode(this[type+"Id"])}if(!this[type]&&!this[type+"Text"]&&this[type+"Eval"]){try{s=eval(this[type+"Eval"])}catch(e){}}if(!this[type]&&this[type+"Text"]){s=this[type+"Text"]}if(!this[type]&&!s){this[type]=hs.getNode(this.a["_"+type+"Id"]);if(!this[type]){var next=this.a.nextSibling;while(next&&!hs.isHsAnchor(next)){if((new RegExp("highslide-"+type)).test(next.className||null)){if(!next.id){this.a["_"+type+"Id"]=next.id="hsId"+hs.idCounter++}this[type]=hs.getNode(next.id);break}next=next.nextSibling}}}if(!this[type]&&!s&&this.numberPosition==type){s="\n"}if(!this[type]&&s){this[type]=hs.createElement("div",{className:"highslide-"+type,innerHTML:s})}if(addOverlay&&this[type]){var o={position:(type=="heading")?"above":"below"};for(var x in this[type+"Overlay"]){o[x]=this[type+"Overlay"][x]}o.overlayId=this[type];this.createOverlay(o)}}},doShowHide:function(a){if(hs.hideSelects){this.showHideElements("SELECT",a)}if(hs.hideIframes){this.showHideElements("IFRAME",a)}if(hs.geckoMac){this.showHideElements("*",a)}},showHideElements:function(c,b){var e=document.getElementsByTagName(c);var a=c=="*"?"overflow":"visibility";for(var f=0;f<e.length;f++){if(a=="visibility"||(document.defaultView.getComputedStyle(e[f],"").getPropertyValue("overflow")=="auto"||e[f].getAttribute("hidden-by")!=null)){var h=e[f].getAttribute("hidden-by");if(b=="visible"&&h){h=h.replace("["+this.key+"]","");e[f].setAttribute("hidden-by",h);if(!h){e[f].style[a]=e[f].origProp}}else{if(b=="hidden"){var k=hs.getPosition(e[f]);k.w=e[f].offsetWidth;k.h=e[f].offsetHeight;if(!this.dimmingOpacity){var j=(k.x+k.w<this.x.get("opos")||k.x>this.x.get("opos")+this.x.get("osize"));var g=(k.y+k.h<this.y.get("opos")||k.y>this.y.get("opos")+this.y.get("osize"))}var d=hs.getWrapperKey(e[f]);if(!j&&!g&&d!=this.key){if(!h){e[f].setAttribute("hidden-by","["+this.key+"]");e[f].origProp=e[f].style[a];e[f].style[a]="hidden"}else{if(h.indexOf("["+this.key+"]")==-1){e[f].setAttribute("hidden-by",h+"["+this.key+"]")}}}else{if((h=="["+this.key+"]"||hs.focusKey==d)&&d!=this.key){e[f].setAttribute("hidden-by","");e[f].style[a]=e[f].origProp||""}else{if(h&&h.indexOf("["+this.key+"]")>-1){e[f].setAttribute("hidden-by",h.replace("["+this.key+"]",""))}}}}}}}},focus:function(){this.wrapper.style.zIndex=hs.zIndexCounter+=2;for(var a=0;a<hs.expanders.length;a++){if(hs.expanders[a]&&a==hs.focusKey){var b=hs.expanders[a];b.content.className+=" highslide-"+b.contentType+"-blur";if(b.isImage){b.content.style.cursor=hs.ieLt7?"hand":"pointer";b.content.title=hs.lang.focusTitle}hs.fireEvent(b,"onBlur")}}if(this.outline){this.outline.table.style.zIndex=this.wrapper.style.zIndex-1}this.content.className="highslide-"+this.contentType;if(this.isImage){this.content.title=hs.lang.restoreTitle;if(hs.restoreCursor){hs.styleRestoreCursor=window.opera?"pointer":"url("+hs.graphicsDir+hs.restoreCursor+"), pointer";if(hs.ieLt7&&hs.uaVersion<6){hs.styleRestoreCursor="hand"}this.content.style.cursor=hs.styleRestoreCursor}}hs.focusKey=this.key;hs.addEventListener(document,window.opera?"keypress":"keydown",hs.keyHandler);hs.fireEvent(this,"onFocus")},moveTo:function(a,b){this.x.setPos(a);this.y.setPos(b)},resize:function(d){var a,b,c=d.width/d.height;a=Math.max(d.width+d.dX,Math.min(this.minWidth,this.x.full));if(this.isImage&&Math.abs(a-this.x.full)<12){a=this.x.full}b=this.isHtml?d.height+d.dY:a/c;if(b<Math.min(this.minHeight,this.y.full)){b=Math.min(this.minHeight,this.y.full);if(this.isImage){a=b*c}}this.resizeTo(a,b)},resizeTo:function(a,b){this.y.setSize(b);this.x.setSize(a);this.wrapper.style.height=this.y.get("wsize")+"px"},close:function(){if(this.isClosing||!this.isExpanded){return}if(this.transitions[1]=="crossfade"&&hs.upcoming){hs.getExpander(hs.upcoming).cancelLoading();hs.upcoming=null}if(!hs.fireEvent(this,"onBeforeClose")){return}this.isClosing=true;if(this.slideshow&&!hs.upcoming){this.slideshow.pause()}hs.removeEventListener(document,window.opera?"keypress":"keydown",hs.keyHandler);try{if(this.isHtml){this.htmlPrepareClose()}this.content.style.cursor="default";this.changeSize(0,{wrapper:{width:this.x.t,height:this.y.t,left:this.x.tpos-this.x.cb+this.x.tb,top:this.y.tpos-this.y.cb+this.y.tb},content:{left:0,top:0,width:this.x.t,height:this.y.t}},hs.restoreDuration)}catch(a){this.afterClose()}},htmlPrepareClose:function(){if(hs.geckoMac){if(!hs.mask){hs.mask=hs.createElement("div",null,{position:"absolute"},hs.container)}hs.setStyles(hs.mask,{width:this.x.size+"px",height:this.y.size+"px",left:this.x.pos+"px",top:this.y.pos+"px",display:"block"})}if(this.objectType=="swf"){try{hs.$(this.body.id).StopPlay()}catch(a){}}if(this.objectLoadTime=="after"&&!this.preserveContent){this.destroyObject()}if(this.scrollerDiv&&this.scrollerDiv!=this.scrollingContent){this.scrollerDiv.style.overflow="hidden"}},destroyObject:function(){if(hs.ie&&this.iframe){try{this.iframe.contentWindow.document.body.innerHTML=""}catch(a){}}if(this.objectType=="swf"){swfobject.removeSWF(this.body.id)}this.body.innerHTML=""},sleep:function(){if(this.outline){this.outline.table.style.display="none"}this.releaseMask=null;this.wrapper.style.display="none";this.isExpanded=false;hs.push(hs.sleeping,this)},awake:function(){try{hs.expanders[this.key]=this;if(!hs.allowMultipleInstances&&hs.focusKey!=this.key){try{hs.expanders[hs.focusKey].close()}catch(b){}}var d=hs.zIndexCounter++,a={display:"",zIndex:d};hs.setStyles(this.wrapper,a);this.isClosing=false;var c=this.outline||0;if(c){if(!this.outlineWhileAnimating){a.visibility="hidden"}hs.setStyles(c.table,a)}if(this.slideshow){this.initSlideshow()}this.show()}catch(b){}},createOverlay:function(e){var d=e.overlayId,a=(e.relativeTo=="viewport"&&!/panel$/.test(e.position));if(typeof d=="string"){d=hs.getNode(d)}if(e.html){d=hs.createElement("div",{innerHTML:e.html})}if(!d||typeof d=="string"){return}if(!hs.fireEvent(this,"onCreateOverlay",{overlay:d})){return}d.style.display="block";e.hsId=e.hsId||e.overlayId;if(this.transitions[1]=="crossfade"&&this.reuseOverlay(e,d)){return}this.genOverlayBox();var c=e.width&&/^[0-9]+(px|%)$/.test(e.width)?e.width:"auto";if(/^(left|right)panel$/.test(e.position)&&!/^[0-9]+px$/.test(e.width)){c="200px"}var b=hs.createElement("div",{id:"hsId"+hs.idCounter++,hsId:e.hsId},{position:"absolute",visibility:"hidden",width:c,direction:hs.lang.cssDirection||"",opacity:0},a?hs.viewport:this.overlayBox,true);if(a){b.hsKey=this.key}b.appendChild(d);hs.extend(b,{opacity:1,offsetX:0,offsetY:0,dur:(e.fade===0||e.fade===false||(e.fade==2&&hs.ie))?0:250});hs.extend(b,e);if(this.gotOverlays){this.positionOverlay(b);if(!b.hideOnMouseOut||this.mouseIsOver){hs.animate(b,{opacity:b.opacity},b.dur)}}hs.push(this.overlays,hs.idCounter-1)},positionOverlay:function(e){var f=e.position||"middle center",c=(e.relativeTo=="viewport"),b=e.offsetX,a=e.offsetY;if(c){hs.viewport.style.display="block";e.hsKey=this.key;if(e.offsetWidth>e.parentNode.offsetWidth){e.style.width="100%"}}else{if(e.parentNode!=this.overlayBox){this.overlayBox.appendChild(e)}}if(/left$/.test(f)){e.style.left=b+"px"}if(/center$/.test(f)){hs.setStyles(e,{left:"50%",marginLeft:(b-Math.round(e.offsetWidth/2))+"px"})}if(/right$/.test(f)){e.style.right=-b+"px"}if(/^leftpanel$/.test(f)){hs.setStyles(e,{right:"100%",marginRight:this.x.cb+"px",top:-this.y.cb+"px",bottom:-this.y.cb+"px",overflow:"auto"});this.x.p1=e.offsetWidth}else{if(/^rightpanel$/.test(f)){hs.setStyles(e,{left:"100%",marginLeft:this.x.cb+"px",top:-this.y.cb+"px",bottom:-this.y.cb+"px",overflow:"auto"});this.x.p2=e.offsetWidth}}var d=e.parentNode.offsetHeight;e.style.height="auto";if(c&&e.offsetHeight>d){e.style.height=hs.ieLt7?d+"px":"100%"}if(/^top/.test(f)){e.style.top=a+"px"}if(/^middle/.test(f)){hs.setStyles(e,{top:"50%",marginTop:(a-Math.round(e.offsetHeight/2))+"px"})}if(/^bottom/.test(f)){e.style.bottom=-a+"px"}if(/^above$/.test(f)){hs.setStyles(e,{left:(-this.x.p1-this.x.cb)+"px",right:(-this.x.p2-this.x.cb)+"px",bottom:"100%",marginBottom:this.y.cb+"px",width:"auto"});this.y.p1=e.offsetHeight}else{if(/^below$/.test(f)){hs.setStyles(e,{position:"relative",left:(-this.x.p1-this.x.cb)+"px",right:(-this.x.p2-this.x.cb)+"px",top:"100%",marginTop:this.y.cb+"px",width:"auto"});this.y.p2=e.offsetHeight;e.style.position="absolute"}}},getOverlays:function(){this.getInline(["heading","caption"],true);this.getNumber();if(this.caption){hs.fireEvent(this,"onAfterGetCaption")}if(this.heading){hs.fireEvent(this,"onAfterGetHeading")}if(this.heading&&this.dragByHeading){this.heading.className+=" highslide-move"}if(hs.showCredits){this.writeCredits()}for(var a=0;a<hs.overlays.length;a++){var d=hs.overlays[a],e=d.thumbnailId,b=d.slideshowGroup;if((!e&&!b)||(e&&e==this.thumbsUserSetId)||(b&&b===this.slideshowGroup)){if(this.isImage||(this.isHtml&&d.useOnHtml)){this.createOverlay(d)}}}var c=[];for(var a=0;a<this.overlays.length;a++){var d=hs.$("hsId"+this.overlays[a]);if(/panel$/.test(d.position)){this.positionOverlay(d)}else{hs.push(c,d)}}for(var a=0;a<c.length;a++){this.positionOverlay(c[a])}this.gotOverlays=true},genOverlayBox:function(){if(!this.overlayBox){this.overlayBox=hs.createElement("div",{className:this.wrapperClassName},{position:"absolute",width:(this.x.size||(this.useBox?this.width:null)||this.x.full)+"px",height:(this.y.size||this.y.full)+"px",visibility:"hidden",overflow:"hidden",zIndex:hs.ie?4:"auto"},hs.container,true)}},sizeOverlayBox:function(f,d){var c=this.overlayBox,a=this.x,h=this.y;hs.setStyles(c,{width:a.size+"px",height:h.size+"px"});if(f||d){for(var e=0;e<this.overlays.length;e++){var g=hs.$("hsId"+this.overlays[e]);var b=(hs.ieLt7||document.compatMode=="BackCompat");if(g&&/^(above|below)$/.test(g.position)){if(b){g.style.width=(c.offsetWidth+2*a.cb+a.p1+a.p2)+"px"}h[g.position=="above"?"p1":"p2"]=g.offsetHeight}if(g&&b&&/^(left|right)panel$/.test(g.position)){g.style.height=(c.offsetHeight+2*h.cb)+"px"}}}if(f){hs.setStyles(this.content,{top:h.p1+"px"});hs.setStyles(c,{top:(h.p1+h.cb)+"px"})}},showOverlays:function(){var a=this.overlayBox;a.className="";hs.setStyles(a,{top:(this.y.p1+this.y.cb)+"px",left:(this.x.p1+this.x.cb)+"px",overflow:"visible"});if(hs.safari){a.style.visibility="visible"}this.wrapper.appendChild(a);for(var c=0;c<this.overlays.length;c++){var d=hs.$("hsId"+this.overlays[c]);d.style.zIndex=d.zIndex||4;if(!d.hideOnMouseOut||this.mouseIsOver){d.style.visibility="visible";hs.setStyles(d,{visibility:"visible",display:""});hs.animate(d,{opacity:d.opacity},d.dur)}}},destroyOverlays:function(){if(!this.overlays.length){return}if(this.slideshow){var d=this.slideshow.controls;if(d&&hs.getExpander(d)==this){d.parentNode.removeChild(d)}}for(var a=0;a<this.overlays.length;a++){var b=hs.$("hsId"+this.overlays[a]);if(b&&b.parentNode==hs.viewport&&hs.getExpander(b)==this){hs.discardElement(b)}}if(this.isHtml&&this.preserveContent){this.overlayBox.style.top="-9999px";hs.container.appendChild(this.overlayBox)}else{hs.discardElement(this.overlayBox)}},createFullExpand:function(){if(this.slideshow&&this.slideshow.controls){this.slideshow.enable("full-expand");return}this.fullExpandLabel=hs.createElement("a",{href:"javascript:hs.expanders["+this.key+"].doFullExpand();",title:hs.lang.fullExpandTitle,className:"highslide-full-expand"});if(!hs.fireEvent(this,"onCreateFullExpand")){return}this.createOverlay({overlayId:this.fullExpandLabel,position:hs.fullExpandPosition,hideOnMouseOut:true,opacity:hs.fullExpandOpacity})},doFullExpand:function(){try{if(!hs.fireEvent(this,"onDoFullExpand")){return}if(this.fullExpandLabel){hs.discardElement(this.fullExpandLabel)}this.focus();var c=this.x.size,a=this.y.size;this.resizeTo(this.x.full,this.y.full);var b=this.x.pos-(this.x.size-c)/2;if(b<hs.marginLeft){b=hs.marginLeft}var f=this.y.pos-(this.y.size-a)/2;if(f<hs.marginTop){f=hs.marginTop}this.moveTo(b,f);this.doShowHide("hidden")}catch(d){this.error(d)}},afterClose:function(){this.a.className=this.a.className.replace("highslide-active-anchor","");this.doShowHide("visible");if(this.isHtml&&this.preserveContent&&this.transitions[1]!="crossfade"){this.sleep()}else{if(this.outline&&this.outlineWhileAnimating){this.outline.destroy()}hs.discardElement(this.wrapper)}if(hs.mask){hs.mask.style.display="none"}this.destroyOverlays();if(!hs.viewport.childNodes.length){hs.viewport.style.display="none"}if(this.dimmingOpacity){hs.undim(this.key)}hs.fireEvent(this,"onAfterClose");hs.expanders[this.key]=null;hs.reOrder()}};hs.Ajax=function(b,c,d){this.a=b;this.content=c;this.pre=d};hs.Ajax.prototype={run:function(){var d;if(!this.src){this.src=hs.getSrc(this.a)}if(this.src.match("#")){var a=this.src.split("#");this.src=a[0];this.id=a[1]}if(hs.cachedGets[this.src]){this.cachedGet=hs.cachedGets[this.src];if(this.id){this.getElementContent()}else{this.loadHTML()}return}try{d=new XMLHttpRequest()}catch(b){try{d=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{d=new ActiveXObject("Microsoft.XMLHTTP")}catch(b){this.onError()}}}var f=this;d.onreadystatechange=function(){if(f.xhr.readyState==4){if(f.id){f.getElementContent()}else{f.loadHTML()}}};var c=this.src;this.xhr=d;if(hs.forceAjaxReload){c=c.replace(/$/,(/\?/.test(c)?"&":"?")+"dummy="+(new Date()).getTime())}d.open("GET",c,true);d.setRequestHeader("X-Requested-With","XMLHttpRequest");d.setRequestHeader("Content-Type","application/x-www-form-urlencoded");d.send(null)},getElementContent:function(){hs.init();var a=window.opera||hs.ie6SSL?{src:"about:blank"}:null;this.iframe=hs.createElement("iframe",a,{position:"absolute",top:"-9999px"},hs.container);this.loadHTML()},loadHTML:function(){var c=this.cachedGet||this.xhr.responseText,b;if(this.pre){hs.cachedGets[this.src]=c}if(!hs.ie||hs.uaVersion>=5.5){c=c.replace(new RegExp("<link[^>]*>","gi"),"").replace(new RegExp("<script[^>]*>.*?<\/script>","gi"),"");if(this.iframe){var f=this.iframe.contentDocument;if(!f&&this.iframe.contentWindow){f=this.iframe.contentWindow.document}if(!f){var g=this;setTimeout(function(){g.loadHTML()},25);return}f.open();f.write(c);f.close();try{c=f.getElementById(this.id).innerHTML}catch(d){try{c=this.iframe.document.getElementById(this.id).innerHTML}catch(d){}}hs.discardElement(this.iframe)}else{b=/(<body[^>]*>|<\/body>)/ig;if(b.test(c)){c=c.split(b)[hs.ieLt9?1:2]}}}hs.getElementByClass(this.content,"DIV","highslide-body").innerHTML=c;this.onLoad();for(var a in this){this[a]=null}}};hs.Slideshow=function(c,b){if(hs.dynamicallyUpdateAnchors!==false){hs.updateAnchors()}this.expKey=c;for(var a in b){this[a]=b[a]}if(this.useControls){this.getControls()}if(this.thumbstrip){this.thumbstrip=hs.Thumbstrip(this)}};hs.Slideshow.prototype={getControls:function(){this.controls=hs.createElement("div",{innerHTML:hs.replaceLang(hs.skin.controls)},null,hs.container);var b=["play","pause","previous","next","move","full-expand","close"];this.btn={};var c=this;for(var a=0;a<b.length;a++){this.btn[b[a]]=hs.getElementByClass(this.controls,"li","highslide-"+b[a]);this.enable(b[a])}this.btn.pause.style.display="none"},checkFirstAndLast:function(){if(this.repeat||!this.controls){return}var c=hs.expanders[this.expKey],b=c.getAnchorIndex(),a=/disabled$/;if(b==0){this.disable("previous")}else{if(a.test(this.btn.previous.getElementsByTagName("a")[0].className)){this.enable("previous")}}if(b+1==hs.anchors.groups[c.slideshowGroup||"none"].length){this.disable("next");this.disable("play")}else{if(a.test(this.btn.next.getElementsByTagName("a")[0].className)){this.enable("next");this.enable("play")}}},enable:function(d){if(!this.btn){return}var c=this,b=this.btn[d].getElementsByTagName("a")[0],e=/disabled$/;b.onclick=function(){c[d]();return false};if(e.test(b.className)){b.className=b.className.replace(e,"")}},disable:function(c){if(!this.btn){return}var b=this.btn[c].getElementsByTagName("a")[0];b.onclick=function(){return false};if(!/disabled$/.test(b.className)){b.className+=" disabled"}},hitSpace:function(){if(this.autoplay){this.pause()}else{this.play()}},play:function(a){if(this.btn){this.btn.play.style.display="none";this.btn.pause.style.display=""}this.autoplay=true;if(!a){hs.next(this.expKey)}},pause:function(){if(this.btn){this.btn.pause.style.display="none";this.btn.play.style.display=""}clearTimeout(this.autoplay);this.autoplay=null},previous:function(){this.pause();hs.previous(this.btn.previous)},next:function(){this.pause();hs.next(this.btn.next)},move:function(){},"full-expand":function(){hs.getExpander().doFullExpand()},close:function(){hs.close(this.btn.close)}};hs.Thumbstrip=function(k){function p(i){hs.extend(f||{},{overlayId:r,hsId:"thumbstrip",className:"highslide-thumbstrip-"+m+"-overlay "+(f.className||"")});if(hs.ieLt7){f.fade=0}i.createOverlay(f);hs.setStyles(r.parentNode,{overflow:"hidden"})}function c(i){d(undefined,Math.round(i*r[h?"offsetWidth":"offsetHeight"]*0.7))}function d(L,M){if(L===undefined){for(var K=0;K<j.length;K++){if(j[K]==hs.expanders[k.expKey].a){L=K;break}}}if(L===undefined){return}var G=r.getElementsByTagName("a"),z=G[L],w=z.parentNode,y=h?"Left":"Top",N=h?"Right":"Bottom",I=h?"Width":"Height",B="offset"+y,H="offset"+I,x=n.parentNode.parentNode[H],F=x-s[H],v=parseInt(s.style[h?"left":"top"])||0,C=v,D=20;if(M!==undefined){C=v-M;if(F>0){F=0}if(C>0){C=0}if(C<F){C=F}}else{for(var K=0;K<G.length;K++){G[K].className=""}z.className="highslide-active-anchor";var J=L>0?G[L-1].parentNode[B]:w[B],A=w[B]+w[H]+(G[L+1]?G[L+1].parentNode[H]:0);if(A>x-v){C=x-A}else{if(J<-v){C=-J}}}var E=w[B]+(w[H]-g[H])/2+C;hs.animate(s,h?{left:C}:{top:C},null,"easeOutQuad");hs.animate(g,h?{left:E}:{top:E},null,"easeOutQuad");l.style.display=C<0?"block":"none";t.style.display=(C>F)?"block":"none"}var j=hs.anchors.groups[hs.expanders[k.expKey].slideshowGroup||"none"],f=k.thumbstrip,m=f.mode||"horizontal",u=(m=="float"),o=u?["div","ul","li","span"]:["table","tbody","tr","td"],h=(m=="horizontal"),r=hs.createElement("div",{className:"highslide-thumbstrip highslide-thumbstrip-"+m,innerHTML:'<div class="highslide-thumbstrip-inner"><'+o[0]+"><"+o[1]+"></"+o[1]+"></"+o[0]+'></div><div class="highslide-scroll-up"><div></div></div><div class="highslide-scroll-down"><div></div></div><div class="highslide-marker"><div></div></div>'},{display:"none"},hs.container),e=r.childNodes,n=e[0],l=e[1],t=e[2],g=e[3],s=n.firstChild,a=r.getElementsByTagName(o[1])[0],b;for(var q=0;q<j.length;q++){if(q==0||!h){b=hs.createElement(o[2],null,null,a)}(function(){var v=j[q],i=hs.createElement(o[3],null,null,b),w=q;hs.createElement("a",{href:v.href,title:v.title,onclick:function(){if(/highslide-active-anchor/.test(this.className)){return false}hs.getExpander(this).focus();return hs.transit(v)},innerHTML:hs.stripItemFormatter?hs.stripItemFormatter(v):v.innerHTML},null,i)})()}if(!u){l.onclick=function(){c(-1)};t.onclick=function(){c(1)};hs.addEventListener(a,document.onmousewheel!==undefined?"mousewheel":"DOMMouseScroll",function(i){var v=0;i=i||window.event;if(i.wheelDelta){v=i.wheelDelta/120;if(hs.opera){v=-v}}else{if(i.detail){v=-i.detail/3}}if(v){c(-v*0.2)}if(i.preventDefault){i.preventDefault()}i.returnValue=false})}return{add:p,selectThumb:d}};hs.langDefaults=hs.lang;var HsExpander=hs.Expander;if(hs.ie&&window==window.top){(function(){try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,50);return}hs.ready()})()}hs.addEventListener(document,"DOMContentLoaded",hs.ready);hs.addEventListener(window,"load",hs.ready);hs.addEventListener(document,"ready",function(){if(hs.expandCursor||hs.dimmingOpacity){var d=hs.createElement("style",{type:"text/css"},null,document.getElementsByTagName("HEAD")[0]),c=document.compatMode=="BackCompat";function b(f,g){if(hs.ie&&(hs.uaVersion<9||c)){var e=document.styleSheets[document.styleSheets.length-1];if(typeof(e.addRule)=="object"){e.addRule(f,g)}}else{d.appendChild(document.createTextNode(f+" {"+g+"}"))}}function a(e){return"expression( ( ( ignoreMe = document.documentElement."+e+" ? document.documentElement."+e+" : document.body."+e+" ) ) + 'px' );"}if(hs.expandCursor){b(".highslide img","cursor: url("+hs.graphicsDir+hs.expandCursor+"), pointer !important;")}b(".highslide-viewport-size",hs.ie&&(hs.uaVersion<7||c)?"position: absolute; left:"+a("scrollLeft")+"top:"+a("scrollTop")+"width:"+a("clientWidth")+"height:"+a("clientHeight"):"position: fixed; width: 100%; height: 100%; left: 0; top: 0")}});hs.addEventListener(window,"resize",function(){hs.getPageSize();if(hs.viewport){for(var a=0;a<hs.viewport.childNodes.length;a++){var b=hs.viewport.childNodes[a],c=hs.getExpander(b);c.positionOverlay(b);if(b.hsId=="thumbstrip"){c.slideshow.thumbstrip.selectThumb()}}}});hs.addEventListener(document,"mousemove",function(a){hs.mouse={x:a.clientX,y:a.clientY}});hs.addEventListener(document,"mousedown",hs.mouseClickHandler);hs.addEventListener(document,"mouseup",hs.mouseClickHandler);hs.addEventListener(document,"ready",hs.setClickEvents);hs.addEventListener(window,"load",hs.preloadImages);hs.addEventListener(window,"load",hs.preloadAjax)};
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide-full.packed.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide-full.packed.js
new file mode 100644
index 0000000000000000000000000000000000000000..9419d2ed262e6b6577bff5fa89af7f26360e91f5
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide-full.packed.js
@@ -0,0 +1,9 @@
+/** 
+ * Name:    Highslide JS
+ * Version: 4.1.13 (2011-10-06)
+ * Config:  default +events +unobtrusive +imagemap +slideshow +positioning +transitions +viewport +thumbstrip +inline +ajax +iframe +flash +packed
+ * Author:  Torstein Hønsi
+ * Support: www.highslide.com/support
+ * License: www.highslide.com/#license
+ */
+eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('q(!m){A m={18:{97:\'aK\',aZ:\'fw...\',aY:\'8G 2i fP\',bD:\'8G 2i g0 2i eR\',9Z:\'eZ 2i fc D (f)\',cq:\'f8 by <i>an ao</i>\',cr:\'f4 2i f6 an ao fg\',8Y:\'aq\',8W:\'ay\',8Z:\'ag\',92:\'am\',90:\'am (eD)\',b0:\'eY\',ab:\'al\',au:\'al 1p (aj)\',ac:\'ah\',ad:\'ah 1p (aj)\',8s:\'aq (8w 1b)\',8X:\'ay (8w 3m)\',8V:\'ag\',ae:\'1:1\',3G:\'g7 %1 fz %2\',9W:\'8G 2i 26 2R, dC aA dE 2i 3u. dF 8w dB O 1D aA 3a.\'},5c:\'K/dw/\',7R:\'dv.5q\',6h:\'dx.5q\',6W:5Z,9A:5Z,4W:15,9B:15,4d:15,6L:15,4F:cY,be:0.75,9l:M,9f:5,3Y:2,ei:3,5S:1j,bz:\'4Q 3m\',bA:1,br:M,ct:\'em://K.eh/\',cs:\'ec\',aS:M,9w:[\'a\',\'5v\'],3q:[],cE:5Z,4b:0,87:50,6J:1j,6X:M,4D:M,3U:\'60\',7W:M,46:\'1M\',9n:\'1M\',b1:I,aC:I,a7:M,4s:aw,6k:aw,5Y:M,1Z:\'ev-dV\',8i:{2X:\'<P 1W="K-2X"><6t>\'+\'<1H 1W="K-3a">\'+\'<a 21="#" 24="{m.18.8s}">\'+\'<1C>{m.18.8Y}</1C></a>\'+\'</1H>\'+\'<1H 1W="K-3L">\'+\'<a 21="#" 24="{m.18.au}">\'+\'<1C>{m.18.ab}</1C></a>\'+\'</1H>\'+\'<1H 1W="K-3p">\'+\'<a 21="#" 24="{m.18.ad}">\'+\'<1C>{m.18.ac}</1C></a>\'+\'</1H>\'+\'<1H 1W="K-1D">\'+\'<a 21="#" 24="{m.18.8X}">\'+\'<1C>{m.18.8W}</1C></a>\'+\'</1H>\'+\'<1H 1W="K-3u">\'+\'<a 21="#" 24="{m.18.8V}">\'+\'<1C>{m.18.8Z}</1C></a>\'+\'</1H>\'+\'<1H 1W="K-1a-2F">\'+\'<a 21="#" 24="{m.18.9Z}">\'+\'<1C>{m.18.ae}</1C></a>\'+\'</1H>\'+\'<1H 1W="K-26">\'+\'<a 21="#" 24="{m.18.90}" >\'+\'<1C>{m.18.92}</1C></a>\'+\'</1H>\'+\'</6t></P>\',bd:\'<P 1W="K-e2"><6t>\'+\'<1H 1W="K-3a">\'+\'<a 21="#" 24="{m.18.8s}" 2p="E m.3a(k)">\'+\'<1C>{m.18.8Y}</1C></a>\'+\'</1H>\'+\'<1H 1W="K-1D">\'+\'<a 21="#" 24="{m.18.8X}" 2p="E m.1D(k)">\'+\'<1C>{m.18.8W}</1C></a>\'+\'</1H>\'+\'<1H 1W="K-3u">\'+\'<a 21="#" 24="{m.18.8V}" 2p="E 1j">\'+\'<1C>{m.18.8Z}</1C></a>\'+\'</1H>\'+\'<1H 1W="K-26">\'+\'<a 21="#" 24="{m.18.90}" 2p="E m.26(k)">\'+\'<1C>{m.18.92}</1C></a>\'+\'</1H>\'+\'</6t></P>\'+\'<P 1W="K-19"></P>\'+\'<P 1W="K-e7"><P>\'+\'<1C 1W="K-3O" 24="{m.18.b0}"><1C></1C></1C>\'+\'</P></P>\'},64:[],a1:M,16:[],a4:[\'5Y\',\'3t\',\'46\',\'9n\',\'b1\',\'aC\',\'1Z\',\'3Y\',\'dU\',\'dM\',\'dL\',\'b3\',\'dK\',\'dI\',\'dJ\',\'b2\',\'cv\',\'a7\',\'42\',\'6l\',\'3q\',\'4b\',\'L\',\'N\',\'88\',\'6J\',\'6X\',\'4D\',\'dN\',\'dO\',\'dT\',\'2I\',\'7W\',\'4j\',\'4x\',\'3U\',\'8e\',\'a9\',\'4s\',\'6k\',\'6M\',\'9i\',\'aX\',\'2N\',\'2Q\',\'cF\',\'cD\',\'1e\'],1T:[],61:0,8g:{x:[\'bM\',\'1b\',\'4X\',\'3m\',\'bC\'],y:[\'5N\',\'Y\',\'9a\',\'4Q\',\'7E\']},7B:{},b2:{},b3:{},8e:{aG:{},29:{},aF:{}},4m:[],6u:[],4n:{},4R:[],7q:[],5a:[],7k:{},8c:{},7l:[],2t:/dP\\/4\\.0/.11(4A.6d)?8:8J((4A.6d.5G().3b(/.+(?:b9|dQ|e9|2h)[\\/: ]([\\d.]+)/)||[0,\'0\'])[1]),2h:(W.6q&&!1S.3z),4M:/ea/.11(4A.6d),6y:/eu.+b9:1\\.[0-8].+es/.11(4A.6d),$:C(1v){q(1v)E W.9Q(1v)},2o:C(2a,3j){2a[2a.V]=3j},1d:C(ba,4l,49,6c,bh){A el=W.1d(ba);q(4l)m.3A(el,4l);q(bh)m.R(el,{94:0,8H:\'1E\',9D:0});q(49)m.R(el,49);q(6c)6c.1X(el);E el},3A:C(el,4l){O(A x 2Y 4l)el[x]=4l[x];E el},R:C(el,49){O(A x 2Y 49){q(m.3R&&x==\'1z\'){q(49[x]>0.99)el.G.ew(\'5Q\');J el.G.5Q=\'bg(1z=\'+(49[x]*2w)+\')\'}J el.G[x]=49[x]}},2z:C(el,1f,3C){A 4T,51,4w;q(1F 3C!=\'7j\'||3C===I){A 2H=c5;3C={4h:2H[2],2Q:2H[3],76:2H[4]}}q(1F 3C.4h!=\'3G\')3C.4h=5Z;3C.2Q=1h[3C.2Q]||1h.bj;3C.7g=m.3A({},1f);O(A 2Z 2Y 1f){A e=1J m.fx(el,3C,2Z);4T=8J(m.8I(el,2Z))||0;51=8J(1f[2Z]);4w=2Z!=\'1z\'?\'F\':\'\';e.3E(4T,51,4w)}},8I:C(el,1f){q(el.G[1f]){E el.G[1f]}J q(W.8L){E W.8L.cK(el,I).co(1f)}J{q(1f==\'1z\')1f=\'5Q\';A 3j=el.5y[1f.2k(/\\-(\\w)/g,C(a,b){E b.bi()})];q(1f==\'5Q\')3j=3j.2k(/bg\\(1z=([0-9]+)\\)/,C(a,b){E b/2w});E 3j===\'\'?1:3j}},7S:C(){A d=W,w=1S,63=d.7a&&d.7a!=\'8v\'?d.5h:d.19,3R=m.2h&&(m.2t<9||1F bf==\'1L\');A L=3R?63.8F:(d.5h.8F||7c.ep),N=3R?63.c4:7c.eo;m.4g={L:L,N:N,5O:3R?63.5O:bf,5R:3R?63.5R:ed};E m.4g},6K:C(el){q(/5v/i.11(el.3J)){A 7N=W.2C(\'1N\');O(A i=0;i<7N.V;i++){A u=7N[i].eb;q(u&&u.2k(/^.*?#/,\'\')==el.23.2Z){el=7N[i];5m}}}A p={x:el.4V,y:el.8O};5g(el.bb){el=el.bb;p.x+=el.4V;p.y+=el.8O;q(el!=W.19&&el!=W.5h){p.x-=el.5O;p.y-=el.5R}}E p},2F:C(a,29,3E,T){q(!a)a=m.1d(\'a\',I,{1o:\'1E\'},m.2b);q(1F a.6a==\'C\')E 29;q(T==\'3D\'){O(A i=0;i<m.4R.V;i++){q(m.4R[i]&&m.4R[i].a==a){m.4R[i].bP();m.4R[i]=I;E 1j}}m.aU=M}1t{1J m.5A(a,29,3E,T);E 1j}1y(e){E M}},9u:C(a,29,3E){E m.2F(a,29,3E,\'3D\')},89:C(){E m.1d(\'P\',{1c:\'K-3D-S\',2d:m.8b(m.8i.bd)})},4p:C(el,3J,1c){A 1m=el.2C(3J);O(A i=0;i<1m.V;i++){q((1J 4Y(1c)).11(1m[i].1c)){E 1m[i]}}E I},8b:C(s){s=s.2k(/\\s/g,\' \');A 2m=/{m\\.18\\.([^}]+)\\}/g,6v=s.3b(2m),18;q(6v)O(A i=0;i<6v.V;i++){18=6v[i].2k(2m,"$1");q(1F m.18[18]!=\'1L\')s=s.2k(6v[i],m.18[18])}E s},c1:C(){A 1m=W.2C(\'a\');O(A i=0;i<1m.V;i++){A T=m.aH(1m[i]);q(T&&!1m[i].aI){(C(){A t=T;q(m.1A(m,\'ek\',{7y:1m[i],T:t})){1m[i].2p=(T==\'2R\')?C(){E m.2F(k)}:C(){E m.9u(k,{2I:t})}}})();1m[i].aI=M}}m.6p()},aH:C(el){q(el.7b==\'K\')E\'2R\';J q(el.7b==\'K-2W\')E\'2W\';J q(el.7b==\'K-1k\')E\'1k\';J q(el.7b==\'K-3x\')E\'3x\'},86:C(a){O(A i=0;i<m.5a.V;i++){q(m.5a[i][0]==a){A c=m.5a[i][1];m.5a[i][1]=c.5J(1);E c}}E I},bI:C(e){A 2a=m.6p();O(A i=0;i<2a.56.V;i++){A a=2a.56[i];q(m.43(a,\'2I\')==\'2W\'&&m.43(a,\'7W\'))m.2o(m.7q,a)}m.8k(0)},8k:C(i){q(!m.7q[i])E;A a=m.7q[i];A 6z=m.4J(m.43(a,\'88\'));q(!6z)6z=m.89();A 2W=1J m.7x(a,6z,1);2W.9z=C(){};2W.3F=C(){m.2o(m.5a,[a,6z]);m.8k(i+1)};2W.9r()},aQ:C(){A 8d=0,7n=-1,16=m.16,B,1B;O(A i=0;i<16.V;i++){B=16[i];q(B){1B=B.U.G.1B;q(1B&&1B>8d){8d=1B;7n=i}}}q(7n==-1)m.3d=-1;J 16[7n].3M()},43:C(a,6b){a.6a=a.2p;A p=a.6a?a.6a():I;a.6a=I;E(p&&1F p[6b]!=\'1L\')?p[6b]:(1F m[6b]!=\'1L\'?m[6b]:I)},7s:C(a){A 1e=m.43(a,\'1e\');q(1e)E 1e;E a.21},4J:C(1v){A 1P=m.$(1v),4q=m.8c[1v],a={};q(!1P&&!4q)E I;q(!4q){4q=1P.5J(M);4q.1v=\'\';m.8c[1v]=4q;E 1P}J{E 4q.5J(M)}},3B:C(d){q(d)m.9y.1X(d);m.9y.2d=\'\'},1u:C(B){q(!m.2v){84=M;m.2v=m.1d(\'P\',{1c:\'K-dc K-2x-D\',5r:\'\',2p:C(){q(m.1A(m,\'d3\'))m.26()}},{1n:\'1Y\',1z:0},m.2b,M);q(/(df|d2|cU|cT)/.11(4A.6d)){A 19=W.19;C 81(){m.R(m.2v,{L:19.cR+\'F\',N:19.cV+\'F\'})}81();m.2j(1S,\'3O\',81)}}m.2v.G.1o=\'\';A 84=m.2v.5r==\'\';m.2v.5r+=\'|\'+B.Q;q(84){q(m.6y&&m.aR)m.R(m.2v,{9t:\'7T(\'+m.5c+\'d0.ak)\',1z:1});J m.2z(m.2v,{1z:B.4b},m.87)}},9x:C(Q){q(!m.2v)E;q(1F Q!=\'1L\')m.2v.5r=m.2v.5r.2k(\'|\'+Q,\'\');q((1F Q!=\'1L\'&&m.2v.5r!=\'\')||(m.2q&&m.43(m.2q,\'4b\')))E;q(m.6y&&m.aR)m.2v.G.1o=\'1E\';J m.2z(m.2v,{1z:0},m.87,I,C(){m.2v.G.1o=\'1E\'})},8N:C(7z,B){A 1i=B||m.2G();B=1i;q(m.2q)E 1j;J m.1i=1i;m.4z(W,1S.3z?\'6U\':\'71\',m.68);1t{m.2q=7z;7z.2p()}1y(e){m.1i=m.2q=I}1t{q(!7z||B.3q[1]!=\'4e\')B.26()}1y(e){}E 1j},7O:C(el,2n){A B=m.2G(el);q(B)E m.8N(B.7V(2n),B);J E 1j},3a:C(el){E m.7O(el,-1)},1D:C(el){E m.7O(el,1)},68:C(e){q(!e)e=1S.2u;q(!e.2L)e.2L=e.9k;q(1F e.2L.9j!=\'1L\')E M;q(!m.1A(m,\'dz\',e))E M;A B=m.2G();A 2n=I;b6(e.dy){2c 70:q(B)B.7r();E M;2c 32:2n=2;5m;2c 34:2c 39:2c 40:2n=1;5m;2c 8:2c 33:2c 37:2c 38:2n=-1;5m;2c 27:2c 13:2n=0}q(2n!==I){q(2n!=2)m.4z(W,1S.3z?\'6U\':\'71\',m.68);q(!m.aS)E M;q(e.5n)e.5n();J e.c0=1j;q(B){q(2n==0){B.26()}J q(2n==2){q(B.1p)B.1p.cl()}J{q(B.1p)B.1p.3p();m.7O(B.Q,2n)}E 1j}}E M},du:C(14){m.2o(m.1T,m.3A(14,{22:\'22\'+m.61++}))},dt:C(1r){A 3c=1r.2N;q(1F 3c==\'7j\'){O(A i=0;i<3c.V;i++){A o={};O(A x 2Y 1r)o[x]=1r[x];o.2N=3c[i];m.2o(m.6u,o)}}J{m.2o(m.6u,1r)}},9U:C(7y,7h){A el,2m=/^K-U-([0-9]+)$/;el=7y;5g(el.23){q(el.6R!==1L)E el.6R;q(el.1v&&2m.11(el.1v))E el.1v.2k(2m,"$1");el=el.23}q(!7h){el=7y;5g(el.23){q(el.3J&&m.77(el)){O(A Q=0;Q<m.16.V;Q++){A B=m.16[Q];q(B&&B.a==el)E Q}}el=el.23}}E I},2G:C(el,7h){q(1F el==\'1L\')E m.16[m.3d]||I;q(1F el==\'3G\')E m.16[el]||I;q(1F el==\'a8\')el=m.$(el);E m.16[m.9U(el,7h)]||I},77:C(a){E(a.2p&&a.2p.cC().2k(/\\s/g,\' \').3b(/m.(dj|e)dh/))},bw:C(){O(A i=0;i<m.16.V;i++)q(m.16[i]&&m.16[i].55)m.aQ()},1A:C(6i,9K,2H){E 6i&&6i[9K]?(6i[9K](6i,2H)!==1j):M},8z:C(e){q(!e)e=1S.2u;q(e.ds>1)E M;q(!e.2L)e.2L=e.9k;A el=e.2L;5g(el.23&&!(/K-(2R|3u|3D|3O)/.11(el.1c))){el=el.23}A B=m.2G(el);q(B&&(B.62||!B.55))E M;q(B&&e.T==\'8y\'){q(e.2L.9j)E M;A 3b=el.1c.3b(/K-(2R|3u|3O)/);q(3b){m.2y={B:B,T:3b[1],1b:B.x.H,L:B.x.D,Y:B.y.H,N:B.y.D,aV:e.7A,aO:e.7F};m.2j(W,\'7D\',m.6H);q(e.5n)e.5n();q(/K-(2R|3D)-9J/.11(B.S.1c)){B.3M();m.a6=M}E 1j}J q(/K-3D/.11(el.1c)&&m.3d!=B.Q){B.3M();B.59(\'1q\')}}J q(e.T==\'c3\'){m.4z(W,\'7D\',m.6H);q(m.2y){q(m.54&&m.2y.T==\'2R\')m.2y.B.S.G.4L=m.54;A 3I=m.2y.3I;q(!3I&&!m.a6&&!/(3u|3O)/.11(m.2y.T)){q(m.1A(B,\'dr\'))B.26()}J q(3I||(!3I&&m.aU)){m.2y.B.59(\'1q\')}q(m.2y.B.3W)m.2y.B.3W.G.1o=\'1E\';q(3I)m.1A(m.2y.B,\'do\',m.2y);m.a6=1j;m.2y=I}J q(/K-2R-9J/.11(el.1c)){el.G.4L=m.54}}E 1j},6H:C(e){q(!m.2y)E M;q(!e)e=1S.2u;A a=m.2y,B=a.B;q(B.1k){q(!B.3W)B.3W=m.1d(\'P\',I,{1l:\'2l\',L:B.x.D+\'F\',N:B.y.D+\'F\',1b:B.x.cb+\'F\',Y:B.y.cb+\'F\',1B:4,9t:(m.3R?\'eB\':\'1E\'),1z:0.eU},B.U,M);q(B.3W.G.1o==\'1E\')B.3W.G.1o=\'\'}a.dX=e.7A-a.aV;a.dY=e.7F-a.aO;A 9g=1h.fG(1h.aE(a.dX,2)+1h.aE(a.dY,2));q(!a.3I)a.3I=(a.T!=\'2R\'&&9g>0)||(9g>(m.fK||5));q(a.3I&&e.7A>5&&e.7F>5){q(!m.1A(B,\'fN\',a))E 1j;q(a.T==\'3O\')B.3O(a);J{B.9m(a.1b+a.dX,a.Y+a.dY);q(a.T==\'2R\')B.S.G.4L=\'3u\'}}E 1j},aP:C(e){1t{q(!e)e=1S.2u;A 66=/fM/i.11(e.T);q(!e.2L)e.2L=e.9k;q(!e.7P)e.7P=66?e.fE:e.fD;A B=m.2G(e.2L);q(!B.55)E;q(!B||!e.7P||m.2G(e.7P,M)==B||m.2y)E;m.1A(B,66?\'ft\':\'fr\',e);O(A i=0;i<B.1T.V;i++)(C(){A o=m.$(\'22\'+B.1T[i]);q(o&&o.7d){q(66)m.R(o,{1n:\'1Y\',1o:\'\'});m.2z(o,{1z:66?o.1z:0},o.4i)}})()}1y(e){}},2j:C(el,2u,3Q){q(el==W&&2u==\'41\'){m.2o(m.7l,3Q)}1t{el.2j(2u,3Q,1j)}1y(e){1t{el.aM(\'65\'+2u,3Q);el.fy(\'65\'+2u,3Q)}1y(e){el[\'65\'+2u]=3Q}}},4z:C(el,2u,3Q){1t{el.4z(2u,3Q,1j)}1y(e){1t{el.aM(\'65\'+2u,3Q)}1y(e){el[\'65\'+2u]=I}}},7C:C(i){q(m.a1&&m.64[i]&&m.64[i]!=\'1L\'){A 1N=W.1d(\'1N\');1N.4N=C(){1N=I;m.7C(i+1)};1N.1e=m.64[i]}},c2:C(3G){q(3G&&1F 3G!=\'7j\')m.9f=3G;A 2a=m.6p();O(A i=0;i<2a.4Z.V&&i<m.9f;i++){m.2o(m.64,m.7s(2a.4Z[i]))}q(m.1Z)1J m.6r(m.1Z,C(){m.7C(0)});J m.7C(0);q(m.6h)A 5q=m.1d(\'1N\',{1e:m.5c+m.6h})},7m:C(){q(!m.2b){m.3Z=m.2h&&m.2t<7;m.3R=m.2h&&m.2t<9;m.7S();m.cf=m.3Z&&85.g5==\'g4:\';O(A x 2Y m.7o){q(1F m[x]!=\'1L\')m.18[x]=m[x];J q(1F m.18[x]==\'1L\'&&1F m.7o[x]!=\'1L\')m.18[x]=m.7o[x]}m.2b=m.1d(\'P\',{1c:\'K-2b\'},{1l:\'2l\',1b:0,Y:0,L:\'2w%\',1B:m.4F,9S:\'aK\'},W.19,M);m.2r=m.1d(\'a\',{1c:\'K-2r\',24:m.18.aY,2d:m.18.aZ,21:\'bt:;\'},{1l:\'2l\',Y:\'-4v\',1z:m.be,1B:1},m.2b);m.9y=m.1d(\'P\',I,{1o:\'1E\'},m.2b);m.2x=m.1d(\'P\',{1c:\'K-2x K-2x-D\'},{1n:(m.4M&&m.2t<73)?\'1Y\':\'1q\'},m.2b,1);m.3w=m.1d(\'P\',I,{aJ:\'bc\',g9:\'ga\'},I,M);1h.g2=C(t,b,c,d){E c*t/d+b};1h.bj=C(t,b,c,d){E c*(t/=d)*t+b};1h.8S=C(t,b,c,d){E-c*(t/=d)*(t-2)+b};m.cO=m.3Z;m.cQ=((1S.3z&&m.2t<9)||4A.av==\'at\'||(m.3Z&&m.2t<5.5));m.1A(k,\'fU\')}},41:C(){q(m.9F)E;m.9F=M;O(A i=0;i<m.7l.V;i++)m.7l[i]()},95:C(){A el,1m,6q=[],4Z=[],56=[],3i={},2m;O(A i=0;i<m.9w.V;i++){1m=W.2C(m.9w[i]);O(A j=0;j<1m.V;j++){el=1m[j];2m=m.77(el);q(2m){m.2o(6q,el);q(2m[0]==\'m.2F\')m.2o(4Z,el);J q(2m[0]==\'m.9u\')m.2o(56,el);A g=m.43(el,\'2N\')||\'1E\';q(!3i[g])3i[g]=[];m.2o(3i[g],el)}}}m.4U={6q:6q,3i:3i,4Z:4Z,56:56};E m.4U},6p:C(){E m.4U||m.95()},26:C(el){A B=m.2G(el);q(B)B.26();E 1j}};m.fx=C(30,1r,1f){k.1r=1r;k.30=30;k.1f=1f;q(!1r.b7)1r.b7={}};m.fx.5w={82:C(){(m.fx.3P[k.1f]||m.fx.3P.ap)(k);q(k.1r.3P)k.1r.3P.ax(k.30,k.4o,k)},3E:C(8u,2i,4w){k.9c=(1J 7K()).79();k.4T=8u;k.51=2i;k.4w=4w;k.4o=k.4T;k.H=k.96=0;A 7c=k;C t(7i){E 7c.3P(7i)}t.30=k.30;q(t()&&m.4m.2o(t)==1){m.af=fX(C(){A 4m=m.4m;O(A i=0;i<4m.V;i++)q(!4m[i]())4m.gd(i--,1);q(!4m.V){eT(m.af)}},13)}},3P:C(7i){A t=(1J 7K()).79();q(7i||t>=k.1r.4h+k.9c){k.4o=k.51;k.H=k.96=1;k.82();k.1r.7g[k.1f]=M;A 9s=M;O(A i 2Y k.1r.7g)q(k.1r.7g[i]!==M)9s=1j;q(9s){q(k.1r.76)k.1r.76.ax(k.30)}E 1j}J{A n=t-k.9c;k.96=n/k.1r.4h;k.H=k.1r.2Q(n,0,1,k.1r.4h);k.4o=k.4T+((k.51-k.4T)*k.H);k.82()}E M}};m.3A(m.fx,{3P:{1z:C(fx){m.R(fx.30,{1z:fx.4o})},ap:C(fx){1t{q(fx.30.G&&fx.30.G[fx.1f]!=I)fx.30.G[fx.1f]=fx.4o+fx.4w;J fx.30[fx.1f]=fx.4o}1y(e){}}}});m.6r=C(1Z,3F){k.3F=3F;k.1Z=1Z;A v=m.2t,47;k.9G=m.2h&&m.2t<7;q(!1Z){q(3F)3F();E}m.7m();k.2g=m.1d(\'2g\',{eJ:0},{1n:\'1q\',1l:\'2l\',eN:\'eM\',L:0},m.2b,M);A 4G=m.1d(\'4G\',I,I,k.2g,1);k.2J=[];O(A i=0;i<=8;i++){q(i%3==0)47=m.1d(\'47\',I,{N:\'1M\'},4G,M);k.2J[i]=m.1d(\'2J\',I,I,47,M);A G=i!=4?{eL:0,eK:0}:{1l:\'4y\'};m.R(k.2J[i],G)}k.2J[4].1c=1Z+\' K-1g\';k.ai()};m.6r.5w={ai:C(){A 1e=m.5c+(m.f1||"fi/")+k.1Z+".ak";A ar=m.4M&&m.2t<73?m.2b:I;k.3V=m.1d(\'1N\',I,{1l:\'2l\',Y:\'-4v\'},ar,M);A 3v=k;k.3V.4N=C(){3v.az()};k.3V.1e=1e},az:C(){A o=k.1w=k.3V.L/4,H=[[0,0],[0,-4],[-2,0],[0,-8],0,[-2,-8],[0,-2],[0,-6],[-2,-2]],1u={N:(2*o)+\'F\',L:(2*o)+\'F\'};O(A i=0;i<=8;i++){q(H[i]){q(k.9G){A w=(i==1||i==7)?\'2w%\':k.3V.L+\'F\';A P=m.1d(\'P\',I,{L:\'2w%\',N:\'2w%\',1l:\'4y\',2e:\'1q\'},k.2J[i],M);m.1d(\'P\',I,{5Q:"fo:fn.bv.fm(fl=fe, 1e=\'"+k.3V.1e+"\')",1l:\'2l\',L:w,N:k.3V.N+\'F\',1b:(H[i][0]*o)+\'F\',Y:(H[i][1]*o)+\'F\'},P,M)}J{m.R(k.2J[i],{9t:\'7T(\'+k.3V.1e+\') \'+(H[i][0]*o)+\'F \'+(H[i][1]*o)+\'F\'})}q(1S.3z&&(i==3||i==5))m.1d(\'P\',I,1u,k.2J[i],M);m.R(k.2J[i],1u)}}k.3V=I;q(m.4n[k.1Z])m.4n[k.1Z].5U();m.4n[k.1Z]=k;q(k.3F)k.3F()},4C:C(H,1w,aB,4i,2Q){A B=k.B,5X=B.U.G,1w=1w||0,H=H||{x:B.x.H+1w,y:B.y.H+1w,w:B.x.Z(\'2f\')-2*1w,h:B.y.Z(\'2f\')-2*1w};q(aB)k.2g.G.1n=(H.h>=4*k.1w)?\'1Y\':\'1q\';m.R(k.2g,{1b:(H.x-k.1w)+\'F\',Y:(H.y-k.1w)+\'F\',L:(H.w+2*k.1w)+\'F\'});H.w-=2*k.1w;H.h-=2*k.1w;m.R(k.2J[4],{L:H.w>=0?H.w+\'F\':0,N:H.h>=0?H.h+\'F\':0});q(k.9G)k.2J[3].G.N=k.2J[5].G.N=k.2J[4].G.N},5U:C(bk){q(bk)k.2g.G.1n=\'1q\';J m.3B(k.2g)}};m.6A=C(B,1u){k.B=B;k.1u=1u;k.3l=1u==\'x\'?\'bY\':\'bW\';k.3k=k.3l.5G();k.6m=1u==\'x\'?\'cj\':\'c8\';k.6Y=k.6m.5G();k.9L=1u==\'x\'?\'c7\':\'bX\';k.b5=k.9L.5G();k.1G=k.36=0};m.6A.5w={Z:C(Q){b6(Q){2c\'9T\':E k.1K+k.3s+(k.t-m.2r[\'1w\'+k.3l])/2;2c\'9v\':E k.H+k.cb+k.1G+(k.D-m.2r[\'1w\'+k.3l])/2;2c\'2f\':E k.D+2*k.cb+k.1G+k.36;2c\'5e\':E k.4K-k.3o-k.4S;2c\'8D\':E k.Z(\'5e\')-2*k.cb-k.1G-k.36;2c\'6e\':E k.H-(k.B.1g?k.B.1g.1w:0);2c\'9R\':E k.Z(\'2f\')+(k.B.1g?2*k.B.1g.1w:0);2c\'2K\':E k.1V?1h.3e((k.D-k.1V)/2):0}},8a:C(){k.cb=(k.B.S[\'1w\'+k.3l]-k.t)/2;k.4S=m[\'9D\'+k.9L]},9M:C(){k.t=k.B.el[k.3k]?3H(k.B.el[k.3k]):k.B.el[\'1w\'+k.3l];k.1K=k.B.1K[k.1u];k.3s=(k.B.el[\'1w\'+k.3l]-k.t)/2;q(k.1K==0||k.1K==-1){k.1K=(m.4g[k.3k]/2)+m.4g[\'28\'+k.6m]}},8h:C(){A B=k.B;k.2T=\'1M\';q(B.9n==\'4X\')k.2T=\'4X\';J q(1J 4Y(k.6Y).11(B.46))k.2T=I;J q(1J 4Y(k.b5).11(B.46))k.2T=\'4t\';k.H=k.1K-k.cb+k.3s;q(k.9i&&k.1u==\'x\')B.6M=1h.31(B.6M||k.1a,B.9i*k.1a/B.y.1a);k.D=1h.31(k.1a,B[\'4t\'+k.3l]||k.1a);k.2U=B.5Y?1h.31(B[\'31\'+k.3l],k.1a):k.1a;q(B.2E&&B.3t){k.D=B[k.3k];k.1V=k.1a}q(k.1u==\'x\'&&m.5S)k.2U=B.4s;k.2L=B[\'2L\'+k.1u.bi()];k.3o=m[\'9D\'+k.6m];k.28=m.4g[\'28\'+k.6m];k.4K=m.4g[k.3k]},72:C(i){A B=k.B;q(B.2E&&(B.3t||m.5S)){k.1V=i;k.D=1h.4t(k.D,k.1V);B.S.G[k.6Y]=k.Z(\'2K\')+\'F\'}J k.D=i;B.S.G[k.3k]=i+\'F\';B.U.G[k.3k]=k.Z(\'2f\')+\'F\';q(B.1g)B.1g.4C();q(B.3W)B.3W.G[k.3k]=i+\'F\';q(k.1u==\'y\'&&B.5C&&B.19.G.N!=\'1M\')1t{B.5C.19.G.2e=\'1M\'}1y(e){}q(B.2A){A d=B.2s;q(k.9e===1L)k.9e=B.1s[\'1w\'+k.3l]-d[\'1w\'+k.3l];d.G[k.3k]=(k.D-k.9e)+\'F\';q(k.1u==\'x\')B.4c.G.L=\'1M\';q(B.19)B.19.G[k.3k]=\'1M\'}q(k.1u==\'x\'&&B.1x)B.57(M);q(k.1u==\'x\'&&B.1p&&B.2E){q(i==k.1a)B.1p.5d(\'1a-2F\');J B.1p.4u(\'1a-2F\')}},aa:C(i){k.H=i;k.B.U.G[k.6Y]=i+\'F\';q(k.B.1g)k.B.1g.4C()}};m.5A=C(a,29,3E,35){q(W.bS&&m.2h&&!m.9F){m.2j(W,\'41\',C(){1J m.5A(a,29,3E,35)});E}k.a=a;k.3E=3E;k.35=35||\'2R\';k.2A=(35==\'3D\');k.2E=!k.2A;m.a1=1j;k.1T=[];k.1i=m.1i;m.1i=I;m.7m();A Q=k.Q=m.16.V;O(A i=0;i<m.a4.V;i++){A 2Z=m.a4[i];k[2Z]=29&&1F 29[2Z]!=\'1L\'?29[2Z]:m[2Z]}q(!k.1e)k.1e=a.21;A el=(29&&29.9P)?m.$(29.9P):a;el=k.aW=el.2C(\'1N\')[0]||el;k.6Q=el.1v||a.1v;q(!m.1A(k,\'f3\'))E M;O(A i=0;i<m.16.V;i++){q(m.16[i]&&m.16[i].a==a&&!(k.1i&&k.3q[1]==\'4e\')){m.16[i].3M();E 1j}}q(!m.f5)O(A i=0;i<m.16.V;i++){q(m.16[i]&&m.16[i].aW!=el&&!m.16[i].6D){m.16[i].6P()}}m.16[Q]=k;q(!m.9l&&!m.2q){q(m.16[Q-1])m.16[Q-1].26();q(1F m.3d!=\'1L\'&&m.16[m.3d])m.16[m.3d].26()}k.el=el;k.1K=k.aX||m.6K(el);m.7S();A x=k.x=1J m.6A(k,\'x\');x.9M();A y=k.y=1J m.6A(k,\'y\');y.9M();q(/5v/i.11(el.3J))k.b8(el);k.U=m.1d(\'P\',{1v:\'K-U-\'+k.Q,1c:\'K-U \'+k.a9},{1n:\'1q\',1l:\'2l\',1B:m.4F+=2},I,M);k.U.eX=k.U.eS=m.aP;q(k.35==\'2R\'&&k.3Y==2)k.3Y=0;q(!k.1Z||(k.1i&&k.2E&&k.3q[1]==\'4e\')){k[k.35+\'9H\']()}J q(m.4n[k.1Z]){k.9I();k[k.35+\'9H\']()}J{k.6n();A B=k;1J m.6r(k.1Z,C(){B.9I();B[B.35+\'9H\']()})}E M};m.5A.5w={9o:C(e){q(m.g8)dq(\'dk \'+e.dl+\': \'+e.dD);J 1S.85.21=k.1e},9I:C(){A 1g=k.1g=m.4n[k.1Z];1g.B=k;1g.2g.G.1B=k.U.G.1B-1;m.4n[k.1Z]=I},6n:C(){q(k.6D||k.2r)E;k.2r=m.2r;A B=k;k.2r.2p=C(){B.6P()};q(!m.1A(k,\'d5\'))E;A B=k,l=k.x.Z(\'9T\')+\'F\',t=k.y.Z(\'9T\')+\'F\';q(!2P&&k.1i&&k.3q[1]==\'4e\')A 2P=k.1i;q(2P){l=2P.x.Z(\'9v\')+\'F\';t=2P.y.Z(\'9v\')+\'F\';k.2r.G.1B=m.4F++}4a(C(){q(B.2r)m.R(B.2r,{1b:l,Y:t,1B:m.4F++})},2w)},ey:C(){A B=k;A 1N=W.1d(\'1N\');k.S=1N;1N.4N=C(){q(m.16[B.Q])B.69()};q(m.e3)1N.dp=C(){E 1j};1N.1c=\'K-2R\';m.R(1N,{1n:\'1q\',1o:\'3X\',1l:\'2l\',6M:\'4v\',1B:3});1N.24=m.18.9W;q(m.4M&&m.2t<73)m.2b.1X(1N);q(m.2h&&m.dH)1N.1e=I;1N.1e=k.1e;k.6n()},d4:C(){q(!m.1A(k,\'da\'))E;k.S=m.86(k.a);q(!k.S)k.S=m.4J(k.88);q(!k.S)k.S=m.89();k.a2([\'6C\']);q(k.6C){A 19=m.4p(k.S,\'P\',\'K-19\');q(19)19.1X(k.6C);k.6C.G.1o=\'3X\'}m.1A(k,\'fp\');A 1s=k.1s=k.S;q(/(3x|1k)/.11(k.2I))k.91(1s);m.2b.1X(k.U);m.R(k.U,{1l:\'fa\',94:\'0 \'+m.9B+\'F 0 \'+m.4W+\'F\'});k.S=m.1d(\'P\',{1c:\'K-3D\'},{1l:\'4y\',1B:3,N:0,2e:\'1q\'},k.U);k.4c=m.1d(\'P\',I,I,k.S,1);k.4c.1X(1s);m.R(1s,{1l:\'4y\',1o:\'3X\',9S:m.18.97||\'\'});q(k.L)1s.G.L=k.L+\'F\';q(k.N)m.R(1s,{N:k.N+\'F\',2e:\'1q\'});q(1s.1O<k.4s)1s.G.L=k.4s+\'F\';q(k.2I==\'2W\'&&!m.86(k.a)){k.6n();A B=k;A 2W=1J m.7x(k.a,1s);2W.1e=k.1e;2W.3F=C(){q(m.16[B.Q])B.69()};2W.9z=C(){85.21=B.1e};2W.9r()}J q(k.2I==\'1k\'&&k.3U==\'60\'){k.6T()}J k.69()},69:C(){1t{q(!k.S)E;k.S.4N=I;q(k.6D)E;J k.6D=M;A x=k.x,y=k.y;q(k.2r){m.R(k.2r,{Y:\'-4v\'});k.2r=I;m.1A(k,\'cu\')}q(k.2E){x.1a=k.S.L;y.1a=k.S.N;m.R(k.S,{L:x.t+\'F\',N:y.t+\'F\'});k.U.1X(k.S);m.2b.1X(k.U)}J q(k.7Z)k.7Z();x.8a();y.8a();m.R(k.U,{1b:(x.1K+x.3s-x.cb)+\'F\',Y:(y.1K+x.3s-y.cb)+\'F\'});k.a0();k.bB();A 2M=x.1a/y.1a;x.8h();k.2T(x);y.8h();k.2T(y);q(k.2A)k.b4();q(k.1x)k.57(0,1);q(k.5Y){q(k.2E)k.cG(2M);J k.8x();A 1R=k.1p;q(1R&&k.1i&&1R.2X&&1R.aT){A H=1R.cB.1l||\'\',p;O(A 1u 2Y m.8g)O(A i=0;i<5;i++){p=k[1u];q(H.3b(m.8g[1u][i])){p.H=k.1i[1u].H+(k.1i[1u].1G-p.1G)+(k.1i[1u].D-p.D)*[0,0,.5,1,1][i];q(1R.aT==\'f0\'){q(p.H+p.D+p.1G+p.36>p.28+p.4K-p.4S)p.H=p.28+p.4K-p.D-p.3o-p.4S-p.1G-p.36;q(p.H<p.28+p.3o)p.H=p.28+p.3o}}}}q(k.2E&&k.x.1a>(k.x.1V||k.x.D)){k.bs();q(k.1T.V==1)k.57()}}k.a5()}1y(e){k.9o(e)}},91:C(6c,1M){A c=m.4p(6c,\'7J\',\'K-19\');q(/(1k|3x)/.11(k.2I)){q(k.4j)c.G.L=k.4j+\'F\';q(k.4x)c.G.N=k.4x+\'F\'}},6T:C(){q(k.aD)E;A B=k;k.19=m.4p(k.1s,\'7J\',\'K-19\');q(k.2I==\'1k\'){k.6n();A 5o=m.3w.5J(1);k.19.1X(5o);k.eP=k.1s.1O;q(!k.4j)k.4j=5o.1O;A 5b=k.1s.1U-k.19.1U,h=k.4x||m.4g.N-5b-m.4d-m.6L,4N=k.3U==\'60\'?\' 4N="q (m.16[\'+k.Q+\']) m.16[\'+k.Q+\'].69()" \':\'\';k.19.2d+=\'<1k 2Z="m\'+(1J 7K()).79()+\'" eQ="0" Q="\'+k.Q+\'" \'+\' G="L:\'+k.4j+\'F; N:\'+h+\'F" \'+4N+\' 1e="\'+k.1e+\'" ></1k>\';k.5o=k.19.2C(\'P\')[0];k.1k=k.19.2C(\'1k\')[0];q(k.3U==\'6x\')k.8A()}q(k.2I==\'3x\'){k.19.1v=k.19.1v||\'m-fY-1v-\'+k.Q;A a=k.8e;q(!a.29)a.29={};q(1F a.29.aN==\'1L\')a.29.aN=\'fR\';q(9p)9p.fT(k.1e,k.19.1v,k.4j,k.4x,a.g1||\'7\',a.gb,a.aG,a.29,a.aF)}k.aD=M},7Z:C(){q(k.1k&&!k.4x){k.1k.G.N=k.19.G.N=k.8p()+\'F\'}k.1s.1X(m.3w);q(!k.x.1a)k.x.1a=k.1s.1O;k.y.1a=k.1s.1U;k.1s.9q(m.3w);q(m.2h&&k.aL>3H(k.1s.5y.N)){k.aL=3H(k.1s.5y.N)}m.R(k.U,{1l:\'2l\',94:\'0\'});m.R(k.S,{L:k.x.t+\'F\',N:k.y.t+\'F\'})},8p:C(){A h;1t{A 2B=k.5C=k.1k.9O||k.1k.6g.W;A 3w=2B.1d(\'P\');3w.G.aJ=\'bc\';2B.19.1X(3w);h=3w.8O;q(m.2h)h+=3H(2B.19.5y.4d)+3H(2B.19.5y.6L)-1}1y(e){h=de}E h},8A:C(){A 5i=k.1s.1O-k.5o.1O;m.3B(k.5o);q(5i<0)5i=0;A 5b=k.1s.1U-k.1k.1U;q(k.5C&&!k.4x&&!k.N&&k.y.D==k.y.1a)1t{k.5C.19.G.2e=\'1q\'}1y(e){}m.R(k.1k,{L:1h.9Y(k.x.D-5i)+\'F\',N:1h.9Y(k.y.D-5b)+\'F\'});m.R(k.19,{L:k.1k.G.L,N:k.1k.G.N});k.52=k.1k;k.2s=k.52},b4:C(){k.91(k.1s);q(k.2I==\'3x\'&&k.3U==\'60\')k.6T();q(k.x.D<k.x.1a&&!k.6J)k.x.D=k.x.1a;q(k.y.D<k.y.1a&&!k.6X)k.y.D=k.y.1a;k.2s=k.1s;m.R(k.4c,{1l:\'4y\',L:k.x.D+\'F\'});m.R(k.1s,{8H:\'1E\',L:\'1M\',N:\'1M\'});A 1P=m.4p(k.1s,\'7J\',\'K-19\');q(1P&&!/(1k|3x)/.11(k.2I)){A 5f=1P;1P=m.1d(5f.d8,I,{2e:\'1q\'},I,M);5f.23.dG(1P,5f);1P.1X(m.3w);1P.1X(5f);A 5i=k.1s.1O-1P.1O;A 5b=k.1s.1U-1P.1U;1P.9q(m.3w);A 6E=m.4M||4A.av==\'at\'?1:0;m.R(1P,{L:(k.x.D-5i-6E)+\'F\',N:(k.y.D-5b)+\'F\',2e:\'1M\',1l:\'4y\'});q(6E&&5f.1U>1P.1U){1P.G.L=(3H(1P.G.L)+6E)+\'F\'}k.52=1P;k.2s=k.52}q(k.1k&&k.3U==\'60\')k.8A();q(!k.52&&k.y.D<k.4c.1U)k.2s=k.S;q(k.2s==k.S&&!k.6J&&!/(1k|3x)/.11(k.2I)){k.x.D+=17}q(k.2s&&k.2s.1U>k.2s.23.1U){4a("1t { m.16["+k.Q+"].2s.G.2e = \'1M\'; } 1y(e) {}",m.6W)}},b8:C(5v){A c=5v.fC.7G(\',\');O(A i=0;i<c.V;i++)c[i]=3H(c[i]);q(5v.ff.5G()==\'eI\'){k.x.1K+=c[0]-c[2];k.y.1K+=c[1]-c[2];k.x.t=k.y.t=2*c[2]}J{A 5H,5z,5x=5H=c[0],5B=5z=c[1];O(A i=0;i<c.V;i++){q(i%2==0){5x=1h.31(5x,c[i]);5H=1h.4t(5H,c[i])}J{5B=1h.31(5B,c[i]);5z=1h.4t(5z,c[i])}}k.x.1K+=5x;k.x.t=5H-5x;k.y.1K+=5B;k.y.t=5z-5B}},2T:C(p,5u){A 4H,2P=p.2L,1u=p==k.x?\'x\':\'y\';q(2P&&2P.3b(/ /)){4H=2P.7G(\' \');2P=4H[0]}q(2P&&m.$(2P)){p.H=m.6K(m.$(2P))[1u];q(4H&&4H[1]&&4H[1].3b(/^[-]?[0-9]+F$/))p.H+=3H(4H[1]);q(p.D<p.2U)p.D=p.2U}J q(p.2T==\'1M\'||p.2T==\'4X\'){A 8C=1j;A 5s=p.B.5Y;q(p.2T==\'4X\')p.H=1h.3e(p.28+(p.4K+p.3o-p.4S-p.Z(\'2f\'))/2);J p.H=1h.3e(p.H-((p.Z(\'2f\')-p.t)/2));q(p.H<p.28+p.3o){p.H=p.28+p.3o;8C=M}q(!5u&&p.D<p.2U){p.D=p.2U;5s=1j}q(p.H+p.Z(\'2f\')>p.28+p.4K-p.4S){q(!5u&&8C&&5s){p.D=1h.31(p.D,p.Z(1u==\'y\'?\'5e\':\'8D\'))}J q(p.Z(\'2f\')<p.Z(\'5e\')){p.H=p.28+p.4K-p.4S-p.Z(\'2f\')}J{p.H=p.28+p.3o;q(!5u&&5s)p.D=p.Z(1u==\'y\'?\'5e\':\'8D\')}}q(!5u&&p.D<p.2U){p.D=p.2U;5s=1j}}J q(p.2T==\'4t\'){p.H=1h.dm(p.H-p.D+p.t)}q(p.H<p.3o){A cH=p.H;p.H=p.3o;q(5s&&!5u)p.D=p.D-(p.H-cH)}},cG:C(2M){A x=k.x,y=k.y,3T=1j,3f=1h.31(x.1a,x.D),3y=1h.31(y.1a,y.D),3t=(k.3t||m.5S);q(3f/3y>2M){ 3f=3y*2M;q(3f<x.2U){3f=x.2U;3y=3f/2M}3T=M}J q(3f/3y<2M){ 3y=3f/2M;3T=M}q(m.5S&&x.1a<x.2U){x.1V=x.1a;y.D=y.1V=y.1a}J q(k.3t){x.1V=3f;y.1V=3y}J{x.D=3f;y.D=3y}3T=k.8x(k.3t?I:2M,3T);q(3t&&y.D<y.1V){y.1V=y.D;x.1V=y.D*2M}q(3T||3t){x.H=x.1K-x.cb+x.3s;x.2U=x.D;k.2T(x,M);y.H=y.1K-y.cb+y.3s;y.2U=y.D;k.2T(y,M);q(k.1x)k.57()}},8x:C(2M,3T){A x=k.x,y=k.y;q(k.1x&&(k.2E||k.6X)){5g(y.D>k.6k&&x.D>k.4s&&y.Z(\'2f\')>y.Z(\'5e\')){y.D-=10;q(2M)x.D=y.D*2M;k.57(0,1);3T=M}}E 3T},dS:C(){q(k.2s){A h=/1k/i.11(k.2s.3J)?(k.8p()+1)+\'F\':\'1M\';q(k.19)k.19.G.N=h;k.2s.G.N=h;k.y.72(k.1s.1U)}},a5:C(){A x=k.x,y=k.y;k.59(\'1q\');m.1A(k,\'et\');q(k.1p&&k.1p.2D)k.1p.2D.5t();k.9b(1,{U:{L:x.Z(\'2f\'),N:y.Z(\'2f\'),1b:x.H,Y:y.H},S:{1b:x.1G+x.Z(\'2K\'),Y:y.1G+y.Z(\'2K\'),L:x.1V||x.D,N:y.1V||y.D}},m.6W)},9b:C(1I,2i,4i){A 5M=k.3q,8o=1I?(k.1i?k.1i.a:I):m.2q,t=(5M[1]&&8o&&m.43(8o,\'3q\')[1]==5M[1])?5M[1]:5M[0];q(k[t]&&t!=\'2F\'){k[t](1I,2i);E}q(k.1g&&!k.3Y){q(1I)k.1g.4C();J k.1g.5U((k.2A&&k.4D))}q(!1I)k.78();A B=k,x=B.x,y=B.y,2Q=k.2Q;q(!1I)2Q=k.cF||2Q;A 6x=1I?C(){q(B.1g)B.1g.2g.G.1n="1Y";4a(C(){B.6I()},50)}:C(){B.5D()};q(1I)m.R(k.U,{L:x.t+\'F\',N:y.t+\'F\'});q(1I&&k.2A){m.R(k.U,{1b:(x.1K-x.cb+x.3s)+\'F\',Y:(y.1K-y.cb+y.3s)+\'F\'})}q(k.cD){m.R(k.U,{1z:1I?0:1});m.3A(2i.U,{1z:1I})}m.2z(k.U,2i.U,{4h:4i,2Q:2Q,3P:C(3j,2H){q(B.1g&&B.3Y&&2H.1f==\'Y\'){A 5W=1I?2H.H:1-2H.H;A H={w:x.t+(x.Z(\'2f\')-x.t)*5W,h:y.t+(y.Z(\'2f\')-y.t)*5W,x:x.1K+(x.H-x.1K)*5W,y:y.1K+(y.H-y.1K)*5W};B.1g.4C(H,0,1)}q(B.2A){q(2H.1f==\'1b\')B.4c.G.1b=(x.H-3j)+\'F\';q(2H.1f==\'Y\')B.4c.G.Y=(y.H-3j)+\'F\'}}});m.2z(k.S,2i.S,4i,2Q,6x);q(1I){k.U.G.1n=\'1Y\';k.S.G.1n=\'1Y\';q(k.2A)k.1s.G.1n=\'1Y\';k.a.1c+=\' K-4I-46\'}},6w:C(1I,2i){k.3Y=1j;A B=k,t=1I?m.6W:0;q(1I){m.2z(k.U,2i.U,0);m.R(k.U,{1z:0,1n:\'1Y\'});m.2z(k.S,2i.S,0);k.S.G.1n=\'1Y\';m.2z(k.U,{1z:1},t,I,C(){B.6I()})}q(k.1g){k.1g.2g.G.1B=k.U.G.1B;A 6Z=1I||-1,1w=k.1g.1w,8r=1I?3:1w,8q=1I?1w:3;O(A i=8r;6Z*i<=6Z*8q;i+=6Z,t+=25){(C(){A o=1I?8q-i:8r-i;4a(C(){B.1g.4C(0,o,1)},t)})()}}q(1I){}J{4a(C(){q(B.1g)B.1g.5U(B.4D);B.78();m.2z(B.U,{1z:0},m.9A,I,C(){B.5D()})},t)}},4e:C(1I,2i,8u){q(!1I)E;A B=k,1i=k.1i,x=k.x,y=k.y,3n=1i.x,3g=1i.y,U=k.U,S=k.S,1x=k.1x;m.4z(W,\'7D\',m.6H);m.R(S,{L:(x.1V||x.D)+\'F\',N:(y.1V||y.D)+\'F\'});q(1x)1x.G.2e=\'1Y\';k.1g=1i.1g;q(k.1g)k.1g.B=B;1i.1g=I;A 5l=m.1d(\'P\',{1c:\'K-\'+k.35},{1l:\'2l\',1B:4,2e:\'1q\',1o:\'1E\'});A 8t={cN:1i,cM:k};O(A n 2Y 8t){k[n]=8t[n].S.5J(1);m.R(k[n],{1l:\'2l\',8H:0,1n:\'1Y\'});5l.1X(k[n])}U.1X(5l);q(k.2A)m.R(k.4c,{1b:0,Y:0});q(1x){1x.1c=\'\';U.1X(1x)}5l.G.1o=\'\';1i.S.G.1o=\'1E\';q(m.4M&&m.2t<73){k.U.G.1n=\'1Y\'}m.2z(U,{L:x.D},{4h:m.cE,3P:C(3j,2H){A H=2H.H,4B=1-H;A 1f,D={},93=[\'H\',\'D\',\'1G\',\'36\'];O(A n 2Y 93){1f=93[n];D[\'x\'+1f]=1h.3e(4B*3n[1f]+H*x[1f]);D[\'y\'+1f]=1h.3e(4B*3g[1f]+H*y[1f]);D.cI=1h.3e(4B*(3n.1V||3n.D)+H*(x.1V||x.D));D.6S=1h.3e(4B*3n.Z(\'2K\')+H*x.Z(\'2K\'));D.cJ=1h.3e(4B*(3g.1V||3g.D)+H*(y.1V||y.D));D.6V=1h.3e(4B*3g.Z(\'2K\')+H*y.Z(\'2K\'))}q(B.1g)B.1g.4C({x:D.3h,y:D.3r,w:D.5L+D.44+D.8U+2*x.cb,h:D.5K+D.45+D.8T+2*y.cb});1i.U.G.d7=\'d6(\'+(D.3r-3g.H)+\'F, \'+(D.5L+D.44+D.8U+D.3h+2*3n.cb-3n.H)+\'F, \'+(D.5K+D.45+D.8T+D.3r+2*3g.cb-3g.H)+\'F, \'+(D.3h-3n.H)+\'F)\';m.R(S,{Y:(D.45+y.Z(\'2K\'))+\'F\',1b:(D.44+x.Z(\'2K\'))+\'F\',4d:(y.H-D.3r)+\'F\',4W:(x.H-D.3h)+\'F\'});m.R(U,{Y:D.3r+\'F\',1b:D.3h+\'F\',L:(D.44+D.8U+D.5L+2*x.cb)+\'F\',N:(D.45+D.8T+D.5K+2*y.cb)+\'F\'});m.R(5l,{L:(D.cI||D.5L)+\'F\',N:(D.cJ||D.5K)+\'F\',1b:(D.44+D.6S)+\'F\',Y:(D.45+D.6V)+\'F\',1n:\'1Y\'});m.R(B.cN,{Y:(3g.H-D.3r+3g.1G-D.45+3g.Z(\'2K\')-D.6V)+\'F\',1b:(3n.H-D.3h+3n.1G-D.44+3n.Z(\'2K\')-D.6S)+\'F\'});m.R(B.cM,{1z:H,Y:(y.H-D.3r+y.1G-D.45+y.Z(\'2K\')-D.6V)+\'F\',1b:(x.H-D.3h+x.1G-D.44+x.Z(\'2K\')-D.6S)+\'F\'});q(1x)m.R(1x,{L:D.5L+\'F\',N:D.5K+\'F\',1b:(D.44+x.cb)+\'F\',Y:(D.45+y.cb)+\'F\'})},76:C(){U.G.1n=S.G.1n=\'1Y\';S.G.1o=\'3X\';m.3B(5l);B.6I();1i.5D();B.1i=I}})},bQ:C(o,el){q(!k.1i)E 1j;O(A i=0;i<k.1i.1T.V;i++){A 6G=m.$(\'22\'+k.1i.1T[i]);q(6G&&6G.22==o.22){k.9V();6G.cS=k.Q;m.2o(k.1T,k.1i.1T[i]);E M}}E 1j},6I:C(){k.55=M;k.3M();q(k.2A&&k.3U==\'6x\')k.6T();q(k.1k){1t{A B=k,2B=k.1k.9O||k.1k.6g.W;m.2j(2B,\'8y\',C(){q(m.3d!=B.Q)B.3M()})}1y(e){}q(m.2h&&1F k.62!=\'cW\')k.1k.G.L=(k.4j-1)+\'F\'}q(k.4b)m.1u(k);q(m.2q&&m.2q==k.a)m.2q=I;k.cL();A p=m.4g,8Q=m.7B.x+p.5O,8P=m.7B.y+p.5R;k.9C=k.x.H<8Q&&8Q<k.x.H+k.x.Z(\'2f\')&&k.y.H<8P&&8P<k.y.H+k.y.Z(\'2f\');q(k.1x)k.bn();m.1A(k,\'d1\')},cL:C(){A Q=k.Q;A 1Z=k.1Z;1J m.6r(1Z,C(){1t{m.16[Q].cP()}1y(e){}})},cP:C(){A 1D=k.7V(1);q(1D&&1D.2p.cC().3b(/m\\.2F/))A 1N=m.1d(\'1N\',{1e:m.7s(1D)})},7V:C(2n){A 7U=k.7v(),as=m.4U.3i[k.2N||\'1E\'];q(as&&!as[7U+2n]&&k.1p&&k.1p.cm){q(2n==1)E as[0];J q(2n==-1)E as[as.V-1]}E(as&&as[7U+2n])||I},7v:C(){A 2a=m.6p().3i[k.2N||\'1E\'];q(2a)O(A i=0;i<2a.V;i++){q(2a[i]==k.a)E i}E I},bq:C(){q(k[k.6l]){A 2a=m.4U.3i[k.2N||\'1E\'];q(2a){A s=m.18.3G.2k(\'%1\',k.7v()+1).2k(\'%2\',2a.V);k[k.6l].2d=\'<P 1W="K-3G">\'+s+\'</P>\'+k[k.6l].2d}}},a0:C(){q(!k.1i){O(A i=0;i<m.6u.V;i++){A 1R=m.6u[i],3c=1R.2N;q(1F 3c==\'1L\'||3c===I||3c===k.2N)k.1p=1J m.83(k.Q,1R)}}J{k.1p=k.1i.1p}A 1R=k.1p;q(!1R)E;A Q=1R.4k=k.Q;1R.ch();1R.5d(\'1a-2F\');q(1R.2X){k.4O(m.3A(1R.cB||{},{4P:1R.2X,22:\'2X\',1B:5}))}q(1R.2D)1R.2D.7p(k);q(!k.1i&&k.42)1R.3L(M);q(1R.42){1R.42=4a(C(){m.1D(Q)},(1R.fH||fs))}},6P:C(){m.3B(k.U);m.16[k.Q]=I;q(m.2q==k.a)m.2q=I;m.9x(k.Q);q(k.2r)m.2r.G.1b=\'-4v\';m.1A(k,\'cu\')},bp:C(){q(k.67)E;k.67=m.1d(\'a\',{21:m.ct,2L:m.cs,1c:\'K-67\',2d:m.18.cq,24:m.18.cr});k.4O({4P:k.67,1l:k.cv||\'Y 1b\',22:\'67\'})},a2:C(8f,cy){O(A i=0;i<8f.V;i++){A T=8f[i],s=I;q(T==\'9X\'&&!m.1A(k,\'eH\'))E;J q(T==\'58\'&&!m.1A(k,\'eG\'))E;q(!k[T+\'5p\']&&k.6Q)k[T+\'5p\']=T+\'-O-\'+k.6Q;q(k[T+\'5p\'])k[T]=m.4J(k[T+\'5p\']);q(!k[T]&&!k[T+\'8j\']&&k[T+\'cw\'])1t{s=fh(k[T+\'cw\'])}1y(e){}q(!k[T]&&k[T+\'8j\']){s=k[T+\'8j\']}q(!k[T]&&!s){k[T]=m.4J(k.a[\'cA\'+T+\'5p\']);q(!k[T]){A 1D=k.a.cz;5g(1D&&!m.77(1D)){q((1J 4Y(\'K-\'+T)).11(1D.1c||I)){q(!1D.1v)k.a[\'cA\'+T+\'5p\']=1D.1v=\'22\'+m.61++;k[T]=m.4J(1D.1v);5m}1D=1D.cz}}}q(!k[T]&&!s&&k.6l==T)s=\'\\n\';q(!k[T]&&s)k[T]=m.1d(\'P\',{1c:\'K-\'+T,2d:s});q(cy&&k[T]){A o={1l:(T==\'58\')?\'5N\':\'7E\'};O(A x 2Y k[T+\'cx\'])o[x]=k[T+\'cx\'][x];o.4P=k[T];k.4O(o)}}},59:C(1n){q(m.cO)k.6B(\'fk\',1n);q(m.cQ)k.6B(\'dd\',1n);q(m.6y)k.6B(\'*\',1n)},6B:C(3J,1n){A 1m=W.2C(3J);A 1f=3J==\'*\'?\'2e\':\'1n\';O(A i=0;i<1m.V;i++){q(1f==\'1n\'||(W.8L.cK(1m[i],"").co(\'2e\')==\'1M\'||1m[i].bH(\'1q-by\')!=I)){A 2S=1m[i].bH(\'1q-by\');q(1n==\'1Y\'&&2S){2S=2S.2k(\'[\'+k.Q+\']\',\'\');1m[i].5F(\'1q-by\',2S);q(!2S)1m[i].G[1f]=1m[i].9N}J q(1n==\'1q\'){A 3N=m.6K(1m[i]);3N.w=1m[i].1O;3N.h=1m[i].1U;q(!k.4b){A bl=(3N.x+3N.w<k.x.Z(\'6e\')||3N.x>k.x.Z(\'6e\')+k.x.Z(\'9R\'));A bG=(3N.y+3N.h<k.y.Z(\'6e\')||3N.y>k.y.Z(\'6e\')+k.y.Z(\'9R\'))}A 6F=m.9U(1m[i]);q(!bl&&!bG&&6F!=k.Q){q(!2S){1m[i].5F(\'1q-by\',\'[\'+k.Q+\']\');1m[i].9N=1m[i].G[1f];1m[i].G[1f]=\'1q\'}J q(2S.bF(\'[\'+k.Q+\']\')==-1){1m[i].5F(\'1q-by\',2S+\'[\'+k.Q+\']\')}}J q((2S==\'[\'+k.Q+\']\'||m.3d==6F)&&6F!=k.Q){1m[i].5F(\'1q-by\',\'\');1m[i].G[1f]=1m[i].9N||\'\'}J q(2S&&2S.bF(\'[\'+k.Q+\']\')>-1){1m[i].5F(\'1q-by\',2S.2k(\'[\'+k.Q+\']\',\'\'))}}}}},3M:C(){k.U.G.1B=m.4F+=2;O(A i=0;i<m.16.V;i++){q(m.16[i]&&i==m.3d){A 4r=m.16[i];4r.S.1c+=\' K-\'+4r.35+\'-9J\';q(4r.2E){4r.S.G.4L=m.3Z?\'bE\':\'7Q\';4r.S.24=m.18.bD}m.1A(4r,\'eW\')}}q(k.1g)k.1g.2g.G.1B=k.U.G.1B-1;k.S.1c=\'K-\'+k.35;q(k.2E){k.S.24=m.18.9W;q(m.6h){m.54=1S.3z?\'7Q\':\'7T(\'+m.5c+m.6h+\'), 7Q\';q(m.3Z&&m.2t<6)m.54=\'bE\';k.S.G.4L=m.54}}m.3d=k.Q;m.2j(W,1S.3z?\'6U\':\'71\',m.68);m.1A(k,\'fd\')},9m:C(x,y){k.x.aa(x);k.y.aa(y)},3O:C(e){A w,h,r=e.L/e.N;w=1h.4t(e.L+e.dX,1h.31(k.4s,k.x.1a));q(k.2E&&1h.9Y(w-k.x.1a)<12)w=k.x.1a;h=k.2A?e.N+e.dY:w/r;q(h<1h.31(k.6k,k.y.1a)){h=1h.31(k.6k,k.y.1a);q(k.2E)w=h*r}k.9h(w,h)},9h:C(w,h){k.y.72(h);k.x.72(w);k.U.G.N=k.y.Z(\'2f\')+\'F\'},26:C(){q(k.62||!k.55)E;q(k.3q[1]==\'4e\'&&m.2q){m.2G(m.2q).6P();m.2q=I}q(!m.1A(k,\'eV\'))E;k.62=M;q(k.1p&&!m.2q)k.1p.3p();m.4z(W,1S.3z?\'6U\':\'71\',m.68);1t{q(k.2A)k.bJ();k.S.G.4L=\'fj\';k.9b(0,{U:{L:k.x.t,N:k.y.t,1b:k.x.1K-k.x.cb+k.x.3s,Y:k.y.1K-k.y.cb+k.y.3s},S:{1b:0,Y:0,L:k.x.t,N:k.y.t}},m.9A)}1y(e){k.5D()}},bJ:C(){q(m.6y){q(!m.6s)m.6s=m.1d(\'P\',I,{1l:\'2l\'},m.2b);m.R(m.6s,{L:k.x.D+\'F\',N:k.y.D+\'F\',1b:k.x.H+\'F\',Y:k.y.H+\'F\',1o:\'3X\'})}q(k.2I==\'3x\')1t{m.$(k.19.1v).f9()}1y(e){}q(k.3U==\'6x\'&&!k.4D)k.bK();q(k.2s&&k.2s!=k.52)k.2s.G.2e=\'1q\'},bK:C(){q(m.2h&&k.1k)1t{k.1k.6g.W.19.2d=\'\'}1y(e){}q(k.2I==\'3x\')9p.fb(k.19.1v);k.19.2d=\'\'},bx:C(){q(k.1g)k.1g.2g.G.1o=\'1E\';k.3W=I;k.U.G.1o=\'1E\';k.55=1j;m.2o(m.4R,k)},bP:C(){1t{m.16[k.Q]=k;q(!m.9l&&m.3d!=k.Q){1t{m.16[m.3d].26()}1y(e){}}A z=m.4F++,5X={1o:\'\',1B:z};m.R(k.U,5X);k.62=1j;A o=k.1g||0;q(o){q(!k.3Y)5X.1n=\'1q\';m.R(o.2g,5X)}q(k.1p){k.a0()}k.a5()}1y(e){}},4O:C(o){A el=o.4P,53=(o.bO==\'2x\'&&!/7M$/.11(o.1l));q(1F el==\'a8\')el=m.4J(el);q(o.3D)el=m.1d(\'P\',{2d:o.3D});q(!el||1F el==\'a8\')E;q(!m.1A(k,\'f7\',{14:el}))E;el.G.1o=\'3X\';o.22=o.22||o.4P;q(k.3q[1]==\'4e\'&&k.bQ(o,el))E;k.9V();A L=o.L&&/^[0-9]+(F|%)$/.11(o.L)?o.L:\'1M\';q(/^(1b|3m)7M$/.11(o.1l)&&!/^[0-9]+F$/.11(o.L))L=\'f2\';A 14=m.1d(\'P\',{1v:\'22\'+m.61++,22:o.22},{1l:\'2l\',1n:\'1q\',L:L,9S:m.18.97||\'\',1z:0},53?m.2x:k.1x,M);q(53)14.6R=k.Q;14.1X(el);m.3A(14,{1z:1,bN:0,bL:0,4i:(o.6w===0||o.6w===1j||(o.6w==2&&m.2h))?0:5Z});m.3A(14,o);q(k.bo){k.5V(14);q(!14.7d||k.9C)m.2z(14,{1z:14.1z},14.4i)}m.2o(k.1T,m.61-1)},5V:C(14){A p=14.1l||\'9a 4X\',53=(14.bO==\'2x\'),74=14.bN,6O=14.bL;q(53){m.2x.G.1o=\'3X\';14.6R=k.Q;q(14.1O>14.23.1O)14.G.L=\'2w%\'}J q(14.23!=k.1x)k.1x.1X(14);q(/1b$/.11(p))14.G.1b=74+\'F\';q(/4X$/.11(p))m.R(14,{1b:\'50%\',4W:(74-1h.3e(14.1O/2))+\'F\'});q(/3m$/.11(p))14.G.3m=-74+\'F\';q(/^bM$/.11(p)){m.R(14,{3m:\'2w%\',9B:k.x.cb+\'F\',Y:-k.y.cb+\'F\',4Q:-k.y.cb+\'F\',2e:\'1M\'});k.x.1G=14.1O}J q(/^bC$/.11(p)){m.R(14,{1b:\'2w%\',4W:k.x.cb+\'F\',Y:-k.y.cb+\'F\',4Q:-k.y.cb+\'F\',2e:\'1M\'});k.x.36=14.1O}A 9d=14.23.1U;14.G.N=\'1M\';q(53&&14.1U>9d)14.G.N=m.3Z?9d+\'F\':\'2w%\';q(/^Y/.11(p))14.G.Y=6O+\'F\';q(/^9a/.11(p))m.R(14,{Y:\'50%\',4d:(6O-1h.3e(14.1U/2))+\'F\'});q(/^4Q/.11(p))14.G.4Q=-6O+\'F\';q(/^5N$/.11(p)){m.R(14,{1b:(-k.x.1G-k.x.cb)+\'F\',3m:(-k.x.36-k.x.cb)+\'F\',4Q:\'2w%\',6L:k.y.cb+\'F\',L:\'1M\'});k.y.1G=14.1U}J q(/^7E$/.11(p)){m.R(14,{1l:\'4y\',1b:(-k.x.1G-k.x.cb)+\'F\',3m:(-k.x.36-k.x.cb)+\'F\',Y:\'2w%\',4d:k.y.cb+\'F\',L:\'1M\'});k.y.36=14.1U;14.G.1l=\'2l\'}},bB:C(){k.a2([\'58\',\'9X\'],M);k.bq();q(k.9X)m.1A(k,\'eE\');q(k.58)m.1A(k,\'eF\');q(k.58&&k.a7)k.58.1c+=\' K-3u\';q(m.br)k.bp();O(A i=0;i<m.1T.V;i++){A o=m.1T[i],6N=o.9P,3c=o.2N;q((!6N&&!3c)||(6N&&6N==k.6Q)||(3c&&3c===k.2N)){q(k.2E||(k.2A&&o.eO))k.4O(o)}}A 7I=[];O(A i=0;i<k.1T.V;i++){A o=m.$(\'22\'+k.1T[i]);q(/7M$/.11(o.1l))k.5V(o);J m.2o(7I,o)}O(A i=0;i<7I.V;i++)k.5V(7I[i]);k.bo=M},9V:C(){q(!k.1x)k.1x=m.1d(\'P\',{1c:k.a9},{1l:\'2l\',L:(k.x.D||(k.3t?k.L:I)||k.x.1a)+\'F\',N:(k.y.D||k.y.1a)+\'F\',1n:\'1q\',2e:\'1q\',1B:m.2h?4:\'1M\'},m.2b,M)},57:C(98,bm){A 1x=k.1x,x=k.x,y=k.y;m.R(1x,{L:x.D+\'F\',N:y.D+\'F\'});q(98||bm){O(A i=0;i<k.1T.V;i++){A o=m.$(\'22\'+k.1T[i]);A 9E=(m.3Z||W.7a==\'8v\');q(o&&/^(5N|7E)$/.11(o.1l)){q(9E){o.G.L=(1x.1O+2*x.cb+x.1G+x.36)+\'F\'}y[o.1l==\'5N\'?\'1G\':\'36\']=o.1U}q(o&&9E&&/^(1b|3m)7M$/.11(o.1l)){o.G.N=(1x.1U+2*y.cb)+\'F\'}}}q(98){m.R(k.S,{Y:y.1G+\'F\'});m.R(1x,{Y:(y.1G+y.cb)+\'F\'})}},bn:C(){A b=k.1x;b.1c=\'\';m.R(b,{Y:(k.y.1G+k.y.cb)+\'F\',1b:(k.x.1G+k.x.cb)+\'F\',2e:\'1Y\'});q(m.4M)b.G.1n=\'1Y\';k.U.1X(b);O(A i=0;i<k.1T.V;i++){A o=m.$(\'22\'+k.1T[i]);o.G.1B=o.1B||4;q(!o.7d||k.9C){o.G.1n=\'1Y\';m.R(o,{1n:\'1Y\',1o:\'\'});m.2z(o,{1z:o.1z},o.4i)}}},78:C(){q(!k.1T.V)E;q(k.1p){A c=k.1p.2X;q(c&&m.2G(c)==k)c.23.9q(c)}O(A i=0;i<k.1T.V;i++){A o=m.$(\'22\'+k.1T[i]);q(o&&o.23==m.2x&&m.2G(o)==k)m.3B(o)}q(k.2A&&k.4D){k.1x.G.Y=\'-4v\';m.2b.1X(k.1x)}J m.3B(k.1x)},bs:C(){q(k.1p&&k.1p.2X){k.1p.4u(\'1a-2F\');E}k.7u=m.1d(\'a\',{21:\'bt:m.16[\'+k.Q+\'].7r();\',24:m.18.9Z,1c:\'K-1a-2F\'});q(!m.1A(k,\'fq\'))E;k.4O({4P:k.7u,1l:m.bz,7d:M,1z:m.bA})},7r:C(){1t{q(!m.1A(k,\'fZ\'))E;q(k.7u)m.3B(k.7u);k.3M();A 3f=k.x.D,3y=k.y.D;k.9h(k.x.1a,k.y.1a);A 3h=k.x.H-(k.x.D-3f)/2;q(3h<m.4W)3h=m.4W;A 3r=k.y.H-(k.y.D-3y)/2;q(3r<m.4d)3r=m.4d;k.9m(3h,3r);k.59(\'1q\')}1y(e){k.9o(e)}},5D:C(){k.a.1c=k.a.1c.2k(\'K-4I-46\',\'\');k.59(\'1Y\');q(k.2A&&k.4D&&k.3q[1]!=\'4e\'){k.bx()}J{q(k.1g&&k.3Y)k.1g.5U();m.3B(k.U)}q(m.6s)m.6s.G.1o=\'1E\';k.78();q(!m.2x.7L.V)m.2x.G.1o=\'1E\';q(k.4b)m.9x(k.Q);m.1A(k,\'fW\');m.16[k.Q]=I;m.bw()}};m.7x=C(a,S,7t){k.a=a;k.S=S;k.7t=7t};m.7x.5w={9r:C(){A 2V;q(!k.1e)k.1e=m.7s(k.a);q(k.1e.3b(\'#\')){A 2a=k.1e.7G(\'#\');k.1e=2a[0];k.1v=2a[1]}q(m.7k[k.1e]){k.cd=m.7k[k.1e];q(k.1v)k.a3();J k.6f();E}1t{2V=1J cp()}1y(e){1t{2V=1J bu("fS.bR")}1y(e){1t{2V=1J bu("bv.bR")}1y(e){k.9z()}}}A 3v=k;2V.gc=C(){q(3v.2V.bS==4){q(3v.1v)3v.a3();J 3v.6f()}};A 1e=k.1e;k.2V=2V;q(m.g3)1e=1e.2k(/$/,(/\\?/.11(1e)?\'&\':\'?\')+\'g6=\'+(1J 7K()).79());2V.ca(\'fQ\',1e,M);2V.ce(\'X-fA-fB\',\'cp\');2V.ce(\'fu-fv\',\'fL/x-fO-9j-fJ\');2V.fF(I)},a3:C(){m.7m();A 4l=1S.3z||m.cf?{1e:\'fI:eC\'}:I;k.1k=m.1d(\'1k\',4l,{1l:\'2l\',Y:\'-4v\'},m.2b);k.6f()},6f:C(){A s=k.cd||k.2V.dn,7H;q(k.7t)m.7k[k.1e]=s;q(!m.2h||m.2t>=5.5){s=s.2k(1J 4Y(\'<di[^>]*>\',\'c9\'),\'\').2k(1J 4Y(\'<cc[^>]*>.*?</cc>\',\'c9\'),\'\');q(k.1k){A 2B=k.1k.9O;q(!2B&&k.1k.6g)2B=k.1k.6g.W;q(!2B){A 3v=k;4a(C(){3v.6f()},25);E}2B.ca();2B.dg(s);2B.26();1t{s=2B.9Q(k.1v).2d}1y(e){1t{s=k.1k.W.9Q(k.1v).2d}1y(e){}}m.3B(k.1k)}J{7H=/(<19[^>]*>|<\\/19>)/db;q(7H.11(s))s=s.7G(7H)[m.3R?1:2]}}m.4p(k.S,\'7J\',\'K-19\').2d=s;k.3F();O(A x 2Y k)k[x]=I}};m.83=C(4k,1r){q(m.cX!==1j)m.95();k.4k=4k;O(A x 2Y 1r)k[x]=1r[x];q(k.cZ)k.cg();q(k.2D)k.2D=m.ci(k)};m.83.5w={cg:C(){k.2X=m.1d(\'P\',{2d:m.8b(m.8i.2X)},I,m.2b);A 6j=[\'3L\',\'3p\',\'3a\',\'1D\',\'3u\',\'1a-2F\',\'26\'];k.1Q={};A 3v=k;O(A i=0;i<6j.V;i++){k.1Q[6j[i]]=m.4p(k.2X,\'1H\',\'K-\'+6j[i]);k.4u(6j[i])}k.1Q.3p.G.1o=\'1E\'},ch:C(){q(k.cm||!k.2X)E;A B=m.16[k.4k],5q=B.7v(),2m=/7w$/;q(5q==0)k.5d(\'3a\');J q(2m.11(k.1Q.3a.2C(\'a\')[0].1c))k.4u(\'3a\');q(5q+1==m.4U.3i[B.2N||\'1E\'].V){k.5d(\'1D\');k.5d(\'3L\')}J q(2m.11(k.1Q.1D.2C(\'a\')[0].1c)){k.4u(\'1D\');k.4u(\'3L\')}},4u:C(1Q){q(!k.1Q)E;A cn=k,a=k.1Q[1Q].2C(\'a\')[0],2m=/7w$/;a.2p=C(){cn[1Q]();E 1j};q(2m.11(a.1c))a.1c=a.1c.2k(2m,\'\')},5d:C(1Q){q(!k.1Q)E;A a=k.1Q[1Q].2C(\'a\')[0];a.2p=C(){E 1j};q(!/7w$/.11(a.1c))a.1c+=\' 7w\'},cl:C(){q(k.42)k.3p();J k.3L()},3L:C(ck){q(k.1Q){k.1Q.3L.G.1o=\'1E\';k.1Q.3p.G.1o=\'\'}k.42=M;q(!ck)m.1D(k.4k)},3p:C(){q(k.1Q){k.1Q.3p.G.1o=\'1E\';k.1Q.3L.G.1o=\'\'}d9(k.42);k.42=I},3a:C(){k.3p();m.3a(k.1Q.3a)},1D:C(){k.3p();m.1D(k.1Q.1D)},3u:C(){},\'1a-2F\':C(){m.2G().7r()},26:C(){m.26(k.1Q.26)}};m.ci=C(1p){C 7p(B){m.3A(1r||{},{4P:4E,22:\'2D\',1c:\'K-2D-\'+5k+\'-14 \'+(1r.1c||\'\')});q(m.3Z)1r.6w=0;B.4O(1r);m.R(4E.23,{2e:\'1q\'})};C 28(3K){5t(1L,1h.3e(3K*4E[3S?\'1O\':\'1U\']*0.7))};C 5t(i,80){q(i===1L)O(A j=0;j<5I.V;j++){q(5I[j]==m.16[1p.4k].a){i=j;5m}}q(i===1L)E;A as=4E.2C(\'a\'),4I=as[i],48=4I.23,1b=3S?\'cj\':\'c8\',3m=3S?\'c7\':\'bX\',L=3S?\'bY\':\'bW\',4V=\'1w\'+1b,1O=\'1w\'+L,7e=P.23.23[1O],5j=7e-2g[1O],6o=3H(2g.G[3S?\'1b\':\'Y\'])||0,2O=6o,ej=20;q(80!==1L){2O=6o-80;q(5j>0)5j=0;q(2O>0)2O=0;q(2O<5j)2O=5j}J{O(A j=0;j<as.V;j++)as[j].1c=\'\';4I.1c=\'K-4I-46\';A 7X=i>0?as[i-1].23[4V]:48[4V],7Y=48[4V]+48[1O]+(as[i+1]?as[i+1].23[1O]:0);q(7Y>7e-6o)2O=7e-7Y;J q(7X<-6o)2O=-7X}A 8R=48[4V]+(48[1O]-7f[1O])/2+2O;m.2z(2g,3S?{1b:2O}:{Y:2O},I,\'8S\');m.2z(7f,3S?{1b:8R}:{Y:8R},I,\'8S\');8l.G.1o=2O<0?\'3X\':\'1E\';8M.G.1o=(2O>5j)?\'3X\':\'1E\'};A 5I=m.4U.3i[m.16[1p.4k].2N||\'1E\'],1r=1p.2D,5k=1r.5k||\'bV\',8K=(5k==\'en\'),4f=8K?[\'P\',\'6t\',\'1H\',\'1C\']:[\'2g\',\'4G\',\'47\',\'2J\'],3S=(5k==\'bV\'),4E=m.1d(\'P\',{1c:\'K-2D K-2D-\'+5k,2d:\'<P 1W="K-2D-eg">\'+\'<\'+4f[0]+\'><\'+4f[1]+\'></\'+4f[1]+\'></\'+4f[0]+\'></P>\'+\'<P 1W="K-28-1I"><P></P></P>\'+\'<P 1W="K-28-ee"><P></P></P>\'+\'<P 1W="K-7f"><P></P></P>\'},{1o:\'1E\'},m.2b),5E=4E.7L,P=5E[0],8l=5E[1],8M=5E[2],7f=5E[3],2g=P.ef,4G=4E.2C(4f[1])[0],47;O(A i=0;i<5I.V;i++){q(i==0||!3S)47=m.1d(4f[2],I,I,4G);(C(){A a=5I[i],48=m.1d(4f[3],I,I,47),ex=i;m.1d(\'a\',{21:a.21,24:a.24,2p:C(){q(/K-4I-46/.11(k.1c))E 1j;m.2G(k).3M();E m.8N(a)},2d:m.bT?m.bT(a):a.2d},I,48)})()}q(!8K){8l.2p=C(){28(-1)};8M.2p=C(){28(1)};m.2j(4G,W.eA!==1L?\'er\':\'eq\',C(e){A 3K=0;e=e||1S.2u;q(e.bU){3K=e.bU/dR;q(m.3z)3K=-3K}J q(e.bZ){3K=-e.bZ/3}q(3K)28(-3K*0.2);q(e.5n)e.5n();e.c0=1j})}E{7p:7p,5t:5t}};m.7o=m.18;A e8=m.5A;q(m.2h&&1S==1S.Y){(C(){1t{W.5h.e4(\'1b\')}1y(e){4a(c5.dZ,50);E}m.41()})()}m.2j(W,\'dW\',m.41);m.2j(1S,\'8B\',m.41);m.2j(W,\'41\',C(){q(m.7R||m.4b){A G=m.1d(\'G\',{T:\'e0/8I\'},I,W.2C(\'e1\')[0]),8E=W.7a==\'8v\';C 5P(8m,8n){q(m.2h&&(m.2t<9||8E)){A 1i=W.c6[W.c6.V-1];q(1F(1i.5P)=="7j")1i.5P(8m,8n)}J{G.1X(W.e6(8m+" {"+8n+"}"))}}C 5T(1f){E\'e5( ( ( ez = W.5h.\'+1f+\' ? W.5h.\'+1f+\' : W.19.\'+1f+\' ) ) + \\\'F\\\' );\'}q(m.7R)5P(\'.K 1N\',\'4L: 7T(\'+m.5c+m.7R+\'), 7Q !dA;\');5P(\'.K-2x-D\',m.2h&&(m.2t<7||8E)?\'1l: 2l; \'+\'1b:\'+5T(\'5O\')+\'Y:\'+5T(\'5R\')+\'L:\'+5T(\'8F\')+\'N:\'+5T(\'c4\'):\'1l: fV; L: 2w%; N: 2w%; 1b: 0; Y: 0\')}});m.2j(1S,\'3O\',C(){m.7S();q(m.2x)O(A i=0;i<m.2x.7L.V;i++){A 1P=m.2x.7L[i],B=m.2G(1P);B.5V(1P);q(1P.22==\'2D\')B.1p.2D.5t()}});m.2j(W,\'7D\',C(e){m.7B={x:e.7A,y:e.7F}});m.2j(W,\'8y\',m.8z);m.2j(W,\'c3\',m.8z);m.2j(W,\'41\',m.c1);m.2j(1S,\'8B\',m.c2);m.2j(1S,\'8B\',m.bI)}',62,1006,'||||||||||||||||||||this||hs||||if||||||||||var|exp|function|size|return|px|style|pos|null|else|highslide|width|true|height|for|div|key|setStyles|content|type|wrapper|length|document||top|get||test|||overlay||expanders||lang|body|full|left|className|createElement|src|prop|outline|Math|last|false|iframe|position|els|visibility|display|slideshow|hidden|options|innerContent|try|dim|id|offset|overlayBox|catch|opacity|fireEvent|zIndex|span|next|none|typeof|p1|li|up|new|tpos|undefined|auto|img|offsetWidth|node|btn|ss|window|overlays|offsetHeight|imgSize|class|appendChild|visible|outlineType||href|hsId|parentNode|title||close||scroll|params|arr|container|case|innerHTML|overflow|wsize|table|ie|to|addEventListener|replace|absolute|re|op|push|onclick|upcoming|loading|scrollerDiv|uaVersion|event|dimmer|100|viewport|dragArgs|animate|isHtml|doc|getElementsByTagName|thumbstrip|isImage|expand|getExpander|args|objectType|td|imgPad|target|ratio|slideshowGroup|tblPos|tgt|easing|image|hiddenBy|justify|minSize|xhr|ajax|controls|in|name|elem|min||||contentType|p2||||previous|match|sg|focusKey|round|xSize|lastY|xpos|groups|val|wh|ucwh|right|lastX|marginMin|pause|transitions|ypos|tb|useBox|move|pThis|clearing|swf|ySize|opera|extend|discardElement|opt|html|custom|onLoad|number|parseInt|hasDragged|tagName|delta|play|focus|elPos|resize|step|func|ieLt9|isX|changed|objectLoadTime|graphic|releaseMask|block|outlineWhileAnimating|ieLt7||ready|autoplay|getParam|xp1|yp1|anchor|tr|cell|styles|setTimeout|dimmingOpacity|mediumContent|marginTop|crossfade|tree|page|duration|dur|objectWidth|expKey|attribs|timers|pendingOutlines|now|getElementByClass|clone|blurExp|minWidth|max|enable|9999px|unit|objectHeight|relative|removeEventListener|navigator|invPos|setPosition|preserveContent|dom|zIndexCounter|tbody|tgtArr|active|getNode|clientSize|cursor|safari|onload|createOverlay|overlayId|bottom|sleeping|marginMax|start|anchors|offsetLeft|marginLeft|center|RegExp|images||end|scrollingContent|relToVP|styleRestoreCursor|isExpanded|htmls|sizeOverlayBox|heading|doShowHide|cacheBindings|hDiff|graphicsDir|disable|fitsize|cNode|while|documentElement|wDiff|minTblPos|mode|fadeBox|break|preventDefault|ruler|Id|cur|owner|allowReduce|selectThumb|moveOnly|area|prototype|minX|currentStyle|maxY|Expander|minY|iDoc|afterClose|domCh|setAttribute|toLowerCase|maxX|group|cloneNode|ysize|xsize|trans|above|scrollLeft|addRule|filter|scrollTop|padToMinWidth|fix|destroy|positionOverlay|fac|stl|allowSizeReduction|250|before|idCounter|isClosing|iebody|preloadTheseImages|on|over|credits|keyHandler|contentLoaded|getParams|param|parent|userAgent|opos|loadHTML|contentWindow|restoreCursor|obj|buttons|minHeight|numberPosition|uclt|showLoading|curTblPos|getAnchors|all|Outline|mask|ul|slideshows|matches|fade|after|geckoMac|cache|Dimension|showHideElements|maincontent|onLoadStarted|kdeBugCorr|wrapperKey|oDiv|dragHandler|afterExpand|allowWidthReduction|getPosition|marginBottom|maxWidth|tId|offY|cancelLoading|thumbsUserSetId|hsKey|ximgPad|writeExtendedContent|keypress|yimgPad|expandDuration|allowHeightReduction|lt|dir||keydown|setSize|525|offX||complete|isHsAnchor|destroyOverlays|getTime|compatMode|rel|self|hideOnMouseOut|overlayWidth|marker|curAnim|expOnly|gotoEnd|object|cachedGets|onReady|init|topmostKey|langDefaults|add|preloadTheseAjax|doFullExpand|getSrc|pre|fullExpandLabel|getAnchorIndex|disabled|Ajax|element|adj|clientX|mouse|preloadFullImage|mousemove|below|clientY|split|regBody|os|DIV|Date|childNodes|panel|imgs|previousOrNext|relatedTarget|pointer|expandCursor|getPageSize|url|current|getAdjacentAnchor|cacheAjax|activeLeft|activeRight|htmlGetSize|scrollBy|pixDimmerSize|update|Slideshow|isNew|location|getCacheBinding|dimmingDuration|contentId|getSelfRendered|calcBorders|replaceLang|clones|topZ|swfOptions|types|oPos|calcExpanded|skin|Text|preloadAjaxElement|scrollUp|sel|dec|other|getIframePageHeight|endOff|startOff|previousTitle|names|from|BackCompat|arrow|fitOverlayBox|mousedown|mouseClickHandler|correctIframeSize|load|hasMovedMin|maxsize|backCompat|clientWidth|Click|border|css|parseFloat|floatMode|defaultView|scrollDown|transit|offsetTop|mY|mX|markerPos|easeOutQuad|yp2|xp2|moveTitle|nextText|nextTitle|previousText|moveText|closeTitle|setObjContainerSize|closeText|props|padding|updateAnchors|state|cssDirection|doWrapper||middle|changeSize|startTime|parOff|sizeDiff|numberOfImagesToPreload|distance|resizeTo|maxHeight|form|srcElement|allowMultipleInstances|moveTo|align|error|swfobject|removeChild|run|done|background|htmlExpand|loadingPosXfade|openerTagNames|undim|garbageBin|onError|restoreDuration|marginRight|mouseIsOver|margin|ie6|isReady|hasAlphaImageLoader|Create|connectOutline|blur|evt|ucrb|calcThumb|origProp|contentDocument|thumbnailId|getElementById|osize|direction|loadingPos|getWrapperKey|genOverlayBox|restoreTitle|caption|abs|fullExpandTitle|initSlideshow|continuePreloading|getInline|getElementContent|overrides|show|hasFocused|dragByHeading|string|wrapperClassName|setPos|playText|pauseText|pauseTitle|fullExpandText|timerId|Move|Pause|preloadGraphic|spacebar|png|Play|Close|Highslide|JS|_default|Previous|appendTo||KDE|playTitle|vendor|200|call|Next|onGraphicLoad|and|vis|targetY|hasExtendedContent|pow|attributes|flashvars|isUnobtrusiveAnchor|hsHasSetClick|clear|ltr|newHeight|detachEvent|wmode|clickY|wrapperMouseHandler|focusTopmost|dimmingGeckoFix|enableKeyListener|fixedControls|hasHtmlExpanders|clickX|thumb|pageOrigin|loadingTitle|loadingText|resizeTitle|targetX|headingOverlay|captionOverlay|htmlSizeOperations|rb|switch|orig|getImageMapAreaCorrection|rv|tag|offsetParent|both|contentWrapper|loadingOpacity|pageXOffset|alpha|nopad|toUpperCase|easeInQuad|hide|clearsX|doPanels|showOverlays|gotOverlays|writeCredits|getNumber|showCredits|createFullExpand|javascript|ActiveXObject|Microsoft|reOrder|sleep||fullExpandPosition|fullExpandOpacity|getOverlays|rightpanel|focusTitle|hand|indexOf|clearsY|getAttribute|preloadAjax|htmlPrepareClose|destroyObject|offsetY|leftpanel|offsetX|relativeTo|awake|reuseOverlay|XMLHTTP|readyState|stripItemFormatter|wheelDelta|horizontal|Height|Bottom|Width|detail|returnValue|setClickEvents|preloadImages|mouseup|clientHeight|arguments|styleSheets|Right|Top|gi|open||script|cachedGet|setRequestHeader|ie6SSL|getControls|checkFirstAndLast|Thumbstrip|Left|wait|hitSpace|repeat|sls|getPropertyValue|XMLHttpRequest|creditsText|creditsTitle|creditsTarget|creditsHref|onHideLoading|creditsPosition|Eval|Overlay|addOverlay|nextSibling|_|overlayOptions|toString|fadeInOut|transitionDuration|easingClose|correctRatio|tmpMin|ximgSize|yimgSize|getComputedStyle|prepareNextOutline|newImg|oldImg|hideSelects|preloadNext|hideIframes|scrollWidth|reuse|iPod|iPhone|scrollHeight|boolean|dynamicallyUpdateAnchors|10001|useControls|geckodimmer|onAfterExpand|iPad|onDimmerClick|htmlCreate|onShowLoading|rect|clip|nodeName|clearTimeout|onBeforeGetContent|ig|dimming|IFRAME|300|Android|write|xpand|link|htmlE|Line|lineNumber|floor|responseText|onDrop|oncontextmenu|alert|onImageClick|button|addSlideshow|registerOverlay|zoomin|graphics|zoomout|keyCode|onKeyDown|important|keys|click|message|drag|Use|insertBefore|flushImgSize|headingText|headingEval|headingId|captionEval|captionText|maincontentId|maincontentText|Trident|it|120|reflow|maincontentEval|captionId|shadow|DOMContentLoaded|||callee|text|HEAD|header|blockRightClick|doScroll|expression|createTextNode|footer|HsExpander|ra|Safari|useMap|_self|pageYOffset|down|firstChild|inner|com|outlineStartOffset|mgnRight|onSetClickEvent||http|float|innerHeight|innerWidth|DOMMouseScroll|mousewheel|Gecko|onBeforeExpand|Macintosh|drop|removeAttribute|pI|imageCreate|ignoreMe|onmousewheel|white|blank|esc|onAfterGetCaption|onAfterGetHeading|onBeforeGetHeading|onBeforeGetCaption|circle|cellSpacing|fontSize|lineHeight|collapse|borderCollapse|useOnHtml|newWidth|frameborder|front|onmouseout|clearInterval|01|onBeforeClose|onBlur|onmouseover|Resize|Expand|fit|outlinesDir|200px|onInit|Go|allowSimultaneousLoading|the|onCreateOverlay|Powered|StopPlay|static|removeSWF|actual|onFocus|scale|shape|homepage|eval|outlines|default|SELECT|sizingMethod|AlphaImageLoader|DXImageTransform|progid|onAfterGetContent|onCreateFullExpand|onMouseOut|500|onMouseOver|Content|Type|Loading||attachEvent|of|Requested|With|coords|toElement|fromElement|send|sqrt|interval|about|urlencoded|dragSensitivity|application|mouseover|onDrag|www|cancel|GET|transparent|Msxml2|embedSWF|onActivate|fixed|onAfterClose|setInterval|flash|onDoFullExpand|bring|version|linearTween|forceAjaxReload|https|protocol|dummy|Image|debug|paddingTop|1px|expressInstallSwfurl|onreadystatechange|splice'.split('|'),0,{}))
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide-ie6.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide-ie6.css
new file mode 100644
index 0000000000000000000000000000000000000000..b4d54840d6a0a7cbc2b3f8ef1e107c5b6f0c2bf8
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide-ie6.css
@@ -0,0 +1,76 @@
+.closebutton {
+    /* NOTE! This URL is relative to the HTML page, not the CSS */
+	filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(
+		src='../highslide/graphics/close.png', sizingMethod='scale');
+
+	background: none;
+	cursor: hand;
+}
+
+/* Viewport fixed hack */
+.highslide-viewport {
+	position: absolute;
+    left: expression( ( ( ignoreMe1 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' );
+	top: expression( ( ignoreMe2 = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) + 'px' );
+	width: expression( ( ( ignoreMe3 = document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth ) ) + 'px' );
+	height: expression( ( ( ignoreMe4 = document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight ) ) + 'px' );
+}
+
+/* Thumbstrip PNG fix */
+.highslide-scroll-down, .highslide-scroll-up {
+	position: relative;
+	overflow: hidden;
+}
+.highslide-scroll-down div, .highslide-scroll-up div {
+	/* NOTE! This URL is relative to the HTML page, not the CSS */
+	filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(
+		src='../highslide/graphics/scrollarrows.png', sizingMethod='scale');
+	background: none !important;
+	position: absolute;
+	cursor: hand;
+	width: 75px;
+	height: 75px !important;
+}
+.highslide-thumbstrip-horizontal .highslide-scroll-down div {
+	left: -50px;
+	top: -15px;
+}
+.highslide-thumbstrip-horizontal .highslide-scroll-up div {
+	top: -15px;
+}
+.highslide-thumbstrip-vertical .highslide-scroll-down div {
+	top: -50px;
+}
+
+/* Thumbstrip marker arrow trasparent background fix */
+.highslide-thumbstrip .highslide-marker {
+	border-color: white; /* match the background */
+}
+.dark .highslide-thumbstrip-horizontal .highslide-marker {
+	border-color: #111;
+}
+.highslide-viewport .highslide-marker {
+	border-color: #333;
+}
+.highslide-thumbstrip {
+	float: left;
+}
+
+/* Positioning fixes for the control bar */
+.text-controls .highslide-controls {
+	width: 480px;
+}
+.text-controls a span {
+	width: 4em;
+}
+.text-controls .highslide-full-expand a span {
+	width: 0;
+}
+.text-controls .highslide-close a span {
+	width: 0;
+}
+
+/* Special */
+.in-page .highslide-thumbstrip-horizontal .highslide-marker {
+    border-bottom: gray;
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide-with-gallery.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide-with-gallery.js
new file mode 100644
index 0000000000000000000000000000000000000000..fa1333e252774c461acb9f8961f0c52926076020
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide-with-gallery.js
@@ -0,0 +1,2657 @@
+/** 
+ * Name:    Highslide JS
+ * Version: 4.1.13 (2011-10-06)
+ * Config:  default +slideshow +positioning +transitions +viewport +thumbstrip
+ * Author:  Torstein Hønsi
+ * Support: www.highslide.com/support
+ * License: www.highslide.com/#license
+ */
+if (!hs) { var hs = {
+// Language strings
+lang : {
+	cssDirection: 'ltr',
+	loadingText : 'Loading...',
+	loadingTitle : 'Click to cancel',
+	focusTitle : 'Click to bring to front',
+	fullExpandTitle : 'Expand to actual size (f)',
+	creditsText : 'Powered by <i>Highslide JS</i>',
+	creditsTitle : 'Go to the Highslide JS homepage',
+	previousText : 'Previous',
+	nextText : 'Next', 
+	moveText : 'Move',
+	closeText : 'Close', 
+	closeTitle : 'Close (esc)', 
+	resizeTitle : 'Resize',
+	playText : 'Play',
+	playTitle : 'Play slideshow (spacebar)',
+	pauseText : 'Pause',
+	pauseTitle : 'Pause slideshow (spacebar)',
+	previousTitle : 'Previous (arrow left)',
+	nextTitle : 'Next (arrow right)',
+	moveTitle : 'Move',
+	fullExpandText : '1:1',
+	number: 'Image %1 of %2',
+	restoreTitle : 'Click to close image, click and drag to move. Use arrow keys for next and previous.'
+},
+// See http://highslide.com/ref for examples of settings  
+graphicsDir : 'highslide/graphics/',
+expandCursor : 'zoomin.cur', // null disables
+restoreCursor : 'zoomout.cur', // null disables
+expandDuration : 250, // milliseconds
+restoreDuration : 250,
+marginLeft : 15,
+marginRight : 15,
+marginTop : 15,
+marginBottom : 15,
+zIndexCounter : 1001, // adjust to other absolutely positioned elements
+loadingOpacity : 0.75,
+allowMultipleInstances: true,
+numberOfImagesToPreload : 5,
+outlineWhileAnimating : 2, // 0 = never, 1 = always, 2 = HTML only 
+outlineStartOffset : 3, // ends at 10
+padToMinWidth : false, // pad the popup width to make room for wide caption
+fullExpandPosition : 'bottom right',
+fullExpandOpacity : 1,
+showCredits : true, // you can set this to false if you want
+creditsHref : 'http://highslide.com/',
+creditsTarget : '_self',
+enableKeyListener : true,
+openerTagNames : ['a'], // Add more to allow slideshow indexing
+transitions : [],
+transitionDuration: 250,
+dimmingOpacity: 0, // Lightbox style dimming background
+dimmingDuration: 50, // 0 for instant dimming
+
+anchor : 'auto', // where the image expands from
+align : 'auto', // position in the client (overrides anchor)
+targetX: null, // the id of a target element
+targetY: null,
+dragByHeading: true,
+minWidth: 200,
+minHeight: 200,
+allowSizeReduction: true, // allow the image to reduce to fit client size. If false, this overrides minWidth and minHeight
+outlineType : 'drop-shadow', // set null to disable outlines
+skin : {
+	controls:
+		'<div class="highslide-controls"><ul>'+
+			'<li class="highslide-previous">'+
+				'<a href="#" title="{hs.lang.previousTitle}">'+
+				'<span>{hs.lang.previousText}</span></a>'+
+			'</li>'+
+			'<li class="highslide-play">'+
+				'<a href="#" title="{hs.lang.playTitle}">'+
+				'<span>{hs.lang.playText}</span></a>'+
+			'</li>'+
+			'<li class="highslide-pause">'+
+				'<a href="#" title="{hs.lang.pauseTitle}">'+
+				'<span>{hs.lang.pauseText}</span></a>'+
+			'</li>'+
+			'<li class="highslide-next">'+
+				'<a href="#" title="{hs.lang.nextTitle}">'+
+				'<span>{hs.lang.nextText}</span></a>'+
+			'</li>'+
+			'<li class="highslide-move">'+
+				'<a href="#" title="{hs.lang.moveTitle}">'+
+				'<span>{hs.lang.moveText}</span></a>'+
+			'</li>'+
+			'<li class="highslide-full-expand">'+
+				'<a href="#" title="{hs.lang.fullExpandTitle}">'+
+				'<span>{hs.lang.fullExpandText}</span></a>'+
+			'</li>'+
+			'<li class="highslide-close">'+
+				'<a href="#" title="{hs.lang.closeTitle}" >'+
+				'<span>{hs.lang.closeText}</span></a>'+
+			'</li>'+
+		'</ul></div>'
+},
+// END OF YOUR SETTINGS
+
+
+// declare internal properties
+preloadTheseImages : [],
+continuePreloading: true,
+expanders : [],
+overrides : [
+	'allowSizeReduction',
+	'useBox',
+	'anchor',
+	'align',
+	'targetX',
+	'targetY',
+	'outlineType',
+	'outlineWhileAnimating',
+	'captionId',
+	'captionText',
+	'captionEval',
+	'captionOverlay',
+	'headingId',
+	'headingText',
+	'headingEval',
+	'headingOverlay',
+	'creditsPosition',
+	'dragByHeading',
+	'autoplay',
+	'numberPosition',
+	'transitions',
+	'dimmingOpacity',
+	
+	'width',
+	'height',
+	
+	'wrapperClassName',
+	'minWidth',
+	'minHeight',
+	'maxWidth',
+	'maxHeight',
+	'pageOrigin',
+	'slideshowGroup',
+	'easing',
+	'easingClose',
+	'fadeInOut',
+	'src'
+],
+overlays : [],
+idCounter : 0,
+oPos : {
+	x: ['leftpanel', 'left', 'center', 'right', 'rightpanel'],
+	y: ['above', 'top', 'middle', 'bottom', 'below']
+},
+mouse: {},
+headingOverlay: {},
+captionOverlay: {},
+timers : [],
+
+slideshows : [],
+
+pendingOutlines : {},
+clones : {},
+onReady: [],
+uaVersion: /Trident\/4\.0/.test(navigator.userAgent) ? 8 :
+	parseFloat((navigator.userAgent.toLowerCase().match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1]),
+ie : (document.all && !window.opera),
+//ie : navigator && /MSIE [678]/.test(navigator.userAgent), // ie9 compliant?
+safari : /Safari/.test(navigator.userAgent),
+geckoMac : /Macintosh.+rv:1\.[0-8].+Gecko/.test(navigator.userAgent),
+
+$ : function (id) {
+	if (id) return document.getElementById(id);
+},
+
+push : function (arr, val) {
+	arr[arr.length] = val;
+},
+
+createElement : function (tag, attribs, styles, parent, nopad) {
+	var el = document.createElement(tag);
+	if (attribs) hs.extend(el, attribs);
+	if (nopad) hs.setStyles(el, {padding: 0, border: 'none', margin: 0});
+	if (styles) hs.setStyles(el, styles);
+	if (parent) parent.appendChild(el);	
+	return el;
+},
+
+extend : function (el, attribs) {
+	for (var x in attribs) el[x] = attribs[x];
+	return el;
+},
+
+setStyles : function (el, styles) {
+	for (var x in styles) {
+		if (hs.ieLt9 && x == 'opacity') {
+			if (styles[x] > 0.99) el.style.removeAttribute('filter');
+			else el.style.filter = 'alpha(opacity='+ (styles[x] * 100) +')';
+		}
+		else el.style[x] = styles[x];		
+	}
+},
+animate: function(el, prop, opt) {
+	var start,
+		end,
+		unit;
+	if (typeof opt != 'object' || opt === null) {
+		var args = arguments;
+		opt = {
+			duration: args[2],
+			easing: args[3],
+			complete: args[4]
+		};
+	}
+	if (typeof opt.duration != 'number') opt.duration = 250;
+	opt.easing = Math[opt.easing] || Math.easeInQuad;
+	opt.curAnim = hs.extend({}, prop);
+	for (var name in prop) {
+		var e = new hs.fx(el, opt , name );
+		
+		start = parseFloat(hs.css(el, name)) || 0;
+		end = parseFloat(prop[name]);
+		unit = name != 'opacity' ? 'px' : '';
+		
+		e.custom( start, end, unit );
+	}	
+},
+css: function(el, prop) {
+	if (el.style[prop]) {
+		return el.style[prop];
+	} else if (document.defaultView) {
+		return document.defaultView.getComputedStyle(el, null).getPropertyValue(prop);
+
+	} else {
+		if (prop == 'opacity') prop = 'filter';
+		var val = el.currentStyle[prop.replace(/\-(\w)/g, function (a, b){ return b.toUpperCase(); })];
+		if (prop == 'filter') 
+			val = val.replace(/alpha\(opacity=([0-9]+)\)/, 
+				function (a, b) { return b / 100 });
+		return val === '' ? 1 : val;
+	} 
+},
+
+getPageSize : function () {
+	var d = document, w = window, iebody = d.compatMode && d.compatMode != 'BackCompat' 
+		? d.documentElement : d.body,
+		ieLt9 = hs.ie && (hs.uaVersion < 9 || typeof pageXOffset == 'undefined');
+	
+	var width = ieLt9 ? iebody.clientWidth : 
+			(d.documentElement.clientWidth || self.innerWidth),
+		height = ieLt9 ? iebody.clientHeight : self.innerHeight;
+	hs.page = {
+		width: width,
+		height: height,		
+		scrollLeft: ieLt9 ? iebody.scrollLeft : pageXOffset,
+		scrollTop: ieLt9 ? iebody.scrollTop : pageYOffset
+	};
+	return hs.page;
+},
+
+getPosition : function(el)	{
+	var p = { x: el.offsetLeft, y: el.offsetTop };
+	while (el.offsetParent)	{
+		el = el.offsetParent;
+		p.x += el.offsetLeft;
+		p.y += el.offsetTop;
+		if (el != document.body && el != document.documentElement) {
+			p.x -= el.scrollLeft;
+			p.y -= el.scrollTop;
+		}
+	}
+	return p;
+},
+
+expand : function(a, params, custom, type) {
+	if (!a) a = hs.createElement('a', null, { display: 'none' }, hs.container);
+	if (typeof a.getParams == 'function') return params;	
+	try {	
+		new hs.Expander(a, params, custom);
+		return false;
+	} catch (e) { return true; }
+},
+getElementByClass : function (el, tagName, className) {
+	var els = el.getElementsByTagName(tagName);
+	for (var i = 0; i < els.length; i++) {
+    	if ((new RegExp(className)).test(els[i].className)) {
+			return els[i];
+		}
+	}
+	return null;
+},
+replaceLang : function(s) {
+	s = s.replace(/\s/g, ' ');
+	var re = /{hs\.lang\.([^}]+)\}/g,
+		matches = s.match(re),
+		lang;
+	if (matches) for (var i = 0; i < matches.length; i++) {
+		lang = matches[i].replace(re, "$1");
+		if (typeof hs.lang[lang] != 'undefined') s = s.replace(matches[i], hs.lang[lang]);
+	}
+	return s;
+},
+
+
+focusTopmost : function() {
+	var topZ = 0, 
+		topmostKey = -1,
+		expanders = hs.expanders,
+		exp,
+		zIndex;
+	for (var i = 0; i < expanders.length; i++) {
+		exp = expanders[i];
+		if (exp) {
+			zIndex = exp.wrapper.style.zIndex;
+			if (zIndex && zIndex > topZ) {
+				topZ = zIndex;				
+				topmostKey = i;
+			}
+		}
+	}
+	if (topmostKey == -1) hs.focusKey = -1;
+	else expanders[topmostKey].focus();
+},
+
+getParam : function (a, param) {
+	a.getParams = a.onclick;
+	var p = a.getParams ? a.getParams() : null;
+	a.getParams = null;
+	
+	return (p && typeof p[param] != 'undefined') ? p[param] : 
+		(typeof hs[param] != 'undefined' ? hs[param] : null);
+},
+
+getSrc : function (a) {
+	var src = hs.getParam(a, 'src');
+	if (src) return src;
+	return a.href;
+},
+
+getNode : function (id) {
+	var node = hs.$(id), clone = hs.clones[id], a = {};
+	if (!node && !clone) return null;
+	if (!clone) {
+		clone = node.cloneNode(true);
+		clone.id = '';
+		hs.clones[id] = clone;
+		return node;
+	} else {
+		return clone.cloneNode(true);
+	}
+},
+
+discardElement : function(d) {
+	if (d) hs.garbageBin.appendChild(d);
+	hs.garbageBin.innerHTML = '';
+},
+dim : function(exp) {
+	if (!hs.dimmer) {
+		isNew = true;
+		hs.dimmer = hs.createElement ('div', {
+				className: 'highslide-dimming highslide-viewport-size',
+				owner: '',
+				onclick: function() {
+					
+						hs.close();
+				}
+			}, {
+                visibility: 'visible',
+				opacity: 0
+			}, hs.container, true);
+			
+		if (/(Android|iPad|iPhone|iPod)/.test(navigator.userAgent)) {
+			var body = document.body;
+			function pixDimmerSize() {
+				hs.setStyles(hs.dimmer, {
+					width: body.scrollWidth +'px',
+					height: body.scrollHeight +'px'
+				});
+			}
+			pixDimmerSize();
+			hs.addEventListener(window, 'resize', pixDimmerSize);
+		}
+	}
+	hs.dimmer.style.display = '';
+
+	var isNew = hs.dimmer.owner == '';
+	hs.dimmer.owner += '|'+ exp.key;
+	
+	if (isNew) {
+		if (hs.geckoMac && hs.dimmingGeckoFix)
+			hs.setStyles(hs.dimmer, {
+				background: 'url('+ hs.graphicsDir + 'geckodimmer.png)',
+				opacity: 1
+			});
+		else
+			hs.animate(hs.dimmer, { opacity: exp.dimmingOpacity }, hs.dimmingDuration);
+	}
+},
+undim : function(key) {
+	if (!hs.dimmer) return;
+	if (typeof key != 'undefined') hs.dimmer.owner = hs.dimmer.owner.replace('|'+ key, '');
+
+	if (
+		(typeof key != 'undefined' && hs.dimmer.owner != '')
+		|| (hs.upcoming && hs.getParam(hs.upcoming, 'dimmingOpacity'))
+	) return;
+
+	if (hs.geckoMac && hs.dimmingGeckoFix) hs.dimmer.style.display = 'none';
+	else hs.animate(hs.dimmer, { opacity: 0 }, hs.dimmingDuration, null, function() {
+		hs.dimmer.style.display = 'none';
+	});
+},
+transit : function (adj, exp) {
+	var last = exp || hs.getExpander();
+	exp = last;
+	if (hs.upcoming) return false;
+	else hs.last = last;
+	hs.removeEventListener(document, window.opera ? 'keypress' : 'keydown', hs.keyHandler);
+	try {
+		hs.upcoming = adj;
+		adj.onclick(); 		
+	} catch (e){
+		hs.last = hs.upcoming = null;
+	}
+	try {
+		if (!adj || exp.transitions[1] != 'crossfade')
+		exp.close();
+	} catch (e) {}
+	return false;
+},
+
+previousOrNext : function (el, op) {
+	var exp = hs.getExpander(el);
+	if (exp) return hs.transit(exp.getAdjacentAnchor(op), exp);
+	else return false;
+},
+
+previous : function (el) {
+	return hs.previousOrNext(el, -1);
+},
+
+next : function (el) {
+	return hs.previousOrNext(el, 1);	
+},
+
+keyHandler : function(e) {
+	if (!e) e = window.event;
+	if (!e.target) e.target = e.srcElement; // ie
+	if (typeof e.target.form != 'undefined') return true; // form element has focus
+	var exp = hs.getExpander();
+	
+	var op = null;
+	switch (e.keyCode) {
+		case 70: // f
+			if (exp) exp.doFullExpand();
+			return true;
+		case 32: // Space
+			op = 2;
+			break;
+		case 34: // Page Down
+		case 39: // Arrow right
+		case 40: // Arrow down
+			op = 1;
+			break;
+		case 8:  // Backspace
+		case 33: // Page Up
+		case 37: // Arrow left
+		case 38: // Arrow up
+			op = -1;
+			break;
+		case 27: // Escape
+		case 13: // Enter
+			op = 0;
+	}
+	if (op !== null) {if (op != 2)hs.removeEventListener(document, window.opera ? 'keypress' : 'keydown', hs.keyHandler);
+		if (!hs.enableKeyListener) return true;
+		
+		if (e.preventDefault) e.preventDefault();
+    	else e.returnValue = false;
+    	if (exp) {
+			if (op == 0) {
+				exp.close();
+			} else if (op == 2) {
+				if (exp.slideshow) exp.slideshow.hitSpace();
+			} else {
+				if (exp.slideshow) exp.slideshow.pause();
+				hs.previousOrNext(exp.key, op);
+			}
+			return false;
+		}
+	}
+	return true;
+},
+
+
+registerOverlay : function (overlay) {
+	hs.push(hs.overlays, hs.extend(overlay, { hsId: 'hsId'+ hs.idCounter++ } ));
+},
+
+
+addSlideshow : function (options) {
+	var sg = options.slideshowGroup;
+	if (typeof sg == 'object') {
+		for (var i = 0; i < sg.length; i++) {
+			var o = {};
+			for (var x in options) o[x] = options[x];
+			o.slideshowGroup = sg[i];
+			hs.push(hs.slideshows, o);
+		}
+	} else {
+		hs.push(hs.slideshows, options);
+	}
+},
+
+getWrapperKey : function (element, expOnly) {
+	var el, re = /^highslide-wrapper-([0-9]+)$/;
+	// 1. look in open expanders
+	el = element;
+	while (el.parentNode)	{
+		if (el.hsKey !== undefined) return el.hsKey;
+		if (el.id && re.test(el.id)) return el.id.replace(re, "$1");
+		el = el.parentNode;
+	}
+	// 2. look in thumbnail
+	if (!expOnly) {
+		el = element;
+		while (el.parentNode)	{
+			if (el.tagName && hs.isHsAnchor(el)) {
+				for (var key = 0; key < hs.expanders.length; key++) {
+					var exp = hs.expanders[key];
+					if (exp && exp.a == el) return key;
+				}
+			}
+			el = el.parentNode;
+		}
+	}
+	return null; 
+},
+
+getExpander : function (el, expOnly) {
+	if (typeof el == 'undefined') return hs.expanders[hs.focusKey] || null;
+	if (typeof el == 'number') return hs.expanders[el] || null;
+	if (typeof el == 'string') el = hs.$(el);
+	return hs.expanders[hs.getWrapperKey(el, expOnly)] || null;
+},
+
+isHsAnchor : function (a) {
+	return (a.onclick && a.onclick.toString().replace(/\s/g, ' ').match(/hs.(htmlE|e)xpand/));
+},
+
+reOrder : function () {
+	for (var i = 0; i < hs.expanders.length; i++)
+		if (hs.expanders[i] && hs.expanders[i].isExpanded) hs.focusTopmost();
+},
+
+mouseClickHandler : function(e) 
+{	
+	if (!e) e = window.event;
+	if (e.button > 1) return true;
+	if (!e.target) e.target = e.srcElement;
+	
+	var el = e.target;
+	while (el.parentNode
+		&& !(/highslide-(image|move|html|resize)/.test(el.className)))
+	{
+		el = el.parentNode;
+	}
+	var exp = hs.getExpander(el);
+	if (exp && (exp.isClosing || !exp.isExpanded)) return true;
+		
+	if (exp && e.type == 'mousedown') {
+		if (e.target.form) return true;
+		var match = el.className.match(/highslide-(image|move|resize)/);
+		if (match) {
+			hs.dragArgs = { 
+				exp: exp , 
+				type: match[1], 
+				left: exp.x.pos, 
+				width: exp.x.size, 
+				top: exp.y.pos, 
+				height: exp.y.size, 
+				clickX: e.clientX, 
+				clickY: e.clientY
+			};
+			
+			
+			hs.addEventListener(document, 'mousemove', hs.dragHandler);
+			if (e.preventDefault) e.preventDefault(); // FF
+			
+			if (/highslide-(image|html)-blur/.test(exp.content.className)) {
+				exp.focus();
+				hs.hasFocused = true;
+			}
+			return false;
+		}
+	} else if (e.type == 'mouseup') {
+		
+		hs.removeEventListener(document, 'mousemove', hs.dragHandler);
+		
+		if (hs.dragArgs) {
+			if (hs.styleRestoreCursor && hs.dragArgs.type == 'image') 
+				hs.dragArgs.exp.content.style.cursor = hs.styleRestoreCursor;
+			var hasDragged = hs.dragArgs.hasDragged;
+			
+			if (!hasDragged &&!hs.hasFocused && !/(move|resize)/.test(hs.dragArgs.type)) {
+				exp.close();
+			} 
+			else if (hasDragged || (!hasDragged && hs.hasHtmlExpanders)) {
+				hs.dragArgs.exp.doShowHide('hidden');
+			}
+			hs.hasFocused = false;
+			hs.dragArgs = null;
+		
+		} else if (/highslide-image-blur/.test(el.className)) {
+			el.style.cursor = hs.styleRestoreCursor;		
+		}
+	}
+	return false;
+},
+
+dragHandler : function(e)
+{
+	if (!hs.dragArgs) return true;
+	if (!e) e = window.event;
+	var a = hs.dragArgs, exp = a.exp;
+	
+	a.dX = e.clientX - a.clickX;
+	a.dY = e.clientY - a.clickY;	
+	
+	var distance = Math.sqrt(Math.pow(a.dX, 2) + Math.pow(a.dY, 2));
+	if (!a.hasDragged) a.hasDragged = (a.type != 'image' && distance > 0)
+		|| (distance > (hs.dragSensitivity || 5));
+	
+	if (a.hasDragged && e.clientX > 5 && e.clientY > 5) {
+		
+		if (a.type == 'resize') exp.resize(a);
+		else {
+			exp.moveTo(a.left + a.dX, a.top + a.dY);
+			if (a.type == 'image') exp.content.style.cursor = 'move';
+		}
+	}
+	return false;
+},
+
+wrapperMouseHandler : function (e) {
+	try {
+		if (!e) e = window.event;
+		var over = /mouseover/i.test(e.type); 
+		if (!e.target) e.target = e.srcElement; // ie
+		if (!e.relatedTarget) e.relatedTarget = 
+			over ? e.fromElement : e.toElement; // ie
+		var exp = hs.getExpander(e.target);
+		if (!exp.isExpanded) return;
+		if (!exp || !e.relatedTarget || hs.getExpander(e.relatedTarget, true) == exp 
+			|| hs.dragArgs) return;
+		for (var i = 0; i < exp.overlays.length; i++) (function() {
+			var o = hs.$('hsId'+ exp.overlays[i]);
+			if (o && o.hideOnMouseOut) {
+				if (over) hs.setStyles(o, { visibility: 'visible', display: '' });
+				hs.animate(o, { opacity: over ? o.opacity : 0 }, o.dur);
+			}
+		})();	
+	} catch (e) {}
+},
+addEventListener : function (el, event, func) {
+	if (el == document && event == 'ready') {
+		hs.push(hs.onReady, func);
+	}
+	try {
+		el.addEventListener(event, func, false);
+	} catch (e) {
+		try {
+			el.detachEvent('on'+ event, func);
+			el.attachEvent('on'+ event, func);
+		} catch (e) {
+			el['on'+ event] = func;
+		}
+	} 
+},
+
+removeEventListener : function (el, event, func) {
+	try {
+		el.removeEventListener(event, func, false);
+	} catch (e) {
+		try {
+			el.detachEvent('on'+ event, func);
+		} catch (e) {
+			el['on'+ event] = null;
+		}
+	}
+},
+
+preloadFullImage : function (i) {
+	if (hs.continuePreloading && hs.preloadTheseImages[i] && hs.preloadTheseImages[i] != 'undefined') {
+		var img = document.createElement('img');
+		img.onload = function() { 
+			img = null;
+			hs.preloadFullImage(i + 1);
+		};
+		img.src = hs.preloadTheseImages[i];
+	}
+},
+preloadImages : function (number) {
+	if (number && typeof number != 'object') hs.numberOfImagesToPreload = number;
+	
+	var arr = hs.getAnchors();
+	for (var i = 0; i < arr.images.length && i < hs.numberOfImagesToPreload; i++) {
+		hs.push(hs.preloadTheseImages, hs.getSrc(arr.images[i]));
+	}
+	
+	// preload outlines
+	if (hs.outlineType)	new hs.Outline(hs.outlineType, function () { hs.preloadFullImage(0)} );
+	else
+	
+	hs.preloadFullImage(0);
+	
+	// preload cursor
+	if (hs.restoreCursor) var cur = hs.createElement('img', { src: hs.graphicsDir + hs.restoreCursor });
+},
+
+
+init : function () {
+	if (!hs.container) {
+	
+		hs.ieLt7 = hs.ie && hs.uaVersion < 7;
+		hs.ieLt9 = hs.ie && hs.uaVersion < 9;
+		
+		hs.getPageSize();
+		for (var x in hs.langDefaults) {
+			if (typeof hs[x] != 'undefined') hs.lang[x] = hs[x];
+			else if (typeof hs.lang[x] == 'undefined' && typeof hs.langDefaults[x] != 'undefined') 
+				hs.lang[x] = hs.langDefaults[x];
+		}
+		
+		hs.container = hs.createElement('div', {
+				className: 'highslide-container'
+			}, {
+				position: 'absolute',
+				left: 0, 
+				top: 0, 
+				width: '100%', 
+				zIndex: hs.zIndexCounter,
+				direction: 'ltr'
+			}, 
+			document.body,
+			true
+		);
+		hs.loading = hs.createElement('a', {
+				className: 'highslide-loading',
+				title: hs.lang.loadingTitle,
+				innerHTML: hs.lang.loadingText,
+				href: 'javascript:;'
+			}, {
+				position: 'absolute',
+				top: '-9999px',
+				opacity: hs.loadingOpacity,
+				zIndex: 1
+			}, hs.container
+		);
+		hs.garbageBin = hs.createElement('div', null, { display: 'none' }, hs.container);
+		hs.viewport = hs.createElement('div', {
+				className: 'highslide-viewport highslide-viewport-size'
+			}, {
+				visibility: (hs.safari && hs.uaVersion < 525) ? 'visible' : 'hidden'
+			}, hs.container, 1
+		);
+		
+		// http://www.robertpenner.com/easing/ 
+		Math.linearTween = function (t, b, c, d) {
+			return c*t/d + b;
+		};
+		Math.easeInQuad = function (t, b, c, d) {
+			return c*(t/=d)*t + b;
+		};
+		Math.easeOutQuad = function (t, b, c, d) {
+			return -c *(t/=d)*(t-2) + b;
+		};
+		
+		hs.hideSelects = hs.ieLt7;
+		hs.hideIframes = ((window.opera && hs.uaVersion < 9) || navigator.vendor == 'KDE' 
+			|| (hs.ieLt7 && hs.uaVersion < 5.5));
+	}
+},
+ready : function() {
+	if (hs.isReady) return;
+	hs.isReady = true;
+	for (var i = 0; i < hs.onReady.length; i++) hs.onReady[i]();
+},
+
+updateAnchors : function() {
+	var el, els, all = [], images = [],groups = {}, re;
+		
+	for (var i = 0; i < hs.openerTagNames.length; i++) {
+		els = document.getElementsByTagName(hs.openerTagNames[i]);
+		for (var j = 0; j < els.length; j++) {
+			el = els[j];
+			re = hs.isHsAnchor(el);
+			if (re) {
+				hs.push(all, el);
+				if (re[0] == 'hs.expand') hs.push(images, el);
+				var g = hs.getParam(el, 'slideshowGroup') || 'none';
+				if (!groups[g]) groups[g] = [];
+				hs.push(groups[g], el);
+			}
+		}
+	}
+	hs.anchors = { all: all, groups: groups, images: images };
+	return hs.anchors;
+	
+},
+
+getAnchors : function() {
+	return hs.anchors || hs.updateAnchors();
+},
+
+
+close : function(el) {
+	var exp = hs.getExpander(el);
+	if (exp) exp.close();
+	return false;
+}
+}; // end hs object
+hs.fx = function( elem, options, prop ){
+	this.options = options;
+	this.elem = elem;
+	this.prop = prop;
+
+	if (!options.orig) options.orig = {};
+};
+hs.fx.prototype = {
+	update: function(){
+		(hs.fx.step[this.prop] || hs.fx.step._default)(this);
+		
+		if (this.options.step)
+			this.options.step.call(this.elem, this.now, this);
+
+	},
+	custom: function(from, to, unit){
+		this.startTime = (new Date()).getTime();
+		this.start = from;
+		this.end = to;
+		this.unit = unit;// || this.unit || "px";
+		this.now = this.start;
+		this.pos = this.state = 0;
+
+		var self = this;
+		function t(gotoEnd){
+			return self.step(gotoEnd);
+		}
+
+		t.elem = this.elem;
+
+		if ( t() && hs.timers.push(t) == 1 ) {
+			hs.timerId = setInterval(function(){
+				var timers = hs.timers;
+
+				for ( var i = 0; i < timers.length; i++ )
+					if ( !timers[i]() )
+						timers.splice(i--, 1);
+
+				if ( !timers.length ) {
+					clearInterval(hs.timerId);
+				}
+			}, 13);
+		}
+	},
+	step: function(gotoEnd){
+		var t = (new Date()).getTime();
+		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.complete) this.options.complete.call(this.elem);
+			}
+			return false;
+		} else {
+			var n = t - this.startTime;
+			this.state = n / this.options.duration;
+			this.pos = this.options.easing(n, 0, 1, this.options.duration);
+			this.now = this.start + ((this.end - this.start) * this.pos);
+			this.update();
+		}
+		return true;
+	}
+
+};
+
+hs.extend( hs.fx, {
+	step: {
+
+		opacity: function(fx){
+			hs.setStyles(fx.elem, { opacity: fx.now });
+		},
+
+		_default: function(fx){
+			try {
+				if ( fx.elem.style && fx.elem.style[ fx.prop ] != null )
+					fx.elem.style[ fx.prop ] = fx.now + fx.unit;
+				else
+					fx.elem[ fx.prop ] = fx.now;
+			} catch (e) {}
+		}
+	}
+});
+
+hs.Outline =  function (outlineType, onLoad) {
+	this.onLoad = onLoad;
+	this.outlineType = outlineType;
+	var v = hs.uaVersion, tr;
+	
+	this.hasAlphaImageLoader = hs.ie && hs.uaVersion < 7;
+	if (!outlineType) {
+		if (onLoad) onLoad();
+		return;
+	}
+	
+	hs.init();
+	this.table = hs.createElement(
+		'table', { 
+			cellSpacing: 0 
+		}, {
+			visibility: 'hidden',
+			position: 'absolute',
+			borderCollapse: 'collapse',
+			width: 0
+		},
+		hs.container,
+		true
+	);
+	var tbody = hs.createElement('tbody', null, null, this.table, 1);
+	
+	this.td = [];
+	for (var i = 0; i <= 8; i++) {
+		if (i % 3 == 0) tr = hs.createElement('tr', null, { height: 'auto' }, tbody, true);
+		this.td[i] = hs.createElement('td', null, null, tr, true);
+		var style = i != 4 ? { lineHeight: 0, fontSize: 0} : { position : 'relative' };
+		hs.setStyles(this.td[i], style);
+	}
+	this.td[4].className = outlineType +' highslide-outline';
+	
+	this.preloadGraphic(); 
+};
+
+hs.Outline.prototype = {
+preloadGraphic : function () {
+	var src = hs.graphicsDir + (hs.outlinesDir || "outlines/")+ this.outlineType +".png";
+				
+	var appendTo = hs.safari && hs.uaVersion < 525 ? hs.container : null;
+	this.graphic = hs.createElement('img', null, { position: 'absolute', 
+		top: '-9999px' }, appendTo, true); // for onload trigger
+	
+	var pThis = this;
+	this.graphic.onload = function() { pThis.onGraphicLoad(); };
+	
+	this.graphic.src = src;
+},
+
+onGraphicLoad : function () {
+	var o = this.offset = this.graphic.width / 4,
+		pos = [[0,0],[0,-4],[-2,0],[0,-8],0,[-2,-8],[0,-2],[0,-6],[-2,-2]],
+		dim = { height: (2*o) +'px', width: (2*o) +'px' };
+	for (var i = 0; i <= 8; i++) {
+		if (pos[i]) {
+			if (this.hasAlphaImageLoader) {
+				var w = (i == 1 || i == 7) ? '100%' : this.graphic.width +'px';
+				var div = hs.createElement('div', null, { width: '100%', height: '100%', position: 'relative', overflow: 'hidden'}, this.td[i], true);
+				hs.createElement ('div', null, { 
+						filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale, src='"+ this.graphic.src + "')", 
+						position: 'absolute',
+						width: w, 
+						height: this.graphic.height +'px',
+						left: (pos[i][0]*o)+'px',
+						top: (pos[i][1]*o)+'px'
+					}, 
+				div,
+				true);
+			} else {
+				hs.setStyles(this.td[i], { background: 'url('+ this.graphic.src +') '+ (pos[i][0]*o)+'px '+(pos[i][1]*o)+'px'});
+			}
+			
+			if (window.opera && (i == 3 || i ==5)) 
+				hs.createElement('div', null, dim, this.td[i], true);
+			
+			hs.setStyles (this.td[i], dim);
+		}
+	}
+	this.graphic = null;
+	if (hs.pendingOutlines[this.outlineType]) hs.pendingOutlines[this.outlineType].destroy();
+	hs.pendingOutlines[this.outlineType] = this;
+	if (this.onLoad) this.onLoad();
+},
+	
+setPosition : function (pos, offset, vis, dur, easing) {
+	var exp = this.exp,
+		stl = exp.wrapper.style,
+		offset = offset || 0,
+		pos = pos || {
+			x: exp.x.pos + offset,
+			y: exp.y.pos + offset,
+			w: exp.x.get('wsize') - 2 * offset,
+			h: exp.y.get('wsize') - 2 * offset
+		};
+	if (vis) this.table.style.visibility = (pos.h >= 4 * this.offset) 
+		? 'visible' : 'hidden';
+	hs.setStyles(this.table, {
+		left: (pos.x - this.offset) +'px',
+		top: (pos.y - this.offset) +'px',
+		width: (pos.w + 2 * this.offset) +'px'
+	});
+	
+	pos.w -= 2 * this.offset;
+	pos.h -= 2 * this.offset;
+	hs.setStyles (this.td[4], {
+		width: pos.w >= 0 ? pos.w +'px' : 0,
+		height: pos.h >= 0 ? pos.h +'px' : 0
+	});
+	if (this.hasAlphaImageLoader) this.td[3].style.height 
+		= this.td[5].style.height = this.td[4].style.height;	
+	
+},
+	
+destroy : function(hide) {
+	if (hide) this.table.style.visibility = 'hidden';
+	else hs.discardElement(this.table);
+}
+};
+
+hs.Dimension = function(exp, dim) {
+	this.exp = exp;
+	this.dim = dim;
+	this.ucwh = dim == 'x' ? 'Width' : 'Height';
+	this.wh = this.ucwh.toLowerCase();
+	this.uclt = dim == 'x' ? 'Left' : 'Top';
+	this.lt = this.uclt.toLowerCase();
+	this.ucrb = dim == 'x' ? 'Right' : 'Bottom';
+	this.rb = this.ucrb.toLowerCase();
+	this.p1 = this.p2 = 0;
+};
+hs.Dimension.prototype = {
+get : function(key) {
+	switch (key) {
+		case 'loadingPos':
+			return this.tpos + this.tb + (this.t - hs.loading['offset'+ this.ucwh]) / 2;
+		case 'loadingPosXfade':
+			return this.pos + this.cb+ this.p1 + (this.size - hs.loading['offset'+ this.ucwh]) / 2;
+		case 'wsize':
+			return this.size + 2 * this.cb + this.p1 + this.p2;
+		case 'fitsize':
+			return this.clientSize - this.marginMin - this.marginMax;
+		case 'maxsize':
+			return this.get('fitsize') - 2 * this.cb - this.p1 - this.p2 ;
+		case 'opos':
+			return this.pos - (this.exp.outline ? this.exp.outline.offset : 0);
+		case 'osize':
+			return this.get('wsize') + (this.exp.outline ? 2*this.exp.outline.offset : 0);
+		case 'imgPad':
+			return this.imgSize ? Math.round((this.size - this.imgSize) / 2) : 0;
+		
+	}
+},
+calcBorders: function() {
+	// correct for borders
+	this.cb = (this.exp.content['offset'+ this.ucwh] - this.t) / 2;
+	
+	this.marginMax = hs['margin'+ this.ucrb];
+},
+calcThumb: function() {
+	this.t = this.exp.el[this.wh] ? parseInt(this.exp.el[this.wh]) : 
+		this.exp.el['offset'+ this.ucwh];
+	this.tpos = this.exp.tpos[this.dim];
+	this.tb = (this.exp.el['offset'+ this.ucwh] - this.t) / 2;
+	if (this.tpos == 0 || this.tpos == -1) {
+		this.tpos = (hs.page[this.wh] / 2) + hs.page['scroll'+ this.uclt];		
+	};
+},
+calcExpanded: function() {
+	var exp = this.exp;
+	this.justify = 'auto';
+	
+	// get alignment
+	if (exp.align == 'center') this.justify = 'center';
+	else if (new RegExp(this.lt).test(exp.anchor)) this.justify = null;
+	else if (new RegExp(this.rb).test(exp.anchor)) this.justify = 'max';
+	
+	
+	// size and position
+	this.pos = this.tpos - this.cb + this.tb;
+	
+	if (this.maxHeight && this.dim == 'x')
+		exp.maxWidth = Math.min(exp.maxWidth || this.full, exp.maxHeight * this.full / exp.y.full); 
+		
+	this.size = Math.min(this.full, exp['max'+ this.ucwh] || this.full);
+	this.minSize = exp.allowSizeReduction ? 
+		Math.min(exp['min'+ this.ucwh], this.full) :this.full;
+	if (exp.isImage && exp.useBox)	{
+		this.size = exp[this.wh];
+		this.imgSize = this.full;
+	}
+	if (this.dim == 'x' && hs.padToMinWidth) this.minSize = exp.minWidth;
+	this.target = exp['target'+ this.dim.toUpperCase()];
+	this.marginMin = hs['margin'+ this.uclt];
+	this.scroll = hs.page['scroll'+ this.uclt];
+	this.clientSize = hs.page[this.wh];
+},
+setSize: function(i) {
+	var exp = this.exp;
+	if (exp.isImage && (exp.useBox || hs.padToMinWidth)) {
+		this.imgSize = i;
+		this.size = Math.max(this.size, this.imgSize);
+		exp.content.style[this.lt] = this.get('imgPad')+'px';
+	} else
+	this.size = i;
+	
+	exp.content.style[this.wh] = i +'px';
+	exp.wrapper.style[this.wh] = this.get('wsize') +'px';
+	if (exp.outline) exp.outline.setPosition();
+	if (this.dim == 'x' && exp.overlayBox) exp.sizeOverlayBox(true);
+	if (this.dim == 'x' && exp.slideshow && exp.isImage) {
+		if (i == this.full) exp.slideshow.disable('full-expand');
+		else exp.slideshow.enable('full-expand');
+	}
+},
+setPos: function(i) {
+	this.pos = i;
+	this.exp.wrapper.style[this.lt] = i +'px';	
+	
+	if (this.exp.outline) this.exp.outline.setPosition();
+	
+}
+};
+
+hs.Expander = function(a, params, custom, contentType) {
+	if (document.readyState && hs.ie && !hs.isReady) {
+		hs.addEventListener(document, 'ready', function() {
+			new hs.Expander(a, params, custom, contentType);
+		});
+		return;
+	} 
+	this.a = a;
+	this.custom = custom;
+	this.contentType = contentType || 'image';
+	this.isImage = !this.isHtml;
+	
+	hs.continuePreloading = false;
+	this.overlays = [];
+	this.last = hs.last;
+	hs.last = null;
+	hs.init();
+	var key = this.key = hs.expanders.length;
+	// override inline parameters
+	for (var i = 0; i < hs.overrides.length; i++) {
+		var name = hs.overrides[i];
+		this[name] = params && typeof params[name] != 'undefined' ?
+			params[name] : hs[name];
+	}
+	if (!this.src) this.src = a.href;
+	
+	// get thumb
+	var el = (params && params.thumbnailId) ? hs.$(params.thumbnailId) : a;
+	el = this.thumb = el.getElementsByTagName('img')[0] || el;
+	this.thumbsUserSetId = el.id || a.id;
+	
+	// check if already open
+	for (var i = 0; i < hs.expanders.length; i++) {
+		if (hs.expanders[i] && hs.expanders[i].a == a 
+			&& !(this.last && this.transitions[1] == 'crossfade')) {
+			hs.expanders[i].focus();
+			return false;
+		}
+	}	
+
+	// cancel other
+	if (!hs.allowSimultaneousLoading) for (var i = 0; i < hs.expanders.length; i++) {
+		if (hs.expanders[i] && hs.expanders[i].thumb != el && !hs.expanders[i].onLoadStarted) {
+			hs.expanders[i].cancelLoading();
+		}
+	}
+	hs.expanders[key] = this;
+	if (!hs.allowMultipleInstances && !hs.upcoming) {
+		if (hs.expanders[key-1]) hs.expanders[key-1].close();
+		if (typeof hs.focusKey != 'undefined' && hs.expanders[hs.focusKey])
+			hs.expanders[hs.focusKey].close();
+	}
+	
+	// initiate metrics
+	this.el = el;
+	this.tpos = this.pageOrigin || hs.getPosition(el);
+	hs.getPageSize();
+	var x = this.x = new hs.Dimension(this, 'x');
+	x.calcThumb();
+	var y = this.y = new hs.Dimension(this, 'y');
+	y.calcThumb();
+	this.wrapper = hs.createElement(
+		'div', {
+			id: 'highslide-wrapper-'+ this.key,
+			className: 'highslide-wrapper '+ this.wrapperClassName
+		}, {
+			visibility: 'hidden',
+			position: 'absolute',
+			zIndex: hs.zIndexCounter += 2
+		}, null, true );
+	
+	this.wrapper.onmouseover = this.wrapper.onmouseout = hs.wrapperMouseHandler;
+	if (this.contentType == 'image' && this.outlineWhileAnimating == 2)
+		this.outlineWhileAnimating = 0;
+	
+	// get the outline
+	if (!this.outlineType 
+		|| (this.last && this.isImage && this.transitions[1] == 'crossfade')) {
+		this[this.contentType +'Create']();
+	
+	} else if (hs.pendingOutlines[this.outlineType]) {
+		this.connectOutline();
+		this[this.contentType +'Create']();
+	
+	} else {
+		this.showLoading();
+		var exp = this;
+		new hs.Outline(this.outlineType, 
+			function () {
+				exp.connectOutline();
+				exp[exp.contentType +'Create']();
+			} 
+		);
+	}
+	return true;
+};
+
+hs.Expander.prototype = {
+error : function(e) {
+	if (hs.debug) alert ('Line '+ e.lineNumber +': '+ e.message);
+	else window.location.href = this.src;
+},
+
+connectOutline : function() {
+	var outline = this.outline = hs.pendingOutlines[this.outlineType];
+	outline.exp = this;
+	outline.table.style.zIndex = this.wrapper.style.zIndex - 1;
+	hs.pendingOutlines[this.outlineType] = null;
+},
+
+showLoading : function() {
+	if (this.onLoadStarted || this.loading) return;
+	
+	this.loading = hs.loading;
+	var exp = this;
+	this.loading.onclick = function() {
+		exp.cancelLoading();
+	};
+	var exp = this, 
+		l = this.x.get('loadingPos') +'px',
+		t = this.y.get('loadingPos') +'px';
+	if (!tgt && this.last && this.transitions[1] == 'crossfade') 
+		var tgt = this.last; 
+	if (tgt) {
+		l = tgt.x.get('loadingPosXfade') +'px';
+		t = tgt.y.get('loadingPosXfade') +'px';
+		this.loading.style.zIndex = hs.zIndexCounter++;
+	}
+	setTimeout(function () { 
+		if (exp.loading) hs.setStyles(exp.loading, { left: l, top: t, zIndex: hs.zIndexCounter++ })}
+	, 100);
+},
+
+imageCreate : function() {
+	var exp = this;
+	
+	var img = document.createElement('img');
+    this.content = img;
+    img.onload = function () {
+    	if (hs.expanders[exp.key]) exp.contentLoaded(); 
+	};
+    if (hs.blockRightClick) img.oncontextmenu = function() { return false; };
+    img.className = 'highslide-image';
+    hs.setStyles(img, {
+    	visibility: 'hidden',
+    	display: 'block',
+    	position: 'absolute',
+		maxWidth: '9999px',
+		zIndex: 3
+	});
+    img.title = hs.lang.restoreTitle;
+	if (hs.safari && hs.uaVersion < 525) hs.container.appendChild(img);
+    if (hs.ie && hs.flushImgSize) img.src = null;
+	img.src = this.src;
+	
+	this.showLoading();
+},
+
+contentLoaded : function() {
+	try {	
+		if (!this.content) return;
+		this.content.onload = null;
+		if (this.onLoadStarted) return;
+		else this.onLoadStarted = true;
+		
+		var x = this.x, y = this.y;
+		
+		if (this.loading) {
+			hs.setStyles(this.loading, { top: '-9999px' });
+			this.loading = null;
+		}	
+			x.full = this.content.width;
+			y.full = this.content.height;
+			
+			hs.setStyles(this.content, {
+				width: x.t +'px',
+				height: y.t +'px'
+			});
+			this.wrapper.appendChild(this.content);
+			hs.container.appendChild(this.wrapper);
+		
+		x.calcBorders();
+		y.calcBorders();
+		
+		hs.setStyles (this.wrapper, {
+			left: (x.tpos + x.tb - x.cb) +'px',
+			top: (y.tpos + x.tb - y.cb) +'px'
+		});
+		
+		
+		this.initSlideshow();
+		this.getOverlays();
+		
+		var ratio = x.full / y.full;
+		x.calcExpanded();
+		this.justify(x);
+		
+		y.calcExpanded();
+		this.justify(y);
+		if (this.overlayBox) this.sizeOverlayBox(0, 1);
+
+		
+		if (this.allowSizeReduction) {
+				this.correctRatio(ratio);
+			var ss = this.slideshow;			
+			if (ss && this.last && ss.controls && ss.fixedControls) {
+				var pos = ss.overlayOptions.position || '', p;
+				for (var dim in hs.oPos) for (var i = 0; i < 5; i++) {
+					p = this[dim];
+					if (pos.match(hs.oPos[dim][i])) {
+						p.pos = this.last[dim].pos 
+							+ (this.last[dim].p1 - p.p1)
+							+ (this.last[dim].size - p.size) * [0, 0, .5, 1, 1][i];
+						if (ss.fixedControls == 'fit') {
+							if (p.pos + p.size + p.p1 + p.p2 > p.scroll + p.clientSize - p.marginMax)
+								p.pos = p.scroll + p.clientSize - p.size - p.marginMin - p.marginMax - p.p1 - p.p2;
+							if (p.pos < p.scroll + p.marginMin) p.pos = p.scroll + p.marginMin; 
+						} 
+					}
+				}
+			}
+			if (this.isImage && this.x.full > (this.x.imgSize || this.x.size)) {
+				this.createFullExpand();
+				if (this.overlays.length == 1) this.sizeOverlayBox();
+			}
+		}
+		this.show();
+		
+	} catch (e) {
+		this.error(e);
+	}
+},
+
+justify : function (p, moveOnly) {
+	var tgtArr, tgt = p.target, dim = p == this.x ? 'x' : 'y';
+	
+	if (tgt && tgt.match(/ /)) {
+		tgtArr = tgt.split(' ');
+		tgt = tgtArr[0];
+	}
+	if (tgt && hs.$(tgt)) {
+		p.pos = hs.getPosition(hs.$(tgt))[dim];
+		if (tgtArr && tgtArr[1] && tgtArr[1].match(/^[-]?[0-9]+px$/)) 
+			p.pos += parseInt(tgtArr[1]);
+		if (p.size < p.minSize) p.size = p.minSize;
+		
+	} else if (p.justify == 'auto' || p.justify == 'center') {
+	
+		var hasMovedMin = false;
+		
+		var allowReduce = p.exp.allowSizeReduction;
+		if (p.justify == 'center')
+			p.pos = Math.round(p.scroll + (p.clientSize + p.marginMin - p.marginMax - p.get('wsize')) / 2);
+		else
+			p.pos = Math.round(p.pos - ((p.get('wsize') - p.t) / 2));
+		if (p.pos < p.scroll + p.marginMin) {
+			p.pos = p.scroll + p.marginMin;
+			hasMovedMin = true;		
+		}
+		if (!moveOnly && p.size < p.minSize) {
+			p.size = p.minSize;
+			allowReduce = false;
+		}
+		if (p.pos + p.get('wsize') > p.scroll + p.clientSize - p.marginMax) {
+			if (!moveOnly && hasMovedMin && allowReduce) {
+				p.size = Math.min(p.size, p.get(dim == 'y' ? 'fitsize' : 'maxsize'));
+			} else if (p.get('wsize') < p.get('fitsize')) {
+				p.pos = p.scroll + p.clientSize - p.marginMax - p.get('wsize');
+			} else { // image larger than viewport
+				p.pos = p.scroll + p.marginMin;
+				if (!moveOnly && allowReduce) p.size = p.get(dim == 'y' ? 'fitsize' : 'maxsize');
+			}			
+		}
+		
+		if (!moveOnly && p.size < p.minSize) {
+			p.size = p.minSize;
+			allowReduce = false;
+		}
+		
+	
+	} else if (p.justify == 'max') {
+		p.pos = Math.floor(p.pos - p.size + p.t);
+	}
+	
+		
+	if (p.pos < p.marginMin) {
+		var tmpMin = p.pos;
+		p.pos = p.marginMin; 
+		
+		if (allowReduce && !moveOnly) p.size = p.size - (p.pos - tmpMin);
+		
+	}
+},
+
+correctRatio : function(ratio) {
+	var x = this.x, 
+		y = this.y,
+		changed = false,
+		xSize = Math.min(x.full, x.size),
+		ySize = Math.min(y.full, y.size),
+		useBox = (this.useBox || hs.padToMinWidth);
+	
+	if (xSize / ySize > ratio) { // width greater
+		xSize = ySize * ratio;
+		if (xSize < x.minSize) { // below minWidth
+			xSize = x.minSize;
+			ySize = xSize / ratio;
+		}
+		changed = true;
+	
+	} else if (xSize / ySize < ratio) { // height greater
+		ySize = xSize / ratio;
+		changed = true;
+	}
+	
+	if (hs.padToMinWidth && x.full < x.minSize) {
+		x.imgSize = x.full;
+		y.size = y.imgSize = y.full;
+	} else if (this.useBox) {
+		x.imgSize = xSize;
+		y.imgSize = ySize;
+	} else {
+		x.size = xSize;
+		y.size = ySize;
+	}
+	changed = this.fitOverlayBox(this.useBox ? null : ratio, changed);
+	if (useBox && y.size < y.imgSize) {
+		y.imgSize = y.size;
+		x.imgSize = y.size * ratio;
+	}
+	if (changed || useBox) {
+		x.pos = x.tpos - x.cb + x.tb;
+		x.minSize = x.size;
+		this.justify(x, true);
+	
+		y.pos = y.tpos - y.cb + y.tb;
+		y.minSize = y.size;
+		this.justify(y, true);
+		if (this.overlayBox) this.sizeOverlayBox();
+	}
+	
+	
+},
+fitOverlayBox : function(ratio, changed) {
+	var x = this.x, y = this.y;
+	if (this.overlayBox) {
+		while (y.size > this.minHeight && x.size > this.minWidth 
+				&&  y.get('wsize') > y.get('fitsize')) {
+			y.size -= 10;
+			if (ratio) x.size = y.size * ratio;
+			this.sizeOverlayBox(0, 1);
+			changed = true;
+		}
+	}
+	return changed;
+},
+
+show : function () {
+	var x = this.x, y = this.y;
+	this.doShowHide('hidden');
+	if (this.slideshow && this.slideshow.thumbstrip) this.slideshow.thumbstrip.selectThumb();
+	
+	// Apply size change
+	this.changeSize(
+		1, {
+			wrapper: {
+				width : x.get('wsize'),
+				height : y.get('wsize'),
+				left: x.pos,
+				top: y.pos
+			},
+			content: {
+				left: x.p1 + x.get('imgPad'),
+				top: y.p1 + y.get('imgPad'),
+				width:x.imgSize ||x.size,
+				height:y.imgSize ||y.size
+			}
+		},
+		hs.expandDuration
+	);
+},
+
+changeSize : function(up, to, dur) {
+	// transition
+	var trans = this.transitions,
+	other = up ? (this.last ? this.last.a : null) : hs.upcoming,
+	t = (trans[1] && other 
+			&& hs.getParam(other, 'transitions')[1] == trans[1]) ?
+		trans[1] : trans[0];
+		
+	if (this[t] && t != 'expand') {
+		this[t](up, to);
+		return;
+	}
+	
+	if (this.outline && !this.outlineWhileAnimating) {
+		if (up) this.outline.setPosition();
+		else this.outline.destroy();
+	}
+	
+	
+	if (!up) this.destroyOverlays();
+	
+	var exp = this,
+		x = exp.x,
+		y = exp.y,
+		easing = this.easing;
+	if (!up) easing = this.easingClose || easing;
+	var after = up ?
+		function() {
+				
+			if (exp.outline) exp.outline.table.style.visibility = "visible";
+			setTimeout(function() {
+				exp.afterExpand();
+			}, 50);
+		} :
+		function() {
+			exp.afterClose();
+		};
+	if (up) hs.setStyles( this.wrapper, {
+		width: x.t +'px',
+		height: y.t +'px'
+	});
+	if (this.fadeInOut) {
+		hs.setStyles(this.wrapper, { opacity: up ? 0 : 1 });
+		hs.extend(to.wrapper, { opacity: up });
+	}
+	hs.animate( this.wrapper, to.wrapper, {
+		duration: dur,
+		easing: easing,
+		step: function(val, args) {
+			if (exp.outline && exp.outlineWhileAnimating && args.prop == 'top') {
+				var fac = up ? args.pos : 1 - args.pos;
+				var pos = {
+					w: x.t + (x.get('wsize') - x.t) * fac,
+					h: y.t + (y.get('wsize') - y.t) * fac,
+					x: x.tpos + (x.pos - x.tpos) * fac,
+					y: y.tpos + (y.pos - y.tpos) * fac
+				};
+				exp.outline.setPosition(pos, 0, 1);				
+			}
+		}
+	});
+	hs.animate( this.content, to.content, dur, easing, after);
+	if (up) {
+		this.wrapper.style.visibility = 'visible';
+		this.content.style.visibility = 'visible';
+		this.a.className += ' highslide-active-anchor';
+	}
+},
+
+
+
+fade : function(up, to) {
+	this.outlineWhileAnimating = false;
+	var exp = this,	t = up ? hs.expandDuration : 0;
+	
+	if (up) {
+		hs.animate(this.wrapper, to.wrapper, 0);
+		hs.setStyles(this.wrapper, { opacity: 0, visibility: 'visible' });
+		hs.animate(this.content, to.content, 0);
+		this.content.style.visibility = 'visible';
+
+		hs.animate(this.wrapper, { opacity: 1 }, t, null, 
+			function() { exp.afterExpand(); });
+	}
+	
+	if (this.outline) {
+		this.outline.table.style.zIndex = this.wrapper.style.zIndex;
+		var dir = up || -1, 
+			offset = this.outline.offset,
+			startOff = up ? 3 : offset,
+			endOff = up? offset : 3;
+		for (var i = startOff; dir * i <= dir * endOff; i += dir, t += 25) {
+			(function() {
+				var o = up ? endOff - i : startOff - i;
+				setTimeout(function() {
+					exp.outline.setPosition(0, o, 1);
+				}, t);
+			})();
+		}
+	}
+	
+	
+	if (up) {}//setTimeout(function() { exp.afterExpand(); }, t+50);
+	else {
+		setTimeout( function() {
+			if (exp.outline) exp.outline.destroy(exp.preserveContent);
+			
+			exp.destroyOverlays();
+	
+			hs.animate( exp.wrapper, { opacity: 0 }, hs.restoreDuration, null, function(){
+				exp.afterClose();
+			});
+		}, t);		
+	}
+},
+crossfade : function (up, to, from) {
+	if (!up) return;
+	var exp = this, 
+		last = this.last,
+		x = this.x,
+		y = this.y,
+		lastX = last.x,
+		lastY = last.y,
+		wrapper = this.wrapper,
+		content = this.content,
+		overlayBox = this.overlayBox;
+	hs.removeEventListener(document, 'mousemove', hs.dragHandler);
+	
+	hs.setStyles(content, { 
+		width: (x.imgSize || x.size) +'px', 
+		height: (y.imgSize || y.size) +'px'		
+	});
+	if (overlayBox) overlayBox.style.overflow = 'visible';
+	this.outline = last.outline;
+	if (this.outline) this.outline.exp = exp;
+	last.outline = null;
+	var fadeBox = hs.createElement('div', {
+			className: 'highslide-'+ this.contentType
+		}, { 
+			position: 'absolute', 
+			zIndex: 4,
+			overflow: 'hidden',
+			display: 'none'
+		}
+	);
+	var names = { oldImg: last, newImg: this };
+	for (var n in names) { 	
+		this[n] = names[n].content.cloneNode(1);
+		hs.setStyles(this[n], {
+			position: 'absolute',
+			border: 0,
+			visibility: 'visible'
+		});
+		fadeBox.appendChild(this[n]);
+	}
+	wrapper.appendChild(fadeBox);
+	if (overlayBox) {
+		overlayBox.className = '';
+		wrapper.appendChild(overlayBox);
+	}
+	fadeBox.style.display = '';
+	last.content.style.display = 'none';
+	
+	
+	if (hs.safari && hs.uaVersion < 525) {
+		this.wrapper.style.visibility = 'visible';
+	}
+	hs.animate(wrapper, {
+		width: x.size
+	}, {
+		duration: hs.transitionDuration, 
+		step: function(val, args) {
+			var pos = args.pos,
+				invPos = 1 - pos;
+			var prop,
+				size = {}, 
+				props = ['pos', 'size', 'p1', 'p2'];
+			for (var n in props) {
+				prop = props[n];
+				size['x'+ prop] = Math.round(invPos * lastX[prop] + pos * x[prop]);
+				size['y'+ prop] = Math.round(invPos * lastY[prop] + pos * y[prop]);
+				size.ximgSize = Math.round(
+					invPos * (lastX.imgSize || lastX.size) + pos * (x.imgSize || x.size));
+				size.ximgPad = Math.round(invPos * lastX.get('imgPad') + pos * x.get('imgPad'));
+				size.yimgSize = Math.round(
+					invPos * (lastY.imgSize || lastY.size) + pos * (y.imgSize || y.size));
+				size.yimgPad = Math.round(invPos * lastY.get('imgPad') + pos * y.get('imgPad'));
+			}
+			if (exp.outline) exp.outline.setPosition({ 
+				x: size.xpos, 
+				y: size.ypos, 
+				w: size.xsize + size.xp1 + size.xp2 + 2 * x.cb, 
+				h: size.ysize + size.yp1 + size.yp2 + 2 * y.cb
+			});
+			last.wrapper.style.clip = 'rect('
+				+ (size.ypos - lastY.pos)+'px, '
+				+ (size.xsize + size.xp1 + size.xp2 + size.xpos + 2 * lastX.cb - lastX.pos) +'px, '
+				+ (size.ysize + size.yp1 + size.yp2 + size.ypos + 2 * lastY.cb - lastY.pos) +'px, '
+				+ (size.xpos - lastX.pos)+'px)';
+				
+			hs.setStyles(content, {
+				top: (size.yp1 + y.get('imgPad')) +'px',
+				left: (size.xp1 + x.get('imgPad')) +'px',
+				marginTop: (y.pos - size.ypos) +'px',
+				marginLeft: (x.pos - size.xpos) +'px'
+			});
+			hs.setStyles(wrapper, {
+				top: size.ypos +'px',
+				left: size.xpos +'px',
+				width: (size.xp1 + size.xp2 + size.xsize + 2 * x.cb)+ 'px',
+				height: (size.yp1 + size.yp2 + size.ysize + 2 * y.cb) + 'px'
+			});
+			hs.setStyles(fadeBox, {
+				width: (size.ximgSize || size.xsize) + 'px',
+				height: (size.yimgSize || size.ysize) +'px',
+				left: (size.xp1 + size.ximgPad)  +'px',
+				top: (size.yp1 + size.yimgPad) +'px',
+				visibility: 'visible'
+			});
+			
+			hs.setStyles(exp.oldImg, {
+				top: (lastY.pos - size.ypos + lastY.p1 - size.yp1 + lastY.get('imgPad') - size.yimgPad)+'px',
+				left: (lastX.pos - size.xpos + lastX.p1 - size.xp1 + lastX.get('imgPad') - size.ximgPad)+'px'
+			});		
+			
+			hs.setStyles(exp.newImg, {
+				opacity: pos,
+				top: (y.pos - size.ypos + y.p1 - size.yp1 + y.get('imgPad') - size.yimgPad) +'px',
+				left: (x.pos - size.xpos + x.p1 - size.xp1 + x.get('imgPad') - size.ximgPad) +'px'
+			});
+			if (overlayBox) hs.setStyles(overlayBox, {
+				width: size.xsize + 'px',
+				height: size.ysize +'px',
+				left: (size.xp1 + x.cb)  +'px',
+				top: (size.yp1 + y.cb) +'px'
+			});
+		},
+		complete: function () {
+			wrapper.style.visibility = content.style.visibility = 'visible';
+			content.style.display = 'block';
+			hs.discardElement(fadeBox);
+			exp.afterExpand();
+			last.afterClose();
+			exp.last = null;
+		}
+		
+	});
+},
+reuseOverlay : function(o, el) {
+	if (!this.last) return false;
+	for (var i = 0; i < this.last.overlays.length; i++) {
+		var oDiv = hs.$('hsId'+ this.last.overlays[i]);
+		if (oDiv && oDiv.hsId == o.hsId) {
+			this.genOverlayBox();
+			oDiv.reuse = this.key;
+			hs.push(this.overlays, this.last.overlays[i]);
+			return true;
+		}
+	}
+	return false;
+},
+
+
+afterExpand : function() {
+	this.isExpanded = true;	
+	this.focus();
+	if (this.dimmingOpacity) hs.dim(this);
+	if (hs.upcoming && hs.upcoming == this.a) hs.upcoming = null;
+	this.prepareNextOutline();
+	var p = hs.page, mX = hs.mouse.x + p.scrollLeft, mY = hs.mouse.y + p.scrollTop;
+	this.mouseIsOver = this.x.pos < mX && mX < this.x.pos + this.x.get('wsize')
+		&& this.y.pos < mY && mY < this.y.pos + this.y.get('wsize');	
+	if (this.overlayBox) this.showOverlays();
+	
+},
+
+
+prepareNextOutline : function() {
+	var key = this.key;
+	var outlineType = this.outlineType;
+	new hs.Outline(outlineType, 
+		function () { try { hs.expanders[key].preloadNext(); } catch (e) {} });
+},
+
+
+preloadNext : function() {
+	var next = this.getAdjacentAnchor(1);
+	if (next && next.onclick.toString().match(/hs\.expand/)) 
+		var img = hs.createElement('img', { src: hs.getSrc(next) });
+},
+
+
+getAdjacentAnchor : function(op) {
+	var current = this.getAnchorIndex(), as = hs.anchors.groups[this.slideshowGroup || 'none'];
+	if (as && !as[current + op] && this.slideshow && this.slideshow.repeat) {
+		if (op == 1) return as[0];
+		else if (op == -1) return as[as.length-1];
+	}
+	return (as && as[current + op]) || null;
+},
+
+getAnchorIndex : function() {
+	var arr = hs.getAnchors().groups[this.slideshowGroup || 'none'];
+	if (arr) for (var i = 0; i < arr.length; i++) {
+		if (arr[i] == this.a) return i; 
+	}
+	return null;
+},
+
+
+getNumber : function() {
+	if (this[this.numberPosition]) {
+		var arr = hs.anchors.groups[this.slideshowGroup || 'none'];
+		if (arr) {
+			var s = hs.lang.number.replace('%1', this.getAnchorIndex() + 1).replace('%2', arr.length);
+			this[this.numberPosition].innerHTML = 
+				'<div class="highslide-number">'+ s +'</div>'+ this[this.numberPosition].innerHTML;
+		}
+	}
+},
+initSlideshow : function() {
+	if (!this.last) {
+		for (var i = 0; i < hs.slideshows.length; i++) {
+			var ss = hs.slideshows[i], sg = ss.slideshowGroup;
+			if (typeof sg == 'undefined' || sg === null || sg === this.slideshowGroup) 
+				this.slideshow = new hs.Slideshow(this.key, ss);
+		} 
+	} else {
+		this.slideshow = this.last.slideshow;
+	}
+	var ss = this.slideshow;
+	if (!ss) return;
+	var key = ss.expKey = this.key;
+	
+	ss.checkFirstAndLast();
+	ss.disable('full-expand');
+	if (ss.controls) {
+		this.createOverlay(hs.extend(ss.overlayOptions || {}, {
+			overlayId: ss.controls,
+			hsId: 'controls',
+			zIndex: 5
+		}));
+	}
+	if (ss.thumbstrip) ss.thumbstrip.add(this);
+	if (!this.last && this.autoplay) ss.play(true);
+	if (ss.autoplay) {
+		ss.autoplay = setTimeout(function() {
+			hs.next(key);
+		}, (ss.interval || 500));
+	}
+},
+
+cancelLoading : function() {
+	hs.discardElement (this.wrapper);
+	hs.expanders[this.key] = null;
+	if (hs.upcoming == this.a) hs.upcoming = null;
+	hs.undim(this.key);
+	if (this.loading) hs.loading.style.left = '-9999px';
+},
+
+writeCredits : function () {
+	if (this.credits) return;
+	this.credits = hs.createElement('a', {
+		href: hs.creditsHref,
+		target: hs.creditsTarget,
+		className: 'highslide-credits',
+		innerHTML: hs.lang.creditsText,
+		title: hs.lang.creditsTitle
+	});
+	this.createOverlay({ 
+		overlayId: this.credits, 
+		position: this.creditsPosition || 'top left', 
+		hsId: 'credits' 
+	});
+},
+
+getInline : function(types, addOverlay) {
+	for (var i = 0; i < types.length; i++) {
+		var type = types[i], s = null;
+		if (!this[type +'Id'] && this.thumbsUserSetId)  
+			this[type +'Id'] = type +'-for-'+ this.thumbsUserSetId;
+		if (this[type +'Id']) this[type] = hs.getNode(this[type +'Id']);
+		if (!this[type] && !this[type +'Text'] && this[type +'Eval']) try {
+			s = eval(this[type +'Eval']);
+		} catch (e) {}
+		if (!this[type] && this[type +'Text']) {
+			s = this[type +'Text'];
+		}
+		if (!this[type] && !s) {
+			this[type] = hs.getNode(this.a['_'+ type + 'Id']);
+			if (!this[type]) {
+				var next = this.a.nextSibling;
+				while (next && !hs.isHsAnchor(next)) {
+					if ((new RegExp('highslide-'+ type)).test(next.className || null)) {
+						if (!next.id) this.a['_'+ type + 'Id'] = next.id = 'hsId'+ hs.idCounter++;
+						this[type] = hs.getNode(next.id);
+						break;
+					}
+					next = next.nextSibling;
+				}
+			}
+		}
+		if (!this[type] && !s && this.numberPosition == type) s = '\n';
+		
+		if (!this[type] && s) this[type] = hs.createElement('div', 
+				{ className: 'highslide-'+ type, innerHTML: s } );
+		
+		if (addOverlay && this[type]) {
+			var o = { position: (type == 'heading') ? 'above' : 'below' };
+			for (var x in this[type+'Overlay']) o[x] = this[type+'Overlay'][x];
+			o.overlayId = this[type];
+			this.createOverlay(o);
+		}
+	}
+},
+
+
+// on end move and resize
+doShowHide : function(visibility) {
+	if (hs.hideSelects) this.showHideElements('SELECT', visibility);
+	if (hs.hideIframes) this.showHideElements('IFRAME', visibility);
+	if (hs.geckoMac) this.showHideElements('*', visibility);
+},
+showHideElements : function (tagName, visibility) {
+	var els = document.getElementsByTagName(tagName);
+	var prop = tagName == '*' ? 'overflow' : 'visibility';
+	for (var i = 0; i < els.length; i++) {
+		if (prop == 'visibility' || (document.defaultView.getComputedStyle(
+				els[i], "").getPropertyValue('overflow') == 'auto'
+				|| els[i].getAttribute('hidden-by') != null)) {
+			var hiddenBy = els[i].getAttribute('hidden-by');
+			if (visibility == 'visible' && hiddenBy) {
+				hiddenBy = hiddenBy.replace('['+ this.key +']', '');
+				els[i].setAttribute('hidden-by', hiddenBy);
+				if (!hiddenBy) els[i].style[prop] = els[i].origProp;
+			} else if (visibility == 'hidden') { // hide if behind
+				var elPos = hs.getPosition(els[i]);
+				elPos.w = els[i].offsetWidth;
+				elPos.h = els[i].offsetHeight;
+				if (!this.dimmingOpacity) { // hide all if dimming
+				
+					var clearsX = (elPos.x + elPos.w < this.x.get('opos') 
+						|| elPos.x > this.x.get('opos') + this.x.get('osize'));
+					var clearsY = (elPos.y + elPos.h < this.y.get('opos') 
+						|| elPos.y > this.y.get('opos') + this.y.get('osize'));
+				}
+				var wrapperKey = hs.getWrapperKey(els[i]);
+				if (!clearsX && !clearsY && wrapperKey != this.key) { // element falls behind image
+					if (!hiddenBy) {
+						els[i].setAttribute('hidden-by', '['+ this.key +']');
+						els[i].origProp = els[i].style[prop];
+						els[i].style[prop] = 'hidden';
+						
+					} else if (hiddenBy.indexOf('['+ this.key +']') == -1) {
+						els[i].setAttribute('hidden-by', hiddenBy + '['+ this.key +']');
+					}
+				} else if ((hiddenBy == '['+ this.key +']' || hs.focusKey == wrapperKey)
+						&& wrapperKey != this.key) { // on move
+					els[i].setAttribute('hidden-by', '');
+					els[i].style[prop] = els[i].origProp || '';
+				} else if (hiddenBy && hiddenBy.indexOf('['+ this.key +']') > -1) {
+					els[i].setAttribute('hidden-by', hiddenBy.replace('['+ this.key +']', ''));
+				}
+						
+			}
+		}
+	}
+},
+
+focus : function() {
+	this.wrapper.style.zIndex = hs.zIndexCounter += 2;
+	// blur others
+	for (var i = 0; i < hs.expanders.length; i++) {
+		if (hs.expanders[i] && i == hs.focusKey) {
+			var blurExp = hs.expanders[i];
+			blurExp.content.className += ' highslide-'+ blurExp.contentType +'-blur';
+				blurExp.content.style.cursor = hs.ieLt7 ? 'hand' : 'pointer';
+				blurExp.content.title = hs.lang.focusTitle;
+		}
+	}
+	
+	// focus this
+	if (this.outline) this.outline.table.style.zIndex 
+		= this.wrapper.style.zIndex - 1;
+	this.content.className = 'highslide-'+ this.contentType;
+		this.content.title = hs.lang.restoreTitle;
+		
+		if (hs.restoreCursor) {
+			hs.styleRestoreCursor = window.opera ? 'pointer' : 'url('+ hs.graphicsDir + hs.restoreCursor +'), pointer';
+			if (hs.ieLt7 && hs.uaVersion < 6) hs.styleRestoreCursor = 'hand';
+			this.content.style.cursor = hs.styleRestoreCursor;
+		}
+		
+	hs.focusKey = this.key;	
+	hs.addEventListener(document, window.opera ? 'keypress' : 'keydown', hs.keyHandler);	
+},
+moveTo: function(x, y) {
+	this.x.setPos(x);
+	this.y.setPos(y);
+},
+resize : function (e) {
+	var w, h, r = e.width / e.height;
+	w = Math.max(e.width + e.dX, Math.min(this.minWidth, this.x.full));
+	if (this.isImage && Math.abs(w - this.x.full) < 12) w = this.x.full;
+	h = w / r;
+	if (h < Math.min(this.minHeight, this.y.full)) {
+		h = Math.min(this.minHeight, this.y.full);
+		if (this.isImage) w = h * r;
+	}
+	this.resizeTo(w, h);
+},
+resizeTo: function(w, h) {
+	this.y.setSize(h);
+	this.x.setSize(w);
+	this.wrapper.style.height = this.y.get('wsize') +'px';
+},
+
+close : function() {
+	if (this.isClosing || !this.isExpanded) return;
+	if (this.transitions[1] == 'crossfade' && hs.upcoming) {
+		hs.getExpander(hs.upcoming).cancelLoading();
+		hs.upcoming = null;
+	}
+	this.isClosing = true;
+	if (this.slideshow && !hs.upcoming) this.slideshow.pause();
+	
+	hs.removeEventListener(document, window.opera ? 'keypress' : 'keydown', hs.keyHandler);
+	
+	try {
+		this.content.style.cursor = 'default';
+		this.changeSize(
+			0, {
+				wrapper: {
+					width : this.x.t,
+					height : this.y.t,
+					left: this.x.tpos - this.x.cb + this.x.tb,
+					top: this.y.tpos - this.y.cb + this.y.tb
+				},
+				content: {
+					left: 0,
+					top: 0,
+					width: this.x.t,
+					height: this.y.t
+				}
+			}, hs.restoreDuration
+		);
+	} catch (e) { this.afterClose(); }
+},
+
+createOverlay : function (o) {
+	var el = o.overlayId, 
+		relToVP = (o.relativeTo == 'viewport' && !/panel$/.test(o.position));
+	if (typeof el == 'string') el = hs.getNode(el);
+	if (o.html) el = hs.createElement('div', { innerHTML: o.html });
+	if (!el || typeof el == 'string') return;
+	el.style.display = 'block';
+	o.hsId = o.hsId || o.overlayId; 
+	if (this.transitions[1] == 'crossfade' && this.reuseOverlay(o, el)) return;
+	this.genOverlayBox();
+	var width = o.width && /^[0-9]+(px|%)$/.test(o.width) ? o.width : 'auto';
+	if (/^(left|right)panel$/.test(o.position) && !/^[0-9]+px$/.test(o.width)) width = '200px';
+	var overlay = hs.createElement(
+		'div', {
+			id: 'hsId'+ hs.idCounter++,
+			hsId: o.hsId
+		}, {
+			position: 'absolute',
+			visibility: 'hidden',
+			width: width,
+			direction: hs.lang.cssDirection || '',
+			opacity: 0
+		},
+		relToVP ? hs.viewport :this.overlayBox,
+		true
+	);
+	if (relToVP) overlay.hsKey = this.key;
+	
+	overlay.appendChild(el);
+	hs.extend(overlay, {
+		opacity: 1,
+		offsetX: 0,
+		offsetY: 0,
+		dur: (o.fade === 0 || o.fade === false || (o.fade == 2 && hs.ie)) ? 0 : 250
+	});
+	hs.extend(overlay, o);
+	
+		
+	if (this.gotOverlays) {
+		this.positionOverlay(overlay);
+		if (!overlay.hideOnMouseOut || this.mouseIsOver) 
+			hs.animate(overlay, { opacity: overlay.opacity }, overlay.dur);
+	}
+	hs.push(this.overlays, hs.idCounter - 1);
+},
+positionOverlay : function(overlay) {
+	var p = overlay.position || 'middle center',
+		relToVP = (overlay.relativeTo == 'viewport'),
+		offX = overlay.offsetX,
+		offY = overlay.offsetY;
+	if (relToVP) {
+		hs.viewport.style.display = 'block';
+		overlay.hsKey = this.key;
+		if (overlay.offsetWidth > overlay.parentNode.offsetWidth)
+			overlay.style.width = '100%';
+	} else
+	if (overlay.parentNode != this.overlayBox) this.overlayBox.appendChild(overlay);
+	if (/left$/.test(p)) overlay.style.left = offX +'px'; 
+	
+	if (/center$/.test(p))	hs.setStyles (overlay, { 
+		left: '50%',
+		marginLeft: (offX - Math.round(overlay.offsetWidth / 2)) +'px'
+	});	
+	
+	if (/right$/.test(p)) overlay.style.right = - offX +'px';
+		
+	if (/^leftpanel$/.test(p)) { 
+		hs.setStyles(overlay, {
+			right: '100%',
+			marginRight: this.x.cb +'px',
+			top: - this.y.cb +'px',
+			bottom: - this.y.cb +'px',
+			overflow: 'auto'
+		});		 
+		this.x.p1 = overlay.offsetWidth;
+	
+	} else if (/^rightpanel$/.test(p)) {
+		hs.setStyles(overlay, {
+			left: '100%',
+			marginLeft: this.x.cb +'px',
+			top: - this.y.cb +'px',
+			bottom: - this.y.cb +'px',
+			overflow: 'auto'
+		});
+		this.x.p2 = overlay.offsetWidth;
+	}
+	var parOff = overlay.parentNode.offsetHeight;
+	overlay.style.height = 'auto';
+	if (relToVP && overlay.offsetHeight > parOff)
+		overlay.style.height = hs.ieLt7 ? parOff +'px' : '100%';
+
+	if (/^top/.test(p)) overlay.style.top = offY +'px'; 
+	if (/^middle/.test(p))	hs.setStyles (overlay, { 
+		top: '50%', 
+		marginTop: (offY - Math.round(overlay.offsetHeight / 2)) +'px'
+	});	
+	if (/^bottom/.test(p)) overlay.style.bottom = - offY +'px';
+	if (/^above$/.test(p)) {
+		hs.setStyles(overlay, {
+			left: (- this.x.p1 - this.x.cb) +'px',
+			right: (- this.x.p2 - this.x.cb) +'px',
+			bottom: '100%',
+			marginBottom: this.y.cb +'px',
+			width: 'auto'
+		});
+		this.y.p1 = overlay.offsetHeight;
+	
+	} else if (/^below$/.test(p)) {
+		hs.setStyles(overlay, {
+			position: 'relative',
+			left: (- this.x.p1 - this.x.cb) +'px',
+			right: (- this.x.p2 - this.x.cb) +'px',
+			top: '100%',
+			marginTop: this.y.cb +'px',
+			width: 'auto'
+		});
+		this.y.p2 = overlay.offsetHeight;
+		overlay.style.position = 'absolute';
+	}
+},
+
+getOverlays : function() {	
+	this.getInline(['heading', 'caption'], true);
+	this.getNumber();
+	if (this.heading && this.dragByHeading) this.heading.className += ' highslide-move';
+	if (hs.showCredits) this.writeCredits();
+	for (var i = 0; i < hs.overlays.length; i++) {
+		var o = hs.overlays[i], tId = o.thumbnailId, sg = o.slideshowGroup;
+		if ((!tId && !sg) || (tId && tId == this.thumbsUserSetId)
+				|| (sg && sg === this.slideshowGroup)) {
+			this.createOverlay(o);
+		}
+	}
+	var os = [];
+	for (var i = 0; i < this.overlays.length; i++) {
+		var o = hs.$('hsId'+ this.overlays[i]);
+		if (/panel$/.test(o.position)) this.positionOverlay(o);
+		else hs.push(os, o);
+	}
+	for (var i = 0; i < os.length; i++) this.positionOverlay(os[i]);
+	this.gotOverlays = true;
+},
+genOverlayBox : function() {
+	if (!this.overlayBox) this.overlayBox = hs.createElement (
+		'div', {
+			className: this.wrapperClassName
+		}, {
+			position : 'absolute',
+			width: (this.x.size || (this.useBox ? this.width : null) 
+				|| this.x.full) +'px',
+			height: (this.y.size || this.y.full) +'px',
+			visibility : 'hidden',
+			overflow : 'hidden',
+			zIndex : hs.ie ? 4 : 'auto'
+		},
+		hs.container,
+		true
+	);
+},
+sizeOverlayBox : function(doWrapper, doPanels) {
+	var overlayBox = this.overlayBox, 
+		x = this.x,
+		y = this.y;
+	hs.setStyles( overlayBox, {
+		width: x.size +'px', 
+		height: y.size +'px'
+	});
+	if (doWrapper || doPanels) {
+		for (var i = 0; i < this.overlays.length; i++) {
+			var o = hs.$('hsId'+ this.overlays[i]);
+			var ie6 = (hs.ieLt7 || document.compatMode == 'BackCompat');
+			if (o && /^(above|below)$/.test(o.position)) {
+				if (ie6) {
+					o.style.width = (overlayBox.offsetWidth + 2 * x.cb
+						+ x.p1 + x.p2) +'px';
+				}
+				y[o.position == 'above' ? 'p1' : 'p2'] = o.offsetHeight;
+			}
+			if (o && ie6 && /^(left|right)panel$/.test(o.position)) {
+				o.style.height = (overlayBox.offsetHeight + 2* y.cb) +'px';
+			}
+		}
+	}
+	if (doWrapper) {
+		hs.setStyles(this.content, {
+			top: y.p1 +'px'
+		});
+		hs.setStyles(overlayBox, {
+			top: (y.p1 + y.cb) +'px'
+		});
+	}
+},
+
+showOverlays : function() {
+	var b = this.overlayBox;
+	b.className = '';
+	hs.setStyles(b, {
+		top: (this.y.p1 + this.y.cb) +'px',
+		left: (this.x.p1 + this.x.cb) +'px',
+		overflow : 'visible'
+	});
+	if (hs.safari) b.style.visibility = 'visible';
+	this.wrapper.appendChild (b);
+	for (var i = 0; i < this.overlays.length; i++) {
+		var o = hs.$('hsId'+ this.overlays[i]);
+		o.style.zIndex = o.zIndex || 4;
+		if (!o.hideOnMouseOut || this.mouseIsOver) {
+			o.style.visibility = 'visible';
+			hs.setStyles(o, { visibility: 'visible', display: '' });
+			hs.animate(o, { opacity: o.opacity }, o.dur);
+		}
+	}
+},
+
+destroyOverlays : function() {
+	if (!this.overlays.length) return;
+	if (this.slideshow) {
+		var c = this.slideshow.controls;
+		if (c && hs.getExpander(c) == this) c.parentNode.removeChild(c);
+	}
+	for (var i = 0; i < this.overlays.length; i++) {
+		var o = hs.$('hsId'+ this.overlays[i]);
+		if (o && o.parentNode == hs.viewport && hs.getExpander(o) == this) hs.discardElement(o);
+	}
+	hs.discardElement(this.overlayBox);
+},
+
+
+
+createFullExpand : function () {
+	if (this.slideshow && this.slideshow.controls) {
+		this.slideshow.enable('full-expand');
+		return;
+	}
+	this.fullExpandLabel = hs.createElement(
+		'a', {
+			href: 'javascript:hs.expanders['+ this.key +'].doFullExpand();',
+			title: hs.lang.fullExpandTitle,
+			className: 'highslide-full-expand'
+		}
+	);
+	
+	this.createOverlay({ 
+		overlayId: this.fullExpandLabel, 
+		position: hs.fullExpandPosition, 
+		hideOnMouseOut: true, 
+		opacity: hs.fullExpandOpacity
+	});
+},
+
+doFullExpand : function () {
+	try {
+		if (this.fullExpandLabel) hs.discardElement(this.fullExpandLabel);
+		
+		this.focus();
+		var xSize = this.x.size,
+        	ySize = this.y.size;
+        this.resizeTo(this.x.full, this.y.full);
+       
+        var xpos = this.x.pos - (this.x.size - xSize) / 2;
+        if (xpos < hs.marginLeft) xpos = hs.marginLeft;
+       
+        var ypos = this.y.pos - (this.y.size - ySize) / 2;
+        if (ypos < hs.marginTop) ypos = hs.marginTop;
+       
+        this.moveTo(xpos, ypos);
+		this.doShowHide('hidden');
+	
+	} catch (e) {
+		this.error(e);
+	}
+},
+
+
+afterClose : function () {
+	this.a.className = this.a.className.replace('highslide-active-anchor', '');
+	
+	this.doShowHide('visible');
+		if (this.outline && this.outlineWhileAnimating) this.outline.destroy();
+	
+		hs.discardElement(this.wrapper);
+	this.destroyOverlays();
+	if (!hs.viewport.childNodes.length) hs.viewport.style.display = 'none';
+	
+	if (this.dimmingOpacity) hs.undim(this.key);
+	hs.expanders[this.key] = null;		
+	hs.reOrder();
+}
+
+};
+
+
+hs.Slideshow = function (expKey, options) {
+	if (hs.dynamicallyUpdateAnchors !== false) hs.updateAnchors();
+	this.expKey = expKey;
+	for (var x in options) this[x] = options[x];
+	if (this.useControls) this.getControls();
+	if (this.thumbstrip) this.thumbstrip = hs.Thumbstrip(this);
+};
+hs.Slideshow.prototype = {
+getControls: function() {
+	this.controls = hs.createElement('div', { innerHTML: hs.replaceLang(hs.skin.controls) }, 
+		null, hs.container);
+	
+	var buttons = ['play', 'pause', 'previous', 'next', 'move', 'full-expand', 'close'];
+	this.btn = {};
+	var pThis = this;
+	for (var i = 0; i < buttons.length; i++) {
+		this.btn[buttons[i]] = hs.getElementByClass(this.controls, 'li', 'highslide-'+ buttons[i]);
+		this.enable(buttons[i]);
+	}
+	this.btn.pause.style.display = 'none';
+	//this.disable('full-expand');
+},
+checkFirstAndLast: function() {
+	if (this.repeat || !this.controls) return;
+	var exp = hs.expanders[this.expKey],
+		cur = exp.getAnchorIndex(), 
+		re = /disabled$/;
+	if (cur == 0) 
+		this.disable('previous');
+	else if (re.test(this.btn.previous.getElementsByTagName('a')[0].className))
+		this.enable('previous');
+	if (cur + 1 == hs.anchors.groups[exp.slideshowGroup || 'none'].length) {
+		this.disable('next');
+		this.disable('play');
+	} else if (re.test(this.btn.next.getElementsByTagName('a')[0].className)) {
+		this.enable('next');
+		this.enable('play');
+	}
+},
+enable: function(btn) {
+	if (!this.btn) return;
+	var sls = this, a = this.btn[btn].getElementsByTagName('a')[0], re = /disabled$/;
+	a.onclick = function() {
+		sls[btn]();
+		return false;
+	};
+	if (re.test(a.className)) a.className = a.className.replace(re, '');
+},
+disable: function(btn) {
+	if (!this.btn) return;
+	var a = this.btn[btn].getElementsByTagName('a')[0];
+	a.onclick = function() { return false; };
+	if (!/disabled$/.test(a.className)) a.className += ' disabled';
+},
+hitSpace: function() {
+	if (this.autoplay) this.pause();
+	else this.play();
+},
+play: function(wait) {
+	if (this.btn) {
+		this.btn.play.style.display = 'none';
+		this.btn.pause.style.display = '';
+	}
+	
+	this.autoplay = true;	
+	if (!wait) hs.next(this.expKey);
+},
+pause: function() {
+	if (this.btn) {
+		this.btn.pause.style.display = 'none';
+		this.btn.play.style.display = '';
+	}
+	
+	clearTimeout(this.autoplay);
+	this.autoplay = null;
+},
+previous: function() {
+	this.pause();
+	hs.previous(this.btn.previous);
+},
+next: function() {
+	this.pause();
+	hs.next(this.btn.next);
+},
+move: function() {},
+'full-expand': function() {
+	hs.getExpander().doFullExpand();
+},
+close: function() {
+	hs.close(this.btn.close);
+}
+};
+hs.Thumbstrip = function(slideshow) {
+	function add (exp) {
+		hs.extend(options || {}, {
+			overlayId: dom,
+			hsId: 'thumbstrip',
+			className: 'highslide-thumbstrip-'+ mode +'-overlay ' + (options.className || '')
+		});
+		if (hs.ieLt7) options.fade = 0;
+		exp.createOverlay(options);
+		hs.setStyles(dom.parentNode, { overflow: 'hidden' });
+	};
+	
+	function scroll (delta) {	
+		selectThumb(undefined, Math.round(delta * dom[isX ? 'offsetWidth' : 'offsetHeight'] * 0.7));
+	};
+	
+	function selectThumb (i, scrollBy) {
+		if (i === undefined) for (var j = 0; j < group.length; j++) {
+			if (group[j] == hs.expanders[slideshow.expKey].a) {
+				i = j;
+				break;
+			}
+		}
+		if (i === undefined) return;
+		var as = dom.getElementsByTagName('a'),
+			active = as[i],
+			cell = active.parentNode,
+			left = isX ? 'Left' : 'Top',
+			right = isX ? 'Right' : 'Bottom',
+			width = isX ? 'Width' : 'Height',
+			offsetLeft = 'offset' + left,
+			offsetWidth = 'offset' + width,
+			overlayWidth = div.parentNode.parentNode[offsetWidth],
+			minTblPos = overlayWidth - table[offsetWidth],
+			curTblPos = parseInt(table.style[isX ? 'left' : 'top']) || 0,
+			tblPos = curTblPos,
+			mgnRight = 20;
+		if (scrollBy !== undefined) {
+			tblPos = curTblPos - scrollBy;
+			
+			if (minTblPos > 0) minTblPos = 0;
+			if (tblPos > 0) tblPos = 0;
+			if (tblPos < minTblPos) tblPos = minTblPos;
+			
+	
+		} else {
+			for (var j = 0; j < as.length; j++) as[j].className = '';
+			active.className = 'highslide-active-anchor';
+			var activeLeft = i > 0 ? as[i - 1].parentNode[offsetLeft] : cell[offsetLeft],
+				activeRight = cell[offsetLeft] + cell[offsetWidth] + 
+					(as[i + 1] ? as[i + 1].parentNode[offsetWidth] : 0);
+			if (activeRight > overlayWidth - curTblPos) tblPos = overlayWidth - activeRight;
+			else if (activeLeft < -curTblPos) tblPos = -activeLeft;
+		}
+		var markerPos = cell[offsetLeft] + (cell[offsetWidth] - marker[offsetWidth]) / 2 + tblPos;
+		hs.animate(table, isX ? { left: tblPos } : { top: tblPos }, null, 'easeOutQuad');
+		hs.animate(marker, isX ? { left: markerPos } : { top: markerPos }, null, 'easeOutQuad');
+		scrollUp.style.display = tblPos < 0 ? 'block' : 'none';
+		scrollDown.style.display = (tblPos > minTblPos)  ? 'block' : 'none';
+		
+	};
+	
+
+	// initialize
+	var group = hs.anchors.groups[hs.expanders[slideshow.expKey].slideshowGroup || 'none'],
+		options = slideshow.thumbstrip,
+		mode = options.mode || 'horizontal',
+		floatMode = (mode == 'float'),
+		tree = floatMode ? ['div', 'ul', 'li', 'span'] : ['table', 'tbody', 'tr', 'td'],
+		isX = (mode == 'horizontal'),
+		dom = hs.createElement('div', {
+				className: 'highslide-thumbstrip highslide-thumbstrip-'+ mode,
+				innerHTML:
+					'<div class="highslide-thumbstrip-inner">'+
+					'<'+ tree[0] +'><'+ tree[1] +'></'+ tree[1] +'></'+ tree[0] +'></div>'+
+					'<div class="highslide-scroll-up"><div></div></div>'+
+					'<div class="highslide-scroll-down"><div></div></div>'+
+					'<div class="highslide-marker"><div></div></div>'
+			}, {
+				display: 'none'
+			}, hs.container),
+		domCh = dom.childNodes,
+		div = domCh[0],
+		scrollUp = domCh[1],
+		scrollDown = domCh[2],
+		marker = domCh[3],
+		table = div.firstChild,
+		tbody = dom.getElementsByTagName(tree[1])[0],
+		tr;
+	for (var i = 0; i < group.length; i++) {
+		if (i == 0 || !isX) tr = hs.createElement(tree[2], null, null, tbody);
+		(function(){
+			var a = group[i],
+				cell = hs.createElement(tree[3], null, null, tr),
+				pI = i;
+			hs.createElement('a', {
+				href: a.href,
+				title: a.title,
+				onclick: function() {
+					if (/highslide-active-anchor/.test(this.className)) return false;
+					hs.getExpander(this).focus();
+					return hs.transit(a);
+				},
+				innerHTML: hs.stripItemFormatter ? hs.stripItemFormatter(a) : a.innerHTML
+			}, null, cell);
+		})();
+	}
+	if (!floatMode) {
+		scrollUp.onclick = function () { scroll(-1); };
+		scrollDown.onclick = function() { scroll(1); };
+		hs.addEventListener(tbody, document.onmousewheel !== undefined ? 
+				'mousewheel' : 'DOMMouseScroll', function(e) {        
+			var delta = 0;
+	        e = e || window.event;
+	        if (e.wheelDelta) {
+				delta = e.wheelDelta/120;
+				if (hs.opera) delta = -delta;
+	        } else if (e.detail) {
+				delta = -e.detail/3;
+	        }
+	        if (delta) scroll(-delta * 0.2);
+			if (e.preventDefault) e.preventDefault();
+			e.returnValue = false;
+		});
+	}
+	
+	return {
+		add: add,
+		selectThumb: selectThumb
+	}
+};
+hs.langDefaults = hs.lang;
+// history
+var HsExpander = hs.Expander;
+if (hs.ie && window == window.top) {
+	(function () {
+		try {
+			document.documentElement.doScroll('left');
+		} catch (e) {
+			setTimeout(arguments.callee, 50);
+			return;
+		}
+		hs.ready();
+	})();
+}
+hs.addEventListener(document, 'DOMContentLoaded', hs.ready);
+hs.addEventListener(window, 'load', hs.ready);
+
+// set handlers
+hs.addEventListener(document, 'ready', function() {
+	if (hs.expandCursor || hs.dimmingOpacity) {
+		var style = hs.createElement('style', { type: 'text/css' }, null, 
+			document.getElementsByTagName('HEAD')[0]), 
+			backCompat = document.compatMode == 'BackCompat';
+			
+		
+		function addRule(sel, dec) {
+			if (hs.ie && (hs.uaVersion < 9 || backCompat)) {
+				var last = document.styleSheets[document.styleSheets.length - 1];
+				if (typeof(last.addRule) == "object") last.addRule(sel, dec);
+			} else {
+				style.appendChild(document.createTextNode(sel + " {" + dec + "}"));
+			}
+		}
+		function fix(prop) {
+			return 'expression( ( ( ignoreMe = document.documentElement.'+ prop +
+				' ? document.documentElement.'+ prop +' : document.body.'+ prop +' ) ) + \'px\' );';
+		}
+		if (hs.expandCursor) addRule ('.highslide img', 
+			'cursor: url('+ hs.graphicsDir + hs.expandCursor +'), pointer !important;');
+		addRule ('.highslide-viewport-size',
+			hs.ie && (hs.uaVersion < 7 || backCompat) ?
+				'position: absolute; '+
+				'left:'+ fix('scrollLeft') +
+				'top:'+ fix('scrollTop') +
+				'width:'+ fix('clientWidth') +
+				'height:'+ fix('clientHeight') :
+				'position: fixed; width: 100%; height: 100%; left: 0; top: 0');
+	}
+});
+hs.addEventListener(window, 'resize', function() {
+	hs.getPageSize();
+	if (hs.viewport) for (var i = 0; i < hs.viewport.childNodes.length; i++) {
+		var node = hs.viewport.childNodes[i],
+			exp = hs.getExpander(node);
+		exp.positionOverlay(node);
+		if (node.hsId == 'thumbstrip') exp.slideshow.thumbstrip.selectThumb();
+	}
+});
+hs.addEventListener(document, 'mousemove', function(e) {
+	hs.mouse = { x: e.clientX, y: e.clientY	};
+});
+hs.addEventListener(document, 'mousedown', hs.mouseClickHandler);
+hs.addEventListener(document, 'mouseup', hs.mouseClickHandler);
+
+hs.addEventListener(document, 'ready', hs.getAnchors);
+hs.addEventListener(window, 'load', hs.preloadImages);
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide-with-gallery.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide-with-gallery.min.js
new file mode 100644
index 0000000000000000000000000000000000000000..6e634d6487136ab9447adad7d6bccfc3383d119b
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide-with-gallery.min.js
@@ -0,0 +1,9 @@
+/** 
+ * Name:    Highslide JS
+ * Version: 4.1.13 (2011-10-06)
+ * Config:  default +slideshow +positioning +transitions +viewport +thumbstrip
+ * Author:  Torstein Hønsi
+ * Support: www.highslide.com/support
+ * License: www.highslide.com/#license
+ */
+if(!hs){var hs={lang:{cssDirection:"ltr",loadingText:"Loading...",loadingTitle:"Click to cancel",focusTitle:"Click to bring to front",fullExpandTitle:"Expand to actual size (f)",creditsText:"Powered by <i>Highslide JS</i>",creditsTitle:"Go to the Highslide JS homepage",previousText:"Previous",nextText:"Next",moveText:"Move",closeText:"Close",closeTitle:"Close (esc)",resizeTitle:"Resize",playText:"Play",playTitle:"Play slideshow (spacebar)",pauseText:"Pause",pauseTitle:"Pause slideshow (spacebar)",previousTitle:"Previous (arrow left)",nextTitle:"Next (arrow right)",moveTitle:"Move",fullExpandText:"1:1",number:"Image %1 of %2",restoreTitle:"Click to close image, click and drag to move. Use arrow keys for next and previous."},graphicsDir:"highslide/graphics/",expandCursor:"zoomin.cur",restoreCursor:"zoomout.cur",expandDuration:250,restoreDuration:250,marginLeft:15,marginRight:15,marginTop:15,marginBottom:15,zIndexCounter:1001,loadingOpacity:0.75,allowMultipleInstances:true,numberOfImagesToPreload:5,outlineWhileAnimating:2,outlineStartOffset:3,padToMinWidth:false,fullExpandPosition:"bottom right",fullExpandOpacity:1,showCredits:true,creditsHref:"http://highslide.com/",creditsTarget:"_self",enableKeyListener:true,openerTagNames:["a"],transitions:[],transitionDuration:250,dimmingOpacity:0,dimmingDuration:50,anchor:"auto",align:"auto",targetX:null,targetY:null,dragByHeading:true,minWidth:200,minHeight:200,allowSizeReduction:true,outlineType:"drop-shadow",skin:{controls:'<div class="highslide-controls"><ul><li class="highslide-previous"><a href="#" title="{hs.lang.previousTitle}"><span>{hs.lang.previousText}</span></a></li><li class="highslide-play"><a href="#" title="{hs.lang.playTitle}"><span>{hs.lang.playText}</span></a></li><li class="highslide-pause"><a href="#" title="{hs.lang.pauseTitle}"><span>{hs.lang.pauseText}</span></a></li><li class="highslide-next"><a href="#" title="{hs.lang.nextTitle}"><span>{hs.lang.nextText}</span></a></li><li class="highslide-move"><a href="#" title="{hs.lang.moveTitle}"><span>{hs.lang.moveText}</span></a></li><li class="highslide-full-expand"><a href="#" title="{hs.lang.fullExpandTitle}"><span>{hs.lang.fullExpandText}</span></a></li><li class="highslide-close"><a href="#" title="{hs.lang.closeTitle}" ><span>{hs.lang.closeText}</span></a></li></ul></div>'},preloadTheseImages:[],continuePreloading:true,expanders:[],overrides:["allowSizeReduction","useBox","anchor","align","targetX","targetY","outlineType","outlineWhileAnimating","captionId","captionText","captionEval","captionOverlay","headingId","headingText","headingEval","headingOverlay","creditsPosition","dragByHeading","autoplay","numberPosition","transitions","dimmingOpacity","width","height","wrapperClassName","minWidth","minHeight","maxWidth","maxHeight","pageOrigin","slideshowGroup","easing","easingClose","fadeInOut","src"],overlays:[],idCounter:0,oPos:{x:["leftpanel","left","center","right","rightpanel"],y:["above","top","middle","bottom","below"]},mouse:{},headingOverlay:{},captionOverlay:{},timers:[],slideshows:[],pendingOutlines:{},clones:{},onReady:[],uaVersion:/Trident\/4\.0/.test(navigator.userAgent)?8:parseFloat((navigator.userAgent.toLowerCase().match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1]),ie:(document.all&&!window.opera),safari:/Safari/.test(navigator.userAgent),geckoMac:/Macintosh.+rv:1\.[0-8].+Gecko/.test(navigator.userAgent),$:function(a){if(a){return document.getElementById(a)}},push:function(a,b){a[a.length]=b},createElement:function(a,f,e,d,c){var b=document.createElement(a);if(f){hs.extend(b,f)}if(c){hs.setStyles(b,{padding:0,border:"none",margin:0})}if(e){hs.setStyles(b,e)}if(d){d.appendChild(b)}return b},extend:function(b,c){for(var a in c){b[a]=c[a]}return b},setStyles:function(b,c){for(var a in c){if(hs.ieLt9&&a=="opacity"){if(c[a]>0.99){b.style.removeAttribute("filter")}else{b.style.filter="alpha(opacity="+(c[a]*100)+")"}}else{b.style[a]=c[a]}}},animate:function(f,a,d){var c,g,j;if(typeof d!="object"||d===null){var i=arguments;d={duration:i[2],easing:i[3],complete:i[4]}}if(typeof d.duration!="number"){d.duration=250}d.easing=Math[d.easing]||Math.easeInQuad;d.curAnim=hs.extend({},a);for(var b in a){var h=new hs.fx(f,d,b);c=parseFloat(hs.css(f,b))||0;g=parseFloat(a[b]);j=b!="opacity"?"px":"";h.custom(c,g,j)}},css:function(a,c){if(a.style[c]){return a.style[c]}else{if(document.defaultView){return document.defaultView.getComputedStyle(a,null).getPropertyValue(c)}else{if(c=="opacity"){c="filter"}var b=a.currentStyle[c.replace(/\-(\w)/g,function(e,d){return d.toUpperCase()})];if(c=="filter"){b=b.replace(/alpha\(opacity=([0-9]+)\)/,function(e,d){return d/100})}return b===""?1:b}}},getPageSize:function(){var f=document,b=window,e=f.compatMode&&f.compatMode!="BackCompat"?f.documentElement:f.body,g=hs.ie&&(hs.uaVersion<9||typeof pageXOffset=="undefined");var c=g?e.clientWidth:(f.documentElement.clientWidth||self.innerWidth),a=g?e.clientHeight:self.innerHeight;hs.page={width:c,height:a,scrollLeft:g?e.scrollLeft:pageXOffset,scrollTop:g?e.scrollTop:pageYOffset};return hs.page},getPosition:function(a){var b={x:a.offsetLeft,y:a.offsetTop};while(a.offsetParent){a=a.offsetParent;b.x+=a.offsetLeft;b.y+=a.offsetTop;if(a!=document.body&&a!=document.documentElement){b.x-=a.scrollLeft;b.y-=a.scrollTop}}return b},expand:function(b,g,d,c){if(!b){b=hs.createElement("a",null,{display:"none"},hs.container)}if(typeof b.getParams=="function"){return g}try{new hs.Expander(b,g,d);return false}catch(f){return true}},getElementByClass:function(e,c,d){var b=e.getElementsByTagName(c);for(var a=0;a<b.length;a++){if((new RegExp(d)).test(b[a].className)){return b[a]}}return null},replaceLang:function(c){c=c.replace(/\s/g," ");var b=/{hs\.lang\.([^}]+)\}/g,d=c.match(b),e;if(d){for(var a=0;a<d.length;a++){e=d[a].replace(b,"$1");if(typeof hs.lang[e]!="undefined"){c=c.replace(d[a],hs.lang[e])}}}return c},focusTopmost:function(){var c=0,b=-1,a=hs.expanders,e,f;for(var d=0;d<a.length;d++){e=a[d];if(e){f=e.wrapper.style.zIndex;if(f&&f>c){c=f;b=d}}}if(b==-1){hs.focusKey=-1}else{a[b].focus()}},getParam:function(b,d){b.getParams=b.onclick;var c=b.getParams?b.getParams():null;b.getParams=null;return(c&&typeof c[d]!="undefined")?c[d]:(typeof hs[d]!="undefined"?hs[d]:null)},getSrc:function(b){var c=hs.getParam(b,"src");if(c){return c}return b.href},getNode:function(e){var c=hs.$(e),d=hs.clones[e],b={};if(!c&&!d){return null}if(!d){d=c.cloneNode(true);d.id="";hs.clones[e]=d;return c}else{return d.cloneNode(true)}},discardElement:function(a){if(a){hs.garbageBin.appendChild(a)}hs.garbageBin.innerHTML=""},dim:function(d){if(!hs.dimmer){a=true;hs.dimmer=hs.createElement("div",{className:"highslide-dimming highslide-viewport-size",owner:"",onclick:function(){hs.close()}},{visibility:"visible",opacity:0},hs.container,true);if(/(Android|iPad|iPhone|iPod)/.test(navigator.userAgent)){var b=document.body;function c(){hs.setStyles(hs.dimmer,{width:b.scrollWidth+"px",height:b.scrollHeight+"px"})}c();hs.addEventListener(window,"resize",c)}}hs.dimmer.style.display="";var a=hs.dimmer.owner=="";hs.dimmer.owner+="|"+d.key;if(a){if(hs.geckoMac&&hs.dimmingGeckoFix){hs.setStyles(hs.dimmer,{background:"url("+hs.graphicsDir+"geckodimmer.png)",opacity:1})}else{hs.animate(hs.dimmer,{opacity:d.dimmingOpacity},hs.dimmingDuration)}}},undim:function(a){if(!hs.dimmer){return}if(typeof a!="undefined"){hs.dimmer.owner=hs.dimmer.owner.replace("|"+a,"")}if((typeof a!="undefined"&&hs.dimmer.owner!="")||(hs.upcoming&&hs.getParam(hs.upcoming,"dimmingOpacity"))){return}if(hs.geckoMac&&hs.dimmingGeckoFix){hs.dimmer.style.display="none"}else{hs.animate(hs.dimmer,{opacity:0},hs.dimmingDuration,null,function(){hs.dimmer.style.display="none"})}},transit:function(a,d){var b=d||hs.getExpander();d=b;if(hs.upcoming){return false}else{hs.last=b}hs.removeEventListener(document,window.opera?"keypress":"keydown",hs.keyHandler);try{hs.upcoming=a;a.onclick()}catch(c){hs.last=hs.upcoming=null}try{if(!a||d.transitions[1]!="crossfade"){d.close()}}catch(c){}return false},previousOrNext:function(a,c){var b=hs.getExpander(a);if(b){return hs.transit(b.getAdjacentAnchor(c),b)}else{return false}},previous:function(a){return hs.previousOrNext(a,-1)},next:function(a){return hs.previousOrNext(a,1)},keyHandler:function(a){if(!a){a=window.event}if(!a.target){a.target=a.srcElement}if(typeof a.target.form!="undefined"){return true}var b=hs.getExpander();var c=null;switch(a.keyCode){case 70:if(b){b.doFullExpand()}return true;case 32:c=2;break;case 34:case 39:case 40:c=1;break;case 8:case 33:case 37:case 38:c=-1;break;case 27:case 13:c=0}if(c!==null){if(c!=2){hs.removeEventListener(document,window.opera?"keypress":"keydown",hs.keyHandler)}if(!hs.enableKeyListener){return true}if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}if(b){if(c==0){b.close()}else{if(c==2){if(b.slideshow){b.slideshow.hitSpace()}}else{if(b.slideshow){b.slideshow.pause()}hs.previousOrNext(b.key,c)}}return false}}return true},registerOverlay:function(a){hs.push(hs.overlays,hs.extend(a,{hsId:"hsId"+hs.idCounter++}))},addSlideshow:function(b){var d=b.slideshowGroup;if(typeof d=="object"){for(var c=0;c<d.length;c++){var e={};for(var a in b){e[a]=b[a]}e.slideshowGroup=d[c];hs.push(hs.slideshows,e)}}else{hs.push(hs.slideshows,b)}},getWrapperKey:function(c,b){var e,d=/^highslide-wrapper-([0-9]+)$/;e=c;while(e.parentNode){if(e.hsKey!==undefined){return e.hsKey}if(e.id&&d.test(e.id)){return e.id.replace(d,"$1")}e=e.parentNode}if(!b){e=c;while(e.parentNode){if(e.tagName&&hs.isHsAnchor(e)){for(var a=0;a<hs.expanders.length;a++){var f=hs.expanders[a];if(f&&f.a==e){return a}}}e=e.parentNode}}return null},getExpander:function(b,a){if(typeof b=="undefined"){return hs.expanders[hs.focusKey]||null}if(typeof b=="number"){return hs.expanders[b]||null}if(typeof b=="string"){b=hs.$(b)}return hs.expanders[hs.getWrapperKey(b,a)]||null},isHsAnchor:function(b){return(b.onclick&&b.onclick.toString().replace(/\s/g," ").match(/hs.(htmlE|e)xpand/))},reOrder:function(){for(var a=0;a<hs.expanders.length;a++){if(hs.expanders[a]&&hs.expanders[a].isExpanded){hs.focusTopmost()}}},mouseClickHandler:function(d){if(!d){d=window.event}if(d.button>1){return true}if(!d.target){d.target=d.srcElement}var b=d.target;while(b.parentNode&&!(/highslide-(image|move|html|resize)/.test(b.className))){b=b.parentNode}var f=hs.getExpander(b);if(f&&(f.isClosing||!f.isExpanded)){return true}if(f&&d.type=="mousedown"){if(d.target.form){return true}var a=b.className.match(/highslide-(image|move|resize)/);if(a){hs.dragArgs={exp:f,type:a[1],left:f.x.pos,width:f.x.size,top:f.y.pos,height:f.y.size,clickX:d.clientX,clickY:d.clientY};hs.addEventListener(document,"mousemove",hs.dragHandler);if(d.preventDefault){d.preventDefault()}if(/highslide-(image|html)-blur/.test(f.content.className)){f.focus();hs.hasFocused=true}return false}}else{if(d.type=="mouseup"){hs.removeEventListener(document,"mousemove",hs.dragHandler);if(hs.dragArgs){if(hs.styleRestoreCursor&&hs.dragArgs.type=="image"){hs.dragArgs.exp.content.style.cursor=hs.styleRestoreCursor}var c=hs.dragArgs.hasDragged;if(!c&&!hs.hasFocused&&!/(move|resize)/.test(hs.dragArgs.type)){f.close()}else{if(c||(!c&&hs.hasHtmlExpanders)){hs.dragArgs.exp.doShowHide("hidden")}}hs.hasFocused=false;hs.dragArgs=null}else{if(/highslide-image-blur/.test(b.className)){b.style.cursor=hs.styleRestoreCursor}}}}return false},dragHandler:function(c){if(!hs.dragArgs){return true}if(!c){c=window.event}var b=hs.dragArgs,d=b.exp;b.dX=c.clientX-b.clickX;b.dY=c.clientY-b.clickY;var f=Math.sqrt(Math.pow(b.dX,2)+Math.pow(b.dY,2));if(!b.hasDragged){b.hasDragged=(b.type!="image"&&f>0)||(f>(hs.dragSensitivity||5))}if(b.hasDragged&&c.clientX>5&&c.clientY>5){if(b.type=="resize"){d.resize(b)}else{d.moveTo(b.left+b.dX,b.top+b.dY);if(b.type=="image"){d.content.style.cursor="move"}}}return false},wrapperMouseHandler:function(c){try{if(!c){c=window.event}var b=/mouseover/i.test(c.type);if(!c.target){c.target=c.srcElement}if(!c.relatedTarget){c.relatedTarget=b?c.fromElement:c.toElement}var d=hs.getExpander(c.target);if(!d.isExpanded){return}if(!d||!c.relatedTarget||hs.getExpander(c.relatedTarget,true)==d||hs.dragArgs){return}for(var a=0;a<d.overlays.length;a++){(function(){var e=hs.$("hsId"+d.overlays[a]);if(e&&e.hideOnMouseOut){if(b){hs.setStyles(e,{visibility:"visible",display:""})}hs.animate(e,{opacity:b?e.opacity:0},e.dur)}})()}}catch(c){}},addEventListener:function(a,c,b){if(a==document&&c=="ready"){hs.push(hs.onReady,b)}try{a.addEventListener(c,b,false)}catch(d){try{a.detachEvent("on"+c,b);a.attachEvent("on"+c,b)}catch(d){a["on"+c]=b}}},removeEventListener:function(a,c,b){try{a.removeEventListener(c,b,false)}catch(d){try{a.detachEvent("on"+c,b)}catch(d){a["on"+c]=null}}},preloadFullImage:function(b){if(hs.continuePreloading&&hs.preloadTheseImages[b]&&hs.preloadTheseImages[b]!="undefined"){var a=document.createElement("img");a.onload=function(){a=null;hs.preloadFullImage(b+1)};a.src=hs.preloadTheseImages[b]}},preloadImages:function(c){if(c&&typeof c!="object"){hs.numberOfImagesToPreload=c}var a=hs.getAnchors();for(var b=0;b<a.images.length&&b<hs.numberOfImagesToPreload;b++){hs.push(hs.preloadTheseImages,hs.getSrc(a.images[b]))}if(hs.outlineType){new hs.Outline(hs.outlineType,function(){hs.preloadFullImage(0)})}else{hs.preloadFullImage(0)}if(hs.restoreCursor){var d=hs.createElement("img",{src:hs.graphicsDir+hs.restoreCursor})}},init:function(){if(!hs.container){hs.ieLt7=hs.ie&&hs.uaVersion<7;hs.ieLt9=hs.ie&&hs.uaVersion<9;hs.getPageSize();for(var a in hs.langDefaults){if(typeof hs[a]!="undefined"){hs.lang[a]=hs[a]}else{if(typeof hs.lang[a]=="undefined"&&typeof hs.langDefaults[a]!="undefined"){hs.lang[a]=hs.langDefaults[a]}}}hs.container=hs.createElement("div",{className:"highslide-container"},{position:"absolute",left:0,top:0,width:"100%",zIndex:hs.zIndexCounter,direction:"ltr"},document.body,true);hs.loading=hs.createElement("a",{className:"highslide-loading",title:hs.lang.loadingTitle,innerHTML:hs.lang.loadingText,href:"javascript:;"},{position:"absolute",top:"-9999px",opacity:hs.loadingOpacity,zIndex:1},hs.container);hs.garbageBin=hs.createElement("div",null,{display:"none"},hs.container);hs.viewport=hs.createElement("div",{className:"highslide-viewport highslide-viewport-size"},{visibility:(hs.safari&&hs.uaVersion<525)?"visible":"hidden"},hs.container,1);Math.linearTween=function(f,e,h,g){return h*f/g+e};Math.easeInQuad=function(f,e,h,g){return h*(f/=g)*f+e};Math.easeOutQuad=function(f,e,h,g){return -h*(f/=g)*(f-2)+e};hs.hideSelects=hs.ieLt7;hs.hideIframes=((window.opera&&hs.uaVersion<9)||navigator.vendor=="KDE"||(hs.ieLt7&&hs.uaVersion<5.5))}},ready:function(){if(hs.isReady){return}hs.isReady=true;for(var a=0;a<hs.onReady.length;a++){hs.onReady[a]()}},updateAnchors:function(){var a,c,k=[],h=[],b={},l;for(var e=0;e<hs.openerTagNames.length;e++){c=document.getElementsByTagName(hs.openerTagNames[e]);for(var d=0;d<c.length;d++){a=c[d];l=hs.isHsAnchor(a);if(l){hs.push(k,a);if(l[0]=="hs.expand"){hs.push(h,a)}var f=hs.getParam(a,"slideshowGroup")||"none";if(!b[f]){b[f]=[]}hs.push(b[f],a)}}}hs.anchors={all:k,groups:b,images:h};return hs.anchors},getAnchors:function(){return hs.anchors||hs.updateAnchors()},close:function(a){var b=hs.getExpander(a);if(b){b.close()}return false}};hs.fx=function(b,a,c){this.options=a;this.elem=b;this.prop=c;if(!a.orig){a.orig={}}};hs.fx.prototype={update:function(){(hs.fx.step[this.prop]||hs.fx.step._default)(this);if(this.options.step){this.options.step.call(this.elem,this.now,this)}},custom:function(e,d,c){this.startTime=(new Date()).getTime();this.start=e;this.end=d;this.unit=c;this.now=this.start;this.pos=this.state=0;var a=this;function b(f){return a.step(f)}b.elem=this.elem;if(b()&&hs.timers.push(b)==1){hs.timerId=setInterval(function(){var g=hs.timers;for(var f=0;f<g.length;f++){if(!g[f]()){g.splice(f--,1)}}if(!g.length){clearInterval(hs.timerId)}},13)}},step:function(d){var c=(new Date()).getTime();if(d||c>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var a=true;for(var b in this.options.curAnim){if(this.options.curAnim[b]!==true){a=false}}if(a){if(this.options.complete){this.options.complete.call(this.elem)}}return false}else{var e=c-this.startTime;this.state=e/this.options.duration;this.pos=this.options.easing(e,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};hs.extend(hs.fx,{step:{opacity:function(a){hs.setStyles(a.elem,{opacity:a.now})},_default:function(a){try{if(a.elem.style&&a.elem.style[a.prop]!=null){a.elem.style[a.prop]=a.now+a.unit}else{a.elem[a.prop]=a.now}}catch(b){}}}});hs.Outline=function(g,e){this.onLoad=e;this.outlineType=g;var a=hs.uaVersion,f;this.hasAlphaImageLoader=hs.ie&&hs.uaVersion<7;if(!g){if(e){e()}return}hs.init();this.table=hs.createElement("table",{cellSpacing:0},{visibility:"hidden",position:"absolute",borderCollapse:"collapse",width:0},hs.container,true);var b=hs.createElement("tbody",null,null,this.table,1);this.td=[];for(var c=0;c<=8;c++){if(c%3==0){f=hs.createElement("tr",null,{height:"auto"},b,true)}this.td[c]=hs.createElement("td",null,null,f,true);var d=c!=4?{lineHeight:0,fontSize:0}:{position:"relative"};hs.setStyles(this.td[c],d)}this.td[4].className=g+" highslide-outline";this.preloadGraphic()};hs.Outline.prototype={preloadGraphic:function(){var b=hs.graphicsDir+(hs.outlinesDir||"outlines/")+this.outlineType+".png";var a=hs.safari&&hs.uaVersion<525?hs.container:null;this.graphic=hs.createElement("img",null,{position:"absolute",top:"-9999px"},a,true);var c=this;this.graphic.onload=function(){c.onGraphicLoad()};this.graphic.src=b},onGraphicLoad:function(){var d=this.offset=this.graphic.width/4,f=[[0,0],[0,-4],[-2,0],[0,-8],0,[-2,-8],[0,-2],[0,-6],[-2,-2]],c={height:(2*d)+"px",width:(2*d)+"px"};for(var b=0;b<=8;b++){if(f[b]){if(this.hasAlphaImageLoader){var a=(b==1||b==7)?"100%":this.graphic.width+"px";var e=hs.createElement("div",null,{width:"100%",height:"100%",position:"relative",overflow:"hidden"},this.td[b],true);hs.createElement("div",null,{filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale, src='"+this.graphic.src+"')",position:"absolute",width:a,height:this.graphic.height+"px",left:(f[b][0]*d)+"px",top:(f[b][1]*d)+"px"},e,true)}else{hs.setStyles(this.td[b],{background:"url("+this.graphic.src+") "+(f[b][0]*d)+"px "+(f[b][1]*d)+"px"})}if(window.opera&&(b==3||b==5)){hs.createElement("div",null,c,this.td[b],true)}hs.setStyles(this.td[b],c)}}this.graphic=null;if(hs.pendingOutlines[this.outlineType]){hs.pendingOutlines[this.outlineType].destroy()}hs.pendingOutlines[this.outlineType]=this;if(this.onLoad){this.onLoad()}},setPosition:function(g,e,c,b,f){var d=this.exp,a=d.wrapper.style,e=e||0,g=g||{x:d.x.pos+e,y:d.y.pos+e,w:d.x.get("wsize")-2*e,h:d.y.get("wsize")-2*e};if(c){this.table.style.visibility=(g.h>=4*this.offset)?"visible":"hidden"}hs.setStyles(this.table,{left:(g.x-this.offset)+"px",top:(g.y-this.offset)+"px",width:(g.w+2*this.offset)+"px"});g.w-=2*this.offset;g.h-=2*this.offset;hs.setStyles(this.td[4],{width:g.w>=0?g.w+"px":0,height:g.h>=0?g.h+"px":0});if(this.hasAlphaImageLoader){this.td[3].style.height=this.td[5].style.height=this.td[4].style.height}},destroy:function(a){if(a){this.table.style.visibility="hidden"}else{hs.discardElement(this.table)}}};hs.Dimension=function(b,a){this.exp=b;this.dim=a;this.ucwh=a=="x"?"Width":"Height";this.wh=this.ucwh.toLowerCase();this.uclt=a=="x"?"Left":"Top";this.lt=this.uclt.toLowerCase();this.ucrb=a=="x"?"Right":"Bottom";this.rb=this.ucrb.toLowerCase();this.p1=this.p2=0};hs.Dimension.prototype={get:function(a){switch(a){case"loadingPos":return this.tpos+this.tb+(this.t-hs.loading["offset"+this.ucwh])/2;case"loadingPosXfade":return this.pos+this.cb+this.p1+(this.size-hs.loading["offset"+this.ucwh])/2;case"wsize":return this.size+2*this.cb+this.p1+this.p2;case"fitsize":return this.clientSize-this.marginMin-this.marginMax;case"maxsize":return this.get("fitsize")-2*this.cb-this.p1-this.p2;case"opos":return this.pos-(this.exp.outline?this.exp.outline.offset:0);case"osize":return this.get("wsize")+(this.exp.outline?2*this.exp.outline.offset:0);case"imgPad":return this.imgSize?Math.round((this.size-this.imgSize)/2):0}},calcBorders:function(){this.cb=(this.exp.content["offset"+this.ucwh]-this.t)/2;this.marginMax=hs["margin"+this.ucrb]},calcThumb:function(){this.t=this.exp.el[this.wh]?parseInt(this.exp.el[this.wh]):this.exp.el["offset"+this.ucwh];this.tpos=this.exp.tpos[this.dim];this.tb=(this.exp.el["offset"+this.ucwh]-this.t)/2;if(this.tpos==0||this.tpos==-1){this.tpos=(hs.page[this.wh]/2)+hs.page["scroll"+this.uclt]}},calcExpanded:function(){var a=this.exp;this.justify="auto";if(a.align=="center"){this.justify="center"}else{if(new RegExp(this.lt).test(a.anchor)){this.justify=null}else{if(new RegExp(this.rb).test(a.anchor)){this.justify="max"}}}this.pos=this.tpos-this.cb+this.tb;if(this.maxHeight&&this.dim=="x"){a.maxWidth=Math.min(a.maxWidth||this.full,a.maxHeight*this.full/a.y.full)}this.size=Math.min(this.full,a["max"+this.ucwh]||this.full);this.minSize=a.allowSizeReduction?Math.min(a["min"+this.ucwh],this.full):this.full;if(a.isImage&&a.useBox){this.size=a[this.wh];this.imgSize=this.full}if(this.dim=="x"&&hs.padToMinWidth){this.minSize=a.minWidth}this.target=a["target"+this.dim.toUpperCase()];this.marginMin=hs["margin"+this.uclt];this.scroll=hs.page["scroll"+this.uclt];this.clientSize=hs.page[this.wh]},setSize:function(a){var b=this.exp;if(b.isImage&&(b.useBox||hs.padToMinWidth)){this.imgSize=a;this.size=Math.max(this.size,this.imgSize);b.content.style[this.lt]=this.get("imgPad")+"px"}else{this.size=a}b.content.style[this.wh]=a+"px";b.wrapper.style[this.wh]=this.get("wsize")+"px";if(b.outline){b.outline.setPosition()}if(this.dim=="x"&&b.overlayBox){b.sizeOverlayBox(true)}if(this.dim=="x"&&b.slideshow&&b.isImage){if(a==this.full){b.slideshow.disable("full-expand")}else{b.slideshow.enable("full-expand")}}},setPos:function(a){this.pos=a;this.exp.wrapper.style[this.lt]=a+"px";if(this.exp.outline){this.exp.outline.setPosition()}}};hs.Expander=function(k,f,b,l){if(document.readyState&&hs.ie&&!hs.isReady){hs.addEventListener(document,"ready",function(){new hs.Expander(k,f,b,l)});return}this.a=k;this.custom=b;this.contentType=l||"image";this.isImage=!this.isHtml;hs.continuePreloading=false;this.overlays=[];this.last=hs.last;hs.last=null;hs.init();var m=this.key=hs.expanders.length;for(var g=0;g<hs.overrides.length;g++){var c=hs.overrides[g];this[c]=f&&typeof f[c]!="undefined"?f[c]:hs[c]}if(!this.src){this.src=k.href}var d=(f&&f.thumbnailId)?hs.$(f.thumbnailId):k;d=this.thumb=d.getElementsByTagName("img")[0]||d;this.thumbsUserSetId=d.id||k.id;for(var g=0;g<hs.expanders.length;g++){if(hs.expanders[g]&&hs.expanders[g].a==k&&!(this.last&&this.transitions[1]=="crossfade")){hs.expanders[g].focus();return false}}if(!hs.allowSimultaneousLoading){for(var g=0;g<hs.expanders.length;g++){if(hs.expanders[g]&&hs.expanders[g].thumb!=d&&!hs.expanders[g].onLoadStarted){hs.expanders[g].cancelLoading()}}}hs.expanders[m]=this;if(!hs.allowMultipleInstances&&!hs.upcoming){if(hs.expanders[m-1]){hs.expanders[m-1].close()}if(typeof hs.focusKey!="undefined"&&hs.expanders[hs.focusKey]){hs.expanders[hs.focusKey].close()}}this.el=d;this.tpos=this.pageOrigin||hs.getPosition(d);hs.getPageSize();var j=this.x=new hs.Dimension(this,"x");j.calcThumb();var h=this.y=new hs.Dimension(this,"y");h.calcThumb();this.wrapper=hs.createElement("div",{id:"highslide-wrapper-"+this.key,className:"highslide-wrapper "+this.wrapperClassName},{visibility:"hidden",position:"absolute",zIndex:hs.zIndexCounter+=2},null,true);this.wrapper.onmouseover=this.wrapper.onmouseout=hs.wrapperMouseHandler;if(this.contentType=="image"&&this.outlineWhileAnimating==2){this.outlineWhileAnimating=0}if(!this.outlineType||(this.last&&this.isImage&&this.transitions[1]=="crossfade")){this[this.contentType+"Create"]()}else{if(hs.pendingOutlines[this.outlineType]){this.connectOutline();this[this.contentType+"Create"]()}else{this.showLoading();var e=this;new hs.Outline(this.outlineType,function(){e.connectOutline();e[e.contentType+"Create"]()})}}return true};hs.Expander.prototype={error:function(a){if(hs.debug){alert("Line "+a.lineNumber+": "+a.message)}else{window.location.href=this.src}},connectOutline:function(){var a=this.outline=hs.pendingOutlines[this.outlineType];a.exp=this;a.table.style.zIndex=this.wrapper.style.zIndex-1;hs.pendingOutlines[this.outlineType]=null},showLoading:function(){if(this.onLoadStarted||this.loading){return}this.loading=hs.loading;var c=this;this.loading.onclick=function(){c.cancelLoading()};var c=this,a=this.x.get("loadingPos")+"px",b=this.y.get("loadingPos")+"px";if(!d&&this.last&&this.transitions[1]=="crossfade"){var d=this.last}if(d){a=d.x.get("loadingPosXfade")+"px";b=d.y.get("loadingPosXfade")+"px";this.loading.style.zIndex=hs.zIndexCounter++}setTimeout(function(){if(c.loading){hs.setStyles(c.loading,{left:a,top:b,zIndex:hs.zIndexCounter++})}},100)},imageCreate:function(){var b=this;var a=document.createElement("img");this.content=a;a.onload=function(){if(hs.expanders[b.key]){b.contentLoaded()}};if(hs.blockRightClick){a.oncontextmenu=function(){return false}}a.className="highslide-image";hs.setStyles(a,{visibility:"hidden",display:"block",position:"absolute",maxWidth:"9999px",zIndex:3});a.title=hs.lang.restoreTitle;if(hs.safari&&hs.uaVersion<525){hs.container.appendChild(a)}if(hs.ie&&hs.flushImgSize){a.src=null}a.src=this.src;this.showLoading()},contentLoaded:function(){try{if(!this.content){return}this.content.onload=null;if(this.onLoadStarted){return}else{this.onLoadStarted=true}var j=this.x,g=this.y;if(this.loading){hs.setStyles(this.loading,{top:"-9999px"});this.loading=null}j.full=this.content.width;g.full=this.content.height;hs.setStyles(this.content,{width:j.t+"px",height:g.t+"px"});this.wrapper.appendChild(this.content);hs.container.appendChild(this.wrapper);j.calcBorders();g.calcBorders();hs.setStyles(this.wrapper,{left:(j.tpos+j.tb-j.cb)+"px",top:(g.tpos+j.tb-g.cb)+"px"});this.initSlideshow();this.getOverlays();var f=j.full/g.full;j.calcExpanded();this.justify(j);g.calcExpanded();this.justify(g);if(this.overlayBox){this.sizeOverlayBox(0,1)}if(this.allowSizeReduction){this.correctRatio(f);var k=this.slideshow;if(k&&this.last&&k.controls&&k.fixedControls){var h=k.overlayOptions.position||"",a;for(var c in hs.oPos){for(var b=0;b<5;b++){a=this[c];if(h.match(hs.oPos[c][b])){a.pos=this.last[c].pos+(this.last[c].p1-a.p1)+(this.last[c].size-a.size)*[0,0,0.5,1,1][b];if(k.fixedControls=="fit"){if(a.pos+a.size+a.p1+a.p2>a.scroll+a.clientSize-a.marginMax){a.pos=a.scroll+a.clientSize-a.size-a.marginMin-a.marginMax-a.p1-a.p2}if(a.pos<a.scroll+a.marginMin){a.pos=a.scroll+a.marginMin}}}}}}if(this.isImage&&this.x.full>(this.x.imgSize||this.x.size)){this.createFullExpand();if(this.overlays.length==1){this.sizeOverlayBox()}}}this.show()}catch(d){this.error(d)}},justify:function(f,b){var g,h=f.target,e=f==this.x?"x":"y";if(h&&h.match(/ /)){g=h.split(" ");h=g[0]}if(h&&hs.$(h)){f.pos=hs.getPosition(hs.$(h))[e];if(g&&g[1]&&g[1].match(/^[-]?[0-9]+px$/)){f.pos+=parseInt(g[1])}if(f.size<f.minSize){f.size=f.minSize}}else{if(f.justify=="auto"||f.justify=="center"){var d=false;var a=f.exp.allowSizeReduction;if(f.justify=="center"){f.pos=Math.round(f.scroll+(f.clientSize+f.marginMin-f.marginMax-f.get("wsize"))/2)}else{f.pos=Math.round(f.pos-((f.get("wsize")-f.t)/2))}if(f.pos<f.scroll+f.marginMin){f.pos=f.scroll+f.marginMin;d=true}if(!b&&f.size<f.minSize){f.size=f.minSize;a=false}if(f.pos+f.get("wsize")>f.scroll+f.clientSize-f.marginMax){if(!b&&d&&a){f.size=Math.min(f.size,f.get(e=="y"?"fitsize":"maxsize"))}else{if(f.get("wsize")<f.get("fitsize")){f.pos=f.scroll+f.clientSize-f.marginMax-f.get("wsize")}else{f.pos=f.scroll+f.marginMin;if(!b&&a){f.size=f.get(e=="y"?"fitsize":"maxsize")}}}}if(!b&&f.size<f.minSize){f.size=f.minSize;a=false}}else{if(f.justify=="max"){f.pos=Math.floor(f.pos-f.size+f.t)}}}if(f.pos<f.marginMin){var c=f.pos;f.pos=f.marginMin;if(a&&!b){f.size=f.size-(f.pos-c)}}},correctRatio:function(c){var a=this.x,g=this.y,e=false,d=Math.min(a.full,a.size),b=Math.min(g.full,g.size),f=(this.useBox||hs.padToMinWidth);if(d/b>c){d=b*c;if(d<a.minSize){d=a.minSize;b=d/c}e=true}else{if(d/b<c){b=d/c;e=true}}if(hs.padToMinWidth&&a.full<a.minSize){a.imgSize=a.full;g.size=g.imgSize=g.full}else{if(this.useBox){a.imgSize=d;g.imgSize=b}else{a.size=d;g.size=b}}e=this.fitOverlayBox(this.useBox?null:c,e);if(f&&g.size<g.imgSize){g.imgSize=g.size;a.imgSize=g.size*c}if(e||f){a.pos=a.tpos-a.cb+a.tb;a.minSize=a.size;this.justify(a,true);g.pos=g.tpos-g.cb+g.tb;g.minSize=g.size;this.justify(g,true);if(this.overlayBox){this.sizeOverlayBox()}}},fitOverlayBox:function(b,c){var a=this.x,d=this.y;if(this.overlayBox){while(d.size>this.minHeight&&a.size>this.minWidth&&d.get("wsize")>d.get("fitsize")){d.size-=10;if(b){a.size=d.size*b}this.sizeOverlayBox(0,1);c=true}}return c},show:function(){var a=this.x,b=this.y;this.doShowHide("hidden");if(this.slideshow&&this.slideshow.thumbstrip){this.slideshow.thumbstrip.selectThumb()}this.changeSize(1,{wrapper:{width:a.get("wsize"),height:b.get("wsize"),left:a.pos,top:b.pos},content:{left:a.p1+a.get("imgPad"),top:b.p1+b.get("imgPad"),width:a.imgSize||a.size,height:b.imgSize||b.size}},hs.expandDuration)},changeSize:function(d,i,b){var k=this.transitions,e=d?(this.last?this.last.a:null):hs.upcoming,j=(k[1]&&e&&hs.getParam(e,"transitions")[1]==k[1])?k[1]:k[0];if(this[j]&&j!="expand"){this[j](d,i);return}if(this.outline&&!this.outlineWhileAnimating){if(d){this.outline.setPosition()}else{this.outline.destroy()}}if(!d){this.destroyOverlays()}var c=this,h=c.x,g=c.y,f=this.easing;if(!d){f=this.easingClose||f}var a=d?function(){if(c.outline){c.outline.table.style.visibility="visible"}setTimeout(function(){c.afterExpand()},50)}:function(){c.afterClose()};if(d){hs.setStyles(this.wrapper,{width:h.t+"px",height:g.t+"px"})}if(this.fadeInOut){hs.setStyles(this.wrapper,{opacity:d?0:1});hs.extend(i.wrapper,{opacity:d})}hs.animate(this.wrapper,i.wrapper,{duration:b,easing:f,step:function(n,l){if(c.outline&&c.outlineWhileAnimating&&l.prop=="top"){var m=d?l.pos:1-l.pos;var o={w:h.t+(h.get("wsize")-h.t)*m,h:g.t+(g.get("wsize")-g.t)*m,x:h.tpos+(h.pos-h.tpos)*m,y:g.tpos+(g.pos-g.tpos)*m};c.outline.setPosition(o,0,1)}}});hs.animate(this.content,i.content,b,f,a);if(d){this.wrapper.style.visibility="visible";this.content.style.visibility="visible";this.a.className+=" highslide-active-anchor"}},fade:function(f,h){this.outlineWhileAnimating=false;var c=this,j=f?hs.expandDuration:0;if(f){hs.animate(this.wrapper,h.wrapper,0);hs.setStyles(this.wrapper,{opacity:0,visibility:"visible"});hs.animate(this.content,h.content,0);this.content.style.visibility="visible";hs.animate(this.wrapper,{opacity:1},j,null,function(){c.afterExpand()})}if(this.outline){this.outline.table.style.zIndex=this.wrapper.style.zIndex;var b=f||-1,d=this.outline.offset,a=f?3:d,g=f?d:3;for(var e=a;b*e<=b*g;e+=b,j+=25){(function(){var i=f?g-e:a-e;setTimeout(function(){c.outline.setPosition(0,i,1)},j)})()}}if(f){}else{setTimeout(function(){if(c.outline){c.outline.destroy(c.preserveContent)}c.destroyOverlays();hs.animate(c.wrapper,{opacity:0},hs.restoreDuration,null,function(){c.afterClose()})},j)}},crossfade:function(g,m,o){if(!g){return}var f=this,p=this.last,l=this.x,k=this.y,d=p.x,b=p.y,a=this.wrapper,i=this.content,c=this.overlayBox;hs.removeEventListener(document,"mousemove",hs.dragHandler);hs.setStyles(i,{width:(l.imgSize||l.size)+"px",height:(k.imgSize||k.size)+"px"});if(c){c.style.overflow="visible"}this.outline=p.outline;if(this.outline){this.outline.exp=f}p.outline=null;var h=hs.createElement("div",{className:"highslide-"+this.contentType},{position:"absolute",zIndex:4,overflow:"hidden",display:"none"});var j={oldImg:p,newImg:this};for(var e in j){this[e]=j[e].content.cloneNode(1);hs.setStyles(this[e],{position:"absolute",border:0,visibility:"visible"});h.appendChild(this[e])}a.appendChild(h);if(c){c.className="";a.appendChild(c)}h.style.display="";p.content.style.display="none";if(hs.safari&&hs.uaVersion<525){this.wrapper.style.visibility="visible"}hs.animate(a,{width:l.size},{duration:hs.transitionDuration,step:function(u,r){var x=r.pos,q=1-x;var w,s={},t=["pos","size","p1","p2"];for(var v in t){w=t[v];s["x"+w]=Math.round(q*d[w]+x*l[w]);s["y"+w]=Math.round(q*b[w]+x*k[w]);s.ximgSize=Math.round(q*(d.imgSize||d.size)+x*(l.imgSize||l.size));s.ximgPad=Math.round(q*d.get("imgPad")+x*l.get("imgPad"));s.yimgSize=Math.round(q*(b.imgSize||b.size)+x*(k.imgSize||k.size));s.yimgPad=Math.round(q*b.get("imgPad")+x*k.get("imgPad"))}if(f.outline){f.outline.setPosition({x:s.xpos,y:s.ypos,w:s.xsize+s.xp1+s.xp2+2*l.cb,h:s.ysize+s.yp1+s.yp2+2*k.cb})}p.wrapper.style.clip="rect("+(s.ypos-b.pos)+"px, "+(s.xsize+s.xp1+s.xp2+s.xpos+2*d.cb-d.pos)+"px, "+(s.ysize+s.yp1+s.yp2+s.ypos+2*b.cb-b.pos)+"px, "+(s.xpos-d.pos)+"px)";hs.setStyles(i,{top:(s.yp1+k.get("imgPad"))+"px",left:(s.xp1+l.get("imgPad"))+"px",marginTop:(k.pos-s.ypos)+"px",marginLeft:(l.pos-s.xpos)+"px"});hs.setStyles(a,{top:s.ypos+"px",left:s.xpos+"px",width:(s.xp1+s.xp2+s.xsize+2*l.cb)+"px",height:(s.yp1+s.yp2+s.ysize+2*k.cb)+"px"});hs.setStyles(h,{width:(s.ximgSize||s.xsize)+"px",height:(s.yimgSize||s.ysize)+"px",left:(s.xp1+s.ximgPad)+"px",top:(s.yp1+s.yimgPad)+"px",visibility:"visible"});hs.setStyles(f.oldImg,{top:(b.pos-s.ypos+b.p1-s.yp1+b.get("imgPad")-s.yimgPad)+"px",left:(d.pos-s.xpos+d.p1-s.xp1+d.get("imgPad")-s.ximgPad)+"px"});hs.setStyles(f.newImg,{opacity:x,top:(k.pos-s.ypos+k.p1-s.yp1+k.get("imgPad")-s.yimgPad)+"px",left:(l.pos-s.xpos+l.p1-s.xp1+l.get("imgPad")-s.ximgPad)+"px"});if(c){hs.setStyles(c,{width:s.xsize+"px",height:s.ysize+"px",left:(s.xp1+l.cb)+"px",top:(s.yp1+k.cb)+"px"})}},complete:function(){a.style.visibility=i.style.visibility="visible";i.style.display="block";hs.discardElement(h);f.afterExpand();p.afterClose();f.last=null}})},reuseOverlay:function(d,c){if(!this.last){return false}for(var b=0;b<this.last.overlays.length;b++){var a=hs.$("hsId"+this.last.overlays[b]);if(a&&a.hsId==d.hsId){this.genOverlayBox();a.reuse=this.key;hs.push(this.overlays,this.last.overlays[b]);return true}}return false},afterExpand:function(){this.isExpanded=true;this.focus();if(this.dimmingOpacity){hs.dim(this)}if(hs.upcoming&&hs.upcoming==this.a){hs.upcoming=null}this.prepareNextOutline();var c=hs.page,b=hs.mouse.x+c.scrollLeft,a=hs.mouse.y+c.scrollTop;this.mouseIsOver=this.x.pos<b&&b<this.x.pos+this.x.get("wsize")&&this.y.pos<a&&a<this.y.pos+this.y.get("wsize");if(this.overlayBox){this.showOverlays()}},prepareNextOutline:function(){var a=this.key;var b=this.outlineType;new hs.Outline(b,function(){try{hs.expanders[a].preloadNext()}catch(c){}})},preloadNext:function(){var b=this.getAdjacentAnchor(1);if(b&&b.onclick.toString().match(/hs\.expand/)){var a=hs.createElement("img",{src:hs.getSrc(b)})}},getAdjacentAnchor:function(c){var b=this.getAnchorIndex(),a=hs.anchors.groups[this.slideshowGroup||"none"];if(a&&!a[b+c]&&this.slideshow&&this.slideshow.repeat){if(c==1){return a[0]}else{if(c==-1){return a[a.length-1]}}}return(a&&a[b+c])||null},getAnchorIndex:function(){var a=hs.getAnchors().groups[this.slideshowGroup||"none"];if(a){for(var b=0;b<a.length;b++){if(a[b]==this.a){return b}}}return null},getNumber:function(){if(this[this.numberPosition]){var a=hs.anchors.groups[this.slideshowGroup||"none"];if(a){var b=hs.lang.number.replace("%1",this.getAnchorIndex()+1).replace("%2",a.length);this[this.numberPosition].innerHTML='<div class="highslide-number">'+b+"</div>"+this[this.numberPosition].innerHTML}}},initSlideshow:function(){if(!this.last){for(var c=0;c<hs.slideshows.length;c++){var b=hs.slideshows[c],d=b.slideshowGroup;if(typeof d=="undefined"||d===null||d===this.slideshowGroup){this.slideshow=new hs.Slideshow(this.key,b)}}}else{this.slideshow=this.last.slideshow}var b=this.slideshow;if(!b){return}var a=b.expKey=this.key;b.checkFirstAndLast();b.disable("full-expand");if(b.controls){this.createOverlay(hs.extend(b.overlayOptions||{},{overlayId:b.controls,hsId:"controls",zIndex:5}))}if(b.thumbstrip){b.thumbstrip.add(this)}if(!this.last&&this.autoplay){b.play(true)}if(b.autoplay){b.autoplay=setTimeout(function(){hs.next(a)},(b.interval||500))}},cancelLoading:function(){hs.discardElement(this.wrapper);hs.expanders[this.key]=null;if(hs.upcoming==this.a){hs.upcoming=null}hs.undim(this.key);if(this.loading){hs.loading.style.left="-9999px"}},writeCredits:function(){if(this.credits){return}this.credits=hs.createElement("a",{href:hs.creditsHref,target:hs.creditsTarget,className:"highslide-credits",innerHTML:hs.lang.creditsText,title:hs.lang.creditsTitle});this.createOverlay({overlayId:this.credits,position:this.creditsPosition||"top left",hsId:"credits"})},getInline:function(types,addOverlay){for(var i=0;i<types.length;i++){var type=types[i],s=null;if(!this[type+"Id"]&&this.thumbsUserSetId){this[type+"Id"]=type+"-for-"+this.thumbsUserSetId}if(this[type+"Id"]){this[type]=hs.getNode(this[type+"Id"])}if(!this[type]&&!this[type+"Text"]&&this[type+"Eval"]){try{s=eval(this[type+"Eval"])}catch(e){}}if(!this[type]&&this[type+"Text"]){s=this[type+"Text"]}if(!this[type]&&!s){this[type]=hs.getNode(this.a["_"+type+"Id"]);if(!this[type]){var next=this.a.nextSibling;while(next&&!hs.isHsAnchor(next)){if((new RegExp("highslide-"+type)).test(next.className||null)){if(!next.id){this.a["_"+type+"Id"]=next.id="hsId"+hs.idCounter++}this[type]=hs.getNode(next.id);break}next=next.nextSibling}}}if(!this[type]&&!s&&this.numberPosition==type){s="\n"}if(!this[type]&&s){this[type]=hs.createElement("div",{className:"highslide-"+type,innerHTML:s})}if(addOverlay&&this[type]){var o={position:(type=="heading")?"above":"below"};for(var x in this[type+"Overlay"]){o[x]=this[type+"Overlay"][x]}o.overlayId=this[type];this.createOverlay(o)}}},doShowHide:function(a){if(hs.hideSelects){this.showHideElements("SELECT",a)}if(hs.hideIframes){this.showHideElements("IFRAME",a)}if(hs.geckoMac){this.showHideElements("*",a)}},showHideElements:function(c,b){var e=document.getElementsByTagName(c);var a=c=="*"?"overflow":"visibility";for(var f=0;f<e.length;f++){if(a=="visibility"||(document.defaultView.getComputedStyle(e[f],"").getPropertyValue("overflow")=="auto"||e[f].getAttribute("hidden-by")!=null)){var h=e[f].getAttribute("hidden-by");if(b=="visible"&&h){h=h.replace("["+this.key+"]","");e[f].setAttribute("hidden-by",h);if(!h){e[f].style[a]=e[f].origProp}}else{if(b=="hidden"){var k=hs.getPosition(e[f]);k.w=e[f].offsetWidth;k.h=e[f].offsetHeight;if(!this.dimmingOpacity){var j=(k.x+k.w<this.x.get("opos")||k.x>this.x.get("opos")+this.x.get("osize"));var g=(k.y+k.h<this.y.get("opos")||k.y>this.y.get("opos")+this.y.get("osize"))}var d=hs.getWrapperKey(e[f]);if(!j&&!g&&d!=this.key){if(!h){e[f].setAttribute("hidden-by","["+this.key+"]");e[f].origProp=e[f].style[a];e[f].style[a]="hidden"}else{if(h.indexOf("["+this.key+"]")==-1){e[f].setAttribute("hidden-by",h+"["+this.key+"]")}}}else{if((h=="["+this.key+"]"||hs.focusKey==d)&&d!=this.key){e[f].setAttribute("hidden-by","");e[f].style[a]=e[f].origProp||""}else{if(h&&h.indexOf("["+this.key+"]")>-1){e[f].setAttribute("hidden-by",h.replace("["+this.key+"]",""))}}}}}}}},focus:function(){this.wrapper.style.zIndex=hs.zIndexCounter+=2;for(var a=0;a<hs.expanders.length;a++){if(hs.expanders[a]&&a==hs.focusKey){var b=hs.expanders[a];b.content.className+=" highslide-"+b.contentType+"-blur";b.content.style.cursor=hs.ieLt7?"hand":"pointer";b.content.title=hs.lang.focusTitle}}if(this.outline){this.outline.table.style.zIndex=this.wrapper.style.zIndex-1}this.content.className="highslide-"+this.contentType;this.content.title=hs.lang.restoreTitle;if(hs.restoreCursor){hs.styleRestoreCursor=window.opera?"pointer":"url("+hs.graphicsDir+hs.restoreCursor+"), pointer";if(hs.ieLt7&&hs.uaVersion<6){hs.styleRestoreCursor="hand"}this.content.style.cursor=hs.styleRestoreCursor}hs.focusKey=this.key;hs.addEventListener(document,window.opera?"keypress":"keydown",hs.keyHandler)},moveTo:function(a,b){this.x.setPos(a);this.y.setPos(b)},resize:function(d){var a,b,c=d.width/d.height;a=Math.max(d.width+d.dX,Math.min(this.minWidth,this.x.full));if(this.isImage&&Math.abs(a-this.x.full)<12){a=this.x.full}b=a/c;if(b<Math.min(this.minHeight,this.y.full)){b=Math.min(this.minHeight,this.y.full);if(this.isImage){a=b*c}}this.resizeTo(a,b)},resizeTo:function(a,b){this.y.setSize(b);this.x.setSize(a);this.wrapper.style.height=this.y.get("wsize")+"px"},close:function(){if(this.isClosing||!this.isExpanded){return}if(this.transitions[1]=="crossfade"&&hs.upcoming){hs.getExpander(hs.upcoming).cancelLoading();hs.upcoming=null}this.isClosing=true;if(this.slideshow&&!hs.upcoming){this.slideshow.pause()}hs.removeEventListener(document,window.opera?"keypress":"keydown",hs.keyHandler);try{this.content.style.cursor="default";this.changeSize(0,{wrapper:{width:this.x.t,height:this.y.t,left:this.x.tpos-this.x.cb+this.x.tb,top:this.y.tpos-this.y.cb+this.y.tb},content:{left:0,top:0,width:this.x.t,height:this.y.t}},hs.restoreDuration)}catch(a){this.afterClose()}},createOverlay:function(e){var d=e.overlayId,a=(e.relativeTo=="viewport"&&!/panel$/.test(e.position));if(typeof d=="string"){d=hs.getNode(d)}if(e.html){d=hs.createElement("div",{innerHTML:e.html})}if(!d||typeof d=="string"){return}d.style.display="block";e.hsId=e.hsId||e.overlayId;if(this.transitions[1]=="crossfade"&&this.reuseOverlay(e,d)){return}this.genOverlayBox();var c=e.width&&/^[0-9]+(px|%)$/.test(e.width)?e.width:"auto";if(/^(left|right)panel$/.test(e.position)&&!/^[0-9]+px$/.test(e.width)){c="200px"}var b=hs.createElement("div",{id:"hsId"+hs.idCounter++,hsId:e.hsId},{position:"absolute",visibility:"hidden",width:c,direction:hs.lang.cssDirection||"",opacity:0},a?hs.viewport:this.overlayBox,true);if(a){b.hsKey=this.key}b.appendChild(d);hs.extend(b,{opacity:1,offsetX:0,offsetY:0,dur:(e.fade===0||e.fade===false||(e.fade==2&&hs.ie))?0:250});hs.extend(b,e);if(this.gotOverlays){this.positionOverlay(b);if(!b.hideOnMouseOut||this.mouseIsOver){hs.animate(b,{opacity:b.opacity},b.dur)}}hs.push(this.overlays,hs.idCounter-1)},positionOverlay:function(e){var f=e.position||"middle center",c=(e.relativeTo=="viewport"),b=e.offsetX,a=e.offsetY;if(c){hs.viewport.style.display="block";e.hsKey=this.key;if(e.offsetWidth>e.parentNode.offsetWidth){e.style.width="100%"}}else{if(e.parentNode!=this.overlayBox){this.overlayBox.appendChild(e)}}if(/left$/.test(f)){e.style.left=b+"px"}if(/center$/.test(f)){hs.setStyles(e,{left:"50%",marginLeft:(b-Math.round(e.offsetWidth/2))+"px"})}if(/right$/.test(f)){e.style.right=-b+"px"}if(/^leftpanel$/.test(f)){hs.setStyles(e,{right:"100%",marginRight:this.x.cb+"px",top:-this.y.cb+"px",bottom:-this.y.cb+"px",overflow:"auto"});this.x.p1=e.offsetWidth}else{if(/^rightpanel$/.test(f)){hs.setStyles(e,{left:"100%",marginLeft:this.x.cb+"px",top:-this.y.cb+"px",bottom:-this.y.cb+"px",overflow:"auto"});this.x.p2=e.offsetWidth}}var d=e.parentNode.offsetHeight;e.style.height="auto";if(c&&e.offsetHeight>d){e.style.height=hs.ieLt7?d+"px":"100%"}if(/^top/.test(f)){e.style.top=a+"px"}if(/^middle/.test(f)){hs.setStyles(e,{top:"50%",marginTop:(a-Math.round(e.offsetHeight/2))+"px"})}if(/^bottom/.test(f)){e.style.bottom=-a+"px"}if(/^above$/.test(f)){hs.setStyles(e,{left:(-this.x.p1-this.x.cb)+"px",right:(-this.x.p2-this.x.cb)+"px",bottom:"100%",marginBottom:this.y.cb+"px",width:"auto"});this.y.p1=e.offsetHeight}else{if(/^below$/.test(f)){hs.setStyles(e,{position:"relative",left:(-this.x.p1-this.x.cb)+"px",right:(-this.x.p2-this.x.cb)+"px",top:"100%",marginTop:this.y.cb+"px",width:"auto"});this.y.p2=e.offsetHeight;e.style.position="absolute"}}},getOverlays:function(){this.getInline(["heading","caption"],true);this.getNumber();if(this.heading&&this.dragByHeading){this.heading.className+=" highslide-move"}if(hs.showCredits){this.writeCredits()}for(var a=0;a<hs.overlays.length;a++){var d=hs.overlays[a],e=d.thumbnailId,b=d.slideshowGroup;if((!e&&!b)||(e&&e==this.thumbsUserSetId)||(b&&b===this.slideshowGroup)){this.createOverlay(d)}}var c=[];for(var a=0;a<this.overlays.length;a++){var d=hs.$("hsId"+this.overlays[a]);if(/panel$/.test(d.position)){this.positionOverlay(d)}else{hs.push(c,d)}}for(var a=0;a<c.length;a++){this.positionOverlay(c[a])}this.gotOverlays=true},genOverlayBox:function(){if(!this.overlayBox){this.overlayBox=hs.createElement("div",{className:this.wrapperClassName},{position:"absolute",width:(this.x.size||(this.useBox?this.width:null)||this.x.full)+"px",height:(this.y.size||this.y.full)+"px",visibility:"hidden",overflow:"hidden",zIndex:hs.ie?4:"auto"},hs.container,true)}},sizeOverlayBox:function(f,d){var c=this.overlayBox,a=this.x,h=this.y;hs.setStyles(c,{width:a.size+"px",height:h.size+"px"});if(f||d){for(var e=0;e<this.overlays.length;e++){var g=hs.$("hsId"+this.overlays[e]);var b=(hs.ieLt7||document.compatMode=="BackCompat");if(g&&/^(above|below)$/.test(g.position)){if(b){g.style.width=(c.offsetWidth+2*a.cb+a.p1+a.p2)+"px"}h[g.position=="above"?"p1":"p2"]=g.offsetHeight}if(g&&b&&/^(left|right)panel$/.test(g.position)){g.style.height=(c.offsetHeight+2*h.cb)+"px"}}}if(f){hs.setStyles(this.content,{top:h.p1+"px"});hs.setStyles(c,{top:(h.p1+h.cb)+"px"})}},showOverlays:function(){var a=this.overlayBox;a.className="";hs.setStyles(a,{top:(this.y.p1+this.y.cb)+"px",left:(this.x.p1+this.x.cb)+"px",overflow:"visible"});if(hs.safari){a.style.visibility="visible"}this.wrapper.appendChild(a);for(var c=0;c<this.overlays.length;c++){var d=hs.$("hsId"+this.overlays[c]);d.style.zIndex=d.zIndex||4;if(!d.hideOnMouseOut||this.mouseIsOver){d.style.visibility="visible";hs.setStyles(d,{visibility:"visible",display:""});hs.animate(d,{opacity:d.opacity},d.dur)}}},destroyOverlays:function(){if(!this.overlays.length){return}if(this.slideshow){var d=this.slideshow.controls;if(d&&hs.getExpander(d)==this){d.parentNode.removeChild(d)}}for(var a=0;a<this.overlays.length;a++){var b=hs.$("hsId"+this.overlays[a]);if(b&&b.parentNode==hs.viewport&&hs.getExpander(b)==this){hs.discardElement(b)}}hs.discardElement(this.overlayBox)},createFullExpand:function(){if(this.slideshow&&this.slideshow.controls){this.slideshow.enable("full-expand");return}this.fullExpandLabel=hs.createElement("a",{href:"javascript:hs.expanders["+this.key+"].doFullExpand();",title:hs.lang.fullExpandTitle,className:"highslide-full-expand"});this.createOverlay({overlayId:this.fullExpandLabel,position:hs.fullExpandPosition,hideOnMouseOut:true,opacity:hs.fullExpandOpacity})},doFullExpand:function(){try{if(this.fullExpandLabel){hs.discardElement(this.fullExpandLabel)}this.focus();var c=this.x.size,a=this.y.size;this.resizeTo(this.x.full,this.y.full);var b=this.x.pos-(this.x.size-c)/2;if(b<hs.marginLeft){b=hs.marginLeft}var f=this.y.pos-(this.y.size-a)/2;if(f<hs.marginTop){f=hs.marginTop}this.moveTo(b,f);this.doShowHide("hidden")}catch(d){this.error(d)}},afterClose:function(){this.a.className=this.a.className.replace("highslide-active-anchor","");this.doShowHide("visible");if(this.outline&&this.outlineWhileAnimating){this.outline.destroy()}hs.discardElement(this.wrapper);this.destroyOverlays();if(!hs.viewport.childNodes.length){hs.viewport.style.display="none"}if(this.dimmingOpacity){hs.undim(this.key)}hs.expanders[this.key]=null;hs.reOrder()}};hs.Slideshow=function(c,b){if(hs.dynamicallyUpdateAnchors!==false){hs.updateAnchors()}this.expKey=c;for(var a in b){this[a]=b[a]}if(this.useControls){this.getControls()}if(this.thumbstrip){this.thumbstrip=hs.Thumbstrip(this)}};hs.Slideshow.prototype={getControls:function(){this.controls=hs.createElement("div",{innerHTML:hs.replaceLang(hs.skin.controls)},null,hs.container);var b=["play","pause","previous","next","move","full-expand","close"];this.btn={};var c=this;for(var a=0;a<b.length;a++){this.btn[b[a]]=hs.getElementByClass(this.controls,"li","highslide-"+b[a]);this.enable(b[a])}this.btn.pause.style.display="none"},checkFirstAndLast:function(){if(this.repeat||!this.controls){return}var c=hs.expanders[this.expKey],b=c.getAnchorIndex(),a=/disabled$/;if(b==0){this.disable("previous")}else{if(a.test(this.btn.previous.getElementsByTagName("a")[0].className)){this.enable("previous")}}if(b+1==hs.anchors.groups[c.slideshowGroup||"none"].length){this.disable("next");this.disable("play")}else{if(a.test(this.btn.next.getElementsByTagName("a")[0].className)){this.enable("next");this.enable("play")}}},enable:function(d){if(!this.btn){return}var c=this,b=this.btn[d].getElementsByTagName("a")[0],e=/disabled$/;b.onclick=function(){c[d]();return false};if(e.test(b.className)){b.className=b.className.replace(e,"")}},disable:function(c){if(!this.btn){return}var b=this.btn[c].getElementsByTagName("a")[0];b.onclick=function(){return false};if(!/disabled$/.test(b.className)){b.className+=" disabled"}},hitSpace:function(){if(this.autoplay){this.pause()}else{this.play()}},play:function(a){if(this.btn){this.btn.play.style.display="none";this.btn.pause.style.display=""}this.autoplay=true;if(!a){hs.next(this.expKey)}},pause:function(){if(this.btn){this.btn.pause.style.display="none";this.btn.play.style.display=""}clearTimeout(this.autoplay);this.autoplay=null},previous:function(){this.pause();hs.previous(this.btn.previous)},next:function(){this.pause();hs.next(this.btn.next)},move:function(){},"full-expand":function(){hs.getExpander().doFullExpand()},close:function(){hs.close(this.btn.close)}};hs.Thumbstrip=function(k){function p(i){hs.extend(f||{},{overlayId:r,hsId:"thumbstrip",className:"highslide-thumbstrip-"+m+"-overlay "+(f.className||"")});if(hs.ieLt7){f.fade=0}i.createOverlay(f);hs.setStyles(r.parentNode,{overflow:"hidden"})}function c(i){d(undefined,Math.round(i*r[h?"offsetWidth":"offsetHeight"]*0.7))}function d(L,M){if(L===undefined){for(var K=0;K<j.length;K++){if(j[K]==hs.expanders[k.expKey].a){L=K;break}}}if(L===undefined){return}var G=r.getElementsByTagName("a"),z=G[L],w=z.parentNode,y=h?"Left":"Top",N=h?"Right":"Bottom",I=h?"Width":"Height",B="offset"+y,H="offset"+I,x=n.parentNode.parentNode[H],F=x-s[H],v=parseInt(s.style[h?"left":"top"])||0,C=v,D=20;if(M!==undefined){C=v-M;if(F>0){F=0}if(C>0){C=0}if(C<F){C=F}}else{for(var K=0;K<G.length;K++){G[K].className=""}z.className="highslide-active-anchor";var J=L>0?G[L-1].parentNode[B]:w[B],A=w[B]+w[H]+(G[L+1]?G[L+1].parentNode[H]:0);if(A>x-v){C=x-A}else{if(J<-v){C=-J}}}var E=w[B]+(w[H]-g[H])/2+C;hs.animate(s,h?{left:C}:{top:C},null,"easeOutQuad");hs.animate(g,h?{left:E}:{top:E},null,"easeOutQuad");l.style.display=C<0?"block":"none";t.style.display=(C>F)?"block":"none"}var j=hs.anchors.groups[hs.expanders[k.expKey].slideshowGroup||"none"],f=k.thumbstrip,m=f.mode||"horizontal",u=(m=="float"),o=u?["div","ul","li","span"]:["table","tbody","tr","td"],h=(m=="horizontal"),r=hs.createElement("div",{className:"highslide-thumbstrip highslide-thumbstrip-"+m,innerHTML:'<div class="highslide-thumbstrip-inner"><'+o[0]+"><"+o[1]+"></"+o[1]+"></"+o[0]+'></div><div class="highslide-scroll-up"><div></div></div><div class="highslide-scroll-down"><div></div></div><div class="highslide-marker"><div></div></div>'},{display:"none"},hs.container),e=r.childNodes,n=e[0],l=e[1],t=e[2],g=e[3],s=n.firstChild,a=r.getElementsByTagName(o[1])[0],b;for(var q=0;q<j.length;q++){if(q==0||!h){b=hs.createElement(o[2],null,null,a)}(function(){var v=j[q],i=hs.createElement(o[3],null,null,b),w=q;hs.createElement("a",{href:v.href,title:v.title,onclick:function(){if(/highslide-active-anchor/.test(this.className)){return false}hs.getExpander(this).focus();return hs.transit(v)},innerHTML:hs.stripItemFormatter?hs.stripItemFormatter(v):v.innerHTML},null,i)})()}if(!u){l.onclick=function(){c(-1)};t.onclick=function(){c(1)};hs.addEventListener(a,document.onmousewheel!==undefined?"mousewheel":"DOMMouseScroll",function(i){var v=0;i=i||window.event;if(i.wheelDelta){v=i.wheelDelta/120;if(hs.opera){v=-v}}else{if(i.detail){v=-i.detail/3}}if(v){c(-v*0.2)}if(i.preventDefault){i.preventDefault()}i.returnValue=false})}return{add:p,selectThumb:d}};hs.langDefaults=hs.lang;var HsExpander=hs.Expander;if(hs.ie&&window==window.top){(function(){try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,50);return}hs.ready()})()}hs.addEventListener(document,"DOMContentLoaded",hs.ready);hs.addEventListener(window,"load",hs.ready);hs.addEventListener(document,"ready",function(){if(hs.expandCursor||hs.dimmingOpacity){var d=hs.createElement("style",{type:"text/css"},null,document.getElementsByTagName("HEAD")[0]),c=document.compatMode=="BackCompat";function b(f,g){if(hs.ie&&(hs.uaVersion<9||c)){var e=document.styleSheets[document.styleSheets.length-1];if(typeof(e.addRule)=="object"){e.addRule(f,g)}}else{d.appendChild(document.createTextNode(f+" {"+g+"}"))}}function a(e){return"expression( ( ( ignoreMe = document.documentElement."+e+" ? document.documentElement."+e+" : document.body."+e+" ) ) + 'px' );"}if(hs.expandCursor){b(".highslide img","cursor: url("+hs.graphicsDir+hs.expandCursor+"), pointer !important;")}b(".highslide-viewport-size",hs.ie&&(hs.uaVersion<7||c)?"position: absolute; left:"+a("scrollLeft")+"top:"+a("scrollTop")+"width:"+a("clientWidth")+"height:"+a("clientHeight"):"position: fixed; width: 100%; height: 100%; left: 0; top: 0")}});hs.addEventListener(window,"resize",function(){hs.getPageSize();if(hs.viewport){for(var a=0;a<hs.viewport.childNodes.length;a++){var b=hs.viewport.childNodes[a],c=hs.getExpander(b);c.positionOverlay(b);if(b.hsId=="thumbstrip"){c.slideshow.thumbstrip.selectThumb()}}}});hs.addEventListener(document,"mousemove",function(a){hs.mouse={x:a.clientX,y:a.clientY}});hs.addEventListener(document,"mousedown",hs.mouseClickHandler);hs.addEventListener(document,"mouseup",hs.mouseClickHandler);hs.addEventListener(document,"ready",hs.getAnchors);hs.addEventListener(window,"load",hs.preloadImages)};
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide-with-gallery.packed.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide-with-gallery.packed.js
new file mode 100644
index 0000000000000000000000000000000000000000..449942c8ea8f3a654c487d830a4120540d8780f3
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide-with-gallery.packed.js
@@ -0,0 +1,9 @@
+/** 
+ * Name:    Highslide JS
+ * Version: 4.1.13 (2011-10-06)
+ * Config:  default +slideshow +positioning +transitions +viewport +thumbstrip +packed
+ * Author:  Torstein Hønsi
+ * Support: www.highslide.com/support
+ * License: www.highslide.com/#license
+ */
+eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('q(!m){u m={18:{9C:\'9t\',9f:\'bb...\',9g:\'8o 1L ba\',9Y:\'8o 1L bd 1L bw\',7p:\'bx 1L bl B (f)\',aS:\'bp by <i>8H 8I</i>\',b0:\'bn 1L bj 8H 8I bz\',8T:\'8C\',8U:\'8D\',8w:\'8E\',8v:\'8J\',8t:\'8J (bv)\',bu:\'bg\',8P:\'8G\',8A:\'8G 1g (8B)\',8N:\'8F\',8M:\'8F 1g (8B)\',8S:\'8C (8l 14)\',8O:\'8D (8l 2V)\',8s:\'8E\',8r:\'1:1\',3n:\'b9 %1 bq %2\',84:\'8o 1L 26 2M, c4 8L c6 1L 3i. c0 8l c1 K 1p 8L 3c.\'},4p:\'L/bX/\',5M:\'bI.4y\',5m:\'bK.4y\',7f:53,8p:53,4L:15,9M:15,4j:15,9K:15,4z:bE,91:0.75,9j:J,7A:5,3B:2,bP:3,4R:1f,at:\'4g 2V\',aq:1,an:J,aF:\'bQ://L.c2/\',aE:\'bO\',8V:J,8e:[\'a\'],2Z:[],aL:53,3I:0,7G:50,3Q:\'2n\',6H:\'2n\',8y:H,8x:H,7v:J,5c:8R,5w:8R,5q:J,1B:\'bR-bS\',a6:{2B:\'<X 2s="L-2B"><7V>\'+\'<1R 2s="L-3c">\'+\'<a 1Y="#" 1X="{m.18.8S}">\'+\'<23>{m.18.8T}</23></a>\'+\'</1R>\'+\'<1R 2s="L-3r">\'+\'<a 1Y="#" 1X="{m.18.8A}">\'+\'<23>{m.18.8P}</23></a>\'+\'</1R>\'+\'<1R 2s="L-2S">\'+\'<a 1Y="#" 1X="{m.18.8M}">\'+\'<23>{m.18.8N}</23></a>\'+\'</1R>\'+\'<1R 2s="L-1p">\'+\'<a 1Y="#" 1X="{m.18.8O}">\'+\'<23>{m.18.8U}</23></a>\'+\'</1R>\'+\'<1R 2s="L-3i">\'+\'<a 1Y="#" 1X="{m.18.8s}">\'+\'<23>{m.18.8w}</23></a>\'+\'</1R>\'+\'<1R 2s="L-1a-2D">\'+\'<a 1Y="#" 1X="{m.18.7p}">\'+\'<23>{m.18.8r}</23></a>\'+\'</1R>\'+\'<1R 2s="L-26">\'+\'<a 1Y="#" 1X="{m.18.8t}" >\'+\'<23>{m.18.8v}</23></a>\'+\'</1R>\'+\'</7V></X>\'},4X:[],6Z:J,W:[],6V:[\'5q\',\'30\',\'3Q\',\'6H\',\'8y\',\'8x\',\'1B\',\'3B\',\'bG\',\'bH\',\'bJ\',\'8u\',\'bW\',\'cd\',\'cc\',\'8z\',\'aW\',\'7v\',\'3D\',\'5b\',\'2Z\',\'3I\',\'M\',\'1b\',\'7B\',\'5c\',\'5w\',\'6F\',\'6R\',\'9i\',\'2t\',\'2r\',\'aT\',\'aD\',\'1G\'],1x:[],4V:0,7q:{x:[\'9H\',\'14\',\'4i\',\'2V\',\'9L\'],y:[\'4T\',\'11\',\'8h\',\'4g\',\'6D\']},66:{},8z:{},8u:{},3u:[],4U:[],48:{},7I:{},5G:[],21:/ca\\/4\\.0/.19(4B.5r)?8:8n((4B.5r.5Y().2H(/.+(?:9y|c9|ce|2m)[\\/: ]([\\d.]+)/)||[0,\'0\'])[1]),2m:(R.52&&!1A.3q),4u:/cf/.19(4B.5r),5Z:/ci.+9y:1\\.[0-8].+cg/.19(4B.5r),$:z(1M){q(1M)D R.c7(1M)},2p:z(2o,3j){2o[2o.S]=3j},1c:z(9m,4k,3P,8b,9n){u C=R.1c(9m);q(4k)m.3b(C,4k);q(9n)m.V(C,{bY:0,aM:\'1F\',6S:0});q(3P)m.V(C,3P);q(8b)8b.2E(C);D C},3b:z(C,4k){K(u x 2T 4k)C[x]=4k[x];D C},V:z(C,3P){K(u x 2T 3P){q(m.4d&&x==\'1n\'){q(3P[x]>0.99)C.G.c5(\'5j\');I C.G.5j=\'9o(1n=\'+(3P[x]*28)+\')\'}I C.G[x]=3P[x]}},2b:z(C,Z,31){u 41,4v,47;q(1q 31!=\'6q\'||31===H){u 36=9V;31={3J:36[2],2r:36[3],63:36[4]}}q(1q 31.3J!=\'3n\')31.3J=53;31.2r=1d[31.2r]||1d.93;31.5S=m.3b({},Z);K(u 35 2T Z){u e=24 m.1E(C,31,35);41=8n(m.7U(C,35))||0;4v=8n(Z[35]);47=35!=\'1n\'?\'F\':\'\';e.3F(41,4v,47)}},7U:z(C,Z){q(C.G[Z]){D C.G[Z]}I q(R.6T){D R.6T.9P(C,H).9Q(Z)}I{q(Z==\'1n\')Z=\'5j\';u 3j=C.bf[Z.2j(/\\-(\\w)/g,z(a,b){D b.92()})];q(Z==\'5j\')3j=3j.2j(/9o\\(1n=([0-9]+)\\)/,z(a,b){D b/28});D 3j===\'\'?1:3j}},6v:z(){u d=R,w=1A,5d=d.6i&&d.6i!=\'7P\'?d.4l:d.3x,4d=m.2m&&(m.21<9||1q 9l==\'1C\');u M=4d?5d.8m:(d.4l.8m||5J.b2),1b=4d?5d.aK:5J.b3;m.3S={M:M,1b:1b,5l:4d?5d.5l:9l,5i:4d?5d.5i:be};D m.3S},6g:z(C){u p={x:C.4f,y:C.9h};4o(C.9k){C=C.9k;p.x+=C.4f;p.y+=C.9h;q(C!=R.3x&&C!=R.4l){p.x-=C.5l;p.y-=C.5i}}D p},2D:z(a,2O,3F,T){q(!a)a=m.1c(\'a\',H,{1u:\'1F\'},m.22);q(1q a.5u==\'z\')D 2O;2d{24 m.4Z(a,2O,3F);D 1f}1W(e){D J}},a4:z(C,4F,U){u 1i=C.2L(4F);K(u i=0;i<1i.S;i++){q((24 5X(U)).19(1i[i].U)){D 1i[i]}}D H},a7:z(s){s=s.2j(/\\s/g,\' \');u 1T=/{m\\.18\\.([^}]+)\\}/g,4S=s.2H(1T),18;q(4S)K(u i=0;i<4S.S;i++){18=4S[i].2j(1T,"$1");q(1q m.18[18]!=\'1C\')s=s.2j(4S[i],m.18[18])}D s},9w:z(){u 7J=0,6j=-1,W=m.W,A,1r;K(u i=0;i<W.S;i++){A=W[i];q(A){1r=A.Q.G.1r;q(1r&&1r>7J){7J=1r;6j=i}}}q(6j==-1)m.3v=-1;I W[6j].43()},5h:z(a,5p){a.5u=a.2G;u p=a.5u?a.5u():H;a.5u=H;D(p&&1q p[5p]!=\'1C\')?p[5p]:(1q m[5p]!=\'1C\'?m[5p]:H)},73:z(a){u 1G=m.5h(a,\'1G\');q(1G)D 1G;D a.1Y},4W:z(1M){u 3w=m.$(1M),45=m.7I[1M],a={};q(!3w&&!45)D H;q(!45){45=3w.7j(J);45.1M=\'\';m.7I[1M]=45;D 3w}I{D 45.7j(J)}},3H:z(d){q(d)m.8j.2E(d);m.8j.2R=\'\'},1m:z(A){q(!m.2a){7E=J;m.2a=m.1c(\'X\',{U:\'L-bk L-1Z-B\',4x:\'\',2G:z(){m.26()}},{1e:\'1D\',1n:0},m.22,J);q(/(bm|bt|bo|br)/.19(4B.5r)){u 3x=R.3x;z 7H(){m.V(m.2a,{M:3x.bA+\'F\',1b:3x.b5+\'F\'})}7H();m.1Q(1A,\'3O\',7H)}}m.2a.G.1u=\'\';u 7E=m.2a.4x==\'\';m.2a.4x+=\'|\'+A.P;q(7E){q(m.5Z&&m.9q)m.V(m.2a,{9e:\'5O(\'+m.4p+\'bh.97)\',1n:1});I m.2b(m.2a,{1n:A.3I},m.7G)}},7Q:z(P){q(!m.2a)D;q(1q P!=\'1C\')m.2a.4x=m.2a.4x.2j(\'|\'+P,\'\');q((1q P!=\'1C\'&&m.2a.4x!=\'\')||(m.1U&&m.5h(m.1U,\'3I\')))D;q(m.5Z&&m.9q)m.2a.G.1u=\'1F\';I m.2b(m.2a,{1n:0},m.7G,H,z(){m.2a.G.1u=\'1F\'})},83:z(6n,A){u Y=A||m.2h();A=Y;q(m.1U)D 1f;I m.Y=Y;m.49(R,1A.3q?\'5P\':\'5Q\',m.4N);2d{m.1U=6n;6n.2G()}1W(e){m.Y=m.1U=H}2d{q(!6n||A.2Z[1]!=\'3Y\')A.26()}1W(e){}D 1f},6d:z(C,1P){u A=m.2h(C);q(A)D m.83(A.7b(1P),A);I D 1f},3c:z(C){D m.6d(C,-1)},1p:z(C){D m.6d(C,1)},4N:z(e){q(!e)e=1A.29;q(!e.2i)e.2i=e.7l;q(1q e.2i.9x!=\'1C\')D J;u A=m.2h();u 1P=H;8Y(e.cq){1I 70:q(A)A.6k();D J;1I 32:1P=2;5B;1I 34:1I 39:1I 40:1P=1;5B;1I 8:1I 33:1I 37:1I 38:1P=-1;5B;1I 27:1I 13:1P=0}q(1P!==H){q(1P!=2)m.49(R,1A.3q?\'5P\':\'5Q\',m.4N);q(!m.8V)D J;q(e.4D)e.4D();I e.9W=1f;q(A){q(1P==0){A.26()}I q(1P==2){q(A.1g)A.1g.ad()}I{q(A.1g)A.1g.2S();m.6d(A.P,1P)}D 1f}}D J},d5:z(O){m.2p(m.1x,m.3b(O,{1H:\'1H\'+m.4V++}))},d4:z(1h){u 2C=1h.2t;q(1q 2C==\'6q\'){K(u i=0;i<2C.S;i++){u o={};K(u x 2T 1h)o[x]=1h[x];o.2t=2C[i];m.2p(m.4U,o)}}I{m.2p(m.4U,1h)}},86:z(7N,65){u C,1T=/^L-Q-([0-9]+)$/;C=7N;4o(C.1O){q(C.5F!==1C)D C.5F;q(C.1M&&1T.19(C.1M))D C.1M.2j(1T,"$1");C=C.1O}q(!65){C=7N;4o(C.1O){q(C.4F&&m.5L(C)){K(u P=0;P<m.W.S;P++){u A=m.W[P];q(A&&A.a==C)D P}}C=C.1O}}D H},2h:z(C,65){q(1q C==\'1C\')D m.W[m.3v]||H;q(1q C==\'3n\')D m.W[C]||H;q(1q C==\'8q\')C=m.$(C);D m.W[m.86(C,65)]||H},5L:z(a){D(a.2G&&a.2G.aI().2j(/\\s/g,\' \').2H(/m.(d6|e)d7/))},ai:z(){K(u i=0;i<m.W.S;i++)q(m.W[i]&&m.W[i].55)m.9w()},87:z(e){q(!e)e=1A.29;q(e.d9>1)D J;q(!e.2i)e.2i=e.7l;u C=e.2i;4o(C.1O&&!(/L-(2M|3i|5W|3O)/.19(C.U))){C=C.1O}u A=m.2h(C);q(A&&(A.8c||!A.55))D J;q(A&&e.T==\'aH\'){q(e.2i.9x)D J;u 2H=C.U.2H(/L-(2M|3i|3O)/);q(2H){m.2I={A:A,T:2H[1],14:A.x.E,M:A.x.B,11:A.y.E,1b:A.y.B,9v:e.6c,9u:e.68};m.1Q(R,\'6o\',m.5V);q(e.4D)e.4D();q(/L-(2M|5W)-89/.19(A.17.U)){A.43();m.7R=J}D 1f}}I q(e.T==\'aA\'){m.49(R,\'6o\',m.5V);q(m.2I){q(m.4I&&m.2I.T==\'2M\')m.2I.A.17.G.46=m.4I;u 3y=m.2I.3y;q(!3y&&!m.7R&&!/(3i|3O)/.19(m.2I.T)){A.26()}I q(3y||(!3y&&m.d8)){m.2I.A.5s(\'1s\')}m.7R=1f;m.2I=H}I q(/L-2M-89/.19(C.U)){C.G.46=m.4I}}D 1f},5V:z(e){q(!m.2I)D J;q(!e)e=1A.29;u a=m.2I,A=a.A;a.5T=e.6c-a.9v;a.7o=e.68-a.9u;u 7s=1d.ck(1d.9r(a.5T,2)+1d.9r(a.7o,2));q(!a.3y)a.3y=(a.T!=\'2M\'&&7s>0)||(7s>(m.cX||5));q(a.3y&&e.6c>5&&e.68>5){q(a.T==\'3O\')A.3O(a);I{A.7C(a.14+a.5T,a.11+a.7o);q(a.T==\'2M\')A.17.G.46=\'3i\'}}D 1f},8Q:z(e){2d{q(!e)e=1A.29;u 6C=/cW/i.19(e.T);q(!e.2i)e.2i=e.7l;q(!e.6E)e.6E=6C?e.db:e.di;u A=m.2h(e.2i);q(!A.55)D;q(!A||!e.6E||m.2h(e.6E,J)==A||m.2I)D;K(u i=0;i<A.1x.S;i++)(z(){u o=m.$(\'1H\'+A.1x[i]);q(o&&o.69){q(6C)m.V(o,{1e:\'1D\',1u:\'\'});m.2b(o,{1n:6C?o.1n:0},o.3t)}})()}1W(e){}},1Q:z(C,29,3l){q(C==R&&29==\'3s\'){m.2p(m.5G,3l)}2d{C.1Q(29,3l,1f)}1W(e){2d{C.9s(\'54\'+29,3l);C.dn(\'54\'+29,3l)}1W(e){C[\'54\'+29]=3l}}},49:z(C,29,3l){2d{C.49(29,3l,1f)}1W(e){2d{C.9s(\'54\'+29,3l)}1W(e){C[\'54\'+29]=H}}},6A:z(i){q(m.6Z&&m.4X[i]&&m.4X[i]!=\'1C\'){u 1y=R.1c(\'1y\');1y.64=z(){1y=H;m.6A(i+1)};1y.1G=m.4X[i]}},9R:z(3n){q(3n&&1q 3n!=\'6q\')m.7A=3n;u 2o=m.60();K(u i=0;i<2o.4A.S&&i<m.7A;i++){m.2p(m.4X,m.73(2o.4A[i]))}q(m.1B)24 m.4O(m.1B,z(){m.6A(0)});I m.6A(0);q(m.5m)u 4y=m.1c(\'1y\',{1G:m.4p+m.5m})},71:z(){q(!m.22){m.3E=m.2m&&m.21<7;m.4d=m.2m&&m.21<9;m.6v();K(u x 2T m.5U){q(1q m[x]!=\'1C\')m.18[x]=m[x];I q(1q m.18[x]==\'1C\'&&1q m.5U[x]!=\'1C\')m.18[x]=m.5U[x]}m.22=m.1c(\'X\',{U:\'L-22\'},{1j:\'2v\',14:0,11:0,M:\'28%\',1r:m.4z,9F:\'9t\'},R.3x,J);m.1S=m.1c(\'a\',{U:\'L-1S\',1X:m.18.9g,2R:m.18.9f,1Y:\'av:;\'},{1j:\'2v\',11:\'-4P\',1n:m.91,1r:1},m.22);m.8j=m.1c(\'X\',H,{1u:\'1F\'},m.22);m.1Z=m.1c(\'X\',{U:\'L-1Z L-1Z-B\'},{1e:(m.4u&&m.21<6t)?\'1D\':\'1s\'},m.22,1);1d.de=z(t,b,c,d){D c*t/d+b};1d.93=z(t,b,c,d){D c*(t/=d)*t+b};1d.7n=z(t,b,c,d){D-c*(t/=d)*(t-2)+b};m.9U=m.3E;m.9z=((1A.3q&&m.21<9)||4B.cU==\'cV\'||(m.3E&&m.21<5.5))}},3s:z(){q(m.6I)D;m.6I=J;K(u i=0;i<m.5G.S;i++)m.5G[i]()},7O:z(){u C,1i,52=[],4A=[],2N={},1T;K(u i=0;i<m.8e.S;i++){1i=R.2L(m.8e[i]);K(u j=0;j<1i.S;j++){C=1i[j];1T=m.5L(C);q(1T){m.2p(52,C);q(1T[0]==\'m.2D\')m.2p(4A,C);u g=m.5h(C,\'2t\')||\'1F\';q(!2N[g])2N[g]=[];m.2p(2N[g],C)}}}m.3R={52:52,2N:2N,4A:4A};D m.3R},60:z(){D m.3R||m.7O()},26:z(C){u A=m.2h(C);q(A)A.26();D 1f}};m.1E=z(2F,1h,Z){k.1h=1h;k.2F=2F;k.Z=Z;q(!1h.8Z)1h.8Z={}};m.1E.5o={8a:z(){(m.1E.3k[k.Z]||m.1E.3k.96)(k);q(k.1h.3k)k.1h.3k.95(k.2F,k.4c,k)},3F:z(72,1L,47){k.80=(24 8X()).94();k.41=72;k.4v=1L;k.47=47;k.4c=k.41;k.E=k.7X=0;u 5J=k;z t(5N){D 5J.3k(5N)}t.2F=k.2F;q(t()&&m.3u.2p(t)==1){m.8W=cx(z(){u 3u=m.3u;K(u i=0;i<3u.S;i++)q(!3u[i]())3u.cw(i--,1);q(!3u.S){cv(m.8W)}},13)}},3k:z(5N){u t=(24 8X()).94();q(5N||t>=k.1h.3J+k.80){k.4c=k.4v;k.E=k.7X=1;k.8a();k.1h.5S[k.Z]=J;u 8d=J;K(u i 2T k.1h.5S)q(k.1h.5S[i]!==J)8d=1f;q(8d){q(k.1h.63)k.1h.63.95(k.2F)}D 1f}I{u n=t-k.80;k.7X=n/k.1h.3J;k.E=k.1h.2r(n,0,1,k.1h.3J);k.4c=k.41+((k.4v-k.41)*k.E);k.8a()}D J}};m.3b(m.1E,{3k:{1n:z(1E){m.V(1E.2F,{1n:1E.4c})},96:z(1E){2d{q(1E.2F.G&&1E.2F.G[1E.Z]!=H)1E.2F.G[1E.Z]=1E.4c+1E.47;I 1E.2F[1E.Z]=1E.4c}1W(e){}}}});m.4O=z(1B,3V){k.3V=3V;k.1B=1B;u v=m.21,3L;k.7h=m.2m&&m.21<7;q(!1B){q(3V)3V();D}m.71();k.1V=m.1c(\'1V\',{cr:0},{1e:\'1s\',1j:\'2v\',cC:\'cD\',M:0},m.22,J);u 4a=m.1c(\'4a\',H,H,k.1V,1);k.2e=[];K(u i=0;i<=8;i++){q(i%3==0)3L=m.1c(\'3L\',H,{1b:\'2n\'},4a,J);k.2e[i]=m.1c(\'2e\',H,H,3L,J);u G=i!=4?{cP:0,cO:0}:{1j:\'8i\'};m.V(k.2e[i],G)}k.2e[4].U=1B+\' L-16\';k.98()};m.4O.5o={98:z(){u 1G=m.4p+(m.cN||"cQ/")+k.1B+".97";u 9a=m.4u&&m.21<6t?m.22:H;k.3d=m.1c(\'1y\',H,{1j:\'2v\',11:\'-4P\'},9a,J);u 7T=k;k.3d.64=z(){7T.9b()};k.3d.1G=1G},9b:z(){u o=k.1k=k.3d.M/4,E=[[0,0],[0,-4],[-2,0],[0,-8],0,[-2,-8],[0,-2],[0,-6],[-2,-2]],1m={1b:(2*o)+\'F\',M:(2*o)+\'F\'};K(u i=0;i<=8;i++){q(E[i]){q(k.7h){u w=(i==1||i==7)?\'28%\':k.3d.M+\'F\';u X=m.1c(\'X\',H,{M:\'28%\',1b:\'28%\',1j:\'8i\',3a:\'1s\'},k.2e[i],J);m.1c(\'X\',H,{5j:"cL:cG.cF.cE(cH=cI, 1G=\'"+k.3d.1G+"\')",1j:\'2v\',M:w,1b:k.3d.1b+\'F\',14:(E[i][0]*o)+\'F\',11:(E[i][1]*o)+\'F\'},X,J)}I{m.V(k.2e[i],{9e:\'5O(\'+k.3d.1G+\') \'+(E[i][0]*o)+\'F \'+(E[i][1]*o)+\'F\'})}q(1A.3q&&(i==3||i==5))m.1c(\'X\',H,1m,k.2e[i],J);m.V(k.2e[i],1m)}}k.3d=H;q(m.48[k.1B])m.48[k.1B].5x();m.48[k.1B]=k;q(k.3V)k.3V()},3Z:z(E,1k,9d,3t,2r){u A=k.A,cK=A.Q.G,1k=1k||0,E=E||{x:A.x.E+1k,y:A.y.E+1k,w:A.x.N(\'1N\')-2*1k,h:A.y.N(\'1N\')-2*1k};q(9d)k.1V.G.1e=(E.h>=4*k.1k)?\'1D\':\'1s\';m.V(k.1V,{14:(E.x-k.1k)+\'F\',11:(E.y-k.1k)+\'F\',M:(E.w+2*k.1k)+\'F\'});E.w-=2*k.1k;E.h-=2*k.1k;m.V(k.2e[4],{M:E.w>=0?E.w+\'F\':0,1b:E.h>=0?E.h+\'F\':0});q(k.7h)k.2e[3].G.1b=k.2e[5].G.1b=k.2e[4].G.1b},5x:z(9c){q(9c)k.1V.G.1e=\'1s\';I m.3H(k.1V)}};m.6r=z(A,1m){k.A=A;k.1m=1m;k.3m=1m==\'x\'?\'ah\':\'au\';k.3G=k.3m.5Y();k.4M=1m==\'x\'?\'af\':\'ag\';k.6B=k.4M.5Y();k.7d=1m==\'x\'?\'a5\':\'a8\';k.90=k.7d.5Y();k.1o=k.2z=0};m.6r.5o={N:z(P){8Y(P){1I\'78\':D k.1K+k.3o+(k.t-m.1S[\'1k\'+k.3m])/2;1I\'6Q\':D k.E+k.cb+k.1o+(k.B-m.1S[\'1k\'+k.3m])/2;1I\'1N\':D k.B+2*k.cb+k.1o+k.2z;1I\'4n\':D k.3W-k.2P-k.3X;1I\'7a\':D k.N(\'4n\')-2*k.cb-k.1o-k.2z;1I\'5t\':D k.E-(k.A.16?k.A.16.1k:0);1I\'7M\':D k.N(\'1N\')+(k.A.16?2*k.A.16.1k:0);1I\'2f\':D k.1z?1d.2y((k.B-k.1z)/2):0}},74:z(){k.cb=(k.A.17[\'1k\'+k.3m]-k.t)/2;k.3X=m[\'6S\'+k.7d]},6X:z(){k.t=k.A.C[k.3G]?7L(k.A.C[k.3G]):k.A.C[\'1k\'+k.3m];k.1K=k.A.1K[k.1m];k.3o=(k.A.C[\'1k\'+k.3m]-k.t)/2;q(k.1K==0||k.1K==-1){k.1K=(m.3S[k.3G]/2)+m.3S[\'1J\'+k.4M]}},6P:z(){u A=k.A;k.2k=\'2n\';q(A.6H==\'4i\')k.2k=\'4i\';I q(24 5X(k.6B).19(A.3Q))k.2k=H;I q(24 5X(k.90).19(A.3Q))k.2k=\'56\';k.E=k.1K-k.cb+k.3o;q(k.6R&&k.1m==\'x\')A.6F=1d.2X(A.6F||k.1a,A.6R*k.1a/A.y.1a);k.B=1d.2X(k.1a,A[\'56\'+k.3m]||k.1a);k.2q=A.5q?1d.2X(A[\'2X\'+k.3m],k.1a):k.1a;q(A.3A&&A.30){k.B=A[k.3G];k.1z=k.1a}q(k.1m==\'x\'&&m.4R)k.2q=A.5c;k.2i=A[\'2i\'+k.1m.92()];k.2P=m[\'6S\'+k.4M];k.1J=m.3S[\'1J\'+k.4M];k.3W=m.3S[k.3G]},82:z(i){u A=k.A;q(A.3A&&(A.30||m.4R)){k.1z=i;k.B=1d.56(k.B,k.1z);A.17.G[k.6B]=k.N(\'2f\')+\'F\'}I k.B=i;A.17.G[k.3G]=i+\'F\';A.Q.G[k.3G]=k.N(\'1N\')+\'F\';q(A.16)A.16.3Z();q(k.1m==\'x\'&&A.1l)A.4K(J);q(k.1m==\'x\'&&A.1g&&A.3A){q(i==k.1a)A.1g.4J(\'1a-2D\');I A.1g.3T(\'1a-2D\')}},7Z:z(i){k.E=i;k.A.Q.G[k.6B]=i+\'F\';q(k.A.16)k.A.16.3Z()}};m.4Z=z(a,2O,3F,2Q){q(R.cs&&m.2m&&!m.6I){m.1Q(R,\'3s\',z(){24 m.4Z(a,2O,3F,2Q)});D}k.a=a;k.3F=3F;k.2Q=2Q||\'2M\';k.3A=!k.cp;m.6Z=1f;k.1x=[];k.Y=m.Y;m.Y=H;m.71();u P=k.P=m.W.S;K(u i=0;i<m.6V.S;i++){u 35=m.6V[i];k[35]=2O&&1q 2O[35]!=\'1C\'?2O[35]:m[35]}q(!k.1G)k.1G=a.1Y;u C=(2O&&2O.7y)?m.$(2O.7y):a;C=k.9p=C.2L(\'1y\')[0]||C;k.6x=C.1M||a.1M;K(u i=0;i<m.W.S;i++){q(m.W[i]&&m.W[i].a==a&&!(k.Y&&k.2Z[1]==\'3Y\')){m.W[i].43();D 1f}}q(!m.cm)K(u i=0;i<m.W.S;i++){q(m.W[i]&&m.W[i].9p!=C&&!m.W[i].6G){m.W[i].5K()}}m.W[P]=k;q(!m.9j&&!m.1U){q(m.W[P-1])m.W[P-1].26();q(1q m.3v!=\'1C\'&&m.W[m.3v])m.W[m.3v].26()}k.C=C;k.1K=k.9i||m.6g(C);m.6v();u x=k.x=24 m.6r(k,\'x\');x.6X();u y=k.y=24 m.6r(k,\'y\');y.6X();k.Q=m.1c(\'X\',{1M:\'L-Q-\'+k.P,U:\'L-Q \'+k.7B},{1e:\'1s\',1j:\'2v\',1r:m.4z+=2},H,J);k.Q.cu=k.Q.cB=m.8Q;q(k.2Q==\'2M\'&&k.3B==2)k.3B=0;q(!k.1B||(k.Y&&k.3A&&k.2Z[1]==\'3Y\')){k[k.2Q+\'6J\']()}I q(m.48[k.1B]){k.6L();k[k.2Q+\'6J\']()}I{k.6U();u A=k;24 m.4O(k.1B,z(){A.6L();A[A.2Q+\'6J\']()})}D J};m.4Z.5o={7D:z(e){q(m.dm)dk(\'do \'+e.d0+\': \'+e.d1);I 1A.cZ.1Y=k.1G},6L:z(){u 16=k.16=m.48[k.1B];16.A=k;16.1V.G.1r=k.Q.G.1r-1;m.48[k.1B]=H},6U:z(){q(k.6G||k.1S)D;k.1S=m.1S;u A=k;k.1S.2G=z(){A.5K()};u A=k,l=k.x.N(\'78\')+\'F\',t=k.y.N(\'78\')+\'F\';q(!2l&&k.Y&&k.2Z[1]==\'3Y\')u 2l=k.Y;q(2l){l=2l.x.N(\'6Q\')+\'F\';t=2l.y.N(\'6Q\')+\'F\';k.1S.G.1r=m.4z++}4r(z(){q(A.1S)m.V(A.1S,{14:l,11:t,1r:m.4z++})},28)},da:z(){u A=k;u 1y=R.1c(\'1y\');k.17=1y;1y.64=z(){q(m.W[A.P])A.8K()};q(m.cY)1y.dj=z(){D 1f};1y.U=\'L-2M\';m.V(1y,{1e:\'1s\',1u:\'4H\',1j:\'2v\',6F:\'4P\',1r:3});1y.1X=m.18.84;q(m.4u&&m.21<6t)m.22.2E(1y);q(m.2m&&m.dc)1y.1G=H;1y.1G=k.1G;k.6U()},8K:z(){2d{q(!k.17)D;k.17.64=H;q(k.6G)D;I k.6G=J;u x=k.x,y=k.y;q(k.1S){m.V(k.1S,{11:\'-4P\'});k.1S=H}x.1a=k.17.M;y.1a=k.17.1b;m.V(k.17,{M:x.t+\'F\',1b:y.t+\'F\'});k.Q.2E(k.17);m.22.2E(k.Q);x.74();y.74();m.V(k.Q,{14:(x.1K+x.3o-x.cb)+\'F\',11:(y.1K+x.3o-y.cb)+\'F\'});k.aB();k.9J();u 2x=x.1a/y.1a;x.6P();k.2k(x);y.6P();k.2k(y);q(k.1l)k.4K(0,1);q(k.5q){k.aZ(2x);u 1v=k.1g;q(1v&&k.Y&&1v.2B&&1v.ar){u E=1v.aC.1j||\'\',p;K(u 1m 2T m.7q)K(u i=0;i<5;i++){p=k[1m];q(E.2H(m.7q[1m][i])){p.E=k.Y[1m].E+(k.Y[1m].1o-p.1o)+(k.Y[1m].B-p.B)*[0,0,.5,1,1][i];q(1v.ar==\'dg\'){q(p.E+p.B+p.1o+p.2z>p.1J+p.3W-p.3X)p.E=p.1J+p.3W-p.B-p.2P-p.3X-p.1o-p.2z;q(p.E<p.1J+p.2P)p.E=p.1J+p.2P}}}}q(k.3A&&k.x.1a>(k.x.1z||k.x.B)){k.ap();q(k.1x.S==1)k.4K()}}k.aG()}1W(e){k.7D(e)}},2k:z(p,4C){u 4b,2l=p.2i,1m=p==k.x?\'x\':\'y\';q(2l&&2l.2H(/ /)){4b=2l.dh(\' \');2l=4b[0]}q(2l&&m.$(2l)){p.E=m.6g(m.$(2l))[1m];q(4b&&4b[1]&&4b[1].2H(/^[-]?[0-9]+F$/))p.E+=7L(4b[1]);q(p.B<p.2q)p.B=p.2q}I q(p.2k==\'2n\'||p.2k==\'4i\'){u 79=1f;u 4q=p.A.5q;q(p.2k==\'4i\')p.E=1d.2y(p.1J+(p.3W+p.2P-p.3X-p.N(\'1N\'))/2);I p.E=1d.2y(p.E-((p.N(\'1N\')-p.t)/2));q(p.E<p.1J+p.2P){p.E=p.1J+p.2P;79=J}q(!4C&&p.B<p.2q){p.B=p.2q;4q=1f}q(p.E+p.N(\'1N\')>p.1J+p.3W-p.3X){q(!4C&&79&&4q){p.B=1d.2X(p.B,p.N(1m==\'y\'?\'4n\':\'7a\'))}I q(p.N(\'1N\')<p.N(\'4n\')){p.E=p.1J+p.3W-p.3X-p.N(\'1N\')}I{p.E=p.1J+p.2P;q(!4C&&4q)p.B=p.N(1m==\'y\'?\'4n\':\'7a\')}}q(!4C&&p.B<p.2q){p.B=p.2q;4q=1f}}I q(p.2k==\'56\'){p.E=1d.df(p.E-p.B+p.t)}q(p.E<p.2P){u aU=p.E;p.E=p.2P;q(4q&&!4C)p.B=p.B-(p.E-aU)}},aZ:z(2x){u x=k.x,y=k.y,3e=1f,2A=1d.2X(x.1a,x.B),2Y=1d.2X(y.1a,y.B),30=(k.30||m.4R);q(2A/2Y>2x){ 2A=2Y*2x;q(2A<x.2q){2A=x.2q;2Y=2A/2x}3e=J}I q(2A/2Y<2x){ 2Y=2A/2x;3e=J}q(m.4R&&x.1a<x.2q){x.1z=x.1a;y.B=y.1z=y.1a}I q(k.30){x.1z=2A;y.1z=2Y}I{x.B=2A;y.B=2Y}3e=k.aY(k.30?H:2x,3e);q(30&&y.B<y.1z){y.1z=y.B;x.1z=y.B*2x}q(3e||30){x.E=x.1K-x.cb+x.3o;x.2q=x.B;k.2k(x,J);y.E=y.1K-y.cb+y.3o;y.2q=y.B;k.2k(y,J);q(k.1l)k.4K()}},aY:z(2x,3e){u x=k.x,y=k.y;q(k.1l){4o(y.B>k.5w&&x.B>k.5c&&y.N(\'1N\')>y.N(\'4n\')){y.B-=10;q(2x)x.B=y.B*2x;k.4K(0,1);3e=J}}D 3e},aG:z(){u x=k.x,y=k.y;k.5s(\'1s\');q(k.1g&&k.1g.2g)k.1g.2g.4G();k.8f(1,{Q:{M:x.N(\'1N\'),1b:y.N(\'1N\'),14:x.E,11:y.E},17:{14:x.1o+x.N(\'2f\'),11:y.1o+y.N(\'2f\'),M:x.1z||x.B,1b:y.1z||y.B}},m.7f)},8f:z(1t,1L,3t){u 5k=k.2Z,6M=1t?(k.Y?k.Y.a:H):m.1U,t=(5k[1]&&6M&&m.5h(6M,\'2Z\')[1]==5k[1])?5k[1]:5k[0];q(k[t]&&t!=\'2D\'){k[t](1t,1L);D}q(k.16&&!k.3B){q(1t)k.16.3Z();I k.16.5x()}q(!1t)k.67();u A=k,x=A.x,y=A.y,2r=k.2r;q(!1t)2r=k.aT||2r;u ay=1t?z(){q(A.16)A.16.1V.G.1e="1D";4r(z(){A.62()},50)}:z(){A.5v()};q(1t)m.V(k.Q,{M:x.t+\'F\',1b:y.t+\'F\'});q(k.aD){m.V(k.Q,{1n:1t?0:1});m.3b(1L.Q,{1n:1t})}m.2b(k.Q,1L.Q,{3J:3t,2r:2r,3k:z(3j,36){q(A.16&&A.3B&&36.Z==\'11\'){u 4Q=1t?36.E:1-36.E;u E={w:x.t+(x.N(\'1N\')-x.t)*4Q,h:y.t+(y.N(\'1N\')-y.t)*4Q,x:x.1K+(x.E-x.1K)*4Q,y:y.1K+(y.E-y.1K)*4Q};A.16.3Z(E,0,1)}}});m.2b(k.17,1L.17,3t,2r,ay);q(1t){k.Q.G.1e=\'1D\';k.17.G.1e=\'1D\';k.a.U+=\' L-42-3Q\'}},5n:z(1t,1L){k.3B=1f;u A=k,t=1t?m.7f:0;q(1t){m.2b(k.Q,1L.Q,0);m.V(k.Q,{1n:0,1e:\'1D\'});m.2b(k.17,1L.17,0);k.17.G.1e=\'1D\';m.2b(k.Q,{1n:1},t,H,z(){A.62()})}q(k.16){k.16.1V.G.1r=k.Q.G.1r;u 5D=1t||-1,1k=k.16.1k,7c=1t?3:1k,6Y=1t?1k:3;K(u i=7c;5D*i<=5D*6Y;i+=5D,t+=25){(z(){u o=1t?6Y-i:7c-i;4r(z(){A.16.3Z(0,o,1)},t)})()}}q(1t){}I{4r(z(){q(A.16)A.16.5x(A.cz);A.67();m.2b(A.Q,{1n:0},m.8p,H,z(){A.5v()})},t)}},3Y:z(1t,1L,72){q(!1t)D;u A=k,Y=k.Y,x=k.x,y=k.y,2W=Y.x,2U=Y.y,Q=k.Q,17=k.17,1l=k.1l;m.49(R,\'6o\',m.5V);m.V(17,{M:(x.1z||x.B)+\'F\',1b:(y.1z||y.B)+\'F\'});q(1l)1l.G.3a=\'1D\';k.16=Y.16;q(k.16)k.16.A=A;Y.16=H;u 4s=m.1c(\'X\',{U:\'L-\'+k.2Q},{1j:\'2v\',1r:4,3a:\'1s\',1u:\'1F\'});u 77={aO:Y,aR:k};K(u n 2T 77){k[n]=77[n].17.7j(1);m.V(k[n],{1j:\'2v\',aM:0,1e:\'1D\'});4s.2E(k[n])}Q.2E(4s);q(1l){1l.U=\'\';Q.2E(1l)}4s.G.1u=\'\';Y.17.G.1u=\'1F\';q(m.4u&&m.21<6t){k.Q.G.1e=\'1D\'}m.2b(Q,{M:x.B},{3J:m.aL,3k:z(3j,36){u E=36.E,3U=1-E;u Z,B={},6N=[\'E\',\'B\',\'1o\',\'2z\'];K(u n 2T 6N){Z=6N[n];B[\'x\'+Z]=1d.2y(3U*2W[Z]+E*x[Z]);B[\'y\'+Z]=1d.2y(3U*2U[Z]+E*y[Z]);B.aJ=1d.2y(3U*(2W.1z||2W.B)+E*(x.1z||x.B));B.6p=1d.2y(3U*2W.N(\'2f\')+E*x.N(\'2f\'));B.aN=1d.2y(3U*(2U.1z||2U.B)+E*(y.1z||y.B));B.6f=1d.2y(3U*2U.N(\'2f\')+E*y.N(\'2f\'))}q(A.16)A.16.3Z({x:B.2K,y:B.2J,w:B.58+B.3C+B.6O+2*x.cb,h:B.5a+B.3z+B.6W+2*y.cb});Y.Q.G.ct=\'cn(\'+(B.2J-2U.E)+\'F, \'+(B.58+B.3C+B.6O+B.2K+2*2W.cb-2W.E)+\'F, \'+(B.5a+B.3z+B.6W+B.2J+2*2U.cb-2U.E)+\'F, \'+(B.2K-2W.E)+\'F)\';m.V(17,{11:(B.3z+y.N(\'2f\'))+\'F\',14:(B.3C+x.N(\'2f\'))+\'F\',4j:(y.E-B.2J)+\'F\',4L:(x.E-B.2K)+\'F\'});m.V(Q,{11:B.2J+\'F\',14:B.2K+\'F\',M:(B.3C+B.6O+B.58+2*x.cb)+\'F\',1b:(B.3z+B.6W+B.5a+2*y.cb)+\'F\'});m.V(4s,{M:(B.aJ||B.58)+\'F\',1b:(B.aN||B.5a)+\'F\',14:(B.3C+B.6p)+\'F\',11:(B.3z+B.6f)+\'F\',1e:\'1D\'});m.V(A.aO,{11:(2U.E-B.2J+2U.1o-B.3z+2U.N(\'2f\')-B.6f)+\'F\',14:(2W.E-B.2K+2W.1o-B.3C+2W.N(\'2f\')-B.6p)+\'F\'});m.V(A.aR,{1n:E,11:(y.E-B.2J+y.1o-B.3z+y.N(\'2f\')-B.6f)+\'F\',14:(x.E-B.2K+x.1o-B.3C+x.N(\'2f\')-B.6p)+\'F\'});q(1l)m.V(1l,{M:B.58+\'F\',1b:B.5a+\'F\',14:(B.3C+x.cb)+\'F\',11:(B.3z+y.cb)+\'F\'})},63:z(){Q.G.1e=17.G.1e=\'1D\';17.G.1u=\'4H\';m.3H(4s);A.62();Y.5v();A.Y=H}})},9E:z(o,C){q(!k.Y)D 1f;K(u i=0;i<k.Y.1x.S;i++){u 61=m.$(\'1H\'+k.Y.1x[i]);q(61&&61.1H==o.1H){k.7z();61.cl=k.P;m.2p(k.1x,k.Y.1x[i]);D J}}D 1f},62:z(){k.55=J;k.43();q(k.3I)m.1m(k);q(m.1U&&m.1U==k.a)m.1U=H;k.aQ();u p=m.3S,7i=m.66.x+p.5l,7e=m.66.y+p.5i;k.7m=k.x.E<7i&&7i<k.x.E+k.x.N(\'1N\')&&k.y.E<7e&&7e<k.y.E+k.y.N(\'1N\');q(k.1l)k.ak()},aQ:z(){u P=k.P;u 1B=k.1B;24 m.4O(1B,z(){2d{m.W[P].aP()}1W(e){}})},aP:z(){u 1p=k.7b(1);q(1p&&1p.2G.aI().2H(/m\\.2D/))u 1y=m.1c(\'1y\',{1G:m.73(1p)})},7b:z(1P){u 7g=k.6e(),as=m.3R.2N[k.2t||\'1F\'];q(as&&!as[7g+1P]&&k.1g&&k.1g.ab){q(1P==1)D as[0];I q(1P==-1)D as[as.S-1]}D(as&&as[7g+1P])||H},6e:z(){u 2o=m.60().2N[k.2t||\'1F\'];q(2o)K(u i=0;i<2o.S;i++){q(2o[i]==k.a)D i}D H},a3:z(){q(k[k.5b]){u 2o=m.3R.2N[k.2t||\'1F\'];q(2o){u s=m.18.3n.2j(\'%1\',k.6e()+1).2j(\'%2\',2o.S);k[k.5b].2R=\'<X 2s="L-3n">\'+s+\'</X>\'+k[k.5b].2R}}},aB:z(){q(!k.Y){K(u i=0;i<m.4U.S;i++){u 1v=m.4U[i],2C=1v.2t;q(1q 2C==\'1C\'||2C===H||2C===k.2t)k.1g=24 m.7S(k.P,1v)}}I{k.1g=k.Y.1g}u 1v=k.1g;q(!1v)D;u P=1v.3N=k.P;1v.aa();1v.4J(\'1a-2D\');q(1v.2B){k.4h(m.3b(1v.aC||{},{44:1v.2B,1H:\'2B\',1r:5}))}q(1v.2g)1v.2g.6s(k);q(!k.Y&&k.3D)1v.3r(J);q(1v.3D){1v.3D=4r(z(){m.1p(P)},(1v.cT||cS))}},5K:z(){m.3H(k.Q);m.W[k.P]=H;q(m.1U==k.a)m.1U=H;m.7Q(k.P);q(k.1S)m.1S.G.14=\'-4P\'},am:z(){q(k.4Y)D;k.4Y=m.1c(\'a\',{1Y:m.aF,2i:m.aE,U:\'L-4Y\',2R:m.18.aS,1X:m.18.b0});k.4h({44:k.4Y,1j:k.aW||\'11 14\',1H:\'4Y\'})},a2:z(76,aw){K(u i=0;i<76.S;i++){u T=76[i],s=H;q(!k[T+\'4t\']&&k.6x)k[T+\'4t\']=T+\'-K-\'+k.6x;q(k[T+\'4t\'])k[T]=m.4W(k[T+\'4t\']);q(!k[T]&&!k[T+\'6K\']&&k[T+\'aX\'])2d{s=cJ(k[T+\'aX\'])}1W(e){}q(!k[T]&&k[T+\'6K\']){s=k[T+\'6K\']}q(!k[T]&&!s){k[T]=m.4W(k.a[\'aV\'+T+\'4t\']);q(!k[T]){u 1p=k.a.b1;4o(1p&&!m.5L(1p)){q((24 5X(\'L-\'+T)).19(1p.U||H)){q(!1p.1M)k.a[\'aV\'+T+\'4t\']=1p.1M=\'1H\'+m.4V++;k[T]=m.4W(1p.1M);5B}1p=1p.b1}}}q(!k[T]&&!s&&k.5b==T)s=\'\\n\';q(!k[T]&&s)k[T]=m.1c(\'X\',{U:\'L-\'+T,2R:s});q(aw&&k[T]){u o={1j:(T==\'6z\')?\'4T\':\'6D\'};K(u x 2T k[T+\'9T\'])o[x]=k[T+\'9T\'][x];o.44=k[T];k.4h(o)}}},5s:z(1e){q(m.9U)k.5I(\'cM\',1e);q(m.9z)k.5I(\'cR\',1e);q(m.5Z)k.5I(\'*\',1e)},5I:z(4F,1e){u 1i=R.2L(4F);u Z=4F==\'*\'?\'3a\':\'1e\';K(u i=0;i<1i.S;i++){q(Z==\'1e\'||(R.6T.9P(1i[i],"").9Q(\'3a\')==\'2n\'||1i[i].a1(\'1s-by\')!=H)){u 2u=1i[i].a1(\'1s-by\');q(1e==\'1D\'&&2u){2u=2u.2j(\'[\'+k.P+\']\',\'\');1i[i].5A(\'1s-by\',2u);q(!2u)1i[i].G[Z]=1i[i].88}I q(1e==\'1s\'){u 3g=m.6g(1i[i]);3g.w=1i[i].2c;3g.h=1i[i].3f;q(!k.3I){u ax=(3g.x+3g.w<k.x.N(\'5t\')||3g.x>k.x.N(\'5t\')+k.x.N(\'7M\'));u 9Z=(3g.y+3g.h<k.y.N(\'5t\')||3g.y>k.y.N(\'5t\')+k.y.N(\'7M\'))}u 5H=m.86(1i[i]);q(!ax&&!9Z&&5H!=k.P){q(!2u){1i[i].5A(\'1s-by\',\'[\'+k.P+\']\');1i[i].88=1i[i].G[Z];1i[i].G[Z]=\'1s\'}I q(2u.9X(\'[\'+k.P+\']\')==-1){1i[i].5A(\'1s-by\',2u+\'[\'+k.P+\']\')}}I q((2u==\'[\'+k.P+\']\'||m.3v==5H)&&5H!=k.P){1i[i].5A(\'1s-by\',\'\');1i[i].G[Z]=1i[i].88||\'\'}I q(2u&&2u.9X(\'[\'+k.P+\']\')>-1){1i[i].5A(\'1s-by\',2u.2j(\'[\'+k.P+\']\',\'\'))}}}}},43:z(){k.Q.G.1r=m.4z+=2;K(u i=0;i<m.W.S;i++){q(m.W[i]&&i==m.3v){u 5g=m.W[i];5g.17.U+=\' L-\'+5g.2Q+\'-89\';5g.17.G.46=m.3E?\'9O\':\'5R\';5g.17.1X=m.18.9Y}}q(k.16)k.16.1V.G.1r=k.Q.G.1r-1;k.17.U=\'L-\'+k.2Q;k.17.1X=m.18.84;q(m.5m){m.4I=1A.3q?\'5R\':\'5O(\'+m.4p+m.5m+\'), 5R\';q(m.3E&&m.21<6)m.4I=\'9O\';k.17.G.46=m.4I}m.3v=k.P;m.1Q(R,1A.3q?\'5P\':\'5Q\',m.4N)},7C:z(x,y){k.x.7Z(x);k.y.7Z(y)},3O:z(e){u w,h,r=e.M/e.1b;w=1d.56(e.M+e.5T,1d.2X(k.5c,k.x.1a));q(k.3A&&1d.co(w-k.x.1a)<12)w=k.x.1a;h=w/r;q(h<1d.2X(k.5w,k.y.1a)){h=1d.2X(k.5w,k.y.1a);q(k.3A)w=h*r}k.7k(w,h)},7k:z(w,h){k.y.82(h);k.x.82(w);k.Q.G.1b=k.y.N(\'1N\')+\'F\'},26:z(){q(k.8c||!k.55)D;q(k.2Z[1]==\'3Y\'&&m.1U){m.2h(m.1U).5K();m.1U=H}k.8c=J;q(k.1g&&!m.1U)k.1g.2S();m.49(R,1A.3q?\'5P\':\'5Q\',m.4N);2d{k.17.G.46=\'cA\';k.8f(0,{Q:{M:k.x.t,1b:k.y.t,14:k.x.1K-k.x.cb+k.x.3o,11:k.y.1K-k.y.cb+k.y.3o},17:{14:0,11:0,M:k.x.t,1b:k.y.t}},m.8p)}1W(e){k.5v()}},4h:z(o){u C=o.44,4E=(o.9A==\'1Z\'&&!/6w$/.19(o.1j));q(1q C==\'8q\')C=m.4W(C);q(o.5W)C=m.1c(\'X\',{2R:o.5W});q(!C||1q C==\'8q\')D;C.G.1u=\'4H\';o.1H=o.1H||o.44;q(k.2Z[1]==\'3Y\'&&k.9E(o,C))D;k.7z();u M=o.M&&/^[0-9]+(F|%)$/.19(o.M)?o.M:\'2n\';q(/^(14|2V)6w$/.19(o.1j)&&!/^[0-9]+F$/.19(o.M))M=\'cy\';u O=m.1c(\'X\',{1M:\'1H\'+m.4V++,1H:o.1H},{1j:\'2v\',1e:\'1s\',M:M,9F:m.18.9C||\'\',1n:0},4E?m.1Z:k.1l,J);q(4E)O.5F=k.P;O.2E(C);m.3b(O,{1n:1,9B:0,9G:0,3t:(o.5n===0||o.5n===1f||(o.5n==2&&m.2m))?0:53});m.3b(O,o);q(k.al){k.5y(O);q(!O.69||k.7m)m.2b(O,{1n:O.1n},O.3t)}m.2p(k.1x,m.4V-1)},5y:z(O){u p=O.1j||\'8h 4i\',4E=(O.9A==\'1Z\'),5E=O.9B,5C=O.9G;q(4E){m.1Z.G.1u=\'4H\';O.5F=k.P;q(O.2c>O.1O.2c)O.G.M=\'28%\'}I q(O.1O!=k.1l)k.1l.2E(O);q(/14$/.19(p))O.G.14=5E+\'F\';q(/4i$/.19(p))m.V(O,{14:\'50%\',4L:(5E-1d.2y(O.2c/2))+\'F\'});q(/2V$/.19(p))O.G.2V=-5E+\'F\';q(/^9H$/.19(p)){m.V(O,{2V:\'28%\',9M:k.x.cb+\'F\',11:-k.y.cb+\'F\',4g:-k.y.cb+\'F\',3a:\'2n\'});k.x.1o=O.2c}I q(/^9L$/.19(p)){m.V(O,{14:\'28%\',4L:k.x.cb+\'F\',11:-k.y.cb+\'F\',4g:-k.y.cb+\'F\',3a:\'2n\'});k.x.2z=O.2c}u 8g=O.1O.3f;O.G.1b=\'2n\';q(4E&&O.3f>8g)O.G.1b=m.3E?8g+\'F\':\'28%\';q(/^11/.19(p))O.G.11=5C+\'F\';q(/^8h/.19(p))m.V(O,{11:\'50%\',4j:(5C-1d.2y(O.3f/2))+\'F\'});q(/^4g/.19(p))O.G.4g=-5C+\'F\';q(/^4T$/.19(p)){m.V(O,{14:(-k.x.1o-k.x.cb)+\'F\',2V:(-k.x.2z-k.x.cb)+\'F\',4g:\'28%\',9K:k.y.cb+\'F\',M:\'2n\'});k.y.1o=O.3f}I q(/^6D$/.19(p)){m.V(O,{1j:\'8i\',14:(-k.x.1o-k.x.cb)+\'F\',2V:(-k.x.2z-k.x.cb)+\'F\',11:\'28%\',4j:k.y.cb+\'F\',M:\'2n\'});k.y.2z=O.3f;O.G.1j=\'2v\'}},9J:z(){k.a2([\'6z\',\'dd\'],J);k.a3();q(k.6z&&k.7v)k.6z.U+=\' L-3i\';q(m.an)k.am();K(u i=0;i<m.1x.S;i++){u o=m.1x[i],6y=o.7y,2C=o.2t;q((!6y&&!2C)||(6y&&6y==k.6x)||(2C&&2C===k.2t)){k.4h(o)}}u 6u=[];K(u i=0;i<k.1x.S;i++){u o=m.$(\'1H\'+k.1x[i]);q(/6w$/.19(o.1j))k.5y(o);I m.2p(6u,o)}K(u i=0;i<6u.S;i++)k.5y(6u[i]);k.al=J},7z:z(){q(!k.1l)k.1l=m.1c(\'X\',{U:k.7B},{1j:\'2v\',M:(k.x.B||(k.30?k.M:H)||k.x.1a)+\'F\',1b:(k.y.B||k.y.1a)+\'F\',1e:\'1s\',3a:\'1s\',1r:m.2m?4:\'2n\'},m.22,J)},4K:z(7t,aj){u 1l=k.1l,x=k.x,y=k.y;m.V(1l,{M:x.B+\'F\',1b:y.B+\'F\'});q(7t||aj){K(u i=0;i<k.1x.S;i++){u o=m.$(\'1H\'+k.1x[i]);u 7u=(m.3E||R.6i==\'7P\');q(o&&/^(4T|6D)$/.19(o.1j)){q(7u){o.G.M=(1l.2c+2*x.cb+x.1o+x.2z)+\'F\'}y[o.1j==\'4T\'?\'1o\':\'2z\']=o.3f}q(o&&7u&&/^(14|2V)6w$/.19(o.1j)){o.G.1b=(1l.3f+2*y.cb)+\'F\'}}}q(7t){m.V(k.17,{11:y.1o+\'F\'});m.V(1l,{11:(y.1o+y.cb)+\'F\'})}},ak:z(){u b=k.1l;b.U=\'\';m.V(b,{11:(k.y.1o+k.y.cb)+\'F\',14:(k.x.1o+k.x.cb)+\'F\',3a:\'1D\'});q(m.4u)b.G.1e=\'1D\';k.Q.2E(b);K(u i=0;i<k.1x.S;i++){u o=m.$(\'1H\'+k.1x[i]);o.G.1r=o.1r||4;q(!o.69||k.7m){o.G.1e=\'1D\';m.V(o,{1e:\'1D\',1u:\'\'});m.2b(o,{1n:o.1n},o.3t)}}},67:z(){q(!k.1x.S)D;q(k.1g){u c=k.1g.2B;q(c&&m.2h(c)==k)c.1O.dl(c)}K(u i=0;i<k.1x.S;i++){u o=m.$(\'1H\'+k.1x[i]);q(o&&o.1O==m.1Z&&m.2h(o)==k)m.3H(o)}m.3H(k.1l)},ap:z(){q(k.1g&&k.1g.2B){k.1g.3T(\'1a-2D\');D}k.6a=m.1c(\'a\',{1Y:\'av:m.W[\'+k.P+\'].6k();\',1X:m.18.7p,U:\'L-1a-2D\'});k.4h({44:k.6a,1j:m.at,69:J,1n:m.aq})},6k:z(){2d{q(k.6a)m.3H(k.6a);k.43();u 2A=k.x.B,2Y=k.y.B;k.7k(k.x.1a,k.y.1a);u 2K=k.x.E-(k.x.B-2A)/2;q(2K<m.4L)2K=m.4L;u 2J=k.y.E-(k.y.B-2Y)/2;q(2J<m.4j)2J=m.4j;k.7C(2K,2J);k.5s(\'1s\')}1W(e){k.7D(e)}},5v:z(){k.a.U=k.a.U.2j(\'L-42-3Q\',\'\');k.5s(\'1D\');q(k.16&&k.3B)k.16.5x();m.3H(k.Q);k.67();q(!m.1Z.6l.S)m.1Z.G.1u=\'1F\';q(k.3I)m.7Q(k.P);m.W[k.P]=H;m.ai()}};m.7S=z(3N,1h){q(m.d2!==1f)m.7O();k.3N=3N;K(u x 2T 1h)k[x]=1h[x];q(k.d3)k.a9();q(k.2g)k.2g=m.ae(k)};m.7S.5o={a9:z(){k.2B=m.1c(\'X\',{2R:m.a7(m.a6.2B)},H,m.22);u 59=[\'3r\',\'2S\',\'3c\',\'1p\',\'3i\',\'1a-2D\',\'26\'];k.1w={};u 7T=k;K(u i=0;i<59.S;i++){k.1w[59[i]]=m.a4(k.2B,\'1R\',\'L-\'+59[i]);k.3T(59[i])}k.1w.2S.G.1u=\'1F\'},aa:z(){q(k.ab||!k.2B)D;u A=m.W[k.3N],4y=A.6e(),1T=/6m$/;q(4y==0)k.4J(\'3c\');I q(1T.19(k.1w.3c.2L(\'a\')[0].U))k.3T(\'3c\');q(4y+1==m.3R.2N[A.2t||\'1F\'].S){k.4J(\'1p\');k.4J(\'3r\')}I q(1T.19(k.1w.1p.2L(\'a\')[0].U)){k.3T(\'1p\');k.3T(\'3r\')}},3T:z(1w){q(!k.1w)D;u a0=k,a=k.1w[1w].2L(\'a\')[0],1T=/6m$/;a.2G=z(){a0[1w]();D 1f};q(1T.19(a.U))a.U=a.U.2j(1T,\'\')},4J:z(1w){q(!k.1w)D;u a=k.1w[1w].2L(\'a\')[0];a.2G=z(){D 1f};q(!/6m$/.19(a.U))a.U+=\' 6m\'},ad:z(){q(k.3D)k.2S();I k.3r()},3r:z(ac){q(k.1w){k.1w.3r.G.1u=\'1F\';k.1w.2S.G.1u=\'\'}k.3D=J;q(!ac)m.1p(k.3N)},2S:z(){q(k.1w){k.1w.2S.G.1u=\'1F\';k.1w.3r.G.1u=\'\'}b8(k.3D);k.3D=H},3c:z(){k.2S();m.3c(k.1w.3c)},1p:z(){k.2S();m.1p(k.1w.1p)},3i:z(){},\'1a-2D\':z(){m.2h().6k()},26:z(){m.26(k.1w.26)}};m.ae=z(1g){z 6s(A){m.3b(1h||{},{44:4e,1H:\'2g\',U:\'L-2g-\'+4m+\'-O \'+(1h.U||\'\')});q(m.3E)1h.5n=0;A.4h(1h);m.V(4e.1O,{3a:\'1s\'})};z 1J(3h){4G(1C,1d.2y(3h*4e[3p?\'2c\':\'3f\']*0.7))};z 4G(i,7K){q(i===1C)K(u j=0;j<51.S;j++){q(51[j]==m.W[1g.3N].a){i=j;5B}}q(i===1C)D;u as=4e.2L(\'a\'),42=as[i],3M=42.1O,14=3p?\'af\':\'ag\',2V=3p?\'a5\':\'a8\',M=3p?\'ah\':\'au\',4f=\'1k\'+14,2c=\'1k\'+M,6h=X.1O.1O[2c],4w=6h-1V[2c],5z=7L(1V.G[3p?\'14\':\'11\'])||0,2w=5z,bs=20;q(7K!==1C){2w=5z-7K;q(4w>0)4w=0;q(2w>0)2w=0;q(2w<4w)2w=4w}I{K(u j=0;j<as.S;j++)as[j].U=\'\';42.U=\'L-42-3Q\';u 7F=i>0?as[i-1].1O[4f]:3M[4f],7x=3M[4f]+3M[2c]+(as[i+1]?as[i+1].1O[2c]:0);q(7x>6h-5z)2w=6h-7x;I q(7F<-5z)2w=-7F}u 7r=3M[4f]+(3M[2c]-6b[2c])/2+2w;m.2b(1V,3p?{14:2w}:{11:2w},H,\'7n\');m.2b(6b,3p?{14:7r}:{11:7r},H,\'7n\');7Y.G.1u=2w<0?\'4H\':\'1F\';85.G.1u=(2w>4w)?\'4H\':\'1F\'};u 51=m.3R.2N[m.W[1g.3N].2t||\'1F\'],1h=1g.2g,4m=1h.4m||\'ao\',81=(4m==\'bi\'),3K=81?[\'X\',\'7V\',\'1R\',\'23\']:[\'1V\',\'4a\',\'3L\',\'2e\'],3p=(4m==\'ao\'),4e=m.1c(\'X\',{U:\'L-2g L-2g-\'+4m,2R:\'<X 2s="L-2g-b4">\'+\'<\'+3K[0]+\'><\'+3K[1]+\'></\'+3K[1]+\'></\'+3K[0]+\'></X>\'+\'<X 2s="L-1J-1t"><X></X></X>\'+\'<X 2s="L-1J-b6"><X></X></X>\'+\'<X 2s="L-6b"><X></X></X>\'},{1u:\'1F\'},m.22),57=4e.6l,X=57[0],7Y=57[1],85=57[2],6b=57[3],1V=X.b7,4a=4e.2L(3K[1])[0],3L;K(u i=0;i<51.S;i++){q(i==0||!3p)3L=m.1c(3K[2],H,H,4a);(z(){u a=51[i],3M=m.1c(3K[3],H,H,3L),cj=i;m.1c(\'a\',{1Y:a.1Y,1X:a.1X,2G:z(){q(/L-42-3Q/.19(k.U))D 1f;m.2h(k).43();D m.83(a)},2R:m.9I?m.9I(a):a.2R},H,3M)})()}q(!81){7Y.2G=z(){1J(-1)};85.2G=z(){1J(1)};m.1Q(4a,R.c3!==1C?\'bB\':\'bZ\',z(e){u 3h=0;e=e||1A.29;q(e.9D){3h=e.9D/ch;q(m.3q)3h=-3h}I q(e.9N){3h=-e.9N/3}q(3h)1J(-3h*0.2);q(e.4D)e.4D();e.9W=1f})}D{6s:6s,4G:4G}};m.5U=m.18;u bC=m.4Z;q(m.2m&&1A==1A.11){(z(){2d{R.4l.bD(\'14\')}1W(e){4r(9V.bF,50);D}m.3s()})()}m.1Q(R,\'bL\',m.3s);m.1Q(1A,\'az\',m.3s);m.1Q(R,\'3s\',z(){q(m.5M||m.3I){u G=m.1c(\'G\',{T:\'bM/7U\'},H,R.2L(\'bT\')[0]),8k=R.6i==\'7P\';z 5e(7w,7W){q(m.2m&&(m.21<9||8k)){u Y=R.9S[R.9S.S-1];q(1q(Y.5e)=="6q")Y.5e(7w,7W)}I{G.2E(R.bU(7w+" {"+7W+"}"))}}z 5f(Z){D\'bV( ( ( bN = R.4l.\'+Z+\' ? R.4l.\'+Z+\' : R.3x.\'+Z+\' ) ) + \\\'F\\\' );\'}q(m.5M)5e(\'.L 1y\',\'46: 5O(\'+m.4p+m.5M+\'), 5R !c8;\');5e(\'.L-1Z-B\',m.2m&&(m.21<7||8k)?\'1j: 2v; \'+\'14:\'+5f(\'5l\')+\'11:\'+5f(\'5i\')+\'M:\'+5f(\'8m\')+\'1b:\'+5f(\'aK\'):\'1j: bc; M: 28%; 1b: 28%; 14: 0; 11: 0\')}});m.1Q(1A,\'3O\',z(){m.6v();q(m.1Z)K(u i=0;i<m.1Z.6l.S;i++){u 3w=m.1Z.6l[i],A=m.2h(3w);A.5y(3w);q(3w.1H==\'2g\')A.1g.2g.4G()}});m.1Q(R,\'6o\',z(e){m.66={x:e.6c,y:e.68}});m.1Q(R,\'aH\',m.87);m.1Q(R,\'aA\',m.87);m.1Q(R,\'3s\',m.60);m.1Q(1A,\'az\',m.9R)}',62,831,'||||||||||||||||||||this||hs||||if||||var|||||function|exp|size|el|return|pos|px|style|null|else|true|for|highslide|width|get|overlay|key|wrapper|document|length|type|className|setStyles|expanders|div|last|prop||top|||left||outline|content|lang|test|full|height|createElement|Math|visibility|false|slideshow|options|els|position|offset|overlayBox|dim|opacity|p1|next|typeof|zIndex|hidden|up|display|ss|btn|overlays|img|imgSize|window|outlineType|undefined|visible|fx|none|src|hsId|case|scroll|tpos|to|id|wsize|parentNode|op|addEventListener|li|loading|re|upcoming|table|catch|title|href|viewport||uaVersion|container|span|new||close||100|event|dimmer|animate|offsetWidth|try|td|imgPad|thumbstrip|getExpander|target|replace|justify|tgt|ie|auto|arr|push|minSize|easing|class|slideshowGroup|hiddenBy|absolute|tblPos|ratio|round|p2|xSize|controls|sg|expand|appendChild|elem|onclick|match|dragArgs|ypos|xpos|getElementsByTagName|image|groups|params|marginMin|contentType|innerHTML|pause|in|lastY|right|lastX|min|ySize|transitions|useBox|opt||||name|args||||overflow|extend|previous|graphic|changed|offsetHeight|elPos|delta|move|val|step|func|ucwh|number|tb|isX|opera|play|ready|dur|timers|focusKey|node|body|hasDragged|yp1|isImage|outlineWhileAnimating|xp1|autoplay|ieLt7|custom|wh|discardElement|dimmingOpacity|duration|tree|tr|cell|expKey|resize|styles|anchor|anchors|page|enable|invPos|onLoad|clientSize|marginMax|crossfade|setPosition||start|active|focus|overlayId|clone|cursor|unit|pendingOutlines|removeEventListener|tbody|tgtArr|now|ieLt9|dom|offsetLeft|bottom|createOverlay|center|marginTop|attribs|documentElement|mode|fitsize|while|graphicsDir|allowReduce|setTimeout|fadeBox|Id|safari|end|minTblPos|owner|cur|zIndexCounter|images|navigator|moveOnly|preventDefault|relToVP|tagName|selectThumb|block|styleRestoreCursor|disable|sizeOverlayBox|marginLeft|uclt|keyHandler|Outline|9999px|fac|padToMinWidth|matches|above|slideshows|idCounter|getNode|preloadTheseImages|credits|Expander||group|all|250|on|isExpanded|max|domCh|xsize|buttons|ysize|numberPosition|minWidth|iebody|addRule|fix|blurExp|getParam|scrollTop|filter|trans|scrollLeft|restoreCursor|fade|prototype|param|allowSizeReduction|userAgent|doShowHide|opos|getParams|afterClose|minHeight|destroy|positionOverlay|curTblPos|setAttribute|break|offY|dir|offX|hsKey|onReady|wrapperKey|showHideElements|self|cancelLoading|isHsAnchor|expandCursor|gotoEnd|url|keypress|keydown|pointer|curAnim|dX|langDefaults|dragHandler|html|RegExp|toLowerCase|geckoMac|getAnchors|oDiv|afterExpand|complete|onload|expOnly|mouse|destroyOverlays|clientY|hideOnMouseOut|fullExpandLabel|marker|clientX|previousOrNext|getAnchorIndex|yimgPad|getPosition|overlayWidth|compatMode|topmostKey|doFullExpand|childNodes|disabled|adj|mousemove|ximgPad|object|Dimension|add|525|os|getPageSize|panel|thumbsUserSetId|tId|heading|preloadFullImage|lt|over|below|relatedTarget|maxWidth|onLoadStarted|align|isReady|Create|Text|connectOutline|other|props|xp2|calcExpanded|loadingPosXfade|maxHeight|margin|defaultView|showLoading|overrides|yp2|calcThumb|endOff|continuePreloading||init|from|getSrc|calcBorders||types|names|loadingPos|hasMovedMin|maxsize|getAdjacentAnchor|startOff|ucrb|mY|expandDuration|current|hasAlphaImageLoader|mX|cloneNode|resizeTo|srcElement|mouseIsOver|easeOutQuad|dY|fullExpandTitle|oPos|markerPos|distance|doWrapper|ie6|dragByHeading|sel|activeRight|thumbnailId|genOverlayBox|numberOfImagesToPreload|wrapperClassName|moveTo|error|isNew|activeLeft|dimmingDuration|pixDimmerSize|clones|topZ|scrollBy|parseInt|osize|element|updateAnchors|BackCompat|undim|hasFocused|Slideshow|pThis|css|ul|dec|state|scrollUp|setPos|startTime|floatMode|setSize|transit|restoreTitle|scrollDown|getWrapperKey|mouseClickHandler|origProp|blur|update|parent|isClosing|done|openerTagNames|changeSize|parOff|middle|relative|garbageBin|backCompat|arrow|clientWidth|parseFloat|Click|restoreDuration|string|fullExpandText|moveTitle|closeTitle|captionOverlay|closeText|moveText|targetY|targetX|headingOverlay|playTitle|spacebar|Previous|Next|Move|Pause|Play|Highslide|JS|Close|contentLoaded|and|pauseTitle|pauseText|nextTitle|playText|wrapperMouseHandler|200|previousTitle|previousText|nextText|enableKeyListener|timerId|Date|switch|orig|rb|loadingOpacity|toUpperCase|easeInQuad|getTime|call|_default|png|preloadGraphic||appendTo|onGraphicLoad|hide|vis|background|loadingText|loadingTitle|offsetTop|pageOrigin|allowMultipleInstances|offsetParent|pageXOffset|tag|nopad|alpha|thumb|dimmingGeckoFix|pow|detachEvent|ltr|clickY|clickX|focusTopmost|form|rv|hideIframes|relativeTo|offsetX|cssDirection|wheelDelta|reuseOverlay|direction|offsetY|leftpanel|stripItemFormatter|getOverlays|marginBottom|rightpanel|marginRight|detail|hand|getComputedStyle|getPropertyValue|preloadImages|styleSheets|Overlay|hideSelects|arguments|returnValue|indexOf|focusTitle|clearsY|sls|getAttribute|getInline|getNumber|getElementByClass|Right|skin|replaceLang|Bottom|getControls|checkFirstAndLast|repeat|wait|hitSpace|Thumbstrip|Left|Top|Width|reOrder|doPanels|showOverlays|gotOverlays|writeCredits|showCredits|horizontal|createFullExpand|fullExpandOpacity|fixedControls||fullExpandPosition|Height|javascript|addOverlay|clearsX|after|load|mouseup|initSlideshow|overlayOptions|fadeInOut|creditsTarget|creditsHref|show|mousedown|toString|ximgSize|clientHeight|transitionDuration|border|yimgSize|oldImg|preloadNext|prepareNextOutline|newImg|creditsText|easingClose|tmpMin|_|creditsPosition|Eval|fitOverlayBox|correctRatio|creditsTitle|nextSibling|innerWidth|innerHeight|inner|scrollHeight|down|firstChild|clearTimeout|Image|cancel|Loading|fixed|bring|pageYOffset|currentStyle|Resize|geckodimmer|float|the|dimming|actual|Android|Go|iPhone|Powered|of|iPod|mgnRight|iPad|resizeTitle|esc|front|Expand||homepage|scrollWidth|mousewheel|HsExpander|doScroll|1001|callee|captionId|captionText|zoomin|captionEval|zoomout|DOMContentLoaded|text|ignoreMe|_self|outlineStartOffset|http|drop|shadow|HEAD|createTextNode|expression|headingId|graphics|padding|DOMMouseScroll|Use|keys|com|onmousewheel|click|removeAttribute|drag|getElementById|important|it|Trident||headingEval|headingText|ra|Safari|Gecko|120|Macintosh|pI|sqrt|reuse|allowSimultaneousLoading|rect|abs|isHtml|keyCode|cellSpacing|readyState|clip|onmouseover|clearInterval|splice|setInterval|200px|preserveContent|default|onmouseout|borderCollapse|collapse|AlphaImageLoader|Microsoft|DXImageTransform|sizingMethod|scale|eval|stl|progid|SELECT|outlinesDir|fontSize|lineHeight|outlines|IFRAME|500|interval|vendor|KDE|mouseover|dragSensitivity|blockRightClick|location|lineNumber|message|dynamicallyUpdateAnchors|useControls|addSlideshow|registerOverlay|htmlE|xpand|hasHtmlExpanders|button|imageCreate|fromElement|flushImgSize|caption|linearTween|floor|fit|split|toElement|oncontextmenu|alert|removeChild|debug|attachEvent|Line'.split('|'),0,{}))
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide-with-html.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide-with-html.js
new file mode 100644
index 0000000000000000000000000000000000000000..c53d877f8f27f0f32bebc8632d60696a1ad8c763
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide-with-html.js
@@ -0,0 +1,2481 @@
+/** 
+ * Name:    Highslide JS
+ * Version: 4.1.13 (2011-10-06)
+ * Config:  default +inline +ajax +iframe +flash
+ * Author:  Torstein Hønsi
+ * Support: www.highslide.com/support
+ * License: www.highslide.com/#license
+ */
+if (!hs) { var hs = {
+// Language strings
+lang : {
+	cssDirection: 'ltr',
+	loadingText : 'Loading...',
+	loadingTitle : 'Click to cancel',
+	focusTitle : 'Click to bring to front',
+	fullExpandTitle : 'Expand to actual size (f)',
+	creditsText : 'Powered by <i>Highslide JS</i>',
+	creditsTitle : 'Go to the Highslide JS homepage',
+	previousText : 'Previous',
+	nextText : 'Next', 
+	moveText : 'Move',
+	closeText : 'Close', 
+	closeTitle : 'Close (esc)', 
+	resizeTitle : 'Resize',
+	playText : 'Play',
+	playTitle : 'Play slideshow (spacebar)',
+	pauseText : 'Pause',
+	pauseTitle : 'Pause slideshow (spacebar)',
+	previousTitle : 'Previous (arrow left)',
+	nextTitle : 'Next (arrow right)',
+	moveTitle : 'Move',
+	fullExpandText : '1:1',
+	restoreTitle : 'Click to close image, click and drag to move. Use arrow keys for next and previous.'
+},
+// See http://highslide.com/ref for examples of settings  
+graphicsDir : 'highslide/graphics/',
+expandCursor : 'zoomin.cur', // null disables
+restoreCursor : 'zoomout.cur', // null disables
+expandDuration : 250, // milliseconds
+restoreDuration : 250,
+marginLeft : 15,
+marginRight : 15,
+marginTop : 15,
+marginBottom : 15,
+zIndexCounter : 1001, // adjust to other absolutely positioned elements
+loadingOpacity : 0.75,
+allowMultipleInstances: true,
+numberOfImagesToPreload : 5,
+outlineWhileAnimating : 2, // 0 = never, 1 = always, 2 = HTML only 
+outlineStartOffset : 3, // ends at 10
+padToMinWidth : false, // pad the popup width to make room for wide caption
+fullExpandPosition : 'bottom right',
+fullExpandOpacity : 1,
+showCredits : true, // you can set this to false if you want
+creditsHref : 'http://highslide.com/',
+creditsTarget : '_self',
+enableKeyListener : true,
+openerTagNames : ['a'], // Add more to allow slideshow indexing
+
+allowWidthReduction : false,
+allowHeightReduction : true,
+preserveContent : true, // Preserve changes made to the content and position of HTML popups.
+objectLoadTime : 'before', // Load iframes 'before' or 'after' expansion.
+cacheAjax : true, // Cache ajax popups for instant display. Can be overridden for each popup.
+dragByHeading: true,
+minWidth: 200,
+minHeight: 200,
+allowSizeReduction: true, // allow the image to reduce to fit client size. If false, this overrides minWidth and minHeight
+outlineType : 'drop-shadow', // set null to disable outlines
+skin : {
+	contentWrapper:
+		'<div class="highslide-header"><ul>'+
+			'<li class="highslide-previous">'+
+				'<a href="#" title="{hs.lang.previousTitle}" onclick="return hs.previous(this)">'+
+				'<span>{hs.lang.previousText}</span></a>'+
+			'</li>'+
+			'<li class="highslide-next">'+
+				'<a href="#" title="{hs.lang.nextTitle}" onclick="return hs.next(this)">'+
+				'<span>{hs.lang.nextText}</span></a>'+
+			'</li>'+
+			'<li class="highslide-move">'+
+				'<a href="#" title="{hs.lang.moveTitle}" onclick="return false">'+
+				'<span>{hs.lang.moveText}</span></a>'+
+			'</li>'+
+			'<li class="highslide-close">'+
+				'<a href="#" title="{hs.lang.closeTitle}" onclick="return hs.close(this)">'+
+				'<span>{hs.lang.closeText}</span></a>'+
+			'</li>'+
+		'</ul></div>'+
+		'<div class="highslide-body"></div>'+
+		'<div class="highslide-footer"><div>'+
+			'<span class="highslide-resize" title="{hs.lang.resizeTitle}"><span></span></span>'+
+		'</div></div>'
+},
+// END OF YOUR SETTINGS
+
+
+// declare internal properties
+preloadTheseImages : [],
+continuePreloading: true,
+expanders : [],
+overrides : [
+	'allowSizeReduction',
+	'useBox',
+	'outlineType',
+	'outlineWhileAnimating',
+	'captionId',
+	'captionText',
+	'captionEval',
+	'captionOverlay',
+	'headingId',
+	'headingText',
+	'headingEval',
+	'headingOverlay',
+	'creditsPosition',
+	'dragByHeading',
+	
+	'width',
+	'height',
+	
+	'contentId',
+	'allowWidthReduction',
+	'allowHeightReduction',
+	'preserveContent',
+	'maincontentId',
+	'maincontentText',
+	'maincontentEval',
+	'objectType',	
+	'cacheAjax',	
+	'objectWidth',
+	'objectHeight',
+	'objectLoadTime',	
+	'swfOptions',
+	'wrapperClassName',
+	'minWidth',
+	'minHeight',
+	'maxWidth',
+	'maxHeight',
+	'pageOrigin',
+	'slideshowGroup',
+	'easing',
+	'easingClose',
+	'fadeInOut',
+	'src'
+],
+overlays : [],
+idCounter : 0,
+oPos : {
+	x: ['leftpanel', 'left', 'center', 'right', 'rightpanel'],
+	y: ['above', 'top', 'middle', 'bottom', 'below']
+},
+mouse: {},
+headingOverlay: {},
+captionOverlay: {},
+swfOptions: { flashvars: {}, params: {}, attributes: {} },
+timers : [],
+
+pendingOutlines : {},
+sleeping : [],
+preloadTheseAjax : [],
+cacheBindings : [],
+cachedGets : {},
+clones : {},
+onReady: [],
+uaVersion: /Trident\/4\.0/.test(navigator.userAgent) ? 8 :
+	parseFloat((navigator.userAgent.toLowerCase().match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1]),
+ie : (document.all && !window.opera),
+//ie : navigator && /MSIE [678]/.test(navigator.userAgent), // ie9 compliant?
+safari : /Safari/.test(navigator.userAgent),
+geckoMac : /Macintosh.+rv:1\.[0-8].+Gecko/.test(navigator.userAgent),
+
+$ : function (id) {
+	if (id) return document.getElementById(id);
+},
+
+push : function (arr, val) {
+	arr[arr.length] = val;
+},
+
+createElement : function (tag, attribs, styles, parent, nopad) {
+	var el = document.createElement(tag);
+	if (attribs) hs.extend(el, attribs);
+	if (nopad) hs.setStyles(el, {padding: 0, border: 'none', margin: 0});
+	if (styles) hs.setStyles(el, styles);
+	if (parent) parent.appendChild(el);	
+	return el;
+},
+
+extend : function (el, attribs) {
+	for (var x in attribs) el[x] = attribs[x];
+	return el;
+},
+
+setStyles : function (el, styles) {
+	for (var x in styles) {
+		if (hs.ieLt9 && x == 'opacity') {
+			if (styles[x] > 0.99) el.style.removeAttribute('filter');
+			else el.style.filter = 'alpha(opacity='+ (styles[x] * 100) +')';
+		}
+		else el.style[x] = styles[x];		
+	}
+},
+animate: function(el, prop, opt) {
+	var start,
+		end,
+		unit;
+	if (typeof opt != 'object' || opt === null) {
+		var args = arguments;
+		opt = {
+			duration: args[2],
+			easing: args[3],
+			complete: args[4]
+		};
+	}
+	if (typeof opt.duration != 'number') opt.duration = 250;
+	opt.easing = Math[opt.easing] || Math.easeInQuad;
+	opt.curAnim = hs.extend({}, prop);
+	for (var name in prop) {
+		var e = new hs.fx(el, opt , name );
+		
+		start = parseFloat(hs.css(el, name)) || 0;
+		end = parseFloat(prop[name]);
+		unit = name != 'opacity' ? 'px' : '';
+		
+		e.custom( start, end, unit );
+	}	
+},
+css: function(el, prop) {
+	if (el.style[prop]) {
+		return el.style[prop];
+	} else if (document.defaultView) {
+		return document.defaultView.getComputedStyle(el, null).getPropertyValue(prop);
+
+	} else {
+		if (prop == 'opacity') prop = 'filter';
+		var val = el.currentStyle[prop.replace(/\-(\w)/g, function (a, b){ return b.toUpperCase(); })];
+		if (prop == 'filter') 
+			val = val.replace(/alpha\(opacity=([0-9]+)\)/, 
+				function (a, b) { return b / 100 });
+		return val === '' ? 1 : val;
+	} 
+},
+
+getPageSize : function () {
+	var d = document, w = window, iebody = d.compatMode && d.compatMode != 'BackCompat' 
+		? d.documentElement : d.body,
+		ieLt9 = hs.ie && (hs.uaVersion < 9 || typeof pageXOffset == 'undefined');
+	
+	var width = ieLt9 ? iebody.clientWidth : 
+			(d.documentElement.clientWidth || self.innerWidth),
+		height = ieLt9 ? iebody.clientHeight : self.innerHeight;
+	hs.page = {
+		width: width,
+		height: height,		
+		scrollLeft: ieLt9 ? iebody.scrollLeft : pageXOffset,
+		scrollTop: ieLt9 ? iebody.scrollTop : pageYOffset
+	};
+	return hs.page;
+},
+
+getPosition : function(el)	{
+	var p = { x: el.offsetLeft, y: el.offsetTop };
+	while (el.offsetParent)	{
+		el = el.offsetParent;
+		p.x += el.offsetLeft;
+		p.y += el.offsetTop;
+		if (el != document.body && el != document.documentElement) {
+			p.x -= el.scrollLeft;
+			p.y -= el.scrollTop;
+		}
+	}
+	return p;
+},
+
+expand : function(a, params, custom, type) {
+	if (!a) a = hs.createElement('a', null, { display: 'none' }, hs.container);
+	if (typeof a.getParams == 'function') return params;
+	if (type == 'html') {
+		for (var i = 0; i < hs.sleeping.length; i++) {
+			if (hs.sleeping[i] && hs.sleeping[i].a == a) {
+				hs.sleeping[i].awake();
+				hs.sleeping[i] = null;
+				return false;
+			}
+		}
+		hs.hasHtmlExpanders = true;
+	}	
+	try {	
+		new hs.Expander(a, params, custom, type);
+		return false;
+	} catch (e) { return true; }
+},
+
+htmlExpand : function(a, params, custom) {
+	return hs.expand(a, params, custom, 'html');
+},
+
+getSelfRendered : function() {
+	return hs.createElement('div', { 
+		className: 'highslide-html-content', 
+		innerHTML: hs.replaceLang(hs.skin.contentWrapper) 
+	});
+},
+getElementByClass : function (el, tagName, className) {
+	var els = el.getElementsByTagName(tagName);
+	for (var i = 0; i < els.length; i++) {
+    	if ((new RegExp(className)).test(els[i].className)) {
+			return els[i];
+		}
+	}
+	return null;
+},
+replaceLang : function(s) {
+	s = s.replace(/\s/g, ' ');
+	var re = /{hs\.lang\.([^}]+)\}/g,
+		matches = s.match(re),
+		lang;
+	if (matches) for (var i = 0; i < matches.length; i++) {
+		lang = matches[i].replace(re, "$1");
+		if (typeof hs.lang[lang] != 'undefined') s = s.replace(matches[i], hs.lang[lang]);
+	}
+	return s;
+},
+
+
+getCacheBinding : function (a) {
+	for (var i = 0; i < hs.cacheBindings.length; i++) {
+		if (hs.cacheBindings[i][0] == a) {
+			var c = hs.cacheBindings[i][1];
+			hs.cacheBindings[i][1] = c.cloneNode(1);
+			return c;
+		}
+	}
+	return null;
+},
+
+preloadAjax : function (e) {
+	var arr = hs.getAnchors();
+	for (var i = 0; i < arr.htmls.length; i++) {
+		var a = arr.htmls[i];
+		if (hs.getParam(a, 'objectType') == 'ajax' && hs.getParam(a, 'cacheAjax'))
+			hs.push(hs.preloadTheseAjax, a);
+	}
+	
+	hs.preloadAjaxElement(0);
+},
+
+preloadAjaxElement : function (i) {
+	if (!hs.preloadTheseAjax[i]) return;
+	var a = hs.preloadTheseAjax[i];
+	var cache = hs.getNode(hs.getParam(a, 'contentId'));
+	if (!cache) cache = hs.getSelfRendered();
+	var ajax = new hs.Ajax(a, cache, 1);	
+   	ajax.onError = function () { };
+   	ajax.onLoad = function () {
+   		hs.push(hs.cacheBindings, [a, cache]);
+   		hs.preloadAjaxElement(i + 1);
+   	};
+   	ajax.run();
+},
+
+focusTopmost : function() {
+	var topZ = 0, 
+		topmostKey = -1,
+		expanders = hs.expanders,
+		exp,
+		zIndex;
+	for (var i = 0; i < expanders.length; i++) {
+		exp = expanders[i];
+		if (exp) {
+			zIndex = exp.wrapper.style.zIndex;
+			if (zIndex && zIndex > topZ) {
+				topZ = zIndex;				
+				topmostKey = i;
+			}
+		}
+	}
+	if (topmostKey == -1) hs.focusKey = -1;
+	else expanders[topmostKey].focus();
+},
+
+getParam : function (a, param) {
+	a.getParams = a.onclick;
+	var p = a.getParams ? a.getParams() : null;
+	a.getParams = null;
+	
+	return (p && typeof p[param] != 'undefined') ? p[param] : 
+		(typeof hs[param] != 'undefined' ? hs[param] : null);
+},
+
+getSrc : function (a) {
+	var src = hs.getParam(a, 'src');
+	if (src) return src;
+	return a.href;
+},
+
+getNode : function (id) {
+	var node = hs.$(id), clone = hs.clones[id], a = {};
+	if (!node && !clone) return null;
+	if (!clone) {
+		clone = node.cloneNode(true);
+		clone.id = '';
+		hs.clones[id] = clone;
+		return node;
+	} else {
+		return clone.cloneNode(true);
+	}
+},
+
+discardElement : function(d) {
+	if (d) hs.garbageBin.appendChild(d);
+	hs.garbageBin.innerHTML = '';
+},
+transit : function (adj, exp) {
+	var last = exp || hs.getExpander();
+	exp = last;
+	if (hs.upcoming) return false;
+	else hs.last = last;
+	hs.removeEventListener(document, window.opera ? 'keypress' : 'keydown', hs.keyHandler);
+	try {
+		hs.upcoming = adj;
+		adj.onclick(); 		
+	} catch (e){
+		hs.last = hs.upcoming = null;
+	}
+	try {
+		exp.close();
+	} catch (e) {}
+	return false;
+},
+
+previousOrNext : function (el, op) {
+	var exp = hs.getExpander(el);
+	if (exp) return hs.transit(exp.getAdjacentAnchor(op), exp);
+	else return false;
+},
+
+previous : function (el) {
+	return hs.previousOrNext(el, -1);
+},
+
+next : function (el) {
+	return hs.previousOrNext(el, 1);	
+},
+
+keyHandler : function(e) {
+	if (!e) e = window.event;
+	if (!e.target) e.target = e.srcElement; // ie
+	if (typeof e.target.form != 'undefined') return true; // form element has focus
+	var exp = hs.getExpander();
+	
+	var op = null;
+	switch (e.keyCode) {
+		case 70: // f
+			if (exp) exp.doFullExpand();
+			return true;
+		case 32: // Space
+		case 34: // Page Down
+		case 39: // Arrow right
+		case 40: // Arrow down
+			op = 1;
+			break;
+		case 8:  // Backspace
+		case 33: // Page Up
+		case 37: // Arrow left
+		case 38: // Arrow up
+			op = -1;
+			break;
+		case 27: // Escape
+		case 13: // Enter
+			op = 0;
+	}
+	if (op !== null) {hs.removeEventListener(document, window.opera ? 'keypress' : 'keydown', hs.keyHandler);
+		if (!hs.enableKeyListener) return true;
+		
+		if (e.preventDefault) e.preventDefault();
+    	else e.returnValue = false;
+    	if (exp) {
+			if (op == 0) {
+				exp.close();
+			} else {
+				hs.previousOrNext(exp.key, op);
+			}
+			return false;
+		}
+	}
+	return true;
+},
+
+
+registerOverlay : function (overlay) {
+	hs.push(hs.overlays, hs.extend(overlay, { hsId: 'hsId'+ hs.idCounter++ } ));
+},
+
+
+getWrapperKey : function (element, expOnly) {
+	var el, re = /^highslide-wrapper-([0-9]+)$/;
+	// 1. look in open expanders
+	el = element;
+	while (el.parentNode)	{
+		if (el.id && re.test(el.id)) return el.id.replace(re, "$1");
+		el = el.parentNode;
+	}
+	// 2. look in thumbnail
+	if (!expOnly) {
+		el = element;
+		while (el.parentNode)	{
+			if (el.tagName && hs.isHsAnchor(el)) {
+				for (var key = 0; key < hs.expanders.length; key++) {
+					var exp = hs.expanders[key];
+					if (exp && exp.a == el) return key;
+				}
+			}
+			el = el.parentNode;
+		}
+	}
+	return null; 
+},
+
+getExpander : function (el, expOnly) {
+	if (typeof el == 'undefined') return hs.expanders[hs.focusKey] || null;
+	if (typeof el == 'number') return hs.expanders[el] || null;
+	if (typeof el == 'string') el = hs.$(el);
+	return hs.expanders[hs.getWrapperKey(el, expOnly)] || null;
+},
+
+isHsAnchor : function (a) {
+	return (a.onclick && a.onclick.toString().replace(/\s/g, ' ').match(/hs.(htmlE|e)xpand/));
+},
+
+reOrder : function () {
+	for (var i = 0; i < hs.expanders.length; i++)
+		if (hs.expanders[i] && hs.expanders[i].isExpanded) hs.focusTopmost();
+},
+
+mouseClickHandler : function(e) 
+{	
+	if (!e) e = window.event;
+	if (e.button > 1) return true;
+	if (!e.target) e.target = e.srcElement;
+	
+	var el = e.target;
+	while (el.parentNode
+		&& !(/highslide-(image|move|html|resize)/.test(el.className)))
+	{
+		el = el.parentNode;
+	}
+	var exp = hs.getExpander(el);
+	if (exp && (exp.isClosing || !exp.isExpanded)) return true;
+		
+	if (exp && e.type == 'mousedown') {
+		if (e.target.form) return true;
+		var match = el.className.match(/highslide-(image|move|resize)/);
+		if (match) {
+			hs.dragArgs = { 
+				exp: exp , 
+				type: match[1], 
+				left: exp.x.pos, 
+				width: exp.x.size, 
+				top: exp.y.pos, 
+				height: exp.y.size, 
+				clickX: e.clientX, 
+				clickY: e.clientY
+			};
+			
+			
+			hs.addEventListener(document, 'mousemove', hs.dragHandler);
+			if (e.preventDefault) e.preventDefault(); // FF
+			
+			if (/highslide-(image|html)-blur/.test(exp.content.className)) {
+				exp.focus();
+				hs.hasFocused = true;
+			}
+			return false;
+		}
+		else if (/highslide-html/.test(el.className) && hs.focusKey != exp.key) {
+			exp.focus();
+			exp.doShowHide('hidden');
+		}
+	} else if (e.type == 'mouseup') {
+		
+		hs.removeEventListener(document, 'mousemove', hs.dragHandler);
+		
+		if (hs.dragArgs) {
+			if (hs.styleRestoreCursor && hs.dragArgs.type == 'image') 
+				hs.dragArgs.exp.content.style.cursor = hs.styleRestoreCursor;
+			var hasDragged = hs.dragArgs.hasDragged;
+			
+			if (!hasDragged &&!hs.hasFocused && !/(move|resize)/.test(hs.dragArgs.type)) {
+				exp.close();
+			} 
+			else if (hasDragged || (!hasDragged && hs.hasHtmlExpanders)) {
+				hs.dragArgs.exp.doShowHide('hidden');
+			}
+			
+			if (hs.dragArgs.exp.releaseMask) 
+				hs.dragArgs.exp.releaseMask.style.display = 'none';
+			hs.hasFocused = false;
+			hs.dragArgs = null;
+		
+		} else if (/highslide-image-blur/.test(el.className)) {
+			el.style.cursor = hs.styleRestoreCursor;		
+		}
+	}
+	return false;
+},
+
+dragHandler : function(e)
+{
+	if (!hs.dragArgs) return true;
+	if (!e) e = window.event;
+	var a = hs.dragArgs, exp = a.exp;
+	if (exp.iframe) {		
+		if (!exp.releaseMask) exp.releaseMask = hs.createElement('div', null, 
+			{ position: 'absolute', width: exp.x.size+'px', height: exp.y.size+'px', 
+				left: exp.x.cb+'px', top: exp.y.cb+'px', zIndex: 4,	background: (hs.ieLt9 ? 'white' : 'none'), 
+				opacity: 0.01 }, 
+			exp.wrapper, true);
+		if (exp.releaseMask.style.display == 'none')
+			exp.releaseMask.style.display = '';
+	}
+	
+	a.dX = e.clientX - a.clickX;
+	a.dY = e.clientY - a.clickY;	
+	
+	var distance = Math.sqrt(Math.pow(a.dX, 2) + Math.pow(a.dY, 2));
+	if (!a.hasDragged) a.hasDragged = (a.type != 'image' && distance > 0)
+		|| (distance > (hs.dragSensitivity || 5));
+	
+	if (a.hasDragged && e.clientX > 5 && e.clientY > 5) {
+		
+		if (a.type == 'resize') exp.resize(a);
+		else {
+			exp.moveTo(a.left + a.dX, a.top + a.dY);
+			if (a.type == 'image') exp.content.style.cursor = 'move';
+		}
+	}
+	return false;
+},
+
+wrapperMouseHandler : function (e) {
+	try {
+		if (!e) e = window.event;
+		var over = /mouseover/i.test(e.type); 
+		if (!e.target) e.target = e.srcElement; // ie
+		if (!e.relatedTarget) e.relatedTarget = 
+			over ? e.fromElement : e.toElement; // ie
+		var exp = hs.getExpander(e.target);
+		if (!exp.isExpanded) return;
+		if (!exp || !e.relatedTarget || hs.getExpander(e.relatedTarget, true) == exp 
+			|| hs.dragArgs) return;
+		for (var i = 0; i < exp.overlays.length; i++) (function() {
+			var o = hs.$('hsId'+ exp.overlays[i]);
+			if (o && o.hideOnMouseOut) {
+				if (over) hs.setStyles(o, { visibility: 'visible', display: '' });
+				hs.animate(o, { opacity: over ? o.opacity : 0 }, o.dur);
+			}
+		})();	
+	} catch (e) {}
+},
+addEventListener : function (el, event, func) {
+	if (el == document && event == 'ready') {
+		hs.push(hs.onReady, func);
+	}
+	try {
+		el.addEventListener(event, func, false);
+	} catch (e) {
+		try {
+			el.detachEvent('on'+ event, func);
+			el.attachEvent('on'+ event, func);
+		} catch (e) {
+			el['on'+ event] = func;
+		}
+	} 
+},
+
+removeEventListener : function (el, event, func) {
+	try {
+		el.removeEventListener(event, func, false);
+	} catch (e) {
+		try {
+			el.detachEvent('on'+ event, func);
+		} catch (e) {
+			el['on'+ event] = null;
+		}
+	}
+},
+
+preloadFullImage : function (i) {
+	if (hs.continuePreloading && hs.preloadTheseImages[i] && hs.preloadTheseImages[i] != 'undefined') {
+		var img = document.createElement('img');
+		img.onload = function() { 
+			img = null;
+			hs.preloadFullImage(i + 1);
+		};
+		img.src = hs.preloadTheseImages[i];
+	}
+},
+preloadImages : function (number) {
+	if (number && typeof number != 'object') hs.numberOfImagesToPreload = number;
+	
+	var arr = hs.getAnchors();
+	for (var i = 0; i < arr.images.length && i < hs.numberOfImagesToPreload; i++) {
+		hs.push(hs.preloadTheseImages, hs.getSrc(arr.images[i]));
+	}
+	
+	// preload outlines
+	if (hs.outlineType)	new hs.Outline(hs.outlineType, function () { hs.preloadFullImage(0)} );
+	else
+	
+	hs.preloadFullImage(0);
+	
+	// preload cursor
+	if (hs.restoreCursor) var cur = hs.createElement('img', { src: hs.graphicsDir + hs.restoreCursor });
+},
+
+
+init : function () {
+	if (!hs.container) {
+	
+		hs.ieLt7 = hs.ie && hs.uaVersion < 7;
+		hs.ieLt9 = hs.ie && hs.uaVersion < 9;
+		
+		hs.getPageSize();
+		hs.ie6SSL = hs.ieLt7 && location.protocol == 'https:';
+		for (var x in hs.langDefaults) {
+			if (typeof hs[x] != 'undefined') hs.lang[x] = hs[x];
+			else if (typeof hs.lang[x] == 'undefined' && typeof hs.langDefaults[x] != 'undefined') 
+				hs.lang[x] = hs.langDefaults[x];
+		}
+		
+		hs.container = hs.createElement('div', {
+				className: 'highslide-container'
+			}, {
+				position: 'absolute',
+				left: 0, 
+				top: 0, 
+				width: '100%', 
+				zIndex: hs.zIndexCounter,
+				direction: 'ltr'
+			}, 
+			document.body,
+			true
+		);
+		hs.loading = hs.createElement('a', {
+				className: 'highslide-loading',
+				title: hs.lang.loadingTitle,
+				innerHTML: hs.lang.loadingText,
+				href: 'javascript:;'
+			}, {
+				position: 'absolute',
+				top: '-9999px',
+				opacity: hs.loadingOpacity,
+				zIndex: 1
+			}, hs.container
+		);
+		hs.garbageBin = hs.createElement('div', null, { display: 'none' }, hs.container);
+		hs.clearing = hs.createElement('div', null, 
+			{ clear: 'both', paddingTop: '1px' }, null, true);
+		
+		// http://www.robertpenner.com/easing/ 
+		Math.linearTween = function (t, b, c, d) {
+			return c*t/d + b;
+		};
+		Math.easeInQuad = function (t, b, c, d) {
+			return c*(t/=d)*t + b;
+		};
+		
+		hs.hideSelects = hs.ieLt7;
+		hs.hideIframes = ((window.opera && hs.uaVersion < 9) || navigator.vendor == 'KDE' 
+			|| (hs.ieLt7 && hs.uaVersion < 5.5));
+	}
+},
+ready : function() {
+	if (hs.isReady) return;
+	hs.isReady = true;
+	for (var i = 0; i < hs.onReady.length; i++) hs.onReady[i]();
+},
+
+updateAnchors : function() {
+	var el, els, all = [], images = [], htmls = [],groups = {}, re;
+		
+	for (var i = 0; i < hs.openerTagNames.length; i++) {
+		els = document.getElementsByTagName(hs.openerTagNames[i]);
+		for (var j = 0; j < els.length; j++) {
+			el = els[j];
+			re = hs.isHsAnchor(el);
+			if (re) {
+				hs.push(all, el);
+				if (re[0] == 'hs.expand') hs.push(images, el);
+				else if (re[0] == 'hs.htmlExpand') hs.push(htmls, el);
+				var g = hs.getParam(el, 'slideshowGroup') || 'none';
+				if (!groups[g]) groups[g] = [];
+				hs.push(groups[g], el);
+			}
+		}
+	}
+	hs.anchors = { all: all, groups: groups, images: images, htmls: htmls };
+	return hs.anchors;
+	
+},
+
+getAnchors : function() {
+	return hs.anchors || hs.updateAnchors();
+},
+
+
+close : function(el) {
+	var exp = hs.getExpander(el);
+	if (exp) exp.close();
+	return false;
+}
+}; // end hs object
+hs.fx = function( elem, options, prop ){
+	this.options = options;
+	this.elem = elem;
+	this.prop = prop;
+
+	if (!options.orig) options.orig = {};
+};
+hs.fx.prototype = {
+	update: function(){
+		(hs.fx.step[this.prop] || hs.fx.step._default)(this);
+		
+		if (this.options.step)
+			this.options.step.call(this.elem, this.now, this);
+
+	},
+	custom: function(from, to, unit){
+		this.startTime = (new Date()).getTime();
+		this.start = from;
+		this.end = to;
+		this.unit = unit;// || this.unit || "px";
+		this.now = this.start;
+		this.pos = this.state = 0;
+
+		var self = this;
+		function t(gotoEnd){
+			return self.step(gotoEnd);
+		}
+
+		t.elem = this.elem;
+
+		if ( t() && hs.timers.push(t) == 1 ) {
+			hs.timerId = setInterval(function(){
+				var timers = hs.timers;
+
+				for ( var i = 0; i < timers.length; i++ )
+					if ( !timers[i]() )
+						timers.splice(i--, 1);
+
+				if ( !timers.length ) {
+					clearInterval(hs.timerId);
+				}
+			}, 13);
+		}
+	},
+	step: function(gotoEnd){
+		var t = (new Date()).getTime();
+		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.complete) this.options.complete.call(this.elem);
+			}
+			return false;
+		} else {
+			var n = t - this.startTime;
+			this.state = n / this.options.duration;
+			this.pos = this.options.easing(n, 0, 1, this.options.duration);
+			this.now = this.start + ((this.end - this.start) * this.pos);
+			this.update();
+		}
+		return true;
+	}
+
+};
+
+hs.extend( hs.fx, {
+	step: {
+
+		opacity: function(fx){
+			hs.setStyles(fx.elem, { opacity: fx.now });
+		},
+
+		_default: function(fx){
+			try {
+				if ( fx.elem.style && fx.elem.style[ fx.prop ] != null )
+					fx.elem.style[ fx.prop ] = fx.now + fx.unit;
+				else
+					fx.elem[ fx.prop ] = fx.now;
+			} catch (e) {}
+		}
+	}
+});
+
+hs.Outline =  function (outlineType, onLoad) {
+	this.onLoad = onLoad;
+	this.outlineType = outlineType;
+	var v = hs.uaVersion, tr;
+	
+	this.hasAlphaImageLoader = hs.ie && hs.uaVersion < 7;
+	if (!outlineType) {
+		if (onLoad) onLoad();
+		return;
+	}
+	
+	hs.init();
+	this.table = hs.createElement(
+		'table', { 
+			cellSpacing: 0 
+		}, {
+			visibility: 'hidden',
+			position: 'absolute',
+			borderCollapse: 'collapse',
+			width: 0
+		},
+		hs.container,
+		true
+	);
+	var tbody = hs.createElement('tbody', null, null, this.table, 1);
+	
+	this.td = [];
+	for (var i = 0; i <= 8; i++) {
+		if (i % 3 == 0) tr = hs.createElement('tr', null, { height: 'auto' }, tbody, true);
+		this.td[i] = hs.createElement('td', null, null, tr, true);
+		var style = i != 4 ? { lineHeight: 0, fontSize: 0} : { position : 'relative' };
+		hs.setStyles(this.td[i], style);
+	}
+	this.td[4].className = outlineType +' highslide-outline';
+	
+	this.preloadGraphic(); 
+};
+
+hs.Outline.prototype = {
+preloadGraphic : function () {
+	var src = hs.graphicsDir + (hs.outlinesDir || "outlines/")+ this.outlineType +".png";
+				
+	var appendTo = hs.safari && hs.uaVersion < 525 ? hs.container : null;
+	this.graphic = hs.createElement('img', null, { position: 'absolute', 
+		top: '-9999px' }, appendTo, true); // for onload trigger
+	
+	var pThis = this;
+	this.graphic.onload = function() { pThis.onGraphicLoad(); };
+	
+	this.graphic.src = src;
+},
+
+onGraphicLoad : function () {
+	var o = this.offset = this.graphic.width / 4,
+		pos = [[0,0],[0,-4],[-2,0],[0,-8],0,[-2,-8],[0,-2],[0,-6],[-2,-2]],
+		dim = { height: (2*o) +'px', width: (2*o) +'px' };
+	for (var i = 0; i <= 8; i++) {
+		if (pos[i]) {
+			if (this.hasAlphaImageLoader) {
+				var w = (i == 1 || i == 7) ? '100%' : this.graphic.width +'px';
+				var div = hs.createElement('div', null, { width: '100%', height: '100%', position: 'relative', overflow: 'hidden'}, this.td[i], true);
+				hs.createElement ('div', null, { 
+						filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale, src='"+ this.graphic.src + "')", 
+						position: 'absolute',
+						width: w, 
+						height: this.graphic.height +'px',
+						left: (pos[i][0]*o)+'px',
+						top: (pos[i][1]*o)+'px'
+					}, 
+				div,
+				true);
+			} else {
+				hs.setStyles(this.td[i], { background: 'url('+ this.graphic.src +') '+ (pos[i][0]*o)+'px '+(pos[i][1]*o)+'px'});
+			}
+			
+			if (window.opera && (i == 3 || i ==5)) 
+				hs.createElement('div', null, dim, this.td[i], true);
+			
+			hs.setStyles (this.td[i], dim);
+		}
+	}
+	this.graphic = null;
+	if (hs.pendingOutlines[this.outlineType]) hs.pendingOutlines[this.outlineType].destroy();
+	hs.pendingOutlines[this.outlineType] = this;
+	if (this.onLoad) this.onLoad();
+},
+	
+setPosition : function (pos, offset, vis, dur, easing) {
+	var exp = this.exp,
+		stl = exp.wrapper.style,
+		offset = offset || 0,
+		pos = pos || {
+			x: exp.x.pos + offset,
+			y: exp.y.pos + offset,
+			w: exp.x.get('wsize') - 2 * offset,
+			h: exp.y.get('wsize') - 2 * offset
+		};
+	if (vis) this.table.style.visibility = (pos.h >= 4 * this.offset) 
+		? 'visible' : 'hidden';
+	hs.setStyles(this.table, {
+		left: (pos.x - this.offset) +'px',
+		top: (pos.y - this.offset) +'px',
+		width: (pos.w + 2 * this.offset) +'px'
+	});
+	
+	pos.w -= 2 * this.offset;
+	pos.h -= 2 * this.offset;
+	hs.setStyles (this.td[4], {
+		width: pos.w >= 0 ? pos.w +'px' : 0,
+		height: pos.h >= 0 ? pos.h +'px' : 0
+	});
+	if (this.hasAlphaImageLoader) this.td[3].style.height 
+		= this.td[5].style.height = this.td[4].style.height;	
+	
+},
+	
+destroy : function(hide) {
+	if (hide) this.table.style.visibility = 'hidden';
+	else hs.discardElement(this.table);
+}
+};
+
+hs.Dimension = function(exp, dim) {
+	this.exp = exp;
+	this.dim = dim;
+	this.ucwh = dim == 'x' ? 'Width' : 'Height';
+	this.wh = this.ucwh.toLowerCase();
+	this.uclt = dim == 'x' ? 'Left' : 'Top';
+	this.lt = this.uclt.toLowerCase();
+	this.ucrb = dim == 'x' ? 'Right' : 'Bottom';
+	this.rb = this.ucrb.toLowerCase();
+	this.p1 = this.p2 = 0;
+};
+hs.Dimension.prototype = {
+get : function(key) {
+	switch (key) {
+		case 'loadingPos':
+			return this.tpos + this.tb + (this.t - hs.loading['offset'+ this.ucwh]) / 2;
+		case 'wsize':
+			return this.size + 2 * this.cb + this.p1 + this.p2;
+		case 'fitsize':
+			return this.clientSize - this.marginMin - this.marginMax;
+		case 'maxsize':
+			return this.get('fitsize') - 2 * this.cb - this.p1 - this.p2 ;
+		case 'opos':
+			return this.pos - (this.exp.outline ? this.exp.outline.offset : 0);
+		case 'osize':
+			return this.get('wsize') + (this.exp.outline ? 2*this.exp.outline.offset : 0);
+		case 'imgPad':
+			return this.imgSize ? Math.round((this.size - this.imgSize) / 2) : 0;
+		
+	}
+},
+calcBorders: function() {
+	// correct for borders
+	this.cb = (this.exp.content['offset'+ this.ucwh] - this.t) / 2;
+	
+	this.marginMax = hs['margin'+ this.ucrb];
+},
+calcThumb: function() {
+	this.t = this.exp.el[this.wh] ? parseInt(this.exp.el[this.wh]) : 
+		this.exp.el['offset'+ this.ucwh];
+	this.tpos = this.exp.tpos[this.dim];
+	this.tb = (this.exp.el['offset'+ this.ucwh] - this.t) / 2;
+	if (this.tpos == 0 || this.tpos == -1) {
+		this.tpos = (hs.page[this.wh] / 2) + hs.page['scroll'+ this.uclt];		
+	};
+},
+calcExpanded: function() {
+	var exp = this.exp;
+	this.justify = 'auto';
+	
+	
+	// size and position
+	this.pos = this.tpos - this.cb + this.tb;
+	
+	if (this.maxHeight && this.dim == 'x')
+		exp.maxWidth = Math.min(exp.maxWidth || this.full, exp.maxHeight * this.full / exp.y.full); 
+		
+	this.size = Math.min(this.full, exp['max'+ this.ucwh] || this.full);
+	this.minSize = exp.allowSizeReduction ? 
+		Math.min(exp['min'+ this.ucwh], this.full) :this.full;
+	if (exp.isImage && exp.useBox)	{
+		this.size = exp[this.wh];
+		this.imgSize = this.full;
+	}
+	if (this.dim == 'x' && hs.padToMinWidth) this.minSize = exp.minWidth;
+	this.marginMin = hs['margin'+ this.uclt];
+	this.scroll = hs.page['scroll'+ this.uclt];
+	this.clientSize = hs.page[this.wh];
+},
+setSize: function(i) {
+	var exp = this.exp;
+	if (exp.isImage && (exp.useBox || hs.padToMinWidth)) {
+		this.imgSize = i;
+		this.size = Math.max(this.size, this.imgSize);
+		exp.content.style[this.lt] = this.get('imgPad')+'px';
+	} else
+	this.size = i;
+	
+	exp.content.style[this.wh] = i +'px';
+	exp.wrapper.style[this.wh] = this.get('wsize') +'px';
+	if (exp.outline) exp.outline.setPosition();
+	if (exp.releaseMask) exp.releaseMask.style[this.wh] = i +'px';
+	if (this.dim == 'y' && exp.iDoc && exp.body.style.height != 'auto') try {
+		exp.iDoc.body.style.overflow = 'auto';
+	} catch (e) {}
+	if (exp.isHtml) {
+		var d = exp.scrollerDiv;
+		if (this.sizeDiff === undefined)
+			this.sizeDiff = exp.innerContent['offset'+ this.ucwh] - d['offset'+ this.ucwh];
+		d.style[this.wh] = (this.size - this.sizeDiff) +'px';
+			
+		if (this.dim == 'x') exp.mediumContent.style.width = 'auto';
+		if (exp.body) exp.body.style[this.wh] = 'auto';
+	}
+	if (this.dim == 'x' && exp.overlayBox) exp.sizeOverlayBox(true);
+},
+setPos: function(i) {
+	this.pos = i;
+	this.exp.wrapper.style[this.lt] = i +'px';	
+	
+	if (this.exp.outline) this.exp.outline.setPosition();
+	
+}
+};
+
+hs.Expander = function(a, params, custom, contentType) {
+	if (document.readyState && hs.ie && !hs.isReady) {
+		hs.addEventListener(document, 'ready', function() {
+			new hs.Expander(a, params, custom, contentType);
+		});
+		return;
+	} 
+	this.a = a;
+	this.custom = custom;
+	this.contentType = contentType || 'image';
+	this.isHtml = (contentType == 'html');
+	this.isImage = !this.isHtml;
+	
+	hs.continuePreloading = false;
+	this.overlays = [];
+	hs.init();
+	var key = this.key = hs.expanders.length;
+	// override inline parameters
+	for (var i = 0; i < hs.overrides.length; i++) {
+		var name = hs.overrides[i];
+		this[name] = params && typeof params[name] != 'undefined' ?
+			params[name] : hs[name];
+	}
+	if (!this.src) this.src = a.href;
+	
+	// get thumb
+	var el = (params && params.thumbnailId) ? hs.$(params.thumbnailId) : a;
+	el = this.thumb = el.getElementsByTagName('img')[0] || el;
+	this.thumbsUserSetId = el.id || a.id;
+	
+	// check if already open
+	for (var i = 0; i < hs.expanders.length; i++) {
+		if (hs.expanders[i] && hs.expanders[i].a == a) {
+			hs.expanders[i].focus();
+			return false;
+		}
+	}	
+
+	// cancel other
+	if (!hs.allowSimultaneousLoading) for (var i = 0; i < hs.expanders.length; i++) {
+		if (hs.expanders[i] && hs.expanders[i].thumb != el && !hs.expanders[i].onLoadStarted) {
+			hs.expanders[i].cancelLoading();
+		}
+	}
+	hs.expanders[key] = this;
+	if (!hs.allowMultipleInstances && !hs.upcoming) {
+		if (hs.expanders[key-1]) hs.expanders[key-1].close();
+		if (typeof hs.focusKey != 'undefined' && hs.expanders[hs.focusKey])
+			hs.expanders[hs.focusKey].close();
+	}
+	
+	// initiate metrics
+	this.el = el;
+	this.tpos = this.pageOrigin || hs.getPosition(el);
+	hs.getPageSize();
+	var x = this.x = new hs.Dimension(this, 'x');
+	x.calcThumb();
+	var y = this.y = new hs.Dimension(this, 'y');
+	y.calcThumb();
+	this.wrapper = hs.createElement(
+		'div', {
+			id: 'highslide-wrapper-'+ this.key,
+			className: 'highslide-wrapper '+ this.wrapperClassName
+		}, {
+			visibility: 'hidden',
+			position: 'absolute',
+			zIndex: hs.zIndexCounter += 2
+		}, null, true );
+	
+	this.wrapper.onmouseover = this.wrapper.onmouseout = hs.wrapperMouseHandler;
+	if (this.contentType == 'image' && this.outlineWhileAnimating == 2)
+		this.outlineWhileAnimating = 0;
+	
+	// get the outline
+	if (!this.outlineType) {
+		this[this.contentType +'Create']();
+	
+	} else if (hs.pendingOutlines[this.outlineType]) {
+		this.connectOutline();
+		this[this.contentType +'Create']();
+	
+	} else {
+		this.showLoading();
+		var exp = this;
+		new hs.Outline(this.outlineType, 
+			function () {
+				exp.connectOutline();
+				exp[exp.contentType +'Create']();
+			} 
+		);
+	}
+	return true;
+};
+
+hs.Expander.prototype = {
+error : function(e) {
+	if (hs.debug) alert ('Line '+ e.lineNumber +': '+ e.message);
+	else window.location.href = this.src;
+},
+
+connectOutline : function() {
+	var outline = this.outline = hs.pendingOutlines[this.outlineType];
+	outline.exp = this;
+	outline.table.style.zIndex = this.wrapper.style.zIndex - 1;
+	hs.pendingOutlines[this.outlineType] = null;
+},
+
+showLoading : function() {
+	if (this.onLoadStarted || this.loading) return;
+	
+	this.loading = hs.loading;
+	var exp = this;
+	this.loading.onclick = function() {
+		exp.cancelLoading();
+	};
+	var exp = this, 
+		l = this.x.get('loadingPos') +'px',
+		t = this.y.get('loadingPos') +'px';
+	setTimeout(function () { 
+		if (exp.loading) hs.setStyles(exp.loading, { left: l, top: t, zIndex: hs.zIndexCounter++ })}
+	, 100);
+},
+
+imageCreate : function() {
+	var exp = this;
+	
+	var img = document.createElement('img');
+    this.content = img;
+    img.onload = function () {
+    	if (hs.expanders[exp.key]) exp.contentLoaded(); 
+	};
+    if (hs.blockRightClick) img.oncontextmenu = function() { return false; };
+    img.className = 'highslide-image';
+    hs.setStyles(img, {
+    	visibility: 'hidden',
+    	display: 'block',
+    	position: 'absolute',
+		maxWidth: '9999px',
+		zIndex: 3
+	});
+    img.title = hs.lang.restoreTitle;
+	if (hs.safari && hs.uaVersion < 525) hs.container.appendChild(img);
+    if (hs.ie && hs.flushImgSize) img.src = null;
+	img.src = this.src;
+	
+	this.showLoading();
+},
+
+htmlCreate : function () {
+	
+	this.content = hs.getCacheBinding(this.a);
+	if (!this.content) 
+		this.content = hs.getNode(this.contentId);
+	if (!this.content) 
+		this.content = hs.getSelfRendered();
+	this.getInline(['maincontent']);
+	if (this.maincontent) {
+		var body = hs.getElementByClass(this.content, 'div', 'highslide-body');
+		if (body) body.appendChild(this.maincontent);
+		this.maincontent.style.display = 'block';
+	}
+	
+	var innerContent = this.innerContent = this.content;
+	
+	if (/(swf|iframe)/.test(this.objectType)) this.setObjContainerSize(innerContent);
+	
+	// the content tree
+	hs.container.appendChild(this.wrapper);
+	hs.setStyles( this.wrapper, { 
+		position: 'static',
+		padding: '0 '+ hs.marginRight +'px 0 '+ hs.marginLeft +'px'
+	});
+	this.content = hs.createElement(
+    	'div', {
+    		className: 'highslide-html' 
+    	}, {
+			position: 'relative',
+			zIndex: 3,
+			height: 0,
+			overflow: 'hidden'
+		},
+		this.wrapper
+	);
+	this.mediumContent = hs.createElement('div', null, null, this.content, 1);
+	this.mediumContent.appendChild(innerContent);
+	
+	hs.setStyles (innerContent, { 
+		position: 'relative',
+		display: 'block',
+		direction: hs.lang.cssDirection || ''
+	});
+	if (this.width) innerContent.style.width = this.width +'px';
+	if (this.height) hs.setStyles(innerContent, {
+		height: this.height +'px',
+		overflow: 'hidden'
+	});
+	if (innerContent.offsetWidth < this.minWidth)
+		innerContent.style.width = this.minWidth +'px';
+		
+	
+    
+	if (this.objectType == 'ajax' && !hs.getCacheBinding(this.a)) {
+		this.showLoading();
+    	var exp = this;
+    	var ajax = new hs.Ajax(this.a, innerContent);
+		ajax.src = this.src;
+    	ajax.onLoad = function () {	if (hs.expanders[exp.key]) exp.contentLoaded(); };
+    	ajax.onError = function () { location.href = exp.src; };
+    	ajax.run();
+	}
+    else
+    
+    if (this.objectType == 'iframe' && this.objectLoadTime == 'before') {
+		this.writeExtendedContent();
+	}
+    else
+    	this.contentLoaded();
+},
+
+contentLoaded : function() {
+	try {	
+		if (!this.content) return;
+		this.content.onload = null;
+		if (this.onLoadStarted) return;
+		else this.onLoadStarted = true;
+		
+		var x = this.x, y = this.y;
+		
+		if (this.loading) {
+			hs.setStyles(this.loading, { top: '-9999px' });
+			this.loading = null;
+		}
+		if (this.isImage) {	
+			x.full = this.content.width;
+			y.full = this.content.height;
+			
+			hs.setStyles(this.content, {
+				width: x.t +'px',
+				height: y.t +'px'
+			});
+			this.wrapper.appendChild(this.content);
+			hs.container.appendChild(this.wrapper);
+		} else if (this.htmlGetSize) this.htmlGetSize();
+		
+		x.calcBorders();
+		y.calcBorders();
+		
+		hs.setStyles (this.wrapper, {
+			left: (x.tpos + x.tb - x.cb) +'px',
+			top: (y.tpos + x.tb - y.cb) +'px'
+		});
+		this.getOverlays();
+		
+		var ratio = x.full / y.full;
+		x.calcExpanded();
+		this.justify(x);
+		
+		y.calcExpanded();
+		this.justify(y);
+		if (this.isHtml) this.htmlSizeOperations();
+		if (this.overlayBox) this.sizeOverlayBox(0, 1);
+
+		
+		if (this.allowSizeReduction) {
+			if (this.isImage)
+				this.correctRatio(ratio);
+			else this.fitOverlayBox();
+			if (this.isImage && this.x.full > (this.x.imgSize || this.x.size)) {
+				this.createFullExpand();
+				if (this.overlays.length == 1) this.sizeOverlayBox();
+			}
+		}
+		this.show();
+		
+	} catch (e) {
+		this.error(e);
+	}
+},
+
+
+setObjContainerSize : function(parent, auto) {
+	var c = hs.getElementByClass(parent, 'DIV', 'highslide-body');
+	if (/(iframe|swf)/.test(this.objectType)) {
+		if (this.objectWidth) c.style.width = this.objectWidth +'px';
+		if (this.objectHeight) c.style.height = this.objectHeight +'px';
+	}
+},
+
+writeExtendedContent : function () {
+	if (this.hasExtendedContent) return;
+	var exp = this;
+	this.body = hs.getElementByClass(this.innerContent, 'DIV', 'highslide-body');
+	if (this.objectType == 'iframe') {
+		this.showLoading();
+		var ruler = hs.clearing.cloneNode(1);
+		this.body.appendChild(ruler);
+		this.newWidth = this.innerContent.offsetWidth;
+		if (!this.objectWidth) this.objectWidth = ruler.offsetWidth;
+		var hDiff = this.innerContent.offsetHeight - this.body.offsetHeight,
+			h = this.objectHeight || hs.page.height - hDiff - hs.marginTop - hs.marginBottom,
+			onload = this.objectLoadTime == 'before' ? 
+				' onload="if (hs.expanders['+ this.key +']) hs.expanders['+ this.key +'].contentLoaded()" ' : '';
+		this.body.innerHTML += '<iframe name="hs'+ (new Date()).getTime() +'" frameborder="0" key="'+ this.key +'" '
+			+' style="width:'+ this.objectWidth +'px; height:'+ h +'px" '
+			+ onload +' src="'+ this.src +'" ></iframe>';
+		this.ruler = this.body.getElementsByTagName('div')[0];
+		this.iframe = this.body.getElementsByTagName('iframe')[0];
+		
+		if (this.objectLoadTime == 'after') this.correctIframeSize();
+		
+	}
+	if (this.objectType == 'swf') {
+		this.body.id = this.body.id || 'hs-flash-id-' + this.key;
+		var a = this.swfOptions;
+		if (!a.params) a.params = {};
+		if (typeof a.params.wmode == 'undefined') a.params.wmode = 'transparent';
+		if (swfobject) swfobject.embedSWF(this.src, this.body.id, this.objectWidth, this.objectHeight, 
+			a.version || '7', a.expressInstallSwfurl, a.flashvars, a.params, a.attributes);
+	}
+	this.hasExtendedContent = true;
+},
+htmlGetSize : function() {
+	if (this.iframe && !this.objectHeight) { // loadtime before
+		this.iframe.style.height = this.body.style.height = this.getIframePageHeight() +'px';
+	}
+	this.innerContent.appendChild(hs.clearing);
+	if (!this.x.full) this.x.full = this.innerContent.offsetWidth;
+    this.y.full = this.innerContent.offsetHeight;
+    this.innerContent.removeChild(hs.clearing);
+    if (hs.ie && this.newHeight > parseInt(this.innerContent.currentStyle.height)) { // ie css bug
+		this.newHeight = parseInt(this.innerContent.currentStyle.height);
+	}
+	hs.setStyles( this.wrapper, { position: 'absolute',	padding: '0'});
+	hs.setStyles( this.content, { width: this.x.t +'px', height: this.y.t +'px'});
+	
+},
+
+getIframePageHeight : function() {
+	var h;
+	try {
+		var doc = this.iDoc = this.iframe.contentDocument || this.iframe.contentWindow.document;
+		var clearing = doc.createElement('div');
+		clearing.style.clear = 'both';
+		doc.body.appendChild(clearing);
+		h = clearing.offsetTop;
+		if (hs.ie) h += parseInt(doc.body.currentStyle.marginTop) 
+			+ parseInt(doc.body.currentStyle.marginBottom) - 1;
+	} catch (e) { // other domain
+		h = 300;
+	}
+	return h;
+},
+correctIframeSize : function () {
+	var wDiff = this.innerContent.offsetWidth - this.ruler.offsetWidth;
+	hs.discardElement(this.ruler);
+	if (wDiff < 0) wDiff = 0;
+	
+	var hDiff = this.innerContent.offsetHeight - this.iframe.offsetHeight;
+	if (this.iDoc && !this.objectHeight && !this.height && this.y.size == this.y.full) try {
+		this.iDoc.body.style.overflow = 'hidden';
+	} catch (e) {}
+	hs.setStyles(this.iframe, { 
+		width: Math.abs(this.x.size - wDiff) +'px', 
+		height: Math.abs(this.y.size - hDiff) +'px'
+	});
+    hs.setStyles(this.body, { 
+		width: this.iframe.style.width, 
+    	height: this.iframe.style.height
+	});
+    	
+    this.scrollingContent = this.iframe;
+    this.scrollerDiv = this.scrollingContent;
+	
+},
+htmlSizeOperations : function () {
+	
+	this.setObjContainerSize(this.innerContent);
+	
+	
+	if (this.objectType == 'swf' && this.objectLoadTime == 'before') this.writeExtendedContent();	
+	
+    // handle minimum size
+    if (this.x.size < this.x.full && !this.allowWidthReduction) this.x.size = this.x.full;
+    if (this.y.size < this.y.full && !this.allowHeightReduction) this.y.size = this.y.full;
+	this.scrollerDiv = this.innerContent;
+    hs.setStyles(this.mediumContent, { 
+		position: 'relative',
+		width: this.x.size +'px'
+	});
+    hs.setStyles(this.innerContent, { 
+    	border: 'none',
+    	width: 'auto',
+    	height: 'auto'
+    });
+	var node = hs.getElementByClass(this.innerContent, 'DIV', 'highslide-body');
+    if (node && !/(iframe|swf)/.test(this.objectType)) {
+    	var cNode = node; // wrap to get true size
+    	node = hs.createElement(cNode.nodeName, null, {overflow: 'hidden'}, null, true);
+    	cNode.parentNode.insertBefore(node, cNode);
+    	node.appendChild(hs.clearing); // IE6
+    	node.appendChild(cNode);
+    	
+    	var wDiff = this.innerContent.offsetWidth - node.offsetWidth;
+    	var hDiff = this.innerContent.offsetHeight - node.offsetHeight;
+		node.removeChild(hs.clearing);
+    	
+    	var kdeBugCorr = hs.safari || navigator.vendor == 'KDE' ? 1 : 0; // KDE repainting bug
+    	hs.setStyles(node, { 
+    			width: (this.x.size - wDiff - kdeBugCorr) +'px', 
+    			height: (this.y.size - hDiff) +'px',
+    			overflow: 'auto', 
+    			position: 'relative' 
+    		} 
+    	);
+		if (kdeBugCorr && cNode.offsetHeight > node.offsetHeight)	{
+    		node.style.width = (parseInt(node.style.width) + kdeBugCorr) + 'px';
+		}
+    	this.scrollingContent = node;
+    	this.scrollerDiv = this.scrollingContent;
+	}
+    if (this.iframe && this.objectLoadTime == 'before') this.correctIframeSize();
+    if (!this.scrollingContent && this.y.size < this.mediumContent.offsetHeight) this.scrollerDiv = this.content;
+	
+	if (this.scrollerDiv == this.content && !this.allowWidthReduction && !/(iframe|swf)/.test(this.objectType)) {
+		this.x.size += 17; // room for scrollbars
+	}
+	if (this.scrollerDiv && this.scrollerDiv.offsetHeight > this.scrollerDiv.parentNode.offsetHeight) {
+		setTimeout("try { hs.expanders["+ this.key +"].scrollerDiv.style.overflow = 'auto'; } catch(e) {}",
+			 hs.expandDuration);
+	}
+},
+
+justify : function (p, moveOnly) {
+	var tgtArr, tgt = p.target, dim = p == this.x ? 'x' : 'y';
+	
+		var hasMovedMin = false;
+		
+		var allowReduce = p.exp.allowSizeReduction;
+			p.pos = Math.round(p.pos - ((p.get('wsize') - p.t) / 2));
+		if (p.pos < p.scroll + p.marginMin) {
+			p.pos = p.scroll + p.marginMin;
+			hasMovedMin = true;		
+		}
+		if (!moveOnly && p.size < p.minSize) {
+			p.size = p.minSize;
+			allowReduce = false;
+		}
+		if (p.pos + p.get('wsize') > p.scroll + p.clientSize - p.marginMax) {
+			if (!moveOnly && hasMovedMin && allowReduce) {
+				p.size = Math.min(p.size, p.get(dim == 'y' ? 'fitsize' : 'maxsize'));
+			} else if (p.get('wsize') < p.get('fitsize')) {
+				p.pos = p.scroll + p.clientSize - p.marginMax - p.get('wsize');
+			} else { // image larger than viewport
+				p.pos = p.scroll + p.marginMin;
+				if (!moveOnly && allowReduce) p.size = p.get(dim == 'y' ? 'fitsize' : 'maxsize');
+			}			
+		}
+		
+		if (!moveOnly && p.size < p.minSize) {
+			p.size = p.minSize;
+			allowReduce = false;
+		}
+		
+	
+		
+	if (p.pos < p.marginMin) {
+		var tmpMin = p.pos;
+		p.pos = p.marginMin; 
+		
+		if (allowReduce && !moveOnly) p.size = p.size - (p.pos - tmpMin);
+		
+	}
+},
+
+correctRatio : function(ratio) {
+	var x = this.x, 
+		y = this.y,
+		changed = false,
+		xSize = Math.min(x.full, x.size),
+		ySize = Math.min(y.full, y.size),
+		useBox = (this.useBox || hs.padToMinWidth);
+	
+	if (xSize / ySize > ratio) { // width greater
+		xSize = ySize * ratio;
+		if (xSize < x.minSize) { // below minWidth
+			xSize = x.minSize;
+			ySize = xSize / ratio;
+		}
+		changed = true;
+	
+	} else if (xSize / ySize < ratio) { // height greater
+		ySize = xSize / ratio;
+		changed = true;
+	}
+	
+	if (hs.padToMinWidth && x.full < x.minSize) {
+		x.imgSize = x.full;
+		y.size = y.imgSize = y.full;
+	} else if (this.useBox) {
+		x.imgSize = xSize;
+		y.imgSize = ySize;
+	} else {
+		x.size = xSize;
+		y.size = ySize;
+	}
+	changed = this.fitOverlayBox(this.useBox ? null : ratio, changed);
+	if (useBox && y.size < y.imgSize) {
+		y.imgSize = y.size;
+		x.imgSize = y.size * ratio;
+	}
+	if (changed || useBox) {
+		x.pos = x.tpos - x.cb + x.tb;
+		x.minSize = x.size;
+		this.justify(x, true);
+	
+		y.pos = y.tpos - y.cb + y.tb;
+		y.minSize = y.size;
+		this.justify(y, true);
+		if (this.overlayBox) this.sizeOverlayBox();
+	}
+	
+	
+},
+fitOverlayBox : function(ratio, changed) {
+	var x = this.x, y = this.y;
+	if (this.overlayBox && (this.isImage || this.allowHeightReduction)) {
+		while (y.size > this.minHeight && x.size > this.minWidth 
+				&&  y.get('wsize') > y.get('fitsize')) {
+			y.size -= 10;
+			if (ratio) x.size = y.size * ratio;
+			this.sizeOverlayBox(0, 1);
+			changed = true;
+		}
+	}
+	return changed;
+},
+
+show : function () {
+	var x = this.x, y = this.y;
+	this.doShowHide('hidden');
+	
+	// Apply size change
+	this.changeSize(
+		1, {
+			wrapper: {
+				width : x.get('wsize'),
+				height : y.get('wsize'),
+				left: x.pos,
+				top: y.pos
+			},
+			content: {
+				left: x.p1 + x.get('imgPad'),
+				top: y.p1 + y.get('imgPad'),
+				width:x.imgSize ||x.size,
+				height:y.imgSize ||y.size
+			}
+		},
+		hs.expandDuration
+	);
+},
+
+changeSize : function(up, to, dur) {
+	
+	if (this.outline && !this.outlineWhileAnimating) {
+		if (up) this.outline.setPosition();
+		else this.outline.destroy(
+				(this.isHtml && this.preserveContent));
+	}
+	
+	
+	if (!up) this.destroyOverlays();
+	
+	var exp = this,
+		x = exp.x,
+		y = exp.y,
+		easing = this.easing;
+	if (!up) easing = this.easingClose || easing;
+	var after = up ?
+		function() {
+				
+			if (exp.outline) exp.outline.table.style.visibility = "visible";
+			setTimeout(function() {
+				exp.afterExpand();
+			}, 50);
+		} :
+		function() {
+			exp.afterClose();
+		};
+	if (up) hs.setStyles( this.wrapper, {
+		width: x.t +'px',
+		height: y.t +'px'
+	});
+	if (up && this.isHtml) {
+		hs.setStyles(this.wrapper, {
+			left: (x.tpos - x.cb + x.tb) +'px',
+			top: (y.tpos - y.cb + y.tb) +'px'
+		});
+	}
+	if (this.fadeInOut) {
+		hs.setStyles(this.wrapper, { opacity: up ? 0 : 1 });
+		hs.extend(to.wrapper, { opacity: up });
+	}
+	hs.animate( this.wrapper, to.wrapper, {
+		duration: dur,
+		easing: easing,
+		step: function(val, args) {
+			if (exp.outline && exp.outlineWhileAnimating && args.prop == 'top') {
+				var fac = up ? args.pos : 1 - args.pos;
+				var pos = {
+					w: x.t + (x.get('wsize') - x.t) * fac,
+					h: y.t + (y.get('wsize') - y.t) * fac,
+					x: x.tpos + (x.pos - x.tpos) * fac,
+					y: y.tpos + (y.pos - y.tpos) * fac
+				};
+				exp.outline.setPosition(pos, 0, 1);				
+			}
+			if (exp.isHtml) {	
+				if (args.prop == 'left') 
+					exp.mediumContent.style.left = (x.pos - val) +'px';
+				if (args.prop == 'top') 
+					exp.mediumContent.style.top = (y.pos - val) +'px';
+			}
+		}
+	});
+	hs.animate( this.content, to.content, dur, easing, after);
+	if (up) {
+		this.wrapper.style.visibility = 'visible';
+		this.content.style.visibility = 'visible';
+		if (this.isHtml) this.innerContent.style.visibility = 'visible';
+		this.a.className += ' highslide-active-anchor';
+	}
+},
+
+
+
+
+afterExpand : function() {
+	this.isExpanded = true;	
+	this.focus();
+	
+	if (this.isHtml && this.objectLoadTime == 'after') this.writeExtendedContent();
+	if (this.iframe) {
+		try {
+			var exp = this,
+				doc = this.iframe.contentDocument || this.iframe.contentWindow.document;
+			hs.addEventListener(doc, 'mousedown', function () {
+				if (hs.focusKey != exp.key) exp.focus();
+			});
+		} catch(e) {}
+		if (hs.ie && typeof this.isClosing != 'boolean') // first open 
+			this.iframe.style.width = (this.objectWidth - 1) +'px'; // hasLayout
+	}
+	if (hs.upcoming && hs.upcoming == this.a) hs.upcoming = null;
+	this.prepareNextOutline();
+	var p = hs.page, mX = hs.mouse.x + p.scrollLeft, mY = hs.mouse.y + p.scrollTop;
+	this.mouseIsOver = this.x.pos < mX && mX < this.x.pos + this.x.get('wsize')
+		&& this.y.pos < mY && mY < this.y.pos + this.y.get('wsize');	
+	if (this.overlayBox) this.showOverlays();
+	
+},
+
+
+prepareNextOutline : function() {
+	var key = this.key;
+	var outlineType = this.outlineType;
+	new hs.Outline(outlineType, 
+		function () { try { hs.expanders[key].preloadNext(); } catch (e) {} });
+},
+
+
+preloadNext : function() {
+	var next = this.getAdjacentAnchor(1);
+	if (next && next.onclick.toString().match(/hs\.expand/)) 
+		var img = hs.createElement('img', { src: hs.getSrc(next) });
+},
+
+
+getAdjacentAnchor : function(op) {
+	var current = this.getAnchorIndex(), as = hs.anchors.groups[this.slideshowGroup || 'none'];
+	return (as && as[current + op]) || null;
+},
+
+getAnchorIndex : function() {
+	var arr = hs.getAnchors().groups[this.slideshowGroup || 'none'];
+	if (arr) for (var i = 0; i < arr.length; i++) {
+		if (arr[i] == this.a) return i; 
+	}
+	return null;
+},
+
+
+cancelLoading : function() {
+	hs.discardElement (this.wrapper);
+	hs.expanders[this.key] = null;
+	if (this.loading) hs.loading.style.left = '-9999px';
+},
+
+writeCredits : function () {
+	this.credits = hs.createElement('a', {
+		href: hs.creditsHref,
+		target: hs.creditsTarget,
+		className: 'highslide-credits',
+		innerHTML: hs.lang.creditsText,
+		title: hs.lang.creditsTitle
+	});
+	this.createOverlay({ 
+		overlayId: this.credits, 
+		position: this.creditsPosition || 'top left' 
+	});
+},
+
+getInline : function(types, addOverlay) {
+	for (var i = 0; i < types.length; i++) {
+		var type = types[i], s = null;
+		if (!this[type +'Id'] && this.thumbsUserSetId)  
+			this[type +'Id'] = type +'-for-'+ this.thumbsUserSetId;
+		if (this[type +'Id']) this[type] = hs.getNode(this[type +'Id']);
+		if (!this[type] && !this[type +'Text'] && this[type +'Eval']) try {
+			s = eval(this[type +'Eval']);
+		} catch (e) {}
+		if (!this[type] && this[type +'Text']) {
+			s = this[type +'Text'];
+		}
+		if (!this[type] && !s) {
+			this[type] = hs.getNode(this.a['_'+ type + 'Id']);
+			if (!this[type]) {
+				var next = this.a.nextSibling;
+				while (next && !hs.isHsAnchor(next)) {
+					if ((new RegExp('highslide-'+ type)).test(next.className || null)) {
+						if (!next.id) this.a['_'+ type + 'Id'] = next.id = 'hsId'+ hs.idCounter++;
+						this[type] = hs.getNode(next.id);
+						break;
+					}
+					next = next.nextSibling;
+				}
+			}
+		}
+		
+		if (!this[type] && s) this[type] = hs.createElement('div', 
+				{ className: 'highslide-'+ type, innerHTML: s } );
+		
+		if (addOverlay && this[type]) {
+			var o = { position: (type == 'heading') ? 'above' : 'below' };
+			for (var x in this[type+'Overlay']) o[x] = this[type+'Overlay'][x];
+			o.overlayId = this[type];
+			this.createOverlay(o);
+		}
+	}
+},
+
+
+// on end move and resize
+doShowHide : function(visibility) {
+	if (hs.hideSelects) this.showHideElements('SELECT', visibility);
+	if (hs.hideIframes) this.showHideElements('IFRAME', visibility);
+	if (hs.geckoMac) this.showHideElements('*', visibility);
+},
+showHideElements : function (tagName, visibility) {
+	var els = document.getElementsByTagName(tagName);
+	var prop = tagName == '*' ? 'overflow' : 'visibility';
+	for (var i = 0; i < els.length; i++) {
+		if (prop == 'visibility' || (document.defaultView.getComputedStyle(
+				els[i], "").getPropertyValue('overflow') == 'auto'
+				|| els[i].getAttribute('hidden-by') != null)) {
+			var hiddenBy = els[i].getAttribute('hidden-by');
+			if (visibility == 'visible' && hiddenBy) {
+				hiddenBy = hiddenBy.replace('['+ this.key +']', '');
+				els[i].setAttribute('hidden-by', hiddenBy);
+				if (!hiddenBy) els[i].style[prop] = els[i].origProp;
+			} else if (visibility == 'hidden') { // hide if behind
+				var elPos = hs.getPosition(els[i]);
+				elPos.w = els[i].offsetWidth;
+				elPos.h = els[i].offsetHeight;
+			
+				
+					var clearsX = (elPos.x + elPos.w < this.x.get('opos') 
+						|| elPos.x > this.x.get('opos') + this.x.get('osize'));
+					var clearsY = (elPos.y + elPos.h < this.y.get('opos') 
+						|| elPos.y > this.y.get('opos') + this.y.get('osize'));
+				var wrapperKey = hs.getWrapperKey(els[i]);
+				if (!clearsX && !clearsY && wrapperKey != this.key) { // element falls behind image
+					if (!hiddenBy) {
+						els[i].setAttribute('hidden-by', '['+ this.key +']');
+						els[i].origProp = els[i].style[prop];
+						els[i].style[prop] = 'hidden';
+						
+					} else if (hiddenBy.indexOf('['+ this.key +']') == -1) {
+						els[i].setAttribute('hidden-by', hiddenBy + '['+ this.key +']');
+					}
+				} else if ((hiddenBy == '['+ this.key +']' || hs.focusKey == wrapperKey)
+						&& wrapperKey != this.key) { // on move
+					els[i].setAttribute('hidden-by', '');
+					els[i].style[prop] = els[i].origProp || '';
+				} else if (hiddenBy && hiddenBy.indexOf('['+ this.key +']') > -1) {
+					els[i].setAttribute('hidden-by', hiddenBy.replace('['+ this.key +']', ''));
+				}
+						
+			}
+		}
+	}
+},
+
+focus : function() {
+	this.wrapper.style.zIndex = hs.zIndexCounter += 2;
+	// blur others
+	for (var i = 0; i < hs.expanders.length; i++) {
+		if (hs.expanders[i] && i == hs.focusKey) {
+			var blurExp = hs.expanders[i];
+			blurExp.content.className += ' highslide-'+ blurExp.contentType +'-blur';
+			if (blurExp.isImage) {
+				blurExp.content.style.cursor = hs.ieLt7 ? 'hand' : 'pointer';
+				blurExp.content.title = hs.lang.focusTitle;	
+			}
+		}
+	}
+	
+	// focus this
+	if (this.outline) this.outline.table.style.zIndex 
+		= this.wrapper.style.zIndex - 1;
+	this.content.className = 'highslide-'+ this.contentType;
+	if (this.isImage) {
+		this.content.title = hs.lang.restoreTitle;
+		
+		if (hs.restoreCursor) {
+			hs.styleRestoreCursor = window.opera ? 'pointer' : 'url('+ hs.graphicsDir + hs.restoreCursor +'), pointer';
+			if (hs.ieLt7 && hs.uaVersion < 6) hs.styleRestoreCursor = 'hand';
+			this.content.style.cursor = hs.styleRestoreCursor;
+		}
+	}
+	hs.focusKey = this.key;	
+	hs.addEventListener(document, window.opera ? 'keypress' : 'keydown', hs.keyHandler);	
+},
+moveTo: function(x, y) {
+	this.x.setPos(x);
+	this.y.setPos(y);
+},
+resize : function (e) {
+	var w, h, r = e.width / e.height;
+	w = Math.max(e.width + e.dX, Math.min(this.minWidth, this.x.full));
+	if (this.isImage && Math.abs(w - this.x.full) < 12) w = this.x.full;
+	h = this.isHtml ? e.height + e.dY : w / r;
+	if (h < Math.min(this.minHeight, this.y.full)) {
+		h = Math.min(this.minHeight, this.y.full);
+		if (this.isImage) w = h * r;
+	}
+	this.resizeTo(w, h);
+},
+resizeTo: function(w, h) {
+	this.y.setSize(h);
+	this.x.setSize(w);
+	this.wrapper.style.height = this.y.get('wsize') +'px';
+},
+
+close : function() {
+	if (this.isClosing || !this.isExpanded) return;
+	this.isClosing = true;
+	
+	hs.removeEventListener(document, window.opera ? 'keypress' : 'keydown', hs.keyHandler);
+	
+	try {
+		if (this.isHtml) this.htmlPrepareClose();
+		this.content.style.cursor = 'default';
+		this.changeSize(
+			0, {
+				wrapper: {
+					width : this.x.t,
+					height : this.y.t,
+					left: this.x.tpos - this.x.cb + this.x.tb,
+					top: this.y.tpos - this.y.cb + this.y.tb
+				},
+				content: {
+					left: 0,
+					top: 0,
+					width: this.x.t,
+					height: this.y.t
+				}
+			}, hs.restoreDuration
+		);
+	} catch (e) { this.afterClose(); }
+},
+
+htmlPrepareClose : function() {
+	if (hs.geckoMac) { // bad redraws
+		if (!hs.mask) hs.mask = hs.createElement('div', null, 
+			{ position: 'absolute' }, hs.container);
+		hs.setStyles(hs.mask, { width: this.x.size +'px', height: this.y.size +'px', 
+			left: this.x.pos +'px', top: this.y.pos +'px', display: 'block' });			
+	}
+	if (this.objectType == 'swf') try { hs.$(this.body.id).StopPlay(); } catch (e) {}
+	
+	if (this.objectLoadTime == 'after' && !this.preserveContent) this.destroyObject();		
+	if (this.scrollerDiv && this.scrollerDiv != this.scrollingContent) 
+		this.scrollerDiv.style.overflow = 'hidden';
+},
+
+destroyObject : function () {
+	if (hs.ie && this.iframe)
+		try { this.iframe.contentWindow.document.body.innerHTML = ''; } catch (e) {}
+	if (this.objectType == 'swf') swfobject.removeSWF(this.body.id);
+	this.body.innerHTML = '';
+},
+
+sleep : function() {
+	if (this.outline) this.outline.table.style.display = 'none';
+	this.releaseMask = null;
+	this.wrapper.style.display = 'none';
+	this.isExpanded = false;
+	hs.push(hs.sleeping, this);
+},
+
+awake : function() {try {
+	
+	hs.expanders[this.key] = this;
+	
+	if (!hs.allowMultipleInstances &&hs.focusKey != this.key) {	
+		try { hs.expanders[hs.focusKey].close(); } catch (e){}
+	}
+	
+	var z = hs.zIndexCounter++, stl = { display: '', zIndex: z };
+	hs.setStyles (this.wrapper, stl);
+	this.isClosing = false;
+	
+	var o = this.outline || 0;
+	if (o) {
+		if (!this.outlineWhileAnimating) stl.visibility = 'hidden';
+		hs.setStyles (o.table, stl);		
+	}
+		
+	this.show();
+} catch (e) {}
+
+
+},
+
+createOverlay : function (o) {
+	var el = o.overlayId;
+	if (typeof el == 'string') el = hs.getNode(el);
+	if (o.html) el = hs.createElement('div', { innerHTML: o.html });
+	if (!el || typeof el == 'string') return;
+	el.style.display = 'block';
+	this.genOverlayBox();
+	var width = o.width && /^[0-9]+(px|%)$/.test(o.width) ? o.width : 'auto';
+	if (/^(left|right)panel$/.test(o.position) && !/^[0-9]+px$/.test(o.width)) width = '200px';
+	var overlay = hs.createElement(
+		'div', {
+			id: 'hsId'+ hs.idCounter++,
+			hsId: o.hsId
+		}, {
+			position: 'absolute',
+			visibility: 'hidden',
+			width: width,
+			direction: hs.lang.cssDirection || '',
+			opacity: 0
+		},this.overlayBox,
+		true
+	);
+	
+	overlay.appendChild(el);
+	hs.extend(overlay, {
+		opacity: 1,
+		offsetX: 0,
+		offsetY: 0,
+		dur: (o.fade === 0 || o.fade === false || (o.fade == 2 && hs.ie)) ? 0 : 250
+	});
+	hs.extend(overlay, o);
+	
+		
+	if (this.gotOverlays) {
+		this.positionOverlay(overlay);
+		if (!overlay.hideOnMouseOut || this.mouseIsOver) 
+			hs.animate(overlay, { opacity: overlay.opacity }, overlay.dur);
+	}
+	hs.push(this.overlays, hs.idCounter - 1);
+},
+positionOverlay : function(overlay) {
+	var p = overlay.position || 'middle center',
+		offX = overlay.offsetX,
+		offY = overlay.offsetY;
+	if (overlay.parentNode != this.overlayBox) this.overlayBox.appendChild(overlay);
+	if (/left$/.test(p)) overlay.style.left = offX +'px'; 
+	
+	if (/center$/.test(p))	hs.setStyles (overlay, { 
+		left: '50%',
+		marginLeft: (offX - Math.round(overlay.offsetWidth / 2)) +'px'
+	});	
+	
+	if (/right$/.test(p)) overlay.style.right = - offX +'px';
+		
+	if (/^leftpanel$/.test(p)) { 
+		hs.setStyles(overlay, {
+			right: '100%',
+			marginRight: this.x.cb +'px',
+			top: - this.y.cb +'px',
+			bottom: - this.y.cb +'px',
+			overflow: 'auto'
+		});		 
+		this.x.p1 = overlay.offsetWidth;
+	
+	} else if (/^rightpanel$/.test(p)) {
+		hs.setStyles(overlay, {
+			left: '100%',
+			marginLeft: this.x.cb +'px',
+			top: - this.y.cb +'px',
+			bottom: - this.y.cb +'px',
+			overflow: 'auto'
+		});
+		this.x.p2 = overlay.offsetWidth;
+	}
+
+	if (/^top/.test(p)) overlay.style.top = offY +'px'; 
+	if (/^middle/.test(p))	hs.setStyles (overlay, { 
+		top: '50%', 
+		marginTop: (offY - Math.round(overlay.offsetHeight / 2)) +'px'
+	});	
+	if (/^bottom/.test(p)) overlay.style.bottom = - offY +'px';
+	if (/^above$/.test(p)) {
+		hs.setStyles(overlay, {
+			left: (- this.x.p1 - this.x.cb) +'px',
+			right: (- this.x.p2 - this.x.cb) +'px',
+			bottom: '100%',
+			marginBottom: this.y.cb +'px',
+			width: 'auto'
+		});
+		this.y.p1 = overlay.offsetHeight;
+	
+	} else if (/^below$/.test(p)) {
+		hs.setStyles(overlay, {
+			position: 'relative',
+			left: (- this.x.p1 - this.x.cb) +'px',
+			right: (- this.x.p2 - this.x.cb) +'px',
+			top: '100%',
+			marginTop: this.y.cb +'px',
+			width: 'auto'
+		});
+		this.y.p2 = overlay.offsetHeight;
+		overlay.style.position = 'absolute';
+	}
+},
+
+getOverlays : function() {	
+	this.getInline(['heading', 'caption'], true);
+	if (this.heading && this.dragByHeading) this.heading.className += ' highslide-move';
+	if (hs.showCredits) this.writeCredits();
+	for (var i = 0; i < hs.overlays.length; i++) {
+		var o = hs.overlays[i], tId = o.thumbnailId, sg = o.slideshowGroup;
+		if ((!tId && !sg) || (tId && tId == this.thumbsUserSetId)
+				|| (sg && sg === this.slideshowGroup)) {
+			if (this.isImage || (this.isHtml && o.useOnHtml))
+			this.createOverlay(o);
+		}
+	}
+	var os = [];
+	for (var i = 0; i < this.overlays.length; i++) {
+		var o = hs.$('hsId'+ this.overlays[i]);
+		if (/panel$/.test(o.position)) this.positionOverlay(o);
+		else hs.push(os, o);
+	}
+	for (var i = 0; i < os.length; i++) this.positionOverlay(os[i]);
+	this.gotOverlays = true;
+},
+genOverlayBox : function() {
+	if (!this.overlayBox) this.overlayBox = hs.createElement (
+		'div', {
+			className: this.wrapperClassName
+		}, {
+			position : 'absolute',
+			width: (this.x.size || (this.useBox ? this.width : null) 
+				|| this.x.full) +'px',
+			height: (this.y.size || this.y.full) +'px',
+			visibility : 'hidden',
+			overflow : 'hidden',
+			zIndex : hs.ie ? 4 : 'auto'
+		},
+		hs.container,
+		true
+	);
+},
+sizeOverlayBox : function(doWrapper, doPanels) {
+	var overlayBox = this.overlayBox, 
+		x = this.x,
+		y = this.y;
+	hs.setStyles( overlayBox, {
+		width: x.size +'px', 
+		height: y.size +'px'
+	});
+	if (doWrapper || doPanels) {
+		for (var i = 0; i < this.overlays.length; i++) {
+			var o = hs.$('hsId'+ this.overlays[i]);
+			var ie6 = (hs.ieLt7 || document.compatMode == 'BackCompat');
+			if (o && /^(above|below)$/.test(o.position)) {
+				if (ie6) {
+					o.style.width = (overlayBox.offsetWidth + 2 * x.cb
+						+ x.p1 + x.p2) +'px';
+				}
+				y[o.position == 'above' ? 'p1' : 'p2'] = o.offsetHeight;
+			}
+			if (o && ie6 && /^(left|right)panel$/.test(o.position)) {
+				o.style.height = (overlayBox.offsetHeight + 2* y.cb) +'px';
+			}
+		}
+	}
+	if (doWrapper) {
+		hs.setStyles(this.content, {
+			top: y.p1 +'px'
+		});
+		hs.setStyles(overlayBox, {
+			top: (y.p1 + y.cb) +'px'
+		});
+	}
+},
+
+showOverlays : function() {
+	var b = this.overlayBox;
+	b.className = '';
+	hs.setStyles(b, {
+		top: (this.y.p1 + this.y.cb) +'px',
+		left: (this.x.p1 + this.x.cb) +'px',
+		overflow : 'visible'
+	});
+	if (hs.safari) b.style.visibility = 'visible';
+	this.wrapper.appendChild (b);
+	for (var i = 0; i < this.overlays.length; i++) {
+		var o = hs.$('hsId'+ this.overlays[i]);
+		o.style.zIndex = o.zIndex || 4;
+		if (!o.hideOnMouseOut || this.mouseIsOver) {
+			o.style.visibility = 'visible';
+			hs.setStyles(o, { visibility: 'visible', display: '' });
+			hs.animate(o, { opacity: o.opacity }, o.dur);
+		}
+	}
+},
+
+destroyOverlays : function() {
+	if (!this.overlays.length) return;
+	if (this.isHtml && this.preserveContent) {
+		this.overlayBox.style.top = '-9999px';
+		hs.container.appendChild(this.overlayBox);
+	} else
+	hs.discardElement(this.overlayBox);
+},
+
+
+
+createFullExpand : function () {
+	this.fullExpandLabel = hs.createElement(
+		'a', {
+			href: 'javascript:hs.expanders['+ this.key +'].doFullExpand();',
+			title: hs.lang.fullExpandTitle,
+			className: 'highslide-full-expand'
+		}
+	);
+	
+	this.createOverlay({ 
+		overlayId: this.fullExpandLabel, 
+		position: hs.fullExpandPosition, 
+		hideOnMouseOut: true, 
+		opacity: hs.fullExpandOpacity
+	});
+},
+
+doFullExpand : function () {
+	try {
+		if (this.fullExpandLabel) hs.discardElement(this.fullExpandLabel);
+		
+		this.focus();
+		var xSize = this.x.size,
+        	ySize = this.y.size;
+        this.resizeTo(this.x.full, this.y.full);
+       
+        var xpos = this.x.pos - (this.x.size - xSize) / 2;
+        if (xpos < hs.marginLeft) xpos = hs.marginLeft;
+       
+        var ypos = this.y.pos - (this.y.size - ySize) / 2;
+        if (ypos < hs.marginTop) ypos = hs.marginTop;
+       
+        this.moveTo(xpos, ypos);
+		this.doShowHide('hidden');
+	
+	} catch (e) {
+		this.error(e);
+	}
+},
+
+
+afterClose : function () {
+	this.a.className = this.a.className.replace('highslide-active-anchor', '');
+	
+	this.doShowHide('visible');	
+	
+	if (this.isHtml && this.preserveContent) {
+		this.sleep();
+	} else {
+		if (this.outline && this.outlineWhileAnimating) this.outline.destroy();
+	
+		hs.discardElement(this.wrapper);
+	}
+	if (hs.mask) hs.mask.style.display = 'none';
+	
+	hs.expanders[this.key] = null;		
+	hs.reOrder();
+}
+
+};
+
+
+// hs.Ajax object prototype
+hs.Ajax = function (a, content, pre) {
+	this.a = a;
+	this.content = content;
+	this.pre = pre;
+};
+
+hs.Ajax.prototype = {
+run : function () {
+	var xhr;
+	if (!this.src) this.src = hs.getSrc(this.a);
+	if (this.src.match('#')) {
+		var arr = this.src.split('#');
+		this.src = arr[0];
+		this.id = arr[1];
+	}
+	if (hs.cachedGets[this.src]) {
+		this.cachedGet = hs.cachedGets[this.src];
+		if (this.id) this.getElementContent();
+		else this.loadHTML();
+		return;
+	}
+	try { xhr = new XMLHttpRequest(); }
+	catch (e) {
+		try { xhr = new ActiveXObject("Msxml2.XMLHTTP"); }
+		catch (e) {
+			try { xhr = new ActiveXObject("Microsoft.XMLHTTP"); }
+			catch (e) { this.onError(); }
+		}
+	}
+	var pThis = this; 
+	xhr.onreadystatechange = function() {
+		if(pThis.xhr.readyState == 4) {
+			if (pThis.id) pThis.getElementContent();
+			else pThis.loadHTML();
+		}
+	};
+	var src = this.src;
+	this.xhr = xhr;
+	if (hs.forceAjaxReload) 
+		src = src.replace(/$/, (/\?/.test(src) ? '&' : '?') +'dummy='+ (new Date()).getTime());
+	xhr.open('GET', src, true);
+	xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
+	xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
+	xhr.send(null);
+},
+
+getElementContent : function() {
+	hs.init();
+	var attribs = window.opera || hs.ie6SSL ? { src: 'about:blank' } : null;
+	
+	this.iframe = hs.createElement('iframe', attribs, 
+		{ position: 'absolute', top: '-9999px' }, hs.container);
+		
+	this.loadHTML();
+},
+
+loadHTML : function() {
+	var s = this.cachedGet || this.xhr.responseText,
+		regBody;
+	if (this.pre) hs.cachedGets[this.src] = s;
+	if (!hs.ie || hs.uaVersion >= 5.5) {
+		s = s.replace(new RegExp('<link[^>]*>', 'gi'), '')
+			.replace(new RegExp('<script[^>]*>.*?</script>', 'gi'), '');
+		if (this.iframe) {
+			var doc = this.iframe.contentDocument;
+			if (!doc && this.iframe.contentWindow) doc = this.iframe.contentWindow.document;
+			if (!doc) { // Opera
+				var pThis = this;
+				setTimeout(function() {	pThis.loadHTML(); }, 25);
+				return;
+			}
+			doc.open();
+			doc.write(s);
+			doc.close();
+			try { s = doc.getElementById(this.id).innerHTML; } catch (e) {
+				try { s = this.iframe.document.getElementById(this.id).innerHTML; } catch (e) {} // opera
+			}
+			hs.discardElement(this.iframe);
+		} else {
+			regBody = /(<body[^>]*>|<\/body>)/ig;
+			if (regBody.test(s)) s = s.split(regBody)[hs.ieLt9 ? 1 : 2];
+			
+		}
+	}
+	hs.getElementByClass(this.content, 'DIV', 'highslide-body').innerHTML = s;
+	this.onLoad();
+	for (var x in this) this[x] = null;
+}
+};
+hs.langDefaults = hs.lang;
+// history
+var HsExpander = hs.Expander;
+if (hs.ie && window == window.top) {
+	(function () {
+		try {
+			document.documentElement.doScroll('left');
+		} catch (e) {
+			setTimeout(arguments.callee, 50);
+			return;
+		}
+		hs.ready();
+	})();
+}
+hs.addEventListener(document, 'DOMContentLoaded', hs.ready);
+hs.addEventListener(window, 'load', hs.ready);
+
+// set handlers
+hs.addEventListener(document, 'ready', function() {
+	if (hs.expandCursor) {
+		var style = hs.createElement('style', { type: 'text/css' }, null, 
+			document.getElementsByTagName('HEAD')[0]), 
+			backCompat = document.compatMode == 'BackCompat';
+			
+		
+		function addRule(sel, dec) {
+			if (hs.ie && (hs.uaVersion < 9 || backCompat)) {
+				var last = document.styleSheets[document.styleSheets.length - 1];
+				if (typeof(last.addRule) == "object") last.addRule(sel, dec);
+			} else {
+				style.appendChild(document.createTextNode(sel + " {" + dec + "}"));
+			}
+		}
+		function fix(prop) {
+			return 'expression( ( ( ignoreMe = document.documentElement.'+ prop +
+				' ? document.documentElement.'+ prop +' : document.body.'+ prop +' ) ) + \'px\' );';
+		}
+		if (hs.expandCursor) addRule ('.highslide img', 
+			'cursor: url('+ hs.graphicsDir + hs.expandCursor +'), pointer !important;');
+	}
+});
+hs.addEventListener(window, 'resize', function() {
+	hs.getPageSize();
+});
+hs.addEventListener(document, 'mousemove', function(e) {
+	hs.mouse = { x: e.clientX, y: e.clientY	};
+});
+hs.addEventListener(document, 'mousedown', hs.mouseClickHandler);
+hs.addEventListener(document, 'mouseup', hs.mouseClickHandler);
+
+hs.addEventListener(document, 'ready', hs.getAnchors);
+hs.addEventListener(window, 'load', hs.preloadImages);
+hs.addEventListener(window, 'load', hs.preloadAjax);
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide-with-html.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide-with-html.min.js
new file mode 100644
index 0000000000000000000000000000000000000000..aa2119ff6b75124663e973ffdf206114a3b538e8
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide-with-html.min.js
@@ -0,0 +1,9 @@
+/** 
+ * Name:    Highslide JS
+ * Version: 4.1.13 (2011-10-06)
+ * Config:  default +inline +ajax +iframe +flash
+ * Author:  Torstein Hønsi
+ * Support: www.highslide.com/support
+ * License: www.highslide.com/#license
+ */
+if(!hs){var hs={lang:{cssDirection:"ltr",loadingText:"Loading...",loadingTitle:"Click to cancel",focusTitle:"Click to bring to front",fullExpandTitle:"Expand to actual size (f)",creditsText:"Powered by <i>Highslide JS</i>",creditsTitle:"Go to the Highslide JS homepage",previousText:"Previous",nextText:"Next",moveText:"Move",closeText:"Close",closeTitle:"Close (esc)",resizeTitle:"Resize",playText:"Play",playTitle:"Play slideshow (spacebar)",pauseText:"Pause",pauseTitle:"Pause slideshow (spacebar)",previousTitle:"Previous (arrow left)",nextTitle:"Next (arrow right)",moveTitle:"Move",fullExpandText:"1:1",restoreTitle:"Click to close image, click and drag to move. Use arrow keys for next and previous."},graphicsDir:"highslide/graphics/",expandCursor:"zoomin.cur",restoreCursor:"zoomout.cur",expandDuration:250,restoreDuration:250,marginLeft:15,marginRight:15,marginTop:15,marginBottom:15,zIndexCounter:1001,loadingOpacity:0.75,allowMultipleInstances:true,numberOfImagesToPreload:5,outlineWhileAnimating:2,outlineStartOffset:3,padToMinWidth:false,fullExpandPosition:"bottom right",fullExpandOpacity:1,showCredits:true,creditsHref:"http://highslide.com/",creditsTarget:"_self",enableKeyListener:true,openerTagNames:["a"],allowWidthReduction:false,allowHeightReduction:true,preserveContent:true,objectLoadTime:"before",cacheAjax:true,dragByHeading:true,minWidth:200,minHeight:200,allowSizeReduction:true,outlineType:"drop-shadow",skin:{contentWrapper:'<div class="highslide-header"><ul><li class="highslide-previous"><a href="#" title="{hs.lang.previousTitle}" onclick="return hs.previous(this)"><span>{hs.lang.previousText}</span></a></li><li class="highslide-next"><a href="#" title="{hs.lang.nextTitle}" onclick="return hs.next(this)"><span>{hs.lang.nextText}</span></a></li><li class="highslide-move"><a href="#" title="{hs.lang.moveTitle}" onclick="return false"><span>{hs.lang.moveText}</span></a></li><li class="highslide-close"><a href="#" title="{hs.lang.closeTitle}" onclick="return hs.close(this)"><span>{hs.lang.closeText}</span></a></li></ul></div><div class="highslide-body"></div><div class="highslide-footer"><div><span class="highslide-resize" title="{hs.lang.resizeTitle}"><span></span></span></div></div>'},preloadTheseImages:[],continuePreloading:true,expanders:[],overrides:["allowSizeReduction","useBox","outlineType","outlineWhileAnimating","captionId","captionText","captionEval","captionOverlay","headingId","headingText","headingEval","headingOverlay","creditsPosition","dragByHeading","width","height","contentId","allowWidthReduction","allowHeightReduction","preserveContent","maincontentId","maincontentText","maincontentEval","objectType","cacheAjax","objectWidth","objectHeight","objectLoadTime","swfOptions","wrapperClassName","minWidth","minHeight","maxWidth","maxHeight","pageOrigin","slideshowGroup","easing","easingClose","fadeInOut","src"],overlays:[],idCounter:0,oPos:{x:["leftpanel","left","center","right","rightpanel"],y:["above","top","middle","bottom","below"]},mouse:{},headingOverlay:{},captionOverlay:{},swfOptions:{flashvars:{},params:{},attributes:{}},timers:[],pendingOutlines:{},sleeping:[],preloadTheseAjax:[],cacheBindings:[],cachedGets:{},clones:{},onReady:[],uaVersion:/Trident\/4\.0/.test(navigator.userAgent)?8:parseFloat((navigator.userAgent.toLowerCase().match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1]),ie:(document.all&&!window.opera),safari:/Safari/.test(navigator.userAgent),geckoMac:/Macintosh.+rv:1\.[0-8].+Gecko/.test(navigator.userAgent),$:function(a){if(a){return document.getElementById(a)}},push:function(a,b){a[a.length]=b},createElement:function(a,f,e,d,c){var b=document.createElement(a);if(f){hs.extend(b,f)}if(c){hs.setStyles(b,{padding:0,border:"none",margin:0})}if(e){hs.setStyles(b,e)}if(d){d.appendChild(b)}return b},extend:function(b,c){for(var a in c){b[a]=c[a]}return b},setStyles:function(b,c){for(var a in c){if(hs.ieLt9&&a=="opacity"){if(c[a]>0.99){b.style.removeAttribute("filter")}else{b.style.filter="alpha(opacity="+(c[a]*100)+")"}}else{b.style[a]=c[a]}}},animate:function(f,a,d){var c,g,j;if(typeof d!="object"||d===null){var i=arguments;d={duration:i[2],easing:i[3],complete:i[4]}}if(typeof d.duration!="number"){d.duration=250}d.easing=Math[d.easing]||Math.easeInQuad;d.curAnim=hs.extend({},a);for(var b in a){var h=new hs.fx(f,d,b);c=parseFloat(hs.css(f,b))||0;g=parseFloat(a[b]);j=b!="opacity"?"px":"";h.custom(c,g,j)}},css:function(a,c){if(a.style[c]){return a.style[c]}else{if(document.defaultView){return document.defaultView.getComputedStyle(a,null).getPropertyValue(c)}else{if(c=="opacity"){c="filter"}var b=a.currentStyle[c.replace(/\-(\w)/g,function(e,d){return d.toUpperCase()})];if(c=="filter"){b=b.replace(/alpha\(opacity=([0-9]+)\)/,function(e,d){return d/100})}return b===""?1:b}}},getPageSize:function(){var f=document,b=window,e=f.compatMode&&f.compatMode!="BackCompat"?f.documentElement:f.body,g=hs.ie&&(hs.uaVersion<9||typeof pageXOffset=="undefined");var c=g?e.clientWidth:(f.documentElement.clientWidth||self.innerWidth),a=g?e.clientHeight:self.innerHeight;hs.page={width:c,height:a,scrollLeft:g?e.scrollLeft:pageXOffset,scrollTop:g?e.scrollTop:pageYOffset};return hs.page},getPosition:function(a){var b={x:a.offsetLeft,y:a.offsetTop};while(a.offsetParent){a=a.offsetParent;b.x+=a.offsetLeft;b.y+=a.offsetTop;if(a!=document.body&&a!=document.documentElement){b.x-=a.scrollLeft;b.y-=a.scrollTop}}return b},expand:function(b,h,f,d){if(!b){b=hs.createElement("a",null,{display:"none"},hs.container)}if(typeof b.getParams=="function"){return h}if(d=="html"){for(var c=0;c<hs.sleeping.length;c++){if(hs.sleeping[c]&&hs.sleeping[c].a==b){hs.sleeping[c].awake();hs.sleeping[c]=null;return false}}hs.hasHtmlExpanders=true}try{new hs.Expander(b,h,f,d);return false}catch(g){return true}},htmlExpand:function(b,d,c){return hs.expand(b,d,c,"html")},getSelfRendered:function(){return hs.createElement("div",{className:"highslide-html-content",innerHTML:hs.replaceLang(hs.skin.contentWrapper)})},getElementByClass:function(e,c,d){var b=e.getElementsByTagName(c);for(var a=0;a<b.length;a++){if((new RegExp(d)).test(b[a].className)){return b[a]}}return null},replaceLang:function(c){c=c.replace(/\s/g," ");var b=/{hs\.lang\.([^}]+)\}/g,d=c.match(b),e;if(d){for(var a=0;a<d.length;a++){e=d[a].replace(b,"$1");if(typeof hs.lang[e]!="undefined"){c=c.replace(d[a],hs.lang[e])}}}return c},getCacheBinding:function(b){for(var d=0;d<hs.cacheBindings.length;d++){if(hs.cacheBindings[d][0]==b){var e=hs.cacheBindings[d][1];hs.cacheBindings[d][1]=e.cloneNode(1);return e}}return null},preloadAjax:function(f){var b=hs.getAnchors();for(var d=0;d<b.htmls.length;d++){var c=b.htmls[d];if(hs.getParam(c,"objectType")=="ajax"&&hs.getParam(c,"cacheAjax")){hs.push(hs.preloadTheseAjax,c)}}hs.preloadAjaxElement(0)},preloadAjaxElement:function(d){if(!hs.preloadTheseAjax[d]){return}var b=hs.preloadTheseAjax[d];var c=hs.getNode(hs.getParam(b,"contentId"));if(!c){c=hs.getSelfRendered()}var e=new hs.Ajax(b,c,1);e.onError=function(){};e.onLoad=function(){hs.push(hs.cacheBindings,[b,c]);hs.preloadAjaxElement(d+1)};e.run()},focusTopmost:function(){var c=0,b=-1,a=hs.expanders,e,f;for(var d=0;d<a.length;d++){e=a[d];if(e){f=e.wrapper.style.zIndex;if(f&&f>c){c=f;b=d}}}if(b==-1){hs.focusKey=-1}else{a[b].focus()}},getParam:function(b,d){b.getParams=b.onclick;var c=b.getParams?b.getParams():null;b.getParams=null;return(c&&typeof c[d]!="undefined")?c[d]:(typeof hs[d]!="undefined"?hs[d]:null)},getSrc:function(b){var c=hs.getParam(b,"src");if(c){return c}return b.href},getNode:function(e){var c=hs.$(e),d=hs.clones[e],b={};if(!c&&!d){return null}if(!d){d=c.cloneNode(true);d.id="";hs.clones[e]=d;return c}else{return d.cloneNode(true)}},discardElement:function(a){if(a){hs.garbageBin.appendChild(a)}hs.garbageBin.innerHTML=""},transit:function(a,d){var b=d||hs.getExpander();d=b;if(hs.upcoming){return false}else{hs.last=b}hs.removeEventListener(document,window.opera?"keypress":"keydown",hs.keyHandler);try{hs.upcoming=a;a.onclick()}catch(c){hs.last=hs.upcoming=null}try{d.close()}catch(c){}return false},previousOrNext:function(a,c){var b=hs.getExpander(a);if(b){return hs.transit(b.getAdjacentAnchor(c),b)}else{return false}},previous:function(a){return hs.previousOrNext(a,-1)},next:function(a){return hs.previousOrNext(a,1)},keyHandler:function(a){if(!a){a=window.event}if(!a.target){a.target=a.srcElement}if(typeof a.target.form!="undefined"){return true}var b=hs.getExpander();var c=null;switch(a.keyCode){case 70:if(b){b.doFullExpand()}return true;case 32:case 34:case 39:case 40:c=1;break;case 8:case 33:case 37:case 38:c=-1;break;case 27:case 13:c=0}if(c!==null){hs.removeEventListener(document,window.opera?"keypress":"keydown",hs.keyHandler);if(!hs.enableKeyListener){return true}if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}if(b){if(c==0){b.close()}else{hs.previousOrNext(b.key,c)}return false}}return true},registerOverlay:function(a){hs.push(hs.overlays,hs.extend(a,{hsId:"hsId"+hs.idCounter++}))},getWrapperKey:function(c,b){var e,d=/^highslide-wrapper-([0-9]+)$/;e=c;while(e.parentNode){if(e.id&&d.test(e.id)){return e.id.replace(d,"$1")}e=e.parentNode}if(!b){e=c;while(e.parentNode){if(e.tagName&&hs.isHsAnchor(e)){for(var a=0;a<hs.expanders.length;a++){var f=hs.expanders[a];if(f&&f.a==e){return a}}}e=e.parentNode}}return null},getExpander:function(b,a){if(typeof b=="undefined"){return hs.expanders[hs.focusKey]||null}if(typeof b=="number"){return hs.expanders[b]||null}if(typeof b=="string"){b=hs.$(b)}return hs.expanders[hs.getWrapperKey(b,a)]||null},isHsAnchor:function(b){return(b.onclick&&b.onclick.toString().replace(/\s/g," ").match(/hs.(htmlE|e)xpand/))},reOrder:function(){for(var a=0;a<hs.expanders.length;a++){if(hs.expanders[a]&&hs.expanders[a].isExpanded){hs.focusTopmost()}}},mouseClickHandler:function(d){if(!d){d=window.event}if(d.button>1){return true}if(!d.target){d.target=d.srcElement}var b=d.target;while(b.parentNode&&!(/highslide-(image|move|html|resize)/.test(b.className))){b=b.parentNode}var f=hs.getExpander(b);if(f&&(f.isClosing||!f.isExpanded)){return true}if(f&&d.type=="mousedown"){if(d.target.form){return true}var a=b.className.match(/highslide-(image|move|resize)/);if(a){hs.dragArgs={exp:f,type:a[1],left:f.x.pos,width:f.x.size,top:f.y.pos,height:f.y.size,clickX:d.clientX,clickY:d.clientY};hs.addEventListener(document,"mousemove",hs.dragHandler);if(d.preventDefault){d.preventDefault()}if(/highslide-(image|html)-blur/.test(f.content.className)){f.focus();hs.hasFocused=true}return false}else{if(/highslide-html/.test(b.className)&&hs.focusKey!=f.key){f.focus();f.doShowHide("hidden")}}}else{if(d.type=="mouseup"){hs.removeEventListener(document,"mousemove",hs.dragHandler);if(hs.dragArgs){if(hs.styleRestoreCursor&&hs.dragArgs.type=="image"){hs.dragArgs.exp.content.style.cursor=hs.styleRestoreCursor}var c=hs.dragArgs.hasDragged;if(!c&&!hs.hasFocused&&!/(move|resize)/.test(hs.dragArgs.type)){f.close()}else{if(c||(!c&&hs.hasHtmlExpanders)){hs.dragArgs.exp.doShowHide("hidden")}}if(hs.dragArgs.exp.releaseMask){hs.dragArgs.exp.releaseMask.style.display="none"}hs.hasFocused=false;hs.dragArgs=null}else{if(/highslide-image-blur/.test(b.className)){b.style.cursor=hs.styleRestoreCursor}}}}return false},dragHandler:function(c){if(!hs.dragArgs){return true}if(!c){c=window.event}var b=hs.dragArgs,d=b.exp;if(d.iframe){if(!d.releaseMask){d.releaseMask=hs.createElement("div",null,{position:"absolute",width:d.x.size+"px",height:d.y.size+"px",left:d.x.cb+"px",top:d.y.cb+"px",zIndex:4,background:(hs.ieLt9?"white":"none"),opacity:0.01},d.wrapper,true)}if(d.releaseMask.style.display=="none"){d.releaseMask.style.display=""}}b.dX=c.clientX-b.clickX;b.dY=c.clientY-b.clickY;var f=Math.sqrt(Math.pow(b.dX,2)+Math.pow(b.dY,2));if(!b.hasDragged){b.hasDragged=(b.type!="image"&&f>0)||(f>(hs.dragSensitivity||5))}if(b.hasDragged&&c.clientX>5&&c.clientY>5){if(b.type=="resize"){d.resize(b)}else{d.moveTo(b.left+b.dX,b.top+b.dY);if(b.type=="image"){d.content.style.cursor="move"}}}return false},wrapperMouseHandler:function(c){try{if(!c){c=window.event}var b=/mouseover/i.test(c.type);if(!c.target){c.target=c.srcElement}if(!c.relatedTarget){c.relatedTarget=b?c.fromElement:c.toElement}var d=hs.getExpander(c.target);if(!d.isExpanded){return}if(!d||!c.relatedTarget||hs.getExpander(c.relatedTarget,true)==d||hs.dragArgs){return}for(var a=0;a<d.overlays.length;a++){(function(){var e=hs.$("hsId"+d.overlays[a]);if(e&&e.hideOnMouseOut){if(b){hs.setStyles(e,{visibility:"visible",display:""})}hs.animate(e,{opacity:b?e.opacity:0},e.dur)}})()}}catch(c){}},addEventListener:function(a,c,b){if(a==document&&c=="ready"){hs.push(hs.onReady,b)}try{a.addEventListener(c,b,false)}catch(d){try{a.detachEvent("on"+c,b);a.attachEvent("on"+c,b)}catch(d){a["on"+c]=b}}},removeEventListener:function(a,c,b){try{a.removeEventListener(c,b,false)}catch(d){try{a.detachEvent("on"+c,b)}catch(d){a["on"+c]=null}}},preloadFullImage:function(b){if(hs.continuePreloading&&hs.preloadTheseImages[b]&&hs.preloadTheseImages[b]!="undefined"){var a=document.createElement("img");a.onload=function(){a=null;hs.preloadFullImage(b+1)};a.src=hs.preloadTheseImages[b]}},preloadImages:function(c){if(c&&typeof c!="object"){hs.numberOfImagesToPreload=c}var a=hs.getAnchors();for(var b=0;b<a.images.length&&b<hs.numberOfImagesToPreload;b++){hs.push(hs.preloadTheseImages,hs.getSrc(a.images[b]))}if(hs.outlineType){new hs.Outline(hs.outlineType,function(){hs.preloadFullImage(0)})}else{hs.preloadFullImage(0)}if(hs.restoreCursor){var d=hs.createElement("img",{src:hs.graphicsDir+hs.restoreCursor})}},init:function(){if(!hs.container){hs.ieLt7=hs.ie&&hs.uaVersion<7;hs.ieLt9=hs.ie&&hs.uaVersion<9;hs.getPageSize();hs.ie6SSL=hs.ieLt7&&location.protocol=="https:";for(var a in hs.langDefaults){if(typeof hs[a]!="undefined"){hs.lang[a]=hs[a]}else{if(typeof hs.lang[a]=="undefined"&&typeof hs.langDefaults[a]!="undefined"){hs.lang[a]=hs.langDefaults[a]}}}hs.container=hs.createElement("div",{className:"highslide-container"},{position:"absolute",left:0,top:0,width:"100%",zIndex:hs.zIndexCounter,direction:"ltr"},document.body,true);hs.loading=hs.createElement("a",{className:"highslide-loading",title:hs.lang.loadingTitle,innerHTML:hs.lang.loadingText,href:"javascript:;"},{position:"absolute",top:"-9999px",opacity:hs.loadingOpacity,zIndex:1},hs.container);hs.garbageBin=hs.createElement("div",null,{display:"none"},hs.container);hs.clearing=hs.createElement("div",null,{clear:"both",paddingTop:"1px"},null,true);Math.linearTween=function(f,e,h,g){return h*f/g+e};Math.easeInQuad=function(f,e,h,g){return h*(f/=g)*f+e};hs.hideSelects=hs.ieLt7;hs.hideIframes=((window.opera&&hs.uaVersion<9)||navigator.vendor=="KDE"||(hs.ieLt7&&hs.uaVersion<5.5))}},ready:function(){if(hs.isReady){return}hs.isReady=true;for(var a=0;a<hs.onReady.length;a++){hs.onReady[a]()}},updateAnchors:function(){var a,d,l=[],h=[],k=[],b={},m;for(var e=0;e<hs.openerTagNames.length;e++){d=document.getElementsByTagName(hs.openerTagNames[e]);for(var c=0;c<d.length;c++){a=d[c];m=hs.isHsAnchor(a);if(m){hs.push(l,a);if(m[0]=="hs.expand"){hs.push(h,a)}else{if(m[0]=="hs.htmlExpand"){hs.push(k,a)}}var f=hs.getParam(a,"slideshowGroup")||"none";if(!b[f]){b[f]=[]}hs.push(b[f],a)}}}hs.anchors={all:l,groups:b,images:h,htmls:k};return hs.anchors},getAnchors:function(){return hs.anchors||hs.updateAnchors()},close:function(a){var b=hs.getExpander(a);if(b){b.close()}return false}};hs.fx=function(b,a,c){this.options=a;this.elem=b;this.prop=c;if(!a.orig){a.orig={}}};hs.fx.prototype={update:function(){(hs.fx.step[this.prop]||hs.fx.step._default)(this);if(this.options.step){this.options.step.call(this.elem,this.now,this)}},custom:function(e,d,c){this.startTime=(new Date()).getTime();this.start=e;this.end=d;this.unit=c;this.now=this.start;this.pos=this.state=0;var a=this;function b(f){return a.step(f)}b.elem=this.elem;if(b()&&hs.timers.push(b)==1){hs.timerId=setInterval(function(){var g=hs.timers;for(var f=0;f<g.length;f++){if(!g[f]()){g.splice(f--,1)}}if(!g.length){clearInterval(hs.timerId)}},13)}},step:function(d){var c=(new Date()).getTime();if(d||c>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var a=true;for(var b in this.options.curAnim){if(this.options.curAnim[b]!==true){a=false}}if(a){if(this.options.complete){this.options.complete.call(this.elem)}}return false}else{var e=c-this.startTime;this.state=e/this.options.duration;this.pos=this.options.easing(e,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};hs.extend(hs.fx,{step:{opacity:function(a){hs.setStyles(a.elem,{opacity:a.now})},_default:function(a){try{if(a.elem.style&&a.elem.style[a.prop]!=null){a.elem.style[a.prop]=a.now+a.unit}else{a.elem[a.prop]=a.now}}catch(b){}}}});hs.Outline=function(g,e){this.onLoad=e;this.outlineType=g;var a=hs.uaVersion,f;this.hasAlphaImageLoader=hs.ie&&hs.uaVersion<7;if(!g){if(e){e()}return}hs.init();this.table=hs.createElement("table",{cellSpacing:0},{visibility:"hidden",position:"absolute",borderCollapse:"collapse",width:0},hs.container,true);var b=hs.createElement("tbody",null,null,this.table,1);this.td=[];for(var c=0;c<=8;c++){if(c%3==0){f=hs.createElement("tr",null,{height:"auto"},b,true)}this.td[c]=hs.createElement("td",null,null,f,true);var d=c!=4?{lineHeight:0,fontSize:0}:{position:"relative"};hs.setStyles(this.td[c],d)}this.td[4].className=g+" highslide-outline";this.preloadGraphic()};hs.Outline.prototype={preloadGraphic:function(){var b=hs.graphicsDir+(hs.outlinesDir||"outlines/")+this.outlineType+".png";var a=hs.safari&&hs.uaVersion<525?hs.container:null;this.graphic=hs.createElement("img",null,{position:"absolute",top:"-9999px"},a,true);var c=this;this.graphic.onload=function(){c.onGraphicLoad()};this.graphic.src=b},onGraphicLoad:function(){var d=this.offset=this.graphic.width/4,f=[[0,0],[0,-4],[-2,0],[0,-8],0,[-2,-8],[0,-2],[0,-6],[-2,-2]],c={height:(2*d)+"px",width:(2*d)+"px"};for(var b=0;b<=8;b++){if(f[b]){if(this.hasAlphaImageLoader){var a=(b==1||b==7)?"100%":this.graphic.width+"px";var e=hs.createElement("div",null,{width:"100%",height:"100%",position:"relative",overflow:"hidden"},this.td[b],true);hs.createElement("div",null,{filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale, src='"+this.graphic.src+"')",position:"absolute",width:a,height:this.graphic.height+"px",left:(f[b][0]*d)+"px",top:(f[b][1]*d)+"px"},e,true)}else{hs.setStyles(this.td[b],{background:"url("+this.graphic.src+") "+(f[b][0]*d)+"px "+(f[b][1]*d)+"px"})}if(window.opera&&(b==3||b==5)){hs.createElement("div",null,c,this.td[b],true)}hs.setStyles(this.td[b],c)}}this.graphic=null;if(hs.pendingOutlines[this.outlineType]){hs.pendingOutlines[this.outlineType].destroy()}hs.pendingOutlines[this.outlineType]=this;if(this.onLoad){this.onLoad()}},setPosition:function(g,e,c,b,f){var d=this.exp,a=d.wrapper.style,e=e||0,g=g||{x:d.x.pos+e,y:d.y.pos+e,w:d.x.get("wsize")-2*e,h:d.y.get("wsize")-2*e};if(c){this.table.style.visibility=(g.h>=4*this.offset)?"visible":"hidden"}hs.setStyles(this.table,{left:(g.x-this.offset)+"px",top:(g.y-this.offset)+"px",width:(g.w+2*this.offset)+"px"});g.w-=2*this.offset;g.h-=2*this.offset;hs.setStyles(this.td[4],{width:g.w>=0?g.w+"px":0,height:g.h>=0?g.h+"px":0});if(this.hasAlphaImageLoader){this.td[3].style.height=this.td[5].style.height=this.td[4].style.height}},destroy:function(a){if(a){this.table.style.visibility="hidden"}else{hs.discardElement(this.table)}}};hs.Dimension=function(b,a){this.exp=b;this.dim=a;this.ucwh=a=="x"?"Width":"Height";this.wh=this.ucwh.toLowerCase();this.uclt=a=="x"?"Left":"Top";this.lt=this.uclt.toLowerCase();this.ucrb=a=="x"?"Right":"Bottom";this.rb=this.ucrb.toLowerCase();this.p1=this.p2=0};hs.Dimension.prototype={get:function(a){switch(a){case"loadingPos":return this.tpos+this.tb+(this.t-hs.loading["offset"+this.ucwh])/2;case"wsize":return this.size+2*this.cb+this.p1+this.p2;case"fitsize":return this.clientSize-this.marginMin-this.marginMax;case"maxsize":return this.get("fitsize")-2*this.cb-this.p1-this.p2;case"opos":return this.pos-(this.exp.outline?this.exp.outline.offset:0);case"osize":return this.get("wsize")+(this.exp.outline?2*this.exp.outline.offset:0);case"imgPad":return this.imgSize?Math.round((this.size-this.imgSize)/2):0}},calcBorders:function(){this.cb=(this.exp.content["offset"+this.ucwh]-this.t)/2;this.marginMax=hs["margin"+this.ucrb]},calcThumb:function(){this.t=this.exp.el[this.wh]?parseInt(this.exp.el[this.wh]):this.exp.el["offset"+this.ucwh];this.tpos=this.exp.tpos[this.dim];this.tb=(this.exp.el["offset"+this.ucwh]-this.t)/2;if(this.tpos==0||this.tpos==-1){this.tpos=(hs.page[this.wh]/2)+hs.page["scroll"+this.uclt]}},calcExpanded:function(){var a=this.exp;this.justify="auto";this.pos=this.tpos-this.cb+this.tb;if(this.maxHeight&&this.dim=="x"){a.maxWidth=Math.min(a.maxWidth||this.full,a.maxHeight*this.full/a.y.full)}this.size=Math.min(this.full,a["max"+this.ucwh]||this.full);this.minSize=a.allowSizeReduction?Math.min(a["min"+this.ucwh],this.full):this.full;if(a.isImage&&a.useBox){this.size=a[this.wh];this.imgSize=this.full}if(this.dim=="x"&&hs.padToMinWidth){this.minSize=a.minWidth}this.marginMin=hs["margin"+this.uclt];this.scroll=hs.page["scroll"+this.uclt];this.clientSize=hs.page[this.wh]},setSize:function(a){var f=this.exp;if(f.isImage&&(f.useBox||hs.padToMinWidth)){this.imgSize=a;this.size=Math.max(this.size,this.imgSize);f.content.style[this.lt]=this.get("imgPad")+"px"}else{this.size=a}f.content.style[this.wh]=a+"px";f.wrapper.style[this.wh]=this.get("wsize")+"px";if(f.outline){f.outline.setPosition()}if(f.releaseMask){f.releaseMask.style[this.wh]=a+"px"}if(this.dim=="y"&&f.iDoc&&f.body.style.height!="auto"){try{f.iDoc.body.style.overflow="auto"}catch(b){}}if(f.isHtml){var c=f.scrollerDiv;if(this.sizeDiff===undefined){this.sizeDiff=f.innerContent["offset"+this.ucwh]-c["offset"+this.ucwh]}c.style[this.wh]=(this.size-this.sizeDiff)+"px";if(this.dim=="x"){f.mediumContent.style.width="auto"}if(f.body){f.body.style[this.wh]="auto"}}if(this.dim=="x"&&f.overlayBox){f.sizeOverlayBox(true)}},setPos:function(a){this.pos=a;this.exp.wrapper.style[this.lt]=a+"px";if(this.exp.outline){this.exp.outline.setPosition()}}};hs.Expander=function(k,f,b,l){if(document.readyState&&hs.ie&&!hs.isReady){hs.addEventListener(document,"ready",function(){new hs.Expander(k,f,b,l)});return}this.a=k;this.custom=b;this.contentType=l||"image";this.isHtml=(l=="html");this.isImage=!this.isHtml;hs.continuePreloading=false;this.overlays=[];hs.init();var m=this.key=hs.expanders.length;for(var g=0;g<hs.overrides.length;g++){var c=hs.overrides[g];this[c]=f&&typeof f[c]!="undefined"?f[c]:hs[c]}if(!this.src){this.src=k.href}var d=(f&&f.thumbnailId)?hs.$(f.thumbnailId):k;d=this.thumb=d.getElementsByTagName("img")[0]||d;this.thumbsUserSetId=d.id||k.id;for(var g=0;g<hs.expanders.length;g++){if(hs.expanders[g]&&hs.expanders[g].a==k){hs.expanders[g].focus();return false}}if(!hs.allowSimultaneousLoading){for(var g=0;g<hs.expanders.length;g++){if(hs.expanders[g]&&hs.expanders[g].thumb!=d&&!hs.expanders[g].onLoadStarted){hs.expanders[g].cancelLoading()}}}hs.expanders[m]=this;if(!hs.allowMultipleInstances&&!hs.upcoming){if(hs.expanders[m-1]){hs.expanders[m-1].close()}if(typeof hs.focusKey!="undefined"&&hs.expanders[hs.focusKey]){hs.expanders[hs.focusKey].close()}}this.el=d;this.tpos=this.pageOrigin||hs.getPosition(d);hs.getPageSize();var j=this.x=new hs.Dimension(this,"x");j.calcThumb();var h=this.y=new hs.Dimension(this,"y");h.calcThumb();this.wrapper=hs.createElement("div",{id:"highslide-wrapper-"+this.key,className:"highslide-wrapper "+this.wrapperClassName},{visibility:"hidden",position:"absolute",zIndex:hs.zIndexCounter+=2},null,true);this.wrapper.onmouseover=this.wrapper.onmouseout=hs.wrapperMouseHandler;if(this.contentType=="image"&&this.outlineWhileAnimating==2){this.outlineWhileAnimating=0}if(!this.outlineType){this[this.contentType+"Create"]()}else{if(hs.pendingOutlines[this.outlineType]){this.connectOutline();this[this.contentType+"Create"]()}else{this.showLoading();var e=this;new hs.Outline(this.outlineType,function(){e.connectOutline();e[e.contentType+"Create"]()})}}return true};hs.Expander.prototype={error:function(a){if(hs.debug){alert("Line "+a.lineNumber+": "+a.message)}else{window.location.href=this.src}},connectOutline:function(){var a=this.outline=hs.pendingOutlines[this.outlineType];a.exp=this;a.table.style.zIndex=this.wrapper.style.zIndex-1;hs.pendingOutlines[this.outlineType]=null},showLoading:function(){if(this.onLoadStarted||this.loading){return}this.loading=hs.loading;var c=this;this.loading.onclick=function(){c.cancelLoading()};var c=this,a=this.x.get("loadingPos")+"px",b=this.y.get("loadingPos")+"px";setTimeout(function(){if(c.loading){hs.setStyles(c.loading,{left:a,top:b,zIndex:hs.zIndexCounter++})}},100)},imageCreate:function(){var b=this;var a=document.createElement("img");this.content=a;a.onload=function(){if(hs.expanders[b.key]){b.contentLoaded()}};if(hs.blockRightClick){a.oncontextmenu=function(){return false}}a.className="highslide-image";hs.setStyles(a,{visibility:"hidden",display:"block",position:"absolute",maxWidth:"9999px",zIndex:3});a.title=hs.lang.restoreTitle;if(hs.safari&&hs.uaVersion<525){hs.container.appendChild(a)}if(hs.ie&&hs.flushImgSize){a.src=null}a.src=this.src;this.showLoading()},htmlCreate:function(){this.content=hs.getCacheBinding(this.a);if(!this.content){this.content=hs.getNode(this.contentId)}if(!this.content){this.content=hs.getSelfRendered()}this.getInline(["maincontent"]);if(this.maincontent){var a=hs.getElementByClass(this.content,"div","highslide-body");if(a){a.appendChild(this.maincontent)}this.maincontent.style.display="block"}var d=this.innerContent=this.content;if(/(swf|iframe)/.test(this.objectType)){this.setObjContainerSize(d)}hs.container.appendChild(this.wrapper);hs.setStyles(this.wrapper,{position:"static",padding:"0 "+hs.marginRight+"px 0 "+hs.marginLeft+"px"});this.content=hs.createElement("div",{className:"highslide-html"},{position:"relative",zIndex:3,height:0,overflow:"hidden"},this.wrapper);this.mediumContent=hs.createElement("div",null,null,this.content,1);this.mediumContent.appendChild(d);hs.setStyles(d,{position:"relative",display:"block",direction:hs.lang.cssDirection||""});if(this.width){d.style.width=this.width+"px"}if(this.height){hs.setStyles(d,{height:this.height+"px",overflow:"hidden"})}if(d.offsetWidth<this.minWidth){d.style.width=this.minWidth+"px"}if(this.objectType=="ajax"&&!hs.getCacheBinding(this.a)){this.showLoading();var c=this;var b=new hs.Ajax(this.a,d);b.src=this.src;b.onLoad=function(){if(hs.expanders[c.key]){c.contentLoaded()}};b.onError=function(){location.href=c.src};b.run()}else{if(this.objectType=="iframe"&&this.objectLoadTime=="before"){this.writeExtendedContent()}else{this.contentLoaded()}}},contentLoaded:function(){try{if(!this.content){return}this.content.onload=null;if(this.onLoadStarted){return}else{this.onLoadStarted=true}var a=this.x,d=this.y;if(this.loading){hs.setStyles(this.loading,{top:"-9999px"});this.loading=null}if(this.isImage){a.full=this.content.width;d.full=this.content.height;hs.setStyles(this.content,{width:a.t+"px",height:d.t+"px"});this.wrapper.appendChild(this.content);hs.container.appendChild(this.wrapper)}else{if(this.htmlGetSize){this.htmlGetSize()}}a.calcBorders();d.calcBorders();hs.setStyles(this.wrapper,{left:(a.tpos+a.tb-a.cb)+"px",top:(d.tpos+a.tb-d.cb)+"px"});this.getOverlays();var b=a.full/d.full;a.calcExpanded();this.justify(a);d.calcExpanded();this.justify(d);if(this.isHtml){this.htmlSizeOperations()}if(this.overlayBox){this.sizeOverlayBox(0,1)}if(this.allowSizeReduction){if(this.isImage){this.correctRatio(b)}else{this.fitOverlayBox()}if(this.isImage&&this.x.full>(this.x.imgSize||this.x.size)){this.createFullExpand();if(this.overlays.length==1){this.sizeOverlayBox()}}}this.show()}catch(c){this.error(c)}},setObjContainerSize:function(a,d){var b=hs.getElementByClass(a,"DIV","highslide-body");if(/(iframe|swf)/.test(this.objectType)){if(this.objectWidth){b.style.width=this.objectWidth+"px"}if(this.objectHeight){b.style.height=this.objectHeight+"px"}}},writeExtendedContent:function(){if(this.hasExtendedContent){return}var f=this;this.body=hs.getElementByClass(this.innerContent,"DIV","highslide-body");if(this.objectType=="iframe"){this.showLoading();var g=hs.clearing.cloneNode(1);this.body.appendChild(g);this.newWidth=this.innerContent.offsetWidth;if(!this.objectWidth){this.objectWidth=g.offsetWidth}var c=this.innerContent.offsetHeight-this.body.offsetHeight,d=this.objectHeight||hs.page.height-c-hs.marginTop-hs.marginBottom,e=this.objectLoadTime=="before"?' onload="if (hs.expanders['+this.key+"]) hs.expanders["+this.key+'].contentLoaded()" ':"";this.body.innerHTML+='<iframe name="hs'+(new Date()).getTime()+'" frameborder="0" key="'+this.key+'"  style="width:'+this.objectWidth+"px; height:"+d+'px" '+e+' src="'+this.src+'" ></iframe>';this.ruler=this.body.getElementsByTagName("div")[0];this.iframe=this.body.getElementsByTagName("iframe")[0];if(this.objectLoadTime=="after"){this.correctIframeSize()}}if(this.objectType=="swf"){this.body.id=this.body.id||"hs-flash-id-"+this.key;var b=this.swfOptions;if(!b.params){b.params={}}if(typeof b.params.wmode=="undefined"){b.params.wmode="transparent"}if(swfobject){swfobject.embedSWF(this.src,this.body.id,this.objectWidth,this.objectHeight,b.version||"7",b.expressInstallSwfurl,b.flashvars,b.params,b.attributes)}}this.hasExtendedContent=true},htmlGetSize:function(){if(this.iframe&&!this.objectHeight){this.iframe.style.height=this.body.style.height=this.getIframePageHeight()+"px"}this.innerContent.appendChild(hs.clearing);if(!this.x.full){this.x.full=this.innerContent.offsetWidth}this.y.full=this.innerContent.offsetHeight;this.innerContent.removeChild(hs.clearing);if(hs.ie&&this.newHeight>parseInt(this.innerContent.currentStyle.height)){this.newHeight=parseInt(this.innerContent.currentStyle.height)}hs.setStyles(this.wrapper,{position:"absolute",padding:"0"});hs.setStyles(this.content,{width:this.x.t+"px",height:this.y.t+"px"})},getIframePageHeight:function(){var a;try{var d=this.iDoc=this.iframe.contentDocument||this.iframe.contentWindow.document;var b=d.createElement("div");b.style.clear="both";d.body.appendChild(b);a=b.offsetTop;if(hs.ie){a+=parseInt(d.body.currentStyle.marginTop)+parseInt(d.body.currentStyle.marginBottom)-1}}catch(c){a=300}return a},correctIframeSize:function(){var b=this.innerContent.offsetWidth-this.ruler.offsetWidth;hs.discardElement(this.ruler);if(b<0){b=0}var a=this.innerContent.offsetHeight-this.iframe.offsetHeight;if(this.iDoc&&!this.objectHeight&&!this.height&&this.y.size==this.y.full){try{this.iDoc.body.style.overflow="hidden"}catch(c){}}hs.setStyles(this.iframe,{width:Math.abs(this.x.size-b)+"px",height:Math.abs(this.y.size-a)+"px"});hs.setStyles(this.body,{width:this.iframe.style.width,height:this.iframe.style.height});this.scrollingContent=this.iframe;this.scrollerDiv=this.scrollingContent},htmlSizeOperations:function(){this.setObjContainerSize(this.innerContent);if(this.objectType=="swf"&&this.objectLoadTime=="before"){this.writeExtendedContent()}if(this.x.size<this.x.full&&!this.allowWidthReduction){this.x.size=this.x.full}if(this.y.size<this.y.full&&!this.allowHeightReduction){this.y.size=this.y.full}this.scrollerDiv=this.innerContent;hs.setStyles(this.mediumContent,{position:"relative",width:this.x.size+"px"});hs.setStyles(this.innerContent,{border:"none",width:"auto",height:"auto"});var e=hs.getElementByClass(this.innerContent,"DIV","highslide-body");if(e&&!/(iframe|swf)/.test(this.objectType)){var b=e;e=hs.createElement(b.nodeName,null,{overflow:"hidden"},null,true);b.parentNode.insertBefore(e,b);e.appendChild(hs.clearing);e.appendChild(b);var c=this.innerContent.offsetWidth-e.offsetWidth;var a=this.innerContent.offsetHeight-e.offsetHeight;e.removeChild(hs.clearing);var d=hs.safari||navigator.vendor=="KDE"?1:0;hs.setStyles(e,{width:(this.x.size-c-d)+"px",height:(this.y.size-a)+"px",overflow:"auto",position:"relative"});if(d&&b.offsetHeight>e.offsetHeight){e.style.width=(parseInt(e.style.width)+d)+"px"}this.scrollingContent=e;this.scrollerDiv=this.scrollingContent}if(this.iframe&&this.objectLoadTime=="before"){this.correctIframeSize()}if(!this.scrollingContent&&this.y.size<this.mediumContent.offsetHeight){this.scrollerDiv=this.content}if(this.scrollerDiv==this.content&&!this.allowWidthReduction&&!/(iframe|swf)/.test(this.objectType)){this.x.size+=17}if(this.scrollerDiv&&this.scrollerDiv.offsetHeight>this.scrollerDiv.parentNode.offsetHeight){setTimeout("try { hs.expanders["+this.key+"].scrollerDiv.style.overflow = 'auto'; } catch(e) {}",hs.expandDuration)}},justify:function(f,b){var g,h=f.target,e=f==this.x?"x":"y";var d=false;var a=f.exp.allowSizeReduction;f.pos=Math.round(f.pos-((f.get("wsize")-f.t)/2));if(f.pos<f.scroll+f.marginMin){f.pos=f.scroll+f.marginMin;d=true}if(!b&&f.size<f.minSize){f.size=f.minSize;a=false}if(f.pos+f.get("wsize")>f.scroll+f.clientSize-f.marginMax){if(!b&&d&&a){f.size=Math.min(f.size,f.get(e=="y"?"fitsize":"maxsize"))}else{if(f.get("wsize")<f.get("fitsize")){f.pos=f.scroll+f.clientSize-f.marginMax-f.get("wsize")}else{f.pos=f.scroll+f.marginMin;if(!b&&a){f.size=f.get(e=="y"?"fitsize":"maxsize")}}}}if(!b&&f.size<f.minSize){f.size=f.minSize;a=false}if(f.pos<f.marginMin){var c=f.pos;f.pos=f.marginMin;if(a&&!b){f.size=f.size-(f.pos-c)}}},correctRatio:function(c){var a=this.x,g=this.y,e=false,d=Math.min(a.full,a.size),b=Math.min(g.full,g.size),f=(this.useBox||hs.padToMinWidth);if(d/b>c){d=b*c;if(d<a.minSize){d=a.minSize;b=d/c}e=true}else{if(d/b<c){b=d/c;e=true}}if(hs.padToMinWidth&&a.full<a.minSize){a.imgSize=a.full;g.size=g.imgSize=g.full}else{if(this.useBox){a.imgSize=d;g.imgSize=b}else{a.size=d;g.size=b}}e=this.fitOverlayBox(this.useBox?null:c,e);if(f&&g.size<g.imgSize){g.imgSize=g.size;a.imgSize=g.size*c}if(e||f){a.pos=a.tpos-a.cb+a.tb;a.minSize=a.size;this.justify(a,true);g.pos=g.tpos-g.cb+g.tb;g.minSize=g.size;this.justify(g,true);if(this.overlayBox){this.sizeOverlayBox()}}},fitOverlayBox:function(b,c){var a=this.x,d=this.y;if(this.overlayBox&&(this.isImage||this.allowHeightReduction)){while(d.size>this.minHeight&&a.size>this.minWidth&&d.get("wsize")>d.get("fitsize")){d.size-=10;if(b){a.size=d.size*b}this.sizeOverlayBox(0,1);c=true}}return c},show:function(){var a=this.x,b=this.y;this.doShowHide("hidden");this.changeSize(1,{wrapper:{width:a.get("wsize"),height:b.get("wsize"),left:a.pos,top:b.pos},content:{left:a.p1+a.get("imgPad"),top:b.p1+b.get("imgPad"),width:a.imgSize||a.size,height:b.imgSize||b.size}},hs.expandDuration)},changeSize:function(b,h,c){if(this.outline&&!this.outlineWhileAnimating){if(b){this.outline.setPosition()}else{this.outline.destroy((this.isHtml&&this.preserveContent))}}if(!b){this.destroyOverlays()}var e=this,a=e.x,g=e.y,f=this.easing;if(!b){f=this.easingClose||f}var d=b?function(){if(e.outline){e.outline.table.style.visibility="visible"}setTimeout(function(){e.afterExpand()},50)}:function(){e.afterClose()};if(b){hs.setStyles(this.wrapper,{width:a.t+"px",height:g.t+"px"})}if(b&&this.isHtml){hs.setStyles(this.wrapper,{left:(a.tpos-a.cb+a.tb)+"px",top:(g.tpos-g.cb+g.tb)+"px"})}if(this.fadeInOut){hs.setStyles(this.wrapper,{opacity:b?0:1});hs.extend(h.wrapper,{opacity:b})}hs.animate(this.wrapper,h.wrapper,{duration:c,easing:f,step:function(k,i){if(e.outline&&e.outlineWhileAnimating&&i.prop=="top"){var j=b?i.pos:1-i.pos;var l={w:a.t+(a.get("wsize")-a.t)*j,h:g.t+(g.get("wsize")-g.t)*j,x:a.tpos+(a.pos-a.tpos)*j,y:g.tpos+(g.pos-g.tpos)*j};e.outline.setPosition(l,0,1)}if(e.isHtml){if(i.prop=="left"){e.mediumContent.style.left=(a.pos-k)+"px"}if(i.prop=="top"){e.mediumContent.style.top=(g.pos-k)+"px"}}}});hs.animate(this.content,h.content,c,f,d);if(b){this.wrapper.style.visibility="visible";this.content.style.visibility="visible";if(this.isHtml){this.innerContent.style.visibility="visible"}this.a.className+=" highslide-active-anchor"}},afterExpand:function(){this.isExpanded=true;this.focus();if(this.isHtml&&this.objectLoadTime=="after"){this.writeExtendedContent()}if(this.iframe){try{var g=this,f=this.iframe.contentDocument||this.iframe.contentWindow.document;hs.addEventListener(f,"mousedown",function(){if(hs.focusKey!=g.key){g.focus()}})}catch(d){}if(hs.ie&&typeof this.isClosing!="boolean"){this.iframe.style.width=(this.objectWidth-1)+"px"}}if(hs.upcoming&&hs.upcoming==this.a){hs.upcoming=null}this.prepareNextOutline();var c=hs.page,b=hs.mouse.x+c.scrollLeft,a=hs.mouse.y+c.scrollTop;this.mouseIsOver=this.x.pos<b&&b<this.x.pos+this.x.get("wsize")&&this.y.pos<a&&a<this.y.pos+this.y.get("wsize");if(this.overlayBox){this.showOverlays()}},prepareNextOutline:function(){var a=this.key;var b=this.outlineType;new hs.Outline(b,function(){try{hs.expanders[a].preloadNext()}catch(c){}})},preloadNext:function(){var b=this.getAdjacentAnchor(1);if(b&&b.onclick.toString().match(/hs\.expand/)){var a=hs.createElement("img",{src:hs.getSrc(b)})}},getAdjacentAnchor:function(c){var b=this.getAnchorIndex(),a=hs.anchors.groups[this.slideshowGroup||"none"];return(a&&a[b+c])||null},getAnchorIndex:function(){var a=hs.getAnchors().groups[this.slideshowGroup||"none"];if(a){for(var b=0;b<a.length;b++){if(a[b]==this.a){return b}}}return null},cancelLoading:function(){hs.discardElement(this.wrapper);hs.expanders[this.key]=null;if(this.loading){hs.loading.style.left="-9999px"}},writeCredits:function(){this.credits=hs.createElement("a",{href:hs.creditsHref,target:hs.creditsTarget,className:"highslide-credits",innerHTML:hs.lang.creditsText,title:hs.lang.creditsTitle});this.createOverlay({overlayId:this.credits,position:this.creditsPosition||"top left"})},getInline:function(types,addOverlay){for(var i=0;i<types.length;i++){var type=types[i],s=null;if(!this[type+"Id"]&&this.thumbsUserSetId){this[type+"Id"]=type+"-for-"+this.thumbsUserSetId}if(this[type+"Id"]){this[type]=hs.getNode(this[type+"Id"])}if(!this[type]&&!this[type+"Text"]&&this[type+"Eval"]){try{s=eval(this[type+"Eval"])}catch(e){}}if(!this[type]&&this[type+"Text"]){s=this[type+"Text"]}if(!this[type]&&!s){this[type]=hs.getNode(this.a["_"+type+"Id"]);if(!this[type]){var next=this.a.nextSibling;while(next&&!hs.isHsAnchor(next)){if((new RegExp("highslide-"+type)).test(next.className||null)){if(!next.id){this.a["_"+type+"Id"]=next.id="hsId"+hs.idCounter++}this[type]=hs.getNode(next.id);break}next=next.nextSibling}}}if(!this[type]&&s){this[type]=hs.createElement("div",{className:"highslide-"+type,innerHTML:s})}if(addOverlay&&this[type]){var o={position:(type=="heading")?"above":"below"};for(var x in this[type+"Overlay"]){o[x]=this[type+"Overlay"][x]}o.overlayId=this[type];this.createOverlay(o)}}},doShowHide:function(a){if(hs.hideSelects){this.showHideElements("SELECT",a)}if(hs.hideIframes){this.showHideElements("IFRAME",a)}if(hs.geckoMac){this.showHideElements("*",a)}},showHideElements:function(c,b){var e=document.getElementsByTagName(c);var a=c=="*"?"overflow":"visibility";for(var f=0;f<e.length;f++){if(a=="visibility"||(document.defaultView.getComputedStyle(e[f],"").getPropertyValue("overflow")=="auto"||e[f].getAttribute("hidden-by")!=null)){var h=e[f].getAttribute("hidden-by");if(b=="visible"&&h){h=h.replace("["+this.key+"]","");e[f].setAttribute("hidden-by",h);if(!h){e[f].style[a]=e[f].origProp}}else{if(b=="hidden"){var k=hs.getPosition(e[f]);k.w=e[f].offsetWidth;k.h=e[f].offsetHeight;var j=(k.x+k.w<this.x.get("opos")||k.x>this.x.get("opos")+this.x.get("osize"));var g=(k.y+k.h<this.y.get("opos")||k.y>this.y.get("opos")+this.y.get("osize"));var d=hs.getWrapperKey(e[f]);if(!j&&!g&&d!=this.key){if(!h){e[f].setAttribute("hidden-by","["+this.key+"]");e[f].origProp=e[f].style[a];e[f].style[a]="hidden"}else{if(h.indexOf("["+this.key+"]")==-1){e[f].setAttribute("hidden-by",h+"["+this.key+"]")}}}else{if((h=="["+this.key+"]"||hs.focusKey==d)&&d!=this.key){e[f].setAttribute("hidden-by","");e[f].style[a]=e[f].origProp||""}else{if(h&&h.indexOf("["+this.key+"]")>-1){e[f].setAttribute("hidden-by",h.replace("["+this.key+"]",""))}}}}}}}},focus:function(){this.wrapper.style.zIndex=hs.zIndexCounter+=2;for(var a=0;a<hs.expanders.length;a++){if(hs.expanders[a]&&a==hs.focusKey){var b=hs.expanders[a];b.content.className+=" highslide-"+b.contentType+"-blur";if(b.isImage){b.content.style.cursor=hs.ieLt7?"hand":"pointer";b.content.title=hs.lang.focusTitle}}}if(this.outline){this.outline.table.style.zIndex=this.wrapper.style.zIndex-1}this.content.className="highslide-"+this.contentType;if(this.isImage){this.content.title=hs.lang.restoreTitle;if(hs.restoreCursor){hs.styleRestoreCursor=window.opera?"pointer":"url("+hs.graphicsDir+hs.restoreCursor+"), pointer";if(hs.ieLt7&&hs.uaVersion<6){hs.styleRestoreCursor="hand"}this.content.style.cursor=hs.styleRestoreCursor}}hs.focusKey=this.key;hs.addEventListener(document,window.opera?"keypress":"keydown",hs.keyHandler)},moveTo:function(a,b){this.x.setPos(a);this.y.setPos(b)},resize:function(d){var a,b,c=d.width/d.height;a=Math.max(d.width+d.dX,Math.min(this.minWidth,this.x.full));if(this.isImage&&Math.abs(a-this.x.full)<12){a=this.x.full}b=this.isHtml?d.height+d.dY:a/c;if(b<Math.min(this.minHeight,this.y.full)){b=Math.min(this.minHeight,this.y.full);if(this.isImage){a=b*c}}this.resizeTo(a,b)},resizeTo:function(a,b){this.y.setSize(b);this.x.setSize(a);this.wrapper.style.height=this.y.get("wsize")+"px"},close:function(){if(this.isClosing||!this.isExpanded){return}this.isClosing=true;hs.removeEventListener(document,window.opera?"keypress":"keydown",hs.keyHandler);try{if(this.isHtml){this.htmlPrepareClose()}this.content.style.cursor="default";this.changeSize(0,{wrapper:{width:this.x.t,height:this.y.t,left:this.x.tpos-this.x.cb+this.x.tb,top:this.y.tpos-this.y.cb+this.y.tb},content:{left:0,top:0,width:this.x.t,height:this.y.t}},hs.restoreDuration)}catch(a){this.afterClose()}},htmlPrepareClose:function(){if(hs.geckoMac){if(!hs.mask){hs.mask=hs.createElement("div",null,{position:"absolute"},hs.container)}hs.setStyles(hs.mask,{width:this.x.size+"px",height:this.y.size+"px",left:this.x.pos+"px",top:this.y.pos+"px",display:"block"})}if(this.objectType=="swf"){try{hs.$(this.body.id).StopPlay()}catch(a){}}if(this.objectLoadTime=="after"&&!this.preserveContent){this.destroyObject()}if(this.scrollerDiv&&this.scrollerDiv!=this.scrollingContent){this.scrollerDiv.style.overflow="hidden"}},destroyObject:function(){if(hs.ie&&this.iframe){try{this.iframe.contentWindow.document.body.innerHTML=""}catch(a){}}if(this.objectType=="swf"){swfobject.removeSWF(this.body.id)}this.body.innerHTML=""},sleep:function(){if(this.outline){this.outline.table.style.display="none"}this.releaseMask=null;this.wrapper.style.display="none";this.isExpanded=false;hs.push(hs.sleeping,this)},awake:function(){try{hs.expanders[this.key]=this;if(!hs.allowMultipleInstances&&hs.focusKey!=this.key){try{hs.expanders[hs.focusKey].close()}catch(b){}}var d=hs.zIndexCounter++,a={display:"",zIndex:d};hs.setStyles(this.wrapper,a);this.isClosing=false;var c=this.outline||0;if(c){if(!this.outlineWhileAnimating){a.visibility="hidden"}hs.setStyles(c.table,a)}this.show()}catch(b){}},createOverlay:function(d){var c=d.overlayId;if(typeof c=="string"){c=hs.getNode(c)}if(d.html){c=hs.createElement("div",{innerHTML:d.html})}if(!c||typeof c=="string"){return}c.style.display="block";this.genOverlayBox();var b=d.width&&/^[0-9]+(px|%)$/.test(d.width)?d.width:"auto";if(/^(left|right)panel$/.test(d.position)&&!/^[0-9]+px$/.test(d.width)){b="200px"}var a=hs.createElement("div",{id:"hsId"+hs.idCounter++,hsId:d.hsId},{position:"absolute",visibility:"hidden",width:b,direction:hs.lang.cssDirection||"",opacity:0},this.overlayBox,true);a.appendChild(c);hs.extend(a,{opacity:1,offsetX:0,offsetY:0,dur:(d.fade===0||d.fade===false||(d.fade==2&&hs.ie))?0:250});hs.extend(a,d);if(this.gotOverlays){this.positionOverlay(a);if(!a.hideOnMouseOut||this.mouseIsOver){hs.animate(a,{opacity:a.opacity},a.dur)}}hs.push(this.overlays,hs.idCounter-1)},positionOverlay:function(c){var d=c.position||"middle center",b=c.offsetX,a=c.offsetY;if(c.parentNode!=this.overlayBox){this.overlayBox.appendChild(c)}if(/left$/.test(d)){c.style.left=b+"px"}if(/center$/.test(d)){hs.setStyles(c,{left:"50%",marginLeft:(b-Math.round(c.offsetWidth/2))+"px"})}if(/right$/.test(d)){c.style.right=-b+"px"}if(/^leftpanel$/.test(d)){hs.setStyles(c,{right:"100%",marginRight:this.x.cb+"px",top:-this.y.cb+"px",bottom:-this.y.cb+"px",overflow:"auto"});this.x.p1=c.offsetWidth}else{if(/^rightpanel$/.test(d)){hs.setStyles(c,{left:"100%",marginLeft:this.x.cb+"px",top:-this.y.cb+"px",bottom:-this.y.cb+"px",overflow:"auto"});this.x.p2=c.offsetWidth}}if(/^top/.test(d)){c.style.top=a+"px"}if(/^middle/.test(d)){hs.setStyles(c,{top:"50%",marginTop:(a-Math.round(c.offsetHeight/2))+"px"})}if(/^bottom/.test(d)){c.style.bottom=-a+"px"}if(/^above$/.test(d)){hs.setStyles(c,{left:(-this.x.p1-this.x.cb)+"px",right:(-this.x.p2-this.x.cb)+"px",bottom:"100%",marginBottom:this.y.cb+"px",width:"auto"});this.y.p1=c.offsetHeight}else{if(/^below$/.test(d)){hs.setStyles(c,{position:"relative",left:(-this.x.p1-this.x.cb)+"px",right:(-this.x.p2-this.x.cb)+"px",top:"100%",marginTop:this.y.cb+"px",width:"auto"});this.y.p2=c.offsetHeight;c.style.position="absolute"}}},getOverlays:function(){this.getInline(["heading","caption"],true);if(this.heading&&this.dragByHeading){this.heading.className+=" highslide-move"}if(hs.showCredits){this.writeCredits()}for(var a=0;a<hs.overlays.length;a++){var d=hs.overlays[a],e=d.thumbnailId,b=d.slideshowGroup;if((!e&&!b)||(e&&e==this.thumbsUserSetId)||(b&&b===this.slideshowGroup)){if(this.isImage||(this.isHtml&&d.useOnHtml)){this.createOverlay(d)}}}var c=[];for(var a=0;a<this.overlays.length;a++){var d=hs.$("hsId"+this.overlays[a]);if(/panel$/.test(d.position)){this.positionOverlay(d)}else{hs.push(c,d)}}for(var a=0;a<c.length;a++){this.positionOverlay(c[a])}this.gotOverlays=true},genOverlayBox:function(){if(!this.overlayBox){this.overlayBox=hs.createElement("div",{className:this.wrapperClassName},{position:"absolute",width:(this.x.size||(this.useBox?this.width:null)||this.x.full)+"px",height:(this.y.size||this.y.full)+"px",visibility:"hidden",overflow:"hidden",zIndex:hs.ie?4:"auto"},hs.container,true)}},sizeOverlayBox:function(f,d){var c=this.overlayBox,a=this.x,h=this.y;hs.setStyles(c,{width:a.size+"px",height:h.size+"px"});if(f||d){for(var e=0;e<this.overlays.length;e++){var g=hs.$("hsId"+this.overlays[e]);var b=(hs.ieLt7||document.compatMode=="BackCompat");if(g&&/^(above|below)$/.test(g.position)){if(b){g.style.width=(c.offsetWidth+2*a.cb+a.p1+a.p2)+"px"}h[g.position=="above"?"p1":"p2"]=g.offsetHeight}if(g&&b&&/^(left|right)panel$/.test(g.position)){g.style.height=(c.offsetHeight+2*h.cb)+"px"}}}if(f){hs.setStyles(this.content,{top:h.p1+"px"});hs.setStyles(c,{top:(h.p1+h.cb)+"px"})}},showOverlays:function(){var a=this.overlayBox;a.className="";hs.setStyles(a,{top:(this.y.p1+this.y.cb)+"px",left:(this.x.p1+this.x.cb)+"px",overflow:"visible"});if(hs.safari){a.style.visibility="visible"}this.wrapper.appendChild(a);for(var c=0;c<this.overlays.length;c++){var d=hs.$("hsId"+this.overlays[c]);d.style.zIndex=d.zIndex||4;if(!d.hideOnMouseOut||this.mouseIsOver){d.style.visibility="visible";hs.setStyles(d,{visibility:"visible",display:""});hs.animate(d,{opacity:d.opacity},d.dur)}}},destroyOverlays:function(){if(!this.overlays.length){return}if(this.isHtml&&this.preserveContent){this.overlayBox.style.top="-9999px";hs.container.appendChild(this.overlayBox)}else{hs.discardElement(this.overlayBox)}},createFullExpand:function(){this.fullExpandLabel=hs.createElement("a",{href:"javascript:hs.expanders["+this.key+"].doFullExpand();",title:hs.lang.fullExpandTitle,className:"highslide-full-expand"});this.createOverlay({overlayId:this.fullExpandLabel,position:hs.fullExpandPosition,hideOnMouseOut:true,opacity:hs.fullExpandOpacity})},doFullExpand:function(){try{if(this.fullExpandLabel){hs.discardElement(this.fullExpandLabel)}this.focus();var c=this.x.size,a=this.y.size;this.resizeTo(this.x.full,this.y.full);var b=this.x.pos-(this.x.size-c)/2;if(b<hs.marginLeft){b=hs.marginLeft}var f=this.y.pos-(this.y.size-a)/2;if(f<hs.marginTop){f=hs.marginTop}this.moveTo(b,f);this.doShowHide("hidden")}catch(d){this.error(d)}},afterClose:function(){this.a.className=this.a.className.replace("highslide-active-anchor","");this.doShowHide("visible");if(this.isHtml&&this.preserveContent){this.sleep()}else{if(this.outline&&this.outlineWhileAnimating){this.outline.destroy()}hs.discardElement(this.wrapper)}if(hs.mask){hs.mask.style.display="none"}hs.expanders[this.key]=null;hs.reOrder()}};hs.Ajax=function(b,c,d){this.a=b;this.content=c;this.pre=d};hs.Ajax.prototype={run:function(){var d;if(!this.src){this.src=hs.getSrc(this.a)}if(this.src.match("#")){var a=this.src.split("#");this.src=a[0];this.id=a[1]}if(hs.cachedGets[this.src]){this.cachedGet=hs.cachedGets[this.src];if(this.id){this.getElementContent()}else{this.loadHTML()}return}try{d=new XMLHttpRequest()}catch(b){try{d=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{d=new ActiveXObject("Microsoft.XMLHTTP")}catch(b){this.onError()}}}var f=this;d.onreadystatechange=function(){if(f.xhr.readyState==4){if(f.id){f.getElementContent()}else{f.loadHTML()}}};var c=this.src;this.xhr=d;if(hs.forceAjaxReload){c=c.replace(/$/,(/\?/.test(c)?"&":"?")+"dummy="+(new Date()).getTime())}d.open("GET",c,true);d.setRequestHeader("X-Requested-With","XMLHttpRequest");d.setRequestHeader("Content-Type","application/x-www-form-urlencoded");d.send(null)},getElementContent:function(){hs.init();var a=window.opera||hs.ie6SSL?{src:"about:blank"}:null;this.iframe=hs.createElement("iframe",a,{position:"absolute",top:"-9999px"},hs.container);this.loadHTML()},loadHTML:function(){var c=this.cachedGet||this.xhr.responseText,b;if(this.pre){hs.cachedGets[this.src]=c}if(!hs.ie||hs.uaVersion>=5.5){c=c.replace(new RegExp("<link[^>]*>","gi"),"").replace(new RegExp("<script[^>]*>.*?<\/script>","gi"),"");if(this.iframe){var f=this.iframe.contentDocument;if(!f&&this.iframe.contentWindow){f=this.iframe.contentWindow.document}if(!f){var g=this;setTimeout(function(){g.loadHTML()},25);return}f.open();f.write(c);f.close();try{c=f.getElementById(this.id).innerHTML}catch(d){try{c=this.iframe.document.getElementById(this.id).innerHTML}catch(d){}}hs.discardElement(this.iframe)}else{b=/(<body[^>]*>|<\/body>)/ig;if(b.test(c)){c=c.split(b)[hs.ieLt9?1:2]}}}hs.getElementByClass(this.content,"DIV","highslide-body").innerHTML=c;this.onLoad();for(var a in this){this[a]=null}}};hs.langDefaults=hs.lang;var HsExpander=hs.Expander;if(hs.ie&&window==window.top){(function(){try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,50);return}hs.ready()})()}hs.addEventListener(document,"DOMContentLoaded",hs.ready);hs.addEventListener(window,"load",hs.ready);hs.addEventListener(document,"ready",function(){if(hs.expandCursor){var d=hs.createElement("style",{type:"text/css"},null,document.getElementsByTagName("HEAD")[0]),c=document.compatMode=="BackCompat";function b(f,g){if(hs.ie&&(hs.uaVersion<9||c)){var e=document.styleSheets[document.styleSheets.length-1];if(typeof(e.addRule)=="object"){e.addRule(f,g)}}else{d.appendChild(document.createTextNode(f+" {"+g+"}"))}}function a(e){return"expression( ( ( ignoreMe = document.documentElement."+e+" ? document.documentElement."+e+" : document.body."+e+" ) ) + 'px' );"}if(hs.expandCursor){b(".highslide img","cursor: url("+hs.graphicsDir+hs.expandCursor+"), pointer !important;")}}});hs.addEventListener(window,"resize",function(){hs.getPageSize()});hs.addEventListener(document,"mousemove",function(a){hs.mouse={x:a.clientX,y:a.clientY}});hs.addEventListener(document,"mousedown",hs.mouseClickHandler);hs.addEventListener(document,"mouseup",hs.mouseClickHandler);hs.addEventListener(document,"ready",hs.getAnchors);hs.addEventListener(window,"load",hs.preloadImages);hs.addEventListener(window,"load",hs.preloadAjax)};
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide-with-html.packed.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide-with-html.packed.js
new file mode 100644
index 0000000000000000000000000000000000000000..6febacff6cf333c90c23f393de9c5dfe8f856a5f
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide-with-html.packed.js
@@ -0,0 +1,9 @@
+/** 
+ * Name:    Highslide JS
+ * Version: 4.1.13 (2011-10-06)
+ * Config:  default +inline +ajax +iframe +flash +packed
+ * Author:  Torstein Hønsi
+ * Support: www.highslide.com/support
+ * License: www.highslide.com/#license
+ */
+eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('q(!m){u m={1e:{89:\'8H\',8K:\'co...\',8G:\'6Q 2h cA\',9s:\'6Q 2h cB 2h c1\',9Y:\'bX 2h bT G (f)\',ag:\'c7 by <i>8g 8f</i>\',9F:\'d3 2h d6 8g 8f dg\',91:\'8n\',8W:\'8e\',8R:\'9g\',8V:\'8j\',8U:\'8j (di)\',93:\'dj\',dd:\'8h\',d2:\'8h 8m (8l)\',cM:\'8k\',bR:\'8k 8m (8l)\',90:\'8n (6L 1f)\',8X:\'8e (6L 2G)\',8S:\'9g\',b8:\'1:1\',7h:\'6Q 2h 28 2D, aR 8Y aL 2h 3I. aH 6L aT W 1M 8Y 5n.\'},56:\'U/aN/\',5v:\'bG.6E\',4E:\'bB.6E\',7c:6j,a7:6j,4j:15,6m:15,3N:15,6f:15,4l:bt,8N:0.75,7m:J,71:5,3g:2,aZ:3,4M:1h,9Z:\'3E 2G\',9U:1,a1:J,9y:\'b2://U.b4/\',9E:\'aO\',8C:J,7B:[\'a\'],5D:1h,5A:J,48:J,31:\'4K\',82:J,7b:J,3O:8Z,4s:8Z,4I:J,1x:\'aS-aP\',8A:{8B:\'<1i 3n="U-aU"><92>\'+\'<3u 3n="U-5n">\'+\'<a 2v="#" 2u="{m.1e.90}" 2M="D m.5n(k)">\'+\'<2p>{m.1e.91}</2p></a>\'+\'</3u>\'+\'<3u 3n="U-1M">\'+\'<a 2v="#" 2u="{m.1e.8X}" 2M="D m.1M(k)">\'+\'<2p>{m.1e.8W}</2p></a>\'+\'</3u>\'+\'<3u 3n="U-3I">\'+\'<a 2v="#" 2u="{m.1e.8S}" 2M="D 1h">\'+\'<2p>{m.1e.8R}</2p></a>\'+\'</3u>\'+\'<3u 3n="U-28">\'+\'<a 2v="#" 2u="{m.1e.8U}" 2M="D m.28(k)">\'+\'<2p>{m.1e.8V}</2p></a>\'+\'</3u>\'+\'</92></1i>\'+\'<1i 3n="U-V"></1i>\'+\'<1i 3n="U-b0"><1i>\'+\'<2p 3n="U-3q" 2u="{m.1e.93}"><2p></2p></2p>\'+\'</1i></1i>\'},4P:[],6n:J,P:[],6s:[\'4I\',\'2K\',\'1x\',\'3g\',\'b5\',\'bc\',\'aG\',\'9e\',\'aM\',\'b3\',\'bQ\',\'9c\',\'9K\',\'7b\',\'K\',\'M\',\'7f\',\'5D\',\'5A\',\'48\',\'bD\',\'bC\',\'bH\',\'2f\',\'82\',\'3i\',\'3J\',\'31\',\'7I\',\'78\',\'3O\',\'4s\',\'5X\',\'6N\',\'8d\',\'4h\',\'2g\',\'an\',\'am\',\'T\'],1Q:[],4y:0,bI:{x:[\'ad\',\'1f\',\'6H\',\'2G\',\'ac\'],y:[\'4U\',\'18\',\'6q\',\'3E\',\'6a\']},5R:{},9c:{},9e:{},7I:{al:{},1E:{},ay:{}},3t:[],3G:{},3C:[],5b:[],4o:[],5J:{},7k:{},6h:[],26:/bM\\/4\\.0/.16(46.5V)?8:6t((46.5V.5x().2Z(/.+(?:9f|bJ|bK|1L)[\\/: ]([\\d.]+)/)||[0,\'0\'])[1]),1L:(N.4F&&!1y.30),4X:/bL/.16(46.5V),7V:/bx.+9f:1\\.[0-8].+bi/.16(46.5V),$:B(1j){q(1j)D N.6F(1j)},20:B(1P,2R){1P[1P.1c]=2R},14:B(9b,3h,3l,4r,95){u C=N.14(9b);q(3h)m.3e(C,3h);q(95)m.Q(C,{6z:0,ap:\'24\',6V:0});q(3l)m.Q(C,3l);q(4r)4r.1G(C);D C},3e:B(C,3h){W(u x 3A 3h)C[x]=3h[x];D C},Q:B(C,3l){W(u x 3A 3l){q(m.2Y&&x==\'1B\'){q(3l[x]>0.99)C.F.bp(\'4C\');L C.F.4C=\'97(1B=\'+(3l[x]*2A)+\')\'}L C.F[x]=3l[x]}},41:B(C,1a,2P){u 3S,3Y,3P;q(1t 2P!=\'6W\'||2P===I){u 2S=aE;2P={3w:2S[2],2g:2S[3],83:2S[4]}}q(1t 2P.3w!=\'42\')2P.3w=6j;2P.2g=1r[2P.2g]||1r.8M;2P.5d=m.3e({},1a);W(u 2z 3A 1a){u e=1w m.1C(C,2P,2z);3S=6t(m.79(C,2z))||0;3Y=6t(1a[2z]);3P=2z!=\'1B\'?\'E\':\'\';e.2O(3S,3Y,3P)}},79:B(C,1a){q(C.F[1a]){D C.F[1a]}L q(N.87){D N.87.9k(C,I).9i(1a)}L{q(1a==\'1B\')1a=\'4C\';u 2R=C.4u[1a.2i(/\\-(\\w)/g,B(a,b){D b.bo()})];q(1a==\'4C\')2R=2R.2i(/97\\(1B=([0-9]+)\\)/,B(a,b){D b/2A});D 2R===\'\'?1:2R}},5y:B(){u d=N,w=1y,58=d.5G&&d.5G!=\'6M\'?d.44:d.V,2Y=m.1L&&(m.26<9||1t 8y==\'1X\');u K=2Y?58.8Q:(d.44.8Q||5o.bv),M=2Y?58.bu:5o.bm;m.3k={K:K,M:M,5T:2Y?58.5T:8y,5U:2Y?58.5U:bf};D m.3k},85:B(C){u p={x:C.8x,y:C.6G};3T(C.8p){C=C.8p;p.x+=C.8x;p.y+=C.6G;q(C!=N.V&&C!=N.44){p.x-=C.5T;p.y-=C.5U}}D p},53:B(a,1E,2O,R){q(!a)a=m.14(\'a\',I,{1O:\'24\'},m.1S);q(1t a.4V==\'B\')D 1E;q(R==\'2Q\'){W(u i=0;i<m.3C.1c;i++){q(m.3C[i]&&m.3C[i].a==a){m.3C[i].a8();m.3C[i]=I;D 1h}}m.8O=J}1m{1w m.4S(a,1E,2O,R);D 1h}1l(e){D J}},8D:B(a,1E,2O){D m.53(a,1E,2O,\'2Q\')},7E:B(){D m.14(\'1i\',{1p:\'U-2Q-O\',2n:m.8w(m.8A.8B)})},4d:B(C,4c,1p){u 1k=C.3x(4c);W(u i=0;i<1k.1c;i++){q((1w 5P(1p)).16(1k[i].1p)){D 1k[i]}}D I},8w:B(s){s=s.2i(/\\s/g,\' \');u 2t=/{m\\.1e\\.([^}]+)\\}/g,55=s.2Z(2t),1e;q(55)W(u i=0;i<55.1c;i++){1e=55[i].2i(2t,"$1");q(1t m.1e[1e]!=\'1X\')s=s.2i(55[i],m.1e[1e])}D s},7t:B(a){W(u i=0;i<m.4o.1c;i++){q(m.4o[i][0]==a){u c=m.4o[i][1];m.4o[i][1]=c.61(1);D c}}D I},af:B(e){u 1P=m.4Z();W(u i=0;i<1P.4q.1c;i++){u a=1P.4q[i];q(m.3U(a,\'2f\')==\'2x\'&&m.3U(a,\'82\'))m.20(m.5b,a)}m.7r(0)},7r:B(i){q(!m.5b[i])D;u a=m.5b[i];u 51=m.3z(m.3U(a,\'7f\'));q(!51)51=m.7E();u 2x=1w m.5j(a,51,1);2x.7v=B(){};2x.2J=B(){m.20(m.4o,[a,51]);m.7r(i+1)};2x.7y()},8L:B(){u 7n=0,5g=-1,P=m.P,A,1u;W(u i=0;i<P.1c;i++){A=P[i];q(A){1u=A.Y.F.1u;q(1u&&1u>7n){7n=1u;5g=i}}}q(5g==-1)m.2q=-1;L P[5g].3d()},3U:B(a,4R){a.4V=a.2M;u p=a.4V?a.4V():I;a.4V=I;D(p&&1t p[4R]!=\'1X\')?p[4R]:(1t m[4R]!=\'1X\'?m[4R]:I)},5m:B(a){u T=m.3U(a,\'T\');q(T)D T;D a.2v},3z:B(1j){u 1D=m.$(1j),3M=m.7k[1j],a={};q(!1D&&!3M)D I;q(!3M){3M=1D.61(J);3M.1j=\'\';m.7k[1j]=3M;D 1D}L{D 3M.61(J)}},3j:B(d){q(d)m.7g.1G(d);m.7g.2n=\'\'},8t:B(7F,A){u 3r=A||m.3v();A=3r;q(m.3B)D 1h;L m.3r=3r;m.4g(N,1y.30?\'5i\':\'5h\',m.4D);1m{m.3B=7F;7F.2M()}1l(e){m.3r=m.3B=I}1m{A.28()}1l(e){}D 1h},5k:B(C,2w){u A=m.3v(C);q(A)D m.8t(A.6B(2w),A);L D 1h},5n:B(C){D m.5k(C,-1)},1M:B(C){D m.5k(C,1)},4D:B(e){q(!e)e=1y.1Y;q(!e.2j)e.2j=e.6p;q(1t e.2j.7O!=\'1X\')D J;u A=m.3v();u 2w=I;8T(e.aI){1J 70:q(A)A.7i();D J;1J 32:1J 34:1J 39:1J 40:2w=1;7N;1J 8:1J 33:1J 37:1J 38:2w=-1;7N;1J 27:1J 13:2w=0}q(2w!==I){m.4g(N,1y.30?\'5i\':\'5h\',m.4D);q(!m.8C)D J;q(e.65)e.65();L e.aY=1h;q(A){q(2w==0){A.28()}L{m.5k(A.S,2w)}D 1h}}D J},b1:B(19){m.20(m.1Q,m.3e(19,{2F:\'2F\'+m.4y++}))},7S:B(7C,5M){u C,2t=/^U-Y-([0-9]+)$/;C=7C;3T(C.3a){q(C.1j&&2t.16(C.1j))D C.1j.2i(2t,"$1");C=C.3a}q(!5M){C=7C;3T(C.3a){q(C.4c&&m.5W(C)){W(u S=0;S<m.P.1c;S++){u A=m.P[S];q(A&&A.a==C)D S}}C=C.3a}}D I},3v:B(C,5M){q(1t C==\'1X\')D m.P[m.2q]||I;q(1t C==\'42\')D m.P[C]||I;q(1t C==\'7L\')C=m.$(C);D m.P[m.7S(C,5M)]||I},5W:B(a){D(a.2M&&a.2M.9C().2i(/\\s/g,\' \').2Z(/m.(aV|e)b7/))},ab:B(){W(u i=0;i<m.P.1c;i++)q(m.P[i]&&m.P[i].4e)m.8L()},7K:B(e){q(!e)e=1y.1Y;q(e.aJ>1)D J;q(!e.2j)e.2j=e.6p;u C=e.2j;3T(C.3a&&!(/U-(2D|3I|2Q|3q)/.16(C.1p))){C=C.3a}u A=m.3v(C);q(A&&(A.4z||!A.4e))D J;q(A&&e.R==\'7H\'){q(e.2j.7O)D J;u 2Z=C.1p.2Z(/U-(2D|3I|3q)/);q(2Z){m.2a={A:A,R:2Z[1],1f:A.x.H,K:A.x.G,18:A.y.H,M:A.y.G,8J:e.5Q,8F:e.5f};m.1R(N,\'6o\',m.8a);q(e.65)e.65();q(/U-(2D|2Q)-7s/.16(A.O.1p)){A.3d();m.7p=J}D 1h}L q(/U-2Q/.16(C.1p)&&m.2q!=A.S){A.3d();A.4a(\'1n\')}}L q(e.R==\'9t\'){m.4g(N,\'6o\',m.8a);q(m.2a){q(m.4i&&m.2a.R==\'2D\')m.2a.A.O.F.3L=m.4i;u 3f=m.2a.3f;q(!3f&&!m.7p&&!/(3I|3q)/.16(m.2a.R)){A.28()}L q(3f||(!3f&&m.8O)){m.2a.A.4a(\'1n\')}q(m.2a.A.2W)m.2a.A.2W.F.1O=\'24\';m.7p=1h;m.2a=I}L q(/U-2D-7s/.16(C.1p)){C.F.3L=m.4i}}D 1h},8a:B(e){q(!m.2a)D J;q(!e)e=1y.1Y;u a=m.2a,A=a.A;q(A.11){q(!A.2W)A.2W=m.14(\'1i\',I,{1d:\'22\',K:A.x.G+\'E\',M:A.y.G+\'E\',1f:A.x.cb+\'E\',18:A.y.cb+\'E\',1u:4,94:(m.2Y?\'bh\':\'24\'),1B:0.cD},A.Y,J);q(A.2W.F.1O==\'24\')A.2W.F.1O=\'\'}a.5q=e.5Q-a.8J;a.5r=e.5f-a.8F;u 6A=1r.cU(1r.8E(a.5q,2)+1r.8E(a.5r,2));q(!a.3f)a.3f=(a.R!=\'2D\'&&6A>0)||(6A>(m.cR||5));q(a.3f&&e.5Q>5&&e.5f>5){q(a.R==\'3q\')A.3q(a);L{A.7x(a.1f+a.5q,a.18+a.5r);q(a.R==\'2D\')A.O.F.3L=\'3I\'}}D 1h},8c:B(e){1m{q(!e)e=1y.1Y;u 67=/cW/i.16(e.R);q(!e.2j)e.2j=e.6p;q(!e.6l)e.6l=67?e.cZ:e.cY;u A=m.3v(e.2j);q(!A.4e)D;q(!A||!e.6l||m.3v(e.6l,J)==A||m.2a)D;W(u i=0;i<A.1Q.1c;i++)(B(){u o=m.$(\'2F\'+A.1Q[i]);q(o&&o.5Z){q(67)m.Q(o,{1q:\'2l\',1O:\'\'});m.41(o,{1B:67?o.1B:0},o.3b)}})()}1l(e){}},1R:B(C,1Y,35){q(C==N&&1Y==\'3p\'){m.20(m.6h,35)}1m{C.1R(1Y,35,1h)}1l(e){1m{C.8I(\'4Q\'+1Y,35);C.cX(\'4Q\'+1Y,35)}1l(e){C[\'4Q\'+1Y]=35}}},4g:B(C,1Y,35){1m{C.4g(1Y,35,1h)}1l(e){1m{C.8I(\'4Q\'+1Y,35)}1l(e){C[\'4Q\'+1Y]=I}}},68:B(i){q(m.6n&&m.4P[i]&&m.4P[i]!=\'1X\'){u 1v=N.14(\'1v\');1v.3H=B(){1v=I;m.68(i+1)};1v.T=m.4P[i]}},9u:B(42){q(42&&1t 42!=\'6W\')m.71=42;u 1P=m.4Z();W(u i=0;i<1P.3Z.1c&&i<m.71;i++){m.20(m.4P,m.5m(1P.3Z[i]))}q(m.1x)1w m.4L(m.1x,B(){m.68(0)});L m.68(0);q(m.4E)u 6E=m.14(\'1v\',{T:m.56+m.4E})},5N:B(){q(!m.1S){m.3F=m.1L&&m.26<7;m.2Y=m.1L&&m.26<9;m.5y();m.9z=m.3F&&7T.cI==\'cH:\';W(u x 3A m.5z){q(1t m[x]!=\'1X\')m.1e[x]=m[x];L q(1t m.1e[x]==\'1X\'&&1t m.5z[x]!=\'1X\')m.1e[x]=m.5z[x]}m.1S=m.14(\'1i\',{1p:\'U-1S\'},{1d:\'22\',1f:0,18:0,K:\'2A%\',1u:m.4l,8b:\'8H\'},N.V,J);m.21=m.14(\'a\',{1p:\'U-21\',2u:m.1e.8G,2n:m.1e.8K,2v:\'9X:;\'},{1d:\'22\',18:\'-3R\',1B:m.8N,1u:1},m.1S);m.7g=m.14(\'1i\',I,{1O:\'24\'},m.1S);m.2I=m.14(\'1i\',I,{ar:\'aw\',cF:\'cJ\'},I,J);1r.cK=B(t,b,c,d){D c*t/d+b};1r.8M=B(t,b,c,d){D c*(t/=d)*t+b};m.9m=m.3F;m.9l=((1y.30&&m.26<9)||46.ai==\'ah\'||(m.3F&&m.26<5.5))}},3p:B(){q(m.6Z)D;m.6Z=J;W(u i=0;i<m.6h.1c;i++)m.6h[i]()},8u:B(){u C,1k,4F=[],3Z=[],4q=[],3m={},2t;W(u i=0;i<m.7B.1c;i++){1k=N.3x(m.7B[i]);W(u j=0;j<1k.1c;j++){C=1k[j];2t=m.5W(C);q(2t){m.20(4F,C);q(2t[0]==\'m.53\')m.20(3Z,C);L q(2t[0]==\'m.8D\')m.20(4q,C);u g=m.3U(C,\'4h\')||\'24\';q(!3m[g])3m[g]=[];m.20(3m[g],C)}}}m.5K={4F:4F,3m:3m,3Z:3Z,4q:4q};D m.5K},4Z:B(){D m.5K||m.8u()},28:B(C){u A=m.3v(C);q(A)A.28();D 1h}};m.1C=B(2k,1N,1a){k.1N=1N;k.2k=2k;k.1a=1a;q(!1N.8s)1N.8s={}};m.1C.54={7Q:B(){(m.1C.3o[k.1a]||m.1C.3o.8z)(k);q(k.1N.3o)k.1N.3o.8v(k.2k,k.3Q,k)},2O:B(8q,2h,3P){k.84=(1w 5s()).59();k.3S=8q;k.3Y=2h;k.3P=3P;k.3Q=k.3S;k.H=k.80=0;u 5o=k;B t(5e){D 5o.3o(5e)}t.2k=k.2k;q(t()&&m.3t.20(t)==1){m.8r=dk(B(){u 3t=m.3t;W(u i=0;i<3t.1c;i++)q(!3t[i]())3t.dh(i--,1);q(!3t.1c){df(m.8r)}},13)}},3o:B(5e){u t=(1w 5s()).59();q(5e||t>=k.1N.3w+k.84){k.3Q=k.3Y;k.H=k.80=1;k.7Q();k.1N.5d[k.1a]=J;u 86=J;W(u i 3A k.1N.5d)q(k.1N.5d[i]!==J)86=1h;q(86){q(k.1N.83)k.1N.83.8v(k.2k)}D 1h}L{u n=t-k.84;k.80=n/k.1N.3w;k.H=k.1N.2g(n,0,1,k.1N.3w);k.3Q=k.3S+((k.3Y-k.3S)*k.H);k.7Q()}D J}};m.3e(m.1C,{3o:{1B:B(1C){m.Q(1C.2k,{1B:1C.3Q})},8z:B(1C){1m{q(1C.2k.F&&1C.2k.F[1C.1a]!=I)1C.2k.F[1C.1a]=1C.3Q+1C.3P;L 1C.2k[1C.1a]=1C.3Q}1l(e){}}}});m.4L=B(1x,2J){k.2J=2J;k.1x=1x;u v=m.26,5O;k.6C=m.1L&&m.26<7;q(!1x){q(2J)2J();D}m.5N();k.2m=m.14(\'2m\',{d7:0},{1q:\'1n\',1d:\'22\',d8:\'dc\',K:0},m.1S,J);u 7W=m.14(\'7W\',I,I,k.2m,1);k.29=[];W(u i=0;i<=8;i++){q(i%3==0)5O=m.14(\'5O\',I,{M:\'1H\'},7W,J);k.29[i]=m.14(\'29\',I,I,5O,J);u F=i!=4?{db:0,da:0}:{1d:\'3K\'};m.Q(k.29[i],F)}k.29[4].1p=1x+\' U-1o\';k.8P()};m.4L.54={8P:B(){u T=m.56+(m.d9||"cL/")+k.1x+".cE";u 98=m.4X&&m.26<8i?m.1S:I;k.2X=m.14(\'1v\',I,{1d:\'22\',18:\'-3R\'},98,J);u 36=k;k.2X.3H=B(){36.96()};k.2X.T=T},96:B(){u o=k.1s=k.2X.K/4,H=[[0,0],[0,-4],[-2,0],[0,-8],0,[-2,-8],[0,-2],[0,-6],[-2,-2]],1F={M:(2*o)+\'E\',K:(2*o)+\'E\'};W(u i=0;i<=8;i++){q(H[i]){q(k.6C){u w=(i==1||i==7)?\'2A%\':k.2X.K+\'E\';u 1i=m.14(\'1i\',I,{K:\'2A%\',M:\'2A%\',1d:\'3K\',1W:\'1n\'},k.29[i],J);m.14(\'1i\',I,{4C:"c6:c5.9M.c4(c8=c9, T=\'"+k.2X.T+"\')",1d:\'22\',K:w,M:k.2X.M+\'E\',1f:(H[i][0]*o)+\'E\',18:(H[i][1]*o)+\'E\'},1i,J)}L{m.Q(k.29[i],{94:\'6X(\'+k.2X.T+\') \'+(H[i][0]*o)+\'E \'+(H[i][1]*o)+\'E\'})}q(1y.30&&(i==3||i==5))m.14(\'1i\',I,1F,k.29[i],J);m.Q(k.29[i],1F)}}k.2X=I;q(m.3G[k.1x])m.3G[k.1x].5l();m.3G[k.1x]=k;q(k.2J)k.2J()},4B:B(H,1s,9a,3b,2g){u A=k.A,4A=A.Y.F,1s=1s||0,H=H||{x:A.x.H+1s,y:A.y.H+1s,w:A.x.1b(\'1K\')-2*1s,h:A.y.1b(\'1K\')-2*1s};q(9a)k.2m.F.1q=(H.h>=4*k.1s)?\'2l\':\'1n\';m.Q(k.2m,{1f:(H.x-k.1s)+\'E\',18:(H.y-k.1s)+\'E\',K:(H.w+2*k.1s)+\'E\'});H.w-=2*k.1s;H.h-=2*k.1s;m.Q(k.29[4],{K:H.w>=0?H.w+\'E\':0,M:H.h>=0?H.h+\'E\':0});q(k.6C)k.29[3].F.M=k.29[5].F.M=k.29[4].F.M},5l:B(9d){q(9d)k.2m.F.1q=\'1n\';L m.3j(k.2m)}};m.5t=B(A,1F){k.A=A;k.1F=1F;k.2H=1F==\'x\'?\'cd\':\'cc\';k.2C=k.2H.5x();k.4J=1F==\'x\'?\'ca\':\'c3\';k.6J=k.4J.5x();k.6P=1F==\'x\'?\'c2\':\'bV\';k.bU=k.6P.5x();k.1V=k.2U=0};m.5t.54={1b:B(S){8T(S){1J\'7R\':D k.1A+k.2s+(k.t-m.21[\'1s\'+k.2H])/2;1J\'1K\':D k.G+2*k.cb+k.1V+k.2U;1J\'4b\':D k.5E-k.3y-k.5F;1J\'6K\':D k.1b(\'4b\')-2*k.cb-k.1V-k.2U;1J\'4w\':D k.H-(k.A.1o?k.A.1o.1s:0);1J\'88\':D k.1b(\'1K\')+(k.A.1o?2*k.A.1o.1s:0);1J\'5u\':D k.1T?1r.5Y((k.G-k.1T)/2):0}},6v:B(){k.cb=(k.A.O[\'1s\'+k.2H]-k.t)/2;k.5F=m[\'6V\'+k.6P]},6y:B(){k.t=k.A.C[k.2C]?49(k.A.C[k.2C]):k.A.C[\'1s\'+k.2H];k.1A=k.A.1A[k.1F];k.2s=(k.A.C[\'1s\'+k.2H]-k.t)/2;q(k.1A==0||k.1A==-1){k.1A=(m.3k[k.2C]/2)+m.3k[\'3s\'+k.4J]}},6u:B(){u A=k.A;k.3X=\'1H\';k.H=k.1A-k.cb+k.2s;q(k.6N&&k.1F==\'x\')A.5X=1r.2L(A.5X||k.Z,A.6N*k.Z/A.y.Z);k.G=1r.2L(k.Z,A[\'7l\'+k.2H]||k.Z);k.2E=A.4I?1r.2L(A[\'2L\'+k.2H],k.Z):k.Z;q(A.2o&&A.2K){k.G=A[k.2C];k.1T=k.Z}q(k.1F==\'x\'&&m.4M)k.2E=A.3O;k.3y=m[\'6V\'+k.4J];k.3s=m.3k[\'3s\'+k.4J];k.5E=m.3k[k.2C]},7J:B(i){u A=k.A;q(A.2o&&(A.2K||m.4M)){k.1T=i;k.G=1r.7l(k.G,k.1T);A.O.F[k.6J]=k.1b(\'5u\')+\'E\'}L k.G=i;A.O.F[k.2C]=i+\'E\';A.Y.F[k.2C]=k.1b(\'1K\')+\'E\';q(A.1o)A.1o.4B();q(A.2W)A.2W.F[k.2C]=i+\'E\';q(k.1F==\'y\'&&A.4v&&A.V.F.M!=\'1H\')1m{A.4v.V.F.1W=\'1H\'}1l(e){}q(A.1Z){u d=A.2c;q(k.7a===1X)k.7a=A.1g[\'1s\'+k.2H]-d[\'1s\'+k.2H];d.F[k.2C]=(k.G-k.7a)+\'E\';q(k.1F==\'x\')A.3D.F.K=\'1H\';q(A.V)A.V.F[k.2C]=\'1H\'}q(k.1F==\'x\'&&A.1z)A.4m(J)},7j:B(i){k.H=i;k.A.Y.F[k.6J]=i+\'E\';q(k.A.1o)k.A.1o.4B()}};m.4S=B(a,1E,2O,2B){q(N.9r&&m.1L&&!m.6Z){m.1R(N,\'3p\',B(){1w m.4S(a,1E,2O,2B)});D}k.a=a;k.2O=2O;k.2B=2B||\'2D\';k.1Z=(2B==\'2Q\');k.2o=!k.1Z;m.6n=1h;k.1Q=[];m.5N();u S=k.S=m.P.1c;W(u i=0;i<m.6s.1c;i++){u 2z=m.6s[i];k[2z]=1E&&1t 1E[2z]!=\'1X\'?1E[2z]:m[2z]}q(!k.T)k.T=a.2v;u C=(1E&&1E.6O)?m.$(1E.6O):a;C=k.8o=C.3x(\'1v\')[0]||C;k.6b=C.1j||a.1j;W(u i=0;i<m.P.1c;i++){q(m.P[i]&&m.P[i].a==a){m.P[i].3d();D 1h}}q(!m.cf)W(u i=0;i<m.P.1c;i++){q(m.P[i]&&m.P[i].8o!=C&&!m.P[i].6e){m.P[i].6w()}}m.P[S]=k;q(!m.7m&&!m.3B){q(m.P[S-1])m.P[S-1].28();q(1t m.2q!=\'1X\'&&m.P[m.2q])m.P[m.2q].28()}k.C=C;k.1A=k.8d||m.85(C);m.5y();u x=k.x=1w m.5t(k,\'x\');x.6y();u y=k.y=1w m.5t(k,\'y\');y.6y();k.Y=m.14(\'1i\',{1j:\'U-Y-\'+k.S,1p:\'U-Y \'+k.78},{1q:\'1n\',1d:\'22\',1u:m.4l+=2},I,J);k.Y.cg=k.Y.cw=m.8c;q(k.2B==\'2D\'&&k.3g==2)k.3g=0;q(!k.1x){k[k.2B+\'7P\']()}L q(m.3G[k.1x]){k.81();k[k.2B+\'7P\']()}L{k.4t();u A=k;1w m.4L(k.1x,B(){A.81();A[A.2B+\'7P\']()})}D J};m.4S.54={7w:B(e){q(m.cv)cu(\'ct \'+e.cx+\': \'+e.cy);L 1y.7T.2v=k.T},81:B(){u 1o=k.1o=m.3G[k.1x];1o.A=k;1o.2m.F.1u=k.Y.F.1u-1;m.3G[k.1x]=I},4t:B(){q(k.6e||k.21)D;k.21=m.21;u A=k;k.21.2M=B(){A.6w()};u A=k,l=k.x.1b(\'7R\')+\'E\',t=k.y.1b(\'7R\')+\'E\';4T(B(){q(A.21)m.Q(A.21,{1f:l,18:t,1u:m.4l++})},2A)},cz:B(){u A=k;u 1v=N.14(\'1v\');k.O=1v;1v.3H=B(){q(m.P[A.S])A.4x()};q(m.cs)1v.cr=B(){D 1h};1v.1p=\'U-2D\';m.Q(1v,{1q:\'1n\',1O:\'4H\',1d:\'22\',5X:\'3R\',1u:3});1v.2u=m.1e.7h;q(m.4X&&m.26<8i)m.1S.1G(1v);q(m.1L&&m.ch)1v.T=I;1v.T=k.T;k.4t()},cl:B(){k.O=m.7t(k.a);q(!k.O)k.O=m.3z(k.7f);q(!k.O)k.O=m.7E();k.77([\'6i\']);q(k.6i){u V=m.4d(k.O,\'1i\',\'U-V\');q(V)V.1G(k.6i);k.6i.F.1O=\'4H\'}u 1g=k.1g=k.O;q(/(3c|11)/.16(k.2f))k.7d(1g);m.1S.1G(k.Y);m.Q(k.Y,{1d:\'cp\',6z:\'0 \'+m.6m+\'E 0 \'+m.4j+\'E\'});k.O=m.14(\'1i\',{1p:\'U-2Q\'},{1d:\'3K\',1u:3,M:0,1W:\'1n\'},k.Y);k.3D=m.14(\'1i\',I,I,k.O,1);k.3D.1G(1g);m.Q(1g,{1d:\'3K\',1O:\'4H\',8b:m.1e.89||\'\'});q(k.K)1g.F.K=k.K+\'E\';q(k.M)m.Q(1g,{M:k.M+\'E\',1W:\'1n\'});q(1g.2e<k.3O)1g.F.K=k.3O+\'E\';q(k.2f==\'2x\'&&!m.7t(k.a)){k.4t();u A=k;u 2x=1w m.5j(k.a,1g);2x.T=k.T;2x.2J=B(){q(m.P[A.S])A.4x()};2x.7v=B(){7T.2v=A.T};2x.7y()}L q(k.2f==\'11\'&&k.31==\'4K\'){k.5S()}L k.4x()},4x:B(){1m{q(!k.O)D;k.O.3H=I;q(k.6e)D;L k.6e=J;u x=k.x,y=k.y;q(k.21){m.Q(k.21,{18:\'-3R\'});k.21=I}q(k.2o){x.Z=k.O.K;y.Z=k.O.M;m.Q(k.O,{K:x.t+\'E\',M:y.t+\'E\'});k.Y.1G(k.O);m.1S.1G(k.Y)}L q(k.76)k.76();x.6v();y.6v();m.Q(k.Y,{1f:(x.1A+x.2s-x.cb)+\'E\',18:(y.1A+x.2s-y.cb)+\'E\'});k.aa();u 2d=x.Z/y.Z;x.6u();k.3X(x);y.6u();k.3X(y);q(k.1Z)k.aq();q(k.1z)k.4m(0,1);q(k.4I){q(k.2o)k.aA(2d);L k.6Y();q(k.2o&&k.x.Z>(k.x.1T||k.x.G)){k.9W();q(k.1Q.1c==1)k.4m()}}k.7M()}1l(e){k.7w(e)}},7d:B(4r,1H){u c=m.4d(4r,\'5H\',\'U-V\');q(/(11|3c)/.16(k.2f)){q(k.3i)c.F.K=k.3i+\'E\';q(k.3J)c.F.M=k.3J+\'E\'}},5S:B(){q(k.av)D;u A=k;k.V=m.4d(k.1g,\'5H\',\'U-V\');q(k.2f==\'11\'){k.4t();u 4n=m.2I.61(1);k.V.1G(4n);k.cn=k.1g.2e;q(!k.3i)k.3i=4n.2e;u 45=k.1g.1I-k.V.1I,h=k.3J||m.3k.M-45-m.3N-m.6f,3H=k.31==\'4K\'?\' 3H="q (m.P[\'+k.S+\']) m.P[\'+k.S+\'].4x()" \':\'\';k.V.2n+=\'<11 2z="m\'+(1w 5s()).59()+\'" cq="0" S="\'+k.S+\'" \'+\' F="K:\'+k.3i+\'E; M:\'+h+\'E" \'+3H+\' T="\'+k.T+\'" ></11>\';k.4n=k.V.3x(\'1i\')[0];k.11=k.V.3x(\'11\')[0];q(k.31==\'4O\')k.6S()}q(k.2f==\'3c\'){k.V.1j=k.V.1j||\'m-cm-1j-\'+k.S;u a=k.7I;q(!a.1E)a.1E={};q(1t a.1E.aF==\'1X\')a.1E.aF=\'ci\';q(7D)7D.cj(k.T,k.V.1j,k.3i,k.3J,a.ck||\'7\',a.cC,a.al,a.1E,a.ay)}k.av=J},76:B(){q(k.11&&!k.3J){k.11.F.M=k.V.F.M=k.at()+\'E\'}k.1g.1G(m.2I);q(!k.x.Z)k.x.Z=k.1g.2e;k.y.Z=k.1g.1I;k.1g.aj(m.2I);q(m.1L&&k.au>49(k.1g.4u.M)){k.au=49(k.1g.4u.M)}m.Q(k.Y,{1d:\'22\',6z:\'0\'});m.Q(k.O,{K:k.x.t+\'E\',M:k.y.t+\'E\'})},at:B(){u h;1m{u 1U=k.4v=k.11.6r||k.11.52.N;u 2I=1U.14(\'1i\');2I.F.ar=\'aw\';1U.V.1G(2I);h=2I.6G;q(m.1L)h+=49(1U.V.4u.3N)+49(1U.V.4u.6f)-1}1l(e){h=bY}D h},6S:B(){u 4k=k.1g.2e-k.4n.2e;m.3j(k.4n);q(4k<0)4k=0;u 45=k.1g.1I-k.11.1I;q(k.4v&&!k.3J&&!k.M&&k.y.G==k.y.Z)1m{k.4v.V.F.1W=\'1n\'}1l(e){}m.Q(k.11,{K:1r.7u(k.x.G-4k)+\'E\',M:1r.7u(k.y.G-45)+\'E\'});m.Q(k.V,{K:k.11.F.K,M:k.11.F.M});k.4p=k.11;k.2c=k.4p},aq:B(){k.7d(k.1g);q(k.2f==\'3c\'&&k.31==\'4K\')k.5S();q(k.x.G<k.x.Z&&!k.5D)k.x.G=k.x.Z;q(k.y.G<k.y.Z&&!k.5A)k.y.G=k.y.Z;k.2c=k.1g;m.Q(k.3D,{1d:\'3K\',K:k.x.G+\'E\'});m.Q(k.1g,{ap:\'24\',K:\'1H\',M:\'1H\'});u 1D=m.4d(k.1g,\'5H\',\'U-V\');q(1D&&!/(11|3c)/.16(k.2f)){u 47=1D;1D=m.14(47.bZ,I,{1W:\'1n\'},I,J);47.3a.c0(1D,47);1D.1G(m.2I);1D.1G(47);u 4k=k.1g.2e-1D.2e;u 45=k.1g.1I-1D.1I;1D.aj(m.2I);u 5C=m.4X||46.ai==\'ah\'?1:0;m.Q(1D,{K:(k.x.G-4k-5C)+\'E\',M:(k.y.G-45)+\'E\',1W:\'1H\',1d:\'3K\'});q(5C&&47.1I>1D.1I){1D.F.K=(49(1D.F.K)+5C)+\'E\'}k.4p=1D;k.2c=k.4p}q(k.11&&k.31==\'4K\')k.6S();q(!k.4p&&k.y.G<k.3D.1I)k.2c=k.O;q(k.2c==k.O&&!k.5D&&!/(11|3c)/.16(k.2f)){k.x.G+=17}q(k.2c&&k.2c.1I>k.2c.3a.1I){4T("1m { m.P["+k.S+"].2c.F.1W = \'1H\'; } 1l(e) {}",m.7c)}},3X:B(p,3W){u bW,bS=p.2j,1F=p==k.x?\'x\':\'y\';u 6R=1h;u 3V=p.A.4I;p.H=1r.5Y(p.H-((p.1b(\'1K\')-p.t)/2));q(p.H<p.3s+p.3y){p.H=p.3s+p.3y;6R=J}q(!3W&&p.G<p.2E){p.G=p.2E;3V=1h}q(p.H+p.1b(\'1K\')>p.3s+p.5E-p.5F){q(!3W&&6R&&3V){p.G=1r.2L(p.G,p.1b(1F==\'y\'?\'4b\':\'6K\'))}L q(p.1b(\'1K\')<p.1b(\'4b\')){p.H=p.3s+p.5E-p.5F-p.1b(\'1K\')}L{p.H=p.3s+p.3y;q(!3W&&3V)p.G=p.1b(1F==\'y\'?\'4b\':\'6K\')}}q(!3W&&p.G<p.2E){p.G=p.2E;3V=1h}q(p.H<p.3y){u ao=p.H;p.H=p.3y;q(3V&&!3W)p.G=p.G-(p.H-ao)}},aA:B(2d){u x=k.x,y=k.y,2V=1h,2r=1r.2L(x.Z,x.G),2N=1r.2L(y.Z,y.G),2K=(k.2K||m.4M);q(2r/2N>2d){ 2r=2N*2d;q(2r<x.2E){2r=x.2E;2N=2r/2d}2V=J}L q(2r/2N<2d){ 2N=2r/2d;2V=J}q(m.4M&&x.Z<x.2E){x.1T=x.Z;y.G=y.1T=y.Z}L q(k.2K){x.1T=2r;y.1T=2N}L{x.G=2r;y.G=2N}2V=k.6Y(k.2K?I:2d,2V);q(2K&&y.G<y.1T){y.1T=y.G;x.1T=y.G*2d}q(2V||2K){x.H=x.1A-x.cb+x.2s;x.2E=x.G;k.3X(x,J);y.H=y.1A-y.cb+y.2s;y.2E=y.G;k.3X(y,J);q(k.1z)k.4m()}},6Y:B(2d,2V){u x=k.x,y=k.y;q(k.1z&&(k.2o||k.5A)){3T(y.G>k.4s&&x.G>k.3O&&y.1b(\'1K\')>y.1b(\'4b\')){y.G-=10;q(2d)x.G=y.G*2d;k.4m(0,1);2V=J}}D 2V},7M:B(){u x=k.x,y=k.y;k.4a(\'1n\');k.7z(1,{Y:{K:x.1b(\'1K\'),M:y.1b(\'1K\'),1f:x.H,18:y.H},O:{1f:x.1V+x.1b(\'5u\'),18:y.1V+y.1b(\'5u\'),K:x.1T||x.G,M:y.1T||y.G}},m.7c)},7z:B(2y,2h,3b){q(k.1o&&!k.3g){q(2y)k.1o.4B();L k.1o.5l((k.1Z&&k.48))}q(!2y)k.9V();u A=k,x=A.x,y=A.y,2g=k.2g;q(!2y)2g=k.an||2g;u 4O=2y?B(){q(A.1o)A.1o.2m.F.1q="2l";4T(B(){A.aC()},50)}:B(){A.7A()};q(2y)m.Q(k.Y,{K:x.t+\'E\',M:y.t+\'E\'});q(2y&&k.1Z){m.Q(k.Y,{1f:(x.1A-x.cb+x.2s)+\'E\',18:(y.1A-y.cb+y.2s)+\'E\'})}q(k.am){m.Q(k.Y,{1B:2y?0:1});m.3e(2h.Y,{1B:2y})}m.41(k.Y,2h.Y,{3w:3b,2g:2g,3o:B(2R,2S){q(A.1o&&A.3g&&2S.1a==\'18\'){u 4G=2y?2S.H:1-2S.H;u H={w:x.t+(x.1b(\'1K\')-x.t)*4G,h:y.t+(y.1b(\'1K\')-y.t)*4G,x:x.1A+(x.H-x.1A)*4G,y:y.1A+(y.H-y.1A)*4G};A.1o.4B(H,0,1)}q(A.1Z){q(2S.1a==\'1f\')A.3D.F.1f=(x.H-2R)+\'E\';q(2S.1a==\'18\')A.3D.F.18=(y.H-2R)+\'E\'}}});m.41(k.O,2h.O,3b,2g,4O);q(2y){k.Y.F.1q=\'2l\';k.O.F.1q=\'2l\';q(k.1Z)k.1g.F.1q=\'2l\';k.a.1p+=\' U-9T-9O\'}},aC:B(){k.4e=J;k.3d();q(k.1Z&&k.31==\'4O\')k.5S();q(k.11){1m{u A=k,1U=k.11.6r||k.11.52.N;m.1R(1U,\'7H\',B(){q(m.2q!=A.S)A.3d()})}1l(e){}q(m.1L&&1t k.4z!=\'ce\')k.11.F.K=(k.3i-1)+\'E\'}q(m.3B&&m.3B==k.a)m.3B=I;k.ax();u p=m.3k,6I=m.5R.x+p.5T,6D=m.5R.y+p.5U;k.6x=k.x.H<6I&&6I<k.x.H+k.x.1b(\'1K\')&&k.y.H<6D&&6D<k.y.H+k.y.1b(\'1K\');q(k.1z)k.9N()},ax:B(){u S=k.S;u 1x=k.1x;1w m.4L(1x,B(){1m{m.P[S].9h()}1l(e){}})},9h:B(){u 1M=k.6B(1);q(1M&&1M.2M.9C().2Z(/m\\.53/))u 1v=m.14(\'1v\',{T:m.5m(1M)})},6B:B(2w){u 9B=k.9A(),as=m.5K.3m[k.4h||\'24\'];D(as&&as[9B+2w])||I},9A:B(){u 1P=m.4Z().3m[k.4h||\'24\'];q(1P)W(u i=0;i<1P.1c;i++){q(1P[i]==k.a)D i}D I},6w:B(){m.3j(k.Y);m.P[k.S]=I;q(k.21)m.21.F.1f=\'-3R\'},a0:B(){k.7e=m.14(\'a\',{2v:m.9y,2j:m.9E,1p:\'U-7e\',2n:m.1e.ag,2u:m.1e.9F});k.4W({60:k.7e,1d:k.9K||\'18 1f\'})},77:B(7X,9x){W(u i=0;i<7X.1c;i++){u R=7X[i],s=I;q(!k[R+\'43\']&&k.6b)k[R+\'43\']=R+\'-W-\'+k.6b;q(k[R+\'43\'])k[R]=m.3z(k[R+\'43\']);q(!k[R]&&!k[R+\'7Z\']&&k[R+\'9I\'])1m{s=d4(k[R+\'9I\'])}1l(e){}q(!k[R]&&k[R+\'7Z\']){s=k[R+\'7Z\']}q(!k[R]&&!s){k[R]=m.3z(k.a[\'9G\'+R+\'43\']);q(!k[R]){u 1M=k.a.9H;3T(1M&&!m.5W(1M)){q((1w 5P(\'U-\'+R)).16(1M.1p||I)){q(!1M.1j)k.a[\'9G\'+R+\'43\']=1M.1j=\'2F\'+m.4y++;k[R]=m.3z(1M.1j);7N}1M=1M.9H}}}q(!k[R]&&s)k[R]=m.14(\'1i\',{1p:\'U-\'+R,2n:s});q(9x&&k[R]){u o={1d:(R==\'66\')?\'4U\':\'6a\'};W(u x 3A k[R+\'9w\'])o[x]=k[R+\'9w\'][x];o.60=k[R];k.4W(o)}}},4a:B(1q){q(m.9m)k.5a(\'d5\',1q);q(m.9l)k.5a(\'de\',1q);q(m.7V)k.5a(\'*\',1q)},5a:B(4c,1q){u 1k=N.3x(4c);u 1a=4c==\'*\'?\'1W\':\'1q\';W(u i=0;i<1k.1c;i++){q(1a==\'1q\'||(N.87.9k(1k[i],"").9i(\'1W\')==\'1H\'||1k[i].9j(\'1n-by\')!=I)){u 23=1k[i].9j(\'1n-by\');q(1q==\'2l\'&&23){23=23.2i(\'[\'+k.S+\']\',\'\');1k[i].4N(\'1n-by\',23);q(!23)1k[i].F[1a]=1k[i].7q}L q(1q==\'1n\'){u 2T=m.85(1k[i]);2T.w=1k[i].2e;2T.h=1k[i].1I;u 9o=(2T.x+2T.w<k.x.1b(\'4w\')||2T.x>k.x.1b(\'4w\')+k.x.1b(\'88\'));u 9p=(2T.y+2T.h<k.y.1b(\'4w\')||2T.y>k.y.1b(\'4w\')+k.y.1b(\'88\'));u 5c=m.7S(1k[i]);q(!9o&&!9p&&5c!=k.S){q(!23){1k[i].4N(\'1n-by\',\'[\'+k.S+\']\');1k[i].7q=1k[i].F[1a];1k[i].F[1a]=\'1n\'}L q(23.9v(\'[\'+k.S+\']\')==-1){1k[i].4N(\'1n-by\',23+\'[\'+k.S+\']\')}}L q((23==\'[\'+k.S+\']\'||m.2q==5c)&&5c!=k.S){1k[i].4N(\'1n-by\',\'\');1k[i].F[1a]=1k[i].7q||\'\'}L q(23&&23.9v(\'[\'+k.S+\']\')>-1){1k[i].4N(\'1n-by\',23.2i(\'[\'+k.S+\']\',\'\'))}}}}},3d:B(){k.Y.F.1u=m.4l+=2;W(u i=0;i<m.P.1c;i++){q(m.P[i]&&i==m.2q){u 4f=m.P[i];4f.O.1p+=\' U-\'+4f.2B+\'-7s\';q(4f.2o){4f.O.F.3L=m.3F?\'9q\':\'5w\';4f.O.2u=m.1e.9s}}}q(k.1o)k.1o.2m.F.1u=k.Y.F.1u-1;k.O.1p=\'U-\'+k.2B;q(k.2o){k.O.2u=m.1e.7h;q(m.4E){m.4i=1y.30?\'5w\':\'6X(\'+m.56+m.4E+\'), 5w\';q(m.3F&&m.26<6)m.4i=\'9q\';k.O.F.3L=m.4i}}m.2q=k.S;m.1R(N,1y.30?\'5i\':\'5h\',m.4D)},7x:B(x,y){k.x.7j(x);k.y.7j(y)},3q:B(e){u w,h,r=e.K/e.M;w=1r.7l(e.K+e.5q,1r.2L(k.3O,k.x.Z));q(k.2o&&1r.7u(w-k.x.Z)<12)w=k.x.Z;h=k.1Z?e.M+e.5r:w/r;q(h<1r.2L(k.4s,k.y.Z)){h=1r.2L(k.4s,k.y.Z);q(k.2o)w=h*r}k.7G(w,h)},7G:B(w,h){k.y.7J(h);k.x.7J(w);k.Y.F.M=k.y.1b(\'1K\')+\'E\'},28:B(){q(k.4z||!k.4e)D;k.4z=J;m.4g(N,1y.30?\'5i\':\'5h\',m.4D);1m{q(k.1Z)k.a5();k.O.F.3L=\'d1\';k.7z(0,{Y:{K:k.x.t,M:k.y.t,1f:k.x.1A-k.x.cb+k.x.2s,18:k.y.1A-k.y.cb+k.y.2s},O:{1f:0,18:0,K:k.x.t,M:k.y.t}},m.a7)}1l(e){k.7A()}},a5:B(){q(m.7V){q(!m.57)m.57=m.14(\'1i\',I,{1d:\'22\'},m.1S);m.Q(m.57,{K:k.x.G+\'E\',M:k.y.G+\'E\',1f:k.x.H+\'E\',18:k.y.H+\'E\',1O:\'4H\'})}q(k.2f==\'3c\')1m{m.$(k.V.1j).cN()}1l(e){}q(k.31==\'4O\'&&!k.48)k.a4();q(k.2c&&k.2c!=k.4p)k.2c.F.1W=\'1n\'},a4:B(){q(m.1L&&k.11)1m{k.11.52.N.V.2n=\'\'}1l(e){}q(k.2f==\'3c\')7D.cO(k.V.1j);k.V.2n=\'\'},9S:B(){q(k.1o)k.1o.2m.F.1O=\'24\';k.2W=I;k.Y.F.1O=\'24\';k.4e=1h;m.20(m.3C,k)},a8:B(){1m{m.P[k.S]=k;q(!m.7m&&m.2q!=k.S){1m{m.P[m.2q].28()}1l(e){}}u z=m.4l++,4A={1O:\'\',1u:z};m.Q(k.Y,4A);k.4z=1h;u o=k.1o||0;q(o){q(!k.3g)4A.1q=\'1n\';m.Q(o.2m,4A)}k.7M()}1l(e){}},4W:B(o){u C=o.60;q(1t C==\'7L\')C=m.3z(C);q(o.2Q)C=m.14(\'1i\',{2n:o.2Q});q(!C||1t C==\'7L\')D;C.F.1O=\'4H\';k.9Q();u K=o.K&&/^[0-9]+(E|%)$/.16(o.K)?o.K:\'1H\';q(/^(1f|2G)73$/.16(o.1d)&&!/^[0-9]+E$/.16(o.K))K=\'cG\';u 19=m.14(\'1i\',{1j:\'2F\'+m.4y++,2F:o.2F},{1d:\'22\',1q:\'1n\',K:K,8b:m.1e.89||\'\',1B:0},k.1z,J);19.1G(C);m.3e(19,{1B:1,a9:0,ae:0,3b:(o.7U===0||o.7U===1h||(o.7U==2&&m.1L))?0:6j});m.3e(19,o);q(k.9R){k.5p(19);q(!19.5Z||k.6x)m.41(19,{1B:19.1B},19.3b)}m.20(k.1Q,m.4y-1)},5p:B(19){u p=19.1d||\'6q 6H\',64=19.a9,62=19.ae;q(19.3a!=k.1z)k.1z.1G(19);q(/1f$/.16(p))19.F.1f=64+\'E\';q(/6H$/.16(p))m.Q(19,{1f:\'50%\',4j:(64-1r.5Y(19.2e/2))+\'E\'});q(/2G$/.16(p))19.F.2G=-64+\'E\';q(/^ad$/.16(p)){m.Q(19,{2G:\'2A%\',6m:k.x.cb+\'E\',18:-k.y.cb+\'E\',3E:-k.y.cb+\'E\',1W:\'1H\'});k.x.1V=19.2e}L q(/^ac$/.16(p)){m.Q(19,{1f:\'2A%\',4j:k.x.cb+\'E\',18:-k.y.cb+\'E\',3E:-k.y.cb+\'E\',1W:\'1H\'});k.x.2U=19.2e}q(/^18/.16(p))19.F.18=62+\'E\';q(/^6q/.16(p))m.Q(19,{18:\'50%\',3N:(62-1r.5Y(19.1I/2))+\'E\'});q(/^3E/.16(p))19.F.3E=-62+\'E\';q(/^4U$/.16(p)){m.Q(19,{1f:(-k.x.1V-k.x.cb)+\'E\',2G:(-k.x.2U-k.x.cb)+\'E\',3E:\'2A%\',6f:k.y.cb+\'E\',K:\'1H\'});k.y.1V=19.1I}L q(/^6a$/.16(p)){m.Q(19,{1d:\'3K\',1f:(-k.x.1V-k.x.cb)+\'E\',2G:(-k.x.2U-k.x.cb)+\'E\',18:\'2A%\',3N:k.y.cb+\'E\',K:\'1H\'});k.y.2U=19.1I;19.F.1d=\'22\'}},aa:B(){k.77([\'66\',\'cP\'],J);q(k.66&&k.7b)k.66.1p+=\' U-3I\';q(m.a1)k.a0();W(u i=0;i<m.1Q.1c;i++){u o=m.1Q[i],63=o.6O,6d=o.4h;q((!63&&!6d)||(63&&63==k.6b)||(6d&&6d===k.4h)){q(k.2o||(k.1Z&&o.cQ))k.4W(o)}}u 6g=[];W(u i=0;i<k.1Q.1c;i++){u o=m.$(\'2F\'+k.1Q[i]);q(/73$/.16(o.1d))k.5p(o);L m.20(6g,o)}W(u i=0;i<6g.1c;i++)k.5p(6g[i]);k.9R=J},9Q:B(){q(!k.1z)k.1z=m.14(\'1i\',{1p:k.78},{1d:\'22\',K:(k.x.G||(k.2K?k.K:I)||k.x.Z)+\'E\',M:(k.y.G||k.y.Z)+\'E\',1q:\'1n\',1W:\'1n\',1u:m.1L?4:\'1H\'},m.1S,J)},4m:B(74,9P){u 1z=k.1z,x=k.x,y=k.y;m.Q(1z,{K:x.G+\'E\',M:y.G+\'E\'});q(74||9P){W(u i=0;i<k.1Q.1c;i++){u o=m.$(\'2F\'+k.1Q[i]);u 72=(m.3F||N.5G==\'6M\');q(o&&/^(4U|6a)$/.16(o.1d)){q(72){o.F.K=(1z.2e+2*x.cb+x.1V+x.2U)+\'E\'}y[o.1d==\'4U\'?\'1V\':\'2U\']=o.1I}q(o&&72&&/^(1f|2G)73$/.16(o.1d)){o.F.M=(1z.1I+2*y.cb)+\'E\'}}}q(74){m.Q(k.O,{18:y.1V+\'E\'});m.Q(1z,{18:(y.1V+y.cb)+\'E\'})}},9N:B(){u b=k.1z;b.1p=\'\';m.Q(b,{18:(k.y.1V+k.y.cb)+\'E\',1f:(k.x.1V+k.x.cb)+\'E\',1W:\'2l\'});q(m.4X)b.F.1q=\'2l\';k.Y.1G(b);W(u i=0;i<k.1Q.1c;i++){u o=m.$(\'2F\'+k.1Q[i]);o.F.1u=o.1u||4;q(!o.5Z||k.6x){o.F.1q=\'2l\';m.Q(o,{1q:\'2l\',1O:\'\'});m.41(o,{1B:o.1B},o.3b)}}},9V:B(){q(!k.1Q.1c)D;q(k.1Z&&k.48){k.1z.F.18=\'-3R\';m.1S.1G(k.1z)}L m.3j(k.1z)},9W:B(){k.69=m.14(\'a\',{2v:\'9X:m.P[\'+k.S+\'].7i();\',2u:m.1e.9Y,1p:\'U-Z-53\'});k.4W({60:k.69,1d:m.9Z,5Z:J,1B:m.9U})},7i:B(){1m{q(k.69)m.3j(k.69);k.3d();u 2r=k.x.G,2N=k.y.G;k.7G(k.x.Z,k.y.Z);u 6k=k.x.H-(k.x.G-2r)/2;q(6k<m.4j)6k=m.4j;u 6c=k.y.H-(k.y.G-2N)/2;q(6c<m.3N)6c=m.3N;k.7x(6k,6c);k.4a(\'1n\')}1l(e){k.7w(e)}},7A:B(){k.a.1p=k.a.1p.2i(\'U-9T-9O\',\'\');k.4a(\'2l\');q(k.1Z&&k.48){k.9S()}L{q(k.1o&&k.3g)k.1o.5l();m.3j(k.Y)}q(m.57)m.57.F.1O=\'24\';m.P[k.S]=I;m.ab()}};m.5j=B(a,O,5L){k.a=a;k.O=O;k.5L=5L};m.5j.54={7y:B(){u 2b;q(!k.T)k.T=m.5m(k.a);q(k.T.2Z(\'#\')){u 1P=k.T.az(\'#\');k.T=1P[0];k.1j=1P[1]}q(m.5J[k.T]){k.9D=m.5J[k.T];q(k.1j)k.7Y();L k.4Y();D}1m{2b=1w 9n()}1l(e){1m{2b=1w a6("bE.9L")}1l(e){1m{2b=1w a6("9M.9L")}1l(e){k.7v()}}}u 36=k;2b.bF=B(){q(36.2b.9r==4){q(36.1j)36.7Y();L 36.4Y()}};u T=k.T;k.2b=2b;q(m.bd)T=T.2i(/$/,(/\\?/.16(T)?\'&\':\'?\')+\'bz=\'+(1w 5s()).59());2b.ak(\'bA\',T,J);2b.9J(\'X-bP-bN\',\'9n\');2b.9J(\'bw-bj\',\'bk/x-bl-7O-be\');2b.bg(I)},7Y:B(){m.5N();u 3h=1y.30||m.9z?{T:\'bs:br\'}:I;k.11=m.14(\'11\',3h,{1d:\'22\',18:\'-3R\'},m.1S);k.4Y()},4Y:B(){u s=k.9D||k.2b.bq,5I;q(k.5L)m.5J[k.T]=s;q(!m.1L||m.26>=5.5){s=s.2i(1w 5P(\'<bn[^>]*>\',\'aB\'),\'\').2i(1w 5P(\'<aD[^>]*>.*?</aD>\',\'aB\'),\'\');q(k.11){u 1U=k.11.6r;q(!1U&&k.11.52)1U=k.11.52.N;q(!1U){u 36=k;4T(B(){36.4Y()},25);D}1U.ak();1U.bO(s);1U.28();1m{s=1U.6F(k.1j).2n}1l(e){1m{s=k.11.N.6F(k.1j).2n}1l(e){}}m.3j(k.11)}L{5I=/(<V[^>]*>|<\\/V>)/ba;q(5I.16(s))s=s.az(5I)[m.2Y?1:2]}}m.4d(k.O,\'5H\',\'U-V\').2n=s;k.2J();W(u x 3A k)k[x]=I}};m.5z=m.1e;u b6=m.4S;q(m.1L&&1y==1y.18){(B(){1m{N.44.aW(\'1f\')}1l(e){4T(aE.aX,50);D}m.3p()})()}m.1R(N,\'b9\',m.3p);m.1R(1y,\'7o\',m.3p);m.1R(N,\'3p\',B(){q(m.5v){u F=m.14(\'F\',{R:\'aK/79\'},I,N.3x(\'aQ\')[0]),a2=N.5G==\'6M\';B 5B(6U,6T){q(m.1L&&(m.26<9||a2)){u 3r=N.a3[N.a3.1c-1];q(1t(3r.5B)=="6W")3r.5B(6U,6T)}L{F.1G(N.bb(6U+" {"+6T+"}"))}}B cT(1a){D\'cS( ( ( cV = N.44.\'+1a+\' ? N.44.\'+1a+\' : N.V.\'+1a+\' ) ) + \\\'E\\\' );\'}q(m.5v)5B(\'.U 1v\',\'3L: 6X(\'+m.56+m.5v+\'), 5w !d0;\')}});m.1R(1y,\'3q\',B(){m.5y()});m.1R(N,\'6o\',B(e){m.5R={x:e.5Q,y:e.5f}});m.1R(N,\'7H\',m.7K);m.1R(N,\'9t\',m.7K);m.1R(N,\'3p\',m.4Z);m.1R(1y,\'7o\',m.9u);m.1R(1y,\'7o\',m.af)}',62,827,'||||||||||||||||||||this||hs||||if||||var||||||exp|function|el|return|px|style|size|pos|null|true|width|else|height|document|content|expanders|setStyles|type|key|src|highslide|body|for||wrapper|full||iframe|||createElement||test||top|overlay|prop|get|length|position|lang|left|innerContent|false|div|id|els|catch|try|hidden|outline|className|visibility|Math|offset|typeof|zIndex|img|new|outlineType|window|overlayBox|tpos|opacity|fx|node|params|dim|appendChild|auto|offsetHeight|case|wsize|ie|next|options|display|arr|overlays|addEventListener|container|imgSize|doc|p1|overflow|undefined|event|isHtml|push|loading|absolute|hiddenBy|none||uaVersion||close|td|dragArgs|xhr|scrollerDiv|ratio|offsetWidth|objectType|easing|to|replace|target|elem|visible|table|innerHTML|isImage|span|focusKey|xSize|tb|re|title|href|op|ajax|up|name|100|contentType|wh|image|minSize|hsId|right|ucwh|clearing|onLoad|useBox|min|onclick|ySize|custom|opt|html|val|args|elPos|p2|changed|releaseMask|graphic|ieLt9|match|opera|objectLoadTime||||func|pThis||||parentNode|dur|swf|focus|extend|hasDragged|outlineWhileAnimating|attribs|objectWidth|discardElement|page|styles|groups|class|step|ready|resize|last|scroll|timers|li|getExpander|duration|getElementsByTagName|marginMin|getNode|in|upcoming|sleeping|mediumContent|bottom|ieLt7|pendingOutlines|onload|move|objectHeight|relative|cursor|clone|marginTop|minWidth|unit|now|9999px|start|while|getParam|allowReduce|moveOnly|justify|end|images||animate|number|Id|documentElement|hDiff|navigator|cNode|preserveContent|parseInt|doShowHide|fitsize|tagName|getElementByClass|isExpanded|blurExp|removeEventListener|slideshowGroup|styleRestoreCursor|marginLeft|wDiff|zIndexCounter|sizeOverlayBox|ruler|cacheBindings|scrollingContent|htmls|parent|minHeight|showLoading|currentStyle|iDoc|opos|contentLoaded|idCounter|isClosing|stl|setPosition|filter|keyHandler|restoreCursor|all|fac|block|allowSizeReduction|uclt|before|Outline|padToMinWidth|setAttribute|after|preloadTheseImages|on|param|Expander|setTimeout|above|getParams|createOverlay|safari|loadHTML|getAnchors||cache|contentWindow|expand|prototype|matches|graphicsDir|mask|iebody|getTime|showHideElements|preloadTheseAjax|wrapperKey|curAnim|gotoEnd|clientY|topmostKey|keydown|keypress|Ajax|previousOrNext|destroy|getSrc|previous|self|positionOverlay|dX|dY|Date|Dimension|imgPad|expandCursor|pointer|toLowerCase|getPageSize|langDefaults|allowHeightReduction|addRule|kdeBugCorr|allowWidthReduction|clientSize|marginMax|compatMode|DIV|regBody|cachedGets|anchors|pre|expOnly|init|tr|RegExp|clientX|mouse|writeExtendedContent|scrollLeft|scrollTop|userAgent|isHsAnchor|maxWidth|round|hideOnMouseOut|overlayId|cloneNode|offY|tId|offX|preventDefault|heading|over|preloadFullImage|fullExpandLabel|below|thumbsUserSetId|ypos|sg|onLoadStarted|marginBottom|os|onReady|maincontent|250|xpos|relatedTarget|marginRight|continuePreloading|mousemove|srcElement|middle|contentDocument|overrides|parseFloat|calcExpanded|calcBorders|cancelLoading|mouseIsOver|calcThumb|padding|distance|getAdjacentAnchor|hasAlphaImageLoader|mY|cur|getElementById|offsetTop|center|mX|lt|maxsize|arrow|BackCompat|maxHeight|thumbnailId|ucrb|Click|hasMovedMin|correctIframeSize|dec|sel|margin|object|url|fitOverlayBox|isReady||numberOfImagesToPreload|ie6|panel|doWrapper||htmlGetSize|getInline|wrapperClassName|css|sizeDiff|dragByHeading|expandDuration|setObjContainerSize|credits|contentId|garbageBin|restoreTitle|doFullExpand|setPos|clones|max|allowMultipleInstances|topZ|load|hasFocused|origProp|preloadAjaxElement|blur|getCacheBinding|abs|onError|error|moveTo|run|changeSize|afterClose|openerTagNames|element|swfobject|getSelfRendered|adj|resizeTo|mousedown|swfOptions|setSize|mouseClickHandler|string|show|break|form|Create|update|loadingPos|getWrapperKey|location|fade|geckoMac|tbody|types|getElementContent|Text|state|connectOutline|cacheAjax|complete|startTime|getPosition|done|defaultView|osize|cssDirection|dragHandler|direction|wrapperMouseHandler|pageOrigin|Next|JS|Highslide|Play|525|Close|Pause|spacebar|slideshow|Previous|thumb|offsetParent|from|timerId|orig|transit|updateAnchors|call|replaceLang|offsetLeft|pageXOffset|_default|skin|contentWrapper|enableKeyListener|htmlExpand|pow|clickY|loadingTitle|ltr|detachEvent|clickX|loadingText|focusTopmost|easeInQuad|loadingOpacity|hasHtmlExpanders|preloadGraphic|clientWidth|moveText|moveTitle|switch|closeTitle|closeText|nextText|nextTitle|and|200|previousTitle|previousText|ul|resizeTitle|background|nopad|onGraphicLoad|alpha|appendTo||vis|tag|headingOverlay|hide|captionOverlay|rv|Move|preloadNext|getPropertyValue|getAttribute|getComputedStyle|hideIframes|hideSelects|XMLHttpRequest|clearsX|clearsY|hand|readyState|focusTitle|mouseup|preloadImages|indexOf|Overlay|addOverlay|creditsHref|ie6SSL|getAnchorIndex|current|toString|cachedGet|creditsTarget|creditsTitle|_|nextSibling|Eval|setRequestHeader|creditsPosition|XMLHTTP|Microsoft|showOverlays|anchor|doPanels|genOverlayBox|gotOverlays|sleep|active|fullExpandOpacity|destroyOverlays|createFullExpand|javascript|fullExpandTitle|fullExpandPosition|writeCredits|showCredits|backCompat|styleSheets|destroyObject|htmlPrepareClose|ActiveXObject|restoreDuration|awake|offsetX|getOverlays|reOrder|rightpanel|leftpanel|offsetY|preloadAjax|creditsText|KDE|vendor|removeChild|open|flashvars|fadeInOut|easingClose|tmpMin|border|htmlSizeOperations|clear||getIframePageHeight|newHeight|hasExtendedContent|both|prepareNextOutline|attributes|split|correctRatio|gi|afterExpand|script|arguments|wmode|captionEval|Use|keyCode|button|text|drag|headingId|graphics|_self|shadow|HEAD|click|drop|keys|header|htmlE|doScroll|callee|returnValue|outlineStartOffset|footer|registerOverlay|http|headingText|com|captionId|HsExpander|xpand|fullExpandText|DOMContentLoaded|ig|createTextNode|captionText|forceAjaxReload|urlencoded|pageYOffset|send|white|Gecko|Type|application|www|innerHeight|link|toUpperCase|removeAttribute|responseText|blank|about|1001|clientHeight|innerWidth|Content|Macintosh||dummy|GET|zoomout|maincontentText|maincontentId|Msxml2|onreadystatechange|zoomin|maincontentEval|oPos|it|ra|Safari|Trident|With|write|Requested|headingEval|pauseTitle|tgt|actual|rb|Bottom|tgtArr|Expand|300|nodeName|insertBefore|front|Right|Top|AlphaImageLoader|DXImageTransform|progid|Powered|sizingMethod|scale|Left||Height|Width|boolean|allowSimultaneousLoading|onmouseover|flushImgSize|transparent|embedSWF|version|htmlCreate|flash|newWidth|Loading|static|frameborder|oncontextmenu|blockRightClick|Line|alert|debug|onmouseout|lineNumber|message|imageCreate|cancel|bring|expressInstallSwfurl|01|png|paddingTop|200px|https|protocol|1px|linearTween|outlines|pauseText|StopPlay|removeSWF|caption|useOnHtml|dragSensitivity|expression|fix|sqrt|ignoreMe|mouseover|attachEvent|toElement|fromElement|important|default|playTitle|Go|eval|SELECT|the|cellSpacing|borderCollapse|outlinesDir|fontSize|lineHeight|collapse|playText|IFRAME|clearInterval|homepage|splice|esc|Resize|setInterval'.split('|'),0,{}))
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide.css
new file mode 100644
index 0000000000000000000000000000000000000000..e4b60ee3f8141c8dbf29efd617128bedf2b297ad
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide.css
@@ -0,0 +1,889 @@
+/**
+* @file: highslide.css 
+* @version: 4.1.13
+*/
+.highslide-container div {
+	font-family: Verdana, Helvetica;
+	font-size: 10pt;
+}
+.highslide-container table {
+	background: none;
+}
+.highslide {
+	outline: none;
+	text-decoration: none;
+}
+.highslide img {
+	border: 2px solid silver;
+}
+.highslide:hover img {
+	border-color: gray;
+}
+.highslide-active-anchor img {
+	visibility: hidden;
+}
+.highslide-gallery .highslide-active-anchor img {
+	border-color: black;
+	visibility: visible;
+	cursor: default;
+}
+.highslide-image {
+	border-width: 2px;
+	border-style: solid;
+	border-color: white;
+}
+.highslide-wrapper, .highslide-outline {
+	background: white;
+}
+.glossy-dark {
+	background: #111;
+}
+
+.highslide-image-blur {
+}
+.highslide-number {
+	font-weight: bold;
+	color: gray;
+	font-size: .9em;
+}
+.highslide-caption {
+	display: none;
+	font-size: 1em;
+	padding: 5px;
+	/*background: white;*/
+}
+.highslide-heading {
+	display: none;
+	font-weight: bold;
+	margin: 0.4em;
+}
+.highslide-dimming {
+	/*position: absolute;*/
+	background: black;
+}
+a.highslide-full-expand {
+   background: url(graphics/fullexpand.gif) no-repeat;
+   display: block;
+   margin: 0 10px 10px 0;
+   width: 34px;
+   height: 34px;
+}
+.highslide-loading {
+	display: block;
+	color: black;
+	font-size: 9px;
+	font-weight: bold;
+	text-transform: uppercase;
+	text-decoration: none;
+	padding: 3px;
+	border: 1px solid white;
+	background-color: white;
+	padding-left: 22px;
+	background-image: url(graphics/loader.white.gif);
+	background-repeat: no-repeat;
+	background-position: 3px 1px;
+}
+a.highslide-credits,
+a.highslide-credits i {
+	padding: 2px;
+	color: silver;
+	text-decoration: none;
+	font-size: 10px;
+}
+a.highslide-credits:hover,
+a.highslide-credits:hover i {
+	color: white;
+	background-color: gray;
+}
+.highslide-move, .highslide-move * {
+	cursor: move;
+}
+
+.highslide-viewport {
+	display: none;
+	position: fixed;
+	width: 100%;
+	height: 100%;
+	z-index: 10001;
+	background: none;
+	left: 0;
+	top: 0;
+}
+.highslide-overlay {
+	display: none;
+}
+.hidden-container {
+	display: none;
+}
+/* Example of a semitransparent, offset closebutton */
+.closebutton {
+	position: relative;
+	top: -15px;
+	left: 15px;
+	width: 30px;
+	height: 30px;
+	cursor: pointer;
+	background: url(graphics/close.png);
+	/* NOTE! For IE6, you also need to update the highslide-ie6.css file. */
+}
+
+/*****************************************************************************/
+/* Thumbnail boxes for the galleries.                                        */
+/* Remove these if you are not using a gallery.                              */
+/*****************************************************************************/
+.highslide-gallery ul {
+	list-style-type: none;
+	margin: 0;
+	padding: 0;
+}
+.highslide-gallery ul li {
+	display: block;
+	position: relative;
+	float: left;
+	width: 106px;
+	height: 106px;
+	border: 1px solid silver;
+	background: #ededed;
+	margin: 2px;
+	padding: 0;
+	line-height: 0;
+	overflow: hidden;
+}
+.highslide-gallery ul a {
+	position: absolute;
+	top: 50%;
+	left: 50%;
+}
+.highslide-gallery ul img {
+ 	position: relative;
+	top: -50%;
+	left: -50%;
+}
+html>/**/body .highslide-gallery ul li {
+	display: table;
+	text-align: center;
+}
+html>/**/body .highslide-gallery ul li {
+	text-align: center;
+}
+html>/**/body .highslide-gallery ul a {
+	position: static;
+	display: table-cell;
+	vertical-align: middle;
+}
+html>/**/body .highslide-gallery ul img {
+	position: static;
+}
+
+/*****************************************************************************/
+/* Controls for the galleries.											     */
+/* Remove these if you are not using a gallery							     */
+/*****************************************************************************/
+.highslide-controls {
+	width: 195px;
+	height: 40px;
+	background: url(graphics/controlbar-white.gif) 0 -90px no-repeat;
+	margin: 20px 15px 10px 0;
+}
+.highslide-controls ul {
+	position: relative;
+	left: 15px;
+	height: 40px;
+	list-style: none;
+	margin: 0;
+	padding: 0;
+	background: url(graphics/controlbar-white.gif) right -90px no-repeat;
+
+}
+.highslide-controls li {
+	float: left;
+	padding: 5px 0;
+	margin:0;
+	list-style: none;
+}
+.highslide-controls a {
+	background-image: url(graphics/controlbar-white.gif);
+	display: block;
+	float: left;
+	height: 30px;
+	width: 30px;
+	outline: none;
+}
+.highslide-controls a.disabled {
+	cursor: default;
+}
+.highslide-controls a.disabled span {
+	cursor: default;
+}
+.highslide-controls a span {
+	/* hide the text for these graphic buttons */
+	display: none;
+	cursor: pointer;
+}
+
+
+/* The CSS sprites for the controlbar - see http://www.google.com/search?q=css+sprites */
+.highslide-controls .highslide-previous a {
+	background-position: 0 0;
+}
+.highslide-controls .highslide-previous a:hover {
+	background-position: 0 -30px;
+}
+.highslide-controls .highslide-previous a.disabled {
+	background-position: 0 -60px !important;
+}
+.highslide-controls .highslide-play a {
+	background-position: -30px 0;
+}
+.highslide-controls .highslide-play a:hover {
+	background-position: -30px -30px;
+}
+.highslide-controls .highslide-play a.disabled {
+	background-position: -30px -60px !important;
+}
+.highslide-controls .highslide-pause a {
+	background-position: -60px 0;
+}
+.highslide-controls .highslide-pause a:hover {
+	background-position: -60px -30px;
+}
+.highslide-controls .highslide-next a {
+	background-position: -90px 0;
+}
+.highslide-controls .highslide-next a:hover {
+	background-position: -90px -30px;
+}
+.highslide-controls .highslide-next a.disabled {
+	background-position: -90px -60px !important;
+}
+.highslide-controls .highslide-move a {
+	background-position: -120px 0;
+}
+.highslide-controls .highslide-move a:hover {
+	background-position: -120px -30px;
+}
+.highslide-controls .highslide-full-expand a {
+	background-position: -150px 0;
+}
+.highslide-controls .highslide-full-expand a:hover {
+	background-position: -150px -30px;
+}
+.highslide-controls .highslide-full-expand a.disabled {
+	background-position: -150px -60px !important;
+}
+.highslide-controls .highslide-close a {
+	background-position: -180px 0;
+}
+.highslide-controls .highslide-close a:hover {
+	background-position: -180px -30px;
+}
+
+/*****************************************************************************/
+/* Styles for the HTML popups											     */
+/* Remove these if you are not using Highslide HTML						     */
+/*****************************************************************************/
+.highslide-maincontent {
+	display: none;
+}
+.highslide-html {
+	background-color: white;
+}
+.mobile .highslide-html {
+	border: 1px solid silver;
+}
+.highslide-html-content {
+	display: none;
+	width: 400px;
+	padding: 0 5px 5px 5px;
+}
+.highslide-header {
+	padding-bottom: 5px;
+}
+.highslide-header ul {
+	margin: 0;
+	padding: 0;
+	text-align: right;
+}
+.highslide-header ul li {
+	display: inline;
+	padding-left: 1em;
+}
+.highslide-header ul li.highslide-previous, .highslide-header ul li.highslide-next {
+	display: none;
+}
+.highslide-header a {
+	font-weight: bold;
+	color: gray;
+	text-transform: uppercase;
+	text-decoration: none;
+}
+.highslide-header a:hover {
+	color: black;
+}
+.highslide-header .highslide-move a {
+	cursor: move;
+}
+.highslide-footer {
+	height: 16px;
+}
+.highslide-footer .highslide-resize {
+	display: block;
+	float: right;
+	margin-top: 5px;
+	height: 11px;
+	width: 11px;
+	background: url(graphics/resize.gif) no-repeat;
+}
+.highslide-footer .highslide-resize span {
+	display: none;
+}
+.highslide-body {
+}
+.highslide-resize {
+	cursor: nw-resize;
+}
+
+/*****************************************************************************/
+/* Styles for the Individual wrapper class names.							 */
+/* See www.highslide.com/ref/hs.wrapperClassName							 */
+/* You can safely remove the class name themes you don't use				 */
+/*****************************************************************************/
+
+/* hs.wrapperClassName = 'draggable-header' */
+.draggable-header .highslide-header {
+	height: 18px;
+	border-bottom: 1px solid #dddddd;
+}
+.draggable-header .highslide-heading {
+	position: absolute;
+	margin: 2px 0.4em;
+}
+
+.draggable-header .highslide-header .highslide-move {
+	cursor: move;
+	display: block;
+	height: 16px;
+	position: absolute;
+	right: 24px;
+	top: 0;
+	width: 100%;
+	z-index: 10001;
+}
+.draggable-header .highslide-header .highslide-move * {
+	display: none;
+}
+.draggable-header .highslide-header .highslide-close {
+	position: absolute;
+	right: 2px;
+	top: 2px;
+	z-index: 10005;
+	padding: 0;
+}
+.draggable-header .highslide-header .highslide-close a {
+	display: block;
+	height: 16px;
+	width: 16px;
+	background-image: url(graphics/closeX.png);
+}
+.draggable-header .highslide-header .highslide-close a:hover {
+	background-position: 0 16px;
+}
+.draggable-header .highslide-header .highslide-close span {
+	display: none;
+}
+.draggable-header .highslide-maincontent {
+	padding-top: 1em;
+}
+
+/* hs.wrapperClassName = 'titlebar' */
+.titlebar .highslide-header {
+	height: 18px;
+	border-bottom: 1px solid #dddddd;
+}
+.titlebar .highslide-heading {
+	position: absolute;
+	width: 90%;
+	margin: 1px 0 1px 5px;
+	color: #666666;
+}
+
+.titlebar .highslide-header .highslide-move {
+	cursor: move;
+	display: block;
+	height: 16px;
+	position: absolute;
+	right: 24px;
+	top: 0;
+	width: 100%;
+	z-index: 10001;
+}
+.titlebar .highslide-header .highslide-move * {
+	display: none;
+}
+.titlebar .highslide-header li {
+	position: relative;
+	top: 3px;
+	z-index: 10002;
+	padding: 0 0 0 1em;
+}
+.titlebar .highslide-maincontent {
+	padding-top: 1em;
+}
+
+/* hs.wrapperClassName = 'no-footer' */
+.no-footer .highslide-footer {
+	display: none;
+}
+
+/* hs.wrapperClassName = 'wide-border' */
+.wide-border {
+	background: white;
+}
+.wide-border .highslide-image {
+	border-width: 10px;
+}
+.wide-border .highslide-caption {
+	padding: 0 10px 10px 10px;
+}
+
+/* hs.wrapperClassName = 'borderless' */
+.borderless .highslide-image {
+	border: none;
+}
+.borderless .highslide-caption {
+	border-bottom: 1px solid white;
+	border-top: 1px solid white;
+	background: silver;
+}
+
+/* hs.wrapperClassName = 'outer-glow' */
+.outer-glow {
+	background: #444;
+}
+.outer-glow .highslide-image {
+	border: 5px solid #444444;
+}
+.outer-glow .highslide-caption {
+	border: 5px solid #444444;
+	border-top: none;
+	padding: 5px;
+	background-color: gray;
+}
+
+/* hs.wrapperClassName = 'colored-border' */
+.colored-border {
+	background: white;
+}
+.colored-border .highslide-image {
+	border: 2px solid green;
+}
+.colored-border .highslide-caption {
+	border: 2px solid green;
+	border-top: none;
+}
+
+/* hs.wrapperClassName = 'dark' */
+.dark {
+	background: #111;
+}
+.dark .highslide-image {
+	border-color: black black #202020 black;
+	background: gray;
+}
+.dark .highslide-caption {
+	color: white;
+	background: #111;
+}
+.dark .highslide-controls,
+.dark .highslide-controls ul,
+.dark .highslide-controls a {
+	background-image: url(graphics/controlbar-black-border.gif);
+}
+
+/* hs.wrapperClassName = 'floating-caption' */
+.floating-caption .highslide-caption {
+	position: absolute;
+	padding: 1em 0 0 0;
+	background: none;
+	color: white;
+	border: none;
+	font-weight: bold;
+}
+
+/* hs.wrapperClassName = 'controls-in-heading' */
+.controls-in-heading .highslide-heading {
+	color: gray;
+	font-weight: bold;
+	height: 20px;
+	overflow: hidden;
+	cursor: default;
+	padding: 0 0 0 22px;
+	margin: 0;
+	background: url(graphics/icon.gif) no-repeat 0 1px;
+}
+.controls-in-heading .highslide-controls {
+	width: 105px;
+	height: 20px;
+	position: relative;
+	margin: 0;
+	top: -23px;
+	left: 7px;
+	background: none;
+}
+.controls-in-heading .highslide-controls ul {
+	position: static;
+	height: 20px;
+	background: none;
+}
+.controls-in-heading .highslide-controls li {
+	padding: 0;
+}
+.controls-in-heading .highslide-controls a {
+	background-image: url(graphics/controlbar-white-small.gif);
+	height: 20px;
+	width: 20px;
+}
+
+.controls-in-heading .highslide-controls .highslide-move {
+	display: none;
+}
+
+.controls-in-heading .highslide-controls .highslide-previous a {
+	background-position: 0 0;
+}
+.controls-in-heading .highslide-controls .highslide-previous a:hover {
+	background-position: 0 -20px;
+}
+.controls-in-heading .highslide-controls .highslide-previous a.disabled {
+	background-position: 0 -40px !important;
+}
+.controls-in-heading .highslide-controls .highslide-play a {
+	background-position: -20px 0;
+}
+.controls-in-heading .highslide-controls .highslide-play a:hover {
+	background-position: -20px -20px;
+}
+.controls-in-heading .highslide-controls .highslide-play a.disabled {
+	background-position: -20px -40px !important;
+}
+.controls-in-heading .highslide-controls .highslide-pause a {
+	background-position: -40px 0;
+}
+.controls-in-heading .highslide-controls .highslide-pause a:hover {
+	background-position: -40px -20px;
+}
+.controls-in-heading .highslide-controls .highslide-next a {
+	background-position: -60px 0;
+}
+.controls-in-heading .highslide-controls .highslide-next a:hover {
+	background-position: -60px -20px;
+}
+.controls-in-heading .highslide-controls .highslide-next a.disabled {
+	background-position: -60px -40px !important;
+}
+.controls-in-heading .highslide-controls .highslide-full-expand a {
+	background-position: -100px 0;
+}
+.controls-in-heading .highslide-controls .highslide-full-expand a:hover {
+	background-position: -100px -20px;
+}
+.controls-in-heading .highslide-controls .highslide-full-expand a.disabled {
+	background-position: -100px -40px !important;
+}
+.controls-in-heading .highslide-controls .highslide-close a {
+	background-position: -120px 0;
+}
+.controls-in-heading .highslide-controls .highslide-close a:hover {
+	background-position: -120px -20px;
+}
+
+/*****************************************************************************/
+/* Styles for text based controls.						                     */
+/* You can safely remove this if you don't use text based controls			 */
+/*****************************************************************************/
+
+.text-controls .highslide-controls {
+	width: auto;
+	height: auto;
+	margin: 0;
+	text-align: center;
+	background: none;
+}
+.text-controls ul {
+	position: static;
+	background: none;
+	height: auto;
+	left: 0;
+}
+.text-controls .highslide-move {
+	display: none;
+}
+.text-controls li {
+    background-image: url(graphics/controlbar-text-buttons.png);
+	background-position: right top !important;
+	padding: 0;
+	margin-left: 15px;
+	display: block;
+	width: auto;
+}
+.text-controls a {
+    background: url(graphics/controlbar-text-buttons.png) no-repeat;
+    background-position: left top !important;
+    position: relative;
+    left: -10px;
+	display: block;
+	width: auto;
+	height: auto;
+	text-decoration: none !important;
+}
+.text-controls a span {
+	background: url(graphics/controlbar-text-buttons.png) no-repeat;
+    margin: 1px 2px 1px 10px;
+	display: block;
+    min-width: 4em;
+    height: 18px;
+    line-height: 18px;
+	padding: 1px 0 1px 18px;
+    color: #333;
+	font-family: "Trebuchet MS", Arial, sans-serif;
+	font-size: 12px;
+	font-weight: bold;
+	white-space: nowrap;
+}
+.text-controls .highslide-next {
+	margin-right: 1em;
+}
+.text-controls .highslide-full-expand a span {
+	min-width: 0;
+	margin: 1px 0;
+	padding: 1px 0 1px 10px;
+}
+.text-controls .highslide-close a span {
+	min-width: 0;
+}
+.text-controls a:hover span {
+	color: black;
+}
+.text-controls a.disabled span {
+	color: #999;
+}
+
+.text-controls .highslide-previous span {
+	background-position: 0 -40px;
+}
+.text-controls .highslide-previous a.disabled {
+	background-position: left top !important;
+}
+.text-controls .highslide-previous a.disabled span {
+	background-position: 0 -140px;
+}
+.text-controls .highslide-play span {
+	background-position: 0 -60px;
+}
+.text-controls .highslide-play a.disabled {
+	background-position: left top !important;
+}
+.text-controls .highslide-play a.disabled span {
+	background-position: 0 -160px;
+}
+.text-controls .highslide-pause span {
+	background-position: 0 -80px;
+}
+.text-controls .highslide-next span {
+	background-position: 0 -100px;
+}
+.text-controls .highslide-next a.disabled {
+	background-position: left top !important;
+}
+.text-controls .highslide-next a.disabled span {
+	background-position: 0 -200px;
+}
+.text-controls .highslide-full-expand span {
+	background: none;
+}
+.text-controls .highslide-full-expand a.disabled {
+	background-position: left top !important;
+}
+.text-controls .highslide-close span {
+	background-position: 0 -120px;
+}
+
+
+/*****************************************************************************/
+/* Styles for the thumbstrip.							                     */
+/* See www.highslide.com/ref/hs.addSlideshow    							 */
+/* You can safely remove this if you don't use a thumbstrip 				 */
+/*****************************************************************************/
+
+.highslide-thumbstrip {
+	height: 100%;
+	direction: ltr;
+}
+.highslide-thumbstrip div {
+	overflow: hidden;
+}
+.highslide-thumbstrip table {
+	position: relative;
+	padding: 0;
+	border-collapse: collapse;
+}
+.highslide-thumbstrip td {
+	padding: 1px;
+	/*text-align: center;*/
+}
+.highslide-thumbstrip a {
+	outline: none;
+}
+.highslide-thumbstrip img {
+	display: block;
+	border: 1px solid gray;
+	margin: 0 auto;
+}
+.highslide-thumbstrip .highslide-active-anchor img {
+	visibility: visible;
+}
+.highslide-thumbstrip .highslide-marker {
+	position: absolute;
+	width: 0;
+	height: 0;
+	border-width: 0;
+	border-style: solid;
+	border-color: transparent; /* change this to actual background color in highslide-ie6.css */
+}
+.highslide-thumbstrip-horizontal div {
+	width: auto;
+	/* width: 100% breaks in small strips in IE */
+}
+.highslide-thumbstrip-horizontal .highslide-scroll-up {
+	display: none;
+	position: absolute;
+	top: 3px;
+	left: 3px;
+	width: 25px;
+	height: 42px;
+}
+.highslide-thumbstrip-horizontal .highslide-scroll-up div {
+	margin-bottom: 10px;
+	cursor: pointer;
+	background: url(graphics/scrollarrows.png) left center no-repeat;
+	height: 42px;
+}
+.highslide-thumbstrip-horizontal .highslide-scroll-down {
+	display: none;
+	position: absolute;
+	top: 3px;
+	right: 3px;
+	width: 25px;
+	height: 42px;
+}
+.highslide-thumbstrip-horizontal .highslide-scroll-down div {
+	margin-bottom: 10px;
+	cursor: pointer;
+	background: url(graphics/scrollarrows.png) center right no-repeat;
+	height: 42px;
+}
+.highslide-thumbstrip-horizontal table {
+	margin: 2px 0 10px 0;
+}
+.highslide-viewport .highslide-thumbstrip-horizontal table {
+	margin-left: 10px;
+}
+.highslide-thumbstrip-horizontal img {
+	width: auto;
+	height: 40px;
+}
+.highslide-thumbstrip-horizontal .highslide-marker {
+	top: 47px;
+	border-left-width: 6px;
+	border-right-width: 6px;
+	border-bottom: 6px solid gray;
+}
+.highslide-viewport .highslide-thumbstrip-horizontal .highslide-marker {
+	margin-left: 10px;
+}
+.dark .highslide-thumbstrip-horizontal .highslide-marker, .highslide-viewport .highslide-thumbstrip-horizontal .highslide-marker {
+	border-bottom-color: white !important;
+}
+
+.highslide-thumbstrip-vertical-overlay {
+	overflow: hidden !important;
+}
+.highslide-thumbstrip-vertical div {
+	height: 100%;
+}
+.highslide-thumbstrip-vertical a {
+	display: block;
+}
+.highslide-thumbstrip-vertical .highslide-scroll-up {
+	display: none;
+	position: absolute;
+	top: 0;
+	left: 0;
+	width: 100%;
+	height: 25px;
+}
+.highslide-thumbstrip-vertical .highslide-scroll-up div {
+	margin-left: 10px;
+	cursor: pointer;
+	background: url(graphics/scrollarrows.png) top center no-repeat;
+	height: 25px;
+}
+.highslide-thumbstrip-vertical .highslide-scroll-down {
+	display: none;
+	position: absolute;
+	bottom: 0;
+	left: 0;
+	width: 100%;
+	height: 25px;
+}
+.highslide-thumbstrip-vertical .highslide-scroll-down div {
+	margin-left: 10px;
+	cursor: pointer;
+	background: url(graphics/scrollarrows.png) bottom center no-repeat;
+	height: 25px;
+}
+.highslide-thumbstrip-vertical table {
+	margin: 10px 0 0 10px;
+}
+.highslide-thumbstrip-vertical img {
+	width: 60px; /* t=5481 */
+}
+.highslide-thumbstrip-vertical .highslide-marker {
+	left: 0;
+	margin-top: 8px;
+	border-top-width: 6px;
+	border-bottom-width: 6px;
+	border-left: 6px solid gray;
+}
+.dark .highslide-thumbstrip-vertical .highslide-marker, .highslide-viewport .highslide-thumbstrip-vertical .highslide-marker {
+	border-left-color: white;
+}
+
+.highslide-viewport .highslide-thumbstrip-float {
+	overflow: auto;
+}
+.highslide-thumbstrip-float ul {
+	margin: 2px 0;
+	padding: 0;
+}
+.highslide-thumbstrip-float li {
+	display: block;
+	height: 60px;
+	margin: 0 2px;
+	list-style: none;
+	float: left;
+}
+.highslide-thumbstrip-float img {
+	display: inline;
+	border-color: silver;
+	max-height: 56px;
+}
+.highslide-thumbstrip-float .highslide-active-anchor img {
+	border-color: black;
+}
+.highslide-thumbstrip-float .highslide-scroll-up div, .highslide-thumbstrip-float .highslide-scroll-down div {
+	display: none;
+}
+.highslide-thumbstrip-float .highslide-marker {
+	display: none;
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide.js
new file mode 100644
index 0000000000000000000000000000000000000000..9c543a0b0baf23094c0955e6346c3770b1b374af
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide.js
@@ -0,0 +1,1891 @@
+/** 
+ * Name:    Highslide JS
+ * Version: 4.1.13 (2011-10-06)
+ * Config:  default
+ * Author:  Torstein Hønsi
+ * Support: www.highslide.com/support
+ * License: www.highslide.com/#license
+ */
+if (!hs) { var hs = {
+// Language strings
+lang : {
+	cssDirection: 'ltr',
+	loadingText : 'Loading...',
+	loadingTitle : 'Click to cancel',
+	focusTitle : 'Click to bring to front',
+	fullExpandTitle : 'Expand to actual size (f)',
+	creditsText : 'Powered by <i>Highslide JS</i>',
+	creditsTitle : 'Go to the Highslide JS homepage',
+	restoreTitle : 'Click to close image, click and drag to move. Use arrow keys for next and previous.'
+},
+// See http://highslide.com/ref for examples of settings  
+graphicsDir : 'highslide/graphics/',
+expandCursor : 'zoomin.cur', // null disables
+restoreCursor : 'zoomout.cur', // null disables
+expandDuration : 250, // milliseconds
+restoreDuration : 250,
+marginLeft : 15,
+marginRight : 15,
+marginTop : 15,
+marginBottom : 15,
+zIndexCounter : 1001, // adjust to other absolutely positioned elements
+loadingOpacity : 0.75,
+allowMultipleInstances: true,
+numberOfImagesToPreload : 5,
+outlineWhileAnimating : 2, // 0 = never, 1 = always, 2 = HTML only 
+outlineStartOffset : 3, // ends at 10
+padToMinWidth : false, // pad the popup width to make room for wide caption
+fullExpandPosition : 'bottom right',
+fullExpandOpacity : 1,
+showCredits : true, // you can set this to false if you want
+creditsHref : 'http://highslide.com/',
+creditsTarget : '_self',
+enableKeyListener : true,
+openerTagNames : ['a'], // Add more to allow slideshow indexing
+
+dragByHeading: true,
+minWidth: 200,
+minHeight: 200,
+allowSizeReduction: true, // allow the image to reduce to fit client size. If false, this overrides minWidth and minHeight
+outlineType : 'drop-shadow', // set null to disable outlines
+// END OF YOUR SETTINGS
+
+
+// declare internal properties
+preloadTheseImages : [],
+continuePreloading: true,
+expanders : [],
+overrides : [
+	'allowSizeReduction',
+	'useBox',
+	'outlineType',
+	'outlineWhileAnimating',
+	'captionId',
+	'captionText',
+	'captionEval',
+	'captionOverlay',
+	'headingId',
+	'headingText',
+	'headingEval',
+	'headingOverlay',
+	'creditsPosition',
+	'dragByHeading',
+	
+	'width',
+	'height',
+	
+	'wrapperClassName',
+	'minWidth',
+	'minHeight',
+	'maxWidth',
+	'maxHeight',
+	'pageOrigin',
+	'slideshowGroup',
+	'easing',
+	'easingClose',
+	'fadeInOut',
+	'src'
+],
+overlays : [],
+idCounter : 0,
+oPos : {
+	x: ['leftpanel', 'left', 'center', 'right', 'rightpanel'],
+	y: ['above', 'top', 'middle', 'bottom', 'below']
+},
+mouse: {},
+headingOverlay: {},
+captionOverlay: {},
+timers : [],
+
+pendingOutlines : {},
+clones : {},
+onReady: [],
+uaVersion: /Trident\/4\.0/.test(navigator.userAgent) ? 8 :
+	parseFloat((navigator.userAgent.toLowerCase().match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1]),
+ie : (document.all && !window.opera),
+//ie : navigator && /MSIE [678]/.test(navigator.userAgent), // ie9 compliant?
+safari : /Safari/.test(navigator.userAgent),
+geckoMac : /Macintosh.+rv:1\.[0-8].+Gecko/.test(navigator.userAgent),
+
+$ : function (id) {
+	if (id) return document.getElementById(id);
+},
+
+push : function (arr, val) {
+	arr[arr.length] = val;
+},
+
+createElement : function (tag, attribs, styles, parent, nopad) {
+	var el = document.createElement(tag);
+	if (attribs) hs.extend(el, attribs);
+	if (nopad) hs.setStyles(el, {padding: 0, border: 'none', margin: 0});
+	if (styles) hs.setStyles(el, styles);
+	if (parent) parent.appendChild(el);	
+	return el;
+},
+
+extend : function (el, attribs) {
+	for (var x in attribs) el[x] = attribs[x];
+	return el;
+},
+
+setStyles : function (el, styles) {
+	for (var x in styles) {
+		if (hs.ieLt9 && x == 'opacity') {
+			if (styles[x] > 0.99) el.style.removeAttribute('filter');
+			else el.style.filter = 'alpha(opacity='+ (styles[x] * 100) +')';
+		}
+		else el.style[x] = styles[x];		
+	}
+},
+animate: function(el, prop, opt) {
+	var start,
+		end,
+		unit;
+	if (typeof opt != 'object' || opt === null) {
+		var args = arguments;
+		opt = {
+			duration: args[2],
+			easing: args[3],
+			complete: args[4]
+		};
+	}
+	if (typeof opt.duration != 'number') opt.duration = 250;
+	opt.easing = Math[opt.easing] || Math.easeInQuad;
+	opt.curAnim = hs.extend({}, prop);
+	for (var name in prop) {
+		var e = new hs.fx(el, opt , name );
+		
+		start = parseFloat(hs.css(el, name)) || 0;
+		end = parseFloat(prop[name]);
+		unit = name != 'opacity' ? 'px' : '';
+		
+		e.custom( start, end, unit );
+	}	
+},
+css: function(el, prop) {
+	if (el.style[prop]) {
+		return el.style[prop];
+	} else if (document.defaultView) {
+		return document.defaultView.getComputedStyle(el, null).getPropertyValue(prop);
+
+	} else {
+		if (prop == 'opacity') prop = 'filter';
+		var val = el.currentStyle[prop.replace(/\-(\w)/g, function (a, b){ return b.toUpperCase(); })];
+		if (prop == 'filter') 
+			val = val.replace(/alpha\(opacity=([0-9]+)\)/, 
+				function (a, b) { return b / 100 });
+		return val === '' ? 1 : val;
+	} 
+},
+
+getPageSize : function () {
+	var d = document, w = window, iebody = d.compatMode && d.compatMode != 'BackCompat' 
+		? d.documentElement : d.body,
+		ieLt9 = hs.ie && (hs.uaVersion < 9 || typeof pageXOffset == 'undefined');
+	
+	var width = ieLt9 ? iebody.clientWidth : 
+			(d.documentElement.clientWidth || self.innerWidth),
+		height = ieLt9 ? iebody.clientHeight : self.innerHeight;
+	hs.page = {
+		width: width,
+		height: height,		
+		scrollLeft: ieLt9 ? iebody.scrollLeft : pageXOffset,
+		scrollTop: ieLt9 ? iebody.scrollTop : pageYOffset
+	};
+	return hs.page;
+},
+
+getPosition : function(el)	{
+	var p = { x: el.offsetLeft, y: el.offsetTop };
+	while (el.offsetParent)	{
+		el = el.offsetParent;
+		p.x += el.offsetLeft;
+		p.y += el.offsetTop;
+		if (el != document.body && el != document.documentElement) {
+			p.x -= el.scrollLeft;
+			p.y -= el.scrollTop;
+		}
+	}
+	return p;
+},
+
+expand : function(a, params, custom, type) {
+	if (!a) a = hs.createElement('a', null, { display: 'none' }, hs.container);
+	if (typeof a.getParams == 'function') return params;	
+	try {	
+		new hs.Expander(a, params, custom);
+		return false;
+	} catch (e) { return true; }
+},
+
+
+focusTopmost : function() {
+	var topZ = 0, 
+		topmostKey = -1,
+		expanders = hs.expanders,
+		exp,
+		zIndex;
+	for (var i = 0; i < expanders.length; i++) {
+		exp = expanders[i];
+		if (exp) {
+			zIndex = exp.wrapper.style.zIndex;
+			if (zIndex && zIndex > topZ) {
+				topZ = zIndex;				
+				topmostKey = i;
+			}
+		}
+	}
+	if (topmostKey == -1) hs.focusKey = -1;
+	else expanders[topmostKey].focus();
+},
+
+getParam : function (a, param) {
+	a.getParams = a.onclick;
+	var p = a.getParams ? a.getParams() : null;
+	a.getParams = null;
+	
+	return (p && typeof p[param] != 'undefined') ? p[param] : 
+		(typeof hs[param] != 'undefined' ? hs[param] : null);
+},
+
+getSrc : function (a) {
+	var src = hs.getParam(a, 'src');
+	if (src) return src;
+	return a.href;
+},
+
+getNode : function (id) {
+	var node = hs.$(id), clone = hs.clones[id], a = {};
+	if (!node && !clone) return null;
+	if (!clone) {
+		clone = node.cloneNode(true);
+		clone.id = '';
+		hs.clones[id] = clone;
+		return node;
+	} else {
+		return clone.cloneNode(true);
+	}
+},
+
+discardElement : function(d) {
+	if (d) hs.garbageBin.appendChild(d);
+	hs.garbageBin.innerHTML = '';
+},
+transit : function (adj, exp) {
+	var last = exp || hs.getExpander();
+	exp = last;
+	if (hs.upcoming) return false;
+	else hs.last = last;
+	hs.removeEventListener(document, window.opera ? 'keypress' : 'keydown', hs.keyHandler);
+	try {
+		hs.upcoming = adj;
+		adj.onclick(); 		
+	} catch (e){
+		hs.last = hs.upcoming = null;
+	}
+	try {
+		exp.close();
+	} catch (e) {}
+	return false;
+},
+
+previousOrNext : function (el, op) {
+	var exp = hs.getExpander(el);
+	if (exp) return hs.transit(exp.getAdjacentAnchor(op), exp);
+	else return false;
+},
+
+previous : function (el) {
+	return hs.previousOrNext(el, -1);
+},
+
+next : function (el) {
+	return hs.previousOrNext(el, 1);	
+},
+
+keyHandler : function(e) {
+	if (!e) e = window.event;
+	if (!e.target) e.target = e.srcElement; // ie
+	if (typeof e.target.form != 'undefined') return true; // form element has focus
+	var exp = hs.getExpander();
+	
+	var op = null;
+	switch (e.keyCode) {
+		case 70: // f
+			if (exp) exp.doFullExpand();
+			return true;
+		case 32: // Space
+		case 34: // Page Down
+		case 39: // Arrow right
+		case 40: // Arrow down
+			op = 1;
+			break;
+		case 8:  // Backspace
+		case 33: // Page Up
+		case 37: // Arrow left
+		case 38: // Arrow up
+			op = -1;
+			break;
+		case 27: // Escape
+		case 13: // Enter
+			op = 0;
+	}
+	if (op !== null) {hs.removeEventListener(document, window.opera ? 'keypress' : 'keydown', hs.keyHandler);
+		if (!hs.enableKeyListener) return true;
+		
+		if (e.preventDefault) e.preventDefault();
+    	else e.returnValue = false;
+    	if (exp) {
+			if (op == 0) {
+				exp.close();
+			} else {
+				hs.previousOrNext(exp.key, op);
+			}
+			return false;
+		}
+	}
+	return true;
+},
+
+
+registerOverlay : function (overlay) {
+	hs.push(hs.overlays, hs.extend(overlay, { hsId: 'hsId'+ hs.idCounter++ } ));
+},
+
+
+getWrapperKey : function (element, expOnly) {
+	var el, re = /^highslide-wrapper-([0-9]+)$/;
+	// 1. look in open expanders
+	el = element;
+	while (el.parentNode)	{
+		if (el.id && re.test(el.id)) return el.id.replace(re, "$1");
+		el = el.parentNode;
+	}
+	// 2. look in thumbnail
+	if (!expOnly) {
+		el = element;
+		while (el.parentNode)	{
+			if (el.tagName && hs.isHsAnchor(el)) {
+				for (var key = 0; key < hs.expanders.length; key++) {
+					var exp = hs.expanders[key];
+					if (exp && exp.a == el) return key;
+				}
+			}
+			el = el.parentNode;
+		}
+	}
+	return null; 
+},
+
+getExpander : function (el, expOnly) {
+	if (typeof el == 'undefined') return hs.expanders[hs.focusKey] || null;
+	if (typeof el == 'number') return hs.expanders[el] || null;
+	if (typeof el == 'string') el = hs.$(el);
+	return hs.expanders[hs.getWrapperKey(el, expOnly)] || null;
+},
+
+isHsAnchor : function (a) {
+	return (a.onclick && a.onclick.toString().replace(/\s/g, ' ').match(/hs.(htmlE|e)xpand/));
+},
+
+reOrder : function () {
+	for (var i = 0; i < hs.expanders.length; i++)
+		if (hs.expanders[i] && hs.expanders[i].isExpanded) hs.focusTopmost();
+},
+
+mouseClickHandler : function(e) 
+{	
+	if (!e) e = window.event;
+	if (e.button > 1) return true;
+	if (!e.target) e.target = e.srcElement;
+	
+	var el = e.target;
+	while (el.parentNode
+		&& !(/highslide-(image|move|html|resize)/.test(el.className)))
+	{
+		el = el.parentNode;
+	}
+	var exp = hs.getExpander(el);
+	if (exp && (exp.isClosing || !exp.isExpanded)) return true;
+		
+	if (exp && e.type == 'mousedown') {
+		if (e.target.form) return true;
+		var match = el.className.match(/highslide-(image|move|resize)/);
+		if (match) {
+			hs.dragArgs = { 
+				exp: exp , 
+				type: match[1], 
+				left: exp.x.pos, 
+				width: exp.x.size, 
+				top: exp.y.pos, 
+				height: exp.y.size, 
+				clickX: e.clientX, 
+				clickY: e.clientY
+			};
+			
+			
+			hs.addEventListener(document, 'mousemove', hs.dragHandler);
+			if (e.preventDefault) e.preventDefault(); // FF
+			
+			if (/highslide-(image|html)-blur/.test(exp.content.className)) {
+				exp.focus();
+				hs.hasFocused = true;
+			}
+			return false;
+		}
+	} else if (e.type == 'mouseup') {
+		
+		hs.removeEventListener(document, 'mousemove', hs.dragHandler);
+		
+		if (hs.dragArgs) {
+			if (hs.styleRestoreCursor && hs.dragArgs.type == 'image') 
+				hs.dragArgs.exp.content.style.cursor = hs.styleRestoreCursor;
+			var hasDragged = hs.dragArgs.hasDragged;
+			
+			if (!hasDragged &&!hs.hasFocused && !/(move|resize)/.test(hs.dragArgs.type)) {
+				exp.close();
+			} 
+			else if (hasDragged || (!hasDragged && hs.hasHtmlExpanders)) {
+				hs.dragArgs.exp.doShowHide('hidden');
+			}
+			hs.hasFocused = false;
+			hs.dragArgs = null;
+		
+		} else if (/highslide-image-blur/.test(el.className)) {
+			el.style.cursor = hs.styleRestoreCursor;		
+		}
+	}
+	return false;
+},
+
+dragHandler : function(e)
+{
+	if (!hs.dragArgs) return true;
+	if (!e) e = window.event;
+	var a = hs.dragArgs, exp = a.exp;
+	
+	a.dX = e.clientX - a.clickX;
+	a.dY = e.clientY - a.clickY;	
+	
+	var distance = Math.sqrt(Math.pow(a.dX, 2) + Math.pow(a.dY, 2));
+	if (!a.hasDragged) a.hasDragged = (a.type != 'image' && distance > 0)
+		|| (distance > (hs.dragSensitivity || 5));
+	
+	if (a.hasDragged && e.clientX > 5 && e.clientY > 5) {
+		
+		if (a.type == 'resize') exp.resize(a);
+		else {
+			exp.moveTo(a.left + a.dX, a.top + a.dY);
+			if (a.type == 'image') exp.content.style.cursor = 'move';
+		}
+	}
+	return false;
+},
+
+wrapperMouseHandler : function (e) {
+	try {
+		if (!e) e = window.event;
+		var over = /mouseover/i.test(e.type); 
+		if (!e.target) e.target = e.srcElement; // ie
+		if (!e.relatedTarget) e.relatedTarget = 
+			over ? e.fromElement : e.toElement; // ie
+		var exp = hs.getExpander(e.target);
+		if (!exp.isExpanded) return;
+		if (!exp || !e.relatedTarget || hs.getExpander(e.relatedTarget, true) == exp 
+			|| hs.dragArgs) return;
+		for (var i = 0; i < exp.overlays.length; i++) (function() {
+			var o = hs.$('hsId'+ exp.overlays[i]);
+			if (o && o.hideOnMouseOut) {
+				if (over) hs.setStyles(o, { visibility: 'visible', display: '' });
+				hs.animate(o, { opacity: over ? o.opacity : 0 }, o.dur);
+			}
+		})();	
+	} catch (e) {}
+},
+addEventListener : function (el, event, func) {
+	if (el == document && event == 'ready') {
+		hs.push(hs.onReady, func);
+	}
+	try {
+		el.addEventListener(event, func, false);
+	} catch (e) {
+		try {
+			el.detachEvent('on'+ event, func);
+			el.attachEvent('on'+ event, func);
+		} catch (e) {
+			el['on'+ event] = func;
+		}
+	} 
+},
+
+removeEventListener : function (el, event, func) {
+	try {
+		el.removeEventListener(event, func, false);
+	} catch (e) {
+		try {
+			el.detachEvent('on'+ event, func);
+		} catch (e) {
+			el['on'+ event] = null;
+		}
+	}
+},
+
+preloadFullImage : function (i) {
+	if (hs.continuePreloading && hs.preloadTheseImages[i] && hs.preloadTheseImages[i] != 'undefined') {
+		var img = document.createElement('img');
+		img.onload = function() { 
+			img = null;
+			hs.preloadFullImage(i + 1);
+		};
+		img.src = hs.preloadTheseImages[i];
+	}
+},
+preloadImages : function (number) {
+	if (number && typeof number != 'object') hs.numberOfImagesToPreload = number;
+	
+	var arr = hs.getAnchors();
+	for (var i = 0; i < arr.images.length && i < hs.numberOfImagesToPreload; i++) {
+		hs.push(hs.preloadTheseImages, hs.getSrc(arr.images[i]));
+	}
+	
+	// preload outlines
+	if (hs.outlineType)	new hs.Outline(hs.outlineType, function () { hs.preloadFullImage(0)} );
+	else
+	
+	hs.preloadFullImage(0);
+	
+	// preload cursor
+	if (hs.restoreCursor) var cur = hs.createElement('img', { src: hs.graphicsDir + hs.restoreCursor });
+},
+
+
+init : function () {
+	if (!hs.container) {
+	
+		hs.ieLt7 = hs.ie && hs.uaVersion < 7;
+		hs.ieLt9 = hs.ie && hs.uaVersion < 9;
+		
+		hs.getPageSize();
+		for (var x in hs.langDefaults) {
+			if (typeof hs[x] != 'undefined') hs.lang[x] = hs[x];
+			else if (typeof hs.lang[x] == 'undefined' && typeof hs.langDefaults[x] != 'undefined') 
+				hs.lang[x] = hs.langDefaults[x];
+		}
+		
+		hs.container = hs.createElement('div', {
+				className: 'highslide-container'
+			}, {
+				position: 'absolute',
+				left: 0, 
+				top: 0, 
+				width: '100%', 
+				zIndex: hs.zIndexCounter,
+				direction: 'ltr'
+			}, 
+			document.body,
+			true
+		);
+		hs.loading = hs.createElement('a', {
+				className: 'highslide-loading',
+				title: hs.lang.loadingTitle,
+				innerHTML: hs.lang.loadingText,
+				href: 'javascript:;'
+			}, {
+				position: 'absolute',
+				top: '-9999px',
+				opacity: hs.loadingOpacity,
+				zIndex: 1
+			}, hs.container
+		);
+		hs.garbageBin = hs.createElement('div', null, { display: 'none' }, hs.container);
+		
+		// http://www.robertpenner.com/easing/ 
+		Math.linearTween = function (t, b, c, d) {
+			return c*t/d + b;
+		};
+		Math.easeInQuad = function (t, b, c, d) {
+			return c*(t/=d)*t + b;
+		};
+		
+		hs.hideSelects = hs.ieLt7;
+		hs.hideIframes = ((window.opera && hs.uaVersion < 9) || navigator.vendor == 'KDE' 
+			|| (hs.ieLt7 && hs.uaVersion < 5.5));
+	}
+},
+ready : function() {
+	if (hs.isReady) return;
+	hs.isReady = true;
+	for (var i = 0; i < hs.onReady.length; i++) hs.onReady[i]();
+},
+
+updateAnchors : function() {
+	var el, els, all = [], images = [],groups = {}, re;
+		
+	for (var i = 0; i < hs.openerTagNames.length; i++) {
+		els = document.getElementsByTagName(hs.openerTagNames[i]);
+		for (var j = 0; j < els.length; j++) {
+			el = els[j];
+			re = hs.isHsAnchor(el);
+			if (re) {
+				hs.push(all, el);
+				if (re[0] == 'hs.expand') hs.push(images, el);
+				var g = hs.getParam(el, 'slideshowGroup') || 'none';
+				if (!groups[g]) groups[g] = [];
+				hs.push(groups[g], el);
+			}
+		}
+	}
+	hs.anchors = { all: all, groups: groups, images: images };
+	return hs.anchors;
+	
+},
+
+getAnchors : function() {
+	return hs.anchors || hs.updateAnchors();
+},
+
+
+close : function(el) {
+	var exp = hs.getExpander(el);
+	if (exp) exp.close();
+	return false;
+}
+}; // end hs object
+hs.fx = function( elem, options, prop ){
+	this.options = options;
+	this.elem = elem;
+	this.prop = prop;
+
+	if (!options.orig) options.orig = {};
+};
+hs.fx.prototype = {
+	update: function(){
+		(hs.fx.step[this.prop] || hs.fx.step._default)(this);
+		
+		if (this.options.step)
+			this.options.step.call(this.elem, this.now, this);
+
+	},
+	custom: function(from, to, unit){
+		this.startTime = (new Date()).getTime();
+		this.start = from;
+		this.end = to;
+		this.unit = unit;// || this.unit || "px";
+		this.now = this.start;
+		this.pos = this.state = 0;
+
+		var self = this;
+		function t(gotoEnd){
+			return self.step(gotoEnd);
+		}
+
+		t.elem = this.elem;
+
+		if ( t() && hs.timers.push(t) == 1 ) {
+			hs.timerId = setInterval(function(){
+				var timers = hs.timers;
+
+				for ( var i = 0; i < timers.length; i++ )
+					if ( !timers[i]() )
+						timers.splice(i--, 1);
+
+				if ( !timers.length ) {
+					clearInterval(hs.timerId);
+				}
+			}, 13);
+		}
+	},
+	step: function(gotoEnd){
+		var t = (new Date()).getTime();
+		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.complete) this.options.complete.call(this.elem);
+			}
+			return false;
+		} else {
+			var n = t - this.startTime;
+			this.state = n / this.options.duration;
+			this.pos = this.options.easing(n, 0, 1, this.options.duration);
+			this.now = this.start + ((this.end - this.start) * this.pos);
+			this.update();
+		}
+		return true;
+	}
+
+};
+
+hs.extend( hs.fx, {
+	step: {
+
+		opacity: function(fx){
+			hs.setStyles(fx.elem, { opacity: fx.now });
+		},
+
+		_default: function(fx){
+			try {
+				if ( fx.elem.style && fx.elem.style[ fx.prop ] != null )
+					fx.elem.style[ fx.prop ] = fx.now + fx.unit;
+				else
+					fx.elem[ fx.prop ] = fx.now;
+			} catch (e) {}
+		}
+	}
+});
+
+hs.Outline =  function (outlineType, onLoad) {
+	this.onLoad = onLoad;
+	this.outlineType = outlineType;
+	var v = hs.uaVersion, tr;
+	
+	this.hasAlphaImageLoader = hs.ie && hs.uaVersion < 7;
+	if (!outlineType) {
+		if (onLoad) onLoad();
+		return;
+	}
+	
+	hs.init();
+	this.table = hs.createElement(
+		'table', { 
+			cellSpacing: 0 
+		}, {
+			visibility: 'hidden',
+			position: 'absolute',
+			borderCollapse: 'collapse',
+			width: 0
+		},
+		hs.container,
+		true
+	);
+	var tbody = hs.createElement('tbody', null, null, this.table, 1);
+	
+	this.td = [];
+	for (var i = 0; i <= 8; i++) {
+		if (i % 3 == 0) tr = hs.createElement('tr', null, { height: 'auto' }, tbody, true);
+		this.td[i] = hs.createElement('td', null, null, tr, true);
+		var style = i != 4 ? { lineHeight: 0, fontSize: 0} : { position : 'relative' };
+		hs.setStyles(this.td[i], style);
+	}
+	this.td[4].className = outlineType +' highslide-outline';
+	
+	this.preloadGraphic(); 
+};
+
+hs.Outline.prototype = {
+preloadGraphic : function () {
+	var src = hs.graphicsDir + (hs.outlinesDir || "outlines/")+ this.outlineType +".png";
+				
+	var appendTo = hs.safari && hs.uaVersion < 525 ? hs.container : null;
+	this.graphic = hs.createElement('img', null, { position: 'absolute', 
+		top: '-9999px' }, appendTo, true); // for onload trigger
+	
+	var pThis = this;
+	this.graphic.onload = function() { pThis.onGraphicLoad(); };
+	
+	this.graphic.src = src;
+},
+
+onGraphicLoad : function () {
+	var o = this.offset = this.graphic.width / 4,
+		pos = [[0,0],[0,-4],[-2,0],[0,-8],0,[-2,-8],[0,-2],[0,-6],[-2,-2]],
+		dim = { height: (2*o) +'px', width: (2*o) +'px' };
+	for (var i = 0; i <= 8; i++) {
+		if (pos[i]) {
+			if (this.hasAlphaImageLoader) {
+				var w = (i == 1 || i == 7) ? '100%' : this.graphic.width +'px';
+				var div = hs.createElement('div', null, { width: '100%', height: '100%', position: 'relative', overflow: 'hidden'}, this.td[i], true);
+				hs.createElement ('div', null, { 
+						filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale, src='"+ this.graphic.src + "')", 
+						position: 'absolute',
+						width: w, 
+						height: this.graphic.height +'px',
+						left: (pos[i][0]*o)+'px',
+						top: (pos[i][1]*o)+'px'
+					}, 
+				div,
+				true);
+			} else {
+				hs.setStyles(this.td[i], { background: 'url('+ this.graphic.src +') '+ (pos[i][0]*o)+'px '+(pos[i][1]*o)+'px'});
+			}
+			
+			if (window.opera && (i == 3 || i ==5)) 
+				hs.createElement('div', null, dim, this.td[i], true);
+			
+			hs.setStyles (this.td[i], dim);
+		}
+	}
+	this.graphic = null;
+	if (hs.pendingOutlines[this.outlineType]) hs.pendingOutlines[this.outlineType].destroy();
+	hs.pendingOutlines[this.outlineType] = this;
+	if (this.onLoad) this.onLoad();
+},
+	
+setPosition : function (pos, offset, vis, dur, easing) {
+	var exp = this.exp,
+		stl = exp.wrapper.style,
+		offset = offset || 0,
+		pos = pos || {
+			x: exp.x.pos + offset,
+			y: exp.y.pos + offset,
+			w: exp.x.get('wsize') - 2 * offset,
+			h: exp.y.get('wsize') - 2 * offset
+		};
+	if (vis) this.table.style.visibility = (pos.h >= 4 * this.offset) 
+		? 'visible' : 'hidden';
+	hs.setStyles(this.table, {
+		left: (pos.x - this.offset) +'px',
+		top: (pos.y - this.offset) +'px',
+		width: (pos.w + 2 * this.offset) +'px'
+	});
+	
+	pos.w -= 2 * this.offset;
+	pos.h -= 2 * this.offset;
+	hs.setStyles (this.td[4], {
+		width: pos.w >= 0 ? pos.w +'px' : 0,
+		height: pos.h >= 0 ? pos.h +'px' : 0
+	});
+	if (this.hasAlphaImageLoader) this.td[3].style.height 
+		= this.td[5].style.height = this.td[4].style.height;	
+	
+},
+	
+destroy : function(hide) {
+	if (hide) this.table.style.visibility = 'hidden';
+	else hs.discardElement(this.table);
+}
+};
+
+hs.Dimension = function(exp, dim) {
+	this.exp = exp;
+	this.dim = dim;
+	this.ucwh = dim == 'x' ? 'Width' : 'Height';
+	this.wh = this.ucwh.toLowerCase();
+	this.uclt = dim == 'x' ? 'Left' : 'Top';
+	this.lt = this.uclt.toLowerCase();
+	this.ucrb = dim == 'x' ? 'Right' : 'Bottom';
+	this.rb = this.ucrb.toLowerCase();
+	this.p1 = this.p2 = 0;
+};
+hs.Dimension.prototype = {
+get : function(key) {
+	switch (key) {
+		case 'loadingPos':
+			return this.tpos + this.tb + (this.t - hs.loading['offset'+ this.ucwh]) / 2;
+		case 'wsize':
+			return this.size + 2 * this.cb + this.p1 + this.p2;
+		case 'fitsize':
+			return this.clientSize - this.marginMin - this.marginMax;
+		case 'maxsize':
+			return this.get('fitsize') - 2 * this.cb - this.p1 - this.p2 ;
+		case 'opos':
+			return this.pos - (this.exp.outline ? this.exp.outline.offset : 0);
+		case 'osize':
+			return this.get('wsize') + (this.exp.outline ? 2*this.exp.outline.offset : 0);
+		case 'imgPad':
+			return this.imgSize ? Math.round((this.size - this.imgSize) / 2) : 0;
+		
+	}
+},
+calcBorders: function() {
+	// correct for borders
+	this.cb = (this.exp.content['offset'+ this.ucwh] - this.t) / 2;
+	
+	this.marginMax = hs['margin'+ this.ucrb];
+},
+calcThumb: function() {
+	this.t = this.exp.el[this.wh] ? parseInt(this.exp.el[this.wh]) : 
+		this.exp.el['offset'+ this.ucwh];
+	this.tpos = this.exp.tpos[this.dim];
+	this.tb = (this.exp.el['offset'+ this.ucwh] - this.t) / 2;
+	if (this.tpos == 0 || this.tpos == -1) {
+		this.tpos = (hs.page[this.wh] / 2) + hs.page['scroll'+ this.uclt];		
+	};
+},
+calcExpanded: function() {
+	var exp = this.exp;
+	this.justify = 'auto';
+	
+	
+	// size and position
+	this.pos = this.tpos - this.cb + this.tb;
+	
+	if (this.maxHeight && this.dim == 'x')
+		exp.maxWidth = Math.min(exp.maxWidth || this.full, exp.maxHeight * this.full / exp.y.full); 
+		
+	this.size = Math.min(this.full, exp['max'+ this.ucwh] || this.full);
+	this.minSize = exp.allowSizeReduction ? 
+		Math.min(exp['min'+ this.ucwh], this.full) :this.full;
+	if (exp.isImage && exp.useBox)	{
+		this.size = exp[this.wh];
+		this.imgSize = this.full;
+	}
+	if (this.dim == 'x' && hs.padToMinWidth) this.minSize = exp.minWidth;
+	this.marginMin = hs['margin'+ this.uclt];
+	this.scroll = hs.page['scroll'+ this.uclt];
+	this.clientSize = hs.page[this.wh];
+},
+setSize: function(i) {
+	var exp = this.exp;
+	if (exp.isImage && (exp.useBox || hs.padToMinWidth)) {
+		this.imgSize = i;
+		this.size = Math.max(this.size, this.imgSize);
+		exp.content.style[this.lt] = this.get('imgPad')+'px';
+	} else
+	this.size = i;
+	
+	exp.content.style[this.wh] = i +'px';
+	exp.wrapper.style[this.wh] = this.get('wsize') +'px';
+	if (exp.outline) exp.outline.setPosition();
+	if (this.dim == 'x' && exp.overlayBox) exp.sizeOverlayBox(true);
+},
+setPos: function(i) {
+	this.pos = i;
+	this.exp.wrapper.style[this.lt] = i +'px';	
+	
+	if (this.exp.outline) this.exp.outline.setPosition();
+	
+}
+};
+
+hs.Expander = function(a, params, custom, contentType) {
+	if (document.readyState && hs.ie && !hs.isReady) {
+		hs.addEventListener(document, 'ready', function() {
+			new hs.Expander(a, params, custom, contentType);
+		});
+		return;
+	} 
+	this.a = a;
+	this.custom = custom;
+	this.contentType = contentType || 'image';
+	this.isImage = !this.isHtml;
+	
+	hs.continuePreloading = false;
+	this.overlays = [];
+	hs.init();
+	var key = this.key = hs.expanders.length;
+	// override inline parameters
+	for (var i = 0; i < hs.overrides.length; i++) {
+		var name = hs.overrides[i];
+		this[name] = params && typeof params[name] != 'undefined' ?
+			params[name] : hs[name];
+	}
+	if (!this.src) this.src = a.href;
+	
+	// get thumb
+	var el = (params && params.thumbnailId) ? hs.$(params.thumbnailId) : a;
+	el = this.thumb = el.getElementsByTagName('img')[0] || el;
+	this.thumbsUserSetId = el.id || a.id;
+	
+	// check if already open
+	for (var i = 0; i < hs.expanders.length; i++) {
+		if (hs.expanders[i] && hs.expanders[i].a == a) {
+			hs.expanders[i].focus();
+			return false;
+		}
+	}	
+
+	// cancel other
+	if (!hs.allowSimultaneousLoading) for (var i = 0; i < hs.expanders.length; i++) {
+		if (hs.expanders[i] && hs.expanders[i].thumb != el && !hs.expanders[i].onLoadStarted) {
+			hs.expanders[i].cancelLoading();
+		}
+	}
+	hs.expanders[key] = this;
+	if (!hs.allowMultipleInstances && !hs.upcoming) {
+		if (hs.expanders[key-1]) hs.expanders[key-1].close();
+		if (typeof hs.focusKey != 'undefined' && hs.expanders[hs.focusKey])
+			hs.expanders[hs.focusKey].close();
+	}
+	
+	// initiate metrics
+	this.el = el;
+	this.tpos = this.pageOrigin || hs.getPosition(el);
+	hs.getPageSize();
+	var x = this.x = new hs.Dimension(this, 'x');
+	x.calcThumb();
+	var y = this.y = new hs.Dimension(this, 'y');
+	y.calcThumb();
+	this.wrapper = hs.createElement(
+		'div', {
+			id: 'highslide-wrapper-'+ this.key,
+			className: 'highslide-wrapper '+ this.wrapperClassName
+		}, {
+			visibility: 'hidden',
+			position: 'absolute',
+			zIndex: hs.zIndexCounter += 2
+		}, null, true );
+	
+	this.wrapper.onmouseover = this.wrapper.onmouseout = hs.wrapperMouseHandler;
+	if (this.contentType == 'image' && this.outlineWhileAnimating == 2)
+		this.outlineWhileAnimating = 0;
+	
+	// get the outline
+	if (!this.outlineType) {
+		this[this.contentType +'Create']();
+	
+	} else if (hs.pendingOutlines[this.outlineType]) {
+		this.connectOutline();
+		this[this.contentType +'Create']();
+	
+	} else {
+		this.showLoading();
+		var exp = this;
+		new hs.Outline(this.outlineType, 
+			function () {
+				exp.connectOutline();
+				exp[exp.contentType +'Create']();
+			} 
+		);
+	}
+	return true;
+};
+
+hs.Expander.prototype = {
+error : function(e) {
+	if (hs.debug) alert ('Line '+ e.lineNumber +': '+ e.message);
+	else window.location.href = this.src;
+},
+
+connectOutline : function() {
+	var outline = this.outline = hs.pendingOutlines[this.outlineType];
+	outline.exp = this;
+	outline.table.style.zIndex = this.wrapper.style.zIndex - 1;
+	hs.pendingOutlines[this.outlineType] = null;
+},
+
+showLoading : function() {
+	if (this.onLoadStarted || this.loading) return;
+	
+	this.loading = hs.loading;
+	var exp = this;
+	this.loading.onclick = function() {
+		exp.cancelLoading();
+	};
+	var exp = this, 
+		l = this.x.get('loadingPos') +'px',
+		t = this.y.get('loadingPos') +'px';
+	setTimeout(function () { 
+		if (exp.loading) hs.setStyles(exp.loading, { left: l, top: t, zIndex: hs.zIndexCounter++ })}
+	, 100);
+},
+
+imageCreate : function() {
+	var exp = this;
+	
+	var img = document.createElement('img');
+    this.content = img;
+    img.onload = function () {
+    	if (hs.expanders[exp.key]) exp.contentLoaded(); 
+	};
+    if (hs.blockRightClick) img.oncontextmenu = function() { return false; };
+    img.className = 'highslide-image';
+    hs.setStyles(img, {
+    	visibility: 'hidden',
+    	display: 'block',
+    	position: 'absolute',
+		maxWidth: '9999px',
+		zIndex: 3
+	});
+    img.title = hs.lang.restoreTitle;
+	if (hs.safari && hs.uaVersion < 525) hs.container.appendChild(img);
+    if (hs.ie && hs.flushImgSize) img.src = null;
+	img.src = this.src;
+	
+	this.showLoading();
+},
+
+contentLoaded : function() {
+	try {	
+		if (!this.content) return;
+		this.content.onload = null;
+		if (this.onLoadStarted) return;
+		else this.onLoadStarted = true;
+		
+		var x = this.x, y = this.y;
+		
+		if (this.loading) {
+			hs.setStyles(this.loading, { top: '-9999px' });
+			this.loading = null;
+		}	
+			x.full = this.content.width;
+			y.full = this.content.height;
+			
+			hs.setStyles(this.content, {
+				width: x.t +'px',
+				height: y.t +'px'
+			});
+			this.wrapper.appendChild(this.content);
+			hs.container.appendChild(this.wrapper);
+		
+		x.calcBorders();
+		y.calcBorders();
+		
+		hs.setStyles (this.wrapper, {
+			left: (x.tpos + x.tb - x.cb) +'px',
+			top: (y.tpos + x.tb - y.cb) +'px'
+		});
+		this.getOverlays();
+		
+		var ratio = x.full / y.full;
+		x.calcExpanded();
+		this.justify(x);
+		
+		y.calcExpanded();
+		this.justify(y);
+		if (this.overlayBox) this.sizeOverlayBox(0, 1);
+
+		
+		if (this.allowSizeReduction) {
+				this.correctRatio(ratio);
+			if (this.isImage && this.x.full > (this.x.imgSize || this.x.size)) {
+				this.createFullExpand();
+				if (this.overlays.length == 1) this.sizeOverlayBox();
+			}
+		}
+		this.show();
+		
+	} catch (e) {
+		this.error(e);
+	}
+},
+
+justify : function (p, moveOnly) {
+	var tgtArr, tgt = p.target, dim = p == this.x ? 'x' : 'y';
+	
+		var hasMovedMin = false;
+		
+		var allowReduce = p.exp.allowSizeReduction;
+			p.pos = Math.round(p.pos - ((p.get('wsize') - p.t) / 2));
+		if (p.pos < p.scroll + p.marginMin) {
+			p.pos = p.scroll + p.marginMin;
+			hasMovedMin = true;		
+		}
+		if (!moveOnly && p.size < p.minSize) {
+			p.size = p.minSize;
+			allowReduce = false;
+		}
+		if (p.pos + p.get('wsize') > p.scroll + p.clientSize - p.marginMax) {
+			if (!moveOnly && hasMovedMin && allowReduce) {
+				p.size = Math.min(p.size, p.get(dim == 'y' ? 'fitsize' : 'maxsize'));
+			} else if (p.get('wsize') < p.get('fitsize')) {
+				p.pos = p.scroll + p.clientSize - p.marginMax - p.get('wsize');
+			} else { // image larger than viewport
+				p.pos = p.scroll + p.marginMin;
+				if (!moveOnly && allowReduce) p.size = p.get(dim == 'y' ? 'fitsize' : 'maxsize');
+			}			
+		}
+		
+		if (!moveOnly && p.size < p.minSize) {
+			p.size = p.minSize;
+			allowReduce = false;
+		}
+		
+	
+		
+	if (p.pos < p.marginMin) {
+		var tmpMin = p.pos;
+		p.pos = p.marginMin; 
+		
+		if (allowReduce && !moveOnly) p.size = p.size - (p.pos - tmpMin);
+		
+	}
+},
+
+correctRatio : function(ratio) {
+	var x = this.x, 
+		y = this.y,
+		changed = false,
+		xSize = Math.min(x.full, x.size),
+		ySize = Math.min(y.full, y.size),
+		useBox = (this.useBox || hs.padToMinWidth);
+	
+	if (xSize / ySize > ratio) { // width greater
+		xSize = ySize * ratio;
+		if (xSize < x.minSize) { // below minWidth
+			xSize = x.minSize;
+			ySize = xSize / ratio;
+		}
+		changed = true;
+	
+	} else if (xSize / ySize < ratio) { // height greater
+		ySize = xSize / ratio;
+		changed = true;
+	}
+	
+	if (hs.padToMinWidth && x.full < x.minSize) {
+		x.imgSize = x.full;
+		y.size = y.imgSize = y.full;
+	} else if (this.useBox) {
+		x.imgSize = xSize;
+		y.imgSize = ySize;
+	} else {
+		x.size = xSize;
+		y.size = ySize;
+	}
+	changed = this.fitOverlayBox(this.useBox ? null : ratio, changed);
+	if (useBox && y.size < y.imgSize) {
+		y.imgSize = y.size;
+		x.imgSize = y.size * ratio;
+	}
+	if (changed || useBox) {
+		x.pos = x.tpos - x.cb + x.tb;
+		x.minSize = x.size;
+		this.justify(x, true);
+	
+		y.pos = y.tpos - y.cb + y.tb;
+		y.minSize = y.size;
+		this.justify(y, true);
+		if (this.overlayBox) this.sizeOverlayBox();
+	}
+	
+	
+},
+fitOverlayBox : function(ratio, changed) {
+	var x = this.x, y = this.y;
+	if (this.overlayBox) {
+		while (y.size > this.minHeight && x.size > this.minWidth 
+				&&  y.get('wsize') > y.get('fitsize')) {
+			y.size -= 10;
+			if (ratio) x.size = y.size * ratio;
+			this.sizeOverlayBox(0, 1);
+			changed = true;
+		}
+	}
+	return changed;
+},
+
+show : function () {
+	var x = this.x, y = this.y;
+	this.doShowHide('hidden');
+	
+	// Apply size change
+	this.changeSize(
+		1, {
+			wrapper: {
+				width : x.get('wsize'),
+				height : y.get('wsize'),
+				left: x.pos,
+				top: y.pos
+			},
+			content: {
+				left: x.p1 + x.get('imgPad'),
+				top: y.p1 + y.get('imgPad'),
+				width:x.imgSize ||x.size,
+				height:y.imgSize ||y.size
+			}
+		},
+		hs.expandDuration
+	);
+},
+
+changeSize : function(up, to, dur) {
+	
+	if (this.outline && !this.outlineWhileAnimating) {
+		if (up) this.outline.setPosition();
+		else this.outline.destroy();
+	}
+	
+	
+	if (!up) this.destroyOverlays();
+	
+	var exp = this,
+		x = exp.x,
+		y = exp.y,
+		easing = this.easing;
+	if (!up) easing = this.easingClose || easing;
+	var after = up ?
+		function() {
+				
+			if (exp.outline) exp.outline.table.style.visibility = "visible";
+			setTimeout(function() {
+				exp.afterExpand();
+			}, 50);
+		} :
+		function() {
+			exp.afterClose();
+		};
+	if (up) hs.setStyles( this.wrapper, {
+		width: x.t +'px',
+		height: y.t +'px'
+	});
+	if (this.fadeInOut) {
+		hs.setStyles(this.wrapper, { opacity: up ? 0 : 1 });
+		hs.extend(to.wrapper, { opacity: up });
+	}
+	hs.animate( this.wrapper, to.wrapper, {
+		duration: dur,
+		easing: easing,
+		step: function(val, args) {
+			if (exp.outline && exp.outlineWhileAnimating && args.prop == 'top') {
+				var fac = up ? args.pos : 1 - args.pos;
+				var pos = {
+					w: x.t + (x.get('wsize') - x.t) * fac,
+					h: y.t + (y.get('wsize') - y.t) * fac,
+					x: x.tpos + (x.pos - x.tpos) * fac,
+					y: y.tpos + (y.pos - y.tpos) * fac
+				};
+				exp.outline.setPosition(pos, 0, 1);				
+			}
+		}
+	});
+	hs.animate( this.content, to.content, dur, easing, after);
+	if (up) {
+		this.wrapper.style.visibility = 'visible';
+		this.content.style.visibility = 'visible';
+		this.a.className += ' highslide-active-anchor';
+	}
+},
+
+
+
+
+afterExpand : function() {
+	this.isExpanded = true;	
+	this.focus();
+	if (hs.upcoming && hs.upcoming == this.a) hs.upcoming = null;
+	this.prepareNextOutline();
+	var p = hs.page, mX = hs.mouse.x + p.scrollLeft, mY = hs.mouse.y + p.scrollTop;
+	this.mouseIsOver = this.x.pos < mX && mX < this.x.pos + this.x.get('wsize')
+		&& this.y.pos < mY && mY < this.y.pos + this.y.get('wsize');	
+	if (this.overlayBox) this.showOverlays();
+	
+},
+
+
+prepareNextOutline : function() {
+	var key = this.key;
+	var outlineType = this.outlineType;
+	new hs.Outline(outlineType, 
+		function () { try { hs.expanders[key].preloadNext(); } catch (e) {} });
+},
+
+
+preloadNext : function() {
+	var next = this.getAdjacentAnchor(1);
+	if (next && next.onclick.toString().match(/hs\.expand/)) 
+		var img = hs.createElement('img', { src: hs.getSrc(next) });
+},
+
+
+getAdjacentAnchor : function(op) {
+	var current = this.getAnchorIndex(), as = hs.anchors.groups[this.slideshowGroup || 'none'];
+	return (as && as[current + op]) || null;
+},
+
+getAnchorIndex : function() {
+	var arr = hs.getAnchors().groups[this.slideshowGroup || 'none'];
+	if (arr) for (var i = 0; i < arr.length; i++) {
+		if (arr[i] == this.a) return i; 
+	}
+	return null;
+},
+
+
+cancelLoading : function() {
+	hs.discardElement (this.wrapper);
+	hs.expanders[this.key] = null;
+	if (this.loading) hs.loading.style.left = '-9999px';
+},
+
+writeCredits : function () {
+	this.credits = hs.createElement('a', {
+		href: hs.creditsHref,
+		target: hs.creditsTarget,
+		className: 'highslide-credits',
+		innerHTML: hs.lang.creditsText,
+		title: hs.lang.creditsTitle
+	});
+	this.createOverlay({ 
+		overlayId: this.credits, 
+		position: this.creditsPosition || 'top left' 
+	});
+},
+
+getInline : function(types, addOverlay) {
+	for (var i = 0; i < types.length; i++) {
+		var type = types[i], s = null;
+		if (!this[type +'Id'] && this.thumbsUserSetId)  
+			this[type +'Id'] = type +'-for-'+ this.thumbsUserSetId;
+		if (this[type +'Id']) this[type] = hs.getNode(this[type +'Id']);
+		if (!this[type] && !this[type +'Text'] && this[type +'Eval']) try {
+			s = eval(this[type +'Eval']);
+		} catch (e) {}
+		if (!this[type] && this[type +'Text']) {
+			s = this[type +'Text'];
+		}
+		if (!this[type] && !s) {
+			this[type] = hs.getNode(this.a['_'+ type + 'Id']);
+			if (!this[type]) {
+				var next = this.a.nextSibling;
+				while (next && !hs.isHsAnchor(next)) {
+					if ((new RegExp('highslide-'+ type)).test(next.className || null)) {
+						if (!next.id) this.a['_'+ type + 'Id'] = next.id = 'hsId'+ hs.idCounter++;
+						this[type] = hs.getNode(next.id);
+						break;
+					}
+					next = next.nextSibling;
+				}
+			}
+		}
+		
+		if (!this[type] && s) this[type] = hs.createElement('div', 
+				{ className: 'highslide-'+ type, innerHTML: s } );
+		
+		if (addOverlay && this[type]) {
+			var o = { position: (type == 'heading') ? 'above' : 'below' };
+			for (var x in this[type+'Overlay']) o[x] = this[type+'Overlay'][x];
+			o.overlayId = this[type];
+			this.createOverlay(o);
+		}
+	}
+},
+
+
+// on end move and resize
+doShowHide : function(visibility) {
+	if (hs.hideSelects) this.showHideElements('SELECT', visibility);
+	if (hs.hideIframes) this.showHideElements('IFRAME', visibility);
+	if (hs.geckoMac) this.showHideElements('*', visibility);
+},
+showHideElements : function (tagName, visibility) {
+	var els = document.getElementsByTagName(tagName);
+	var prop = tagName == '*' ? 'overflow' : 'visibility';
+	for (var i = 0; i < els.length; i++) {
+		if (prop == 'visibility' || (document.defaultView.getComputedStyle(
+				els[i], "").getPropertyValue('overflow') == 'auto'
+				|| els[i].getAttribute('hidden-by') != null)) {
+			var hiddenBy = els[i].getAttribute('hidden-by');
+			if (visibility == 'visible' && hiddenBy) {
+				hiddenBy = hiddenBy.replace('['+ this.key +']', '');
+				els[i].setAttribute('hidden-by', hiddenBy);
+				if (!hiddenBy) els[i].style[prop] = els[i].origProp;
+			} else if (visibility == 'hidden') { // hide if behind
+				var elPos = hs.getPosition(els[i]);
+				elPos.w = els[i].offsetWidth;
+				elPos.h = els[i].offsetHeight;
+			
+				
+					var clearsX = (elPos.x + elPos.w < this.x.get('opos') 
+						|| elPos.x > this.x.get('opos') + this.x.get('osize'));
+					var clearsY = (elPos.y + elPos.h < this.y.get('opos') 
+						|| elPos.y > this.y.get('opos') + this.y.get('osize'));
+				var wrapperKey = hs.getWrapperKey(els[i]);
+				if (!clearsX && !clearsY && wrapperKey != this.key) { // element falls behind image
+					if (!hiddenBy) {
+						els[i].setAttribute('hidden-by', '['+ this.key +']');
+						els[i].origProp = els[i].style[prop];
+						els[i].style[prop] = 'hidden';
+						
+					} else if (hiddenBy.indexOf('['+ this.key +']') == -1) {
+						els[i].setAttribute('hidden-by', hiddenBy + '['+ this.key +']');
+					}
+				} else if ((hiddenBy == '['+ this.key +']' || hs.focusKey == wrapperKey)
+						&& wrapperKey != this.key) { // on move
+					els[i].setAttribute('hidden-by', '');
+					els[i].style[prop] = els[i].origProp || '';
+				} else if (hiddenBy && hiddenBy.indexOf('['+ this.key +']') > -1) {
+					els[i].setAttribute('hidden-by', hiddenBy.replace('['+ this.key +']', ''));
+				}
+						
+			}
+		}
+	}
+},
+
+focus : function() {
+	this.wrapper.style.zIndex = hs.zIndexCounter += 2;
+	// blur others
+	for (var i = 0; i < hs.expanders.length; i++) {
+		if (hs.expanders[i] && i == hs.focusKey) {
+			var blurExp = hs.expanders[i];
+			blurExp.content.className += ' highslide-'+ blurExp.contentType +'-blur';
+				blurExp.content.style.cursor = hs.ieLt7 ? 'hand' : 'pointer';
+				blurExp.content.title = hs.lang.focusTitle;
+		}
+	}
+	
+	// focus this
+	if (this.outline) this.outline.table.style.zIndex 
+		= this.wrapper.style.zIndex - 1;
+	this.content.className = 'highslide-'+ this.contentType;
+		this.content.title = hs.lang.restoreTitle;
+		
+		if (hs.restoreCursor) {
+			hs.styleRestoreCursor = window.opera ? 'pointer' : 'url('+ hs.graphicsDir + hs.restoreCursor +'), pointer';
+			if (hs.ieLt7 && hs.uaVersion < 6) hs.styleRestoreCursor = 'hand';
+			this.content.style.cursor = hs.styleRestoreCursor;
+		}
+		
+	hs.focusKey = this.key;	
+	hs.addEventListener(document, window.opera ? 'keypress' : 'keydown', hs.keyHandler);	
+},
+moveTo: function(x, y) {
+	this.x.setPos(x);
+	this.y.setPos(y);
+},
+resize : function (e) {
+	var w, h, r = e.width / e.height;
+	w = Math.max(e.width + e.dX, Math.min(this.minWidth, this.x.full));
+	if (this.isImage && Math.abs(w - this.x.full) < 12) w = this.x.full;
+	h = w / r;
+	if (h < Math.min(this.minHeight, this.y.full)) {
+		h = Math.min(this.minHeight, this.y.full);
+		if (this.isImage) w = h * r;
+	}
+	this.resizeTo(w, h);
+},
+resizeTo: function(w, h) {
+	this.y.setSize(h);
+	this.x.setSize(w);
+	this.wrapper.style.height = this.y.get('wsize') +'px';
+},
+
+close : function() {
+	if (this.isClosing || !this.isExpanded) return;
+	this.isClosing = true;
+	
+	hs.removeEventListener(document, window.opera ? 'keypress' : 'keydown', hs.keyHandler);
+	
+	try {
+		this.content.style.cursor = 'default';
+		this.changeSize(
+			0, {
+				wrapper: {
+					width : this.x.t,
+					height : this.y.t,
+					left: this.x.tpos - this.x.cb + this.x.tb,
+					top: this.y.tpos - this.y.cb + this.y.tb
+				},
+				content: {
+					left: 0,
+					top: 0,
+					width: this.x.t,
+					height: this.y.t
+				}
+			}, hs.restoreDuration
+		);
+	} catch (e) { this.afterClose(); }
+},
+
+createOverlay : function (o) {
+	var el = o.overlayId;
+	if (typeof el == 'string') el = hs.getNode(el);
+	if (o.html) el = hs.createElement('div', { innerHTML: o.html });
+	if (!el || typeof el == 'string') return;
+	el.style.display = 'block';
+	this.genOverlayBox();
+	var width = o.width && /^[0-9]+(px|%)$/.test(o.width) ? o.width : 'auto';
+	if (/^(left|right)panel$/.test(o.position) && !/^[0-9]+px$/.test(o.width)) width = '200px';
+	var overlay = hs.createElement(
+		'div', {
+			id: 'hsId'+ hs.idCounter++,
+			hsId: o.hsId
+		}, {
+			position: 'absolute',
+			visibility: 'hidden',
+			width: width,
+			direction: hs.lang.cssDirection || '',
+			opacity: 0
+		},this.overlayBox,
+		true
+	);
+	
+	overlay.appendChild(el);
+	hs.extend(overlay, {
+		opacity: 1,
+		offsetX: 0,
+		offsetY: 0,
+		dur: (o.fade === 0 || o.fade === false || (o.fade == 2 && hs.ie)) ? 0 : 250
+	});
+	hs.extend(overlay, o);
+	
+		
+	if (this.gotOverlays) {
+		this.positionOverlay(overlay);
+		if (!overlay.hideOnMouseOut || this.mouseIsOver) 
+			hs.animate(overlay, { opacity: overlay.opacity }, overlay.dur);
+	}
+	hs.push(this.overlays, hs.idCounter - 1);
+},
+positionOverlay : function(overlay) {
+	var p = overlay.position || 'middle center',
+		offX = overlay.offsetX,
+		offY = overlay.offsetY;
+	if (overlay.parentNode != this.overlayBox) this.overlayBox.appendChild(overlay);
+	if (/left$/.test(p)) overlay.style.left = offX +'px'; 
+	
+	if (/center$/.test(p))	hs.setStyles (overlay, { 
+		left: '50%',
+		marginLeft: (offX - Math.round(overlay.offsetWidth / 2)) +'px'
+	});	
+	
+	if (/right$/.test(p)) overlay.style.right = - offX +'px';
+		
+	if (/^leftpanel$/.test(p)) { 
+		hs.setStyles(overlay, {
+			right: '100%',
+			marginRight: this.x.cb +'px',
+			top: - this.y.cb +'px',
+			bottom: - this.y.cb +'px',
+			overflow: 'auto'
+		});		 
+		this.x.p1 = overlay.offsetWidth;
+	
+	} else if (/^rightpanel$/.test(p)) {
+		hs.setStyles(overlay, {
+			left: '100%',
+			marginLeft: this.x.cb +'px',
+			top: - this.y.cb +'px',
+			bottom: - this.y.cb +'px',
+			overflow: 'auto'
+		});
+		this.x.p2 = overlay.offsetWidth;
+	}
+
+	if (/^top/.test(p)) overlay.style.top = offY +'px'; 
+	if (/^middle/.test(p))	hs.setStyles (overlay, { 
+		top: '50%', 
+		marginTop: (offY - Math.round(overlay.offsetHeight / 2)) +'px'
+	});	
+	if (/^bottom/.test(p)) overlay.style.bottom = - offY +'px';
+	if (/^above$/.test(p)) {
+		hs.setStyles(overlay, {
+			left: (- this.x.p1 - this.x.cb) +'px',
+			right: (- this.x.p2 - this.x.cb) +'px',
+			bottom: '100%',
+			marginBottom: this.y.cb +'px',
+			width: 'auto'
+		});
+		this.y.p1 = overlay.offsetHeight;
+	
+	} else if (/^below$/.test(p)) {
+		hs.setStyles(overlay, {
+			position: 'relative',
+			left: (- this.x.p1 - this.x.cb) +'px',
+			right: (- this.x.p2 - this.x.cb) +'px',
+			top: '100%',
+			marginTop: this.y.cb +'px',
+			width: 'auto'
+		});
+		this.y.p2 = overlay.offsetHeight;
+		overlay.style.position = 'absolute';
+	}
+},
+
+getOverlays : function() {	
+	this.getInline(['heading', 'caption'], true);
+	if (this.heading && this.dragByHeading) this.heading.className += ' highslide-move';
+	if (hs.showCredits) this.writeCredits();
+	for (var i = 0; i < hs.overlays.length; i++) {
+		var o = hs.overlays[i], tId = o.thumbnailId, sg = o.slideshowGroup;
+		if ((!tId && !sg) || (tId && tId == this.thumbsUserSetId)
+				|| (sg && sg === this.slideshowGroup)) {
+			this.createOverlay(o);
+		}
+	}
+	var os = [];
+	for (var i = 0; i < this.overlays.length; i++) {
+		var o = hs.$('hsId'+ this.overlays[i]);
+		if (/panel$/.test(o.position)) this.positionOverlay(o);
+		else hs.push(os, o);
+	}
+	for (var i = 0; i < os.length; i++) this.positionOverlay(os[i]);
+	this.gotOverlays = true;
+},
+genOverlayBox : function() {
+	if (!this.overlayBox) this.overlayBox = hs.createElement (
+		'div', {
+			className: this.wrapperClassName
+		}, {
+			position : 'absolute',
+			width: (this.x.size || (this.useBox ? this.width : null) 
+				|| this.x.full) +'px',
+			height: (this.y.size || this.y.full) +'px',
+			visibility : 'hidden',
+			overflow : 'hidden',
+			zIndex : hs.ie ? 4 : 'auto'
+		},
+		hs.container,
+		true
+	);
+},
+sizeOverlayBox : function(doWrapper, doPanels) {
+	var overlayBox = this.overlayBox, 
+		x = this.x,
+		y = this.y;
+	hs.setStyles( overlayBox, {
+		width: x.size +'px', 
+		height: y.size +'px'
+	});
+	if (doWrapper || doPanels) {
+		for (var i = 0; i < this.overlays.length; i++) {
+			var o = hs.$('hsId'+ this.overlays[i]);
+			var ie6 = (hs.ieLt7 || document.compatMode == 'BackCompat');
+			if (o && /^(above|below)$/.test(o.position)) {
+				if (ie6) {
+					o.style.width = (overlayBox.offsetWidth + 2 * x.cb
+						+ x.p1 + x.p2) +'px';
+				}
+				y[o.position == 'above' ? 'p1' : 'p2'] = o.offsetHeight;
+			}
+			if (o && ie6 && /^(left|right)panel$/.test(o.position)) {
+				o.style.height = (overlayBox.offsetHeight + 2* y.cb) +'px';
+			}
+		}
+	}
+	if (doWrapper) {
+		hs.setStyles(this.content, {
+			top: y.p1 +'px'
+		});
+		hs.setStyles(overlayBox, {
+			top: (y.p1 + y.cb) +'px'
+		});
+	}
+},
+
+showOverlays : function() {
+	var b = this.overlayBox;
+	b.className = '';
+	hs.setStyles(b, {
+		top: (this.y.p1 + this.y.cb) +'px',
+		left: (this.x.p1 + this.x.cb) +'px',
+		overflow : 'visible'
+	});
+	if (hs.safari) b.style.visibility = 'visible';
+	this.wrapper.appendChild (b);
+	for (var i = 0; i < this.overlays.length; i++) {
+		var o = hs.$('hsId'+ this.overlays[i]);
+		o.style.zIndex = o.zIndex || 4;
+		if (!o.hideOnMouseOut || this.mouseIsOver) {
+			o.style.visibility = 'visible';
+			hs.setStyles(o, { visibility: 'visible', display: '' });
+			hs.animate(o, { opacity: o.opacity }, o.dur);
+		}
+	}
+},
+
+destroyOverlays : function() {
+	if (!this.overlays.length) return;
+	hs.discardElement(this.overlayBox);
+},
+
+
+
+createFullExpand : function () {
+	this.fullExpandLabel = hs.createElement(
+		'a', {
+			href: 'javascript:hs.expanders['+ this.key +'].doFullExpand();',
+			title: hs.lang.fullExpandTitle,
+			className: 'highslide-full-expand'
+		}
+	);
+	
+	this.createOverlay({ 
+		overlayId: this.fullExpandLabel, 
+		position: hs.fullExpandPosition, 
+		hideOnMouseOut: true, 
+		opacity: hs.fullExpandOpacity
+	});
+},
+
+doFullExpand : function () {
+	try {
+		if (this.fullExpandLabel) hs.discardElement(this.fullExpandLabel);
+		
+		this.focus();
+		var xSize = this.x.size,
+        	ySize = this.y.size;
+        this.resizeTo(this.x.full, this.y.full);
+       
+        var xpos = this.x.pos - (this.x.size - xSize) / 2;
+        if (xpos < hs.marginLeft) xpos = hs.marginLeft;
+       
+        var ypos = this.y.pos - (this.y.size - ySize) / 2;
+        if (ypos < hs.marginTop) ypos = hs.marginTop;
+       
+        this.moveTo(xpos, ypos);
+		this.doShowHide('hidden');
+	
+	} catch (e) {
+		this.error(e);
+	}
+},
+
+
+afterClose : function () {
+	this.a.className = this.a.className.replace('highslide-active-anchor', '');
+	
+	this.doShowHide('visible');
+		if (this.outline && this.outlineWhileAnimating) this.outline.destroy();
+	
+		hs.discardElement(this.wrapper);
+	
+	hs.expanders[this.key] = null;		
+	hs.reOrder();
+}
+
+};
+hs.langDefaults = hs.lang;
+// history
+var HsExpander = hs.Expander;
+if (hs.ie && window == window.top) {
+	(function () {
+		try {
+			document.documentElement.doScroll('left');
+		} catch (e) {
+			setTimeout(arguments.callee, 50);
+			return;
+		}
+		hs.ready();
+	})();
+}
+hs.addEventListener(document, 'DOMContentLoaded', hs.ready);
+hs.addEventListener(window, 'load', hs.ready);
+
+// set handlers
+hs.addEventListener(document, 'ready', function() {
+	if (hs.expandCursor) {
+		var style = hs.createElement('style', { type: 'text/css' }, null, 
+			document.getElementsByTagName('HEAD')[0]), 
+			backCompat = document.compatMode == 'BackCompat';
+			
+		
+		function addRule(sel, dec) {
+			if (hs.ie && (hs.uaVersion < 9 || backCompat)) {
+				var last = document.styleSheets[document.styleSheets.length - 1];
+				if (typeof(last.addRule) == "object") last.addRule(sel, dec);
+			} else {
+				style.appendChild(document.createTextNode(sel + " {" + dec + "}"));
+			}
+		}
+		function fix(prop) {
+			return 'expression( ( ( ignoreMe = document.documentElement.'+ prop +
+				' ? document.documentElement.'+ prop +' : document.body.'+ prop +' ) ) + \'px\' );';
+		}
+		if (hs.expandCursor) addRule ('.highslide img', 
+			'cursor: url('+ hs.graphicsDir + hs.expandCursor +'), pointer !important;');
+	}
+});
+hs.addEventListener(window, 'resize', function() {
+	hs.getPageSize();
+});
+hs.addEventListener(document, 'mousemove', function(e) {
+	hs.mouse = { x: e.clientX, y: e.clientY	};
+});
+hs.addEventListener(document, 'mousedown', hs.mouseClickHandler);
+hs.addEventListener(document, 'mouseup', hs.mouseClickHandler);
+
+hs.addEventListener(document, 'ready', hs.getAnchors);
+hs.addEventListener(window, 'load', hs.preloadImages);
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide.min.js
new file mode 100644
index 0000000000000000000000000000000000000000..2437ab7cb4fd391b012eb33a331b71524147e24b
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide.min.js
@@ -0,0 +1,9 @@
+/** 
+ * Name:    Highslide JS
+ * Version: 4.1.13 (2011-10-06)
+ * Config:  default
+ * Author:  Torstein Hønsi
+ * Support: www.highslide.com/support
+ * License: www.highslide.com/#license
+ */
+if(!hs){var hs={lang:{cssDirection:"ltr",loadingText:"Loading...",loadingTitle:"Click to cancel",focusTitle:"Click to bring to front",fullExpandTitle:"Expand to actual size (f)",creditsText:"Powered by <i>Highslide JS</i>",creditsTitle:"Go to the Highslide JS homepage",restoreTitle:"Click to close image, click and drag to move. Use arrow keys for next and previous."},graphicsDir:"highslide/graphics/",expandCursor:"zoomin.cur",restoreCursor:"zoomout.cur",expandDuration:250,restoreDuration:250,marginLeft:15,marginRight:15,marginTop:15,marginBottom:15,zIndexCounter:1001,loadingOpacity:0.75,allowMultipleInstances:true,numberOfImagesToPreload:5,outlineWhileAnimating:2,outlineStartOffset:3,padToMinWidth:false,fullExpandPosition:"bottom right",fullExpandOpacity:1,showCredits:true,creditsHref:"http://highslide.com/",creditsTarget:"_self",enableKeyListener:true,openerTagNames:["a"],dragByHeading:true,minWidth:200,minHeight:200,allowSizeReduction:true,outlineType:"drop-shadow",preloadTheseImages:[],continuePreloading:true,expanders:[],overrides:["allowSizeReduction","useBox","outlineType","outlineWhileAnimating","captionId","captionText","captionEval","captionOverlay","headingId","headingText","headingEval","headingOverlay","creditsPosition","dragByHeading","width","height","wrapperClassName","minWidth","minHeight","maxWidth","maxHeight","pageOrigin","slideshowGroup","easing","easingClose","fadeInOut","src"],overlays:[],idCounter:0,oPos:{x:["leftpanel","left","center","right","rightpanel"],y:["above","top","middle","bottom","below"]},mouse:{},headingOverlay:{},captionOverlay:{},timers:[],pendingOutlines:{},clones:{},onReady:[],uaVersion:/Trident\/4\.0/.test(navigator.userAgent)?8:parseFloat((navigator.userAgent.toLowerCase().match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1]),ie:(document.all&&!window.opera),safari:/Safari/.test(navigator.userAgent),geckoMac:/Macintosh.+rv:1\.[0-8].+Gecko/.test(navigator.userAgent),$:function(a){if(a){return document.getElementById(a)}},push:function(a,b){a[a.length]=b},createElement:function(a,f,e,d,c){var b=document.createElement(a);if(f){hs.extend(b,f)}if(c){hs.setStyles(b,{padding:0,border:"none",margin:0})}if(e){hs.setStyles(b,e)}if(d){d.appendChild(b)}return b},extend:function(b,c){for(var a in c){b[a]=c[a]}return b},setStyles:function(b,c){for(var a in c){if(hs.ieLt9&&a=="opacity"){if(c[a]>0.99){b.style.removeAttribute("filter")}else{b.style.filter="alpha(opacity="+(c[a]*100)+")"}}else{b.style[a]=c[a]}}},animate:function(f,a,d){var c,g,j;if(typeof d!="object"||d===null){var i=arguments;d={duration:i[2],easing:i[3],complete:i[4]}}if(typeof d.duration!="number"){d.duration=250}d.easing=Math[d.easing]||Math.easeInQuad;d.curAnim=hs.extend({},a);for(var b in a){var h=new hs.fx(f,d,b);c=parseFloat(hs.css(f,b))||0;g=parseFloat(a[b]);j=b!="opacity"?"px":"";h.custom(c,g,j)}},css:function(a,c){if(a.style[c]){return a.style[c]}else{if(document.defaultView){return document.defaultView.getComputedStyle(a,null).getPropertyValue(c)}else{if(c=="opacity"){c="filter"}var b=a.currentStyle[c.replace(/\-(\w)/g,function(e,d){return d.toUpperCase()})];if(c=="filter"){b=b.replace(/alpha\(opacity=([0-9]+)\)/,function(e,d){return d/100})}return b===""?1:b}}},getPageSize:function(){var f=document,b=window,e=f.compatMode&&f.compatMode!="BackCompat"?f.documentElement:f.body,g=hs.ie&&(hs.uaVersion<9||typeof pageXOffset=="undefined");var c=g?e.clientWidth:(f.documentElement.clientWidth||self.innerWidth),a=g?e.clientHeight:self.innerHeight;hs.page={width:c,height:a,scrollLeft:g?e.scrollLeft:pageXOffset,scrollTop:g?e.scrollTop:pageYOffset};return hs.page},getPosition:function(a){var b={x:a.offsetLeft,y:a.offsetTop};while(a.offsetParent){a=a.offsetParent;b.x+=a.offsetLeft;b.y+=a.offsetTop;if(a!=document.body&&a!=document.documentElement){b.x-=a.scrollLeft;b.y-=a.scrollTop}}return b},expand:function(b,g,d,c){if(!b){b=hs.createElement("a",null,{display:"none"},hs.container)}if(typeof b.getParams=="function"){return g}try{new hs.Expander(b,g,d);return false}catch(f){return true}},focusTopmost:function(){var c=0,b=-1,a=hs.expanders,e,f;for(var d=0;d<a.length;d++){e=a[d];if(e){f=e.wrapper.style.zIndex;if(f&&f>c){c=f;b=d}}}if(b==-1){hs.focusKey=-1}else{a[b].focus()}},getParam:function(b,d){b.getParams=b.onclick;var c=b.getParams?b.getParams():null;b.getParams=null;return(c&&typeof c[d]!="undefined")?c[d]:(typeof hs[d]!="undefined"?hs[d]:null)},getSrc:function(b){var c=hs.getParam(b,"src");if(c){return c}return b.href},getNode:function(e){var c=hs.$(e),d=hs.clones[e],b={};if(!c&&!d){return null}if(!d){d=c.cloneNode(true);d.id="";hs.clones[e]=d;return c}else{return d.cloneNode(true)}},discardElement:function(a){if(a){hs.garbageBin.appendChild(a)}hs.garbageBin.innerHTML=""},transit:function(a,d){var b=d||hs.getExpander();d=b;if(hs.upcoming){return false}else{hs.last=b}hs.removeEventListener(document,window.opera?"keypress":"keydown",hs.keyHandler);try{hs.upcoming=a;a.onclick()}catch(c){hs.last=hs.upcoming=null}try{d.close()}catch(c){}return false},previousOrNext:function(a,c){var b=hs.getExpander(a);if(b){return hs.transit(b.getAdjacentAnchor(c),b)}else{return false}},previous:function(a){return hs.previousOrNext(a,-1)},next:function(a){return hs.previousOrNext(a,1)},keyHandler:function(a){if(!a){a=window.event}if(!a.target){a.target=a.srcElement}if(typeof a.target.form!="undefined"){return true}var b=hs.getExpander();var c=null;switch(a.keyCode){case 70:if(b){b.doFullExpand()}return true;case 32:case 34:case 39:case 40:c=1;break;case 8:case 33:case 37:case 38:c=-1;break;case 27:case 13:c=0}if(c!==null){hs.removeEventListener(document,window.opera?"keypress":"keydown",hs.keyHandler);if(!hs.enableKeyListener){return true}if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}if(b){if(c==0){b.close()}else{hs.previousOrNext(b.key,c)}return false}}return true},registerOverlay:function(a){hs.push(hs.overlays,hs.extend(a,{hsId:"hsId"+hs.idCounter++}))},getWrapperKey:function(c,b){var e,d=/^highslide-wrapper-([0-9]+)$/;e=c;while(e.parentNode){if(e.id&&d.test(e.id)){return e.id.replace(d,"$1")}e=e.parentNode}if(!b){e=c;while(e.parentNode){if(e.tagName&&hs.isHsAnchor(e)){for(var a=0;a<hs.expanders.length;a++){var f=hs.expanders[a];if(f&&f.a==e){return a}}}e=e.parentNode}}return null},getExpander:function(b,a){if(typeof b=="undefined"){return hs.expanders[hs.focusKey]||null}if(typeof b=="number"){return hs.expanders[b]||null}if(typeof b=="string"){b=hs.$(b)}return hs.expanders[hs.getWrapperKey(b,a)]||null},isHsAnchor:function(b){return(b.onclick&&b.onclick.toString().replace(/\s/g," ").match(/hs.(htmlE|e)xpand/))},reOrder:function(){for(var a=0;a<hs.expanders.length;a++){if(hs.expanders[a]&&hs.expanders[a].isExpanded){hs.focusTopmost()}}},mouseClickHandler:function(d){if(!d){d=window.event}if(d.button>1){return true}if(!d.target){d.target=d.srcElement}var b=d.target;while(b.parentNode&&!(/highslide-(image|move|html|resize)/.test(b.className))){b=b.parentNode}var f=hs.getExpander(b);if(f&&(f.isClosing||!f.isExpanded)){return true}if(f&&d.type=="mousedown"){if(d.target.form){return true}var a=b.className.match(/highslide-(image|move|resize)/);if(a){hs.dragArgs={exp:f,type:a[1],left:f.x.pos,width:f.x.size,top:f.y.pos,height:f.y.size,clickX:d.clientX,clickY:d.clientY};hs.addEventListener(document,"mousemove",hs.dragHandler);if(d.preventDefault){d.preventDefault()}if(/highslide-(image|html)-blur/.test(f.content.className)){f.focus();hs.hasFocused=true}return false}}else{if(d.type=="mouseup"){hs.removeEventListener(document,"mousemove",hs.dragHandler);if(hs.dragArgs){if(hs.styleRestoreCursor&&hs.dragArgs.type=="image"){hs.dragArgs.exp.content.style.cursor=hs.styleRestoreCursor}var c=hs.dragArgs.hasDragged;if(!c&&!hs.hasFocused&&!/(move|resize)/.test(hs.dragArgs.type)){f.close()}else{if(c||(!c&&hs.hasHtmlExpanders)){hs.dragArgs.exp.doShowHide("hidden")}}hs.hasFocused=false;hs.dragArgs=null}else{if(/highslide-image-blur/.test(b.className)){b.style.cursor=hs.styleRestoreCursor}}}}return false},dragHandler:function(c){if(!hs.dragArgs){return true}if(!c){c=window.event}var b=hs.dragArgs,d=b.exp;b.dX=c.clientX-b.clickX;b.dY=c.clientY-b.clickY;var f=Math.sqrt(Math.pow(b.dX,2)+Math.pow(b.dY,2));if(!b.hasDragged){b.hasDragged=(b.type!="image"&&f>0)||(f>(hs.dragSensitivity||5))}if(b.hasDragged&&c.clientX>5&&c.clientY>5){if(b.type=="resize"){d.resize(b)}else{d.moveTo(b.left+b.dX,b.top+b.dY);if(b.type=="image"){d.content.style.cursor="move"}}}return false},wrapperMouseHandler:function(c){try{if(!c){c=window.event}var b=/mouseover/i.test(c.type);if(!c.target){c.target=c.srcElement}if(!c.relatedTarget){c.relatedTarget=b?c.fromElement:c.toElement}var d=hs.getExpander(c.target);if(!d.isExpanded){return}if(!d||!c.relatedTarget||hs.getExpander(c.relatedTarget,true)==d||hs.dragArgs){return}for(var a=0;a<d.overlays.length;a++){(function(){var e=hs.$("hsId"+d.overlays[a]);if(e&&e.hideOnMouseOut){if(b){hs.setStyles(e,{visibility:"visible",display:""})}hs.animate(e,{opacity:b?e.opacity:0},e.dur)}})()}}catch(c){}},addEventListener:function(a,c,b){if(a==document&&c=="ready"){hs.push(hs.onReady,b)}try{a.addEventListener(c,b,false)}catch(d){try{a.detachEvent("on"+c,b);a.attachEvent("on"+c,b)}catch(d){a["on"+c]=b}}},removeEventListener:function(a,c,b){try{a.removeEventListener(c,b,false)}catch(d){try{a.detachEvent("on"+c,b)}catch(d){a["on"+c]=null}}},preloadFullImage:function(b){if(hs.continuePreloading&&hs.preloadTheseImages[b]&&hs.preloadTheseImages[b]!="undefined"){var a=document.createElement("img");a.onload=function(){a=null;hs.preloadFullImage(b+1)};a.src=hs.preloadTheseImages[b]}},preloadImages:function(c){if(c&&typeof c!="object"){hs.numberOfImagesToPreload=c}var a=hs.getAnchors();for(var b=0;b<a.images.length&&b<hs.numberOfImagesToPreload;b++){hs.push(hs.preloadTheseImages,hs.getSrc(a.images[b]))}if(hs.outlineType){new hs.Outline(hs.outlineType,function(){hs.preloadFullImage(0)})}else{hs.preloadFullImage(0)}if(hs.restoreCursor){var d=hs.createElement("img",{src:hs.graphicsDir+hs.restoreCursor})}},init:function(){if(!hs.container){hs.ieLt7=hs.ie&&hs.uaVersion<7;hs.ieLt9=hs.ie&&hs.uaVersion<9;hs.getPageSize();for(var a in hs.langDefaults){if(typeof hs[a]!="undefined"){hs.lang[a]=hs[a]}else{if(typeof hs.lang[a]=="undefined"&&typeof hs.langDefaults[a]!="undefined"){hs.lang[a]=hs.langDefaults[a]}}}hs.container=hs.createElement("div",{className:"highslide-container"},{position:"absolute",left:0,top:0,width:"100%",zIndex:hs.zIndexCounter,direction:"ltr"},document.body,true);hs.loading=hs.createElement("a",{className:"highslide-loading",title:hs.lang.loadingTitle,innerHTML:hs.lang.loadingText,href:"javascript:;"},{position:"absolute",top:"-9999px",opacity:hs.loadingOpacity,zIndex:1},hs.container);hs.garbageBin=hs.createElement("div",null,{display:"none"},hs.container);Math.linearTween=function(f,e,h,g){return h*f/g+e};Math.easeInQuad=function(f,e,h,g){return h*(f/=g)*f+e};hs.hideSelects=hs.ieLt7;hs.hideIframes=((window.opera&&hs.uaVersion<9)||navigator.vendor=="KDE"||(hs.ieLt7&&hs.uaVersion<5.5))}},ready:function(){if(hs.isReady){return}hs.isReady=true;for(var a=0;a<hs.onReady.length;a++){hs.onReady[a]()}},updateAnchors:function(){var a,c,k=[],h=[],b={},l;for(var e=0;e<hs.openerTagNames.length;e++){c=document.getElementsByTagName(hs.openerTagNames[e]);for(var d=0;d<c.length;d++){a=c[d];l=hs.isHsAnchor(a);if(l){hs.push(k,a);if(l[0]=="hs.expand"){hs.push(h,a)}var f=hs.getParam(a,"slideshowGroup")||"none";if(!b[f]){b[f]=[]}hs.push(b[f],a)}}}hs.anchors={all:k,groups:b,images:h};return hs.anchors},getAnchors:function(){return hs.anchors||hs.updateAnchors()},close:function(a){var b=hs.getExpander(a);if(b){b.close()}return false}};hs.fx=function(b,a,c){this.options=a;this.elem=b;this.prop=c;if(!a.orig){a.orig={}}};hs.fx.prototype={update:function(){(hs.fx.step[this.prop]||hs.fx.step._default)(this);if(this.options.step){this.options.step.call(this.elem,this.now,this)}},custom:function(e,d,c){this.startTime=(new Date()).getTime();this.start=e;this.end=d;this.unit=c;this.now=this.start;this.pos=this.state=0;var a=this;function b(f){return a.step(f)}b.elem=this.elem;if(b()&&hs.timers.push(b)==1){hs.timerId=setInterval(function(){var g=hs.timers;for(var f=0;f<g.length;f++){if(!g[f]()){g.splice(f--,1)}}if(!g.length){clearInterval(hs.timerId)}},13)}},step:function(d){var c=(new Date()).getTime();if(d||c>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var a=true;for(var b in this.options.curAnim){if(this.options.curAnim[b]!==true){a=false}}if(a){if(this.options.complete){this.options.complete.call(this.elem)}}return false}else{var e=c-this.startTime;this.state=e/this.options.duration;this.pos=this.options.easing(e,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};hs.extend(hs.fx,{step:{opacity:function(a){hs.setStyles(a.elem,{opacity:a.now})},_default:function(a){try{if(a.elem.style&&a.elem.style[a.prop]!=null){a.elem.style[a.prop]=a.now+a.unit}else{a.elem[a.prop]=a.now}}catch(b){}}}});hs.Outline=function(g,e){this.onLoad=e;this.outlineType=g;var a=hs.uaVersion,f;this.hasAlphaImageLoader=hs.ie&&hs.uaVersion<7;if(!g){if(e){e()}return}hs.init();this.table=hs.createElement("table",{cellSpacing:0},{visibility:"hidden",position:"absolute",borderCollapse:"collapse",width:0},hs.container,true);var b=hs.createElement("tbody",null,null,this.table,1);this.td=[];for(var c=0;c<=8;c++){if(c%3==0){f=hs.createElement("tr",null,{height:"auto"},b,true)}this.td[c]=hs.createElement("td",null,null,f,true);var d=c!=4?{lineHeight:0,fontSize:0}:{position:"relative"};hs.setStyles(this.td[c],d)}this.td[4].className=g+" highslide-outline";this.preloadGraphic()};hs.Outline.prototype={preloadGraphic:function(){var b=hs.graphicsDir+(hs.outlinesDir||"outlines/")+this.outlineType+".png";var a=hs.safari&&hs.uaVersion<525?hs.container:null;this.graphic=hs.createElement("img",null,{position:"absolute",top:"-9999px"},a,true);var c=this;this.graphic.onload=function(){c.onGraphicLoad()};this.graphic.src=b},onGraphicLoad:function(){var d=this.offset=this.graphic.width/4,f=[[0,0],[0,-4],[-2,0],[0,-8],0,[-2,-8],[0,-2],[0,-6],[-2,-2]],c={height:(2*d)+"px",width:(2*d)+"px"};for(var b=0;b<=8;b++){if(f[b]){if(this.hasAlphaImageLoader){var a=(b==1||b==7)?"100%":this.graphic.width+"px";var e=hs.createElement("div",null,{width:"100%",height:"100%",position:"relative",overflow:"hidden"},this.td[b],true);hs.createElement("div",null,{filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale, src='"+this.graphic.src+"')",position:"absolute",width:a,height:this.graphic.height+"px",left:(f[b][0]*d)+"px",top:(f[b][1]*d)+"px"},e,true)}else{hs.setStyles(this.td[b],{background:"url("+this.graphic.src+") "+(f[b][0]*d)+"px "+(f[b][1]*d)+"px"})}if(window.opera&&(b==3||b==5)){hs.createElement("div",null,c,this.td[b],true)}hs.setStyles(this.td[b],c)}}this.graphic=null;if(hs.pendingOutlines[this.outlineType]){hs.pendingOutlines[this.outlineType].destroy()}hs.pendingOutlines[this.outlineType]=this;if(this.onLoad){this.onLoad()}},setPosition:function(g,e,c,b,f){var d=this.exp,a=d.wrapper.style,e=e||0,g=g||{x:d.x.pos+e,y:d.y.pos+e,w:d.x.get("wsize")-2*e,h:d.y.get("wsize")-2*e};if(c){this.table.style.visibility=(g.h>=4*this.offset)?"visible":"hidden"}hs.setStyles(this.table,{left:(g.x-this.offset)+"px",top:(g.y-this.offset)+"px",width:(g.w+2*this.offset)+"px"});g.w-=2*this.offset;g.h-=2*this.offset;hs.setStyles(this.td[4],{width:g.w>=0?g.w+"px":0,height:g.h>=0?g.h+"px":0});if(this.hasAlphaImageLoader){this.td[3].style.height=this.td[5].style.height=this.td[4].style.height}},destroy:function(a){if(a){this.table.style.visibility="hidden"}else{hs.discardElement(this.table)}}};hs.Dimension=function(b,a){this.exp=b;this.dim=a;this.ucwh=a=="x"?"Width":"Height";this.wh=this.ucwh.toLowerCase();this.uclt=a=="x"?"Left":"Top";this.lt=this.uclt.toLowerCase();this.ucrb=a=="x"?"Right":"Bottom";this.rb=this.ucrb.toLowerCase();this.p1=this.p2=0};hs.Dimension.prototype={get:function(a){switch(a){case"loadingPos":return this.tpos+this.tb+(this.t-hs.loading["offset"+this.ucwh])/2;case"wsize":return this.size+2*this.cb+this.p1+this.p2;case"fitsize":return this.clientSize-this.marginMin-this.marginMax;case"maxsize":return this.get("fitsize")-2*this.cb-this.p1-this.p2;case"opos":return this.pos-(this.exp.outline?this.exp.outline.offset:0);case"osize":return this.get("wsize")+(this.exp.outline?2*this.exp.outline.offset:0);case"imgPad":return this.imgSize?Math.round((this.size-this.imgSize)/2):0}},calcBorders:function(){this.cb=(this.exp.content["offset"+this.ucwh]-this.t)/2;this.marginMax=hs["margin"+this.ucrb]},calcThumb:function(){this.t=this.exp.el[this.wh]?parseInt(this.exp.el[this.wh]):this.exp.el["offset"+this.ucwh];this.tpos=this.exp.tpos[this.dim];this.tb=(this.exp.el["offset"+this.ucwh]-this.t)/2;if(this.tpos==0||this.tpos==-1){this.tpos=(hs.page[this.wh]/2)+hs.page["scroll"+this.uclt]}},calcExpanded:function(){var a=this.exp;this.justify="auto";this.pos=this.tpos-this.cb+this.tb;if(this.maxHeight&&this.dim=="x"){a.maxWidth=Math.min(a.maxWidth||this.full,a.maxHeight*this.full/a.y.full)}this.size=Math.min(this.full,a["max"+this.ucwh]||this.full);this.minSize=a.allowSizeReduction?Math.min(a["min"+this.ucwh],this.full):this.full;if(a.isImage&&a.useBox){this.size=a[this.wh];this.imgSize=this.full}if(this.dim=="x"&&hs.padToMinWidth){this.minSize=a.minWidth}this.marginMin=hs["margin"+this.uclt];this.scroll=hs.page["scroll"+this.uclt];this.clientSize=hs.page[this.wh]},setSize:function(a){var b=this.exp;if(b.isImage&&(b.useBox||hs.padToMinWidth)){this.imgSize=a;this.size=Math.max(this.size,this.imgSize);b.content.style[this.lt]=this.get("imgPad")+"px"}else{this.size=a}b.content.style[this.wh]=a+"px";b.wrapper.style[this.wh]=this.get("wsize")+"px";if(b.outline){b.outline.setPosition()}if(this.dim=="x"&&b.overlayBox){b.sizeOverlayBox(true)}},setPos:function(a){this.pos=a;this.exp.wrapper.style[this.lt]=a+"px";if(this.exp.outline){this.exp.outline.setPosition()}}};hs.Expander=function(k,f,b,l){if(document.readyState&&hs.ie&&!hs.isReady){hs.addEventListener(document,"ready",function(){new hs.Expander(k,f,b,l)});return}this.a=k;this.custom=b;this.contentType=l||"image";this.isImage=!this.isHtml;hs.continuePreloading=false;this.overlays=[];hs.init();var m=this.key=hs.expanders.length;for(var g=0;g<hs.overrides.length;g++){var c=hs.overrides[g];this[c]=f&&typeof f[c]!="undefined"?f[c]:hs[c]}if(!this.src){this.src=k.href}var d=(f&&f.thumbnailId)?hs.$(f.thumbnailId):k;d=this.thumb=d.getElementsByTagName("img")[0]||d;this.thumbsUserSetId=d.id||k.id;for(var g=0;g<hs.expanders.length;g++){if(hs.expanders[g]&&hs.expanders[g].a==k){hs.expanders[g].focus();return false}}if(!hs.allowSimultaneousLoading){for(var g=0;g<hs.expanders.length;g++){if(hs.expanders[g]&&hs.expanders[g].thumb!=d&&!hs.expanders[g].onLoadStarted){hs.expanders[g].cancelLoading()}}}hs.expanders[m]=this;if(!hs.allowMultipleInstances&&!hs.upcoming){if(hs.expanders[m-1]){hs.expanders[m-1].close()}if(typeof hs.focusKey!="undefined"&&hs.expanders[hs.focusKey]){hs.expanders[hs.focusKey].close()}}this.el=d;this.tpos=this.pageOrigin||hs.getPosition(d);hs.getPageSize();var j=this.x=new hs.Dimension(this,"x");j.calcThumb();var h=this.y=new hs.Dimension(this,"y");h.calcThumb();this.wrapper=hs.createElement("div",{id:"highslide-wrapper-"+this.key,className:"highslide-wrapper "+this.wrapperClassName},{visibility:"hidden",position:"absolute",zIndex:hs.zIndexCounter+=2},null,true);this.wrapper.onmouseover=this.wrapper.onmouseout=hs.wrapperMouseHandler;if(this.contentType=="image"&&this.outlineWhileAnimating==2){this.outlineWhileAnimating=0}if(!this.outlineType){this[this.contentType+"Create"]()}else{if(hs.pendingOutlines[this.outlineType]){this.connectOutline();this[this.contentType+"Create"]()}else{this.showLoading();var e=this;new hs.Outline(this.outlineType,function(){e.connectOutline();e[e.contentType+"Create"]()})}}return true};hs.Expander.prototype={error:function(a){if(hs.debug){alert("Line "+a.lineNumber+": "+a.message)}else{window.location.href=this.src}},connectOutline:function(){var a=this.outline=hs.pendingOutlines[this.outlineType];a.exp=this;a.table.style.zIndex=this.wrapper.style.zIndex-1;hs.pendingOutlines[this.outlineType]=null},showLoading:function(){if(this.onLoadStarted||this.loading){return}this.loading=hs.loading;var c=this;this.loading.onclick=function(){c.cancelLoading()};var c=this,a=this.x.get("loadingPos")+"px",b=this.y.get("loadingPos")+"px";setTimeout(function(){if(c.loading){hs.setStyles(c.loading,{left:a,top:b,zIndex:hs.zIndexCounter++})}},100)},imageCreate:function(){var b=this;var a=document.createElement("img");this.content=a;a.onload=function(){if(hs.expanders[b.key]){b.contentLoaded()}};if(hs.blockRightClick){a.oncontextmenu=function(){return false}}a.className="highslide-image";hs.setStyles(a,{visibility:"hidden",display:"block",position:"absolute",maxWidth:"9999px",zIndex:3});a.title=hs.lang.restoreTitle;if(hs.safari&&hs.uaVersion<525){hs.container.appendChild(a)}if(hs.ie&&hs.flushImgSize){a.src=null}a.src=this.src;this.showLoading()},contentLoaded:function(){try{if(!this.content){return}this.content.onload=null;if(this.onLoadStarted){return}else{this.onLoadStarted=true}var a=this.x,d=this.y;if(this.loading){hs.setStyles(this.loading,{top:"-9999px"});this.loading=null}a.full=this.content.width;d.full=this.content.height;hs.setStyles(this.content,{width:a.t+"px",height:d.t+"px"});this.wrapper.appendChild(this.content);hs.container.appendChild(this.wrapper);a.calcBorders();d.calcBorders();hs.setStyles(this.wrapper,{left:(a.tpos+a.tb-a.cb)+"px",top:(d.tpos+a.tb-d.cb)+"px"});this.getOverlays();var b=a.full/d.full;a.calcExpanded();this.justify(a);d.calcExpanded();this.justify(d);if(this.overlayBox){this.sizeOverlayBox(0,1)}if(this.allowSizeReduction){this.correctRatio(b);if(this.isImage&&this.x.full>(this.x.imgSize||this.x.size)){this.createFullExpand();if(this.overlays.length==1){this.sizeOverlayBox()}}}this.show()}catch(c){this.error(c)}},justify:function(f,b){var g,h=f.target,e=f==this.x?"x":"y";var d=false;var a=f.exp.allowSizeReduction;f.pos=Math.round(f.pos-((f.get("wsize")-f.t)/2));if(f.pos<f.scroll+f.marginMin){f.pos=f.scroll+f.marginMin;d=true}if(!b&&f.size<f.minSize){f.size=f.minSize;a=false}if(f.pos+f.get("wsize")>f.scroll+f.clientSize-f.marginMax){if(!b&&d&&a){f.size=Math.min(f.size,f.get(e=="y"?"fitsize":"maxsize"))}else{if(f.get("wsize")<f.get("fitsize")){f.pos=f.scroll+f.clientSize-f.marginMax-f.get("wsize")}else{f.pos=f.scroll+f.marginMin;if(!b&&a){f.size=f.get(e=="y"?"fitsize":"maxsize")}}}}if(!b&&f.size<f.minSize){f.size=f.minSize;a=false}if(f.pos<f.marginMin){var c=f.pos;f.pos=f.marginMin;if(a&&!b){f.size=f.size-(f.pos-c)}}},correctRatio:function(c){var a=this.x,g=this.y,e=false,d=Math.min(a.full,a.size),b=Math.min(g.full,g.size),f=(this.useBox||hs.padToMinWidth);if(d/b>c){d=b*c;if(d<a.minSize){d=a.minSize;b=d/c}e=true}else{if(d/b<c){b=d/c;e=true}}if(hs.padToMinWidth&&a.full<a.minSize){a.imgSize=a.full;g.size=g.imgSize=g.full}else{if(this.useBox){a.imgSize=d;g.imgSize=b}else{a.size=d;g.size=b}}e=this.fitOverlayBox(this.useBox?null:c,e);if(f&&g.size<g.imgSize){g.imgSize=g.size;a.imgSize=g.size*c}if(e||f){a.pos=a.tpos-a.cb+a.tb;a.minSize=a.size;this.justify(a,true);g.pos=g.tpos-g.cb+g.tb;g.minSize=g.size;this.justify(g,true);if(this.overlayBox){this.sizeOverlayBox()}}},fitOverlayBox:function(b,c){var a=this.x,d=this.y;if(this.overlayBox){while(d.size>this.minHeight&&a.size>this.minWidth&&d.get("wsize")>d.get("fitsize")){d.size-=10;if(b){a.size=d.size*b}this.sizeOverlayBox(0,1);c=true}}return c},show:function(){var a=this.x,b=this.y;this.doShowHide("hidden");this.changeSize(1,{wrapper:{width:a.get("wsize"),height:b.get("wsize"),left:a.pos,top:b.pos},content:{left:a.p1+a.get("imgPad"),top:b.p1+b.get("imgPad"),width:a.imgSize||a.size,height:b.imgSize||b.size}},hs.expandDuration)},changeSize:function(b,h,c){if(this.outline&&!this.outlineWhileAnimating){if(b){this.outline.setPosition()}else{this.outline.destroy()}}if(!b){this.destroyOverlays()}var e=this,a=e.x,g=e.y,f=this.easing;if(!b){f=this.easingClose||f}var d=b?function(){if(e.outline){e.outline.table.style.visibility="visible"}setTimeout(function(){e.afterExpand()},50)}:function(){e.afterClose()};if(b){hs.setStyles(this.wrapper,{width:a.t+"px",height:g.t+"px"})}if(this.fadeInOut){hs.setStyles(this.wrapper,{opacity:b?0:1});hs.extend(h.wrapper,{opacity:b})}hs.animate(this.wrapper,h.wrapper,{duration:c,easing:f,step:function(k,i){if(e.outline&&e.outlineWhileAnimating&&i.prop=="top"){var j=b?i.pos:1-i.pos;var l={w:a.t+(a.get("wsize")-a.t)*j,h:g.t+(g.get("wsize")-g.t)*j,x:a.tpos+(a.pos-a.tpos)*j,y:g.tpos+(g.pos-g.tpos)*j};e.outline.setPosition(l,0,1)}}});hs.animate(this.content,h.content,c,f,d);if(b){this.wrapper.style.visibility="visible";this.content.style.visibility="visible";this.a.className+=" highslide-active-anchor"}},afterExpand:function(){this.isExpanded=true;this.focus();if(hs.upcoming&&hs.upcoming==this.a){hs.upcoming=null}this.prepareNextOutline();var c=hs.page,b=hs.mouse.x+c.scrollLeft,a=hs.mouse.y+c.scrollTop;this.mouseIsOver=this.x.pos<b&&b<this.x.pos+this.x.get("wsize")&&this.y.pos<a&&a<this.y.pos+this.y.get("wsize");if(this.overlayBox){this.showOverlays()}},prepareNextOutline:function(){var a=this.key;var b=this.outlineType;new hs.Outline(b,function(){try{hs.expanders[a].preloadNext()}catch(c){}})},preloadNext:function(){var b=this.getAdjacentAnchor(1);if(b&&b.onclick.toString().match(/hs\.expand/)){var a=hs.createElement("img",{src:hs.getSrc(b)})}},getAdjacentAnchor:function(c){var b=this.getAnchorIndex(),a=hs.anchors.groups[this.slideshowGroup||"none"];return(a&&a[b+c])||null},getAnchorIndex:function(){var a=hs.getAnchors().groups[this.slideshowGroup||"none"];if(a){for(var b=0;b<a.length;b++){if(a[b]==this.a){return b}}}return null},cancelLoading:function(){hs.discardElement(this.wrapper);hs.expanders[this.key]=null;if(this.loading){hs.loading.style.left="-9999px"}},writeCredits:function(){this.credits=hs.createElement("a",{href:hs.creditsHref,target:hs.creditsTarget,className:"highslide-credits",innerHTML:hs.lang.creditsText,title:hs.lang.creditsTitle});this.createOverlay({overlayId:this.credits,position:this.creditsPosition||"top left"})},getInline:function(types,addOverlay){for(var i=0;i<types.length;i++){var type=types[i],s=null;if(!this[type+"Id"]&&this.thumbsUserSetId){this[type+"Id"]=type+"-for-"+this.thumbsUserSetId}if(this[type+"Id"]){this[type]=hs.getNode(this[type+"Id"])}if(!this[type]&&!this[type+"Text"]&&this[type+"Eval"]){try{s=eval(this[type+"Eval"])}catch(e){}}if(!this[type]&&this[type+"Text"]){s=this[type+"Text"]}if(!this[type]&&!s){this[type]=hs.getNode(this.a["_"+type+"Id"]);if(!this[type]){var next=this.a.nextSibling;while(next&&!hs.isHsAnchor(next)){if((new RegExp("highslide-"+type)).test(next.className||null)){if(!next.id){this.a["_"+type+"Id"]=next.id="hsId"+hs.idCounter++}this[type]=hs.getNode(next.id);break}next=next.nextSibling}}}if(!this[type]&&s){this[type]=hs.createElement("div",{className:"highslide-"+type,innerHTML:s})}if(addOverlay&&this[type]){var o={position:(type=="heading")?"above":"below"};for(var x in this[type+"Overlay"]){o[x]=this[type+"Overlay"][x]}o.overlayId=this[type];this.createOverlay(o)}}},doShowHide:function(a){if(hs.hideSelects){this.showHideElements("SELECT",a)}if(hs.hideIframes){this.showHideElements("IFRAME",a)}if(hs.geckoMac){this.showHideElements("*",a)}},showHideElements:function(c,b){var e=document.getElementsByTagName(c);var a=c=="*"?"overflow":"visibility";for(var f=0;f<e.length;f++){if(a=="visibility"||(document.defaultView.getComputedStyle(e[f],"").getPropertyValue("overflow")=="auto"||e[f].getAttribute("hidden-by")!=null)){var h=e[f].getAttribute("hidden-by");if(b=="visible"&&h){h=h.replace("["+this.key+"]","");e[f].setAttribute("hidden-by",h);if(!h){e[f].style[a]=e[f].origProp}}else{if(b=="hidden"){var k=hs.getPosition(e[f]);k.w=e[f].offsetWidth;k.h=e[f].offsetHeight;var j=(k.x+k.w<this.x.get("opos")||k.x>this.x.get("opos")+this.x.get("osize"));var g=(k.y+k.h<this.y.get("opos")||k.y>this.y.get("opos")+this.y.get("osize"));var d=hs.getWrapperKey(e[f]);if(!j&&!g&&d!=this.key){if(!h){e[f].setAttribute("hidden-by","["+this.key+"]");e[f].origProp=e[f].style[a];e[f].style[a]="hidden"}else{if(h.indexOf("["+this.key+"]")==-1){e[f].setAttribute("hidden-by",h+"["+this.key+"]")}}}else{if((h=="["+this.key+"]"||hs.focusKey==d)&&d!=this.key){e[f].setAttribute("hidden-by","");e[f].style[a]=e[f].origProp||""}else{if(h&&h.indexOf("["+this.key+"]")>-1){e[f].setAttribute("hidden-by",h.replace("["+this.key+"]",""))}}}}}}}},focus:function(){this.wrapper.style.zIndex=hs.zIndexCounter+=2;for(var a=0;a<hs.expanders.length;a++){if(hs.expanders[a]&&a==hs.focusKey){var b=hs.expanders[a];b.content.className+=" highslide-"+b.contentType+"-blur";b.content.style.cursor=hs.ieLt7?"hand":"pointer";b.content.title=hs.lang.focusTitle}}if(this.outline){this.outline.table.style.zIndex=this.wrapper.style.zIndex-1}this.content.className="highslide-"+this.contentType;this.content.title=hs.lang.restoreTitle;if(hs.restoreCursor){hs.styleRestoreCursor=window.opera?"pointer":"url("+hs.graphicsDir+hs.restoreCursor+"), pointer";if(hs.ieLt7&&hs.uaVersion<6){hs.styleRestoreCursor="hand"}this.content.style.cursor=hs.styleRestoreCursor}hs.focusKey=this.key;hs.addEventListener(document,window.opera?"keypress":"keydown",hs.keyHandler)},moveTo:function(a,b){this.x.setPos(a);this.y.setPos(b)},resize:function(d){var a,b,c=d.width/d.height;a=Math.max(d.width+d.dX,Math.min(this.minWidth,this.x.full));if(this.isImage&&Math.abs(a-this.x.full)<12){a=this.x.full}b=a/c;if(b<Math.min(this.minHeight,this.y.full)){b=Math.min(this.minHeight,this.y.full);if(this.isImage){a=b*c}}this.resizeTo(a,b)},resizeTo:function(a,b){this.y.setSize(b);this.x.setSize(a);this.wrapper.style.height=this.y.get("wsize")+"px"},close:function(){if(this.isClosing||!this.isExpanded){return}this.isClosing=true;hs.removeEventListener(document,window.opera?"keypress":"keydown",hs.keyHandler);try{this.content.style.cursor="default";this.changeSize(0,{wrapper:{width:this.x.t,height:this.y.t,left:this.x.tpos-this.x.cb+this.x.tb,top:this.y.tpos-this.y.cb+this.y.tb},content:{left:0,top:0,width:this.x.t,height:this.y.t}},hs.restoreDuration)}catch(a){this.afterClose()}},createOverlay:function(d){var c=d.overlayId;if(typeof c=="string"){c=hs.getNode(c)}if(d.html){c=hs.createElement("div",{innerHTML:d.html})}if(!c||typeof c=="string"){return}c.style.display="block";this.genOverlayBox();var b=d.width&&/^[0-9]+(px|%)$/.test(d.width)?d.width:"auto";if(/^(left|right)panel$/.test(d.position)&&!/^[0-9]+px$/.test(d.width)){b="200px"}var a=hs.createElement("div",{id:"hsId"+hs.idCounter++,hsId:d.hsId},{position:"absolute",visibility:"hidden",width:b,direction:hs.lang.cssDirection||"",opacity:0},this.overlayBox,true);a.appendChild(c);hs.extend(a,{opacity:1,offsetX:0,offsetY:0,dur:(d.fade===0||d.fade===false||(d.fade==2&&hs.ie))?0:250});hs.extend(a,d);if(this.gotOverlays){this.positionOverlay(a);if(!a.hideOnMouseOut||this.mouseIsOver){hs.animate(a,{opacity:a.opacity},a.dur)}}hs.push(this.overlays,hs.idCounter-1)},positionOverlay:function(c){var d=c.position||"middle center",b=c.offsetX,a=c.offsetY;if(c.parentNode!=this.overlayBox){this.overlayBox.appendChild(c)}if(/left$/.test(d)){c.style.left=b+"px"}if(/center$/.test(d)){hs.setStyles(c,{left:"50%",marginLeft:(b-Math.round(c.offsetWidth/2))+"px"})}if(/right$/.test(d)){c.style.right=-b+"px"}if(/^leftpanel$/.test(d)){hs.setStyles(c,{right:"100%",marginRight:this.x.cb+"px",top:-this.y.cb+"px",bottom:-this.y.cb+"px",overflow:"auto"});this.x.p1=c.offsetWidth}else{if(/^rightpanel$/.test(d)){hs.setStyles(c,{left:"100%",marginLeft:this.x.cb+"px",top:-this.y.cb+"px",bottom:-this.y.cb+"px",overflow:"auto"});this.x.p2=c.offsetWidth}}if(/^top/.test(d)){c.style.top=a+"px"}if(/^middle/.test(d)){hs.setStyles(c,{top:"50%",marginTop:(a-Math.round(c.offsetHeight/2))+"px"})}if(/^bottom/.test(d)){c.style.bottom=-a+"px"}if(/^above$/.test(d)){hs.setStyles(c,{left:(-this.x.p1-this.x.cb)+"px",right:(-this.x.p2-this.x.cb)+"px",bottom:"100%",marginBottom:this.y.cb+"px",width:"auto"});this.y.p1=c.offsetHeight}else{if(/^below$/.test(d)){hs.setStyles(c,{position:"relative",left:(-this.x.p1-this.x.cb)+"px",right:(-this.x.p2-this.x.cb)+"px",top:"100%",marginTop:this.y.cb+"px",width:"auto"});this.y.p2=c.offsetHeight;c.style.position="absolute"}}},getOverlays:function(){this.getInline(["heading","caption"],true);if(this.heading&&this.dragByHeading){this.heading.className+=" highslide-move"}if(hs.showCredits){this.writeCredits()}for(var a=0;a<hs.overlays.length;a++){var d=hs.overlays[a],e=d.thumbnailId,b=d.slideshowGroup;if((!e&&!b)||(e&&e==this.thumbsUserSetId)||(b&&b===this.slideshowGroup)){this.createOverlay(d)}}var c=[];for(var a=0;a<this.overlays.length;a++){var d=hs.$("hsId"+this.overlays[a]);if(/panel$/.test(d.position)){this.positionOverlay(d)}else{hs.push(c,d)}}for(var a=0;a<c.length;a++){this.positionOverlay(c[a])}this.gotOverlays=true},genOverlayBox:function(){if(!this.overlayBox){this.overlayBox=hs.createElement("div",{className:this.wrapperClassName},{position:"absolute",width:(this.x.size||(this.useBox?this.width:null)||this.x.full)+"px",height:(this.y.size||this.y.full)+"px",visibility:"hidden",overflow:"hidden",zIndex:hs.ie?4:"auto"},hs.container,true)}},sizeOverlayBox:function(f,d){var c=this.overlayBox,a=this.x,h=this.y;hs.setStyles(c,{width:a.size+"px",height:h.size+"px"});if(f||d){for(var e=0;e<this.overlays.length;e++){var g=hs.$("hsId"+this.overlays[e]);var b=(hs.ieLt7||document.compatMode=="BackCompat");if(g&&/^(above|below)$/.test(g.position)){if(b){g.style.width=(c.offsetWidth+2*a.cb+a.p1+a.p2)+"px"}h[g.position=="above"?"p1":"p2"]=g.offsetHeight}if(g&&b&&/^(left|right)panel$/.test(g.position)){g.style.height=(c.offsetHeight+2*h.cb)+"px"}}}if(f){hs.setStyles(this.content,{top:h.p1+"px"});hs.setStyles(c,{top:(h.p1+h.cb)+"px"})}},showOverlays:function(){var a=this.overlayBox;a.className="";hs.setStyles(a,{top:(this.y.p1+this.y.cb)+"px",left:(this.x.p1+this.x.cb)+"px",overflow:"visible"});if(hs.safari){a.style.visibility="visible"}this.wrapper.appendChild(a);for(var c=0;c<this.overlays.length;c++){var d=hs.$("hsId"+this.overlays[c]);d.style.zIndex=d.zIndex||4;if(!d.hideOnMouseOut||this.mouseIsOver){d.style.visibility="visible";hs.setStyles(d,{visibility:"visible",display:""});hs.animate(d,{opacity:d.opacity},d.dur)}}},destroyOverlays:function(){if(!this.overlays.length){return}hs.discardElement(this.overlayBox)},createFullExpand:function(){this.fullExpandLabel=hs.createElement("a",{href:"javascript:hs.expanders["+this.key+"].doFullExpand();",title:hs.lang.fullExpandTitle,className:"highslide-full-expand"});this.createOverlay({overlayId:this.fullExpandLabel,position:hs.fullExpandPosition,hideOnMouseOut:true,opacity:hs.fullExpandOpacity})},doFullExpand:function(){try{if(this.fullExpandLabel){hs.discardElement(this.fullExpandLabel)}this.focus();var c=this.x.size,a=this.y.size;this.resizeTo(this.x.full,this.y.full);var b=this.x.pos-(this.x.size-c)/2;if(b<hs.marginLeft){b=hs.marginLeft}var f=this.y.pos-(this.y.size-a)/2;if(f<hs.marginTop){f=hs.marginTop}this.moveTo(b,f);this.doShowHide("hidden")}catch(d){this.error(d)}},afterClose:function(){this.a.className=this.a.className.replace("highslide-active-anchor","");this.doShowHide("visible");if(this.outline&&this.outlineWhileAnimating){this.outline.destroy()}hs.discardElement(this.wrapper);hs.expanders[this.key]=null;hs.reOrder()}};hs.langDefaults=hs.lang;var HsExpander=hs.Expander;if(hs.ie&&window==window.top){(function(){try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,50);return}hs.ready()})()}hs.addEventListener(document,"DOMContentLoaded",hs.ready);hs.addEventListener(window,"load",hs.ready);hs.addEventListener(document,"ready",function(){if(hs.expandCursor){var d=hs.createElement("style",{type:"text/css"},null,document.getElementsByTagName("HEAD")[0]),c=document.compatMode=="BackCompat";function b(f,g){if(hs.ie&&(hs.uaVersion<9||c)){var e=document.styleSheets[document.styleSheets.length-1];if(typeof(e.addRule)=="object"){e.addRule(f,g)}}else{d.appendChild(document.createTextNode(f+" {"+g+"}"))}}function a(e){return"expression( ( ( ignoreMe = document.documentElement."+e+" ? document.documentElement."+e+" : document.body."+e+" ) ) + 'px' );"}if(hs.expandCursor){b(".highslide img","cursor: url("+hs.graphicsDir+hs.expandCursor+"), pointer !important;")}}});hs.addEventListener(window,"resize",function(){hs.getPageSize()});hs.addEventListener(document,"mousemove",function(a){hs.mouse={x:a.clientX,y:a.clientY}});hs.addEventListener(document,"mousedown",hs.mouseClickHandler);hs.addEventListener(document,"mouseup",hs.mouseClickHandler);hs.addEventListener(document,"ready",hs.getAnchors);hs.addEventListener(window,"load",hs.preloadImages)};
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide.packed.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide.packed.js
new file mode 100644
index 0000000000000000000000000000000000000000..42837a211fa0e3a7a221d102a4029922ee9741b0
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/highslide.packed.js
@@ -0,0 +1,9 @@
+/** 
+ * Name:    Highslide JS
+ * Version: 4.1.13 (2011-10-06)
+ * Config:  default +packed
+ * Author:  Torstein Hønsi
+ * Support: www.highslide.com/support
+ * License: www.highslide.com/#license
+ */
+eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('q(!m){u m={1F:{8l:\'6P\',6K:\'93...\',6L:\'6b 1L 92\',7T:\'6b 1L 91 1L 8Z\',88:\'90 1L 94 I (f)\',8e:\'95 2t <i>6I 6F</i>\',8b:\'9a 1L 98 6I 6F 97\',5V:\'6b 1L 2h 1Y, 96 6O 8Y 1L 3c. 8X 8Q 8P S 1A 6O 79.\'},47:\'1c/8O/\',4l:\'8M.6A\',3S:\'8N.6A\',84:5c,7y:5c,43:15,7J:15,48:15,7N:15,3L:8R,7g:0.75,8j:G,5U:5,2R:2,8S:3,3V:1a,7z:\'2S 2o\',7O:1,7W:G,8x:\'8W://1c.8V/\',8o:\'8U\',7e:G,5t:[\'a\'],68:G,3Y:6W,3K:6W,3N:G,1h:\'9b-9c\',3U:[],5j:G,N:[],5i:[\'3N\',\'2d\',\'1h\',\'2R\',\'9u\',\'9t\',\'9s\',\'6R\',\'9q\',\'9r\',\'9v\',\'6X\',\'89\',\'68\',\'M\',\'16\',\'60\',\'3Y\',\'3K\',\'4X\',\'5q\',\'8h\',\'3b\',\'1J\',\'85\',\'86\',\'1l\'],1v:[],3F:0,9w:{x:[\'8n\',\'18\',\'6c\',\'2o\',\'7x\'],y:[\'42\',\'W\',\'6a\',\'2S\',\'4r\']},4B:{},6X:{},6R:{},2A:[],2Q:{},6m:{},4a:[],1R:/9A\\/4\\.0/.14(3W.4V)?8:6g((3W.4V.58().2X(/.+(?:6V|9z|9y|1P)[\\/: ]([\\d.]+)/)||[0,\'0\'])[1]),1P:(L.3R&&!1n.2r),4D:/9x/.14(3W.4V),8y:/9p.+6V:1\\.[0-8].+9o/.14(3W.4V),$:A(1t){q(1t)C L.9h(1t)},2e:A(2c,2v){2c[2c.X]=2v},Z:A(6S,3a,2F,6f,6U){u B=L.Z(6S);q(3a)m.2q(B,3a);q(6U)m.T(B,{9f:0,9d:\'3r\',5h:0});q(2F)m.T(B,2F);q(6f)6f.2g(B);C B},2q:A(B,3a){S(u x 3v 3a)B[x]=3a[x];C B},T:A(B,2F){S(u x 3v 2F){q(m.2Y&&x==\'1o\'){q(2F[x]>0.99)B.F.9e(\'3P\');K B.F.3P=\'7k(1o=\'+(2F[x]*1V)+\')\'}K B.F[x]=2F[x]}},3p:A(B,Q,25){u 2O,3h,2M;q(1m 25!=\'5I\'||25===H){u 2y=87;25={2Z:2y[2],1J:2y[3],5y:2y[4]}}q(1m 25.2Z!=\'3g\')25.2Z=5c;25.1J=1d[25.1J]||1d.6Z;25.4c=m.2q({},Q);S(u 2b 3v Q){u e=1S m.1k(B,25,2b);2O=6g(m.5s(B,2b))||0;3h=6g(Q[2b]);2M=2b!=\'1o\'?\'D\':\'\';e.2z(2O,3h,2M)}},5s:A(B,Q){q(B.F[Q]){C B.F[Q]}K q(L.63){C L.63.8B(B,H).8s(Q)}K{q(Q==\'1o\')Q=\'3P\';u 2v=B.8L[Q.31(/\\-(\\w)/g,A(a,b){C b.9j()})];q(Q==\'3P\')2v=2v.31(/7k\\(1o=([0-9]+)\\)/,A(a,b){C b/1V});C 2v===\'\'?1:2v}},4N:A(){u d=L,w=1n,3D=d.5a&&d.5a!=\'5K\'?d.3i:d.4J,2Y=m.1P&&(m.1R<9||1m 71==\'1Z\');u M=2Y?3D.7j:(d.3i.7j||4H.9n),16=2Y?3D.9m:4H.9l;m.2J={M:M,16:16,4w:2Y?3D.4w:71,4y:2Y?3D.4y:9k};C m.2J},62:A(B){u p={x:B.7n,y:B.7s};3m(B.7m){B=B.7m;p.x+=B.7n;p.y+=B.7s;q(B!=L.4J&&B!=L.3i){p.x-=B.4w;p.y-=B.4y}}C p},4b:A(a,21,2z,J){q(!a)a=m.Z(\'a\',H,{3q:\'3r\'},m.20);q(1m a.3E==\'A\')C 21;1z{1S m.46(a,21,2z);C 1a}1C(e){C G}},7a:A(){u 5X=0,54=-1,N=m.N,z,1p;S(u i=0;i<N.X;i++){z=N[i];q(z){1p=z.V.F.1p;q(1p&&1p>5X){5X=1p;54=i}}}q(54==-1)m.2u=-1;K N[54].3k()},5r:A(a,3J){a.3E=a.3x;u p=a.3E?a.3E():H;a.3E=H;C(p&&1m p[3J]!=\'1Z\')?p[3J]:(1m m[3J]!=\'1Z\'?m[3J]:H)},5l:A(a){u 1l=m.5r(a,\'1l\');q(1l)C 1l;C a.3y},3B:A(1t){u 4s=m.$(1t),2U=m.6m[1t],a={};q(!4s&&!2U)C H;q(!2U){2U=4s.7f(G);2U.1t=\'\';m.6m[1t]=2U;C 4s}K{C 2U.7f(G)}},3t:A(d){q(d)m.5k.2g(d);m.5k.3G=\'\'},74:A(66,z){u 2G=z||m.2C();z=2G;q(m.2W)C 1a;K m.2G=2G;m.3d(L,1n.2r?\'4R\':\'4T\',m.3H);1z{m.2W=66;66.3x()}1C(e){m.2G=m.2W=H}1z{z.2h()}1C(e){}C 1a},4e:A(B,1W){u z=m.2C(B);q(z)C m.74(z.5m(1W),z);K C 1a},79:A(B){C m.4e(B,-1)},1A:A(B){C m.4e(B,1)},3H:A(e){q(!e)e=1n.1G;q(!e.1M)e.1M=e.6x;q(1m e.1M.7c!=\'1Z\')C G;u z=m.2C();u 1W=H;7u(e.8F){1q 70:q(z)z.5M();C G;1q 32:1q 34:1q 39:1q 40:1W=1;6r;1q 8:1q 33:1q 37:1q 38:1W=-1;6r;1q 27:1q 13:1W=0}q(1W!==H){m.3d(L,1n.2r?\'4R\':\'4T\',m.3H);q(!m.7e)C G;q(e.4F)e.4F();K e.8E=1a;q(z){q(1W==0){z.2h()}K{m.4e(z.R,1W)}C 1a}}C G},8G:A(O){m.2e(m.1v,m.2q(O,{2a:\'2a\'+m.3F++}))},65:A(6l,4u){u B,30=/^1c-V-([0-9]+)$/;B=6l;3m(B.2V){q(B.1t&&30.14(B.1t))C B.1t.31(30,"$1");B=B.2V}q(!4u){B=6l;3m(B.2V){q(B.4g&&m.4E(B)){S(u R=0;R<m.N.X;R++){u z=m.N[R];q(z&&z.a==B)C R}}B=B.2V}}C H},2C:A(B,4u){q(1m B==\'1Z\')C m.N[m.2u]||H;q(1m B==\'3g\')C m.N[B]||H;q(1m B==\'69\')B=m.$(B);C m.N[m.65(B,4u)]||H},4E:A(a){C(a.3x&&a.3x.7F().31(/\\s/g,\' \').2X(/m.(8J|e)8D/))},7Y:A(){S(u i=0;i<m.N.X;i++)q(m.N[i]&&m.N[i].3C)m.7a()},6i:A(e){q(!e)e=1n.1G;q(e.8I>1)C G;q(!e.1M)e.1M=e.6x;u B=e.1M;3m(B.2V&&!(/1c-(1Y|3c|4Z|2T)/.14(B.1g))){B=B.2V}u z=m.2C(B);q(z&&(z.6k||!z.3C))C G;q(z&&e.J==\'7o\'){q(e.1M.7c)C G;u 2X=B.1g.2X(/1c-(1Y|3c|2T)/);q(2X){m.1U={z:z,J:2X[1],18:z.x.E,M:z.x.I,W:z.y.E,16:z.y.I,72:e.4z,76:e.4o};m.1D(L,\'6w\',m.6D);q(e.4F)e.4F();q(/1c-(1Y|4Z)-5W/.14(z.11.1g)){z.3k();m.6B=G}C 1a}}K q(e.J==\'7i\'){m.3d(L,\'6w\',m.6D);q(m.1U){q(m.3e&&m.1U.J==\'1Y\')m.1U.z.11.F.2N=m.3e;u 2E=m.1U.2E;q(!2E&&!m.6B&&!/(3c|2T)/.14(m.1U.J)){z.2h()}K q(2E||(!2E&&m.8C)){m.1U.z.45(\'1i\')}m.6B=1a;m.1U=H}K q(/1c-1Y-5W/.14(B.1g)){B.F.2N=m.3e}}C 1a},6D:A(e){q(!m.1U)C G;q(!e)e=1n.1G;u a=m.1U,z=a.z;a.5b=e.4z-a.72;a.6o=e.4o-a.76;u 6n=1d.a7(1d.7q(a.5b,2)+1d.7q(a.6o,2));q(!a.2E)a.2E=(a.J!=\'1Y\'&&6n>0)||(6n>(m.al||5));q(a.2E&&e.4z>5&&e.4o>5){q(a.J==\'2T\')z.2T(a);K{z.5v(a.18+a.5b,a.W+a.6o);q(a.J==\'1Y\')z.11.F.2N=\'3c\'}}C 1a},8g:A(e){1z{q(!e)e=1n.1G;u 4C=/ao/i.14(e.J);q(!e.1M)e.1M=e.6x;q(!e.4v)e.4v=4C?e.an:e.9C;u z=m.2C(e.1M);q(!z.3C)C;q(!z||!e.4v||m.2C(e.4v,G)==z||m.1U)C;S(u i=0;i<z.1v.X;i++)(A(){u o=m.$(\'2a\'+z.1v[i]);q(o&&o.4K){q(4C)m.T(o,{1b:\'1X\',3q:\'\'});m.3p(o,{1o:4C?o.1o:0},o.2p)}})()}1C(e){}},1D:A(B,1G,2i){q(B==L&&1G==\'2H\'){m.2e(m.4a,2i)}1z{B.1D(1G,2i,1a)}1C(e){1z{B.7l(\'3Z\'+1G,2i);B.ac(\'3Z\'+1G,2i)}1C(e){B[\'3Z\'+1G]=2i}}},3d:A(B,1G,2i){1z{B.3d(1G,2i,1a)}1C(e){1z{B.7l(\'3Z\'+1G,2i)}1C(e){B[\'3Z\'+1G]=H}}},4A:A(i){q(m.5j&&m.3U[i]&&m.3U[i]!=\'1Z\'){u 1f=L.Z(\'1f\');1f.4S=A(){1f=H;m.4A(i+1)};1f.1l=m.3U[i]}},7E:A(3g){q(3g&&1m 3g!=\'5I\')m.5U=3g;u 2c=m.51();S(u i=0;i<2c.36.X&&i<m.5U;i++){m.2e(m.3U,m.5l(2c.36[i]))}q(m.1h)1S m.41(m.1h,A(){m.4A(0)});K m.4A(0);q(m.3S)u 6A=m.Z(\'1f\',{1l:m.47+m.3S})},6y:A(){q(!m.20){m.3j=m.1P&&m.1R<7;m.2Y=m.1P&&m.1R<9;m.4N();S(u x 3v m.4O){q(1m m[x]!=\'1Z\')m.1F[x]=m[x];K q(1m m.1F[x]==\'1Z\'&&1m m.4O[x]!=\'1Z\')m.1F[x]=m.4O[x]}m.20=m.Z(\'1O\',{1g:\'1c-20\'},{1e:\'29\',18:0,W:0,M:\'1V%\',1p:m.3L,8a:\'6P\'},L.4J,G);m.1E=m.Z(\'a\',{1g:\'1c-1E\',3w:m.1F.6L,3G:m.1F.6K,3y:\'8u:;\'},{1e:\'29\',W:\'-3X\',1o:m.7g,1p:1},m.20);m.5k=m.Z(\'1O\',H,{3q:\'3r\'},m.20);1d.at=A(t,b,c,d){C c*t/d+b};1d.6Z=A(t,b,c,d){C c*(t/=d)*t+b};m.8A=m.3j;m.8f=((1n.2r&&m.1R<9)||3W.aw==\'ay\'||(m.3j&&m.1R<5.5))}},2H:A(){q(m.5n)C;m.5n=G;S(u i=0;i<m.4a.X;i++)m.4a[i]()},7p:A(){u B,17,3R=[],36=[],2s={},30;S(u i=0;i<m.5t.X;i++){17=L.4U(m.5t[i]);S(u j=0;j<17.X;j++){B=17[j];30=m.4E(B);q(30){m.2e(3R,B);q(30[0]==\'m.4b\')m.2e(36,B);u g=m.5r(B,\'3b\')||\'3r\';q(!2s[g])2s[g]=[];m.2e(2s[g],B)}}}m.4p={3R:3R,2s:2s,36:36};C m.4p},51:A(){C m.4p||m.7p()},2h:A(B){u z=m.2C(B);q(z)z.2h();C 1a}};m.1k=A(1Q,1w,Q){k.1w=1w;k.1Q=1Q;k.Q=Q;q(!1w.7h)1w.7h={}};m.1k.53={5C:A(){(m.1k.2x[k.Q]||m.1k.2x.7r)(k);q(k.1w.2x)k.1w.2x.77(k.1Q,k.2I,k)},2z:A(7b,1L,2M){k.5x=(1S 78()).73();k.2O=7b;k.3h=1L;k.2M=2M;k.2I=k.2O;k.E=k.5E=0;u 4H=k;A t(4d){C 4H.2x(4d)}t.1Q=k.1Q;q(t()&&m.2A.2e(t)==1){m.7d=9M(A(){u 2A=m.2A;S(u i=0;i<2A.X;i++)q(!2A[i]())2A.9P(i--,1);q(!2A.X){9Q(m.7d)}},13)}},2x:A(4d){u t=(1S 78()).73();q(4d||t>=k.1w.2Z+k.5x){k.2I=k.3h;k.E=k.5E=1;k.5C();k.1w.4c[k.Q]=G;u 5z=G;S(u i 3v k.1w.4c)q(k.1w.4c[i]!==G)5z=1a;q(5z){q(k.1w.5y)k.1w.5y.77(k.1Q)}C 1a}K{u n=t-k.5x;k.5E=n/k.1w.2Z;k.E=k.1w.1J(n,0,1,k.1w.2Z);k.2I=k.2O+((k.3h-k.2O)*k.E);k.5C()}C G}};m.2q(m.1k,{2x:{1o:A(1k){m.T(1k.1Q,{1o:1k.2I})},7r:A(1k){1z{q(1k.1Q.F&&1k.1Q.F[1k.Q]!=H)1k.1Q.F[1k.Q]=1k.2I+1k.2M;K 1k.1Q[1k.Q]=1k.2I}1C(e){}}}});m.41=A(1h,2P){k.2P=2P;k.1h=1h;u v=m.1R,4Y;k.5J=m.1P&&m.1R<7;q(!1h){q(2P)2P();C}m.6y();k.28=m.Z(\'28\',{9V:0},{1b:\'1i\',1e:\'29\',9X:\'9Y\',M:0},m.20,G);u 5R=m.Z(\'5R\',H,H,k.28,1);k.1H=[];S(u i=0;i<=8;i++){q(i%3==0)4Y=m.Z(\'4Y\',H,{16:\'2l\'},5R,G);k.1H[i]=m.Z(\'1H\',H,H,4Y,G);u F=i!=4?{9Z:0,aF:0}:{1e:\'6j\'};m.T(k.1H[i],F)}k.1H[4].1g=1h+\' 1c-19\';k.7t()};m.41.53={7t:A(){u 1l=m.47+(m.9K||"9O/")+k.1h+".9N";u 6T=m.4D&&m.1R<7v?m.20:H;k.2k=m.Z(\'1f\',H,{1e:\'29\',W:\'-3X\'},6T,G);u 6E=k;k.2k.4S=A(){6E.6N()};k.2k.1l=1l},6N:A(){u o=k.1j=k.2k.M/4,E=[[0,0],[0,-4],[-2,0],[0,-8],0,[-2,-8],[0,-2],[0,-6],[-2,-2]],1x={16:(2*o)+\'D\',M:(2*o)+\'D\'};S(u i=0;i<=8;i++){q(E[i]){q(k.5J){u w=(i==1||i==7)?\'1V%\':k.2k.M+\'D\';u 1O=m.Z(\'1O\',H,{M:\'1V%\',16:\'1V%\',1e:\'6j\',2L:\'1i\'},k.1H[i],G);m.Z(\'1O\',H,{3P:"a0:9U.9W.a1(a8=9I, 1l=\'"+k.2k.1l+"\')",1e:\'29\',M:w,16:k.2k.16+\'D\',18:(E[i][0]*o)+\'D\',W:(E[i][1]*o)+\'D\'},1O,G)}K{m.T(k.1H[i],{9J:\'5T(\'+k.2k.1l+\') \'+(E[i][0]*o)+\'D \'+(E[i][1]*o)+\'D\'})}q(1n.2r&&(i==3||i==5))m.Z(\'1O\',H,1x,k.1H[i],G);m.T(k.1H[i],1x)}}k.2k=H;q(m.2Q[k.1h])m.2Q[k.1h].4q();m.2Q[k.1h]=k;q(k.2P)k.2P()},3A:A(E,1j,6H,2p,1J){u z=k.z,9E=z.V.F,1j=1j||0,E=E||{x:z.x.E+1j,y:z.y.E+1j,w:z.x.P(\'1u\')-2*1j,h:z.y.P(\'1u\')-2*1j};q(6H)k.28.F.1b=(E.h>=4*k.1j)?\'1X\':\'1i\';m.T(k.28,{18:(E.x-k.1j)+\'D\',W:(E.y-k.1j)+\'D\',M:(E.w+2*k.1j)+\'D\'});E.w-=2*k.1j;E.h-=2*k.1j;m.T(k.1H[4],{M:E.w>=0?E.w+\'D\':0,16:E.h>=0?E.h+\'D\':0});q(k.5J)k.1H[3].F.16=k.1H[5].F.16=k.1H[4].F.16},4q:A(6Y){q(6Y)k.28.F.1b=\'1i\';K m.3t(k.28)}};m.4W=A(z,1x){k.z=z;k.1x=1x;k.2D=1x==\'x\'?\'ax\':\'av\';k.2w=k.2D.58();k.3O=1x==\'x\'?\'ar\':\'au\';k.5o=k.3O.58();k.5f=1x==\'x\'?\'az\':\'aA\';k.aG=k.5f.58();k.1B=k.2f=0};m.4W.53={P:A(R){7u(R){1q\'5O\':C k.1s+k.2j+(k.t-m.1E[\'1j\'+k.2D])/2;1q\'1u\':C k.I+2*k.Y+k.1B+k.2f;1q\'3o\':C k.55-k.2K-k.4I;1q\'5G\':C k.P(\'3o\')-2*k.Y-k.1B-k.2f;1q\'3Q\':C k.E-(k.z.19?k.z.19.1j:0);1q\'64\':C k.P(\'1u\')+(k.z.19?2*k.z.19.1j:0);1q\'4h\':C k.1y?1d.56((k.I-k.1y)/2):0}},5w:A(){k.Y=(k.z.11[\'1j\'+k.2D]-k.t)/2;k.4I=m[\'5h\'+k.5f]},5g:A(){k.t=k.z.B[k.2w]?aC(k.z.B[k.2w]):k.z.B[\'1j\'+k.2D];k.1s=k.z.1s[k.1x];k.2j=(k.z.B[\'1j\'+k.2D]-k.t)/2;q(k.1s==0||k.1s==-1){k.1s=(m.2J[k.2w]/2)+m.2J[\'2B\'+k.3O]}},5B:A(){u z=k.z;k.3n=\'2l\';k.E=k.1s-k.Y+k.2j;q(k.5q&&k.1x==\'x\')z.4X=1d.22(z.4X||k.U,z.5q*k.U/z.y.U);k.I=1d.22(k.U,z[\'67\'+k.2D]||k.U);k.1T=z.3N?1d.22(z[\'22\'+k.2D],k.U):k.U;q(z.3f&&z.2d){k.I=z[k.2w];k.1y=k.U}q(k.1x==\'x\'&&m.3V)k.1T=z.3Y;k.2K=m[\'5h\'+k.3O];k.2B=m.2J[\'2B\'+k.3O];k.55=m.2J[k.2w]},6h:A(i){u z=k.z;q(z.3f&&(z.2d||m.3V)){k.1y=i;k.I=1d.67(k.I,k.1y);z.11.F[k.5o]=k.P(\'4h\')+\'D\'}K k.I=i;z.11.F[k.2w]=i+\'D\';z.V.F[k.2w]=k.P(\'1u\')+\'D\';q(z.19)z.19.3A();q(k.1x==\'x\'&&z.1r)z.35(G)},5Z:A(i){k.E=i;k.z.V.F[k.5o]=i+\'D\';q(k.z.19)k.z.19.3A()}};m.46=A(a,21,2z,26){q(L.ab&&m.1P&&!m.5n){m.1D(L,\'2H\',A(){1S m.46(a,21,2z,26)});C}k.a=a;k.2z=2z;k.26=26||\'1Y\';k.3f=!k.ak;m.5j=1a;k.1v=[];m.6y();u R=k.R=m.N.X;S(u i=0;i<m.5i.X;i++){u 2b=m.5i[i];k[2b]=21&&1m 21[2b]!=\'1Z\'?21[2b]:m[2b]}q(!k.1l)k.1l=a.3y;u B=(21&&21.5Y)?m.$(21.5Y):a;B=k.8k=B.4U(\'1f\')[0]||B;k.4Q=B.1t||a.1t;S(u i=0;i<m.N.X;i++){q(m.N[i]&&m.N[i].a==a){m.N[i].3k();C 1a}}q(!m.ad)S(u i=0;i<m.N.X;i++){q(m.N[i]&&m.N[i].8k!=B&&!m.N[i].52){m.N[i].6t()}}m.N[R]=k;q(!m.8j&&!m.2W){q(m.N[R-1])m.N[R-1].2h();q(1m m.2u!=\'1Z\'&&m.N[m.2u])m.N[m.2u].2h()}k.B=B;k.1s=k.8h||m.62(B);m.4N();u x=k.x=1S m.4W(k,\'x\');x.5g();u y=k.y=1S m.4W(k,\'y\');y.5g();k.V=m.Z(\'1O\',{1t:\'1c-V-\'+k.R,1g:\'1c-V \'+k.60},{1b:\'1i\',1e:\'29\',1p:m.3L+=2},H,G);k.V.aB=k.V.aD=m.8g;q(k.26==\'1Y\'&&k.2R==2)k.2R=0;q(!k.1h){k[k.26+\'5e\']()}K q(m.2Q[k.1h]){k.5N();k[k.26+\'5e\']()}K{k.5H();u z=k;1S m.41(k.1h,A(){z.5N();z[z.26+\'5e\']()})}C G};m.46.53={5Q:A(e){q(m.aE)aa(\'a9 \'+e.9L+\': \'+e.9F);K 1n.9H.3y=k.1l},5N:A(){u 19=k.19=m.2Q[k.1h];19.z=k;19.28.F.1p=k.V.F.1p-1;m.2Q[k.1h]=H},5H:A(){q(k.52||k.1E)C;k.1E=m.1E;u z=k;k.1E.3x=A(){z.6t()};u z=k,l=k.x.P(\'5O\')+\'D\',t=k.y.P(\'5O\')+\'D\';5S(A(){q(z.1E)m.T(z.1E,{18:l,W:t,1p:m.3L++})},1V)},af:A(){u z=k;u 1f=L.Z(\'1f\');k.11=1f;1f.4S=A(){q(m.N[z.R])z.81()};q(m.aq)1f.9D=A(){C 1a};1f.1g=\'1c-1Y\';m.T(1f,{1b:\'1i\',3q:\'7I\',1e:\'29\',4X:\'3X\',1p:3});1f.3w=m.1F.5V;q(m.4D&&m.1R<7v)m.20.2g(1f);q(m.1P&&m.a2)1f.1l=H;1f.1l=k.1l;k.5H()},81:A(){1z{q(!k.11)C;k.11.4S=H;q(k.52)C;K k.52=G;u x=k.x,y=k.y;q(k.1E){m.T(k.1E,{W:\'-3X\'});k.1E=H}x.U=k.11.M;y.U=k.11.16;m.T(k.11,{M:x.t+\'D\',16:y.t+\'D\'});k.V.2g(k.11);m.20.2g(k.V);x.5w();y.5w();m.T(k.V,{18:(x.1s+x.2j-x.Y)+\'D\',W:(y.1s+x.2j-y.Y)+\'D\'});k.80();u 1K=x.U/y.U;x.5B();k.3n(x);y.5B();k.3n(y);q(k.1r)k.35(0,1);q(k.3N){k.7R(1K);q(k.3f&&k.x.U>(k.x.1y||k.x.I)){k.8p();q(k.1v.X==1)k.35()}}k.7U()}1C(e){k.5Q(e)}},3n:A(p,3l){u a5,a3=p.1M,1x=p==k.x?\'x\':\'y\';u 5D=1a;u 3s=p.z.3N;p.E=1d.56(p.E-((p.P(\'1u\')-p.t)/2));q(p.E<p.2B+p.2K){p.E=p.2B+p.2K;5D=G}q(!3l&&p.I<p.1T){p.I=p.1T;3s=1a}q(p.E+p.P(\'1u\')>p.2B+p.55-p.4I){q(!3l&&5D&&3s){p.I=1d.22(p.I,p.P(1x==\'y\'?\'3o\':\'5G\'))}K q(p.P(\'1u\')<p.P(\'3o\')){p.E=p.2B+p.55-p.4I-p.P(\'1u\')}K{p.E=p.2B+p.2K;q(!3l&&3s)p.I=p.P(1x==\'y\'?\'3o\':\'5G\')}}q(!3l&&p.I<p.1T){p.I=p.1T;3s=1a}q(p.E<p.2K){u 7X=p.E;p.E=p.2K;q(3s&&!3l)p.I=p.I-(p.E-7X)}},7R:A(1K){u x=k.x,y=k.y,2m=1a,1N=1d.22(x.U,x.I),24=1d.22(y.U,y.I),2d=(k.2d||m.3V);q(1N/24>1K){ 1N=24*1K;q(1N<x.1T){1N=x.1T;24=1N/1K}2m=G}K q(1N/24<1K){ 24=1N/1K;2m=G}q(m.3V&&x.U<x.1T){x.1y=x.U;y.I=y.1y=y.U}K q(k.2d){x.1y=1N;y.1y=24}K{x.I=1N;y.I=24}2m=k.7S(k.2d?H:1K,2m);q(2d&&y.I<y.1y){y.1y=y.I;x.1y=y.I*1K}q(2m||2d){x.E=x.1s-x.Y+x.2j;x.1T=x.I;k.3n(x,G);y.E=y.1s-y.Y+y.2j;y.1T=y.I;k.3n(y,G);q(k.1r)k.35()}},7S:A(1K,2m){u x=k.x,y=k.y;q(k.1r){3m(y.I>k.3K&&x.I>k.3Y&&y.P(\'1u\')>y.P(\'3o\')){y.I-=10;q(1K)x.I=y.I*1K;k.35(0,1);2m=G}}C 2m},7U:A(){u x=k.x,y=k.y;k.45(\'1i\');k.6e(1,{V:{M:x.P(\'1u\'),16:y.P(\'1u\'),18:x.E,W:y.E},11:{18:x.1B+x.P(\'4h\'),W:y.1B+y.P(\'4h\'),M:x.1y||x.I,16:y.1y||y.I}},m.84)},6e:A(23,1L,2p){q(k.19&&!k.2R){q(23)k.19.3A();K k.19.4q()}q(!23)k.8v();u z=k,x=z.x,y=z.y,1J=k.1J;q(!23)1J=k.85||1J;u 7A=23?A(){q(z.19)z.19.28.F.1b="1X";5S(A(){z.7B()},50)}:A(){z.5P()};q(23)m.T(k.V,{M:x.t+\'D\',16:y.t+\'D\'});q(k.86){m.T(k.V,{1o:23?0:1});m.2q(1L.V,{1o:23})}m.3p(k.V,1L.V,{2Z:2p,1J:1J,2x:A(2v,2y){q(z.19&&z.2R&&2y.Q==\'W\'){u 3I=23?2y.E:1-2y.E;u E={w:x.t+(x.P(\'1u\')-x.t)*3I,h:y.t+(y.P(\'1u\')-y.t)*3I,x:x.1s+(x.E-x.1s)*3I,y:y.1s+(y.E-y.1s)*3I};z.19.3A(E,0,1)}}});m.3p(k.11,1L.11,2p,1J,7A);q(23){k.V.F.1b=\'1X\';k.11.F.1b=\'1X\';k.a.1g+=\' 1c-7P-7Q\'}},7B:A(){k.3C=G;k.3k();q(m.2W&&m.2W==k.a)m.2W=H;k.7w();u p=m.2J,5u=m.4B.x+p.4w,5p=m.4B.y+p.4y;k.6q=k.x.E<5u&&5u<k.x.E+k.x.P(\'1u\')&&k.y.E<5p&&5p<k.y.E+k.y.P(\'1u\');q(k.1r)k.8d()},7w:A(){u R=k.R;u 1h=k.1h;1S m.41(1h,A(){1z{m.N[R].7K()}1C(e){}})},7K:A(){u 1A=k.5m(1);q(1A&&1A.3x.7F().2X(/m\\.4b/))u 1f=m.Z(\'1f\',{1l:m.5l(1A)})},5m:A(1W){u 8r=k.8q(),as=m.4p.2s[k.3b||\'3r\'];C(as&&as[8r+1W])||H},8q:A(){u 2c=m.51().2s[k.3b||\'3r\'];q(2c)S(u i=0;i<2c.X;i++){q(2c[i]==k.a)C i}C H},6t:A(){m.3t(k.V);m.N[k.R]=H;q(k.1E)m.1E.F.18=\'-3X\'},8c:A(){k.6v=m.Z(\'a\',{3y:m.8x,1M:m.8o,1g:\'1c-6v\',3G:m.1F.8e,3w:m.1F.8b});k.49({4x:k.6v,1e:k.89||\'W 18\'})},7Z:A(6u,8w){S(u i=0;i<6u.X;i++){u J=6u[i],s=H;q(!k[J+\'3z\']&&k.4Q)k[J+\'3z\']=J+\'-S-\'+k.4Q;q(k[J+\'3z\'])k[J]=m.3B(k[J+\'3z\']);q(!k[J]&&!k[J+\'6s\']&&k[J+\'8i\'])1z{s=ah(k[J+\'8i\'])}1C(e){}q(!k[J]&&k[J+\'6s\']){s=k[J+\'6s\']}q(!k[J]&&!s){k[J]=m.3B(k.a[\'8t\'+J+\'3z\']);q(!k[J]){u 1A=k.a.83;3m(1A&&!m.4E(1A)){q((1S aj(\'1c-\'+J)).14(1A.1g||H)){q(!1A.1t)k.a[\'8t\'+J+\'3z\']=1A.1t=\'2a\'+m.3F++;k[J]=m.3B(1A.1t);6r}1A=1A.83}}}q(!k[J]&&s)k[J]=m.Z(\'1O\',{1g:\'1c-\'+J,3G:s});q(8w&&k[J]){u o={1e:(J==\'4P\')?\'42\':\'4r\'};S(u x 3v k[J+\'8z\'])o[x]=k[J+\'8z\'][x];o.4x=k[J];k.49(o)}}},45:A(1b){q(m.8A)k.4f(\'8K\',1b);q(m.8f)k.4f(\'8H\',1b);q(m.8y)k.4f(\'*\',1b)},4f:A(4g,1b){u 17=L.4U(4g);u Q=4g==\'*\'?\'2L\':\'1b\';S(u i=0;i<17.X;i++){q(Q==\'1b\'||(L.63.8B(17[i],"").8s(\'2L\')==\'2l\'||17[i].7H(\'1i-2t\')!=H)){u 1I=17[i].7H(\'1i-2t\');q(1b==\'1X\'&&1I){1I=1I.31(\'[\'+k.R+\']\',\'\');17[i].3T(\'1i-2t\',1I);q(!1I)17[i].F[Q]=17[i].61}K q(1b==\'1i\'){u 2n=m.62(17[i]);2n.w=17[i].44;2n.h=17[i].3u;u 7G=(2n.x+2n.w<k.x.P(\'3Q\')||2n.x>k.x.P(\'3Q\')+k.x.P(\'64\'));u 7M=(2n.y+2n.h<k.y.P(\'3Q\')||2n.y>k.y.P(\'3Q\')+k.y.P(\'64\'));u 4j=m.65(17[i]);q(!7G&&!7M&&4j!=k.R){q(!1I){17[i].3T(\'1i-2t\',\'[\'+k.R+\']\');17[i].61=17[i].F[Q];17[i].F[Q]=\'1i\'}K q(1I.7L(\'[\'+k.R+\']\')==-1){17[i].3T(\'1i-2t\',1I+\'[\'+k.R+\']\')}}K q((1I==\'[\'+k.R+\']\'||m.2u==4j)&&4j!=k.R){17[i].3T(\'1i-2t\',\'\');17[i].F[Q]=17[i].61||\'\'}K q(1I&&1I.7L(\'[\'+k.R+\']\')>-1){17[i].3T(\'1i-2t\',1I.31(\'[\'+k.R+\']\',\'\'))}}}}},3k:A(){k.V.F.1p=m.3L+=2;S(u i=0;i<m.N.X;i++){q(m.N[i]&&i==m.2u){u 3M=m.N[i];3M.11.1g+=\' 1c-\'+3M.26+\'-5W\';3M.11.F.2N=m.3j?\'7V\':\'4i\';3M.11.3w=m.1F.7T}}q(k.19)k.19.28.F.1p=k.V.F.1p-1;k.11.1g=\'1c-\'+k.26;k.11.3w=m.1F.5V;q(m.3S){m.3e=1n.2r?\'4i\':\'5T(\'+m.47+m.3S+\'), 4i\';q(m.3j&&m.1R<6)m.3e=\'7V\';k.11.F.2N=m.3e}m.2u=k.R;m.1D(L,1n.2r?\'4R\':\'4T\',m.3H)},5v:A(x,y){k.x.5Z(x);k.y.5Z(y)},2T:A(e){u w,h,r=e.M/e.16;w=1d.67(e.M+e.5b,1d.22(k.3Y,k.x.U));q(k.3f&&1d.9B(w-k.x.U)<12)w=k.x.U;h=w/r;q(h<1d.22(k.3K,k.y.U)){h=1d.22(k.3K,k.y.U);q(k.3f)w=h*r}k.5L(w,h)},5L:A(w,h){k.y.6h(h);k.x.6h(w);k.V.F.16=k.y.P(\'1u\')+\'D\'},2h:A(){q(k.6k||!k.3C)C;k.6k=G;m.3d(L,1n.2r?\'4R\':\'4T\',m.3H);1z{k.11.F.2N=\'9g\';k.6e(0,{V:{M:k.x.t,16:k.y.t,18:k.x.1s-k.x.Y+k.x.2j,W:k.y.1s-k.y.Y+k.y.2j},11:{18:0,W:0,M:k.x.t,16:k.y.t}},m.7y)}1C(e){k.5P()}},49:A(o){u B=o.4x;q(1m B==\'69\')B=m.3B(B);q(o.4Z)B=m.Z(\'1O\',{3G:o.4Z});q(!B||1m B==\'69\')C;B.F.3q=\'7I\';k.7C();u M=o.M&&/^[0-9]+(D|%)$/.14(o.M)?o.M:\'2l\';q(/^(18|2o)6z$/.14(o.1e)&&!/^[0-9]+D$/.14(o.M))M=\'8T\';u O=m.Z(\'1O\',{1t:\'2a\'+m.3F++,2a:o.2a},{1e:\'29\',1b:\'1i\',M:M,8a:m.1F.8l||\'\',1o:0},k.1r,G);O.2g(B);m.2q(O,{1o:1,6Q:0,8m:0,2p:(o.6d===0||o.6d===1a||(o.6d==2&&m.1P))?0:5c});m.2q(O,o);q(k.82){k.4m(O);q(!O.4K||k.6q)m.3p(O,{1o:O.1o},O.2p)}m.2e(k.1v,m.3F-1)},4m:A(O){u p=O.1e||\'6a 6c\',57=O.6Q,59=O.8m;q(O.2V!=k.1r)k.1r.2g(O);q(/18$/.14(p))O.F.18=57+\'D\';q(/6c$/.14(p))m.T(O,{18:\'50%\',43:(57-1d.56(O.44/2))+\'D\'});q(/2o$/.14(p))O.F.2o=-57+\'D\';q(/^8n$/.14(p)){m.T(O,{2o:\'1V%\',7J:k.x.Y+\'D\',W:-k.y.Y+\'D\',2S:-k.y.Y+\'D\',2L:\'2l\'});k.x.1B=O.44}K q(/^7x$/.14(p)){m.T(O,{18:\'1V%\',43:k.x.Y+\'D\',W:-k.y.Y+\'D\',2S:-k.y.Y+\'D\',2L:\'2l\'});k.x.2f=O.44}q(/^W/.14(p))O.F.W=59+\'D\';q(/^6a/.14(p))m.T(O,{W:\'50%\',48:(59-1d.56(O.3u/2))+\'D\'});q(/^2S/.14(p))O.F.2S=-59+\'D\';q(/^42$/.14(p)){m.T(O,{18:(-k.x.1B-k.x.Y)+\'D\',2o:(-k.x.2f-k.x.Y)+\'D\',2S:\'1V%\',7N:k.y.Y+\'D\',M:\'2l\'});k.y.1B=O.3u}K q(/^4r$/.14(p)){m.T(O,{1e:\'6j\',18:(-k.x.1B-k.x.Y)+\'D\',2o:(-k.x.2f-k.x.Y)+\'D\',W:\'1V%\',48:k.y.Y+\'D\',M:\'2l\'});k.y.2f=O.3u;O.F.1e=\'29\'}},80:A(){k.7Z([\'4P\',\'9i\'],G);q(k.4P&&k.68)k.4P.1g+=\' 1c-3c\';q(m.7W)k.8c();S(u i=0;i<m.1v.X;i++){u o=m.1v[i],5d=o.5Y,4n=o.3b;q((!5d&&!4n)||(5d&&5d==k.4Q)||(4n&&4n===k.3b)){k.49(o)}}u 4k=[];S(u i=0;i<k.1v.X;i++){u o=m.$(\'2a\'+k.1v[i]);q(/6z$/.14(o.1e))k.4m(o);K m.2e(4k,o)}S(u i=0;i<4k.X;i++)k.4m(4k[i]);k.82=G},7C:A(){q(!k.1r)k.1r=m.Z(\'1O\',{1g:k.60},{1e:\'29\',M:(k.x.I||(k.2d?k.M:H)||k.x.U)+\'D\',16:(k.y.I||k.y.U)+\'D\',1b:\'1i\',2L:\'1i\',1p:m.1P?4:\'2l\'},m.20,G)},35:A(6p,7D){u 1r=k.1r,x=k.x,y=k.y;m.T(1r,{M:x.I+\'D\',16:y.I+\'D\'});q(6p||7D){S(u i=0;i<k.1v.X;i++){u o=m.$(\'2a\'+k.1v[i]);u 6C=(m.3j||L.5a==\'5K\');q(o&&/^(42|4r)$/.14(o.1e)){q(6C){o.F.M=(1r.44+2*x.Y+x.1B+x.2f)+\'D\'}y[o.1e==\'42\'?\'1B\':\'2f\']=o.3u}q(o&&6C&&/^(18|2o)6z$/.14(o.1e)){o.F.16=(1r.3u+2*y.Y)+\'D\'}}}q(6p){m.T(k.11,{W:y.1B+\'D\'});m.T(1r,{W:(y.1B+y.Y)+\'D\'})}},8d:A(){u b=k.1r;b.1g=\'\';m.T(b,{W:(k.y.1B+k.y.Y)+\'D\',18:(k.x.1B+k.x.Y)+\'D\',2L:\'1X\'});q(m.4D)b.F.1b=\'1X\';k.V.2g(b);S(u i=0;i<k.1v.X;i++){u o=m.$(\'2a\'+k.1v[i]);o.F.1p=o.1p||4;q(!o.4K||k.6q){o.F.1b=\'1X\';m.T(o,{1b:\'1X\',3q:\'\'});m.3p(o,{1o:o.1o},o.2p)}}},8v:A(){q(!k.1v.X)C;m.3t(k.1r)},8p:A(){k.4M=m.Z(\'a\',{3y:\'8u:m.N[\'+k.R+\'].5M();\',3w:m.1F.88,1g:\'1c-U-4b\'});k.49({4x:k.4M,1e:m.7z,4K:G,1o:m.7O})},5M:A(){1z{q(k.4M)m.3t(k.4M);k.3k();u 1N=k.x.I,24=k.y.I;k.5L(k.x.U,k.y.U);u 4G=k.x.E-(k.x.I-1N)/2;q(4G<m.43)4G=m.43;u 4t=k.y.E-(k.y.I-24)/2;q(4t<m.48)4t=m.48;k.5v(4G,4t);k.45(\'1i\')}1C(e){k.5Q(e)}},5P:A(){k.a.1g=k.a.1g.31(\'1c-7P-7Q\',\'\');k.45(\'1X\');q(k.19&&k.2R)k.19.4q();m.3t(k.V);m.N[k.R]=H;m.7Y()}};m.4O=m.1F;u 9G=m.46;q(m.1P&&1n==1n.W){(A(){1z{L.3i.a4(\'18\')}1C(e){5S(87.ag,50);C}m.2H()})()}m.1D(L,\'ai\',m.2H);m.1D(1n,\'6M\',m.2H);m.1D(L,\'2H\',A(){q(m.4l){u F=m.Z(\'F\',{J:\'am/5s\'},H,L.4U(\'ap\')[0]),6G=L.5a==\'5K\';A 4L(5A,5F){q(m.1P&&(m.1R<9||6G)){u 2G=L.6J[L.6J.X-1];q(1m(2G.4L)=="5I")2G.4L(5A,5F)}K{F.2g(L.a6(5A+" {"+5F+"}"))}}A 9T(Q){C\'9S( ( ( 9R = L.3i.\'+Q+\' ? L.3i.\'+Q+\' : L.4J.\'+Q+\' ) ) + \\\'D\\\' );\'}q(m.4l)4L(\'.1c 1f\',\'2N: 5T(\'+m.47+m.4l+\'), 4i !ae;\')}});m.1D(1n,\'2T\',A(){m.4N()});m.1D(L,\'6w\',A(e){m.4B={x:e.4z,y:e.4o}});m.1D(L,\'7o\',m.6i);m.1D(L,\'7i\',m.6i);m.1D(L,\'2H\',m.51);m.1D(1n,\'6M\',m.7E)}',62,663,'||||||||||||||||||||this||hs||||if||||var|||||exp|function|el|return|px|pos|style|true|null|size|type|else|document|width|expanders|overlay|get|prop|key|for|setStyles|full|wrapper|top|length|cb|createElement||content|||test||height|els|left|outline|false|visibility|highslide|Math|position|img|className|outlineType|hidden|offset|fx|src|typeof|window|opacity|zIndex|case|overlayBox|tpos|id|wsize|overlays|options|dim|imgSize|try|next|p1|catch|addEventListener|loading|lang|event|td|hiddenBy|easing|ratio|to|target|xSize|div|ie|elem|uaVersion|new|minSize|dragArgs|100|op|visible|image|undefined|container|params|min|up|ySize|opt|contentType||table|absolute|hsId|name|arr|useBox|push|p2|appendChild|close|func|tb|graphic|auto|changed|elPos|right|dur|extend|opera|groups|by|focusKey|val|wh|step|args|custom|timers|scroll|getExpander|ucwh|hasDragged|styles|last|ready|now|page|marginMin|overflow|unit|cursor|start|onLoad|pendingOutlines|outlineWhileAnimating|bottom|resize|clone|parentNode|upcoming|match|ieLt9|duration|re|replace||||sizeOverlayBox|images||||attribs|slideshowGroup|move|removeEventListener|styleRestoreCursor|isImage|number|end|documentElement|ieLt7|focus|moveOnly|while|justify|fitsize|animate|display|none|allowReduce|discardElement|offsetHeight|in|title|onclick|href|Id|setPosition|getNode|isExpanded|iebody|getParams|idCounter|innerHTML|keyHandler|fac|param|minHeight|zIndexCounter|blurExp|allowSizeReduction|uclt|filter|opos|all|restoreCursor|setAttribute|preloadTheseImages|padToMinWidth|navigator|9999px|minWidth|on||Outline|above|marginLeft|offsetWidth|doShowHide|Expander|graphicsDir|marginTop|createOverlay|onReady|expand|curAnim|gotoEnd|previousOrNext|showHideElements|tagName|imgPad|pointer|wrapperKey|os|expandCursor|positionOverlay|sg|clientY|anchors|destroy|below|node|ypos|expOnly|relatedTarget|scrollLeft|overlayId|scrollTop|clientX|preloadFullImage|mouse|over|safari|isHsAnchor|preventDefault|xpos|self|marginMax|body|hideOnMouseOut|addRule|fullExpandLabel|getPageSize|langDefaults|heading|thumbsUserSetId|keypress|onload|keydown|getElementsByTagName|userAgent|Dimension|maxWidth|tr|html||getAnchors|onLoadStarted|prototype|topmostKey|clientSize|round|offX|toLowerCase|offY|compatMode|dX|250|tId|Create|ucrb|calcThumb|margin|overrides|continuePreloading|garbageBin|getSrc|getAdjacentAnchor|isReady|lt|mY|maxHeight|getParam|css|openerTagNames|mX|moveTo|calcBorders|startTime|complete|done|sel|calcExpanded|update|hasMovedMin|state|dec|maxsize|showLoading|object|hasAlphaImageLoader|BackCompat|resizeTo|doFullExpand|connectOutline|loadingPos|afterClose|error|tbody|setTimeout|url|numberOfImagesToPreload|restoreTitle|blur|topZ|thumbnailId|setPos|wrapperClassName|origProp|getPosition|defaultView|osize|getWrapperKey|adj|max|dragByHeading|string|middle|Click|center|fade|changeSize|parent|parseFloat|setSize|mouseClickHandler|relative|isClosing|element|clones|distance|dY|doWrapper|mouseIsOver|break|Text|cancelLoading|types|credits|mousemove|srcElement|init|panel|cur|hasFocused|ie6|dragHandler|pThis|JS|backCompat|vis|Highslide|styleSheets|loadingText|loadingTitle|load|onGraphicLoad|and|ltr|offsetX|captionOverlay|tag|appendTo|nopad|rv|200|headingOverlay|hide|easeInQuad||pageXOffset|clickX|getTime|transit||clickY|call|Date|previous|focusTopmost|from|form|timerId|enableKeyListener|cloneNode|loadingOpacity|orig|mouseup|clientWidth|alpha|detachEvent|offsetParent|offsetLeft|mousedown|updateAnchors|pow|_default|offsetTop|preloadGraphic|switch|525|prepareNextOutline|rightpanel|restoreDuration|fullExpandPosition|after|afterExpand|genOverlayBox|doPanels|preloadImages|toString|clearsX|getAttribute|block|marginRight|preloadNext|indexOf|clearsY|marginBottom|fullExpandOpacity|active|anchor|correctRatio|fitOverlayBox|focusTitle|show|hand|showCredits|tmpMin|reOrder|getInline|getOverlays|contentLoaded|gotOverlays|nextSibling|expandDuration|easingClose|fadeInOut|arguments|fullExpandTitle|creditsPosition|direction|creditsTitle|writeCredits|showOverlays|creditsText|hideIframes|wrapperMouseHandler|pageOrigin|Eval|allowMultipleInstances|thumb|cssDirection|offsetY|leftpanel|creditsTarget|createFullExpand|getAnchorIndex|current|getPropertyValue|_|javascript|destroyOverlays|addOverlay|creditsHref|geckoMac|Overlay|hideSelects|getComputedStyle|hasHtmlExpanders|xpand|returnValue|keyCode|registerOverlay|IFRAME|button|htmlE|SELECT|currentStyle|zoomin|zoomout|graphics|keys|arrow|1001|outlineStartOffset|200px|_self|com|http|Use|drag|front|Expand|bring|cancel|Loading|actual|Powered|click|homepage|the||Go|drop|shadow|border|removeAttribute|padding|default|getElementById|caption|toUpperCase|pageYOffset|innerHeight|clientHeight|innerWidth|Gecko|Macintosh|headingId|headingText|captionEval|captionText|captionId|headingEval|oPos|Safari|ra|it|Trident|abs|toElement|oncontextmenu|stl|message|HsExpander|location|scale|background|outlinesDir|lineNumber|setInterval|png|outlines|splice|clearInterval|ignoreMe|expression|fix|DXImageTransform|cellSpacing|Microsoft|borderCollapse|collapse|lineHeight|progid|AlphaImageLoader|flushImgSize|tgt|doScroll|tgtArr|createTextNode|sqrt|sizingMethod|Line|alert|readyState|attachEvent|allowSimultaneousLoading|important|imageCreate|callee|eval|DOMContentLoaded|RegExp|isHtml|dragSensitivity|text|fromElement|mouseover|HEAD|blockRightClick|Left||linearTween|Top|Height|vendor|Width|KDE|Right|Bottom|onmouseover|parseInt|onmouseout|debug|fontSize|rb'.split('|'),0,{}))
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/nextgen_highslide_init.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/nextgen_highslide_init.js
new file mode 100644
index 0000000000000000000000000000000000000000..6269bf0afb82afa9b117f4afd58019c138f1866a
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/highslide/nextgen_highslide_init.js
@@ -0,0 +1,37 @@
+// Apply default settings
+var galleryOptions = {
+    align: 'center',
+    dimmingOpacity: 0.8,
+    fadeInOut: true,
+    marginBottom: 80,
+    marginLeft: 100,
+    numberPosition: 'caption',
+    slideshowGroup: 'gallery',
+    transitions: ['expand', 'crossfade'],
+    wrapperClassName: 'dark borderless floating-caption',
+    graphicsDir: nextgen_highslide_graphics_dir + '/'
+};
+
+hs.align            = galleryOptions['align'];
+hs.dimmingOpacity   = galleryOptions['dimmingOpacity'];
+hs.fadeInOut        = galleryOptions['fadeInOut'];
+hs.marginBottom     = galleryOptions['marginBottom'];
+hs.marginLeft       = galleryOptions['marginLeft'];
+hs.numberPosition   = galleryOptions['numberPosition'];
+hs.transitions      = galleryOptions['transitions'];
+hs.showCredits      = galleryOptions['showCredits'];
+hs.graphicsDir      = galleryOptions['graphicsDir'];
+hs.wrapperClassName = galleryOptions['wrapperClassName'];
+
+// Enable slideshows
+hs.addSlideshow({
+    fixedControls: true,
+    interval: 5000,
+    overlayOptions: {
+        hideOnMouseOut: true,
+        opacity: .6,
+        position: 'top center'
+    },
+    repeat: true,
+    useControls: true
+});
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/jquery.lightbox/jquery.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/jquery.lightbox/jquery.js
new file mode 100644
index 0000000000000000000000000000000000000000..3747929d8bf80f238139443a5032a606d726e5f0
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/jquery.lightbox/jquery.js
@@ -0,0 +1,32 @@
+/*
+ * jQuery 1.2.3 - 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-02-06 00:21:25 -0500 (Wed, 06 Feb 2008) $
+ * $Rev: 4663 $
+ */
+(function(){if(window.jQuery)var _jQuery=window.jQuery;var jQuery=window.jQuery=function(selector,context){return new jQuery.prototype.init(selector,context);};if(window.$)var _$=window.$;window.$=jQuery;var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/;var isSimple=/^.[^:#\[\.]*$/;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}else if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem)if(elem.id!=match[3])return jQuery().find(selector);else{this[0]=elem;this.length=1;return this;}else
+selector=[];}}else
+return new jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return new jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(selector.constructor==Array&&selector||(selector.jquery||selector.length&&selector!=window&&!selector.nodeType&&selector[0]!=undefined&&selector[0].nodeType)&&jQuery.makeArray(selector)||[selector]);},jquery:"1.2.3",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;this.each(function(i){if(this==elem)ret=i;});return ret;},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value==undefined)return this.length&&jQuery[type||"attr"](this[0],name)||undefined;else{options={};options[name]=value;}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){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])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){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else
+return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});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 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)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!selector?this:this.pushStack(jQuery.merge(this.get(),selector.constructor==String?jQuery(selector).get():selector.length!=undefined&&(!selector.nodeName||jQuery.nodeName(selector,"form"))?selector:[selector]));},is:function(selector){return selector?jQuery.multiFilter(selector,this).length>0:false;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){value=jQuery.browser.msie&&!option.attributes.value.specified?option.text:option.value;if(one)return value;values.push(value);}}return values;}else
+return(this[0].value||"").replace(/\r/g,"");}return undefined;}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=value.constructor==Array?value:[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.length?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==null){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data==undefined&&this.length)data=jQuery.data(this[0],key);return data==null&&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;if(jQuery.nodeName(elem,"script")){scripts=scripts.add(elem);}else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).remove());callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.prototype.init.prototype=jQuery.prototype;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);}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function")target={};if(length==1){target=this;i=0;}for(;i<length;i++)if((options=arguments[i])!=null)for(var name in options){if(target===options[name])continue;if(deep&&options[name]&&typeof options[name]=="object"&&target[name]&&!options[name].nodeType)target[name]=jQuery.extend(target[name],options[name]);else if(options[name]!=undefined)target[name]=options[name];}return target;};var expando="jQuery"+(new Date()).getTime(),uuid=0,windowData={};var exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i;jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)window.jQuery=_jQuery;return jQuery;},isFunction:function(fn){return!!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/function/i.test(fn+"");},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body;},globalEval:function(data){data=jQuery.trim(data);if(data){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));head.appendChild(script);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];if(!id)id=elem[expando]=++uuid;if(name&&!jQuery.cache[id])jQuery.cache[id]={};if(data!=undefined)jQuery.cache[id][name]=data;return name?jQuery.cache[id][name]:id;},removeData:function(elem,name){elem=elem==window?windowData:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id])break;if(!name)jQuery.removeData(elem);}}else{try{delete elem[expando];}catch(e){if(elem.removeAttribute)elem.removeAttribute(expando);}delete jQuery.cache[id];}},each:function(object,callback,args){if(args){if(object.length==undefined){for(var name in object)if(callback.apply(object[name],args)===false)break;}else
+for(var i=0,length=object.length;i<length;i++)if(callback.apply(object[i],args)===false)break;}else{if(object.length==undefined){for(var name in object)if(callback.call(object[name],name,object[name])===false)break;}else
+for(var i=0,length=object.length,value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}return object;},prop:function(elem,value,type,i,name){if(jQuery.isFunction(value))value=value.call(elem,i);return value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(name)?value+"px":value;},className:{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;});},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(" "):"";},has:function(elem,className){return jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);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;function color(elem){if(!jQuery.browser.safari)return false;var ret=document.defaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(elem.style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=elem.style.outline;elem.style.outline="0 solid black";elem.style.outline=save;}if(name.match(/float/i))name=styleFloat;if(!force&&elem.style&&elem.style[name])ret=elem.style[name];else if(document.defaultView&&document.defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var getComputedStyle=document.defaultView.getComputedStyle(elem,null);if(getComputedStyle&&!color(elem))ret=getComputedStyle.getPropertyValue(name);else{var swap=[],stack=[];for(var a=elem;a&&color(a);a=a.parentNode)stack.unshift(a);for(var i=0;i<stack.length;i++)if(color(stack[i])){swap[i]=stack[i].style.display;stack[i].style.display="block";}ret=name=="display"&&swap[stack.length-1]!=null?"none":(getComputedStyle&&getComputedStyle.getPropertyValue(name))||"";for(var i=0;i<swap.length;i++)if(swap[i]!=null)stack[i].style.display=swap[i];}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];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var style=elem.style.left,runtimeStyle=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;elem.style.left=ret||0;ret=elem.style.pixelLeft+"px";elem.style.left=style;elem.runtimeStyle.left=runtimeStyle;}}return ret;},clean:function(elems,context){var ret=[];context=context||document;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=elem.toString();if(typeof elem=="string"){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+">";});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!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>"]||(!tags.indexOf("<td")||!tags.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||jQuery.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf("<table")&&tags.indexOf("<tbody")<0?div.firstChild&&div.firstChild.childNodes: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]);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){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var fix=jQuery.isXMLDoc(elem)?{}:jQuery.props;if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(fix[name]){if(value!=undefined)elem[fix[name]]=value;return elem[fix[name]];}else if(jQuery.browser.msie&&name=="style")return jQuery.attr(elem.style,"cssText",value);else if(value==undefined&&jQuery.browser.msie&&jQuery.nodeName(elem,"form")&&(name=="action"||name=="method"))return elem.getAttributeNode(name).nodeValue;else if(elem.tagName){if(value!=undefined){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem.setAttribute(name,""+value);}if(jQuery.browser.msie&&/href|src/.test(name)&&!jQuery.isXMLDoc(elem))return elem.getAttribute(name,2);return elem.getAttribute(name);}else{if(name=="opacity"&&jQuery.browser.msie){if(value!=undefined){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseFloat(value).toString()=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100).toString():"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(value!=undefined)elem[name]=value;return elem[name];}},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(typeof array!="array")for(var i=0,length=array.length;i<length;i++)ret.push(array[i]);else
+ret=array.slice(0);return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i<length;i++)if(array[i]==elem)return i;return-1;},merge:function(first,second){if(jQuery.browser.msie){for(var i=0;second[i];i++)if(second[i].nodeType!=8)first.push(second[i]);}else
+for(var i=0;second[i];i++)first.push(second[i]);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=[];for(var i=0,length=elems.length;i<length;i++)if(!inv&&callback(elems[i],i)||inv&&!callback(elems[i],i))ret.push(elems[i]);return ret;},map:function(elems,callback){var ret=[];for(var i=0,length=elems.length;i<length;i++){var value=callback(elems[i],i);if(value!==null&&value!=undefined){if(value.constructor!=Array)value=[value];ret=ret.concat(value);}}return ret;}});var userAgent=navigator.userAgent.toLowerCase();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({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,innerHTML:"innerHTML",className:"className",value:"value",disabled:"disabled",checked:"checked",readonly:"readOnly",selected:"selected",maxlength:"maxLength",selectedIndex:"selectedIndex",defaultValue:"defaultValue",tagName:"tagName",nodeName:"nodeName"}});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){jQuery("*",this).add(this).each(function(){jQuery.event.remove(this);jQuery.removeData(this);});if(this.parentNode)this.parentNode.removeChild(this);}},empty:function(){jQuery(">*",this).remove();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){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});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];},":":{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;},"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:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},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";},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");},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:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,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){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false;var re=quickChild;var m=re.exec(t);if(m){nodeName=m[1].toUpperCase();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;t=jQuery.trim(t.replace(re,""));foundToken=true;}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0])ret.shift();done=jQuery.merge(done,ret);r=ret=[context];t=" "+t.substr(1,t.length);}else{var re2=quickID;var m=re2.exec(t);if(m){m=[0,m[2],m[3],m[1]];}else{re2=quickClass;m=re2.exec(t);}m[2]=m[2].replace(/\\/g,"");var elem=ret[ret.length-1];if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2])oid=jQuery('[@id="'+m[2]+'"]',elem)[0];ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[];}else{for(var i=0;ret[i];i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object")tag="param";r=jQuery.merge(r,ret[i].getElementsByTagName(tag));}if(m[1]==".")r=jQuery.classFilter(r,m[2]);if(m[1]=="#"){var tmp=[];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(t){var val=jQuery.filter(t,r);ret=r=val.r;t=jQuery.trim(val.t);}}if(t)ret=[];if(ret&&context==ret[0])ret.shift();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;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){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);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;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;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;}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+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[];var 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&&(!elem||n!=elem))r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval!=undefined)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=function(){return fn.apply(this,arguments);};handler.data=data;handler.guid=fn.guid;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){var val;if(typeof jQuery=="undefined"||jQuery.event.triggered)return val;val=jQuery.event.handle.apply(arguments.callee.elem,arguments);return val;});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener)elem.addEventListener(type,handle,false);else if(elem.attachEvent)elem.attachEvent("on"+type,handle);}}handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)=="."))for(var type in events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else
+for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];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];}}});}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){data=jQuery.makeArray(data||[]);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event)data.unshift(this.fix({type:type,target:elem}));data[0].type=type;if(exclusive)data[0].exclusive=true;if(jQuery.isFunction(jQuery.data(elem,"handle")))val=jQuery.data(elem,"handle").apply(elem,data);if(!fn&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val;event=jQuery.event.fix(event||window.event||{});var parts=event.type.split(".");event.type=parts[0];var handlers=jQuery.data(this,"events")&&jQuery.data(this,"events")[event.type],args=Array.prototype.slice.call(arguments,1);args.unshift(event);for(var j in handlers){var handler=handlers[j];args[0].handler=handler;args[0].data=handler.data;if(!parts[1]&&!event.exclusive||handler.type==parts[1]){var ret=handler.apply(this,args);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}if(jQuery.browser.msie)event.target=event.preventDefault=event.stopPropagation=event.handler=event.data=null;return val;},fix:function(event){var originalEvent=event;event=jQuery.extend({},originalEvent);event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=originalEvent.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;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);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},special:{ready:{setup:function(){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(withinElement(event,this))return true;arguments[0].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(withinElement(event,this))return true;arguments[0].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){return this.each(function(){jQuery.event.add(this,type,function(event){jQuery(this).unbind(event);return(fn||data).apply(this,arguments);},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){if(this[0])return jQuery.event.trigger(type,data,this[0],false,fn);return undefined;},toggle:function(){var args=arguments;return this.click(function(event){this.lastToggle=0==this.lastToggle?1:0;event.preventDefault();return args[this.lastToggle].apply(this,arguments)||false;});},hover:function(fnOver,fnOut){return this.bind('mouseenter',fnOver).bind('mouseleave',fnOut);},ready:function(fn){bindReady();if(jQuery.isReady)fn.call(document,jQuery);else
+jQuery.readyList.push(function(){return fn.call(this,jQuery);});return this;}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.apply(document);});jQuery.readyList=null;}jQuery(document).triggerHandler("ready");}}});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(document.addEventListener&&!jQuery.browser.opera)document.addEventListener("DOMContentLoaded",jQuery.ready,false);if(jQuery.browser.msie&&window==top)(function(){if(jQuery.isReady)return;try{document.documentElement.doScroll("left");}catch(error){setTimeout(arguments.callee,0);return;}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;}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;}jQuery.ready();})();}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){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name);};});var withinElement=function(event,elem){var parent=event.relatedTarget;while(parent&&parent!=elem)try{parent=parent.parentNode;}catch(error){parent=elem;}return parent==elem;};jQuery(window).bind("unload",function(){jQuery("*").add(document).unbind();});jQuery.fn.extend({load:function(url,params,callback){if(jQuery.isFunction(url))return this.bind("load",url);var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):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();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=(new Date).getTime();jQuery.extend({get:function(url,data,callback,type){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:{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:"*/*"}},lastModified:{},ajax:function(s){var jsonp,jsre=/=\?(&|$)/g,status,data;s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(s.type.toLowerCase()=="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";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();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&&s.type.toLowerCase()=="get"){var ts=(new Date()).getTime();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&s.type.toLowerCase()=="get"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");if((!s.url.indexOf("http")||!s.url.indexOf("//"))&&s.dataType=="script"&&s.type.toLowerCase()=="get"){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var done=false;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);return undefined;}var requestDone=false;var xml=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();xml.open(s.type,s.url,s.async,s.username,s.password);try{if(s.data)xml.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xml.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xml.setRequestHeader("X-Requested-With","XMLHttpRequest");xml.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend)s.beforeSend(xml);if(s.global)jQuery.event.trigger("ajaxSend",[xml,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xml&&(xml.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xml)&&"error"||s.ifModified&&jQuery.httpNotModified(xml,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xml,s.dataType);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xml.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else
+jQuery.handleError(s,xml,status);complete();if(s.async)xml=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xml){xml.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xml.send(s.data);}catch(e){jQuery.handleError(s,xml,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xml,s]);}function complete(){if(s.complete)s.complete(xml,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xml,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xml;},handleError:function(s,xml,status,e){if(s.error)s.error(xml,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xml,s,e]);},active:0,httpSuccess:function(r){try{return!r.status&&location.protocol=="file:"||(r.status>=200&&r.status<300)||r.status==304||r.status==1223||jQuery.browser.safari&&r.status==undefined;}catch(e){}return false;},httpNotModified:function(xml,url){try{var xmlRes=xml.getResponseHeader("Last-Modified");return xml.status==304||xmlRes==jQuery.lastModified[url]||jQuery.browser.safari&&xml.status==undefined;}catch(e){}return false;},httpData:function(r,type){var ct=r.getResponseHeader("content-type");var xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0;var data=xml?r.responseXML:r.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else
+for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else
+s.push(encodeURIComponent(j)+"="+encodeURIComponent(a[j]));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");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();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle(fn,fn2):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);var hidden=jQuery(this).is(":hidden"),self=this;for(var p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return jQuery.isFunction(opt.complete)&&opt.complete.apply(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");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";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else
+e.custom(start,val,"");}});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.apply(this);}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return this;}});var queue=function(elem,type,array){if(!elem)return undefined;type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",array?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].apply(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:{slow:600,fast:200}[opt.duration])||400;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.apply(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={update:function(){if(this.options.step)this.options.step.apply(this.elem,[this.now,this]);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},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;},custom:function(from,to,unit){this.startTime=(new Date()).getTime();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);}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(0,this.cur());if(this.prop=="width"||this.prop=="height")this.elem.style[this.prop]="1px";jQuery(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(gotoEnd){var t=(new Date()).getTime();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){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";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&&jQuery.isFunction(this.options.complete))this.options.complete.apply(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;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);this.update();}return true;}};jQuery.fx.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;}};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),fixed=jQuery.css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&jQuery.css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(jQuery.css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&jQuery.css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||jQuery.css(offsetChild,"position")=="absolute"))||(mozilla&&jQuery.css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}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)||0;top+=parseInt(t)||0;}return results;};})();
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/jquery.lightbox/jquery.lightbox-0.5.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/jquery.lightbox/jquery.lightbox-0.5.css
new file mode 100644
index 0000000000000000000000000000000000000000..5805977996ae33ed31e0010efb87925e6df2bd9b
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/jquery.lightbox/jquery.lightbox-0.5.css
@@ -0,0 +1,103 @@
+/**
+ * jQuery lightBox plugin
+ * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/)
+ * and adapted to me for use like a plugin from jQuery.
+ * @name jquery-lightbox-0.5.css
+ * @author Leandro Vieira Pinho - http://leandrovieira.com
+ * @version 0.5
+ * @date April 11, 2008
+ * @category jQuery plugin
+ * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com)
+ * @license CCAttribution-ShareAlike 2.5 Brazil - http://creativecommons.org/licenses/by-sa/2.5/br/deed.en_US
+ * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin
+ */
+#jquery-overlay {
+	position: absolute;
+	top: 0;
+	left: 0;
+	z-index: 10090;
+	width: 100%;
+	height: 500px;
+}
+#jquery-lightbox {
+	position: absolute;
+	top: 0;
+	left: 0;
+	width: 100%;
+	z-index: 10100;
+	text-align: center;
+	line-height: 0;
+}
+#jquery-lightbox a img { border: none; }
+#lightbox-container-image-box {
+	position: relative;
+	background-color: #fff;
+	width: 250px;
+	height: 250px;
+	margin: 0 auto;
+}
+#lightbox-container-image { padding: 10px; }
+#lightbox-loading {
+	position: absolute;
+	top: 40%;
+	left: 0%;
+	height: 25%;
+	width: 100%;
+	text-align: center;
+	line-height: 0;
+}
+#lightbox-nav {
+	position: absolute;
+	top: 0;
+	left: 0;
+	height: 100%;
+	width: 100%;
+	z-index: 10010;
+}
+#lightbox-container-image-box > #lightbox-nav { left: 0; }
+#lightbox-nav a { outline: none;}
+#lightbox-nav-btnPrev, #lightbox-nav-btnNext {
+	width: 49%;
+	height: 100%;
+	zoom: 1;
+	display: block;
+}
+#lightbox-nav-btnPrev { 
+	left: 0; 
+	float: left;
+}
+#lightbox-nav-btnNext { 
+	right: 0; 
+	float: right;
+}
+#lightbox-container-image-data-box {
+	font: 10px Verdana, Helvetica, sans-serif;
+	background-color: #fff;
+	margin: 0 auto;
+	line-height: 1.4em;
+	overflow: auto;
+	width: 100%;
+	padding: 0 10px 0;
+	position: relative;
+	min-height: 32px;
+}
+#lightbox-container-image-data {
+	padding: 0 10px; 
+	color: #666; 
+}
+#lightbox-container-image-data #lightbox-image-details { 
+	width: 70%; 
+	float: left; 
+	text-align: left; 
+}	
+#lightbox-image-details-caption { font-weight: bold; }
+#lightbox-image-details-currentNumber {
+	display: block; 
+	clear: left; 
+	padding-bottom: 1.0em;	
+}			
+#lightbox-secNav-btnClose {
+	width: 66px; 
+	float: right;
+	padding-bottom: 0.7em;	
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/jquery.lightbox/jquery.lightbox-0.5.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/jquery.lightbox/jquery.lightbox-0.5.js
new file mode 100644
index 0000000000000000000000000000000000000000..28a61bbf63afadc3d7e491f4946ed62d3df73bb3
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/jquery.lightbox/jquery.lightbox-0.5.js
@@ -0,0 +1,472 @@
+/**
+ * jQuery lightBox plugin
+ * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/)
+ * and adapted to me for use like a plugin from jQuery.
+ * @name jquery-lightbox-0.5.js
+ * @author Leandro Vieira Pinho - http://leandrovieira.com
+ * @version 0.5
+ * @date April 11, 2008
+ * @category jQuery plugin
+ * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com)
+ * @license CCAttribution-ShareAlike 2.5 Brazil - http://creativecommons.org/licenses/by-sa/2.5/br/deed.en_US
+ * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin
+ */
+
+// Offering a Custom Alias suport - More info: http://docs.jquery.com/Plugins/Authoring#Custom_Alias
+(function($) {
+	/**
+	 * $ is an alias to jQuery object
+	 *
+	 */
+	$.fn.lightBox = function(settings) {
+		// Settings to configure the jQuery lightBox plugin how you like
+		settings = jQuery.extend({
+			// Configuration related to overlay
+			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.
+			overlayOpacity:			0.8,		// (integer) Opacity value to overlay; inform: 0.X. Where X are number from 0 to 9
+			// Configuration related to navigation
+			fixedNavigation:		false,		// (boolean) Boolean that informs if the navigation (next and prev button) will be fixed or not in the interface.
+			// Configuration related to images
+			imageLoading:			'images/lightbox-ico-loading.gif',		// (string) Path and the name of the loading icon
+			imageBtnPrev:			'images/lightbox-btn-prev.gif',			// (string) Path and the name of the prev button image
+			imageBtnNext:			'images/lightbox-btn-next.gif',			// (string) Path and the name of the next button image
+			imageBtnClose:			'images/lightbox-btn-close.gif',		// (string) Path and the name of the close btn
+			imageBlank:				'images/lightbox-blank.gif',			// (string) Path and the name of a blank image (one pixel)
+			// Configuration related to container image box
+			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
+			containerResizeSpeed:	400,		// (integer) Specify the resize duration of container image. These number are miliseconds. 400 is default.
+			// Configuration related to texts in caption. For example: Image 2 of 8. You can alter either "Image" and "of" texts.
+			txtImage:				'Image',	// (string) Specify text "Image"
+			txtOf:					'of',		// (string) Specify text "of"
+			// Configuration related to keyboard navigation
+			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.
+			keyToPrev:				'p',		// (string) (p = previous) Letter to show the previous image
+			keyToNext:				'n',		// (string) (n = next) Letter to show the next image.
+			// Don�t alter these variables in any way
+			imageArray:				[],
+			activeImage:			0
+		},settings);
+		// Caching the jQuery object with all elements matched
+		var jQueryMatchedObj = this; // This, in this context, refer to jQuery object
+		/**
+		 * Initializing the plugin calling the start function
+		 *
+		 * @return boolean false
+		 */
+		function _initialize() {
+			_start(this,jQueryMatchedObj); // This, in this context, refer to object (link) which the user have clicked
+			return false; // Avoid the browser following the link
+		}
+		/**
+		 * Start the jQuery lightBox plugin
+		 *
+		 * @param object objClicked The object (link) whick the user have clicked
+		 * @param object jQueryMatchedObj The jQuery object with all elements matched
+		 */
+		function _start(objClicked,jQueryMatchedObj) {
+			// Hime some elements to avoid conflict with overlay in IE. These elements appear above the overlay.
+			$('embed, object, select').css({ 'visibility' : 'hidden' });
+			// Call the function to create the markup structure; style some elements; assign events in some elements.
+			_set_interface();
+			// Unset total images in imageArray
+			settings.imageArray.length = 0;
+			// Unset image active information
+			settings.activeImage = 0;
+			// We have an image set? Or just an image? Let�s see it.
+			if ( jQueryMatchedObj.length == 1 ) {
+				settings.imageArray.push(new Array(objClicked.getAttribute('href'),objClicked.getAttribute('title')));
+			} else {
+				// Add an Array (as many as we have), with href and title atributes, inside the Array that storage the images references		
+				for ( var i = 0; i < jQueryMatchedObj.length; i++ ) {
+					settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('href'),jQueryMatchedObj[i].getAttribute('title')));
+				}
+			}
+			while ( settings.imageArray[settings.activeImage][0] != objClicked.getAttribute('href') ) {
+				settings.activeImage++;
+			}
+			// Call the function that prepares image exibition
+			_set_image_to_view();
+		}
+		/**
+		 * Create the jQuery lightBox plugin interface
+		 *
+		 * The HTML markup will be like that:
+			<div id="jquery-overlay"></div>
+			<div id="jquery-lightbox">
+				<div id="lightbox-container-image-box">
+					<div id="lightbox-container-image">
+						<img src="../fotos/XX.jpg" id="lightbox-image">
+						<div 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="../images/lightbox-ico-loading.gif">
+							</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="../images/lightbox-btn-close.gif">
+							</a>
+						</div>
+					</div>
+				</div>
+			</div>
+		 *
+		 */
+		function _set_interface() {
+			// Apply the HTML markup into body tag
+			$('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>');	
+			// Get page sizes
+			var arrPageSizes = ___getPageSize();
+			// Style overlay and show it
+			$('#jquery-overlay').css({
+				backgroundColor:	settings.overlayBgColor,
+				opacity:			settings.overlayOpacity,
+				width:				arrPageSizes[0],
+				height:				arrPageSizes[1]
+			}).fadeIn();
+			// Get page scroll
+			var arrPageScroll = ___getPageScroll();
+			// Calculate top and left offset for the jquery-lightbox div object and show it
+			$('#jquery-lightbox').css({
+				top:	arrPageScroll[1] + (arrPageSizes[3] / 10),
+				left:	arrPageScroll[0]
+			}).show();
+			// Assigning click events in elements to close overlay
+			$('#jquery-overlay,#jquery-lightbox').click(function() {
+				_finish();									
+			});
+			// Assign the _finish function to lightbox-loading-link and lightbox-secNav-btnClose objects
+			$('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function() {
+				_finish();
+				return false;
+			});
+			// If window was resized, calculate the new overlay dimensions
+			$(window).resize(function() {
+				// Get page sizes
+				var arrPageSizes = ___getPageSize();
+				// Style overlay and show it
+				$('#jquery-overlay').css({
+					width:		arrPageSizes[0],
+					height:		arrPageSizes[1]
+				});
+				// Get page scroll
+				var arrPageScroll = ___getPageScroll();
+				// Calculate top and left offset for the jquery-lightbox div object and show it
+				$('#jquery-lightbox').css({
+					top:	arrPageScroll[1] + (arrPageSizes[3] / 10),
+					left:	arrPageScroll[0]
+				});
+			});
+		}
+		/**
+		 * Prepares image exibition; doing a image�s preloader to calculate it�s size
+		 *
+		 */
+		function _set_image_to_view() { // show the loading
+			// Show the loading
+			$('#lightbox-loading').show();
+			if ( settings.fixedNavigation ) {
+				$('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();
+			} else {
+				// Hide some elements
+				$('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();
+			}
+			// Image preload process
+			var objImagePreloader = new Image();
+			objImagePreloader.onload = function() {
+				$('#lightbox-image').attr('src',settings.imageArray[settings.activeImage][0]);
+				// Perfomance an effect in the image container resizing it
+				_resize_container_image_box(objImagePreloader.width,objImagePreloader.height);
+				//	clear onLoad, IE behaves irratically with animated gifs otherwise
+				objImagePreloader.onload=function(){};
+			};
+			objImagePreloader.src = settings.imageArray[settings.activeImage][0];
+		};
+		/**
+		 * Perfomance an effect in the image container resizing it
+		 *
+		 * @param integer intImageWidth The image�s width that will be showed
+		 * @param integer intImageHeight The image�s height that will be showed
+		 */
+		function _resize_container_image_box(intImageWidth,intImageHeight) {
+			// Get current width and height
+			var intCurrentWidth = $('#lightbox-container-image-box').width();
+			var intCurrentHeight = $('#lightbox-container-image-box').height();
+			// Get the width and height of the selected image plus the padding
+			var intWidth = (intImageWidth + (settings.containerBorderSize * 2)); // Plus the image�s width and the left and right padding value
+			var intHeight = (intImageHeight + (settings.containerBorderSize * 2)); // Plus the image�s height and the left and right padding value
+			// Diferences
+			var intDiffW = intCurrentWidth - intWidth;
+			var intDiffH = intCurrentHeight - intHeight;
+			// Perfomance the effect
+			$('#lightbox-container-image-box').animate({ width: intWidth, height: intHeight },settings.containerResizeSpeed,function() { _show_image(); });
+			if ( ( intDiffW == 0 ) && ( intDiffH == 0 ) ) {
+				if ( $.browser.msie ) {
+					___pause(250);
+				} else {
+					___pause(100);	
+				}
+			} 
+			$('#lightbox-container-image-data-box').css({ width: intImageWidth });
+			$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ height: intImageHeight + (settings.containerBorderSize * 2) });
+		};
+		/**
+		 * Show the prepared image
+		 *
+		 */
+		function _show_image() {
+			$('#lightbox-loading').hide();
+			$('#lightbox-image').fadeIn(function() {
+				_show_image_data();
+				_set_navigation();
+			});
+			_preload_neighbor_images();
+		};
+		/**
+		 * Show the image information
+		 *
+		 */
+		function _show_image_data() {
+			$('#lightbox-container-image-data-box').slideDown('fast');
+			$('#lightbox-image-details-caption').hide();
+			if ( settings.imageArray[settings.activeImage][1] ) {
+				$('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show();
+			}
+			// If we have a image set, display 'Image X of X'
+			if ( settings.imageArray.length > 1 ) {
+				$('#lightbox-image-details-currentNumber').html(settings.txtImage + ' ' + ( settings.activeImage + 1 ) + ' ' + settings.txtOf + ' ' + settings.imageArray.length).show();
+			}		
+		}
+		/**
+		 * Display the button navigations
+		 *
+		 */
+		function _set_navigation() {
+			$('#lightbox-nav').show();
+
+			// Instead to define this configuration in CSS file, we define here. And it�s need to IE. Just.
+			$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });
+			
+			// Show the prev button, if not the first image in set
+			if ( settings.activeImage != 0 ) {
+				if ( settings.fixedNavigation ) {
+					$('#lightbox-nav-btnPrev').css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' })
+						.unbind()
+						.bind('click',function() {
+							settings.activeImage = settings.activeImage - 1;
+							_set_image_to_view();
+							return false;
+						});
+				} else {
+					// Show the images button for Next buttons
+					$('#lightbox-nav-btnPrev').unbind().hover(function() {
+						$(this).css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' });
+					},function() {
+						$(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });
+					}).show().bind('click',function() {
+						settings.activeImage = settings.activeImage - 1;
+						_set_image_to_view();
+						return false;
+					});
+				}
+			}
+			
+			// Show the next button, if not the last image in set
+			if ( settings.activeImage != ( settings.imageArray.length -1 ) ) {
+				if ( settings.fixedNavigation ) {
+					$('#lightbox-nav-btnNext').css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' })
+						.unbind()
+						.bind('click',function() {
+							settings.activeImage = settings.activeImage + 1;
+							_set_image_to_view();
+							return false;
+						});
+				} else {
+					// Show the images button for Next buttons
+					$('#lightbox-nav-btnNext').unbind().hover(function() {
+						$(this).css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' });
+					},function() {
+						$(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });
+					}).show().bind('click',function() {
+						settings.activeImage = settings.activeImage + 1;
+						_set_image_to_view();
+						return false;
+					});
+				}
+			}
+			// Enable keyboard navigation
+			_enable_keyboard_navigation();
+		}
+		/**
+		 * Enable a support to keyboard navigation
+		 *
+		 */
+		function _enable_keyboard_navigation() {
+			$(document).keydown(function(objEvent) {
+				_keyboard_action(objEvent);
+			});
+		}
+		/**
+		 * Disable the support to keyboard navigation
+		 *
+		 */
+		function _disable_keyboard_navigation() {
+			$(document).unbind();
+		}
+		/**
+		 * Perform the keyboard actions
+		 *
+		 */
+		function _keyboard_action(objEvent) {
+			// To ie
+			if ( objEvent == null ) {
+				keycode = event.keyCode;
+				escapeKey = 27;
+			// To Mozilla
+			} else {
+				keycode = objEvent.keyCode;
+				escapeKey = objEvent.DOM_VK_ESCAPE;
+			}
+			// Get the key in lower case form
+			key = String.fromCharCode(keycode).toLowerCase();
+			// Verify the keys to close the ligthBox
+			if ( ( key == settings.keyToClose ) || ( key == 'x' ) || ( keycode == escapeKey ) ) {
+				_finish();
+			}
+			// Verify the key to show the previous image
+			if ( ( key == settings.keyToPrev ) || ( keycode == 37 ) ) {
+				// If we�re not showing the first image, call the previous
+				if ( settings.activeImage != 0 ) {
+					settings.activeImage = settings.activeImage - 1;
+					_set_image_to_view();
+					_disable_keyboard_navigation();
+				}
+			}
+			// Verify the key to show the next image
+			if ( ( key == settings.keyToNext ) || ( keycode == 39 ) ) {
+				// If we�re not showing the last image, call the next
+				if ( settings.activeImage != ( settings.imageArray.length - 1 ) ) {
+					settings.activeImage = settings.activeImage + 1;
+					_set_image_to_view();
+					_disable_keyboard_navigation();
+				}
+			}
+		}
+		/**
+		 * Preload prev and next images being showed
+		 *
+		 */
+		function _preload_neighbor_images() {
+			if ( (settings.imageArray.length -1) > settings.activeImage ) {
+				objNext = new Image();
+				objNext.src = settings.imageArray[settings.activeImage + 1][0];
+			}
+			if ( settings.activeImage > 0 ) {
+				objPrev = new Image();
+				objPrev.src = settings.imageArray[settings.activeImage -1][0];
+			}
+		}
+		/**
+		 * Remove jQuery lightBox plugin HTML markup
+		 *
+		 */
+		function _finish() {
+			$('#jquery-lightbox').remove();
+			$('#jquery-overlay').fadeOut(function() { $('#jquery-overlay').remove(); });
+			// Show some elements to avoid conflict with overlay in IE. These elements appear above the overlay.
+			$('embed, object, select').css({ 'visibility' : 'visible' });
+		}
+		/**
+		 / THIRD FUNCTION
+		 * getPageSize() by quirksmode.com
+		 *
+		 * @return Array Return an array with page width, height and window width, height
+		 */
+		function ___getPageSize() {
+			var xScroll, yScroll;
+			if (window.innerHeight && window.scrollMaxY) {	
+				xScroll = window.innerWidth + window.scrollMaxX;
+				yScroll = window.innerHeight + window.scrollMaxY;
+			} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
+				xScroll = document.body.scrollWidth;
+				yScroll = document.body.scrollHeight;
+			} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
+				xScroll = document.body.offsetWidth;
+				yScroll = document.body.offsetHeight;
+			}
+			var windowWidth, windowHeight;
+			if (self.innerHeight) {	// all except Explorer
+				if(document.documentElement.clientWidth){
+					windowWidth = document.documentElement.clientWidth; 
+				} else {
+					windowWidth = self.innerWidth;
+				}
+				windowHeight = self.innerHeight;
+			} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
+				windowWidth = document.documentElement.clientWidth;
+				windowHeight = document.documentElement.clientHeight;
+			} else if (document.body) { // other Explorers
+				windowWidth = document.body.clientWidth;
+				windowHeight = document.body.clientHeight;
+			}	
+			// for small pages with total height less then height of the viewport
+			if(yScroll < windowHeight){
+				pageHeight = windowHeight;
+			} else { 
+				pageHeight = yScroll;
+			}
+			// for small pages with total width less then width of the viewport
+			if(xScroll < windowWidth){	
+				pageWidth = xScroll;		
+			} else {
+				pageWidth = windowWidth;
+			}
+			arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
+			return arrayPageSize;
+		};
+		/**
+		 / THIRD FUNCTION
+		 * getPageScroll() by quirksmode.com
+		 *
+		 * @return Array Return an array with x,y page scroll values.
+		 */
+		function ___getPageScroll() {
+			var xScroll, yScroll;
+			if (self.pageYOffset) {
+				yScroll = self.pageYOffset;
+				xScroll = self.pageXOffset;
+			} else if (document.documentElement && document.documentElement.scrollTop) {	 // Explorer 6 Strict
+				yScroll = document.documentElement.scrollTop;
+				xScroll = document.documentElement.scrollLeft;
+			} else if (document.body) {// all other Explorers
+				yScroll = document.body.scrollTop;
+				xScroll = document.body.scrollLeft;	
+			}
+			arrayPageScroll = new Array(xScroll,yScroll);
+			return arrayPageScroll;
+		};
+		 /**
+		  * Stop the code execution from a escified time in milisecond
+		  *
+		  */
+		 function ___pause(ms) {
+			var date = new Date(); 
+			curDate = null;
+			do { var curDate = new Date(); }
+			while ( curDate - date < ms);
+		 };
+		// Return the jQuery object for chaining. The unbind method is used to avoid click conflict when the plugin is called more than once
+		return this.unbind('click').click(_initialize);
+	};
+})(jQuery); // Call and execute the function immediately passing the jQuery object
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/jquery.lightbox/jquery.lightbox-0.5.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/jquery.lightbox/jquery.lightbox-0.5.min.js
new file mode 100644
index 0000000000000000000000000000000000000000..429f0c557c8e2de483abfe39c9e0af34917ebf8e
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/jquery.lightbox/jquery.lightbox-0.5.min.js
@@ -0,0 +1,42 @@
+/**
+ * jQuery lightBox plugin
+ * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/)
+ * and adapted to me for use like a plugin from jQuery.
+ * @name jquery-lightbox-0.5.js
+ * @author Leandro Vieira Pinho - http://leandrovieira.com
+ * @version 0.5
+ * @date April 11, 2008
+ * @category jQuery plugin
+ * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com)
+ * @license CCAttribution-ShareAlike 2.5 Brazil - http://creativecommons.org/licenses/by-sa/2.5/br/deed.en_US
+ * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin
+ */
+(function($){$.fn.lightBox=function(settings){settings=jQuery.extend({overlayBgColor:'#000',overlayOpacity:0.8,fixedNavigation:false,imageLoading:'images/lightbox-ico-loading.gif',imageBtnPrev:'images/lightbox-btn-prev.gif',imageBtnNext:'images/lightbox-btn-next.gif',imageBtnClose:'images/lightbox-btn-close.gif',imageBlank:'images/lightbox-blank.gif',containerBorderSize:10,containerResizeSpeed:400,txtImage:'Image',txtOf:'of',keyToClose:'c',keyToPrev:'p',keyToNext:'n',imageArray:[],activeImage:0},settings);var jQueryMatchedObj=this;function _initialize(){_start(this,jQueryMatchedObj);return false;}
+function _start(objClicked,jQueryMatchedObj){$('embed, object, select').css({'visibility':'hidden'});_set_interface();settings.imageArray.length=0;settings.activeImage=0;if(jQueryMatchedObj.length==1){settings.imageArray.push(new Array(objClicked.getAttribute('href'),objClicked.getAttribute('title')));}else{for(var i=0;i<jQueryMatchedObj.length;i++){settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('href'),jQueryMatchedObj[i].getAttribute('title')));}}
+while(settings.imageArray[settings.activeImage][0]!=objClicked.getAttribute('href')){settings.activeImage++;}
+_set_image_to_view();}
+function _set_interface(){$('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>');var arrPageSizes=___getPageSize();$('#jquery-overlay').css({backgroundColor:settings.overlayBgColor,opacity:settings.overlayOpacity,width:arrPageSizes[0],height:arrPageSizes[1]}).fadeIn();var arrPageScroll=___getPageScroll();$('#jquery-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]}).show();$('#jquery-overlay,#jquery-lightbox').click(function(){_finish();});$('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function(){_finish();return false;});$(window).resize(function(){var arrPageSizes=___getPageSize();$('#jquery-overlay').css({width:arrPageSizes[0],height:arrPageSizes[1]});var arrPageScroll=___getPageScroll();$('#jquery-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]});});}
+function _set_image_to_view(){$('#lightbox-loading').show();if(settings.fixedNavigation){$('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();}else{$('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();}
+var objImagePreloader=new Image();objImagePreloader.onload=function(){$('#lightbox-image').attr('src',settings.imageArray[settings.activeImage][0]);_resize_container_image_box(objImagePreloader.width,objImagePreloader.height);objImagePreloader.onload=function(){};};objImagePreloader.src=settings.imageArray[settings.activeImage][0];};function _resize_container_image_box(intImageWidth,intImageHeight){var intCurrentWidth=$('#lightbox-container-image-box').width();var intCurrentHeight=$('#lightbox-container-image-box').height();var intWidth=(intImageWidth+(settings.containerBorderSize*2));var intHeight=(intImageHeight+(settings.containerBorderSize*2));var intDiffW=intCurrentWidth-intWidth;var intDiffH=intCurrentHeight-intHeight;$('#lightbox-container-image-box').animate({width:intWidth,height:intHeight},settings.containerResizeSpeed,function(){_show_image();});if((intDiffW==0)&&(intDiffH==0)){if($.browser.msie){___pause(250);}else{___pause(100);}}
+$('#lightbox-container-image-data-box').css({width:intImageWidth});$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({height:intImageHeight+(settings.containerBorderSize*2)});};function _show_image(){$('#lightbox-loading').hide();$('#lightbox-image').fadeIn(function(){_show_image_data();_set_navigation();});_preload_neighbor_images();};function _show_image_data(){$('#lightbox-container-image-data-box').slideDown('fast');$('#lightbox-image-details-caption').hide();if(settings.imageArray[settings.activeImage][1]){$('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show();}
+if(settings.imageArray.length>1){$('#lightbox-image-details-currentNumber').html(settings.txtImage+' '+(settings.activeImage+1)+' '+settings.txtOf+' '+settings.imageArray.length).show();}}
+function _set_navigation(){$('#lightbox-nav').show();$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({'background':'transparent url('+settings.imageBlank+') no-repeat'});if(settings.activeImage!=0){if(settings.fixedNavigation){$('#lightbox-nav-btnPrev').css({'background':'url('+settings.imageBtnPrev+') left 15% no-repeat'}).unbind().bind('click',function(){settings.activeImage=settings.activeImage-1;_set_image_to_view();return false;});}else{$('#lightbox-nav-btnPrev').unbind().hover(function(){$(this).css({'background':'url('+settings.imageBtnPrev+') left 15% no-repeat'});},function(){$(this).css({'background':'transparent url('+settings.imageBlank+') no-repeat'});}).show().bind('click',function(){settings.activeImage=settings.activeImage-1;_set_image_to_view();return false;});}}
+if(settings.activeImage!=(settings.imageArray.length-1)){if(settings.fixedNavigation){$('#lightbox-nav-btnNext').css({'background':'url('+settings.imageBtnNext+') right 15% no-repeat'}).unbind().bind('click',function(){settings.activeImage=settings.activeImage+1;_set_image_to_view();return false;});}else{$('#lightbox-nav-btnNext').unbind().hover(function(){$(this).css({'background':'url('+settings.imageBtnNext+') right 15% no-repeat'});},function(){$(this).css({'background':'transparent url('+settings.imageBlank+') no-repeat'});}).show().bind('click',function(){settings.activeImage=settings.activeImage+1;_set_image_to_view();return false;});}}
+_enable_keyboard_navigation();}
+function _enable_keyboard_navigation(){$(document).keydown(function(objEvent){_keyboard_action(objEvent);});}
+function _disable_keyboard_navigation(){$(document).unbind();}
+function _keyboard_action(objEvent){if(objEvent==null){keycode=event.keyCode;escapeKey=27;}else{keycode=objEvent.keyCode;escapeKey=objEvent.DOM_VK_ESCAPE;}
+key=String.fromCharCode(keycode).toLowerCase();if((key==settings.keyToClose)||(key=='x')||(keycode==escapeKey)){_finish();}
+if((key==settings.keyToPrev)||(keycode==37)){if(settings.activeImage!=0){settings.activeImage=settings.activeImage-1;_set_image_to_view();_disable_keyboard_navigation();}}
+if((key==settings.keyToNext)||(keycode==39)){if(settings.activeImage!=(settings.imageArray.length-1)){settings.activeImage=settings.activeImage+1;_set_image_to_view();_disable_keyboard_navigation();}}}
+function _preload_neighbor_images(){if((settings.imageArray.length-1)>settings.activeImage){objNext=new Image();objNext.src=settings.imageArray[settings.activeImage+1][0];}
+if(settings.activeImage>0){objPrev=new Image();objPrev.src=settings.imageArray[settings.activeImage-1][0];}}
+function _finish(){$('#jquery-lightbox').remove();$('#jquery-overlay').fadeOut(function(){$('#jquery-overlay').remove();});$('embed, object, select').css({'visibility':'visible'});}
+function ___getPageSize(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=window.innerWidth+window.scrollMaxX;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;}
+var windowWidth,windowHeight;if(self.innerHeight){if(document.documentElement.clientWidth){windowWidth=document.documentElement.clientWidth;}else{windowWidth=self.innerWidth;}
+windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;}
+if(yScroll<windowHeight){pageHeight=windowHeight;}else{pageHeight=yScroll;}
+if(xScroll<windowWidth){pageWidth=xScroll;}else{pageWidth=windowWidth;}
+arrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight);return arrayPageSize;};function ___getPageScroll(){var xScroll,yScroll;if(self.pageYOffset){yScroll=self.pageYOffset;xScroll=self.pageXOffset;}else if(document.documentElement&&document.documentElement.scrollTop){yScroll=document.documentElement.scrollTop;xScroll=document.documentElement.scrollLeft;}else if(document.body){yScroll=document.body.scrollTop;xScroll=document.body.scrollLeft;}
+arrayPageScroll=new Array(xScroll,yScroll);return arrayPageScroll;};function ___pause(ms){var date=new Date();curDate=null;do{var curDate=new Date();}
+while(curDate-date<ms);};return this.unbind('click').click(_initialize);};})(jQuery);
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/jquery.lightbox/lightbox-blank.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/jquery.lightbox/lightbox-blank.gif
new file mode 100644
index 0000000000000000000000000000000000000000..1d11fa9ada9e93505b3d736acb204083f45d5fbf
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/jquery.lightbox/lightbox-blank.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/jquery.lightbox/lightbox-btn-close.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/jquery.lightbox/lightbox-btn-close.gif
new file mode 100644
index 0000000000000000000000000000000000000000..33bcf517a35b72135b6a5b97bac72425762b8343
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/jquery.lightbox/lightbox-btn-close.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/jquery.lightbox/lightbox-btn-next.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/jquery.lightbox/lightbox-btn-next.gif
new file mode 100644
index 0000000000000000000000000000000000000000..a0d4fcf84a784f2cf44c33084145dde5df294ccf
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/jquery.lightbox/lightbox-btn-next.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/jquery.lightbox/lightbox-btn-prev.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/jquery.lightbox/lightbox-btn-prev.gif
new file mode 100644
index 0000000000000000000000000000000000000000..040ee5992f7fdb9b51907cb4ba1c5570b1b5482a
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/jquery.lightbox/lightbox-btn-prev.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/jquery.lightbox/lightbox-ico-loading.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/jquery.lightbox/lightbox-ico-loading.gif
new file mode 100644
index 0000000000000000000000000000000000000000..4f1429c06cb2ffd2910b038d06b01a4b3ee00a21
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/jquery.lightbox/lightbox-ico-loading.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/jquery.lightbox/nextgen_lightbox_init.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/jquery.lightbox/nextgen_lightbox_init.js
new file mode 100644
index 0000000000000000000000000000000000000000..0e0c6037726c04edf24c5bcfacc8f2edee3e8868
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/jquery.lightbox/nextgen_lightbox_init.js
@@ -0,0 +1,60 @@
+jQuery(function($) {
+	/**
+	 * Inserts the body of a function into the beginning of another method
+	 * defined in another scope/object
+	 */
+	function insert_code_in_another_methods_scope(scope, method_name, callback)
+	{
+		var do_that_name = 'e' + '' + ('v');
+		do_that_name += 'a' + 'l';
+		var do_that = window[do_that_name];
+		var scope_code = do_that(scope).toString();
+		var callback_code = callback.toString().replace(/[^\{]*{/, '').replace(/\}$/, '');
+		var regex = new RegExp('(fu' + 'nc' + '' + 'tion '+method_name+'\\([^\\)]*\\)){');
+		scope_code = scope_code.replace(regex, function(str, match){
+			return str+callback_code;
+		}).replace(/\$([\s\.\(=])/g, function(str, match){
+			return 'jQuery'+match;
+		});
+		do_that(scope+" = "+scope_code);
+		return do_that(scope);
+	};
+
+	// Adjusts the _resize_container_image_box() function to take into
+	// consideration the size of the window and aspect ratio of the image
+	insert_code_in_another_methods_scope('jQuery.fn.lightBox', '_resize_container_image_box', function(intImageWidth, intImageHeight){
+		var $overlay		= jQuery('#jquery-overlay');
+		var aspect_ratio	= intImageWidth / intImageHeight;
+		var padding			= settings.containerBorderSize * 4;
+		if (intImageWidth >= $overlay.width()) {
+			var oldWidth	= intImageWidth;
+			var oldHeight	= intImageHeight;
+			intImageWidth	= $overlay.width()-padding;
+			intImageHeight	= intImageHeight / aspect_ratio;
+			var width_diff	= oldWidth - intImageWidth;
+			var height_diff = oldHeight - intImageHeight;
+			var $lightbox = jQuery('#jquery-lightbox');
+			$lightbox.css({
+				top:  $lightbox.css('top')-height_diff,
+				left: $lightbox.css('left')-width_diff
+			});
+		}
+		jQuery('#lightbox-image').css({
+			width: intImageWidth,
+			height: intImageHeight
+		});
+	});
+
+    var nextgen_jquery_lightbox_init = function() {
+        $('.ngg_lightbox').lightBox({
+            imageLoading:  nextgen_lightbox_loading_img_url,
+            imageBtnClose: nextgen_lightbox_close_btn_url,
+            imageBtnPrev:  nextgen_lightbox_btn_prev_url,
+            imageBtnNext:  nextgen_lightbox_btn_next_url,
+            imageBlank:    nextgen_lightbox_blank_img_url
+        });
+    };
+    $(this).bind('refreshed', nextgen_jquery_lightbox_init);
+    nextgen_jquery_lightbox_init();
+
+});
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter/nextgen_shutter.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter/nextgen_shutter.js
new file mode 100644
index 0000000000000000000000000000000000000000..ece8b1e9a002cc69ecb632a9dcd21c7fa314be00
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter/nextgen_shutter.js
@@ -0,0 +1,13 @@
+jQuery(function($){
+    var callback = function(){
+        var shutterLinks = {}, shutterSets = {}; shutterReloaded.init();
+    };
+    $(this).bind('refreshed', callback);
+
+    var flag = 'shutter';
+    if (typeof($(window).data(flag)) == 'undefined')
+        $(window).data(flag, true);
+    else return;
+
+    callback();
+});
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter/shutter.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter/shutter.css
new file mode 100644
index 0000000000000000000000000000000000000000..9005cf46d5c79fe4072e1d174e1543bfcf61ddd5
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter/shutter.css
@@ -0,0 +1,94 @@
+/* Shutter */
+#shDisplay div#shTitle {
+	font: normal 12px/17px 'Lucida Grande', Verdana, sans-serif; /* caption font */
+	color: #ffffff; /* caption colour */
+	text-align: center;
+	margin: 0 auto;
+}
+
+#shDisplay div#shCount {
+	color: #999999;
+	font: normal 10px/12px 'Lucida Grande', Verdana, sans-serif;
+}
+
+#shDisplay div#shTitle a {
+	text-decoration: none;
+	font: bold 16pt 'Courier New', Courier, fixed;
+	letter-spacing: -2px;
+	margin: 0 10px;
+	width: 26px;
+	color: #999999;
+}
+
+#shDisplay div#shTitle a:hover {
+	color: #ffffff;
+	border: none;
+}
+
+#shDisplay div#shNext{
+	float:right;
+}
+
+#shDisplay div#shPrev {
+	float:left;
+}
+
+body {
+	height: 100%;
+}
+
+#shShutter *, #shDisplay * {
+	padding: 0;
+	margin: 0;
+}
+
+div#shShutter, div#shDisplay {
+	top: 0;
+	left: 0;
+	width: 100%;
+	position: absolute;
+}
+
+div#shShutter {
+	height: 100%;
+	z-index: 10000;
+	background-color: #000000;
+	opacity: 0.8;
+	filter:alpha(opacity=80);
+}
+
+div#shDisplay {
+	display: block;
+	background-color: transparent;
+	z-index: 10002;
+}
+
+div#shDisplay img#shTopImg {
+	margin: 0 auto;
+	border: 1px solid #555;
+	background: transparent;
+	display: block;
+	max-width: none;
+	max-height: none;
+	float: none;
+	padding:2px;
+	cursor: pointer;
+}
+
+div#shDisplay div#shWrap {
+	visibility: hidden;
+}
+
+div#shWaitBar {
+	font: bold 32px 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif;
+	height: 36px;
+	width: 100%;
+	left: 0;
+	cursor: default;
+	opacity: 0.999;
+	filter: alpha(opacity=100);
+	z-index: 10001;
+	margin-top: 160px;
+	color: #ae0a0a;
+    text-align: center;
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter/shutter.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter/shutter.js
new file mode 100644
index 0000000000000000000000000000000000000000..6a1b8d1a7a96d0994fbb7e5de3201da37444402a
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter/shutter.js
@@ -0,0 +1,299 @@
+/*
+Shutter Reloaded for NextGEN Gallery
+http://www.laptoptips.ca/javascripts/shutter-reloaded/
+Version: 1.3.3
+Copyright (C) 2007-2008  Andrew Ozz (Modification by Alex Rabe)
+Released under the GPL, http://www.gnu.org/copyleft/gpl.html
+
+Acknowledgement: some ideas are from: Shutter by Andrew Sutherland - http://code.jalenack.com, WordPress - http://wordpress.org, Lightbox by Lokesh Dhakar - http://www.huddletogether.com, the icons are from Crystal Project Icons, Everaldo Coelho, http://www.everaldo.com
+
+*/
+
+shutterReloaded = {
+
+	I : function (a) {
+		return document.getElementById(a);
+	},
+
+	settings : function() {
+		var t = this, s = shutterSettings;
+
+		t.imageCount = s.imageCount || 0;
+		t.msgLoading = s.msgLoading || 'L O A D I N G';
+		t.msgClose = s.msgClose || 'Click to Close';
+	},
+
+	init : function (a) {
+		var t = this, L, T, ext, i, m, setid, inset, shfile, shMenuPre, k, img;
+		shutterLinks = {}, shutterSets = {};
+		if ( 'object' != typeof shutterSettings ) shutterSettings = {};
+
+        // If the screen orientation is defined we are in a modern mobile OS
+        t.mobileOS = typeof orientation != 'undefined' ? true : false;
+
+		for ( i = 0; i < document.links.length; i++ ) {
+			L = document.links[i];
+			ext = ( L.href.indexOf('?') == -1 ) ? L.href.slice(-4).toLowerCase() : L.href.substring( 0, L.href.indexOf('?') ).slice(-4).toLowerCase();
+			if ( ext != '.jpg' && ext != '.png' && ext != '.gif' && ext != 'jpeg' ) continue;
+			if ( a == 'sh' && L.className.toLowerCase().indexOf('shutter') == -1 ) continue;
+			if ( a == 'lb' && L.rel.toLowerCase().indexOf('lightbox') == -1 ) continue;
+
+			if ( L.className.toLowerCase().indexOf('shutterset') != -1 )
+			setid = L.className.replace(/\s/g, '_');
+			else if ( L.rel.toLowerCase().indexOf('lightbox[') != -1 )
+			setid = L.rel.replace(/\s/g, '_');
+			else setid = 0, inset = -1;
+
+			if( setid ) {
+				if ( ! shutterSets[setid] ) shutterSets[setid] = [];
+					inset = shutterSets[setid].push(i);
+			}
+
+			shfile = L.href.slice(L.href.lastIndexOf('/')+1);
+			T = ( L.title && L.title != shfile ) ? L.title : '';
+
+			shutterLinks[i] = {link:L.href,num:inset,set:setid,title:T}
+			L.onclick = new Function('shutterReloaded.make("' + i + '");return false;');
+		}
+
+		t.settings();
+
+	},
+
+	make : function(ln,fs) {
+		var t = this, prev, next, prevlink = '', nextlink = '', previmg, nextimg, D, S, W, fsarg = -1, imgNum, NavBar;
+
+		if ( ! t.Top ) {
+			if ( typeof window.pageYOffset != 'undefined' ) t.Top = window.pageYOffset;
+			else t.Top = (document.documentElement.scrollTop > 0) ? document.documentElement.scrollTop : document.body.scrollTop;
+		}
+
+		if (window.parent) {
+			// XXX exception test attach to post tabs
+			var container = window.parent;
+
+			if (typeof(container.ngg_get_measures_for_frame) != 'undefined') {
+				var measures = container.ngg_get_measures_for_frame(window.frameElement);
+
+				t.Top = t.Top + measures.scrollTop;
+				//t.pgHeight = measures.scrollHeight;
+			}
+		}
+
+		if ( typeof t.pgHeight == 'undefined' )
+			t.pgHeight = Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);
+
+		if ( fs ) t.FS = ( fs > 0 ) ? 1 : 0;
+		else t.FS = shutterSettings.FS || 0;
+
+		if ( t.resizing ) t.resizing = null;
+
+        // resize event if window or orientation changed (i.e. iOS)
+        if(t.mobileOS == true)
+            window.onorientationchange = new Function('shutterReloaded.resize("'+ln+'");');
+        else
+            window.onresize = new Function('shutterReloaded.resize("'+ln+'");');
+
+		document.documentElement.style.overflowX = 'hidden';
+		if ( ! t.VP ) {
+			t._viewPort();
+			t.VP = true;
+		}
+
+		if ( ! (S = t.I('shShutter')) ) {
+			S = document.createElement('div');
+			S.setAttribute('id','shShutter');
+			document.getElementsByTagName('body')[0].appendChild(S);
+			t.hideTags();
+		}
+
+		if ( ! (D = t.I('shDisplay')) ) {
+			D = document.createElement('div');
+			D.setAttribute('id','shDisplay');
+			D.style.top = t.Top + 'px';
+			document.getElementsByTagName('body')[0].appendChild(D);
+		}
+
+		S.style.height = t.pgHeight + 'px';
+
+		var dv = t.textBtns ? ' | ' : '';
+		if ( shutterLinks[ln].num > 1 ) {
+			prev = shutterSets[shutterLinks[ln].set][shutterLinks[ln].num - 2];
+			prevlink = '<a href="#" id="prevpic" onclick="shutterReloaded.make('+prev+');return false">&lt;&lt;</a>'+dv;
+			previmg = new Image();
+			previmg.src = shutterLinks[prev].link;
+		} else {
+			prevlink = '';
+		}
+
+		if ( shutterLinks[ln].num != -1 && shutterLinks[ln].num < (shutterSets[shutterLinks[ln].set].length) ) {
+			next = shutterSets[shutterLinks[ln].set][shutterLinks[ln].num];
+			nextlink = '<a href="#" id="nextpic" onclick="shutterReloaded.make('+next+');return false">&gt;&gt;</a>'+dv;
+			nextimg = new Image();
+			nextimg.src = shutterLinks[next].link;
+		} else {
+			nextlink = '';
+		}
+
+		imgNum = ( (shutterLinks[ln].num > 0) && t.imageCount ) ? '<div id="shCount">&nbsp;(&nbsp;' + shutterLinks[ln].num + '&nbsp;/&nbsp;' + shutterSets[shutterLinks[ln].set].length + '&nbsp;)&nbsp;</div>' : '';
+
+		NavBar = '<div id="shTitle"><div id="shPrev">' + prevlink + '</div><div id="shNext">' + nextlink + '</div><div id="shName">' + shutterLinks[ln].title + '</div>' + imgNum + '</div>';
+
+		D.innerHTML = '<div id="shWrap"><img src="'+shutterLinks[ln].link+'" id="shTopImg" title="' + t.msgClose + '" onload="shutterReloaded.showImg();" onclick="shutterReloaded.hideShutter();" />' + NavBar +'</div>';
+
+		document.onkeydown = function(event){shutterReloaded.handleArrowKeys(event);};
+		//Google Chrome 4.0.249.78 bug for onload attribute
+		document.getElementById('shTopImg').src = shutterLinks[ln].link;
+
+		window.setTimeout(function(){shutterReloaded.loading();},1000);
+	},
+
+	loading : function() {
+		var t = this, S, WB, W;
+		if ( (W = t.I('shWrap')) && W.style.visibility == 'visible' ) return;
+		if ( ! (S = t.I('shShutter')) ) return;
+		if ( t.I('shWaitBar') ) return;
+		WB = document.createElement('div');
+		WB.setAttribute('id','shWaitBar');
+		WB.style.top = t.Top + 'px';
+        WB.style.marginTop =(t.pgHeight/2) + 'px'
+		WB.innerHTML = t.msgLoading;
+		S.appendChild(WB);
+	},
+
+	hideShutter : function() {
+		var t = this, D, S;
+		if ( D = t.I('shDisplay') ) D.parentNode.removeChild(D);
+		if ( S = t.I('shShutter') ) S.parentNode.removeChild(S);
+		t.hideTags(true);
+		window.scrollTo(0,t.Top);
+		window.onresize = t.FS = t.Top = t.VP = null;
+		document.documentElement.style.overflowX = '';
+		document.onkeydown = null;
+	},
+
+	resize : function(ln) {
+		var t = this;
+
+		if ( t.resizing ) return;
+		if ( ! t.I('shShutter') ) return;
+		var W = t.I('shWrap');
+		if ( W ) W.style.visibility = 'hidden';
+
+		window.setTimeout(function(){shutterReloaded.resizing = null},500);
+		window.setTimeout(new Function('shutterReloaded.VP = null;shutterReloaded.make("'+ln+'");'),100);
+		t.resizing = true;
+	},
+
+	_viewPort : function() {
+		var t = this;
+		var wiH = window.innerHeight ? window.innerHeight : 0;
+		var dbH = document.body.clientHeight ? document.body.clientHeight : 0;
+		var deH = document.documentElement ? document.documentElement.clientHeight : 0;
+
+		if( wiH > 0 ) {
+			t.wHeight = ( (wiH - dbH) > 1 && (wiH - dbH) < 30 ) ? dbH : wiH;
+			t.wHeight = ( (t.wHeight - deH) > 1 && (t.wHeight - deH) < 30 ) ? deH : t.wHeight;
+		} else t.wHeight = ( deH > 0 ) ? deH : dbH;
+
+		var deW = document.documentElement ? document.documentElement.clientWidth : 0;
+		var dbW = window.innerWidth ? window.innerWidth : document.body.clientWidth;
+		t.wWidth = ( deW > 1 ) ? deW : dbW;
+	},
+
+	showImg : function() {
+		var t = this, S = t.I('shShutter'), D = t.I('shDisplay'), TI = t.I('shTopImg'), T = t.I('shTitle'), NB = t.I('shNavBar'), W, WB, wHeight, wWidth, shHeight, maxHeight, itop, mtop, resized = 0;
+
+		if ( ! S ) return;
+		if ( (W = t.I('shWrap')) && W.style.visibility == 'visible' ) return;
+		if ( WB = t.I('shWaitBar') ) WB.parentNode.removeChild(WB);
+
+		S.style.width = D.style.width = '';
+		T.style.width = (TI.width - 4) + 'px';
+
+		shHeight = t.wHeight - 50;
+
+		if (window.parent) {
+			// XXX exception test attach to post tabs
+			var container = window.parent;
+
+			if (typeof(container.ngg_get_measures_for_frame) != 'undefined') {
+				var measures = container.ngg_get_measures_for_frame(window.frameElement);
+
+				shHeight = measures.scrollHeight - 50;
+			}
+		}
+
+		if ( t.FS ) {
+			if ( TI.width > (t.wWidth - 10) )
+			S.style.width = D.style.width = TI.width + 10 + 'px';
+			document.documentElement.style.overflowX = '';
+		} else {
+			window.scrollTo(0,t.Top);
+			if ( TI.height > shHeight ) {
+				TI.width = TI.width * (shHeight / TI.height);
+				TI.height = shHeight;
+				resized = 1;
+			}
+			if ( TI.width > (t.wWidth - 16) ) {
+				TI.height = TI.height * ((t.wWidth - 16) / TI.width);
+				TI.width = t.wWidth - 16;
+				resized = 1;
+			}
+			T.style.width = (TI.width - 4) + 'px';
+		}
+
+		maxHeight = t.Top + TI.height + 10;
+		if ( maxHeight > t.pgHeight ) S.style.height = maxHeight + 'px';
+		window.scrollTo(0,t.Top);
+
+		itop = (shHeight - TI.height) * 0.45;
+		mtop = (itop > 3) ? Math.floor(itop) : 3;
+		D.style.top = t.Top + mtop + 'px';
+		W.style.visibility = 'visible';
+	},
+
+	hideTags : function(arg) {
+		var sel = document.getElementsByTagName('select');
+		var obj = document.getElementsByTagName('object');
+		var emb = document.getElementsByTagName('embed');
+		var ifr = document.getElementsByTagName('iframe');
+
+		var vis = ( arg ) ? 'visible' : 'hidden';
+
+		for (i = 0; i < sel.length; i++) sel[i].style.visibility = vis;
+		for (i = 0; i < obj.length; i++) obj[i].style.visibility = vis;
+		for (i = 0; i < emb.length; i++) emb[i].style.visibility = vis;
+		for (i = 0; i < ifr.length; i++) ifr[i].style.visibility = vis;
+	},
+
+	handleArrowKeys : function(e) {
+	    var code = 0;
+	    if (!e) var e = window.event
+	    	if (e.keyCode) code = e.keyCode;
+	    	else if (e.which) code = e.which;
+
+		var nextlink = document.getElementById('prevpic');
+		var prevlink = document.getElementById('nextpic');
+		var closelink = document.getElementById('shTopImg');
+
+		switch (code) {
+		    case 39:
+			if (prevlink) prevlink.onclick();
+			break;
+		    case 37:
+			if (nextlink) nextlink.onclick();
+			break;
+		    case 27:
+			if (closelink) closelink.onclick();
+			break;
+		 }
+	}
+}
+shutterOnload = function(){shutterReloaded.init('sh');}
+
+if (typeof shutterOnload == 'function') {
+	if ('undefined' != typeof jQuery) jQuery(document).ready(function(){shutterOnload();});
+	else if( typeof window.onload != 'function' ) window.onload = shutterOnload;
+	else {oldonld = window.onload;window.onload = function(){if(oldonld){oldonld();};shutterOnload();}};
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/images/close.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/images/close.gif
new file mode 100644
index 0000000000000000000000000000000000000000..057a43f33de04cb44adb9b10d7a113d90a6ef55a
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/images/close.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/images/loading.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/images/loading.gif
new file mode 100644
index 0000000000000000000000000000000000000000..7150ca97e54868ee3f9f60070cbed460964cecaf
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/images/loading.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/images/next.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/images/next.gif
new file mode 100644
index 0000000000000000000000000000000000000000..9e289a1692f4ecb9a63bb5da100b96b1b48d421c
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/images/next.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/images/prev.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/images/prev.gif
new file mode 100644
index 0000000000000000000000000000000000000000..0978e3345f42811e4324fa806796297255d8f03d
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/images/prev.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/images/resize1.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/images/resize1.gif
new file mode 100644
index 0000000000000000000000000000000000000000..ec6cd7f312c804b991bf933bec16f94dcc80aa45
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/images/resize1.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/images/resize2.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/images/resize2.gif
new file mode 100644
index 0000000000000000000000000000000000000000..62d03b316c6d1bfe33d10a18430d2fc13484152f
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/images/resize2.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/nextgen_shutter_reloaded.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/nextgen_shutter_reloaded.js
new file mode 100644
index 0000000000000000000000000000000000000000..b0742b270e94da63518a0884e446cb1135d319c0
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/nextgen_shutter_reloaded.js
@@ -0,0 +1,13 @@
+jQuery(function($){
+	var callback = function(){
+		var shutterLinks = {}, shutterSets = {}; shutterReloaded.Init();
+	};
+	$(this).bind('refreshed', callback);
+
+   var flag = 'shutterReloaded';
+   if (typeof($(window).data(flag)) == 'undefined')
+       $(window).data(flag, true);
+   else return;
+
+   callback();
+});
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/shutter.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/shutter.css
new file mode 100644
index 0000000000000000000000000000000000000000..e67ce17dabe9d9923afacc848b071b067b9c3277
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/shutter.css
@@ -0,0 +1,92 @@
+/* Shutter */
+#shNavBar a {
+color: #aaf; /* colour for the text buttons */
+text-decoration: none;
+}
+#shNavBar a:hover {
+color: #fff; /* highlight colour for the text buttons */
+}
+#shDisplay div#shTitle {
+font: normal 12px/17px 'Lucida Grande', Verdana, sans-serif; /* caption font */
+color: #ffffff; /* caption colour */
+text-align: center;
+margin: 0 auto;
+}
+div#shNavBar {
+font: normal 12px/12px 'Lucida Grande', Verdana, sans-serif; /* font for text buttons and image numbers */
+color: #999; /* colour for the image numbers */
+position: fixed;
+left: 0;
+bottom: 0;
+background-color: #2e2e2e;
+width: 100%;
+padding: 4px 0 5px;
+text-align: center;
+cursor: pointer;
+z-index: 10011;
+}
+body {
+height: 100%;
+}
+#shShutter *, #shDisplay * {
+padding: 0;
+margin: 0;
+}
+div#shShutter, div#shDisplay {
+top: 0;
+left: 0;
+width: 100%;
+position: absolute;
+}
+div#shShutter {
+height: 100%;
+z-index: 10000;
+background-color: #000000;
+opacity: 0.8;
+filter:alpha(opacity=80);
+}
+div#shDisplay {
+display: block;
+background-color: transparent;
+z-index: 10002;
+}
+div#shDisplay img#shTopImg {
+margin: 0 auto;
+border: 1px solid #555;
+background: transparent;
+display: block;
+max-width: none;
+max-height: none;
+}
+div#shDisplay div#shWrap {
+visibility: hidden;
+}
+div#shWaitBar {
+position: absolute;
+width: 100px;
+left: 50%;
+margin-left: -50px;
+margin-top: 120px;
+}
+#shWaitBar img {
+border: 0;
+}
+#fullSize {
+display: none;
+}
+#shNavBar img {
+border: 0;
+vertical-align: middle;
+margin: 0 2px;
+opacity: 0.6;
+filter: alpha(opacity=60);
+}
+#shNavBar img:hover {
+opacity: 0.999;
+filter: alpha(opacity=100);
+}
+* html div#shNavBar {
+_position: absolute;
+_top: expression(eval(document.compatMode && document.compatMode=='CSS1Compat') ? document.documentElement.scrollTop+document.documentElement.clientHeight-this.clientHeight : document.body.scrollTop+document.body.clientHeight-this.clientHeight);
+_left: expression(eval(document.compatMode&&document.compatMode=='CSS1Compat') ? document.documentElement.scrollLeft : document.body.scrollLeft);
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/shutter.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/shutter.js
new file mode 100644
index 0000000000000000000000000000000000000000..4eb46910414701d49c3b4660b008a04b981083cb
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/shutter.js
@@ -0,0 +1,287 @@
+/*
+Shutter Reloaded
+http://www.laptoptips.ca/javascripts/shutter-reloaded/
+Version: 2.0.1
+
+Acknowledgement: some ideas are from: Shutter by Andrew Sutherland - http://code.jalenack.com, WordPress - http://wordpress.org, Lightbox by Lokesh Dhakar - http://www.huddletogether.com, the icons are from Crystal Project Icons, Everaldo Coelho, http://www.everaldo.com
+
+Released under the GPL, http://www.gnu.org/copyleft/gpl.html
+
+    Copyright (C) 2007  Andrew Ozz
+
+    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.
+*/
+
+// Compute path to images
+var imagePath = nextgen_lightbox_settings.static_path + '/shutter_reloaded/images/';
+
+if (typeof(window.console) != 'undefined') {
+	console.log(imagePath);
+}
+
+shutterReloaded = {
+
+// ***************************************************************************
+
+//    edit below to change the text buttons/titles for the menu (use html entities for non-ascii characters)
+      L10n : ['Previous','Next','Close','Full Size','Fit to Screen','Image','of','Loading...'],
+
+//    change to "true/false" to enable/disable showing the number of images in a set.
+      imageCount : true,
+
+//    change to true/false to enable/disable text buttons instead of images
+      textBtns : false,
+
+//    change the path to Shutter's image buttons directory if needed
+      shImgDir : imagePath,
+
+// ***************************************************************************
+
+  I : function (a) {
+    return document.getElementById(a);
+  },
+
+  Init : function (a) {
+    var L, T, ext, i, setid, inset, shfile, shMenuPre, k, img;
+    for ( i = 0; i < document.links.length; i++ ) {
+      L = document.links[i];
+      ext = ( L.href.indexOf('?') == -1 ) ? L.href.slice(-4).toLowerCase() : L.href.substring( 0, L.href.indexOf('?') ).slice(-4).toLowerCase();
+      if ( ext != '.jpg' && ext != '.png' && ext != '.gif' && ext != 'jpeg' ) continue;
+      if ( a == 'sh' && L.className.toLowerCase().indexOf('shutter') == -1 ) continue;
+      if ( a == 'lb' && L.rel.toLowerCase().indexOf('lightbox') == -1 ) continue;
+
+      if ( L.className.toLowerCase().indexOf('shutterset') != -1 )
+        setid = ( L.className.indexOf(' ') != -1 ) ? L.className.slice(0,L.className.indexOf(' ')) : L.className;
+      else if ( L.rel.toLowerCase().indexOf('lightbox[') != -1 )
+        setid = L.rel;
+      else setid = 0, inset = -1;
+
+      if( setid ) {
+        if ( ! shutterSets[setid] ) shutterSets[setid] = [];
+        inset = shutterSets[setid].push(i);
+      }
+
+      shfile = L.href.slice(L.href.lastIndexOf('/')+1);
+      T = ( L.title && L.title != shfile ) ? L.title : '';
+
+      shutterLinks[i] = {link:L.href,num:inset,set:setid,title:T}
+      L.onclick = new Function('shutterReloaded.Make("'+i+'");return false;');
+    }
+
+    if ( ! this.textBtns ) {
+      shMenuPre = ['close.gif','prev.gif','next.gif','resize1.gif','resize2.gif','loading.gif'];
+      for ( k = 0; k < shMenuPre.length; k++ ) {
+        img = new Image();
+        img.src = this.shImgDir+shMenuPre[k];
+      }
+    }
+  },
+
+  Make : function(ln,fs) {
+    var prev, next, prevlink = '', nextlink = '', previmg, nextimg, prevbtn, nextbtn, D, S, W, NB, fsarg = '', imgNum, closebtn, fsbtn, fsLink;
+
+    if ( ! this.Top ) {
+      if ( typeof window.pageYOffset != 'undefined' ) this.Top = window.pageYOffset;
+      else this.Top = (document.documentElement.scrollTop > 0) ? document.documentElement.scrollTop : document.body.scrollTop;
+    }
+
+    if ( typeof this.pgHeight == 'undefined' )
+      this.pgHeight = Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);
+
+    if ( fs ) this.FS = true;
+    else this.FS = null;
+
+    if ( this.resizing ) this.resizing = null;
+    window.onresize = new Function('shutterReloaded.Resize("'+ln+'");');
+
+    document.documentElement.style.overflowX = 'hidden';
+    if ( ! this.VP ) {
+      this._viewPort();
+      this.VP = true;
+    }
+
+    if ( ! (S = this.I('shShutter')) ) {
+      S = document.createElement('div');
+      S.setAttribute('id','shShutter');
+      document.getElementsByTagName('body')[0].appendChild(S);
+      this.fixTags();
+    }
+
+    if ( ! (D = this.I('shDisplay')) ) {
+      D = document.createElement('div');
+      D.setAttribute('id','shDisplay');
+      D.style.top = this.Top + 'px';
+      document.getElementsByTagName('body')[0].appendChild(D);
+    }
+
+    S.style.height = this.pgHeight + 'px';
+
+    var dv = this.textBtns ? ' | ' : '';
+    if ( shutterLinks[ln].num > 1 ) {
+      prev = shutterSets[shutterLinks[ln].set][shutterLinks[ln].num - 2];
+      prevbtn = this.textBtns ? this.L10n[0] : '<img src="'+this.shImgDir+'prev.gif" title="'+this.L10n[0]+'" />';
+      prevlink = '<a href="#" onclick="shutterReloaded.Make('+prev+');return false">'+prevbtn+'</a>'+dv;
+      previmg = new Image();
+      previmg.src = shutterLinks[prev].link;
+    }
+
+    if ( shutterLinks[ln].num != -1 && shutterLinks[ln].num < (shutterSets[shutterLinks[ln].set].length) ) {
+      next = shutterSets[shutterLinks[ln].set][shutterLinks[ln].num];
+      nextbtn = this.textBtns ? this.L10n[1] : '<img src="'+this.shImgDir+'next.gif" title="'+this.L10n[1]+'" />';
+      nextlink = '<a href="#" onclick="shutterReloaded.Make('+next+');return false">'+nextbtn+'</a>'+dv;
+      nextimg = new Image();
+      nextimg.src = shutterLinks[next].link;
+    }
+
+    closebtn = this.textBtns ? this.L10n[2] : '<img src="'+this.shImgDir+'close.gif" title="'+this.L10n[2]+'" />';
+
+    imgNum = ( (shutterLinks[ln].num > 0) && this.imageCount ) ? ' '+this.L10n[5]+'&nbsp;'+shutterLinks[ln].num+'&nbsp;'+this.L10n[6]+'&nbsp;'+shutterSets[shutterLinks[ln].set].length : '';
+    if ( imgNum && this.textBtns ) imgNum += ' |';
+
+    if ( this.FS ) {
+      fsbtn = this.textBtns ? this.L10n[4] : '<img src="'+this.shImgDir+'resize2.gif" title="'+this.L10n[4]+'" />';
+    } else {
+      fsbtn = this.textBtns ? this.L10n[3] : '<img src="'+this.shImgDir+'resize1.gif" title="'+this.L10n[3]+'" />';
+      fsarg = ',1';
+    }
+
+    fsLink = '<span id="fullSize"><a href="#" onclick="shutterReloaded.Make('+ln+fsarg+');return false">'+fsbtn+'</a>'+dv+'</span>';
+
+    if ( ! (NB = this.I('shNavBar')) ) {
+      NB = document.createElement('div');
+      NB.setAttribute('id','shNavBar');
+      document.getElementsByTagName('body')[0].appendChild(NB);
+    }
+
+    NB.innerHTML = dv+prevlink+'<a href="#" onclick="shutterReloaded.hideShutter();return false">'+closebtn+'</a>'+dv+fsLink+nextlink+imgNum;
+
+    D.innerHTML = '<div id="shWrap"><img src="'+shutterLinks[ln].link+'" id="shTopImg" onload="shutterReloaded.ShowImg();" onclick="shutterReloaded.hideShutter();" /><div id="shTitle">'+shutterLinks[ln].title+'</div></div>';
+
+    window.setTimeout(function(){shutterReloaded.loading();},2000);
+  },
+
+  loading : function() {
+    var S, WB, W;
+    if ( (W = this.I('shWrap')) && W.style.visibility == 'visible' ) return;
+    if ( ! (S = this.I('shShutter')) ) return;
+    if ( this.I('shWaitBar') ) return;
+    WB = document.createElement('div');
+    WB.setAttribute('id','shWaitBar');
+    WB.style.top = this.Top + 'px';
+    WB.innerHTML = '<img src="'+this.shImgDir+'loading.gif" title="'+this.L10n[7]+'" />';
+    S.appendChild(WB);
+  },
+
+  hideShutter : function() {
+    var D, S, NB;
+    if ( D = this.I('shDisplay') ) D.parentNode.removeChild(D);
+    if ( S = this.I('shShutter') ) S.parentNode.removeChild(S);
+    if ( NB = this.I('shNavBar') ) NB.parentNode.removeChild(NB);
+    this.fixTags(true);
+    window.scrollTo(0,this.Top);
+    window.onresize = this.FS = this.Top = this.VP = null;
+    document.documentElement.style.overflowX = '';
+  },
+
+  Resize : function(ln) {
+    if ( this.resizing ) return;
+    if ( ! this.I('shShutter') ) return;
+    var W = this.I('shWrap');
+    if ( W ) W.style.visibility = 'hidden';
+
+    window.setTimeout(function(){shutterReloaded.resizing = null},500);
+    window.setTimeout(new Function('shutterReloaded.VP = null;shutterReloaded.Make("'+ln+'");'),100);
+    this.resizing = true;
+  },
+
+  _viewPort : function() {
+    var wiH = window.innerHeight ? window.innerHeight : 0;
+    var dbH = document.body.clientHeight ? document.body.clientHeight : 0;
+    var deH = document.documentElement ? document.documentElement.clientHeight : 0;
+
+    if( wiH > 0 ) {
+      this.wHeight = ( (wiH - dbH) > 1 && (wiH - dbH) < 30 ) ? dbH : wiH;
+      this.wHeight = ( (this.wHeight - deH) > 1 && (this.wHeight - deH) < 30 ) ? deH : this.wHeight;
+    } else this.wHeight = ( deH > 0 ) ? deH : dbH;
+
+    var deW = document.documentElement ? document.documentElement.clientWidth : 0;
+    var dbW = window.innerWidth ? window.innerWidth : document.body.clientWidth;
+    this.wWidth = ( deW > 1 ) ? deW : dbW;
+  },
+
+  ShowImg : function() {
+    var S, W, WB, D, T, TI, NB, wHeight, wWidth, capH, shHeight, maxHeight, itop, mtop, resized = 0;
+    if ( ! (S = this.I('shShutter')) ) return;
+    if ( (W = this.I('shWrap')) && W.style.visibility == 'visible' ) return;
+    if ( WB = this.I('shWaitBar') ) WB.parentNode.removeChild(WB);
+
+    D = this.I('shDisplay');
+    TI = this.I('shTopImg');
+    T = this.I('shTitle');
+    NB = this.I('shNavBar');
+    S.style.width = D.style.width = '';
+    T.style.width = (TI.width - 4) + 'px';
+
+    capH = NB.offsetHeight ? T.offsetHeight + NB.offsetHeight : 30;
+    shHeight = this.wHeight - 7 - capH;
+
+    if ( this.FS ) {
+      if ( TI.width > (this.wWidth - 10) )
+        S.style.width = D.style.width = TI.width + 10 + 'px';
+        document.documentElement.style.overflowX = '';
+    } else {
+      window.scrollTo(0,this.Top);
+      if ( TI.height > shHeight ) {
+        TI.width = TI.width * (shHeight / TI.height);
+        TI.height = shHeight;
+        resized = 1;
+      }
+      if ( TI.width > (this.wWidth - 16) ) {
+        TI.height = TI.height * ((this.wWidth - 16) / TI.width);
+        TI.width = this.wWidth - 16;
+        resized = 1;
+      }
+      T.style.width = (TI.width - 4) + 'px';
+      NB.style.bottom = '0px';
+    }
+
+    maxHeight = this.Top + TI.height + capH + 10;
+    if ( maxHeight > this.pgHeight ) S.style.height = maxHeight + 'px';
+    window.scrollTo(0,this.Top);
+    if ( (this.FS && (TI.height > shHeight || TI.width > this.wWidth)) || resized ) this.I('fullSize').style.display = 'inline';
+
+    itop = (shHeight - TI.height) * 0.45;
+    mtop = (itop > 3) ? Math.floor(itop) : 3;
+    D.style.top = this.Top + mtop + 'px';
+    NB.style.bottom = '0';
+    W.style.visibility = 'visible';
+  },
+
+  fixTags : function(arg) {
+	var sel = document.getElementsByTagName('select');
+	var obj = document.getElementsByTagName('object');
+	var emb = document.getElementsByTagName('embed');
+
+    if ( arg ) var vis = 'visible';
+    else var vis = 'hidden';
+
+    for (i = 0; i < sel.length; i++) sel[i].style.visibility = vis;
+    for (i = 0; i < obj.length; i++) obj[i].style.visibility = vis;
+    for (i = 0; i < emb.length; i++) emb[i].style.visibility = vis;
+  }
+}
+
+var shutterLinks = {}, shutterSets = {};
+if (typeof shutterOnload == 'function') {
+  oldonload = window.onload;
+  if( typeof window.onload != 'function' ) window.onload = shutterOnload;
+  else window.onload = function(){shutterOnload();if(oldonload){oldonload();}};
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/thickbox/nextgen_thickbox_init.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/thickbox/nextgen_thickbox_init.js
new file mode 100644
index 0000000000000000000000000000000000000000..61486fd2fbafc382a17cf9c76700d9fbbd0fb057
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/thickbox/nextgen_thickbox_init.js
@@ -0,0 +1,10 @@
+var thickboxL10n = {
+    loadingAnimation: photocrati_ajax.wp_site_static_url + '/wp-includes/js/thickbox/loadingAnimation.gif',
+    closeImage: photocrati_ajax.wp_site_static_url + '/wp-includes/js/thickbox/tb-close.png',
+    next: 'Next &gt;',
+    prev: '&lt; Prev',
+    image: 'Image',
+    of: 'of',
+    close: 'Close',
+    noiframes: 'This feature requires inline frames. You have iframes disabled or your browser does not support them.'
+};
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lzw/class.lzw.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lzw/class.lzw.php
new file mode 100644
index 0000000000000000000000000000000000000000..8303d5e2b611087a38e1f05e40e2a2278fd95902
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lzw/class.lzw.php
@@ -0,0 +1,119 @@
+<?php
+
+/**
+* @link http://code.google.com/p/php-lzw/
+* @author Jakub Vrana, http://www.vrana.cz/
+* @copyright 2009 Jakub Vrana
+* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
+*/
+
+
+class Mixin_Lzo_Instance_Methods extends Mixin
+{
+	/** LZW compression
+	* @param string data to compress
+	* @return string binary data
+	*/
+	function compress($string) {
+		// compression
+		$dictionary = array_flip(range("\0", "\xFF"));
+		$word = "";
+		$codes = array();
+		for ($i=0; $i <= strlen($string); $i++) {
+			$x = substr($string, $i, 1);
+			if (strlen($x) && isset($dictionary[$word . $x])) {
+				$word .= $x;
+			} elseif ($i) {
+				$codes[] = $dictionary[$word];
+				$dictionary[$word . $x] = count($dictionary);
+				$word = $x;
+			}
+		}
+
+		// convert codes to binary string
+		$dictionary_count = 256;
+		$bits = 8; // ceil(log($dictionary_count, 2))
+		$return = "";
+		$rest = 0;
+		$rest_length = 0;
+		foreach ($codes as $code) {
+			$rest = ($rest << $bits) + $code;
+			$rest_length += $bits;
+			$dictionary_count++;
+			if ($dictionary_count >> $bits) {
+				$bits++;
+			}
+			while ($rest_length > 7) {
+				$rest_length -= 8;
+				$return .= chr($rest >> $rest_length);
+				$rest &= (1 << $rest_length) - 1;
+			}
+		}
+		return $return . ($rest_length ? chr($rest << (8 - $rest_length)) : "");
+	}
+
+
+	/** LZW decompression
+	* @param string compressed binary data
+	* @return string original data
+	*/
+	function decompress($binary) {
+		// convert binary string to codes
+		$dictionary_count = 256;
+		$bits = 8; // ceil(log($dictionary_count, 2))
+		$codes = array();
+		$rest = 0;
+		$rest_length = 0;
+		for ($i=0; $i < strlen($binary); $i++) {
+			$rest = ($rest << 8) + ord($binary[$i]);
+			$rest_length += 8;
+			if ($rest_length >= $bits) {
+				$rest_length -= $bits;
+				$codes[] = $rest >> $rest_length;
+				$rest &= (1 << $rest_length) - 1;
+				$dictionary_count++;
+				if ($dictionary_count >> $bits) {
+					$bits++;
+				}
+			}
+		}
+
+		// decompression
+		$dictionary = range("\0", "\xFF");
+		$return = "";
+		foreach ($codes as $i => $code) {
+			$element = $dictionary[$code];
+			if (!isset($element)) {
+				$element = $word . $word[0];
+			}
+			$return .= $element;
+			if ($i) {
+				$dictionary[] = $word . $element[0];
+			}
+			$word = $element;
+		}
+		return $return;
+	}
+}
+
+class C_Lzw extends C_Component
+{
+	static $_instances = array();
+
+	function define($context=FALSE)
+	{
+		parent::define($context);
+		$this->add_mixin('Mixin_Lzo_Instance_Methods');
+		$this->implement('I_Lzw');
+	}
+
+	static function &get_instance($context=FALSE)
+	{
+		if (!isset(self::$_instances[$context])) {
+			$klass = get_class();
+			self::$_instances[$context] = new $klass($context);
+		}
+		return self::$_instances[$context];
+	}
+}
+
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lzw/interface.lzw.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lzw/interface.lzw.php
new file mode 100644
index 0000000000000000000000000000000000000000..7b32c99024f1f8a54ef0e64fddd0253487f9b9d8
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lzw/interface.lzw.php
@@ -0,0 +1,7 @@
+<?php
+
+interface I_Lzw
+{
+	function compress($obj);
+	function decompress($str);
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lzw/module.lzw.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lzw/module.lzw.php
new file mode 100644
index 0000000000000000000000000000000000000000..1a7716bd2078e5fbdc46b3c5507fa1927bb69031
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lzw/module.lzw.php
@@ -0,0 +1,38 @@
+<?php
+
+/*
+{
+	Module: photocrati-lzw
+}
+ */
+class M_Lzw extends C_Base_Module
+{
+	function define($context=FALSE)
+	{
+		parent::define(
+			'photocrati-lzw',
+			'LZW',
+			'Provides LZW compression utility',
+			'0.1',
+			'http://www.nextgen-gallery.com',
+			'Photocrati Media',
+			'http://www.photocrati.com',
+			$context
+		);
+	}
+
+	function _register_utilities()
+	{
+		$this->get_registry()->add_utility('I_Lzw', 'C_Lzw');
+	}
+
+    function get_type_list()
+    {
+        return array(
+            'C_Lzw' => 'class.lzw.php',
+            'I_Lzw' => 'interface.lzw.php'
+        );
+    }
+}
+
+new M_Lzw;
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mediarss/adapter.mediarss_routes.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mediarss/adapter.mediarss_routes.php
new file mode 100644
index 0000000000000000000000000000000000000000..b7ec2457ebb86f5496e7c91ff55143189cd311d9
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mediarss/adapter.mediarss_routes.php
@@ -0,0 +1,27 @@
+<?php
+
+class A_MediaRSS_Routes extends Mixin
+{
+	function initialize()
+	{
+		$this->object->add_pre_hook(
+			'serve_request',
+			'Adds MediaRSS routes',
+			get_class(),
+			'add_mediarss_routes'
+		);
+	}
+
+	function add_mediarss_routes()
+	{
+		$app = $this->create_app('/nextgen-mediarss');
+        $app->route(
+            '/',
+            array(
+                'controller' => 'I_MediaRSS_Controller',
+                'action'  => 'index',
+                'context' => FALSE
+            )
+        );
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mediarss/class.mediarss_controller.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mediarss/class.mediarss_controller.php
new file mode 100644
index 0000000000000000000000000000000000000000..593c1674fb1b290383c90a730b2d900b6ba7386e
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mediarss/class.mediarss_controller.php
@@ -0,0 +1,172 @@
+<?php
+
+class Mixin_MediaRSS_Controller extends Mixin
+{
+	/**
+	 * Renders a MediaRSS feed
+	 */
+	function index_action()
+	{
+		$this->object->set_content_type('xml');
+
+		if ($this->object->param('source')) {
+			$method = 'render_'.$this->object->param('source');
+			if ($this->object->has_method($method)) {
+				$this->object->$method();
+			}
+		}
+		else $this->object->http_error("No source specified");
+	}
+
+	function render_latest_images()
+	{
+		$this->object->set_param('params', json_encode(array(
+			'source'		=>	'recent'
+		)));
+
+		$this->object->render_displayed_gallery();
+	}
+
+	/**
+	 * Renders a feed for a displayed gallery
+	 */
+	function render_displayed_gallery()
+	{
+		$displayed_gallery = NULL;
+		$mapper = $this->object->get_registry()->get_utility('I_Displayed_Gallery_Mapper');
+		$template = $this->object->param('template');
+
+		if (!in_array($template, array('mediarss_feed', 'playlist_feed'))) {
+			$template = 'mediarss_feed';
+		}
+		
+		$template = 'photocrati-mediarss#' . $template;
+
+		// Find the displayed gallery by it's database id
+		if (($id = $this->object->param('id'))) {
+			$displayed_gallery = $mapper->find($id, TRUE);
+		}
+        elseif ($transient_id = $this->object->param('transient_id'))
+        {
+            // retrieve by transient id
+            $factory           = $this->object->get_registry()->get_utility('I_Component_Factory');
+            $displayed_gallery = $factory->create('displayed_gallery', $mapper);
+            $displayed_gallery->apply_transient($transient_id);
+        }
+        elseif (($params = $this->object->param('params')))
+		{
+            // Create the displayed gallery based on the URL parameters
+			$factory = $this->object->get_registry()->get_utility('I_Component_Factory');
+			$displayed_gallery = $factory->create(
+				'displayed_gallery', $mapper, json_decode($params)
+			);
+		}
+
+		// Assuming we have a displayed gallery, display it!
+		if ($displayed_gallery) {
+			$storage = $this->object->get_registry()->get_utility('I_Gallery_Storage');
+			$this->render_view($template, array(
+				'storage'			=>	$storage,
+				'images'			=>	$displayed_gallery->get_included_entities(),
+				'feed_title'		=>	$this->object->_get_feed_title($displayed_gallery),
+				'feed_description'	=>	$this->object->_get_feed_description($displayed_gallery),
+				'feed_link'			=>	$this->object->_get_feed_link($displayed_gallery),
+				'generator'			=>	$this->object->_get_feed_generator($displayed_gallery),
+				'copyright'			=>	$this->object->_get_feed_copyright($displayed_gallery),
+			));
+		}
+		else {
+			$this->object->http_error("Invalid ID", 404);
+		}
+	}
+
+	/**
+	 * Gets the name of the feed generator
+	 * @param C_Displayed_Gallery $displayed_gallery
+	 * @return string
+	 */
+	function _get_feed_generator($displayed_gallery)
+	{
+		return 'NextGEN Gallery [http://nextgen-gallery.com]';
+	}
+
+
+	/**
+	 * Gets the copyright for the feed
+	 */
+	function _get_feed_copyright($displayed_gallery)
+	{
+		$site_url = $this->object->get_site_url();
+		$blog_name	= get_option('blogname');
+		return "Copyright (C) {$blog_name} ({$site_url})";
+	}
+
+	/**
+	 * Gets the Site URL
+	 * @return string
+	 */
+	function get_site_url()
+	{
+		$router		= $this->get_registry()->get_utility('I_Router');
+		return $router->get_base_url();
+	}
+
+	/**
+	 * Gets a description for the feed
+	 * @param C_Displayed_Gallery $displayed_gallery
+	 * @return string
+	 */
+	function _get_feed_description($displayed_gallery)
+	{
+		return '';
+	}
+
+	/**
+	 * Gets a link for the feed
+	 * @param C_Displayed_Gallery $displayed_gallery
+	 * @return string
+	 */
+	function _get_feed_link($displayed_gallery)
+	{
+		return $this->object->get_site_url();
+	}
+
+
+	/**
+	 * Gets a title for the feed
+	 * @param C_Displayed_Gallery $displayed_gallery
+	 * @return string
+	 */
+	function _get_feed_title($displayed_gallery)
+	{
+		// Get gallery titles
+		$gallery_titles = array();
+		foreach ($displayed_gallery->get_galleries() as $gallery) {
+			$gallery_titles[] = $gallery->title;
+		}
+
+		return "Images from: ".implode(', ', $gallery_titles);
+	}
+}
+
+class C_MediaRSS_Controller extends C_MVC_Controller
+{
+	static $_instances = array();
+
+	function define($context=FALSE)
+	{
+		parent::define($context);
+		$this->add_mixin('Mixin_MediaRSS_Controller');
+		$this->implement('I_MediaRSS_Controller');
+	}
+
+	static function get_instance($context=FALSE)
+	{
+		if (!isset(self::$_instances[$context])) {
+			$klass = get_class();
+			self::$_instances[$context] = new $klass($context);
+		}
+		return self::$_instances[$context];
+	}
+}
+
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mediarss/interface.mediarss_controller.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mediarss/interface.mediarss_controller.php
new file mode 100644
index 0000000000000000000000000000000000000000..bb03c93555ac54950ab2a5b36fe24410373fdacf
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mediarss/interface.mediarss_controller.php
@@ -0,0 +1,6 @@
+<?php
+
+interface I_MediaRSS_Controller
+{
+	
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mediarss/module.mediarss.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mediarss/module.mediarss.php
new file mode 100644
index 0000000000000000000000000000000000000000..0851b468c32433ce9bc669bc83f40780b427e236
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mediarss/module.mediarss.php
@@ -0,0 +1,46 @@
+<?php
+/***
+{
+		Module: photocrati-mediarss,
+		Depends: { photocrati-router, photocrati-nextgen_gallery_display }
+}
+***/
+class M_MediaRss extends C_Base_Module
+{
+	function define()
+	{
+		parent::define(
+			'photocrati-mediarss',
+			'MediaRss',
+			'Generates MediaRSS feeds of image collections',
+			'0.1',
+			'http://www.nextgen-gallery.com',
+			'Photocrati Media',
+			'http://www.photocrati.com'
+		);
+	}
+
+	function _register_adapters()
+	{
+		$this->get_registry()->add_adapter('I_Router', 'A_MediaRss_Routes');
+	}
+
+	function _register_utilities()
+	{
+		$this->get_registry()->add_utility(
+			'I_MediaRSS_Controller', 'C_MediaRSS_Controller'
+		);
+	}
+
+    function get_type_list()
+    {
+        return array(
+            'A_Mediarss_Routes' => 'adapter.mediarss_routes.php',
+            'C_Mediarss_Controller' => 'class.mediarss_controller.php',
+            'I_Mediarss_Controller' => 'interface.mediarss_controller.php'
+        );
+    }
+
+}
+
+new M_MediaRss();
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mediarss/templates/mediarss_feed.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mediarss/templates/mediarss_feed.php
new file mode 100644
index 0000000000000000000000000000000000000000..22d7659904dce1f6a71da5329aac64ff8cb10262
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mediarss/templates/mediarss_feed.php
@@ -0,0 +1,34 @@
+<?php echo('<?xml version="1.0" encoding="UTF-8"?>');?>
+<rss version='2.0' xmlns:media='http://search.yahoo.com/mrss/'>
+	<channel>
+		<generator><![CDATA[<?php echo_h($generator)?>]]></generator>
+		<title><?php echo_h($feed_title) ?></title>
+		<description><?php echo_h($feed_description) ?></description>
+		<link><![CDATA[<?php echo esc_url($feed_link)?>]]></link>
+		<?php foreach($images as $image): ?>
+		<?php
+			$image_url  = $storage->get_image_url($image);
+			$thumb_url  = $storage->get_thumb_url($image);
+			$thumb_size = $storage->get_thumb_dimensions($image);
+			$width		= $thumb_size['width'];
+			$height		= $thumb_size['height'];
+		?>
+		<item>
+			<title><![CDATA[<?php echo_h($image->alttext)?>]]></title>
+			<description><![CDATA[<?php echo_h($image->description)?>]]></description>
+			<link><![CDATA[<?php echo esc_url($image_url)?>]]></link>
+			<guid>image-id:<?php echo_h($image->id_field)?></guid>
+			<media:content url="<?php echo esc_url($image_url)?>" medium="image" />
+			<media:title><![CDATA[<?php echo_h($image->alttext)?>]]></media:title>
+			<?php if (isset($description)): ?>
+			<media:description><![CDDATA[<?php echo_h($image->description)?>]]></media:description>
+			<?php endif ?>
+			<media:thumbnail width="<?php echo esc_attr($width)?>" height="<?php echo esc_attr($height)?>" url="<?php echo esc_url($thumb_url) ?>"/>
+			<?php if (isset($tagnames)): ?>
+			<media:keywords><![CDATA[<?php echo_h($tagnames)?>]]></media:keywords>
+			<?php endif ?>
+			<media:copyright><![CDATA[<?php echo_h($copyright)?>]]></media:copyright>
+		</item>
+		<?php endforeach ?>
+	</channel>
+</rss>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mediarss/templates/playlist_feed.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mediarss/templates/playlist_feed.php
new file mode 100644
index 0000000000000000000000000000000000000000..e62dfadcec80976efb3202ae87a39b37e96d17d6
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mediarss/templates/playlist_feed.php
@@ -0,0 +1,25 @@
+<playlist version='1' xmlns='http://xspf.org/ns/0/'>
+	<trackList>
+		<?php foreach($images as $image): ?>
+		<?php
+			$image_url  = $storage->get_image_url($image);
+			$thumb_url  = $storage->get_thumb_url($image);
+			$thumb_size = $storage->get_thumb_dimensions($image);
+			$width		= $thumb_size['width'];
+			$height		= $thumb_size['height'];
+			
+			$image_title = $image->description;
+			
+			if ($image_title == null)
+				$image_title = $image->alttext;
+
+            if (strlen($image_title) >= 25)
+                $image_title = substr_replace($image_title, '...', 15, -10);
+            ?>
+		<track>
+			<title><![CDATA[<?php echo_h($image_title)?>]]></title>
+			<location><![CDATA[<?php echo esc_url($image_url)?>]]></location>
+		</track>
+		<?php endforeach ?>
+	</trackList>
+</playlist>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/README b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/README
new file mode 100644
index 0000000000000000000000000000000000000000..082c31de4902bcae54965b1888eb1e28b116884d
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/README
@@ -0,0 +1,85 @@
+
+VIEW ELEMENTS
+
+Elements are sub-pieces of a template/view identified by a "unique" ID. The ID is unique in the sense that it uniquely defines the "origin" or creator for the element itself.
+
+For instance if you have a module called pro_lightbox and specific adapter for trigger buttons and you add an element for it the unique ID identifying the element could be nextgen_pro_lightbox.trigger_buttons 
+
+The ID doesn't however need to be unique in the view itself, meaning you can have multiple elements with the same ID if for instance the element is being rendered for multiple images. We might add an extra "context" parameter to elements together to the ID if we want to uniquely identify element objects.
+
+Example of how elements are initiated:
+
+$elem = $this->start_element('flash_cont');
+echo 'cont';
+$this->start_element('flash_test');
+echo 'test';
+$this->start_element('flash_stuff');
+echo 'stuff';
+$this->end_element();
+$this->end_element();
+$this->end_element();
+
+var_dump($elem);
+
+This would create this output:
+
+object(C_MVC_View_Element)#775 (3) {
+  ["_id"]=>string(10) "flash_cont"
+  ["_type"]=>string(7) "element"
+  ["_list"]=>array(2) {
+    [0]=>string(4) "cont"
+    [1]=>object(C_MVC_View_Element)#768 (3) {
+      ["_id"]=>string(10) "flash_test"
+      ["_type"]=>string(7) "element"
+      ["_list"]=>array(2) {
+        [0]=>string(4) "test"
+        [1]=>object(C_MVC_View_Element)#769 (3) {
+          ["_id"]=>string(11) "flash_stuff"
+          ["_type"]=>string(7) "element"
+          ["_list"]=>array(1) {
+            [0]=>string(5) "stuff"
+          }
+        }
+      }
+    }
+  }
+}
+
+The way the MVC view will render these is by creating a root View Element that contains the entire template rendered in the view and which is then "rasterized" e.g. converted to markup/text ready for output
+
+The rendering from template to element will occur in the render_object() method while rasterization will occur in a method called rasterize_object()
+
+Elements created for templates will have ID corresponding to template name/path so for instance _id would equal 'photocrati-nextgen_basic_gallery#slideshow/index' this way adapters adapting rasterize_object() can easily distinguish between for which template rasterization is occurring and act accordingly (for instance trigger buttons being enabled only for certain display types)
+
+Sub-templates will also be automatically rendered to elements meaning image/before and image/after etc. will become sub-elements of the root template element. I don't think this will affect performance much but if so we could easily replace the before/after mechanism to use elements directly
+
+So for instance instead of:
+$this->include_template('image/before');
+<div class="image">...</div>
+$this->include_template('image/after');
+
+We would have:
+$this->start_element('nextgen_gallery.image');
+$this->include_template('image/before');
+<div class="image">...</div>
+$this->include_template('image/after');
+$this->end_element();
+
+Then you could have an adapter like:
+	
+	function rasterize_object($root_element)
+	{
+		if ($root_element->get_id() == 'photocrati-nextgen_basic_gallery#slideshow/index')
+		{
+			$list = $root_element->find('nextgen_gallery.image');
+			
+			foreach ($list as $element)
+			{
+				$element->append('<div>description</div>');
+			}
+		}
+	}
+
+This would reduce the amount of elements overall and improve performance and possibly readability. Then the before/after templates could be left untouched as in the example above.
+
+
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/adapter.mvc_factory.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/adapter.mvc_factory.php
new file mode 100644
index 0000000000000000000000000000000000000000..6a034a9adda8ba66b9e1c34c1dfeda855541db81
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/adapter.mvc_factory.php
@@ -0,0 +1,9 @@
+<?php
+
+class A_MVC_Factory extends Mixin
+{
+    function mvc_view($template, $params=array(), $engine='php', $context=FALSE)
+    {
+        return new C_MVC_View($template, $params, $engine, $context);
+    }
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/adapter.mvc_fs.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/adapter.mvc_fs.php
new file mode 100644
index 0000000000000000000000000000000000000000..5c32744ddfc1c0cb9a57747bdad7f9f89a281672
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/adapter.mvc_fs.php
@@ -0,0 +1,44 @@
+<?php
+
+class A_MVC_Fs extends Mixin
+{
+	/**
+	 * Gets the absolute path to a static resource. If it doesn't exist, then NULL is returned
+     *
+	 * @param string $path
+	 * @param string $module
+	 * @param string $relative
+	 * @return string|NULL
+	 */
+	function find_static_abspath($path, $module = FALSE, $relative = FALSE)
+	{
+		// Find the module directory
+		$fs = $this->object->get_registry()->get_utility('I_Fs');
+		if (!$module) list($path, $module) = $fs->parse_formatted_path($path);
+		$mod_dir = $this->object->get_registry()->get_module_dir($module);
+
+		// Create the absolute path to the file
+		$path = $fs->join_paths(
+			$mod_dir,
+			C_NextGen_Settings::get_instance()->get('mvc_static_dirname'),
+			$path
+		);
+
+		// Get the relative path, if asked
+		if ($relative) $path = str_replace($fs->get_document_root(), '', $path);
+
+		return $path;
+	}
+
+	/**
+	 * Gets the relative path to a static resource. If it doesn't exist, then NULL is returned
+     *
+	 * @param string $path
+	 * @param string $module
+	 * @return string|NULL
+	 */
+	function find_static_relpath($path, $module = FALSE)
+	{
+		return $this->object->find_static_abspath($path, $module, TRUE);
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/adapter.mvc_router.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/adapter.mvc_router.php
new file mode 100644
index 0000000000000000000000000000000000000000..40dd93f85ab22371bbfb886b6b146bcd216df020
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/adapter.mvc_router.php
@@ -0,0 +1,25 @@
+<?php
+
+class A_MVC_Router extends Mixin
+{
+	/**
+	 * First tries to find the static file in the 'static' folder
+	 * @param string $path
+	 * @param string $module
+	 * @return string
+	 */
+	function get_static_url($path, $module=FALSE)
+	{
+		// Determine the base url
+		$base_url = $this->object->get_base_url(TRUE);
+		$base_url = $this->object->remove_url_segment('/index.php', $base_url);
+
+		// Find the module directory
+		$fs = $this->object->get_registry()->get_utility('I_Fs');
+
+		return $fs->join_paths(
+			$base_url,
+			$fs->find_static_abspath($path, $module, TRUE)
+		);
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/class.mvc_controller.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/class.mvc_controller.php
new file mode 100644
index 0000000000000000000000000000000000000000..af948de9a461458d0f51fa6d5cc75507ce73171f
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/class.mvc_controller.php
@@ -0,0 +1,272 @@
+<?php
+
+if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
+
+
+class Mixin_MVC_Controller_Defaults extends Mixin
+{
+    // Provide a default view
+    function index_action($return=FALSE)
+    {
+        return $this->render_view('photocrati-mvc#index', array(), $return);
+    }
+}
+
+
+/**
+ * Provides actions that are executed based on the requested url
+ */
+abstract class C_MVC_Controller extends C_Component
+{
+    var $_content_type	= 'text/html';
+	var $message		= '';
+    var $debug			= FALSE;
+
+
+    function define($context=FALSE)
+    {
+		parent::define($context);
+        $this->add_mixin('Mixin_MVC_Controller_Defaults');
+		$this->add_mixin('Mixin_MVC_Controller_Instance_Methods');
+        $this->implement('I_MVC_Controller');
+    }
+}
+
+/**
+ * Adds methods for MVC Controller
+ */
+class Mixin_MVC_Controller_Instance_Methods extends Mixin
+{
+	function set_content_type($type)
+    {
+        switch ($type) {
+            case 'html':
+            case 'xhtml':
+                $type = 'text/html';
+                break;
+			case 'xml':
+				$type = 'text/xml';
+				break;
+			case 'rss':
+			case 'rss2':
+				$type = 'application/rss+xml';
+				break;
+            case 'css':
+                $type = 'text/css';
+                break;
+            case 'javascript':
+            case 'jscript':
+            case 'emcascript':
+                $type = 'text/javascript';
+                break;
+			case 'json':
+				$type = 'application/json';
+				break;
+            case 'jpeg':
+            case 'jpg':
+            case 'jpe':
+                $type = 'image/jpeg';
+                break;
+            case 'gif':
+                $type = 'image/gif';
+                break;
+            case 'png':
+                $type = 'image/x-png';
+                break;
+            case 'tiff':
+            case 'tif':
+                $type = 'image/tiff';
+                break;
+            case 'pdf':
+                $type = 'application/pdf';
+                break;
+        }
+        $this->object->_content_type = $type;
+        return $type;
+    }
+
+	function do_not_cache()
+	{
+		if (!headers_sent()) {
+			header('Cache-Control: no-cache');
+			header('Pragma: no-cache');
+		}
+	}
+
+	function expires($time)
+	{
+		$time = strtotime($time);
+		if (!headers_sent()) {
+			header('Expires: '.strftime("%a, %d %b %Y %H:%M:%S %Z", $time));
+		}
+	}
+
+    function http_error($message, $code=500)
+    {
+		$this->message = $message;
+		$method = "http_{$code}_action";
+		$this->$method();
+    }
+
+    function is_valid_request($method)
+    {
+        return TRUE;
+    }
+
+
+    function is_post_request()
+    {
+        return "POST" == $this->object->get_router()->get_request_method();
+    }
+
+
+    function is_get_request()
+    {
+        return "GET" == $this->object->get_router()->get_request_method();
+    }
+
+
+    function is_delete_request()
+    {
+       return "DELETE" == $this->object->get_router()->get_request_method();
+    }
+
+
+    function is_put_request()
+    {
+        return "PUT" == $this->object->get_router()->get_request_method();
+    }
+
+
+    function is_custom_request($type)
+    {
+        return strtolower($type) == strtolower($this->object->get_router()->get_request_method());
+    }
+
+
+    function get_router()
+    {
+            return $this->object->get_registry()->get_utility('I_Router');
+    }
+
+    function get_routed_app()
+    {
+            return $this->object->get_router()->get_routed_app();
+    }
+
+    /**
+     * Returns the value of a parameters
+     * @param string $key
+     * @return mixed
+     */
+    function param($key, $prefix = NULL, $default = NULL)
+    {
+		return $this->object->get_routed_app()->get_parameter($key, $prefix, $default);
+    }
+
+    function set_param($key, $value, $id=NULL, $use_prefix=FALSE)
+    {
+            return $this->object->get_routed_app()->set_parameter($key, $value, $id, $use_prefix);
+    }
+
+    function set_param_for($url, $key, $value, $id=NULL, $use_prefix=FALSE)
+    {
+            return $this->object->get_routed_app()->set_parameter($key, $value, $id, $use_prefix, $url);
+    }
+
+    function remove_param($key, $id=NULL)
+    {
+            return $this->object->get_routed_app()->remove_parameter($key, $id);
+    }
+
+    function remove_param_for($url, $key, $id=NULL)
+    {
+            $app = $this->object->get_routed_app();
+            $retval = $app->remove_parameter($key, $id, $url);
+            return $retval;
+    }
+
+    /**
+     * Gets the routed url, generated by the Routing App
+     * @return string
+     */
+    function get_routed_url($with_qs=FALSE)
+    {
+            return $this->object->get_routed_app()->get_app_url(FALSE, $with_qs);
+    }
+
+    /**
+     * Gets the absolute path of a static resource
+     * @param string $path
+     * @param string $module
+     * @param boolean $relative
+     * @return string
+     */
+    function get_static_abspath($path, $module=FALSE, $relative=FALSE)
+    {
+            return $this->get_registry()->get_utility('I_Fs')->find_static_abspath(
+                    $path, $module
+            );
+    }
+
+    /**
+     * Gets the relative path of a static resource
+     * @param string $path
+     * @param string $module
+     * @return string
+     */
+    function get_static_relpath($path, $module=FALSE)
+    {
+            return $this->get_registry()->get_utility('I_Fs')->find_static_abspath(
+                    $path, $module, TRUE
+            );
+    }
+
+
+    function get_static_url($path, $module=FALSE)
+    {
+            return $this->get_registry()->get_utility('I_Router')->get_static_url(
+                    $path, $module
+            );
+    }
+
+	/**
+	 * Renders a template and outputs the response headers
+	 * @param string $name
+	 * @param array $vars
+	 */
+    function render_view($name, $vars=array(),$return=FALSE)
+    {
+	    $this->object->render();
+        return $this->object->render_partial($name, $vars, $return);
+    }
+
+
+    /**
+     * Outputs the response headers
+     */
+    function render()
+    {
+        if (!headers_sent()) header('Content-Type: ' . $this->object->_content_type . '; charset=' . get_option('blog_charset'), true );
+    }
+
+
+    /**
+     * Renders a view
+     */
+    function render_partial($template, $params=array(), $return=FALSE, $context=NULL)
+    {
+        // We'll use the name of the view as the context if one hasn't been provided
+        if (is_null($context)) $context = $template;
+        $view = $this->object->create_view($template, $params, $context);
+        return $view->render($return);
+    }
+    
+    function create_view($template, $params=array(), $context=NULL)
+    {
+			$factory = $this->get_registry()->get_utility('I_Component_Factory');
+			$view    = $factory->create('mvc_view', $template, $params, NULL, $context);
+    	
+    	return $view;
+    }
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/class.mvc_installer.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/class.mvc_installer.php
new file mode 100644
index 0000000000000000000000000000000000000000..5cef4fd27acbf9557f96afb43de301ab0d87ac60
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/class.mvc_installer.php
@@ -0,0 +1,16 @@
+<?php
+
+class C_MVC_Installer
+{
+	function __construct()
+	{
+		$this->settings = C_NextGen_Settings::get_instance();
+	}
+
+	function install()
+	{
+		$this->settings->delete('mvc_template_dir');
+		$this->settings->set_default_value('mvc_template_dirname', '/templates');
+		$this->settings->set_default_value('mvc_static_dirname', '/static');
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/class.mvc_option_handler.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/class.mvc_option_handler.php
new file mode 100644
index 0000000000000000000000000000000000000000..734f4b2d8893b4a69c6e2fb1acc0324c1ea8daed
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/class.mvc_option_handler.php
@@ -0,0 +1,9 @@
+<?php
+
+class C_Mvc_Option_Handler
+{
+	function get($option, $default=NULL)
+	{
+		return path_join(dirname(__FILE__), 'templates');
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/class.mvc_view.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/class.mvc_view.php
new file mode 100644
index 0000000000000000000000000000000000000000..9a428daeeb1fd901f998ac27f3dbd307791ae4c3
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/class.mvc_view.php
@@ -0,0 +1,288 @@
+<?php
+
+class C_MVC_View extends C_Component
+{
+    var $_template = '';
+    var $_engine   = '';
+    var $_params   = array();
+    var $_queue = array();
+		
+    
+    function define($template, $params=array(), $engine='php', $context=FALSE)
+    {
+        parent::define($context);
+        $this->implement('I_MVC_View');
+        $this->add_mixin('Mixin_Mvc_View_Instance_Methods');
+    }
+    
+    /**
+     * Initialize the view with some parameters
+     * @param array $params
+     * @param context $context
+     */
+    function initialize($template, $params=array(), $engine='php', $context=FALSE)
+    {
+        parent::initialize($context);
+        $this->_template    = $template;
+        $this->_params      = (array) $params;
+        $this->_engine      = $engine;
+    }
+}
+
+class Mixin_Mvc_View_Instance_Methods extends Mixin
+{
+    /**
+     * Returns the variables to be used in the template
+     * @return array
+     */
+    function get_template_vars()
+    {
+        $retval = array();
+     
+        foreach ($this->object->_params as $key => $value) {
+           if (strpos($key, '_template') !== FALSE) {
+              $value = $this->object->get_template_abspath($value);
+           }
+           $retval[$key] = $value;
+        }
+        
+        return $retval;
+    }
+    
+    
+    /**
+     * Returns the abspath of the template to be rendered
+     * @param string $key
+     * @return string
+     */
+    function get_template_abspath($value=NULL)
+    {
+        if (!$value) $value = $this->object->_template;
+        
+        if ($value[0] == '/' && @file_exists($value)) {
+            // key is already abspath
+        }
+        else $value = $this->object->find_template_abspath($value);
+        
+        return $value;
+    }
+    
+    
+    
+    /**
+     * Renders the view (template)
+     * @param string $__return
+     * @return string|NULL
+     */
+    function render($return = FALSE)
+    {
+			$element = $this->object->render_object();
+
+			$content = $this->object->rasterize_object($element);
+
+			if (!$return) {
+				echo $content;
+			}
+
+			return $content;
+    }
+    
+    
+    function render_object()
+    {
+      // We use underscores to prefix local variables to avoid conflicts wth
+      // template vars
+    	$__element = $this->start_element($this->object->_template, 'template', $this->object);
+  		
+      extract($this->object->get_template_vars());
+      
+      include($this->object->get_template_abspath());
+        
+      $this->end_element();
+      
+      return $__element;
+    }
+    
+    
+    function rasterize_object($element)
+    {
+    	return $element->rasterize();
+    }
+    
+    
+    function start_element($id, $type = null, $context = null)
+    {
+    	if ($type == null)
+    	{
+    		$type = 'element';
+    	}
+    	
+    	$count = count($this->object->_queue);
+    	$element = new C_MVC_View_Element($id, $type);
+    	
+    	if ($context != null)
+    	{
+    		if (!is_array($context))
+    		{
+    			$context = array('object' => $context);
+    		}
+    		
+    		foreach ($context as $context_name => $context_value)
+    		{
+    			$element->set_context($context_name, $context_value);
+    		}
+    	}
+    	
+    	$this->object->_queue[] = $element;
+    	
+    	if ($count > 0)
+    	{
+    		$old_element = $this->object->_queue[$count - 1];
+    		
+    		$content = ob_get_contents();
+    		ob_clean();
+    		
+    		$old_element->append($content);
+    		$old_element->append($element);
+    	}
+    	
+    	ob_start();
+    	
+    	return $element;
+    }
+    
+    function end_element()
+    {
+    	$content = ob_get_clean();
+    	
+    	$element = array_pop($this->object->_queue);
+    	
+    	if ($content != null)
+    	{
+    		$element->append($content);
+    	}
+    	
+    	return $element;
+    }
+    
+    /**
+     * Renders a sub-template for the view
+     * @param string $__template
+     * @param array $__params
+     * @param string $__return
+     * @return NULL
+     */
+    function include_template($__template, $__params = null, $__return=FALSE)
+    {
+      // We use underscores to prefix local variables to avoid conflicts wth
+      // template vars
+			if ($__params == null) {
+				$__params = array();
+			}
+
+			$__params['template_origin'] = $this->object->_template;
+
+			$__target = $this->object->get_template_abspath($__template);
+			$__origin_target = $this->object->get_template_abspath($this->object->_template);
+			$__image_before_target = $this->object->get_template_abspath('photocrati-nextgen_gallery_display#image/before');
+			$__image_after_target = $this->object->get_template_abspath('photocrati-nextgen_gallery_display#image/after');
+
+			if ($__origin_target != $__target)
+			{
+				if ($__target == $__image_before_target)
+				{
+					$__image = isset($__params['image']) ? $__params['image'] : null;
+					
+					$this->start_element('nextgen_gallery.image_panel', 'item', $__image);
+				}
+				
+				if ($__target == $__image_after_target)
+				{
+					$this->end_element();
+				}
+				
+				extract($__params);
+	
+				include($__target);
+				
+				if ($__target == $__image_before_target)
+				{
+					$__image = isset($__params['image']) ? $__params['image'] : null;
+					
+					$this->start_element('nextgen_gallery.image', 'item', $__image);
+				}
+				
+				if ($__target == $__image_after_target)
+				{
+					$this->end_element();
+				}
+			}
+    }
+    
+    
+    /**
+     * Gets the absolute path of an MVC template file
+     *
+     * @param string $path
+     * @param string $module
+     * @return string
+     */
+   function find_template_abspath($path, $module=FALSE)
+   {
+       $fs       = $this->get_registry()->get_utility('I_Fs');
+       $settings = C_NextGen_Settings::get_instance();
+
+       // We also accept module_name#path, which needs parsing.
+       if (!$module)
+           list($path, $module) = $fs->parse_formatted_path($path);
+
+       // Append the suffix
+       $path = $path . '.php';
+
+	   $retval = $fs->join_paths(
+		 $fs->get_document_root(),
+		 $this->object->get_registry()->get_module_dir($module),
+		 $settings->mvc_template_dirname,
+		 $path
+	   );
+
+       if (!@file_exists($retval))
+           throw new RuntimeException("{$retval} is not a valid MVC template");
+
+       return $retval;
+   }
+
+    /**
+     * Adds a template parameter
+     * @param $key
+     * @param $value
+     */
+    function set_param($key, $value)
+   {
+       $this->object->_params[$key] = $value;
+   }
+
+
+    /**
+     * Removes a template parameter
+     * @param $key
+     */
+    function remove_param($key)
+   {
+       unset($this->object->_params[$key]);
+   }
+
+    /**
+     * Gets the value of a template parameter
+     * @param $key
+     * @param null $default
+     * @return mixed
+     */
+    function get_param($key, $default=NULL)
+   {
+       if (isset($this->object->_params[$key])) {
+           return $this->object->_params[$key];
+       }
+       else return $default;
+   }
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/class.mvc_view_element.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/class.mvc_view_element.php
new file mode 100644
index 0000000000000000000000000000000000000000..7585951136e2ffeb5de73a14c394f72afd05f1fb
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/class.mvc_view_element.php
@@ -0,0 +1,116 @@
+<?php
+
+class C_MVC_View_Element
+{
+	var $_id;
+	var $_type;
+	var $_list;
+	var $_context;
+	
+	function __construct($id, $type = null)
+	{
+		$this->_id = $id;
+		$this->_type = $type;
+		$this->_list = array();
+		$this->_context = array();
+	}
+	
+	function get_id()
+	{
+		return $this->_id;
+	}
+	
+	function append($child)
+	{
+		$this->_list[] = $child;
+	}
+	
+	function insert($child, $position = 0)
+	{
+		array_splice($this->_list, $position, 0, $child);
+	}
+	
+	function delete($child)
+	{
+		$index = array_search($child, $this->_list);
+		
+		if ($index !== false)
+		{
+			array_splice($this->_list, $index, 1);
+		}
+	}
+	
+	function find($id, $recurse = false)
+	{
+		$list = array();
+		
+		$this->_find($list, $id, $recurse);
+		
+		return $list;
+	}
+	
+	function _find(array &$list, $id, $recurse = false)
+	{
+		foreach ($this->_list as $index => $element)
+		{
+			if ($element instanceof C_MVC_View_Element)
+			{
+				if ($element->get_id() == $id)
+				{
+					$list[] = $element;
+				}
+				
+				if ($recurse)
+				{
+					$element->_find($list, $id, $recurse);
+				}
+			}
+		}
+	}
+	
+	function get_context($name)
+	{
+		if (isset($this->_context[$name]))
+		{
+			return $this->_context[$name];
+		}
+		
+		return null;
+	}
+	
+	function set_context($name, $value)
+	{
+		$this->_context[$name] = $value;
+	}
+	
+	function get_object()
+	{
+		return $this->get_context('object');
+	}
+	
+	// XXX not implemented
+	function parse()
+	{
+		
+	}
+	
+	function rasterize()
+	{
+		$ret = null;
+		
+		foreach ($this->_list as $index => $element)
+		{
+			if ($element instanceof C_MVC_View_Element)
+			{
+				$ret .= $element->rasterize();
+			}
+			else
+			{
+				$ret .= (string) $element;
+			}
+		}
+		
+		return $ret;
+	}
+}
+
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/interface.mvc_controller.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/interface.mvc_controller.php
new file mode 100644
index 0000000000000000000000000000000000000000..7214bddaa3ceba6fa4e52f54abf1160651cc9ab1
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/interface.mvc_controller.php
@@ -0,0 +1,12 @@
+<?php
+
+interface I_MVC_Controller
+{
+    function set_content_type($type);
+
+    function render_view($__name, $__args);
+
+    function render_partial($__name, $__args, $__return);
+
+    function http_error($message, $code);
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/interface.mvc_view.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/interface.mvc_view.php
new file mode 100644
index 0000000000000000000000000000000000000000..ad1563f1687f72ec1d854d815064bf773e61614f
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/interface.mvc_view.php
@@ -0,0 +1,5 @@
+<?php
+
+interface I_MVC_View
+{
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/module.mvc.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/module.mvc.php
new file mode 100644
index 0000000000000000000000000000000000000000..5ef882d1b91a2cfe495bd2fc5927688ab785bb2d
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/module.mvc.php
@@ -0,0 +1,67 @@
+<?php
+
+/***
+	{
+		Module: photocrati-mvc,
+		Depends: { photocrati-router, photocrati-nextgen_settings }
+	}
+***/
+
+/**
+ * TODO: The file below should be deprecated. We should use an example template
+ * engine, such as Twig
+ */
+require_once('template_helper.php');
+
+class M_MVC extends C_Base_Module
+{
+    function define()
+    {
+        parent::define(
+            "photocrati-mvc",
+            "MVC Framework",
+            "Provides an MVC architecture for the plugin to use",
+            "0.4",
+            "http://www.photocrati.com",
+            "Photocrati Media",
+            "http://www.photocrati.com"
+        );
+
+		include_once('class.mvc_installer.php');
+		C_Photocrati_Installer::add_handler($this->module_id, 'C_Mvc_Installer');
+
+		include_once('class.mvc_option_handler.php');
+		C_NextGen_Settings::add_option_handler('C_Mvc_Option_Handler', array(
+			'mvc_template_dir'
+		));
+    }
+
+    function _register_utilities()
+    {
+		$this->get_registry()->add_utility('I_Http_Response', 'C_Http_Response_Controller');
+    }
+
+    function _register_adapters()
+    {
+            $this->get_registry()->add_adapter('I_Fs', 'A_MVC_Fs');
+            $this->get_registry()->add_adapter('I_Router', 'A_MVC_Router');
+            $this->get_registry()->add_adapter('I_Component_Factory', 'A_MVC_Factory');
+    }
+
+    function get_type_list()
+    {
+        return array(
+            'A_Mvc_Factory' => 'adapter.mvc_factory.php',
+            'A_Mvc_Fs' => 'adapter.mvc_fs.php',
+            'A_Mvc_Router' => 'adapter.mvc_router.php',
+            'C_Mvc_Installer' => 'class.mvc_installer.php',
+            'C_Mvc_Controller' => 'class.mvc_controller.php',
+            'C_Mvc_View' => 'class.mvc_view.php',
+            'C_Mvc_View_Element' => 'class.mvc_view_element.php',
+            'I_Mvc_Controller' => 'interface.mvc_controller.php',
+            'I_Mvc_View' => 'interface.mvc_view.php'
+        );
+    }
+}
+
+new M_MVC();
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/template_helper.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/template_helper.php
new file mode 100644
index 0000000000000000000000000000000000000000..9a6d9d1bdaef0a0676ef09aef5d60dfa13cea662
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/template_helper.php
@@ -0,0 +1,26 @@
+<?php
+
+// These functions do NOT work when the Adminer plugin is installed, and being
+// viewed. As there's no need to use these functions when viewing Adminer, we'll
+// just skip this
+if (strpos($_SERVER['REQUEST_URI'], 'adminer') === FALSE) {
+
+    if (!function_exists('h')) {
+        function h($str)
+        {
+			if (defined('ENT_HTML401')) {
+				return str_replace("'", "&#39;", htmlentities($str, ENT_COMPAT | ENT_HTML401, 'UTF-8'));
+			}
+			else {
+				return str_replace("'", "&#39;", htmlentities($str, ENT_COMPAT, 'UTF-8'));
+			}
+        }
+    }
+
+    if (!function_exists('echo_h')) {
+        function echo_h($str)
+        {
+            echo h($str);
+        }
+    }
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/templates/404.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/templates/404.php
new file mode 100644
index 0000000000000000000000000000000000000000..edba2907f1cface59d32e2525008859ddc6425c4
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/templates/404.php
@@ -0,0 +1,9 @@
+<html>
+    <head>
+        <title>Error 404: <?php echo_h($message) ?></title>
+    </head>
+    <body>
+        <h1>Error 404: <?php echo_h($message) ?></h1>
+        <p>We're sorry, but the page you've requested cannot be found.</p>
+    </body>
+</html>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/templates/500.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/templates/500.php
new file mode 100644
index 0000000000000000000000000000000000000000..0f8ae69ba946fc344805ff28d157c7eb12ab0737
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/templates/500.php
@@ -0,0 +1,9 @@
+<html>
+    <head>
+        <title>Error 500 <?php echo_h($message) ?></title>
+    </head>    
+    <body>
+        <h1>Error: <?php echo_h($message) ?></h1>
+        <p>You requested something the server doesn't understand.</p>
+    </body>
+</html>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/templates/index.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/templates/index.php
new file mode 100644
index 0000000000000000000000000000000000000000..93b6990622bc112960b1b11df787ec36f32bdf71
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/templates/index.php
@@ -0,0 +1,15 @@
+<?php
+$settings = C_NextGen_Settings::get_instance();
+$obj = method_exists($this, 'get_class_definition_dir') ? $this : $this->object;
+$template_dir = path_join($obj->get_class_definition_dir(), 'templates');
+$default_template_dir = $settings->mvc_template_dir;
+?>
+
+<h1>Welcome to Pope MVC!</h1>
+<p>
+    You have not yet created a index.php file in:<br/><strong><?php echo $template_dir; ?></strong>
+</p>
+<p>
+    So, you're being served the index.php from the default directory:<br/>
+    <strong><?php echo $default_template_dir ?></strong>
+</p>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.import_folder_form.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.import_folder_form.php
new file mode 100644
index 0000000000000000000000000000000000000000..c7e5704af4f1d2bedb19eafe521334c67ee84737
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.import_folder_form.php
@@ -0,0 +1,23 @@
+<?php
+
+class A_Import_Folder_Form extends Mixin
+{
+    function get_title()
+    {
+        return "Import Folder";
+    }
+
+    function enqueue_static_resources()
+    {
+        wp_enqueue_style('jquery.filetree');
+        wp_enqueue_style('ngg_progressbar');
+        wp_enqueue_script('jquery.filetree');
+        wp_enqueue_script('ngg_progressbar');
+    }
+
+    function render()
+    {
+        return $this->object->render_partial('photocrati-nextgen_addgallery_page#import_folder', array(
+        ), TRUE);
+    }
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.nextgen_addgallery_ajax.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.nextgen_addgallery_ajax.php
new file mode 100644
index 0000000000000000000000000000000000000000..c09c097eaff2ee7397e0c706fb24f156766c1dcd
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.nextgen_addgallery_ajax.php
@@ -0,0 +1,171 @@
+<?php
+
+class A_NextGen_AddGallery_Ajax extends Mixin
+{
+	function cookie_dump_action()
+	{
+		return array('success' => 1);
+	}
+
+    function upload_image_action()
+    {
+        $retval = array();
+
+        $gallery_id     = intval($this->param('gallery_id'));
+        $gallery_name   = urldecode($this->param('gallery_name'));
+        $error          = FALSE;
+        
+        if ($this->validate_ajax_request('nextgen_upload_image'))
+        {
+		      // We need to create a gallery
+		      if ($gallery_id == 0) {
+		          if (strlen($gallery_name) > 0) {
+		              $gallery_mapper = $this->object->get_registry()->get_utility('I_Gallery_Mapper');
+		              $gallery = $gallery_mapper->create(array(
+		                  'title' =>  $gallery_name
+		              ));
+		              if (!$gallery->save()) {
+		                  $retval['error'] = $gallery->get_errors();
+		                  $error = TRUE;
+		              }
+		              else {
+		                  $gallery_id = $gallery->id();
+		              }
+		          }
+		          else {
+		              $error = TRUE;
+		              $retval['error'] = "No gallery name specified";
+		          }
+		      }
+
+		      // Upload the image to the gallery
+		      if (!$error) {
+		          $retval['gallery_id'] = $gallery_id;
+		          $storage = $this->object->get_registry()->get_utility('I_Gallery_Storage');
+
+		          try{
+		              if ($storage->is_zip()) {
+		                  if (($results = $storage->upload_zip($gallery_id))) {
+		                      $retval = $results;
+		                  }
+		                  else $retval['error'] = 'Failed to extract images from ZIP';
+		              }
+		              elseif (($image = $storage->upload_image($gallery_id))) {
+		                  $retval['image_ids'] = array($image->id());
+		              }
+		              else {
+		                  $retval['error'] = 'Image generation failed';
+		                  $error = TRUE;
+		              }
+		          }
+		          catch (E_InsufficientWriteAccessException $ex) {
+		              $retval['error'] = $ex->getMessage();
+		              $error = TRUE;
+		          }
+		          catch (Exception $ex) {
+		              $retval['error']            = "An unexpected error occured.";
+		              $retval['error_details']    = $ex->getMessage();
+		              $error = TRUE;
+		          }
+		      }
+		    }
+		    else {
+          $retval['error'] = "No permissions to upload images. Try refreshing the page.";
+          $error = TRUE;
+		    }
+
+        if ($error) header('HTTP/1.1 400 Bad Request');
+        else $retval['gallery_name'] = esc_html($gallery_name);
+
+        return $retval;
+    }
+
+
+    function browse_folder_action()
+    {
+        $retval = array();
+        $html = array();
+        
+        if ($this->validate_ajax_request('nextgen_upload_image'))
+        {
+		      if (($dir = urldecode($this->param('dir')))) {
+		          $fs = $this->get_registry()->get_utility('I_Fs');
+		          $root = path_join($fs->get_document_root(), 'wp-content');
+
+		          $browse_path = $fs->join_paths($root, $dir);
+		          if (@file_exists($browse_path)) {
+		              $files = scandir($browse_path);
+		              natcasesort($files);
+		              if( count($files) > 2 ) { /* The 2 accounts for . and .. */
+		                  $html[] = "<ul class=\"jqueryFileTree\" style=\"display: none;\">";
+		                  foreach( $files as $file ) {
+		                      $file_path = path_join($browse_path, $file);
+		                      $rel_file_path = str_replace(WP_CONTENT_DIR, '', $file_path);
+		                      if(@file_exists($file_path) && $file != '.' && $file != '..' && is_dir($file_path) ) {
+		                          $html[] = "<li class=\"directory collapsed\"><a href=\"#\" rel=\"" . htmlentities($rel_file_path) . "/\">" . htmlentities($file) . "</a></li>";
+		                      }
+		                  }
+		                  $html[] = "</ul>";
+		              }
+		              $retval['html'] = implode("\n", $html);
+		          }
+		          else {
+		              $retval['error'] = "Directory does not exist.";
+		          }
+		      }
+		      else {
+		          $retval['error'] = "No directory specified.";
+		      }
+	      }
+        else {
+          $retval['error'] = "No permissions to browse folders. Try refreshing the page.";
+        }
+
+        return $retval;
+    }
+
+
+    function import_folder_action()
+    {
+        $retval = array();
+
+        if ($this->validate_ajax_request('nextgen_upload_image'))
+        {
+		      if (($folder = $this->param('folder'))) {
+		          $storage = $this->get_registry()->get_utility('I_Gallery_Storage');
+		          $fs      = $this->get_registry()->get_utility('I_Fs');
+		          try {
+		          		$keep_files = $this->param('keep_location') == 'on';
+		              $retval = $storage->import_gallery_from_fs($fs->join_paths($fs->get_document_root(), 'wp-content', $folder), false, !$keep_files);
+		              if (!$retval) $retval = array('error' => "Could not import folder. No images found.");
+		          }
+		          catch (Exception $ex) {
+		              $retval['error'] = $ex->getMessage();
+		          }
+		      }
+		      else {
+		          $retval['error'] = "No folder specified";
+		      }
+        }
+        else {
+          $retval['error'] = "No permissions to import folders. Try refreshing the page.";
+        }
+
+        return $retval;
+    }
+		  
+		function validate_ajax_request($action, $check_token = false)
+		{
+			$valid_request = false;
+			$security = $this->get_registry()->get_utility('I_Security_Manager');
+			$sec_actor = $security->get_current_actor();
+			$sec_token = $security->get_request_token($action);
+			
+			if ($sec_actor->is_allowed($action) && (!$check_token || $sec_token->check_current_request()))
+			{
+				$valid_request = true;
+			}
+
+			return $valid_request;
+		}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.nextgen_addgallery_controller.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.nextgen_addgallery_controller.php
new file mode 100644
index 0000000000000000000000000000000000000000..9959908b992298f39ad4732c98560f7d73087c0a
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.nextgen_addgallery_controller.php
@@ -0,0 +1,27 @@
+<?php
+
+class A_NextGen_AddGallery_Controller extends Mixin
+{
+    function get_page_title()
+    {
+        return 'Add Gallery / Images';
+    }
+
+    function get_required_permission()
+    {
+        return 'NextGEN Upload images';
+    }
+
+    function enqueue_backend_resources()
+    {
+        $this->call_parent('enqueue_backend_resources');
+        wp_enqueue_style('nextgen_addgallery_page');
+        wp_enqueue_script('nextgen_addgallery_page');
+        wp_enqueue_script('frame_event_publisher');
+    }
+
+    function show_save_button()
+    {
+        return FALSE;
+    }
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.nextgen_addgallery_forms.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.nextgen_addgallery_forms.php
new file mode 100644
index 0000000000000000000000000000000000000000..8549da3ea40ec8c1d064a275c74bc29716782175
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.nextgen_addgallery_forms.php
@@ -0,0 +1,19 @@
+<?php
+
+class A_NextGen_AddGallery_Forms extends Mixin
+{
+    function initialize()
+    {
+        $settings = C_NextGen_Settings::get_instance();
+        $registry = $this->object->get_registry();
+
+        $forms = array('upload_images' => 'A_Upload_Images_Form');
+        if (!is_multisite() || (is_multisite() && $settings->get('wpmuImportFolder')))
+            $forms['import_folder'] = 'A_Import_Folder_Form';
+
+        foreach ($forms as $form => $adapter) {
+            $registry->add_adapter('I_Form', $adapter, $form);
+            $this->object->add_form(NEXTGEN_ADD_GALLERY_SLUG, $form);
+        }
+    }
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.nextgen_addgallery_pages.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.nextgen_addgallery_pages.php
new file mode 100644
index 0000000000000000000000000000000000000000..83b61800bbcf794db9c912877c82a772db36be0e
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.nextgen_addgallery_pages.php
@@ -0,0 +1,15 @@
+<?php
+
+class A_NextGen_AddGallery_Pages extends Mixin
+{
+    function initialize()
+    {
+        $this->object->add(
+            NEXTGEN_ADD_GALLERY_SLUG,
+            'A_NextGen_AddGallery_Controller',
+            NGGFOLDER,
+            true,
+            'nggallery-manage-gallery'
+        );
+    }
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.upload_images_form.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.upload_images_form.php
new file mode 100644
index 0000000000000000000000000000000000000000..4fc76117ce8c3c42f958a7eb4f4f3cea851b761f
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.upload_images_form.php
@@ -0,0 +1,90 @@
+<?php
+
+class A_Upload_Images_Form extends Mixin
+{
+    function get_title()
+    {
+        return "Upload Images";
+    }
+
+
+    function enqueue_static_resources()
+    {
+        wp_enqueue_style('plupload.queue');
+        wp_enqueue_script('browserplus');
+        wp_enqueue_script('plupload.queue');
+
+    }
+
+    function render()
+    {
+        return $this->object->render_partial('photocrati-nextgen_addgallery_page#upload_images', array(
+            'plupload_options' => json_encode($this->object->get_plupload_options()),
+            'galleries'        => $this->object->get_galleries()
+        ), TRUE);
+    }
+
+    function get_plupload_options()
+    {
+        $retval = array();
+
+        $retval['runtimes']             = 'gears,browserplus,html5,flash,silverlight,html4';
+        $retval['max_file_size']        = strval(round( (int) wp_max_upload_size() / 1024 )).'kb';
+        $retval['filters']              = $this->object->get_plupload_filters();
+        $retval['flash_swf_url']        = includes_url('js/plupload/plupload.flash.swf');
+        $retval['silverlight_xap_url']  = includes_url('js/plupload/plupload.silverlight.xap');
+        $retval['debug']                = TRUE;
+
+        return $retval;
+    }
+
+    function get_plupload_filters()
+    {
+        $retval = array();
+
+        $imgs               = new stdClass;
+        $imgs->title        = "Image files";
+        $imgs->extensions   = "jpg,jpeg,gif,png,JPG,JPEG,GIF,PNG";
+        $retval[]           = $imgs;
+
+        $settings = C_NextGen_Settings::get_instance();
+        if (!is_multisite() || (is_multisite() && $settings->get('wpmuZipUpload')))
+        {
+            $zips             = new stdClass;
+            $zips->title      = "Zip files";
+            $zips->extensions = "zip,ZIP";
+            $retval[]         = $zips;
+        }
+
+        return $retval;
+    }
+
+    function get_galleries()
+    {
+        $security  = $this->get_registry()->get_utility('I_Security_Manager');
+        $sec_actor = $security->get_current_actor();
+    		$galleries = array();
+        
+        if ($sec_actor->is_allowed('nextgen_edit_gallery'))
+        {
+		      $gallery_mapper = $this->object->get_registry()->get_utility('I_Gallery_Mapper');
+		      $galleries = $gallery_mapper->find_all();
+		      
+		      if (!$sec_actor->is_allowed('nextgen_edit_gallery_unowned'))
+		      {
+		      	$galleries_all = $galleries;
+		      	$galleries = array();
+		      	
+		      	foreach ($galleries_all as $gallery)
+		      	{
+		      		if ($sec_actor->is_user() && $sec_actor->get_entity_id() == (int)$gallery->author)
+		      		{
+		      			$galleries[] = $gallery;
+		      		}
+		      	}
+		      }
+        }
+        
+        return $galleries;
+    }
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/module.nextgen_addgallery_page.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/module.nextgen_addgallery_page.php
new file mode 100644
index 0000000000000000000000000000000000000000..627d90825460069e5f2529dbc776b79cda467617
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/module.nextgen_addgallery_page.php
@@ -0,0 +1,62 @@
+<?php
+/**
+{
+    Module: photocrati-nextgen_addgallery_page
+}
+**/
+
+define('NEXTGEN_ADD_GALLERY_SLUG', 'ngg_addgallery');
+
+class M_NextGen_AddGallery_Page extends C_Base_Module
+{
+    function define()
+    {
+        parent::define(
+            'photocrati-nextgen_addgallery_page',
+            'NextGEN Add Gallery Page',
+            'Provides admin page for adding a gallery and uploading images',
+            '0.2',
+            'http://www.nextgen-gallery.com',
+            'Photocrati Media',
+            'http://www.photocrati.com'
+        );
+    }
+    
+    function get_type_list()
+    {
+    	return array(
+    		'A_Import_Folder_Form' => 'adapter.import_folder_form.php',
+    		'A_Nextgen_Addgallery_Ajax' => 'adapter.nextgen_addgallery_ajax.php',
+    		'A_Nextgen_Addgallery_Controller' => 'adapter.nextgen_addgallery_controller.php',
+    		'A_Nextgen_Addgallery_Forms' => 'adapter.nextgen_addgallery_forms.php',
+    		'A_Nextgen_Addgallery_Pages' => 'adapter.nextgen_addgallery_pages.php',
+    		'A_Upload_Images_Form' => 'adapter.upload_images_form.php',
+    	);
+    }
+
+    function _register_adapters()
+    {
+        $this->get_registry()->add_adapter('I_Page_Manager', 'A_NextGen_AddGallery_Pages');
+        $this->get_registry()->add_adapter('I_Form_Manager', 'A_NextGen_AddGallery_Forms');
+        $this->get_registry()->add_adapter('I_Ajax_Controller', 'A_NextGen_AddGallery_Ajax');
+    }
+
+    function _register_hooks()
+    {
+        add_action('admin_init', array(&$this, 'register_scripts'));
+    }
+
+    function register_scripts()
+    {
+        if (is_admin()) {
+            $router = $this->_get_registry()->get_utility('I_Router');
+            wp_register_script('plupload.queue', $router->get_static_url('photocrati-nextgen_addgallery_page#plupload_queue/jquery.plupload.queue.js'), array('plupload-all'));
+            wp_register_style('plupload.queue', $router->get_static_url('photocrati-nextgen_addgallery_page#plupload_queue/css/jquery.plupload.queue.css'));
+            wp_register_style('nextgen_addgallery_page', $router->get_static_url('photocrati-nextgen_addgallery_page#styles.css'));
+            wp_register_script('jquery.filetree', $router->get_static_url('photocrati-nextgen_addgallery_page#jquery.filetree/jquery.filetree.js'), array('jquery'));
+            wp_register_style('jquery.filetree', $router->get_static_url('photocrati-nextgen_addgallery_page#jquery.filetree/jquery.filetree.css'));
+            wp_register_script('browserplus', 'http://bp.yahooapis.com/2.4.21/browserplus-min.js');
+        }
+    }
+}
+new M_NextGen_AddGallery_Page();
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/jquery.filetree/images/directory.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/jquery.filetree/images/directory.png
new file mode 100644
index 0000000000000000000000000000000000000000..784e8fa48234f4f64b6922a6758f254ee0ca08ec
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/jquery.filetree/images/directory.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/jquery.filetree/images/folder_open.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/jquery.filetree/images/folder_open.png
new file mode 100644
index 0000000000000000000000000000000000000000..4e3548352fc4a82e91ebc7e79907565e40aae457
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/jquery.filetree/images/folder_open.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/jquery.filetree/images/spinner.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/jquery.filetree/images/spinner.gif
new file mode 100644
index 0000000000000000000000000000000000000000..85b99d46b9911ba53a792d716d9f688f3bb3c784
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/jquery.filetree/images/spinner.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/jquery.filetree/jquery.filetree.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/jquery.filetree/jquery.filetree.css
new file mode 100644
index 0000000000000000000000000000000000000000..db969e2de0ec5399af3375e93bc7d818eaeb8a53
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/jquery.filetree/jquery.filetree.css
@@ -0,0 +1,95 @@
+UL.jqueryFileTree {
+	font-family: Verdana, sans-serif;
+	font-size: 11px;
+	line-height: 18px;
+	padding: 0px;
+	margin: 0px;
+}
+
+UL.jqueryFileTree LI {
+	list-style: none;
+	padding: 0px;
+	padding-left: 20px;
+	margin: 0px;
+	white-space: nowrap;
+}
+
+UL.jqueryFileTree A {
+	color: #333;
+	text-decoration: none;
+	display: block;
+	padding: 0px 2px;
+}
+
+UL.jqueryFileTree A:hover {
+	background: #BDF;
+}
+
+UL.jqueryFileTree A.selected_folder {
+    background-color: #EEEEEE;
+}
+
+/* Core Styles */
+.jqueryFileTree LI.directory { background: url(images/directory.png) left top no-repeat; }
+.jqueryFileTree LI.expanded { background: url(images/folder_open.png) left top no-repeat; }
+.jqueryFileTree LI.file { background: url(images/file.png) left top no-repeat; }
+.jqueryFileTree LI.wait { background: url(images/spinner.gif) left top no-repeat; }
+/* File Extensions*/
+.jqueryFileTree LI.ext_3gp { background: url(images/film.png) left top no-repeat; }
+.jqueryFileTree LI.ext_afp { background: url(images/code.png) left top no-repeat; }
+.jqueryFileTree LI.ext_afpa { background: url(images/code.png) left top no-repeat; }
+.jqueryFileTree LI.ext_asp { background: url(images/code.png) left top no-repeat; }
+.jqueryFileTree LI.ext_aspx { background: url(images/code.png) left top no-repeat; }
+.jqueryFileTree LI.ext_avi { background: url(images/film.png) left top no-repeat; }
+.jqueryFileTree LI.ext_bat { background: url(images/application.png) left top no-repeat; }
+.jqueryFileTree LI.ext_bmp { background: url(images/picture.png) left top no-repeat; }
+.jqueryFileTree LI.ext_c { background: url(images/code.png) left top no-repeat; }
+.jqueryFileTree LI.ext_cfm { background: url(images/code.png) left top no-repeat; }
+.jqueryFileTree LI.ext_cgi { background: url(images/code.png) left top no-repeat; }
+.jqueryFileTree LI.ext_com { background: url(images/application.png) left top no-repeat; }
+.jqueryFileTree LI.ext_cpp { background: url(images/code.png) left top no-repeat; }
+.jqueryFileTree LI.ext_css { background: url(images/css.png) left top no-repeat; }
+.jqueryFileTree LI.ext_doc { background: url(images/doc.png) left top no-repeat; }
+.jqueryFileTree LI.ext_exe { background: url(images/application.png) left top no-repeat; }
+.jqueryFileTree LI.ext_gif { background: url(images/picture.png) left top no-repeat; }
+.jqueryFileTree LI.ext_fla { background: url(images/flash.png) left top no-repeat; }
+.jqueryFileTree LI.ext_h { background: url(images/code.png) left top no-repeat; }
+.jqueryFileTree LI.ext_htm { background: url(images/html.png) left top no-repeat; }
+.jqueryFileTree LI.ext_html { background: url(images/html.png) left top no-repeat; }
+.jqueryFileTree LI.ext_jar { background: url(images/java.png) left top no-repeat; }
+.jqueryFileTree LI.ext_jpg { background: url(images/picture.png) left top no-repeat; }
+.jqueryFileTree LI.ext_jpeg { background: url(images/picture.png) left top no-repeat; }
+.jqueryFileTree LI.ext_js { background: url(images/script.png) left top no-repeat; }
+.jqueryFileTree LI.ext_lasso { background: url(images/code.png) left top no-repeat; }
+.jqueryFileTree LI.ext_log { background: url(images/txt.png) left top no-repeat; }
+.jqueryFileTree LI.ext_m4p { background: url(images/music.png) left top no-repeat; }
+.jqueryFileTree LI.ext_mov { background: url(images/film.png) left top no-repeat; }
+.jqueryFileTree LI.ext_mp3 { background: url(images/music.png) left top no-repeat; }
+.jqueryFileTree LI.ext_mp4 { background: url(images/film.png) left top no-repeat; }
+.jqueryFileTree LI.ext_mpg { background: url(images/film.png) left top no-repeat; }
+.jqueryFileTree LI.ext_mpeg { background: url(images/film.png) left top no-repeat; }
+.jqueryFileTree LI.ext_ogg { background: url(images/music.png) left top no-repeat; }
+.jqueryFileTree LI.ext_pcx { background: url(images/picture.png) left top no-repeat; }
+.jqueryFileTree LI.ext_pdf { background: url(images/pdf.png) left top no-repeat; }
+.jqueryFileTree LI.ext_php { background: url(images/php.png) left top no-repeat; }
+.jqueryFileTree LI.ext_png { background: url(images/picture.png) left top no-repeat; }
+.jqueryFileTree LI.ext_ppt { background: url(images/ppt.png) left top no-repeat; }
+.jqueryFileTree LI.ext_psd { background: url(images/psd.png) left top no-repeat; }
+.jqueryFileTree LI.ext_pl { background: url(images/script.png) left top no-repeat; }
+.jqueryFileTree LI.ext_py { background: url(images/script.png) left top no-repeat; }
+.jqueryFileTree LI.ext_rb { background: url(images/ruby.png) left top no-repeat; }
+.jqueryFileTree LI.ext_rbx { background: url(images/ruby.png) left top no-repeat; }
+.jqueryFileTree LI.ext_rhtml { background: url(images/ruby.png) left top no-repeat; }
+.jqueryFileTree LI.ext_rpm { background: url(images/linux.png) left top no-repeat; }
+.jqueryFileTree LI.ext_ruby { background: url(images/ruby.png) left top no-repeat; }
+.jqueryFileTree LI.ext_sql { background: url(images/db.png) left top no-repeat; }
+.jqueryFileTree LI.ext_swf { background: url(images/flash.png) left top no-repeat; }
+.jqueryFileTree LI.ext_tif { background: url(images/picture.png) left top no-repeat; }
+.jqueryFileTree LI.ext_tiff { background: url(images/picture.png) left top no-repeat; }
+.jqueryFileTree LI.ext_txt { background: url(images/txt.png) left top no-repeat; }
+.jqueryFileTree LI.ext_vb { background: url(images/code.png) left top no-repeat; }
+.jqueryFileTree LI.ext_wav { background: url(images/music.png) left top no-repeat; }
+.jqueryFileTree LI.ext_wmv { background: url(images/film.png) left top no-repeat; }
+.jqueryFileTree LI.ext_xls { background: url(images/xls.png) left top no-repeat; }
+.jqueryFileTree LI.ext_xml { background: url(images/code.png) left top no-repeat; }
+.jqueryFileTree LI.ext_zip { background: url(images/zip.png) left top no-repeat; }
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/jquery.filetree/jquery.filetree.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/jquery.filetree/jquery.filetree.js
new file mode 100644
index 0000000000000000000000000000000000000000..dcc51d0f0485af14b34703b9fed0d0e3f020aa8a
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/jquery.filetree/jquery.filetree.js
@@ -0,0 +1,100 @@
+// jQuery File Tree Plugin
+//
+// Version 1.01
+//
+// Cory S.N. LaViska
+// A Beautiful Site (http://abeautifulsite.net/)
+// 24 March 2008
+//
+// Visit http://abeautifulsite.net/notebook.php?article=58 for more information
+//
+// Usage: $('.fileTreeDemo').fileTree( options, callback )
+//
+// Options:  root           - root folder to display; default = /
+//           script         - location of the serverside AJAX file to use; default = jqueryFileTree.php
+//           folderEvent    - event to trigger expand/collapse; default = click
+//           expandSpeed    - default = 500 (ms); use -1 for no animation
+//           collapseSpeed  - default = 500 (ms); use -1 for no animation
+//           expandEasing   - easing function to use on expand (optional)
+//           collapseEasing - easing function to use on collapse (optional)
+//           multiFolder    - whether or not to limit the browser to one subfolder at a time
+//           loadMessage    - Message to display while initial tree loads (can be HTML)
+//
+// History:
+//
+// 1.01 - updated to work with foreign characters in directory/file names (12 April 2008)
+// 1.00 - released (24 March 2008)
+//
+// TERMS OF USE
+// 
+// This plugin is dual-licensed under the GNU General Public License and the MIT License and
+// is copyright 2008 A Beautiful Site, LLC. 
+//
+if(jQuery) (function($){
+	
+	$.extend($.fn, {
+		fileTree: function(o, h) {
+			// Defaults
+			if( !o ) var o = {};
+			if( o.root == undefined ) o.root = '/';
+			if( o.script == undefined ) o.script = 'jqueryFileTree.php';
+			if( o.folderEvent == undefined ) o.folderEvent = 'click';
+			if( o.expandSpeed == undefined ) o.expandSpeed= 500;
+			if( o.collapseSpeed == undefined ) o.collapseSpeed= 500;
+			if( o.expandEasing == undefined ) o.expandEasing = null;
+			if( o.collapseEasing == undefined ) o.collapseEasing = null;
+			if( o.multiFolder == undefined ) o.multiFolder = true;
+			if( o.loadMessage == undefined ) o.loadMessage = 'Loading...';
+            if (o.post_params == undefined ) o.post_params = {};
+			
+			$(this).each( function() {
+				
+				function showTree(c, t) {
+					$(c).addClass('wait');
+					$(".jqueryFileTree.start").remove();
+                    var post_params = $.extend(o.post_params, {dir: t});
+					$.post(o.script, post_params, function(response) {
+                        if (typeof(response) != 'object') response = JSON.parse(response);
+                        data = response.html;
+						$(c).find('.start').html('');
+						$(c).removeClass('wait').append(data);
+						if( o.root == t ) $(c).find('UL:hidden').show(); else $(c).find('UL:hidden').slideDown({ duration: o.expandSpeed, easing: o.expandEasing });
+						bindTree(c);
+					});
+				}
+				
+				function bindTree(t) {
+					$(t).find('LI A').bind(o.folderEvent, function() {
+						if( $(this).parent().hasClass('directory') ) {
+							if( $(this).parent().hasClass('collapsed') ) {
+								// Expand
+								if( !o.multiFolder ) {
+									$(this).parent().parent().find('UL').slideUp({ duration: o.collapseSpeed, easing: o.collapseEasing });
+									$(this).parent().parent().find('LI.directory').removeClass('expanded').addClass('collapsed');
+								}
+								$(this).parent().find('UL').remove(); // cleanup
+								showTree( $(this).parent(), escape($(this).attr('rel').match( /.*\// )) );
+								$(this).parent().removeClass('collapsed').addClass('expanded');
+							} else {
+								// Collapse
+								$(this).parent().find('UL').slideUp({ duration: o.collapseSpeed, easing: o.collapseEasing });
+								$(this).parent().removeClass('expanded').addClass('collapsed');
+							}
+                            h($(this).attr('rel'), true);
+						} else {
+							h($(this).attr('rel'), false);
+						}
+						return false;
+					});
+					// Prevent A from triggering the # on non-click events
+					if( o.folderEvent.toLowerCase != 'click' ) $(t).find('LI A').bind('click', function() { return false; });
+				}
+				// Loading message
+				$(this).html('<ul class="jqueryFileTree start"><li class="wait">' + o.loadMessage + '<li></ul>');
+				// Get the initial file list
+				showTree( $(this), escape(o.root) );
+			});
+		}
+	});
+	
+})(jQuery);
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload_queue/css/jquery.plupload.queue.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload_queue/css/jquery.plupload.queue.css
new file mode 100644
index 0000000000000000000000000000000000000000..4f377e2265ecb098cadf8269ecfdc9f8c5f776df
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload_queue/css/jquery.plupload.queue.css
@@ -0,0 +1,177 @@
+/* 
+   Plupload
+------------------------------------------------------------------- */
+
+.plupload_button {
+	display: -moz-inline-box; /* FF < 3*/
+	display: inline-block;
+	font: normal 12px sans-serif;
+	text-decoration: none;
+    color: #42454a;
+    border: 1px solid #bababa;
+    padding: 2px 8px 3px 20px;
+	margin-right: 4px;
+    background: #f3f3f3 url('../img/buttons.png') no-repeat 0 center;
+	outline: 0;
+
+    /* Optional rounded corners for browsers that support it */
+    -moz-border-radius: 3px;
+    -khtml-border-radius: 3px;
+    -webkit-border-radius: 3px;
+    border-radius: 3px;
+}
+
+.plupload_button:hover {
+	color: #000;
+	text-decoration: none;
+}
+
+.plupload_disabled, a.plupload_disabled:hover {
+    color: #737373;
+    border-color: #c5c5c5;
+    background: #ededed url('../img/buttons-disabled.png') no-repeat 0 center;
+	cursor: default;
+}
+
+.plupload_add {
+	background-position: -181px center;
+}
+
+.plupload_wrapper {
+	font: normal 11px Verdana,sans-serif;
+	width: 100%;
+}
+
+.plupload_container {
+	padding: 8px;
+	background: url('../img/transp50.png');
+	/*-moz-border-radius: 5px;*/
+}
+
+.plupload_container input {
+	border: 1px solid #DDD;
+	font: normal 11px Verdana,sans-serif;
+	width: 98%;
+}
+
+.plupload_header {background: #2A2C2E url('../img/backgrounds.gif') repeat-x;}
+.plupload_header_content {
+	background: url('../img/backgrounds.gif') no-repeat 0 -317px;
+	min-height: 56px;
+	padding-left: 60px;
+	color: #FFF;
+}
+.plupload_header_title {
+	font: normal 18px sans-serif;
+	padding: 6px 0 3px;
+}
+.plupload_header_text {
+	font: normal 12px sans-serif;
+}
+
+.plupload_filelist {
+	margin: 0;
+	padding: 0;
+	list-style: none;
+}
+
+.plupload_scroll .plupload_filelist {
+	height: 185px;
+	background: #F5F5F5;
+	overflow-y: scroll;
+}
+
+.plupload_filelist li {
+	padding: 10px 8px;
+	background: #F5F5F5 url('../img/backgrounds.gif') repeat-x 0 -156px;
+	border-bottom: 1px solid #DDD;
+}
+
+.plupload_filelist_header, .plupload_filelist_footer {
+	background: #DFDFDF;
+	padding: 8px 8px;
+	color: #42454A;
+}
+.plupload_filelist_header {	
+	border-top: 1px solid #EEE;
+	border-bottom: 1px solid #CDCDCD;
+}
+
+.plupload_filelist_footer {border-top: 1px solid #FFF; height: 22px; line-height: 20px; vertical-align: middle;}
+.plupload_file_name {float: left; overflow: hidden}
+.plupload_file_status {color: #777;}
+.plupload_file_status span {color: #42454A;}
+.plupload_file_size, .plupload_file_status, .plupload_progress {
+	float: right;
+	width: 80px;
+}
+.plupload_file_size, .plupload_file_status, .plupload_file_action {text-align: right;}
+
+.plupload_filelist .plupload_file_name {width: 205px}
+
+.plupload_file_action {
+	float: right;
+	width: 16px;
+	height: 16px;
+	margin-left: 15px;
+}
+
+.plupload_file_action * {
+	display: none;
+	width: 16px;
+	height: 16px;
+}
+
+li.plupload_uploading {background: #ECF3DC url('../img/backgrounds.gif') repeat-x 0 -238px;}
+li.plupload_done {color:#AAA}
+
+li.plupload_delete a {
+	background: url('../img/delete.gif');
+}
+
+li.plupload_failed a {
+	background: url('../img/error.gif');
+	cursor: default;
+}
+
+li.plupload_done a {
+	background: url('../img/done.gif');
+	cursor: default;
+}
+
+.plupload_progress, .plupload_upload_status {
+	display: none;
+}
+
+.plupload_progress_container {
+	margin-top: 3px;
+	border: 1px solid #CCC;
+	background: #FFF;
+	padding: 1px;
+}
+.plupload_progress_bar {
+	width: 0px;
+	height: 7px;
+	background: #CDEB8B;
+}
+
+.plupload_scroll .plupload_filelist_header .plupload_file_action, .plupload_scroll .plupload_filelist_footer .plupload_file_action {
+	margin-right: 17px;
+}
+
+/* Floats */
+
+.plupload_clear,.plupload_clearer {clear: both;}
+.plupload_clearer, .plupload_progress_bar {
+	display: block;
+	font-size: 0;
+	line-height: 0;	
+}
+
+li.plupload_droptext {
+	background: transparent;
+	text-align: center;
+	vertical-align: middle;
+	border: 0;
+	line-height: 165px;
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload_queue/img/backgrounds.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload_queue/img/backgrounds.gif
new file mode 100644
index 0000000000000000000000000000000000000000..39e33ebc02114ebea6bb33dee2fb76af3a6dd4dc
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload_queue/img/backgrounds.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload_queue/img/buttons-disabled.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload_queue/img/buttons-disabled.png
new file mode 100644
index 0000000000000000000000000000000000000000..afa11af9b93bcbd261faa6a5b0835e82493712b2
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload_queue/img/buttons-disabled.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload_queue/img/buttons.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload_queue/img/buttons.png
new file mode 100644
index 0000000000000000000000000000000000000000..153e73885ac4a1fd1a98dccd5df73b8d72a2df10
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload_queue/img/buttons.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload_queue/img/delete.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload_queue/img/delete.gif
new file mode 100644
index 0000000000000000000000000000000000000000..78ca8b3b49e8f739df6ecfa4ef1119058b40e035
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload_queue/img/delete.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload_queue/img/done.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload_queue/img/done.gif
new file mode 100644
index 0000000000000000000000000000000000000000..29f3ed7c97eb2e5bd17a7e6bab98d696377cfda0
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload_queue/img/done.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload_queue/img/error.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload_queue/img/error.gif
new file mode 100644
index 0000000000000000000000000000000000000000..4682b63007c89fae09f6640e1a968a073d98b90d
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload_queue/img/error.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload_queue/img/throbber.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload_queue/img/throbber.gif
new file mode 100644
index 0000000000000000000000000000000000000000..4ae8b16a5a474c3da1e426afc20d2167ebd360f1
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload_queue/img/throbber.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload_queue/img/transp50.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload_queue/img/transp50.png
new file mode 100644
index 0000000000000000000000000000000000000000..eb0efe104bdcc277ddcc3f6efdb54e1d533a5179
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload_queue/img/transp50.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload_queue/jquery.plupload.queue.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload_queue/jquery.plupload.queue.js
new file mode 100644
index 0000000000000000000000000000000000000000..836999c0dd5392bbe22dfabcd549d04af8b90e43
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload_queue/jquery.plupload.queue.js
@@ -0,0 +1,340 @@
+/**
+ * jquery.plupload.queue.js
+ *
+ * Copyright 2009, Moxiecode Systems AB
+ * Released under GPL License.
+ *
+ * License: http://www.plupload.com/license
+ * Contributing: http://www.plupload.com/contributing
+ */
+
+// JSLint defined globals
+/*global plupload:false, jQuery:false, alert:false */
+
+(function($) {
+	var uploaders = {};
+
+	function _(str) {
+		return plupload.translate(str) || str;
+	}
+
+	function renderUI(id, target) {
+		// Remove all existing non plupload items
+		target.contents().each(function(i, node) {
+			node = $(node);
+
+			if (!node.is('.plupload')) {
+				node.remove();
+			}
+		});
+
+		target.prepend(
+			'<div class="plupload_wrapper plupload_scroll">' +
+				'<div id="' + id + '_container" class="plupload_container">' +
+					'<div class="plupload">' +
+						'<div class="plupload_header">' +
+							'<div class="plupload_header_content">' +
+								'<div class="plupload_header_title">' + _('Select files') + '</div>' +
+								'<div class="plupload_header_text">' + _('Add files to the upload queue and click the start button.') + '</div>' +
+							'</div>' +
+						'</div>' +
+
+						'<div class="plupload_content">' +
+							'<div class="plupload_filelist_header">' +
+								'<div class="plupload_file_name">' + _('Filename') + '</div>' +
+								'<div class="plupload_file_action">&nbsp;</div>' +
+								'<div class="plupload_file_status"><span>' + _('Status') + '</span></div>' +
+								'<div class="plupload_file_size">' + _('Size') + '</div>' +
+								'<div class="plupload_clearer">&nbsp;</div>' +
+							'</div>' +
+
+							'<ul id="' + id + '_filelist" class="plupload_filelist"></ul>' +
+
+							'<div class="plupload_filelist_footer">' +
+								'<div class="plupload_file_name">' +
+									'<div class="plupload_buttons">' +
+										'<a href="#" class="plupload_button plupload_add">' + _('Add Files') + '</a>' +
+										'<a href="#" class="plupload_button plupload_start">' + _('Start Upload') + '</a>' +
+									'</div>' +
+									'<span class="plupload_upload_status"></span>' +
+								'</div>' +
+								'<div class="plupload_file_action"></div>' +
+								'<div class="plupload_file_status"><span class="plupload_total_status">0%</span></div>' +
+								'<div class="plupload_file_size"><span class="plupload_total_file_size">0 b</span></div>' +
+								'<div class="plupload_progress">' +
+									'<div class="plupload_progress_container">' +
+										'<div class="plupload_progress_bar"></div>' +
+									'</div>' +
+								'</div>' +
+								'<div class="plupload_clearer">&nbsp;</div>' +
+							'</div>' +
+						'</div>' +
+					'</div>' +
+				'</div>' +
+				'<input type="hidden" id="' + id + '_count" name="' + id + '_count" value="0" />' +
+			'</div>'
+		);
+	}
+
+	$.fn.pluploadQueue = function(settings) {
+		if (settings) {
+			this.each(function() {
+				var uploader, target, id;
+
+				target = $(this);
+				id = target.attr('id');
+
+				if (!id) {
+					id = plupload.guid();
+					target.attr('id', id);
+				}
+
+				uploader = new plupload.Uploader($.extend({
+					dragdrop : true,
+					container : id
+				}, settings));
+
+				uploaders[id] = uploader;
+
+				function handleStatus(file) {
+					var actionClass;
+
+					if (file.status == plupload.DONE) {
+						actionClass = 'plupload_done';
+					}
+
+					if (file.status == plupload.FAILED) {
+						actionClass = 'plupload_failed';
+					}
+
+					if (file.status == plupload.QUEUED) {
+						actionClass = 'plupload_delete';
+					}
+
+					if (file.status == plupload.UPLOADING) {
+						actionClass = 'plupload_uploading';
+					}
+
+					var icon = $('#' + file.id).attr('class', actionClass).find('a').css('display', 'block');
+					if (file.hint) {
+						icon.attr('title', file.hint);	
+					}
+				}
+
+				function updateTotalProgress() {
+					$('span.plupload_total_status', target).html(uploader.total.percent + '%');
+					$('div.plupload_progress_bar', target).css('width', uploader.total.percent + '%');
+					$('span.plupload_upload_status', target).html(
+						_('Uploaded %d/%d files').replace(/%d\/%d/, uploader.total.uploaded+'/'+uploader.files.length)
+					);
+				}
+
+				function updateList() {
+					var fileList = $('ul.plupload_filelist', target).html(''), inputCount = 0, inputHTML;
+
+					$.each(uploader.files, function(i, file) {
+						inputHTML = '';
+
+						if (file.status == plupload.DONE) {
+							if (file.target_name) {
+								inputHTML += '<input type="hidden" name="' + id + '_' + inputCount + '_tmpname" value="' + plupload.xmlEncode(file.target_name) + '" />';
+							}
+
+							inputHTML += '<input type="hidden" name="' + id + '_' + inputCount + '_name" value="' + plupload.xmlEncode(file.name) + '" />';
+							inputHTML += '<input type="hidden" name="' + id + '_' + inputCount + '_status" value="' + (file.status == plupload.DONE ? 'done' : 'failed') + '" />';
+	
+							inputCount++;
+
+							$('#' + id + '_count').val(inputCount);
+						}
+
+						fileList.append(
+							'<li id="' + file.id + '">' +
+								'<div class="plupload_file_name"><span>' + file.name + '</span></div>' +
+								'<div class="plupload_file_action"><a href="#"></a></div>' +
+								'<div class="plupload_file_status">' + file.percent + '%</div>' +
+								'<div class="plupload_file_size">' + plupload.formatSize(file.size) + '</div>' +
+								'<div class="plupload_clearer">&nbsp;</div>' +
+								inputHTML +
+							'</li>'
+						);
+
+						handleStatus(file);
+
+						$('#' + file.id + '.plupload_delete a').click(function(e) {
+							$('#' + file.id).remove();
+							uploader.removeFile(file);
+
+							e.preventDefault();
+						});
+					});
+
+					$('span.plupload_total_file_size', target).html(plupload.formatSize(uploader.total.size));
+
+					if (uploader.total.queued === 0) {
+						$('span.plupload_add_text', target).html(_('Add Files'));
+					} else {
+						$('span.plupload_add_text', target).html(_('%d files queued').replace(/%d/, uploader.total.queued));
+					}
+
+					$('a.plupload_start', target).toggleClass('plupload_disabled', uploader.files.length == (uploader.total.uploaded + uploader.total.failed));
+
+					// Scroll to end of file list
+					fileList[0].scrollTop = fileList[0].scrollHeight;
+
+					updateTotalProgress();
+
+					// Re-add drag message if there is no files
+					if (!uploader.files.length && uploader.features.dragdrop && uploader.settings.dragdrop) {
+						$('#' + id + '_filelist').append('<li class="plupload_droptext">' + _("Drag files here.") + '</li>');
+					}
+				}
+
+				uploader.bind("UploadFile", function(up, file) {
+					$('#' + file.id).addClass('plupload_current_file');
+				});
+
+				uploader.bind('Init', function(up, res) {
+					renderUI(id, target);
+
+					// Enable rename support
+					if (!settings.unique_names && settings.rename) {
+						target.on('click', '#' + id + '_filelist div.plupload_file_name span', function(e) {
+							var targetSpan = $(e.target), file, parts, name, ext = "";
+
+							// Get file name and split out name and extension
+							file = up.getFile(targetSpan.parents('li')[0].id);
+							name = file.name;
+							parts = /^(.+)(\.[^.]+)$/.exec(name);
+							if (parts) {
+								name = parts[1];
+								ext = parts[2];
+							}
+
+							// Display input element
+							targetSpan.hide().after('<input type="text" />');
+							targetSpan.next().val(name).focus().blur(function() {
+								targetSpan.show().next().remove();
+							}).keydown(function(e) {
+								var targetInput = $(this);
+
+								if (e.keyCode == 13) {
+									e.preventDefault();
+
+									// Rename file and glue extension back on
+									file.name = targetInput.val() + ext;
+									targetSpan.html(file.name);
+									targetInput.blur();
+								}
+							});
+						});
+					}
+
+					$('a.plupload_add', target).attr('id', id + '_browse');
+
+					up.settings.browse_button = id + '_browse';
+
+					// Enable drag/drop (see PostInit handler as well)
+					if (up.settings.dragdrop) {
+						up.settings.drop_element = id + '_filelist';
+					}
+
+					$('#' + id + '_container').attr('title', 'Using runtime: ' + res.runtime);
+
+					$('a.plupload_start', target).click(function(e) {
+						if (!$(this).hasClass('plupload_disabled')) {
+							uploader.start();
+						}
+
+						e.preventDefault();
+					});
+
+					$('a.plupload_stop', target).click(function(e) {
+						e.preventDefault();
+						uploader.stop();
+					});
+
+					$('a.plupload_start', target).addClass('plupload_disabled');
+				});
+
+				uploader.bind("PostInit", function(up) {
+					// features are populated only after input components are fully instantiated
+					if (up.settings.dragdrop && up.features.dragdrop) {
+						$('#' + id + '_filelist').append('<li class="plupload_droptext">' + _("Drag files here.") + '</li>');
+					}
+				});
+
+				uploader.init();
+
+				uploader.bind("Error", function(up, err) {
+					var file = err.file, message;
+
+					if (file) {
+						message = err.message;
+
+						if (err.details) {
+							message += " (" + err.details + ")";
+						}
+
+						if (err.code == plupload.FILE_SIZE_ERROR) {
+							alert(_("Error: File too large:") + " " + file.name);
+						}
+
+						if (err.code == plupload.FILE_EXTENSION_ERROR) {
+							alert(_("Error: Invalid file extension:") + " " + file.name);
+						}
+
+						file.hint = message;
+						$('#' + file.id).attr('class', 'plupload_failed').find('a').css('display', 'block').attr('title', message);
+					}
+				});
+
+				uploader.bind('StateChanged', function() {
+					if (uploader.state === plupload.STARTED) {
+						$('li.plupload_delete a,div.plupload_buttons', target).hide();
+						$('span.plupload_upload_status,div.plupload_progress,a.plupload_stop', target).css('display', 'block');
+						$('span.plupload_upload_status', target).html('Uploaded ' + uploader.total.uploaded + '/' + uploader.files.length + ' files');
+
+						if (settings.multiple_queues) {
+							$('span.plupload_total_status,span.plupload_total_file_size', target).show();
+						}
+					} else {
+						updateList();
+						$('a.plupload_stop,div.plupload_progress', target).hide();
+						$('a.plupload_delete', target).css('display', 'block');
+					}
+				});
+
+				uploader.bind('QueueChanged', updateList);
+
+				uploader.bind('FileUploaded', function(up, file) {
+					handleStatus(file);
+				});
+
+				uploader.bind("UploadProgress", function(up, file) {
+					// Set file specific progress
+					$('#' + file.id + ' div.plupload_file_status', target).html(file.percent + '%');
+
+					handleStatus(file);
+					updateTotalProgress();
+
+					if (settings.multiple_queues && uploader.total.uploaded + uploader.total.failed == uploader.files.length) {
+						$(".plupload_buttons,.plupload_upload_status", target).css("display", "inline");
+						$(".plupload_start", target).addClass("plupload_disabled");
+						$('span.plupload_total_status,span.plupload_total_file_size', target).hide();
+					}
+				});
+
+				// Call setup function
+				if (settings.setup) {
+					settings.setup(uploader);
+				}
+			});
+
+			return this;
+		} else {
+			// Get uploader instance for specified element
+			return uploaders[$(this[0]).attr('id')];
+		}
+	};
+})(jQuery);
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/styles.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/styles.css
new file mode 100644
index 0000000000000000000000000000000000000000..ee99f9ba8f70e9d181267499014121495c169582
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/styles.css
@@ -0,0 +1,40 @@
+#gallery_selection {
+    background-color: #EFEFEF;
+    padding: 7px;
+}
+
+#gallery_selection label {
+    font-weight: 600;
+    position: relative;
+    top: -1px;
+}
+
+#gallery_name {
+    width: auto;
+    min-width: 200px;
+}
+
+#gallery_name.error {
+    border: solid 1px red;
+}
+
+#upload_images_content {
+    padding: 0px;
+}
+
+#upload_images_content .plupload_container {
+    padding: 0px;
+}
+
+.plupload_header {
+    display: none;
+}
+
+.plupload_buttons {
+    display: inline
+}
+
+.plupload_droptext {
+    font-size: 16px;
+    color: silver;
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/import_folder.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/import_folder.php
new file mode 100644
index 0000000000000000000000000000000000000000..669b191c06c5c36645a201e8971a775a33604588
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/import_folder.php
@@ -0,0 +1,63 @@
+<p>Select a folder to import. The folder name will be used as the title of the gallery.</p>
+<div id="file_browser">
+</div>
+<p>
+    <input type="checkbox" id="import_keep_location" name="keep_location" value="on" /> <label for="import_keep_location"> <?php esc_html_e('Keep images in original location.', 'nggallery'); ?> <span style="font-size: 85%"><?php esc_html_e('Caution: If you keep images in the original folder and later delete the gallery, the images in that folder might be deleted depending on your settings.', 'nggallery'); ?></span></label><br/><br/>
+    <input type="button" id="import_button" name="import_folder" value="Import Folder" class="button-primary"/>
+</p>
+<script type="text/javascript">
+    var selected_folder = null;
+    jQuery(function($){
+        // Only run this function once!
+        if (typeof($(window).data('ready')) == 'undefined')
+            $(window).data('ready', true);
+        else return;
+
+        // Render file browser
+        $('#file_browser').fileTree({
+            root:           '/',
+            script:         photocrati_ajax.url,
+            post_params:    {action: 'browse_folder', token: ''}
+        }, function(file){
+            selected_folder = file;
+            $('#file_browser a').each(function(){
+                $(this).removeClass('selected_folder');
+            })
+            $('#file_browser a[rel="'+file+'"]').addClass('selected_folder');
+            file = file.split("/");
+            file.pop();
+            file = '/'+file.pop();
+            $('#import_button').val("Import "+file);
+        });
+
+        // Import the folder
+        $('#import_button').click(function(e){
+            e.preventDefault();
+
+            // Show progress bar
+            var progress_bar =  $.nggProgressBar({
+                title: "Importing gallery",
+                infinite: true,
+                starting_value: 'In Progress...'
+            });
+
+            // Start importing process
+            var post_params = {
+                action: 'import_folder',
+                folder: selected_folder,
+                keep_location: $('#import_keep_location').is(":checked") ? 'on' : 'off'
+            };
+            $.post(photocrati_ajax.url, post_params, function(response){
+                if (typeof(response) != 'object') response = JSON.parse(response);
+                if (typeof(response.error) == 'string') {
+                    progress_bar.set("Error occurred");
+                    alert(response.error);
+                }
+                else {
+                    progress_bar.set('Done! Successfully imported '+response.image_ids.length+' images.');
+                }
+                progress_bar.close();
+            });
+        })
+    });
+</script>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/upload_images.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/upload_images.php
new file mode 100644
index 0000000000000000000000000000000000000000..b3688469ab0fa4a223bb8f522bfebf0b20c49419
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/upload_images.php
@@ -0,0 +1,223 @@
+<div id="gallery_selection">
+    <label for="gallery_id">Gallery</label>
+    <select id="gallery_id">
+        <option value="0">Create a new gallery</option>
+        <?php foreach ($galleries as $gallery): ?>
+            <option value="<?php echo esc_attr($gallery->{$gallery->id_field}) ?>"><?php echo esc_attr($gallery->title) ?></option>
+        <?php endforeach ?>
+    </select>
+    <input type="text" id="gallery_name" name="gallery_name"/>
+</div>
+
+<div id="uploader">
+    <p>You browser doesn't have Flash, Silverlight, HTML5, or HTML4 support.</p>
+</div>
+<script type="text/javascript">
+    (function($){
+
+        // Listen for events emitted in other frames
+        if (window.Frame_Event_Publisher) {
+
+            // If a gallery has been deleted, remove it from the drop-downs of available galleries
+            Frame_Event_Publisher.listen_for('attach_to_post:manage_galleries', function() {
+				window.location.href = window.location.href;
+            });
+        }
+
+
+		$(function(){
+                // Show the page content
+                $('#ngg_page_content').css('visibility', 'visible');
+
+                // Only execute this code once!
+                var flag = 'addgallery';
+                if (typeof($(window).data(flag)) == 'undefined')
+                    $(window).data(flag, true);
+                else return;
+
+                window.urlencode = function(str){
+                    str = (str + '').toString();
+
+                    // Tilde should be allowed unescaped in future versions of PHP (as reflected below), but if you want to reflect current
+                    // PHP behavior, you would need to add ".replace(/~/g, '%7E');" to the following.
+                    return encodeURIComponent(str).replace(/!/g, '%21').replace(/'/g, '%27').replace(/\(/g, '%28').
+                        replace(/\)/g, '%29').replace(/\*/g, '%2A').replace(/%20/g, '+');
+                };
+
+                // Sets the plupload url with necessary parameters in the QS
+                window.set_plupload_url = function(gallery_id, gallery_name) {
+                    var qs = "?action=upload_image&gallery_id="+urlencode(gallery_id);
+                    qs += "&gallery_name="+urlencode(gallery_name);
+                    return photocrati_ajax.url + qs;
+                };
+
+                // Reinitializes plupload
+                window.reinit_plupload = function(up){
+                    $("#uploader").animate({
+                        'opacity': 0.0,
+                    }, 'slow');
+                    up.destroy();
+                    $('#gallery_id').val(0);
+                    $('#gallery_name').val('');
+                    init_plupload();
+                    $("#uploader").animate({
+                        'opacity': 1.0
+                    }, 'slow');
+                };
+
+                // Initializes plupload
+                window.init_plupload = function() {
+                    var plupload_options =  <?php echo $plupload_options ?>;
+                    var $gallery_id = $('#gallery_id');
+                    var $gallery_name = $('#gallery_name').show();
+                    var $gallery_selection = $('#gallery_selection').detach();
+                    window.uploaded_image_ids = [];
+
+                    // Override some final plupload options
+                    plupload_options.url = photocrati_ajax.url;
+                    plupload_options.preinit = {
+                        PostInit: function(up){
+
+                            // Hide/show the gallery name field
+                            $gallery_selection.insertAfter('.plupload_header');
+                            var gallery_select    = $('#gallery_id');
+                            gallery_select.on('change', function(){
+                                var optionSelected = $("option:selected", this);
+                                var valueSelected = parseInt(this.value);
+
+                                if (valueSelected == 0) {
+                                    $('#gallery_name:hidden').fadeIn().focus(function(){
+                                        up.refresh(); // must be done for IE
+                                    }).focus();
+                                }
+                                else {
+                                    $('#gallery_name:visible').fadeOut(400, function(){
+                                        gallery_select.focus();
+                                        up.refresh(); // must be done for IE
+                                    });
+                                }
+                            });
+
+                            // Change the text for the dragdrop
+                            $('.plupload_droptext').html("Drag image and ZIP files here or click <strong>Add Files</strong>");
+
+                            // Move the buttons
+                            var buttons = $('.plupload_buttons').detach();
+                            $gallery_selection.append(buttons);
+
+                            // Hide/show the validation for the gallery name field
+                            $gallery_name.keypress(function(){
+                                if ($gallery_name.val().length > 0) {
+                                    $gallery_name.removeClass('error');
+                                }
+                            });
+
+                            // Don't let the uploader continue without a gallery name
+                            var start_button = $('#uploader a.plupload_start');
+                            start_button.click(function(e){
+                                e.preventDefault();
+
+                                var up = $('#uploader').pluploadQueue();
+
+                                if ($gallery_id.val() == 0 && $gallery_name.val().length == 0) {
+                                    $gallery_name.addClass('error');
+                                    e.stopImmediatePropagation();
+                                    alert("Please enter a gallery name");
+                                    $gallery_name.focus();
+                                    return false;
+                                }
+                                else {
+                                    $gallery_name.removeClass('error');
+                                    return true;
+                                }
+                            });
+
+                            // Rearrange event handler for start button, to ensure that it has the ability
+                            // to execute first
+                            var click_events = $._data(start_button[0], 'events').click;
+                            if (click_events.length == 2) click_events.unshift(click_events.pop());
+
+                        },
+
+                        // change url before upload
+                        BeforeUpload: function(up, file) {
+                            up.settings.url = window.set_plupload_url($gallery_id.val(), $gallery_name.val());
+                        },
+
+                        // Refresh the interface after a successful upload
+                        StateChanged: function(up){
+
+                            // Determine appropriate message to display
+                            var upload_count = window.uploaded_image_ids.length;
+                            var msg = upload_count + " images were uploaded successfully";
+                            if (upload_count == 1) {
+                                msg = "1 image was uploaded successfully";
+                            }
+                            else if (upload_count == 0) {
+                                msg = "0 images were uploaded";
+                            }
+
+                            // Display message/notification
+                            if (up.state == plupload.STOPPED) {
+                                $.gritter.add({
+                                    title: "Upload complete",
+                                    text: msg,
+                                    sticky: true
+                                });
+                                setTimeout(function(){
+                                    reinit_plupload(up);
+                                }, 3000);
+                            }
+                        },
+
+                        // When a gallery has been created, use the same gallery for each request going forward
+                        FileUploaded: function(up, file, info){
+                            var response = info.response;
+                            if (typeof(response) != 'object') {
+                                try {
+                                    response = JSON.parse(info.response);
+                                }
+                                catch (ex) {
+                                    up.trigger('Error', {
+                                        code: plupload.IO_ERROR,
+                                        msg:  "An unexpected error occured. This is most likely due to a server misconfiguration. Check your PHP error log or ask your hosting provider for assistance.",
+                                        details: response.replace(/<.*>/, '').trim(),
+                                        file: file
+                                    });
+                                    return;
+                                }
+                            }
+                            window.uploaded_image_ids = window.uploaded_image_ids.concat(response.image_ids);
+                            up.settings.url = window.set_plupload_url(response.gallery_id, $gallery_name.val());
+
+                            // If we created a new gallery, ensure it's now in the drop-down list, and select it
+                            if ($gallery_id.find('option[value="'+response.gallery_id+'"]').length == 0) {
+                                var option = $('<option/>').attr('value', response.gallery_id).text(response.gallery_name);
+                                $gallery_id.append(option);
+                                $gallery_id.val(response.gallery_id);
+                                option.attr('selected', 'selected');
+                            }
+
+                            // our Frame-Event-Publisher hooks onto the jQuery ajaxComplete action which plupload
+                            // of course does not honor. Tie them together here..
+                            if (window.Frame_Event_Publisher) {
+								$.post(photocrati_ajax.url, {'action': 'cookie_dump'}, function(){
+									window.Frame_Event_Publisher.find_parent(window).broadcast();
+								});
+                            }
+                        },
+
+                        Error: function(up, args){
+                            if (typeof(window.console) != 'undefined') console.log(args);
+                        }
+                    };
+                    $("#uploader").pluploadQueue(plupload_options);
+                    var uploader = $('#uploader').pluploadQueue();
+                    uploader.refresh();
+
+                };
+
+                window.init_plupload();
+            });
+    })(jQuery);
+</script>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/adapter.fs_access_page.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/adapter.fs_access_page.php
new file mode 100644
index 0000000000000000000000000000000000000000..ad7d7252409e0c7425e0284fe14df89ad8b61eba
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/adapter.fs_access_page.php
@@ -0,0 +1,43 @@
+<?php
+
+// TODO: Finish the implementation
+class A_Fs_Access_Page extends Mixin
+{
+	function index_action()
+	{
+		$router			= $this->get_registry()->get_utility('I_Router');
+		$url			= $this->param('uri') ? $router->get_url($uri) :
+							admin_url('/admin.php?'.$router->get_querystring());
+
+		// Request filesystem credentials from user
+		$creds = request_filesystem_credentials(
+			$url,
+			'',
+			FALSE,
+			ABSPATH,
+			array()
+		);
+
+		if (WP_Filesystem($creds)) {
+			global $wp_filesystem;
+		}
+	}
+
+	/**
+	 * Determines whether the given paths are writable
+	 * @return boolean
+	 */
+	function are_paths_writable()
+	{
+		$retval = TRUE;
+		$path = $this->object->param('path');
+		if (!is_array($path)) $path = array($path);
+		foreach ($path as $p) {
+			if (!is_writable($p)) {
+				$retval = FALSE;
+				break;
+			}
+		}
+		return $retval;
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/adapter.mvc_validation.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/adapter.mvc_validation.php
new file mode 100644
index 0000000000000000000000000000000000000000..c9cc55bf1b13aa86b4331c62377ee81040192b03
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/adapter.mvc_validation.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Provides validation for datamapper entities within an MVC controller
+ */
+class A_MVC_Validation extends Mixin
+{
+	function show_errors_for($entity, $return=FALSE)
+	{
+		$retval = '';
+
+		if ($entity->is_invalid()) {
+			$retval = $this->object->render_partial('photocrati-nextgen_admin#entity_errors', array(
+				'entity'	=>	$entity
+			), $return);
+		}
+
+		return $retval;
+	}
+
+	function show_success_for($entity, $message, $return=FALSE)
+	{
+		$retval = '';
+
+		if ($entity->is_valid()) {
+			$retval = $this->object->render_partial('photocrati-nextgen_admin#entity_saved', array(
+				'entity'	=>	$entity,
+				'message'	=>	$message
+			));
+		}
+
+		return $retval;
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/adapter.nextgen_admin_default_pages.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/adapter.nextgen_admin_default_pages.php
new file mode 100644
index 0000000000000000000000000000000000000000..8ff7f1ddfbc2d0a9ea75822c6c5a77f8a8a8dda9
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/adapter.nextgen_admin_default_pages.php
@@ -0,0 +1,11 @@
+<?php
+
+class A_NextGen_Admin_Default_Pages extends Mixin
+{
+	function initialize()
+	{
+		$this->object->add(
+			NEXTGEN_FS_ACCESS_SLUG, 'A_Fs_Access_Page', NGGFOLDER, FALSE
+		);
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/adapter.nextgen_settings_routes.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/adapter.nextgen_settings_routes.php
new file mode 100644
index 0000000000000000000000000000000000000000..036077377bba386b83018bd5c100178c3944088c
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/adapter.nextgen_settings_routes.php
@@ -0,0 +1,20 @@
+<?php
+
+class A_NextGen_Settings_Routes extends Mixin
+{
+    function initialize()
+    {
+        $this->object->add_pre_hook(
+            'serve_request',
+            'Adds NextGen Admin-Settings routes',
+            get_class(),
+            'add_nextgen_settings_routes'
+        );
+    }
+
+    function add_nextgen_settings_routes()
+    {
+        $this->create_app('/nextgen-settings')
+             ->route('/update_watermark_preview', 'I_Settings_Manager_Controller#watermark_update');
+    }
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/class.form.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/class.form.php
new file mode 100644
index 0000000000000000000000000000000000000000..9c982689bdc9751a77ee7519d9ef6274c1710133
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/class.form.php
@@ -0,0 +1,375 @@
+<?php
+
+class C_Form extends C_MVC_Controller
+{
+	static $_instances = array();
+
+	/**
+	 * Gets an instance of a form
+	 * @param string $context
+	 * @return C_Form
+	 */
+	static function &get_instance($context)
+	{
+		if (!isset(self::$_instances[$context])) {
+			$klass = get_class();
+			self::$_instances[$context] = new $klass($context);
+		}
+		return self::$_instances[$context];
+	}
+
+	/**
+	 * Defines the form
+	 * @param string $context
+	 */
+	function define($context)
+	{
+		parent::define($context);
+		$this->add_mixin('Mixin_Form_Instance_Methods');
+		$this->add_mixin('Mixin_Form_Field_Generators');
+		$this->implement('I_Form');
+	}
+}
+
+class Mixin_Form_Instance_Methods extends Mixin
+{
+	/**
+	 * Enqueues any static resources required by the form
+	 */
+	function enqueue_static_resources()
+	{
+	}
+
+	/**
+	 * Gets a list of fields to render
+	 * @return array
+	 */
+	function _get_field_names()
+	{
+		return array();
+	}
+
+	function get_id()
+	{
+		return $this->object->context;
+	}
+
+	function get_title()
+	{
+		return $this->object->context;
+	}
+
+	/**
+	 * Saves the form/model
+	 * @param array $attributes
+	 * @return type
+	 */
+	function save_action($attributes=array())
+	{
+		if ($this->object->has_method('get_model')) {
+			return $this->object->get_model()->save($attributes);
+		}
+		else return TRUE;
+	}
+
+	/**
+	 * Returns the rendered form
+	 */
+	function render($wrap = TRUE)
+	{
+		$fields = array();
+		foreach ($this->object->_get_field_names() as $field) {
+			$method = "_render_{$field}_field";
+			if ($this->object->has_method($method)) {
+				$fields[] = $this->object->$method($this->object->get_model());
+			}
+		}
+
+		return $this->object->render_partial(
+            'photocrati-nextgen_admin#form',
+            array(
+                'fields' => $fields,
+                'wrap'   => $wrap
+            ),
+            TRUE
+        );
+	}
+}
+
+/**
+ * Provides some default field generators for forms to use
+ */
+class Mixin_Form_Field_Generators extends Mixin
+{
+	function _render_select_field($display_type, $name, $label, $options=array(), $value, $text = '', $hidden = FALSE)
+    {
+        return $this->object->render_partial(
+            'photocrati-nextgen_admin#field_generator/nextgen_settings_field_select',
+            array(
+                'display_type_name' => $display_type->name,
+                'name'    => $name,
+                'label'   => _($label),
+                'options' => $options,
+                'value'   => $value,
+                'text'    => $text,
+                'hidden'  => $hidden
+            ),
+            True
+        );
+    }
+
+    function _render_radio_field($display_type, $name, $label, $value, $text = '', $hidden = FALSE)
+    {
+        return $this->object->render_partial(
+            'photocrati-nextgen_admin#field_generator/nextgen_settings_field_radio',
+            array(
+                'display_type_name' => $display_type->name,
+                'name'   => $name,
+                'label'  => _($label),
+                'value'  => $value,
+                'text'   => $text,
+                'hidden' => $hidden
+            ),
+            True
+        );
+    }
+
+    function _render_number_field($display_type,
+                                  $name,
+                                  $label,
+                                  $value,
+                                  $text = '',
+                                  $hidden = FALSE,
+                                  $placeholder = '',
+                                  $min = NULL,
+                                  $max = NULL)
+    {
+        return $this->object->render_partial(
+            'photocrati-nextgen_admin#field_generator/nextgen_settings_field_number',
+            array(
+                'display_type_name' => $display_type->name,
+                'name'  => $name,
+                'label' => _($label),
+                'value' => $value,
+                'text' => $text,
+                'hidden' => $hidden,
+                'placeholder' => $placeholder,
+                'min' => $min,
+                'max' => $max
+            ),
+            True
+        );
+    }
+
+    function _render_text_field($display_type, $name, $label, $value, $text = '', $hidden = FALSE, $placeholder = '')
+    {
+        return $this->object->render_partial(
+            'photocrati-nextgen_admin#field_generator/nextgen_settings_field_text',
+            array(
+                'display_type_name' => $display_type->name,
+                'name'  => $name,
+                'label' => _($label),
+                'value' => $value,
+                'text' => $text,
+                'hidden' => $hidden,
+                'placeholder' => $placeholder
+            ),
+            True
+        );
+    }
+
+    function _render_textarea_field($display_type, $name, $label, $value, $text = '', $hidden = FALSE, $placeholder = '')
+    {
+        return $this->object->render_partial(
+            'photocrati-nextgen_admin#field_generator/nextgen_settings_field_textarea',
+            array(
+                'display_type_name' => $display_type->name,
+                'name'  => $name,
+                'label' => _($label),
+                'value' => $value,
+                'text' => $text,
+                'hidden' => $hidden,
+                'placeholder' => $placeholder
+            ),
+            True
+        );
+    }
+
+    function _render_color_field($display_type, $name, $label, $value, $text = '', $hidden = FALSE)
+    {
+        return $this->object->render_partial(
+            'photocrati-nextgen_admin#field_generator/nextgen_settings_field_color',
+            array(
+                'display_type_name' => $display_type->name,
+                'name'  => $name,
+                'label' => _($label),
+                'value' => $value,
+                'text' => $text,
+                'hidden' => $hidden
+            ),
+            True
+        );
+    }
+
+	function _render_ajax_pagination_field($display_type)
+	{
+		return $this->object->_render_radio_field(
+			$display_type,
+			'ajax_pagination',
+			_('Enable AJAX pagination'),
+			isset($display_type->settings['ajax_pagination']) ? $display_type->settings['ajax_pagination'] : FALSE
+		);
+	}
+    
+    function _render_thumbnail_override_settings_field($display_type)
+    {
+        $override_field = $this->_render_radio_field(
+            $display_type,
+            'override_thumbnail_settings',
+            'Override thumbnail settings',
+            $display_type->settings['override_thumbnail_settings'],
+			"This does not affect existing thumbnails; overriding the thumbnail settings will create an additional set of thumbnails. To change the size of existing thumbnails please visit 'Manage Galleries' and choose 'Create new thumbnails' for all images in the gallery."
+        );
+
+        $dimensions_field = $this->object->render_partial(
+            'photocrati-nextgen_admin#field_generator/thumbnail_settings',
+            array(
+                'display_type_name' => $display_type->name,
+                'name' => 'thumbnail_dimensions',
+                'label'=> _('Thumbnail dimensions'),
+                'thumbnail_width' => $display_type->settings['thumbnail_width'],
+                'thumbnail_height'=> $display_type->settings['thumbnail_height'],
+                'hidden' => empty($display_type->settings['override_thumbnail_settings']) ? 'hidden' : '',
+                'text' => ''
+            ),
+            TRUE
+        );
+
+        $qualities = array();
+        for ($i = 100; $i > 40; $i -= 5) { $qualities[$i] = "{$i}%"; }
+        $quality_field = $this->_render_select_field(
+            $display_type,
+            'thumbnail_quality',
+            'Thumbnail quality',
+            $qualities,
+            $display_type->settings['thumbnail_quality'],
+            '',
+            empty($display_type->settings['override_thumbnail_settings']) ? TRUE : FALSE
+        );
+
+        $crop_field = $this->_render_radio_field(
+            $display_type,
+            'thumbnail_crop',
+            'Thumbnail crop',
+            $display_type->settings['thumbnail_crop'],
+            '',
+            empty($display_type->settings['override_thumbnail_settings']) ? TRUE : FALSE
+        );
+
+        $watermark_field = $this->_render_radio_field(
+            $display_type,
+            'thumbnail_watermark',
+            'Thumbnail watermark',
+            $display_type->settings['thumbnail_watermark'],
+            '',
+            empty($display_type->settings['override_thumbnail_settings']) ? TRUE : FALSE
+        );
+
+        $everything = $override_field . $dimensions_field . $quality_field . $crop_field . $watermark_field;
+
+        return $everything;
+    }
+    
+
+    /**
+     * Renders the thumbnail override settings field(s)
+     *
+     * @param C_Display_Type $display_type
+     * @return string
+     */
+    function _render_image_override_settings_field($display_type)
+    {
+        $override_field = $this->_render_radio_field(
+            $display_type,
+            'override_image_settings',
+            'Override image settings',
+            $display_type->settings['override_image_settings'],
+			'Overriding the image settings will create an additional set of images'
+        );
+
+        $qualities = array();
+        for ($i = 100; $i > 40; $i -= 5) { $qualities[$i] = "{$i}%"; }
+        $quality_field = $this->_render_select_field(
+            $display_type,
+            'image_quality',
+            'Image quality',
+            $qualities,    
+            $display_type->settings['image_quality'],
+            '',
+            empty($display_type->settings['override_image_settings']) ? TRUE : FALSE
+        );
+
+        $crop_field = $this->_render_radio_field(
+            $display_type,
+            'image_crop',
+            'Image crop',
+            $display_type->settings['image_crop'],
+            '',
+            empty($display_type->settings['override_image_settings']) ? TRUE : FALSE
+        );
+
+        $watermark_field = $this->_render_radio_field(
+            $display_type,
+            'image_watermark',
+            'Image watermark',
+            $display_type->settings['image_watermark'],
+            '',
+            empty($display_type->settings['override_image_settings']) ? TRUE : FALSE
+        );
+
+        $everything = $override_field . $quality_field . $crop_field . $watermark_field;
+
+        return $everything;
+    }
+
+    /**
+     * Renders a pair of fields for width and width-units (px, em, etc)
+     *
+     * @param C_Display_Type $display_type
+     * @return string
+     */
+    function _render_width_and_unit_field($display_type)
+    {
+        return $this->object->render_partial(
+            'photocrati-nextgen_admin#field_generator/nextgen_settings_field_width_and_unit',
+            array(
+                'display_type_name' => $display_type->name,
+                'name' => 'width',
+                'label' => 'Gallery width',
+                'value' => $display_type->settings['width'],
+                'text' => 'An empty or "0" setting will make the gallery full width',
+                'placeholder' => '(optional)',
+                'unit_name' => 'width_unit',
+                'unit_value' => $display_type->settings['width_unit'],
+                'options' => array('px' => 'Pixels', '%' => 'Percent')
+            ),
+            TRUE
+        );
+    }
+
+    function _get_aspect_ratio_options()
+    {
+        return array(
+            'first_image' => __('First Image', 'nggallery'),
+            'image_average' => __('Average', 'nggallery'),
+            '1.5'   => '3:2 [1.5]',
+            '1.333' => '4:3 [1.333]',
+            '1.777' => '16:9 [1.777]',
+            '1.6'   => '16:10 [1.6]',
+            '1.85'  => '1.85:1 [1.85]',
+            '2.39'  => '2.39:1 [2.39]',
+            '1.81'  => '1.81:1 [1.81]',
+            '1'     => '1:1 (Square) [1]'
+        );
+    }
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/class.form_manager.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/class.form_manager.php
new file mode 100644
index 0000000000000000000000000000000000000000..787ffb27f26c3337f585b80ca2f812b9345563c0
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/class.form_manager.php
@@ -0,0 +1,189 @@
+<?php
+
+class C_Form_Manager extends C_Component
+{
+	static $_instances	= array();
+	var $_forms			= array();
+	/**
+	 * Returns an instance of the form manager
+	 * @returns C_Form_Manager
+	 */
+	static function &get_instance($context=FALSE)
+	{
+		if (!isset(self::$_instances[$context])) {
+			$klass = get_class();
+			self::$_instances[$context] = new $klass($context);
+		}
+		return self::$_instances[$context];
+	}
+
+	/**
+	 * Defines the instance
+	 * @param mixed $context
+	 */
+	function define($context=FALSE)
+	{
+		parent::define($context);
+		$this->add_mixin('Mixin_Form_Manager');
+		$this->implement('I_Form_Manager');
+	}
+}
+
+class Mixin_Form_Manager extends Mixin
+{
+	/**
+	 * Adds one or more
+	 * @param type $type
+	 * @param type $form_names
+	 * @return type
+	 */
+	function add_form($type, $form_names)
+	{
+		if (!isset($this->object->_forms[$type])) {
+			$this->object->_forms[$type] = array();
+		}
+
+		if (!is_array($form_names)) $form_names= array($form_names);
+		foreach ($form_names as $form) $this->object->_forms[$type][] = $form;
+
+		return $this->object->get_form_count($type);
+	}
+
+	/**
+	 * Alias for add_form() method
+	 * @param string $type
+	 * @param string|array $form_names
+	 * @return int
+	 */
+	function add_forms($type, $form_names)
+	{
+		return $this->object->add_form($type, $form_names);
+	}
+
+	/**
+	 * Removes one or more forms of a particular type
+	 * @param string $type
+	 * @param string|array $form_names
+	 * @return int	number of forms remaining for the type
+	 */
+	function remove_form($type, $form_names)
+	{
+		$retval = 0;
+		if (isset($this->object->_forms[$type])) {
+			foreach ($form_names as $form) {
+				if (($index = array_search($form, $this->object->_forms[$type])))
+					unsset($this->object->_forms[$type][$index]);
+			}
+			$retval = $this->object->get_form_count($type);
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Alias for remove_form() method
+	 * @param string $type
+	 * @param string|array $form_names
+	 * @return int
+	 */
+	function remove_forms($type, $form_names)
+	{
+		return $this->object->remove_form($type, $form_names);
+	}
+
+	/**
+	 * Gets known form types
+	 * @return type
+	 */
+	function get_known_types()
+	{
+		return array_keys($this->object->_forms);
+	}
+
+
+	/**
+	 * Gets forms of a particular type
+	 * @param string $type
+	 * @return array
+	 */
+	function get_forms($type, $instantiate=FALSE)
+	{
+		$retval = array();
+		if (isset($this->object->_forms[$type])) {
+			if (!$instantiate) $retval = $this->object->_forms[$type];
+			else foreach ($this->object->_forms[$type] as $context) {
+				$retval[] = $this->get_registry()->get_utility('I_Form', $context);
+			}
+		}
+		return $retval;
+	}
+
+	/**
+	 * Gets the number of forms registered for a particular type
+	 * @param string $type
+	 * @return int
+	 */
+	function get_form_count($type)
+	{
+		$retval = 0;
+		if (isset($this->object->_forms[$type])) {
+			$retval = count($this->object->_forms[$type]);
+		}
+		return $retval;
+	}
+
+	/**
+	 * Gets the index of a particular form
+	 * @param string $type
+	 * @param string $name
+	 * @return FALSE|int
+	 */
+	function get_form_index($type, $name)
+	{
+		$retval = FALSE;
+		if ($this->object->get_form_count($type) > 0) {
+			$retval = array_search($name, $this->object->_forms[$type]);
+		}
+		return $retval;
+	}
+
+	/**
+	 * Adds one or more forms before a form already registered
+	 * @param string $type
+	 * @param string $before
+	 * @param string|array $form_names
+	 * @param int $offset
+	 * @return int
+	 */
+	function add_form_before($type, $before, $form_names, $offset=0)
+	{
+		$retval		= 0;
+		$index		= FALSE;
+		$use_add	= FALSE;
+
+		// Append the forms
+		if ($this->object->get_form_count($type) == 0) $use_add = TRUE;
+		else if (($index = $this->object->get_form_index($type, $name)) == FALSE) $use_add = FALSE;
+		if ($use_add) $this->object->add_forms($type, $form_names);
+		else {
+			$before = array_slice($this->object->get_forms($type), 0, $offset);
+			$after	= array_slice($this->object->get_forms($type), $offset);
+			$this->object->_forms[$type] = array_merge($before, $form_names, $after);
+			$retval = $this->object->get_form_count($type);
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Adds one or more forms after an existing form
+	 * @param string $type
+	 * @param string $after
+	 * @param string|array $form_names
+	 * @return int
+	 */
+	function add_form_after($type, $after, $form_names)
+	{
+		return $this->object->add_form_before($type, $after, $form_names, 1);
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/class.nextgen_admin_installer.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/class.nextgen_admin_installer.php
new file mode 100644
index 0000000000000000000000000000000000000000..3e2d71aeec0930c62139dbc7d8a5584e197cffb7
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/class.nextgen_admin_installer.php
@@ -0,0 +1,27 @@
+<?php
+
+class C_NextGen_Admin_Installer
+{
+	function install()
+	{
+		// In version 0.2 of this module and earlier, the following values
+		// were statically set rather than dynamically using a handler. Therefore, we need
+		// to delete those static values
+		$module_name = 'photocrati-nextgen_admin';
+		$settings = C_NextGen_Settings::get_instance();
+		$modules = $settings->pope_module_list;
+		$cleanup = FALSE;
+		if (!isset($modules[$module_name])) $cleanup = FALSE;
+		elseif (floatval(str_replace($module_name, '|', $modules[$module_name])) < '0.3') {
+			$cleanup = TRUE;
+		}
+		if ($cleanup) {
+			$keys = array(
+				'jquery_ui_theme',
+				'jquery_ui_theme_version',
+				'jquery_ui_theme_url'
+			);
+			foreach ($keys as $key) $settings->delete($key);
+		}
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/class.nextgen_admin_option_handler.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/class.nextgen_admin_option_handler.php
new file mode 100644
index 0000000000000000000000000000000000000000..dfa8a6ad8d5af97837d7632c98d6f80fde10d06e
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/class.nextgen_admin_option_handler.php
@@ -0,0 +1,29 @@
+<?php
+
+class C_NextGen_Admin_Option_Handler
+{
+	function get_router()
+	{
+		return C_Component_Registry::get_instance()->get_utility('I_Router');
+	}
+
+
+	function get($key, $default=NULL)
+	{
+		$retval = $default;
+
+		switch ($key) {
+			case 'jquery_ui_theme':
+				$retval = 'jquery-ui-nextgen';
+				break;
+			case 'jquery_ui_theme_version':
+				$retval = '1.8';
+				break;
+			case 'jquery_ui_theme_url':
+				$retval = $this->get_router()->get_static_url('photocrati-nextgen_admin#jquery-ui/jquery-ui-1.9.1.custom.css');
+				break;
+		}
+
+		return $retval;
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/class.nextgen_admin_page_controller.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/class.nextgen_admin_page_controller.php
new file mode 100644
index 0000000000000000000000000000000000000000..aafc5584857bfff824aa44765959286160d2d3a1
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/class.nextgen_admin_page_controller.php
@@ -0,0 +1,276 @@
+<?php
+
+class C_NextGen_Admin_Page_Controller extends C_MVC_Controller
+{
+	static $_instances = array();
+
+	static function &get_instance($context=FALSE)
+	{
+		if (!isset(self::$_instances[$context])) {
+			$klass = get_class();
+			self::$_instances[$context] = new $klass($context);
+		}
+		return self::$_instances[$context];
+	}
+
+	function define($context=FALSE)
+	{
+		if (is_array($context)) $this->name = $context[0];
+		else $this->name = $context;
+
+		parent::define($context);
+		$this->add_mixin('Mixin_NextGen_Admin_Page_Instance_Methods');
+		$this->implement('I_NextGen_Admin_Page');
+	}
+
+	function initialize()
+	{
+		parent::initialize();
+		$this->add_pre_hook(
+			'index_action',
+			'Enqueue Backend Resources',
+			'Hook_NextGen_Admin_Page_Resources',
+			'enqueue_backend_resources'
+		);
+	}
+}
+
+class Hook_NextGen_Admin_Page_Resources extends Hook
+{
+	function enqueue_backend_resources()
+	{
+		$this->object->enqueue_backend_resources();
+	}
+}
+
+
+class Mixin_NextGen_Admin_Page_Instance_Methods extends Mixin
+{
+	/**
+	 * Authorizes the request
+	 */
+	function is_authorized_request($privilege=NULL)
+	{
+		if (!$privilege) $privilege = $this->object->get_required_permission();
+		$security = $this->get_registry()->get_utility('I_Security_Manager');
+		$retval = $sec_token = $security->get_request_token(str_replace(array(' ', "\n", "\t"), '_', $privilege));
+		$sec_actor = $security->get_current_actor();
+
+		// Ensure that the user has permission to access this page
+		if (!$sec_actor->is_allowed($privilege))
+			$retval = FALSE;
+
+		// Ensure that nonce is valid
+		if ($this->object->is_post_request() && !$sec_token->check_current_request()) {
+			$retval = FALSE;
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Returns the permission required to access this page
+	 * @return string
+	 */
+	function get_required_permission()
+	{
+		return $this->object->name;
+	}
+
+	/**
+	 * Enqueues resources required by a NextGEN Admin page
+	 */
+	function enqueue_backend_resources()
+	{
+		wp_enqueue_script('jquery');
+		$this->object->enqueue_jquery_ui_theme();
+		wp_enqueue_script('jquery-ui-accordion');
+		wp_enqueue_script(
+            'nextgen_display_settings_page_placeholder_stub',
+            $this->get_static_url('photocrati-nextgen_admin#jquery.placeholder.min.js'),
+            array('jquery'),
+            '2.0.7',
+            TRUE
+        );
+		wp_register_script('iris', $this->get_router()->get_url('/wp-admin/js/iris.min.js', FALSE, TRUE), array('jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch'));
+		wp_register_script('wp-color-picker', $this->get_router()->get_url('/wp-admin/js/color-picker.js', FALSE, TRUE), array('iris'));
+		wp_localize_script('wp-color-picker', 'wpColorPickerL10n', array(
+			'clear' => __( 'Clear' ),
+			'defaultString' => __( 'Default' ),
+			'pick' => __( 'Select Color' ),
+			'current' => __( 'Current Color' ),
+		));
+		wp_enqueue_script(
+			'nextgen_admin_page',
+			$this->get_static_url('photocrati-nextgen_admin#nextgen_admin_page.js'),
+            array('wp-color-picker')
+		);
+		wp_enqueue_style(
+			'nextgen_admin_page',
+			$this->get_static_url('photocrati-nextgen_admin#nextgen_admin_page.css'),
+            array('wp-color-picker')
+		);
+
+		// Ensure select2
+		wp_enqueue_style('select2');
+		wp_enqueue_script('select2');
+	}
+
+	function enqueue_jquery_ui_theme()
+	{
+		$settings = C_NextGen_Settings::get_instance();
+		wp_enqueue_style(
+			$settings->jquery_ui_theme,
+			is_ssl() ?
+				 str_replace('http:', 'https:', $settings->jquery_ui_theme_url) :
+				 $settings->jquery_ui_theme_url,
+			NULL,
+			$settings->jquery_ui_theme_version
+		);
+	}
+
+	/**
+	 * Returns the page title
+	 * @return string
+	 */
+	function get_page_title()
+	{
+		return $this->object->name;
+	}
+
+	/**
+	 * Returns the page heading
+	 * @return string
+	 */
+	function get_page_heading()
+	{
+		return $this->object->get_page_title();
+	}
+
+	/**
+	 * Returns the type of forms to render on this page
+	 * @return string
+	 */
+	function get_form_type()
+	{
+
+		return is_array($this->object->context) ?
+			$this->object->context[0] : $this->object->context;
+	}
+
+	function get_success_message()
+	{
+		return "Saved successfully";
+	}
+
+
+	/**
+	 * Returns an accordion tab, encapsulating the form
+	 * @param I_Form $form
+	 */
+	function to_accordion_tab($form)
+	{
+		return $this->object->render_partial('photocrati-nextgen_admin#accordion_tab', array(
+			'id'		=>	$form->get_id(),
+			'title'		=>	$form->get_title(),
+			'content'	=>	$form->render(TRUE)
+		), TRUE);
+	}
+
+	/**
+	 * Returns the
+	 * @return type
+	 */
+	function get_forms()
+	{
+		$forms = array();
+        $form_manager = C_Form_Manager::get_instance();
+		foreach ($form_manager->get_forms($this->object->get_form_type()) as $form) {
+			$forms[] = $this->get_registry()->get_utility('I_Form', $form);
+		}
+		return $forms;
+	}
+
+	/**
+	 * Gets the action to be executed
+	 * @return string
+	 */
+	function _get_action()
+	{
+		$retval = preg_quote($this->object->param('action'), '/');
+		$retval = strtolower(preg_replace(
+			"/[^\w]/",
+			'_',
+			$retval
+		));
+		return preg_replace("/_{2,}/", "_", $retval).'_action';
+	}
+
+	/**
+	 * Returns the template to be rendered for the index action
+	 * @return string
+	 */
+	function index_template()
+	{
+		return 'photocrati-nextgen_admin#nextgen_admin_page';
+	}
+
+    function show_save_button()
+    {
+        return TRUE;
+    }
+
+	/**
+	 * Renders a NextGEN Admin Page using jQuery Accordions
+	 */
+	function index_action()
+	{
+		if (($token = $this->object->is_authorized_request())) {
+			// Get each form. Validate it and save any changes if this is a post
+			// request
+			$tabs			= array();
+			$errors			= array();
+			$success		= $this->object->is_post_request() ?
+									$this->object->get_success_message() : '';
+
+			foreach ($this->object->get_forms() as $form) {
+				$form->enqueue_static_resources();
+				if ($this->object->is_post_request()) {
+					$action = $this->object->_get_action();
+					if ($form->has_method($action)) {
+                        $form->$action($this->object->param($form->context));
+					}
+				}
+
+                $tabs[] = $this->object->to_accordion_tab($form);
+
+                if ($form->has_method('get_model') && $form->get_model()) {
+                    if ($form->get_model()->is_invalid()) {
+                        if (($form_errors = $this->object->show_errors_for($form->get_model(), TRUE))) {
+                            $errors[] = $form_errors;
+                        }
+                        $form->get_model()->clear_errors();
+                    }
+                }
+			}
+
+			// Render the view
+			$this->render_partial($this->object->index_template(), array(
+				'page_heading'		=>	$this->object->get_page_heading(),
+				'tabs'				=>	$tabs,
+				'errors'			=>	$errors,
+				'success'			=>	$success,
+				'form_header'		=>  $token->get_form_html(),
+                'show_save_button'  =>  $this->object->show_save_button()
+			));
+		}
+
+		// The user is not authorized to view this page
+		else {
+			$this->render_view('photocrati-nextgen_admin#not_authorized', array(
+				'name'	=>	$this->object->name,
+				'title'	=>	$this->object->get_page_title()
+			));
+		}
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/class.page_manager.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/class.page_manager.php
new file mode 100644
index 0000000000000000000000000000000000000000..c7b2727cc095b9ea566430484b185c717875b92d
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/class.page_manager.php
@@ -0,0 +1,146 @@
+<?php
+
+class C_Page_Manager extends C_Component
+{
+	static $_instances = array();
+	var $_pages = array();
+
+	/**
+	 * Gets an instance of the Page Manager
+	 * @param string $context
+	 * @return C_Page_Manager
+	 */
+	static function &get_instance($context=FALSE)
+	{
+		if (!isset(self::$_instances[$context])) {
+			$klass = get_class();
+			self::$_instances[$context] = new $klass($context);
+		}
+		return self::$_instances[$context];
+	}
+
+	/**
+	 * Defines the instance of the Page Manager
+	 * @param type $context
+	 */
+	function define($context=FALSE)
+	{
+		parent::define($context);
+		$this->add_mixin('Mixin_Page_Manager');
+		$this->implement('I_Page_Manager');
+	}
+}
+
+class Mixin_Page_Manager extends Mixin
+{
+	function add($slug, $adapter, $parent=NULL, $add_menu=TRUE, $before = NULL)
+	{
+		$this->object->_pages[$slug] = array(
+			'adapter'	=>	$adapter,
+			'parent'	=>	$parent,
+			'add_menu'	=>	$add_menu,
+			'before' => $before
+		);
+	}
+	
+	function move_page($slug, $other_slug, $after = false)
+	{
+		$page_list = $this->object->_pages;
+		
+		if (isset($page_list[$slug]) && isset($page_list[$other_slug]))
+		{
+			$slug_list = array_keys($page_list);
+			$item_list = array_values($page_list);
+			
+			$slug_idx = array_search($slug, $slug_list);
+			$item = $page_list[$slug];
+			
+			unset($slug_list[$slug_idx]);
+			unset($item_list[$slug_idx]);
+			
+			$slug_list = array_values($slug_list);
+			$item_list = array_values($item_list);
+			
+			$other_idx = array_search($other_slug, $slug_list);
+			
+			array_splice($slug_list, $other_idx, 0, array($slug));
+			array_splice($item_list, $other_idx, 0, array($item));
+			
+			$this->object->_pages = array_combine($slug_list, $item_list);
+		}
+	}
+
+	function remove_page($slug)
+	{
+		unset($this->object->_pages[$slug]);
+	}
+
+	function get_all()
+	{
+		return $this->object->_pages;
+	}
+
+	function setup()
+	{
+		$registry		= $this->get_registry();
+		$controllers	= array();
+		foreach ($this->object->_pages as $slug => $properties) {
+			$registry->add_adapter(
+				'I_NextGen_Admin_Page',
+				$properties['adapter'],
+				$slug
+			);
+			$controllers[$slug] = $registry->get_utility(
+				'I_NextGen_Admin_Page',
+				$slug
+			);
+			if ($properties['add_menu']) {
+				add_submenu_page(
+					$properties['parent'],
+					$controllers[$slug]->get_page_title(),
+					$controllers[$slug]->get_page_heading(),
+					$controllers[$slug]->get_required_permission(),
+					$slug,
+					array(&$controllers[$slug], 'index_action')
+				);
+				
+				if ($properties['before']) {
+					global $submenu;
+					
+					$parent = $submenu[$properties['parent']];
+					$item_index = -1;
+					$before_index = -1;
+					
+					if ($parent != null) {
+						foreach ($parent as $index => $menu) {
+						
+							// under add_submenu_page, $menu_slug is index 2
+							// $submenu[$parent_slug][] = array ( $menu_title, $capability, $menu_slug, $page_title );
+							if ($menu[2] == $slug) {
+								$item_index = $index;
+							}
+							else if ($menu[2] == $properties['before']) {
+								$before_index = $index;
+							}
+						}
+					}
+				
+					if ($item_index > -1 && $before_index > -1) {
+				
+						$item = $parent[$item_index];
+					
+						unset($parent[$item_index]);
+						$parent = array_values($parent);
+					
+						if ($item_index < $before_index) 
+							$before_index--;
+						
+						array_splice($parent, $before_index, 0, array($item));
+					
+						$submenu[$properties['parent']] = $parent;
+					}
+				}
+			}
+		}
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/interface.form.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/interface.form.php
new file mode 100644
index 0000000000000000000000000000000000000000..e3a7855fc932a2ec3f906fdb074cf143b4d9e478
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/interface.form.php
@@ -0,0 +1,7 @@
+<?php
+
+interface I_Form
+{
+	function render($retval=TRUE);
+	function save_action($properties=array());
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/interface.form_manager.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/interface.form_manager.php
new file mode 100644
index 0000000000000000000000000000000000000000..60e678de6ee02216e56078f406031dc24587e5cc
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/interface.form_manager.php
@@ -0,0 +1,11 @@
+<?php
+
+interface I_Form_Manager
+{
+	function add_form($type, $interfaces);
+	function remove_form($type, $interfaces);
+	function add_form_before($type, $before, $interfaces);
+	function add_form_after($type, $after, $interfaces);
+	function get_forms($type);
+	function get_known_types();
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/interface.nextgen_admin_page.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/interface.nextgen_admin_page.php
new file mode 100644
index 0000000000000000000000000000000000000000..362d09b12b92993c2e3d3c807af51be4fbbfeace
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/interface.nextgen_admin_page.php
@@ -0,0 +1,6 @@
+<?php
+
+interface I_NextGen_Admin_Page
+{
+	function enqueue_backend_resources();
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/interface.page_manager.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/interface.page_manager.php
new file mode 100644
index 0000000000000000000000000000000000000000..f4884397c494ce284bd89cc78e36c46db59df566
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/interface.page_manager.php
@@ -0,0 +1,6 @@
+<?php
+
+interface I_Page_Manager
+{
+	
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/module.nextgen_admin.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/module.nextgen_admin.php
new file mode 100644
index 0000000000000000000000000000000000000000..0a8f76fda3274c735384433894acabe56c20436d
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/module.nextgen_admin.php
@@ -0,0 +1,149 @@
+<?php
+
+/***
+{
+	Module:	photocrati-nextgen_admin
+}
+***/
+
+define('NEXTGEN_FS_ACCESS_SLUG', 'ngg_fs_access');
+
+class M_NextGen_Admin extends C_Base_Module
+{
+	/**
+	 * Defines the module
+	 */
+	function define()
+	{
+		parent::define(
+			'photocrati-nextgen_admin',
+			'NextGEN Administration',
+			'Provides a framework for adding Administration pages',
+			'0.4',
+			'http://www.nextgen-gallery.com',
+			'Photocrati Media',
+			'http://www.photocrati.com'
+		);
+
+		include_once('class.nextgen_admin_installer.php');
+		C_Photocrati_Installer::add_handler($this->module_id, 'C_NextGen_Admin_Installer');
+
+		include_once('class.nextgen_admin_option_handler.php');
+		C_NextGen_Settings::add_option_handler('C_NextGen_Admin_Option_Handler', array(
+			'jquery_ui_theme',
+			'jquery_ui_theme_version',
+			'jquery_ui_theme_url'
+		));
+	}
+
+	/**
+	 * Register utilities necessary for this module (and the plugin)
+	 */
+	function _register_utilities()
+	{
+		// Provides a NextGEN Administation page
+		$this->get_registry()->add_utility(
+			'I_NextGen_Admin_Page',
+			'C_NextGen_Admin_Page_Controller'
+		);
+
+		$this->get_registry()->add_utility(
+			'I_Page_Manager',
+			'C_Page_Manager'
+		);
+
+		// Provides a form manager
+		$this->get_registry()->add_utility(
+			'I_Form_Manager',
+			'C_Form_Manager'
+		);
+
+		// Provides a form
+		$this->get_registry()->add_utility(
+			'I_Form',
+			'C_Form'
+		);
+	}
+
+	/**
+	 * Registers adapters required by this module
+	 */
+	function _register_adapters()
+	{
+		$this->get_registry()->add_adapter(
+			'I_MVC_Controller',
+			'A_MVC_Validation'
+		);
+
+        $this->get_registry()->add_adapter(
+			'I_Router',
+			'A_NextGen_Settings_Routes'
+		);
+
+		$this->get_registry()->add_adapter(
+			'I_Page_Manager',
+			'A_NextGen_Admin_Default_Pages'
+		);
+	}
+
+	/**
+	 * Hooks into the WordPress Framework
+	 */
+	function _register_hooks()
+	{
+        // Register scripts
+        add_action('init', array(&$this, 'register_scripts'));
+
+		// Provides menu options for managing NextGEN Settings
+		add_action('admin_menu', array(&$this, 'add_menu_pages'), 999);
+	}
+
+
+    function register_scripts()
+    {
+        $router = $this->get_registry()->get_utility('I_Router');
+        wp_register_script('gritter', $router->get_static_url('photocrati-nextgen_admin#gritter/gritter.min.js'), array('jquery'));
+        wp_register_style('gritter',  $router->get_static_url('photocrati-nextgen_admin#gritter/css/gritter.css'));
+        wp_register_script('ngg_progressbar', $router->get_static_url('photocrati-nextgen_admin#ngg_progressbar.js'), array('gritter'));
+        wp_register_style('ngg_progressbar', $router->get_static_url('photocrati-nextgen_admin#ngg_progressbar.css'), array('gritter'));
+        wp_register_style('select2', $router->get_static_url('photocrati-nextgen_admin#select2/select2.css'));
+        wp_register_script('select2', $router->get_static_url('photocrati-nextgen_admin#select2/select2.modded.js'));
+
+        $match = preg_quote("/wp-admin/post.php", "#");
+        if (preg_match("#{$match}#", $_SERVER['REQUEST_URI'])) {
+            wp_enqueue_script('ngg_progressbar');
+            wp_enqueue_style('ngg_progressbar');
+        }
+    }
+
+	/**
+	 * Adds menu pages to manage NextGen Settings
+	 * @uses action: admin_menu
+	 */
+	function add_menu_pages()
+	{
+		$this->get_registry()->get_utility('I_Page_Manager')->setup();
+	}
+
+    function get_type_list()
+    {
+        return array(
+            'A_Fs_Access_Page' => 'adapter.fs_access_page.php',
+            'A_Mvc_Validation' => 'adapter.mvc_validation.php',
+            'C_Nextgen_Admin_Installer' => 'class.nextgen_admin_installer.php',
+            'A_Nextgen_Admin_Default_Pages' => 'adapter.nextgen_admin_default_pages.php',
+            'A_Nextgen_Settings_Routes' => 'adapter.nextgen_settings_routes.php',
+            'C_Form' => 'class.form.php',
+            'C_Form_Manager' => 'class.form_manager.php',
+            'C_Nextgen_Admin_Page_Controller' => 'class.nextgen_admin_page_controller.php',
+            'C_Page_Manager' => 'class.page_manager.php',
+            'I_Form' => 'interface.form.php',
+            'I_Form_Manager' => 'interface.form_manager.php',
+            'I_Nextgen_Admin_Page' => 'interface.nextgen_admin_page.php',
+            'I_Nextgen_Settings' => 'interface.nextgen_settings.php',
+            'I_Page_Manager' => 'interface.page_manager.php'
+        );
+    }
+}
+
+new M_NextGen_Admin();
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/animation.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/animation.gif
new file mode 100644
index 0000000000000000000000000000000000000000..d61b3fd1fef1e416acabb9f674e8b3bcfd47a38f
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/animation.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/gritter/css/gritter.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/gritter/css/gritter.css
new file mode 100644
index 0000000000000000000000000000000000000000..7b1d130cd5e6901cc31cce9a7a2ddc5e4ea4464a
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/gritter/css/gritter.css
@@ -0,0 +1,101 @@
+/* the norm */
+#gritter-notice-wrapper {
+    position:fixed;
+    top:30px;
+    right:20px;
+    width:301px;
+    z-index: 999999;
+}
+#gritter-notice-wrapper.top-left {
+    left: 20px;
+    right: auto;
+}
+#gritter-notice-wrapper.bottom-right {
+    top: auto;
+    left: auto;
+    bottom: 20px;
+    right: 20px;
+}
+#gritter-notice-wrapper.bottom-left {
+    top: auto;
+    right: auto;
+    bottom: 20px;
+    left: 20px;
+}
+.gritter-item-wrapper {
+    position:relative;
+    margin:0 0 10px 0;
+    background:url('../images/ie-spacer.gif'); /* ie7/8 fix */
+}
+.gritter-top {
+    background:url(../images/gritter.png) no-repeat left -30px;
+    height:10px;
+}
+.hover .gritter-top {
+    background-position:right -30px;
+}
+.gritter-bottom {
+    background:url(../images/gritter.png) no-repeat left bottom;
+    height:8px;
+    margin:0;
+}
+.hover .gritter-bottom {
+    background-position: bottom right;
+}
+.gritter-item {
+    display:block;
+    background:url(../images/gritter.png) no-repeat left -40px;
+    color:#eee;
+    padding:2px 11px 8px 11px;
+    font-size: 11px;
+    font-family:verdana;
+}
+.hover .gritter-item {
+    background-position:right -40px;
+}
+.gritter-item p {
+    padding:0;
+    margin:0;
+    word-wrap:break-word;
+}
+.gritter-close {
+    display:none;
+    position:absolute;
+    top:5px;
+    right:3px;
+    background:url(../images/gritter.png) no-repeat left top;
+    cursor:pointer;
+    width:30px;
+    height:30px;
+}
+.gritter-title {
+    font-size:14px;
+    font-weight:bold;
+    padding:0 0 7px 0;
+    display:block;
+    text-shadow:1px 1px 0 #000; /* Not supported by IE :( */
+}
+.gritter-image {
+    width:48px;
+    height:48px;
+    float:left;
+}
+.gritter-with-image,
+.gritter-without-image {
+    padding:0;
+}
+.gritter-with-image {
+    width:220px;
+    float:right;
+}
+/* for the light (white) version of the gritter notice */
+.gritter-light .gritter-item,
+.gritter-light .gritter-bottom,
+.gritter-light .gritter-top,
+.gritter-light .gritter-close {
+    background-image: url(../images/gritter-light.png);
+    color: #222;
+}
+.gritter-light .gritter-title {
+    text-shadow: none;
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/gritter/gritter.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/gritter/gritter.min.js
new file mode 100644
index 0000000000000000000000000000000000000000..ff8c3f01ef85bdfaa7f4d3da530b9ca6cca7aa08
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/gritter/gritter.min.js
@@ -0,0 +1 @@
+(function(b){b.gritter={};b.gritter.options={position:"",class_name:"",fade_in_speed:"medium",fade_out_speed:1000,time:6000};b.gritter.add=function(f){try{return a.add(f||{})}catch(d){var c="Gritter Error: "+d;(typeof(console)!="undefined"&&console.error)?console.error(c,f):alert(c)}};b.gritter.remove=function(d,c){a.removeSpecific(d,c||{})};b.gritter.removeAll=function(c){a.stop(c||{})};var a={position:"",fade_in_speed:"",fade_out_speed:"",time:"",_custom_timer:0,_item_count:0,_is_setup:0,_tpl_close:'<div class="gritter-close"></div>',_tpl_title:'<span class="gritter-title">[[title]]</span>',_tpl_item:'<div id="gritter-item-[[number]]" class="gritter-item-wrapper [[item_class]]" style="display:none"><div class="gritter-top"></div><div class="gritter-item">[[close]][[image]]<div class="[[class_name]]">[[title]]<p>[[text]]</p></div><div style="clear:both"></div></div><div class="gritter-bottom"></div></div>',_tpl_wrap:'<div id="gritter-notice-wrapper"></div>',add:function(g){if(typeof(g)=="string"){g={text:g}}if(g.text===null){throw'You must supply "text" parameter.'}if(!this._is_setup){this._runSetup()}var k=g.title,n=g.text,e=g.image||"",l=g.sticky||false,m=g.class_name||b.gritter.options.class_name,j=b.gritter.options.position,d=g.time||"";this._verifyWrapper();this._item_count++;var f=this._item_count,i=this._tpl_item;b(["before_open","after_open","before_close","after_close"]).each(function(p,q){a["_"+q+"_"+f]=(b.isFunction(g[q]))?g[q]:function(){}});this._custom_timer=0;if(d){this._custom_timer=d}var c=(e!="")?'<img src="'+e+'" class="gritter-image" />':"",h=(e!="")?"gritter-with-image":"gritter-without-image";if(k){k=this._str_replace("[[title]]",k,this._tpl_title)}else{k=""}i=this._str_replace(["[[title]]","[[text]]","[[close]]","[[image]]","[[number]]","[[class_name]]","[[item_class]]"],[k,n,this._tpl_close,c,this._item_count,h,m],i);if(this["_before_open_"+f]()===false){return false}b("#gritter-notice-wrapper").addClass(j).append(i);var o=b("#gritter-item-"+this._item_count);o.fadeIn(this.fade_in_speed,function(){a["_after_open_"+f](b(this))});if(!l){this._setFadeTimer(o,f)}b(o).bind("mouseenter mouseleave",function(p){if(p.type=="mouseenter"){if(!l){a._restoreItemIfFading(b(this),f)}}else{if(!l){a._setFadeTimer(b(this),f)}}a._hoverState(b(this),p.type)});b(o).find(".gritter-close").click(function(){a.removeSpecific(f,{},null,true)});return f},_countRemoveWrapper:function(c,d,f){d.remove();this["_after_close_"+c](d,f);if(b(".gritter-item-wrapper").length==0){b("#gritter-notice-wrapper").remove()}},_fade:function(g,d,j,f){var j=j||{},i=(typeof(j.fade)!="undefined")?j.fade:true,c=j.speed||this.fade_out_speed,h=f;this["_before_close_"+d](g,h);if(f){g.unbind("mouseenter mouseleave")}if(i){g.animate({opacity:0},c,function(){g.animate({height:0},300,function(){a._countRemoveWrapper(d,g,h)})})}else{this._countRemoveWrapper(d,g)}},_hoverState:function(d,c){if(c=="mouseenter"){d.addClass("hover");d.find(".gritter-close").show()}else{d.removeClass("hover");d.find(".gritter-close").hide()}},removeSpecific:function(c,g,f,d){if(!f){var f=b("#gritter-item-"+c)}this._fade(f,c,g||{},d)},_restoreItemIfFading:function(d,c){clearTimeout(this["_int_id_"+c]);d.stop().css({opacity:"",height:""})},_runSetup:function(){for(opt in b.gritter.options){this[opt]=b.gritter.options[opt]}this._is_setup=1},_setFadeTimer:function(f,d){var c=(this._custom_timer)?this._custom_timer:this.time;this["_int_id_"+d]=setTimeout(function(){a._fade(f,d)},c)},stop:function(e){var c=(b.isFunction(e.before_close))?e.before_close:function(){};var f=(b.isFunction(e.after_close))?e.after_close:function(){};var d=b("#gritter-notice-wrapper");c(d);d.fadeOut(function(){b(this).remove();f()})},_str_replace:function(v,e,o,n){var k=0,h=0,t="",m="",g=0,q=0,l=[].concat(v),c=[].concat(e),u=o,d=c instanceof Array,p=u instanceof Array;u=[].concat(u);if(n){this.window[n]=0}for(k=0,g=u.length;k<g;k++){if(u[k]===""){continue}for(h=0,q=l.length;h<q;h++){t=u[k]+"";m=d?(c[h]!==undefined?c[h]:""):c[0];u[k]=(t).split(l[h]).join(m);if(n&&u[k]!==t){this.window[n]+=(t.length-u[k].length)/l[h].length}}}return p?u:u[0]},_verifyWrapper:function(){if(b("#gritter-notice-wrapper").length==0){b("body").append(this._tpl_wrap)}}}})(jQuery);
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/gritter/images/gritter-light.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/gritter/images/gritter-light.png
new file mode 100644
index 0000000000000000000000000000000000000000..1b5238efc5d524014046ad5cd90ab1024c9ba250
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/gritter/images/gritter-light.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/gritter/images/gritter-long.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/gritter/images/gritter-long.png
new file mode 100644
index 0000000000000000000000000000000000000000..578b89104feb2460a821b8543be29c50008666b6
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/gritter/images/gritter-long.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/gritter/images/gritter.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/gritter/images/gritter.png
new file mode 100644
index 0000000000000000000000000000000000000000..0ca3bc0a0f8068194082db9719d6e20a8645985f
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/gritter/images/gritter.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/gritter/images/ie-spacer.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/gritter/images/ie-spacer.gif
new file mode 100644
index 0000000000000000000000000000000000000000..5bfd67a2d6f72ac3a55cbfcea5866e841d22f5d9
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/gritter/images/ie-spacer.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/gritter/images/trees.jpg b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/gritter/images/trees.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..00b2d5d7acbf85458a799bb33d1968243acd6a8c
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/gritter/images/trees.jpg differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/information.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/information.png
new file mode 100644
index 0000000000000000000000000000000000000000..60a3aac3aa2ef1a78e7a8f362ae0ba9f52fa5840
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/information.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/nextgen-logo-small.jpg b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/nextgen-logo-small.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..580d0b4338ad7a6a063573994962b2dd84ebf684
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/nextgen-logo-small.jpg differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-bg_flat_0_aaaaaa_40x100.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-bg_flat_0_aaaaaa_40x100.png
new file mode 100644
index 0000000000000000000000000000000000000000..5b5dab2ab7b1c50dea9cfe73dc5a269a92d2d4b4
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-bg_flat_0_aaaaaa_40x100.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-bg_flat_65_ececec_40x100.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-bg_flat_65_ececec_40x100.png
new file mode 100644
index 0000000000000000000000000000000000000000..78457140c37667b5bd60074bfa403df2d58c9ebc
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-bg_flat_65_ececec_40x100.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-bg_flat_75_ffffff_40x100.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-bg_flat_75_ffffff_40x100.png
new file mode 100644
index 0000000000000000000000000000000000000000..ac8b229af950c29356abf64a6c4aa894575445f0
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-bg_flat_75_ffffff_40x100.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-bg_glass_55_ffffe0_1x400.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-bg_glass_55_ffffe0_1x400.png
new file mode 100644
index 0000000000000000000000000000000000000000..e74334377f31331ff7e35edf99af466b8b6883c0
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-bg_glass_55_ffffe0_1x400.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-bg_glass_95_ffebe8_1x400.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-bg_glass_95_ffebe8_1x400.png
new file mode 100644
index 0000000000000000000000000000000000000000..5dd9675d326cc5738a117b078cd1deec79c8baef
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-bg_glass_95_ffebe8_1x400.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-bg_highlight-hard_75_ececec_1x100.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-bg_highlight-hard_75_ececec_1x100.png
new file mode 100644
index 0000000000000000000000000000000000000000..e6766510116d18abb68bf7edab6377bc84be272e
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-bg_highlight-hard_75_ececec_1x100.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-bg_highlight-soft_75_ececec_1x100.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-bg_highlight-soft_75_ececec_1x100.png
new file mode 100644
index 0000000000000000000000000000000000000000..84041634ed81f3376054a84ee8a57bea30382053
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-bg_highlight-soft_75_ececec_1x100.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-bg_inset-hard_75_ececec_1x100.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-bg_inset-hard_75_ececec_1x100.png
new file mode 100644
index 0000000000000000000000000000000000000000..46f974296a25e7698adf6b26bfad8b3acac23e4a
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-bg_inset-hard_75_ececec_1x100.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-icons-photocrati.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-icons-photocrati.png
new file mode 100644
index 0000000000000000000000000000000000000000..acd45b8bcc4951519bf8b41a26fade87bcc417ce
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-icons-photocrati.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-icons_21759b_256x240.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-icons_21759b_256x240.png
new file mode 100644
index 0000000000000000000000000000000000000000..a41a5e6fdc5ae183345aff3f2b445d6c09d27049
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-icons_21759b_256x240.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-icons_333333_256x240.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-icons_333333_256x240.png
new file mode 100644
index 0000000000000000000000000000000000000000..fe079a59506b5df3307dc763b574c492ce81ce9c
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-icons_333333_256x240.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-icons_999999_256x240.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-icons_999999_256x240.png
new file mode 100644
index 0000000000000000000000000000000000000000..50ff803dceabc920d514d6a41634fe4388b6c128
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-icons_999999_256x240.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-icons_cc0000_256x240.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-icons_cc0000_256x240.png
new file mode 100644
index 0000000000000000000000000000000000000000..03a953b0dd87d7a6893b2d150ebc1beab6d8a384
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/images/ui-icons_cc0000_256x240.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/jquery-ui-1.9.1.custom.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/jquery-ui-1.9.1.custom.css
new file mode 100644
index 0000000000000000000000000000000000000000..6c2835b142b1077033a1747cf929fea2dd3b1df5
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/jquery-ui-1.9.1.custom.css
@@ -0,0 +1,1887 @@
+/*! jQuery UI - v1.9.1 - 2012-11-05
+* http://jqueryui.com
+* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
+* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=sans-serif&fwDefault=normal&fsDefault=12px&cornerRadius=4px&bgColorHeader=ececec&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=dfdfdf&fcHeader=333333&iconColorHeader=999999&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=dfdfdf&fcContent=333333&iconColorContent=333333&bgColorDefault=ececec&bgTextureDefault=04_highlight_hard.png&bgImgOpacityDefault=75&borderColorDefault=dfdfdf&fcDefault=333333&iconColorDefault=333333&bgColorHover=ececec&bgTextureHover=06_inset_hard.png&bgImgOpacityHover=75&borderColorHover=cccccc&fcHover=000000&iconColorHover=333333&bgColorActive=ececec&bgTextureActive=01_flat.png&bgImgOpacityActive=65&borderColorActive=dfdfdf&fcActive=333333&iconColorActive=333333&bgColorHighlight=ffffe0&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=e6db55&fcHighlight=333333&iconColorHighlight=21759b&bgColorError=ffebe8&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cc0000&fcError=cc0000&iconColorError=cc0000&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=3px
+* Copyright (c) 2012 jQuery Foundation and other contributors Licensed MIT */
+/* This theme is made to look like the Wordpress style when possible */
+/* This file is presented as-is from jqueryui.com; scroll to line ~1812 to find changes */
+
+/* Layout helpers
+----------------------------------*/
+.ui-helper-hidden {
+    display: none;
+}
+
+.ui-helper-hidden-accessible {
+    position: absolute !important;
+    clip: rect(1px 1px 1px 1px);
+    clip: rect(1px, 1px, 1px, 1px);
+}
+
+.ui-helper-reset {
+    margin: 0;
+    padding: 0;
+    border: 0;
+    outline: 0;
+    line-height: 1.3;
+    text-decoration: none;
+    font-size: 100%;
+    list-style: none;
+}
+
+.ui-helper-clearfix:before, .ui-helper-clearfix:after {
+    content: "";
+    display: table;
+}
+
+.ui-helper-clearfix:after {
+    clear: both;
+}
+
+.ui-helper-clearfix {
+    zoom: 1;
+}
+
+.ui-helper-zfix {
+    width: 100%;
+    height: 100%;
+    top: 0;
+    left: 0;
+    position: absolute;
+    opacity: 0;
+    filter: Alpha(Opacity = 0);
+}
+
+/* Interaction Cues
+----------------------------------*/
+.ui-state-disabled {
+    cursor: default !important;
+}
+
+/* Icons
+----------------------------------*/
+
+/* states and images */
+.ui-icon {
+    display: block;
+    text-indent: -99999px;
+    overflow: hidden;
+    background-repeat: no-repeat;
+}
+
+/* Misc visuals
+----------------------------------*/
+
+/* Overlays */
+.ui-widget-overlay {
+    position: absolute;
+    top: 0;
+    left: 0;
+    width: 100%;
+    height: 100%;
+}
+
+.ui-resizable {
+    position: relative;
+}
+
+.ui-resizable-handle {
+    position: absolute;
+    font-size: 0.1px;
+    display: block;
+}
+
+.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle {
+    display: none;
+}
+
+.ui-resizable-n {
+    cursor: n-resize;
+    height: 7px;
+    width: 100%;
+    top: -5px;
+    left: 0;
+}
+
+.ui-resizable-s {
+    cursor: s-resize;
+    height: 7px;
+    width: 100%;
+    bottom: -5px;
+    left: 0;
+}
+
+.ui-resizable-e {
+    cursor: e-resize;
+    width: 7px;
+    right: -5px;
+    top: 0;
+    height: 100%;
+}
+
+.ui-resizable-w {
+    cursor: w-resize;
+    width: 7px;
+    left: -5px;
+    top: 0;
+    height: 100%;
+}
+
+.ui-resizable-se {
+    cursor: se-resize;
+    width: 12px;
+    height: 12px;
+    right: 1px;
+    bottom: 1px;
+}
+
+.ui-resizable-sw {
+    cursor: sw-resize;
+    width: 9px;
+    height: 9px;
+    left: -5px;
+    bottom: -5px;
+}
+
+.ui-resizable-nw {
+    cursor: nw-resize;
+    width: 9px;
+    height: 9px;
+    left: -5px;
+    top: -5px;
+}
+
+.ui-resizable-ne {
+    cursor: ne-resize;
+    width: 9px;
+    height: 9px;
+    right: -5px;
+    top: -5px;
+}
+
+.ui-selectable-helper {
+    position: absolute;
+    z-index: 100;
+    border: 1px dotted black;
+}
+
+.ui-accordion .ui-accordion-header {
+    display: block;
+    cursor: pointer;
+    position: relative;
+    margin-top: 2px;
+    padding: .5em .5em .5em .7em;
+    zoom: 1;
+}
+
+.ui-accordion .ui-accordion-icons {
+    padding-left: 2.2em;
+}
+
+.ui-accordion .ui-accordion-noicons {
+    padding-left: .7em;
+}
+
+.ui-accordion .ui-accordion-icons .ui-accordion-icons {
+    padding-left: 2.2em;
+}
+
+.ui-accordion .ui-accordion-header .ui-accordion-header-icon {
+    position: absolute;
+    left: .5em;
+    top: 50%;
+    margin-top: -8px;
+}
+
+.ui-accordion .ui-accordion-content {
+    padding: 1em 2.2em;
+    border-top: 0;
+    overflow: auto;
+    zoom: 1;
+}
+
+.ui-autocomplete {
+    position: absolute;
+    top: 0; /* #8656 */
+    cursor: default;
+}
+
+/* workarounds */
+* html .ui-autocomplete {
+    width: 1px;
+}
+
+/* without this, the menu expands to 100% in IE6 */
+.ui-button {
+    display: inline-block;
+    position: relative;
+    padding: 0;
+    margin-right: .1em;
+    cursor: pointer;
+    text-align: center;
+    zoom: 1;
+    overflow: visible;
+}
+
+/* the overflow property removes extra width in IE */
+.ui-button, .ui-button:link, .ui-button:visited, .ui-button:hover, .ui-button:active {
+    text-decoration: none;
+}
+
+.ui-button-icon-only {
+    width: 2.2em;
+}
+
+/* to make room for the icon, a width needs to be set here */
+button.ui-button-icon-only {
+    width: 2.4em;
+}
+
+/* button elements seem to need a little more width */
+.ui-button-icons-only {
+    width: 3.4em;
+}
+
+button.ui-button-icons-only {
+    width: 3.7em;
+}
+
+/*button text element */
+.ui-button .ui-button-text {
+    display: block;
+    line-height: 1.4;
+}
+
+.ui-button-text-only .ui-button-text {
+    padding: .4em 1em;
+}
+
+.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text {
+    padding: .4em;
+    text-indent: -9999999px;
+}
+
+.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text {
+    padding: .4em 1em .4em 2.1em;
+}
+
+.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text {
+    padding: .4em 2.1em .4em 1em;
+}
+
+.ui-button-text-icons .ui-button-text {
+    padding-left: 2.1em;
+    padding-right: 2.1em;
+}
+
+/* no icon support for input elements, provide padding by default */
+input.ui-button {
+    padding: .4em 1em;
+}
+
+/*button icon element(s) */
+.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon {
+    position: absolute;
+    top: 50%;
+    margin-top: -8px;
+}
+
+.ui-button-icon-only .ui-icon {
+    left: 50%;
+    margin-left: -8px;
+}
+
+.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary {
+    left: .5em;
+}
+
+.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary {
+    right: .5em;
+}
+
+.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary {
+    right: .5em;
+}
+
+/*button sets*/
+.ui-buttonset {
+    margin-right: 7px;
+}
+
+.ui-buttonset .ui-button {
+    margin-left: 0;
+    margin-right: -.3em;
+}
+
+/* workarounds */
+button.ui-button::-moz-focus-inner {
+    border: 0;
+    padding: 0;
+}
+
+/* reset extra padding in Firefox */
+.ui-datepicker {
+    width: 17em;
+    padding: .2em .2em 0;
+    display: none;
+}
+
+.ui-datepicker .ui-datepicker-header {
+    position: relative;
+    padding: .2em 0;
+}
+
+.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next {
+    position: absolute;
+    top: 2px;
+    width: 1.8em;
+    height: 1.8em;
+}
+
+.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover {
+    top: 1px;
+}
+
+.ui-datepicker .ui-datepicker-prev {
+    left: 2px;
+}
+
+.ui-datepicker .ui-datepicker-next {
+    right: 2px;
+}
+
+.ui-datepicker .ui-datepicker-prev-hover {
+    left: 1px;
+}
+
+.ui-datepicker .ui-datepicker-next-hover {
+    right: 1px;
+}
+
+.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span {
+    display: block;
+    position: absolute;
+    left: 50%;
+    margin-left: -8px;
+    top: 50%;
+    margin-top: -8px;
+}
+
+.ui-datepicker .ui-datepicker-title {
+    margin: 0 2.3em;
+    line-height: 1.8em;
+    text-align: center;
+}
+
+.ui-datepicker .ui-datepicker-title select {
+    font-size: 1em;
+    margin: 1px 0;
+}
+
+.ui-datepicker select.ui-datepicker-month-year {
+    width: 100%;
+}
+
+.ui-datepicker select.ui-datepicker-month,
+.ui-datepicker select.ui-datepicker-year {
+    width: 49%;
+}
+
+.ui-datepicker table {
+    width: 100%;
+    font-size: .9em;
+    border-collapse: collapse;
+    margin: 0 0 .4em;
+}
+
+.ui-datepicker th {
+    padding: .7em .3em;
+    text-align: center;
+    font-weight: bold;
+    border: 0;
+}
+
+.ui-datepicker td {
+    border: 0;
+    padding: 1px;
+}
+
+.ui-datepicker td span, .ui-datepicker td a {
+    display: block;
+    padding: .2em;
+    text-align: right;
+    text-decoration: none;
+}
+
+.ui-datepicker .ui-datepicker-buttonpane {
+    background-image: none;
+    margin: .7em 0 0 0;
+    padding: 0 .2em;
+    border-left: 0;
+    border-right: 0;
+    border-bottom: 0;
+}
+
+.ui-datepicker .ui-datepicker-buttonpane button {
+    float: right;
+    margin: .5em .2em .4em;
+    cursor: pointer;
+    padding: .2em .6em .3em .6em;
+    width: auto;
+    overflow: visible;
+}
+
+.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
+    float: left;
+}
+
+/* with multiple calendars */
+.ui-datepicker.ui-datepicker-multi {
+    width: auto;
+}
+
+.ui-datepicker-multi .ui-datepicker-group {
+    float: left;
+}
+
+.ui-datepicker-multi .ui-datepicker-group table {
+    width: 95%;
+    margin: 0 auto .4em;
+}
+
+.ui-datepicker-multi-2 .ui-datepicker-group {
+    width: 50%;
+}
+
+.ui-datepicker-multi-3 .ui-datepicker-group {
+    width: 33.3%;
+}
+
+.ui-datepicker-multi-4 .ui-datepicker-group {
+    width: 25%;
+}
+
+.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header {
+    border-left-width: 0;
+}
+
+.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
+    border-left-width: 0;
+}
+
+.ui-datepicker-multi .ui-datepicker-buttonpane {
+    clear: left;
+}
+
+.ui-datepicker-row-break {
+    clear: both;
+    width: 100%;
+    font-size: 0em;
+}
+
+/* RTL support */
+.ui-datepicker-rtl {
+    direction: rtl;
+}
+
+.ui-datepicker-rtl .ui-datepicker-prev {
+    right: 2px;
+    left: auto;
+}
+
+.ui-datepicker-rtl .ui-datepicker-next {
+    left: 2px;
+    right: auto;
+}
+
+.ui-datepicker-rtl .ui-datepicker-prev:hover {
+    right: 1px;
+    left: auto;
+}
+
+.ui-datepicker-rtl .ui-datepicker-next:hover {
+    left: 1px;
+    right: auto;
+}
+
+.ui-datepicker-rtl .ui-datepicker-buttonpane {
+    clear: right;
+}
+
+.ui-datepicker-rtl .ui-datepicker-buttonpane button {
+    float: left;
+}
+
+.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current {
+    float: right;
+}
+
+.ui-datepicker-rtl .ui-datepicker-group {
+    float: right;
+}
+
+.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header {
+    border-right-width: 0;
+    border-left-width: 1px;
+}
+
+.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
+    border-right-width: 0;
+    border-left-width: 1px;
+}
+
+/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
+.ui-datepicker-cover {
+    position: absolute; /*must have*/
+    z-index: -1; /*must have*/
+    filter: mask(); /*must have*/
+    top: -4px; /*must have*/
+    left: -4px; /*must have*/
+    width: 200px; /*must have*/
+    height: 200px; /*must have*/
+}
+
+.ui-dialog {
+    position: absolute;
+    padding: .2em;
+    width: 300px;
+    overflow: hidden;
+}
+
+.ui-dialog .ui-dialog-titlebar {
+    padding: .4em 1em;
+    position: relative;
+}
+
+.ui-dialog .ui-dialog-title {
+    float: left;
+    margin: .1em 16px .1em 0;
+}
+
+.ui-dialog .ui-dialog-titlebar-close {
+    position: absolute;
+    right: .3em;
+    top: 50%;
+    width: 19px;
+    margin: -10px 0 0 0;
+    padding: 1px;
+    height: 18px;
+}
+
+.ui-dialog .ui-dialog-titlebar-close span {
+    display: block;
+    /*margin: 1px; -- breaks WP 3.6 */
+}
+
+.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus {
+    padding: 0;
+}
+
+.ui-dialog .ui-dialog-content {
+    position: relative;
+    border: 0;
+    padding: .5em 1em;
+    background: none;
+    overflow: auto;
+    zoom: 1;
+}
+
+.ui-dialog .ui-dialog-buttonpane {
+    text-align: left;
+    border-width: 1px 0 0 0;
+    background-image: none;
+    margin: .5em 0 0 0;
+    padding: .3em 1em .5em .4em;
+}
+
+.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
+    float: right;
+}
+
+.ui-dialog .ui-dialog-buttonpane button {
+    margin: .5em .4em .5em 0;
+    cursor: pointer;
+}
+
+.ui-dialog .ui-resizable-se {
+    width: 14px;
+    height: 14px;
+    right: 3px;
+    bottom: 3px;
+}
+
+.ui-draggable .ui-dialog-titlebar {
+    cursor: move;
+}
+
+.ui-menu {
+    list-style: none;
+    padding: 2px;
+    margin: 0;
+    display: block;
+    outline: none;
+}
+
+.ui-menu .ui-menu {
+    margin-top: -3px;
+    position: absolute;
+}
+
+.ui-menu .ui-menu-item {
+    margin: 0;
+    padding: 0;
+    zoom: 1;
+    width: 100%;
+}
+
+.ui-menu .ui-menu-divider {
+    margin: 5px -2px 5px -2px;
+    height: 0;
+    font-size: 0;
+    line-height: 0;
+    border-width: 1px 0 0 0;
+}
+
+.ui-menu .ui-menu-item a {
+    text-decoration: none;
+    display: block;
+    padding: 2px .4em;
+    line-height: 1.5;
+    zoom: 1;
+    font-weight: normal;
+}
+
+.ui-menu .ui-menu-item a.ui-state-focus,
+.ui-menu .ui-menu-item a.ui-state-active {
+    font-weight: normal;
+    margin: -1px;
+}
+
+.ui-menu .ui-state-disabled {
+    font-weight: normal;
+    margin: .4em 0 .2em;
+    line-height: 1.5;
+}
+
+.ui-menu .ui-state-disabled a {
+    cursor: default;
+}
+
+/* icon support */
+.ui-menu-icons {
+    position: relative;
+}
+
+.ui-menu-icons .ui-menu-item a {
+    position: relative;
+    padding-left: 2em;
+}
+
+/* left-aligned */
+.ui-menu .ui-icon {
+    position: absolute;
+    top: .2em;
+    left: .2em;
+}
+
+/* right-aligned */
+.ui-menu .ui-menu-icon {
+    position: static;
+    float: right;
+}
+
+.ui-progressbar {
+    height: 2em;
+    text-align: left;
+    overflow: hidden;
+}
+
+.ui-progressbar .ui-progressbar-value {
+    margin: -1px;
+    height: 100%;
+}
+
+.ui-slider {
+    position: relative;
+    text-align: left;
+}
+
+.ui-slider .ui-slider-handle {
+    position: absolute;
+    z-index: 2;
+    width: 1.2em;
+    height: 1.2em;
+    cursor: default;
+}
+
+.ui-slider .ui-slider-range {
+    position: absolute;
+    z-index: 1;
+    font-size: .7em;
+    display: block;
+    border: 0;
+    background-position: 0 0;
+}
+
+.ui-slider-horizontal {
+    height: .8em;
+}
+
+.ui-slider-horizontal .ui-slider-handle {
+    top: -.3em;
+    margin-left: -.6em;
+}
+
+.ui-slider-horizontal .ui-slider-range {
+    top: 0;
+    height: 100%;
+}
+
+.ui-slider-horizontal .ui-slider-range-min {
+    left: 0;
+}
+
+.ui-slider-horizontal .ui-slider-range-max {
+    right: 0;
+}
+
+.ui-slider-vertical {
+    width: .8em;
+    height: 100px;
+}
+
+.ui-slider-vertical .ui-slider-handle {
+    left: -.3em;
+    margin-left: 0;
+    margin-bottom: -.6em;
+}
+
+.ui-slider-vertical .ui-slider-range {
+    left: 0;
+    width: 100%;
+}
+
+.ui-slider-vertical .ui-slider-range-min {
+    bottom: 0;
+}
+
+.ui-slider-vertical .ui-slider-range-max {
+    top: 0;
+}
+
+.ui-spinner {
+    position: relative;
+    display: inline-block;
+    overflow: hidden;
+    padding: 0;
+    vertical-align: middle;
+}
+
+.ui-spinner-input {
+    border: none;
+    background: none;
+    padding: 0;
+    margin: .2em 0;
+    vertical-align: middle;
+    margin-left: .4em;
+    margin-right: 22px;
+}
+
+.ui-spinner-button {
+    width: 16px;
+    height: 50%;
+    font-size: .5em;
+    padding: 0;
+    margin: 0;
+    text-align: center;
+    position: absolute;
+    cursor: default;
+    display: block;
+    overflow: hidden;
+    right: 0;
+}
+
+.ui-spinner a.ui-spinner-button {
+    border-top: none;
+    border-bottom: none;
+    border-right: none;
+}
+
+/* more specificity required here to overide default borders */
+.ui-spinner .ui-icon {
+    position: absolute;
+    margin-top: -8px;
+    top: 50%;
+    left: 0;
+}
+
+/* vertical centre icon */
+.ui-spinner-up {
+    top: 0;
+}
+
+.ui-spinner-down {
+    bottom: 0;
+}
+
+/* TR overrides */
+.ui-spinner .ui-icon-triangle-1-s {
+    /* need to fix icons sprite */
+    background-position: -65px -16px;
+}
+
+.ui-tabs {
+    position: relative;
+    padding: .2em;
+    zoom: 1;
+}
+
+/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
+.ui-tabs .ui-tabs-nav {
+    margin: 0;
+    padding: .2em .2em 0;
+}
+
+.ui-tabs .ui-tabs-nav li {
+    list-style: none;
+    float: left;
+    position: relative;
+    top: 0;
+    margin: 1px .2em 0 0;
+    border-bottom: 0;
+    padding: 0;
+    white-space: nowrap;
+}
+
+.ui-tabs .ui-tabs-nav li a {
+    float: left;
+    padding: .5em 1em;
+    text-decoration: none;
+}
+
+.ui-tabs .ui-tabs-nav li.ui-tabs-active {
+    margin-bottom: -1px;
+    padding-bottom: 1px;
+}
+
+.ui-tabs .ui-tabs-nav li.ui-tabs-active a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-tabs-loading a {
+    cursor: text;
+}
+
+.ui-tabs .ui-tabs-nav li a, .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a {
+    cursor: pointer;
+}
+
+/* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
+.ui-tabs .ui-tabs-panel {
+    display: block;
+    border-width: 0;
+    padding: 1em 1.4em;
+    background: none;
+}
+
+.ui-tooltip {
+    padding: 8px;
+    position: absolute;
+    z-index: 9999;
+    max-width: 300px;
+    -webkit-box-shadow: 0 0 5px #aaa;
+    box-shadow: 0 0 5px #aaa;
+}
+
+/* Fades and background-images don't work well together in IE6, drop the image */
+* html .ui-tooltip {
+    background-image: none;
+}
+
+body .ui-tooltip {
+    border-width: 2px;
+}
+
+/* Component containers
+----------------------------------*/
+.ui-widget {
+    font-family: sans-serif;
+    font-size: 12px;
+}
+
+.ui-widget .ui-widget {
+    font-size: 1em;
+}
+
+.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button {
+    font-family: sans-serif;
+    font-size: 1em;
+}
+
+.ui-widget-content {
+    border: 1px solid #dfdfdf;
+    background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;
+    color: #333333;
+}
+
+.ui-widget-content a {
+    color: #333333;
+}
+
+.ui-widget-header {
+    border: 1px solid #dfdfdf;
+    background: #ececec url(images/ui-bg_highlight-soft_75_ececec_1x100.png) 50% 50% repeat-x;
+    color: #333333;
+    font-weight: bold;
+}
+
+.ui-widget-header a {
+    color: #333333;
+}
+
+/* Interaction states
+----------------------------------*/
+.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default {
+    border: 1px solid #dfdfdf;
+    background: #ececec url(images/ui-bg_highlight-hard_75_ececec_1x100.png) 50% 50% repeat-x;
+    font-weight: normal;
+    color: #333333;
+}
+
+.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited {
+    color: #333333;
+    text-decoration: none;
+}
+
+.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus {
+    border: 1px solid #cccccc;
+    background: #ececec url(images/ui-bg_inset-hard_75_ececec_1x100.png) 50% 50% repeat-x;
+    font-weight: normal;
+    color: #000000;
+}
+
+.ui-state-hover a, .ui-state-hover a:hover, .ui-state-hover a:link, .ui-state-hover a:visited {
+    color: #000000;
+    text-decoration: none;
+}
+
+.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active {
+    border: 1px solid #dfdfdf;
+    background: #ececec url(images/ui-bg_flat_65_ececec_40x100.png) 50% 50% repeat-x;
+    font-weight: normal;
+    color: #333333;
+}
+
+.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited {
+    color: #333333;
+    text-decoration: none;
+}
+
+/* Interaction Cues
+----------------------------------*/
+.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {
+    border: 1px solid #e6db55;
+    background: #ffffe0 url(images/ui-bg_glass_55_ffffe0_1x400.png) 50% 50% repeat-x;
+    color: #333333;
+}
+
+.ui-state-highlight a, .ui-widget-content .ui-state-highlight a, .ui-widget-header .ui-state-highlight a {
+    color: #333333;
+}
+
+.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {
+    border: 1px solid #cc0000;
+    background: #ffebe8 url(images/ui-bg_glass_95_ffebe8_1x400.png) 50% 50% repeat-x;
+    color: #cc0000;
+}
+
+.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a {
+    color: #cc0000;
+}
+
+.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text {
+    color: #cc0000;
+}
+
+.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary {
+    font-weight: bold;
+}
+
+.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary {
+    opacity: .7;
+    filter: Alpha(Opacity = 70);
+    font-weight: normal;
+}
+
+.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled {
+    opacity: .35;
+    filter: Alpha(Opacity = 35);
+    background-image: none;
+}
+
+.ui-state-disabled .ui-icon {
+    filter: Alpha(Opacity = 35);
+}
+
+/* For IE8 - See #6059 */
+
+/* Icons
+----------------------------------*/
+
+/* states and images */
+.ui-icon {
+    width: 16px;
+    height: 16px;
+    background-image: url(images/ui-icons_333333_256x240.png);
+}
+
+.ui-widget-content .ui-icon {
+    background-image: url(images/ui-icons_333333_256x240.png);
+}
+
+.ui-widget-header .ui-icon {
+    background-image: url(images/ui-icons_999999_256x240.png);
+}
+
+.ui-state-default .ui-icon {
+    background-image: url(images/ui-icons_333333_256x240.png);
+}
+
+.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {
+    background-image: url(images/ui-icons_333333_256x240.png);
+}
+
+.ui-state-active .ui-icon {
+    background-image: url(images/ui-icons_333333_256x240.png);
+}
+
+.ui-state-highlight .ui-icon {
+    background-image: url(images/ui-icons_21759b_256x240.png);
+}
+
+.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {
+    background-image: url(images/ui-icons_cc0000_256x240.png);
+}
+
+/* positioning */
+.ui-icon-carat-1-n {
+    background-position: 0 0;
+}
+
+.ui-icon-carat-1-ne {
+    background-position: -16px 0;
+}
+
+.ui-icon-carat-1-e {
+    background-position: -32px 0;
+}
+
+.ui-icon-carat-1-se {
+    background-position: -48px 0;
+}
+
+.ui-icon-carat-1-s {
+    background-position: -64px 0;
+}
+
+.ui-icon-carat-1-sw {
+    background-position: -80px 0;
+}
+
+.ui-icon-carat-1-w {
+    background-position: -96px 0;
+}
+
+.ui-icon-carat-1-nw {
+    background-position: -112px 0;
+}
+
+.ui-icon-carat-2-n-s {
+    background-position: -128px 0;
+}
+
+.ui-icon-carat-2-e-w {
+    background-position: -144px 0;
+}
+
+.ui-icon-triangle-1-n {
+    background-position: 0 -16px;
+}
+
+.ui-icon-triangle-1-ne {
+    background-position: -16px -16px;
+}
+
+.ui-icon-triangle-1-e {
+    background-position: -32px -16px;
+}
+
+.ui-icon-triangle-1-se {
+    background-position: -48px -16px;
+}
+
+.ui-icon-triangle-1-s {
+    background-position: -64px -16px;
+}
+
+.ui-icon-triangle-1-sw {
+    background-position: -80px -16px;
+}
+
+.ui-icon-triangle-1-w {
+    background-position: -96px -16px;
+}
+
+.ui-icon-triangle-1-nw {
+    background-position: -112px -16px;
+}
+
+.ui-icon-triangle-2-n-s {
+    background-position: -128px -16px;
+}
+
+.ui-icon-triangle-2-e-w {
+    background-position: -144px -16px;
+}
+
+.ui-icon-arrow-1-n {
+    background-position: 0 -32px;
+}
+
+.ui-icon-arrow-1-ne {
+    background-position: -16px -32px;
+}
+
+.ui-icon-arrow-1-e {
+    background-position: -32px -32px;
+}
+
+.ui-icon-arrow-1-se {
+    background-position: -48px -32px;
+}
+
+.ui-icon-arrow-1-s {
+    background-position: -64px -32px;
+}
+
+.ui-icon-arrow-1-sw {
+    background-position: -80px -32px;
+}
+
+.ui-icon-arrow-1-w {
+    background-position: -96px -32px;
+}
+
+.ui-icon-arrow-1-nw {
+    background-position: -112px -32px;
+}
+
+.ui-icon-arrow-2-n-s {
+    background-position: -128px -32px;
+}
+
+.ui-icon-arrow-2-ne-sw {
+    background-position: -144px -32px;
+}
+
+.ui-icon-arrow-2-e-w {
+    background-position: -160px -32px;
+}
+
+.ui-icon-arrow-2-se-nw {
+    background-position: -176px -32px;
+}
+
+.ui-icon-arrowstop-1-n {
+    background-position: -192px -32px;
+}
+
+.ui-icon-arrowstop-1-e {
+    background-position: -208px -32px;
+}
+
+.ui-icon-arrowstop-1-s {
+    background-position: -224px -32px;
+}
+
+.ui-icon-arrowstop-1-w {
+    background-position: -240px -32px;
+}
+
+.ui-icon-arrowthick-1-n {
+    background-position: 0 -48px;
+}
+
+.ui-icon-arrowthick-1-ne {
+    background-position: -16px -48px;
+}
+
+.ui-icon-arrowthick-1-e {
+    background-position: -32px -48px;
+}
+
+.ui-icon-arrowthick-1-se {
+    background-position: -48px -48px;
+}
+
+.ui-icon-arrowthick-1-s {
+    background-position: -64px -48px;
+}
+
+.ui-icon-arrowthick-1-sw {
+    background-position: -80px -48px;
+}
+
+.ui-icon-arrowthick-1-w {
+    background-position: -96px -48px;
+}
+
+.ui-icon-arrowthick-1-nw {
+    background-position: -112px -48px;
+}
+
+.ui-icon-arrowthick-2-n-s {
+    background-position: -128px -48px;
+}
+
+.ui-icon-arrowthick-2-ne-sw {
+    background-position: -144px -48px;
+}
+
+.ui-icon-arrowthick-2-e-w {
+    background-position: -160px -48px;
+}
+
+.ui-icon-arrowthick-2-se-nw {
+    background-position: -176px -48px;
+}
+
+.ui-icon-arrowthickstop-1-n {
+    background-position: -192px -48px;
+}
+
+.ui-icon-arrowthickstop-1-e {
+    background-position: -208px -48px;
+}
+
+.ui-icon-arrowthickstop-1-s {
+    background-position: -224px -48px;
+}
+
+.ui-icon-arrowthickstop-1-w {
+    background-position: -240px -48px;
+}
+
+.ui-icon-arrowreturnthick-1-w {
+    background-position: 0 -64px;
+}
+
+.ui-icon-arrowreturnthick-1-n {
+    background-position: -16px -64px;
+}
+
+.ui-icon-arrowreturnthick-1-e {
+    background-position: -32px -64px;
+}
+
+.ui-icon-arrowreturnthick-1-s {
+    background-position: -48px -64px;
+}
+
+.ui-icon-arrowreturn-1-w {
+    background-position: -64px -64px;
+}
+
+.ui-icon-arrowreturn-1-n {
+    background-position: -80px -64px;
+}
+
+.ui-icon-arrowreturn-1-e {
+    background-position: -96px -64px;
+}
+
+.ui-icon-arrowreturn-1-s {
+    background-position: -112px -64px;
+}
+
+.ui-icon-arrowrefresh-1-w {
+    background-position: -128px -64px;
+}
+
+.ui-icon-arrowrefresh-1-n {
+    background-position: -144px -64px;
+}
+
+.ui-icon-arrowrefresh-1-e {
+    background-position: -160px -64px;
+}
+
+.ui-icon-arrowrefresh-1-s {
+    background-position: -176px -64px;
+}
+
+.ui-icon-arrow-4 {
+    background-position: 0 -80px;
+}
+
+.ui-icon-arrow-4-diag {
+    background-position: -16px -80px;
+}
+
+.ui-icon-extlink {
+    background-position: -32px -80px;
+}
+
+.ui-icon-newwin {
+    background-position: -48px -80px;
+}
+
+.ui-icon-refresh {
+    background-position: -64px -80px;
+}
+
+.ui-icon-shuffle {
+    background-position: -80px -80px;
+}
+
+.ui-icon-transfer-e-w {
+    background-position: -96px -80px;
+}
+
+.ui-icon-transferthick-e-w {
+    background-position: -112px -80px;
+}
+
+.ui-icon-folder-collapsed {
+    background-position: 0 -96px;
+}
+
+.ui-icon-folder-open {
+    background-position: -16px -96px;
+}
+
+.ui-icon-document {
+    background-position: -32px -96px;
+}
+
+.ui-icon-document-b {
+    background-position: -48px -96px;
+}
+
+.ui-icon-note {
+    background-position: -64px -96px;
+}
+
+.ui-icon-mail-closed {
+    background-position: -80px -96px;
+}
+
+.ui-icon-mail-open {
+    background-position: -96px -96px;
+}
+
+.ui-icon-suitcase {
+    background-position: -112px -96px;
+}
+
+.ui-icon-comment {
+    background-position: -128px -96px;
+}
+
+.ui-icon-person {
+    background-position: -144px -96px;
+}
+
+.ui-icon-print {
+    background-position: -160px -96px;
+}
+
+.ui-icon-trash {
+    background-position: -176px -96px;
+}
+
+.ui-icon-locked {
+    background-position: -192px -96px;
+}
+
+.ui-icon-unlocked {
+    background-position: -208px -96px;
+}
+
+.ui-icon-bookmark {
+    background-position: -224px -96px;
+}
+
+.ui-icon-tag {
+    background-position: -240px -96px;
+}
+
+.ui-icon-home {
+    background-position: 0 -112px;
+}
+
+.ui-icon-flag {
+    background-position: -16px -112px;
+}
+
+.ui-icon-calendar {
+    background-position: -32px -112px;
+}
+
+.ui-icon-cart {
+    background-position: -48px -112px;
+}
+
+.ui-icon-pencil {
+    background-position: -64px -112px;
+}
+
+.ui-icon-clock {
+    background-position: -80px -112px;
+}
+
+.ui-icon-disk {
+    background-position: -96px -112px;
+}
+
+.ui-icon-calculator {
+    background-position: -112px -112px;
+}
+
+.ui-icon-zoomin {
+    background-position: -128px -112px;
+}
+
+.ui-icon-zoomout {
+    background-position: -144px -112px;
+}
+
+.ui-icon-search {
+    background-position: -160px -112px;
+}
+
+.ui-icon-wrench {
+    background-position: -176px -112px;
+}
+
+.ui-icon-gear {
+    background-position: -192px -112px;
+}
+
+.ui-icon-heart {
+    background-position: -208px -112px;
+}
+
+.ui-icon-star {
+    background-position: -224px -112px;
+}
+
+.ui-icon-link {
+    background-position: -240px -112px;
+}
+
+.ui-icon-cancel {
+    background-position: 0 -128px;
+}
+
+.ui-icon-plus {
+    background-position: -16px -128px;
+}
+
+.ui-icon-plusthick {
+    background-position: -32px -128px;
+}
+
+.ui-icon-minus {
+    background-position: -48px -128px;
+}
+
+.ui-icon-minusthick {
+    background-position: -64px -128px;
+}
+
+.ui-icon-close {
+    background-position: -80px -128px;
+}
+
+.ui-icon-closethick {
+    background-position: -96px -128px;
+}
+
+.ui-icon-key {
+    background-position: -112px -128px;
+}
+
+.ui-icon-lightbulb {
+    background-position: -128px -128px;
+}
+
+.ui-icon-scissors {
+    background-position: -144px -128px;
+}
+
+.ui-icon-clipboard {
+    background-position: -160px -128px;
+}
+
+.ui-icon-copy {
+    background-position: -176px -128px;
+}
+
+.ui-icon-contact {
+    background-position: -192px -128px;
+}
+
+.ui-icon-image {
+    background-position: -208px -128px;
+}
+
+.ui-icon-video {
+    background-position: -224px -128px;
+}
+
+.ui-icon-script {
+    background-position: -240px -128px;
+}
+
+.ui-icon-alert {
+    background-position: 0 -144px;
+}
+
+.ui-icon-info {
+    background-position: -16px -144px;
+}
+
+.ui-icon-notice {
+    background-position: -32px -144px;
+}
+
+.ui-icon-help {
+    background-position: -48px -144px;
+}
+
+.ui-icon-check {
+    background-position: -64px -144px;
+}
+
+.ui-icon-bullet {
+    background-position: -80px -144px;
+}
+
+.ui-icon-radio-on {
+    background-position: -96px -144px;
+}
+
+.ui-icon-radio-off {
+    background-position: -112px -144px;
+}
+
+.ui-icon-pin-w {
+    background-position: -128px -144px;
+}
+
+.ui-icon-pin-s {
+    background-position: -144px -144px;
+}
+
+.ui-icon-play {
+    background-position: 0 -160px;
+}
+
+.ui-icon-pause {
+    background-position: -16px -160px;
+}
+
+.ui-icon-seek-next {
+    background-position: -32px -160px;
+}
+
+.ui-icon-seek-prev {
+    background-position: -48px -160px;
+}
+
+.ui-icon-seek-end {
+    background-position: -64px -160px;
+}
+
+.ui-icon-seek-start {
+    background-position: -80px -160px;
+}
+
+/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
+.ui-icon-seek-first {
+    background-position: -80px -160px;
+}
+
+.ui-icon-stop {
+    background-position: -96px -160px;
+}
+
+.ui-icon-eject {
+    background-position: -112px -160px;
+}
+
+.ui-icon-volume-off {
+    background-position: -128px -160px;
+}
+
+.ui-icon-volume-on {
+    background-position: -144px -160px;
+}
+
+.ui-icon-power {
+    background-position: 0 -176px;
+}
+
+.ui-icon-signal-diag {
+    background-position: -16px -176px;
+}
+
+.ui-icon-signal {
+    background-position: -32px -176px;
+}
+
+.ui-icon-battery-0 {
+    background-position: -48px -176px;
+}
+
+.ui-icon-battery-1 {
+    background-position: -64px -176px;
+}
+
+.ui-icon-battery-2 {
+    background-position: -80px -176px;
+}
+
+.ui-icon-battery-3 {
+    background-position: -96px -176px;
+}
+
+.ui-icon-circle-plus {
+    background-position: 0 -192px;
+}
+
+.ui-icon-circle-minus {
+    background-position: -16px -192px;
+}
+
+.ui-icon-circle-close {
+    background-position: -32px -192px;
+}
+
+.ui-icon-circle-triangle-e {
+    background-position: -48px -192px;
+}
+
+.ui-icon-circle-triangle-s {
+    background-position: -64px -192px;
+}
+
+.ui-icon-circle-triangle-w {
+    background-position: -80px -192px;
+}
+
+.ui-icon-circle-triangle-n {
+    background-position: -96px -192px;
+}
+
+.ui-icon-circle-arrow-e {
+    background-position: -112px -192px;
+}
+
+.ui-icon-circle-arrow-s {
+    background-position: -128px -192px;
+}
+
+.ui-icon-circle-arrow-w {
+    background-position: -144px -192px;
+}
+
+.ui-icon-circle-arrow-n {
+    background-position: -160px -192px;
+}
+
+.ui-icon-circle-zoomin {
+    background-position: -176px -192px;
+}
+
+.ui-icon-circle-zoomout {
+    background-position: -192px -192px;
+}
+
+.ui-icon-circle-check {
+    background-position: -208px -192px;
+}
+
+.ui-icon-circlesmall-plus {
+    background-position: 0 -208px;
+}
+
+.ui-icon-circlesmall-minus {
+    background-position: -16px -208px;
+}
+
+.ui-icon-circlesmall-close {
+    background-position: -32px -208px;
+}
+
+.ui-icon-squaresmall-plus {
+    background-position: -48px -208px;
+}
+
+.ui-icon-squaresmall-minus {
+    background-position: -64px -208px;
+}
+
+.ui-icon-squaresmall-close {
+    background-position: -80px -208px;
+}
+
+.ui-icon-grip-dotted-vertical {
+    background-position: 0 -224px;
+}
+
+.ui-icon-grip-dotted-horizontal {
+    background-position: -16px -224px;
+}
+
+.ui-icon-grip-solid-vertical {
+    background-position: -32px -224px;
+}
+
+.ui-icon-grip-solid-horizontal {
+    background-position: -48px -224px;
+}
+
+.ui-icon-gripsmall-diagonal-se {
+    background-position: -64px -224px;
+}
+
+.ui-icon-grip-diagonal-se {
+    background-position: -80px -224px;
+}
+
+/* Misc visuals
+----------------------------------*/
+
+/* Corner radius */
+.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl {
+    -moz-border-radius-topleft: 4px;
+    -webkit-border-top-left-radius: 4px;
+    -khtml-border-top-left-radius: 4px;
+    border-top-left-radius: 4px;
+}
+
+.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr {
+    -moz-border-radius-topright: 4px;
+    -webkit-border-top-right-radius: 4px;
+    -khtml-border-top-right-radius: 4px;
+    border-top-right-radius: 4px;
+}
+
+.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl {
+    -moz-border-radius-bottomleft: 4px;
+    -webkit-border-bottom-left-radius: 4px;
+    -khtml-border-bottom-left-radius: 4px;
+    border-bottom-left-radius: 4px;
+}
+
+.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br {
+    -moz-border-radius-bottomright: 4px;
+    -webkit-border-bottom-right-radius: 4px;
+    -khtml-border-bottom-right-radius: 4px;
+    border-bottom-right-radius: 4px;
+}
+
+/* Overlays */
+.ui-widget-overlay {
+    background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
+    opacity: .3;
+    filter: Alpha(Opacity = 30);
+}
+
+.ui-widget-shadow {
+    margin: -8px 0 0 -8px;
+    padding: 8px;
+    background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
+    opacity: .3;
+    filter: Alpha(Opacity = 30);
+    -moz-border-radius: 3px;
+    -khtml-border-radius: 3px;
+    -webkit-border-radius: 3px;
+    border-radius: 3px;
+}
+
+/* Everything that follows was added by Photocrati */
+.ui-icon {
+    float: left;
+}
+
+/* Make accordions look like Wordpress' semi-accordion header field */
+.ui-accordion .ui-accordion-header {
+    font-size: 1.17em;
+    text-shadow: #fff 0 1px 0;
+    font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
+    line-height: 1;
+}
+
+/* Tabs: remove background, change text color, and add :hover state */
+.ui-tabs .ui-tabs-nav li {
+    background: white;
+    font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", sans-serif;
+    margin-bottom: -1px;
+    margin-right: .5em;
+}
+
+.ui-tabs .ui-tabs-nav li a {
+    color: #aaa;
+    outline: none;
+    font-size: 120%;
+}
+
+.ui-tabs .ui-tabs-nav li a:hover {
+    color: #d54e21;
+}
+
+.ui-tabs .ui-tabs-nav li.ui-tabs-active {
+    padding-bottom: -1px;
+}
+
+.ui-tabs .ui-tabs-nav li.ui-tabs-active a {
+    color: #464646;
+}
+
+.ui-tabs .ui-tabs-nav li.ui-tabs-selected {
+    border-top: 1px solid #8a8a8a;
+    border-right: 1px solid #8a8a8a;
+    border-left: 1px solid #8a8a8a;
+    border-bottom: 1px solid #ffffff;
+}
+
+.ui-tabs-icon + ul.ui-tabs-nav {
+    -moz-border-radius-bottomleft: 0px;
+    -webkit-border-bottom-left-radius: 0px;
+    -khtml-border-bottom-left-radius: 0px;
+    border-bottom-left-radius: 0px;
+}
+
+.ui-tabs-icon {
+    float: left;
+    background: url('images/nextgen-logo-small.jpg') no-repeat left center;
+    font-size: 18px;
+    font-family: HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', sans-serif;
+    width: 200px;
+    height: 40px;
+}
+
+.ui-tabs-icon .nextgen_logo {
+	display: none;
+}
+.ui-tabs-icon .nextgen_logo_sub {
+	display: none;
+	font-size: 14px;
+}
+
+/** Fix overlays in IE8 **/
+.ui-widget-overlay {
+	background: #000000 50% 50% repeat-x;
+	opacity: .4;
+    filter: Alpha(Opacity = 40);
+	filter: -\9;
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery.placeholder.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery.placeholder.min.js
new file mode 100644
index 0000000000000000000000000000000000000000..138ddd32bbdeb3ec8b83fa1fadbc73026d0ff884
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery.placeholder.min.js
@@ -0,0 +1,2 @@
+/*! http://mths.be/placeholder v2.0.7 by @mathias */
+;(function(f,h,$){var a='placeholder' in h.createElement('input'),d='placeholder' in h.createElement('textarea'),i=$.fn,c=$.valHooks,k,j;if(a&&d){j=i.placeholder=function(){return this};j.input=j.textarea=true}else{j=i.placeholder=function(){var l=this;l.filter((a?'textarea':':input')+'[placeholder]').not('.placeholder').bind({'focus.placeholder':b,'blur.placeholder':e}).data('placeholder-enabled',true).trigger('blur.placeholder');return l};j.input=a;j.textarea=d;k={get:function(m){var l=$(m);return l.data('placeholder-enabled')&&l.hasClass('placeholder')?'':m.value},set:function(m,n){var l=$(m);if(!l.data('placeholder-enabled')){return m.value=n}if(n==''){m.value=n;if(m!=h.activeElement){e.call(m)}}else{if(l.hasClass('placeholder')){b.call(m,true,n)||(m.value=n)}else{m.value=n}}return l}};a||(c.input=k);d||(c.textarea=k);$(function(){$(h).delegate('form','submit.placeholder',function(){var l=$('.placeholder',this).each(b);setTimeout(function(){l.each(e)},10)})});$(f).bind('beforeunload.placeholder',function(){$('.placeholder').each(function(){this.value=''})})}function g(m){var l={},n=/^jQuery\d+$/;$.each(m.attributes,function(p,o){if(o.specified&&!n.test(o.name)){l[o.name]=o.value}});return l}function b(m,n){var l=this,o=$(l);if(l.value==o.attr('placeholder')&&o.hasClass('placeholder')){if(o.data('placeholder-password')){o=o.hide().next().show().attr('id',o.removeAttr('id').data('placeholder-id'));if(m===true){return o[0].value=n}o.focus()}else{l.value='';o.removeClass('placeholder');l==h.activeElement&&l.select()}}}function e(){var q,l=this,p=$(l),m=p,o=this.id;if(l.value==''){if(l.type=='password'){if(!p.data('placeholder-textinput')){try{q=p.clone().attr({type:'text'})}catch(n){q=$('<input>').attr($.extend(g(this),{type:'text'}))}q.removeAttr('name').data({'placeholder-password':true,'placeholder-id':o}).bind('focus.placeholder',b);p.data({'placeholder-textinput':q,'placeholder-id':o}).before(q)}p=p.removeAttr('id').hide().prev().attr('id',o).show()}p.addClass('placeholder');p[0].value=p.attr('placeholder')}else{p.removeClass('placeholder')}}}(this,document,jQuery));
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/nextgen_admin_page.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/nextgen_admin_page.css
new file mode 100644
index 0000000000000000000000000000000000000000..d3aa9163337d528f291d3a01f00dd494b10cfa44
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/nextgen_admin_page.css
@@ -0,0 +1,39 @@
+.hidden {
+	display: none;
+}
+
+.nextgen_advanced_toggle_link {
+	font-size: 11px;
+	position: relative;
+	bottom: 5px;
+	color: #444444;
+}
+
+.url_field {
+	width: 400px;
+}
+
+.nextgen_settings_colorpicker {
+    width: 85px !important;
+    text-align: center;
+    margin-left: 50px;
+}
+
+#nextgen_settings_wmXpos,
+#nextgen_settings_wmYpos {
+    width: 65px !important;
+}
+
+table.nextgen_settings_position {
+    width: auto !important;
+}
+
+
+span.tooltip,
+label.tooltip {
+    outline: none;
+    background-image: url('information.png');
+    background-repeat: no-repeat;
+    padding-left: 18px;
+    padding-bottom: 1px;
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/nextgen_admin_page.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/nextgen_admin_page.js
new file mode 100644
index 0000000000000000000000000000000000000000..aff7def4bad78172ef99a6a46c6c8c113d4f1416
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/nextgen_admin_page.js
@@ -0,0 +1,67 @@
+jQuery(function($){
+
+    // Activate accordions
+    $('.accordion').accordion({
+        clearStyle: true,
+        autoHeight: false,
+        heightStyle: 'content'
+    });
+
+     // When a submit button is clicked...
+	$('input[type="submit"]').click(function(e){
+		var $button = $(this);
+		var message = false;
+
+		// Check if a confirmation dialog is required
+		if ((message = $button.attr('data-confirm'))) {
+			if (!confirm(message)) {
+				e.preventDefault();
+				return;
+			}
+		}
+
+		// Check if this is a proxy button for another field
+		if ($button.attr('name').indexOf('_proxy') != -1) {
+
+			// Get the value to set
+			var value = $button.attr('data-proxy-value');
+			if (!value) value = $button.attr('value');
+
+			// Get the name of the field that is being proxied
+			var field_name = $button.attr('name').replace('_proxy', '');
+
+			// Try getting the existing field
+			var $field = $('input[name="'+field_name+'"]');
+			if ($field.length > 0) $field.val(value);
+			else {
+				$field = $('<input/>').attr({
+					type: 'hidden',
+					name: field_name,
+					value: value
+				});
+				$button.parents('form').append($field);
+			}
+		}
+	});
+    
+    
+	// Toggle the advanced settings
+	$('.nextgen_advanced_toggle_link').on('click', function(e){
+		e.preventDefault();
+		var form_id = '#'+$(this).attr('rel');
+		var btn = $(this);
+		$(form_id).toggle(500, 'swing', function(){
+			if ($(this).hasClass('hidden')) {
+				$(this).removeClass('hidden');
+				btn.text(btn.attr('active_label'));
+			}
+			else {
+				$(this).addClass('hidden');
+				btn.text(btn.attr('hidden_label'));
+			}
+		});
+	});
+
+    $('input.nextgen_settings_field_colorpicker').wpColorPicker();
+    $('#ngg_page_content').css('visibility', 'visible');
+});
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/ngg_progressbar.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/ngg_progressbar.css
new file mode 100644
index 0000000000000000000000000000000000000000..69ed138bceb83b83513ba138148da657534886a6
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/ngg_progressbar.css
@@ -0,0 +1,28 @@
+.ngg_progressbar {
+    width: 100%;
+    background: #292929;
+    border: 1px solid #111;
+    border-radius: 5px;
+    overflow: hidden;
+    box-shadow: 0 0 5px #333;
+    height: 25px;
+}
+
+.ngg_progressbar div {
+    width: 0%;
+    text-align: right;
+    color: white;
+    background-image: url('animation.gif');
+    border: solid 1px darkolivegreen;
+    overflow: hidden;
+    border-radius: 5px;
+    height: 100%;
+    font-size: 12px;
+    padding-top: 3px;
+    font-family: Helvetica, Arial
+}
+
+.ngg_progressbar.infinite div {
+    width: 100%;
+    text-align: center;
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/ngg_progressbar.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/ngg_progressbar.js
new file mode 100644
index 0000000000000000000000000000000000000000..27fef37d9cc2cb9f613d835cc2f9c8117ed285a9
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/ngg_progressbar.js
@@ -0,0 +1,102 @@
+(function($){
+
+    $.nggProgressBar = function(options){
+        var progressBar = {
+            defaults: {
+                starting_value: 0,
+                infinite: false,
+                in_progress_text: 'In progress...',
+                finished_text: 'Done!'
+            },
+
+            // Initializes the progress bar
+            init: function(options){
+
+                // Set the options
+                this.options = $.extend(this.defaults, options);
+
+                // Display the sticky Gritter notification
+                this.gritter_id = this.find_gritter(window).add({
+                    progressBar: this,
+                    sticky: true,
+                    title:  this.options.title,
+                    text:   "<div class='ngg_progressbar'><div></div></div>",
+                });
+
+                // Find the gritter element added
+                this.find_gritter_el(window);
+
+                // Is this an infinite progress bar?
+                if (this.options.infinite) {
+                    this.gritter_el.find('.ngg_progressbar').addClass('infinite');
+                }
+
+                // Set the starting value
+                this.set(this.options.starting_value);
+            },
+
+            set: function(percent, text){
+              // You can set the percentage of completion, as well as the text message to appear
+              if (typeof(text) == 'undefined') text = percent;
+
+              // You can optionally just pass in a message, and we'll assume that it's an infinite progress bar
+              // and use 100 completion, with the message as the text
+              if (isNaN(percent)) {
+                  text = percent;
+                  percent = 100;
+              }
+              percent = percent + "%";
+              this.status_el.animate({
+                  width: percent
+              }).text(text);
+            },
+
+            // Closes the progress bar
+            close: function(delay){
+                if (typeof(delay) == 'undefined') delay = 1000;
+                var gritter     = this.find_gritter(window)
+                var gritter_id  = this.gritter_id;
+                setTimeout(function(){
+                    gritter.remove(gritter_id);
+                }, delay);
+            },
+
+            // Finds the parent window
+            find_parent: function(win){
+                var retval = win;
+                try {
+                    while (retval.document !== retval.parent.document) retval = retval.parent;
+                }
+                catch (ex){
+                    if (typeof(console) != "undefined") console.log(ex);
+                }
+                return retval;
+            },
+
+            // Finds the gritter library
+            find_gritter: function(win){
+               return this.find_parent(win).jQuery.gritter
+            },
+
+
+            // Finds the gritter element
+            find_gritter_el: function(win){
+                var selector = '#gritter-item-'+this.gritter_id;
+                this.gritter_el = $(selector);
+                if (this.gritter_el.length == 0) {
+                    this.gritter_el = this.find_parent(win).jQuery(selector);
+                }
+
+                this.status_el = this.gritter_el.find('.ngg_progressbar:first div');
+                this.gritter_el.data('nggProgressBar', this);
+
+                return this.gritter_el;
+            }
+        };
+
+        progressBar.init(options);
+
+        return progressBar;
+    };
+
+})(jQuery);
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/select2/select2-spinner.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/select2/select2-spinner.gif
new file mode 100644
index 0000000000000000000000000000000000000000..5b33f7e54f4e55b6b8774d86d96895db9af044b4
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/select2/select2-spinner.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/select2/select2.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/select2/select2.css
new file mode 100644
index 0000000000000000000000000000000000000000..3eae7318e18bd3fad4c7b2917e1438ebd3704b8d
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/select2/select2.css
@@ -0,0 +1,573 @@
+/*
+Version: @@ver@@ Timestamp: @@timestamp@@
+*/
+.select2-container {
+    position: relative;
+    display: inline-block;
+    /* inline-block for ie7 */
+    zoom: 1;
+    *display: inline;
+    vertical-align: top;
+}
+
+.select2-container,
+.select2-drop,
+.select2-search,
+.select2-search input{
+  /*
+    Force border-box so that % widths fit the parent
+    container without overlap because of margin/padding.
+
+    More Info : http://www.quirksmode.org/css/box.html
+  */
+  -webkit-box-sizing: border-box; /* webkit */
+   -khtml-box-sizing: border-box; /* konqueror */
+     -moz-box-sizing: border-box; /* firefox */
+      -ms-box-sizing: border-box; /* ie */
+          box-sizing: border-box; /* css3 */
+}
+
+.select2-container .select2-choice {
+    display: block;
+    height: 26px;
+    padding: 0 0 0 8px;
+    overflow: hidden;
+    position: relative;
+
+    border: 1px solid #aaa;
+    white-space: nowrap;
+    line-height: 26px;
+    color: #444;
+    text-decoration: none;
+
+    -webkit-border-radius: 4px;
+       -moz-border-radius: 4px;
+            border-radius: 4px;
+
+    -webkit-background-clip: padding-box;
+       -moz-background-clip: padding;
+            background-clip: padding-box;
+
+    background-color: #fff;
+    background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.5, white));
+    background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 50%);
+    background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 50%);
+    background-image: -o-linear-gradient(bottom, #eeeeee 0%, #ffffff 50%);
+    background-image: -ms-linear-gradient(top, #ffffff 0%, #eeeeee 50%);
+    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#ffffff', endColorstr = '#eeeeee', GradientType = 0);
+    background-image: linear-gradient(top, #ffffff 0%, #eeeeee 50%);
+}
+
+.select2-container.select2-drop-above .select2-choice {
+    border-bottom-color: #aaa;
+
+    -webkit-border-radius:0 0 4px 4px;
+       -moz-border-radius:0 0 4px 4px;
+            border-radius:0 0 4px 4px;
+
+    background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.9, white));
+    background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 90%);
+    background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 90%);
+    background-image: -o-linear-gradient(bottom, #eeeeee 0%, white 90%);
+    background-image: -ms-linear-gradient(top, #eeeeee 0%,#ffffff 90%);
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee',GradientType=0 );
+    background-image: linear-gradient(top, #eeeeee 0%,#ffffff 90%);
+}
+
+.select2-container .select2-choice span {
+    margin-right: 26px;
+    display: block;
+    overflow: hidden;
+
+    white-space: nowrap;
+
+    -ms-text-overflow: ellipsis;
+     -o-text-overflow: ellipsis;
+        text-overflow: ellipsis;
+}
+
+.select2-container .select2-choice abbr {
+    display: block;
+    width: 12px;
+    height: 12px;
+    position: absolute;
+    right: 26px;
+    top: 8px;
+
+    font-size: 1px;
+    text-decoration: none;
+
+    border: 0;
+    background: url('select2.png') right top no-repeat;
+    cursor: pointer;
+    outline: 0;
+}
+.select2-container .select2-choice abbr:hover {
+    background-position: right -11px;
+    cursor: pointer;
+}
+
+.select2-drop {
+    width: 100%;
+    margin-top:-1px;
+    position: absolute;
+    z-index: 9999;
+    top: 100%;
+
+    background: #fff;
+    color: #000;
+    border: 1px solid #aaa;
+    border-top: 0;
+
+    -webkit-border-radius: 0 0 4px 4px;
+       -moz-border-radius: 0 0 4px 4px;
+            border-radius: 0 0 4px 4px;
+
+    -webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
+       -moz-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
+         -o-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
+            box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
+}
+
+.select2-drop.select2-drop-above {
+    margin-top: 1px;
+    border-top: 1px solid #aaa;
+    border-bottom: 0;
+
+    -webkit-border-radius: 4px 4px 0 0;
+       -moz-border-radius: 4px 4px 0 0;
+            border-radius: 4px 4px 0 0;
+
+    -webkit-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
+       -moz-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
+         -o-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
+            box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
+}
+
+.select2-container .select2-choice div {
+    display: block;
+    width: 18px;
+    height: 100%;
+    position: absolute;
+    right: 0;
+    top: 0;
+
+    border-left: 1px solid #aaa;
+    -webkit-border-radius: 0 4px 4px 0;
+       -moz-border-radius: 0 4px 4px 0;
+            border-radius: 0 4px 4px 0;
+
+    -webkit-background-clip: padding-box;
+       -moz-background-clip: padding;
+            background-clip: padding-box;
+
+    background: #ccc;
+    background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #ccc), color-stop(0.6, #eee));
+    background-image: -webkit-linear-gradient(center bottom, #ccc 0%, #eee 60%);
+    background-image: -moz-linear-gradient(center bottom, #ccc 0%, #eee 60%);
+    background-image: -o-linear-gradient(bottom, #ccc 0%, #eee 60%);
+    background-image: -ms-linear-gradient(top, #cccccc 0%, #eeeeee 60%);
+    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#eeeeee', endColorstr = '#cccccc', GradientType = 0);
+    background-image: linear-gradient(top, #cccccc 0%, #eeeeee 60%);
+}
+
+.select2-container .select2-choice div b {
+    display: block;
+    width: 100%;
+    height: 100%;
+    background: url('select2.png') no-repeat 0 1px;
+}
+
+.select2-search {
+    display: inline-block;
+    width: 100%;
+    min-height: 26px;
+    margin: 0;
+    padding-left: 4px;
+    padding-right: 4px;
+
+    position: relative;
+    z-index: 10000;
+
+    white-space: nowrap;
+}
+
+.select2-search-hidden {
+    display: block;
+    position: absolute;
+    left: -10000px;
+}
+
+.select2-search input {
+    width: 100%;
+    height: auto !important;
+    min-height: 26px;
+    padding: 4px 20px 4px 5px;
+    margin: 0;
+
+    outline: 0;
+    font-family: sans-serif;
+    font-size: 1em;
+
+    border: 1px solid #aaa;
+    -webkit-border-radius: 0;
+       -moz-border-radius: 0;
+            border-radius: 0;
+
+    -webkit-box-shadow: none;
+       -moz-box-shadow: none;
+            box-shadow: none;
+
+    background: #fff url('select2.png') no-repeat 100% -22px;
+    background: url('select2.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
+    background: url('select2.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
+    background: url('select2.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
+    background: url('select2.png') no-repeat 100% -22px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
+    background: url('select2.png') no-repeat 100% -22px, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%);
+    background: url('select2.png') no-repeat 100% -22px, linear-gradient(top, #ffffff 85%, #eeeeee 99%);
+}
+
+.select2-drop.select2-drop-above .select2-search input {
+    margin-top: 4px;
+}
+
+.select2-search input.select2-active {
+    background: #fff url('select2-spinner.gif') no-repeat 100%;
+    background: url('select2-spinner.gif') no-repeat 100%, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
+    background: url('select2-spinner.gif') no-repeat 100%, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
+    background: url('select2-spinner.gif') no-repeat 100%, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
+    background: url('select2-spinner.gif') no-repeat 100%, -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
+    background: url('select2-spinner.gif') no-repeat 100%, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%);
+    background: url('select2-spinner.gif') no-repeat 100%, linear-gradient(top, #ffffff 85%, #eeeeee 99%);
+}
+
+.select2-container-active .select2-choice,
+.select2-container-active .select2-choices {
+    border: 1px solid #5897fb;
+    outline: none;
+
+    -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
+       -moz-box-shadow: 0 0 5px rgba(0,0,0,.3);
+         -o-box-shadow: 0 0 5px rgba(0,0,0,.3);
+            box-shadow: 0 0 5px rgba(0,0,0,.3);
+}
+
+.select2-dropdown-open .select2-choice {
+    border: 1px solid #aaa;
+    border-bottom-color: transparent;
+    -webkit-box-shadow: 0 1px 0 #fff inset;
+       -moz-box-shadow: 0 1px 0 #fff inset;
+         -o-box-shadow: 0 1px 0 #fff inset;
+            box-shadow: 0 1px 0 #fff inset;
+
+    -webkit-border-bottom-left-radius: 0;
+        -moz-border-radius-bottomleft: 0;
+            border-bottom-left-radius: 0;
+
+    -webkit-border-bottom-right-radius: 0;
+        -moz-border-radius-bottomright: 0;
+            border-bottom-right-radius: 0;
+
+    background-color: #eee;
+    background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, white), color-stop(0.5, #eeeeee));
+    background-image: -webkit-linear-gradient(center bottom, white 0%, #eeeeee 50%);
+    background-image: -moz-linear-gradient(center bottom, white 0%, #eeeeee 50%);
+    background-image: -o-linear-gradient(bottom, white 0%, #eeeeee 50%);
+    background-image: -ms-linear-gradient(top, #ffffff 0%,#eeeeee 50%);
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff',GradientType=0 );
+    background-image: linear-gradient(top, #ffffff 0%,#eeeeee 50%);
+}
+
+.select2-dropdown-open .select2-choice div {
+    background: transparent;
+    border-left: none;
+    filter: none;
+}
+.select2-dropdown-open .select2-choice div b {
+    background-position: -18px 1px;
+}
+
+/* results */
+.select2-results {
+    max-height: 200px;
+    padding: 0 0 0 4px;
+    margin: 4px 4px 4px 0;
+    position: relative;
+    overflow-x: hidden;
+    overflow-y: auto;
+}
+
+.select2-results ul.select2-result-sub {
+    margin: 0;
+}
+
+.select2-results ul.select2-result-sub > li .select2-result-label { padding-left: 20px }
+.select2-results ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 40px }
+.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 60px }
+.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 80px }
+.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 100px }
+.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 110px }
+.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 120px }
+
+.select2-results li {
+    list-style: none;
+    display: list-item;
+}
+
+.select2-results li.select2-result-with-children > .select2-result-label {
+    font-weight: bold;
+}
+
+.select2-results .select2-result-label {
+    padding: 3px 7px 4px;
+    margin: 0;
+    cursor: pointer;
+}
+
+.select2-results .select2-highlighted {
+    background: #3875d7;
+    color: #fff;
+}
+.select2-results li em {
+    background: #feffde;
+    font-style: normal;
+}
+.select2-results .select2-highlighted em {
+    background: transparent;
+}
+.select2-results .select2-no-results,
+.select2-results .select2-searching,
+.select2-results .select2-selection-limit {
+    background: #f4f4f4;
+    display: list-item;
+}
+
+/*
+disabled look for already selected choices in the results dropdown
+.select2-results .select2-disabled.select2-highlighted {
+    color: #666;
+    background: #f4f4f4;
+    display: list-item;
+    cursor: default;
+}
+.select2-results .select2-disabled {
+  background: #f4f4f4;
+  display: list-item;
+  cursor: default;
+}
+*/
+.select2-results .select2-disabled {
+    display: none;
+}
+
+.select2-more-results.select2-active {
+    background: #f4f4f4 url('select2-spinner.gif') no-repeat 100%;
+}
+
+.select2-more-results {
+    background: #f4f4f4;
+    display: list-item;
+}
+
+/* disabled styles */
+
+.select2-container.select2-container-disabled .select2-choice {
+    background-color: #f4f4f4;
+    background-image: none;
+    border: 1px solid #ddd;
+    cursor: default;
+}
+
+.select2-container.select2-container-disabled .select2-choice div {
+    background-color: #f4f4f4;
+    background-image: none;
+    border-left: 0;
+}
+
+.select2-container.select2-container-disabled .select2-choice abbr {
+    display: none
+}
+
+
+/* multiselect */
+
+.select2-container-multi .select2-choices {
+    height: auto !important;
+    height: 1%;
+    margin: 0;
+    padding: 0;
+    position: relative;
+
+    border: 1px solid #aaa;
+    cursor: text;
+    overflow: hidden;
+
+    background-color: #fff;
+    background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
+    background-image: -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
+    background-image: -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
+    background-image: -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
+    background-image: -ms-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
+    background-image: linear-gradient(top, #eeeeee 1%, #ffffff 15%);
+}
+
+.select2-locked {
+  padding: 3px 5px 3px 5px !important;
+}
+
+.select2-container-multi .select2-choices {
+    min-height: 26px;
+}
+
+.select2-container-multi.select2-container-active .select2-choices {
+    border: 1px solid #5897fb;
+    outline: none;
+
+    -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
+       -moz-box-shadow: 0 0 5px rgba(0,0,0,.3);
+         -o-box-shadow: 0 0 5px rgba(0,0,0,.3);
+            box-shadow: 0 0 5px rgba(0,0,0,.3);
+}
+.select2-container-multi .select2-choices li {
+    float: left;
+    list-style: none;
+}
+.select2-container-multi .select2-choices .select2-search-field {
+    margin: 0;
+    padding: 0;
+    white-space: nowrap;
+}
+
+.select2-container-multi .select2-choices .select2-search-field input {
+    height: 15px;
+    padding: 5px;
+    margin: 1px 0;
+
+    font-family: sans-serif;
+    font-size: 100%;
+    color: #666;
+    outline: 0;
+    border: 0;
+    -webkit-box-shadow: none;
+       -moz-box-shadow: none;
+         -o-box-shadow: none;
+            box-shadow: none;
+    background: transparent !important;
+}
+
+.select2-container-multi .select2-choices .select2-search-field input.select2-active {
+    background: #fff url('select2-spinner.gif') no-repeat 100% !important;
+}
+
+.select2-default {
+    color: #999 !important;
+}
+
+.select2-container-multi .select2-choices .select2-search-choice {
+    padding: 3px 5px 3px 18px;
+    margin: 3px 0 3px 5px;
+    position: relative;
+
+    line-height: 13px;
+    color: #333;
+    cursor: default;
+    border: 1px solid #aaaaaa;
+
+    -webkit-border-radius: 3px;
+       -moz-border-radius: 3px;
+            border-radius: 3px;
+
+    -webkit-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
+       -moz-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
+            box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
+
+    -webkit-background-clip: padding-box;
+       -moz-background-clip: padding;
+            background-clip: padding-box;
+
+    background-color: #e4e4e4;
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#f4f4f4', GradientType=0 );
+    background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
+    background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
+    background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
+    background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
+    background-image: -ms-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
+    background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
+}
+.select2-container-multi .select2-choices .select2-search-choice span {
+    cursor: default;
+}
+.select2-container-multi .select2-choices .select2-search-choice-focus {
+    background: #d4d4d4;
+}
+
+.select2-search-choice-close {
+    display: block;
+    width: 12px;
+    height: 13px;
+    position: absolute;
+    right: 3px;
+    top: 4px;
+
+    font-size: 1px;
+    outline: none;
+    background: url('select2.png') right top no-repeat;
+}
+
+.select2-container-multi .select2-search-choice-close {
+    left: 3px;
+}
+
+.select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover {
+  background-position: right -11px;
+}
+.select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close {
+    background-position: right -11px;
+}
+
+/* disabled styles */
+.select2-container-multi.select2-container-disabled .select2-choices{
+    background-color: #f4f4f4;
+    background-image: none;
+    border: 1px solid #ddd;
+    cursor: default;
+}
+
+.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice {
+    padding: 3px 5px 3px 5px;
+    border: 1px solid #ddd;
+    background-image: none;
+    background-color: #f4f4f4;
+}
+
+.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close {
+    display: none;
+}
+/* end multiselect */
+
+
+.select2-result-selectable .select2-match,
+.select2-result-unselectable .select2-result-selectable .select2-match {
+    text-decoration: underline;
+}
+.select2-result-unselectable .select2-match {
+    text-decoration: none;
+}
+
+.select2-offscreen {
+    position: absolute;
+    left: -10000px;
+}
+
+/* Retina-ize icons */
+
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 144dpi)  {
+  .select2-search input, .select2-search-choice-close, .select2-container .select2-choice abbr, .select2-container .select2-choice div b {
+      background-image: url('select2x2.png') !important;
+      background-repeat: no-repeat !important;
+      background-size: 60px 40px !important;
+  }
+  .select2-search input {
+      background-position: 100% -21px !important;
+  }
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/select2/select2.modded.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/select2/select2.modded.js
new file mode 100644
index 0000000000000000000000000000000000000000..9f2a11ebc8c54bfde5993e7828768848b67b42b3
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/select2/select2.modded.js
@@ -0,0 +1,2432 @@
+/*
+Copyright 2012 Igor Vaynberg
+
+Version: @@ver@@ Timestamp: @@timestamp@@
+
+This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
+General Public License version 2 (the "GPL License"). You may choose either license to govern your
+use of this software only upon the condition that you accept all of the terms of either the Apache
+License or the GPL License.
+
+You may obtain a copy of the Apache License and the GPL License at:
+
+    http://www.apache.org/licenses/LICENSE-2.0
+    http://www.gnu.org/licenses/gpl-2.0.html
+
+Unless required by applicable law or agreed to in writing, software distributed under the
+Apache License or the GPL Licesnse is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+CONDITIONS OF ANY KIND, either express or implied. See the Apache License and the GPL License for
+the specific language governing permissions and limitations under the Apache License and the GPL License.
+*/
+ (function ($) {
+ 	if(typeof $.fn.each2 == "undefined"){
+ 		$.fn.extend({
+ 			/*
+			* 4-10 times faster .each replacement
+			* use it carefully, as it overrides jQuery context of element on each iteration
+			*/
+			each2 : function (c) {
+				var j = $([0]), i = -1, l = this.length;
+				while (
+					++i < l
+					&& (j.context = j[0] = this[i])
+					&& c.call(j[0], i, j) !== false //"this"=DOM, i=index, j=jQuery object
+				);
+				return this;
+			}
+ 		});
+ 	}
+})(jQuery);
+
+(function ($, undefined) {
+    "use strict";
+    /*global document, window, jQuery, console */
+
+    if (window.Select2 !== undefined) {
+        return;
+    }
+
+    var KEY, AbstractSelect2, SingleSelect2, MultiSelect2, nextUid, sizer,
+        lastMousePosition, $document;
+
+    KEY = {
+        TAB: 9,
+        ENTER: 13,
+        ESC: 27,
+        SPACE: 32,
+        LEFT: 37,
+        UP: 38,
+        RIGHT: 39,
+        DOWN: 40,
+        SHIFT: 16,
+        CTRL: 17,
+        ALT: 18,
+        PAGE_UP: 33,
+        PAGE_DOWN: 34,
+        HOME: 36,
+        END: 35,
+        BACKSPACE: 8,
+        DELETE: 46,
+        isArrow: function (k) {
+            k = k.which ? k.which : k;
+            switch (k) {
+            case KEY.LEFT:
+            case KEY.RIGHT:
+            case KEY.UP:
+            case KEY.DOWN:
+                return true;
+            }
+            return false;
+        },
+        isControl: function (e) {
+            var k = e.which;
+            switch (k) {
+            case KEY.SHIFT:
+            case KEY.CTRL:
+            case KEY.ALT:
+                return true;
+            }
+
+            if (e.metaKey) return true;
+
+            return false;
+        },
+        isFunctionKey: function (k) {
+            k = k.which ? k.which : k;
+            return k >= 112 && k <= 123;
+        }
+    };
+
+    $document = $(document);
+
+    nextUid=(function() { var counter=1; return function() { return counter++; }; }());
+
+    function indexOf(value, array) {
+        var i = 0, l = array.length, v;
+
+        if (typeof value === "undefined") {
+          return -1;
+        }
+
+        if (value.constructor === String) {
+            for (; i < l; i = i + 1) if (value.localeCompare(array[i]) === 0) return i;
+        } else {
+            for (; i < l; i = i + 1) {
+                v = array[i];
+                if (v.constructor === String) {
+                    if (v.localeCompare(value) === 0) return i;
+                } else {
+                    if (v === value) return i;
+                }
+            }
+        }
+        return -1;
+    }
+
+    /**
+     * Compares equality of a and b taking into account that a and b may be strings, in which case localeCompare is used
+     * @param a
+     * @param b
+     */
+    function equal(a, b) {
+        if (a === b) return true;
+        if (a === undefined || b === undefined) return false;
+        if (a === null || b === null) return false;
+        if (a.constructor === String) return a.localeCompare(b) === 0;
+        if (b.constructor === String) return b.localeCompare(a) === 0;
+        return false;
+    }
+
+    /**
+     * Splits the string into an array of values, trimming each value. An empty array is returned for nulls or empty
+     * strings
+     * @param string
+     * @param separator
+     */
+    function splitVal(string, separator) {
+        var val, i, l;
+        if (string === null || string.length < 1) return [];
+        val = string.split(separator);
+        for (i = 0, l = val.length; i < l; i = i + 1) val[i] = $.trim(val[i]);
+        return val;
+    }
+
+    function getSideBorderPadding(element) {
+        return element.outerWidth(false) - element.width();
+    }
+
+    function installKeyUpChangeEvent(element) {
+        var key="keyup-change-value";
+        element.bind("keydown", function () {
+            if ($.data(element, key) === undefined) {
+                $.data(element, key, element.val());
+            }
+        });
+        element.bind("keyup", function () {
+            var val= $.data(element, key);
+            if (val !== undefined && element.val() !== val) {
+                $.removeData(element, key);
+                element.trigger("keyup-change");
+            }
+        });
+    }
+
+    $document.bind("mousemove", function (e) {
+        lastMousePosition = {x: e.pageX, y: e.pageY};
+    });
+
+    /**
+     * filters mouse events so an event is fired only if the mouse moved.
+     *
+     * filters out mouse events that occur when mouse is stationary but
+     * the elements under the pointer are scrolled.
+     */
+    function installFilteredMouseMove(element) {
+	    element.bind("mousemove", function (e) {
+            var lastpos = lastMousePosition;
+            if (lastpos === undefined || lastpos.x !== e.pageX || lastpos.y !== e.pageY) {
+                $(e.target).trigger("mousemove-filtered", e);
+            }
+        });
+    }
+
+    /**
+     * Debounces a function. Returns a function that calls the original fn function only if no invocations have been made
+     * within the last quietMillis milliseconds.
+     *
+     * @param quietMillis number of milliseconds to wait before invoking fn
+     * @param fn function to be debounced
+     * @param ctx object to be used as this reference within fn
+     * @return debounced version of fn
+     */
+    function debounce(quietMillis, fn, ctx) {
+        ctx = ctx || undefined;
+        var timeout;
+        return function () {
+            var args = arguments;
+            window.clearTimeout(timeout);
+            timeout = window.setTimeout(function() {
+                fn.apply(ctx, args);
+            }, quietMillis);
+        };
+    }
+
+    /**
+     * A simple implementation of a thunk
+     * @param formula function used to lazily initialize the thunk
+     * @return {Function}
+     */
+    function thunk(formula) {
+        var evaluated = false,
+            value;
+        return function() {
+            if (evaluated === false) { value = formula(); evaluated = true; }
+            return value;
+        };
+    };
+
+    function installDebouncedScroll(threshold, element) {
+        var notify = debounce(threshold, function (e) { element.trigger("scroll-debounced", e);});
+        element.bind("scroll", function (e) {
+            if (indexOf(e.target, element.get()) >= 0) notify(e);
+        });
+    }
+
+    function killEvent(event) {
+        event.preventDefault();
+        event.stopPropagation();
+    }
+    function killEventImmediately(event) {
+        event.preventDefault();
+        event.stopImmediatePropagation();
+    }
+
+    function measureTextWidth(e) {
+        if (!sizer){
+        	var style = e[0].currentStyle || window.getComputedStyle(e[0], null);
+        	sizer = $("<div></div>").css({
+	            position: "absolute",
+	            left: "-10000px",
+	            top: "-10000px",
+	            display: "none",
+	            fontSize: style.fontSize,
+	            fontFamily: style.fontFamily,
+	            fontStyle: style.fontStyle,
+	            fontWeight: style.fontWeight,
+	            letterSpacing: style.letterSpacing,
+	            textTransform: style.textTransform,
+	            whiteSpace: "nowrap"
+	        });
+        	$("body").append(sizer);
+        }
+        sizer.text(e.val());
+        return sizer.width();
+    }
+
+    function markMatch(text, term, markup) {
+        var match=text.toUpperCase().indexOf(term.toUpperCase()),
+            tl=term.length;
+
+        if (match<0) {
+            markup.push(text);
+            return;
+        }
+
+        markup.push(text.substring(0, match));
+        markup.push("<span class='select2-match'>");
+        markup.push(text.substring(match, match + tl));
+        markup.push("</span>");
+        markup.push(text.substring(match + tl, text.length));
+    }
+
+    /**
+     * Produces an ajax-based query function
+     *
+     * @param options object containing configuration paramters
+     * @param options.transport function that will be used to execute the ajax request. must be compatible with parameters supported by $.ajax
+     * @param options.url url for the data
+     * @param options.data a function(searchTerm, pageNumber, context) that should return an object containing query string parameters for the above url.
+     * @param options.dataType request data type: ajax, jsonp, other datatatypes supported by jQuery's $.ajax function or the transport function if specified
+     * @param options.traditional a boolean flag that should be true if you wish to use the traditional style of param serialization for the ajax request
+     * @param options.quietMillis (optional) milliseconds to wait before making the ajaxRequest, helps debounce the ajax function if invoked too often
+     * @param options.results a function(remoteData, pageNumber) that converts data returned form the remote request to the format expected by Select2.
+     *      The expected format is an object containing the following keys:
+     *      results array of objects that will be used as choices
+     *      more (optional) boolean indicating whether there are more results available
+     *      Example: {results:[{id:1, text:'Red'},{id:2, text:'Blue'}], more:true}
+     */
+    function ajax(options) {
+        var timeout, // current scheduled but not yet executed request
+            requestSequence = 0, // sequence used to drop out-of-order responses
+            handler = null,
+            quietMillis = options.quietMillis || 100;
+
+        return function (query) {
+            window.clearTimeout(timeout);
+            timeout = window.setTimeout(function () {
+                requestSequence += 1; // increment the sequence
+                var requestNumber = requestSequence, // this request's sequence number
+                    data = options.data, // ajax data function
+                    transport = options.transport || $.ajax,
+                    traditional = options.traditional || false,
+                    type = options.type || 'GET'; // set type of request (GET or POST)
+
+                data = data.call(this, query.term, query.page, query.context);
+
+                if( null !== handler) { handler.abort(); }
+
+                handler = transport.call(null, {
+                    url: options.url,
+                    dataType: options.dataType,
+                    data: data,
+                    type: type,
+                    traditional: traditional,
+                    success: function (data) {
+                        if (requestNumber < requestSequence) {
+                            return;
+                        }
+                        // TODO 3.0 - replace query.page with query so users have access to term, page, etc.
+                        var results = options.results(data, query.page);
+                        query.callback(results);
+                    }
+                });
+            }, quietMillis);
+        };
+    }
+
+    /**
+     * Produces a query function that works with a local array
+     *
+     * @param options object containing configuration parameters. The options parameter can either be an array or an
+     * object.
+     *
+     * If the array form is used it is assumed that it contains objects with 'id' and 'text' keys.
+     *
+     * If the object form is used ti is assumed that it contains 'data' and 'text' keys. The 'data' key should contain
+     * an array of objects that will be used as choices. These objects must contain at least an 'id' key. The 'text'
+     * key can either be a String in which case it is expected that each element in the 'data' array has a key with the
+     * value of 'text' which will be used to match choices. Alternatively, text can be a function(item) that can extract
+     * the text.
+     */
+    function local(options) {
+        var data = options, // data elements
+            dataText,
+            text = function (item) { return ""+item.text; }; // function used to retrieve the text portion of a data item that is matched against the search
+
+        if (!$.isArray(data)) {
+            text = data.text;
+            // if text is not a function we assume it to be a key name
+            if (!$.isFunction(text)) {
+              dataText = data.text; // we need to store this in a separate variable because in the next step data gets reset and data.text is no longer available
+              text = function (item) { return item[dataText]; };
+            }
+            data = data.results;
+        }
+
+        return function (query) {
+            var t = query.term, filtered = { results: [] }, process;
+            if (t === "") {
+                query.callback({results: data});
+                return;
+            }
+
+            process = function(datum, collection) {
+                var group, attr;
+                datum = datum[0];
+                if (datum.children) {
+                    group = {};
+                    for (attr in datum) {
+                        if (datum.hasOwnProperty(attr)) group[attr]=datum[attr];
+                    }
+                    group.children=[];
+                    $(datum.children).each2(function(i, childDatum) { process(childDatum, group.children); });
+                    if (group.children.length || query.matcher(t, text(group))) {
+                        collection.push(group);
+                    }
+                } else {
+                    if (query.matcher(t, text(datum))) {
+                        collection.push(datum);
+                    }
+                }
+            };
+
+            $(data).each2(function(i, datum) { process(datum, filtered.results); });
+            query.callback(filtered);
+        };
+    }
+
+    // TODO javadoc
+    function tags(data) {
+        // TODO even for a function we should probably return a wrapper that does the same object/string check as
+        // the function for arrays. otherwise only functions that return objects are supported.
+        if ($.isFunction(data)) {
+            return data;
+        }
+
+        // if not a function we assume it to be an array
+
+        return function (query) {
+            var t = query.term, filtered = {results: []};
+            $(data).each(function () {
+                var isObject = this.text !== undefined,
+                    text = isObject ? this.text : this;
+                if (t === "" || query.matcher(t, text)) {
+                    filtered.results.push(isObject ? this : {id: this, text: this});
+                }
+            });
+            query.callback(filtered);
+        };
+    }
+
+    /**
+     * Checks if the formatter function should be used.
+     *
+     * Throws an error if it is not a function. Returns true if it should be used,
+     * false if no formatting should be performed.
+     *
+     * @param formatter
+     */
+    function checkFormatter(formatter, formatterName) {
+        if ($.isFunction(formatter)) return true;
+        if (!formatter) return false;
+        throw new Error("formatterName must be a function or a falsy value");
+    }
+
+    function evaluate(val) {
+        return $.isFunction(val) ? val() : val;
+    }
+
+    function countResults(results) {
+        var count = 0;
+        $.each(results, function(i, item) {
+            if (item.children) {
+                count += countResults(item.children);
+            } else {
+                count++;
+            }
+        });
+        return count;
+    }
+
+    /**
+     * Default tokenizer. This function uses breaks the input on substring match of any string from the
+     * opts.tokenSeparators array and uses opts.createSearchChoice to create the choice object. Both of those
+     * two options have to be defined in order for the tokenizer to work.
+     *
+     * @param input text user has typed so far or pasted into the search field
+     * @param selection currently selected choices
+     * @param selectCallback function(choice) callback tho add the choice to selection
+     * @param opts select2's opts
+     * @return undefined/null to leave the current input unchanged, or a string to change the input to the returned value
+     */
+    function defaultTokenizer(input, selection, selectCallback, opts) {
+        var original = input, // store the original so we can compare and know if we need to tell the search to update its text
+            dupe = false, // check for whether a token we extracted represents a duplicate selected choice
+            token, // token
+            index, // position at which the separator was found
+            i, l, // looping variables
+            separator; // the matched separator
+
+        if (!opts.createSearchChoice || !opts.tokenSeparators || opts.tokenSeparators.length < 1) return undefined;
+
+        while (true) {
+            index = -1;
+
+            for (i = 0, l = opts.tokenSeparators.length; i < l; i++) {
+                separator = opts.tokenSeparators[i];
+                index = input.indexOf(separator);
+                if (index >= 0) break;
+            }
+
+            if (index < 0) break; // did not find any token separator in the input string, bail
+
+            token = input.substring(0, index);
+            input = input.substring(index + separator.length);
+
+            if (token.length > 0) {
+                token = opts.createSearchChoice(token, selection);
+                if (token !== undefined && token !== null && opts.id(token) !== undefined && opts.id(token) !== null) {
+                    dupe = false;
+                    for (i = 0, l = selection.length; i < l; i++) {
+                        if (equal(opts.id(token), opts.id(selection[i]))) {
+                            dupe = true; break;
+                        }
+                    }
+
+                    if (!dupe) selectCallback(token);
+                }
+            }
+        }
+
+        if (original.localeCompare(input) != 0) return input;
+    }
+
+    /**
+     * blurs any Select2 container that has focus when an element outside them was clicked or received focus
+     *
+     * also takes care of clicks on label tags that point to the source element
+     */
+    $document.ready(function () {
+        $document.bind("mousedown touchend", function (e) {
+            var target = $(e.target).closest("div.select2-container").get(0), attr;
+            if (target) {
+                $document.find("div.select2-container-active").each(function () {
+                    if (this !== target) $(this).data("select2").blur();
+                });
+            } else {
+                target = $(e.target).closest("div.select2-drop").get(0);
+                $document.find("div.select2-drop-active").each(function () {
+                    if (this !== target) $(this).data("select2").blur();
+                });
+            }
+
+            target=$(e.target);
+            attr = target.attr("for");
+            if ("LABEL" === e.target.tagName && attr && attr.length > 0) {
+                attr = attr.replace(/([\[\].])/g,'\\$1'); /* escapes [, ], and . so properly selects the id */
+                target = $("#"+attr);
+                target = target.data("select2");
+                if (target !== undefined) { target.focus(); e.preventDefault();}
+            }
+        });
+    });
+
+    /**
+     * Creates a new class
+     *
+     * @param superClass
+     * @param methods
+     */
+    function clazz(SuperClass, methods) {
+        var constructor = function () {};
+        constructor.prototype = new SuperClass;
+        constructor.prototype.constructor = constructor;
+        constructor.prototype.parent = SuperClass.prototype;
+        constructor.prototype = $.extend(constructor.prototype, methods);
+        return constructor;
+    }
+
+    AbstractSelect2 = clazz(Object, {
+
+        // abstract
+        bind: function (func) {
+            var self = this;
+            return function () {
+                func.apply(self, arguments);
+            };
+        },
+
+        // abstract
+        init: function (opts) {
+            var results, search, resultsSelector = ".select2-results";
+
+            // prepare options
+            this.opts = opts = this.prepareOpts(opts);
+
+            this.id=opts.id;
+
+            // destroy if called on an existing component
+            if (opts.element.data("select2") !== undefined &&
+                opts.element.data("select2") !== null) {
+                this.destroy();
+            }
+
+            this.enabled=true;
+            this.container = this.createContainer();
+
+            this.containerId="s2id_"+(opts.element.attr("id") || "autogen"+nextUid());
+            this.containerSelector="#"+this.containerId.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g, '\\$1');
+            this.container.attr("id", this.containerId);
+
+            // cache the body so future lookups are cheap
+            this.body = thunk(function() { return opts.element.closest("body"); });
+
+            if (opts.element.attr("class") !== undefined) {
+                this.container.addClass(opts.element.attr("class").replace(/validate\[[\S ]+] ?/, ''));
+            }
+
+            this.container.css(evaluate(opts.containerCss));
+            this.container.addClass(evaluate(opts.containerCssClass));
+
+            // swap container for the element
+            this.opts.element
+                .data("select2", this)
+                .hide()
+                .before(this.container);
+            this.container.data("select2", this);
+
+            this.dropdown = this.container.find(".select2-drop");
+            this.dropdown.addClass(evaluate(opts.dropdownCssClass));
+            this.dropdown.data("select2", this);
+
+            this.results = results = this.container.find(resultsSelector);
+            this.search = search = this.container.find("input.select2-input");
+
+            search.attr("tabIndex", this.opts.element.attr("tabIndex"));
+
+            this.resultsPage = 0;
+            this.context = null;
+
+            // initialize the container
+            this.initContainer();
+            this.initContainerWidth();
+
+            installFilteredMouseMove(this.results);
+            this.dropdown.delegate(resultsSelector, "mousemove-filtered", this.bind(this.highlightUnderEvent));
+
+            installDebouncedScroll(80, this.results);
+            this.dropdown.delegate(resultsSelector, "scroll-debounced", this.bind(this.loadMoreIfNeeded));
+
+            // if jquery.mousewheel plugin is installed we can prevent out-of-bounds scrolling of results via mousewheel
+            if ($.fn.mousewheel) {
+                results.mousewheel(function (e, delta, deltaX, deltaY) {
+                    var top = results.scrollTop(), height;
+                    if (deltaY > 0 && top - deltaY <= 0) {
+                        results.scrollTop(0);
+                        killEvent(e);
+                    } else if (deltaY < 0 && results.get(0).scrollHeight - results.scrollTop() + deltaY <= results.height()) {
+                        results.scrollTop(results.get(0).scrollHeight - results.height());
+                        killEvent(e);
+                    }
+                });
+            }
+
+            installKeyUpChangeEvent(search);
+            search.bind("keyup-change", this.bind(this.updateResults));
+            search.bind("focus", function () { search.addClass("select2-focused"); if (search.val() === " ") search.val(""); });
+            search.bind("blur", function () { search.removeClass("select2-focused");});
+
+            this.dropdown.delegate(resultsSelector, "mouseup", this.bind(function (e) {
+                if ($(e.target).closest(".select2-result-selectable:not(.select2-disabled)").length > 0) {
+                    this.highlightUnderEvent(e);
+                    this.selectHighlighted(e);
+                } else {
+                    this.focusSearch();
+                }
+                killEvent(e);
+            }));
+
+            // trap all mouse events from leaving the dropdown. sometimes there may be a modal that is listening
+            // for mouse events outside of itself so it can close itself. since the dropdown is now outside the select2's
+            // dom it will trigger the popup close, which is not what we want
+            this.dropdown.bind("click mouseup mousedown", function (e) { e.stopPropagation(); });
+
+            if ($.isFunction(this.opts.initSelection)) {
+                // initialize selection based on the current value of the source element
+                this.initSelection();
+
+                // if the user has provided a function that can set selection based on the value of the source element
+                // we monitor the change event on the element and trigger it, allowing for two way synchronization
+                this.monitorSource();
+            }
+
+            if (opts.element.is(":disabled") || opts.element.is("[readonly='readonly']")) this.disable();
+        },
+
+        // abstract
+        destroy: function () {
+            var select2 = this.opts.element.data("select2");
+            if (select2 !== undefined) {
+                select2.container.remove();
+                select2.dropdown.remove();
+                select2.opts.element
+                    .removeData("select2")
+                    .unbind(".select2")
+                    .show();
+            }
+        },
+
+        // abstract
+        prepareOpts: function (opts) {
+            var element, select, idKey, ajaxUrl;
+
+            element = opts.element;
+
+            if (element.get(0).tagName.toLowerCase() === "select") {
+                this.select = select = opts.element;
+            }
+
+            if (select) {
+                // these options are not allowed when attached to a select because they are picked up off the element itself
+                $.each(["id", "multiple", "ajax", "query", "createSearchChoice", "initSelection", "data", "tags"], function () {
+                    if (this in opts) {
+                        throw new Error("Option '" + this + "' is not allowed for Select2 when attached to a <select> element.");
+                    }
+                });
+            }
+
+            opts = $.extend({}, {
+                populateResults: function(container, results, query) {
+                    var populate,  data, result, children, id=this.opts.id, self=this;
+
+                    populate=function(results, container, depth) {
+
+                        var i, l, result, selectable, compound, node, label, innerContainer, formatted;
+                        for (i = 0, l = results.length; i < l; i = i + 1) {
+
+                            result=results[i];
+                            selectable=id(result) !== undefined;
+                            compound=result.children && result.children.length > 0;
+
+                            node=$("<li></li>");
+                            node.addClass("select2-results-dept-"+depth);
+                            node.addClass("select2-result");
+                            node.addClass(selectable ? "select2-result-selectable" : "select2-result-unselectable");
+                            if (compound) { node.addClass("select2-result-with-children"); }
+                            node.addClass(self.opts.formatResultCssClass(result));
+
+                            label=$("<div></div>");
+                            label.addClass("select2-result-label");
+
+                            formatted=opts.formatResult(result, label, query);
+                            if (formatted!==undefined) {
+                                label.html(self.opts.escapeMarkup(formatted));
+                            }
+
+                            node.append(label);
+
+                            if (compound) {
+
+                                innerContainer=$("<ul></ul>");
+                                innerContainer.addClass("select2-result-sub");
+                                populate(result.children, innerContainer, depth+1);
+                                node.append(innerContainer);
+                            }
+
+                            node.data("select2-data", result);
+                            container.append(node);
+                        }
+                    };
+
+                    populate(results, container, 0);
+                }
+            }, $.fn.select2.defaults, opts);
+
+            if (typeof(opts.id) !== "function") {
+                idKey = opts.id;
+                opts.id = function (e) { return e[idKey]; };
+            }
+
+            if (select) {
+                opts.query = this.bind(function (query) {
+                    var data = { results: [], more: false },
+                        term = query.term,
+                        children, firstChild, process;
+
+                    process=function(element, collection) {
+                        var group;
+                        if (element.is("option")) {
+                            if (query.matcher(term, element.text(), element)) {
+                                collection.push({id:element.attr("value"), text:element.text(), element: element.get(), css: element.attr("class")});
+                            }
+                        } else if (element.is("optgroup")) {
+                            group={text:element.attr("label"), children:[], element: element.get(), css: element.attr("class")};
+                            element.children().each2(function(i, elm) { process(elm, group.children); });
+                            if (group.children.length>0) {
+                                collection.push(group);
+                            }
+                        }
+                    };
+
+                    children=element.children();
+
+                    // ignore the placeholder option if there is one
+                    if (this.getPlaceholder() !== undefined && children.length > 0) {
+                        firstChild = children[0];
+                        if ($(firstChild).text() === "") {
+                            children=children.not(firstChild);
+                        }
+                    }
+
+                    children.each2(function(i, elm) { process(elm, data.results); });
+
+                    query.callback(data);
+                });
+                // this is needed because inside val() we construct choices from options and there id is hardcoded
+                opts.id=function(e) { return e.id; };
+                opts.formatResultCssClass = function(data) { return data.css; }
+            } else {
+                if (!("query" in opts)) {
+                    if ("ajax" in opts) {
+                        ajaxUrl = opts.element.data("ajax-url");
+                        if (ajaxUrl && ajaxUrl.length > 0) {
+                            opts.ajax.url = ajaxUrl;
+                        }
+                        opts.query = ajax(opts.ajax);
+                    } else if ("data" in opts) {
+                        opts.query = local(opts.data);
+                    } else if ("tags" in opts) {
+                        opts.query = tags(opts.tags);
+                        if (opts.createSearchChoice === undefined) {
+                            opts.createSearchChoice = function (term) { return {id: term, text: term}; };
+                        }
+                        opts.initSelection = function (element, callback) {
+                            var data = [];
+                            $(splitVal(element.val(), opts.separator)).each(function () {
+                                var id = this, text = this, tags=opts.tags;
+                                if ($.isFunction(tags)) tags=tags();
+                                $(tags).each(function() { if (equal(this.id, id)) { text = this.text; return false; } });
+                                data.push({id: id, text: text});
+                            });
+
+                            callback(data);
+                        };
+                    }
+                }
+            }
+            if (typeof(opts.query) !== "function") {
+                throw "query function not defined for Select2 " + opts.element.attr("id");
+            }
+
+            return opts;
+        },
+
+        /**
+         * Monitor the original element for changes and update select2 accordingly
+         */
+        // abstract
+        monitorSource: function () {
+            this.opts.element.bind("change.select2", this.bind(function (e) {
+                if (this.opts.element.data("select2-change-triggered") !== true) {
+                    this.initSelection();
+                }
+            }));
+        },
+
+        /**
+         * Triggers the change event on the source element
+         */
+        // abstract
+        triggerChange: function (details) {
+
+            details = details || {};
+            details= $.extend({}, details, { type: "change", val: this.val() });
+            // prevents recursive triggering
+            this.opts.element.data("select2-change-triggered", true);
+            this.opts.element.trigger(details);
+            this.opts.element.data("select2-change-triggered", false);
+
+            // some validation frameworks ignore the change event and listen instead to keyup, click for selects
+            // so here we trigger the click event manually
+            this.opts.element.click();
+
+            // ValidationEngine ignorea the change event and listens instead to blur
+            // so here we trigger the blur event manually if so desired
+            if (this.opts.blurOnChange)
+                this.opts.element.blur();
+        },
+
+
+        // abstract
+        enable: function() {
+            if (this.enabled) return;
+
+            this.enabled=true;
+            this.container.removeClass("select2-container-disabled");
+            this.opts.element.removeAttr("disabled");
+        },
+
+        // abstract
+        disable: function() {
+            if (!this.enabled) return;
+
+            this.close();
+
+            this.enabled=false;
+            this.container.addClass("select2-container-disabled");
+            this.opts.element.attr("disabled", "disabled");
+        },
+
+        // abstract
+        opened: function () {
+            return this.container.hasClass("select2-dropdown-open");
+        },
+
+        // abstract
+        positionDropdown: function() {
+            var offset = this.container.offset(),
+                height = this.container.outerHeight(false),
+                width = this.container.outerWidth(false),
+                dropHeight = this.dropdown.outerHeight(false),
+	        viewPortRight = $(window).scrollLeft() + document.documentElement.clientWidth,
+                viewportBottom = $(window).scrollTop() + document.documentElement.clientHeight,
+                dropTop = offset.top + height,
+                dropLeft = offset.left,
+                enoughRoomBelow = dropTop + dropHeight <= viewportBottom,
+                enoughRoomAbove = (offset.top - dropHeight) >= this.body().scrollTop(),
+	        dropWidth = this.dropdown.outerWidth(false),
+	        enoughRoomOnRight = dropLeft + dropWidth <= viewPortRight,
+                aboveNow = this.dropdown.hasClass("select2-drop-above"),
+                bodyOffset,
+                above,
+                css;
+
+            // console.log("below/ droptop:", dropTop, "dropHeight", dropHeight, "sum", (dropTop+dropHeight)+" viewport bottom", viewportBottom, "enough?", enoughRoomBelow);
+            // console.log("above/ offset.top", offset.top, "dropHeight", dropHeight, "top", (offset.top-dropHeight), "scrollTop", this.body().scrollTop(), "enough?", enoughRoomAbove);
+
+            // fix positioning when body has an offset and is not position: static
+
+            if (this.body().css('position') !== 'static') {
+                bodyOffset = this.body().offset();
+                dropTop -= bodyOffset.top;
+                dropLeft -= bodyOffset.left;
+            }
+
+            // always prefer the current above/below alignment, unless there is not enough room
+
+            if (aboveNow) {
+                above = true;
+                if (!enoughRoomAbove && enoughRoomBelow) above = false;
+            } else {
+                above = false;
+                if (!enoughRoomBelow && enoughRoomAbove) above = true;
+            }
+
+	    if (!enoughRoomOnRight) {
+		   dropLeft = offset.left + width - dropWidth;
+	    }
+
+            if (above) {
+                dropTop = offset.top - dropHeight;
+                this.container.addClass("select2-drop-above");
+                this.dropdown.addClass("select2-drop-above");
+            }
+            else {
+                this.container.removeClass("select2-drop-above");
+                this.dropdown.removeClass("select2-drop-above");
+            }
+
+            css = $.extend({
+                top: dropTop,
+                left: dropLeft,
+                width: width
+            }, evaluate(this.opts.dropdownCss));
+
+            this.dropdown.css(css);
+        },
+
+        // abstract
+        shouldOpen: function() {
+            var event;
+
+            if (this.opened()) return false;
+
+            event = $.Event("open");
+            this.opts.element.trigger(event);
+            return !event.isDefaultPrevented();
+        },
+
+        // abstract
+        clearDropdownAlignmentPreference: function() {
+            // clear the classes used to figure out the preference of where the dropdown should be opened
+            this.container.removeClass("select2-drop-above");
+            this.dropdown.removeClass("select2-drop-above");
+        },
+
+        /**
+         * Opens the dropdown
+         *
+         * @return {Boolean} whether or not dropdown was opened. This method will return false if, for example,
+         * the dropdown is already open, or if the 'open' event listener on the element called preventDefault().
+         */
+        // abstract
+        open: function () {
+
+            if (!this.shouldOpen()) return false;
+
+            window.setTimeout(this.bind(this.opening), 1);
+
+            return true;
+        },
+
+        /**
+         * Performs the opening of the dropdown
+         */
+        // abstract
+        opening: function() {
+            var cid = this.containerId, selector = this.containerSelector,
+                scroll = "scroll." + cid, resize = "resize." + cid;
+
+            this.container.parents().each(function() {
+                $(this).bind(scroll, function() {
+                    var s2 = $(selector);
+                    if (s2.length == 0) {
+                        $(this).unbind(scroll);
+                    }
+                    s2.select2("close");
+                });
+            });
+
+            window.setTimeout(function() {
+                // this is done inside a timeout because IE will sometimes fire a resize event while opening
+                // the dropdown and that causes this handler to immediately close it. this way the dropdown
+                // has a chance to fully open before we start listening to resize events
+                $(window).bind(resize, function() {
+                    var s2 = $(selector);
+                    if (s2.length == 0) {
+                        $(window).unbind(resize);
+                    }
+                    s2.select2("close");
+                })
+            }, 10);
+
+            this.clearDropdownAlignmentPreference();
+
+            if (this.search.val() === " ") { this.search.val(""); }
+
+            this.container.addClass("select2-dropdown-open").addClass("select2-container-active");
+
+            this.updateResults(true);
+
+            if(this.dropdown[0] !== this.body().children().last()[0]) {
+                this.dropdown.detach().appendTo(this.body());
+            }
+
+            this.dropdown.show();
+
+            this.positionDropdown();
+            this.dropdown.addClass("select2-drop-active");
+
+            this.ensureHighlightVisible();
+
+            this.focusSearch();
+        },
+
+        // abstract
+        close: function () {
+            if (!this.opened()) return;
+
+            var self = this;
+
+            this.container.parents().each(function() {
+                $(this).unbind("scroll." + self.containerId);
+            });
+            $(window).unbind("resize." + this.containerId);
+
+            this.clearDropdownAlignmentPreference();
+
+            this.dropdown.hide();
+            this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active");
+            this.results.empty();
+            this.clearSearch();
+
+            this.opts.element.trigger($.Event("close"));
+        },
+
+        // abstract
+        clearSearch: function () {
+
+        },
+
+        // abstract
+        ensureHighlightVisible: function () {
+            var results = this.results, children, index, child, hb, rb, y, more;
+
+            index = this.highlight();
+
+            if (index < 0) return;
+
+            if (index == 0) {
+
+                // if the first element is highlighted scroll all the way to the top,
+                // that way any unselectable headers above it will also be scrolled
+                // into view
+
+                results.scrollTop(0);
+                return;
+            }
+
+            children = results.find(".select2-result-selectable");
+
+            child = $(children[index]);
+
+            hb = child.offset().top + child.outerHeight(true);
+
+            // if this is the last child lets also make sure select2-more-results is visible
+            if (index === children.length - 1) {
+                more = results.find("li.select2-more-results");
+                if (more.length > 0) {
+                    hb = more.offset().top + more.outerHeight(true);
+                }
+            }
+
+            rb = results.offset().top + results.outerHeight(true);
+            if (hb > rb) {
+                results.scrollTop(results.scrollTop() + (hb - rb));
+            }
+            y = child.offset().top - results.offset().top;
+
+            // make sure the top of the element is visible
+            if (y < 0 && child.css('display') != 'none' ) {
+                results.scrollTop(results.scrollTop() + y); // y is negative
+            }
+        },
+
+        // abstract
+        moveHighlight: function (delta) {
+            var choices = this.results.find(".select2-result-selectable"),
+                index = this.highlight();
+
+            while (index > -1 && index < choices.length) {
+                index += delta;
+                var choice = $(choices[index]);
+                if (choice.hasClass("select2-result-selectable") && !choice.hasClass("select2-disabled")) {
+                    this.highlight(index);
+                    break;
+                }
+            }
+        },
+
+        // abstract
+        highlight: function (index) {
+            var choices = this.results.find(".select2-result-selectable").not(".select2-disabled");
+
+            if (arguments.length === 0) {
+                return indexOf(choices.filter(".select2-highlighted")[0], choices.get());
+            }
+
+            if (index >= choices.length) index = choices.length - 1;
+            if (index < 0) index = 0;
+
+            choices.removeClass("select2-highlighted");
+
+            $(choices[index]).addClass("select2-highlighted");
+            this.ensureHighlightVisible();
+
+        },
+
+        // abstract
+        countSelectableResults: function() {
+            return this.results.find(".select2-result-selectable").not(".select2-disabled").length;
+        },
+
+        // abstract
+        highlightUnderEvent: function (event) {
+            var el = $(event.target).closest(".select2-result-selectable");
+            if (el.length > 0 && !el.is(".select2-highlighted")) {
+        		var choices = this.results.find('.select2-result-selectable');
+                this.highlight(choices.index(el));
+            } else if (el.length == 0) {
+                // if we are over an unselectable item remove al highlights
+                this.results.find(".select2-highlighted").removeClass("select2-highlighted");
+            }
+        },
+
+        // abstract
+        loadMoreIfNeeded: function () {
+            var results = this.results,
+                more = results.find("li.select2-more-results"),
+                below, // pixels the element is below the scroll fold, below==0 is when the element is starting to be visible
+                offset = -1, // index of first element without data
+                page = this.resultsPage + 1,
+                self=this,
+                term=this.search.val(),
+                context=this.context;
+
+            if (more.length === 0) return;
+            below = more.offset().top - results.offset().top - results.height();
+
+            if (below <= 0) {
+                more.addClass("select2-active");
+                this.opts.query({
+                        term: term,
+                        page: page,
+                        context: context,
+                        matcher: this.opts.matcher,
+                        callback: this.bind(function (data) {
+
+                    // ignore a response if the select2 has been closed before it was received
+                    if (!self.opened()) return;
+
+
+                    self.opts.populateResults.call(this, results, data.results, {term: term, page: page, context:context});
+
+                    if (data.more===true) {
+                        more.detach().appendTo(results).text(self.opts.formatLoadMore(page+1));
+                        window.setTimeout(function() { self.loadMoreIfNeeded(); }, 10);
+                    } else {
+                        more.remove();
+                    }
+                    self.positionDropdown();
+                    self.resultsPage = page;
+                })});
+            }
+        },
+
+        /**
+         * Default tokenizer function which does nothing
+         */
+        tokenize: function() {
+
+        },
+
+        /**
+         * @param initial whether or not this is the call to this method right after the dropdown has been opened
+         */
+        // abstract
+        updateResults: function (initial) {
+            var search = this.search, results = this.results, opts = this.opts, data, self=this, input;
+
+            // if the search is currently hidden we do not alter the results
+            if (initial !== true && (this.showSearchInput === false || !this.opened())) {
+                return;
+            }
+
+            search.addClass("select2-active");
+
+            function postRender() {
+                results.scrollTop(0);
+                search.removeClass("select2-active");
+                self.positionDropdown();
+            }
+
+            function render(html) {
+                results.html(self.opts.escapeMarkup(html));
+                postRender();
+            }
+
+            if (opts.maximumSelectionSize >=1) {
+                data = this.data();
+                if ($.isArray(data) && data.length >= opts.maximumSelectionSize && checkFormatter(opts.formatSelectionTooBig, "formatSelectionTooBig")) {
+            	    render("<li class='select2-selection-limit'>" + opts.formatSelectionTooBig(opts.maximumSelectionSize) + "</li>");
+            	    return;
+                }
+            }
+
+            if (search.val().length < opts.minimumInputLength) {
+                if (checkFormatter(opts.formatInputTooShort, "formatInputTooShort")) {
+                    render("<li class='select2-no-results'>" + opts.formatInputTooShort(search.val(), opts.minimumInputLength) + "</li>");
+                } else {
+                    render("");
+                }
+                return;
+            }
+            else if (opts.formatSearching()) {
+                render("<li class='select2-searching'>" + opts.formatSearching() + "</li>");
+            }
+
+            // give the tokenizer a chance to pre-process the input
+            input = this.tokenize();
+            if (input != undefined && input != null) {
+                search.val(input);
+            }
+
+            this.resultsPage = 1;
+            opts.query({
+                    term: search.val(),
+                    page: this.resultsPage,
+                    context: null,
+                    matcher: opts.matcher,
+                    callback: this.bind(function (data) {
+                var def; // default choice
+
+                // ignore a response if the select2 has been closed before it was received
+                if (!this.opened()) return;
+
+                // save context, if any
+                this.context = (data.context===undefined) ? null : data.context;
+
+                // create a default choice and prepend it to the list
+                if (this.opts.createSearchChoice && search.val() !== "") {
+                    def = this.opts.createSearchChoice.call(null, search.val(), data.results);
+                    if (def !== undefined && def !== null && self.id(def) !== undefined && self.id(def) !== null) {
+                        if ($(data.results).filter(
+                            function () {
+                                return equal(self.id(this), self.id(def));
+                            }).length === 0) {
+                            data.results.unshift(def);
+                        }
+                    }
+                }
+
+                if (data.results.length === 0 && checkFormatter(opts.formatNoMatches, "formatNoMatches")) {
+                    render("<li class='select2-no-results'>" + opts.formatNoMatches(search.val()) + "</li>");
+                    return;
+                }
+
+                results.empty();
+                self.opts.populateResults.call(this, results, data.results, {term: search.val(), page: this.resultsPage, context:null});
+
+                if (data.more === true && checkFormatter(opts.formatLoadMore, "formatLoadMore")) {
+                    results.append("<li class='select2-more-results'>" + self.opts.escapeMarkup(opts.formatLoadMore(this.resultsPage)) + "</li>");
+                    window.setTimeout(function() { self.loadMoreIfNeeded(); }, 10);
+                }
+
+                this.postprocessResults(data, initial);
+
+                postRender();
+            })});
+        },
+
+        // abstract
+        cancel: function () {
+            this.close();
+        },
+
+        // abstract
+        blur: function () {
+            this.close();
+            this.container.removeClass("select2-container-active");
+            this.dropdown.removeClass("select2-drop-active");
+            // synonymous to .is(':focus'), which is available in jquery >= 1.6
+            if (this.search[0] === document.activeElement) { this.search.blur(); }
+            this.clearSearch();
+            this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");
+            this.opts.element.triggerHandler("blur");
+        },
+
+        // abstract
+        focusSearch: function () {
+            // need to do it here as well as in timeout so it works in IE
+            this.search.show();
+            this.search.focus();
+
+            /* we do this in a timeout so that current event processing can complete before this code is executed.
+             this makes sure the search field is focussed even if the current event would blur it */
+            window.setTimeout(this.bind(function () {
+                // reset the value so IE places the cursor at the end of the input box
+                this.search.show();
+                this.search.focus();
+                this.search.val(this.search.val());
+            }), 10);
+        },
+
+        // abstract
+        selectHighlighted: function () {
+            var index=this.highlight(),
+                highlighted=this.results.find(".select2-highlighted").not(".select2-disabled"),
+                data = highlighted.closest('.select2-result-selectable').data("select2-data");
+            if (data) {
+                highlighted.addClass("select2-disabled");
+                this.highlight(index);
+                this.onSelect(data);
+            }
+        },
+
+        // abstract
+        getPlaceholder: function () {
+            return this.opts.element.attr("placeholder") ||
+                this.opts.element.attr("data-placeholder") || // jquery 1.4 compat
+                this.opts.element.data("placeholder") ||
+                this.opts.placeholder;
+        },
+
+        /**
+         * Get the desired width for the container element.  This is
+         * derived first from option `width` passed to select2, then
+         * the inline 'style' on the original element, and finally
+         * falls back to the jQuery calculated element width.
+         */
+        // abstract
+        initContainerWidth: function () {
+            function resolveContainerWidth() {
+                var style, attrs, matches, i, l;
+
+                if (this.opts.width === "off") {
+                    return null;
+                } else if (this.opts.width === "element"){
+                    return this.opts.element.outerWidth(false) === 0 ? 'auto' : this.opts.element.outerWidth(false) + 'px';
+                } else if (this.opts.width === "copy" || this.opts.width === "resolve") {
+                    // check if there is inline style on the element that contains width
+                    style = this.opts.element.attr('style');
+                    if (style !== undefined) {
+                        attrs = style.split(';');
+                        for (i = 0, l = attrs.length; i < l; i = i + 1) {
+                            matches = attrs[i].replace(/\s/g, '')
+                                .match(/width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/);
+                            if (matches !== null && matches.length >= 1)
+                                return matches[1];
+                        }
+                    }
+
+                    if (this.opts.width === "resolve") {
+                        // next check if css('width') can resolve a width that is percent based, this is sometimes possible
+                        // when attached to input type=hidden or elements hidden via css
+                        style = this.opts.element.css('width');
+                        if (style.indexOf("%") > 0) return style;
+
+                        // finally, fallback on the calculated width of the element
+                        return (this.opts.element.outerWidth(false) === 0 ? 'auto' : this.opts.element.outerWidth(false) + 'px');
+                    }
+
+                    return null;
+                } else if ($.isFunction(this.opts.width)) {
+                    return this.opts.width();
+                } else {
+                    return this.opts.width;
+               }
+            };
+
+            var width = resolveContainerWidth.call(this);
+            if (width !== null) {
+                this.container.attr("style", "width: "+width);
+            }
+        }
+    });
+
+    SingleSelect2 = clazz(AbstractSelect2, {
+
+        // single
+
+		createContainer: function () {
+            var container = $("<div></div>", {
+                "class": "select2-container"
+            }).html([
+                "    <a href='javascript:void(0)' onclick='return false;' class='select2-choice'>",
+                "   <span></span><abbr class='select2-search-choice-close' style='display:none;'></abbr>",
+                "   <div><b></b></div>" ,
+                "</a>",
+                "    <div class='select2-drop select2-offscreen'>" ,
+                "   <div class='select2-search'>" ,
+                "       <input type='text' autocomplete='off' class='select2-input'/>" ,
+                "   </div>" ,
+                "   <ul class='select2-results'>" ,
+                "   </ul>" ,
+                "</div>"].join(""));
+            return container;
+        },
+
+        // single
+        opening: function () {
+            this.search.show();
+            this.parent.opening.apply(this, arguments);
+            this.dropdown.removeClass("select2-offscreen");
+        },
+
+        // single
+        close: function () {
+            if (!this.opened()) return;
+            this.parent.close.apply(this, arguments);
+            this.dropdown.removeAttr("style").addClass("select2-offscreen").insertAfter(this.selection).show();
+        },
+
+        // single
+        focus: function () {
+            this.close();
+            this.selection.focus();
+        },
+
+        // single
+        isFocused: function () {
+            return this.selection[0] === document.activeElement;
+        },
+
+        // single
+        cancel: function () {
+            this.parent.cancel.apply(this, arguments);
+            this.selection.focus();
+        },
+
+        // single
+        initContainer: function () {
+
+            var selection,
+                container = this.container,
+                dropdown = this.dropdown,
+                clickingInside = false;
+
+            this.selection = selection = container.find(".select2-choice");
+
+            this.search.bind("keydown", this.bind(function (e) {
+                if (!this.enabled) return;
+
+                if (e.which === KEY.PAGE_UP || e.which === KEY.PAGE_DOWN) {
+                    // prevent the page from scrolling
+                    killEvent(e);
+                    return;
+                }
+
+                if (this.opened()) {
+                    switch (e.which) {
+                        case KEY.UP:
+                        case KEY.DOWN:
+                            this.moveHighlight((e.which === KEY.UP) ? -1 : 1);
+                            killEvent(e);
+                            return;
+                        case KEY.TAB:
+                        case KEY.ENTER:
+                            this.selectHighlighted();
+                            killEvent(e);
+                            return;
+                        case KEY.ESC:
+                            this.cancel(e);
+                            killEvent(e);
+                            return;
+                    }
+                } else {
+
+                    if (e.which === KEY.TAB || KEY.isControl(e) || KEY.isFunctionKey(e) || e.which === KEY.ESC) {
+                        return;
+                    }
+
+                    if (this.opts.openOnEnter === false && e.which === KEY.ENTER) {
+                        return;
+                    }
+
+                    this.open();
+
+                    if (e.which === KEY.ENTER) {
+                        // do not propagate the event otherwise we open, and propagate enter which closes
+                        return;
+                    }
+                }
+            }));
+
+            this.search.bind("focus", this.bind(function() {
+                this.selection.attr("tabIndex", "-1");
+            }));
+            this.search.bind("blur", this.bind(function() {
+                if (!this.opened()) this.container.removeClass("select2-container-active");
+                window.setTimeout(this.bind(function() {
+                    // restore original tab index
+                    var ti=this.opts.element.attr("tabIndex");
+                    if (ti) {
+                        this.selection.attr("tabIndex", ti);
+                    } else {
+                        this.selection.removeAttr("tabIndex");
+                    }
+                }), 10);
+            }));
+
+            selection.delegate("abbr", "mousedown", this.bind(function (e) {
+                if (!this.enabled) return;
+                this.clear();
+                killEventImmediately(e);
+                this.close();
+                this.triggerChange();
+                this.selection.focus();
+            }));
+
+            selection.bind("mousedown", this.bind(function (e) {
+                clickingInside = true;
+
+                if (this.opened()) {
+                    this.close();
+                    this.selection.focus();
+                } else if (this.enabled) {
+                    this.open();
+                }
+
+                clickingInside = false;
+            }));
+
+            dropdown.bind("mousedown", this.bind(function() { this.search.focus(); }));
+
+            selection.bind("focus", this.bind(function() {
+                this.container.addClass("select2-container-active");
+                // hide the search so the tab key does not focus on it
+                this.search.attr("tabIndex", "-1");
+            }));
+
+            selection.bind("blur", this.bind(function() {
+                if (!this.opened()) {
+                    this.container.removeClass("select2-container-active");
+                }
+                window.setTimeout(this.bind(function() { this.search.attr("tabIndex", this.opts.element.attr("tabIndex")); }), 10);
+            }));
+
+            selection.bind("keydown", this.bind(function(e) {
+                if (!this.enabled) return;
+
+                if (e.which == KEY.DOWN || e.which == KEY.UP
+                    || (e.which == KEY.ENTER && this.opts.openOnEnter)) {
+                    this.open();
+                    killEvent(e);
+                    return;
+                }
+
+                if (e.which == KEY.DELETE || e.which == KEY.BACKSPACE) {
+                    if (this.opts.allowClear) {
+                        this.clear();
+                    }
+                    killEvent(e);
+                    return;
+                }
+            }));
+            selection.bind("keypress", this.bind(function(e) {
+                var key = String.fromCharCode(e.which);
+                this.search.val(key);
+                this.open();
+            }));
+
+            this.setPlaceholder();
+
+            this.search.bind("focus", this.bind(function() {
+                this.container.addClass("select2-container-active");
+            }));
+        },
+
+        // single
+        clear: function() {
+            this.opts.element.val("");
+            this.selection.find("span").empty();
+            this.selection.removeData("select2-data");
+            this.setPlaceholder();
+        },
+
+        /**
+         * Sets selection based on source element's value
+         */
+        // single
+        initSelection: function () {
+            var selected;
+            if (this.opts.element.val() === "" && this.opts.element.text() === "") {
+                this.close();
+                this.setPlaceholder();
+            } else {
+                var self = this;
+                this.opts.initSelection.call(null, this.opts.element, function(selected){
+                    if (selected !== undefined && selected !== null) {
+                        self.updateSelection(selected);
+                        self.close();
+                        self.setPlaceholder();
+                    }
+                });
+            }
+        },
+
+        // single
+        prepareOpts: function () {
+            var opts = this.parent.prepareOpts.apply(this, arguments);
+
+            if (opts.element.get(0).tagName.toLowerCase() === "select") {
+                // install the selection initializer
+                opts.initSelection = function (element, callback) {
+                    var selected = element.find("option[selected]");
+                    // a single select box always has a value, no need to null check 'selected'
+                    if ($.isFunction(callback))
+                        callback({id: selected.attr("value"), text: selected.text(), element:selected});
+                };
+            }
+
+            return opts;
+        },
+
+        // single
+        setPlaceholder: function () {
+            var placeholder = this.getPlaceholder();
+
+            if (this.opts.element.val() === "" && placeholder !== undefined) {
+
+                // check for a first blank option if attached to a select
+                if (this.select && this.select.find("option:first").text() !== "") return;
+
+                this.selection.find("span").html(this.opts.escapeMarkup(placeholder));
+
+                this.selection.addClass("select2-default");
+
+                this.selection.find("abbr").hide();
+            }
+        },
+
+        // single
+        postprocessResults: function (data, initial) {
+            var selected = 0, self = this, showSearchInput = true;
+
+            // find the selected element in the result list
+
+            this.results.find(".select2-result-selectable").each2(function (i, elm) {
+                if (equal(self.id(elm.data("select2-data")), self.opts.element.val())) {
+                    selected = i;
+                    return false;
+                }
+            });
+
+            // and highlight it
+
+            this.highlight(selected);
+
+            // hide the search box if this is the first we got the results and there are a few of them
+
+            if (initial === true) {
+                showSearchInput = this.showSearchInput = countResults(data.results) >= this.opts.minimumResultsForSearch;
+                this.dropdown.find(".select2-search")[showSearchInput ? "removeClass" : "addClass"]("select2-search-hidden");
+
+                //add "select2-with-searchbox" to the container if search box is shown
+                $(this.dropdown, this.container)[showSearchInput ? "addClass" : "removeClass"]("select2-with-searchbox");
+            }
+
+        },
+
+        // single
+        onSelect: function (data) {
+            var old = this.opts.element.val();
+
+            this.opts.element.val(this.id(data));
+            this.updateSelection(data);
+            this.close();
+            this.selection.focus();
+
+            if (!equal(old, this.id(data))) { this.triggerChange(); }
+        },
+
+        // single
+        updateSelection: function (data) {
+
+            var container=this.selection.find("span"), formatted;
+
+            this.selection.data("select2-data", data);
+
+            container.empty();
+            formatted=this.opts.formatSelection(data, container);
+            if (formatted !== undefined) {
+                container.append(this.opts.escapeMarkup(formatted));
+            }
+
+            this.selection.removeClass("select2-default");
+
+            if (this.opts.allowClear && this.getPlaceholder() !== undefined) {
+                this.selection.find("abbr").show();
+            }
+        },
+
+        // single
+        val: function () {
+            var val, data = null, self = this;
+
+            if (arguments.length === 0) {
+                return this.opts.element.val();
+            }
+
+            val = arguments[0];
+
+            if (this.select) {
+                this.select
+                    .val(val)
+                    .find("option[selected]").each2(function (i, elm) {
+                        data = {id: elm.attr("value"), text: elm.text()};
+                        return false;
+                    });
+                this.updateSelection(data);
+                this.setPlaceholder();
+            } else {
+                if (this.opts.initSelection === undefined) {
+                    throw new Error("cannot call val() if initSelection() is not defined");
+                }
+                // val is an id. !val is true for [undefined,null,'']
+                if (!val) {
+                    this.clear();
+                    return;
+                }
+                this.opts.element.val(val);
+                this.opts.initSelection(this.opts.element, function(data){
+                    self.opts.element.val(!data ? "" : self.id(data));
+                    self.updateSelection(data);
+                    self.setPlaceholder();
+                });
+            }
+        },
+
+        // single
+        clearSearch: function () {
+            this.search.val("");
+        },
+
+        // single
+        data: function(value) {
+            var data;
+
+            if (arguments.length === 0) {
+                data = this.selection.data("select2-data");
+                if (data == undefined) data = null;
+                return data;
+            } else {
+                if (!value || value === "") {
+                    this.clear();
+                } else {
+                    this.opts.element.val(!value ? "" : this.id(value));
+                    this.updateSelection(value);
+                }
+            }
+        }
+    });
+
+    MultiSelect2 = clazz(AbstractSelect2, {
+
+        // multi
+        createContainer: function () {
+            var container = $("<div></div>", {
+                "class": "select2-container select2-container-multi"
+            }).html([
+                "    <ul class='select2-choices'>",
+                //"<li class='select2-search-choice'><span>California</span><a href="javascript:void(0)" class="select2-search-choice-close"></a></li>" ,
+                "  <li class='select2-search-field'>" ,
+                "    <input type='text' autocomplete='off' class='select2-input'>" ,
+                "  </li>" ,
+                "</ul>" ,
+                "<div class='select2-drop select2-drop-multi' style='display:none;'>" ,
+                "   <ul class='select2-results'>" ,
+                "   </ul>" ,
+                "</div>"].join(""));
+			return container;
+        },
+
+        // multi
+        prepareOpts: function () {
+            var opts = this.parent.prepareOpts.apply(this, arguments);
+
+            // TODO validate placeholder is a string if specified
+
+            if (opts.element.get(0).tagName.toLowerCase() === "select") {
+                // install sthe selection initializer
+                opts.initSelection = function (element,callback) {
+
+                    var data = [];
+                    element.find("option[selected]").each2(function (i, elm) {
+                        data.push({id: elm.attr("value"), text: elm.text(), element: elm});
+                    });
+
+                    if ($.isFunction(callback))
+                        callback(data);
+                };
+            }
+
+            return opts;
+        },
+
+        // multi
+        initContainer: function () {
+
+            var selector = ".select2-choices", selection;
+
+            this.searchContainer = this.container.find(".select2-search-field");
+            this.selection = selection = this.container.find(selector);
+
+            this.search.bind("keydown", this.bind(function (e) {
+                if (!this.enabled) return;
+
+                if (e.which === KEY.BACKSPACE && this.search.val() === "") {
+                    this.close();
+
+                    var choices,
+                        selected = selection.find(".select2-search-choice-focus");
+                    if (selected.length > 0) {
+                        this.unselect(selected.first());
+                        this.search.width(10);
+                        killEvent(e);
+                        return;
+                    }
+
+                    choices = selection.find(".select2-search-choice:not(.select2-locked)");
+                    if (choices.length > 0) {
+                        choices.last().addClass("select2-search-choice-focus");
+                    }
+                } else {
+                    selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");
+                }
+
+                if (this.opened()) {
+                    switch (e.which) {
+                    case KEY.UP:
+                    case KEY.DOWN:
+                        this.moveHighlight((e.which === KEY.UP) ? -1 : 1);
+                        killEvent(e);
+                        return;
+                    case KEY.ENTER:
+                    case KEY.TAB:
+                        this.selectHighlighted();
+                        killEvent(e);
+                        return;
+                    case KEY.ESC:
+                        this.cancel(e);
+                        killEvent(e);
+                        return;
+                    }
+                }
+
+                if (e.which === KEY.TAB || KEY.isControl(e) || KEY.isFunctionKey(e)
+                 || e.which === KEY.BACKSPACE || e.which === KEY.ESC) {
+                    return;
+                }
+
+                if (this.opts.openOnEnter === false && e.which === KEY.ENTER) {
+                    return;
+                }
+
+                this.open();
+
+                if (e.which === KEY.PAGE_UP || e.which === KEY.PAGE_DOWN) {
+                    // prevent the page from scrolling
+                    killEvent(e);
+                }
+            }));
+
+            this.search.bind("keyup", this.bind(this.resizeSearch));
+
+            this.search.bind("blur", this.bind(function(e) {
+                this.container.removeClass("select2-container-active");
+                this.search.removeClass("select2-focused");
+                this.clearSearch();
+                e.stopImmediatePropagation();
+            }));
+
+            this.container.delegate(selector, "mousedown", this.bind(function (e) {
+                if (!this.enabled) return;
+                if ($(e.target).closest(".select2-search-choice").length > 0) {
+                    // clicked inside a select2 search choice, do not open
+                    return;
+                }
+                this.clearPlaceholder();
+                this.open();
+                this.focusSearch();
+                e.preventDefault();
+            }));
+
+            this.container.delegate(selector, "focus", this.bind(function () {
+                if (!this.enabled) return;
+                this.container.addClass("select2-container-active");
+                this.dropdown.addClass("select2-drop-active");
+                this.clearPlaceholder();
+            }));
+
+            // set the placeholder if necessary
+            this.clearSearch();
+        },
+
+        // multi
+        enable: function() {
+            if (this.enabled) return;
+
+            this.parent.enable.apply(this, arguments);
+
+            this.search.removeAttr("disabled");
+        },
+
+        // multi
+        disable: function() {
+            if (!this.enabled) return;
+
+            this.parent.disable.apply(this, arguments);
+
+            this.search.attr("disabled", true);
+        },
+
+        // multi
+        initSelection: function () {
+            var data;
+            if (this.opts.element.val() === "" && this.opts.element.text() === "") {
+                this.updateSelection([]);
+                this.close();
+                // set the placeholder if necessary
+                this.clearSearch();
+            }
+            if (this.select || this.opts.element.val() !== "") {
+                var self = this;
+                this.opts.initSelection.call(null, this.opts.element, function(data){
+                    if (data !== undefined && data !== null) {
+                        self.updateSelection(data);
+                        self.close();
+                        // set the placeholder if necessary
+                        self.clearSearch();
+                    }
+                });
+            }
+        },
+
+        // multi
+        clearSearch: function () {
+            var placeholder = this.getPlaceholder();
+
+            if (placeholder !== undefined  && this.getVal().length === 0 && this.search.hasClass("select2-focused") === false) {
+                this.search.val(placeholder).addClass("select2-default");
+                // stretch the search box to full width of the container so as much of the placeholder is visible as possible
+                this.resizeSearch();
+            } else {
+                // we set this to " " instead of "" and later clear it on focus() because there is a firefox bug
+                // that does not properly render the caret when the field starts out blank
+                this.search.val(" ").width(10);
+            }
+        },
+
+        // multi
+        clearPlaceholder: function () {
+            if (this.search.hasClass("select2-default")) {
+                this.search.val("").removeClass("select2-default");
+            } else {
+                // work around for the space character we set to avoid firefox caret bug
+                if (this.search.val() === " ") this.search.val("");
+            }
+        },
+
+        // multi
+        opening: function () {
+            this.parent.opening.apply(this, arguments);
+
+            this.clearPlaceholder();
+			this.resizeSearch();
+            this.focusSearch();
+        },
+
+        // multi
+        close: function () {
+            if (!this.opened()) return;
+            this.parent.close.apply(this, arguments);
+        },
+
+        // multi
+        focus: function () {
+            this.close();
+            this.search.focus();
+        },
+
+        // multi
+        isFocused: function () {
+            return this.search.hasClass("select2-focused");
+        },
+
+        // multi
+        updateSelection: function (data) {
+            var ids = [], filtered = [], self = this;
+
+            // filter out duplicates
+            $(data).each(function () {
+                if (indexOf(self.id(this), ids) < 0) {
+                    ids.push(self.id(this));
+                    filtered.push(this);
+                }
+            });
+            data = filtered;
+
+            this.selection.find(".select2-search-choice").remove();
+            $(data).each(function () {
+                self.addSelectedChoice(this);
+            });
+            self.postprocessResults();
+        },
+
+        tokenize: function() {
+            var input = this.search.val();
+            input = this.opts.tokenizer(input, this.data(), this.bind(this.onSelect), this.opts);
+            if (input != null && input != undefined) {
+                this.search.val(input);
+                if (input.length > 0) {
+                    this.open();
+                }
+            }
+
+        },
+
+        // multi
+        onSelect: function (data) {
+            this.addSelectedChoice(data);
+            if (this.select || !this.opts.closeOnSelect) this.postprocessResults();
+
+            if (this.opts.closeOnSelect) {
+                this.close();
+                this.search.width(10);
+            } else {
+                if (this.countSelectableResults()>0) {
+                    this.search.width(10);
+                    this.resizeSearch();
+                    this.positionDropdown();
+                } else {
+                    // if nothing left to select close
+                    this.close();
+                }
+            }
+
+            // since its not possible to select an element that has already been
+            // added we do not need to check if this is a new element before firing change
+            this.triggerChange({ added: data });
+
+            this.focusSearch();
+        },
+
+        // multi
+        cancel: function () {
+            this.close();
+            this.focusSearch();
+        },
+
+        addSelectedChoice: function (data) {
+            var enableChoice = !data.locked,
+                enabledItem = $(
+                    "<li class='select2-search-choice'>" +
+                    "    <div></div>" +
+                    "    <a href='#' onclick='return false;' class='select2-search-choice-close' tabindex='-1'></a>" +
+                    "</li>"),
+                disabledItem = $(
+                    "<li class='select2-search-choice select2-locked'>" +
+                    "<div></div>" +
+                    "</li>");
+            var choice = enableChoice ? enabledItem : disabledItem,
+                id = this.id(data),
+                val = this.getVal(),
+                formatted;
+
+            formatted=this.opts.formatSelection(data, choice.find("div"));
+            if (formatted != undefined) {
+                choice.find("div").replaceWith("<div>"+this.opts.escapeMarkup(formatted)+"</div>");
+            }
+
+            if(enableChoice){
+              choice.find(".select2-search-choice-close")
+                  .bind("mousedown", killEvent)
+                  .bind("click dblclick", this.bind(function (e) {
+                  if (!this.enabled) return;
+
+                  $(e.target).closest(".select2-search-choice").fadeOut('fast', this.bind(function(){
+                      this.unselect($(e.target));
+                      this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");
+                      this.close();
+                      this.focusSearch();
+                  })).dequeue();
+                  killEvent(e);
+              })).bind("focus", this.bind(function () {
+                  if (!this.enabled) return;
+                  this.container.addClass("select2-container-active");
+                  this.dropdown.addClass("select2-drop-active");
+              }));
+            }
+
+            choice.data("select2-data", data);
+            choice.insertBefore(this.searchContainer);
+
+            val.push(id);
+            this.setVal(val);
+        },
+
+        // multi
+        unselect: function (selected) {
+            var val = this.getVal(),
+                data,
+                index;
+
+            selected = selected.closest(".select2-search-choice");
+
+            if (selected.length === 0) {
+                throw "Invalid argument: " + selected + ". Must be .select2-search-choice";
+            }
+
+            data = selected.data("select2-data");
+
+            index = indexOf(this.id(data), val);
+
+            if (index >= 0) {
+                val.splice(index, 1);
+                this.setVal(val);
+                if (this.select) this.postprocessResults();
+            }
+            selected.remove();
+            this.triggerChange({ removed: data });
+        },
+
+        // multi
+        postprocessResults: function () {
+            var val = this.getVal(),
+                choices = this.results.find(".select2-result-selectable"),
+                compound = this.results.find(".select2-result-with-children"),
+                self = this;
+
+            choices.each2(function (i, choice) {
+                var id = self.id(choice.data("select2-data"));
+                if (indexOf(id, val) >= 0) {
+                    choice.addClass("select2-disabled").removeClass("select2-result-selectable");
+                } else {
+                    choice.removeClass("select2-disabled").addClass("select2-result-selectable");
+                }
+            });
+
+            compound.each2(function(i, e) {
+                if (!e.is('.select2-result-selectable') && e.find(".select2-result-selectable").length==0) {  // FIX FOR HIRECHAL DATA
+                    e.addClass("select2-disabled");
+                } else {
+                    e.removeClass("select2-disabled");
+                }
+            });
+
+            if (this.highlight() == -1){
+                choices.each2(function (i, choice) {
+                    if (!choice.hasClass("select2-disabled") && choice.hasClass("select2-result-selectable")) {
+                        self.highlight(0);
+                        return false;
+                    }
+                });
+            }
+
+        },
+
+        // multi
+        resizeSearch: function () {
+
+            var minimumWidth, left, maxWidth, containerLeft, searchWidth,
+            	sideBorderPadding = getSideBorderPadding(this.search);
+
+            minimumWidth = measureTextWidth(this.search) + 10;
+
+            left = this.search.offset().left;
+
+            maxWidth = this.selection.width();
+            containerLeft = this.selection.offset().left;
+
+            searchWidth = maxWidth - (left - containerLeft) - sideBorderPadding;
+            if (searchWidth < minimumWidth) {
+                searchWidth = maxWidth - sideBorderPadding;
+            }
+
+            if (searchWidth < 40) {
+                searchWidth = maxWidth - sideBorderPadding;
+            }
+            this.search.width(searchWidth);
+        },
+
+        // multi
+        getVal: function () {
+            var val;
+            if (this.select) {
+                val = this.select.val();
+                return val === null ? [] : val;
+            } else {
+                val = this.opts.element.val();
+                return splitVal(val, this.opts.separator);
+            }
+        },
+
+        // multi
+        setVal: function (val) {
+            var unique;
+            if (this.select) {
+                this.select.val(val);
+            } else {
+                unique = [];
+                // filter out duplicates
+                $(val).each(function () {
+                    if (indexOf(this, unique) < 0) unique.push(this);
+                });
+                this.opts.element.val(unique.length === 0 ? "" : unique.join(this.opts.separator));
+            }
+        },
+
+        // multi
+        val: function () {
+            var val, data = [], self=this;
+
+            if (arguments.length === 0) {
+                return this.getVal();
+            }
+
+            val = arguments[0];
+
+            if (!val) {
+                this.opts.element.val("");
+                this.updateSelection([]);
+                this.clearSearch();
+                return;
+            }
+
+            // val is a list of ids
+            this.setVal(val);
+
+            if (this.select) {
+                this.select.find("option[selected]").each(function () {
+                    data.push({id: $(this).attr("value"), text: $(this).text()});
+                });
+                this.updateSelection(data);
+            } else {
+                if (this.opts.initSelection === undefined) {
+                    throw new Error("val() cannot be called if initSelection() is not defined")
+                }
+
+                this.opts.initSelection(this.opts.element, function(data){
+                    var ids=$(data).map(self.id);
+                    self.setVal(ids);
+                    self.updateSelection(data);
+                    self.clearSearch();
+                });
+            }
+            this.clearSearch();
+        },
+
+        // multi
+        onSortStart: function() {
+            if (this.select) {
+                throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");
+            }
+
+            // collapse search field into 0 width so its container can be collapsed as well
+            this.search.width(0);
+            // hide the container
+            this.searchContainer.hide();
+        },
+
+        // multi
+        onSortEnd:function() {
+
+            var val=[], self=this;
+
+            // show search and move it to the end of the list
+            this.searchContainer.show();
+            // make sure the search container is the last item in the list
+            this.searchContainer.appendTo(this.searchContainer.parent());
+            // since we collapsed the width in dragStarted, we resize it here
+            this.resizeSearch();
+
+            // update selection
+
+            this.selection.find(".select2-search-choice").each(function() {
+                val.push(self.opts.id($(this).data("select2-data")));
+            });
+            this.setVal(val);
+            this.triggerChange();
+        },
+
+        // multi
+        data: function(values) {
+            var self=this, ids;
+            if (arguments.length === 0) {
+                 return this.selection
+                     .find(".select2-search-choice")
+                     .map(function() { return $(this).data("select2-data"); })
+                     .get();
+            } else {
+                if (!values) { values = []; }
+                ids = $.map(values, function(e) { return self.opts.id(e)});
+                this.setVal(ids);
+                this.updateSelection(values);
+                this.clearSearch();
+            }
+        }
+    });
+
+    $.fn.select2 = function () {
+
+        var args = Array.prototype.slice.call(arguments, 0),
+            opts,
+            select2,
+            value, multiple, allowedMethods = ["val", "destroy", "opened", "open", "close", "focus", "isFocused", "container", "onSortStart", "onSortEnd", "enable", "disable", "positionDropdown", "data"];
+
+        this.each(function () {
+            if (args.length === 0 || typeof(args[0]) === "object") {
+                opts = args.length === 0 ? {} : $.extend({}, args[0]);
+                opts.element = $(this);
+
+                if (opts.element.get(0).tagName.toLowerCase() === "select") {
+                    multiple = opts.element.attr("multiple");
+                } else {
+                    multiple = opts.multiple || false;
+                    if ("tags" in opts) {opts.multiple = multiple = true;}
+                }
+
+                select2 = multiple ? new MultiSelect2() : new SingleSelect2();
+                select2.init(opts);
+            } else if (typeof(args[0]) === "string") {
+
+                if (indexOf(args[0], allowedMethods) < 0) {
+                    throw "Unknown method: " + args[0];
+                }
+
+                value = undefined;
+                select2 = $(this).data("select2");
+                if (select2 === undefined) return;
+                if (args[0] === "container") {
+                    value=select2.container;
+                } else {
+                    value = select2[args[0]].apply(select2, args.slice(1));
+                }
+                if (value !== undefined) {return false;}
+            } else {
+                throw "Invalid arguments to select2 plugin: " + args;
+            }
+        });
+        return (value === undefined) ? this : value;
+    };
+
+    // plugin defaults, accessible to users
+    $.fn.select2.defaults = {
+        width: "copy",
+        closeOnSelect: true,
+        openOnEnter: true,
+        containerCss: {},
+        dropdownCss: {},
+        containerCssClass: "",
+        dropdownCssClass: "",
+        formatResult: function(result, container, query) {
+            var markup=[];
+            markMatch(result.text, query.term, markup);
+            return markup.join("");
+        },
+        formatSelection: function (data, container) {
+            return data ? data.text : undefined;
+        },
+        formatResultCssClass: function(data) {return undefined;},
+        formatNoMatches: function () { return "No matches found"; },
+        formatInputTooShort: function (input, min) { var n = min - input.length; return "Please enter " + n + " more character" + (n == 1? "" : "s"); },
+        formatSelectionTooBig: function (limit) { return "You can only select " + limit + " item" + (limit == 1 ? "" : "s"); },
+        formatLoadMore: function (pageNumber) { return "Loading more results..."; },
+        formatSearching: function () { return "Searching..."; },
+        minimumResultsForSearch: 0,
+        minimumInputLength: 0,
+        maximumSelectionSize: 0,
+        id: function (e) { return e.id; },
+        matcher: function(term, text) {
+            return text.toUpperCase().indexOf(term.toUpperCase()) >= 0;
+        },
+        separator: ",",
+        tokenSeparators: [],
+        tokenizer: defaultTokenizer,
+        escapeMarkup: function (markup) {
+            if (markup && typeof(markup) === "string") {
+                return markup.replace(/&/g, "&amp;");
+            }
+            return markup;
+        },
+        blurOnChange: false
+    };
+
+    // exports
+    window.Select2 = {
+        query: {
+            ajax: ajax,
+            local: local,
+            tags: tags
+        }, util: {
+            debounce: debounce,
+            markMatch: markMatch
+        }, "class": {
+            "abstract": AbstractSelect2,
+            "single": SingleSelect2,
+            "multi": MultiSelect2
+        }
+    };
+
+}(jQuery));
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/select2/select2.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/select2/select2.png
new file mode 100644
index 0000000000000000000000000000000000000000..1d804ffb99699b9e030f1010314de0970b5a000d
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/select2/select2.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/select2/select2x2.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/select2/select2x2.png
new file mode 100644
index 0000000000000000000000000000000000000000..4bdd5c961d452c49dfa0789c2c7ffb82c238fc24
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/select2/select2x2.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/accordion_tab.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/accordion_tab.php
new file mode 100644
index 0000000000000000000000000000000000000000..3c34314231b45fccce7cf962ef29d6fe0fb58e48
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/accordion_tab.php
@@ -0,0 +1,4 @@
+<h3 class="accordion_tab" id="<?php echo esc_attr($id) ?>"><a href="#"><?php echo_h($title) ?></a></h3>
+<div id="<?php echo esc_attr($id) ?>_content">
+	<?php echo $content ?>
+</div>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/entity_errors.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/entity_errors.php
new file mode 100644
index 0000000000000000000000000000000000000000..c4b3237443b92b41c1f7c9f6582fef83fcbc9ec5
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/entity_errors.php
@@ -0,0 +1,10 @@
+<div class="entity_errors">
+	<p>Please correct the following:</p>
+	<ul>
+		<?php foreach($entity->get_errors() as $property => $errors): ?>
+			<?php foreach ($errors as $error): ?>
+				<li><?php echo_h($error) ?></li>
+			<?php endforeach ?>
+		<?php endforeach ?>
+	</ul>
+</div>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/entity_saved.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/entity_saved.php
new file mode 100644
index 0000000000000000000000000000000000000000..4f26e34d2167f1007c3df328f19ac01cd345d0b0
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/entity_saved.php
@@ -0,0 +1,3 @@
+<div class='success updated'>
+	<p><?php echo_h($message) ?> saved successfully</p>
+</div>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/field_generator/nextgen_settings_field_color.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/field_generator/nextgen_settings_field_color.php
new file mode 100644
index 0000000000000000000000000000000000000000..2d11be220b81c214c85f84d474415727952e0297
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/field_generator/nextgen_settings_field_color.php
@@ -0,0 +1,17 @@
+<tr id='tr_<?php print esc_attr("{$display_type_name}_{$name}"); ?>' class='<?php print !empty($hidden) ? 'hidden' : ''; ?>'>
+    <td>
+        <label for="<?php print esc_attr("{$display_type_name}_{$name}"); ?>"
+               <?php if (!empty($text)) { ?>title='<?php print esc_attr($text); ?>'<?php } ?>
+               <?php if (!empty($text)) { ?>class='tooltip'<?php } ?>>
+            <?php print $label; ?>
+        </label>
+    </td>
+    <td>
+        <input type='text'
+               id='<?php print esc_attr("{$display_type_name}_{$name}"); ?>'
+               name='<?php print esc_attr("{$display_type_name}[{$name}]"); ?>'
+               class='<?php print esc_attr("{$display_type_name}_{$name}"); ?> nextgen_settings_field_colorpicker'
+               value='<?php print esc_attr($value); ?>'
+               data-default-color='<?php print esc_attr($value); ?>'/>
+    </td>
+</tr>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/field_generator/nextgen_settings_field_number.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/field_generator/nextgen_settings_field_number.php
new file mode 100644
index 0000000000000000000000000000000000000000..e1bab0484d6f124152078c440293ec2e78c30325
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/field_generator/nextgen_settings_field_number.php
@@ -0,0 +1,20 @@
+<tr id='tr_<?php print esc_attr("{$display_type_name}_{$name}"); ?>' class='<?php print !empty($hidden) ? 'hidden' : ''; ?>'>
+    <td>
+        <label for="<?php print esc_attr("{$display_type_name}_{$name}"); ?>"
+               <?php if (!empty($text)) { ?>title='<?php print esc_attr($text); ?>'<?php } ?>
+               <?php if (!empty($text)) { ?>class='tooltip'<?php } ?>>
+            <?php print $label; ?>
+        </label>
+    </td>
+    <td>
+        <input type='number'
+               step='any'
+               id='<?php print esc_attr("{$display_type_name}_{$name}"); ?>'
+               name='<?php print esc_attr("{$display_type_name}[{$name}]"); ?>'
+               class='<?php print esc_attr("{$display_type_name}[{$name}]"); ?>'
+               <?php if (!empty($placeholder)) { ?>placeholder='<?php print esc_attr($placeholder); ?>'<?php } ?>
+               <?php if (!empty($min) || $min === 0) { ?>min='<?php print esc_attr($min); ?>'<?php } ?>
+               <?php if (!empty($max) || $max === 0) { ?>max='<?php print esc_attr($max); ?>'<?php } ?>
+               value='<?php print esc_attr($value); ?>'/>
+    </td>
+</tr>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/field_generator/nextgen_settings_field_radio.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/field_generator/nextgen_settings_field_radio.php
new file mode 100644
index 0000000000000000000000000000000000000000..a82936254cbdc06d240ac52ddcc7398964ac4d13
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/field_generator/nextgen_settings_field_radio.php
@@ -0,0 +1,26 @@
+<tr id='tr_<?php print esc_attr("{$display_type_name}_{$name}"); ?>' class='<?php print !empty($hidden) ? 'hidden' : ''; ?>'>
+    <td>
+        <label for="<?php print esc_attr("{$display_type_name}_{$name}"); ?>"
+               <?php if (!empty($text)) { ?>title='<?php print esc_attr($text); ?>'<?php } ?>
+               <?php if (!empty($text)) { ?>class='tooltip'<?php } ?>>
+            <?php print $label; ?>
+        </label>
+    </td>
+    <td>
+        <input type="radio"
+               id="<?php print esc_attr($display_type_name . '_' . $name); ?>"
+               name="<?php print esc_attr($display_type_name . '[' . $name . ']'); ?>"
+               class="<?php print esc_attr($display_type_name . '_' . $name); ?>"
+               value="1"
+               <?php checked(True, !empty($value)); ?>/>
+        <label for="<?php print esc_attr($display_type_name . '_' . $name); ?>"><?php _e('Yes'); ?></label>
+        &nbsp;
+        <input type="radio"
+               id="<?php print esc_attr($display_type_name . '_' . $name); ?>_no"
+               name="<?php print esc_attr($display_type_name . '[' . $name . ']'); ?>"
+               class="<?php print esc_attr($display_type_name . '_' . $name); ?>"
+               value="0"
+               <?php checked(True, empty($value)); ?>/>
+        <label for="<?php print esc_attr($display_type_name . '_' . $name); ?>_no"><?php _e('No'); ?></label>
+    </td>
+</tr>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/field_generator/nextgen_settings_field_select.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/field_generator/nextgen_settings_field_select.php
new file mode 100644
index 0000000000000000000000000000000000000000..b310b207faa038774eef60a057cd632f151723c4
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/field_generator/nextgen_settings_field_select.php
@@ -0,0 +1,18 @@
+<tr id='tr_<?php print esc_attr("{$display_type_name}_{$name}"); ?>' class='<?php print !empty($hidden) ? 'hidden' : ''; ?>'>
+    <td>
+        <label for="<?php print esc_attr("{$display_type_name}_{$name}"); ?>"
+               <?php if (!empty($text)) { ?>title='<?php print esc_attr($text); ?>'<?php } ?>
+               <?php if (!empty($text)) { ?>class='tooltip'<?php } ?>>
+            <?php print $label; ?>
+        </label>
+    </td>
+    <td>
+        <select id="<?php print esc_attr($display_type_name . '_' . $name); ?>"
+                name="<?php print esc_attr($display_type_name . '[' . $name . ']'); ?>"
+                class="<?php print esc_attr($display_type_name . '_' . $name); ?>">
+            <?php foreach ($options as $key => $val) { ?>
+                <option value='<?php print esc_attr($key); ?>' <?php selected($key, $value); ?>><?php print htmlentities(_($val)); ?></option>
+            <?php } ?>
+        </select>
+    </td>
+</tr>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/field_generator/nextgen_settings_field_text.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/field_generator/nextgen_settings_field_text.php
new file mode 100644
index 0000000000000000000000000000000000000000..e73fb46a9ecedd0006216a1b2d7357c9c4a53ab8
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/field_generator/nextgen_settings_field_text.php
@@ -0,0 +1,17 @@
+<tr id='tr_<?php print esc_attr("{$display_type_name}_{$name}"); ?>' class='<?php print !empty($hidden) ? 'hidden' : ''; ?>'>
+    <td>
+        <label for="<?php print esc_attr("{$display_type_name}_{$name}"); ?>"
+               <?php if (!empty($text)) { ?>title='<?php print esc_attr($text); ?>'<?php } ?>
+               <?php if (!empty($text)) { ?>class='tooltip'<?php } ?>>
+            <?php print $label; ?>
+        </label>
+    </td>
+    <td>
+        <input type='text'
+               id='<?php print esc_attr("{$display_type_name}_{$name}"); ?>'
+               name='<?php print esc_attr("{$display_type_name}[{$name}]"); ?>'
+               class='<?php print esc_attr("{$display_type_name}[{$name}]"); ?>'
+               <?php if (!empty($placeholder)) { ?>placeholder='<?php print esc_attr($placeholder); ?>'<?php } ?>
+               value='<?php print esc_attr($value); ?>'/>
+    </td>
+</tr>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/field_generator/nextgen_settings_field_textarea.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/field_generator/nextgen_settings_field_textarea.php
new file mode 100644
index 0000000000000000000000000000000000000000..88cfa9ff366114c200df674409fe47a8ee732e97
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/field_generator/nextgen_settings_field_textarea.php
@@ -0,0 +1,16 @@
+<tr id='tr_<?php print esc_attr("{$display_type_name}_{$name}"); ?>' class='<?php print !empty($hidden) ? 'hidden' : ''; ?>'>
+    <td>
+        <label for="<?php print esc_attr("{$display_type_name}_{$name}"); ?>"
+               <?php if (!empty($text)) { ?>title='<?php print esc_attr($text); ?>'<?php } ?>
+               <?php if (!empty($text)) { ?>class='tooltip'<?php } ?>>
+            <?php print $label; ?>
+        </label>
+    </td>
+    <td>
+        <textarea id='<?php print esc_attr("{$display_type_name}_{$name}"); ?>'
+                  name='<?php print esc_attr("{$display_type_name}[{$name}]"); ?>'
+                  class='<?php print esc_attr("{$display_type_name}[{$name}]"); ?>'
+                  <?php if (!empty($placeholder)) { ?>placeholder='<?php print esc_attr($placeholder); ?>'<?php } ?>
+            ><?php print esc_attr($value); ?></textarea>
+    </td>
+</tr>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/field_generator/nextgen_settings_field_width_and_unit.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/field_generator/nextgen_settings_field_width_and_unit.php
new file mode 100644
index 0000000000000000000000000000000000000000..d712bb54a60d5deb9ac838307e1775aa23c44679
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/field_generator/nextgen_settings_field_width_and_unit.php
@@ -0,0 +1,25 @@
+<tr id='tr_<?php print esc_attr("{$display_type_name}_{$name}"); ?>' class='<?php print !empty($hidden) ? 'hidden' : ''; ?>'>
+    <td>
+        <label for="<?php print esc_attr("{$display_type_name}_{$name}"); ?>"
+               <?php if (!empty($text)) { ?>title='<?php print esc_attr($text); ?>'<?php } ?>
+               <?php if (!empty($text)) { ?>class='tooltip'<?php } ?>>
+            <?php print $label; ?>
+        </label>
+    </td>
+    <td>
+        <input type='number'
+               id='<?php print esc_attr("{$display_type_name}_{$name}"); ?>'
+               name='<?php print esc_attr("{$display_type_name}[{$name}]"); ?>'
+               class='<?php print esc_attr("{$display_type_name}[{$name}]"); ?> nextgen_settings_field_width_and_unit'
+               <?php if (!empty($placeholder)) { ?>placeholder='<?php print esc_attr($placeholder); ?>'<?php } ?>
+               value='<?php print esc_attr($value); ?>'/>
+
+        <select id="<?php print esc_attr("{$display_type_name}_{$unit_name}"); ?>"
+                name="<?php print esc_attr("{$display_type_name}[{$unit_name}]"); ?>"
+                class="<?php print esc_attr("{$display_type_name}_{$unit_name}"); ?> nextgen_settings_field_width_and_unit">
+            <?php foreach ($options as $key => $val) { ?>
+                <option value='<?php print $key; ?>' <?php selected($key, $unit_value); ?>><?php print _($val); ?></option>
+            <?php } ?>
+        </select>
+    </td>
+</tr>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/field_generator/thumbnail_settings.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/field_generator/thumbnail_settings.php
new file mode 100644
index 0000000000000000000000000000000000000000..e73d1d8f180c45b754d136d57be5b204a53af73e
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/field_generator/thumbnail_settings.php
@@ -0,0 +1,22 @@
+<tr id='tr_<?php print esc_attr("{$display_type_name}_{$name}"); ?>' class='<?php print !empty($hidden) ? 'hidden' : ''; ?>'>
+    <td>
+        <label for="<?php print esc_attr("{$display_type_name}_{$name}"); ?>"
+               <?php if (!empty($text)) { ?>title='<?php print esc_attr($text); ?>'<?php } ?>
+               <?php if (!empty($text)) { ?>class='tooltip'<?php } ?>>
+            <?php print $label; ?>
+        </label>
+    </td>
+    <td>
+        <?php
+        $thumbnails_template_width_value = $thumbnail_width;
+        $thumbnails_template_height_value = $thumbnail_height;
+        $thumbnails_template_id = $display_type_name . '_thumbnail_dimensions';
+        $thumbnails_template_width_id = $display_type_name . '_thumbnail_width';
+        $thumbnails_template_height_id = $display_type_name . '_thumbnail_height';
+        $thumbnails_template_name = $display_type_name . '_thumbnail_dimensions';
+        $thumbnails_template_width_name = $display_type_name . '[thumbnail_width]';
+        $thumbnails_template_height_name = $display_type_name . '[thumbnail_height]';
+        include(path_join(NGGALLERY_ABSPATH, implode(DIRECTORY_SEPARATOR, array('admin', 'thumbnails-template.php'))));
+        ?>
+    </td>
+</tr>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/form.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/form.php
new file mode 100644
index 0000000000000000000000000000000000000000..3b5d0164724623dfa0bc68dc2251aa37202bb81b
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/form.php
@@ -0,0 +1,5 @@
+<?php if ($wrap) { ?><table><?php } ?>
+	<?php foreach($fields as $field): ?>
+	    <?php echo $field ?>
+	<?php endforeach ?>
+<?php if ($wrap) { ?></table><?php } ?>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/nextgen_admin_page.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/nextgen_admin_page.php
new file mode 100644
index 0000000000000000000000000000000000000000..b4bbbb69ead8452c2198d9c496095a6b1be4382a
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/nextgen_admin_page.php
@@ -0,0 +1,29 @@
+<div class="wrap" id='ngg_page_content' style='position: relative; visibility: hidden;'>
+	<h2><?php echo_h($page_heading)?></h2>
+	<?php if ($errors): ?>
+	<?php foreach ($errors as $msg): ?>
+	<?php echo $msg ?>
+	<?php endforeach ?>
+	<?php endif ?>
+	<?php if ($success AND empty($errors)): ?>
+	<div class='success updated'>
+		<p><?php echo_h($success);?></p>
+	</div>
+	<?php endif ?>
+	<form method="POST" action="<?php echo esc_url($_SERVER['REQUEST_URI'])?>">
+		<?php if (isset($form_header)): ?>
+		<?php echo $form_header."\n"; ?>
+		<?php endif ?>
+		<input type="hidden" name="action"/>
+		<div class="accordion" id="nextgen_admin_accordion">
+		<?php foreach($tabs as $tab): ?>
+			<?php echo $tab ?>
+		<?php endforeach ?>
+		</div>
+        <?php if ($show_save_button): ?>
+		<p>
+			<input type="submit" name='action_proxy' value="Save" class="button-primary"/>
+		</p>
+        <?php endif ?>
+	</form>
+</div>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/not_authorized.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/not_authorized.php
new file mode 100644
index 0000000000000000000000000000000000000000..0a3ab69167806eaf9673788044a95a1b57686b99
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/not_authorized.php
@@ -0,0 +1,3 @@
+<h1>Not Authorized</h1>
+<p>You are not permitted to access this page. If you believe this is by error, try
+refreshing the page.</p>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/adapter.nextgen_basic_album.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/adapter.nextgen_basic_album.php
new file mode 100644
index 0000000000000000000000000000000000000000..f6073f3a30944750215d25829ab9a44f78fbd3ff
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/adapter.nextgen_basic_album.php
@@ -0,0 +1,39 @@
+<?php
+
+class A_NextGen_Basic_Album extends Mixin
+{
+    /**
+     * Adds a hook to perform validation for albums
+     */
+    function initialize()
+    {
+		$ngglegacy_albums = array(
+			NEXTGEN_GALLERY_NEXTGEN_BASIC_COMPACT_ALBUM,
+			NEXTGEN_GALLERY_NEXTGEN_BASIC_EXTENDED_ALBUM
+		);
+		if (in_array($this->object->name, $ngglegacy_albums)) {
+            $this->object->add_pre_hook(
+              'validation',
+              'NextGEN Basic Album Validation',
+              'Hook_NextGen_Basic_Album_Validation'
+            );
+        }
+    }
+    
+		function get_order()
+		{
+			return NEXTGEN_DISPLAY_PRIORITY_BASE + NEXTGEN_DISPLAY_PRIORITY_STEP;
+		}
+}
+
+/**
+ * Provides validation for NextGen Basic Albums
+ */
+class Hook_NextGen_Basic_Album_Validation extends Hook
+{
+    function validation()
+    {
+      $this->object->validates_presence_of('gallery_display_type');
+      $this->object->validates_numericality_of('galleries_per_page');
+    }
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/adapter.nextgen_basic_album_controller.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/adapter.nextgen_basic_album_controller.php
new file mode 100644
index 0000000000000000000000000000000000000000..205a8867b4aabe748e7e1cd40f15b81e56472aa4
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/adapter.nextgen_basic_album_controller.php
@@ -0,0 +1,299 @@
+<?php
+
+class A_NextGen_Basic_Album_Controller extends Mixin
+{
+
+    function initialize()
+    {
+		$this->albums = array();
+        $this->object->add_mixin('Mixin_NextGen_Basic_Pagination');
+    }
+
+    /**
+     * Renders the front-end for the NextGen Basic Album display type
+     *
+     * @param $displayed_gallery
+     * @param bool $return
+     */
+    function index_action($displayed_gallery, $return = FALSE)
+    {
+        $display_settings = $displayed_gallery->display_settings;
+
+		// We need to fetch the album containers selected in the Attach
+		// to Post interface. We need to do this, because once we fetch the
+		// included entities, we need to iterate over each entity and assign it
+		// a parent_id, which is the album that it belongs to. We need to do this
+		// because the link to the gallery, is not /nggallery/gallery--id, but
+		// /nggallery/album--id/gallery--id
+
+		// Are we to display a gallery?
+        if (($gallery = $this->param('gallery')))
+        {
+            // basic albums only support one per post
+            if (isset($GLOBALS['nggShowGallery']))
+                return;
+            $GLOBALS['nggShowGallery'] = TRUE;
+
+            if (!is_numeric($gallery))
+            {
+                $mapper = $this->object->get_registry()->get_utility('I_Gallery_Mapper');
+                $result = reset($mapper->select()->where(array('slug = %s', $gallery))->limit(1)->run_query());
+                $gallery = $result->{$result->id_field};
+            }
+
+            $renderer = $this->object->get_registry()->get_utility('I_Displayed_Gallery_Renderer');
+            return $renderer->display_images(
+                array(
+                    'source'				=> 'galleries',
+                    'container_ids'			=> array($gallery),
+                    'display_type'			=> $display_settings['gallery_display_type'],
+					'original_display_type'	=> $displayed_gallery->display_type
+                ),
+                $return
+            );
+        }
+
+		// If we're viewing a sub-album, then we use that album as a container instead
+		else if (($album = $this->param('album'))) {
+
+			// Are we to display a sub-album?
+            {
+                $mapper = $this->object->get_registry()->get_utility('I_Album_Mapper');
+                $result = array_pop($mapper->select()->where(array('slug = %s', $album))->limit(1)->run_query());
+                $album_sub = $result ? $result->{$result->id_field} : null;
+                
+                if ($album_sub != null) {
+                	$album = $album_sub;
+                }
+            }
+            $displayed_gallery->entity_ids = array();
+			$displayed_gallery->sortorder = array();
+            $displayed_gallery->container_ids = ($album === '0' OR $album === 'all') ? array() : array($album);
+		}
+
+		// Get the albums
+		$this->albums = $displayed_gallery->get_albums();
+
+        // None of the above: Display the main album. Get the settings required for display
+        $current_page = (int)$this->param('page', 1);
+        $offset = $display_settings['galleries_per_page'] * ($current_page - 1);
+        $entities = $displayed_gallery->get_included_entities($display_settings['galleries_per_page'], $offset);
+
+        // If there are entities to be displayed
+        if ($entities)
+        {
+            if (!empty($display_settings['template']))
+            {
+                // Add additional parameters
+                $pagination_result = $this->object->create_pagination(
+                    $current_page,
+                    $displayed_gallery->get_entity_count(),
+                    $display_settings['galleries_per_page'],
+                    urldecode($this->object->param('ajax_pagination_referrer'))
+                );
+                $this->object->remove_param('ajax_pagination_referrer');
+                $display_settings['current_page'] = $current_page;
+                $display_settings['entities']     = &$entities;
+                $display_settings['pagination_prev'] = $pagination_result['prev'];
+                $display_settings['pagination_next'] = $pagination_result['next'];
+                $display_settings['pagination']      = $pagination_result['output'];
+
+                // Render legacy template
+                $this->object->add_mixin('Mixin_NextGen_Basic_Templates');
+                $display_settings = $this->prepare_legacy_album_params($displayed_gallery->get_entity(), $display_settings);
+                return $this->object->legacy_render($display_settings['template'], $display_settings, $return, 'album');
+            }
+            else {
+                $params = $display_settings;
+                $albums = $this->prepare_legacy_album_params($displayed_gallery->get_entity(), array('entities' => $entities));;
+                $params['galleries'] = $albums['galleries'];
+                $params['displayed_gallery'] = $displayed_gallery;
+                $params = $this->object->prepare_display_parameters($displayed_gallery, $params);
+
+                switch ($displayed_gallery->display_type) {
+                    case NEXTGEN_GALLERY_NEXTGEN_BASIC_COMPACT_ALBUM:
+                        $template = 'compact';
+                        break;
+                    case NEXTGEN_GALLERY_NEXTGEN_BASIC_EXTENDED_ALBUM:
+                        $template = 'extended';
+                        break;
+                }
+
+                return $this->object->render_view("photocrati-nextgen_basic_album#{$template}", $params, $return);
+            }
+        }
+        else {
+            return $this->object->render_partial('photocrati-nextgen_gallery_display#no_images_found', array(), $return);
+        }
+    }
+
+	/**
+	 * Gets the parent album for the entity being displayed
+	 * @param int $entity_id
+	 * @return stdClass (album)
+	 */
+	function get_parent_album_for($entity_id)
+	{
+		$retval = NULL;
+
+		foreach ($this->albums as $album) {
+			if (in_array($entity_id, $album->sortorder)) {
+				$retval = $album;
+				break;
+			}
+		}
+
+		return $retval;
+	}
+
+
+    function prepare_legacy_album_params($displayed_gallery, $params)
+    {
+        $image_mapper = $this->object->get_registry()->get_utility('I_Image_Mapper');
+        $storage      = $this->object->get_registry()->get_utility('I_Gallery_Storage');
+        $image_gen    = $this->object->get_registry()->get_utility('I_Dynamic_Thumbnails_Manager');
+
+        if (empty($displayed_gallery->display_settings['override_thumbnail_settings']))
+        {
+            // legacy templates expect these dimensions
+            $image_gen_params = array(
+                'width'  => 91,
+                'height' => 68,
+                'crop'   => TRUE
+            );
+        }
+        else {
+            // use settings requested by user
+            $image_gen_params = array(
+                'width'     => $displayed_gallery->display_settings['thumbnail_width'],
+                'height'    => $displayed_gallery->display_settings['thumbnail_height'],
+                'quality'   => $displayed_gallery->display_settings['thumbnail_quality'],
+                'crop'      => $displayed_gallery->display_settings['thumbnail_crop'],
+                'watermark' => $displayed_gallery->display_settings['thumbnail_watermark']
+            );
+        }
+
+        // Transform entities
+        $params['galleries'] = $params['entities'];
+        unset($params['entities']);
+
+        foreach ($params['galleries'] as &$gallery) {
+
+            // Get the preview image url
+            $gallery->previewurl = '';
+            if ($gallery->previewpic && $gallery->previewpic > 0)
+            {
+                if (($image = $image_mapper->find(intval($gallery->previewpic))))
+                {
+                    $gallery->previewurl = $storage->get_image_url($image, $image_gen->get_size_name($image_gen_params));
+                    $gallery->previewname = $gallery->name;
+                }
+            }
+
+            // Get the page link. If the entity is an album, then the url will
+			// look like /nggallery/album--slug.
+            $id_field = $gallery->id_field;
+			if ($gallery->is_album)
+            {
+                if ($gallery->pageid > 0)
+                    $gallery->pagelink = get_post_permalink($gallery->pageid);
+                else {
+                    $gallery->pagelink = $this->object->set_param_for(
+                        $this->object->get_routed_url(TRUE),
+                        'album',
+                        $gallery->slug
+                    );
+                }
+			}
+
+			// Otherwise, if it's a gallery then it will look like
+			// /nggallery/album--slug/gallery--slug
+			else {
+                if ($gallery->pageid > 0)
+                    $gallery->pagelink = get_post_permalink($gallery->pageid);
+                else {
+                    $pagelink = $this->object->get_routed_url(TRUE);
+                    $parent_album = $this->object->get_parent_album_for($gallery->$id_field);
+                    if ($parent_album) {
+                        $pagelink = $this->object->set_param_for(
+                            $pagelink,
+                            'album',
+                            $parent_album->slug
+                        );
+                    }
+                    // Legacy compat: use an album slug of 'all' if we're missing a container_id
+                    else if($displayed_gallery->container_ids === array('0')
+                         || $displayed_gallery->container_ids === array('')) {
+                        $pagelink = $this->object->set_param_for($pagelink, 'album', 'all');
+                    }
+                    else {
+                        $pagelink = $this->object->set_param_for($pagelink, 'album', 'album');
+                    }
+                    $gallery->pagelink = $this->object->set_param_for(
+                        $pagelink,
+                        'gallery',
+                        $gallery->slug
+                    );
+                }
+			}
+
+			// The router by default will generate param segments that look like,
+			// /gallery--foobar. We need to convert these to the admittingly
+			// nicer links that ngglegacy uses
+            if ($gallery->pageid <= 0)
+                $gallery->pagelink = $this->object->prettify_pagelink($gallery->pagelink);
+
+            // Let plugins modify the gallery
+            $gallery = apply_filters('ngg_album_galleryobject', $gallery);
+        }
+
+        // Clean up
+        unset($storage);
+        unset($image_mapper);
+        unset($image_gen);
+        unset($image_gen_params);
+
+        return $params;
+    }
+
+
+	function prettify_pagelink($pagelink)
+	{
+		$param_separator = C_NextGen_Settings::get_instance()->get('router_param_separator');
+
+		$regex = implode('', array(
+			'#',
+			'/(gallery|album)',
+			preg_quote($param_separator, '#'),
+			'([^/?]+)',
+			'#'
+		));
+		
+		$pagelink = preg_replace($regex, '/\2', $pagelink);
+		
+		return $pagelink;
+	}
+
+
+    function _get_js_lib_url()
+    {
+        return $this->object->get_static_url('photocrati-nextgen_basic_album#init.js');
+    }
+
+    /**
+     * Enqueues all static resources required by this display type
+     *
+     * @param C_Displayed_Gallery $displayed_gallery
+     */
+    function enqueue_frontend_resources($displayed_gallery)
+    {
+        $this->call_parent('enqueue_frontend_resources', $displayed_gallery);
+
+        wp_enqueue_style('nextgen_basic_album_style', $this->object->get_static_url('photocrati-nextgen_basic_album#nextgen_basic_album.css'));
+        wp_enqueue_script('jquery.dotdotdot', $this->object->get_static_url('photocrati-nextgen_basic_album#jquery.dotdotdot-1.5.7-packed.js'), array('jquery'));
+
+		$this->enqueue_ngg_styles();
+
+    }
+
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/adapter.nextgen_basic_album_forms.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/adapter.nextgen_basic_album_forms.php
new file mode 100644
index 0000000000000000000000000000000000000000..1f43051f20c65489210490dc4b9dbe320bce00d9
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/adapter.nextgen_basic_album_forms.php
@@ -0,0 +1,16 @@
+<?php
+
+class A_NextGen_Basic_Album_Forms extends Mixin
+{
+    function initialize()
+    {
+        $this->add_form(
+            NEXTGEN_DISPLAY_SETTINGS_SLUG,
+            NEXTGEN_GALLERY_NEXTGEN_BASIC_COMPACT_ALBUM
+        );
+        $this->add_form(
+            NEXTGEN_DISPLAY_SETTINGS_SLUG,
+            NEXTGEN_GALLERY_NEXTGEN_BASIC_EXTENDED_ALBUM
+        );
+    }
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/adapter.nextgen_basic_album_mapper.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/adapter.nextgen_basic_album_mapper.php
new file mode 100644
index 0000000000000000000000000000000000000000..f9c13c532a2f04bb6084275ef5fa21e452bc666d
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/adapter.nextgen_basic_album_mapper.php
@@ -0,0 +1,49 @@
+<?php
+
+class A_NextGen_Basic_Album_Mapper extends Mixin
+{
+    /**
+     * Adds a hook for setting default values
+     */
+    function initialize()
+    {
+        $this->object->add_post_hook(
+            'set_defaults',
+            'NextGen Basic Album Defaults',
+            'Hook_NextGen_Basic_Album_Defaults',
+            'set_defaults'
+        );
+    }
+}
+
+
+class Hook_NextGen_Basic_Album_Defaults extends Hook
+{
+    function set_defaults($entity)
+    {
+		if (in_array($entity->name, array(
+		  NEXTGEN_GALLERY_NEXTGEN_BASIC_COMPACT_ALBUM,
+		  NEXTGEN_GALLERY_NEXTGEN_BASIC_EXTENDED_ALBUM))) {
+
+			// Set defaults for both display (album) types
+            $settings = C_NextGen_Settings::get_instance();
+            $this->object->_set_default_value($entity, 'settings', 'galleries_per_page', $settings->galPagedGalleries);
+            $this->object->_set_default_value($entity, 'settings', 'disable_pagination',  0);
+            $this->object->_set_default_value($entity, 'settings', 'template', '');
+
+            // Thumbnail dimensions -- only used by extended albums
+            if ($entity->name == NEXTGEN_GALLERY_NEXTGEN_BASIC_EXTENDED_ALBUM)
+            {
+                $this->_set_default_value($entity, 'settings', 'override_thumbnail_settings', 0);
+                $this->_set_default_value($entity, 'settings', 'thumbnail_width',   $settings->thumbwidth);
+                $this->_set_default_value($entity, 'settings', 'thumbnail_height',  $settings->thumbheight);
+                $this->_set_default_value($entity, 'settings', 'thumbnail_quality', $settings->thumbquality);
+                $this->_set_default_value($entity, 'settings', 'thumbnail_crop',    $settings->thumbfix);
+                $this->_set_default_value($entity, 'settings', 'thumbnail_watermark', 0);
+            }
+
+            if (defined('NEXTGEN_GALLERY_BASIC_THUMBNAILS'))
+                $this->object->_set_default_value($entity, 'settings', 'gallery_display_type', NEXTGEN_GALLERY_BASIC_THUMBNAILS);
+        }
+    }
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/adapter.nextgen_basic_album_routes.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/adapter.nextgen_basic_album_routes.php
new file mode 100644
index 0000000000000000000000000000000000000000..30b1282339fd8fe9cf6ff7a70e688b0d0a1b1bd5
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/adapter.nextgen_basic_album_routes.php
@@ -0,0 +1,44 @@
+<?php
+
+class A_NextGen_Basic_Album_Routes extends Mixin
+{
+	function initialize()
+	{
+		$this->object->add_pre_hook(
+			'render',
+			'Add late url rewriting for albums',
+			__CLASS__,
+			'_nextgen_basic_album_rewrite_rules'
+		);
+	}
+
+	function _nextgen_basic_album_rewrite_rules($displayed_gallery)
+	{
+		// Get display types
+		$original_display_type = isset($displayed_gallery->display_settings['original_display_type']) ?
+			$displayed_gallery->display_settings['original_display_type'] : '';
+		$display_type = $displayed_gallery->display_type;
+
+		// Get router
+        $router = $this->get_registry()->get_utility('I_Router');
+        $app 	= $router->get_routed_app();
+		$slug	= C_NextGen_Settings::get_instance()->router_param_slug;
+
+		// If we're viewing an album, rewrite the urls
+		$regex = "/photocrati-nextgen_basic_\w+_album/";
+		if (preg_match($regex, $display_type)) {
+			$app->rewrite("{$slug}/pid--{*}",		      "{$slug}/pid--{1}", FALSE, TRUE); // avoid conflicts with imagebrowser
+			$app->rewrite("{$slug}/{\\w}",                "{$slug}/album--{1}");
+			$app->rewrite("{$slug}/{\\w}/{\\w}",          "{$slug}/album--{1}/gallery--{2}");
+			$app->rewrite("{$slug}/{\\w}/{\\w}/{\\w}{*}", "{$slug}/album--{1}/gallery--{2}/{3}{4}");
+		}
+		elseif (preg_match($regex, $original_display_type)) {
+			$app->rewrite("{$slug}/album--{\\w}",                    "{$slug}/{1}");
+			$app->rewrite("{$slug}/album--{\\w}/gallery--{\\w}",     "{$slug}/{1}/{2}");
+			$app->rewrite("{$slug}/album--{\\w}/gallery--{\\w}/{*}", "{$slug}/{1}/{2}/{3}");
+		}
+
+		// Perform rewrites
+		$app->do_rewrites();
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/adapter.nextgen_basic_album_urls.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/adapter.nextgen_basic_album_urls.php
new file mode 100644
index 0000000000000000000000000000000000000000..bc8f3db4799700a3765cb7ac1f69af9c195b3eb3
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/adapter.nextgen_basic_album_urls.php
@@ -0,0 +1,13 @@
+<?php
+
+class A_NextGen_Basic_Album_Urls extends Mixin
+{
+    function create_parameter_segment($key, $value, $id=NULL, $use_prefix=FALSE)
+    {
+        if ($key == 'page') {
+            return 'page/'.$value;
+        }
+        else
+            return $this->call_parent('create_parameter_segment', $key, $value, $id, $use_prefix);
+    }
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/adapter.nextgen_basic_compact_album_form.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/adapter.nextgen_basic_compact_album_form.php
new file mode 100644
index 0000000000000000000000000000000000000000..6838b9ecb1295e3062c413ef90836fa86dc9782d
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/adapter.nextgen_basic_compact_album_form.php
@@ -0,0 +1,31 @@
+<?php
+
+class A_NextGen_Basic_Compact_Album_Form extends Mixin_NextGen_Basic_Album_Form
+{
+	function get_display_type_name()
+	{
+		return NEXTGEN_GALLERY_NEXTGEN_BASIC_COMPACT_ALBUM;
+	}
+
+    /**
+     * Returns a list of fields to render on the settings page
+     */
+    function _get_field_names()
+    {
+        $fields = parent::_get_field_names();
+        $fields[] = 'thumbnail_override_settings';
+        return $fields;
+    }
+
+    /**
+     * Enqueues static resources required by this form
+     */
+    function enqueue_static_resources()
+    {
+        wp_enqueue_script(
+            'nextgen_basic_compact_albums_settings_script',
+            $this->object->get_static_url('photocrati-nextgen_basic_album#compact_settings.js'),
+            array('jquery.nextgen_radio_toggle')
+        );
+    }
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/adapter.nextgen_basic_extended_album_form.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/adapter.nextgen_basic_extended_album_form.php
new file mode 100644
index 0000000000000000000000000000000000000000..ff7387c06cf83155171150230bc692405f783915
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/adapter.nextgen_basic_extended_album_form.php
@@ -0,0 +1,31 @@
+<?php
+
+class A_NextGen_Basic_Extended_Album_Form extends Mixin_NextGen_Basic_Album_Form
+{
+	function get_display_type_name()
+	{
+		return NEXTGEN_GALLERY_NEXTGEN_BASIC_EXTENDED_ALBUM;
+	}
+
+    /**
+     * Returns a list of fields to render on the settings page
+     */
+    function _get_field_names()
+    {
+        $fields = parent::_get_field_names();
+        $fields[] = 'thumbnail_override_settings';
+        return $fields;
+    }
+
+    /**
+     * Enqueues static resources required by this form
+     */
+    function enqueue_static_resources()
+    {
+        wp_enqueue_script(
+            'nextgen_basic_extended_albums_settings_script',
+            $this->object->get_static_url('photocrati-nextgen_basic_album#extended_settings.js'),
+            array('jquery.nextgen_radio_toggle')
+        );
+    }
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/class.nextgen_basic_album_installer.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/class.nextgen_basic_album_installer.php
new file mode 100644
index 0000000000000000000000000000000000000000..fc7a282c4df1e1c389ad5e66fede26eae60dc0da
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/class.nextgen_basic_album_installer.php
@@ -0,0 +1,25 @@
+<?php
+
+class C_NextGen_Basic_Album_Installer extends C_Gallery_Display_Installer
+{
+	function install()
+	{
+		$this->install_display_type(
+			NEXTGEN_GALLERY_NEXTGEN_BASIC_COMPACT_ALBUM, array(
+			'title'					=>	'NextGEN Basic Compact Album',
+			'entity_types'			=>	array('album', 'gallery'),
+			'preview_image_relpath'	=>	'photocrati-nextgen_basic_album#compact_preview.jpg',
+			'default_source'		=>	'albums',
+			'view_order' => NEXTGEN_DISPLAY_PRIORITY_BASE + 200
+		));
+
+		$this->install_display_type(
+			NEXTGEN_GALLERY_NEXTGEN_BASIC_EXTENDED_ALBUM, array(
+			'title'					=>	'NextGEN Basic Extended Album',
+			'entity_types'			=>	array('album', 'gallery'),
+			'preview_image_relpath'	=>	'photocrati-nextgen_basic_album#extended_preview.jpg',
+			'default_source'		=>	'albums',
+			'view_order' => NEXTGEN_DISPLAY_PRIORITY_BASE + 210
+		));
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/mixin.nextgen_basic_album_form.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/mixin.nextgen_basic_album_form.php
new file mode 100644
index 0000000000000000000000000000000000000000..39fe3b7b81351e9450f5b093283b0d42e4ede46f
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/mixin.nextgen_basic_album_form.php
@@ -0,0 +1,54 @@
+<?php
+
+class Mixin_NextGen_Basic_Album_Form extends Mixin_Display_Type_Form
+{
+	function _get_field_names()
+	{
+		return array(
+            'nextgen_basic_album_gallery_display_type',
+            'nextgen_basic_templates_template',
+        );
+	}
+
+    /**
+     * Renders the Gallery Display Type field
+     * @param C_Display_Type $display_type
+     */
+    function _render_nextgen_basic_album_gallery_display_type_field($display_type)
+    {
+        $mapper = $this->object->get_registry()->get_utility('I_Display_Type_Mapper');
+
+        return $this->render_partial(
+            'photocrati-nextgen_basic_album#nextgen_basic_album_gallery_display_type',
+            array(
+                'display_type_name'             =>  $display_type->name,
+                'gallery_display_type_label'    =>  _('Display galleries as'),
+                'gallery_display_type_help'     =>  _('How would you like galleries to be displayed?'),
+                'gallery_display_type'          =>  $display_type->settings['gallery_display_type'],
+                'galleries_per_page_label'      =>  _('Galleries per page'),
+                'galleries_per_page'            =>  $display_type->settings['galleries_per_page'],
+                'display_types'                 =>  $mapper->find_by_entity_type('image')
+            ),
+            TRUE
+        );
+    }
+
+
+    /**
+     * Renders the Galleries Per Page field
+     * @param C_Display_Type $display_type
+     */
+    function _render_nextgen_basic_album_galleries_per_page_field($display_type)
+    {
+        return $this->render_partial(
+            'photocrati-nextgen_basic_album#nextgen_basic_album_galleries_per_page',
+            array(
+                'display_type_name'             =>  $display_type->name,
+                'galleries_per_page_label'      =>  _('Items per page'),
+                'galleries_per_page_help'       =>  _('Maximum number of galleries or sub-albums to appear on a single page'),
+                'galleries_per_page'            =>  $display_type->settings['galleries_per_page']
+            ),
+            TRUE
+        );
+    }
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/module.nextgen_basic_album.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/module.nextgen_basic_album.php
new file mode 100644
index 0000000000000000000000000000000000000000..fb7786b883f530dad92805cc3c4d207450afc4d1
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/module.nextgen_basic_album.php
@@ -0,0 +1,142 @@
+<?php
+
+/*
+{
+    Module:		photocrati-nextgen_basic_album,
+    Depends:  	{ photocrati-nextgen_gallery_display, photocrati-nextgen_basic_templates, photocrati-nextgen_pagination }
+}
+ */
+
+define('NEXTGEN_GALLERY_NEXTGEN_BASIC_COMPACT_ALBUM', 'photocrati-nextgen_basic_compact_album');
+define('NEXTGEN_GALLERY_NEXTGEN_BASIC_EXTENDED_ALBUM', 'photocrati-nextgen_basic_extended_album');
+
+class M_NextGen_Basic_Album extends C_Base_Module
+{
+	function define()
+    {
+        parent::define(
+            'photocrati-nextgen_basic_album',
+            'NextGEN Basic Album',
+            "Provides support for NextGEN's Basic Album",
+            '0.4',
+            'http://nextgen-gallery.com',
+            'Photocrati Media',
+            'http://www.photocrati.com'
+        );
+
+		include_once('class.nextgen_basic_album_installer.php');
+		C_Photocrati_Installer::add_handler($this->module_id, 'C_NextGen_Basic_Album_Installer');
+    }
+
+
+    function _register_adapters()
+    {
+		// Add validation for album display settings
+        $this->get_registry()->add_adapter(
+			'I_Display_Type',
+			'A_NextGen_Basic_Album'
+		);
+
+		// Add a controller for displaying albums on the front-end
+        $this->get_registry()->add_adapter(
+			'I_Display_Type_Controller',
+			'A_NextGen_Basic_Album_Controller',
+			array(
+				NEXTGEN_GALLERY_NEXTGEN_BASIC_COMPACT_ALBUM,
+				NEXTGEN_GALLERY_NEXTGEN_BASIC_EXTENDED_ALBUM,
+				$this->module_id
+			)
+		);
+
+		// Add a mapper for setting the defaults for the album
+        $this->get_registry()->add_adapter(
+			'I_Display_Type_Mapper',
+			'A_NextGen_Basic_Album_Mapper'
+		);
+
+		// Add a generic adapter for display types to do late url rewriting
+		$this->get_registry()->add_adapter(
+			'I_Displayed_Gallery_Renderer',
+			'A_NextGen_Basic_Album_Routes'
+		);
+
+		// Add a display settings form for each display type
+		$this->get_registry()->add_adapter(
+			'I_Form',
+			'A_NextGen_Basic_Compact_Album_Form',
+			NEXTGEN_GALLERY_NEXTGEN_BASIC_COMPACT_ALBUM
+		);
+		$this->get_registry()->add_adapter(
+			'I_Form',
+			'A_NextGen_Basic_Extended_Album_Form',
+			NEXTGEN_GALLERY_NEXTGEN_BASIC_EXTENDED_ALBUM
+		);
+
+        // Creates special parameter segments
+        $this->get_registry()->add_adapter(
+            'I_Routing_App',
+            'A_NextGen_Basic_Album_Urls'
+        );
+
+        $this->get_registry()->add_adapter(
+            'I_Form_Manager',
+            'A_NextGen_Basic_Album_Forms'
+        );
+    }
+
+	function _register_hooks()
+	{
+		C_NextGen_Shortcode_Manager::add('album',    array(&$this, 'ngglegacy_shortcode'));
+		C_NextGen_Shortcode_Manager::add('nggalbum', array(&$this, 'ngglegacy_shortcode'));
+	}
+
+    /**
+     * Gets a value from the parameter array, and if not available, uses the default value
+     *
+     * @param string $name
+     * @param mixed $default
+     * @param array $params
+     * @return mixed
+     */
+    function _get_param($name, $default, $params)
+    {
+        return (isset($params[$name])) ? $params[$name] : $default;
+    }
+
+	/**
+     * Renders the shortcode for rendering an album
+     * @param array $params
+     * @param null $inner_content
+     * @return string
+     */
+	function ngglegacy_shortcode($params, $inner_content=NULL)
+    {
+        $params['source']           = $this->_get_param('source', 'albums', $params);
+        $params['container_ids']    = $this->_get_param('id', NULL, $params);
+        $params['display_type']     = $this->_get_param('display_type', NEXTGEN_GALLERY_NEXTGEN_BASIC_COMPACT_ALBUM, $params);
+
+        unset($params['id']);
+
+        $renderer = $this->get_registry()->get_utility('I_Displayed_Gallery_Renderer');
+        return $renderer->display_images($params, $inner_content);
+    }
+
+    function get_type_list()
+    {
+        return array(
+            'A_Nextgen_Basic_Album' => 'adapter.nextgen_basic_album.php',
+            'A_Nextgen_Basic_Album_Controller' => 'adapter.nextgen_basic_album_controller.php',
+            'A_Nextgen_Basic_Album_Forms' => 'adapter.nextgen_basic_album_forms.php',
+            'C_Nextgen_Basic_Album_Installer' => 'class.nextgen_basic_album_installer.php',
+            'A_Nextgen_Basic_Album_Mapper' => 'adapter.nextgen_basic_album_mapper.php',
+            'A_Nextgen_Basic_Album_Routes' => 'adapter.nextgen_basic_album_routes.php',
+            'A_Nextgen_Basic_Album_Urls' => 'adapter.nextgen_basic_album_urls.php',
+            'A_Nextgen_Basic_Compact_Album_Form' => 'adapter.nextgen_basic_compact_album_form.php',
+            'A_Nextgen_Basic_Extended_Album_Form' => 'adapter.nextgen_basic_extended_album_form.php',
+            'Mixin_Nextgen_Basic_Album_Form' => 'mixin.nextgen_basic_album_form.php'
+        );
+    }
+}
+
+
+new M_NextGen_Basic_Album();
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/albumset.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/albumset.gif
new file mode 100644
index 0000000000000000000000000000000000000000..8dc3d4ed8f486f8fe0082bc38145a638eb528e68
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/albumset.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/compact_preview.jpg b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/compact_preview.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..9f609f2a919d211bb2642925c7ce50c6073ede48
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/compact_preview.jpg differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/compact_settings.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/compact_settings.js
new file mode 100644
index 0000000000000000000000000000000000000000..897a5027a052018b47964f62579145fa00c025bc
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/compact_settings.js
@@ -0,0 +1,7 @@
+jQuery(function($){
+    $('input[name="photocrati-nextgen_basic_compact_album[override_thumbnail_settings]"]')
+        .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_compact_album_thumbnail_dimensions'))
+        .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_compact_album_thumbnail_quality'))
+        .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_compact_album_thumbnail_crop'))
+        .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_compact_album_thumbnail_watermark'));
+});
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/extended_preview.jpg b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/extended_preview.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..bbedf94ff02b9918721e6fd736fc770c91f5c5f3
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/extended_preview.jpg differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/extended_settings.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/extended_settings.js
new file mode 100644
index 0000000000000000000000000000000000000000..d169fdd9bc8966534e71148bfd75a432bd8a2822
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/extended_settings.js
@@ -0,0 +1,7 @@
+jQuery(function($){
+    $('input[name="photocrati-nextgen_basic_extended_album[override_thumbnail_settings]"]')
+        .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_extended_album_thumbnail_dimensions'))
+        .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_extended_album_thumbnail_quality'))
+        .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_extended_album_thumbnail_crop'))
+        .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_extended_album_thumbnail_watermark'));
+});
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/init.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/init.js
new file mode 100644
index 0000000000000000000000000000000000000000..d1eb1714bfce0277afc06c78ef11a1c1abe96826
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/init.js
@@ -0,0 +1,6 @@
+jQuery(function($){
+    $('.ngg-album-desc').dotdotdot();
+    $('.ngg-albumoverview').each(function(){
+        $(this).css('opacity', 1.0);
+    });
+});
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/jquery.dotdotdot-1.5.7-packed.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/jquery.dotdotdot-1.5.7-packed.js
new file mode 100644
index 0000000000000000000000000000000000000000..67ef39d494645af967e6690e55866bba3cc8d63a
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/jquery.dotdotdot-1.5.7-packed.js
@@ -0,0 +1,15 @@
+/*	
+ *	jQuery dotdotdot 1.5.7
+ *	
+ *	Copyright (c) 2013 Fred Heusschen
+ *	www.frebsite.nl
+ *
+ *	Plugin website:
+ *	dotdotdot.frebsite.nl
+ *
+ *	Dual licensed under the MIT and GPL licenses.
+ *	http://en.wikipedia.org/wiki/MIT_License
+ *	http://en.wikipedia.org/wiki/GNU_General_Public_License
+ */
+
+(function(a){function c(a,b,c){var d=a.children(),e=!1;a.empty();for(var g=0,h=d.length;h>g;g++){var i=d.eq(g);if(a.append(i),c&&a.append(c),f(a,b)){i.remove(),e=!0;break}c&&c.remove()}return e}function d(b,c,g,h,i){var j=b.contents(),k=!1;b.empty();for(var l="table, thead, tbody, tfoot, tr, col, colgroup, object, embed, param, ol, ul, dl, select, optgroup, option, textarea, script, style",m=0,n=j.length;n>m&&!k;m++){var o=j[m],p=a(o);void 0!==o&&(b.append(p),i&&b[b.is(l)?"after":"append"](i),3==o.nodeType?f(g,h)&&(k=e(p,c,g,h,i)):k=d(p,c,g,h,i),k||i&&i.remove())}return k}function e(a,b,c,d,h){var k=!1,l=a[0];if(l===void 0)return!1;for(var m="letter"==d.wrap?"":" ",n=j(l).split(m),o=-1,p=-1,q=0,r=n.length-1;r>=q;){var s=Math.floor((q+r)/2);if(s==p)break;p=s,i(l,n.slice(0,p+1).join(m)+d.ellipsis),f(c,d)?r=p:(o=p,q=p)}if(-1==o||1==n.length&&0==n[0].length){var u=a.parent();a.remove();var v=h?h.length:0;if(u.contents().size()>v){var w=u.contents().eq(-1-v);k=e(w,b,c,d,h)}else{var l=u.prev().contents().eq(-1)[0];if(l!==void 0){var t=g(j(l),d);i(l,t),u.remove(),k=!0}}}else{var t=g(n.slice(0,o+1).join(m),d);k=!0,i(l,t)}return k}function f(a,b){return a.innerHeight()>b.maxHeight}function g(b,c){for(;a.inArray(b.slice(-1),c.lastCharacter.remove)>-1;)b=b.slice(0,-1);return 0>a.inArray(b.slice(-1),c.lastCharacter.noEllipsis)&&(b+=c.ellipsis),b}function h(a){return{width:a.innerWidth(),height:a.innerHeight()}}function i(a,b){a.innerText?a.innerText=b:a.nodeValue?a.nodeValue=b:a.textContent&&(a.textContent=b)}function j(a){return a.innerText?a.innerText:a.nodeValue?a.nodeValue:a.textContent?a.textContent:""}function k(b,c){return b===void 0?!1:b?"string"==typeof b?(b=a(b,c),b.length?b:!1):"object"==typeof b?b.jquery===void 0?!1:b:!1:!1}function l(a){for(var b=a.innerHeight(),c=["paddingTop","paddingBottom"],d=0,e=c.length;e>d;d++){var f=parseInt(a.css(c[d]),10);isNaN(f)&&(f=0),b-=f}return b}function m(a,b){return a?(b="string"==typeof b?"dotdotdot: "+b:["dotdotdot:",b],window.console!==void 0&&window.console.log!==void 0&&window.console.log(b),!1):!1}if(!a.fn.dotdotdot){a.fn.dotdotdot=function(e){if(0==this.length)return e&&e.debug===!1||m(!0,'No element found for "'+this.selector+'".'),this;if(this.length>1)return this.each(function(){a(this).dotdotdot(e)});var g=this;g.data("dotdotdot")&&g.trigger("destroy.dot"),g.bind_events=function(){return g.bind("update.dot",function(b,e){b.preventDefault(),b.stopPropagation(),j.maxHeight="number"==typeof j.height?j.height:l(g),j.maxHeight+=j.tolerance,e!==void 0&&(("string"==typeof e||e instanceof HTMLElement)&&(e=a("<div />").append(e).contents()),e instanceof a&&(i=e)),q=g.wrapInner('<div class="dotdotdot" />').children(),q.empty().append(i.clone(!0)).css({height:"auto",width:"auto",border:"none",padding:0,margin:0});var h=!1,k=!1;return n.afterElement&&(h=n.afterElement.clone(!0),n.afterElement.remove()),f(q,j)&&(k="children"==j.wrap?c(q,j,h):d(q,g,q,j,h)),q.replaceWith(q.contents()),q=null,a.isFunction(j.callback)&&j.callback.call(g[0],k,i),n.isTruncated=k,k}).bind("isTruncated.dot",function(a,b){return a.preventDefault(),a.stopPropagation(),"function"==typeof b&&b.call(g[0],n.isTruncated),n.isTruncated}).bind("originalContent.dot",function(a,b){return a.preventDefault(),a.stopPropagation(),"function"==typeof b&&b.call(g[0],i),i}).bind("destroy.dot",function(a){a.preventDefault(),a.stopPropagation(),g.unwatch().unbind_events().empty().append(i).data("dotdotdot",!1)}),g},g.unbind_events=function(){return g.unbind(".dot"),g},g.watch=function(){if(g.unwatch(),"window"==j.watch){var b=a(window),c=b.width(),d=b.height();b.bind("resize.dot"+n.dotId,function(){c==b.width()&&d==b.height()&&j.windowResizeFix||(c=b.width(),d=b.height(),p&&clearInterval(p),p=setTimeout(function(){g.trigger("update.dot")},10))})}else o=h(g),p=setInterval(function(){var a=h(g);(o.width!=a.width||o.height!=a.height)&&(g.trigger("update.dot"),o=h(g))},100);return g},g.unwatch=function(){return a(window).unbind("resize.dot"+n.dotId),p&&clearInterval(p),g};var i=g.contents(),j=a.extend(!0,{},a.fn.dotdotdot.defaults,e),n={},o={},p=null,q=null;return n.afterElement=k(j.after,g),n.isTruncated=!1,n.dotId=b++,g.data("dotdotdot",!0).bind_events().trigger("update.dot"),j.watch&&g.watch(),g},a.fn.dotdotdot.defaults={ellipsis:"... ",wrap:"word",lastCharacter:{remove:[" ",",",";",".","!","?"],noEllipsis:[]},tolerance:0,callback:null,after:null,height:null,watch:!1,windowResizeFix:!0,debug:!1};var b=1,n=a.fn.html;a.fn.html=function(a){return a!==void 0?this.data("dotdotdot")&&"function"!=typeof a?this.trigger("update",[a]):n.call(this,a):n.call(this)};var o=a.fn.text;a.fn.text=function(b){if(b!==void 0){if(this.data("dotdotdot")){var c=a("<div />");return c.text(b),b=c.html(),c.remove(),this.trigger("update",[b])}return o.call(this,b)}return o.call(this)}}})(jQuery);
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/nextgen_basic_album.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/nextgen_basic_album.css
new file mode 100644
index 0000000000000000000000000000000000000000..997087a2e2325e434a5cfb4db17d2995fb22a72e
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/nextgen_basic_album.css
@@ -0,0 +1,98 @@
+/* ----------- Album Styles Extend -------------*/
+
+.ngg-albumoverview {
+    margin-top: 10px;
+    width: 100%;
+    clear: both;
+    display: block !important;
+}
+
+.ngg-album {
+    height: 100%;
+    overflow: hidden;
+    padding: 5px;
+    margin-bottom: 5px;
+    border: 1px solid #cccccc;
+}
+
+.ngg-albumtitle {
+    text-align: left;
+    font-weight: bold;
+    margin: 0px;
+    padding: 0px;
+    font-size: 1.4em;
+    margin-bottom: 10px;
+}
+
+.ngg-thumbnail {
+    float: left;
+    margin-right: 12px;
+}
+
+.ngg-thumbnail img {
+    background-color: #FFFFFF;
+    border: 1px solid #A9A9A9;
+    margin: 4px 0px 4px 5px;
+    padding: 4px;
+    position: relative;
+}
+
+.ngg-thumbnail img:hover {
+    background-color: #A9A9A9;
+}
+
+.ngg-description {
+    text-align: left;
+}
+
+/* ----------- Album Styles Compact -------------*/
+
+.ngg-album-compact {
+    float: left;
+    height: 180px;
+    padding: 0 6px 4px 0 !important;
+    margin: 0px !important;
+    text-align: left;
+    width: 120px;
+}
+
+.ngg-album-compactbox {
+    background: transparent url(albumset.gif) no-repeat scroll 0%;
+    height: 88px;
+    margin: 0pt 0pt 6px !important;
+    padding: 8px 0pt 0pt 8px !important;
+    width: 120px;
+    box-sizing: border-box;
+    -moz-box-sizing: border-box;
+}
+
+.ngg-album-compactbox .Thumb {
+    margin: 0px !important;
+    padding: 0px 0 0 0 !important;
+    width: 91px;
+    height: 68px;
+    border: none;
+}
+
+.ngg-album-compact h4 {
+    font-size: 15px;
+    font-weight: bold;
+    width: 110px;
+    margin: 0;
+}
+
+.ngg-album-compact h4 .ngg-album-desc {
+    overflow: hidden;
+    display: block;
+    height: 54px;
+}
+
+.ngg-album-compact p {
+    font-size: 11px;
+    margin: 0;
+}
+
+.ngg-clear {
+    clear: both;
+    float: none;
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/templates/compact.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/templates/compact.php
new file mode 100644
index 0000000000000000000000000000000000000000..f6f11df66c65b9889460f73a8ebe39cef9ac0230
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/templates/compact.php
@@ -0,0 +1,27 @@
+<?php $this->start_element('nextgen_gallery.gallery_container', 'container', $displayed_gallery); ?>
+<div class="ngg-albumoverview">
+    <?php foreach ($galleries as $gallery) { ?>
+        <div class="ngg-album-compact">
+            <div class="ngg-album-compactbox">
+                <div class="ngg-album-link">
+                    <a class="Link" href="<?php echo $gallery->pagelink; ?>">
+                        <img class="Thumb"
+                             alt="<?php echo $gallery->title; ?>"
+                             src="<?php echo $gallery->previewurl; ?>"/>
+                    </a>
+                </div>
+            </div>
+            <h4>
+                <a class="ngg-album-desc"
+                   title="<?php echo $gallery->title; ?>"
+                   href="<?php echo $gallery->pagelink; ?>"
+                    ><?php echo $gallery->title; ?></a>
+            </h4>
+            <?php if (isset($gallery->counter) && $gallery->counter > 0) { ?>
+                <p><strong><?php echo $gallery->counter; ?></strong>&nbsp;<?php _e('Photos', 'nggallery'); ?></p>
+            <?php } ?>
+        </div>
+    <?php } ?>
+    <br class="ngg-clear"/>
+</div>
+<?php $this->end_element(); ?>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/templates/extended.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/templates/extended.php
new file mode 100644
index 0000000000000000000000000000000000000000..bc5b322cd59232842defa78306214b8b6e9f2d2b
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/templates/extended.php
@@ -0,0 +1,22 @@
+<?php $this->start_element('nextgen_gallery.gallery_container', 'container', $displayed_gallery); ?>
+<div class="ngg-albumoverview">
+    <?php foreach ($galleries as $gallery) { ?>
+        <div class="ngg-album">
+            <div class="ngg-albumtitle">
+                <a href="<?php echo $gallery->pagelink; ?>"><?php echo $gallery->title; ?></a>
+            </div>
+            <div class="ngg-albumcontent">
+                <div class="ngg-thumbnail">
+                    <a href="<?php echo $gallery->pagelink; ?>"><img class="Thumb" alt="<?php echo $gallery->title; ?>" src="<?php echo $gallery->previewurl; ?>"/></a>
+                </div>
+                <div class="ngg-description">
+                    <p><?php echo $gallery->galdesc; ?></p>
+                    <?php if (isset($gallery->counter) && $gallery->counter > 0) { ?>
+                        <p><strong><?php echo $gallery->counter; ?></strong>&nbsp;<?php _e('Photos', 'nggallery'); ?></p>
+                    <?php } ?>
+                </div>
+            </div>
+        </div>
+    <?php } ?>
+</div>
+<?php $this->end_element(); ?>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/templates/nextgen_basic_album_galleries_per_page.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/templates/nextgen_basic_album_galleries_per_page.php
new file mode 100644
index 0000000000000000000000000000000000000000..e4c81ce1fb6e2e75dafd350b0407bb9b6cff232e
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/templates/nextgen_basic_album_galleries_per_page.php
@@ -0,0 +1,19 @@
+<tr>
+    <td>
+        <label class="tooltip"
+               for="<?php echo esc_attr($display_type_name)?>_galleries_per_page"
+               title="<?php echo_h($galleries_per_page_help)?>">
+            <?php echo_h($galleries_per_page_label) ?>
+        </label>
+    </td>
+    <td>
+        <input
+            id="<?php echo esc_attr($display_type_name)?>_galleries_per_page"
+            name="<?php echo esc_attr($display_type_name) ?>[galleries_per_page]"
+            type="number"
+            min="0"
+            value="<?php echo esc_attr($galleries_per_page)?>"
+            placeholder="#"
+        />
+    </td>
+</tr>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/templates/nextgen_basic_album_gallery_display_type.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/templates/nextgen_basic_album_gallery_display_type.php
new file mode 100644
index 0000000000000000000000000000000000000000..26a3cb23ec43c3f611ded498b34729e0d95913ba
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/templates/nextgen_basic_album_gallery_display_type.php
@@ -0,0 +1,23 @@
+<tr>
+    <td>
+        <label for="<?php echo esc_attr($display_type_name) ?>_gallery_display_type"
+               class="tooltip"
+               title="<?php echo_h($gallery_display_type_help)?>">
+            <?php echo_h($gallery_display_type_label)?>
+        </label>
+    </td>
+    <td>
+        <select
+            style="width: 400px"
+            id="<?php echo esc_attr($display_type_name) ?>_gallery_display_type"
+            name="<?php echo esc_attr($display_type_name)?>[gallery_display_type]">
+            <?php foreach ($display_types as $display_type): ?>
+            <option
+                value="<?php echo esc_attr($display_type->name) ?>"
+                <?php selected($display_type->name, $gallery_display_type) ?>>
+                <?php echo_h($display_type->title)?>
+            </option>
+            <?php endforeach ?>
+        </select>
+    </td>
+</tr>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.ajax_pagination_actions.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.ajax_pagination_actions.php
new file mode 100644
index 0000000000000000000000000000000000000000..64120d72de1c277ed21db41dca6e25a943377385
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.ajax_pagination_actions.php
@@ -0,0 +1,29 @@
+<?php
+
+class A_Ajax_Pagination_Actions extends Mixin
+{
+    function get_displayed_gallery_page_action()
+    {
+        $retval = array();
+        $mapper = $this->object->get_registry()->get_utility('I_Displayed_Gallery_Mapper');
+
+        if (($id = $this->object->param('displayed_gallery_id')))
+        {
+            // retrieve by transient id
+            $factory           = $this->object->get_registry()->get_utility('I_Component_Factory');
+            $displayed_gallery = $factory->create('displayed_gallery', $mapper);
+            $displayed_gallery->apply_transient($id);
+            $displayed_gallery->transient_id = $id;
+
+            // Prevent future "show slideshow" links from using the AJAX request URI
+            if ($displayed_gallery->display_settings['ajax_pagination'])
+                $displayed_gallery->display_settings['slideshow_link_origin'] = $_SERVER['HTTP_REFERER'];
+
+            // render the displayed gallery
+            $this->renderer                 = $this->get_registry()->get_utility('I_Displayed_Gallery_Renderer');
+            $retval['html']                 = $this->renderer->render($displayed_gallery, TRUE);
+            $retval['displayed_gallery_id'] = $displayed_gallery->id();
+        }
+        return $retval;
+    }
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_gallery_forms.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_gallery_forms.php
new file mode 100644
index 0000000000000000000000000000000000000000..d38dd748ce654f28080d9150489e982be8d5c341
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_gallery_forms.php
@@ -0,0 +1,10 @@
+<?php
+
+class A_NextGen_Basic_Gallery_Forms extends Mixin
+{
+    function initialize()
+    {
+        $this->add_form(NEXTGEN_DISPLAY_SETTINGS_SLUG, NEXTGEN_GALLERY_BASIC_THUMBNAILS);
+        $this->add_form(NEXTGEN_DISPLAY_SETTINGS_SLUG, NEXTGEN_GALLERY_BASIC_SLIDESHOW);
+    }
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_gallery_mapper.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_gallery_mapper.php
new file mode 100644
index 0000000000000000000000000000000000000000..27d461053a39f623a5cdac3f02878a8313fedb7c
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_gallery_mapper.php
@@ -0,0 +1,102 @@
+<?php
+
+class A_NextGen_Basic_Gallery_Mapper extends Mixin
+{
+	function initialize()
+	{
+		$this->object->add_post_hook(
+			'set_defaults',
+            'NextGen Basic Gallery Defaults',
+			'Hook_NextGen_Basic_Gallery_Defaults'
+		);
+	}
+}
+
+/**
+ * Sets default values for the NextGen Basic Slideshow display type
+ */
+class Hook_NextGen_Basic_Gallery_Defaults extends Hook
+{
+	function set_defaults($entity)
+	{
+		if ($entity->name == NEXTGEN_GALLERY_BASIC_SLIDESHOW)
+            $this->set_slideshow_defaults($entity);
+            
+        else if ($entity->name == NEXTGEN_GALLERY_BASIC_THUMBNAILS)
+            $this->set_thumbnail_defaults($entity);
+	}
+    
+    function set_slideshow_defaults($entity)
+    {
+        $settings = C_NextGen_Settings::get_instance();
+        $this->object->_set_default_value($entity, 'settings', 'images_per_page', 10);
+        $this->object->_set_default_value($entity, 'settings', 'gallery_width', $settings->irWidth);
+        $this->object->_set_default_value($entity, 'settings', 'gallery_height', $settings->irHeight);
+        $this->object->_set_default_value($entity, 'settings', 'thumbnail_width', $settings->thumbwidth);
+        $this->object->_set_default_value($entity, 'settings', 'thumbnail_height', $settings->thumbheight);
+        $this->object->_set_default_value($entity, 'settings', 'cycle_interval', $settings->irRotatetime);
+        $this->object->_set_default_value($entity, 'settings', 'cycle_effect', $settings->slideFx);
+        $this->object->_set_default_value($entity, 'settings', 'flash_enabled', $settings->enableIR);
+        $this->object->_set_default_value($entity, 'settings', 'flash_path', $settings->irURL);
+        $this->object->_set_default_value($entity, 'settings', 'flash_shuffle', $settings->irShuffle);
+        $this->object->_set_default_value($entity, 'settings', 'flash_next_on_click', $settings->irLinkfromdisplay);
+        $this->object->_set_default_value($entity, 'settings', 'flash_navigation_bar', $settings->irShownavigation);
+        $this->object->_set_default_value($entity, 'settings', 'flash_loading_icon', $settings->irShowicons);
+        $this->object->_set_default_value($entity, 'settings', 'flash_watermark_logo', $settings->irWatermark);
+        $this->object->_set_default_value($entity, 'settings', 'flash_stretch_image', $settings->irOverstretch);
+        $this->object->_set_default_value($entity, 'settings', 'flash_transition_effect', $settings->irTransition);
+        $this->object->_set_default_value($entity, 'settings', 'flash_slow_zoom', $settings->irKenburns);
+        $this->object->_set_default_value($entity, 'settings', 'flash_background_color', $settings->irBackcolor);
+        $this->object->_set_default_value($entity, 'settings', 'flash_text_color', $settings->irFrontcolor);
+        $this->object->_set_default_value($entity, 'settings', 'flash_rollover_color', $settings->irLightcolor);
+        $this->object->_set_default_value($entity, 'settings', 'flash_screen_color', $settings->irScreencolor);
+        $this->object->_set_default_value($entity, 'settings', 'flash_background_music', $settings->irAudio);
+        $this->object->_set_default_value($entity, 'settings', 'flash_xhtml_validation', $settings->irXHTMLvalid);
+        $this->object->_set_default_value($entity, 'settings', 'effect_code', $settings->thumbCode);
+        $this->object->_set_default_value($entity, 'settings', 'show_thumbnail_link', $settings->galShowSlide ? 1 : 0);
+        $this->object->_set_default_value($entity, 'settings', 'thumbnail_link_text', $settings->galTextGallery);
+        $this->object->_set_default_value($entity, 'settings', 'template', '');
+
+        // Part of the pro-modules
+        $this->object->_set_default_value($entity, 'settings', 'ngg_triggers_display', 'never');
+    }
+    
+    
+    function set_thumbnail_defaults($entity)
+    {
+        $settings = C_NextGen_Settings::get_instance();
+        $this->object->_set_default_value($entity, 'settings', 'images_per_page', $settings->galImages);
+        $this->object->_set_default_value($entity, 'settings', 'number_of_columns', $settings->galColumns);
+        $this->object->_set_default_value($entity, 'settings', 'thumbnail_width', $settings->thumbwidth);
+        $this->object->_set_default_value($entity, 'settings', 'thumbnail_height', $settings->thumbheight);
+        $this->object->_set_default_value($entity, 'settings', 'show_all_in_lightbox', $settings->galHiddenImg);
+        $this->object->_set_default_value($entity, 'settings', 'ajax_pagination', $settings->galAjaxNav);
+        $this->object->_set_default_value($entity, 'settings', 'use_imagebrowser_effect', $settings->galImgBrowser);
+        $this->object->_set_default_value($entity, 'settings', 'template', '');
+        $this->object->_set_default_value($entity, 'settings', 'display_no_images_error', 1);
+
+        // TODO: Should this be called enable pagination?
+        $this->object->_set_default_value($entity, 'settings', 'disable_pagination', 0);
+
+        // Alternative view support
+        $this->object->_set_default_value($entity, 'settings', 'show_slideshow_link', $settings->galShowSlide ? 1 : 0);
+        $this->object->_Set_default_value($entity, 'settings', 'slideshow_link_text', $settings->galTextSlide);
+
+        // override thumbnail settings
+        $this->object->_set_default_value($entity, 'settings', 'override_thumbnail_settings', 0);
+        $this->object->_set_default_value($entity, 'settings', 'thumbnail_quality', '100');
+        $this->object->_set_default_value($entity, 'settings', 'thumbnail_crop', 1);
+        $this->object->_set_default_value($entity, 'settings', 'thumbnail_watermark', 0);
+
+        // Show piclens link ?
+        $this->object->_set_default_value($entity, 'settings', 'piclens_link_text', _('[Show PicLens]'));
+        $this->object->_set_default_value($entity, 'settings', 'show_piclens_link',
+            isset($entity->settings['show_piclens_link']) &&
+              preg_match("/^true|yes|y$/", $entity->settings['show_piclens_link']) ?
+                1 : 0
+        );
+
+        // Part of the pro-modules
+        $this->object->_set_default_value($entity, 'settings', 'ngg_triggers_display', 'never');
+    }
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_gallery_routes.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_gallery_routes.php
new file mode 100644
index 0000000000000000000000000000000000000000..80646af8267ec5df4114a6cbba18ed82fdcb0fff
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_gallery_routes.php
@@ -0,0 +1,25 @@
+<?php
+
+class A_NextGen_Basic_Gallery_Routes extends Mixin
+{
+    function initialize()
+    {
+        $this->object->add_pre_hook(
+            'serve_request',
+            get_class(),
+            get_class(),
+            'add_nextgen_basic_gallery_routes'
+        );
+    }
+    
+    function add_nextgen_basic_gallery_routes()
+    {
+		$slug = C_NextGen_Settings::get_instance()->router_param_slug;
+        $this->object->rewrite("{$slug}{*}/image/{*}",         "{$slug}{1}/pid--{2}");
+        $this->object->rewrite("{$slug}{*}/slideshow/{*}",     "{$slug}{1}/show--" . NEXTGEN_GALLERY_BASIC_SLIDESHOW  . "{2}");
+        $this->object->rewrite("{$slug}{*}/thumbnails/{*}",    "{$slug}{1}/show--".  NEXTGEN_GALLERY_BASIC_THUMBNAILS . "{2}");
+        $this->object->rewrite("{$slug}{*}/show--slide/{*}",   "{$slug}{1}/show--" . NEXTGEN_GALLERY_BASIC_SLIDESHOW  . "/{2}");
+        $this->object->rewrite("{$slug}{*}/show--gallery/{*}", "{$slug}{1}/show--" . NEXTGEN_GALLERY_BASIC_THUMBNAILS . "/{2}");
+        $this->object->rewrite("{$slug}{*}/page/{\\d}{*}",     "{$slug}{1}/page--{2}{3}");
+    }
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_gallery_urls.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_gallery_urls.php
new file mode 100644
index 0000000000000000000000000000000000000000..4160b56334131becd72f45c48eca309f2a5e5c82
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_gallery_urls.php
@@ -0,0 +1,85 @@
+<?php
+
+class A_NextGen_Basic_Gallery_Urls extends Mixin
+{
+    function initialize()
+	{
+		$this->object->add_post_hook(
+			'set_parameter_value',
+			get_class(),
+			get_class(),
+			'_set_nextgen_basic_thumbnail_parameter'
+		);
+		$this->object->add_post_hook(
+			'remove_parameter',
+			get_class(),
+			get_class(),
+			'_remove_nextgen_basic_thumbnail_parameter'
+		);
+
+	}
+    
+    
+    function create_parameter_segment($key, $value, $id=NULL, $use_prefix=FALSE)
+	{
+		if ($key == 'show') {
+            if ($value == NEXTGEN_GALLERY_BASIC_SLIDESHOW) $value = 'slideshow';
+            elseif ($value == NEXTGEN_GALLERY_BASIC_THUMBNAILS) $value = 'thumbnails';
+            elseif ($value == NEXTGEN_GALLERY_NEXTGEN_BASIC_IMAGEBROWSER) $value = 'imagebrowser';
+            return '/'.$value;
+        }
+        elseif ($key == 'page') {
+			return 'page/'.$value;
+		}
+		else
+			return $this->call_parent('create_parameter_segment', $key, $value, $id, $use_prefix);
+
+	}
+    
+    
+    function _set_nextgen_basic_thumbnail_parameter($key, $value, $id=NULL, $use_prefix=NULL)
+	{
+		$this->_set_ngglegacy_page_parameter($key, $id);
+	}
+
+
+	function _remove_nextgen_basic_thumbnail_parameter($key, $id=NULL, $url=FALSE)
+	{
+		$this->_set_ngglegacy_page_parameter($key, $id);
+        
+	}
+
+
+	function _set_ngglegacy_page_parameter($key, $id=NULL)
+	{
+		// Get the returned url
+		$retval		= $this->object->get_method_property(
+			$this->method_called, ExtensibleObject::METHOD_PROPERTY_RETURN_VALUE
+		);
+
+		// Get the settings manager
+		$settings	= C_NextGen_Settings::get_instance();
+
+		// Create the regex pattern
+		$sep		= preg_quote($settings->router_param_separator, '#');
+		if ($id)$id = preg_quote($id, '#').$sep;
+		$prefix		= preg_quote($settings->router_param_prefix, '#');
+		$regex		= implode('', array(
+			'#//?',
+			$id ? "({$id})?" : "(\w+{$sep})?",
+			"($prefix)?page{$sep}(\d+)/?#"
+		));
+
+		// Replace any page parameters with the ngglegacy equivalent
+		if (preg_match($regex, $retval, $matches)) {
+			$retval = str_replace($matches[0], "/page/{$matches[3]}/", $retval);
+			$this->object->set_method_property(
+				$this->method_called,
+				ExtensibleObject::METHOD_PROPERTY_RETURN_VALUE,
+				$retval
+			);
+		}
+
+		return $retval;
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_gallery_validation.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_gallery_validation.php
new file mode 100644
index 0000000000000000000000000000000000000000..a0430421b1b832c76364bc4e019affd470705788
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_gallery_validation.php
@@ -0,0 +1,46 @@
+<?php
+
+class A_NextGen_Basic_Gallery_Validation extends Mixin
+{
+    function initialize()
+    {
+        if ($this->object->name == NEXTGEN_GALLERY_BASIC_THUMBNAILS) {
+            $this->object->add_pre_hook(
+                'validation',
+                get_class(),
+                'Hook_NextGen_Basic_Thumbnail_Validation'
+            );
+        }
+        else if ($this->object->name == NEXTGEN_GALLERY_BASIC_SLIDESHOW) {
+            $this->object->add_pre_hook(
+                'validation',
+                get_class(),
+                'Hook_NextGen_Basic_Slideshow_Validation'
+            );
+        }
+        
+    }
+}
+
+class Hook_NextGen_Basic_Slideshow_Validation extends Hook
+{
+    function validation()
+    {
+        $this->object->validates_presence_of('gallery_width');
+		$this->object->validates_presence_of('gallery_height');
+		$this->object->validates_numericality_of('gallery_width');
+		$this->object->validates_numericality_of('gallery_height');
+    }
+}
+
+class Hook_NextGen_Basic_Thumbnail_Validation extends Hook
+{
+    function validation()
+    {
+        $this->object->validates_presence_of('thumbnail_width');
+		$this->object->validates_presence_of('thumbnail_height');
+		$this->object->validates_numericality_of('thumbnail_width');
+		$this->object->validates_numericality_of('thumbnail_height');
+		$this->object->validates_numericality_of('images_per_page');   
+    }
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_controller.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_controller.php
new file mode 100644
index 0000000000000000000000000000000000000000..0b02703ff0d9334e7af3e8e47ef5474cbdf40a39
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_controller.php
@@ -0,0 +1,104 @@
+<?php
+
+class A_NextGen_Basic_Slideshow_Controller extends Mixin_NextGen_Basic_Gallery_Controller
+{
+	/**
+	 * Displays the ngglegacy thumbnail gallery.
+	 * This method deprecates the use of the nggShowGallery() function.
+	 * @param stdClass|C_Displayed_Gallery|C_DataMapper_Model $displayed_gallery
+	 */
+	function index_action($displayed_gallery, $return=FALSE)
+	{   
+		// Get the images to be displayed
+        $current_page = (int)$this->param('page', 1);
+
+		// TODO: Shouldn't we be using maximum_entity_count instead?
+        $limit = FALSE;
+        if (in_array($displayed_gallery->source, array('random_images', 'recent_images')))
+            $limit = $displayed_gallery->display_settings['images_per_page'];
+
+		if (($images = $displayed_gallery->get_included_entities($limit)))
+        {
+			// Get the gallery storage component
+			$storage = $this->object->get_registry()->get_utility('I_Gallery_Storage');
+
+			// Create parameter list for the view
+			$params = $displayed_gallery->display_settings;
+			$params['storage']				= &$storage;
+			$params['images']				= &$images;
+			$params['displayed_gallery_id'] = $displayed_gallery->id();
+			$params['current_page']			= $current_page;
+			$params['effect_code']			= $this->object->get_effect_code($displayed_gallery);
+			$params['anchor']				= 'ngg-slideshow-' . $displayed_gallery->id() . '-' . rand(1, getrandmax()) . $current_page;
+			$gallery_width					= $displayed_gallery->display_settings['gallery_width'];
+			$gallery_height					= $displayed_gallery->display_settings['gallery_height'];
+			$params['aspect_ratio']			= $gallery_width/$gallery_height;
+			$params['flash_path']			= $this->object->get_static_url('photocrati-nextgen_basic_gallery#slideshow/imagerotator.swf');
+			$params['placeholder']			= $this->object->get_static_url('photocrati-nextgen_basic_gallery#slideshow/placeholder.gif');
+
+			// Are we displayed a flash slideshow?
+			if ($displayed_gallery->display_settings['flash_enabled'])
+            {
+				include_once(path_join(NGGALLERY_ABSPATH, implode(DIRECTORY_SEPARATOR, array('lib', 'swfobject.php'))));
+                $transient_id = $displayed_gallery->transient_id;
+				$params['mediarss_link'] = $this->get_router()->get_url(
+					'/nextgen-mediarss?template=playlist_feed&source=displayed_gallery&transient_id=' . $transient_id, false
+				);
+			}
+            
+            // Are we to generate a thumbnail link?
+            if ($displayed_gallery->display_settings['show_thumbnail_link']) {
+                $params['thumbnail_link'] = $this->object->get_url_for_alternate_display_type(
+                    $displayed_gallery, NEXTGEN_GALLERY_BASIC_THUMBNAILS
+                );
+            }
+                
+      $params = $this->object->prepare_display_parameters($displayed_gallery, $params);
+
+			$retval = $this->object->render_partial('photocrati-nextgen_basic_gallery#slideshow/index', $params, $return);
+		}
+
+		// No images found
+		else {
+			$retval = $this->object->render_partial('photocrati-nextgen_gallery_display#no_images_found', array(), $return);
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Enqueues all static resources required by this display type
+	 * @param C_Displayed_Gallery $displayed_gallery
+	 */
+	function enqueue_frontend_resources($displayed_gallery)
+	{
+		if ($this->object->is_flash_enabled($displayed_gallery)) {
+			wp_enqueue_script('swfobject'); // WordPress built-in library
+		}
+		else {
+            $resource = defined('SCRIPT_DEBUG') ? 'jquery.cycle.all.min.js' : "jquery.cycle.all.js";
+            wp_register_script('jquery-cycle', $this->get_static_url("photocrati-nextgen_basic_gallery#slideshow/{$resource}"), array('jquery'));
+			wp_enqueue_script('jquery-cycle');
+		}
+
+		wp_enqueue_style('nextgen_basic_slideshow_style', $this->get_static_url('photocrati-nextgen_basic_gallery#slideshow/nextgen_basic_slideshow.css'));
+        wp_enqueue_script('waitforimages', $this->get_static_url('photocrati-nextgen_basic_gallery#slideshow/jquery.waitforimages.js'), array('jquery'));
+		$this->call_parent('enqueue_frontend_resources', $displayed_gallery);
+		$this->enqueue_ngg_styles();
+	}
+
+	function is_flash_enabled($displayed_gallery)
+	{
+		return $displayed_gallery->display_settings['flash_enabled'];
+	}
+
+	/**
+	 * Provides the url of the JavaScript library required for
+	 * NextGEN Basic Slideshow to display
+	 * @return string
+	 */
+	function _get_js_lib_url()
+	{
+		return $this->get_static_url('photocrati-nextgen_basic_gallery#slideshow/nextgen_basic_slideshow.js');
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php
new file mode 100644
index 0000000000000000000000000000000000000000..19ffaba33dbcda06a8fb7954cc65d094e37c9c3f
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php
@@ -0,0 +1,338 @@
+<?php
+
+/**
+ * Provides the display settings form for the NextGen Basic Slideshow
+ */
+class A_NextGen_Basic_Slideshow_Form extends Mixin_Display_Type_Form
+{
+	function get_display_type_name()
+	{
+		return NEXTGEN_GALLERY_BASIC_SLIDESHOW;
+	}
+
+    function enqueue_static_resources()
+    {
+        wp_enqueue_script(
+            'nextgen_basic_slideshow_settings-js',
+            $this->get_static_url('photocrati-nextgen_basic_gallery#slideshow/nextgen_basic_slideshow_settings.js'),
+            array('jquery.nextgen_radio_toggle')
+        );
+    }
+
+    /**
+     * Returns a list of fields to render on the settings page
+     */
+    function _get_field_names()
+    {
+        return array(
+            'nextgen_basic_slideshow_gallery_dimensions',
+            'nextgen_basic_slideshow_cycle_effect',
+            'nextgen_basic_slideshow_cycle_interval',
+            'nextgen_basic_slideshow_images_per_page',
+            'nextgen_basic_slideshow_flash_enabled',
+            'nextgen_basic_slideshow_flash_background_music',
+            'nextgen_basic_slideshow_flash_stretch_image',
+            'nextgen_basic_slideshow_flash_transition_effect',
+            'nextgen_basic_slideshow_flash_shuffle',
+            'nextgen_basic_slideshow_flash_next_on_click',
+            'nextgen_basic_slideshow_flash_navigation_bar',
+            'nextgen_basic_slideshow_flash_loading_icon',
+            'nextgen_basic_slideshow_flash_watermark_logo',
+            'nextgen_basic_slideshow_flash_slow_zoom',
+            'nextgen_basic_slideshow_flash_xhtml_validation',
+            'nextgen_basic_slideshow_flash_background_color',
+            'nextgen_basic_slideshow_flash_text_color',
+            'nextgen_basic_slideshow_flash_rollover_color',
+            'nextgen_basic_slideshow_flash_screen_color',
+            'nextgen_basic_slideshow_show_thumbnail_link',
+            'nextgen_basic_slideshow_thumbnail_link_text'
+        );
+    }
+
+    function _render_nextgen_basic_slideshow_cycle_interval_field($display_type)
+    {
+        return $this->_render_number_field(
+            $display_type,
+            'cycle_interval',
+            'Interval',
+            $display_type->settings['cycle_interval'],
+            '',
+            FALSE,
+            '# of seconds',
+            1
+        );
+    }
+
+    function _render_nextgen_basic_slideshow_images_per_page_field($display_type)
+    {
+        return $this->_render_number_field(
+            $display_type,
+            'images_per_page',
+            'Image limit',
+            $display_type->settings['images_per_page'],
+            'Maximum number of images to display with recent or random sources',
+            FALSE,
+            '# of images',
+            0
+        );
+    }
+
+    function _render_nextgen_basic_slideshow_cycle_effect_field($display_type)
+    {
+        return $this->_render_select_field(
+            $display_type,
+            'cycle_effect',
+            'Effect',
+			array(
+			'fade' => 'fade',
+			'blindX' => 'blindX',
+			'cover' => 'cover',
+			'scrollUp' => 'scrollUp',
+			'scrollDown' => 'scrollDown',
+			'shuffle' => 'shuffle',
+			'toss' => 'toss',
+			'wipe' => 'wipe'
+			),
+            $display_type->settings['cycle_effect'],
+            '',
+            FALSE
+        );
+    }
+
+    function _render_nextgen_basic_slideshow_gallery_dimensions_field($display_type)
+    {
+        return $this->render_partial('photocrati-nextgen_basic_gallery#slideshow/nextgen_basic_slideshow_settings_gallery_dimensions', array(
+            'display_type_name' => $display_type->name,
+            'gallery_dimensions_label' => _('Maximum dimensions'),
+            'gallery_width' => $display_type->settings['gallery_width'],
+            'gallery_height' => $display_type->settings['gallery_height'],
+        ), True);
+    }
+
+    function _render_nextgen_basic_slideshow_flash_enabled_field($display_type)
+    {
+        return $this->_render_radio_field(
+            $display_type,
+            'flash_enabled',
+            'Enable flash slideshow',
+            $display_type->settings['flash_enabled'],
+            'Integrate the flash based slideshow for all flash supported devices'
+        );
+    }
+
+    function _render_nextgen_basic_slideshow_flash_shuffle_field($display_type)
+    {
+        return $this->_render_radio_field(
+            $display_type,
+            'flash_shuffle',
+            'Shuffle',
+            $display_type->settings['flash_shuffle'],
+            '',
+            empty($display_type->settings['flash_enabled']) ? TRUE : FALSE
+        );
+    }
+
+    function _render_nextgen_basic_slideshow_flash_next_on_click_field($display_type)
+    {
+        return $this->_render_radio_field(
+            $display_type,
+            'flash_next_on_click',
+            'Show next image on click',
+            $display_type->settings['flash_next_on_click'],
+            '',
+            empty($display_type->settings['flash_enabled']) ? TRUE : FALSE
+        );
+    }
+
+    function _render_nextgen_basic_slideshow_flash_navigation_bar_field($display_type)
+    {
+        return $this->_render_radio_field(
+            $display_type,
+            'flash_navigation_bar',
+            'Show navigation bar',
+            $display_type->settings['flash_navigation_bar'],
+            '',
+            empty($display_type->settings['flash_enabled']) ? TRUE : FALSE
+        );
+    }
+
+    function _render_nextgen_basic_slideshow_flash_loading_icon_field($display_type)
+    {
+        return $this->_render_radio_field(
+            $display_type,
+            'flash_loading_icon',
+            'Show loading icon',
+            $display_type->settings['flash_loading_icon'],
+            '',
+            empty($display_type->settings['flash_enabled']) ? TRUE : FALSE
+        );
+    }
+
+    function _render_nextgen_basic_slideshow_flash_watermark_logo_field($display_type)
+    {
+        return $this->_render_radio_field(
+            $display_type,
+            'flash_watermark_logo',
+            'Use watermark logo',
+            $display_type->settings['flash_watermark_logo'],
+            'Use the watermark image in the Flash object. Note: this does not watermark the image itself, and cannot be applied with text watermarks',
+            empty($display_type->settings['flash_enabled']) ? TRUE : FALSE
+        );
+    }
+
+    function _render_nextgen_basic_slideshow_flash_stretch_image_field($display_type)
+    {
+        return $this->_render_select_field(
+            $display_type,
+            'flash_stretch_image',
+            'Stretch image',
+			array('true' => 'true', 'false' => 'false', 'fit' => 'fit', 'none' => 'none'),
+            $display_type->settings['flash_stretch_image'],
+            '',
+            empty($display_type->settings['flash_enabled']) ? TRUE : FALSE
+        );
+    }
+
+    function _render_nextgen_basic_slideshow_flash_transition_effect_field($display_type)
+    {
+        return $this->_render_select_field(
+            $display_type,
+            'flash_transition_effect',
+            'Transition / fade effect',
+            array(
+                'fade' => 'fade',
+                'bgfade' => 'bgfade',
+                'slowfade' => 'slowfade',
+                'circles' => 'circles',
+                'bubbles' => 'bubbles',
+                'blocks' => 'blocks',
+                'fluids' => 'fluids',
+                'flash' => 'flash',
+                'lines' => 'lines',
+                'random' => 'random'
+            ),
+            $display_type->settings['flash_transition_effect'],
+            '',
+            empty($display_type->settings['flash_enabled']) ? TRUE : FALSE
+        );
+    }
+
+    function _render_nextgen_basic_slideshow_flash_slow_zoom_field($display_type)
+    {
+        return $this->_render_radio_field(
+            $display_type,
+            'flash_slow_zoom',
+            'Use slow zooming effect',
+            $display_type->settings['flash_slow_zoom'],
+            '',
+            empty($display_type->settings['flash_enabled']) ? TRUE : FALSE
+        );
+    }
+
+    function _render_nextgen_basic_slideshow_flash_background_music_field($display_type)
+    {
+        return $this->_render_text_field(
+            $display_type,
+            'flash_background_music',
+            'Background music (url)',
+            $display_type->settings['flash_background_music'],
+            '',
+            empty($display_type->settings['flash_enabled']) ? TRUE : FALSE,
+            'http://...'
+        );
+    }
+
+    function _render_nextgen_basic_slideshow_flash_xhtml_validation_field($display_type)
+    {
+        return $this->_render_radio_field(
+            $display_type,
+            'flash_xhtml_validation',
+            'Try XHTML validation',
+            $display_type->settings['flash_xhtml_validation'],
+            'Uses CDATA. Important: Could cause problems with some older browsers',
+            empty($display_type->settings['flash_enabled']) ? TRUE : FALSE
+        );
+    }
+
+    function _render_nextgen_basic_slideshow_flash_background_color_field($display_type)
+    {
+        return $this->_render_color_field(
+            $display_type,
+            'flash_background_color',
+            'Background',
+            $display_type->settings['flash_background_color'],
+            '',
+            empty($display_type->settings['flash_enabled']) ? TRUE : FALSE
+        );
+    }
+
+    function _render_nextgen_basic_slideshow_flash_text_color_field($display_type)
+    {
+        return $this->_render_color_field(
+            $display_type,
+            'flash_text_color',
+            'Texts / buttons',
+            $display_type->settings['flash_text_color'],
+            '',
+            empty($display_type->settings['flash_enabled']) ? TRUE : FALSE
+        );
+    }
+
+    function _render_nextgen_basic_slideshow_flash_rollover_color_field($display_type)
+    {
+        return $this->_render_color_field(
+            $display_type,
+            'flash_rollover_color',
+            'Rollover / active',
+            $display_type->settings['flash_rollover_color'],
+            '',
+            empty($display_type->settings['flash_enabled']) ? TRUE : FALSE
+        );
+    }
+
+    function _render_nextgen_basic_slideshow_flash_screen_color_field($display_type)
+    {
+        return $this->_render_color_field(
+            $display_type,
+            'flash_screen_color',
+            'Screen',
+            $display_type->settings['flash_screen_color'],
+            '',
+            empty($display_type->settings['flash_enabled']) ? TRUE : FALSE
+        );
+    }
+
+    /**
+     * Renders the show_thumbnail_link settings field
+     *
+     * @param C_Display_Type $display_type
+     * @return string
+     */
+    function _render_nextgen_basic_slideshow_show_thumbnail_link_field($display_type)
+    {
+        return $this->_render_radio_field(
+            $display_type,
+            'show_thumbnail_link',
+            'Show thumbnail link',
+            $display_type->settings['show_thumbnail_link']
+        );
+    }
+
+    /**
+     * Renders the thumbnail_link_text settings field
+     *
+     * @param C_Display_Type $display_type
+     * @return string
+     */
+    function _render_nextgen_basic_slideshow_thumbnail_link_text_field($display_type)
+    {
+        return $this->_render_text_field(
+            $display_type,
+            'thumbnail_link_text',
+            'Thumbnail link text',
+            $display_type->settings['thumbnail_link_text'],
+            '',
+            !empty($display_type->settings['show_thumbnail_link']) ? FALSE : TRUE
+        );
+    }
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnail_form.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnail_form.php
new file mode 100644
index 0000000000000000000000000000000000000000..8a0ad3498365068a28f3cce63897f98ab44d3f37
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnail_form.php
@@ -0,0 +1,200 @@
+<?php
+
+class A_NextGen_Basic_Thumbnail_Form extends Mixin_Display_Type_Form
+{
+	function get_display_type_name()
+	{
+		return NEXTGEN_GALLERY_BASIC_THUMBNAILS;
+	}
+
+	/**
+	 * Enqueues static resources required by this form
+	 */
+	function enqueue_static_resources()
+	{
+		wp_enqueue_style(
+			'nextgen_basic_thumbnails_settings',
+			$this->object->get_static_url('photocrati-nextgen_basic_gallery#thumbnails/nextgen_basic_thumbnails_settings.css'),
+			false
+		);
+
+		wp_enqueue_script(
+			'nextgen_basic_thumbnails_settings',
+			$this->object->get_static_url('photocrati-nextgen_basic_gallery#thumbnails/nextgen_basic_thumbnails_settings.js'),
+			array('jquery.nextgen_radio_toggle')
+		);
+	}
+
+	/**
+     * Returns a list of fields to render on the settings page
+     */
+    function _get_field_names()
+    {
+        return array(
+            'thumbnail_override_settings',
+            'nextgen_basic_thumbnails_images_per_page',
+            'nextgen_basic_thumbnails_number_of_columns',
+            'nextgen_basic_thumbnails_ajax_pagination',
+            'nextgen_basic_thumbnails_hidden',
+            'nextgen_basic_thumbnails_imagebrowser_effect',
+            'nextgen_basic_thumbnails_show_piclens_link',
+            'nextgen_basic_thumbnails_piclens_link_text',
+            'nextgen_basic_thumbnails_show_slideshow_link',
+            'nextgen_basic_thumbnails_slideshow_link_text',
+            'nextgen_basic_templates_template',
+        );
+    }
+
+    /**
+     * Renders the images_per_page settings field
+     *
+     * @param C_Display_Type $display_type
+     * @return string
+     */
+    function _render_nextgen_basic_thumbnails_images_per_page_field($display_type)
+    {
+        return $this->_render_number_field(
+            $display_type,
+            'images_per_page',
+            'Images per page',
+            $display_type->settings['images_per_page'],
+            '"0" will display all images at once',
+            FALSE,
+            '# of images',
+            0
+        );
+    }
+
+    /**
+     * Renders the number_of_columns settings field
+     *
+     * @param C_Display_Type $display_type
+     * @return string
+     */
+    function _render_nextgen_basic_thumbnails_number_of_columns_field($display_type)
+    {
+        return $this->_render_number_field(
+            $display_type,
+            'number_of_columns',
+            'Number of columns to display',
+            $display_type->settings['number_of_columns'],
+            '',
+            FALSE,
+            '# of columns',
+            0
+        );
+    }
+
+    /**
+     * Renders the piclens_link_text settings field
+     *
+     * @param C_Display_Type $display_type
+     * @return string
+     */
+    function _render_nextgen_basic_thumbnails_piclens_link_text_field($display_type)
+    {
+        return $this->_render_text_field(
+            $display_type,
+            'piclens_link_text',
+            'Piclens link text',
+            $display_type->settings['piclens_link_text'],
+            '',
+            !empty($display_type->settings['show_piclens_link']) ? FALSE : TRUE
+        );
+    }
+
+    /**
+     * Renders the show_piclens_link settings field
+     *
+     * @param C_Display_Type $display_type
+     * @return string
+     */
+    function _render_nextgen_basic_thumbnails_show_piclens_link_field($display_type)
+    {
+        return $this->_render_radio_field(
+            $display_type,
+            'show_piclens_link',
+            'Show piclens link',
+            $display_type->settings['show_piclens_link']
+        );
+    }
+
+    /**
+     * Renders the show_piclens_link settings field
+     *
+     * @param C_Display_Type $display_type
+     * @return string
+     */
+    function _render_nextgen_basic_thumbnails_hidden_field($display_type)
+    {
+        return $this->_render_radio_field(
+            $display_type,
+            'show_all_in_lightbox',
+            'Add Hidden Images',
+            $display_type->settings['show_all_in_lightbox'],
+            'If pagination is used this option will show all images in the modal window (Thickbox, Lightbox etc.) This increases page load.'
+        );
+    }
+
+    function _render_nextgen_basic_thumbnails_imagebrowser_effect_field($display_type)
+    {
+        return $this->_render_radio_field(
+            $display_type,
+            'use_imagebrowser_effect',
+            'Use imagebrowser effect',
+            $display_type->settings['use_imagebrowser_effect'],
+            'When active each image in the gallery will link to an imagebrowser display and lightbox effects will not be applied.'
+        );
+    }
+
+    /**
+     * Renders the show_piclens_link settings field
+     *
+     * @param C_Display_Type $display_type
+     * @return string
+     */
+    function _render_nextgen_basic_thumbnails_ajax_pagination_field($display_type)
+    {
+        return $this->_render_radio_field(
+            $display_type,
+            'ajax_pagination',
+            'Enable AJAX pagination',
+            $display_type->settings['ajax_pagination'],
+            'Browse images without reloading the page.'
+        );
+    }
+
+    /**
+     * Renders the show_slideshow_link settings field
+     *
+     * @param C_Display_Type $display_type
+     * @return string
+     */
+    function _render_nextgen_basic_thumbnails_show_slideshow_link_field($display_type)
+    {
+        return $this->_render_radio_field(
+            $display_type,
+            'show_slideshow_link',
+            'Show slideshow link',
+            $display_type->settings['show_slideshow_link']
+        );
+    }
+
+    /**
+     * Renders the slideshow_link_text settings field
+     *
+     * @param C_Display_Type $display_type
+     * @return string
+     */
+    function _render_nextgen_basic_thumbnails_slideshow_link_text_field($display_type)
+    {
+        return $this->_render_text_field(
+            $display_type,
+            'slideshow_link_text',
+            'Slideshow link text',
+            $display_type->settings['slideshow_link_text'],
+            '',
+            !empty($display_type->settings['show_slideshow_link']) ? FALSE : TRUE
+        );
+    }
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnails_controller.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnails_controller.php
new file mode 100644
index 0000000000000000000000000000000000000000..d04ce3241bd7f1f22dab5ea031d753988df2069c
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnails_controller.php
@@ -0,0 +1,221 @@
+<?php
+
+class A_NextGen_Basic_Thumbnails_Controller extends Mixin_NextGen_Basic_Gallery_Controller
+{
+	/**
+	 * Adds framework support for thumbnails
+	 */
+	function initialize()
+	{
+        parent::initialize();
+        $this->add_mixin('Mixin_NextGen_Basic_Pagination');
+	}
+
+	/**
+	 * Displays the ngglegacy thumbnail gallery.
+	 * This method deprecates the use of the nggShowGallery() function.
+	 * @param stdClass|C_Displayed_Gallery|C_DataMapper_Model $displayed_gallery
+	 */
+	function index_action($displayed_gallery, $return=FALSE)
+    {  
+        $display_settings = $displayed_gallery->display_settings;
+
+        // If these options are on we must use the transient_id to identify the gallery
+        if ($display_settings['show_piclens_link'] || $display_settings['ajax_pagination'])
+            $gallery_id = $displayed_gallery->transient_id;
+        else
+            $gallery_id = $displayed_gallery->id();
+
+        if (!$display_settings['disable_pagination'])
+            $current_page = (int)$this->param('page', $gallery_id, 1);
+        else
+            $current_page = 1;
+
+        $offset = $display_settings['images_per_page'] * ($current_page - 1);
+        $storage = $this->object->get_registry()->get_utility('I_Gallery_Storage');
+        $total = $displayed_gallery->get_entity_count();
+
+        // Get the images to be displayed
+        if ($display_settings['images_per_page'] > 0 && $display_settings['show_all_in_lightbox'])
+        {
+            // the "Add Hidden Images" feature works by loading ALL images and then marking the ones not on this page
+            // as hidden (style="display: none")
+            $images = $displayed_gallery->get_included_entities();
+            $i = 0;
+            foreach ($images as &$image) {
+                if ($i < $display_settings['images_per_page'] * ($current_page - 1))
+                {
+                    $image->hidden = TRUE;
+                }
+                elseif ($i >= $display_settings['images_per_page'] * ($current_page))
+                {
+                    $image->hidden = TRUE;
+                }
+                $i++;
+            }
+        }
+        else {
+            // just display the images for this page, as normal
+            $images = $displayed_gallery->get_included_entities($display_settings['images_per_page'], $offset);
+        }
+
+        if (in_array($displayed_gallery->source, array('random_images', 'recent_images')))
+            $display_settings['disable_pagination'] = TRUE;
+
+		// Are there images to display?
+		if ($images) {
+
+			// Create pagination
+			if ($display_settings['images_per_page'] && !$display_settings['disable_pagination']) {
+                $pagination_result = $this->object->create_pagination(
+                    $current_page,
+                    $total,
+                    $display_settings['images_per_page'],
+                    urldecode($this->object->param('ajax_pagination_referrer'))
+                );
+                $this->object->remove_param('ajax_pagination_referrer');
+                $pagination_prev = $pagination_result['prev'];
+                $pagination_next = $pagination_result['next'];
+                $pagination      = $pagination_result['output'];
+			} else {
+                list($pagination_prev, $pagination_next, $pagination) = array(NULL, NULL, NULL);
+            }
+
+			$thumbnail_size_name = 'thumbnail';
+
+			if ($display_settings['override_thumbnail_settings'])
+            {
+                $dynthumbs = $this->object->get_registry()->get_utility('I_Dynamic_Thumbnails_Manager');
+
+                if ($dynthumbs != null)
+                {
+                    $dyn_params = array(
+                        'width' => $display_settings['thumbnail_width'],
+                        'height' => $display_settings['thumbnail_height'],
+                    );
+
+                    if ($display_settings['thumbnail_quality'])
+                        $dyn_params['quality'] = $display_settings['thumbnail_quality'];
+
+                    if ($display_settings['thumbnail_crop'])
+                        $dyn_params['crop'] = true;
+
+                    if ($display_settings['thumbnail_watermark'])
+                        $dyn_params['watermark'] = true;
+
+                    $thumbnail_size_name = $dynthumbs->get_size_name($dyn_params);
+                }
+            }
+
+            // Determine what the piclens link would be
+            $piclens_link = '';
+            if ($display_settings['show_piclens_link']) {
+				$mediarss_link = $this->object->get_router()->get_url('/nextgen-mediarss?source=displayed_gallery&transient_id=' . $gallery_id, FALSE);
+                $piclens_link = "javascript:PicLensLite.start({feedUrl:'{$mediarss_link}'});";
+            }
+            
+            // Generate a slideshow link
+            $slideshow_link = '';
+            if ($display_settings['show_slideshow_link'])
+            {
+                // origin_url is necessary for ajax operations. slideshow_link_origin will NOT always exist.
+                $origin_url = (empty($display_settings['slideshow_link_origin']) ? FALSE : $display_settings['slideshow_link_origin']);
+                $slideshow_link = $this->object->get_url_for_alternate_display_type(
+                    $displayed_gallery, NEXTGEN_GALLERY_BASIC_SLIDESHOW, $origin_url
+                );
+            }
+
+            // This setting 1) points all images to an imagebrowser display & 2) disables the lightbox effect
+            if ($display_settings['use_imagebrowser_effect'])
+            {
+                // this hook *MUST* be removed later; it should not apply to galleries that may come after this one!
+                $storage->add_post_hook(
+                    'get_image_url',
+                    'imagebrowser alternate url replacer',
+                    'Hook_NextGen_Basic_Imagebrowser_Alt_URLs',
+                    'get_image_url'
+                );
+                $effect_code = '';
+            }
+            else {
+                $effect_code = $this->object->get_effect_code($displayed_gallery);
+            }
+
+            // The render functions require different processing
+            if (!empty($display_settings['template']))
+            {
+                $this->object->add_mixin('A_NextGen_Basic_Template_Form');
+                $this->object->add_mixin('Mixin_NextGen_Basic_Templates');
+                $params = $this->object->prepare_legacy_parameters(
+                    $images,
+                    $displayed_gallery,
+                    array(
+                        'next' => (empty($pagination_next)) ? FALSE : $pagination_next,
+                        'prev' => (empty($pagination_prev)) ? FALSE : $pagination_prev,
+                        'pagination' => $pagination,
+                        'piclens_link' => $piclens_link,
+                        'slideshow_link' => $slideshow_link
+                    )
+                );
+                $output = $this->object->legacy_render($display_settings['template'], $params, $return, 'gallery');
+            }
+            else {
+                $params = $display_settings;
+                $params['storage']				= &$storage;
+                $params['images']				= &$images;
+                $params['displayed_gallery_id'] = $gallery_id;
+                $params['transient_id']         = $displayed_gallery->transient_id;
+                $params['current_page']			= $current_page;
+                $params['piclens_link']			= $piclens_link;
+                $params['effect_code']			= $effect_code;
+                $params['pagination']			= $pagination;
+                $params['thumbnail_size_name']	= $thumbnail_size_name;
+                $params['slideshow_link']       = $slideshow_link;
+                
+                $params = $this->object->prepare_display_parameters($displayed_gallery, $params);
+                
+                $output = $this->object->render_view('photocrati-nextgen_basic_gallery#thumbnails/index', $params, $return);
+            }
+
+            if ($display_settings['use_imagebrowser_effect'])
+                $storage->del_post_hook('get_image_url', 'imagebrowser alternate url replacer');
+
+            return $output;
+
+		}
+		else if ($display_settings['display_no_images_error']) {
+			return $this->object->render_partial("photocrati-nextgen_gallery_display#no_images_found", array(), $return);
+		}
+	}
+
+	/**
+	 * Enqueues all static resources required by this display type
+	 * @param C_Displayed_Gallery $displayed_gallery
+	 */
+	function enqueue_frontend_resources($displayed_gallery)
+	{
+		$this->call_parent('enqueue_frontend_resources', $displayed_gallery);
+
+        wp_enqueue_style('nextgen_basic_thumbnails_style', $this->get_static_url('photocrati-nextgen_basic_gallery#thumbnails/nextgen_basic_thumbnails.css'));
+
+		if ($displayed_gallery->display_settings['show_piclens_link'])
+			wp_enqueue_script('piclens', $this->get_static_url('photocrati-nextgen_basic_gallery#thumbnails/piclens/lite/piclens.js'));
+
+        if ($displayed_gallery->display_settings['ajax_pagination'])
+            wp_enqueue_script('nextgen-basic-thumbnails-ajax-pagination', $this->object->get_static_url('photocrati-nextgen_basic_gallery#thumbnails/ajax_pagination.js'));
+
+		wp_enqueue_style('nextgen_pagination_style', $this->get_static_url('photocrati-nextgen_pagination#style.css'));
+
+		$this->enqueue_ngg_styles();
+	}
+
+	/**
+	 * Provides the url of the JavaScript library required for
+	 * NextGEN Basic Thumbnails to display
+	 * @return string
+	 */
+	function _get_js_lib_url()
+	{
+        return $this->object->get_static_url('photocrati-nextgen_basic_gallery#thumbnails/nextgen_basic_thumbnails.js');
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/class.nextgen_basic_gallery_installer.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/class.nextgen_basic_gallery_installer.php
new file mode 100644
index 0000000000000000000000000000000000000000..e3cfcc11752a4477daf6d6c2cb36a10d4bd8d5ec
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/class.nextgen_basic_gallery_installer.php
@@ -0,0 +1,27 @@
+<?php
+
+class C_NextGen_Basic_Gallery_Installer extends C_Gallery_Display_Installer
+{
+	function install()
+	{
+		$this->install_display_type(NEXTGEN_GALLERY_BASIC_THUMBNAILS,
+			array(
+				'title'					=>	'NextGEN Basic Thumbnails',
+				'entity_types'			=>	array('image'),
+				'preview_image_relpath'	=>	'photocrati-nextgen_basic_gallery#thumb_preview.jpg',
+				'default_source'		=>	'galleries',
+				'view_order' => NEXTGEN_DISPLAY_PRIORITY_BASE
+			)
+		);
+
+		$this->install_display_type(NEXTGEN_GALLERY_BASIC_SLIDESHOW,
+			array(
+				'title'					=>	'NextGEN Basic Slideshow',
+				'entity_types'			=>	array('image'),
+				'preview_image_relpath'	=>	'photocrati-nextgen_basic_gallery#slideshow_preview.jpg',
+				'default_source'		=>	'galleries',
+				'view_order' => NEXTGEN_DISPLAY_PRIORITY_BASE + 10
+			)
+		);
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/hook.nextgen_basic_gallery_integration.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/hook.nextgen_basic_gallery_integration.php
new file mode 100644
index 0000000000000000000000000000000000000000..2029c71a427e397ea0fee687765830dfc6c70064
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/hook.nextgen_basic_gallery_integration.php
@@ -0,0 +1,50 @@
+<?php
+
+class Hook_NextGen_Basic_Gallery_Integration extends Hook
+{
+    function index_action($displayed_gallery, $return=FALSE)
+    {
+        $show = $this->object->param('show');
+		$pid  = $this->object->param('pid');
+
+		if (!empty($pid) && isset($displayed_gallery->display_settings['use_imagebrowser_effect']) && intval($displayed_gallery->display_settings['use_imagebrowser_effect']))
+			$show = NEXTGEN_GALLERY_NEXTGEN_BASIC_IMAGEBROWSER;
+
+        // Are we to display a different display type?
+        if (!empty($show))
+        {
+            $params = (array)$displayed_gallery->get_entity();
+            $ds = $params['display_settings'];
+
+            if ((!empty($ds['show_slideshow_link']) || !empty($ds['show_thumbnail_link']) || !empty($ds['use_imagebrowser_effect']))
+            &&   $show != $this->object->context)
+            {
+                // We've got an alternate request. We'll use a different display
+                // type to serve the request and not run the original controller
+                // action
+                $this->object->set_method_property(
+                    $this->method_called,
+                    ExtensibleObject::METHOD_PROPERTY_RUN,
+                    FALSE
+                );
+                
+                // Render the new display type
+                $renderer = $this->get_registry()->get_utility('I_Displayed_Gallery_Renderer');
+                $displayed_gallery->original_display_type = $displayed_gallery->display_type;
+                $displayed_gallery->display_type = $show;
+                $params = (array)$displayed_gallery->get_entity();
+                unset($params['display_settings']);
+                $retval = $renderer->display_images($params, $return);
+                
+                // Set return value
+                $this->object->set_method_property(
+                    $this->method_called,
+                    ExtensibleObject::METHOD_PROPERTY_RETURN_VALUE,
+                    $retval
+                );
+                
+                return $retval;
+            }
+        }
+    }
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/mixin.nextgen_basic_gallery_controller.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/mixin.nextgen_basic_gallery_controller.php
new file mode 100644
index 0000000000000000000000000000000000000000..f1cb3bdde7fb15a9b735b7f23abd49f75a1db096
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/mixin.nextgen_basic_gallery_controller.php
@@ -0,0 +1,30 @@
+<?php
+
+class Mixin_NextGen_Basic_Gallery_Controller extends Mixin
+{
+    function initialize()
+    {
+        $this->object->add_pre_hook(
+            'index_action',
+            get_class(),
+            'Hook_NextGen_Basic_Gallery_Integration'
+        );    
+    }
+    
+    
+    /**
+     * Returns a url to view the displayed gallery using an alternate display
+     * type
+     * @param C_Displayed_Gallery $displayed_gallery
+     * @param string $display_type
+     * @return string
+     */
+    function get_url_for_alternate_display_type($displayed_gallery, $display_type, $origin_url = FALSE)
+    {
+        $url = ($origin_url ? $origin_url : $this->object->get_routed_url(TRUE));
+        $url = $this->object->remove_param_for($url, 'show', $displayed_gallery->id());
+        $url = $this->object->set_param_for($url, 'show', $display_type, $displayed_gallery->id());
+
+        return $url;
+    }
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/module.nextgen_basic_gallery.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/module.nextgen_basic_gallery.php
new file mode 100644
index 0000000000000000000000000000000000000000..115b37e657bd4a48fe070d1365c7c505d3da2e06
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/module.nextgen_basic_gallery.php
@@ -0,0 +1,242 @@
+<?php
+/*
+{
+    Module: photocrati-nextgen_basic_gallery,
+    Depends: { photocrati-nextgen_pagination }
+}
+*/
+
+define(
+    'NEXTGEN_GALLERY_BASIC_THUMBNAILS',
+    'photocrati-nextgen_basic_thumbnails'
+);
+
+define(
+    'NEXTGEN_GALLERY_BASIC_SLIDESHOW',
+    'photocrati-nextgen_basic_slideshow'
+);
+
+
+class M_NextGen_Basic_Gallery extends C_Base_Module
+{
+    function define()
+    {
+        parent::define(
+            'photocrati-nextgen_basic_gallery',
+            'NextGEN Basic Gallery',
+            "Provides NextGEN Gallery's basic thumbnail/slideshow integrated gallery",
+            '0.6',
+            'http://www.nextgen-gallery.com',
+            'Photocrati Media',
+            'http://www.photocrati.com'
+        );
+
+		include_once('class.nextgen_basic_gallery_installer.php');
+		C_Photocrati_Installer::add_handler($this->module_id, 'C_NextGen_Basic_Gallery_Installer');
+    }
+
+    function get_type_list()
+    {
+        return array(
+            'A_Ajax_Pagination_Actions' => 'adapter.ajax_pagination_actions.php',
+            'A_Nextgen_Basic_Gallery_Forms' => 'adapter.nextgen_basic_gallery_forms.php',
+            'C_Nextgen_Basic_Gallery_Installer' => 'class.nextgen_basic_gallery_installer.php',
+            'A_Nextgen_Basic_Gallery_Mapper' => 'adapter.nextgen_basic_gallery_mapper.php',
+            'A_Nextgen_Basic_Gallery_Routes' => 'adapter.nextgen_basic_gallery_routes.php',
+            'A_Nextgen_Basic_Gallery_Urls' => 'adapter.nextgen_basic_gallery_urls.php',
+            'A_Nextgen_Basic_Gallery_Validation' => 'adapter.nextgen_basic_gallery_validation.php',
+            'A_Nextgen_Basic_Slideshow_Controller' => 'adapter.nextgen_basic_slideshow_controller.php',
+            'A_Nextgen_Basic_Slideshow_Form' => 'adapter.nextgen_basic_slideshow_form.php',
+            'A_Nextgen_Basic_Thumbnail_Form' => 'adapter.nextgen_basic_thumbnail_form.php',
+            'A_Nextgen_Basic_Thumbnails_Controller' => 'adapter.nextgen_basic_thumbnails_controller.php',
+            'Hook_Nextgen_Basic_Gallery_Integration' => 'hook.nextgen_basic_gallery_integration.php',
+            'Mixin_Nextgen_Basic_Gallery_Controller' => 'mixin.nextgen_basic_gallery_controller.php'
+        );
+    }
+    
+   
+    function _register_adapters()
+    {
+        // Provides the display type forms
+        $this->get_registry()->add_adapter(
+            'I_Form',
+            'A_NextGen_Basic_Slideshow_Form',
+            NEXTGEN_GALLERY_BASIC_SLIDESHOW
+        );
+        $this->get_registry()->add_adapter(
+            'I_Form',
+            'A_NextGen_Basic_Thumbnail_Form',
+            NEXTGEN_GALLERY_BASIC_THUMBNAILS
+        );
+        
+        // Provides the controllers for the display types
+        $this->get_registry()->add_adapter(
+            'I_Display_Type_Controller',
+            'A_NextGen_Basic_Slideshow_Controller',
+            NEXTGEN_GALLERY_BASIC_SLIDESHOW
+        );
+        $this->get_registry()->add_adapter(
+            'I_Display_Type_Controller',
+            'A_NextGen_Basic_Thumbnails_Controller',
+            NEXTGEN_GALLERY_BASIC_THUMBNAILS
+        );
+        
+        // Provide defaults for the display types
+        $this->get_registry()->add_adapter(
+            'I_Display_Type_Mapper',
+            'A_NextGen_Basic_Gallery_Mapper'
+        );
+        
+        // Provides validation for the display types
+        $this->get_registry()->add_adapter(
+            'I_Display_Type',
+            'A_NextGen_Basic_Gallery_Validation'
+        );
+        
+        // Provides url generation support for the display types
+        $this->get_registry()->add_adapter(
+			'I_Routing_App',
+			'A_NextGen_Basic_Gallery_Urls'
+		);
+        
+        // Provides routing logic for the display types
+        $this->get_registry()->add_adapter(
+            'I_Router',
+            'A_NextGen_Basic_Gallery_Routes'
+        );
+        
+        
+        // Provides AJAX pagination actions required by the display types
+        $this->get_registry()->add_adapter(
+            'I_Ajax_Controller',
+            'A_Ajax_Pagination_Actions'
+        );
+
+        // Adds the settings forms
+        $this->get_registry()->add_adapter(
+            'I_Form_Manager',
+            'A_NextGen_Basic_Gallery_Forms'
+        );
+    }
+    
+    function _register_hooks()
+	{
+		C_NextGen_Shortcode_Manager::add('nggallery', array(&$this, 'render'));
+		C_NextGen_Shortcode_Manager::add('nggtags',   array(&$this, 'render_based_on_tags'));
+		C_NextGen_Shortcode_Manager::add('random',    array(&$this, 'render_random_images'));
+		C_NextGen_Shortcode_Manager::add('recent',    array(&$this, 'render_recent_images'));
+		C_NextGen_Shortcode_Manager::add('thumb',	   array(&$this, 'render_thumb_shortcode'));
+		C_NextGen_Shortcode_Manager::add('slideshow',		 array(&$this, 'render_slideshow'));
+		C_NextGen_Shortcode_Manager::add('nggslideshow',	 array(&$this, 'render_slideshow'));
+	}
+
+    /**
+     * Gets a value from the parameter array, and if not available, uses the default value
+     *
+     * @param string $name
+     * @param mixed $default
+     * @param array $params
+     * @return mixed
+     */
+    function _get_param($name, $default, $params)
+    {
+        return (isset($params[$name])) ? $params[$name] : $default;
+    }
+
+	/**
+     * Short-cut for rendering an thumbnail gallery
+     * @param array $params
+     * @param null $inner_content
+     * @return string
+     */
+	function render($params, $inner_content=NULL)
+    {
+        $params['gallery_ids']     = $this->_get_param('id', NULL, $params);
+        $params['display_type']    = $this->_get_param('display_type', NEXTGEN_GALLERY_BASIC_THUMBNAILS, $params);
+        if (isset($params['images']))
+        {
+            $params['images_per_page'] = $this->_get_param('images', NULL, $params);
+        }
+        unset($params['id']);
+        unset($params['images']);
+
+		$renderer = $this->get_registry()->get_utility('I_Displayed_Gallery_Renderer');
+        return $renderer->display_images($params, $inner_content);
+    }
+
+	function render_based_on_tags($params, $inner_content=NULL)
+    {
+        $params['tag_ids']      = $this->_get_param('gallery', $this->_get_param('album', array(), $params), $params);
+        $params['source']       = $this->_get_param('source', 'tags', $params);
+        $params['display_type'] = $this->_get_param('display_type', NEXTGEN_GALLERY_BASIC_THUMBNAILS, $params);
+        unset($params['gallery']);
+
+		$renderer = $this->get_registry()->get_utility('I_Displayed_Gallery_Renderer');
+        return $renderer->display_images($params, $inner_content);
+    }
+
+	function render_random_images($params, $inner_content=NULL)
+	{
+		$params['source']             = $this->_get_param('source', 'random', $params);
+        $params['images_per_page']    = $this->_get_param('max', NULL, $params);
+        $params['disable_pagination'] = $this->_get_param('disable_pagination', TRUE, $params);
+        $params['display_type']       = $this->_get_param('display_type', NEXTGEN_GALLERY_BASIC_THUMBNAILS, $params);
+
+        // inside if because Mixin_Displayed_Gallery_Instance_Methods->get_entities() doesn't handle NULL container_ids
+        // correctly
+        if (isset($params['id']))
+        {
+            $params['container_ids'] = $this->_get_param('id', NULL, $params);
+        }
+
+        unset($params['max']);
+        unset($params['id']);
+
+		$renderer = $this->get_registry()->get_utility('I_Displayed_Gallery_Renderer');
+        return $renderer->display_images($params, $inner_content);
+	}
+
+	function render_recent_images($params, $inner_content=NULL)
+	{
+		        $params['source']             = $this->_get_param('source', 'recent', $params);
+        $params['images_per_page']    = $this->_get_param('max', NULL, $params);
+        $params['disable_pagination'] = $this->_get_param('disable_pagination', TRUE, $params);
+        $params['display_type']       = $this->_get_param('display_type', NEXTGEN_GALLERY_BASIC_THUMBNAILS, $params);
+
+        if (isset($params['id']))
+        {
+            $params['container_ids'] = $this->_get_param('id', NULL, $params);
+        }
+
+        unset($params['max']);
+        unset($params['id']);
+
+		$renderer = $this->get_registry()->get_utility('I_Displayed_Gallery_Renderer');
+        return $renderer->display_images($params, $inner_content);
+	}
+
+	function render_thumb_shortcode($params, $inner_content=NULL)
+	{
+		$params['entity_ids']   = $this->_get_param('id', NULL, $params);
+        $params['source']       = $this->_get_param('source', 'galleries', $params);
+        $params['display_type'] = $this->_get_param('display_type', NEXTGEN_GALLERY_BASIC_THUMBNAILS, $params);
+        unset($params['id']);
+
+        $renderer = $this->get_registry()->get_utility('I_Displayed_Gallery_Renderer');
+        return $renderer->display_images($params, $inner_content);
+	}
+    
+	function render_slideshow($params, $inner_content=NULL)
+	{
+		$params['gallery_ids']    = $this->_get_param('id', NULL, $params);
+        $params['display_type']   = $this->_get_param('display_type', NEXTGEN_GALLERY_BASIC_SLIDESHOW, $params);
+        $params['gallery_width']  = $this->_get_param('w', NULL, $params);
+        $params['gallery_height'] = $this->_get_param('h', NULL, $params);
+        unset($params['id'], $params['w'], $params['h']);
+
+		$renderer = $this->get_registry()->get_utility('I_Displayed_Gallery_Renderer');
+        return $renderer->display_images($params, $inner_content);
+	}    
+}
+
+new M_NextGen_Basic_Gallery;
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/imagerotator.swf b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/imagerotator.swf
new file mode 100644
index 0000000000000000000000000000000000000000..6c2d76f32a78e6cec140b53bddf336cd987bcdc4
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/imagerotator.swf differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/jquery.cycle.all.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/jquery.cycle.all.js
new file mode 100644
index 0000000000000000000000000000000000000000..44c50173549ea7dec0c4186d8b2571bba2804ce5
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/jquery.cycle.all.js
@@ -0,0 +1,1548 @@
+/*!
+ * jQuery Cycle Plugin (with Transition Definitions)
+ * Examples and documentation at: http://jquery.malsup.com/cycle/
+ * Copyright (c) 2007-2010 M. Alsup
+ * Version: 2.9999.6 (11-SEP-2012)
+ * Dual licensed under the MIT and GPL licenses.
+ * http://jquery.malsup.com/license.html
+ * Requires: jQuery v1.3.2 or later
+ */
+;(function($, undefined) {
+"use strict";
+
+var ver = '2.9999.6';
+
+// if $.support is not defined (pre jQuery 1.3) add what I need
+if ($.support === undefined) {
+	$.support = {
+		opacity: !($.browser.msie)
+	};
+}
+
+function debug(s) {
+	if ($.fn.cycle.debug)
+		log(s);
+}		
+function log() {
+	if (window.console && console.log)
+		console.log('[cycle] ' + Array.prototype.join.call(arguments,' '));
+}
+$.expr[':'].paused = function(el) {
+	return el.cyclePause;
+};
+
+
+// the options arg can be...
+//   a number  - indicates an immediate transition should occur to the given slide index
+//   a string  - 'pause', 'resume', 'toggle', 'next', 'prev', 'stop', 'destroy' or the name of a transition effect (ie, 'fade', 'zoom', etc)
+//   an object - properties to control the slideshow
+//
+// the arg2 arg can be...
+//   the name of an fx (only used in conjunction with a numeric value for 'options')
+//   the value true (only used in first arg == 'resume') and indicates
+//	 that the resume should occur immediately (not wait for next timeout)
+
+$.fn.cycle = function(options, arg2) {
+	var o = { s: this.selector, c: this.context };
+
+	// in 1.3+ we can fix mistakes with the ready state
+	if (this.length === 0 && options != 'stop') {
+		if (!$.isReady && o.s) {
+			log('DOM not ready, queuing slideshow');
+			$(function() {
+				$(o.s,o.c).cycle(options,arg2);
+			});
+			return this;
+		}
+		// is your DOM ready?  http://docs.jquery.com/Tutorials:Introducing_$(document).ready()
+		log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)'));
+		return this;
+	}
+
+	// iterate the matched nodeset
+	return this.each(function() {
+		var opts = handleArguments(this, options, arg2);
+		if (opts === false)
+			return;
+
+		opts.updateActivePagerLink = opts.updateActivePagerLink || $.fn.cycle.updateActivePagerLink;
+		
+		// stop existing slideshow for this container (if there is one)
+		if (this.cycleTimeout)
+			clearTimeout(this.cycleTimeout);
+		this.cycleTimeout = this.cyclePause = 0;
+		this.cycleStop = 0; // issue #108
+
+		var $cont = $(this);
+		var $slides = opts.slideExpr ? $(opts.slideExpr, this) : $cont.children();
+		var els = $slides.get();
+
+		if (els.length < 2) {
+			log('terminating; too few slides: ' + els.length);
+			return;
+		}
+
+		var opts2 = buildOptions($cont, $slides, els, opts, o);
+		if (opts2 === false)
+			return;
+
+		var startTime = opts2.continuous ? 10 : getTimeout(els[opts2.currSlide], els[opts2.nextSlide], opts2, !opts2.backwards);
+
+		// if it's an auto slideshow, kick it off
+		if (startTime) {
+			startTime += (opts2.delay || 0);
+			if (startTime < 10)
+				startTime = 10;
+			debug('first timeout: ' + startTime);
+			this.cycleTimeout = setTimeout(function(){go(els,opts2,0,!opts.backwards);}, startTime);
+		}
+	});
+};
+
+function triggerPause(cont, byHover, onPager) {
+	var opts = $(cont).data('cycle.opts');
+	var paused = !!cont.cyclePause;
+	if (paused && opts.paused)
+		opts.paused(cont, opts, byHover, onPager);
+	else if (!paused && opts.resumed)
+		opts.resumed(cont, opts, byHover, onPager);
+}
+
+// process the args that were passed to the plugin fn
+function handleArguments(cont, options, arg2) {
+	if (cont.cycleStop === undefined)
+		cont.cycleStop = 0;
+	if (options === undefined || options === null)
+		options = {};
+	if (options.constructor == String) {
+		switch(options) {
+		case 'destroy':
+		case 'stop':
+			var opts = $(cont).data('cycle.opts');
+			if (!opts)
+				return false;
+			cont.cycleStop++; // callbacks look for change
+			if (cont.cycleTimeout)
+				clearTimeout(cont.cycleTimeout);
+			cont.cycleTimeout = 0;
+			if (opts.elements)
+				$(opts.elements).stop();
+			$(cont).removeData('cycle.opts');
+			if (options == 'destroy')
+				destroy(cont, opts);
+			return false;
+		case 'toggle':
+			cont.cyclePause = (cont.cyclePause === 1) ? 0 : 1;
+			checkInstantResume(cont.cyclePause, arg2, cont);
+			triggerPause(cont);
+			return false;
+		case 'pause':
+			cont.cyclePause = 1;
+			triggerPause(cont);
+			return false;
+		case 'resume':
+			cont.cyclePause = 0;
+			checkInstantResume(false, arg2, cont);
+			triggerPause(cont);
+			return false;
+		case 'prev':
+		case 'next':
+			opts = $(cont).data('cycle.opts');
+			if (!opts) {
+				log('options not found, "prev/next" ignored');
+				return false;
+			}
+			$.fn.cycle[options](opts);
+			return false;
+		default:
+			options = { fx: options };
+		}
+		return options;
+	}
+	else if (options.constructor == Number) {
+		// go to the requested slide
+		var num = options;
+		options = $(cont).data('cycle.opts');
+		if (!options) {
+			log('options not found, can not advance slide');
+			return false;
+		}
+		if (num < 0 || num >= options.elements.length) {
+			log('invalid slide index: ' + num);
+			return false;
+		}
+		options.nextSlide = num;
+		if (cont.cycleTimeout) {
+			clearTimeout(cont.cycleTimeout);
+			cont.cycleTimeout = 0;
+		}
+		if (typeof arg2 == 'string')
+			options.oneTimeFx = arg2;
+		go(options.elements, options, 1, num >= options.currSlide);
+		return false;
+	}
+	return options;
+	
+	function checkInstantResume(isPaused, arg2, cont) {
+		if (!isPaused && arg2 === true) { // resume now!
+			var options = $(cont).data('cycle.opts');
+			if (!options) {
+				log('options not found, can not resume');
+				return false;
+			}
+			if (cont.cycleTimeout) {
+				clearTimeout(cont.cycleTimeout);
+				cont.cycleTimeout = 0;
+			}
+			go(options.elements, options, 1, !options.backwards);
+		}
+	}
+}
+
+function removeFilter(el, opts) {
+	if (!$.support.opacity && opts.cleartype && el.style.filter) {
+		try { el.style.removeAttribute('filter'); }
+		catch(smother) {} // handle old opera versions
+	}
+}
+
+// unbind event handlers
+function destroy(cont, opts) {
+	if (opts.next)
+		$(opts.next).unbind(opts.prevNextEvent);
+	if (opts.prev)
+		$(opts.prev).unbind(opts.prevNextEvent);
+	
+	if (opts.pager || opts.pagerAnchorBuilder)
+		$.each(opts.pagerAnchors || [], function() {
+			this.unbind().remove();
+		});
+	opts.pagerAnchors = null;
+	$(cont).unbind('mouseenter.cycle mouseleave.cycle');
+	if (opts.destroy) // callback
+		opts.destroy(opts);
+}
+
+// one-time initialization
+function buildOptions($cont, $slides, els, options, o) {
+	var startingSlideSpecified;
+	// support metadata plugin (v1.0 and v2.0)
+	var opts = $.extend({}, $.fn.cycle.defaults, options || {}, $.metadata ? $cont.metadata() : $.meta ? $cont.data() : {});
+	var meta = $.isFunction($cont.data) ? $cont.data(opts.metaAttr) : null;
+	if (meta)
+		opts = $.extend(opts, meta);
+	if (opts.autostop)
+		opts.countdown = opts.autostopCount || els.length;
+
+	var cont = $cont[0];
+	$cont.data('cycle.opts', opts);
+	opts.$cont = $cont;
+	opts.stopCount = cont.cycleStop;
+	opts.elements = els;
+	opts.before = opts.before ? [opts.before] : [];
+	opts.after = opts.after ? [opts.after] : [];
+
+	// push some after callbacks
+	if (!$.support.opacity && opts.cleartype)
+		opts.after.push(function() { removeFilter(this, opts); });
+	if (opts.continuous)
+		opts.after.push(function() { go(els,opts,0,!opts.backwards); });
+
+	saveOriginalOpts(opts);
+
+	// clearType corrections
+	if (!$.support.opacity && opts.cleartype && !opts.cleartypeNoBg)
+		clearTypeFix($slides);
+
+	// container requires non-static position so that slides can be position within
+	if ($cont.css('position') == 'static')
+		$cont.css('position', 'relative');
+	if (opts.width)
+		$cont.width(opts.width);
+	if (opts.height && opts.height != 'auto')
+		$cont.height(opts.height);
+
+	if (opts.startingSlide !== undefined) {
+		opts.startingSlide = parseInt(opts.startingSlide,10);
+		if (opts.startingSlide >= els.length || opts.startSlide < 0)
+			opts.startingSlide = 0; // catch bogus input
+		else 
+			startingSlideSpecified = true;
+	}
+	else if (opts.backwards)
+		opts.startingSlide = els.length - 1;
+	else
+		opts.startingSlide = 0;
+
+	// if random, mix up the slide array
+	if (opts.random) {
+		opts.randomMap = [];
+		for (var i = 0; i < els.length; i++)
+			opts.randomMap.push(i);
+		opts.randomMap.sort(function(a,b) {return Math.random() - 0.5;});
+		if (startingSlideSpecified) {
+			// try to find the specified starting slide and if found set start slide index in the map accordingly
+			for ( var cnt = 0; cnt < els.length; cnt++ ) {
+				if ( opts.startingSlide == opts.randomMap[cnt] ) {
+					opts.randomIndex = cnt;
+				}
+			}
+		}
+		else {
+			opts.randomIndex = 1;
+			opts.startingSlide = opts.randomMap[1];
+		}
+	}
+	else if (opts.startingSlide >= els.length)
+		opts.startingSlide = 0; // catch bogus input
+	opts.currSlide = opts.startingSlide || 0;
+	var first = opts.startingSlide;
+
+	// set position and zIndex on all the slides
+	$slides.css({position: 'absolute', top:0, left:0}).hide().each(function(i) {
+		var z;
+		if (opts.backwards)
+			z = first ? i <= first ? els.length + (i-first) : first-i : els.length-i;
+		else
+			z = first ? i >= first ? els.length - (i-first) : first-i : els.length-i;
+		$(this).css('z-index', z);
+	});
+
+	// make sure first slide is visible
+	$(els[first]).css('opacity',1).show(); // opacity bit needed to handle restart use case
+	removeFilter(els[first], opts);
+
+	// stretch slides
+	if (opts.fit) {
+		if (!opts.aspect) {
+	        if (opts.width)
+	            $slides.width(opts.width);
+	        if (opts.height && opts.height != 'auto')
+	            $slides.height(opts.height);
+		} else {
+			$slides.each(function(){
+				var $slide = $(this);
+				var ratio = (opts.aspect === true) ? $slide.width()/$slide.height() : opts.aspect;
+				if( opts.width && $slide.width() != opts.width ) {
+					$slide.width( opts.width );
+					$slide.height( opts.width / ratio );
+				}
+
+				if( opts.height && $slide.height() < opts.height ) {
+					$slide.height( opts.height );
+					$slide.width( opts.height * ratio );
+				}
+			});
+		}
+	}
+
+	if (opts.center && ((!opts.fit) || opts.aspect)) {
+		$slides.each(function(){
+			var $slide = $(this);
+			$slide.css({
+				"margin-left": opts.width ?
+					((opts.width - $slide.width()) / 2) + "px" :
+					0,
+				"margin-top": opts.height ?
+					((opts.height - $slide.height()) / 2) + "px" :
+					0
+			});
+		});
+	}
+
+	if (opts.center && !opts.fit && !opts.slideResize) {
+		$slides.each(function(){
+			var $slide = $(this);
+			$slide.css({
+				"margin-left": opts.width ? ((opts.width - $slide.width()) / 2) + "px" : 0,
+				"margin-top": opts.height ? ((opts.height - $slide.height()) / 2) + "px" : 0
+			});
+		});
+	}
+		
+	// stretch container
+	var reshape = (opts.containerResize || opts.containerResizeHeight) && !$cont.innerHeight();
+	if (reshape) { // do this only if container has no size http://tinyurl.com/da2oa9
+		var maxw = 0, maxh = 0;
+		for(var j=0; j < els.length; j++) {
+			var $e = $(els[j]), e = $e[0], w = $e.outerWidth(), h = $e.outerHeight();
+			if (!w) w = e.offsetWidth || e.width || $e.attr('width');
+			if (!h) h = e.offsetHeight || e.height || $e.attr('height');
+			maxw = w > maxw ? w : maxw;
+			maxh = h > maxh ? h : maxh;
+		}
+		if (opts.containerResize && maxw > 0 && maxh > 0)
+			$cont.css({width:maxw+'px',height:maxh+'px'});
+		if (opts.containerResizeHeight && maxh > 0)
+			$cont.css({height:maxh+'px'});
+	}
+
+	var pauseFlag = false;  // https://github.com/malsup/cycle/issues/44
+	if (opts.pause)
+		$cont.bind('mouseenter.cycle', function(){
+			pauseFlag = true;
+			this.cyclePause++;
+			triggerPause(cont, true);
+		}).bind('mouseleave.cycle', function(){
+				if (pauseFlag)
+					this.cyclePause--;
+				triggerPause(cont, true);
+		});
+
+	if (supportMultiTransitions(opts) === false)
+		return false;
+
+	// apparently a lot of people use image slideshows without height/width attributes on the images.
+	// Cycle 2.50+ requires the sizing info for every slide; this block tries to deal with that.
+	var requeue = false;
+	options.requeueAttempts = options.requeueAttempts || 0;
+	$slides.each(function() {
+		// try to get height/width of each slide
+		var $el = $(this);
+		this.cycleH = (opts.fit && opts.height) ? opts.height : ($el.height() || this.offsetHeight || this.height || $el.attr('height') || 0);
+		this.cycleW = (opts.fit && opts.width) ? opts.width : ($el.width() || this.offsetWidth || this.width || $el.attr('width') || 0);
+
+		if ( $el.is('img') ) {
+			// sigh..  sniffing, hacking, shrugging...  this crappy hack tries to account for what browsers do when
+			// an image is being downloaded and the markup did not include sizing info (height/width attributes);
+			// there seems to be some "default" sizes used in this situation
+			var loadingIE	= ($.browser.msie  && this.cycleW == 28 && this.cycleH == 30 && !this.complete);
+			var loadingFF	= ($.browser.mozilla && this.cycleW == 34 && this.cycleH == 19 && !this.complete);
+			var loadingOp	= ($.browser.opera && ((this.cycleW == 42 && this.cycleH == 19) || (this.cycleW == 37 && this.cycleH == 17)) && !this.complete);
+			var loadingOther = (this.cycleH === 0 && this.cycleW === 0 && !this.complete);
+			// don't requeue for images that are still loading but have a valid size
+			if (loadingIE || loadingFF || loadingOp || loadingOther) {
+				if (o.s && opts.requeueOnImageNotLoaded && ++options.requeueAttempts < 100) { // track retry count so we don't loop forever
+					log(options.requeueAttempts,' - img slide not loaded, requeuing slideshow: ', this.src, this.cycleW, this.cycleH);
+					setTimeout(function() {$(o.s,o.c).cycle(options);}, opts.requeueTimeout);
+					requeue = true;
+					return false; // break each loop
+				}
+				else {
+					log('could not determine size of image: '+this.src, this.cycleW, this.cycleH);
+				}
+			}
+		}
+		return true;
+	});
+
+	if (requeue)
+		return false;
+
+	opts.cssBefore = opts.cssBefore || {};
+	opts.cssAfter = opts.cssAfter || {};
+	opts.cssFirst = opts.cssFirst || {};
+	opts.animIn = opts.animIn || {};
+	opts.animOut = opts.animOut || {};
+
+	$slides.not(':eq('+first+')').css(opts.cssBefore);
+	$($slides[first]).css(opts.cssFirst);
+
+	if (opts.timeout) {
+		opts.timeout = parseInt(opts.timeout,10);
+		// ensure that timeout and speed settings are sane
+		if (opts.speed.constructor == String)
+			opts.speed = $.fx.speeds[opts.speed] || parseInt(opts.speed,10);
+		if (!opts.sync)
+			opts.speed = opts.speed / 2;
+		
+		var buffer = opts.fx == 'none' ? 0 : opts.fx == 'shuffle' ? 500 : 250;
+		while((opts.timeout - opts.speed) < buffer) // sanitize timeout
+			opts.timeout += opts.speed;
+	}
+	if (opts.easing)
+		opts.easeIn = opts.easeOut = opts.easing;
+	if (!opts.speedIn)
+		opts.speedIn = opts.speed;
+	if (!opts.speedOut)
+		opts.speedOut = opts.speed;
+
+	opts.slideCount = els.length;
+	opts.currSlide = opts.lastSlide = first;
+	if (opts.random) {
+		if (++opts.randomIndex == els.length)
+			opts.randomIndex = 0;
+		opts.nextSlide = opts.randomMap[opts.randomIndex];
+	}
+	else if (opts.backwards)
+		opts.nextSlide = opts.startingSlide === 0 ? (els.length-1) : opts.startingSlide-1;
+	else
+		opts.nextSlide = opts.startingSlide >= (els.length-1) ? 0 : opts.startingSlide+1;
+
+	// run transition init fn
+	if (!opts.multiFx) {
+		var init = $.fn.cycle.transitions[opts.fx];
+		if ($.isFunction(init))
+			init($cont, $slides, opts);
+		else if (opts.fx != 'custom' && !opts.multiFx) {
+			log('unknown transition: ' + opts.fx,'; slideshow terminating');
+			return false;
+		}
+	}
+
+	// fire artificial events
+	var e0 = $slides[first];
+	if (!opts.skipInitializationCallbacks) {
+		if (opts.before.length)
+			opts.before[0].apply(e0, [e0, e0, opts, true]);
+		if (opts.after.length)
+			opts.after[0].apply(e0, [e0, e0, opts, true]);
+	}
+	if (opts.next)
+		$(opts.next).bind(opts.prevNextEvent,function(){return advance(opts,1);});
+	if (opts.prev)
+		$(opts.prev).bind(opts.prevNextEvent,function(){return advance(opts,0);});
+	if (opts.pager || opts.pagerAnchorBuilder)
+		buildPager(els,opts);
+
+	exposeAddSlide(opts, els);
+
+	return opts;
+}
+
+// save off original opts so we can restore after clearing state
+function saveOriginalOpts(opts) {
+	opts.original = { before: [], after: [] };
+	opts.original.cssBefore = $.extend({}, opts.cssBefore);
+	opts.original.cssAfter  = $.extend({}, opts.cssAfter);
+	opts.original.animIn	= $.extend({}, opts.animIn);
+	opts.original.animOut   = $.extend({}, opts.animOut);
+	$.each(opts.before, function() { opts.original.before.push(this); });
+	$.each(opts.after,  function() { opts.original.after.push(this); });
+}
+
+function supportMultiTransitions(opts) {
+	var i, tx, txs = $.fn.cycle.transitions;
+	// look for multiple effects
+	if (opts.fx.indexOf(',') > 0) {
+		opts.multiFx = true;
+		opts.fxs = opts.fx.replace(/\s*/g,'').split(',');
+		// discard any bogus effect names
+		for (i=0; i < opts.fxs.length; i++) {
+			var fx = opts.fxs[i];
+			tx = txs[fx];
+			if (!tx || !txs.hasOwnProperty(fx) || !$.isFunction(tx)) {
+				log('discarding unknown transition: ',fx);
+				opts.fxs.splice(i,1);
+				i--;
+			}
+		}
+		// if we have an empty list then we threw everything away!
+		if (!opts.fxs.length) {
+			log('No valid transitions named; slideshow terminating.');
+			return false;
+		}
+	}
+	else if (opts.fx == 'all') {  // auto-gen the list of transitions
+		opts.multiFx = true;
+		opts.fxs = [];
+		for (var p in txs) {
+			if (txs.hasOwnProperty(p)) {
+				tx = txs[p];
+				if (txs.hasOwnProperty(p) && $.isFunction(tx))
+					opts.fxs.push(p);
+			}
+		}
+	}
+	if (opts.multiFx && opts.randomizeEffects) {
+		// munge the fxs array to make effect selection random
+		var r1 = Math.floor(Math.random() * 20) + 30;
+		for (i = 0; i < r1; i++) {
+			var r2 = Math.floor(Math.random() * opts.fxs.length);
+			opts.fxs.push(opts.fxs.splice(r2,1)[0]);
+		}
+		debug('randomized fx sequence: ',opts.fxs);
+	}
+	return true;
+}
+
+// provide a mechanism for adding slides after the slideshow has started
+function exposeAddSlide(opts, els) {
+	opts.addSlide = function(newSlide, prepend) {
+		var $s = $(newSlide), s = $s[0];
+		if (!opts.autostopCount)
+			opts.countdown++;
+		els[prepend?'unshift':'push'](s);
+		if (opts.els)
+			opts.els[prepend?'unshift':'push'](s); // shuffle needs this
+		opts.slideCount = els.length;
+
+		// add the slide to the random map and resort
+		if (opts.random) {
+			opts.randomMap.push(opts.slideCount-1);
+			opts.randomMap.sort(function(a,b) {return Math.random() - 0.5;});
+		}
+
+		$s.css('position','absolute');
+		$s[prepend?'prependTo':'appendTo'](opts.$cont);
+
+		if (prepend) {
+			opts.currSlide++;
+			opts.nextSlide++;
+		}
+
+		if (!$.support.opacity && opts.cleartype && !opts.cleartypeNoBg)
+			clearTypeFix($s);
+
+		if (opts.fit && opts.width)
+			$s.width(opts.width);
+		if (opts.fit && opts.height && opts.height != 'auto')
+			$s.height(opts.height);
+		s.cycleH = (opts.fit && opts.height) ? opts.height : $s.height();
+		s.cycleW = (opts.fit && opts.width) ? opts.width : $s.width();
+
+		$s.css(opts.cssBefore);
+
+		if (opts.pager || opts.pagerAnchorBuilder)
+			$.fn.cycle.createPagerAnchor(els.length-1, s, $(opts.pager), els, opts);
+
+		if ($.isFunction(opts.onAddSlide))
+			opts.onAddSlide($s);
+		else
+			$s.hide(); // default behavior
+	};
+}
+
+// reset internal state; we do this on every pass in order to support multiple effects
+$.fn.cycle.resetState = function(opts, fx) {
+	fx = fx || opts.fx;
+	opts.before = []; opts.after = [];
+	opts.cssBefore = $.extend({}, opts.original.cssBefore);
+	opts.cssAfter  = $.extend({}, opts.original.cssAfter);
+	opts.animIn	= $.extend({}, opts.original.animIn);
+	opts.animOut   = $.extend({}, opts.original.animOut);
+	opts.fxFn = null;
+	$.each(opts.original.before, function() { opts.before.push(this); });
+	$.each(opts.original.after,  function() { opts.after.push(this); });
+
+	// re-init
+	var init = $.fn.cycle.transitions[fx];
+	if ($.isFunction(init))
+		init(opts.$cont, $(opts.elements), opts);
+};
+
+// this is the main engine fn, it handles the timeouts, callbacks and slide index mgmt
+function go(els, opts, manual, fwd) {
+	var p = opts.$cont[0], curr = els[opts.currSlide], next = els[opts.nextSlide];
+
+	// opts.busy is true if we're in the middle of an animation
+	if (manual && opts.busy && opts.manualTrump) {
+		// let manual transitions requests trump active ones
+		debug('manualTrump in go(), stopping active transition');
+		$(els).stop(true,true);
+		opts.busy = 0;
+		clearTimeout(p.cycleTimeout);
+	}
+
+	// don't begin another timeout-based transition if there is one active
+	if (opts.busy) {
+		debug('transition active, ignoring new tx request');
+		return;
+	}
+
+
+	// stop cycling if we have an outstanding stop request
+	if (p.cycleStop != opts.stopCount || p.cycleTimeout === 0 && !manual)
+		return;
+
+	// check to see if we should stop cycling based on autostop options
+	if (!manual && !p.cyclePause && !opts.bounce &&
+		((opts.autostop && (--opts.countdown <= 0)) ||
+		(opts.nowrap && !opts.random && opts.nextSlide < opts.currSlide))) {
+		if (opts.end)
+			opts.end(opts);
+		return;
+	}
+
+	// if slideshow is paused, only transition on a manual trigger
+	var changed = false;
+	if ((manual || !p.cyclePause) && (opts.nextSlide != opts.currSlide)) {
+		changed = true;
+		var fx = opts.fx;
+		// keep trying to get the slide size if we don't have it yet
+		curr.cycleH = curr.cycleH || $(curr).height();
+		curr.cycleW = curr.cycleW || $(curr).width();
+		next.cycleH = next.cycleH || $(next).height();
+		next.cycleW = next.cycleW || $(next).width();
+
+		// support multiple transition types
+		if (opts.multiFx) {
+			if (fwd && (opts.lastFx === undefined || ++opts.lastFx >= opts.fxs.length))
+				opts.lastFx = 0;
+			else if (!fwd && (opts.lastFx === undefined || --opts.lastFx < 0))
+				opts.lastFx = opts.fxs.length - 1;
+			fx = opts.fxs[opts.lastFx];
+		}
+
+		// one-time fx overrides apply to:  $('div').cycle(3,'zoom');
+		if (opts.oneTimeFx) {
+			fx = opts.oneTimeFx;
+			opts.oneTimeFx = null;
+		}
+
+		$.fn.cycle.resetState(opts, fx);
+
+		// run the before callbacks
+		if (opts.before.length)
+			$.each(opts.before, function(i,o) {
+				if (p.cycleStop != opts.stopCount) return;
+				o.apply(next, [curr, next, opts, fwd]);
+			});
+
+		// stage the after callacks
+		var after = function() {
+			opts.busy = 0;
+			$.each(opts.after, function(i,o) {
+				if (p.cycleStop != opts.stopCount) return;
+				o.apply(next, [curr, next, opts, fwd]);
+			});
+			if (!p.cycleStop) {
+				// queue next transition
+				queueNext();
+			}
+		};
+
+		debug('tx firing('+fx+'); currSlide: ' + opts.currSlide + '; nextSlide: ' + opts.nextSlide);
+		
+		// get ready to perform the transition
+		opts.busy = 1;
+		if (opts.fxFn) // fx function provided?
+			opts.fxFn(curr, next, opts, after, fwd, manual && opts.fastOnEvent);
+		else if ($.isFunction($.fn.cycle[opts.fx])) // fx plugin ?
+			$.fn.cycle[opts.fx](curr, next, opts, after, fwd, manual && opts.fastOnEvent);
+		else
+			$.fn.cycle.custom(curr, next, opts, after, fwd, manual && opts.fastOnEvent);
+	}
+	else {
+		queueNext();
+	}
+
+	if (changed || opts.nextSlide == opts.currSlide) {
+		// calculate the next slide
+		var roll;
+		opts.lastSlide = opts.currSlide;
+		if (opts.random) {
+			opts.currSlide = opts.nextSlide;
+			if (++opts.randomIndex == els.length) {
+				opts.randomIndex = 0;
+				opts.randomMap.sort(function(a,b) {return Math.random() - 0.5;});
+			}
+			opts.nextSlide = opts.randomMap[opts.randomIndex];
+			if (opts.nextSlide == opts.currSlide)
+				opts.nextSlide = (opts.currSlide == opts.slideCount - 1) ? 0 : opts.currSlide + 1;
+		}
+		else if (opts.backwards) {
+			roll = (opts.nextSlide - 1) < 0;
+			if (roll && opts.bounce) {
+				opts.backwards = !opts.backwards;
+				opts.nextSlide = 1;
+				opts.currSlide = 0;
+			}
+			else {
+				opts.nextSlide = roll ? (els.length-1) : opts.nextSlide-1;
+				opts.currSlide = roll ? 0 : opts.nextSlide+1;
+			}
+		}
+		else { // sequence
+			roll = (opts.nextSlide + 1) == els.length;
+			if (roll && opts.bounce) {
+				opts.backwards = !opts.backwards;
+				opts.nextSlide = els.length-2;
+				opts.currSlide = els.length-1;
+			}
+			else {
+				opts.nextSlide = roll ? 0 : opts.nextSlide+1;
+				opts.currSlide = roll ? els.length-1 : opts.nextSlide-1;
+			}
+		}
+	}
+	if (changed && opts.pager)
+		opts.updateActivePagerLink(opts.pager, opts.currSlide, opts.activePagerClass);
+	
+	function queueNext() {
+		// stage the next transition
+		var ms = 0, timeout = opts.timeout;
+		if (opts.timeout && !opts.continuous) {
+			ms = getTimeout(els[opts.currSlide], els[opts.nextSlide], opts, fwd);
+         if (opts.fx == 'shuffle')
+            ms -= opts.speedOut;
+      }
+		else if (opts.continuous && p.cyclePause) // continuous shows work off an after callback, not this timer logic
+			ms = 10;
+		if (ms > 0)
+			p.cycleTimeout = setTimeout(function(){ go(els, opts, 0, !opts.backwards); }, ms);
+	}
+}
+
+// invoked after transition
+$.fn.cycle.updateActivePagerLink = function(pager, currSlide, clsName) {
+   $(pager).each(function() {
+       $(this).children().removeClass(clsName).eq(currSlide).addClass(clsName);
+   });
+};
+
+// calculate timeout value for current transition
+function getTimeout(curr, next, opts, fwd) {
+	if (opts.timeoutFn) {
+		// call user provided calc fn
+		var t = opts.timeoutFn.call(curr,curr,next,opts,fwd);
+		while (opts.fx != 'none' && (t - opts.speed) < 250) // sanitize timeout
+			t += opts.speed;
+		debug('calculated timeout: ' + t + '; speed: ' + opts.speed);
+		if (t !== false)
+			return t;
+	}
+	return opts.timeout;
+}
+
+// expose next/prev function, caller must pass in state
+$.fn.cycle.next = function(opts) { advance(opts,1); };
+$.fn.cycle.prev = function(opts) { advance(opts,0);};
+
+// advance slide forward or back
+function advance(opts, moveForward) {
+	var val = moveForward ? 1 : -1;
+	var els = opts.elements;
+	var p = opts.$cont[0], timeout = p.cycleTimeout;
+	if (timeout) {
+		clearTimeout(timeout);
+		p.cycleTimeout = 0;
+	}
+	if (opts.random && val < 0) {
+		// move back to the previously display slide
+		opts.randomIndex--;
+		if (--opts.randomIndex == -2)
+			opts.randomIndex = els.length-2;
+		else if (opts.randomIndex == -1)
+			opts.randomIndex = els.length-1;
+		opts.nextSlide = opts.randomMap[opts.randomIndex];
+	}
+	else if (opts.random) {
+		opts.nextSlide = opts.randomMap[opts.randomIndex];
+	}
+	else {
+		opts.nextSlide = opts.currSlide + val;
+		if (opts.nextSlide < 0) {
+			if (opts.nowrap) return false;
+			opts.nextSlide = els.length - 1;
+		}
+		else if (opts.nextSlide >= els.length) {
+			if (opts.nowrap) return false;
+			opts.nextSlide = 0;
+		}
+	}
+
+	var cb = opts.onPrevNextEvent || opts.prevNextClick; // prevNextClick is deprecated
+	if ($.isFunction(cb))
+		cb(val > 0, opts.nextSlide, els[opts.nextSlide]);
+	go(els, opts, 1, moveForward);
+	return false;
+}
+
+function buildPager(els, opts) {
+	var $p = $(opts.pager);
+	$.each(els, function(i,o) {
+		$.fn.cycle.createPagerAnchor(i,o,$p,els,opts);
+	});
+	opts.updateActivePagerLink(opts.pager, opts.startingSlide, opts.activePagerClass);
+}
+
+$.fn.cycle.createPagerAnchor = function(i, el, $p, els, opts) {
+	var a;
+	if ($.isFunction(opts.pagerAnchorBuilder)) {
+		a = opts.pagerAnchorBuilder(i,el);
+		debug('pagerAnchorBuilder('+i+', el) returned: ' + a);
+	}
+	else
+		a = '<a href="#">'+(i+1)+'</a>';
+		
+	if (!a)
+		return;
+	var $a = $(a);
+	// don't reparent if anchor is in the dom
+	if ($a.parents('body').length === 0) {
+		var arr = [];
+		if ($p.length > 1) {
+			$p.each(function() {
+				var $clone = $a.clone(true);
+				$(this).append($clone);
+				arr.push($clone[0]);
+			});
+			$a = $(arr);
+		}
+		else {
+			$a.appendTo($p);
+		}
+	}
+
+	opts.pagerAnchors =  opts.pagerAnchors || [];
+	opts.pagerAnchors.push($a);
+	
+	var pagerFn = function(e) {
+		e.preventDefault();
+		opts.nextSlide = i;
+		var p = opts.$cont[0], timeout = p.cycleTimeout;
+		if (timeout) {
+			clearTimeout(timeout);
+			p.cycleTimeout = 0;
+		}
+		var cb = opts.onPagerEvent || opts.pagerClick; // pagerClick is deprecated
+		if ($.isFunction(cb))
+			cb(opts.nextSlide, els[opts.nextSlide]);
+		go(els,opts,1,opts.currSlide < i); // trigger the trans
+//		return false; // <== allow bubble
+	};
+	
+	if ( /mouseenter|mouseover/i.test(opts.pagerEvent) ) {
+		$a.hover(pagerFn, function(){/* no-op */} );
+	}
+	else {
+		$a.bind(opts.pagerEvent, pagerFn);
+	}
+	
+	if ( ! /^click/.test(opts.pagerEvent) && !opts.allowPagerClickBubble)
+		$a.bind('click.cycle', function(){return false;}); // suppress click
+	
+	var cont = opts.$cont[0];
+	var pauseFlag = false; // https://github.com/malsup/cycle/issues/44
+	if (opts.pauseOnPagerHover) {
+		$a.hover(
+			function() { 
+				pauseFlag = true;
+				cont.cyclePause++; 
+				triggerPause(cont,true,true);
+			}, function() { 
+				if (pauseFlag)
+					cont.cyclePause--; 
+				triggerPause(cont,true,true);
+			} 
+		);
+	}
+};
+
+// helper fn to calculate the number of slides between the current and the next
+$.fn.cycle.hopsFromLast = function(opts, fwd) {
+	var hops, l = opts.lastSlide, c = opts.currSlide;
+	if (fwd)
+		hops = c > l ? c - l : opts.slideCount - l;
+	else
+		hops = c < l ? l - c : l + opts.slideCount - c;
+	return hops;
+};
+
+// fix clearType problems in ie6 by setting an explicit bg color
+// (otherwise text slides look horrible during a fade transition)
+function clearTypeFix($slides) {
+	debug('applying clearType background-color hack');
+	function hex(s) {
+		s = parseInt(s,10).toString(16);
+		return s.length < 2 ? '0'+s : s;
+	}
+	function getBg(e) {
+		for ( ; e && e.nodeName.toLowerCase() != 'html'; e = e.parentNode) {
+			var v = $.css(e,'background-color');
+			if (v && v.indexOf('rgb') >= 0 ) {
+				var rgb = v.match(/\d+/g);
+				return '#'+ hex(rgb[0]) + hex(rgb[1]) + hex(rgb[2]);
+			}
+			if (v && v != 'transparent')
+				return v;
+		}
+		return '#ffffff';
+	}
+	$slides.each(function() { $(this).css('background-color', getBg(this)); });
+}
+
+// reset common props before the next transition
+$.fn.cycle.commonReset = function(curr,next,opts,w,h,rev) {
+	$(opts.elements).not(curr).hide();
+	if (typeof opts.cssBefore.opacity == 'undefined')
+		opts.cssBefore.opacity = 1;
+	opts.cssBefore.display = 'block';
+	if (opts.slideResize && w !== false && next.cycleW > 0)
+		opts.cssBefore.width = next.cycleW;
+	if (opts.slideResize && h !== false && next.cycleH > 0)
+		opts.cssBefore.height = next.cycleH;
+	opts.cssAfter = opts.cssAfter || {};
+	opts.cssAfter.display = 'none';
+	$(curr).css('zIndex',opts.slideCount + (rev === true ? 1 : 0));
+	$(next).css('zIndex',opts.slideCount + (rev === true ? 0 : 1));
+};
+
+// the actual fn for effecting a transition
+$.fn.cycle.custom = function(curr, next, opts, cb, fwd, speedOverride) {
+	var $l = $(curr), $n = $(next);
+	var speedIn = opts.speedIn, speedOut = opts.speedOut, easeIn = opts.easeIn, easeOut = opts.easeOut;
+	$n.css(opts.cssBefore);
+	if (speedOverride) {
+		if (typeof speedOverride == 'number')
+			speedIn = speedOut = speedOverride;
+		else
+			speedIn = speedOut = 1;
+		easeIn = easeOut = null;
+	}
+	var fn = function() {
+		$n.animate(opts.animIn, speedIn, easeIn, function() {
+			cb();
+		});
+	};
+	$l.animate(opts.animOut, speedOut, easeOut, function() {
+		$l.css(opts.cssAfter);
+		if (!opts.sync) 
+			fn();
+	});
+	if (opts.sync) fn();
+};
+
+// transition definitions - only fade is defined here, transition pack defines the rest
+$.fn.cycle.transitions = {
+	fade: function($cont, $slides, opts) {
+		$slides.not(':eq('+opts.currSlide+')').css('opacity',0);
+		opts.before.push(function(curr,next,opts) {
+			$.fn.cycle.commonReset(curr,next,opts);
+			opts.cssBefore.opacity = 0;
+		});
+		opts.animIn	   = { opacity: 1 };
+		opts.animOut   = { opacity: 0 };
+		opts.cssBefore = { top: 0, left: 0 };
+	}
+};
+
+$.fn.cycle.ver = function() { return ver; };
+
+// override these globally if you like (they are all optional)
+$.fn.cycle.defaults = {
+    activePagerClass: 'activeSlide', // class name used for the active pager link
+    after:            null,     // transition callback (scope set to element that was shown):  function(currSlideElement, nextSlideElement, options, forwardFlag)
+    allowPagerClickBubble: false, // allows or prevents click event on pager anchors from bubbling
+    animIn:           null,     // properties that define how the slide animates in
+    animOut:          null,     // properties that define how the slide animates out
+    aspect:           false,    // preserve aspect ratio during fit resizing, cropping if necessary (must be used with fit option)
+    autostop:         0,        // true to end slideshow after X transitions (where X == slide count)
+    autostopCount:    0,        // number of transitions (optionally used with autostop to define X)
+    backwards:        false,    // true to start slideshow at last slide and move backwards through the stack
+    before:           null,     // transition callback (scope set to element to be shown):     function(currSlideElement, nextSlideElement, options, forwardFlag)
+    center:           null,     // set to true to have cycle add top/left margin to each slide (use with width and height options)
+    cleartype:        !$.support.opacity,  // true if clearType corrections should be applied (for IE)
+    cleartypeNoBg:    false,    // set to true to disable extra cleartype fixing (leave false to force background color setting on slides)
+    containerResize:  1,        // resize container to fit largest slide
+    containerResizeHeight:  0,  // resize containers height to fit the largest slide but leave the width dynamic
+    continuous:       0,        // true to start next transition immediately after current one completes
+    cssAfter:         null,     // properties that defined the state of the slide after transitioning out
+    cssBefore:        null,     // properties that define the initial state of the slide before transitioning in
+    delay:            0,        // additional delay (in ms) for first transition (hint: can be negative)
+    easeIn:           null,     // easing for "in" transition
+    easeOut:          null,     // easing for "out" transition
+    easing:           null,     // easing method for both in and out transitions
+    end:              null,     // callback invoked when the slideshow terminates (use with autostop or nowrap options): function(options)
+    fastOnEvent:      0,        // force fast transitions when triggered manually (via pager or prev/next); value == time in ms
+    fit:              0,        // force slides to fit container
+    fx:               'fade',   // name of transition effect (or comma separated names, ex: 'fade,scrollUp,shuffle')
+    fxFn:             null,     // function used to control the transition: function(currSlideElement, nextSlideElement, options, afterCalback, forwardFlag)
+    height:           'auto',   // container height (if the 'fit' option is true, the slides will be set to this height as well)
+    manualTrump:      true,     // causes manual transition to stop an active transition instead of being ignored
+    metaAttr:         'cycle',  // data- attribute that holds the option data for the slideshow
+    next:             null,     // element, jQuery object, or jQuery selector string for the element to use as event trigger for next slide
+    nowrap:           0,        // true to prevent slideshow from wrapping
+    onPagerEvent:     null,     // callback fn for pager events: function(zeroBasedSlideIndex, slideElement)
+    onPrevNextEvent:  null,     // callback fn for prev/next events: function(isNext, zeroBasedSlideIndex, slideElement)
+    pager:            null,     // element, jQuery object, or jQuery selector string for the element to use as pager container
+    pagerAnchorBuilder: null,   // callback fn for building anchor links:  function(index, DOMelement)
+    pagerEvent:       'click.cycle', // name of event which drives the pager navigation
+    pause:            0,        // true to enable "pause on hover"
+    pauseOnPagerHover: 0,       // true to pause when hovering over pager link
+    prev:             null,     // element, jQuery object, or jQuery selector string for the element to use as event trigger for previous slide
+    prevNextEvent:    'click.cycle',// event which drives the manual transition to the previous or next slide
+    random:           0,        // true for random, false for sequence (not applicable to shuffle fx)
+    randomizeEffects: 1,        // valid when multiple effects are used; true to make the effect sequence random
+    requeueOnImageNotLoaded: true, // requeue the slideshow if any image slides are not yet loaded
+    requeueTimeout:   250,      // ms delay for requeue
+    rev:              0,        // causes animations to transition in reverse (for effects that support it such as scrollHorz/scrollVert/shuffle)
+    shuffle:          null,     // coords for shuffle animation, ex: { top:15, left: 200 }
+    skipInitializationCallbacks: false, // set to true to disable the first before/after callback that occurs prior to any transition
+    slideExpr:        null,     // expression for selecting slides (if something other than all children is required)
+    slideResize:      1,        // force slide width/height to fixed size before every transition
+    speed:            1000,     // speed of the transition (any valid fx speed value)
+    speedIn:          null,     // speed of the 'in' transition
+    speedOut:         null,     // speed of the 'out' transition
+    startingSlide:    undefined,// zero-based index of the first slide to be displayed
+    sync:             1,        // true if in/out transitions should occur simultaneously
+    timeout:          4000,     // milliseconds between slide transitions (0 to disable auto advance)
+    timeoutFn:        null,     // callback for determining per-slide timeout value:  function(currSlideElement, nextSlideElement, options, forwardFlag)
+    updateActivePagerLink: null,// callback fn invoked to update the active pager link (adds/removes activePagerClass style)
+    width:            null      // container width (if the 'fit' option is true, the slides will be set to this width as well)
+};
+
+})(jQuery);
+
+
+/*!
+ * jQuery Cycle Plugin Transition Definitions
+ * This script is a plugin for the jQuery Cycle Plugin
+ * Examples and documentation at: http://malsup.com/jquery/cycle/
+ * Copyright (c) 2007-2010 M. Alsup
+ * Version:	 2.73
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ */
+(function($) {
+"use strict";
+
+//
+// These functions define slide initialization and properties for the named
+// transitions. To save file size feel free to remove any of these that you
+// don't need.
+//
+$.fn.cycle.transitions.none = function($cont, $slides, opts) {
+	opts.fxFn = function(curr,next,opts,after){
+		$(next).show();
+		$(curr).hide();
+		after();
+	};
+};
+
+// not a cross-fade, fadeout only fades out the top slide
+$.fn.cycle.transitions.fadeout = function($cont, $slides, opts) {
+	$slides.not(':eq('+opts.currSlide+')').css({ display: 'block', 'opacity': 1 });
+	opts.before.push(function(curr,next,opts,w,h,rev) {
+		$(curr).css('zIndex',opts.slideCount + (rev !== true ? 1 : 0));
+		$(next).css('zIndex',opts.slideCount + (rev !== true ? 0 : 1));
+	});
+	opts.animIn.opacity = 1;
+	opts.animOut.opacity = 0;
+	opts.cssBefore.opacity = 1;
+	opts.cssBefore.display = 'block';
+	opts.cssAfter.zIndex = 0;
+};
+
+// scrollUp/Down/Left/Right
+$.fn.cycle.transitions.scrollUp = function($cont, $slides, opts) {
+	$cont.css('overflow','hidden');
+	opts.before.push($.fn.cycle.commonReset);
+	var h = $cont.height();
+	opts.cssBefore.top = h;
+	opts.cssBefore.left = 0;
+	opts.cssFirst.top = 0;
+	opts.animIn.top = 0;
+	opts.animOut.top = -h;
+};
+$.fn.cycle.transitions.scrollDown = function($cont, $slides, opts) {
+	$cont.css('overflow','hidden');
+	opts.before.push($.fn.cycle.commonReset);
+	var h = $cont.height();
+	opts.cssFirst.top = 0;
+	opts.cssBefore.top = -h;
+	opts.cssBefore.left = 0;
+	opts.animIn.top = 0;
+	opts.animOut.top = h;
+};
+$.fn.cycle.transitions.scrollLeft = function($cont, $slides, opts) {
+	$cont.css('overflow','hidden');
+	opts.before.push($.fn.cycle.commonReset);
+	var w = $cont.width();
+	opts.cssFirst.left = 0;
+	opts.cssBefore.left = w;
+	opts.cssBefore.top = 0;
+	opts.animIn.left = 0;
+	opts.animOut.left = 0-w;
+};
+$.fn.cycle.transitions.scrollRight = function($cont, $slides, opts) {
+	$cont.css('overflow','hidden');
+	opts.before.push($.fn.cycle.commonReset);
+	var w = $cont.width();
+	opts.cssFirst.left = 0;
+	opts.cssBefore.left = -w;
+	opts.cssBefore.top = 0;
+	opts.animIn.left = 0;
+	opts.animOut.left = w;
+};
+$.fn.cycle.transitions.scrollHorz = function($cont, $slides, opts) {
+	$cont.css('overflow','hidden').width();
+	opts.before.push(function(curr, next, opts, fwd) {
+		if (opts.rev)
+			fwd = !fwd;
+		$.fn.cycle.commonReset(curr,next,opts);
+		opts.cssBefore.left = fwd ? (next.cycleW-1) : (1-next.cycleW);
+		opts.animOut.left = fwd ? -curr.cycleW : curr.cycleW;
+	});
+	opts.cssFirst.left = 0;
+	opts.cssBefore.top = 0;
+	opts.animIn.left = 0;
+	opts.animOut.top = 0;
+};
+$.fn.cycle.transitions.scrollVert = function($cont, $slides, opts) {
+	$cont.css('overflow','hidden');
+	opts.before.push(function(curr, next, opts, fwd) {
+		if (opts.rev)
+			fwd = !fwd;
+		$.fn.cycle.commonReset(curr,next,opts);
+		opts.cssBefore.top = fwd ? (1-next.cycleH) : (next.cycleH-1);
+		opts.animOut.top = fwd ? curr.cycleH : -curr.cycleH;
+	});
+	opts.cssFirst.top = 0;
+	opts.cssBefore.left = 0;
+	opts.animIn.top = 0;
+	opts.animOut.left = 0;
+};
+
+// slideX/slideY
+$.fn.cycle.transitions.slideX = function($cont, $slides, opts) {
+	opts.before.push(function(curr, next, opts) {
+		$(opts.elements).not(curr).hide();
+		$.fn.cycle.commonReset(curr,next,opts,false,true);
+		opts.animIn.width = next.cycleW;
+	});
+	opts.cssBefore.left = 0;
+	opts.cssBefore.top = 0;
+	opts.cssBefore.width = 0;
+	opts.animIn.width = 'show';
+	opts.animOut.width = 0;
+};
+$.fn.cycle.transitions.slideY = function($cont, $slides, opts) {
+	opts.before.push(function(curr, next, opts) {
+		$(opts.elements).not(curr).hide();
+		$.fn.cycle.commonReset(curr,next,opts,true,false);
+		opts.animIn.height = next.cycleH;
+	});
+	opts.cssBefore.left = 0;
+	opts.cssBefore.top = 0;
+	opts.cssBefore.height = 0;
+	opts.animIn.height = 'show';
+	opts.animOut.height = 0;
+};
+
+// shuffle
+$.fn.cycle.transitions.shuffle = function($cont, $slides, opts) {
+	var i, w = $cont.css('overflow', 'visible').width();
+	$slides.css({left: 0, top: 0});
+	opts.before.push(function(curr,next,opts) {
+		$.fn.cycle.commonReset(curr,next,opts,true,true,true);
+	});
+	// only adjust speed once!
+	if (!opts.speedAdjusted) {
+		opts.speed = opts.speed / 2; // shuffle has 2 transitions
+		opts.speedAdjusted = true;
+	}
+	opts.random = 0;
+	opts.shuffle = opts.shuffle || {left:-w, top:15};
+	opts.els = [];
+	for (i=0; i < $slides.length; i++)
+		opts.els.push($slides[i]);
+
+	for (i=0; i < opts.currSlide; i++)
+		opts.els.push(opts.els.shift());
+
+	// custom transition fn (hat tip to Benjamin Sterling for this bit of sweetness!)
+	opts.fxFn = function(curr, next, opts, cb, fwd) {
+		if (opts.rev)
+			fwd = !fwd;
+		var $el = fwd ? $(curr) : $(next);
+		$(next).css(opts.cssBefore);
+		var count = opts.slideCount;
+		$el.animate(opts.shuffle, opts.speedIn, opts.easeIn, function() {
+			var hops = $.fn.cycle.hopsFromLast(opts, fwd);
+			for (var k=0; k < hops; k++) {
+				if (fwd)
+					opts.els.push(opts.els.shift());
+				else
+					opts.els.unshift(opts.els.pop());
+			}
+			if (fwd) {
+				for (var i=0, len=opts.els.length; i < len; i++)
+					$(opts.els[i]).css('z-index', len-i+count);
+			}
+			else {
+				var z = $(curr).css('z-index');
+				$el.css('z-index', parseInt(z,10)+1+count);
+			}
+			$el.animate({left:0, top:0}, opts.speedOut, opts.easeOut, function() {
+				$(fwd ? this : curr).hide();
+				if (cb) cb();
+			});
+		});
+	};
+	$.extend(opts.cssBefore, { display: 'block', opacity: 1, top: 0, left: 0 });
+};
+
+// turnUp/Down/Left/Right
+$.fn.cycle.transitions.turnUp = function($cont, $slides, opts) {
+	opts.before.push(function(curr, next, opts) {
+		$.fn.cycle.commonReset(curr,next,opts,true,false);
+		opts.cssBefore.top = next.cycleH;
+		opts.animIn.height = next.cycleH;
+		opts.animOut.width = next.cycleW;
+	});
+	opts.cssFirst.top = 0;
+	opts.cssBefore.left = 0;
+	opts.cssBefore.height = 0;
+	opts.animIn.top = 0;
+	opts.animOut.height = 0;
+};
+$.fn.cycle.transitions.turnDown = function($cont, $slides, opts) {
+	opts.before.push(function(curr, next, opts) {
+		$.fn.cycle.commonReset(curr,next,opts,true,false);
+		opts.animIn.height = next.cycleH;
+		opts.animOut.top   = curr.cycleH;
+	});
+	opts.cssFirst.top = 0;
+	opts.cssBefore.left = 0;
+	opts.cssBefore.top = 0;
+	opts.cssBefore.height = 0;
+	opts.animOut.height = 0;
+};
+$.fn.cycle.transitions.turnLeft = function($cont, $slides, opts) {
+	opts.before.push(function(curr, next, opts) {
+		$.fn.cycle.commonReset(curr,next,opts,false,true);
+		opts.cssBefore.left = next.cycleW;
+		opts.animIn.width = next.cycleW;
+	});
+	opts.cssBefore.top = 0;
+	opts.cssBefore.width = 0;
+	opts.animIn.left = 0;
+	opts.animOut.width = 0;
+};
+$.fn.cycle.transitions.turnRight = function($cont, $slides, opts) {
+	opts.before.push(function(curr, next, opts) {
+		$.fn.cycle.commonReset(curr,next,opts,false,true);
+		opts.animIn.width = next.cycleW;
+		opts.animOut.left = curr.cycleW;
+	});
+	$.extend(opts.cssBefore, { top: 0, left: 0, width: 0 });
+	opts.animIn.left = 0;
+	opts.animOut.width = 0;
+};
+
+// zoom
+$.fn.cycle.transitions.zoom = function($cont, $slides, opts) {
+	opts.before.push(function(curr, next, opts) {
+		$.fn.cycle.commonReset(curr,next,opts,false,false,true);
+		opts.cssBefore.top = next.cycleH/2;
+		opts.cssBefore.left = next.cycleW/2;
+		$.extend(opts.animIn, { top: 0, left: 0, width: next.cycleW, height: next.cycleH });
+		$.extend(opts.animOut, { width: 0, height: 0, top: curr.cycleH/2, left: curr.cycleW/2 });
+	});
+	opts.cssFirst.top = 0;
+	opts.cssFirst.left = 0;
+	opts.cssBefore.width = 0;
+	opts.cssBefore.height = 0;
+};
+
+// fadeZoom
+$.fn.cycle.transitions.fadeZoom = function($cont, $slides, opts) {
+	opts.before.push(function(curr, next, opts) {
+		$.fn.cycle.commonReset(curr,next,opts,false,false);
+		opts.cssBefore.left = next.cycleW/2;
+		opts.cssBefore.top = next.cycleH/2;
+		$.extend(opts.animIn, { top: 0, left: 0, width: next.cycleW, height: next.cycleH });
+	});
+	opts.cssBefore.width = 0;
+	opts.cssBefore.height = 0;
+	opts.animOut.opacity = 0;
+};
+
+// blindX
+$.fn.cycle.transitions.blindX = function($cont, $slides, opts) {
+	var w = $cont.css('overflow','hidden').width();
+	opts.before.push(function(curr, next, opts) {
+		$.fn.cycle.commonReset(curr,next,opts);
+		opts.animIn.width = next.cycleW;
+		opts.animOut.left   = curr.cycleW;
+	});
+	opts.cssBefore.left = w;
+	opts.cssBefore.top = 0;
+	opts.animIn.left = 0;
+	opts.animOut.left = w;
+};
+// blindY
+$.fn.cycle.transitions.blindY = function($cont, $slides, opts) {
+	var h = $cont.css('overflow','hidden').height();
+	opts.before.push(function(curr, next, opts) {
+		$.fn.cycle.commonReset(curr,next,opts);
+		opts.animIn.height = next.cycleH;
+		opts.animOut.top   = curr.cycleH;
+	});
+	opts.cssBefore.top = h;
+	opts.cssBefore.left = 0;
+	opts.animIn.top = 0;
+	opts.animOut.top = h;
+};
+// blindZ
+$.fn.cycle.transitions.blindZ = function($cont, $slides, opts) {
+	var h = $cont.css('overflow','hidden').height();
+	var w = $cont.width();
+	opts.before.push(function(curr, next, opts) {
+		$.fn.cycle.commonReset(curr,next,opts);
+		opts.animIn.height = next.cycleH;
+		opts.animOut.top   = curr.cycleH;
+	});
+	opts.cssBefore.top = h;
+	opts.cssBefore.left = w;
+	opts.animIn.top = 0;
+	opts.animIn.left = 0;
+	opts.animOut.top = h;
+	opts.animOut.left = w;
+};
+
+// growX - grow horizontally from centered 0 width
+$.fn.cycle.transitions.growX = function($cont, $slides, opts) {
+	opts.before.push(function(curr, next, opts) {
+		$.fn.cycle.commonReset(curr,next,opts,false,true);
+		opts.cssBefore.left = this.cycleW/2;
+		opts.animIn.left = 0;
+		opts.animIn.width = this.cycleW;
+		opts.animOut.left = 0;
+	});
+	opts.cssBefore.top = 0;
+	opts.cssBefore.width = 0;
+};
+// growY - grow vertically from centered 0 height
+$.fn.cycle.transitions.growY = function($cont, $slides, opts) {
+	opts.before.push(function(curr, next, opts) {
+		$.fn.cycle.commonReset(curr,next,opts,true,false);
+		opts.cssBefore.top = this.cycleH/2;
+		opts.animIn.top = 0;
+		opts.animIn.height = this.cycleH;
+		opts.animOut.top = 0;
+	});
+	opts.cssBefore.height = 0;
+	opts.cssBefore.left = 0;
+};
+
+// curtainX - squeeze in both edges horizontally
+$.fn.cycle.transitions.curtainX = function($cont, $slides, opts) {
+	opts.before.push(function(curr, next, opts) {
+		$.fn.cycle.commonReset(curr,next,opts,false,true,true);
+		opts.cssBefore.left = next.cycleW/2;
+		opts.animIn.left = 0;
+		opts.animIn.width = this.cycleW;
+		opts.animOut.left = curr.cycleW/2;
+		opts.animOut.width = 0;
+	});
+	opts.cssBefore.top = 0;
+	opts.cssBefore.width = 0;
+};
+// curtainY - squeeze in both edges vertically
+$.fn.cycle.transitions.curtainY = function($cont, $slides, opts) {
+	opts.before.push(function(curr, next, opts) {
+		$.fn.cycle.commonReset(curr,next,opts,true,false,true);
+		opts.cssBefore.top = next.cycleH/2;
+		opts.animIn.top = 0;
+		opts.animIn.height = next.cycleH;
+		opts.animOut.top = curr.cycleH/2;
+		opts.animOut.height = 0;
+	});
+	opts.cssBefore.height = 0;
+	opts.cssBefore.left = 0;
+};
+
+// cover - curr slide covered by next slide
+$.fn.cycle.transitions.cover = function($cont, $slides, opts) {
+	var d = opts.direction || 'left';
+	var w = $cont.css('overflow','hidden').width();
+	var h = $cont.height();
+	opts.before.push(function(curr, next, opts) {
+		$.fn.cycle.commonReset(curr,next,opts);
+		if (d == 'right')
+			opts.cssBefore.left = -w;
+		else if (d == 'up')
+			opts.cssBefore.top = h;
+		else if (d == 'down')
+			opts.cssBefore.top = -h;
+		else
+			opts.cssBefore.left = w;
+	});
+	opts.animIn.left = 0;
+	opts.animIn.top = 0;
+	opts.cssBefore.top = 0;
+	opts.cssBefore.left = 0;
+};
+
+// uncover - curr slide moves off next slide
+$.fn.cycle.transitions.uncover = function($cont, $slides, opts) {
+	var d = opts.direction || 'left';
+	var w = $cont.css('overflow','hidden').width();
+	var h = $cont.height();
+	opts.before.push(function(curr, next, opts) {
+		$.fn.cycle.commonReset(curr,next,opts,true,true,true);
+		if (d == 'right')
+			opts.animOut.left = w;
+		else if (d == 'up')
+			opts.animOut.top = -h;
+		else if (d == 'down')
+			opts.animOut.top = h;
+		else
+			opts.animOut.left = -w;
+	});
+	opts.animIn.left = 0;
+	opts.animIn.top = 0;
+	opts.cssBefore.top = 0;
+	opts.cssBefore.left = 0;
+};
+
+// toss - move top slide and fade away
+$.fn.cycle.transitions.toss = function($cont, $slides, opts) {
+	var w = $cont.css('overflow','visible').width();
+	var h = $cont.height();
+	opts.before.push(function(curr, next, opts) {
+		$.fn.cycle.commonReset(curr,next,opts,true,true,true);
+		// provide default toss settings if animOut not provided
+		if (!opts.animOut.left && !opts.animOut.top)
+			$.extend(opts.animOut, { left: w*2, top: -h/2, opacity: 0 });
+		else
+			opts.animOut.opacity = 0;
+	});
+	opts.cssBefore.left = 0;
+	opts.cssBefore.top = 0;
+	opts.animIn.left = 0;
+};
+
+// wipe - clip animation
+$.fn.cycle.transitions.wipe = function($cont, $slides, opts) {
+	var w = $cont.css('overflow','hidden').width();
+	var h = $cont.height();
+	opts.cssBefore = opts.cssBefore || {};
+	var clip;
+	if (opts.clip) {
+		if (/l2r/.test(opts.clip))
+			clip = 'rect(0px 0px '+h+'px 0px)';
+		else if (/r2l/.test(opts.clip))
+			clip = 'rect(0px '+w+'px '+h+'px '+w+'px)';
+		else if (/t2b/.test(opts.clip))
+			clip = 'rect(0px '+w+'px 0px 0px)';
+		else if (/b2t/.test(opts.clip))
+			clip = 'rect('+h+'px '+w+'px '+h+'px 0px)';
+		else if (/zoom/.test(opts.clip)) {
+			var top = parseInt(h/2,10);
+			var left = parseInt(w/2,10);
+			clip = 'rect('+top+'px '+left+'px '+top+'px '+left+'px)';
+		}
+	}
+
+	opts.cssBefore.clip = opts.cssBefore.clip || clip || 'rect(0px 0px 0px 0px)';
+
+	var d = opts.cssBefore.clip.match(/(\d+)/g);
+	var t = parseInt(d[0],10), r = parseInt(d[1],10), b = parseInt(d[2],10), l = parseInt(d[3],10);
+
+	opts.before.push(function(curr, next, opts) {
+		if (curr == next) return;
+		var $curr = $(curr), $next = $(next);
+		$.fn.cycle.commonReset(curr,next,opts,true,true,false);
+		opts.cssAfter.display = 'block';
+
+		var step = 1, count = parseInt((opts.speedIn / 13),10) - 1;
+		(function f() {
+			var tt = t ? t - parseInt(step * (t/count),10) : 0;
+			var ll = l ? l - parseInt(step * (l/count),10) : 0;
+			var bb = b < h ? b + parseInt(step * ((h-b)/count || 1),10) : h;
+			var rr = r < w ? r + parseInt(step * ((w-r)/count || 1),10) : w;
+			$next.css({ clip: 'rect('+tt+'px '+rr+'px '+bb+'px '+ll+'px)' });
+			(step++ <= count) ? setTimeout(f, 13) : $curr.css('display', 'none');
+		})();
+	});
+	$.extend(opts.cssBefore, { display: 'block', opacity: 1, top: 0, left: 0 });
+	opts.animIn	   = { left: 0 };
+	opts.animOut   = { left: 0 };
+};
+
+})(jQuery);
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/jquery.cycle.all.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/jquery.cycle.all.min.js
new file mode 100644
index 0000000000000000000000000000000000000000..57f08336eaeaa08e5ef78f5251e16959f6e2cf00
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/jquery.cycle.all.min.js
@@ -0,0 +1,10 @@
+/*!
+ * jQuery Cycle Plugin (with Transition Definitions)
+ * Examples and documentation at: http://jquery.malsup.com/cycle/
+ * Copyright (c) 2007-2010 M. Alsup
+ * Version: 2.9999.6 (11-SEP-2012)
+ * Dual licensed under the MIT and GPL licenses.
+ * http://jquery.malsup.com/license.html
+ * Requires: jQuery v1.3.2 or later
+ */
+(function(a,b){function d(b){if(a.fn.cycle.debug)e(b)}function e(){if(window.console&&console.log)console.log("[cycle] "+Array.prototype.join.call(arguments," "))}function f(b,c,d){var e=a(b).data("cycle.opts");var f=!!b.cyclePause;if(f&&e.paused)e.paused(b,e,c,d);else if(!f&&e.resumed)e.resumed(b,e,c,d)}function g(c,d,g){function k(b,c,d){if(!b&&c===true){var f=a(d).data("cycle.opts");if(!f){e("options not found, can not resume");return false}if(d.cycleTimeout){clearTimeout(d.cycleTimeout);d.cycleTimeout=0}n(f.elements,f,1,!f.backwards)}}if(c.cycleStop===b)c.cycleStop=0;if(d===b||d===null)d={};if(d.constructor==String){switch(d){case"destroy":case"stop":var h=a(c).data("cycle.opts");if(!h)return false;c.cycleStop++;if(c.cycleTimeout)clearTimeout(c.cycleTimeout);c.cycleTimeout=0;if(h.elements)a(h.elements).stop();a(c).removeData("cycle.opts");if(d=="destroy")i(c,h);return false;case"toggle":c.cyclePause=c.cyclePause===1?0:1;k(c.cyclePause,g,c);f(c);return false;case"pause":c.cyclePause=1;f(c);return false;case"resume":c.cyclePause=0;k(false,g,c);f(c);return false;case"prev":case"next":h=a(c).data("cycle.opts");if(!h){e('options not found, "prev/next" ignored');return false}a.fn.cycle[d](h);return false;default:d={fx:d}}return d}else if(d.constructor==Number){var j=d;d=a(c).data("cycle.opts");if(!d){e("options not found, can not advance slide");return false}if(j<0||j>=d.elements.length){e("invalid slide index: "+j);return false}d.nextSlide=j;if(c.cycleTimeout){clearTimeout(c.cycleTimeout);c.cycleTimeout=0}if(typeof g=="string")d.oneTimeFx=g;n(d.elements,d,1,j>=d.currSlide);return false}return d}function h(b,c){if(!a.support.opacity&&c.cleartype&&b.style.filter){try{b.style.removeAttribute("filter")}catch(d){}}}function i(b,c){if(c.next)a(c.next).unbind(c.prevNextEvent);if(c.prev)a(c.prev).unbind(c.prevNextEvent);if(c.pager||c.pagerAnchorBuilder)a.each(c.pagerAnchors||[],function(){this.unbind().remove()});c.pagerAnchors=null;a(b).unbind("mouseenter.cycle mouseleave.cycle");if(c.destroy)c.destroy(c)}function j(c,d,g,i,j){var o;var s=a.extend({},a.fn.cycle.defaults,i||{},a.metadata?c.metadata():a.meta?c.data():{});var t=a.isFunction(c.data)?c.data(s.metaAttr):null;if(t)s=a.extend(s,t);if(s.autostop)s.countdown=s.autostopCount||g.length;var u=c[0];c.data("cycle.opts",s);s.$cont=c;s.stopCount=u.cycleStop;s.elements=g;s.before=s.before?[s.before]:[];s.after=s.after?[s.after]:[];if(!a.support.opacity&&s.cleartype)s.after.push(function(){h(this,s)});if(s.continuous)s.after.push(function(){n(g,s,0,!s.backwards)});k(s);if(!a.support.opacity&&s.cleartype&&!s.cleartypeNoBg)r(d);if(c.css("position")=="static")c.css("position","relative");if(s.width)c.width(s.width);if(s.height&&s.height!="auto")c.height(s.height);if(s.startingSlide!==b){s.startingSlide=parseInt(s.startingSlide,10);if(s.startingSlide>=g.length||s.startSlide<0)s.startingSlide=0;else o=true}else if(s.backwards)s.startingSlide=g.length-1;else s.startingSlide=0;if(s.random){s.randomMap=[];for(var v=0;v<g.length;v++)s.randomMap.push(v);s.randomMap.sort(function(a,b){return Math.random()-.5});if(o){for(var w=0;w<g.length;w++){if(s.startingSlide==s.randomMap[w]){s.randomIndex=w}}}else{s.randomIndex=1;s.startingSlide=s.randomMap[1]}}else if(s.startingSlide>=g.length)s.startingSlide=0;s.currSlide=s.startingSlide||0;var x=s.startingSlide;d.css({position:"absolute",top:0,left:0}).hide().each(function(b){var c;if(s.backwards)c=x?b<=x?g.length+(b-x):x-b:g.length-b;else c=x?b>=x?g.length-(b-x):x-b:g.length-b;a(this).css("z-index",c)});a(g[x]).css("opacity",1).show();h(g[x],s);if(s.fit){if(!s.aspect){if(s.width)d.width(s.width);if(s.height&&s.height!="auto")d.height(s.height)}else{d.each(function(){var b=a(this);var c=s.aspect===true?b.width()/b.height():s.aspect;if(s.width&&b.width()!=s.width){b.width(s.width);b.height(s.width/c)}if(s.height&&b.height()<s.height){b.height(s.height);b.width(s.height*c)}})}}if(s.center&&(!s.fit||s.aspect)){d.each(function(){var b=a(this);b.css({"margin-left":s.width?(s.width-b.width())/2+"px":0,"margin-top":s.height?(s.height-b.height())/2+"px":0})})}if(s.center&&!s.fit&&!s.slideResize){d.each(function(){var b=a(this);b.css({"margin-left":s.width?(s.width-b.width())/2+"px":0,"margin-top":s.height?(s.height-b.height())/2+"px":0})})}var y=(s.containerResize||s.containerResizeHeight)&&!c.innerHeight();if(y){var z=0,A=0;for(var B=0;B<g.length;B++){var C=a(g[B]),D=C[0],E=C.outerWidth(),F=C.outerHeight();if(!E)E=D.offsetWidth||D.width||C.attr("width");if(!F)F=D.offsetHeight||D.height||C.attr("height");z=E>z?E:z;A=F>A?F:A}if(s.containerResize&&z>0&&A>0)c.css({width:z+"px",height:A+"px"});if(s.containerResizeHeight&&A>0)c.css({height:A+"px"})}var G=false;if(s.pause)c.bind("mouseenter.cycle",function(){G=true;this.cyclePause++;f(u,true)}).bind("mouseleave.cycle",function(){if(G)this.cyclePause--;f(u,true)});if(l(s)===false)return false;var H=false;i.requeueAttempts=i.requeueAttempts||0;d.each(function(){var b=a(this);this.cycleH=s.fit&&s.height?s.height:b.height()||this.offsetHeight||this.height||b.attr("height")||0;this.cycleW=s.fit&&s.width?s.width:b.width()||this.offsetWidth||this.width||b.attr("width")||0;if(b.is("img")){var c=a.browser.msie&&this.cycleW==28&&this.cycleH==30&&!this.complete;var d=a.browser.mozilla&&this.cycleW==34&&this.cycleH==19&&!this.complete;var f=a.browser.opera&&(this.cycleW==42&&this.cycleH==19||this.cycleW==37&&this.cycleH==17)&&!this.complete;var g=this.cycleH===0&&this.cycleW===0&&!this.complete;if(c||d||f||g){if(j.s&&s.requeueOnImageNotLoaded&&++i.requeueAttempts<100){e(i.requeueAttempts," - img slide not loaded, requeuing slideshow: ",this.src,this.cycleW,this.cycleH);setTimeout(function(){a(j.s,j.c).cycle(i)},s.requeueTimeout);H=true;return false}else{e("could not determine size of image: "+this.src,this.cycleW,this.cycleH)}}}return true});if(H)return false;s.cssBefore=s.cssBefore||{};s.cssAfter=s.cssAfter||{};s.cssFirst=s.cssFirst||{};s.animIn=s.animIn||{};s.animOut=s.animOut||{};d.not(":eq("+x+")").css(s.cssBefore);a(d[x]).css(s.cssFirst);if(s.timeout){s.timeout=parseInt(s.timeout,10);if(s.speed.constructor==String)s.speed=a.fx.speeds[s.speed]||parseInt(s.speed,10);if(!s.sync)s.speed=s.speed/2;var I=s.fx=="none"?0:s.fx=="shuffle"?500:250;while(s.timeout-s.speed<I)s.timeout+=s.speed}if(s.easing)s.easeIn=s.easeOut=s.easing;if(!s.speedIn)s.speedIn=s.speed;if(!s.speedOut)s.speedOut=s.speed;s.slideCount=g.length;s.currSlide=s.lastSlide=x;if(s.random){if(++s.randomIndex==g.length)s.randomIndex=0;s.nextSlide=s.randomMap[s.randomIndex]}else if(s.backwards)s.nextSlide=s.startingSlide===0?g.length-1:s.startingSlide-1;else s.nextSlide=s.startingSlide>=g.length-1?0:s.startingSlide+1;if(!s.multiFx){var J=a.fn.cycle.transitions[s.fx];if(a.isFunction(J))J(c,d,s);else if(s.fx!="custom"&&!s.multiFx){e("unknown transition: "+s.fx,"; slideshow terminating");return false}}var K=d[x];if(!s.skipInitializationCallbacks){if(s.before.length)s.before[0].apply(K,[K,K,s,true]);if(s.after.length)s.after[0].apply(K,[K,K,s,true])}if(s.next)a(s.next).bind(s.prevNextEvent,function(){return p(s,1)});if(s.prev)a(s.prev).bind(s.prevNextEvent,function(){return p(s,0)});if(s.pager||s.pagerAnchorBuilder)q(g,s);m(s,g);return s}function k(b){b.original={before:[],after:[]};b.original.cssBefore=a.extend({},b.cssBefore);b.original.cssAfter=a.extend({},b.cssAfter);b.original.animIn=a.extend({},b.animIn);b.original.animOut=a.extend({},b.animOut);a.each(b.before,function(){b.original.before.push(this)});a.each(b.after,function(){b.original.after.push(this)})}function l(b){var c,f,g=a.fn.cycle.transitions;if(b.fx.indexOf(",")>0){b.multiFx=true;b.fxs=b.fx.replace(/\s*/g,"").split(",");for(c=0;c<b.fxs.length;c++){var h=b.fxs[c];f=g[h];if(!f||!g.hasOwnProperty(h)||!a.isFunction(f)){e("discarding unknown transition: ",h);b.fxs.splice(c,1);c--}}if(!b.fxs.length){e("No valid transitions named; slideshow terminating.");return false}}else if(b.fx=="all"){b.multiFx=true;b.fxs=[];for(var i in g){if(g.hasOwnProperty(i)){f=g[i];if(g.hasOwnProperty(i)&&a.isFunction(f))b.fxs.push(i)}}}if(b.multiFx&&b.randomizeEffects){var j=Math.floor(Math.random()*20)+30;for(c=0;c<j;c++){var k=Math.floor(Math.random()*b.fxs.length);b.fxs.push(b.fxs.splice(k,1)[0])}d("randomized fx sequence: ",b.fxs)}return true}function m(b,c){b.addSlide=function(d,e){var f=a(d),g=f[0];if(!b.autostopCount)b.countdown++;c[e?"unshift":"push"](g);if(b.els)b.els[e?"unshift":"push"](g);b.slideCount=c.length;if(b.random){b.randomMap.push(b.slideCount-1);b.randomMap.sort(function(a,b){return Math.random()-.5})}f.css("position","absolute");f[e?"prependTo":"appendTo"](b.$cont);if(e){b.currSlide++;b.nextSlide++}if(!a.support.opacity&&b.cleartype&&!b.cleartypeNoBg)r(f);if(b.fit&&b.width)f.width(b.width);if(b.fit&&b.height&&b.height!="auto")f.height(b.height);g.cycleH=b.fit&&b.height?b.height:f.height();g.cycleW=b.fit&&b.width?b.width:f.width();f.css(b.cssBefore);if(b.pager||b.pagerAnchorBuilder)a.fn.cycle.createPagerAnchor(c.length-1,g,a(b.pager),c,b);if(a.isFunction(b.onAddSlide))b.onAddSlide(f);else f.hide()}}function n(c,e,f,g){function q(){var a=0,b=e.timeout;if(e.timeout&&!e.continuous){a=o(c[e.currSlide],c[e.nextSlide],e,g);if(e.fx=="shuffle")a-=e.speedOut}else if(e.continuous&&h.cyclePause)a=10;if(a>0)h.cycleTimeout=setTimeout(function(){n(c,e,0,!e.backwards)},a)}var h=e.$cont[0],i=c[e.currSlide],j=c[e.nextSlide];if(f&&e.busy&&e.manualTrump){d("manualTrump in go(), stopping active transition");a(c).stop(true,true);e.busy=0;clearTimeout(h.cycleTimeout)}if(e.busy){d("transition active, ignoring new tx request");return}if(h.cycleStop!=e.stopCount||h.cycleTimeout===0&&!f)return;if(!f&&!h.cyclePause&&!e.bounce&&(e.autostop&&--e.countdown<=0||e.nowrap&&!e.random&&e.nextSlide<e.currSlide)){if(e.end)e.end(e);return}var k=false;if((f||!h.cyclePause)&&e.nextSlide!=e.currSlide){k=true;var l=e.fx;i.cycleH=i.cycleH||a(i).height();i.cycleW=i.cycleW||a(i).width();j.cycleH=j.cycleH||a(j).height();j.cycleW=j.cycleW||a(j).width();if(e.multiFx){if(g&&(e.lastFx===b||++e.lastFx>=e.fxs.length))e.lastFx=0;else if(!g&&(e.lastFx===b||--e.lastFx<0))e.lastFx=e.fxs.length-1;l=e.fxs[e.lastFx]}if(e.oneTimeFx){l=e.oneTimeFx;e.oneTimeFx=null}a.fn.cycle.resetState(e,l);if(e.before.length)a.each(e.before,function(a,b){if(h.cycleStop!=e.stopCount)return;b.apply(j,[i,j,e,g])});var m=function(){e.busy=0;a.each(e.after,function(a,b){if(h.cycleStop!=e.stopCount)return;b.apply(j,[i,j,e,g])});if(!h.cycleStop){q()}};d("tx firing("+l+"); currSlide: "+e.currSlide+"; nextSlide: "+e.nextSlide);e.busy=1;if(e.fxFn)e.fxFn(i,j,e,m,g,f&&e.fastOnEvent);else if(a.isFunction(a.fn.cycle[e.fx]))a.fn.cycle[e.fx](i,j,e,m,g,f&&e.fastOnEvent);else a.fn.cycle.custom(i,j,e,m,g,f&&e.fastOnEvent)}else{q()}if(k||e.nextSlide==e.currSlide){var p;e.lastSlide=e.currSlide;if(e.random){e.currSlide=e.nextSlide;if(++e.randomIndex==c.length){e.randomIndex=0;e.randomMap.sort(function(a,b){return Math.random()-.5})}e.nextSlide=e.randomMap[e.randomIndex];if(e.nextSlide==e.currSlide)e.nextSlide=e.currSlide==e.slideCount-1?0:e.currSlide+1}else if(e.backwards){p=e.nextSlide-1<0;if(p&&e.bounce){e.backwards=!e.backwards;e.nextSlide=1;e.currSlide=0}else{e.nextSlide=p?c.length-1:e.nextSlide-1;e.currSlide=p?0:e.nextSlide+1}}else{p=e.nextSlide+1==c.length;if(p&&e.bounce){e.backwards=!e.backwards;e.nextSlide=c.length-2;e.currSlide=c.length-1}else{e.nextSlide=p?0:e.nextSlide+1;e.currSlide=p?c.length-1:e.nextSlide-1}}}if(k&&e.pager)e.updateActivePagerLink(e.pager,e.currSlide,e.activePagerClass)}function o(a,b,c,e){if(c.timeoutFn){var f=c.timeoutFn.call(a,a,b,c,e);while(c.fx!="none"&&f-c.speed<250)f+=c.speed;d("calculated timeout: "+f+"; speed: "+c.speed);if(f!==false)return f}return c.timeout}function p(b,c){var d=c?1:-1;var e=b.elements;var f=b.$cont[0],g=f.cycleTimeout;if(g){clearTimeout(g);f.cycleTimeout=0}if(b.random&&d<0){b.randomIndex--;if(--b.randomIndex==-2)b.randomIndex=e.length-2;else if(b.randomIndex==-1)b.randomIndex=e.length-1;b.nextSlide=b.randomMap[b.randomIndex]}else if(b.random){b.nextSlide=b.randomMap[b.randomIndex]}else{b.nextSlide=b.currSlide+d;if(b.nextSlide<0){if(b.nowrap)return false;b.nextSlide=e.length-1}else if(b.nextSlide>=e.length){if(b.nowrap)return false;b.nextSlide=0}}var h=b.onPrevNextEvent||b.prevNextClick;if(a.isFunction(h))h(d>0,b.nextSlide,e[b.nextSlide]);n(e,b,1,c);return false}function q(b,c){var d=a(c.pager);a.each(b,function(e,f){a.fn.cycle.createPagerAnchor(e,f,d,b,c)});c.updateActivePagerLink(c.pager,c.startingSlide,c.activePagerClass)}function r(b){function c(a){a=parseInt(a,10).toString(16);return a.length<2?"0"+a:a}function e(b){for(;b&&b.nodeName.toLowerCase()!="html";b=b.parentNode){var d=a.css(b,"background-color");if(d&&d.indexOf("rgb")>=0){var e=d.match(/\d+/g);return"#"+c(e[0])+c(e[1])+c(e[2])}if(d&&d!="transparent")return d}return"#ffffff"}d("applying clearType background-color hack");b.each(function(){a(this).css("background-color",e(this))})}"use strict";var c="2.9999.6";if(a.support===b){a.support={opacity:!a.browser.msie}}a.expr[":"].paused=function(a){return a.cyclePause};a.fn.cycle=function(b,c){var f={s:this.selector,c:this.context};if(this.length===0&&b!="stop"){if(!a.isReady&&f.s){e("DOM not ready, queuing slideshow");a(function(){a(f.s,f.c).cycle(b,c)});return this}e("terminating; zero elements found by selector"+(a.isReady?"":" (DOM not ready)"));return this}return this.each(function(){var h=g(this,b,c);if(h===false)return;h.updateActivePagerLink=h.updateActivePagerLink||a.fn.cycle.updateActivePagerLink;if(this.cycleTimeout)clearTimeout(this.cycleTimeout);this.cycleTimeout=this.cyclePause=0;this.cycleStop=0;var i=a(this);var k=h.slideExpr?a(h.slideExpr,this):i.children();var l=k.get();if(l.length<2){e("terminating; too few slides: "+l.length);return}var m=j(i,k,l,h,f);if(m===false)return;var p=m.continuous?10:o(l[m.currSlide],l[m.nextSlide],m,!m.backwards);if(p){p+=m.delay||0;if(p<10)p=10;d("first timeout: "+p);this.cycleTimeout=setTimeout(function(){n(l,m,0,!h.backwards)},p)}})};a.fn.cycle.resetState=function(b,c){c=c||b.fx;b.before=[];b.after=[];b.cssBefore=a.extend({},b.original.cssBefore);b.cssAfter=a.extend({},b.original.cssAfter);b.animIn=a.extend({},b.original.animIn);b.animOut=a.extend({},b.original.animOut);b.fxFn=null;a.each(b.original.before,function(){b.before.push(this)});a.each(b.original.after,function(){b.after.push(this)});var d=a.fn.cycle.transitions[c];if(a.isFunction(d))d(b.$cont,a(b.elements),b)};a.fn.cycle.updateActivePagerLink=function(b,c,d){a(b).each(function(){a(this).children().removeClass(d).eq(c).addClass(d)})};a.fn.cycle.next=function(a){p(a,1)};a.fn.cycle.prev=function(a){p(a,0)};a.fn.cycle.createPagerAnchor=function(b,c,e,g,h){var i;if(a.isFunction(h.pagerAnchorBuilder)){i=h.pagerAnchorBuilder(b,c);d("pagerAnchorBuilder("+b+", el) returned: "+i)}else i='<a href="#">'+(b+1)+"</a>";if(!i)return;var j=a(i);if(j.parents("body").length===0){var k=[];if(e.length>1){e.each(function(){var b=j.clone(true);a(this).append(b);k.push(b[0])});j=a(k)}else{j.appendTo(e)}}h.pagerAnchors=h.pagerAnchors||[];h.pagerAnchors.push(j);var l=function(c){c.preventDefault();h.nextSlide=b;var d=h.$cont[0],e=d.cycleTimeout;if(e){clearTimeout(e);d.cycleTimeout=0}var f=h.onPagerEvent||h.pagerClick;if(a.isFunction(f))f(h.nextSlide,g[h.nextSlide]);n(g,h,1,h.currSlide<b)};if(/mouseenter|mouseover/i.test(h.pagerEvent)){j.hover(l,function(){})}else{j.bind(h.pagerEvent,l)}if(!/^click/.test(h.pagerEvent)&&!h.allowPagerClickBubble)j.bind("click.cycle",function(){return false});var m=h.$cont[0];var o=false;if(h.pauseOnPagerHover){j.hover(function(){o=true;m.cyclePause++;f(m,true,true)},function(){if(o)m.cyclePause--;f(m,true,true)})}};a.fn.cycle.hopsFromLast=function(a,b){var c,d=a.lastSlide,e=a.currSlide;if(b)c=e>d?e-d:a.slideCount-d;else c=e<d?d-e:d+a.slideCount-e;return c};a.fn.cycle.commonReset=function(b,c,d,e,f,g){a(d.elements).not(b).hide();if(typeof d.cssBefore.opacity=="undefined")d.cssBefore.opacity=1;d.cssBefore.display="block";if(d.slideResize&&e!==false&&c.cycleW>0)d.cssBefore.width=c.cycleW;if(d.slideResize&&f!==false&&c.cycleH>0)d.cssBefore.height=c.cycleH;d.cssAfter=d.cssAfter||{};d.cssAfter.display="none";a(b).css("zIndex",d.slideCount+(g===true?1:0));a(c).css("zIndex",d.slideCount+(g===true?0:1))};a.fn.cycle.custom=function(b,c,d,e,f,g){var h=a(b),i=a(c);var j=d.speedIn,k=d.speedOut,l=d.easeIn,m=d.easeOut;i.css(d.cssBefore);if(g){if(typeof g=="number")j=k=g;else j=k=1;l=m=null}var n=function(){i.animate(d.animIn,j,l,function(){e()})};h.animate(d.animOut,k,m,function(){h.css(d.cssAfter);if(!d.sync)n()});if(d.sync)n()};a.fn.cycle.transitions={fade:function(b,c,d){c.not(":eq("+d.currSlide+")").css("opacity",0);d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d);d.cssBefore.opacity=0});d.animIn={opacity:1};d.animOut={opacity:0};d.cssBefore={top:0,left:0}}};a.fn.cycle.ver=function(){return c};a.fn.cycle.defaults={activePagerClass:"activeSlide",after:null,allowPagerClickBubble:false,animIn:null,animOut:null,aspect:false,autostop:0,autostopCount:0,backwards:false,before:null,center:null,cleartype:!a.support.opacity,cleartypeNoBg:false,containerResize:1,containerResizeHeight:0,continuous:0,cssAfter:null,cssBefore:null,delay:0,easeIn:null,easeOut:null,easing:null,end:null,fastOnEvent:0,fit:0,fx:"fade",fxFn:null,height:"auto",manualTrump:true,metaAttr:"cycle",next:null,nowrap:0,onPagerEvent:null,onPrevNextEvent:null,pager:null,pagerAnchorBuilder:null,pagerEvent:"click.cycle",pause:0,pauseOnPagerHover:0,prev:null,prevNextEvent:"click.cycle",random:0,randomizeEffects:1,requeueOnImageNotLoaded:true,requeueTimeout:250,rev:0,shuffle:null,skipInitializationCallbacks:false,slideExpr:null,slideResize:1,speed:1e3,speedIn:null,speedOut:null,startingSlide:b,sync:1,timeout:4e3,timeoutFn:null,updateActivePagerLink:null,width:null}})(jQuery);(function(a){"use strict";a.fn.cycle.transitions.none=function(b,c,d){d.fxFn=function(b,c,d,e){a(c).show();a(b).hide();e()}};a.fn.cycle.transitions.fadeout=function(b,c,d){c.not(":eq("+d.currSlide+")").css({display:"block",opacity:1});d.before.push(function(b,c,d,e,f,g){a(b).css("zIndex",d.slideCount+(g!==true?1:0));a(c).css("zIndex",d.slideCount+(g!==true?0:1))});d.animIn.opacity=1;d.animOut.opacity=0;d.cssBefore.opacity=1;d.cssBefore.display="block";d.cssAfter.zIndex=0};a.fn.cycle.transitions.scrollUp=function(b,c,d){b.css("overflow","hidden");d.before.push(a.fn.cycle.commonReset);var e=b.height();d.cssBefore.top=e;d.cssBefore.left=0;d.cssFirst.top=0;d.animIn.top=0;d.animOut.top=-e};a.fn.cycle.transitions.scrollDown=function(b,c,d){b.css("overflow","hidden");d.before.push(a.fn.cycle.commonReset);var e=b.height();d.cssFirst.top=0;d.cssBefore.top=-e;d.cssBefore.left=0;d.animIn.top=0;d.animOut.top=e};a.fn.cycle.transitions.scrollLeft=function(b,c,d){b.css("overflow","hidden");d.before.push(a.fn.cycle.commonReset);var e=b.width();d.cssFirst.left=0;d.cssBefore.left=e;d.cssBefore.top=0;d.animIn.left=0;d.animOut.left=0-e};a.fn.cycle.transitions.scrollRight=function(b,c,d){b.css("overflow","hidden");d.before.push(a.fn.cycle.commonReset);var e=b.width();d.cssFirst.left=0;d.cssBefore.left=-e;d.cssBefore.top=0;d.animIn.left=0;d.animOut.left=e};a.fn.cycle.transitions.scrollHorz=function(b,c,d){b.css("overflow","hidden").width();d.before.push(function(b,c,d,e){if(d.rev)e=!e;a.fn.cycle.commonReset(b,c,d);d.cssBefore.left=e?c.cycleW-1:1-c.cycleW;d.animOut.left=e?-b.cycleW:b.cycleW});d.cssFirst.left=0;d.cssBefore.top=0;d.animIn.left=0;d.animOut.top=0};a.fn.cycle.transitions.scrollVert=function(b,c,d){b.css("overflow","hidden");d.before.push(function(b,c,d,e){if(d.rev)e=!e;a.fn.cycle.commonReset(b,c,d);d.cssBefore.top=e?1-c.cycleH:c.cycleH-1;d.animOut.top=e?b.cycleH:-b.cycleH});d.cssFirst.top=0;d.cssBefore.left=0;d.animIn.top=0;d.animOut.left=0};a.fn.cycle.transitions.slideX=function(b,c,d){d.before.push(function(b,c,d){a(d.elements).not(b).hide();a.fn.cycle.commonReset(b,c,d,false,true);d.animIn.width=c.cycleW});d.cssBefore.left=0;d.cssBefore.top=0;d.cssBefore.width=0;d.animIn.width="show";d.animOut.width=0};a.fn.cycle.transitions.slideY=function(b,c,d){d.before.push(function(b,c,d){a(d.elements).not(b).hide();a.fn.cycle.commonReset(b,c,d,true,false);d.animIn.height=c.cycleH});d.cssBefore.left=0;d.cssBefore.top=0;d.cssBefore.height=0;d.animIn.height="show";d.animOut.height=0};a.fn.cycle.transitions.shuffle=function(b,c,d){var e,f=b.css("overflow","visible").width();c.css({left:0,top:0});d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,true,true,true)});if(!d.speedAdjusted){d.speed=d.speed/2;d.speedAdjusted=true}d.random=0;d.shuffle=d.shuffle||{left:-f,top:15};d.els=[];for(e=0;e<c.length;e++)d.els.push(c[e]);for(e=0;e<d.currSlide;e++)d.els.push(d.els.shift());d.fxFn=function(b,c,d,e,f){if(d.rev)f=!f;var g=f?a(b):a(c);a(c).css(d.cssBefore);var h=d.slideCount;g.animate(d.shuffle,d.speedIn,d.easeIn,function(){var c=a.fn.cycle.hopsFromLast(d,f);for(var i=0;i<c;i++){if(f)d.els.push(d.els.shift());else d.els.unshift(d.els.pop())}if(f){for(var j=0,k=d.els.length;j<k;j++)a(d.els[j]).css("z-index",k-j+h)}else{var l=a(b).css("z-index");g.css("z-index",parseInt(l,10)+1+h)}g.animate({left:0,top:0},d.speedOut,d.easeOut,function(){a(f?this:b).hide();if(e)e()})})};a.extend(d.cssBefore,{display:"block",opacity:1,top:0,left:0})};a.fn.cycle.transitions.turnUp=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,true,false);d.cssBefore.top=c.cycleH;d.animIn.height=c.cycleH;d.animOut.width=c.cycleW});d.cssFirst.top=0;d.cssBefore.left=0;d.cssBefore.height=0;d.animIn.top=0;d.animOut.height=0};a.fn.cycle.transitions.turnDown=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,true,false);d.animIn.height=c.cycleH;d.animOut.top=b.cycleH});d.cssFirst.top=0;d.cssBefore.left=0;d.cssBefore.top=0;d.cssBefore.height=0;d.animOut.height=0};a.fn.cycle.transitions.turnLeft=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,false,true);d.cssBefore.left=c.cycleW;d.animIn.width=c.cycleW});d.cssBefore.top=0;d.cssBefore.width=0;d.animIn.left=0;d.animOut.width=0};a.fn.cycle.transitions.turnRight=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,false,true);d.animIn.width=c.cycleW;d.animOut.left=b.cycleW});a.extend(d.cssBefore,{top:0,left:0,width:0});d.animIn.left=0;d.animOut.width=0};a.fn.cycle.transitions.zoom=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,false,false,true);d.cssBefore.top=c.cycleH/2;d.cssBefore.left=c.cycleW/2;a.extend(d.animIn,{top:0,left:0,width:c.cycleW,height:c.cycleH});a.extend(d.animOut,{width:0,height:0,top:b.cycleH/2,left:b.cycleW/2})});d.cssFirst.top=0;d.cssFirst.left=0;d.cssBefore.width=0;d.cssBefore.height=0};a.fn.cycle.transitions.fadeZoom=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,false,false);d.cssBefore.left=c.cycleW/2;d.cssBefore.top=c.cycleH/2;a.extend(d.animIn,{top:0,left:0,width:c.cycleW,height:c.cycleH})});d.cssBefore.width=0;d.cssBefore.height=0;d.animOut.opacity=0};a.fn.cycle.transitions.blindX=function(b,c,d){var e=b.css("overflow","hidden").width();d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d);d.animIn.width=c.cycleW;d.animOut.left=b.cycleW});d.cssBefore.left=e;d.cssBefore.top=0;d.animIn.left=0;d.animOut.left=e};a.fn.cycle.transitions.blindY=function(b,c,d){var e=b.css("overflow","hidden").height();d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d);d.animIn.height=c.cycleH;d.animOut.top=b.cycleH});d.cssBefore.top=e;d.cssBefore.left=0;d.animIn.top=0;d.animOut.top=e};a.fn.cycle.transitions.blindZ=function(b,c,d){var e=b.css("overflow","hidden").height();var f=b.width();d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d);d.animIn.height=c.cycleH;d.animOut.top=b.cycleH});d.cssBefore.top=e;d.cssBefore.left=f;d.animIn.top=0;d.animIn.left=0;d.animOut.top=e;d.animOut.left=f};a.fn.cycle.transitions.growX=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,false,true);d.cssBefore.left=this.cycleW/2;d.animIn.left=0;d.animIn.width=this.cycleW;d.animOut.left=0});d.cssBefore.top=0;d.cssBefore.width=0};a.fn.cycle.transitions.growY=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,true,false);d.cssBefore.top=this.cycleH/2;d.animIn.top=0;d.animIn.height=this.cycleH;d.animOut.top=0});d.cssBefore.height=0;d.cssBefore.left=0};a.fn.cycle.transitions.curtainX=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,false,true,true);d.cssBefore.left=c.cycleW/2;d.animIn.left=0;d.animIn.width=this.cycleW;d.animOut.left=b.cycleW/2;d.animOut.width=0});d.cssBefore.top=0;d.cssBefore.width=0};a.fn.cycle.transitions.curtainY=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,true,false,true);d.cssBefore.top=c.cycleH/2;d.animIn.top=0;d.animIn.height=c.cycleH;d.animOut.top=b.cycleH/2;d.animOut.height=0});d.cssBefore.height=0;d.cssBefore.left=0};a.fn.cycle.transitions.cover=function(b,c,d){var e=d.direction||"left";var f=b.css("overflow","hidden").width();var g=b.height();d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d);if(e=="right")d.cssBefore.left=-f;else if(e=="up")d.cssBefore.top=g;else if(e=="down")d.cssBefore.top=-g;else d.cssBefore.left=f});d.animIn.left=0;d.animIn.top=0;d.cssBefore.top=0;d.cssBefore.left=0};a.fn.cycle.transitions.uncover=function(b,c,d){var e=d.direction||"left";var f=b.css("overflow","hidden").width();var g=b.height();d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,true,true,true);if(e=="right")d.animOut.left=f;else if(e=="up")d.animOut.top=-g;else if(e=="down")d.animOut.top=g;else d.animOut.left=-f});d.animIn.left=0;d.animIn.top=0;d.cssBefore.top=0;d.cssBefore.left=0};a.fn.cycle.transitions.toss=function(b,c,d){var e=b.css("overflow","visible").width();var f=b.height();d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,true,true,true);if(!d.animOut.left&&!d.animOut.top)a.extend(d.animOut,{left:e*2,top:-f/2,opacity:0});else d.animOut.opacity=0});d.cssBefore.left=0;d.cssBefore.top=0;d.animIn.left=0};a.fn.cycle.transitions.wipe=function(b,c,d){var e=b.css("overflow","hidden").width();var f=b.height();d.cssBefore=d.cssBefore||{};var g;if(d.clip){if(/l2r/.test(d.clip))g="rect(0px 0px "+f+"px 0px)";else if(/r2l/.test(d.clip))g="rect(0px "+e+"px "+f+"px "+e+"px)";else if(/t2b/.test(d.clip))g="rect(0px "+e+"px 0px 0px)";else if(/b2t/.test(d.clip))g="rect("+f+"px "+e+"px "+f+"px 0px)";else if(/zoom/.test(d.clip)){var h=parseInt(f/2,10);var i=parseInt(e/2,10);g="rect("+h+"px "+i+"px "+h+"px "+i+"px)"}}d.cssBefore.clip=d.cssBefore.clip||g||"rect(0px 0px 0px 0px)";var j=d.cssBefore.clip.match(/(\d+)/g);var k=parseInt(j[0],10),l=parseInt(j[1],10),m=parseInt(j[2],10),n=parseInt(j[3],10);d.before.push(function(b,c,d){if(b==c)return;var g=a(b),h=a(c);a.fn.cycle.commonReset(b,c,d,true,true,false);d.cssAfter.display="block";var i=1,j=parseInt(d.speedIn/13,10)-1;(function o(){var a=k?k-parseInt(i*(k/j),10):0;var b=n?n-parseInt(i*(n/j),10):0;var c=m<f?m+parseInt(i*((f-m)/j||1),10):f;var d=l<e?l+parseInt(i*((e-l)/j||1),10):e;h.css({clip:"rect("+a+"px "+d+"px "+c+"px "+b+"px)"});i++<=j?setTimeout(o,13):g.css("display","none")})()});a.extend(d.cssBefore,{display:"block",opacity:1,top:0,left:0});d.animIn={left:0};d.animOut={left:0}}})(jQuery)
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/jquery.waitforimages.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/jquery.waitforimages.js
new file mode 100644
index 0000000000000000000000000000000000000000..36f3259ecfa5e20baf3bfa031822a6364886b1dd
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/jquery.waitforimages.js
@@ -0,0 +1,135 @@
+/*! waitForImages jQuery Plugin - v1.4.1 - 2012-10-12
+* https://github.com/alexanderdickson/waitForImages
+* Copyright (c) 2012 Alex Dickson; Licensed MIT */
+
+(function ($) {
+    // Namespace all events.
+    var eventNamespace = 'waitForImages';
+
+    // CSS properties which contain references to images. 
+    $.waitForImages = {
+        hasImageProperties: ['backgroundImage', 'listStyleImage', 'borderImage', 'borderCornerImage']
+    };
+
+    // Custom selector to find `img` elements that have a valid `src` attribute and have not already loaded.
+    $.expr[':'].uncached = function (obj) {
+        // Ensure we are dealing with an `img` element with a valid `src` attribute.
+        if (!$(obj).is('img[src!=""]')) {
+            return false;
+        }
+
+        // Firefox's `complete` property will always be `true` even if the image has not been downloaded.
+        // Doing it this way works in Firefox.
+        var img = new Image();
+        img.src = obj.src;
+        return !img.complete;
+    };
+
+    $.fn.waitForImages = function (finishedCallback, eachCallback, waitForAll) {
+
+        var allImgsLength = 0;
+        var allImgsLoaded = 0;
+
+        // Handle options object.
+        if ($.isPlainObject(arguments[0])) {
+            finishedCallback = arguments[0].finished;
+            eachCallback = arguments[0].each;
+            waitForAll = arguments[0].waitForAll;
+        }
+
+        // Handle missing callbacks.
+        finishedCallback = finishedCallback || $.noop;
+        eachCallback = eachCallback || $.noop;
+
+        // Convert waitForAll to Boolean
+        waitForAll = !! waitForAll;
+
+        // Ensure callbacks are functions.
+        if (!$.isFunction(finishedCallback) || !$.isFunction(eachCallback)) {
+            throw new TypeError('An invalid callback was supplied.');
+        }
+
+        return this.each(function () {
+            // Build a list of all imgs, dependent on what images will be considered.
+            var obj = $(this);
+            var allImgs = [];
+            // CSS properties which may contain an image.
+            var hasImgProperties = $.waitForImages.hasImageProperties || [];
+            // To match `url()` references.
+            // Spec: http://www.w3.org/TR/CSS2/syndata.html#value-def-uri
+            var matchUrl = /url\(\s*(['"]?)(.*?)\1\s*\)/g;
+
+            if (waitForAll) {
+
+                // Get all elements (including the original), as any one of them could have a background image.
+                obj.find('*').andSelf().each(function () {
+                    var element = $(this);
+
+                    // If an `img` element, add it. But keep iterating in case it has a background image too.
+                    if (element.is('img:uncached')) {
+                        allImgs.push({
+                            src: element.attr('src'),
+                            element: element[0]
+                        });
+                    }
+
+                    $.each(hasImgProperties, function (i, property) {
+                        var propertyValue = element.css(property);
+                        var match;
+
+                        // If it doesn't contain this property, skip.
+                        if (!propertyValue) {
+                            return true;
+                        }
+
+                        // Get all url() of this element.
+                        while (match = matchUrl.exec(propertyValue)) {
+                            allImgs.push({
+                                src: match[2],
+                                element: element[0]
+                            });
+                        }
+                    });
+                });
+            } else {
+                // For images only, the task is simpler.
+                obj.find('img:uncached')
+                    .each(function () {
+                    allImgs.push({
+                        src: this.src,
+                        element: this
+                    });
+                });
+            }
+
+            allImgsLength = allImgs.length;
+            allImgsLoaded = 0;
+
+            // If no images found, don't bother.
+            if (allImgsLength === 0) {
+                finishedCallback.call(obj[0]);
+            }
+
+            $.each(allImgs, function (i, img) {
+
+                var image = new Image();
+
+                // Handle the image loading and error with the same callback.
+                $(image).bind('load.' + eventNamespace + ' error.' + eventNamespace, function (event) {
+                    allImgsLoaded++;
+
+                    // If an error occurred with loading the image, set the third argument accordingly.
+                    eachCallback.call(img.element, allImgsLoaded, allImgsLength, event.type == 'load');
+
+                    if (allImgsLoaded == allImgsLength) {
+                        finishedCallback.call(obj[0]);
+                        return false;
+                    }
+
+                });
+
+                image.src = img.src;
+            });
+        });
+    };
+}(jQuery));
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/nextgen_basic_slideshow.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/nextgen_basic_slideshow.css
new file mode 100644
index 0000000000000000000000000000000000000000..1e5a1d803bc25c13e41895733ca3fafef97a2c5d
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/nextgen_basic_slideshow.css
@@ -0,0 +1,67 @@
+body {
+}
+
+#page {
+    overflow: visible;
+}
+
+/* ----------- Slideshow -------------*/
+
+.slideshow {
+    margin-left: auto;
+    margin-right: auto;
+    text-align: center;
+    outline: none;
+}
+
+.slideshowlink {
+}
+
+/* ----------- JS Slideshow -------------*/
+
+.ngg-slideshow {
+    overflow: hidden;
+    position: relative;
+    margin-left: auto;
+    margin-right: auto;
+    text-align: center;
+    clear: both;
+    z-index: 0;
+}
+
+.ngg-slideshow * {
+    vertical-align: middle;
+}
+
+.ngg-slideshow img {
+	max-width: 100% !important; 
+	max-height: 100%;
+	width: auto;
+	height: auto;
+	border: none;
+}
+
+.ngg-slideshow .ngg-gallery-slideshow-image {
+	position: relative;
+ 	width: 100% !important;
+	height: 100% !important;
+	max-width: 100% !important;
+	max-height: 100% !important;
+}
+
+.ngg-slideshow .image-placeholder {
+	visibility: hidden;
+}
+
+/* See also : http://www.brunildo.org/test/img_center.html */
+.ngg-slideshow-loader {
+    display: table-cell;
+    text-align: center;
+    vertical-align: middle;
+}
+
+.ngg-slideshow-loader img {
+    background: none !important;
+    border: 0 none !important;
+    margin: auto !important;
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/nextgen_basic_slideshow.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/nextgen_basic_slideshow.js
new file mode 100644
index 0000000000000000000000000000000000000000..f9c9eeb4732d2908b5932063c56064d49bf40c26
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/nextgen_basic_slideshow.js
@@ -0,0 +1,55 @@
+jQuery.fn.nggShowSlideshow = function(args) {
+  
+    var defaults = {
+        id: 1,
+        width: 600,
+        height: 400,
+        fx: 'fade',
+        domain: '',
+        timeout: 5000
+    };
+                   
+    var s = jQuery.extend({}, defaults, args);
+    var selector = this.selector;
+	
+    jQuery(selector + '-loader').empty().remove();
+		
+		var container = jQuery(selector);
+    var gallery = jQuery(selector + '-image-list');
+    var self = this;
+
+    jQuery(gallery).waitForImages(function() {
+        var list = gallery.contents().detach();
+        var placeholder = container.attr('data-placeholder');
+        
+        gallery.remove();
+
+        list.appendTo(self);
+
+        self.show();
+        
+        if (placeholder) {
+        	self.prepend('<img class="image-placeholder" src="' + placeholder + '" width="' + s.width + '" height="' + s.height + '" style="width: ' + s.width + 'px; height: ' + s.height + 'px;" />');
+        }
+
+        if (self.children().length > 1) {
+            self.cycle({
+                fx: s.fx,
+                slideExpr: '.ngg-gallery-slideshow-image',
+                slideResize: false,
+                containerResize: false,
+                fit: 1,
+                timeout: s.timeout,
+                next: self, // advance to next image when clicked
+                after: function(currSlideElement, nextSlideElement, options, forwardFlag) {
+                    // update the pro-lightbox triggers should they exist
+                    jQuery(nextSlideElement).parent().siblings('div.ngg-trigger-buttons').each(function() {
+                        jQuery(this).find('i').each(function() {
+                            jQuery(this).data('image-id', jQuery(nextSlideElement).find('img').data('image-id'));
+                        });
+                    });
+                }
+            });
+        }
+    });
+};
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/nextgen_basic_slideshow_settings.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/nextgen_basic_slideshow_settings.js
new file mode 100644
index 0000000000000000000000000000000000000000..d4d9e63c075b9519fc27063fea04c5dfc79a2690
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/nextgen_basic_slideshow_settings.js
@@ -0,0 +1,20 @@
+jQuery(function($) {
+    $('input[name="photocrati-nextgen_basic_slideshow[show_thumbnail_link]"]')
+        .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_slideshow_thumbnail_link_text'));
+
+    $('input[name="photocrati-nextgen_basic_slideshow[flash_enabled]"]')
+        .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_slideshow_flash_background_music'))
+        .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_slideshow_flash_stretch_image'))
+        .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_slideshow_flash_transition_effect'))
+        .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_slideshow_flash_shuffle'))
+        .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_slideshow_flash_next_on_click'))
+        .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_slideshow_flash_navigation_bar'))
+        .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_slideshow_flash_loading_icon'))
+        .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_slideshow_flash_watermark_logo'))
+        .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_slideshow_flash_slow_zoom'))
+        .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_slideshow_flash_xhtml_validation'))
+        .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_slideshow_flash_background_color'))
+        .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_slideshow_flash_text_color'))
+        .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_slideshow_flash_rollover_color'))
+        .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_slideshow_flash_screen_color'));
+});
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/placeholder.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/placeholder.gif
new file mode 100644
index 0000000000000000000000000000000000000000..37e18887d1880311d3b6fa25158ee252dd554903
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/placeholder.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow_preview.jpg b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow_preview.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..f3da223cf6b1c0f2cb87120c54a609ca83222069
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow_preview.jpg differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumb_preview.jpg b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumb_preview.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..413a59cf028c06c6ef4b5c62f5caf2f781fca411
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumb_preview.jpg differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/ajax_pagination.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/ajax_pagination.js
new file mode 100644
index 0000000000000000000000000000000000000000..d15de65ce1ac5d743a8243ea98f9d27503f7b2dd
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/ajax_pagination.js
@@ -0,0 +1,67 @@
+jQuery(function($){
+    NggAjaxNavigation = {
+        loading_image:            null,
+
+        /**
+         * Initializes the AJAX paginators
+         */
+        init:                     function(){
+            var self = this;
+            jQuery('body').on('click', 'a.page-numbers, a.prev, a.next', function(e){
+              e.preventDefault();
+              var $this     = $(this);
+              var $gallery  = $this.parents('.ngg-galleryoverview:first');
+              var gallery_id= $gallery.attr('id').replace('ngg-gallery-','').replace(/-\d+$/, '');
+
+              self.toggle_busy(true);
+
+              // Create a request to render a displayed gallery
+              var params = self.get_querystring_params_from_url($this.attr('href'));
+              params['action']                   = 'get_displayed_gallery_page';
+              params['displayed_gallery_id']     = gallery_id;
+              params['page']                     = $this.data('pageid');
+              params['ajax_pagination_referrer'] = document.URL;
+
+              $.get(photocrati_ajax.url, params, function(response){
+
+                  // Ensure that the server returned JSON
+                  if (typeof(response) != 'object') response = JSON.parse(response);
+                  if (response) {
+                      $gallery.replaceWith(response.html);
+                  }
+
+                  // Let the user know that we've refreshed the content
+                  $(document).trigger('refreshed');
+              }).always(function() { 
+                  self.toggle_busy(false);
+              });
+
+            });
+        },
+
+        /**
+         * Gets the querystring parameters for a url
+         * @param url
+         * @return {Object}
+         */
+        get_querystring_params_from_url: function(url){
+            var url_params = {};
+            var url_parts = url.split('?');
+            if (url_parts.length == 2) {
+                url_parts = url_parts[1].split('&');
+                for (var key in url_parts) {
+                    var param = url_parts[key].split('=');
+                    url_params[param[0]] = param.length == 2 ? param[1] : '';
+                }
+            }
+            return url_params;
+        },
+
+
+        toggle_busy:                    function(busy) {
+            $('body, a').css('cursor', busy ? 'wait' : 'auto');
+        }
+    };
+
+    NggAjaxNavigation.init();
+});
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails.css
new file mode 100644
index 0000000000000000000000000000000000000000..529a3598f386d2699a70fc423ac2ac45dd431408
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails.css
@@ -0,0 +1,102 @@
+/* ----------- Gallery style -------------*/
+
+.ngg-galleryoverview {
+    overflow: hidden;
+    margin-top: 10px;
+    width: 100%;
+    clear: both;
+    display: block !important;
+}
+
+.ngg-galleryoverview .desc {
+    /* required for description */
+    margin: 0px 10px 10px 0px;
+    padding: 5px;
+}
+
+.ngg-gallery-thumbnail-box {
+    float: left;
+    margin-right: 5px;
+}
+
+.ngg-template-caption .ngg-gallery-thumbnail-box {
+    margin-right: 0px;
+}
+
+.ngg-gallery-thumbnail {
+    float: left;
+    text-align: center;
+}
+
+.ngg-gallery-thumbnail img {
+    background-color: #FFFFFF;
+    border: 1px solid #A9A9A9;
+    display: block;
+    margin: 4px 0px 4px 4px;
+    padding: 4px;
+    position: relative;
+}
+
+.ngg-gallery-thumbnail img:hover {
+    background-color: #A9A9A9;
+}
+
+.ngg-gallery-thumbnail span {
+    /* Images description */
+    font-size: 90%;
+    padding-left: 5px;
+    display: block;
+}
+
+/* ----------- Gallery list (Carousel template) -------------*/
+
+.ngg-galleryoverview ul li:before {
+    content: '' !important;
+}
+
+.ngg-gallery-list {
+    list-style-type: none;
+    padding: 0px !important;
+    text-indent: 0px !important;
+}
+
+.ngg-galleryoverview div.pic img {
+    width: 100%;
+	border: 0px;
+	border-radius: 0px;
+}
+
+.ngg-gallery-list li {
+    float: left;
+    margin: 0 2px 0px 2px !important;
+    overflow: hidden;
+}
+
+.ngg-gallery-list li a {
+    border: 1px solid #CCCCCC;
+    display: block;
+    padding: 2px;
+}
+
+.ngg-gallery-list li.selected a {
+    -moz-background-inline-policy: continuous;
+    -moz-background-origin: padding;
+    background: #000000 none repeat scroll 0 0;
+}
+
+.ngg-gallery-list li img {
+    height: 40px;
+    width: 40px;
+}
+
+li.ngg-next, li.ngg-prev {
+    height: 40px;
+    width: 40px;
+    font-size: 3.5em;
+}
+
+li.ngg-next a, li.ngg-prev a {
+    padding-top: 10px;
+    border: none;
+    text-decoration: none;
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails.js
new file mode 100644
index 0000000000000000000000000000000000000000..139597f9cb07c5d48bed18984ec4747f4b4f3438
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails.js
@@ -0,0 +1,2 @@
+
+
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails_settings.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails_settings.css
new file mode 100644
index 0000000000000000000000000000000000000000..58e7d91009871e508664ddb489f6e879ec631171
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails_settings.css
@@ -0,0 +1,3 @@
+.nextgen-thumb-size-custom br {
+display:none;
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails_settings.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails_settings.js
new file mode 100644
index 0000000000000000000000000000000000000000..83fc649628ab1d0b6de959885443c4db0b48fbd4
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails_settings.js
@@ -0,0 +1,13 @@
+jQuery(function($) {
+    $('input[name="photocrati-nextgen_basic_thumbnails[override_thumbnail_settings]"]')
+        .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_thumbnails_thumbnail_dimensions'))
+        .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_thumbnails_thumbnail_quality'))
+        .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_thumbnails_thumbnail_crop'))
+        .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_thumbnails_thumbnail_watermark'));
+
+    $('input[name="photocrati-nextgen_basic_thumbnails[show_piclens_link]"]')
+        .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_thumbnails_piclens_link_text'));
+
+    $('input[name="photocrati-nextgen_basic_thumbnails[show_slideshow_link]"]')
+        .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_thumbnails_slideshow_link_text'))
+});
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lite/NoFlash.jpg b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lite/NoFlash.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..94f643dc7824f1179fec635c245d852f8cfbcb03
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lite/NoFlash.jpg differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lite/PicLensButton.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lite/PicLensButton.png
new file mode 100644
index 0000000000000000000000000000000000000000..daba6435b070324df0e756ddfe7d385ecbdd6809
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lite/PicLensButton.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lite/PicLensLite.swf b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lite/PicLensLite.swf
new file mode 100644
index 0000000000000000000000000000000000000000..3bfd4ea495027027b457595699afe0a23fbe5949
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lite/PicLensLite.swf differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lite/piclens.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lite/piclens.js
new file mode 100644
index 0000000000000000000000000000000000000000..982b76acf61dced637dfeb2156c6ce5372c50559
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lite/piclens.js
@@ -0,0 +1,1127 @@
+/* PicLens Lite: version 1.3.1 (14221)
+ * Copyright (c) 2008 Cooliris, Inc.  All Rights Reserved.
+ * 
+ * The JavaScript part of PicLens Lite (i.e., this file) is BSD licensed (see: http://lite.piclens.com/bsdlicense)
+ * This launcher includes and interacts with SWFObject (MIT), BrowserDetect (BSD Compatible), and Lytebox (CC Attribution 3.0).
+ * 
+ * There are two versions of this JS: 
+ * http://lite.piclens.com/current/piclens.js				full commented file 		(~39KB)
+ * http://lite.piclens.com/current/piclens_optimized.js		lighter deployment file		(~21KB)
+ *
+ * Updated 2012-09-21 by Photocrati with higher z-index scores
+ */
+var PicLensLite = {
+	// PUBLIC API
+
+	// PicLens Lite can be deployed in one of two ways:
+	// 1) include http://lite.piclens.com/current/piclens.js in the <head> of your webpage
+	// 2) download the zip file and deploy it on your own website (unzip it anywhere, and point to the JS file in the <head> of your page)
+	//    see: http://lite.piclens.com/releases/current.zip
+	// 
+	// For example: the directory layout looks like:
+	//	 lite.piclens.com/current/ contains the SWF, JS, and image files
+	//					 /lytebox/ contains slideshow support for browsers w/o Flash
+	// 
+	// Pointing to the JS directly will configure Lite relative to that URL.
+	// Alternatively, you can customize the URLs with PicLensLite.setLiteURLs
+	
+	// 1) Call PicLensLite.start() to launch the default feed (specified in the head)
+	// 2) Call PicLensLite.start({feedUrl:'http://myWebsite.com/myFeed.rss', ...}) to launch a specific feed
+	//	Option 2 supports the following named arguments:
+	//		feedUrl  : String  // is the URL to the specific Media RSS feed you want to launch
+	//		feedData : String  // is the Media RSS feed itself (do not use feedUrl if you want to programmatically generate & pass in the feed text)
+	//		guid	 : String  // starts from the item in the feed that is tagged w/ this unique id
+	//		maxScale : Number  // normally, images fill the stage; 0 -> never scale up; any other positive number S --> scale up to S times the original size of the photo (but never bigger than the stage)
+	//		loadFeedInFlash : Boolean // if true, we ask Flash to load the feed, instead of AJAX (expert option)
+	//		loop	 : Boolean // if true, we turn looping on by default
+	//		paused	 : Boolean // if true, we start the slideshow in paused mode
+	// To enable smoothing for images. a crossdomain.xml file is required at the root of your image server.
+	// Lite detects this crossdomain.xml and applies smoothing automatically.
+	start : function (namedArgs) {
+		this.determineBrowserParams();
+		clearTimeout(this.REMOVE_TIMER_ID);
+		clearTimeout(this.AUTO_CLOSE_TIMER_ID);
+		this.ARGS = {}; // clear out previous args
+
+		// handle named arguments
+		if (typeof namedArgs !== "undefined" && namedArgs !== null) {
+			this.ARGS = namedArgs;
+
+			// if feedUrl is specified, it launches immediately
+			if (namedArgs.feedUrl) {
+				this.THE_FEED_URL = namedArgs.feedUrl;
+				if (this.checkForPluginAndLaunchIfPossible(namedArgs.feedUrl, namedArgs.guid)) {
+					return;
+				}
+				if (namedArgs.loadFeedInFlash) {
+					// read up on flash crossdomain.xml if you choose this option
+					// Flash can only load feeds from servers hosting a crossdomain.xml
+					// pass the URL as a FlashVar, and load the contents via a GET request
+					this.showFlashUI("");
+				} else {
+					// load the contents of the URL via AJAX, and launch the Flash UI afterward....
+					this.loadViaXHR(namedArgs.feedUrl);
+				}
+			}
+			// pass in the feed XML directly through Javascript
+			// use feedUrl OR feedData, but not both!
+			if (typeof namedArgs.feedData !== 'undefined') {
+				this.showFlashUI(namedArgs.feedData);
+			}
+			
+		} else {
+			// find the feed from the header, since none was specified
+			// build list of XML feeds
+			var feeds = this.indexFeeds();
+			if (feeds.length !== 0) { // view the first feed, if available
+				var feed = feeds[0];
+				this.THE_FEED_URL = feed.url;
+				if (this.checkForPluginAndLaunchIfPossible(feed.url)) {
+					return;
+				}
+				this.loadViaXHR(feed.url);
+			}
+		}
+	},
+	// check if the slideshow is currently running
+	isRunning : function () {
+		return this.LITE_IS_RUNNING;
+	},
+	// check if the browser plug-in is installed
+	hasClient : function () {
+		return this.hasCooliris();
+	},
+	// call this before starting lite. we currently support a single custom button
+	// the icon is a 24x24 PNG
+	// we will perform a GET request of a provided URL (w/ the item's GUID) when the user clicks
+	// http://yourwebserver.com/buttonURL?itemGUID=guidVal
+	addCustomButton : function (buttonRESTUrl, buttonLabel, buttonIcon) {
+		this.CUSTOM_BUTTON = {targetURL: buttonRESTUrl, labelText: buttonLabel, iconImage: buttonIcon};
+	},
+	// OPTIONAL: provide callbacks to be notified in certain situations. Call this BEFORE PicLensLite.start(...)
+	// 	onNoPlugins():Boolean
+	//		is called when the user invokes Lite but does not have PicLens / Flash installed
+	// 	onExit(itemUID):void
+	//		is called when the user exits from Lite
+	//		we provide the item's GUID if it exists, and the item's content URL otherwise
+	//		itemUID is undefined if the user exited before Lite launched, or if the user did not have Flash
+	setCallbacks : function (args) {
+		if (args.onNoPlugins) {
+			this.ON_NO_PLUGINS = args.onNoPlugins;
+		}
+		if (args.onExit) {
+			this.ON_EXIT = args.onExit;
+		}
+	},
+	// OPTIONAL: customize the location of resources. Call this BEFORE PicLensLite.start(...)
+	// Normally, we locate the PicLensLite files relative to the JS file 
+	// To use this function, pass in an object with the following named arguments:
+	// args = {
+	//		lite	: other paths can be determined from this (make sure it ends in a slash)
+	//		swf		: the URL of the SWF file					1
+	//		button	: image allowing users to download piclens	1
+	//		lbox	: where to find lytebox						1
+	//		lboxcss	: the CSS file								2
+	//		lboxjs	: the JS file								2
+	// }
+	// 1: Can be determined from args.lite
+	// 2: Can be determined from args.lbox or args.lite
+	setLiteURLs : function (args) {
+		if (!this.LITE_URL) {
+			if (args.swf) {
+				this.LITE_URL = args.swf;
+			} else if (args.lite) {
+				this.LITE_URL = args.lite + "PicLensLite.swf";
+			} // if both lite & swf aren't set, it won't work
+		}
+		if (!this.BUTTON_URL) {
+			if (args.button) {
+				this.BUTTON_URL = args.button;
+			} else if (args.lite) {
+				this.BUTTON_URL = args.lite + "NoFlash.jpg";
+			}
+		}
+
+		var lboxUrl = "";
+		if (args.lbox) {
+			lboxUrl = args.lbox;
+		} else if (args.lite) {
+			lboxUrl = args.lite + "../lytebox/";
+		}
+		
+		if (!this.LBOX_CSS_URL) {
+			if (args.lboxcss) {
+				this.LBOX_CSS_URL = args.lboxcss;
+			} else if (lboxUrl != "") {
+				this.LBOX_CSS_URL = lboxUrl + "lytebox.css";
+			}
+		}
+
+		if (!this.LBOX_JS_URL) {
+			if (args.lboxjs) {
+				this.LBOX_JS_URL = args.lboxjs;
+			} else if (lboxUrl != "") {
+				this.LBOX_JS_URL = lboxUrl + "lytebox.js";
+			}
+		}
+	},
+
+
+
+	//////////////////////////////////////////////////////////////////////////////////////////////////////////
+	// The PRIVATE API is below
+	// DO NOT USE these functions/variables directly; they WILL change in future releases
+	// Email us to request changes to the public API
+	ARGS			: {},
+	DEBUG_NOCLIENT	: false,	// if true, we will NEVER launch the PicLens Client (for testing Lite)
+	DEBUG_NOFLASH	: false,	// if true, we will assume the user does not have Flash (for testing Lite)
+	HPAD			: 60,		// horizontal padding
+	VPAD			: 20,		// vertical padding
+	LITE_BG_DIV		: null,		// the grey/black background overlay
+	LITE_FG_DIV		: null,		// the foreground div that contains the flash component
+	LITE_URL		: null,		// the location of PicLensLite.SWF
+	BUTTON_URL		: null,		// image to display if the user doesn't have flash
+	LBOX_CSS_URL	: null,		// where to find lytebox css/js files
+	LBOX_JS_URL		: null,
+	LBOX_COUNT		: 0,		// try to start lytebox, but if it doesn't exist after a few tries, give up...
+	SHOW_LBOX		: false,	// if true, skip flash altogether
+	OS_WIN			: false,	// OS Detect
+	OS_MAC			: false,	// sadly, sometimes we have to do something different depending on our Browser/OS/Configuration
+	BROWSER_FFX		: false,	// Browser Detect
+	BROWSER_SAF		: false,
+	BROWSER_IE		: false,
+	BROWSER_IE6		: false,
+	OLD_B_MARGIN	: null,
+	OLD_B_OVERFLOW	: null,
+	OLD_B_HEIGHT	: null,
+	OLD_H_OVERFLOW	: null,
+	OLD_H_HEIGHT	: null,
+	THE_FEED		: "",			// the feed text
+	THE_FEED_URL	: "",			// the feed url
+	LITE_IS_RUNNING		: false,	// use isRunning()
+	piclensIsRunning_	: false,	// maintain compatibility with the Wordpress Plugin for a few iterations...
+	FLASH_ID_1		: "pllflash1",	// outer
+	FLASH_ID_2		: "pllflash2",	// inner
+	FLASH_VER		: null,			// the version of Flash we're running 
+	FLASH_URL		: "http://www.adobe.com/go/getflashplayer",
+	PL_URL			: "http://download.piclens.com/partner/",   // downloads PL immediately
+	PLC				: null,			// PicLens Client
+	LEARN_PL_URL	: "http://affiliate.piclens.com/partner/",  // landing page to read about / download PL
+	FONT			: "font-family: Lucida Grande, Myriad Pro, Verdana, Helvetica, Arial, sans-serif;",
+	KEY_HANDLERS	: "",	// save the old key handlers, if any
+	ON_NO_PLUGINS	: null, // callback
+	ON_EXIT			: null, // callback
+	AUTO_CLOSE_TIMER_ID		: 0,	// 
+	REMOVE_TIMER_ID			: 0,	// the timer for removing the children...
+	RESIZE_TIMER_IE6		: null,	// every second, autoresizes the UI
+	RESIZE_HANDLER_EXISTS	: false,// add a handler to detect user resize events in safari
+	CUSTOM_BUTTON			: null,	// add an action to the UI
+
+	addKeyHandlers : function() {
+		var self = this;
+		if (typeof document.onkeydown !== 'undefined') { // save & later restore key handlers...
+			this.KEY_HANDLERS = document.onkeydown;
+		}
+		document.onkeydown = function(e) {
+			var keycode;
+			if (typeof e === "undefined" || e === null) { // ie
+				keycode = window.event.keyCode;
+			} else { // mozilla
+				keycode = e.which;
+			}
+			var val=self.handleKeyPress(keycode);
+			if (typeof e != "undefined" && e != null) {
+				e.returnValue = val;
+			}
+			return val;
+		};
+	},
+	addMouseHandlers : function() {
+		if (window.addEventListener) {		// Firefox/Opera
+			window.addEventListener("DOMMouseScroll", this.handleMouseWheel, false);
+		} else if (document.attachEvent) {	// IE
+			document.attachEvent("onmousewheel", this.handleMouseWheel);
+		}
+		// must be outside of the if-else
+        window.onmousewheel = document.onmousewheel = this.handleMouseWheel; // Safari & Others
+	},
+	// call this at the last possible moment (especially for Win/Firefox)
+	appendElementsToDocument : function() { 
+		if (this.BROWSER_FFX && this.OS_MAC) {	// avoid redraw bug by not showing the background
+			this.LITE_BG_DIV.style.display = "none";
+		}
+		document.body.appendChild(this.LITE_BG_DIV);
+		document.body.appendChild(this.LITE_FG_DIV);
+	},
+	autoResize : function() { // for the IE6 auto resize
+		if (!this.isRunning()) {
+			// unregister the timer
+			clearInterval(this.RESIZE_TIMER_IE6);
+			return;
+		}
+		
+		// resize the BG and FG divs
+		var size = this.getPageSize();
+		var bg = this.LITE_BG_DIV;
+		if (bg) {
+			bg.style.height = size.h + 'px';
+			bg.style.width  = size.w + 'px';
+		}
+		if (this.LITE_FG_DIV) {
+			var fgs = this.LITE_FG_DIV.style;
+			this.resizeToPaddedBox(fgs);
+			this.resizeToFitPaddedBox(fgs, size);
+			this.resizeFlashToFitPaddedBox();
+		}
+	},
+	checkForPluginAndLaunchIfPossible : function (url, guid) {
+		// if we have the correct version of piclens, pass it onto the client and do not use LITE
+		if (this.hasCooliris()) {
+			if (typeof(guid) != "undefined") {
+				this.PLC.launch(url,'uid',guid);
+			} else {
+				this.PLC.launch(url,'','');
+			}
+
+			return true; // launched!
+		}
+		return false;
+	},
+	createBackgroundOverlay : function () {
+		// create a background that covers the page
+		var bg = document.createElement('div');
+		this.LITE_BG_DIV = bg;
+		bg.id = "lite_bg_div";
+		
+		var bgs = bg.style;
+		bgs.position = 'fixed';
+
+		// stick to the sides when the window resizes
+		bgs.width = bgs.height = "100%";
+
+		if (this.BROWSER_IE6) {
+			var b = document.body;
+			var bs = b.currentStyle;
+			var de = document.documentElement;
+			var ds = de.currentStyle;
+			
+			// save previous document styles
+			this.OLD_B_MARGIN = bs.margin;
+			this.OLD_B_OVERFLOW = bs.overflow;
+			this.OLD_B_HEIGHT = bs.height;
+			this.OLD_H_OVERFLOW = ds.overflow;
+			this.OLD_H_HEIGHT = ds.height;
+			this.OLD_SCROLL_Y = de.scrollTop;
+			
+			// simulate position:fixed...
+			b.style.margin = "0";
+			b.style.overflow = "auto";
+			b.style.height = "100%";
+			de.style.overflow = "auto";
+			de.style.height = "100%";
+
+			bgs.position = 'absolute';
+			var page = this.getPageSize();
+			bgs.height = page.h + 'px';
+			bgs.width  = page.w + 'px';
+		}
+		
+		bgs.left = bgs.right = bgs.top = bgs.bottom = '0';
+		bgs.backgroundColor = '#000';
+		bgs.zIndex = 10000;
+		bgs.opacity = '0.5';
+		bgs.filter = 'alpha(opacity=50)';		// IE7
+
+		var self = this;
+		bg.onclick = function () {
+			self.exitPicLensLite();
+		};
+	},
+	createForegroundFlashComponent : function () { // configure the box
+		var fg = document.createElement('div');
+		this.LITE_FG_DIV = fg;
+		fg.id = "lite_fg_div";
+
+		var fgs = fg.style;
+		fgs.backgroundColor = '#000';
+		fgs.position = 'fixed';
+		fgs.border = '2px solid #555';
+		fgs.zIndex = 10001;	   // above the bg
+
+		this.resizeToPaddedBox(fgs);
+
+		if (this.BROWSER_IE6) {
+			fgs.position = 'absolute';
+			this.resizeToFitPaddedBox(fgs);
+		}
+	},
+	// this just removes the HTML elements
+	// we call this from Flash (thus, we need to allow the function to return before removing the children)
+	closeFlashUI : function (itemID) {
+		var doc = document;
+		
+		// remove the keyboard & mouse handlers...
+		doc.onkeydown = this.KEY_HANDLERS;
+		window.onmousewheel = doc.onmousewheel = "";
+		if (window.removeEventListener) {
+			window.removeEventListener("DOMMouseScroll", this.handleMouseWheel, false);
+		}
+		if (doc.detachEvent) { // IE/Opera
+			doc.detachEvent("onmousewheel", this.handleMouseWheel);
+		}
+
+		// hide the div now; remove them later
+		this.LITE_BG_DIV.style.display = this.LITE_FG_DIV.style.display = 'none';
+		this.REMOVE_TIMER_ID = setTimeout(function (){PicLensLite.removeChildren();}, 150); // 0.15s
+
+		if (this.BROWSER_IE6) { // restore styles
+			var b = document.body;
+			var de = document.documentElement;
+			b.style.margin = this.OLD_B_MARGIN;
+			b.style.overflow = this.OLD_B_OVERFLOW;
+			b.style.height = this.OLD_B_HEIGHT;
+			de.style.overflow = this.OLD_H_OVERFLOW;
+			de.style.height = this.OLD_H_HEIGHT;
+			window.scrollTo(0, this.OLD_SCROLL_Y);
+		}
+
+		if (this.ON_EXIT !== null) {
+			this.ON_EXIT(itemID); // call on exit
+		}
+		this.setRunningFlag(false);
+	},
+	// for handling cross-browser quirks...
+	determineBrowserParams : function () {
+		// BrowserDetect {.OS, .browser, .version} e.g., "Mac Firefox 2" and "Windows Explorer 7"
+		var os = BrowserDetect.OS;
+		var b = BrowserDetect.browser;
+		this.OS_MAC = (os == "Mac");
+		this.OS_WIN = (os == "Windows");
+		this.BROWSER_FFX = (b == "Firefox");
+		this.BROWSER_SAF = (b == "Safari");
+		this.BROWSER_IE = (b == "Explorer");
+		this.BROWSER_IE6 = (this.BROWSER_IE && BrowserDetect.version == "6");
+		this.FLASH_VER = swfobjlite.getFlashPlayerVersion(); // what version of Flash is the browser running?
+	},
+	// we should tell Flash we are exiting when this is called...
+	// this should only be called when the user clicks outside of the flash component
+	// all other exits are handled through Flash
+	exitPicLensLite : function () {
+		var fl = this.getFlash();
+		if (fl !== null && fl.fl_exitPicLensLite) {	// binding exists
+			// tell flash that we are quitting
+			fl.fl_exitPicLensLite();
+			// close after .5 seconds, if nothing happened
+			// TODO: make sure this doesn't crash any browsers
+			// TODO: Check the Return Value to Fire this Timer?
+			this.AUTO_CLOSE_TIMER_ID = setTimeout(function (){ if (PicLensLite.isRunning()) { PicLensLite.closeFlashUI();}}, 500); // 0.5s
+		} else {
+			// if it's not running already, we just remove the DIVs (flash isn't defined)
+			this.closeFlashUI();
+		}
+	},
+	// a website should include the absolute URL of the piclens.js in its header
+	// This function looks for the script tag and extracts the ROOT_URL
+	// <script type="text/javascript" src="ROOT_URL/piclens.js"></script>
+	// we assume the SWF and JPEG/PNG/GIF files are relative to this ROOT_URL...
+	findScriptLocation : function () {
+		var scriptTags = document.getElementsByTagName("script");
+		for (var i = 0; i != scriptTags.length; ++i) {
+			var script = scriptTags[i];
+			var type = script.getAttribute("type");
+			if (type == "text/javascript") {
+				var src = script.getAttribute("src");
+				if (src === null) {
+					continue;
+				}
+				var index = src.indexOf("piclens.js"); 
+				if (index != -1) {
+					this.setLiteURLs({lite:src.substring(0,index)});
+					return;
+				} else {
+					index = src.indexOf("piclens_optimized.js");
+					if (index != -1) {
+						this.setLiteURLs({lite:src.substring(0,index)});
+						return;
+					}
+				}
+			}
+		}
+	},
+	// returns an object describing the page size of the browser window
+	getPageSize : function () {
+		var xScroll, yScroll, winW, winH;
+		var doc = document;
+		var body = doc.body;
+		var html;
+		if (window.innerHeight && window.scrollMaxY) {
+			xScroll = doc.scrollWidth;
+			yScroll = (this.isFrame ? parent.innerHeight : self.innerHeight) + (this.isFrame ? parent.scrollMaxY : self.scrollMaxY);
+		} else if (body.scrollHeight > body.offsetHeight){
+			xScroll = body.scrollWidth;
+			yScroll = body.scrollHeight;
+		} else {
+			html = doc.getElementsByTagName("html").item(0);
+			xScroll = html.offsetWidth;
+			yScroll = html.offsetHeight;
+			xScroll = (xScroll < body.offsetWidth) ? body.offsetWidth : xScroll;
+			yScroll = (yScroll < body.offsetHeight) ? body.offsetHeight : yScroll;
+		}
+		var docElement = doc.documentElement;
+		if (self.innerHeight) {
+			winW = (this.isFrame) ? parent.innerWidth : self.innerWidth;
+			winH = (this.isFrame) ? parent.innerHeight : self.innerHeight;
+		} else if (docElement && docElement.clientHeight) {
+			winW = docElement.clientWidth;
+			winH = docElement.clientHeight;
+		} else if (body) {
+			html = doc.getElementsByTagName("html").item(0);
+			winW = html.clientWidth;
+			winH = html.clientHeight;
+			winW = (winW == 0) ? body.clientWidth : winW;
+			winH = (winH == 0) ? body.clientHeight : winH;
+		}
+		var pageHeight = (yScroll < winH) ? winH : yScroll;
+		var pageWidth = (xScroll < winW) ? winW : xScroll;
+		return {pw:pageWidth, ph:pageHeight, w:winW, h:winH}; // pw and ph are the larger pair. use w and h.
+	},
+	getElementsFromXMLFeed : function () {
+		var xmlDoc;
+		if (window.ActiveXObject) { // IE
+		  	xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
+		  	xmlDoc.async=false;
+		  	xmlDoc.loadXML(PicLensLite.THE_FEED);
+		} else { // Mozilla, Firefox, Opera, etc.
+			var parser = new DOMParser();
+			xmlDoc = parser.parseFromString(PicLensLite.THE_FEED, "text/xml");
+		}
+		var elements = xmlDoc.getElementsByTagName('*');
+		return elements;
+	},
+	getBasicSlideShowHTML : function () {
+		if (!this.LBOX_JS_URL || !this.LBOX_CSS_URL) {
+			return "";
+		}
+		
+		// make sure the lytebox JS is included
+		var head = document.getElementsByTagName('head').item(0);
+
+		// add the script tag
+		var script  = document.createElement('script');
+		script.src  = this.LBOX_JS_URL;
+		script.type = 'text/javascript';
+		head.appendChild(script);
+		
+		// add the lytebox CSS too
+		var link = document.createElement('link');
+		link.rel = "stylesheet";
+		link.href = this.LBOX_CSS_URL;
+		link.type = "text/css";
+		link.media = "screen";
+		head.appendChild(link);
+
+		// find all image URLs from the feed.
+		var xmlElements = this.getElementsFromXMLFeed();
+
+		var i;
+		var hiddenURLs = "";
+		for (i = 0; i < xmlElements.length; i++) {
+			if (xmlElements[i].nodeName == "media:content") {	// what about the namespace?
+				var url = xmlElements[i].getAttribute("url");
+				if (url.indexOf(".flv") == -1) {				// images only... avoid FLV files
+					hiddenURLs += '<a id="lboxImage" href="' + url + '" rel="lytebox[lite]"></a> ';
+				}
+			}
+		}
+		// rel="lytebox[lite]"
+		var basicSlideShow = "<div id='lightbox_images' align='center' style='display: none; padding-top:10px; color:#FFFFFF; font-size:.8em; " +this.FONT+ " color:#999999;'>";
+		basicSlideShow +=  '( Alternatively, <a onclick="javascript:PicLensLite.invokeLytebox();return false;" href="#" style="color:#656588">click here for a basic slideshow</a>. )';
+		basicSlideShow += hiddenURLs;
+		basicSlideShow += "</div><br/>";
+
+		return basicSlideShow;
+	},
+	generateAlternativeContent : function () {
+		var altContentHTML = '<div id="altContent" style="text-align:center; margin: 0 0 0 0; padding: 0 0 0 0; background-color: #000; min-width:860px;">';
+		altContentHTML += '<div align="center" style="width: 100%; padding-top:60px; '+this.FONT+'">';
+
+		var v = this.FLASH_VER;
+		var flashMessage;
+		if (v.major > 0) { // has some version of Flash
+			flashMessage = "update your Flash Player from version "+ v.major + '.' + v.minor + '.' + v.release + " to version 9.0.28 or newer";
+		} else {
+			flashMessage = "install the most recent Flash Player";
+		}
+		
+		var basicSlideShow = "";
+		if (this.THE_FEED !== "") {   // do this if we've loaded the feed in AJAX
+			basicSlideShow = this.getBasicSlideShowHTML();
+		}
+		
+		var downloadPL = this.PL_URL;
+		var learnPL = this.LEARN_PL_URL;
+		var pid = this.ARGS.pid;
+		if (pid) {
+			downloadPL += pid + "/";
+			learnPL += pid + "/";
+		} else {
+			var x = "000000000001/";
+			downloadPL += x;
+			learnPL += x;
+		}
+		
+		if (this.SHOW_LBOX) {
+			// don't show the image, because we will invoke lytebox immediately
+		} else {
+			var sp = "<span style='padding-left:25px; color:#C6C6C6; font-size:";
+			altContentHTML += 
+				"<div style='padding:10px;'>" + 
+					sp+"1.5em; font-weight: bold; " +this.FONT+ "'>You're clicks away from going full screen!</span><br/>" + 
+					sp+".9em; padding-bottom: 15px; " +this.FONT+ "'>You must get the <a href='"+downloadPL+"' style='color:#656588'>Cooliris</a> browser plugin, or "+flashMessage+".</span>" +
+				"</div>";
+			if (!this.BUTTON_URL) {
+				altContentHTML +=
+				'<a href="' + downloadPL + '" style="color:#ACD">Get Cooliris Now!</a>';
+			} else {
+				var area = '<area shape="rect" coords=';
+				altContentHTML +=
+				'<img src="'+this.BUTTON_URL+'" alt="" border="0" usemap="#Map">' + 
+				'<map name="Map" id="Map">' + 
+					area+'"0,0,33,33" href="#" onclick="javascript:PicLensLite.closeFlashUI();" />' +
+					area+'"35,35,325,325" href="' + downloadPL +'" />' +
+					area+'"593,209,825,301" href="' + this.FLASH_URL +'" />' +
+					area+'"327,148,448,178" href="' + learnPL +'" />' +
+				'</map>';
+			}
+		}
+
+		altContentHTML += '</div>';
+		altContentHTML += basicSlideShow;
+		altContentHTML += '<div align="center" style="color:#666666; font-size:11px; '+this.FONT+'">&copy; 2008 Cooliris, Inc. All trademarks are property of their respective holders.<br/><br/><br/></div>';
+		altContentHTML += '</div>';
+		return altContentHTML;		
+	},
+	generateFlashVars : function () {
+		var fv = '';
+		var args = this.ARGS;
+		if (typeof args.guid !== 'undefined') {
+			fv += "&startItemGUID=" + args.guid;
+		}
+		if (args.loadFeedInFlash) {
+			fv += "&feedURL=" + encodeURIComponent(this.THE_FEED_URL);	// may need crossdomain.xml to allow loading of feed
+		}
+		if (args.paused) {
+			fv += "&paused=" + args.paused;
+		}
+		if (args.loop) {
+			fv += "&loop=" + args.loop;
+		}
+		if (args.delay) { // seconds: from 1-10
+			fv += "&delay=" + args.delay;
+		}
+		if (args.pid) {
+			fv += "&pid=" + args.pid;
+		}
+		if (typeof args.maxScale != 'undefined') {	// allow 0
+			fv += "&maxScale=" + args.maxScale;
+		}
+		if (typeof args.overlayToolbars != 'undefined') {
+			fv += "&overlayToolbars=" + args.overlayToolbars;
+		}
+		var cb = this.CUSTOM_BUTTON;
+		if (cb != null) {
+			fv += "&cButtonURL=" + encodeURIComponent(cb.targetURL);
+			if (cb.labelText != null) {
+				fv += "&cButtonLabel=" + encodeURIComponent(cb.labelText);
+			}
+			if (cb.iconImage != null) {
+				fv += "&cButtonIcon=" + encodeURIComponent(cb.iconImage);
+			}
+		}
+		fv += "&swfURL="+encodeURIComponent(this.LITE_URL);
+		fv = fv.substring(1); // kill the first &
+		return fv;
+	},
+	// does the right thing for each browser
+	// returns the Flash object, so we can communicate with it over the ExternalInterface
+	getFlash : function () {
+		// we should determine which one to pass back depending on Browser/OS configuration
+		if (this.BROWSER_SAF || this.BROWSER_IE) {
+			return document.getElementById(this.FLASH_ID_1); // outer <object>
+		} else {
+			return document.getElementById(this.FLASH_ID_2); // inner <object>
+		}
+	},
+	getWindowSize : function () { // inner size
+		var docElement = document.documentElement;
+		var docBody = document.body;
+		var w = 0, h = 0;
+		if (typeof(window.innerWidth) == 'number') {
+			// not IE
+			w = window.innerWidth;
+			h = window.innerHeight;
+		} else if (docElement && (docElement.clientWidth || docElement.clientHeight)) {
+			// IE 6+ in 'standards compliant mode'
+			w = docElement.clientWidth;
+			h = docElement.clientHeight;
+		} else if (docBody && (docBody.clientWidth || docBody.clientHeight)) {
+			// IE 4 compatible
+			w = docBody.clientWidth;
+			h = docBody.clientHeight;
+		}
+		return {w:w, h:h};
+	},
+	handleKeyPress : function (code) {
+		if (!this.isRunning()) { return true; }
+		var fl = this.getFlash();
+		if (fl != null && fl.fl_keyPressed) {
+			fl.fl_keyPressed(code); // forward to Flash
+		} else {
+			if (code == 27) { // ESC to close
+				this.closeFlashUI();
+				return false;
+			}
+		}
+		if (code == 9 || code == 13) { // trap tab, enter
+			return false;
+		}
+		return true; // allow the browser to process the key
+	},
+	handleMouseWheel : function (e) {
+		// e.wheelDelta
+		// Safari/Windows (MouseWheel Up is +120; Down is -120)
+		var delta = 0;
+		if (!e) {
+			e = window.event;
+		}
+		if (e.wheelDelta) { // IE/Opera
+			delta = e.wheelDelta/120;
+			if (window.opera) {
+				delta = -delta;
+			}
+		} else if (e.detail) { // Firefox/Moz
+			var d = e.detail;
+			// on mac, don't divide by 3...
+			if (Math.abs(d) < 3) {
+				delta = -d;
+			} else {
+				delta = -d/3;
+			}
+		}
+		if (delta) {
+			// don't send abs values < 1; otherwise, you can only scroll next
+			PicLensLite.sendMouseScrollToFlash(delta);		
+		}
+		if (e.preventDefault) {
+			e.preventDefault();
+		}
+		e.returnValue = false;
+		return false;
+	},
+	hasPicLensClient : function () { // DEPRECATED! Use hasClient()
+		return this.hasCooliris();
+	},
+	// check if Cooliris Client is available
+	hasCooliris : function () {
+		// a flag to turn off the client
+		if (this.DEBUG_NOCLIENT) {
+			return false;
+		}
+		
+		// check if the bridge has already been defined
+		var clientExists = false;
+		if (this.PLC) {
+			clientExists = true;
+		} else if (window.piclens && window.piclens.launch) {
+			this.PLC = window.piclens;
+			clientExists = true;
+		} else { // if not, try to define it here...
+			var context = null;
+			if (typeof PicLensContext != 'undefined') { // Firefox
+				context = new PicLensContext();
+			} else {									
+				try { 
+					context = new ActiveXObject("PicLens.Context"); // IE
+				} catch (e) {
+					if (navigator.mimeTypes['application/x-cooliris']) { // Safari
+						context = document.createElement('object');
+						context.style.display = 'none';
+						context.width = 0;
+						context.height = 0;
+						context.type = 'application/x-cooliris';
+						document.documentElement.appendChild(context);
+					} else {
+						context = null;
+					}
+				}
+			}
+			
+			this.PLC = context;
+			if (this.PLC) {
+				clientExists = true;
+			}
+		}
+		
+		if (clientExists) { // check the version number
+			if (this.BROWSER_SAF) { // for Safari, we just return true (the first v. was 1.8)
+				return true;
+			}
+				
+			var version;
+			try { version = this.PLC.version; } catch (e) { return false; }
+						
+			var parts = version.split('.'); // minimum ver. is: 1.6.0.824
+			if (parts[0] > 1) {			    // a ver. 2.X product
+				return true;
+			} else if (parts[0] == 1) {	    // a 1.X product
+				if (parts[1] > 6) {		    // a 1.7.X product
+					return true;
+				} else if (parts[1] == 6) { // a 1.6 product
+					if (parts[2] > 0) {	    // a 1.6.1.X product
+						return true;
+					} else if (parts[2] == 0) {
+						if (parts[3] >= 824) { // 1.6.0.824 or newer...
+							return true;
+						}
+					}
+				}
+			}
+			return false; // a 0.X product
+		} else {
+			return false;
+		}
+	},
+	invokeLytebox : function () {
+		this.SHOW_LBOX = true; // user has specified that she wants to use the basic slideshow
+		myLytebox.start(document.getElementById("lboxImage"), false, false);
+		this.closeFlashUI();
+	},
+	showLyteboxLink : function () {
+		myLytebox.updateLyteboxItems();
+		myLytebox.doAnimations = false;
+		var lboxImages = document.getElementById('lightbox_images');
+		if (lboxImages != null) {
+			lboxImages.style.display = "block";
+			if (this.SHOW_LBOX && this.getFlash()==null) { // the user has clicked on lbox once, so we assume it going forward
+				this.invokeLytebox();
+			}
+		}
+	},
+	startLytebox : function () { // allows us to include lytebox, unmodified
+		if (typeof myLytebox != "undefined") {
+			this.showLyteboxLink();
+		} else {
+			if (typeof initLytebox != "undefined") {
+				initLytebox();
+				this.showLyteboxLink();
+			} else {
+				if (this.LBOX_COUNT >= 4) {
+					return; // give up after 600 ms
+				}
+				setTimeout(function (){PicLensLite.startLytebox();}, 150); // try again in 150 ms
+				this.LBOX_COUNT++;
+			}
+		}
+	},
+	injectFlashPlayer : function () {
+		var fg = this.LITE_FG_DIV;
+		
+		// determine the width and height of the flash component
+		var flashWInner;
+		var flashHInner;
+		flashWInner = flashHInner = '100%';
+		if (this.BROWSER_IE6) {
+			flashWInner = flashHInner = '0';
+		}
+		
+		var flashVars = this.generateFlashVars();
+		var altContentHTML = this.generateAlternativeContent(); // non-flash content
+
+		if (this.meetsReqs()) {
+			var par = '<param name=';
+			fg.innerHTML = 
+				'<object id="'+ this.FLASH_ID_1 +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%">' + // SAF & IE
+					par+'"movie" value="' + this.LITE_URL + '" />' +
+					par+'"quality" value="high"/> ' +
+					par+'"bgcolor" value="#000000"/> ' +
+					par+'"allowScriptAccess" value="always"/> ' +
+					par+'"FlashVars" value="' + flashVars + '"/> ' +
+					par+'"allowFullScreen" value="true"/> ' +
+					par+'"wmode" value="window"/> ' +
+					par+'"scale" value="noscale"/> ' +
+						'<object type="application/x-shockwave-flash" data="' + this.LITE_URL + '" width="'+flashWInner+'" height="'+flashHInner+'" ' + // NOT IE
+							'quality="high" ' +
+							'bgcolor="#000000" id="'+ this.FLASH_ID_2 + '" ' + 
+							'quality="high" ' +
+							'FlashVars="' + flashVars + '" ' +
+							'allowFullScreen="true" ' +
+							'scale="noscale" ' + 
+							'wmode="window" ' +
+							'allowScriptAccess="always">' +
+							altContentHTML + // IE
+						'</object>'+ // NOT IE
+				'</object>';
+		} else {
+			if (this.ON_NO_PLUGINS) {
+				this.ON_NO_PLUGINS(); // callback instead of showing NoFlash.jpg
+			} else {
+				fg.innerHTML = altContentHTML;
+				fg.style.minWidth = "860px";
+				fg.style.minHeight = "550px";
+			}
+		}
+		
+		if (this.BROWSER_SAF) {
+			this.resizeUI(); // fixes layout 
+		}
+	},
+	// find the RSS feeds on this page, and return an array
+	indexFeeds : function () {
+		var linkTags = document.getElementsByTagName("link");
+		var feeds = [];
+		for (var i = 0; i != linkTags.length; ++i) {
+			var link = linkTags[i], type = link.getAttribute("type");
+			if (type == "application/rss+xml" || type == "text/xml") {
+				feeds.push({ title: link.getAttribute("title"), url: link.getAttribute("href") });
+			}
+		}
+		return feeds;
+	},
+	// once we get the response text, we launch flash
+	loadViaXHR : function (url) {
+		var self = this;
+		var request = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("MSXML2.XMLHTTP.3.0");
+		try {
+			request.open("GET", url, true);
+			request.onreadystatechange = function () {
+				if (request.readyState == 4) {
+					if ((request.status == 200 || request.status == 0)) { // 0 -> File System Testing
+						if (request.responseText) {
+							// at this point, we have the text
+							self.showFlashUI(request.responseText);
+						}
+					} else {
+						if (console) {console.log("PicLens Lite could not load the RSS Feed: " + url);}
+					}
+				}
+			};
+			request.send("");
+		} catch (err) { // probably a crossdomain issue, so ask flash to try loading
+			this.ARGS.loadFeedInFlash = true;
+			this.showFlashUI("");
+		}
+	},
+	meetsReqs : function () {
+		if (this.DEBUG_NOFLASH) {
+			return false;
+		}
+		// if IE7 and Flash detect returns v0, we show the Flash
+		var ie7FlashDetectionWorkaround = (this.FLASH_VER.major == 0) && this.BROWSER_IE;
+		var hasFlash = swfobjlite.hasFlashPlayerVersion("9.0.28");
+		return hasFlash || ie7FlashDetectionWorkaround;
+	},
+	removeChildren : function () {
+		this.REMOVE_TIMER_ID = 0;
+		// remove the divs after a timeout
+		if (this.LITE_BG_DIV !== null) {
+			document.body.removeChild(this.LITE_BG_DIV);
+			this.LITE_BG_DIV = null;
+		}
+		if (this.LITE_FG_DIV !== null) {
+			document.body.removeChild(this.LITE_FG_DIV);
+			this.LITE_FG_DIV = null;
+		}
+	},
+	resizeFlashToFitPaddedBox : function () {
+		var flash = this.getFlash();
+		if (flash) {
+			var size = this.getPageSize();
+			var w = size.w - this.HPAD * 2;
+			var h = size.h - this.VPAD * 2;
+			flash.style.width = w; flash.style.height = h;
+			flash.width = w; flash.height = h;
+		}
+	},
+	resizeToFitPaddedBox : function (s, size) {
+		if (typeof size == 'undefined') {
+			size = this.getPageSize();
+		}
+		s.width = (size.w - this.HPAD * 2) + 'px';
+		s.height = (size.h - this.VPAD * 2) + 'px';
+	},
+	resizeToPaddedBox : function (s) {
+		s.left = s.right = this.HPAD + 'px';
+		s.top = s.bottom = this.VPAD + 'px';
+	},
+	resizeUI : function () { // resize handler for Safari
+		if (this.LITE_FG_DIV) {
+			var fgs = this.LITE_FG_DIV.style;
+			this.resizeToPaddedBox(fgs);
+			this.resizeToFitPaddedBox(fgs);
+			this.resizeFlashToFitPaddedBox();
+		}
+	},
+	setRunningFlag : function (flag) {
+		this.LITE_IS_RUNNING = flag;
+		this.piclensIsRunning_ = flag;
+	},
+	setResizeHandler : function () { // for safari
+		if (!this.RESIZE_HANDLER_EXISTS && this.BROWSER_SAF) {
+			var self = this;
+			window.addEventListener('resize', function () { self.resizeUI(); }, false);
+			this.RESIZE_HANDLER_EXISTS = true;
+		}
+	},
+	setResizeTimer : function () { // only do it for IE6...
+		if (this.BROWSER_IE6) {
+			this.RESIZE_TIMER_IE6 = setInterval(function () { PicLensLite.autoResize(); }, 1000);
+		}
+	},
+	showFlashUI : function (feedText) {
+		this.THE_FEED = feedText; // is "" if we are loading the feed in Flash
+		this.findScriptLocation();
+		this.createBackgroundOverlay();
+		this.createForegroundFlashComponent();
+		if (this.BROWSER_IE) {
+			this.appendElementsToDocument();
+		}
+		this.injectFlashPlayer();
+		if (!this.BROWSER_IE) {
+			// Win Firefox needs this to be last
+			// Other Browsers are OK with this
+			this.appendElementsToDocument(); 
+		}
+		this.addKeyHandlers();
+		this.addMouseHandlers();
+		this.setRunningFlag(true);
+		this.setResizeTimer();
+		this.setResizeHandler();
+		this.startLytebox();
+	},
+	sendMouseScrollToFlash : function (delta) {
+		if (!this.isRunning()) { return; }
+		var fl = this.getFlash();
+		if (fl != null && fl.fl_mouseMoved) {
+			fl.fl_mouseMoved(delta);
+		}
+	}
+	// don't end the last function with a comma; it messes up IE7
+};
+
+
+
+
+/* SWFObject v2.0 <http://code.google.com/p/swfobject/> / Copyright 2007 Geoff Stearns, Michael Williams, and Bobby van der Sluis / MIT License */
+var swfobjlite = function() {
+	var UNDEF = "undefined",
+		OBJECT = "object",
+		SHOCKWAVE_FLASH = "Shockwave Flash",
+		SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
+		win = window,
+		doc = document,
+		nav = navigator;
+	
+	var ua = function() {
+		var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF && typeof doc.appendChild != UNDEF
+					&& typeof doc.replaceChild != UNDEF && typeof doc.removeChild != UNDEF && typeof doc.cloneNode != UNDEF,
+			playerVersion = [0,0,0],
+			d = null;
+		if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
+			d = nav.plugins[SHOCKWAVE_FLASH].description;
+			if (d) {
+				d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
+				playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
+				playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
+				playerVersion[2] = /r/.test(d) ? parseInt(d.replace(/^.*r(.*)$/, "$1"), 10) : 0;
+			}
+		}
+		else if (typeof win.ActiveXObject != UNDEF) {
+			var a = null, fp6Crash = false;
+			try {
+				a = new ActiveXObject(SHOCKWAVE_FLASH_AX + ".7");
+			}
+			catch(e) {
+				try { 
+					a = new ActiveXObject(SHOCKWAVE_FLASH_AX + ".6");
+					playerVersion = [6,0,21];
+					a.AllowScriptAccess = "always";  // Introduced in fp6.0.47
+				}
+				catch(e) {
+					if (playerVersion[0] == 6) {
+						fp6Crash = true;
+					}
+				}
+				if (!fp6Crash) {
+					try {
+						a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
+					}
+					catch(e) {}
+				}
+			}
+			if (!fp6Crash && a) { // a will return null when ActiveX is disabled
+				try {
+					d = a.GetVariable("$version");  // Will crash fp6.0.21/23/29
+					if (d) {
+						d = d.split(" ")[1].split(",");
+						playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+					}
+				}
+				catch(e) {}
+			}
+		}
+		var u = nav.userAgent.toLowerCase(),
+			p = nav.platform.toLowerCase(),
+			webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
+			ie = false,
+			windows = p ? /win/.test(p) : /win/.test(u),
+			mac = p ? /mac/.test(p) : /mac/.test(u);
+		/*@cc_on
+			ie = true;
+			@if (@_win32)
+				windows = true;
+			@elif (@_mac)
+				mac = true;
+			@end
+		@*/
+		return { w3cdom:w3cdom, pv:playerVersion, webkit:webkit, ie:ie, win:windows, mac:mac };
+	}();
+
+	return { // PUBLIC API
+		hasFlashPlayerVersion : function(rv) {
+			var pv = ua.pv, v = rv.split(".");
+			v[0] = parseInt(v[0], 10);
+			v[1] = parseInt(v[1], 10);
+			v[2] = parseInt(v[2], 10);
+			return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
+		},
+		getFlashPlayerVersion: function() {
+			return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
+		}
+	};
+}();
+
+
+
+
+	
+/* BrowserDetect: http://www.quirksmode.org/js/detect.html */
+var BrowserDetect={
+	init:function() { this.browser = this.searchString(this.dataBrowser) || "Unknown Browser"; this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "Unknown Version"; this.OS = this.searchString(this.dataOS) || "Unknown OS"; },
+	searchString:function(data) { for (var i=0;i<data.length;i++)	{ var dataString = data[i].string; var dataProp = data[i].prop; this.versionSearchString = data[i].versionSearch || data[i].identity; if (dataString) { if (dataString.indexOf(data[i].subString) != -1) {return data[i].identity;} } else if (dataProp) { return data[i].identity; } } },
+	searchVersion:function(dataString) { var index = dataString.indexOf(this.versionSearchString); if (index == -1) {return;} return parseFloat(dataString.substring(index+this.versionSearchString.length+1)); },
+	dataBrowser:[
+		{ string: navigator.userAgent, subString: "OmniWeb", versionSearch: "OmniWeb/", identity: "OmniWeb" },
+		{ string: navigator.vendor, subString: "Apple", identity: "Safari" },
+		{ prop: window.opera, identity: "Opera" },
+		{ string: navigator.vendor, subString: "iCab", identity: "iCab" },
+		{ string: navigator.vendor, subString: "KDE", identity: "Konqueror" },
+		{ string: navigator.userAgent, subString: "Firefox", identity: "Firefox" },
+		{ string: navigator.vendor, subString: "Camino", identity: "Camino" },
+		{ string: navigator.userAgent, subString: "Netscape", identity: "Netscape" }, // newer Netscapes (6+)
+		{ string: navigator.userAgent, subString: "MSIE", identity: "Explorer", versionSearch: "MSIE" },
+		{ string: navigator.userAgent, subString: "Gecko", identity: "Mozilla", versionSearch: "rv" },
+		{ string: navigator.userAgent, subString: "Mozilla", identity: "Netscape", versionSearch: "Mozilla" } // older Netscapes (4-)
+	],
+	dataOS:[{ string: navigator.platform, subString: "Win", identity: "Windows" }, { string: navigator.platform, subString: "Mac", identity: "Mac" }, { string: navigator.platform, subString: "Linux", identity: "Linux" } ]
+};
+BrowserDetect.init();
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lite/piclens_optimized.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lite/piclens_optimized.js
new file mode 100644
index 0000000000000000000000000000000000000000..b254ddb2a25cad9f6c951ddf04641b0a9057c581
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lite/piclens_optimized.js
@@ -0,0 +1,20 @@
+/* PicLens Lite: version 1.3.1 (14221)
+ * Copyright (c) 2008 Cooliris, Inc.  All Rights Reserved.
+ * 
+ * The JavaScript part of PicLens Lite (i.e., this file) is BSD licensed (see: http://lite.piclens.com/bsdlicense)
+ * This launcher includes and interacts with SWFObject (MIT), BrowserDetect (BSD Compatible), and Lytebox (CC Attribution 3.0).
+ * 
+ * There are two versions of this JS: 
+ * http://lite.piclens.com/current/piclens.js               full commented file         (~39KB)
+ * http://lite.piclens.com/current/piclens_optimized.js     lighter deployment file     (~21KB)
+ */
+var PicLensLite={start:function(B){this.determineBrowserParams();clearTimeout(this.REMOVE_TIMER_ID);clearTimeout(this.AUTO_CLOSE_TIMER_ID);this.ARGS={};if(typeof B!=="undefined"&&B!==null){this.ARGS=B;if(B.feedUrl){this.THE_FEED_URL=B.feedUrl;if(this.checkForPluginAndLaunchIfPossible(B.feedUrl,B.guid)){return }if(B.loadFeedInFlash){this.showFlashUI("")}else{this.loadViaXHR(B.feedUrl)}}if(typeof B.feedData!=="undefined"){this.showFlashUI(B.feedData)}}else{var A=this.indexFeeds();if(A.length!==0){var C=A[0];this.THE_FEED_URL=C.url;if(this.checkForPluginAndLaunchIfPossible(C.url)){return }this.loadViaXHR(C.url)}}},isRunning:function(){return this.LITE_IS_RUNNING},hasClient:function(){return this.hasCooliris()},addCustomButton:function(C,B,A){this.CUSTOM_BUTTON={targetURL:C,labelText:B,iconImage:A}},setCallbacks:function(A){if(A.onNoPlugins){this.ON_NO_PLUGINS=A.onNoPlugins}if(A.onExit){this.ON_EXIT=A.onExit}},setLiteURLs:function(A){if(!this.LITE_URL){if(A.swf){this.LITE_URL=A.swf}else{if(A.lite){this.LITE_URL=A.lite+"PicLensLite.swf"}}}if(!this.BUTTON_URL){if(A.button){this.BUTTON_URL=A.button}else{if(A.lite){this.BUTTON_URL=A.lite+"NoFlash.jpg"}}}var B="";if(A.lbox){B=A.lbox}else{if(A.lite){B=A.lite+"../lytebox/"}}if(!this.LBOX_CSS_URL){if(A.lboxcss){this.LBOX_CSS_URL=A.lboxcss}else{if(B!=""){this.LBOX_CSS_URL=B+"lytebox.css"}}}if(!this.LBOX_JS_URL){if(A.lboxjs){this.LBOX_JS_URL=A.lboxjs}else{if(B!=""){this.LBOX_JS_URL=B+"lytebox.js"}}}},ARGS:{},DEBUG_NOCLIENT:false,DEBUG_NOFLASH:false,HPAD:60,VPAD:20,LITE_BG_DIV:null,LITE_FG_DIV:null,LITE_URL:null,BUTTON_URL:null,LBOX_CSS_URL:null,LBOX_JS_URL:null,LBOX_COUNT:0,SHOW_LBOX:false,OS_WIN:false,OS_MAC:false,BROWSER_FFX:false,BROWSER_SAF:false,BROWSER_IE:false,BROWSER_IE6:false,OLD_B_MARGIN:null,OLD_B_OVERFLOW:null,OLD_B_HEIGHT:null,OLD_H_OVERFLOW:null,OLD_H_HEIGHT:null,THE_FEED:"",THE_FEED_URL:"",LITE_IS_RUNNING:false,piclensIsRunning_:false,FLASH_ID_1:"pllflash1",FLASH_ID_2:"pllflash2",FLASH_VER:null,FLASH_URL:"http://www.adobe.com/go/getflashplayer",PL_URL:"http://download.piclens.com/partner/",PLC:null,LEARN_PL_URL:"http://affiliate.piclens.com/partner/",FONT:"font-family: Lucida Grande, Myriad Pro, Verdana, Helvetica, Arial, sans-serif;",KEY_HANDLERS:"",ON_NO_PLUGINS:null,ON_EXIT:null,AUTO_CLOSE_TIMER_ID:0,REMOVE_TIMER_ID:0,RESIZE_TIMER_IE6:null,RESIZE_HANDLER_EXISTS:false,CUSTOM_BUTTON:null,addKeyHandlers:function(){var A=this;if(typeof document.onkeydown!=="undefined"){this.KEY_HANDLERS=document.onkeydown}document.onkeydown=function(C){var B;if(typeof C==="undefined"||C===null){B=window.event.keyCode}else{B=C.which}var D=A.handleKeyPress(B);if(typeof C!="undefined"&&C!=null){C.returnValue=D}return D}},addMouseHandlers:function(){if(window.addEventListener){window.addEventListener("DOMMouseScroll",this.handleMouseWheel,false)}else{if(document.attachEvent){document.attachEvent("onmousewheel",this.handleMouseWheel)}}window.onmousewheel=document.onmousewheel=this.handleMouseWheel},appendElementsToDocument:function(){if(this.BROWSER_FFX&&this.OS_MAC){this.LITE_BG_DIV.style.display="none"}document.body.appendChild(this.LITE_BG_DIV);document.body.appendChild(this.LITE_FG_DIV)},autoResize:function(){if(!this.isRunning()){clearInterval(this.RESIZE_TIMER_IE6);return }var C=this.getPageSize();var B=this.LITE_BG_DIV;if(B){B.style.height=C.h+"px";B.style.width=C.w+"px"}if(this.LITE_FG_DIV){var A=this.LITE_FG_DIV.style;this.resizeToPaddedBox(A);this.resizeToFitPaddedBox(A,C);this.resizeFlashToFitPaddedBox()}},checkForPluginAndLaunchIfPossible:function(B,A){if(this.hasCooliris()){if(typeof (A)!="undefined"){this.PLC.launch(B,"uid",A)}else{this.PLC.launch(B,"","")}return true}return false},createBackgroundOverlay:function(){var D=document.createElement("div");this.LITE_BG_DIV=D;D.id="lite_bg_div";var E=D.style;E.position="fixed";E.width=E.height="100%";if(this.BROWSER_IE6){var A=document.body;var C=A.currentStyle;var H=document.documentElement;var G=H.currentStyle;this.OLD_B_MARGIN=C.margin;this.OLD_B_OVERFLOW=C.overflow;this.OLD_B_HEIGHT=C.height;this.OLD_H_OVERFLOW=G.overflow;this.OLD_H_HEIGHT=G.height;this.OLD_SCROLL_Y=H.scrollTop;A.style.margin="0";A.style.overflow="auto";A.style.height="100%";H.style.overflow="auto";H.style.height="100%";E.position="absolute";var F=this.getPageSize();E.height=F.h+"px";E.width=F.w+"px"}E.left=E.right=E.top=E.bottom="0";E.backgroundColor="#000";E.zIndex=1000;E.opacity="0.5";E.filter="alpha(opacity=50)";var B=this;D.onclick=function(){B.exitPicLensLite()}},createForegroundFlashComponent:function(){var B=document.createElement("div");this.LITE_FG_DIV=B;B.id="lite_fg_div";var A=B.style;A.backgroundColor="#000";A.position="fixed";A.border="2px solid #555";A.zIndex=1001;this.resizeToPaddedBox(A);if(this.BROWSER_IE6){A.position="absolute";this.resizeToFitPaddedBox(A)}},closeFlashUI:function(C){var B=document;B.onkeydown=this.KEY_HANDLERS;window.onmousewheel=B.onmousewheel="";if(window.removeEventListener){window.removeEventListener("DOMMouseScroll",this.handleMouseWheel,false)}if(B.detachEvent){B.detachEvent("onmousewheel",this.handleMouseWheel)}this.LITE_BG_DIV.style.display=this.LITE_FG_DIV.style.display="none";this.REMOVE_TIMER_ID=setTimeout(function(){PicLensLite.removeChildren()},150);if(this.BROWSER_IE6){var A=document.body;var D=document.documentElement;A.style.margin=this.OLD_B_MARGIN;A.style.overflow=this.OLD_B_OVERFLOW;A.style.height=this.OLD_B_HEIGHT;D.style.overflow=this.OLD_H_OVERFLOW;D.style.height=this.OLD_H_HEIGHT;window.scrollTo(0,this.OLD_SCROLL_Y)}if(this.ON_EXIT!==null){this.ON_EXIT(C)}this.setRunningFlag(false)},determineBrowserParams:function(){var B=BrowserDetect.OS;var A=BrowserDetect.browser;this.OS_MAC=(B=="Mac");this.OS_WIN=(B=="Windows");this.BROWSER_FFX=(A=="Firefox");this.BROWSER_SAF=(A=="Safari");this.BROWSER_IE=(A=="Explorer");this.BROWSER_IE6=(this.BROWSER_IE&&BrowserDetect.version=="6");this.FLASH_VER=swfobjlite.getFlashPlayerVersion()},exitPicLensLite:function(){var A=this.getFlash();if(A!==null&&A.fl_exitPicLensLite){A.fl_exitPicLensLite();this.AUTO_CLOSE_TIMER_ID=setTimeout(function(){if(PicLensLite.isRunning()){PicLensLite.closeFlashUI()}},500)}else{this.closeFlashUI()}},findScriptLocation:function(){var E=document.getElementsByTagName("script");for(var C=0;C!=E.length;++C){var A=E[C];var D=A.getAttribute("type");if(D=="text/javascript"){var F=A.getAttribute("src");if(F===null){continue}var B=F.indexOf("piclens.js");if(B!=-1){this.setLiteURLs({lite:F.substring(0,B)});return }else{B=F.indexOf("piclens_optimized.js");if(B!=-1){this.setLiteURLs({lite:F.substring(0,B)});return }}}}},getPageSize:function(){var J,F,G,C;var I=document;var E=I.body;var D;if(window.innerHeight&&window.scrollMaxY){J=I.scrollWidth;F=(this.isFrame?parent.innerHeight:self.innerHeight)+(this.isFrame?parent.scrollMaxY:self.scrollMaxY)}else{if(E.scrollHeight>E.offsetHeight){J=E.scrollWidth;F=E.scrollHeight}else{D=I.getElementsByTagName("html").item(0);J=D.offsetWidth;F=D.offsetHeight;J=(J<E.offsetWidth)?E.offsetWidth:J;F=(F<E.offsetHeight)?E.offsetHeight:F}}var A=I.documentElement;if(self.innerHeight){G=(this.isFrame)?parent.innerWidth:self.innerWidth;C=(this.isFrame)?parent.innerHeight:self.innerHeight}else{if(A&&A.clientHeight){G=A.clientWidth;C=A.clientHeight}else{if(E){D=I.getElementsByTagName("html").item(0);G=D.clientWidth;C=D.clientHeight;G=(G==0)?E.clientWidth:G;C=(C==0)?E.clientHeight:C}}}var B=(F<C)?C:F;var H=(J<G)?G:J;return{pw:H,ph:B,w:G,h:C}},getElementsFromXMLFeed:function(){var B;if(window.ActiveXObject){B=new ActiveXObject("Microsoft.XMLDOM");B.async=false;B.loadXML(PicLensLite.THE_FEED)}else{var C=new DOMParser();B=C.parseFromString(PicLensLite.THE_FEED,"text/xml")}var A=B.getElementsByTagName("*");return A},getBasicSlideShowHTML:function(){if(!this.LBOX_JS_URL||!this.LBOX_CSS_URL){return""}var D=document.getElementsByTagName("head").item(0);var A=document.createElement("script");A.src=this.LBOX_JS_URL;A.type="text/javascript";D.appendChild(A);var G=document.createElement("link");G.rel="stylesheet";G.href=this.LBOX_CSS_URL;G.type="text/css";G.media="screen";D.appendChild(G);var F=this.getElementsFromXMLFeed();var C;var H="";for(C=0;C<F.length;C++){if(F[C].nodeName=="media:content"){var B=F[C].getAttribute("url");if(B.indexOf(".flv")==-1){H+='<a id="lboxImage" href="'+B+'" rel="lytebox[lite]"></a> '}}}var E="<div id='lightbox_images' align='center' style='display: none; padding-top:10px; color:#FFFFFF; font-size:.8em; "+this.FONT+" color:#999999;'>";E+='( Alternatively, <a onclick="javascript:PicLensLite.invokeLytebox();return false;" href="#" style="color:#656588">click here for a basic slideshow</a>. )';E+=H;E+="</div><br/>";return E},generateAlternativeContent:function(){var J='<div id="altContent" style="text-align:center; margin: 0 0 0 0; padding: 0 0 0 0; background-color: #000; min-width:860px;">';J+='<div align="center" style="width: 100%; padding-top:60px; '+this.FONT+'">';var I=this.FLASH_VER;var G;if(I.major>0){G="update your Flash Player from version "+I.major+"."+I.minor+"."+I.release+" to version 9.0.28 or newer"}else{G="install the most recent Flash Player"}var D="";if(this.THE_FEED!==""){D=this.getBasicSlideShowHTML()}var A=this.PL_URL;var E=this.LEARN_PL_URL;var F=this.ARGS.pid;if(F){A+=F+"/";E+=F+"/"}else{var H="000000000001/";A+=H;E+=H}if(this.SHOW_LBOX){}else{var C="<span style='padding-left:25px; color:#C6C6C6; font-size:";J+="<div style='padding:10px;'>"+C+"1.5em; font-weight: bold; "+this.FONT+"'>You're clicks away from going full screen!</span><br/>"+C+".9em; padding-bottom: 15px; "+this.FONT+"'>You must get the <a href='"+A+"' style='color:#656588'>Cooliris</a> browser plugin, or "+G+".</span></div>";if(!this.BUTTON_URL){J+='<a href="'+A+'" style="color:#ACD">Get Cooliris Now!</a>'}else{var B='<area shape="rect" coords=';J+='<img src="'+this.BUTTON_URL+'" alt="" border="0" usemap="#Map"><map name="Map" id="Map">'+B+'"0,0,33,33" href="#" onclick="javascript:PicLensLite.closeFlashUI();" />'+B+'"35,35,325,325" href="'+A+'" />'+B+'"593,209,825,301" href="'+this.FLASH_URL+'" />'+B+'"327,148,448,178" href="'+E+'" /></map>'}}J+="</div>";J+=D;J+='<div align="center" style="color:#666666; font-size:11px; '+this.FONT+'">&copy; 2008 Cooliris, Inc. All trademarks are property of their respective holders.<br/><br/><br/></div>';J+="</div>";return J},generateFlashVars:function(){var C="";var B=this.ARGS;if(typeof B.guid!=="undefined"){C+="&startItemGUID="+B.guid}if(B.loadFeedInFlash){C+="&feedURL="+encodeURIComponent(this.THE_FEED_URL)}if(B.paused){C+="&paused="+B.paused}if(B.loop){C+="&loop="+B.loop}if(B.delay){C+="&delay="+B.delay}if(B.pid){C+="&pid="+B.pid}if(typeof B.maxScale!="undefined"){C+="&maxScale="+B.maxScale}if(typeof B.overlayToolbars!="undefined"){C+="&overlayToolbars="+B.overlayToolbars}var A=this.CUSTOM_BUTTON;if(A!=null){C+="&cButtonURL="+encodeURIComponent(A.targetURL);if(A.labelText!=null){C+="&cButtonLabel="+encodeURIComponent(A.labelText)}if(A.iconImage!=null){C+="&cButtonIcon="+encodeURIComponent(A.iconImage)}}C+="&swfURL="+encodeURIComponent(this.LITE_URL);C=C.substring(1);return C},getFlash:function(){if(this.BROWSER_SAF||this.BROWSER_IE){return document.getElementById(this.FLASH_ID_1)}else{return document.getElementById(this.FLASH_ID_2)}},getWindowSize:function(){var B=document.documentElement;var D=document.body;var A=0,C=0;if(typeof (window.innerWidth)=="number"){A=window.innerWidth;C=window.innerHeight}else{if(B&&(B.clientWidth||B.clientHeight)){A=B.clientWidth;C=B.clientHeight}else{if(D&&(D.clientWidth||D.clientHeight)){A=D.clientWidth;C=D.clientHeight}}}return{w:A,h:C}},handleKeyPress:function(A){if(!this.isRunning()){return true}var B=this.getFlash();if(B!=null&&B.fl_keyPressed){B.fl_keyPressed(A)}else{if(A==27){this.closeFlashUI();return false}}if(A==9||A==13){return false}return true},handleMouseWheel:function(A){var C=0;if(!A){A=window.event}if(A.wheelDelta){C=A.wheelDelta/120;if(window.opera){C=-C}}else{if(A.detail){var B=A.detail;if(Math.abs(B)<3){C=-B}else{C=-B/3}}}if(C){PicLensLite.sendMouseScrollToFlash(C)}if(A.preventDefault){A.preventDefault()}A.returnValue=false;return false},hasPicLensClient:function(){return this.hasCooliris()},hasCooliris:function(){if(this.DEBUG_NOCLIENT){return false}var E=false;if(this.PLC){E=true}else{if(window.piclens&&window.piclens.launch){this.PLC=window.piclens;E=true}else{var B=null;if(typeof PicLensContext!="undefined"){B=new PicLensContext()}else{try{B=new ActiveXObject("PicLens.Context")}catch(D){if(navigator.mimeTypes["application/x-cooliris"]){B=document.createElement("object");B.style.display="none";B.width=0;B.height=0;B.type="application/x-cooliris";document.documentElement.appendChild(B)}else{B=null}}}this.PLC=B;if(this.PLC){E=true}}}if(E){if(this.BROWSER_SAF){return true}var A;try{A=this.PLC.version}catch(D){return false}var C=A.split(".");if(C[0]>1){return true}else{if(C[0]==1){if(C[1]>6){return true}else{if(C[1]==6){if(C[2]>0){return true}else{if(C[2]==0){if(C[3]>=824){return true}}}}}}}return false}else{return false}},invokeLytebox:function(){this.SHOW_LBOX=true;myLytebox.start(document.getElementById("lboxImage"),false,false);this.closeFlashUI()},showLyteboxLink:function(){myLytebox.updateLyteboxItems();myLytebox.doAnimations=false;var A=document.getElementById("lightbox_images");if(A!=null){A.style.display="block";if(this.SHOW_LBOX&&this.getFlash()==null){this.invokeLytebox()}}},startLytebox:function(){if(typeof myLytebox!="undefined"){this.showLyteboxLink()}else{if(typeof initLytebox!="undefined"){initLytebox();this.showLyteboxLink()}else{if(this.LBOX_COUNT>=4){return }setTimeout(function(){PicLensLite.startLytebox()},150);this.LBOX_COUNT++}}},injectFlashPlayer:function(){var A=this.LITE_FG_DIV;var D;var F;D=F="100%";if(this.BROWSER_IE6){D=F="0"}var E=this.generateFlashVars();var B=this.generateAlternativeContent();if(this.meetsReqs()){var C="<param name=";A.innerHTML='<object id="'+this.FLASH_ID_1+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%">'+C+'"movie" value="'+this.LITE_URL+'" />'+C+'"quality" value="high"/> '+C+'"bgcolor" value="#000000"/> '+C+'"allowScriptAccess" value="always"/> '+C+'"FlashVars" value="'+E+'"/> '+C+'"allowFullScreen" value="true"/> '+C+'"wmode" value="window"/> '+C+'"scale" value="noscale"/> <object type="application/x-shockwave-flash" data="'+this.LITE_URL+'" width="'+D+'" height="'+F+'" quality="high" bgcolor="#000000" id="'+this.FLASH_ID_2+'" quality="high" FlashVars="'+E+'" allowFullScreen="true" scale="noscale" wmode="window" allowScriptAccess="always">'+B+"</object></object>"}else{if(this.ON_NO_PLUGINS){this.ON_NO_PLUGINS()}else{A.innerHTML=B;A.style.minWidth="860px";A.style.minHeight="550px"}}if(this.BROWSER_SAF){this.resizeUI()}},indexFeeds:function(){var E=document.getElementsByTagName("link");var A=[];for(var B=0;B!=E.length;++B){var D=E[B],C=D.getAttribute("type");if(C=="application/rss+xml"||C=="text/xml"){A.push({title:D.getAttribute("title"),url:D.getAttribute("href")})}}return A},loadViaXHR:function(B){var A=this;var D=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("MSXML2.XMLHTTP.3.0");try{D.open("GET",B,true);D.onreadystatechange=function(){if(D.readyState==4){if((D.status==200||D.status==0)){if(D.responseText){A.showFlashUI(D.responseText)}}else{if(console){console.log("PicLens Lite could not load the RSS Feed: "+B)}}}};D.send("")}catch(C){this.ARGS.loadFeedInFlash=true;this.showFlashUI("")}},meetsReqs:function(){if(this.DEBUG_NOFLASH){return false}var B=(this.FLASH_VER.major==0)&&this.BROWSER_IE;var A=swfobjlite.hasFlashPlayerVersion("9.0.28");return A||B},removeChildren:function(){this.REMOVE_TIMER_ID=0;if(this.LITE_BG_DIV!==null){document.body.removeChild(this.LITE_BG_DIV);this.LITE_BG_DIV=null}if(this.LITE_FG_DIV!==null){document.body.removeChild(this.LITE_FG_DIV);this.LITE_FG_DIV=null}},resizeFlashToFitPaddedBox:function(){var B=this.getFlash();if(B){var C=this.getPageSize();var A=C.w-this.HPAD*2;var D=C.h-this.VPAD*2;B.style.width=A;B.style.height=D;B.width=A;B.height=D}},resizeToFitPaddedBox:function(B,A){if(typeof A=="undefined"){A=this.getPageSize()}B.width=(A.w-this.HPAD*2)+"px";B.height=(A.h-this.VPAD*2)+"px"},resizeToPaddedBox:function(A){A.left=A.right=this.HPAD+"px";A.top=A.bottom=this.VPAD+"px"},resizeUI:function(){if(this.LITE_FG_DIV){var A=this.LITE_FG_DIV.style;this.resizeToPaddedBox(A);this.resizeToFitPaddedBox(A);this.resizeFlashToFitPaddedBox()}},setRunningFlag:function(A){this.LITE_IS_RUNNING=A;this.piclensIsRunning_=A},setResizeHandler:function(){if(!this.RESIZE_HANDLER_EXISTS&&this.BROWSER_SAF){var A=this;window.addEventListener("resize",function(){A.resizeUI()},false);this.RESIZE_HANDLER_EXISTS=true}},setResizeTimer:function(){if(this.BROWSER_IE6){this.RESIZE_TIMER_IE6=setInterval(function(){PicLensLite.autoResize()},1000)}},showFlashUI:function(A){this.THE_FEED=A;this.findScriptLocation();this.createBackgroundOverlay();this.createForegroundFlashComponent();if(this.BROWSER_IE){this.appendElementsToDocument()}this.injectFlashPlayer();if(!this.BROWSER_IE){this.appendElementsToDocument()}this.addKeyHandlers();this.addMouseHandlers();this.setRunningFlag(true);this.setResizeTimer();this.setResizeHandler();this.startLytebox()},sendMouseScrollToFlash:function(B){if(!this.isRunning()){return }var A=this.getFlash();if(A!=null&&A.fl_mouseMoved){A.fl_mouseMoved(B)}}};var swfobjlite=function(){var UNDEF="undefined",OBJECT="object",SHOCKWAVE_FLASH="Shockwave Flash",SHOCKWAVE_FLASH_AX="ShockwaveFlash.ShockwaveFlash",win=window,doc=document,nav=navigator;var ua=function(){var w3cdom=typeof doc.getElementById!=UNDEF&&typeof doc.getElementsByTagName!=UNDEF&&typeof doc.createElement!=UNDEF&&typeof doc.appendChild!=UNDEF&&typeof doc.replaceChild!=UNDEF&&typeof doc.removeChild!=UNDEF&&typeof doc.cloneNode!=UNDEF,playerVersion=[0,0,0],d=null;if(typeof nav.plugins!=UNDEF&&typeof nav.plugins[SHOCKWAVE_FLASH]==OBJECT){d=nav.plugins[SHOCKWAVE_FLASH].description;if(d){d=d.replace(/^.*\s+(\S+\s+\S+$)/,"$1");playerVersion[0]=parseInt(d.replace(/^(.*)\..*$/,"$1"),10);playerVersion[1]=parseInt(d.replace(/^.*\.(.*)\s.*$/,"$1"),10);playerVersion[2]=/r/.test(d)?parseInt(d.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof win.ActiveXObject!=UNDEF){var a=null,fp6Crash=false;try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".7")}catch(e){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".6");playerVersion=[6,0,21];a.AllowScriptAccess="always"}catch(e){if(playerVersion[0]==6){fp6Crash=true}}if(!fp6Crash){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX)}catch(e){}}}if(!fp6Crash&&a){try{d=a.GetVariable("$version");if(d){d=d.split(" ")[1].split(",");playerVersion=[parseInt(d[0],10),parseInt(d[1],10),parseInt(d[2],10)]}}catch(e){}}}}var u=nav.userAgent.toLowerCase(),p=nav.platform.toLowerCase(),webkit=/webkit/.test(u)?parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,ie=false,windows=p?/win/.test(p):/win/.test(u),mac=p?/mac/.test(p):/mac/.test(u);
+/*@cc_on
+			ie = true;
+			@if (@_win32)
+				windows = true;
+			@elif (@_mac)
+				mac = true;
+			@end
+		@*/
+return{w3cdom:w3cdom,pv:playerVersion,webkit:webkit,ie:ie,win:windows,mac:mac}}();return{hasFlashPlayerVersion:function(rv){var pv=ua.pv,v=rv.split(".");v[0]=parseInt(v[0],10);v[1]=parseInt(v[1],10);v[2]=parseInt(v[2],10);return(pv[0]>v[0]||(pv[0]==v[0]&&pv[1]>v[1])||(pv[0]==v[0]&&pv[1]==v[1]&&pv[2]>=v[2]))?true:false},getFlashPlayerVersion:function(){return{major:ua.pv[0],minor:ua.pv[1],release:ua.pv[2]}}}}();var BrowserDetect={init:function(){this.browser=this.searchString(this.dataBrowser)||"Unknown Browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"Unknown Version";this.OS=this.searchString(this.dataOS)||"Unknown OS"},searchString:function(D){for(var A=0;A<D.length;A++){var B=D[A].string;var C=D[A].prop;this.versionSearchString=D[A].versionSearch||D[A].identity;if(B){if(B.indexOf(D[A].subString)!=-1){return D[A].identity}}else{if(C){return D[A].identity}}}},searchVersion:function(B){var A=B.indexOf(this.versionSearchString);if(A==-1){return }return parseFloat(B.substring(A+this.versionSearchString.length+1))},dataBrowser:[{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};BrowserDetect.init();
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/blank.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/blank.gif
new file mode 100644
index 0000000000000000000000000000000000000000..1d11fa9ada9e93505b3d736acb204083f45d5fbf
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/blank.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/close_blue.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/close_blue.png
new file mode 100644
index 0000000000000000000000000000000000000000..297368c821c5cf9fa2f9ec3294a3ff4410238667
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/close_blue.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/close_gold.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/close_gold.png
new file mode 100644
index 0000000000000000000000000000000000000000..d1b847694285ee99bead9f76ced1fe468c92ff66
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/close_gold.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/close_green.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/close_green.png
new file mode 100644
index 0000000000000000000000000000000000000000..83909e2d766a2002e239a69fb0a7ed2e1dc74b9e
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/close_green.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/close_grey.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/close_grey.png
new file mode 100644
index 0000000000000000000000000000000000000000..bc83ac55ef79ac1f8e27c8cdd8b2fba16cf2de8c
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/close_grey.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/close_red.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/close_red.png
new file mode 100644
index 0000000000000000000000000000000000000000..3d835bb305b2ebcf9a876055d53a8a0aef7623b4
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/close_red.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/loading.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/loading.gif
new file mode 100644
index 0000000000000000000000000000000000000000..f864d5fd38b7466c76b5a36dc0e3e9455c0126e2
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/loading.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/next_blue.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/next_blue.gif
new file mode 100644
index 0000000000000000000000000000000000000000..4666e44d3555af0c91cf467c1a94d229fd3d5cf6
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/next_blue.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/next_gold.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/next_gold.gif
new file mode 100644
index 0000000000000000000000000000000000000000..c5ba21f5cf44fd06e65d30739e06c3087b2c2925
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/next_gold.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/next_green.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/next_green.gif
new file mode 100644
index 0000000000000000000000000000000000000000..85a1433b83d52854dd7b968c66e05e12a7da37fd
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/next_green.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/next_grey.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/next_grey.gif
new file mode 100644
index 0000000000000000000000000000000000000000..f1773cd195fe982a3e7911d3ff09cc6c21885a6c
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/next_grey.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/next_red.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/next_red.gif
new file mode 100644
index 0000000000000000000000000000000000000000..4ddff3daec5c54af69221f9c082172f5ec21f74f
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/next_red.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/pause_blue.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/pause_blue.png
new file mode 100644
index 0000000000000000000000000000000000000000..3d4e34f689a96db7b6911bddcaeff8aeedea1777
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/pause_blue.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/pause_gold.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/pause_gold.png
new file mode 100644
index 0000000000000000000000000000000000000000..ee529699c446ee5c2564745088bf695e8349ba5b
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/pause_gold.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/pause_green.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/pause_green.png
new file mode 100644
index 0000000000000000000000000000000000000000..c52f28c1c4e16760ab62c7c356fb6a38dd50b9ed
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/pause_green.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/pause_grey.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/pause_grey.png
new file mode 100644
index 0000000000000000000000000000000000000000..1c2e9e0b21e58eeecd289d94cc5ee561fb3ee16e
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/pause_grey.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/pause_red.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/pause_red.png
new file mode 100644
index 0000000000000000000000000000000000000000..5ee4dcf5cf5b4292a865332a6f4ee4280c42a2c8
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/pause_red.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/play_blue.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/play_blue.png
new file mode 100644
index 0000000000000000000000000000000000000000..c8cd259c46fc4574b987823d88b6507ee8a7c63e
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/play_blue.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/play_gold.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/play_gold.png
new file mode 100644
index 0000000000000000000000000000000000000000..766d6513cef1102218a69434dee315866e166b3f
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/play_gold.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/play_green.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/play_green.png
new file mode 100644
index 0000000000000000000000000000000000000000..6e832a43872ab925516109007c12cf1de141819e
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/play_green.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/play_grey.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/play_grey.png
new file mode 100644
index 0000000000000000000000000000000000000000..8e18760be80a81e21a4864b48f3452e3de7c4057
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/play_grey.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/play_red.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/play_red.png
new file mode 100644
index 0000000000000000000000000000000000000000..887d6449648072b7f85bc494c838323cf2c093e1
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/play_red.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/prev_blue.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/prev_blue.gif
new file mode 100644
index 0000000000000000000000000000000000000000..beba13ef5e1748d02b4cfb88f2ead310fdf06405
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/prev_blue.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/prev_gold.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/prev_gold.gif
new file mode 100644
index 0000000000000000000000000000000000000000..b481932586c7b5324160b79bd3f18bc2a1b26962
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/prev_gold.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/prev_green.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/prev_green.gif
new file mode 100644
index 0000000000000000000000000000000000000000..2d4e14e5230de53ac80a9c0a874b584f1ca0020b
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/prev_green.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/prev_grey.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/prev_grey.gif
new file mode 100644
index 0000000000000000000000000000000000000000..a7f2260a56877db4e24dae5e09072dbc7e2c75b2
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/prev_grey.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/prev_red.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/prev_red.gif
new file mode 100644
index 0000000000000000000000000000000000000000..f702e6333684923a099633f2d8af55cfd928bc6b
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/images/prev_red.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/lytebox.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/lytebox.css
new file mode 100644
index 0000000000000000000000000000000000000000..e01ce7900c61c272fee358a3646f9cdf63045b65
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/lytebox.css
@@ -0,0 +1,93 @@
+#lbOverlay { position: fixed; top: 0; left: 0; z-index: 99998; width: 100%; height: 500px; }
+	#lbOverlay.grey { background-color: #000000; }
+	#lbOverlay.red { background-color: #330000; }
+	#lbOverlay.green { background-color: #003300; }
+	#lbOverlay.blue { background-color: #011D50; }
+	#lbOverlay.gold { background-color: #666600; }
+
+#lbMain { position: absolute; left: 0; width: 100%; z-index: 99999; text-align: center; line-height: 0; }
+#lbMain a img { border: none; }
+
+#lbOuterContainer { position: relative; background-color: #fff; width: 200px; height: 200px; margin: 0 auto; }
+	#lbOuterContainer.grey { border: 3px solid #888888; }
+	#lbOuterContainer.red { border: 3px solid #DD0000; }
+	#lbOuterContainer.green { border: 3px solid #00B000; }
+	#lbOuterContainer.blue { border: 3px solid #5F89D8; }
+	#lbOuterContainer.gold { border: 3px solid #B0B000; }
+
+#lbDetailsContainer {	font: 10px Verdana, Helvetica, sans-serif; background-color: #fff; width: 100%; line-height: 1.4em;	overflow: auto; margin: 0 auto; }
+	#lbDetailsContainer.grey { border: 3px solid #888888; border-top: none; }
+	#lbDetailsContainer.red { border: 3px solid #DD0000; border-top: none; }
+	#lbDetailsContainer.green { border: 3px solid #00B000; border-top: none; }
+	#lbDetailsContainer.blue { border: 3px solid #5F89D8; border-top: none; }
+	#lbDetailsContainer.gold { border: 3px solid #B0B000; border-top: none; }
+
+#lbImageContainer, #lbIframeContainer { padding: 10px; }
+#lbLoading {
+	position: absolute; top: 45%; left: 0%; height: 32px; width: 100%; text-align: center; line-height: 0; background: url(images/loading.gif) center no-repeat;
+}
+
+#lbHoverNav { position: absolute; top: 0; left: 0; height: 100%; width: 100%; z-index: 10; }
+#lbImageContainer>#lbHoverNav { left: 0; }
+#lbHoverNav a { outline: none; }
+
+#lbPrev { width: 49%; height: 100%; background: transparent url(images/blank.gif) no-repeat; display: block; left: 0; float: left; }
+	#lbPrev.grey:hover, #lbPrev.grey:visited:hover { background: url(images/prev_grey.gif) left 15% no-repeat; }
+	#lbPrev.red:hover, #lbPrev.red:visited:hover { background: url(images/prev_red.gif) left 15% no-repeat; }
+	#lbPrev.green:hover, #lbPrev.green:visited:hover { background: url(images/prev_green.gif) left 15% no-repeat; }
+	#lbPrev.blue:hover, #lbPrev.blue:visited:hover { background: url(images/prev_blue.gif) left 15% no-repeat; }
+	#lbPrev.gold:hover, #lbPrev.gold:visited:hover { background: url(images/prev_gold.gif) left 15% no-repeat; }
+	
+#lbNext { width: 49%; height: 100%; background: transparent url(images/blank.gif) no-repeat; display: block; right: 0; float: right; }
+	#lbNext.grey:hover, #lbNext.grey:visited:hover { background: url(images/next_grey.gif) right 15% no-repeat; }
+	#lbNext.red:hover, #lbNext.red:visited:hover { background: url(images/next_red.gif) right 15% no-repeat; }
+	#lbNext.green:hover, #lbNext.green:visited:hover { background: url(images/next_green.gif) right 15% no-repeat; }
+	#lbNext.blue:hover, #lbNext.blue:visited:hover { background: url(images/next_blue.gif) right 15% no-repeat; }
+	#lbNext.gold:hover, #lbNext.gold:visited:hover { background: url(images/next_gold.gif) right 15% no-repeat; }
+
+#lbPrev2, #lbNext2 { text-decoration: none; font-weight: bold; }
+	#lbPrev2.grey, #lbNext2.grey, #lbSpacer.grey { color: #333333; }
+	#lbPrev2.red, #lbNext2.red, #lbSpacer.red { color: #620000; }
+	#lbPrev2.green, #lbNext2.green, #lbSpacer.green { color: #003300; }
+	#lbPrev2.blue, #lbNext2.blue, #lbSpacer.blue { color: #01379E; }
+	#lbPrev2.gold, #lbNext2.gold, #lbSpacer.gold { color: #666600; }
+	
+#lbPrev2_Off, #lbNext2_Off { font-weight: bold; }
+	#lbPrev2_Off.grey, #lbNext2_Off.grey { color: #CCCCCC; }
+	#lbPrev2_Off.red, #lbNext2_Off.red { color: #FFCCCC; }
+	#lbPrev2_Off.green, #lbNext2_Off.green { color: #82FF82; }
+	#lbPrev2_Off.blue, #lbNext2_Off.blue { color: #B7CAEE; }
+	#lbPrev2_Off.gold, #lbNext2_Off.gold { color: #E1E100; }
+	
+#lbDetailsData { padding: 0 10px; }
+	#lbDetailsData.grey { color: #333333; }
+	#lbDetailsData.red { color: #620000; }
+	#lbDetailsData.green { color: #003300; }
+	#lbDetailsData.blue { color: #01379E; }
+	#lbDetailsData.gold { color: #666600; }
+
+#lbDetails { width: 60%; float: left; text-align: left; }
+#lbCaption { display: block; font-weight: bold; }
+#lbNumberDisplay { float: left; display: block; padding-bottom: 1.0em; }
+#lbNavDisplay { float: left; display: block; padding-bottom: 1.0em; }
+
+#lbClose { width: 64px; height: 28px; float: right; margin-bottom: 1px; }
+	#lbClose.grey { background: url(images/close_grey.png) no-repeat; }
+	#lbClose.red { background: url(images/close_red.png) no-repeat; }
+	#lbClose.green { background: url(images/close_green.png) no-repeat; }
+	#lbClose.blue { background: url(images/close_blue.png) no-repeat; }
+	#lbClose.gold { background: url(images/close_gold.png) no-repeat; }
+
+#lbPlay { width: 64px; height: 28px; float: right; margin-bottom: 1px; }
+	#lbPlay.grey { background: url(images/play_grey.png) no-repeat; }
+	#lbPlay.red { background: url(images/play_red.png) no-repeat; }
+	#lbPlay.green { background: url(images/play_green.png) no-repeat; }
+	#lbPlay.blue { background: url(images/play_blue.png) no-repeat; }
+	#lbPlay.gold { background: url(images/play_gold.png) no-repeat; }
+	
+#lbPause { width: 64px; height: 28px; float: right; margin-bottom: 1px; }
+	#lbPause.grey { background: url(images/pause_grey.png) no-repeat; }
+	#lbPause.red { background: url(images/pause_red.png) no-repeat; }
+	#lbPause.green { background: url(images/pause_green.png) no-repeat; }
+	#lbPause.blue { background: url(images/pause_blue.png) no-repeat; }
+	#lbPause.gold { background: url(images/pause_gold.png) no-repeat; }
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/lytebox.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/lytebox.js
new file mode 100644
index 0000000000000000000000000000000000000000..d9e29dc3486aeeb8c8ab9f32b141f7348f422bfe
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/piclens/lytebox/lytebox.js
@@ -0,0 +1,843 @@
+//***********************************************************************************************************************************/
+//	LyteBox v3.22
+//
+//	 Author: Markus F. Hay
+//  Website: http://www.dolem.com/lytebox
+//	   Date: October 2, 2007
+//	License: Creative Commons Attribution 3.0 License (http://creativecommons.org/licenses/by/3.0/)
+// Browsers: Tested successfully on WinXP with the following browsers (using no DOCTYPE and Strict/Transitional/Loose DOCTYPES):
+//				* Firefox: 2.0.0.7, 1.5.0.12
+//				* Internet Explorer: 7.0, 6.0 SP2, 5.5 SP2
+//				* Opera: 9.23
+//
+// Releases: For up-to-date and complete release information, visit http://www.dolem.com/forum/showthread.php?tid=62
+//				* v3.22 (10/02/07)
+//				* v3.21 (09/30/07)
+//				* v3.20 (07/12/07)
+//				* v3.10 (05/28/07)
+//				* v3.00 (05/15/07)
+//				* v2.02 (11/13/06)
+//
+//   Credit: LyteBox was originally derived from the Lightbox class (v2.02) that was written by Lokesh Dhakar. For more
+//			 information please visit http://huddletogether.com/projects/lightbox2/
+//***********************************************************************************************************************************/
+Array.prototype.removeDuplicates = function () { for (var i = 1; i < this.length; i++) { if (this[i][0] == this[i-1][0]) { this.splice(i,1); } } }
+Array.prototype.empty = function () { for (var i = 0; i <= this.length; i++) { this.shift(); } }
+String.prototype.trim = function () { return this.replace(/^\s+|\s+$/g, ''); }
+
+function LyteBox() {
+	/*** Start Global Configuration ***/
+		this.theme				= 'grey';	// themes: grey (default), red, green, blue, gold
+		this.hideFlash			= true;		// controls whether or not Flash objects should be hidden
+		this.outerBorder		= true;		// controls whether to show the outer grey (or theme) border
+		this.resizeSpeed		= 8;		// controls the speed of the image resizing (1=slowest and 10=fastest)
+		this.maxOpacity			= 80;		// higher opacity = darker overlay, lower opacity = lighter overlay
+		this.navType			= 1;		// 1 = "Prev/Next" buttons on top left and left (default), 2 = "<< prev | next >>" links next to image number
+		this.autoResize			= true;		// controls whether or not images should be resized if larger than the browser window dimensions
+		this.doAnimations		= true;		// controls whether or not "animate" Lytebox, i.e. resize transition between images, fade in/out effects, etc.
+		
+		this.borderSize			= 12;		// if you adjust the padding in the CSS, you will need to update this variable -- otherwise, leave this alone...
+	/*** End Global Configuration ***/
+	
+	/*** Configure Slideshow Options ***/
+		this.slideInterval		= 4000;		// Change value (milliseconds) to increase/decrease the time between "slides" (10000 = 10 seconds)
+		this.showNavigation		= true;		// true to display Next/Prev buttons/text during slideshow, false to hide
+		this.showClose			= true;		// true to display the Close button, false to hide
+		this.showDetails		= true;		// true to display image details (caption, count), false to hide
+		this.showPlayPause		= true;		// true to display pause/play buttons next to close button, false to hide
+		this.autoEnd			= true;		// true to automatically close Lytebox after the last image is reached, false to keep open
+		this.pauseOnNextClick	= false;	// true to pause the slideshow when the "Next" button is clicked
+        this.pauseOnPrevClick 	= true;		// true to pause the slideshow when the "Prev" button is clicked
+	/*** End Slideshow Configuration ***/
+	
+	if(this.resizeSpeed > 10) { this.resizeSpeed = 10; }
+	if(this.resizeSpeed < 1) { resizeSpeed = 1; }
+	this.resizeDuration = (11 - this.resizeSpeed) * 0.15;
+	this.resizeWTimerArray		= new Array();
+	this.resizeWTimerCount		= 0;
+	this.resizeHTimerArray		= new Array();
+	this.resizeHTimerCount		= 0;
+	this.showContentTimerArray	= new Array();
+	this.showContentTimerCount	= 0;
+	this.overlayTimerArray		= new Array();
+	this.overlayTimerCount		= 0;
+	this.imageTimerArray		= new Array();
+	this.imageTimerCount		= 0;
+	this.timerIDArray			= new Array();
+	this.timerIDCount			= 0;
+	this.slideshowIDArray		= new Array();
+	this.slideshowIDCount		= 0;
+	this.imageArray	 = new Array();
+	this.activeImage = null;
+	this.slideArray	 = new Array();
+	this.activeSlide = null;
+	this.frameArray	 = new Array();
+	this.activeFrame = null;
+	this.checkFrame();
+	this.isSlideshow = false;
+	this.isLyteframe = false;
+	/*@cc_on
+		/*@if (@_jscript)
+			this.ie = (document.all && !window.opera) ? true : false;
+		/*@else @*/
+			this.ie = false;
+		/*@end
+	@*/
+	this.ie7 = (this.ie && window.XMLHttpRequest);	
+	this.initialize();
+}
+LyteBox.prototype.initialize = function() {
+	this.updateLyteboxItems();
+	var objBody = this.doc.getElementsByTagName("body").item(0);	
+	if (this.doc.getElementById('lbOverlay')) {
+		objBody.removeChild(this.doc.getElementById("lbOverlay"));
+		objBody.removeChild(this.doc.getElementById("lbMain"));
+	}
+	var objOverlay = this.doc.createElement("div");
+		objOverlay.setAttribute('id','lbOverlay');
+		objOverlay.setAttribute((this.ie ? 'className' : 'class'), this.theme);
+		if ((this.ie && !this.ie7) || (this.ie7 && this.doc.compatMode == 'BackCompat')) {
+			objOverlay.style.position = 'absolute';
+		}
+		objOverlay.style.display = 'none';
+		objBody.appendChild(objOverlay);
+	var objLytebox = this.doc.createElement("div");
+		objLytebox.setAttribute('id','lbMain');
+		objLytebox.style.display = 'none';
+		objBody.appendChild(objLytebox);
+	var objOuterContainer = this.doc.createElement("div");
+		objOuterContainer.setAttribute('id','lbOuterContainer');
+		objOuterContainer.setAttribute((this.ie ? 'className' : 'class'), this.theme);
+		objLytebox.appendChild(objOuterContainer);
+	var objIframeContainer = this.doc.createElement("div");
+		objIframeContainer.setAttribute('id','lbIframeContainer');
+		objIframeContainer.style.display = 'none';
+		objOuterContainer.appendChild(objIframeContainer);
+	var objIframe = this.doc.createElement("iframe");
+		objIframe.setAttribute('id','lbIframe');
+		objIframe.setAttribute('name','lbIframe');
+		objIframe.style.display = 'none';
+		objIframeContainer.appendChild(objIframe);
+	var objImageContainer = this.doc.createElement("div");
+		objImageContainer.setAttribute('id','lbImageContainer');
+		objOuterContainer.appendChild(objImageContainer);
+	var objLyteboxImage = this.doc.createElement("img");
+		objLyteboxImage.setAttribute('id','lbImage');
+		objImageContainer.appendChild(objLyteboxImage);
+	var objLoading = this.doc.createElement("div");
+		objLoading.setAttribute('id','lbLoading');
+		objOuterContainer.appendChild(objLoading);
+	var objDetailsContainer = this.doc.createElement("div");
+		objDetailsContainer.setAttribute('id','lbDetailsContainer');
+		objDetailsContainer.setAttribute((this.ie ? 'className' : 'class'), this.theme);
+		objLytebox.appendChild(objDetailsContainer);
+	var objDetailsData =this.doc.createElement("div");
+		objDetailsData.setAttribute('id','lbDetailsData');
+		objDetailsData.setAttribute((this.ie ? 'className' : 'class'), this.theme);
+		objDetailsContainer.appendChild(objDetailsData);
+	var objDetails = this.doc.createElement("div");
+		objDetails.setAttribute('id','lbDetails');
+		objDetailsData.appendChild(objDetails);
+	var objCaption = this.doc.createElement("span");
+		objCaption.setAttribute('id','lbCaption');
+		objDetails.appendChild(objCaption);
+	var objHoverNav = this.doc.createElement("div");
+		objHoverNav.setAttribute('id','lbHoverNav');
+		objImageContainer.appendChild(objHoverNav);
+	var objBottomNav = this.doc.createElement("div");
+		objBottomNav.setAttribute('id','lbBottomNav');
+		objDetailsData.appendChild(objBottomNav);
+	var objPrev = this.doc.createElement("a");
+		objPrev.setAttribute('id','lbPrev');
+		objPrev.setAttribute((this.ie ? 'className' : 'class'), this.theme);
+		objPrev.setAttribute('href','#');
+		objHoverNav.appendChild(objPrev);
+	var objNext = this.doc.createElement("a");
+		objNext.setAttribute('id','lbNext');
+		objNext.setAttribute((this.ie ? 'className' : 'class'), this.theme);
+		objNext.setAttribute('href','#');
+		objHoverNav.appendChild(objNext);
+	var objNumberDisplay = this.doc.createElement("span");
+		objNumberDisplay.setAttribute('id','lbNumberDisplay');
+		objDetails.appendChild(objNumberDisplay);
+	var objNavDisplay = this.doc.createElement("span");
+		objNavDisplay.setAttribute('id','lbNavDisplay');
+		objNavDisplay.style.display = 'none';
+		objDetails.appendChild(objNavDisplay);
+	var objClose = this.doc.createElement("a");
+		objClose.setAttribute('id','lbClose');
+		objClose.setAttribute((this.ie ? 'className' : 'class'), this.theme);
+		objClose.setAttribute('href','#');
+		objBottomNav.appendChild(objClose);
+	var objPause = this.doc.createElement("a");
+		objPause.setAttribute('id','lbPause');
+		objPause.setAttribute((this.ie ? 'className' : 'class'), this.theme);
+		objPause.setAttribute('href','#');
+		objPause.style.display = 'none';
+		objBottomNav.appendChild(objPause);
+	var objPlay = this.doc.createElement("a");
+		objPlay.setAttribute('id','lbPlay');
+		objPlay.setAttribute((this.ie ? 'className' : 'class'), this.theme);
+		objPlay.setAttribute('href','#');
+		objPlay.style.display = 'none';
+		objBottomNav.appendChild(objPlay);
+};
+LyteBox.prototype.updateLyteboxItems = function() {	
+	var anchors = (this.isFrame) ? window.parent.frames[window.name].document.getElementsByTagName('a') : document.getElementsByTagName('a');
+	for (var i = 0; i < anchors.length; i++) {
+		var anchor = anchors[i];
+		var relAttribute = String(anchor.getAttribute('rel'));
+		if (anchor.getAttribute('href')) {
+			if (relAttribute.toLowerCase().match('lytebox')) {
+				anchor.onclick = function () { myLytebox.start(this, false, false); return false; }
+			} else if (relAttribute.toLowerCase().match('lyteshow')) {
+				anchor.onclick = function () { myLytebox.start(this, true, false); return false; }
+			} else if (relAttribute.toLowerCase().match('lyteframe')) {
+				anchor.onclick = function () { myLytebox.start(this, false, true); return false; }
+			}
+		}
+	}
+};
+LyteBox.prototype.start = function(imageLink, doSlide, doFrame) {
+	if (this.ie && !this.ie7) {	this.toggleSelects('hide');	}
+	if (this.hideFlash) { this.toggleFlash('hide'); }
+	this.isLyteframe = (doFrame ? true : false);
+	var pageSize	= this.getPageSize();
+	var objOverlay	= this.doc.getElementById('lbOverlay');
+	var objBody		= this.doc.getElementsByTagName("body").item(0);
+	objOverlay.style.height = pageSize[1] + "px";
+	objOverlay.style.display = '';
+	this.appear('lbOverlay', (this.doAnimations ? 0 : this.maxOpacity));
+	var anchors = (this.isFrame) ? window.parent.frames[window.name].document.getElementsByTagName('a') : document.getElementsByTagName('a');
+	if (this.isLyteframe) {
+		this.frameArray = [];
+		this.frameNum = 0;
+		if ((imageLink.getAttribute('rel') == 'lyteframe')) {
+			var rev = imageLink.getAttribute('rev');
+			this.frameArray.push(new Array(imageLink.getAttribute('href'), imageLink.getAttribute('title'), (rev == null || rev == '' ? 'width: 400px; height: 400px; scrolling: auto;' : rev)));
+		} else {
+			if (imageLink.getAttribute('rel').indexOf('lyteframe') != -1) {
+				for (var i = 0; i < anchors.length; i++) {
+					var anchor = anchors[i];
+					if (anchor.getAttribute('href') && (anchor.getAttribute('rel') == imageLink.getAttribute('rel'))) {
+						var rev = anchor.getAttribute('rev');
+						this.frameArray.push(new Array(anchor.getAttribute('href'), anchor.getAttribute('title'), (rev == null || rev == '' ? 'width: 400px; height: 400px; scrolling: auto;' : rev)));
+					}
+				}
+				this.frameArray.removeDuplicates();
+				while(this.frameArray[this.frameNum][0] != imageLink.getAttribute('href')) { this.frameNum++; }
+			}
+		}
+	} else {
+		this.imageArray = [];
+		this.imageNum = 0;
+		this.slideArray = [];
+		this.slideNum = 0;
+		if ((imageLink.getAttribute('rel') == 'lytebox')) {
+			this.imageArray.push(new Array(imageLink.getAttribute('href'), imageLink.getAttribute('title')));
+		} else {
+			if (imageLink.getAttribute('rel').indexOf('lytebox') != -1) {
+				for (var i = 0; i < anchors.length; i++) {
+					var anchor = anchors[i];
+					if (anchor.getAttribute('href') && (anchor.getAttribute('rel') == imageLink.getAttribute('rel'))) {
+						this.imageArray.push(new Array(anchor.getAttribute('href'), anchor.getAttribute('title')));
+					}
+				}
+				this.imageArray.removeDuplicates();
+				while(this.imageArray[this.imageNum][0] != imageLink.getAttribute('href')) { this.imageNum++; }
+			}
+			if (imageLink.getAttribute('rel').indexOf('lyteshow') != -1) {
+				for (var i = 0; i < anchors.length; i++) {
+					var anchor = anchors[i];
+					if (anchor.getAttribute('href') && (anchor.getAttribute('rel') == imageLink.getAttribute('rel'))) {
+						this.slideArray.push(new Array(anchor.getAttribute('href'), anchor.getAttribute('title')));
+					}
+				}
+				this.slideArray.removeDuplicates();
+				while(this.slideArray[this.slideNum][0] != imageLink.getAttribute('href')) { this.slideNum++; }
+			}
+		}
+	}
+	var object = this.doc.getElementById('lbMain');
+		object.style.top = (this.getPageScroll() + (pageSize[3] / 15)) + "px";
+		object.style.display = '';
+	if (!this.outerBorder) {
+		this.doc.getElementById('lbOuterContainer').style.border = 'none';
+		this.doc.getElementById('lbDetailsContainer').style.border = 'none';
+	} else {
+		this.doc.getElementById('lbOuterContainer').style.borderBottom = '';
+		this.doc.getElementById('lbOuterContainer').setAttribute((this.ie ? 'className' : 'class'), this.theme);
+	}
+	this.doc.getElementById('lbOverlay').onclick = function() { myLytebox.end(); return false; }
+	this.doc.getElementById('lbMain').onclick = function(e) {
+		var e = e;
+		if (!e) {
+			if (window.parent.frames[window.name] && (parent.document.getElementsByTagName('frameset').length <= 0)) {
+				e = window.parent.window.event;
+			} else {
+				e = window.event;
+			}
+		}
+		var id = (e.target ? e.target.id : e.srcElement.id);
+		if (id == 'lbMain') { myLytebox.end(); return false; }
+	}
+	this.doc.getElementById('lbClose').onclick = function() { myLytebox.end(); return false; }
+	this.doc.getElementById('lbPause').onclick = function() { myLytebox.togglePlayPause("lbPause", "lbPlay"); return false; }
+	this.doc.getElementById('lbPlay').onclick = function() { myLytebox.togglePlayPause("lbPlay", "lbPause"); return false; }	
+	this.isSlideshow = doSlide;
+	this.isPaused = (this.slideNum != 0 ? true : false);
+	if (this.isSlideshow && this.showPlayPause && this.isPaused) {
+		this.doc.getElementById('lbPlay').style.display = '';
+		this.doc.getElementById('lbPause').style.display = 'none';
+	}
+	if (this.isLyteframe) {
+		this.changeContent(this.frameNum);
+	} else {
+		if (this.isSlideshow) {
+			this.changeContent(this.slideNum);
+		} else {
+			this.changeContent(this.imageNum);
+		}
+	}
+};
+LyteBox.prototype.changeContent = function(imageNum) {
+	if (this.isSlideshow) {
+		for (var i = 0; i < this.slideshowIDCount; i++) { window.clearTimeout(this.slideshowIDArray[i]); }
+	}
+	this.activeImage = this.activeSlide = this.activeFrame = imageNum;
+	if (!this.outerBorder) {
+		this.doc.getElementById('lbOuterContainer').style.border = 'none';
+		this.doc.getElementById('lbDetailsContainer').style.border = 'none';
+	} else {
+		this.doc.getElementById('lbOuterContainer').style.borderBottom = '';
+		this.doc.getElementById('lbOuterContainer').setAttribute((this.ie ? 'className' : 'class'), this.theme);
+	}
+	this.doc.getElementById('lbLoading').style.display = '';
+	this.doc.getElementById('lbImage').style.display = 'none';
+	this.doc.getElementById('lbIframe').style.display = 'none';
+	this.doc.getElementById('lbPrev').style.display = 'none';
+	this.doc.getElementById('lbNext').style.display = 'none';
+	this.doc.getElementById('lbIframeContainer').style.display = 'none';
+	this.doc.getElementById('lbDetailsContainer').style.display = 'none';
+	this.doc.getElementById('lbNumberDisplay').style.display = 'none';
+	if (this.navType == 2 || this.isLyteframe) {
+		object = this.doc.getElementById('lbNavDisplay');
+		object.innerHTML = '&nbsp;&nbsp;&nbsp;<span id="lbPrev2_Off" style="display: none;" class="' + this.theme + '">&laquo; prev</span><a href="#" id="lbPrev2" class="' + this.theme + '" style="display: none;">&laquo; prev</a> <b id="lbSpacer" class="' + this.theme + '">||</b> <span id="lbNext2_Off" style="display: none;" class="' + this.theme + '">next &raquo;</span><a href="#" id="lbNext2" class="' + this.theme + '" style="display: none;">next &raquo;</a>';
+		object.style.display = 'none';
+	}
+	if (this.isLyteframe) {
+		var iframe = myLytebox.doc.getElementById('lbIframe');
+		var styles = this.frameArray[this.activeFrame][2];
+		var aStyles = styles.split(';');
+		for (var i = 0; i < aStyles.length; i++) {
+			if (aStyles[i].indexOf('width:') >= 0) {
+				var w = aStyles[i].replace('width:', '');
+				iframe.width = w.trim();
+			} else if (aStyles[i].indexOf('height:') >= 0) {
+				var h = aStyles[i].replace('height:', '');
+				iframe.height = h.trim();
+			} else if (aStyles[i].indexOf('scrolling:') >= 0) {
+				var s = aStyles[i].replace('scrolling:', '');
+				iframe.scrolling = s.trim();
+			} else if (aStyles[i].indexOf('border:') >= 0) {
+				// Not implemented yet, as there are cross-platform issues with setting the border (from a GUI standpoint)
+				//var b = aStyles[i].replace('border:', '');
+				//iframe.style.border = b.trim();
+			}
+		}
+		this.resizeContainer(parseInt(iframe.width), parseInt(iframe.height));
+	} else {
+		imgPreloader = new Image();
+		imgPreloader.onload = function() {
+			var imageWidth = imgPreloader.width;
+			var imageHeight = imgPreloader.height;
+			if (myLytebox.autoResize) {
+				var pagesize = myLytebox.getPageSize();
+				var x = pagesize[2] - 150;
+				var y = pagesize[3] - 150;
+				if (imageWidth > x) {
+					imageHeight = Math.round(imageHeight * (x / imageWidth));
+					imageWidth = x; 
+					if (imageHeight > y) { 
+						imageWidth = Math.round(imageWidth * (y / imageHeight));
+						imageHeight = y; 
+					}
+				} else if (imageHeight > y) { 
+					imageWidth = Math.round(imageWidth * (y / imageHeight));
+					imageHeight = y; 
+					if (imageWidth > x) {
+						imageHeight = Math.round(imageHeight * (x / imageWidth));
+						imageWidth = x;
+					}
+				}
+			}
+			var lbImage = myLytebox.doc.getElementById('lbImage')
+			lbImage.src = (myLytebox.isSlideshow ? myLytebox.slideArray[myLytebox.activeSlide][0] : myLytebox.imageArray[myLytebox.activeImage][0]);
+			lbImage.width = imageWidth;
+			lbImage.height = imageHeight;
+			myLytebox.resizeContainer(imageWidth, imageHeight);
+			imgPreloader.onload = function() {};
+		}
+		imgPreloader.src = (this.isSlideshow ? this.slideArray[this.activeSlide][0] : this.imageArray[this.activeImage][0]);
+	}
+};
+LyteBox.prototype.resizeContainer = function(imgWidth, imgHeight) {
+	this.wCur = this.doc.getElementById('lbOuterContainer').offsetWidth;
+	this.hCur = this.doc.getElementById('lbOuterContainer').offsetHeight;
+	this.xScale = ((imgWidth  + (this.borderSize * 2)) / this.wCur) * 100;
+	this.yScale = ((imgHeight  + (this.borderSize * 2)) / this.hCur) * 100;
+	var wDiff = (this.wCur - this.borderSize * 2) - imgWidth;
+	var hDiff = (this.hCur - this.borderSize * 2) - imgHeight;
+	if (!(hDiff == 0)) {
+		this.hDone = false;
+		this.resizeH('lbOuterContainer', this.hCur, imgHeight + this.borderSize*2, this.getPixelRate(this.hCur, imgHeight));
+	} else {
+		this.hDone = true;
+	}
+	if (!(wDiff == 0)) {
+		this.wDone = false;
+		this.resizeW('lbOuterContainer', this.wCur, imgWidth + this.borderSize*2, this.getPixelRate(this.wCur, imgWidth));
+	} else {
+		this.wDone = true;
+	}
+	if ((hDiff == 0) && (wDiff == 0)) {
+		if (this.ie){ this.pause(250); } else { this.pause(100); } 
+	}
+	this.doc.getElementById('lbPrev').style.height = imgHeight + "px";
+	this.doc.getElementById('lbNext').style.height = imgHeight + "px";
+	this.doc.getElementById('lbDetailsContainer').style.width = (imgWidth + (this.borderSize * 2) + (this.ie && this.doc.compatMode == "BackCompat" && this.outerBorder ? 2 : 0)) + "px";
+	this.showContent();
+};
+LyteBox.prototype.showContent = function() {
+	if (this.wDone && this.hDone) {
+		for (var i = 0; i < this.showContentTimerCount; i++) { window.clearTimeout(this.showContentTimerArray[i]); }
+		if (this.outerBorder) {
+			this.doc.getElementById('lbOuterContainer').style.borderBottom = 'none';
+		}
+		this.doc.getElementById('lbLoading').style.display = 'none';
+		if (this.isLyteframe) {
+			this.doc.getElementById('lbIframe').style.display = '';
+			this.appear('lbIframe', (this.doAnimations ? 0 : 100));
+		} else {
+			this.doc.getElementById('lbImage').style.display = '';
+			this.appear('lbImage', (this.doAnimations ? 0 : 100));
+			this.preloadNeighborImages();
+		}
+		if (this.isSlideshow) {
+			if(this.activeSlide == (this.slideArray.length - 1)) {
+				if (this.autoEnd) {
+					this.slideshowIDArray[this.slideshowIDCount++] = setTimeout("myLytebox.end('slideshow')", this.slideInterval);
+				}
+			} else {
+				if (!this.isPaused) {
+					this.slideshowIDArray[this.slideshowIDCount++] = setTimeout("myLytebox.changeContent("+(this.activeSlide+1)+")", this.slideInterval);
+				}
+			}
+			this.doc.getElementById('lbHoverNav').style.display = (this.showNavigation && this.navType == 1 ? '' : 'none');
+			this.doc.getElementById('lbClose').style.display = (this.showClose ? '' : 'none');
+			this.doc.getElementById('lbDetails').style.display = (this.showDetails ? '' : 'none');
+			this.doc.getElementById('lbPause').style.display = (this.showPlayPause && !this.isPaused ? '' : 'none');
+			this.doc.getElementById('lbPlay').style.display = (this.showPlayPause && !this.isPaused ? 'none' : '');
+			this.doc.getElementById('lbNavDisplay').style.display = (this.showNavigation && this.navType == 2 ? '' : 'none');
+		} else {
+			this.doc.getElementById('lbHoverNav').style.display = (this.navType == 1 && !this.isLyteframe ? '' : 'none');
+			if ((this.navType == 2 && !this.isLyteframe && this.imageArray.length > 1) || (this.frameArray.length > 1 && this.isLyteframe)) {
+				this.doc.getElementById('lbNavDisplay').style.display = '';
+			} else {
+				this.doc.getElementById('lbNavDisplay').style.display = 'none';
+			}
+			this.doc.getElementById('lbClose').style.display = '';
+			this.doc.getElementById('lbDetails').style.display = '';
+			this.doc.getElementById('lbPause').style.display = 'none';
+			this.doc.getElementById('lbPlay').style.display = 'none';
+		}
+		this.doc.getElementById('lbImageContainer').style.display = (this.isLyteframe ? 'none' : '');
+		this.doc.getElementById('lbIframeContainer').style.display = (this.isLyteframe ? '' : 'none');
+		try {
+			this.doc.getElementById('lbIframe').src = this.frameArray[this.activeFrame][0];
+		} catch(e) { }
+	} else {
+		this.showContentTimerArray[this.showContentTimerCount++] = setTimeout("myLytebox.showContent()", 200);
+	}
+};
+LyteBox.prototype.updateDetails = function() {
+	var object = this.doc.getElementById('lbCaption');
+	var sTitle = (this.isSlideshow ? this.slideArray[this.activeSlide][1] : (this.isLyteframe ? this.frameArray[this.activeFrame][1] : this.imageArray[this.activeImage][1]));
+	object.style.display = '';
+	object.innerHTML = (sTitle == null ? '' : sTitle);
+	this.updateNav();
+	this.doc.getElementById('lbDetailsContainer').style.display = '';
+	object = this.doc.getElementById('lbNumberDisplay');
+	if (this.isSlideshow && this.slideArray.length > 1) {
+		object.style.display = '';
+		object.innerHTML = "Image " + eval(this.activeSlide + 1) + " of " + this.slideArray.length;
+		this.doc.getElementById('lbNavDisplay').style.display = (this.navType == 2 && this.showNavigation ? '' : 'none');
+	} else if (this.imageArray.length > 1 && !this.isLyteframe) {
+		object.style.display = '';
+		object.innerHTML = "Image " + eval(this.activeImage + 1) + " of " + this.imageArray.length;
+		this.doc.getElementById('lbNavDisplay').style.display = (this.navType == 2 ? '' : 'none');
+	} else if (this.frameArray.length > 1 && this.isLyteframe) {
+		object.style.display = '';
+		object.innerHTML = "Page " + eval(this.activeFrame + 1) + " of " + this.frameArray.length;
+		this.doc.getElementById('lbNavDisplay').style.display = '';
+	} else {
+		this.doc.getElementById('lbNavDisplay').style.display = 'none';
+	}
+	this.appear('lbDetailsContainer', (this.doAnimations ? 0 : 100));
+};
+LyteBox.prototype.updateNav = function() {
+	if (this.isSlideshow) {
+		if (this.activeSlide != 0) {
+			var object = (this.navType == 2 ? this.doc.getElementById('lbPrev2') : this.doc.getElementById('lbPrev'));
+				object.style.display = '';
+				object.onclick = function() {
+					if (myLytebox.pauseOnPrevClick) { myLytebox.togglePlayPause("lbPause", "lbPlay"); }
+					myLytebox.changeContent(myLytebox.activeSlide - 1); return false;
+				}
+		} else {
+			if (this.navType == 2) { this.doc.getElementById('lbPrev2_Off').style.display = ''; }
+		}
+		if (this.activeSlide != (this.slideArray.length - 1)) {
+			var object = (this.navType == 2 ? this.doc.getElementById('lbNext2') : this.doc.getElementById('lbNext'));
+				object.style.display = '';
+				object.onclick = function() {
+					if (myLytebox.pauseOnNextClick) { myLytebox.togglePlayPause("lbPause", "lbPlay"); }
+					myLytebox.changeContent(myLytebox.activeSlide + 1); return false;
+				}
+		} else {
+			if (this.navType == 2) { this.doc.getElementById('lbNext2_Off').style.display = ''; }
+		}
+	} else if (this.isLyteframe) {
+		if(this.activeFrame != 0) {
+			var object = this.doc.getElementById('lbPrev2');
+				object.style.display = '';
+				object.onclick = function() {
+					myLytebox.changeContent(myLytebox.activeFrame - 1); return false;
+				}
+		} else {
+			this.doc.getElementById('lbPrev2_Off').style.display = '';
+		}
+		if(this.activeFrame != (this.frameArray.length - 1)) {
+			var object = this.doc.getElementById('lbNext2');
+				object.style.display = '';
+				object.onclick = function() {
+					myLytebox.changeContent(myLytebox.activeFrame + 1); return false;
+				}
+		} else {
+			this.doc.getElementById('lbNext2_Off').style.display = '';
+		}		
+	} else {
+		if(this.activeImage != 0) {
+			var object = (this.navType == 2 ? this.doc.getElementById('lbPrev2') : this.doc.getElementById('lbPrev'));
+				object.style.display = '';
+				object.onclick = function() {
+					myLytebox.changeContent(myLytebox.activeImage - 1); return false;
+				}
+		} else {
+			if (this.navType == 2) { this.doc.getElementById('lbPrev2_Off').style.display = ''; }
+		}
+		if(this.activeImage != (this.imageArray.length - 1)) {
+			var object = (this.navType == 2 ? this.doc.getElementById('lbNext2') : this.doc.getElementById('lbNext'));
+				object.style.display = '';
+				object.onclick = function() {
+					myLytebox.changeContent(myLytebox.activeImage + 1); return false;
+				}
+		} else {
+			if (this.navType == 2) { this.doc.getElementById('lbNext2_Off').style.display = ''; }
+		}
+	}
+	this.enableKeyboardNav();
+};
+LyteBox.prototype.enableKeyboardNav = function() { document.onkeydown = this.keyboardAction; };
+LyteBox.prototype.disableKeyboardNav = function() { document.onkeydown = ''; };
+LyteBox.prototype.keyboardAction = function(e) {
+	var keycode = key = escape = null;
+	keycode	= (e == null) ? event.keyCode : e.which;
+	key		= String.fromCharCode(keycode).toLowerCase();
+	escape  = (e == null) ? 27 : e.DOM_VK_ESCAPE;
+	if ((key == 'x') || (key == 'c') || (keycode == escape)) {
+		myLytebox.end();
+	} else if ((key == 'p') || (keycode == 37)) {
+		if (myLytebox.isSlideshow) {
+			if(myLytebox.activeSlide != 0) {
+				myLytebox.disableKeyboardNav();
+				myLytebox.changeContent(myLytebox.activeSlide - 1);
+			}
+		} else if (myLytebox.isLyteframe) {
+			if(myLytebox.activeFrame != 0) {
+				myLytebox.disableKeyboardNav();
+				myLytebox.changeContent(myLytebox.activeFrame - 1);
+			}
+		} else {
+			if(myLytebox.activeImage != 0) {
+				myLytebox.disableKeyboardNav();
+				myLytebox.changeContent(myLytebox.activeImage - 1);
+			}
+		}
+	} else if ((key == 'n') || (keycode == 39)) {
+		if (myLytebox.isSlideshow) {
+			if(myLytebox.activeSlide != (myLytebox.slideArray.length - 1)) {
+				myLytebox.disableKeyboardNav();
+				myLytebox.changeContent(myLytebox.activeSlide + 1);
+			}
+		} else if (myLytebox.isLyteframe) {
+			if(myLytebox.activeFrame != (myLytebox.frameArray.length - 1)) {
+				myLytebox.disableKeyboardNav();
+				myLytebox.changeContent(myLytebox.activeFrame + 1);
+			}
+		} else {
+			if(myLytebox.activeImage != (myLytebox.imageArray.length - 1)) {
+				myLytebox.disableKeyboardNav();
+				myLytebox.changeContent(myLytebox.activeImage + 1);
+			}
+		}
+	}
+};
+LyteBox.prototype.preloadNeighborImages = function() {
+	if (this.isSlideshow) {
+		if ((this.slideArray.length - 1) > this.activeSlide) {
+			preloadNextImage = new Image();
+			preloadNextImage.src = this.slideArray[this.activeSlide + 1][0];
+		}
+		if(this.activeSlide > 0) {
+			preloadPrevImage = new Image();
+			preloadPrevImage.src = this.slideArray[this.activeSlide - 1][0];
+		}
+	} else {
+		if ((this.imageArray.length - 1) > this.activeImage) {
+			preloadNextImage = new Image();
+			preloadNextImage.src = this.imageArray[this.activeImage + 1][0];
+		}
+		if(this.activeImage > 0) {
+			preloadPrevImage = new Image();
+			preloadPrevImage.src = this.imageArray[this.activeImage - 1][0];
+		}
+	}
+};
+LyteBox.prototype.togglePlayPause = function(hideID, showID) {
+	if (this.isSlideshow && hideID == "lbPause") {
+		for (var i = 0; i < this.slideshowIDCount; i++) { window.clearTimeout(this.slideshowIDArray[i]); }
+	}
+	this.doc.getElementById(hideID).style.display = 'none';
+	this.doc.getElementById(showID).style.display = '';
+	if (hideID == "lbPlay") {
+		this.isPaused = false;
+		if (this.activeSlide == (this.slideArray.length - 1)) {
+			this.end();
+		} else {
+			this.changeContent(this.activeSlide + 1);
+		}
+	} else {
+		this.isPaused = true;
+	}
+};
+LyteBox.prototype.end = function(caller) {
+	var closeClick = (caller == 'slideshow' ? false : true);
+	if (this.isSlideshow && this.isPaused && !closeClick) { return; }
+	this.disableKeyboardNav();
+	this.doc.getElementById('lbMain').style.display = 'none';
+	this.fade('lbOverlay', (this.doAnimations ? this.maxOpacity : 0));
+	this.toggleSelects('visible');
+	if (this.hideFlash) { this.toggleFlash('visible'); }
+	if (this.isSlideshow) {
+		for (var i = 0; i < this.slideshowIDCount; i++) { window.clearTimeout(this.slideshowIDArray[i]); }
+	}
+	if (this.isLyteframe) {
+		 this.initialize();
+	}
+};
+LyteBox.prototype.checkFrame = function() {
+	if (window.parent.frames[window.name] && (parent.document.getElementsByTagName('frameset').length <= 0)) {
+		this.isFrame = true;
+		this.lytebox = "window.parent." + window.name + ".myLytebox";
+		this.doc = parent.document;
+	} else {
+		this.isFrame = false;
+		this.lytebox = "myLytebox";
+		this.doc = document;
+	}
+};
+LyteBox.prototype.getPixelRate = function(cur, img) {
+	var diff = (img > cur) ? img - cur : cur - img;
+	if (diff >= 0 && diff <= 100) { return 10; }
+	if (diff > 100 && diff <= 200) { return 15; }
+	if (diff > 200 && diff <= 300) { return 20; }
+	if (diff > 300 && diff <= 400) { return 25; }
+	if (diff > 400 && diff <= 500) { return 30; }
+	if (diff > 500 && diff <= 600) { return 35; }
+	if (diff > 600 && diff <= 700) { return 40; }
+	if (diff > 700) { return 45; }
+};
+LyteBox.prototype.appear = function(id, opacity) {
+	var object = this.doc.getElementById(id).style;
+	object.opacity = (opacity / 100);
+	object.MozOpacity = (opacity / 100);
+	object.KhtmlOpacity = (opacity / 100);
+	object.filter = "alpha(opacity=" + (opacity + 10) + ")";
+	if (opacity == 100 && (id == 'lbImage' || id == 'lbIframe')) {
+		try { object.removeAttribute("filter"); } catch(e) {}	/* Fix added for IE Alpha Opacity Filter bug. */
+		this.updateDetails();
+	} else if (opacity >= this.maxOpacity && id == 'lbOverlay') {
+		for (var i = 0; i < this.overlayTimerCount; i++) { window.clearTimeout(this.overlayTimerArray[i]); }
+		return;
+	} else if (opacity >= 100 && id == 'lbDetailsContainer') {
+		try { object.removeAttribute("filter"); } catch(e) {}	/* Fix added for IE Alpha Opacity Filter bug. */
+		for (var i = 0; i < this.imageTimerCount; i++) { window.clearTimeout(this.imageTimerArray[i]); }
+		this.doc.getElementById('lbOverlay').style.height = this.getPageSize()[1] + "px";
+	} else {
+		if (id == 'lbOverlay') {
+			this.overlayTimerArray[this.overlayTimerCount++] = setTimeout("myLytebox.appear('" + id + "', " + (opacity+20) + ")", 1);
+		} else {
+			this.imageTimerArray[this.imageTimerCount++] = setTimeout("myLytebox.appear('" + id + "', " + (opacity+10) + ")", 1);
+		}
+	}
+};
+LyteBox.prototype.fade = function(id, opacity) {
+	var object = this.doc.getElementById(id).style;
+	object.opacity = (opacity / 100);
+	object.MozOpacity = (opacity / 100);
+	object.KhtmlOpacity = (opacity / 100);
+	object.filter = "alpha(opacity=" + opacity + ")";
+	if (opacity <= 0) {
+		try {
+			object.display = 'none';
+		} catch(err) { }
+	} else if (id == 'lbOverlay') {
+		this.overlayTimerArray[this.overlayTimerCount++] = setTimeout("myLytebox.fade('" + id + "', " + (opacity-20) + ")", 1);
+	} else {
+		this.timerIDArray[this.timerIDCount++] = setTimeout("myLytebox.fade('" + id + "', " + (opacity-10) + ")", 1);
+	}
+};
+LyteBox.prototype.resizeW = function(id, curW, maxW, pixelrate, speed) {
+	if (!this.hDone) {
+		this.resizeWTimerArray[this.resizeWTimerCount++] = setTimeout("myLytebox.resizeW('" + id + "', " + curW + ", " + maxW + ", " + pixelrate + ")", 100);
+		return;
+	}
+	var object = this.doc.getElementById(id);
+	var timer = speed ? speed : (this.resizeDuration/2);
+	var newW = (this.doAnimations ? curW : maxW);
+	object.style.width = (newW) + "px";
+	if (newW < maxW) {
+		newW += (newW + pixelrate >= maxW) ? (maxW - newW) : pixelrate;
+	} else if (newW > maxW) {
+		newW -= (newW - pixelrate <= maxW) ? (newW - maxW) : pixelrate;
+	}
+	this.resizeWTimerArray[this.resizeWTimerCount++] = setTimeout("myLytebox.resizeW('" + id + "', " + newW + ", " + maxW + ", " + pixelrate + ", " + (timer+0.02) + ")", timer+0.02);
+	if (parseInt(object.style.width) == maxW) {
+		this.wDone = true;
+		for (var i = 0; i < this.resizeWTimerCount; i++) { window.clearTimeout(this.resizeWTimerArray[i]); }
+	}
+};
+LyteBox.prototype.resizeH = function(id, curH, maxH, pixelrate, speed) {
+	var timer = speed ? speed : (this.resizeDuration/2);
+	var object = this.doc.getElementById(id);
+	var newH = (this.doAnimations ? curH : maxH);
+	object.style.height = (newH) + "px";
+	if (newH < maxH) {
+		newH += (newH + pixelrate >= maxH) ? (maxH - newH) : pixelrate;
+	} else if (newH > maxH) {
+		newH -= (newH - pixelrate <= maxH) ? (newH - maxH) : pixelrate;
+	}
+	this.resizeHTimerArray[this.resizeHTimerCount++] = setTimeout("myLytebox.resizeH('" + id + "', " + newH + ", " + maxH + ", " + pixelrate + ", " + (timer+.02) + ")", timer+.02);
+	if (parseInt(object.style.height) == maxH) {
+		this.hDone = true;
+		for (var i = 0; i < this.resizeHTimerCount; i++) { window.clearTimeout(this.resizeHTimerArray[i]); }
+	}
+};
+LyteBox.prototype.getPageScroll = function() {
+	if (self.pageYOffset) {
+		return this.isFrame ? parent.pageYOffset : self.pageYOffset;
+	} else if (this.doc.documentElement && this.doc.documentElement.scrollTop){
+		return this.doc.documentElement.scrollTop;
+	} else if (document.body) {
+		return this.doc.body.scrollTop;
+	}
+};
+LyteBox.prototype.getPageSize = function() {	
+	var xScroll, yScroll, windowWidth, windowHeight;
+	if (window.innerHeight && window.scrollMaxY) {
+		xScroll = this.doc.scrollWidth;
+		yScroll = (this.isFrame ? parent.innerHeight : self.innerHeight) + (this.isFrame ? parent.scrollMaxY : self.scrollMaxY);
+	} else if (this.doc.body.scrollHeight > this.doc.body.offsetHeight){
+		xScroll = this.doc.body.scrollWidth;
+		yScroll = this.doc.body.scrollHeight;
+	} else {
+		xScroll = this.doc.getElementsByTagName("html").item(0).offsetWidth;
+		yScroll = this.doc.getElementsByTagName("html").item(0).offsetHeight;
+		xScroll = (xScroll < this.doc.body.offsetWidth) ? this.doc.body.offsetWidth : xScroll;
+		yScroll = (yScroll < this.doc.body.offsetHeight) ? this.doc.body.offsetHeight : yScroll;
+	}
+	if (self.innerHeight) {
+		windowWidth = (this.isFrame) ? parent.innerWidth : self.innerWidth;
+		windowHeight = (this.isFrame) ? parent.innerHeight : self.innerHeight;
+	} else if (document.documentElement && document.documentElement.clientHeight) {
+		windowWidth = this.doc.documentElement.clientWidth;
+		windowHeight = this.doc.documentElement.clientHeight;
+	} else if (document.body) {
+		windowWidth = this.doc.getElementsByTagName("html").item(0).clientWidth;
+		windowHeight = this.doc.getElementsByTagName("html").item(0).clientHeight;
+		windowWidth = (windowWidth == 0) ? this.doc.body.clientWidth : windowWidth;
+		windowHeight = (windowHeight == 0) ? this.doc.body.clientHeight : windowHeight;
+	}
+	var pageHeight = (yScroll < windowHeight) ? windowHeight : yScroll;
+	var pageWidth = (xScroll < windowWidth) ? windowWidth : xScroll;
+	return new Array(pageWidth, pageHeight, windowWidth, windowHeight);
+};
+LyteBox.prototype.toggleFlash = function(state) {
+	var objects = this.doc.getElementsByTagName("object");
+	for (var i = 0; i < objects.length; i++) {
+		objects[i].style.visibility = (state == "hide") ? 'hidden' : 'visible';
+	}
+	var embeds = this.doc.getElementsByTagName("embed");
+	for (var i = 0; i < embeds.length; i++) {
+		embeds[i].style.visibility = (state == "hide") ? 'hidden' : 'visible';
+	}
+	if (this.isFrame) {
+		for (var i = 0; i < parent.frames.length; i++) {
+			try {
+				objects = parent.frames[i].window.document.getElementsByTagName("object");
+				for (var j = 0; j < objects.length; j++) {
+					objects[j].style.visibility = (state == "hide") ? 'hidden' : 'visible';
+				}
+			} catch(e) { }
+			try {
+				embeds = parent.frames[i].window.document.getElementsByTagName("embed");
+				for (var j = 0; j < embeds.length; j++) {
+					embeds[j].style.visibility = (state == "hide") ? 'hidden' : 'visible';
+				}
+			} catch(e) { }
+		}
+	}
+};
+LyteBox.prototype.toggleSelects = function(state) {
+	var selects = this.doc.getElementsByTagName("select");
+	for (var i = 0; i < selects.length; i++ ) {
+		selects[i].style.visibility = (state == "hide") ? 'hidden' : 'visible';
+	}
+	if (this.isFrame) {
+		for (var i = 0; i < parent.frames.length; i++) {
+			try {
+				selects = parent.frames[i].window.document.getElementsByTagName("select");
+				for (var j = 0; j < selects.length; j++) {
+					selects[j].style.visibility = (state == "hide") ? 'hidden' : 'visible';
+				}
+			} catch(e) { }
+		}
+	}
+};
+LyteBox.prototype.pause = function(numberMillis) {
+	var now = new Date();
+	var exitTime = now.getTime() + numberMillis;
+	while (true) {
+		now = new Date();
+		if (now.getTime() > exitTime) { return; }
+	}
+};
+if (window.addEventListener) {
+	window.addEventListener("load",initLytebox,false);
+} else if (window.attachEvent) {
+	window.attachEvent("onload",initLytebox);
+} else {
+	window.onload = function() {initLytebox();}
+}
+function initLytebox() { myLytebox = new LyteBox(); }
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/slideshow/index.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/slideshow/index.php
new file mode 100644
index 0000000000000000000000000000000000000000..33c490760adb4281bd6778dcf0fd4ba9b3ab05dc
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/slideshow/index.php
@@ -0,0 +1,203 @@
+<?php $this->start_element('nextgen_gallery.gallery_container', 'container', $displayed_gallery); ?>
+<?php if ($show_thumbnail_link): ?>
+<!-- Thumbnails Link -->
+<div class="slideshowlink">
+    <a href='<?php echo $thumbnail_link ?>'><?php echo_h($thumbnail_link_text) ?></a>
+</div>
+<?php endif ?>
+
+<?php if ($flash_enabled): ?>
+	<!-- Display Flash Slideshow -->
+
+	<?php
+	// Configure slideshow parameters
+	$width = $gallery_width;
+	$height = $gallery_height;
+
+		if ($cycle_interval == 0)
+			$cycle_interval = 1;
+    
+    if ($flash_background_color && $flash_background_color[0] == '#')
+    	$flash_background_color = substr($flash_background_color, 1);
+    	
+    if ($flash_text_color && $flash_text_color[0] == '#')
+    	$flash_text_color = substr($flash_text_color, 1);
+    	
+    if ($flash_rollover_color && $flash_rollover_color[0] == '#')
+    	$flash_rollover_color = substr($flash_rollover_color, 1);
+    	
+    if ($flash_screen_color && $flash_screen_color[0] == '#')
+    	$flash_screen_color = substr($flash_screen_color, 1);
+
+    // init the flash output
+    $swfobject = new swfobject( $flash_path, 'so' . $displayed_gallery_id, $width, $height, '7.0.0', 'false');
+
+    $swfobject->message = '<p>' . __('Slideshows require the&nbsp;<a href="http://www.macromedia.com/go/getflashplayer">Flash Player</a>&nbsp;and a&nbsp;<a href="http://www.mozilla.com/firefox/">browser with Javascript support</a>.', 'nggallery') . '</p>';
+
+    $swfobject->add_params('wmode', 'opaque');
+    $swfobject->add_params('allowfullscreen', 'true');
+    $swfobject->add_params('bgcolor', $flash_screen_color, 'FFFFFF', 'string', '#');
+    $swfobject->add_attributes('styleclass', 'slideshow');
+    $swfobject->add_attributes('name', 'so' . $displayed_gallery_id);
+
+    // adding the flash parameter
+    //$swfobject->add_flashvars( 'file', urlencode ( trailingslashit ( home_url() ) . 'index.php?callback=imagerotator&gid=' . $displayed_gallery_id ) );
+    $swfobject->add_flashvars( 'file', urlencode ( $mediarss_link ) );
+    $swfobject->add_flashvars( 'shuffle', $flash_shuffle, 'false', 'bool');
+
+    // option has oposite meaning : true should switch to next image
+    $swfobject->add_flashvars( 'linkfromdisplay', !$flash_next_on_click, 'false', 'bool');
+    $swfobject->add_flashvars( 'shownavigation', $flash_navigation_bar, 'true', 'bool');
+    $swfobject->add_flashvars( 'showicons', $flash_loading_icon, 'true', 'bool');
+    $swfobject->add_flashvars( 'kenburns', $flash_slow_zoom, 'false', 'bool');
+    $swfobject->add_flashvars( 'overstretch', $flash_stretch_image, 'false', 'string');
+    $swfobject->add_flashvars( 'rotatetime', $cycle_interval, 5, 'int');
+    $swfobject->add_flashvars( 'transition', $flash_transition_effect, 'random', 'string');
+    	
+    $swfobject->add_flashvars( 'backcolor', $flash_background_color, 'FFFFFF', 'string', '0x');
+    $swfobject->add_flashvars( 'frontcolor', $flash_text_color, '000000', 'string', '0x');
+    $swfobject->add_flashvars( 'lightcolor', $flash_rollover_color, '000000', 'string', '0x');
+    $swfobject->add_flashvars( 'screencolor', $flash_screen_color, '000000', 'string', '0x');
+    if ($flash_watermark_logo) {
+		$ngg_options = C_NextGen_Settings::get_instance();
+		$swfobject->add_flashvars( 'logo', $ngg_options['wmPath'], '', 'string');
+	}
+
+
+    $swfobject->add_flashvars( 'audio', $flash_background_music, '', 'string');
+    $swfobject->add_flashvars( 'width', $width, '260');
+    $swfobject->add_flashvars( 'height', $height, '320');
+    ?>
+
+    <div class="slideshow" id="gallery_<?php echo_h($displayed_gallery_id) ?>">
+        <?php echo $swfobject->output(); ?>
+    </div>
+    <script type="text/javascript" defer="defer">
+        <?php if ($flash_xhtml_validation): ?>
+        <!--
+        <?php endif ?>
+		jQuery(function($){
+			<?php echo $swfobject->javascript(); ?>
+		});
+        <?php if ($flash_xhtml_validation): ?>
+        -->
+        <?php endif ?>
+    </script>
+
+<?php else: ?>
+	<!-- Display JQuery Cycle Slideshow -->
+	<div class="ngg-slideshow-image-list ngg-slideshow-nojs" id="<?php echo_h($anchor)?>-image-list">
+		<?php
+    
+		$this->include_template('photocrati-nextgen_gallery_display#list/before');
+	
+		?>
+		<?php for ($i=0; $i<count($images); $i++): ?>
+
+			<?php
+			// Determine image dimensions
+			$image = $images[$i];
+			$image_size = $storage->get_original_dimensions($image);
+
+			if ($image_size == null) {
+				$image_size['width'] = $image->meta_data['width'];
+				$image_size['height'] = $image->meta_data['height'];
+			}
+
+			// Determine whether an image is hidden or not
+			if (isset($image->hidden) && $image->hidden) {
+			  $image->style = 'style="display: none;"';
+			}
+			else {
+				$image->style = '';
+			}
+
+			// Determine image aspect ratio
+			$image_ratio = $image_size['width'] / $image_size['height'];
+			if ($image_ratio > $aspect_ratio) {
+				if ($image_size['width'] > $gallery_width) {
+					$image_size['width'] = $gallery_width;
+					$image_size['height'] = (int) round($gallery_width / $image_ratio);
+				}
+			}
+			else {
+				if ($image_size['height'] > $gallery_height) {
+					$image_size['width'] = (int) round($gallery_height * $image_ratio);
+					$image_size['height'] = $gallery_height;
+				}
+			}
+			?>
+			
+			<?php
+			
+			$template_params = array(
+					'index' => $i,
+					'class' => 'ngg-gallery-slideshow-image'
+				);
+			$template_params = array_merge(get_defined_vars(), $template_params);
+			
+			$this->include_template('photocrati-nextgen_gallery_display#image/before', $template_params);
+			
+			?>
+			
+				<img data-image-id='<?php echo esc_attr($image->pid); ?>'
+					 title="<?php echo esc_attr($image->description)?>"
+					 alt="<?php echo esc_attr($image->alttext)?>"
+					 src="<?php echo esc_attr($storage->get_image_url($image))?>"
+					 width="<?php echo esc_attr($image_size['width'])?>"
+					 height="<?php echo esc_attr($image_size['height'])?>"
+				/>
+				
+			<?php
+			
+			$this->include_template('photocrati-nextgen_gallery_display#image/after', $template_params);
+			
+			?>
+			
+		<?php endfor ?>
+			
+		<?php
+		
+		$this->include_template('photocrati-nextgen_gallery_display#list/after');
+		
+		?>
+	</div>
+
+	<?php
+
+	$this->include_template('photocrati-nextgen_gallery_display#container/before');
+
+	?>
+	<div
+		class="ngg-galleryoverview ngg-slideshow"
+		id="<?php echo_h($anchor)?>"
+		data-placeholder="<?php echo esc_url($placeholder)?>"
+		style="max-width:<?php echo_h($gallery_width) ?>px; max-height:<?php echo_h($gallery_height) ?>px;">
+
+		<div
+			class="ngg-slideshow-loader"
+			id="<?php echo_h($anchor)?>-loader"
+			style="width:<?php echo_h($gallery_width) ?>px; height:<?php echo_h($gallery_height) ?>px;">
+			<img src="<?php echo_h(NGGALLERY_URLPATH) ?>images/loader.gif" alt="" />
+		</div>
+	</div>
+	<?php
+
+	$this->include_template('photocrati-nextgen_gallery_display#container/after');
+
+	?>
+	<script type="text/javascript">
+	jQuery('#<?php echo_h($anchor)?>-image-list').hide().removeClass('ngg-slideshow-nojs');
+	jQuery(function($){
+		jQuery('#<?php echo_h($anchor); ?>').nggShowSlideshow({
+			id: '<?php echo_h($displayed_gallery_id); ?>',
+			fx: '<?php echo_h($cycle_effect); ?>',
+			width: <?php echo_h($gallery_width); ?>,
+			height: <?php echo_h($gallery_height); ?>,
+			domain: '<?php echo_h(trailingslashit(home_url())); ?>',
+			timeout: <?php echo_h(intval($cycle_interval) * 1000); ?>
+		});
+	});
+	</script>
+<?php endif ?>
+<?php $this->end_element(); ?>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/slideshow/nextgen_basic_slideshow_settings_gallery_dimensions.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/slideshow/nextgen_basic_slideshow_settings_gallery_dimensions.php
new file mode 100644
index 0000000000000000000000000000000000000000..f1a2b5787743adb46132ea2448cadceee2fdce91
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/slideshow/nextgen_basic_slideshow_settings_gallery_dimensions.php
@@ -0,0 +1,27 @@
+<tr>
+    <td>
+        <label for='<?php echo esc_attr($display_type_name); ?>_gallery_width'>
+            <?php echo_h($gallery_dimensions_label); ?>
+        </label>
+    </td>
+    <td>
+        <label for='<?php echo esc_attr($display_type_name); ?>_gallery_width'>w</label>
+        <input type='number'
+               id='<?php echo esc_attr($display_type_name); ?>_gallery_width'
+               name='<?php echo esc_attr($display_type_name); ?>[gallery_width]'
+               class='nextgen_settings_field_width_and_height'
+               placeholder='<?php _e('Width'); ?>'
+               min='1'
+               required='required'
+               value='<?php echo esc_attr($gallery_width); ?>'/> /
+        <input type='number'
+               id='<?php echo esc_attr($display_type_name); ?>_gallery_height'
+               name='<?php echo esc_attr($display_type_name); ?>[gallery_height]'
+               class='nextgen_settings_field_width_and_height'
+               placeholder='<?php _e('Height'); ?>'
+               min='1'
+               required='required'
+               value='<?php echo esc_attr($gallery_height); ?>'/>
+        <label for='<?php echo esc_attr($display_type_name); ?>_gallery_height'>h</label>
+    </td>
+</tr>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/thumbnails/index.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/thumbnails/index.php
new file mode 100644
index 0000000000000000000000000000000000000000..91886cbb2837459aa50ecb83a41bd2fc6f00c474
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/thumbnails/index.php
@@ -0,0 +1,99 @@
+<?php
+
+$this->start_element('nextgen_gallery.gallery_container', 'container', $displayed_gallery);
+
+?>
+<div
+	class="ngg-galleryoverview"
+	id="ngg-gallery-<?php echo_h($displayed_gallery_id)?>-<?php echo_h($current_page)?>">
+
+    <?php if (!empty($slideshow_link)): ?>
+	<div class="slideshowlink">
+        <a href='<?php echo $slideshow_link ?>'><?php echo $slideshow_link_text ?></a>
+		
+	</div>
+	<?php endif ?>
+
+	<?php if ($show_piclens_link): ?>
+	<!-- Piclense link -->
+	<div class="piclenselink">
+		<a class="piclenselink" href="<?php echo esc_attr($piclens_link) ?>">
+			<?php echo_h($piclens_link_text); ?>
+		</a>
+	</div>
+	<?php endif ?>
+	<?php
+
+	$this->start_element('nextgen_gallery.image_list_container', 'container', $images);
+
+	?>
+	<!-- Thumbnails -->
+	<?php for ($i=0; $i<count($images); $i++):
+       $image = $images[$i];
+       $thumb_size = $storage->get_image_dimensions($image, $thumbnail_size_name);
+       $style = isset($image->style) ? $image->style : null;
+
+       if (isset($image->hidden) && $image->hidden) {
+          $style = 'style="display: none;"';
+       }
+       else {
+       		$style = null;
+       }
+
+			 $this->start_element('nextgen_gallery.image_panel', 'item', $image);
+
+			?>
+			<div id="<?php echo_h('ngg-image-' . $i) ?>" class="ngg-gallery-thumbnail-box" <?php if ($style) echo $style; ?>>
+				<?php
+
+				$this->start_element('nextgen_gallery.image', 'item', $image);
+
+				?>
+        <div class="ngg-gallery-thumbnail">
+            <a href="<?php echo esc_attr($storage->get_image_url($image))?>"
+               title="<?php echo esc_attr($image->description)?>"
+               data-image-id='<?php echo esc_attr($image->pid); ?>'
+               <?php echo $effect_code ?>>
+                <img
+                    title="<?php echo esc_attr($image->alttext)?>"
+                    alt="<?php echo esc_attr($image->alttext)?>"
+                    src="<?php echo esc_attr($storage->get_image_url($image, $thumbnail_size_name))?>"
+                    width="<?php echo esc_attr($thumb_size['width'])?>"
+                    height="<?php echo esc_attr($thumb_size['height'])?>"
+                    style="max-width:none;"
+                />
+            </a>
+        </div>
+				<?php
+
+				$this->end_element();
+
+				?>
+			</div> 
+			<?php
+
+			$this->end_element();
+
+			?>
+
+        <?php if ($number_of_columns > 0): ?>
+            <?php if ((($i + 1) % $number_of_columns) == 0 ): ?>
+                <br style="clear: both" />
+            <?php endif; ?>
+        <?php endif; ?>
+
+	<?php endfor ?>
+	<?php
+
+	$this->end_element();
+
+	?>
+
+	<?php if ($pagination): ?>
+	<!-- Pagination -->
+	<?php echo $pagination ?>
+	<?php else: ?>
+	<div class="ngg-clear"></div>
+	<?php endif ?>
+</div>
+<?php $this->end_element(); ?>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/adapter.nextgen_basic_imagebrowser.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/adapter.nextgen_basic_imagebrowser.php
new file mode 100644
index 0000000000000000000000000000000000000000..df0978d09960ba3809b80bcd7604b7652dfaafe5
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/adapter.nextgen_basic_imagebrowser.php
@@ -0,0 +1,28 @@
+<?php
+
+/**
+ * Adds validation for the NextGen Basic ImageBrowser display type
+ */
+class A_NextGen_Basic_ImageBrowser extends Mixin
+{
+	function initialize()
+	{
+		if ($this->object->name == NEXTGEN_GALLERY_NEXTGEN_BASIC_IMAGEBROWSER) {
+			$this->object->add_pre_hook(
+				'validation',
+				__CLASS__,
+				'Hook_NextGen_Basic_ImageBrowser_Validation'
+			);
+		}
+	}
+}
+
+/**
+ * Provides validation for the NextGen Basic ImageBrowser display type
+ */
+class Hook_NextGen_Basic_ImageBrowser_Validation extends Hook
+{
+	function validation()
+	{
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/adapter.nextgen_basic_imagebrowser_controller.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/adapter.nextgen_basic_imagebrowser_controller.php
new file mode 100644
index 0000000000000000000000000000000000000000..5d35d34690c0a5d69df461c5f6bb6d97eedf3bf2
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/adapter.nextgen_basic_imagebrowser_controller.php
@@ -0,0 +1,205 @@
+<?php
+
+/**
+ * Provides rendering logic for the NextGen Basic ImageBrowser
+ */
+class A_NextGen_Basic_ImageBrowser_Controller extends Mixin_NextGen_Basic_Gallery_Controller
+{
+	/**
+	 * Renders the front-end display for the imagebrowser display type
+     *
+	 * @param C_Displayed_Gallery $displayed_gallery
+	 * @param bool $return
+	 * @return string
+	 */
+	function index_action($displayed_gallery, $return = FALSE)
+	{
+		$picture_list = array();
+
+		foreach ($displayed_gallery->get_included_entities() as $image) {
+			$picture_list[$image->{$image->id_field}] = $image;
+		}
+
+		if ($picture_list)
+        {
+            $retval = $this->render_image_browser($displayed_gallery, $picture_list);
+
+			if ($return)
+            {
+                return $retval;
+            }
+			else {
+                echo $retval;
+            }
+		}
+		else {
+			return $this->object->render_partial('photocrati-nextgen_gallery_display#no_images_found', array(), $return);
+        }
+
+	}
+
+    /**
+     * Returns the rendered template of an image browser display
+     *
+     * @param C_Displayed_Gallery
+     * @param array $picture_list
+     * @return string Rendered HTML (probably)
+     */
+    function render_image_browser($displayed_gallery, $picture_list)
+    {
+        $display_settings = $displayed_gallery->display_settings;
+        $storage     = $this->object->get_registry()->get_utility('I_Gallery_Storage');
+        $imap        = $this->object->get_registry()->get_utility('I_Image_Mapper');
+        $application = $this->object->get_registry()->get_utility('I_Router')->get_routed_app();
+
+        // the pid may be a slug so we must track it & the slug target's database id
+        $pid = $this->object->param('pid');
+        $numeric_pid = NULL;
+
+        // makes the upcoming which-image-am-I loop easier
+        $picture_array = array();
+        foreach ($picture_list as $picture) {
+            $picture_array[] = $picture->{$imap->get_primary_key_column()};
+        }
+
+        // Determine which image in the list we need to display
+        if (!empty($pid))
+        {
+            if (is_numeric($pid))
+            {
+                $numeric_pid = intval($pid);
+            }
+            else {
+                // in the case it's a slug we need to search for the pid
+                foreach ($picture_list as $key => $picture) {
+                    if ($picture->image_slug == $pid)
+                    {
+                        $numeric_pid = $key;
+                        break;
+                    }
+                }
+            }
+        }
+        else {
+            reset($picture_array);
+            $numeric_pid = current($picture_array);
+        }
+
+        // get ids to the next and previous images
+        $total = count($picture_array);
+        $key = array_search($numeric_pid, $picture_array);
+        if (!$key)
+        {
+            $numeric_pid = reset($picture_array);
+            $key = key($picture_array);
+        }
+
+        // for "viewing image #13 of $total"
+        $picture_list_pos = $key + 1;
+
+        // our image to display
+        $picture = new C_Image_Wrapper($imap->find($numeric_pid), $displayed_gallery, TRUE);
+        $picture = apply_filters('ngg_image_object', $picture, $numeric_pid);
+
+        // determine URI to the next & previous images
+        $back_pid = ($key >= 1) ? $picture_array[$key - 1] : end($picture_array);
+
+        // 'show' is set when using the imagebrowser as an alternate view to a thumbnail or slideshow
+        // for which the basic-gallery module will rewrite the show parameter into existence as long as 'image'
+        // is set. We remove 'show' here so navigation appears fluid.
+        $prev_image_link = $this->object->set_param_for(
+            $application->get_routed_url(TRUE),
+            'pid',
+            $picture_list[$back_pid]->image_slug
+        );
+        $prev_image_link = trailingslashit($this->object->remove_param_for($prev_image_link, 'show', $displayed_gallery->id()));
+
+        $next_pid = ($key < ($total - 1)) ? $picture_array[$key + 1] : reset($picture_array);
+        $next_image_link = $this->object->set_param_for(
+            $application->get_routed_url(TRUE),
+            'pid',
+            $picture_list[$next_pid]->image_slug
+        );
+        $next_image_link = trailingslashit($this->object->remove_param_for($next_image_link, 'show', $displayed_gallery->id()));
+
+        // css class
+        $anchor = 'ngg-imagebrowser-' . $displayed_gallery->id() . '-' . (get_the_ID() == false ? 0 : get_the_ID());
+
+        // try to read EXIF data, but fallback to the db presets
+        $meta = new C_NextGen_Metadata($picture);
+        $meta->sanitize();
+        $meta_results = array(
+            'exif' => $meta->get_EXIF(),
+            'iptc' => $meta->get_IPTC(),
+            'xmp'  => $meta->get_XMP(),
+            'db'   => $meta->get_saved_meta()
+        );
+        $meta_results['exif'] = ($meta_results['exif'] == false) ? $meta_results['db'] : $meta_results['exif'];
+
+        if (!empty($display_settings['template']))
+        {
+            $this->object->add_mixin('Mixin_NextGen_Basic_Templates');
+            $picture->href_link = $picture->get_href_link();
+            $picture->previous_image_link = $prev_image_link;
+            $picture->previous_pid = $back_pid;
+            $picture->next_image_link = $next_image_link;
+            $picture->next_pid = $next_pid;
+            $picture->number = $picture_list_pos;
+            $picture->total = $total;
+            $picture->anchor = $anchor;
+            
+            return $this->object->legacy_render(
+                $display_settings['template'],
+                array(
+                    'image' => $picture,
+                    'meta'  => $meta,
+                    'exif'  => $meta_results['exif'],
+                    'iptc'  => $meta_results['iptc'],
+                    'xmp'   => $meta_results['xmp'],
+                    'db'    => $meta_results['db']
+                ),
+                TRUE,
+                'imagebrowser'
+            );
+        }
+        else {
+            $params = $display_settings;
+            $params['anchor']       = $anchor;
+            $params['image']        = $picture;
+            $params['storage']      = &$storage;
+            $params['previous_pid'] = $back_pid;
+            $params['next_pid']     = $next_pid;
+            $params['number']       = $picture_list_pos;
+            $params['total']        = $total;
+
+            $params['previous_image_link'] = $prev_image_link;
+            $params['next_image_link']     = $next_image_link;
+            $params['effect_code']         = $this->object->get_effect_code($displayed_gallery);
+                
+            $params = $this->object->prepare_display_parameters($displayed_gallery, $params);
+
+            return $this->object->render_partial(
+                'photocrati-nextgen_basic_imagebrowser#nextgen_basic_imagebrowser',
+                $params,
+                TRUE
+            );
+        }
+    }
+
+    /**
+     * Enqueues all static resources required by this display type
+     *
+     * @param C_Displayed_Gallery $displayed_gallery
+     */
+    function enqueue_frontend_resources($displayed_gallery)
+    {
+		$this->call_parent('enqueue_frontend_resources', $displayed_gallery);
+
+		wp_enqueue_style(
+            'nextgen_basic_imagebrowser_style',
+            $this->get_static_url('photocrati-nextgen_basic_imagebrowser#style.css')
+        );
+
+		$this->enqueue_ngg_styles();
+    }
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/adapter.nextgen_basic_imagebrowser_form.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/adapter.nextgen_basic_imagebrowser_form.php
new file mode 100644
index 0000000000000000000000000000000000000000..35896765a0b4d686d9a81f4415f3a00c037c7bf3
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/adapter.nextgen_basic_imagebrowser_form.php
@@ -0,0 +1,20 @@
+<?php
+
+class A_NextGen_Basic_ImageBrowser_Form extends Mixin_Display_Type_Form
+{
+	function get_display_type_name()
+	{
+		return NEXTGEN_GALLERY_NEXTGEN_BASIC_IMAGEBROWSER;
+	}
+
+	/**
+     * Returns a list of fields to render on the settings page
+     */
+    function _get_field_names()
+    {
+        return array(
+			'ajax_pagination',
+			'nextgen_basic_templates_template',
+		);
+    }
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/adapter.nextgen_basic_imagebrowser_forms.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/adapter.nextgen_basic_imagebrowser_forms.php
new file mode 100644
index 0000000000000000000000000000000000000000..956798862f33a1c89fd9e2d205396bc7b1a050d3
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/adapter.nextgen_basic_imagebrowser_forms.php
@@ -0,0 +1,11 @@
+<?php
+
+class A_NextGen_Basic_ImageBrowser_Forms extends Mixin
+{
+    function initialize()
+    {
+        $this->add_form(
+            NEXTGEN_DISPLAY_SETTINGS_SLUG, NEXTGEN_GALLERY_NEXTGEN_BASIC_IMAGEBROWSER
+        );
+    }
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/adapter.nextgen_basic_imagebrowser_mapper.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/adapter.nextgen_basic_imagebrowser_mapper.php
new file mode 100644
index 0000000000000000000000000000000000000000..5277564ef03b7c0c7325def5dde696e40b14eb30
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/adapter.nextgen_basic_imagebrowser_mapper.php
@@ -0,0 +1,34 @@
+<?php
+
+class A_NextGen_Basic_ImageBrowser_Mapper extends Mixin
+{
+	/**
+	 * Adds a hook for setting default values
+	 */
+	function initialize()
+	{
+		$this->object->add_post_hook(
+			'set_defaults',
+			'NextGen Basic ImageBrowser Defaults',
+			'Hook_NextGen_Basic_ImageBrowser_Defaults',
+			'set_defaults'
+		);
+	}
+}
+
+/**
+ * Adds default values for the NextGEN Basic ImageBrowser display type
+ */
+class Hook_NextGen_Basic_ImageBrowser_Defaults extends Hook
+{
+	function set_defaults($entity)
+	{
+		if ($entity->name == NEXTGEN_GALLERY_NEXTGEN_BASIC_IMAGEBROWSER)
+        {
+			$this->object->_set_default_value($entity, 'settings', 'template', '');
+
+            // Part of the pro-modules
+            $this->object->_set_default_value($entity, 'settings', 'ngg_triggers_display', 'never');
+		}
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/adapter.nextgen_basic_imagebrowser_routes.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/adapter.nextgen_basic_imagebrowser_routes.php
new file mode 100644
index 0000000000000000000000000000000000000000..d0806366bb4faa7039dcc29518ae8257d9ed2f07
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/adapter.nextgen_basic_imagebrowser_routes.php
@@ -0,0 +1,20 @@
+<?php
+
+class A_NextGen_Basic_ImageBrowser_Routes extends Mixin
+{
+	function initialize()
+	{
+		$this->object->add_pre_hook(
+			'serve_request',
+			'Adds Routes for NextGen Basic ImageBrowser',
+			get_class(),
+			'_add_nextgen_basic_imagebrowser_routes'
+		);
+	}
+
+	function _add_nextgen_basic_imagebrowser_routes()
+	{
+		$slug = C_NextGen_Settings::get_instance()->router_param_slug;
+        $this->object->rewrite("{$slug}{*}/image/{\\w}", "{$slug}{1}/pid--{2}");
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/adapter.nextgen_basic_imagebrowser_urls.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/adapter.nextgen_basic_imagebrowser_urls.php
new file mode 100644
index 0000000000000000000000000000000000000000..4f5daba5b6871fbc62bf621769e20cb58c24536c
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/adapter.nextgen_basic_imagebrowser_urls.php
@@ -0,0 +1,12 @@
+<?php
+
+class A_NextGen_Basic_ImageBrowser_Urls extends Mixin
+{
+	function create_parameter_segment($key, $value, $id=NULL, $use_prefix=FALSE)
+	{
+		if ($key == 'pid')
+			return "image/{$value}";
+		else
+			return $this->call_parent('create_parameter_segment', $key, $value, $id, $use_prefix);
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/class.nextgen_basic_imagebrowser_installer.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/class.nextgen_basic_imagebrowser_installer.php
new file mode 100644
index 0000000000000000000000000000000000000000..d43e95cf42c1fe41a3723cd16c10bddcaa318798
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/class.nextgen_basic_imagebrowser_installer.php
@@ -0,0 +1,17 @@
+<?php
+
+class C_NextGen_Basic_ImageBrowser_Installer extends C_Gallery_Display_Installer
+{
+	function install()
+	{
+		$this->install_display_type(
+			NEXTGEN_GALLERY_NEXTGEN_BASIC_IMAGEBROWSER, array(
+				'title'					=>	'NextGEN Basic ImageBrowser',
+				'entity_types'			=>	array('image'),
+				'preview_image_relpath'	=>	'photocrati-nextgen_basic_imagebrowser#preview.jpg',
+				'default_source'		=>	'galleries',
+				'view_order' => NEXTGEN_DISPLAY_PRIORITY_BASE + 20
+			)
+		);
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/hook.nextgen_basic_imagebrowser_alt_urls.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/hook.nextgen_basic_imagebrowser_alt_urls.php
new file mode 100644
index 0000000000000000000000000000000000000000..9461b6164d161b3b90a47ea81a926c24444ea27d
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/hook.nextgen_basic_imagebrowser_alt_urls.php
@@ -0,0 +1,45 @@
+<?php
+
+class Hook_NextGen_Basic_Imagebrowser_Alt_URLs extends Hook {
+    /**
+     * Replaces the full-size image url with a path to the current url + a pid (image) parameter. This causes
+     * basic thumbnail displays to render a basic imagebrowser.
+     *
+     * @param $image
+     * @param string $size
+     * @return null
+     */
+    function get_image_url($image, $size='full')
+    {
+        // Get the method to be returned
+        $retval = $this->object->get_method_property(
+            $this->method_called,
+            ExtensibleObject::METHOD_PROPERTY_RETURN_VALUE
+        );
+
+        if ($size == 'full')
+        {
+            $router      = $this->object->get_registry()->get_utility('I_Router');
+            $controller  = $this->object->get_registry()->get_utility('I_Display_Type_Controller');
+            $application = $router->get_routed_app();
+
+            if ($router->param('ajax_pagination_referrer'))
+                $url = $router->param('ajax_pagination_referrer');
+            else
+                $url = $application->get_routed_url(TRUE);
+
+            $url = $controller->set_param_for($url, 'pid', $image->image_slug);
+            $url = $controller->remove_param_for($url, 'show');
+
+            $retval = $url;
+
+            $this->object->set_method_property(
+                $this->method_called,
+                ExtensibleObject::METHOD_PROPERTY_RETURN_VALUE,
+                $retval
+            );
+        }
+
+        return $retval;
+    }
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/module.nextgen_basic_imagebrowser.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/module.nextgen_basic_imagebrowser.php
new file mode 100644
index 0000000000000000000000000000000000000000..77d3fb386743b9bcbf0f69c379603c243f7de4ed
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/module.nextgen_basic_imagebrowser.php
@@ -0,0 +1,122 @@
+<?php
+/***
+{
+	Module:		photocrati-nextgen_basic_imagebrowser,
+	Depends:	{ photocrati-nextgen_gallery_display }
+}
+***/
+
+define(
+	'NEXTGEN_GALLERY_NEXTGEN_BASIC_IMAGEBROWSER',
+	'photocrati-nextgen_basic_imagebrowser'
+);
+
+class M_NextGen_Basic_ImageBrowser extends C_Base_Module
+{
+	function define()
+	{
+		parent::define(
+			'photocrati-nextgen_basic_imagebrowser',
+			'NextGEN Basic ImageBrowser',
+			'Provides the NextGEN Basic ImageBrowser Display Type',
+            '0.4',
+			'http://www.nextgen-gallery.com',
+			'Photocrati Media',
+			'http://www.photocrati.com'
+		);
+
+		include_once('class.nextgen_basic_imagebrowser_installer.php');
+		C_Photocrati_Installer::add_handler($this->module_id, 'C_NextGen_Basic_ImageBrowser_Installer');
+	}
+
+	/**
+	 * Register adapters required for the NextGen Basic ImageBrowser
+	 */
+	function _register_adapters()
+	{
+		$this->get_registry()->add_adapter(
+		  'I_Display_Type_Mapper',		'A_NextGen_Basic_ImageBrowser_Mapper'
+		);
+
+		// Add validation for the display type
+		$this->get_registry()->add_adapter(
+		  'I_Display_Type',			    'A_NextGen_Basic_ImageBrowser'
+		);
+
+		// Add rendering logic
+		$this->get_registry()->add_adapter(
+		  'I_Display_Type_Controller', 'A_NextGen_Basic_ImageBrowser_Controller',
+		  $this->module_id
+		);
+
+		// Add imagebrowser routes
+		$this->get_registry()->add_adapter(
+			'I_Routing_App',			'A_NextGen_Basic_ImageBrowser_Routes'
+		);
+
+		// Add imagebrowser ngglegacy-compatible urls
+		$this->get_registry()->add_adapter(
+			'I_Routing_App',			'A_NextGen_Basic_ImageBrowser_Urls'
+		);
+
+		// Provide the imagebrowser form
+		$this->get_registry()->add_adapter(
+			'I_Form',
+			'A_NextGen_Basic_ImageBrowser_Form',
+			$this->module_id
+		);
+
+        // Provides the setting forms
+        $this->get_registry()->add_adapter(
+            'I_Form_Manager',
+            'A_NextGen_Basic_ImageBrowser_Forms'
+        );
+	}
+
+	function _register_hooks()
+	{
+		C_NextGen_Shortcode_Manager::add('imagebrowser', array(&$this, 'render_shortcode'));
+	}
+
+    /**
+     * Gets a value from the parameter array, and if not available, uses the default value
+     *
+     * @param string $name
+     * @param mixed $default
+     * @param array $params
+     * @return mixed
+     */
+    function _get_param($name, $default, $params)
+    {
+        return (isset($params[$name])) ? $params[$name] : $default;
+    }
+
+	function render_shortcode($params, $inner_content=NULL)
+    {
+        $params['gallery_ids']  = $this->_get_param('id', NULL, $params);
+        $params['source']       = $this->_get_param('source', 'galleries', $params);
+        $params['display_type'] = $this->_get_param('display_type', NEXTGEN_GALLERY_NEXTGEN_BASIC_IMAGEBROWSER, $params);
+
+        unset($params['id']);
+
+        $renderer = $this->get_registry()->get_utility('I_Displayed_Gallery_Renderer');
+        return $renderer->display_images($params, $inner_content);
+    }
+
+    function get_type_list()
+    {
+        return array(
+            'A_Nextgen_Basic_Imagebrowser' => 'adapter.nextgen_basic_imagebrowser.php',
+            'A_Nextgen_Basic_Imagebrowser_Controller' => 'adapter.nextgen_basic_imagebrowser_controller.php',
+            'A_Nextgen_Basic_Imagebrowser_Form' => 'adapter.nextgen_basic_imagebrowser_form.php',
+            'A_Nextgen_Basic_Imagebrowser_Forms' => 'adapter.nextgen_basic_imagebrowser_forms.php',
+            'C_Nextgen_Basic_Imagebrowser_Installer' => 'class.nextgen_basic_imagebrowser_installer.php',
+            'A_Nextgen_Basic_Imagebrowser_Mapper' => 'adapter.nextgen_basic_imagebrowser_mapper.php',
+            'A_Nextgen_Basic_Imagebrowser_Routes' => 'adapter.nextgen_basic_imagebrowser_routes.php',
+            'A_Nextgen_Basic_Imagebrowser_Urls' => 'adapter.nextgen_basic_imagebrowser_urls.php',
+            'Hook_NextGen_Basic_Imagebrowser_Alt_URLs' => 'hook.nextgen_basic_imagebrowser_alt_urls.php'
+        );
+    }
+}
+
+new M_NextGen_Basic_ImageBrowser();
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/static/preview.jpg b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/static/preview.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..791b8941c4c777e966eac27fbfa762daa690bd60
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/static/preview.jpg differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/static/style.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/static/style.css
new file mode 100644
index 0000000000000000000000000000000000000000..a5ce7885317a78a9647c431b604a32412a91771a
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/static/style.css
@@ -0,0 +1,58 @@
+/* ----------- Image browser style -------------*/
+
+.ngg-imagebrowser {
+}
+
+.ngg-imagebrowser h3 {
+    text-align: center;
+}
+
+.ngg-imagebrowser-desc {
+    clear: both;
+}
+
+.ngg-imagebrowser .pic {
+	max-width: 100%;
+  margin-top: 10px;
+  margin-bottom: 10px;
+  border: 1px solid #A9A9A9;
+}
+.ngg-imagebrowser .pic a {
+  display: block !important;
+  font-size: 0px;
+  margin: 5px;
+  text-align: center;
+}
+
+.ngg-imagebrowser img {
+	max-width: 100%;
+    margin: 0;
+    padding: 0;
+    border: none;
+}
+
+.ngg-imagebrowser-nav {
+    padding: 5px;
+}
+
+.ngg-imagebrowser-nav .back {
+    float: left;
+    border: 1px solid #DDDDDD;
+    padding: 3px 7px;
+}
+
+.ngg-imagebrowser-nav .next {
+    float: right;
+    border: 1px solid #DDDDDD;
+    padding: 3px 7px;
+}
+
+.ngg-imagebrowser-nav .counter {
+    text-align: center;
+    font-size: 0.9em !important;
+}
+
+.exif-data {
+    margin-left: auto !important;
+    margin-right: auto !important;
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/templates/nextgen_basic_imagebrowser.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/templates/nextgen_basic_imagebrowser.php
new file mode 100644
index 0000000000000000000000000000000000000000..48e731f6e123ba50ab659434996934635134568f
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/templates/nextgen_basic_imagebrowser.php
@@ -0,0 +1,72 @@
+<?php $this->start_element('nextgen_gallery.gallery_container', 'container', $displayed_gallery); ?>
+	<div class='ngg-imagebrowser' id='<?php echo $anchor; ?>'>
+
+    <h3><?php echo esc_attr($image->alttext); ?></h3>
+
+		<?php
+		
+		$template_params = array(
+				'index' => 0,
+				'class' => 'pic',
+				'image' => $image,
+			);
+			
+		$this->include_template('photocrati-nextgen_gallery_display#image/before', $template_params);
+		
+		?>
+        <a href='<?php echo esc_attr($storage->get_image_url($image)); ?>'
+           title='<?php echo esc_attr($image->description); ?>'
+           data-image-id='<?php echo esc_attr($image->pid); ?>'
+           <?php echo $effect_code ?>>
+            <img title='<?php echo esc_attr($image->alttext); ?>'
+                 alt='<?php echo esc_attr($image->alttext); ?>'
+                 src='<?php echo esc_attr($storage->get_image_url($image)); ?>'/>
+        </a>
+	  <?php
+
+		$this->include_template('photocrati-nextgen_gallery_display#image/after', $template_params);
+
+		?>
+
+    <div class='ngg-imagebrowser-nav'>
+
+        <div class='back'>
+            <a class='ngg-browser-prev'
+               id='ngg-prev-<?php echo $previous_pid; ?>'
+               href='<?php echo $previous_image_link; ?>'>
+                &#9668; <?php _e('Back', 'nggallery'); ?>
+            </a>
+        </div>
+
+        <div class='next'>
+            <a class='ngg-browser-next'
+               id='ngg-next-<?php echo $next_pid; ?>'
+               href='<?php echo $next_image_link; ?>'>
+                <?php _e('Next', 'nggallery'); ?>
+                &#9658;
+            </a>
+        </div>
+
+        <div class='counter'>
+            <?php _e('Picture', 'nggallery'); ?> <?php echo $number; ?> <?php _e('of', 'nggallery'); ?> <?php echo $total; ?>
+        </div>
+
+        <div class='ngg-imagebrowser-desc'>
+            <p>
+                <?php echo $image->description; ?>
+            </p>
+        </div>
+
+    </div>
+
+</div>
+<?php $this->end_element(); ?>
+<script type='text/javascript'>
+	jQuery(function($){
+		new NggPaginatedGallery(
+			'<?php echo $displayed_gallery->id() ?>',
+			$('#<?php echo $anchor ?>'),
+			$('#<?php echo $anchor ?> .ngg-browser-prev, #<?php echo $anchor ?> .ngg-browser-next')
+		)
+	});
+</script>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/adapter.nextgen_basic_singlepic.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/adapter.nextgen_basic_singlepic.php
new file mode 100644
index 0000000000000000000000000000000000000000..122ac01e131f8522c540751016c5cf99cb8e8fd2
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/adapter.nextgen_basic_singlepic.php
@@ -0,0 +1,23 @@
+<?php
+
+class A_NextGen_Basic_Singlepic extends Mixin
+{
+    function initialize()
+    {
+        if ($this->object->name == NEXTGEN_BASIC_SINGLEPIC_MODULE_NAME)
+        {
+            $this->object->add_pre_hook(
+				'validation',
+				get_class(),
+				'Hook_NextGen_Basic_Singlepic_Validation'
+			);
+        }
+    }
+}
+
+class Hook_NextGen_Basic_Singlepic_Validation extends Hook
+{
+    function validation()
+    {
+    }
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/adapter.nextgen_basic_singlepic_controller.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/adapter.nextgen_basic_singlepic_controller.php
new file mode 100644
index 0000000000000000000000000000000000000000..b3154fdc6eda0654d6573c7a90640baa633037c0
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/adapter.nextgen_basic_singlepic_controller.php
@@ -0,0 +1,153 @@
+<?php
+
+class A_NextGen_Basic_Singlepic_Controller extends Mixin
+{
+    /**
+     * Displays the 'singlepic' display type
+     *
+     * @param stdClass|C_Displayed_Gallery|C_DataMapper_Model $displayed_gallery
+     */
+    function index_action($displayed_gallery, $return = FALSE)
+    {
+        $storage   = $this->object->get_registry()->get_utility('I_Gallery_Storage');
+        $dynthumbs = $this->object->get_registry()->get_utility('I_Dynamic_Thumbnails_Manager');
+        $display_settings = $displayed_gallery->display_settings;
+		$image = array_shift($displayed_gallery->get_included_entities(1));
+
+        if (!$image)
+            return $this->object->render_partial("photocrati-nextgen_gallery_display#no_images_found", array(), $return);
+
+        switch ($display_settings['float']) {
+            case 'left':
+                $display_settings['float'] = 'ngg-left';
+                break;
+            case 'right':
+                $display_settings['float'] = 'ngg-right';
+                break;
+            case 'center':
+                $display_settings['float'] = 'ngg-center';
+                break;
+            default:
+                $display_settings['float'] = '';
+                break;
+        }
+
+        $params = array();
+
+        if (!empty($display_settings['link']))
+        {
+            $target = '_blank';
+            $effect_code = '';
+        }
+        else {
+            $display_settings['link'] = $storage->get_image_url($image);
+            $target = '_self';
+            $effect_code = $this->object->get_effect_code($displayed_gallery);
+        }
+        $params['target'] = $target;
+
+        // mode is a legacy parameter
+        if (!is_array($display_settings['mode']))
+            $display_settings['mode'] = explode(',', $display_settings['mode']);
+        if (in_array('web20', $display_settings['mode']))
+            $display_settings['display_reflection'] = TRUE;
+        if (in_array('watermark', $display_settings['mode']))
+            $display_settings['display_watermark'] = TRUE;
+        
+	      if (isset($display_settings['w']))
+	          $display_settings['width'] = $display_settings['w'];
+	      elseif (isset($display_settings['h']))
+	      		unset($display_settings['width']);
+	          
+	      if (isset($display_settings['h']))
+	          $display_settings['height'] = $display_settings['h'];
+	      elseif (isset($display_settings['w']))
+	      		unset($display_settings['height']);
+        
+        // legacy assumed no width/height meant full size unlike generate_thumbnail: force a full resolution
+        if (!isset($display_settings['width']) && !isset($display_settings['height']))
+            $display_settings['width'] = $image->meta_data['width'];
+        
+        if (isset($display_settings['width']))
+        		$params['width'] = $display_settings['width'];
+        
+        if (isset($display_settings['height']))
+            $params['height'] = $display_settings['height'];
+            
+        $params['quality'] = $display_settings['quality'];
+        $params['crop'] = $display_settings['crop'];
+        $params['watermark'] = $display_settings['display_watermark'];
+        $params['reflection'] = $display_settings['display_reflection'];
+
+        // Fall back to full in case dynamic images aren't available
+        $size = 'full';
+
+        if ($dynthumbs != null)
+            $size = $dynthumbs->get_size_name($params);
+
+        $thumbnail_url = $storage->get_image_url($image, $size);
+
+        if (!empty($display_settings['template']))
+        {
+            $this->object->add_mixin('A_NextGen_Basic_Template_Form');
+            $this->object->add_mixin('Mixin_NextGen_Basic_Templates');
+            $params = $this->object->prepare_legacy_parameters(array($image), $displayed_gallery, array('single_image' => TRUE));
+
+            // the wrapper is a lazy-loader that calculates variables when requested. We here override those to always
+            // return the same precalculated settings provided
+            $params['image']->container[0]->_cache_overrides['caption']      = $displayed_gallery->inner_content;
+            $params['image']->container[0]->_cache_overrides['classname']    = 'ngg-singlepic ' . $display_settings['float'];
+            $params['image']->container[0]->_cache_overrides['imageURL']     = $display_settings['link'];
+            $params['image']->container[0]->_cache_overrides['thumbnailURL'] = $thumbnail_url;
+            $params['target'] = $target;
+
+            // if a link is present we temporarily must filter out the effect code
+            if (empty($effect_code))
+                add_filter('ngg_get_thumbcode', array(&$this, 'strip_thumbcode'), 10);
+
+            $retval = $this->object->legacy_render($display_settings['template'], $params, $return, 'singlepic');
+
+            if (empty($effect_code))
+                remove_filter('ngg_get_thumbcode', array(&$this, 'strip_thumbcode'), 10);
+
+            return $retval;
+        }
+        else {
+            $params = $display_settings;
+            $params['storage']       = &$storage;
+            $params['image']         = &$image;
+            $params['effect_code']   = $effect_code;
+            $params['inner_content'] = $displayed_gallery->inner_content;
+            $params['settings']      = $display_settings;
+            $params['thumbnail_url'] = $thumbnail_url;
+            $params['target']        = $target;
+                
+            $params = $this->object->prepare_display_parameters($displayed_gallery, $params);
+
+            return $this->object->render_partial('photocrati-nextgen_basic_singlepic#nextgen_basic_singlepic', $params, $return);
+        }
+    }
+
+    /**
+     * Intentionally disable the application of the effect code
+     */
+    function strip_thumbcode($thumbcode)
+    {
+        return '';
+    }
+
+    /**
+     * Enqueues all static resources required by this display type
+     *
+     * @param C_Displayed_Gallery $displayed_gallery
+     */
+    function enqueue_frontend_resources($displayed_gallery)
+    {
+		$this->call_parent('enqueue_frontend_resources', $displayed_gallery);
+
+        wp_enqueue_style('nextgen_basic_singlepic_style', $this->get_static_url('photocrati-nextgen_basic_singlepic#nextgen_basic_singlepic.css'));
+
+		$this->enqueue_ngg_styles();
+    }
+
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/adapter.nextgen_basic_singlepic_form.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/adapter.nextgen_basic_singlepic_form.php
new file mode 100644
index 0000000000000000000000000000000000000000..b2a3bfbdaff6899338786451bc8b15a986d130a1
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/adapter.nextgen_basic_singlepic_form.php
@@ -0,0 +1,113 @@
+<?php
+
+class A_NextGen_Basic_SinglePic_Form extends Mixin_Display_Type_Form
+{
+	/**
+	 * Returns the name of the display type
+	 * @return string
+	 */
+	function get_display_type_name()
+	{
+		return NEXTGEN_BASIC_SINGLEPIC_MODULE_NAME;
+	}
+
+	/**
+	 * Returns the name of the fields to render for the SinglePic
+	 */
+	function _get_field_names()
+	{
+		return array(
+            'nextgen_basic_singlepic_dimensions',
+            'nextgen_basic_singlepic_link',
+            'nextgen_basic_singlepic_float',
+            'nextgen_basic_singlepic_quality',
+            'nextgen_basic_singlepic_crop',
+            'nextgen_basic_singlepic_display_watermark',
+            'nextgen_basic_singlepic_display_reflection',
+            'nextgen_basic_templates_template'
+        );
+	}
+
+	    function _render_nextgen_basic_singlepic_dimensions_field($display_type)
+    {
+        return $this->object->render_partial(
+            'photocrati-nextgen_basic_singlepic#nextgen_basic_singlepic_settings_dimensions',
+            array(
+                'display_type_name' => $display_type->name,
+                'dimensions_label' => _('Thumbnail dimensions'),
+                'width_label' => _('Width'),
+                'width' => $display_type->settings['width'],
+                'height_label' => _('Width'),
+                'height' => $display_type->settings['height'],
+            ),
+            True
+        );
+    }
+
+    function _render_nextgen_basic_singlepic_link_field($display_type)
+    {
+        return $this->object->render_partial(
+            'photocrati-nextgen_basic_singlepic#nextgen_basic_singlepic_settings_link',
+            array(
+                'display_type_name' => $display_type->name,
+                'link_label' => _('Link'),
+                'link' => $display_type->settings['link'],
+            ),
+            True
+        );
+    }
+
+    function _render_nextgen_basic_singlepic_quality_field($display_type)
+    {
+        return $this->object->render_partial(
+            'photocrati-nextgen_basic_singlepic#nextgen_basic_singlepic_settings_quality',
+            array(
+                'display_type_name' => $display_type->name,
+                'quality_label' => _('Image quality'),
+                'quality' => $display_type->settings['quality'],
+            ),
+            True
+        );
+    }
+
+    function _render_nextgen_basic_singlepic_display_watermark_field($display_type)
+    {
+        return $this->_render_radio_field(
+            $display_type,
+            'display_watermark',
+            'Display watermark',
+            $display_type->settings['display_watermark']
+        );
+    }
+
+    function _render_nextgen_basic_singlepic_display_reflection_field($display_type)
+    {
+        return $this->_render_radio_field(
+            $display_type,
+            'display_reflection',
+            'Display reflection',
+            $display_type->settings['display_reflection']
+        );
+    }
+
+    function _render_nextgen_basic_singlepic_crop_field($display_type)
+    {
+        return $this->_render_radio_field(
+            $display_type,
+            'crop',
+            'Crop thumbnail',
+            $display_type->settings['crop']
+        );
+    }
+
+    function _render_nextgen_basic_singlepic_float_field($display_type)
+    {
+        return $this->_render_select_field(
+            $display_type,
+            'float',
+            'Float',
+            array('' => 'None', 'left' => 'Left', 'right' => 'Right'),
+            $display_type->settings['float']
+        );
+    }
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/adapter.nextgen_basic_singlepic_forms.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/adapter.nextgen_basic_singlepic_forms.php
new file mode 100644
index 0000000000000000000000000000000000000000..734e4cd661eed1b1f2bb7bc8c89bbc8ab3adcc6a
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/adapter.nextgen_basic_singlepic_forms.php
@@ -0,0 +1,11 @@
+<?php
+
+class A_NextGen_Basic_SinglePic_Forms extends Mixin
+{
+    function initialize()
+    {
+        $this->add_form(
+            NEXTGEN_DISPLAY_SETTINGS_SLUG, NEXTGEN_BASIC_SINGLEPIC_MODULE_NAME
+        );
+    }
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/adapter.nextgen_basic_singlepic_mapper.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/adapter.nextgen_basic_singlepic_mapper.php
new file mode 100644
index 0000000000000000000000000000000000000000..87bc4645d081b8192ea5be3b7a02106230d6f48c
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/adapter.nextgen_basic_singlepic_mapper.php
@@ -0,0 +1,77 @@
+<?php
+
+class A_NextGen_Basic_SinglePic_Mapper extends Mixin
+{
+	function initialize()
+	{
+		$this->object->add_post_hook(
+			'set_defaults',
+			get_class(),
+			get_class(),
+			'_set_singlepic_defaults'
+		);
+
+		if ($this->object->has_context('attach_to_post')) {
+			$this->object->add_post_hook(
+				'run_query',
+				get_class(),
+				get_class(),
+				'_remove_singlepic_from_results'
+			);
+		}
+	}
+
+	/**
+	 * Removes the singlepic display type from a resultset to hide it from
+	 * the Attach to Post interface
+	 */
+	function _remove_singlepic_from_results()
+	{
+		$retval = array();
+
+		// Get all of the returned display types
+		$results = $this->object->get_method_property(
+			$this->method_called, ExtensibleObject::METHOD_PROPERTY_RETURN_VALUE
+		);
+
+		// Iterate through each display type to be returned, and remove the
+		// SinglePic display type
+		foreach ($results as &$display_type) {
+			if (!((isset($display_type->name) && $display_type->name == NEXTGEN_BASIC_SINGLEPIC_MODULE_NAME))) {
+				$retval[] = $display_type;
+			}
+		}
+
+		// Set the new return value
+		$this->object->set_method_property(
+			$this->method_called,
+			ExtensibleObject::METHOD_PROPERTY_RETURN_VALUE,
+			$retval
+		);
+
+		return $retval;
+	}
+
+	/**
+	 * Sets default values for SinglePic settings
+	 * @param stdClass|C_DataMapper_Model $entity
+	 */
+	function _set_singlepic_defaults($entity)
+	{
+		if ($entity->name == NEXTGEN_BASIC_SINGLEPIC_MODULE_NAME) {
+			$this->object->_set_default_value($entity, 'settings', 'width', '');
+			$this->object->_set_default_value($entity, 'settings', 'height', '');
+			$this->object->_set_default_value($entity, 'settings', 'mode', '');
+			$this->object->_set_default_value($entity, 'settings', 'display_watermark', 0);
+			$this->object->_set_default_value($entity, 'settings', 'display_reflection', 0);
+			$this->object->_set_default_value($entity, 'settings', 'float', '');
+			$this->object->_set_default_value($entity, 'settings', 'link', '');
+			$this->object->_set_default_value($entity, 'settings', 'quality', 100);
+			$this->object->_set_default_value($entity, 'settings', 'crop', 0);
+            $this->object->_set_default_value($entity, 'settings', 'template', '');
+
+            // Part of the pro-modules
+            $this->object->_set_default_value($entity, 'settings', 'ngg_triggers_display', 'never');
+		}
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/class.nextgen_basic_singlepic_installer.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/class.nextgen_basic_singlepic_installer.php
new file mode 100644
index 0000000000000000000000000000000000000000..83b40a54d661bc20e543813de675cfc0f467b348
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/class.nextgen_basic_singlepic_installer.php
@@ -0,0 +1,16 @@
+<?php
+
+class C_NextGen_Basic_SinglePic_Installer extends C_Gallery_Display_Installer
+{
+	function install()
+	{
+		$this->install_display_type(
+			NEXTGEN_BASIC_SINGLEPIC_MODULE_NAME, array(
+			'title'					=>	'NextGEN Basic SinglePic',
+			'entity_types'			=>	array('image'),
+			'preview_image_relpath'	=>	'photocrati-nextgen_basic_singlepic#preview.gif',
+			'default_source'		=>	'galleries',
+			'view_order' => NEXTGEN_DISPLAY_PRIORITY_BASE + 60
+		));
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/module.nextgen_basic_singlepic.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/module.nextgen_basic_singlepic.php
new file mode 100644
index 0000000000000000000000000000000000000000..d975ddca2083ce948ed7fbd112d97269ca6d2114
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/module.nextgen_basic_singlepic.php
@@ -0,0 +1,101 @@
+<?php
+
+/***
+{
+        Module:     photocrati-nextgen_basic_singlepic,
+        Depends:    { photocrati-nextgen_gallery_display }
+}
+ ***/
+
+define('NEXTGEN_BASIC_SINGLEPIC_MODULE_NAME', 'photocrati-nextgen_basic_singlepic');
+
+class M_NextGen_Basic_Singlepic extends C_Base_Module
+{
+    function define()
+    {
+        parent::define(
+            NEXTGEN_BASIC_SINGLEPIC_MODULE_NAME,
+            'NextGen Basic Singlepic',
+            'Provides a singlepic gallery for NextGEN Gallery',
+            '0.4',
+            'http://www.photocrati.com',
+            'Photocrati Media',
+            'http://www.photocrati.com'
+        );
+
+		include_once('class.nextgen_basic_singlepic_installer.php');
+		C_Photocrati_Installer::add_handler($this->module_id, 'C_NextGen_Basic_SinglePic_Installer');
+    }
+
+
+    function _register_adapters()
+    {
+        // Provides settings fields and frontend rendering
+        $this->get_registry()->add_adapter(
+            'I_Display_Type_Controller',
+            'A_NextGen_Basic_Singlepic_Controller',
+            $this->module_id
+        );
+
+		// Provides default values for the display type
+		$this->get_registry()->add_adapter(
+			'I_Display_Type_Mapper',
+			'A_NextGen_Basic_Singlepic_Mapper'
+		);
+
+		// Provides the display settings form for the SinglePic display type
+		$this->get_registry()->add_adapter(
+			'I_Form',
+			'A_NextGen_Basic_SinglePic_Form',
+			$this->module_id
+		);
+
+       // Adds the setting forms
+        $this->get_registry()->add_adapter(
+            'I_Form_Manager',
+            'A_NextGen_Basic_SinglePic_Forms'
+        );
+    }
+
+	function _register_hooks()
+	{
+		C_NextGen_Shortcode_Manager::add('singlepic',    array(&$this, 'render_singlepic'));
+	}
+
+    /**
+     * Gets a value from the parameter array, and if not available, uses the default value
+     *
+     * @param string $name
+     * @param mixed $default
+     * @param array $params
+     * @return mixed
+     */
+    function _get_param($name, $default, $params)
+    {
+        return (isset($params[$name])) ? $params[$name] : $default;
+    }
+
+	function render_singlepic($params, $inner_content=NULL)
+	{
+		$params['display_type'] = $this->_get_param('display_type', NEXTGEN_BASIC_SINGLEPIC_MODULE_NAME, $params);
+        $params['image_ids'] = $this->_get_param('id', NULL, $params);
+        unset($params['id']);
+
+		$renderer = $this->get_registry()->get_utility('I_Displayed_Gallery_Renderer');
+        return $renderer->display_images($params, $inner_content);
+	}
+
+    function get_type_list()
+    {
+        return array(
+            'A_Nextgen_Basic_Singlepic' => 'adapter.nextgen_basic_singlepic.php',
+            'A_Nextgen_Basic_Singlepic_Controller' => 'adapter.nextgen_basic_singlepic_controller.php',
+            'A_Nextgen_Basic_Singlepic_Form' => 'adapter.nextgen_basic_singlepic_form.php',
+            'A_Nextgen_Basic_Singlepic_Forms' => 'adapter.nextgen_basic_singlepic_forms.php',
+            'C_NextGen_Basic_SinglePic_Installer' => 'class.nextgen_basic_singlepic_installer.php',
+            'A_Nextgen_Basic_Singlepic_Mapper' => 'adapter.nextgen_basic_singlepic_mapper.php'
+        );
+    }
+}
+
+new M_NextGen_Basic_Singlepic();
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/static/nextgen_basic_singlepic.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/static/nextgen_basic_singlepic.css
new file mode 100644
index 0000000000000000000000000000000000000000..c82808475720b454e1b825046cb60a560d5674ae
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/static/nextgen_basic_singlepic.css
@@ -0,0 +1,38 @@
+/* ----------- Single picture -------------*/
+
+.ngg-gallery-singlepic-image {
+margin: 0 auto 1em auto;
+}
+.ngg-gallery-singlepic-image a {
+max-width: 100%;
+}
+.ngg-gallery-singlepic-image img {
+margin: 0;
+max-width: 100%;
+border: none;
+}
+
+.ngg-singlepic {
+    background-color: #FFFFFF;
+    display: block;
+    padding: 4px;
+}
+
+.ngg-left {
+    float: left;
+    margin-right: 10px;
+}
+
+.ngg-right {
+    float: right;
+    margin-left: 10px;
+}
+
+.ngg-center {
+    margin-left: auto !important;
+    margin-right: auto !important;
+}
+
+.ngg-gallery-singlepic-image .ngg-trigger-buttons {
+margin: 5px 0 0 0;
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/static/preview.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/static/preview.gif
new file mode 100644
index 0000000000000000000000000000000000000000..8389b127b1ac30f1d96b57a9e29e167fa01da3bc
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/static/preview.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/templates/nextgen_basic_singlepic.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/templates/nextgen_basic_singlepic.php
new file mode 100644
index 0000000000000000000000000000000000000000..63f4d92ed983966a006a54f0385e5c2c2846cafa
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/templates/nextgen_basic_singlepic.php
@@ -0,0 +1,91 @@
+<?php if (!empty($image)): ?>
+    <?php
+    
+    $this->start_element('nextgen_gallery.gallery_container', 'container', $displayed_gallery);
+    
+		$image_size = $storage->get_original_dimensions($image);
+
+		if ($image_size == null) {
+			$image_size['width'] = $image->meta_data['width'];
+			$image_size['height'] = $image->meta_data['height'];
+		}
+		
+		$image_ratio = $image_size['width'] / $image_size['height'];
+    
+    $width = isset($settings['width']) ? $settings['width'] : null;
+    $height = isset($settings['height']) ? $settings['height'] : null;
+    
+    $width = intval($width);
+    $height = intval($height);
+		
+		if ($width != null && $height != null)
+		{
+			// check image aspect ratio, avoid distortions
+			$aspect_ratio = $width / $height;
+			if ($image_ratio > $aspect_ratio) {
+				if ($image_size['width'] > $width) {
+					$height = (int) round($width / $image_ratio);
+				}
+			}
+			else {
+				if ($image_size['height'] > $height) {
+					$width = (int) round($height * $image_ratio);
+				}
+			}
+			
+			// Ensure that height is always null, or else the image won't be responsive correctly
+			$height = null;
+		}
+		else if ($height != null)
+		{
+			$width = (int) round($height * $image_ratio);
+			// Ensure that height is always null, or else the image won't be responsive correctly
+			$height = null;
+		}
+		
+		$style = null;
+		
+		if ($width) {
+			$style .= 'max-width: ' . $width . 'px';
+		}
+		
+		if ($height) {
+			$style .= 'max-height: ' . $height . 'px';
+		}
+
+    ?>
+    <?php $this->start_element('nextgen_gallery.image_panel', 'item', $image); ?>
+    
+		<div class="ngg-gallery-singlepic-image <?php echo $settings['float']; ?>" style="<?php echo esc_attr($style); ?>">
+			<?php
+
+			$this->start_element('nextgen_gallery.image', 'item', $image);
+			
+			?>
+    	<a href="<?php echo esc_attr($settings['link']); ?>"
+		     title="<?php echo esc_attr($image->description)?>"
+		     data-image-id='<?php echo esc_attr($image->pid); ?>'
+             target='<?php echo esc_attr($target); ?>'
+       <?php echo $effect_code ?>>
+        	<img class="ngg-singlepic"
+             src="<?php echo $thumbnail_url; ?>"
+             alt="<?php echo esc_attr($image->alttext); ?>"
+             title="<?php echo esc_attr($image->alttext); ?>"
+             <?php if ($width) { ?> width="<?php echo esc_attr($width); ?>" <?php } ?>
+             <?php if ($height) { ?> height="<?php echo esc_attr($height); ?>" <?php } ?> />
+    	</a>
+		  <?php
+		  
+		 		$this->end_element(); 
+		 	?>
+    </div>
+    <?php if (!is_null($inner_content)) { ?><span><?php echo $inner_content; ?></span><?php } ?>
+    <?php
+    
+   		$this->end_element(); 
+   		
+   		$this->end_element(); 
+    ?>
+<?php else: ?>
+    <p>No image found</p>
+<?php endif ?>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/templates/nextgen_basic_singlepic_settings_dimensions.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/templates/nextgen_basic_singlepic_settings_dimensions.php
new file mode 100644
index 0000000000000000000000000000000000000000..46054ec742ecb34dd83ee0ce16a3474bd0fe4186
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/templates/nextgen_basic_singlepic_settings_dimensions.php
@@ -0,0 +1,25 @@
+<tr>
+    <td>
+        <label for='<?php echo esc_attr($display_type_name); ?>_image_dimensions'>
+            <?php echo_h($dimensions_label); ?>
+        </label>
+    </td>
+    <td>
+        <label for='<?php echo esc_attr($display_type_name); ?>_width'>w</label>
+        <input type='number'
+               id='<?php echo esc_attr($display_type_name); ?>_width'
+               name='<?php echo esc_attr($display_type_name); ?>[width]'
+               class='nextgen_settings_field_width_and_height'
+               placeholder='<?php _e('Width'); ?>'
+               min='1'
+               value='<?php echo esc_attr($width); ?>'/> /
+        <input type='number'
+               id='<?php echo esc_attr($display_type_name); ?>_height'
+               name='<?php echo esc_attr($display_type_name); ?>[height]'
+               class='nextgen_settings_field_width_and_height'
+               placeholder='<?php _e('Height'); ?>'
+               min='1'
+               value='<?php echo esc_attr($height); ?>'/>
+        <label for='<?php echo esc_attr($display_type_name); ?>_height'>h</label>
+    </td>
+</tr>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/templates/nextgen_basic_singlepic_settings_link.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/templates/nextgen_basic_singlepic_settings_link.php
new file mode 100644
index 0000000000000000000000000000000000000000..92ec7948efb364113dac7b910ddc84f757730e78
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/templates/nextgen_basic_singlepic_settings_link.php
@@ -0,0 +1,15 @@
+<tr>
+    <td>
+        <label for='<?php echo esc_attr($display_type_name); ?>_link'>
+            <?php echo_h($link_label); ?>
+        </label>
+    </td>
+    <td>
+        <input type='text'
+               id='<?php echo esc_attr($display_type_name); ?>_link'
+               name='<?php echo esc_attr($display_type_name); ?>[link]'
+               class='ngg_singlepic_link'
+               placeholder='http://...'
+               value='<?php echo esc_attr($link); ?>'>
+    </td>
+</tr>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/templates/nextgen_basic_singlepic_settings_quality.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/templates/nextgen_basic_singlepic_settings_quality.php
new file mode 100644
index 0000000000000000000000000000000000000000..afa0a064a773f153cd1c0c240fbe485f58933859
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/templates/nextgen_basic_singlepic_settings_quality.php
@@ -0,0 +1,17 @@
+<tr>
+    <td>
+        <label for='<?php echo esc_attr($display_type_name); ?>_quality'>
+            <?php echo_h($quality_label); ?>
+        </label>
+    </td>
+    <td>
+        <input type='number'
+               id='<?php echo esc_attr($display_type_name); ?>_quality'
+               name='<?php echo esc_attr($display_type_name); ?>[quality]'
+               class='ngg_singlepic_quality'
+               placeholder='quality %'
+               min='1'
+               max='100'
+               value='<?php echo esc_attr($quality); ?>'>
+    </td>
+</tr>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/templates/nextgen_basic_singlepic_settings_radio.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/templates/nextgen_basic_singlepic_settings_radio.php
new file mode 100644
index 0000000000000000000000000000000000000000..6ea96eaa7d5252ddfefe5da5f2d1a6094f6f5a72
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/templates/nextgen_basic_singlepic_settings_radio.php
@@ -0,0 +1,26 @@
+<tr>
+    <td>
+        <label for="<?php print esc_attr("{$display_type_name}_{$name}"); ?>"
+               <?php if (!empty($text)) { ?>title='<?php print esc_attr($text); ?>'<?php } ?>
+               <?php if (!empty($text)) { ?>class='tooltip'<?php } ?>>
+            <?php print $label; ?>
+        </label>
+    </td>
+    <td>
+        <input type="radio"
+               id="<?php print $display_type_name . '_' . $name; ?>"
+               name="<?php print $display_type_name . '[' . $name . ']'; ?>"
+               class="<?php print $display_type_name . '_' . $name; ?>"
+               value="1"
+            <?php checked(1, $value); ?>/>
+        <label for="<?php print $display_type_name . '_' . $name; ?>"><?php _e('Yes'); ?></label>
+        &nbsp;
+        <input type="radio"
+               id="<?php print $display_type_name . '_' . $name; ?>_no"
+               name="<?php print $display_type_name . '[' . $name . ']'; ?>"
+               class="<?php print $display_type_name . '_' . $name; ?>"
+               value="0"
+            <?php checked(0, $value); ?>/>
+        <label for="<?php print $display_type_name . '_' . $name; ?>_no"><?php _e('No'); ?></label>
+    </td>
+</tr>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/templates/nextgen_basic_singlepic_settings_select.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/templates/nextgen_basic_singlepic_settings_select.php
new file mode 100644
index 0000000000000000000000000000000000000000..f23d575cba5d9721fc6ddc6f2efef0aa192448c6
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/templates/nextgen_basic_singlepic_settings_select.php
@@ -0,0 +1,19 @@
+<tr>
+    <td>
+        <label for="<?php print esc_attr("{$display_type_name}_{$name}"); ?>"
+               <?php if (!empty($text)) { ?>title='<?php print esc_attr($text); ?>'<?php } ?>
+               <?php if (!empty($text)) { ?>class='tooltip'<?php } ?>>
+            <?php print $label; ?>
+        </label>
+    </td>
+    <td>
+        <select
+               id="<?php print $display_type_name . '_' . $name; ?>"
+               name="<?php print $display_type_name . '[' . $name . ']'; ?>"
+               class="<?php print $display_type_name . '_' . $name; ?>">
+            <?php foreach ($options as $key => $val) { ?>
+                <option value='<?php print $key; ?>' <?php selected($key, $value); ?>><?php print _($val); ?></option>
+            <?php } ?>
+        </select>
+    </td>
+</tr>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/adapter.nextgen_basic_tagcloud.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/adapter.nextgen_basic_tagcloud.php
new file mode 100644
index 0000000000000000000000000000000000000000..6767f6f3f67545af71d24b08ad50d7a48f0d599a
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/adapter.nextgen_basic_tagcloud.php
@@ -0,0 +1,23 @@
+<?php
+
+class A_NextGen_Basic_Tagcloud extends Mixin
+{
+    function initialize()
+    {
+        if ($this->object->name == NEXTGEN_BASIC_TAG_CLOUD_MODULE_NAME) {
+            $this->object->add_pre_hook(
+				'validation',
+				get_class(),
+				'Hook_NextGen_Basic_Tagcloud_Validation'
+			);
+        }
+    }
+}
+
+class Hook_NextGen_Basic_Tagcloud_Validation extends Hook
+{
+    function validation()
+    {
+        $this->object->validates_presence_of('display_type');
+    }
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/adapter.nextgen_basic_tagcloud_controller.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/adapter.nextgen_basic_tagcloud_controller.php
new file mode 100644
index 0000000000000000000000000000000000000000..5e8f0679b778b32e07d7a19b420e7701618e179d
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/adapter.nextgen_basic_tagcloud_controller.php
@@ -0,0 +1,78 @@
+<?php
+
+class A_NextGen_Basic_Tagcloud_Controller extends Mixin
+{
+    /**
+     * Displays the 'tagcloud' display type
+     *
+     * @param stdClass|C_Displayed_Gallery|C_DataMapper_Model $displayed_gallery
+     */
+    function index_action($displayed_gallery, $return = FALSE)
+    {
+        $display_settings = $displayed_gallery->display_settings;
+        $application = $this->object->get_registry()->get_utility('I_Router')->get_routed_app();
+        $tag = $this->param('gallerytag');
+
+        // we're looking at a tag, so show images w/that tag as a thumbnail gallery
+        if (!is_home() && !empty($tag))
+        {
+            return $this->object->get_registry()
+                        ->get_utility('I_Displayed_Gallery_Renderer')
+                        ->display_images(
+                array(
+                    'source' => 'tags',
+                    'container_ids' => array(esc_attr($tag)),
+                    'display_type' => $display_settings['display_type']
+                )
+            );
+        }
+
+        $defaults = array(
+            'exclude'  => '',
+            'format'   => 'list',
+            'include'  => $displayed_gallery->get_term_ids_for_tags(),
+            'largest'  => 22,
+            'link'     => 'view',
+            'number'   => 45,
+            'order'    => 'ASC',
+            'orderby'  => 'name',
+            'smallest' => 8,
+            'taxonomy' => 'ngg_tag',
+            'unit'     => 'pt'
+        );
+        $args = wp_parse_args('', $defaults);
+
+        // Always query top tags
+        $tags = get_terms($args['taxonomy'], array_merge($args, array('orderby' => 'count', 'order' => 'DESC')));
+
+        foreach ($tags as $key => $tag) {
+            $tags[$key]->link = $this->object->set_param_for($application->get_routed_url(TRUE), 'gallerytag', $tag->slug);
+            $tags[$key]->id = $tag->term_id;
+        }
+
+        $params = $display_settings;
+        $params['inner_content']        = $displayed_gallery->inner_content;
+        $params['storage']              = &$storage;
+        $params['tagcloud']             = wp_generate_tag_cloud($tags, $args);
+        $params['displayed_gallery_id'] = $displayed_gallery->id();
+                
+        $params = $this->object->prepare_display_parameters($displayed_gallery, $params);
+        
+        return $this->object->render_partial('photocrati-nextgen_basic_tagcloud#nextgen_basic_tagcloud', $params, $return);
+    }
+
+    /**
+     * Enqueues all static resources required by this display type
+     *
+     * @param C_Displayed_Gallery $displayed_gallery
+     */
+    function enqueue_frontend_resources($displayed_gallery)
+    {
+		$this->call_parent('enqueue_frontend_resources', $displayed_gallery);
+
+        wp_enqueue_style('photocrati-nextgen_basic_tagcloud-style', $this->get_static_url('photocrati-nextgen_basic_tagcloud#nextgen_basic_tagcloud.css'));
+
+		$this->enqueue_ngg_styles();
+    }
+
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/adapter.nextgen_basic_tagcloud_form.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/adapter.nextgen_basic_tagcloud_form.php
new file mode 100644
index 0000000000000000000000000000000000000000..b242b271773a78128d5cc0d8c7e8177e6ff8198f
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/adapter.nextgen_basic_tagcloud_form.php
@@ -0,0 +1,41 @@
+<?php
+
+class A_NextGen_Basic_Tagcloud_Form extends Mixin_Display_Type_Form
+{
+	function get_display_type_name()
+	{
+		return NEXTGEN_BASIC_TAG_CLOUD_MODULE_NAME;
+	}
+
+
+    function _get_field_names()
+    {
+        return array(
+            'nextgen_basic_tagcloud_display_type'
+        );
+    }
+
+    function _render_nextgen_basic_tagcloud_display_type_field($display_type)
+    {
+        $types = array();
+        $skip_types = array(
+            'photocrati-nextgen_basic_tagcloud',
+            'photocrati-nextgen_basic_singlepic'
+        );
+        $mapper = $this->object->get_registry()->get_utility('I_Display_Type_Mapper');
+        $display_types = $mapper->find_all();
+        foreach ($display_types as $dt) {
+            if (in_array($dt->name, $skip_types)) continue;
+            $types[$dt->name] = str_replace('NextGEN Basic ', '', $dt->title);
+        }
+
+        return $this->_render_select_field(
+            $display_type,
+            'display_type',
+            'Display type',
+            $types,
+            $display_type->settings['display_type'],
+            'The display type that the tagcloud will point its results to'
+        );
+    }
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/adapter.nextgen_basic_tagcloud_forms.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/adapter.nextgen_basic_tagcloud_forms.php
new file mode 100644
index 0000000000000000000000000000000000000000..cc90442aeb8f25907c783757f69b6c6d6f74f7a3
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/adapter.nextgen_basic_tagcloud_forms.php
@@ -0,0 +1,11 @@
+<?php
+
+class A_NextGen_Basic_TagCloud_Forms extends Mixin
+{
+    function initialize()
+    {
+        $this->add_form(
+            NEXTGEN_DISPLAY_SETTINGS_SLUG, NEXTGEN_BASIC_TAG_CLOUD_MODULE_NAME
+        );
+    }
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/adapter.nextgen_basic_tagcloud_mapper.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/adapter.nextgen_basic_tagcloud_mapper.php
new file mode 100644
index 0000000000000000000000000000000000000000..daa7e74362cebc1802d4b662d2f146080ba6ce53
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/adapter.nextgen_basic_tagcloud_mapper.php
@@ -0,0 +1,28 @@
+<?php
+
+class A_NextGen_Basic_TagCloud_Mapper extends Mixin
+{
+	function initialize()
+	{
+		$this->object->add_post_hook(
+			'set_defaults',
+			'NextGen Basic TagCloud Default Values',
+			'Hook_NextGen_Basic_TagCloud_Defaults'
+		);
+	}
+}
+
+class Hook_NextGen_Basic_TagCloud_Defaults extends Hook
+{
+	function set_defaults($entity)
+	{
+		if ($entity->name == NEXTGEN_BASIC_TAG_CLOUD_MODULE_NAME) {
+			$this->object->_set_default_value(
+				$entity,
+				'settings',
+				'display_type',
+				'photocrati-nextgen_basic_thumbnails'
+			);
+		}
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/adapter.nextgen_basic_tagcloud_routes.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/adapter.nextgen_basic_tagcloud_routes.php
new file mode 100644
index 0000000000000000000000000000000000000000..57fdaf6967ae461dfc26b3ce71bcf1fcae91a274
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/adapter.nextgen_basic_tagcloud_routes.php
@@ -0,0 +1,20 @@
+<?php
+
+class A_NextGen_Basic_TagCloud_Routes extends Mixin
+{
+	function initialize()
+	{
+		$this->object->add_pre_hook(
+			'serve_request',
+			'Adds Routes for NextGen Basic TagCloud',
+			get_class(),
+			'_add_nextgen_basic_tagcloud_routes'
+		);
+	}
+
+	function _add_nextgen_basic_tagcloud_routes()
+	{
+		$slug = C_NextGen_Settings::get_instance()->router_param_slug;
+        $this->object->rewrite("{$slug}{*}/tags/{\\w}{*}", "{$slug}{1}/gallerytag--{2}{3}");
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/adapter.nextgen_basic_tagcloud_urls.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/adapter.nextgen_basic_tagcloud_urls.php
new file mode 100644
index 0000000000000000000000000000000000000000..6536004bacbb2cbb757ec5b367ad46bb361d1597
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/adapter.nextgen_basic_tagcloud_urls.php
@@ -0,0 +1,75 @@
+<?php
+
+class A_NextGen_Basic_TagCloud_Urls extends Mixin
+{
+	function initialize()
+	{
+		$this->object->add_post_hook(
+			'set_parameter_value',
+			get_class(),
+			get_class(),
+			'_set_tag_cloud_parameter'
+		);
+		$this->object->add_post_hook(
+			'remove_parameter',
+			get_class(),
+			get_class(),
+			'_remove_tag_cloud_parameter'
+		);
+	}
+
+
+	function create_parameter_segment($key, $value, $id, $use_prefix)
+	{
+		if ($key == 'gallerytag') {
+			return 'tags/'.$value;
+		}
+		else return $this->call_parent('create_parameter_segment', $key, $value, $id, $use_prefix);
+	}
+
+
+	function _set_tag_cloud_parameter($key, $value, $id=NULL, $use_prefix=NULL)
+	{
+		$this->_set_tag_cloud_parameters($key, $id);
+	}
+
+
+	function _remove_tag_cloud_parameter($key, $id=NULL, $use_prefix=NULL)
+	{
+		$this->_set_tag_cloud_parameters($key, $id);
+	}
+
+
+	function _set_tag_cloud_parameters($key, $id=NULL)
+	{
+		// Get the returned url
+		$retval		= $this->object->get_method_property(
+			$this->method_called, ExtensibleObject::METHOD_PROPERTY_RETURN_VALUE
+		);
+
+		// Get the settings manager
+		$settings	= C_NextGen_Settings::get_instance();
+
+		// Create the regex pattern
+		$sep		= preg_quote($settings->router_param_separator, '#');
+		if ($id)$id = preg_quote($id, '#').$sep;
+		$prefix		= preg_quote($settings->router_param_prefix, '#');
+		$regex		= implode('', array(
+			'#//?',
+			$id ? "({$id})?" : "(\w+{$sep})?",
+			"($prefix)?gallerytag{$sep}([\w-_]+)/?#"
+		));
+
+		// Replace any page parameters with the ngglegacy equivalent
+		if (preg_match($regex, $retval, $matches)) {
+			$retval = str_replace($matches[0], "/tags/{$matches[3]}/", $retval);
+			$this->object->set_method_property(
+				$this->method_called,
+				ExtensibleObject::METHOD_PROPERTY_RETURN_VALUE,
+				$retval
+			);
+		}
+
+		return $retval;
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/class.nextgen_basic_tagcloud_installer.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/class.nextgen_basic_tagcloud_installer.php
new file mode 100644
index 0000000000000000000000000000000000000000..0788ae64dcc6b5296ea4f0ca4ee47769c2475e56
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/class.nextgen_basic_tagcloud_installer.php
@@ -0,0 +1,21 @@
+<?php
+
+class C_NextGen_Basic_Tagcloud_Installer extends C_Gallery_Display_Installer
+{
+	/**
+	 * Installs the display type for NextGEN Basic Tagcloud
+	 */
+	function install()
+	{
+		$this->install_display_type(
+			NEXTGEN_BASIC_TAG_CLOUD_MODULE_NAME, array(
+				'title'					=>	'NextGEN Basic TagCloud',
+				'entity_types'			=>	array('image'),
+				'preview_image_relpath'	=>	'photocrati-nextgen_basic_tagcloud#preview.gif',
+				'default_source'		=>	'tags',
+				'view_order' => NEXTGEN_DISPLAY_PRIORITY_BASE + 100
+			)
+
+		);
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/class.taxonomy_controller.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/class.taxonomy_controller.php
new file mode 100644
index 0000000000000000000000000000000000000000..a51bf1e1b7b30817588287746d8c8eadfe82093e
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/class.taxonomy_controller.php
@@ -0,0 +1,117 @@
+<?php
+
+class C_Taxonomy_Controller extends C_MVC_Controller
+{
+    static $_instances = array();
+    protected $ngg_tag_detection_has_run = FALSE;
+
+    /**
+     * Returns an instance of this class
+     *
+     * @param string $context
+     * @return C_Taxonomy_Controller
+     */
+    static function get_instance($context = FALSE)
+    {
+        if (!isset(self::$_instances[$context]))
+        {
+            $klass = get_class();
+            self::$_instances[$context] = new $klass($context);
+        }
+        return self::$_instances[$context];
+    }
+
+    function define($context = FALSE)
+    {
+        parent::define($context);
+        $this->implement('I_Taxonomy_Controller');
+    }
+
+    /**
+     * Returns the rendered HTML of a gallery based on the provided tag
+     *
+     * @param string $tag
+     * @return string
+     */
+    function index_action($tag)
+    {
+        $renderer = $this->object->get_registry()->get_utility('I_Displayed_Gallery_Renderer');
+        $output = $renderer->display_images(array(
+            'source' => 'tags',
+            'container_ids' => $tag,
+            'slug' => $tag,
+            'display_type' => NEXTGEN_GALLERY_BASIC_THUMBNAILS
+        ));
+
+        // This strips extra whitespace and strips newlines. For some reason this is especially
+        // necessary on Wordpress taxonomy pages.
+        return trim(preg_replace("/\s\s+/", " ", $output));
+    }
+
+    /**
+     * Determines if the current page is /ngg_tag/{*}
+     *
+     * @param $posts Wordpress post objects
+     * @return array Wordpress post objects
+     */
+    function detect_ngg_tag($posts)
+    {
+        global $wp;
+        global $wp_query;
+
+        // This appears to be necessary for multisite installations, but I can't imagine why. More hackery..
+        $tag = (get_query_var('ngg_tag') ? get_query_var('ngg_tag') : get_query_var('name'));
+
+        if (!$this->ngg_tag_detection_has_run // don't run more than once; necessary for certain themes
+        &&  !is_admin() // will destroy 'view all posts' page without this
+        &&  !empty($tag) // only run when a tag has been given to wordpress
+        &&  (stripos($wp->request, 'ngg_tag') === 0 // make sure the query begins with /ngg_tag
+             || (isset($wp_query->query_vars['page_id'])
+                  && $wp_query->query_vars['page_id'] === 'ngg_tag')
+            )
+           )
+        {
+            $this->ngg_tag_detection_has_run = TRUE;
+
+            // Wordpress somewhat-correctly generates several notices, so silence them as they're really unnecessary
+            if (!defined('WP_DEBUG') || !WP_DEBUG)
+                error_reporting(0);
+
+            // create in-code a fake post; we feed it back to Wordpress as the sole result of the "the_posts" filter
+            $posts = NULL;
+            $posts[] = $this->create_ngg_tag_post($tag);
+
+            $wp_query->is_404 = FALSE;
+            $wp_query->is_page = TRUE;
+            $wp_query->is_singular = TRUE;
+            $wp_query->is_home = FALSE;
+            $wp_query->is_archive = FALSE;
+            $wp_query->is_category = FALSE;
+
+            unset($wp_query->query['error']);
+            $wp_query->query_vars['error'] = '';
+        }
+
+        return $posts;
+    }
+
+    function create_ngg_tag_post($tag)
+    {
+        $post = new stdClass;
+        $post->post_author = FALSE;
+        $post->post_name = 'ngg_tag';
+        $post->guid = get_bloginfo('wpurl') . '/' . 'ngg_tag';
+        $post->post_title = "Images tagged &quot;{$tag}&quot;";
+        $post->post_content = $this->index_action($tag);
+        $post->ID = FALSE;
+        $post->post_type = 'page';
+        $post->post_status = 'static';
+        $post->comment_status = 'closed';
+        $post->ping_status = 'closed';
+        $post->comment_count = 0;
+        $post->post_date = current_time('mysql');
+        $post->post_date_gmt = current_time('mysql', 1);
+
+        return($post);
+    }
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/interface.taxonomy_controller.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/interface.taxonomy_controller.php
new file mode 100644
index 0000000000000000000000000000000000000000..492c5767a2f467f9f640cc459efbff9cb6cf5e48
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/interface.taxonomy_controller.php
@@ -0,0 +1,8 @@
+<?php
+
+interface I_Taxonomy_Controller extends I_MVC_Controller
+{
+    function index_action($tag);
+    function detect_ngg_tag($posts);
+    function create_ngg_tag_post($tag);
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/module.nextgen_basic_tagcloud.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/module.nextgen_basic_tagcloud.php
new file mode 100644
index 0000000000000000000000000000000000000000..ddf24b9abdbe36814cf000dad0bf05044dd95b29
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/module.nextgen_basic_tagcloud.php
@@ -0,0 +1,141 @@
+<?php
+
+/***
+{
+        Module:     photocrati-nextgen_basic_tagcloud,
+        Depends:    { photocrati-nextgen_gallery_display }
+}
+ ***/
+
+define('NEXTGEN_BASIC_TAG_CLOUD_MODULE_NAME', 'photocrati-nextgen_basic_tagcloud');
+
+class M_NextGen_Basic_Tagcloud extends C_Base_Module
+{
+    function define()
+    {
+        parent::define(
+			NEXTGEN_BASIC_TAG_CLOUD_MODULE_NAME,
+            'NextGen Basic Tagcloud',
+            'Provides a tagcloud for NextGEN Gallery',
+            '0.4',
+            'http://www.photocrati.com',
+            'Photocrati Media',
+            'http://www.photocrati.com'
+        );
+
+		include_once('class.nextgen_basic_tagcloud_installer.php');
+		C_Photocrati_Installer::add_handler($this->module_id, 'C_NextGen_Basic_Tagcloud_Installer');
+    }
+
+    function _register_utilities()
+    {
+        $this->get_registry()->add_utility('I_Taxonomy_Controller', 'C_Taxonomy_Controller');
+    }
+
+    function _register_adapters()
+    {
+        // Provides settings fields and frontend rendering
+        $this->get_registry()->add_adapter(
+            'I_Display_Type_Controller',
+            'A_NextGen_Basic_Tagcloud_Controller',
+            $this->module_id
+        );
+
+        // Provides validation for the display type
+        $this->get_registry()->add_adapter(
+            'I_Display_Type',
+            'A_NextGen_Basic_Tagcloud'
+        );
+
+		// Provides default values for the display type
+		$this->get_registry()->add_adapter(
+			'I_Display_Type_Mapper',
+			'A_NextGen_Basic_TagCloud_Mapper'
+		);
+
+		// Add routing for ngglegacy routes
+		$this->get_registry()->add_adapter(
+			'I_Routing_App',
+			'A_NextGen_Basic_TagCloud_Routes'
+		);
+
+		// Add legacy urls
+		$this->get_registry()->add_adapter(
+			'I_Routing_App',
+			'A_NextGen_Basic_TagCloud_Urls'
+		);
+
+		// Adds a display settings form
+		$this->get_registry()->add_adapter(
+			'I_Form',
+			'A_NextGen_Basic_TagCloud_Form',
+			$this->module_id
+		);
+
+        // Provides the forms for the settings
+        $this->get_registry()->add_adapter(
+            'I_Form_Manager',
+            'A_NextGen_Basic_TagCloud_Forms'
+        );
+    }
+
+	function _register_hooks()
+	{
+		C_NextGen_Shortcode_Manager::add('tagcloud', array(&$this, 'render_shortcode'));
+
+        add_filter(
+            'the_posts',
+            array(
+                $this->get_registry()->get_utility('I_Taxonomy_Controller'),
+                'detect_ngg_tag'),
+            -10
+        );
+	}
+
+    /**
+     * Gets a value from the parameter array, and if not available, uses the default value
+     *
+     * @param string $name
+     * @param mixed $default
+     * @param array $params
+     * @return mixed
+     */
+    function _get_param($name, $default, $params)
+    {
+        return (isset($params[$name])) ? $params[$name] : $default;
+    }
+
+	/**
+     * Short-cut for rendering a thumbnail gallery based on tags
+     * @param array $params
+     * @param null $inner_content
+     * @return string
+     */
+	function render_shortcode($params, $inner_content=NULL)
+    {
+	    $params['tagcloud']     = $this->_get_param('tagcloud', 'yes', $params);
+        $params['source']       = $this->_get_param('source', 'tags', $params);
+        $params['display_type'] = $this->_get_param('display_type', NEXTGEN_BASIC_TAG_CLOUD_MODULE_NAME, $params);
+
+		$renderer = $this->get_registry()->get_utility('I_Displayed_Gallery_Renderer');
+        return $renderer->display_images($params, $inner_content);
+    }
+
+    function get_type_list()
+    {
+        return array(
+            'A_Nextgen_Basic_Tagcloud' => 'adapter.nextgen_basic_tagcloud.php',
+            'A_Nextgen_Basic_Tagcloud_Controller' => 'adapter.nextgen_basic_tagcloud_controller.php',
+            'A_Nextgen_Basic_Tagcloud_Form' => 'adapter.nextgen_basic_tagcloud_form.php',
+            'A_Nextgen_Basic_Tagcloud_Forms' => 'adapter.nextgen_basic_tagcloud_forms.php',
+            'C_NextGen_Basic_Tagcloud_Installer' => 'class.nextgen_basic_tagcloud_installer.php',
+            'A_Nextgen_Basic_Tagcloud_Mapper' => 'adapter.nextgen_basic_tagcloud_mapper.php',
+            'A_Nextgen_Basic_Tagcloud_Routes' => 'adapter.nextgen_basic_tagcloud_routes.php',
+            'A_Nextgen_Basic_Tagcloud_Urls' => 'adapter.nextgen_basic_tagcloud_urls.php',
+            'I_Taxonomy_Controller' => 'interface.taxonomy_controller.php',
+            'C_Taxonomy_Controller' => 'class.taxonomy_controller.php'
+        );
+    }
+}
+
+new M_NextGen_Basic_Tagcloud();
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/static/nextgen_basic_tagcloud.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/static/nextgen_basic_tagcloud.css
new file mode 100644
index 0000000000000000000000000000000000000000..1e80d054fb91fe8a4651b1c76a6d31b4627a5b3b
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/static/nextgen_basic_tagcloud.css
@@ -0,0 +1,22 @@
+.ngg-tagcloud {
+    display: inline-block;
+}
+.ngg-tagcloud ul.wp-tag-cloud {
+    margin: 0;
+    padding: 0;
+}
+
+.ngg-tagcloud ul.wp-tag-cloud li {
+    list-style: none;
+    float: left;
+    height: 30pt;
+    margin: 0 4px 0 0;
+    padding: 0;
+}
+
+.ngg-tagcloud ul.wp-tag-cloud li a {
+    display: table-cell;
+    display: block\9;
+    vertical-align: bottom;
+    height: 30pt;
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/static/preview.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/static/preview.gif
new file mode 100644
index 0000000000000000000000000000000000000000..e4533f1142df13b980e5b0c144e5c1ce7f1dbb98
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/static/preview.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/templates/nextgen_basic_tagcloud.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/templates/nextgen_basic_tagcloud.php
new file mode 100644
index 0000000000000000000000000000000000000000..fa2073fa048b221477d5602009244719f76ed3b9
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/templates/nextgen_basic_tagcloud.php
@@ -0,0 +1,7 @@
+<div class='ngg-tagcloud' id="gallery_<?php echo $displayed_gallery_id ?>">
+    <?php if ($tagcloud): ?>
+    <?php print $tagcloud; ?>
+    <?php else: ?>
+        No images have been tagged.
+    <?php endif ?>
+</div>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/templates/nextgen_basic_tagcloud_settings_select.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/templates/nextgen_basic_tagcloud_settings_select.php
new file mode 100644
index 0000000000000000000000000000000000000000..f23d575cba5d9721fc6ddc6f2efef0aa192448c6
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/templates/nextgen_basic_tagcloud_settings_select.php
@@ -0,0 +1,19 @@
+<tr>
+    <td>
+        <label for="<?php print esc_attr("{$display_type_name}_{$name}"); ?>"
+               <?php if (!empty($text)) { ?>title='<?php print esc_attr($text); ?>'<?php } ?>
+               <?php if (!empty($text)) { ?>class='tooltip'<?php } ?>>
+            <?php print $label; ?>
+        </label>
+    </td>
+    <td>
+        <select
+               id="<?php print $display_type_name . '_' . $name; ?>"
+               name="<?php print $display_type_name . '[' . $name . ']'; ?>"
+               class="<?php print $display_type_name . '_' . $name; ?>">
+            <?php foreach ($options as $key => $val) { ?>
+                <option value='<?php print $key; ?>' <?php selected($key, $value); ?>><?php print _($val); ?></option>
+            <?php } ?>
+        </select>
+    </td>
+</tr>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/adapter.nextgen_basic_template_form.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/adapter.nextgen_basic_template_form.php
new file mode 100644
index 0000000000000000000000000000000000000000..b1c45ec2ec588238bd0999cdeef48da9804b0b39
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/adapter.nextgen_basic_template_form.php
@@ -0,0 +1,214 @@
+<?php
+
+class A_NextGen_Basic_Template_Form extends Mixin
+{
+    /**
+     * Renders 'template' settings field
+     *
+     * @param $display_type
+     * @return mixed
+     */
+    function _render_nextgen_basic_templates_template_field($display_type)
+    {
+        switch($display_type->name) {
+            case 'photocrati-nextgen_basic_singlepic':
+                $prefix = 'singlepic';
+                break;
+            case 'photocrati-nextgen_basic_thumbnails':
+                $prefix = 'gallery';
+                break;
+            case 'photocrati-nextgen_basic_slideshow':
+                $prefix = 'gallery';
+                break;
+            case 'photocrati-nextgen_basic_imagebrowser':
+                $prefix = 'imagebrowser';
+                break;
+            case NEXTGEN_GALLERY_NEXTGEN_BASIC_COMPACT_ALBUM:
+                $prefix = 'album';
+                break;
+            case NEXTGEN_GALLERY_NEXTGEN_BASIC_EXTENDED_ALBUM:
+                $prefix = 'album';
+                break;
+            default:
+                $prefix = FALSE;
+                break;
+        }
+
+        // ensure the current file is in the list
+        $templates = $this->object->_get_available_templates($prefix);
+        if (!isset($templates[$display_type->settings['template']]))
+            $templates[$display_type->settings['template']] = $display_type->settings['template'];
+
+        return $this->object->render_partial(
+            'photocrati-nextgen_basic_templates#nextgen_basic_templates_settings_template',
+            array(
+                'display_type_name' => $display_type->name,
+                'template_label'    => _('Template'),
+                'template_text'     => _('Use a legacy template when rendering (not recommended).'),
+                'chosen_file'       => $display_type->settings['template'],
+                'templates'         => $templates
+            ),
+            True
+        );
+    }
+
+    /**
+     * Retrieves listing of available templates
+     *
+     * Override this function to modify or add to the available templates listing, array format
+     * is array(file_abspath => label)
+     * @return array
+     */
+    function _get_available_templates($prefix = FALSE)
+    {
+        $templates = array();
+        foreach ($this->object
+                      ->get_registry()
+                      ->get_utility('I_Legacy_Template_Locator')
+                      ->find_all($prefix) as $label => $files) {
+            foreach ($files as $file) {
+                $tmp = explode(DIRECTORY_SEPARATOR, $file);
+                $templates[$file] = "{$label}: " . end($tmp);
+            }
+        }
+        asort($templates);
+        return $templates;
+    }
+
+    /**
+     * Returns the parameter objects necessary for legacy template rendering (legacy_render())
+     *
+     * @param array $images Array of image objects
+     * @param string $slideshow_link Slideshow HTML string
+     * @param string string $piclens_link Piclens HTML string
+     * @param string $pagination Pagination HTML string
+     * @return array
+     */
+    function prepare_legacy_parameters($images, $displayed_gallery, $params = array())
+    {
+        // setup
+		$image_map	  = $this->object->get_registry()->get_utility('I_Image_Mapper');
+		$gallery_map  = C_Component_Registry::get_instance()->get_utility('I_Gallery_Mapper');
+		$image_key	  = $image_map->get_primary_key_column();
+		$gallery_key  = $gallery_map->get_primary_key_column();
+        $pid          = $this->object->param('pid');
+
+        // because picture_list implements ArrayAccess any array-specific actions must be taken on
+        // $picture_list->container or they won't do anything
+        $picture_list = new C_Image_Wrapper_Collection();
+        $current_pid  = NULL;
+
+        // begin processing
+        $current_page = (@get_the_ID() == FALSE) ? 0 : @get_the_ID();
+
+        // determine what the "current image" is; used mostly for carousel
+        if (!is_numeric($pid) && !empty($pid))
+        {
+            $picture = $image_map->find_first(array('image_slug = %s', $pid));
+            $pid = $picture->$image_key;
+        }
+
+        // create our new wrappers
+        foreach ($images as $image) {
+            $new_image = new C_Image_Wrapper($image, $displayed_gallery);
+            if ($pid == $new_image->$image_key)
+                $current_pid = $new_image;
+            $picture_list[] = $new_image;
+        }
+        reset($picture_list->container);
+
+        // assign current_pid
+        $current_pid = (is_null($current_pid)) ? current($picture_list->container) : $current_pid;
+
+        foreach ($picture_list as &$image) {
+            if (isset($image->hidden) && $image->hidden)
+            {
+                $tmp = $displayed_gallery->display_settings['number_of_columns'];
+                $image->style = ($tmp > 0) ? 'style="width:' . floor(100 / $tmp) . '%;display: none;"' : 'style="display: none;"';
+            }
+        }
+
+        // find our gallery to build the new one on
+        $orig_gallery = $gallery_map->find(current($picture_list->container)->galleryid);
+
+        // create the 'gallery' object
+        $gallery = new stdclass;
+        $gallery->ID = $displayed_gallery->id();
+        $gallery->name = stripslashes($orig_gallery->name);
+        $gallery->title = stripslashes($orig_gallery->title);
+        $gallery->description = html_entity_decode(stripslashes($orig_gallery->galdesc));
+        $gallery->pageid = $orig_gallery->pageid;
+
+        if ($displayed_gallery->display_settings['ajax_pagination'])
+            $gallery_id = $displayed_gallery->transient_id;
+        else
+            $gallery_id = $displayed_gallery->id();
+
+        $gallery->anchor = 'ngg-gallery-' . $gallery_id . '-' . $current_page;
+        $gallery->displayed_gallery = &$displayed_gallery;
+        $gallery->columns = @intval($displayed_gallery->display_settings['number_of_columns']);
+        $gallery->imagewidth = ($gallery->columns > 0) ? 'style="width:' . floor(100 / $gallery->columns) . '%;"' : '';
+
+        if (!empty($displayed_gallery->display_settings['show_slideshow_link'])) {
+            $gallery->show_slideshow = TRUE;
+            $gallery->slideshow_link = $params['slideshow_link'];
+            $gallery->slideshow_link_text = $displayed_gallery->display_settings['slideshow_link_text'];
+        }
+		else $gallery->show_slideshow = FALSE;
+
+        if (!empty($displayed_gallery->display_settings['show_piclens_link'])) {
+            $gallery->show_piclens = true;
+            $gallery->piclens_link = $params['piclens_link'];
+            $gallery->piclens_link_text = $displayed_gallery->display_settings['piclens_link_text'];
+        }
+		else $gallery->show_piclens = FALSE;
+
+        $gallery = apply_filters('ngg_gallery_object', $gallery, 4);
+
+        // build our array of things to return
+        $return = array(
+            'registry' => C_Component_Registry::get_instance(),
+            'gallery'  => $gallery,
+        );
+
+        // single_image is an internally added flag
+        if (!empty($params['single_image']))
+        {
+            $return['image'] = $picture_list[0];
+        }
+        else {
+            $return['current'] = $current_pid;
+            $return['images']  = $picture_list->container;
+        }
+
+        // this is expected to always exist
+        if (!empty($params['pagination']))
+        {
+            $return['pagination'] = $params['pagination'];
+        }
+        else {
+            $return['pagination'] = NULL;
+        }
+
+        $return['next'] = $params['next'];
+        $return['prev'] = $params['prev'];
+
+        return $return;
+    }
+
+	function enqueue_static_resources()
+	{
+		wp_enqueue_style(
+            'ngg_template_settings',
+            $this->get_static_url('photocrati-nextgen_basic_templates#ngg_template_settings.css')
+        );
+
+        wp_enqueue_script(
+            'ngg_template_settings',
+            $this->get_static_url('photocrati-nextgen_basic_templates#ngg_template_settings.js'),
+            array('jquery-ui-autocomplete', 'jquery-ui-button'),
+            $this->module_version,
+            TRUE
+        );
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/class.legacy_template_locator.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/class.legacy_template_locator.php
new file mode 100644
index 0000000000000000000000000000000000000000..78b6c61c618875911fd5ed950a4388da1fdbbde3
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/class.legacy_template_locator.php
@@ -0,0 +1,152 @@
+<?php
+
+/**
+ * Provides a utility to locate legacy templates
+ */
+class C_Legacy_Template_Locator extends C_Component
+{
+    static $_instances = array();
+
+    function define($context=FALSE)
+    {
+        parent::define($context);
+        $this->add_mixin('Mixin_Legacy_Template_Locator');
+        $this->implement('I_Legacy_Template_Locator');
+    }
+
+    static function get_instance($context=FALSE)
+    {
+        if (!isset(self::$_instances[$context])) {
+            $klass = get_class();
+            self::$_instances[$context] = new $klass($context);
+        }
+        return self::$_instances[$context];
+    }
+}
+
+
+/**
+ * Provides instance methods for the legacy template locator
+ */
+class Mixin_Legacy_Template_Locator extends Mixin
+{
+    /**
+     * Returns an array of template storing directories
+     *
+     * @return array Template storing directories
+     */
+    function get_template_directories()
+    {
+        return array(
+			'Child Theme' => get_stylesheet_directory() . DIRECTORY_SEPARATOR . 'nggallery' . DIRECTORY_SEPARATOR,
+			'Parent Theme' => get_template_directory() . DIRECTORY_SEPARATOR . 'nggallery' . DIRECTORY_SEPARATOR,
+            'NextGEN' => NGGALLERY_ABSPATH . 'view' . DIRECTORY_SEPARATOR
+        );
+    }
+
+    /**
+     * Returns an array of all available template files
+     *
+     * @return array All available template files
+     */
+    function find_all($prefix = FALSE)
+    {
+        $files = array();
+        foreach ($this->object->get_template_directories() as $label => $dir) {
+            $tmp = $this->object->get_templates_from_dir($dir, $prefix);
+            if (!$tmp)
+                continue;
+            $files[$label] = $tmp;
+        }
+        return $files;
+    }
+
+    /**
+     * Recursively scans $dir for files ending in .php
+     *
+     * @param string $dir Directory
+     * @return array All php files in $dir
+     */
+    function get_templates_from_dir($dir, $prefix = FALSE)
+    {
+        if (!is_dir($dir))
+        {
+            return;
+        }
+
+        $dir = new RecursiveDirectoryIterator($dir);
+        $iterator = new RecursiveIteratorIterator($dir);
+
+        // convert single-item arrays to string
+        if (is_array($prefix) && count($prefix) <= 1)
+        {
+            $prefix = end($prefix);
+        }
+
+        // we can filter results by allowing a set of prefixes, one prefix, or by showing all available files
+        if (is_array($prefix))
+        {
+            $str = implode('|', $prefix);
+            $regex_iterator = new RegexIterator($iterator, "/({$str})-.+\.php$/i", RecursiveRegexIterator::GET_MATCH);
+        }
+        elseif (is_string($prefix))
+        {
+            $regex_iterator = new RegexIterator($iterator, "#(.*)/{$prefix}\-?.*\.php$#i", RecursiveRegexIterator::GET_MATCH);
+        }
+        else {
+            $regex_iterator = new RegexIterator($iterator, '/^.+\.php$/i', RecursiveRegexIterator::GET_MATCH);
+        }
+
+        $files = array();
+        foreach ($regex_iterator as $filename) {
+            $files[] = reset($filename);
+        }
+
+        return $files;
+    }
+
+
+    /**
+     * Find a particular template by name
+     * @param $template
+     */
+    function find($template_name)
+    {
+        $template_abspath = FALSE;
+
+        // hook into the render feature to allow other plugins to include templates
+        $custom_template = apply_filters('ngg_render_template', FALSE, $template_name);
+
+        if ($custom_template === FALSE)
+            $custom_template = $template_name;
+
+        // Ensure we have a PHP extension
+        if (strpos($custom_template, '.php') === FALSE)
+            $custom_template .= '.php';
+
+        // Find the abspath of the template to render
+        if (!@file_exists($custom_template))
+        {
+            foreach ($this->object->get_template_directories() as $dir) {
+                if ($template_abspath)
+                    break;
+                $filename = path_join($dir, $custom_template);
+                if (@file_exists($filename))
+                {
+                    $template_abspath = $filename;
+                }
+                elseif (strpos($custom_template, '-template') === FALSE) {
+                    $filename = path_join($dir, str_replace('.php', '', $custom_template) . '-template.php');
+                    if (@file_exists($filename))
+                        $template_abspath = $filename;
+                }
+            }
+        }
+        else {
+            // An absolute path was already given
+            $template_abspath = $custom_template;
+        }
+
+        return $template_abspath;
+    }
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/interface.legacy_template_locator.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/interface.legacy_template_locator.php
new file mode 100644
index 0000000000000000000000000000000000000000..b7edb13226e25a3918fc8538981716bbbe9326e9
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/interface.legacy_template_locator.php
@@ -0,0 +1,9 @@
+<?php
+
+interface I_Legacy_Template_Locator
+{
+    function find($template_name);
+    function find_all($prefix = FALSE);
+    function get_template_directories();
+    function get_templates_from_dir($dir, $prefix = FALSE);
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/mixin.nextgen_basic_templates.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/mixin.nextgen_basic_templates.php
new file mode 100644
index 0000000000000000000000000000000000000000..ea896f7fe5a704f7b2caa85febb96e7ed7ccb7ff
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/mixin.nextgen_basic_templates.php
@@ -0,0 +1,37 @@
+<?php
+
+class Mixin_NextGen_Basic_Templates extends Mixin
+{
+        /**
+     * Renders NextGen-Legacy style templates
+     *
+     * @param string $template_name File name
+     * @param array $vars Specially formatted array of parameters
+     * @param bool $callback
+	 * @param bool $return
+     */
+    function legacy_render($template_name, $vars = array(), $return = FALSE, $prefix = NULL)
+    {
+        $retval = "[Not a valid template]";
+        $template_locator = $this->object->get_registry()->get_utility('I_Legacy_Template_Locator');
+
+        // search first for files with their prefix
+        $template_abspath = $template_locator->find($prefix . '-' . $template_name);
+        if (!$template_abspath)
+            $template_abspath = $template_locator->find($template_name);
+
+        if ($template_abspath)
+        {
+            // render the template
+            extract($vars);
+            if ($return) ob_start();
+            include ($template_abspath);
+            if ($return) {
+                $retval = ob_get_contents();
+                ob_end_clean();
+            }
+        }
+
+        return $retval;
+    }
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/module.nextgen_basic_templates.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/module.nextgen_basic_templates.php
new file mode 100644
index 0000000000000000000000000000000000000000..75c1640e046807520fe9ac2a59b56df920f5e55e
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/module.nextgen_basic_templates.php
@@ -0,0 +1,52 @@
+<?php
+
+/***
+{
+    Module: photocrati-nextgen_basic_templates,
+    Depends: { photocrati-nextgen_gallery_display, photocrati-nextgen_basic_album }
+}
+ ***/
+
+class M_NextGen_Basic_Templates extends C_Base_Module
+{
+	function define()
+	{
+		parent::define(
+			'photocrati-nextgen_basic_templates',
+			'NextGen Basic Templates',
+			'Provides a NextGen-Legacy compatible thumbnail gallery for NextGEN Gallery',
+			'0.2',
+			'http://www.photocrati.com',
+			'Photocrati Media',
+			'http://www.photocrati.com'
+		);
+	}
+
+    function _register_utilities()
+    {
+        $this->get_registry()->add_utility(
+            'I_Legacy_Template_Locator',
+            'C_Legacy_Template_Locator'
+        );
+    }
+
+	function _register_adapters()
+	{
+		$this->get_registry()->add_adapter(
+			'I_Form',
+			'A_NextGen_Basic_Template_Form'
+		);
+	}
+
+    function get_type_list()
+    {
+        return array(
+            'A_Nextgen_Basic_Template_Form' => 'adapter.nextgen_basic_template_form.php',
+            'C_Legacy_Template_Locator' => 'class.legacy_template_locator.php',
+            'I_Legacy_Template_Locator' => 'interface.legacy_template_locator.php',
+            'Mixin_Nextgen_Basic_Templates' => 'mixin.nextgen_basic_templates.php'
+        );
+    }
+}
+
+new M_NextGen_Basic_Templates();
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/static/ngg_template_settings.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/static/ngg_template_settings.css
new file mode 100644
index 0000000000000000000000000000000000000000..ecf2d7703d7a2d73c87e3bc4b322b2c5eae82963
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/static/ngg_template_settings.css
@@ -0,0 +1,19 @@
+.ngg_settings_template_wrapper .ui-combobox {
+    position: relative;
+    display: inline-block;
+}
+.ngg_settings_template_wrapper .ui-combobox-toggle {
+    position: absolute;
+    top: 0;
+    bottom: 0;
+    margin-left: -1px;
+}
+.ngg_settings_template_wrapper .ui-combobox-input {
+    margin: 0;
+    padding: 0.3em;
+    width: 365px;
+}
+
+.ngg_settings_template_wrapper .ui-helper-hidden-accessible {
+    display: none;
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/static/ngg_template_settings.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/static/ngg_template_settings.js
new file mode 100644
index 0000000000000000000000000000000000000000..717ee97c1b4aa53eda8bf8c9673b1924ca18fc48
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/static/ngg_template_settings.js
@@ -0,0 +1,114 @@
+(function( $ ) {
+    $.widget("ui.combobox", {
+        _create: function() {
+            var input,
+                that = this,
+                select = this.element.hide(),
+                selected = select.children(":selected"),
+                value = selected.val() ? selected.text() : "",
+                wrapper = this.wrapper = $("<span>").addClass("ui-combobox")
+                                                    .insertAfter(select);
+
+            function removeIfInvalid(element) {
+                var value = $(element).val(),
+                    matcher = new RegExp("^" + $.ui.autocomplete.escapeRegex(value) + "$", "i" ),
+                    valid = false;
+
+                select.children("option").each(function() {
+                    if ($(this).text().match(matcher)) {
+                        this.selected = valid = true;
+                        return false;
+                    }
+                });
+
+                if (!valid) {
+                    var new_option = new Option(value, value, true, true);
+                    select.append(new_option);
+                    select.val(value);
+                    $(element).val(value);
+                    input.data('autocomplete').term = value;
+                    return true;
+                }
+            }
+
+            input = $("<input>").appendTo(wrapper)
+                                .val(value)
+                                .attr("title", "")
+                                .addClass("ui-state-default ui-combobox-input")
+                                .autocomplete({
+                                    delay: 0,
+                                    minLength: 0,
+                                    source: function(request, response) {
+                                        var matcher = new RegExp($.ui.autocomplete.escapeRegex(request.term), "i");
+                                        response(select.children("option").map(function() {
+                                            var text = $(this).text();
+                                            if (!request.term || matcher.test(text)) {
+                                                var label = text;
+                                                if (request.term != '' && matcher.test(label)) {
+                                                    label = label.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + $.ui.autocomplete.escapeRegex(request.term) + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>");
+                                                }
+                                                return {
+                                                    label: label,
+                                                    value: text,
+                                                    option: this
+                                                };
+                                            }
+                                        }));
+                                    },
+                                    select: function(event, ui) {
+                                        ui.item.option.selected = true;
+                                        that._trigger("selected", event, {
+                                            item: ui.item.option
+                                        });
+                                    },
+                                    change: function(event, ui) {
+                                        if (!ui.item) {
+                                            return removeIfInvalid(this);
+                                        }
+                                    }
+                                })
+                                .addClass("ui-widget ui-widget-content ui-corner-left");
+			var autocomplete = input.data("autocomplete");
+            if (autocomplete) autocomplete._renderItem = function(ul, item) {
+                return $("<li>").data("item.autocomplete", item)
+                                .append("<a>" + item.label + "</a>")
+                                .appendTo(ul);
+            };
+
+            $("<a>").attr("tabIndex", -1)
+                    .attr("title", "Show All Items")
+                    .appendTo(wrapper)
+                    .button({
+                        icons: { primary: "ui-icon-triangle-1-s" },
+                        text: false
+                    })
+                    .removeClass("ui-corner-all")
+                    .addClass("ui-corner-right ui-combobox-toggle")
+                    .click(function() {
+                        // close if already visible
+                        if (input.autocomplete("widget").is(":visible")) {
+                            input.autocomplete("close");
+                            removeIfInvalid(input);
+                            return;
+                        }
+
+                        // work around a bug (likely same cause as #5265)
+                        $(this).blur();
+
+                        // pass empty string as value to search for, displaying all results
+                        input.autocomplete("search", "");
+                        input.focus();
+                    });
+        },
+
+        destroy: function() {
+            this.wrapper.remove();
+            this.element.show();
+            $.Widget.prototype.destroy.call( this );
+        }
+    });
+})(jQuery);
+
+jQuery(function($) {
+    $(".ngg_settings_template").combobox();
+});
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/templates/nextgen_basic_templates_settings_template.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/templates/nextgen_basic_templates_settings_template.php
new file mode 100644
index 0000000000000000000000000000000000000000..c4dcf78e33f33879c732c058820f810d856ca813
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/templates/nextgen_basic_templates_settings_template.php
@@ -0,0 +1,21 @@
+<tr>
+    <td>
+        <label for='<?php echo esc_attr($display_type_name); ?>_template'
+               class='tooltip'
+               title="<?php echo_h($template_text); ?>">
+            <?php echo_h($template_label); ?>
+        </label>
+    </td>
+    <td>
+        <div class='ngg_settings_template_wrapper'>
+            <select name='<?php echo esc_attr($display_type_name); ?>[template]'
+                    id='<?php echo esc_attr($display_type_name); ?>_template>'
+                    class='ngg_thumbnail_template ngg_settings_template'>
+                <option value=''>&nbsp;</option>
+                <?php foreach ($templates as $file => $label) { ?>
+                    <option value="<?php echo $file; ?>" <?php selected($chosen_file, $file, TRUE); ?>><?php echo_h($label); ?></option>
+                <?php } ?>
+            </select>
+        </div>
+    </td>
+</tr>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/adapter.attachment_datamapper.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/adapter.attachment_datamapper.php
new file mode 100644
index 0000000000000000000000000000000000000000..fb51b863b42bd2276ac78c34bc447b5c9debe2ec
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/adapter.attachment_datamapper.php
@@ -0,0 +1,62 @@
+<?php
+
+/**
+ * Modifies a custom post datamapper to use the WordPress built-in 'attachment'
+ * custom post type, as used by the Media Library
+ */
+class A_Attachment_DataMapper extends Mixin
+{
+	function initialize()
+	{
+		$this->object->_object_name = 'attachment';
+	}
+
+		/**
+	 * Saves the entity using the wp_insert_attachment function
+	 * instead of the wp_insert_post
+	 * @param stdObject $entity
+	 */
+	function _save_entity($entity)
+	{
+		$post = $this->object->_convert_entity_to_post($entity);
+		$filename = property_exists($entity, 'filename') ? $entity->filename : FALSE;
+		$primary_key = $this->object->get_primary_key_column();
+
+		if (($post_id = $attachment_id = wp_insert_attachment($post, $filename))) {
+			$new_entity = $this->object->find($post_id);
+			foreach ($new_entity as $key => $value) $entity->$key = $value;
+
+			// Merge meta data with WordPress Attachment Meta Data
+			if (property_exists($entity, 'meta_data')) {
+				$meta_data = wp_get_attachment_metadata($attachment_id);
+				if (isset($meta_data['image_meta'])) {
+					$entity->meta_data = array_merge_recursive(
+						$meta_data['image_meta'],
+						$entity->meta_data
+					);
+					wp_update_attachment_metadata($attachment_id, $entity->meta_data);
+				}
+			}
+
+			// Save properties are post meta as well
+			$this->object->_flush_and_update_postmeta($attachment_id, ($entity instanceof stdClass ? $entity : $entity->get_entity()), array(
+					'_wp_attached_file',
+					'_wp_attachment_metadata',
+					'_mapper'
+			));
+
+			$entity->id_field = $primary_key;
+		}
+
+		return $attachment_id;
+	}
+	
+	function select($fields='*')
+	{
+    $ret = $this->call_parent('select', $fields);
+    
+    $this->object->_query_args['datamapper_attachment'] = true;
+    
+    return $ret;
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/adapter.customtable_sorting_datamapper.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/adapter.customtable_sorting_datamapper.php
new file mode 100644
index 0000000000000000000000000000000000000000..76c9635e0e99469d2524c88083bcad455cd12708
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/adapter.customtable_sorting_datamapper.php
@@ -0,0 +1,42 @@
+<?php
+
+/**
+ * Modifies a custom table datamapper sorting to use natural sorting
+ */
+class A_CustomTable_Sorting_DataMapper extends Mixin
+{
+#	function initialize()
+#	{
+#		$this->object->get_wrapped_instance()->add_post_hook(
+#			'order_by',
+#			'Natural Sorting',
+#			'Hook_CustomTable_Natural_Sorting'
+#		);
+#	}
+	
+	function order_by($order_by, $direction='ASC')
+	{
+		// We treat the rand() function as an exception
+		if (!preg_match("/rand\(\s*\)/", $order_by)) {
+			$order_by_col	= $this->object->_clean_column($order_by);
+
+			// If the order by clause is a column, then it should be backticked
+			if ($this->object->has_column($order_by_col)) $order_by_col = "ABS(`{$order_by_col}`)";
+
+			$direction	= $this->object->_clean_column($direction);
+			$order		= "{$order_by_col} {$direction}";
+
+			$this->object->_order_clauses[] = $order;
+		}
+		
+		return $this->call_parent('order_by', $order_by, $direction);
+	}
+}
+
+class Hook_CustomTable_Natural_Sorting extends Hook
+{
+	function order_by($order_by, $direction='ASC')
+	{
+	}
+}
+
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/adapter.nextgen_data_factory.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/adapter.nextgen_data_factory.php
new file mode 100644
index 0000000000000000000000000000000000000000..652976f48ffae804eded61f2a7c4341fe19b87a1
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/adapter.nextgen_data_factory.php
@@ -0,0 +1,51 @@
+<?php
+
+class A_NextGen_Data_Factory extends Mixin
+{
+	function gallery($mapper=FALSE, $properties=array(), $context=FALSE)
+    {
+        return new C_Gallery($properties, $mapper, $context);
+    }
+
+
+    function gallery_image($mapper=FALSE, $properties=array(), $context=FALSE)
+    {
+        return new C_Image($properties, $mapper, $context);
+    }
+
+
+    function image($mapper=FALSE, $properties=array(), $context=FALSE)
+    {
+        return new C_Image($properties, $mapper, $context);
+    }
+
+
+    function album($mapper=FALSE, $properties=array(), $context=FALSE)
+    {
+        return new C_Album($mapper, $properties, $context);
+    }
+
+
+	function ngglegacy_gallery_storage($context=FALSE)
+	{
+		return new C_NggLegacy_GalleryStorage_Driver($context);
+	}
+
+
+	function wordpress_gallery_storage($context=FALSE)
+	{
+		return new C_WordPress_GalleryStorage_Driver($context);
+	}
+
+
+	function gallery_storage($context=FALSE)
+	{
+		return new C_Gallery_Storage($context);
+	}
+
+
+	function gallerystorage($context=FALSE)
+	{
+		return $this->object->gallery_storage($context);
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.album.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.album.php
new file mode 100644
index 0000000000000000000000000000000000000000..5d76d7485d8e831dc5fe59d5fbeee04882ffb691
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.album.php
@@ -0,0 +1,56 @@
+<?php
+
+class C_Album extends C_DataMapper_Model
+{
+    var $_mapper_interface = 'I_Album_Mapper';
+
+
+    function define($mapper=FALSE, $properties=FALSE, $context=FALSE)
+    {
+        parent::define($mapper, $properties, $context);
+        $this->add_mixin('Mixin_NextGen_Album_Instance_Methods');
+        $this->implement('I_Album');
+    }
+
+
+    /**
+     * Instantiates an Album object
+     * @param bool|\C_DataMapper|\FALSE $mapper
+     * @param array $properties
+     */
+    function initialize($mapper=FALSE, $properties=array()) {
+
+        // Get the mapper is not specified
+        if (!$mapper) {
+            $mapper = $this->get_registry()->get_utility($this->_mapper_interface);
+        }
+
+        // Initialize
+        parent::initialize($mapper, $properties);
+    }
+}
+
+/**
+ * Provides instance methods for the album
+ */
+class Mixin_NextGen_Album_Instance_Methods extends Mixin
+{
+    function validation()
+    {
+        $this->validates_presence_of('name');
+        $this->validates_numericality_of('previewpic');
+        return $this->object->is_valid();
+    }
+
+    /**
+     * Gets all galleries associated with the album
+     */
+    function get_galleries($models=FALSE)
+    {
+        $retval = array();
+        $mapper = $this->object->get_registry()->get_utility('I_Gallery_Mapper');
+        $gallery_key = $mapper->get_primary_key_column();
+        $retval = $mapper->find_all(array("{$gallery_key} IN %s", $this->object->sortorder), $models);
+        return $retval;
+    }
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.album_mapper.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.album_mapper.php
new file mode 100644
index 0000000000000000000000000000000000000000..e0e49c267f22aa00b4b9ac7080d5e59785fdc0c7
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.album_mapper.php
@@ -0,0 +1,123 @@
+<?php
+
+class C_Album_Mapper extends C_CustomTable_DataMapper_Driver
+{
+    static $_instances = array();
+
+	function define($context=FALSE)
+	{
+		if (!is_array($context)) $context = array($context);
+		array_push($context, 'album');
+
+		$this->_primary_key_column = 'id';
+
+		parent::define('ngg_album', $context);
+		$this->add_mixin('Mixin_Album_Mapper');
+		$this->implement('I_Album_Mapper');
+		$this->set_model_factory_method('album');
+        $this->add_post_hook(
+            '_convert_to_entity',
+            'Unserialize Galleries',
+            'Hook_Unserialize_Album_Galleries',
+            'unserialize_galleries'
+        );
+	}
+
+	function initialize()
+	{
+		parent::initialize('ngg_album');
+	}
+
+
+    /**
+     * Returns an instance of the album datamapper
+     * @param bool|mixed $context
+     * @return C_Album_Mapper
+     */
+    static function get_instance($context=FALSE)
+    {
+        if (!isset(self::$_instances[$context])) {
+            $klass = get_class();
+            self::$_instances[$context] = new $klass($context);
+        }
+        return self::$_instances[$context];
+    }
+}
+
+/**
+ * NextGEN stores all gallery ids for the album in a property called sortorder
+ */
+class Hook_Unserialize_Album_Galleries extends Hook
+{
+    function unserialize_galleries($entity)
+    {
+        if (isset($entity->sortorder) && is_string($entity->sortorder)) {
+            $entity->sortorder = $this->object->unserialize($entity->sortorder);
+        }
+    }
+}
+
+
+/**
+ * Provides album-specific methods for the datamapper
+ */
+class Mixin_Album_Mapper extends Mixin
+{
+    /**
+     * Gets the post title when the Custom Post driver is used
+     * @param C_DataMapper_Model|C_Album|stdClass $entity
+     * @return string
+     */
+    function get_post_title($entity)
+	{
+		return $entity->name;
+	}
+
+	/**
+	 * Override the save method to avoid trying to save the 'exclude' property
+	 * to the database, which will fail since the column doesn't exist in the
+	 * database.
+	 * TODO: This is just a workaround and should be removed when we implement
+	 * https://www.wrike.com/open.htm?id=8250095
+	 * @param stdClass|C_DataMapper_Model $entity
+	 * @return boolean
+	 */
+	function _convert_to_table_data($entity)
+	{
+		$exclude 		= $entity->exclude;
+		$new_sortorder 	= property_exists($entity, 'new_sortorder') ? $entity->new_sortorder : NULL;
+		unset($entity->exclude);
+		unset($entity->new_sortorder);
+		$retval = $this->call_parent('_convert_to_table_data', $entity);
+		$entity->exclude = $exclude;
+		if ($new_sortorder) $entity->new_sortorder = $new_sortorder;
+		return $retval;
+	}
+
+	function _save_entity($entity)
+	{
+		$retval = $this->call_parent('_save_entity', $entity);
+		if ($retval) {
+			C_Photocrati_Cache::flush();
+		}
+		return $retval;
+	}
+
+    /**
+     * Sets the defaults for an album
+     * @param C_DataMapper_Model|C_Album|stdClass $entity
+     */
+    function set_defaults($entity)
+    {
+        $this->object->_set_default_value($entity, 'name', '');
+        $this->object->_set_default_value($entity, 'albumdesc', '');
+        $this->object->_set_default_value($entity, 'sortorder', array());
+        $this->object->_set_default_value($entity, 'previewpic', 0);
+		$this->object->_set_default_value($entity, 'exclude', 0);
+        $this->object->_set_default_value(
+            $entity,
+            'slug',
+            nggdb::get_unique_slug( sanitize_title( $entity->name ), 'album' )
+        );
+    }
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.gallery.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.gallery.php
new file mode 100644
index 0000000000000000000000000000000000000000..b82910bc77e2b295111e7136d3e0c17125b5575b
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.gallery.php
@@ -0,0 +1,81 @@
+<?php
+
+class Mixin_NextGen_Gallery_Validation
+{
+    /**
+     * Validates whether the gallery can be saved
+     */
+    function validation()
+    {
+        // If a title is present, we can auto-populate some other properties
+        if (isset($this->object->title)) {
+
+            // If no name is present, use the title to generate one
+            if (!isset($this->object->name)) {
+                $this->object->name = sanitize_file_name( sanitize_title($this->object->title));
+                $this->object->name = apply_filters('ngg_gallery_name', $this->object->name);
+            }
+
+            // If no slug is set, use the title to generate one
+            if (!isset($this->object->slug)) {
+                $this->object->slug = nggdb::get_unique_slug( sanitize_title($this->object->title), 'gallery' );
+            }
+        }
+
+        // Set what will be the path to the gallery
+        if (empty($this->object->path))
+        {
+            $storage = $this->object->get_registry()->get_utility('I_Gallery_Storage');
+            $this->object->path = $storage->get_upload_relpath($this->object);
+            unset($storage);
+        }
+
+        $this->object->validates_presence_of('title');
+		$this->object->validates_presence_of('name');
+        $this->object->validates_uniqueness_of('slug');
+        $this->object->validates_numericality_of('author');
+
+		return $this->object->is_valid();
+    }
+}
+
+/**
+ * Creates a model representing a NextGEN Gallery object
+ */
+class C_Gallery extends C_DataMapper_Model
+{
+	var $_mapper_interface = 'I_Gallery_Mapper';
+
+    /**
+     * Defines the interfaces and methods (through extensions and hooks)
+     * that this class provides
+     */
+    function define($properties, $mapper, $context=FALSE)
+    {
+        parent::define($mapper, $properties, $context);
+		$this->add_mixin('Mixin_NextGen_Gallery_Validation');
+        $this->implement('I_Gallery');
+    }
+
+	/**
+	 * Instantiates a new model
+	 * @param array|stdClass $properties
+	 * @param C_DataMapper $mapper
+	 * @param string $context
+	 */
+	function initialize($properties = FALSE, $mapper=FALSE)
+	{
+
+		// Get the mapper is not specified
+		if (!$mapper) {
+			$mapper = $this->get_registry()->get_utility($this->_mapper_interface);
+		}
+		parent::initialize($mapper, $properties);
+	}
+
+	function get_images()
+	{
+		$mapper = C_Image_Mapper::get_instance();
+		return $mapper->find_all(array('galleryid = %d', $this->gid));
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.gallery_mapper.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.gallery_mapper.php
new file mode 100644
index 0000000000000000000000000000000000000000..8fcea65762ed273ccfe920b83ce3694a797d1f79
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.gallery_mapper.php
@@ -0,0 +1,136 @@
+<?php
+
+/**
+ * Provides a datamapper for galleries
+ */
+class C_Gallery_Mapper extends C_CustomTable_DataMapper_Driver
+{
+    public static $_instances = array();
+
+	/**
+	 * Define the object
+	 * @param string $context
+	 */
+	function define($context=FALSE)
+	{
+		// Add 'gallery' context
+		if (!is_array($context)) $context = array($context);
+		array_push($context, 'gallery');
+
+		$this->_primary_key_column = 'gid';
+
+		// Continue defining the object
+		parent::define('ngg_gallery', $context);
+		$this->set_model_factory_method('gallery');
+		$this->add_mixin('Mixin_Gallery_Mapper');
+		$this->implement('I_Gallery_Mapper');
+	}
+
+	function initialize()
+	{
+		parent::initialize('ngg_gallery');
+	}
+
+	/**
+	 * Returns a singleton of the gallery mapper
+	 * @param string $context
+	 * @return C_Gallery_Mapper
+	 */
+    public static function get_instance($context = False)
+    {
+        if (!isset(self::$_instances[$context]))
+        {
+            self::$_instances[$context] = new C_Gallery_Mapper($context);
+        }
+        return self::$_instances[$context];
+    }
+}
+
+class Mixin_Gallery_Mapper extends Mixin
+{
+	/**
+	 * Uses the title property as the post title when the Custom Post driver
+	 * is used
+	 */
+	function get_post_title($entity)
+	{
+		return $entity->title;
+	}
+
+	/**
+	 * Override the save method to avoid trying to save the 'new_sortorder' property
+	 * to the database, which will fail since the column doesn't exist in the
+	 * database.
+	 * TODO: This is just a workaround and should be removed when we implement
+	 * https://www.wrike.com/open.htm?id=8250095
+	 * @param stdClass|C_DataMapper_Model $entity
+	 * @return boolean
+	 */
+	function _convert_to_table_data($entity)
+	{
+		$new_sortorder 	= property_exists($entity, 'new_sortorder') ? $entity->new_sortorder : NULL;
+		unset($entity->new_sortorder);
+		$retval = $this->call_parent('_convert_to_table_data', $entity);
+		if ($new_sortorder) $entity->new_sortorder = $new_sortorder;
+		return $retval;
+	}
+
+
+    function _save_entity($entity)
+    {
+        $retval = $this->call_parent('_save_entity', $entity);
+
+        if ($retval) {
+            do_action('ngg_created_new_gallery', $entity->{$entity->id_field});
+			C_Photocrati_Cache::flush();
+        }
+
+        return $retval;
+    }
+
+	function destroy($image)
+	{
+		$retval = $this->call_parent('destroy',$image);
+		C_Photocrati_Cache::flush();
+		return $retval;
+	}
+
+    function set_preview_image($gallery, $image, $only_if_empty=FALSE)
+    {
+        $retval = FALSE;
+
+        // We need the gallery object
+        if (is_numeric($gallery)) {
+            $gallery = $this->object->find($gallery);
+        }
+
+        // We need the image id
+        if (!is_numeric($image)) {
+            if (method_exists($image, 'id')) {
+                $image = $image->id();
+            }
+            else {
+                $image = $image->{$image->id_field};
+            }
+        }
+
+        if ($gallery && $image) {
+            if (($only_if_empty && !$gallery->previewpic) OR !$only_if_empty) {
+                $gallery->previewpic = $image;
+                $retval = $this->object->save($gallery);
+            }
+        }
+
+        return $retval;
+    }
+
+	/**
+	 * Sets default values for the gallery
+	 */
+	function set_defaults($entity)
+	{
+		// If author is missing, then set to the current user id
+        // TODO: Using wordpress function. Should use abstraction
+		$this->object->_set_default_value($entity, 'author', get_current_user_id());
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.gallery_storage.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.gallery_storage.php
new file mode 100644
index 0000000000000000000000000000000000000000..6a26609e6e796313ba40f7a433d65a5c5900e7c3
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.gallery_storage.php
@@ -0,0 +1,76 @@
+<?php
+
+class GalleryStorageDriverNotSelectedException extends RuntimeException
+{
+	function __construct($message='', $code=NULL, $previous=NULL)
+	{
+		if (!$message) $message = "No gallery storage driver selected.";
+		parent::__construct($message, $code, $previous);
+	}
+}
+
+class Mixin_GalleryStorage extends Mixin
+{
+	/**
+	 * Returns the name of the class which provides the gallerystorage
+	 * implementation
+	 * @return string
+	 */
+	function _get_driver_factory_method($context=FALSE)
+	{
+		$factory_method = '';
+
+		// No constant has been defined to establish a global gallerystorage driver
+		if (!defined('GALLERYSTORAGE_DRIVER')) {
+
+			// Get the datamapper configured in the database
+			$factory_method = C_NextGen_Settings::get_instance()->gallerystorage_driver;
+
+			// Define a constant and use this as the global gallerystorage driver,
+			// unless running in a SimpleTest Environment
+			if (!isset($GLOBALS['SIMPLE_TEST_RUNNING']))
+				define('GALLERYSTORAGE_DRIVER', $factory_method);
+		}
+
+		// Use the globally defined gallerystorage driver in the constant
+		else $factory_method = GALLERYSTORAGE_DRIVER;
+
+		return $factory_method;
+	}
+}
+
+class C_Gallery_Storage extends C_GalleryStorage_Base
+{
+    public static $_instances = array();
+
+	function define($object_name, $context=FALSE)
+	{
+		parent::define($context);
+		$this->add_mixin('Mixin_GalleryStorage');
+		$this->wrap('I_GalleryStorage_Driver', array(&$this, '_get_driver'), array($object_name, $context));
+		$this->implement('I_Gallery_Storage');
+	}
+
+    static function get_instance($context = False)
+    {
+        if (!isset(self::$_instances[$context]))
+        {
+            self::$_instances[$context] = new C_Gallery_Storage($context);
+        }
+        return self::$_instances[$context];
+    }
+
+	/**
+	 * Returns the implementation for the gallerystorage
+	 * @param array $args
+	 * @return mixed
+	 */
+	function _get_driver($args)
+	{
+		$object_name = $args[0];
+		$context = $args[1];
+		$factory_method = $this->_get_driver_factory_method($context);
+		$factory = $this->get_registry()->get_utility('I_Component_Factory');
+		return $factory->create($factory_method, $object_name, $context);
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.gallerystorage_base.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.gallerystorage_base.php
new file mode 100644
index 0000000000000000000000000000000000000000..a7e3c9b90fce8e79b15b7eb8856273c896c16092
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.gallerystorage_base.php
@@ -0,0 +1,21 @@
+<?php
+
+class C_GalleryStorage_Base extends C_Component
+{
+	/**
+	 * Gets the url or path of an image of a particular size
+	 * @param string $method
+	 * @param array $args
+	 */
+	function __call($method, $args)
+	{
+		if (preg_match("/^get_(\w+)_(abspath|url|dimensions|html|size_params)$/", $method, $match)) {
+			if (isset($match[1]) && isset($match[2]) && !$this->has_method($method)) {
+				$method = 'get_image_'.$match[2];
+				$args[] = $match[1]; // array($image, $size)
+				return parent::__call($method, $args);
+			}
+		}
+		return parent::__call($method, $args);
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.gallerystorage_driver_base.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.gallerystorage_driver_base.php
new file mode 100644
index 0000000000000000000000000000000000000000..79b554e8f65627abc490f8ac023fef24f70fa30d
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.gallerystorage_driver_base.php
@@ -0,0 +1,1362 @@
+<?php
+
+class E_UploadException extends RuntimeException
+{
+	function __construct($message='', $code=NULL, $previous=NULL)
+	{
+		if (!$message) $message = "There was a problem uploading the file.";
+		parent::__construct($message, $code, $previous);
+	}
+}
+
+class E_InsufficientWriteAccessException extends RuntimeException
+{
+	function __construct($message=FALSE, $filename=NULL, $code=NULL, $previous=NULL)
+	{
+		if (!$message) $message = "Could not write to file. Please check filesystem permissions.";
+		if ($filename) $message .= " Filename: {$filename}";
+		parent::__construct($message, $code, $previous);
+	}
+}
+
+class E_NoSpaceAvailableException extends RuntimeException
+{
+	function __construct($message='', $code=NULL, $previous=NULL)
+	{
+		if (!$message) $message = "You have exceeded your storage capacity. Please remove some files and try again.";
+		parent::__construct($message, $code, $previous);
+	}
+}
+
+class Mixin_GalleryStorage_Driver_Base extends Mixin
+{
+	/**
+	 * Set correct file permissions (taken from wp core). Should be called
+	 * after writing any file
+	 *
+	 * @class nggAdmin
+	 * @param string $filename
+	 * @return bool $result
+	 */
+	function _chmod($filename = '')
+	{
+		$stat = @ stat( dirname($filename) );
+		$perms = $stat['mode'] & 0000666; // Remove execute bits for files
+		if ( @chmod($filename, $perms) )
+			return TRUE;
+
+		return FALSE;
+	}
+
+    /**
+     * Gets the id of a gallery, regardless of whether an integer
+     * or object was passed as an argument
+     * @param mixed $gallery_obj_or_id
+     */
+    function _get_gallery_id($gallery_obj_or_id)
+    {
+        $retval = NULL;
+        $gallery_key = $this->object->_gallery_mapper->get_primary_key_column();
+        if (is_object($gallery_obj_or_id)) {
+            if (isset($gallery_obj_or_id->$gallery_key)) {
+                $retval = $gallery_obj_or_id->$gallery_key;
+            }
+        }
+        elseif(is_numeric($gallery_obj_or_id)) {
+            $retval = $gallery_obj_or_id;
+        }
+
+        return $retval;
+    }
+
+    /**
+     * Gets the id of an image, regardless of whether an integer
+     * or object was passed as an argument
+     * @param type $image_obj_or_id
+     */
+    function _get_image_id($image_obj_or_id)
+    {
+        $retval = NULL;
+
+        $image_key = $this->object->_image_mapper->get_primary_key_column();
+        if (is_object($image_obj_or_id)) {
+            if (isset($image_obj_or_id->$image_key)) {
+                $retval = $image_obj_or_id->$image_key;
+            }
+        }
+        elseif (is_numeric($image_obj_or_id)) {
+            $retval = $image_obj_or_id;
+        }
+
+        return $retval;
+    }
+
+
+    function delete_directory($abspath)
+    {
+        $retval = FALSE;
+
+        if (@file_exists($abspath)) {
+            $files = scandir($abspath);
+            array_shift($files);
+            array_shift($files);
+            foreach ($files as $file) {
+                $file_abspath = path_join($abspath, $file);
+                if (is_dir($file_abspath)) $this->object->delete_directory($file_abspath);
+                else unlink($file_abspath);
+            }
+            rmdir($abspath);
+            $retval = @file_exists($abspath);
+        }
+
+        return $retval;
+    }
+
+    /**
+     * Backs up an image file
+     * @param int|object $image
+     */
+    function backup_image($image)
+    {
+        $retval = FALSE;
+
+        if (($image_path = $this->object->get_image_abspath($image))) {
+            $retval = copy($image_path, $this->object->get_backup_abspath($image));
+        }
+
+        return $retval;
+    }
+
+    /**
+     * Copies images into another gallery
+     * @param array $images
+     * @param int|object $gallery
+     * @param boolean $db optionally only copy the image files
+     * @param boolean $move move the image instead of copying
+     */
+    function copy_images($images, $gallery, $db=TRUE, $move=FALSE)
+    {
+        $retval = FALSE;
+
+        // Ensure we have a valid gallery
+        if (($gallery = $this->object->_get_gallery_id($gallery))) {
+            $gallery_path = $this->object->get_gallery_abspath($gallery);
+            $image_key = $this->object->_image_mapper->get_primary_key_column();
+            $retval = TRUE;
+
+            // Iterate through each image to copy...
+            foreach ($images as $image) {
+
+                // Copy each image size
+                foreach ($this->object->get_image_sizes() as $size) {
+                    $image_path = $this->object->get_image_abspath($image, $size);
+                    $dst = path_join($gallery_path, basename($image_path));
+                    $success = $move ? move($image_path, $dst) : copy($image_path, $dst);
+                    if (!$success) $retval = FALSE;
+                }
+
+                // Copy the db entry
+                if ($db) {
+                    if (is_numeric($image)) $this->object->_image_mapper($image);
+                    unset($image->$image_key);
+                    $image->galleryid = $gallery;
+                }
+            }
+        }
+
+        return $retval;
+    }
+
+    /**
+     * Empties the gallery cache directory of content
+     */
+    function flush_cache($gallery)
+    {
+        $cache = $this->object->get_registry()->get_utility('I_Cache');
+        $cache->flush_directory($this->object->get_cache_abspath($gallery));
+    }
+
+    /**
+     * Gets the absolute path of the backup of an original image
+     * @param string $image
+     */
+    function get_backup_abspath($image)
+    {
+        $retval = NULL;
+
+        if (($image_path = $this->object->get_image_abspath($image))) {
+            $retval = $image_path.'_backup';
+        }
+
+        return $retval;
+    }
+
+    /**
+     * Returns the absolute path to the cache directory of a gallery.
+     *
+     * Without the gallery parameter the legacy (pre 2.0) shared directory is returned.
+     *
+     * @param int|stdClass|C_Gallery $gallery (optional)
+     * @return string Absolute path to cache directory
+     */
+    function get_cache_abspath($gallery = FALSE)
+    {
+        $retval = NULL;
+
+        if (FALSE == $gallery)
+        {
+            $gallerypath = C_NextGen_Settings::get_instance()->gallerypath;
+            $retval = path_join(WINABSPATH, $gallerypath);
+            $retval = path_join($retval, 'cache');
+        }
+        else {
+            if (is_numeric($gallery))
+            {
+                $gallery = $this->object->_gallery_mapper->find($gallery);
+            }
+            $retval = path_join($this->object->get_gallery_abspath($gallery), 'dynamic');
+        }
+
+        return $retval;
+    }
+
+    /**
+	 * Gets the absolute path where the full-sized image is stored
+	 * @param int|object $image
+	 */
+	function get_full_abspath($image)
+	{
+		return $this->object->get_image_abspath($image, 'full');
+	}
+
+    /**
+     * Alias to get_image_dimensions()
+     * @param int|object $image
+     * @return array
+     */
+    function get_full_dimensions($image)
+    {
+        return $this->object->get_image_dimensions($image, 'full');
+    }
+
+    /**
+     * Alias to get_image_html()
+     * @param int|object $image
+     * @return string
+     */
+    function get_full_html($image)
+    {
+        return $this->object->get_image_html($image, 'full');
+    }
+
+    /**
+     * Alias for get_original_url()
+     *
+     * @param int|stdClass|C_Image $image
+     * @return string
+     */
+    function get_full_url($image)
+    {
+        return $this->object->get_image_url($image, 'full');
+    }
+
+    /**
+     * Gets the dimensions for a particular-sized image
+     *
+     * @param int|object $image
+     * @param string $size
+     * @return array
+     */
+    function get_image_dimensions($image, $size='full')
+    {
+			$retval = NULL;
+
+        // If an image id was provided, get the entity
+        if (is_numeric($image)) $image = $this->object->_image_mapper->find($image);
+
+        // Ensure we have a valid image
+        if ($image) {
+
+            // Adjust size parameter
+            switch ($size) {
+                case 'original':
+                    $size = 'full';
+                    break;
+                case 'thumbnails':
+                case 'thumbnail':
+                case 'thumb':
+                case 'thumbs':
+                    $size = 'thumbnail';
+                    break;
+            }
+
+            // Image dimensions are stored in the $image->meta_data
+            // property for all implementations
+            if (isset($image->meta_data) && isset($image->meta_data[$size])) {
+                $retval = $image->meta_data[$size];
+            }
+
+				// Didn't exist for meta data. We'll have to compute
+				// dimensions in the meta_data after computing? This is most likely
+				// due to a dynamic image size being calculated for the first time
+				else {
+				
+					$abspath = $this->object->get_image_abspath($image, $size);
+				
+					if (@file_exists($abspath))
+					{
+						$dims = getimagesize($abspath);
+						
+						if ($dims) {
+							$retval['width']	= $dims[0];
+							$retval['height']	= $dims[1];
+						}
+					}
+				}
+      }
+
+    	return $retval;
+    }
+
+    /**
+     * Gets the HTML for an image
+     * @param int|object $image
+     * @param string $size
+     * @return string
+     */
+    function get_image_html($image, $size='full', $attributes=array())
+    {
+        $retval = "";
+
+        if (is_numeric($image)) $image = $this->object->_image_mapper->find($image);
+
+        if ($image) {
+
+			// Set alt text if not already specified
+			if (!isset($attributes['alttext'])) {
+				$attributes['alt'] = esc_attr($image->alttext);
+			}
+
+			// Set the title if not already set
+			if (!isset($attributes['title'])) {
+				$attributes['title'] = esc_attr($image->alttext);
+			}
+
+			// Set the dimensions if not set already
+			if (!isset($attributes['width']) OR !isset($attributes['height'])) {
+				$dimensions = $this->object->get_image_dimensions($image, $size);
+				if (!isset($attributes['width'])) {
+					$attributes['width'] = $dimensions['width'];
+				}
+				if (!isset($attributes['height'])) {
+					$attributes['height'] = $dimensions['height'];
+				}
+			}
+
+			// Set the url if not already specified
+			if (!isset($attributes['src'])) {
+				$attributes['src'] = $this->object->get_image_url($image, $size);
+			}
+
+			// Format attributes
+			$attribs = array();
+			foreach ($attributes as $attrib => $value) $attribs[] = "{$attrib}=\"{$value}\"";
+			$attribs = implode(" ", $attribs);
+
+			// Return HTML string
+			$retval = "<img {$attribs} />";
+        }
+
+        return $retval;
+    }
+
+    /**
+     * An alias for get_full_abspath()
+     * @param int|object $image
+     */
+    function get_original_abspath($image)
+    {
+        return $this->object->get_image_abspath($image, 'full');
+    }
+
+    /**
+     * Alias to get_image_dimensions()
+     * @param int|object $image
+     * @return array
+     */
+    function get_original_dimensions($image)
+    {
+        return $this->object->get_image_dimensions($image, 'full');
+    }
+
+    /**
+     * Alias to get_image_html()
+     * @param int|object $image
+     * @return string
+     */
+    function get_original_html($image)
+    {
+        return $this->object->get_image_html($image, 'full');
+    }
+
+    /**
+     * Gets the url to the original-sized image
+     * @param int|stdClass|C_Image $image
+     * @return string
+     */
+    function get_original_url($image)
+    {
+        return $this->object->get_image_url($image, 'full');
+    }
+
+	/**
+	 * Gets the upload path, optionally for a particular gallery
+	 * @param int|C_Gallery|stdClass $gallery
+	 */
+	function get_upload_relpath($gallery=FALSE)
+	{
+		return str_replace(ABSPATH, '', $this->object->get_upload_abspath($gallery));
+	}
+
+	/**
+	 * Moves images from to another gallery
+	 * @param array $images
+	 * @param int|object $gallery
+	 * @param boolean $db optionally only move the image files, not the db entries
+	 * @return boolean
+	 */
+	function move_images($images, $gallery, $db=TRUE)
+	{
+		return $this->object->copy_images($images, $gallery, $db, TRUE);
+	}
+
+
+    function is_zip()
+    {
+        $retval = FALSE;
+        
+        if ((isset($_FILES['file']) && $_FILES['file']['error'] == 0)) {
+            $file_info = $_FILES['file'];
+            
+            if (isset($file_info['type'])) {
+            	$type = $file_info['type'];
+            	$type_parts = explode('/', $type);
+            	
+            	if (strtolower($type_parts[0]) == 'application') {
+            		$spec = $type_parts[1];
+            		$spec_parts = explode('-', $spec);
+            		$spec_parts = array_map('strtolower', $spec_parts);
+            		
+            		if (in_array($spec, array('zip', 'octet-stream')) || in_array('zip', $spec_parts)) {
+            			$retval = true;
+            		}
+            	}
+            }
+        }
+
+        return $retval;
+    }
+
+    function upload_zip($gallery_id)
+    {
+        $memory_limit = intval(ini_get('memory_limit'));
+        if ($memory_limit < 256) @ini_set('memory_limit', '256M');
+
+        $retval = FALSE;
+
+        if ($this->object->is_zip()) {
+            $zipfile    = $_FILES['file']['tmp_name'];
+            $dest_path  = path_join(get_temp_dir(), 'unpacked-'.basename($zipfile));
+            $fs         = $this->get_registry()->get_utility('I_Fs');
+
+            // Ensure that we truly have the gallery id
+            $gallery_id = $this->_get_gallery_id($gallery_id);
+
+            // Uses the WordPress ZIP abstraction API
+            wp_mkdir_p($dest_path);
+            include_once($fs->join_paths(ABSPATH, 'wp-admin', 'includes', 'file.php'));
+            WP_Filesystem();
+            if ((unzip_file($zipfile, $dest_path) === TRUE)) {
+                $retval = $this->object->import_gallery_from_fs($dest_path, $gallery_id);
+            }
+            $this->object->delete_directory($dest_path);
+        }
+
+        @ini_set('memory_limit', $memory_limit.'M');
+
+        return $retval;
+    }
+
+
+	/**
+	 * Uploads base64 file to a gallery
+	 * @param int|stdClass|C_Gallery $gallery
+	 * @param $data base64-encoded string of data representing the image
+	 * @param type $filename specifies the name of the file
+	 * @return C_Image
+	 */
+	function upload_base64_image($gallery, $data, $filename=FALSE, $image_id=FALSE)
+	{
+        $settings = C_NextGen_Settings::get_instance();
+        $memory_limit = intval(ini_get('memory_limit'));
+        if ($memory_limit < 256) @ini_set('memory_limit', '256M');
+
+		$retval		= NULL;
+		if (($gallery_id = $this->object->_get_gallery_id($gallery))) {
+
+			// Ensure that there is capacity available
+            require_once(ABSPATH . 'wp-admin/includes/ms.php');
+			if ( (is_multisite()) && nggWPMU::wpmu_enable_function('wpmuQuotaCheck')) {
+				if (upload_is_user_over_quota(FALSE)) {
+					throw new E_NoSpaceAvailableException();
+				}
+			}
+
+			// Get path information. The use of get_upload_abspath() might
+			// not be the best for some drivers. For example, if using the
+			// WordPress Media Library for uploading, then the wp_upload_bits()
+			// function should perhaps be used
+			$upload_dir = $this->object->get_upload_abspath($gallery);
+
+			// Perhaps a filename was given instead of base64 data?
+			if ($data[0] == '/' && @file_exists($data)) {
+				if (!$filename) $filename = basename($data);
+				$data = file_get_contents($data);
+			}
+
+			// Determine filenames
+			$filename = $filename ? sanitize_title_with_dashes($filename) : uniqid('nextgen-gallery');
+			if (preg_match("/\-(png|jpg|gif|jpeg)$/i", $filename, $match)) {
+				$filename = str_replace($match[0], '.'.$match[1], $filename);
+			}
+			$abs_filename = path_join($upload_dir, $filename);
+
+			// Create or retrieve the image object
+			$image	= NULL;
+			if ($image_id) {
+				$image	= $this->object->_image_mapper->find($image_id, TRUE);
+				unset($image->meta_data['saved']);
+			}
+			if (!$image) $image = $this->object->_image_mapper->create();
+			$retval	= $image;
+			
+			// Create or update the database record
+			$image->alttext		= sanitize_title_with_dashes(basename($filename, '.' . pathinfo($filename, PATHINFO_EXTENSION)));
+			$image->galleryid	= $this->object->_get_gallery_id($gallery);
+			$image->filename	= $filename;
+			$image->image_slug = nggdb::get_unique_slug( sanitize_title_with_dashes( $image->alttext ), 'image' );
+			$image_key			= $this->object->_image_mapper->get_primary_key_column();
+
+            // If we can't write to the directory, then there's no point in continuing
+            if (!@file_exists($upload_dir)) @wp_mkdir_p($upload_dir);
+            if (!is_writable($upload_dir)) {
+                throw new E_InsufficientWriteAccessException(
+                    FALSE, $upload_dir, FALSE
+                );
+            }
+
+			// Save the image
+			if (($image_id = $this->object->_image_mapper->save($image))) {
+				try {
+					// Try writing the image
+					if (!@file_exists($upload_dir)) wp_mkdir_p($upload_dir);
+					$fp = fopen($abs_filename, 'w');
+					fwrite($fp, $data);
+					fclose($fp);
+
+                    if ($settings->imgBackup)
+                        $this->object->backup_image($image);
+
+                    if ($settings->imgAutoResize)
+                        $this->object->generate_image_clone(
+                            $abs_filename,
+                            $abs_filename,
+                            $this->object->get_image_size_params($image_id, 'full')
+                        );
+
+                    // Ensure that fullsize dimensions are added to metadata array
+                    $dimensions = getimagesize($abs_filename);
+                    $full_meta = array(
+                        'width'		=>	$dimensions[0],
+                        'height'	=>	$dimensions[1]
+                    );
+                    if (!isset($image->meta_data) OR (is_string($image->meta_data) && strlen($image->meta_data) == 0)) {
+                        $image->meta_data = array();
+                    }
+                    $image->meta_data = array_merge($image->meta_data, $full_meta);
+                    $image->meta_data['full'] = $full_meta;
+
+					// Generate a thumbnail for the image
+					$this->object->generate_thumbnail($image);
+
+                    // Set gallery preview image if missing
+                    $this->object->get_registry()->get_utility('I_Gallery_Mapper')->set_preview_image($gallery, $image_id, TRUE);
+
+					// Notify other plugins that an image has been added
+					do_action('ngg_added_new_image', $image);
+
+					// delete dirsize after adding new images
+					delete_transient( 'dirsize_cache' );
+
+					// Seems redundant to above hook. Maintaining for legacy purposes
+					do_action(
+						'ngg_after_new_images_added',
+						$gallery_id,
+						array($image->$image_key)
+					);
+				}
+				catch(Exception $ex) {
+					throw new E_InsufficientWriteAccessException(
+						FALSE, $abs_filename, FALSE, $ex
+					);
+				}
+			}
+            else throw new E_InvalidEntityException();
+		}
+		else throw new E_EntityNotFoundException();
+
+        @ini_set('memory_limit', $memory_limit.'M');
+
+		return $retval;
+	}
+
+    function import_gallery_from_fs($abspath, $gallery_id=FALSE, $move_files=TRUE)
+    {
+        $retval = FALSE;
+        if (@file_exists($abspath)) {
+
+            // Ensure that this folder has images
+            $files_all = scandir($abspath);
+            $files = array();
+            
+            // first perform some filtering on file list
+            foreach ($files_all as $file)
+            {
+            	if ($file == '.' || $file == '..')
+            		continue;
+            		
+            	$files[] = $file;
+            }
+            
+            if (!empty($files)) {
+
+                // Get needed utilities
+                $fs = $this->get_registry()->get_utility('I_Fs');
+                $gallery_mapper = $this->get_registry()->get_utility('I_Gallery_Mapper');
+
+                // Sometimes users try importing a directory, which actually has all images under another directory
+                $first_file_abspath = $fs->join_paths($abspath, $files[0]);
+                if (is_dir($first_file_abspath) && count($files) == 1) return $this->import_gallery_from_fs($first_file_abspath, $gallery_id, $move_files);
+
+                // If no gallery has been specified, then use the directory name as the gallery name
+                if (!$gallery_id) {
+                    // Create the gallery
+                    $gallery = $gallery_mapper->create(array(
+                        'title'         =>  basename($abspath),
+                    ));
+                    
+                    if (!$move_files) {
+                    	$gallery->path = str_ireplace(ABSPATH, '', $abspath);
+                    }
+
+                    // Save the gallery
+                    if ($gallery->save()) $gallery_id = $gallery->id();
+                }
+
+                // Ensure that we have a gallery id
+                if ($gallery_id) {
+                    $retval = array('gallery_id' => $gallery_id, 'image_ids' => array());
+                    foreach ($files as $file) {
+                        if (!preg_match("/\.(jpg|jpeg|gif|png)/i", $file)) continue;
+                        $file_abspath = $fs->join_paths($abspath, $file);
+                        $image = null;
+                        
+                        if ($move_files) {
+		                      $image = $this->object->upload_base64_image(
+		                          $gallery_id,
+		                          file_get_contents($file_abspath),
+		                          str_replace(' ', '_', $file)
+		                      );
+                        }
+                        else {
+													// Create the database record ... TODO cleanup, some duplication here from upload_base64_image
+													$factory = $this->object->get_registry()->get_utility('I_Component_Factory');
+													$image = $factory->create('image');
+													$image->alttext		= sanitize_title_with_dashes(basename($file_abspath, '.' . pathinfo($file_abspath, PATHINFO_EXTENSION)));
+													$image->galleryid	= $this->object->_get_gallery_id($gallery_id);
+													$image->filename	= basename($file_abspath);
+													$image->image_slug = nggdb::get_unique_slug( sanitize_title_with_dashes( $image->alttext ), 'image' );
+													$image_key			= $this->object->_image_mapper->get_primary_key_column();
+													$abs_filename = $file_abspath;
+
+													if (($image_id = $this->object->_image_mapper->save($image))) {
+														try {
+															// backup and image resizing should have already been performed, better to avoid
+#															if ($settings->imgBackup)
+#															    $this->object->backup_image($image);
+
+#															if ($settings->imgAutoResize)
+#															    $this->object->generate_image_clone(
+#															        $abs_filename,
+#															        $abs_filename,
+#															        $this->object->get_image_size_params($image_id, 'full')
+#															    );
+
+															// Ensure that fullsize dimensions are added to metadata array
+															$dimensions = getimagesize($abs_filename);
+															$full_meta = array(
+															    'width'		=>	$dimensions[0],
+															    'height'	=>	$dimensions[1]
+															);
+															if (!isset($image->meta_data) OR (is_string($image->meta_data) && strlen($image->meta_data) == 0)) {
+															    $image->meta_data = array();
+															}
+															$image->meta_data = array_merge($image->meta_data, $full_meta);
+															$image->meta_data['full'] = $full_meta;
+
+															// Generate a thumbnail for the image
+															$this->object->generate_thumbnail($image);
+
+															// Set gallery preview image if missing
+															$this->object->get_registry()->get_utility('I_Gallery_Mapper')->set_preview_image($gallery, $image_id, TRUE);
+
+															// Notify other plugins that an image has been added
+															do_action('ngg_added_new_image', $image);
+
+															// delete dirsize after adding new images
+															delete_transient( 'dirsize_cache' );
+
+															// Seems redundant to above hook. Maintaining for legacy purposes
+															do_action(
+																'ngg_after_new_images_added',
+																$gallery_id,
+																array($image->$image_key)
+															);
+														}
+														catch(Exception $ex) {
+															throw new E_InsufficientWriteAccessException(
+																FALSE, $abs_filename, FALSE, $ex
+															);
+														}
+													}
+													else throw new E_InvalidEntityException();
+                    	}
+				                    	
+                      $retval['image_ids'][] = $image->{$image->id_field};
+                    }
+
+                    // Add the gallery name to the result
+                    $gallery = $gallery_mapper->find($gallery_id);
+                    $retval['gallery_name'] = $gallery->title;
+                    unset($gallery);
+                }
+            }
+        }
+
+        return $retval;
+    }
+
+	function get_image_format_list()
+	{
+		$format_list = array(IMAGETYPE_GIF => 'gif', IMAGETYPE_JPEG => 'jpg', IMAGETYPE_PNG => 'png');
+
+		return $format_list;
+	}
+
+	/**
+	 * Returns an array of properties of a resulting clone image if and when generated
+	 * @param string $image_path
+	 * @param string $clone_path
+	 * @param array $params
+	 * @return array
+	 */
+	function calculate_image_clone_result($image_path, $clone_path, $params)
+	{
+		$width      = isset($params['width'])      ? $params['width']      : NULL;
+		$height     = isset($params['height'])     ? $params['height']     : NULL;
+		$quality    = isset($params['quality'])    ? $params['quality']    : NULL;
+		$type       = isset($params['type'])       ? $params['type']       : NULL;
+		$crop       = isset($params['crop'])       ? $params['crop']       : NULL;
+		$watermark  = isset($params['watermark'])  ? $params['watermark']  : NULL;
+		$rotation   = isset($params['rotation'])   ? $params['rotation']   : NULL;
+		$reflection = isset($params['reflection']) ? $params['reflection'] : NULL;
+		$crop_frame = isset($params['crop_frame']) ? $params['crop_frame'] : NULL;
+		$result  = NULL;
+
+		// Ensure we have a valid image
+		if ($image_path && @file_exists($image_path))
+		{
+			// Ensure target directory exists, but only create 1 subdirectory
+			$image_dir = dirname($image_path);
+			$clone_dir = dirname($clone_path);
+			$image_extension = pathinfo($image_path, PATHINFO_EXTENSION);
+			$image_extension_str = null;
+			$clone_extension = pathinfo($clone_path, PATHINFO_EXTENSION);
+			$clone_extension_str = null;
+
+			if ($image_extension != null)
+			{
+				$image_extension_str = '.' . $image_extension;
+			}
+
+			if ($clone_extension != null)
+			{
+				$clone_extension_str = '.' . $clone_extension;
+			}
+
+			$image_basename = basename($image_path, $image_extension_str);
+			$clone_basename = basename($clone_path, $clone_extension_str);
+			// We use a default suffix as passing in null as the suffix will make WordPress use a default
+			$clone_suffix = null;
+			$format_list = $this->object->get_image_format_list();
+			$clone_format = null; // format is determined below and based on $type otherwise left to null
+
+			// suffix is only used to reconstruct paths for image_resize function
+			if (strpos($clone_basename, $image_basename) === 0)
+			{
+				$clone_suffix = substr($clone_basename, strlen($image_basename));
+			}
+
+			if ($clone_suffix != null && $clone_suffix[0] == '-')
+			{
+				// WordPress adds '-' on its own
+				$clone_suffix = substr($clone_suffix, 1);
+			}
+
+            // Get original image dimensions
+			$dimensions = getimagesize($image_path);
+
+			if ($width == null && $height == null) {
+				if ($dimensions != null) {
+
+					if ($width == null) {
+						$width = $dimensions[0];
+					}
+
+					if ($height == null) {
+						$height = $dimensions[1];
+					}
+				}
+				else {
+					// XXX Don't think there's any other option here but to fail miserably...use some hard-coded defaults maybe?
+					return null;
+				}
+			}
+
+			if ($dimensions != null) {
+				$dimensions_ratio = $dimensions[0] / $dimensions[1];
+
+				if ($width == null) {
+					$width = (int) round($height * $dimensions_ratio);
+
+					if ($width == ($dimensions[0] - 1))
+					{
+						$width = $dimensions[0];
+					}
+				}
+				else if ($height == null) {
+					$height = (int) round($width / $dimensions_ratio);
+
+					if ($height == ($dimensions[1] - 1))
+					{
+						$height = $dimensions[1];
+					}
+				}
+
+				if ($width > $dimensions[0]) {
+					$width = $dimensions[0];
+				}
+
+				if ($height > $dimensions[1]) {
+					$height = $dimensions[1];
+				}
+
+				$image_format = $dimensions[2];
+
+				if ($type != null)
+				{
+					if (is_string($type))
+					{
+						$type = strtolower($type);
+
+						// Indexes in the $format_list array correspond to IMAGETYPE_XXX values appropriately
+						if (($index = array_search($type, $format_list)) !== false)
+						{
+							$type = $index;
+
+							if ($type != $image_format)
+							{
+								// Note: this only changes the FORMAT of the image but not the extension
+								$clone_format = $type;
+							}
+						}
+					}
+				}
+			}
+
+			if ($width == null || $height == null) {
+				// Something went wrong...
+				return null;
+			}
+
+			$result['clone_path'] = $clone_path;
+			$result['clone_directory'] = $clone_dir;
+			$result['clone_suffix'] = $clone_suffix;
+			$result['clone_format'] = $clone_format;
+			$result['base_width'] = $dimensions[0];
+			$result['base_height'] = $dimensions[1];
+
+			// image_resize() has limitations:
+			// - no easy crop frame support
+			// - fails if the dimensions are unchanged
+			// - doesn't support filename prefix, only suffix so names like thumbs_original_name.jpg for $clone_path are not supported
+			//   also suffix cannot be null as that will make WordPress use a default suffix...we could use an object that returns empty string from __toString() but for now just fallback to ngg generator
+            if (FALSE) { // disabling the WordPress method for Iteration #6
+//			if (($crop_frame == null || !$crop) && ($dimensions[0] != $width && $dimensions[1] != $height) && $clone_suffix != null)
+				$result['method'] = 'wordpress';
+
+				$new_dims = image_resize_dimensions($dimensions[0], $dimensions[1], $width, $height, $crop);
+
+				if ($new_dims) {
+					list($dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h) = $new_dims;
+
+					$width = $dst_w;
+					$height = $dst_h;
+				}
+				else {
+					$result['error'] = new WP_Error( 'error_getting_dimensions', __('Could not calculate resized image dimensions') );
+				}
+			}
+			else
+			{
+				$result['method'] = 'nextgen';
+				$original_width = $dimensions[0];
+				$original_height = $dimensions[1];
+				$original_ratio = $original_width / $original_height;
+
+				$aspect_ratio = $width / $height;
+
+				$orig_ratio_x = $original_width / $width;
+				$orig_ratio_y = $original_height / $height;
+
+				if ($crop)
+				{
+					$algo = 'shrink'; // either 'adapt' or 'shrink'
+
+					if ($crop_frame != null)
+					{
+						$crop_x = (int) round($crop_frame['x']);
+						$crop_y = (int) round($crop_frame['y']);
+						$crop_width = (int) round($crop_frame['width']);
+						$crop_height = (int) round($crop_frame['height']);
+						$crop_final_width = (int) round($crop_frame['final_width']);
+						$crop_final_height = (int) round($crop_frame['final_height']);
+
+						$crop_width_orig = $crop_width;
+						$crop_height_orig = $crop_height;
+
+						$crop_factor_x = $crop_width / $crop_final_width;
+						$crop_factor_y = $crop_height / $crop_final_height;
+
+						$crop_ratio_x = $crop_width / $width;
+						$crop_ratio_y = $crop_height / $height;
+
+						if ($algo == 'adapt')
+						{
+							// XXX not sure about this...don't use for now
+#							$crop_width = (int) round($width * $crop_factor_x);
+#							$crop_height = (int) round($height * $crop_factor_y);
+						}
+						else if ($algo == 'shrink')
+						{
+							if ($crop_ratio_x < $crop_ratio_y)
+							{
+								$crop_width = max($crop_width, $width);
+								$crop_height = (int) round($crop_width / $aspect_ratio);
+							}
+							else
+							{
+								$crop_height = max($crop_height, $height);
+								$crop_width = (int) round($crop_height * $aspect_ratio);
+							}
+
+							if ($crop_width == ($crop_width_orig - 1))
+							{
+								$crop_width = $crop_width_orig;
+							}
+
+							if ($crop_height == ($crop_height_orig - 1))
+							{
+								$crop_height = $crop_height_orig;
+							}
+						}
+
+						$crop_diff_x = (int) round(($crop_width_orig - $crop_width) / 2);
+						$crop_diff_y = (int) round(($crop_height_orig - $crop_height) / 2);
+
+						$crop_x += $crop_diff_x;
+						$crop_y += $crop_diff_y;
+
+						$crop_max_x = ($crop_x + $crop_width);
+						$crop_max_y = ($crop_y + $crop_height);
+
+						// Check if we're overflowing borders
+						//
+						if ($crop_x < 0)
+						{
+							$crop_x = 0;
+						}
+						else if ($crop_max_x > $original_width)
+						{
+							$crop_x -= ($crop_max_x - $original_width);
+						}
+
+						if ($crop_y < 0)
+						{
+							$crop_y = 0;
+						}
+						else if ($crop_max_y > $original_height)
+						{
+							$crop_y -= ($crop_max_y - $original_height);
+						}
+					}
+					else
+					{
+						if ($orig_ratio_x < $orig_ratio_y)
+						{
+							$crop_width = $original_width;
+							$crop_height = (int) round($height * $orig_ratio_x);
+
+						}
+						else
+						{
+							$crop_height = $original_height;
+							$crop_width = (int) round($width * $orig_ratio_y);
+						}
+
+						if ($crop_width == ($width - 1))
+						{
+							$crop_width = $width;
+						}
+
+						if ($crop_height == ($height - 1))
+						{
+							$crop_height = $height;
+						}
+
+						$crop_x = (int) round(($original_width - $crop_width) / 2);
+						$crop_y = (int) round(($original_height - $crop_height) / 2);
+					}
+
+					$result['crop_area'] = array('x' => $crop_x, 'y' => $crop_y, 'width' => $crop_width, 'height' => $crop_height);
+				}
+				else {
+					// Just constraint dimensions to ensure there's no stretching or deformations
+					list($width, $height) = wp_constrain_dimensions($original_width, $original_height, $width, $height);
+				}
+			}
+
+			$result['width'] = $width;
+			$result['height'] = $height;
+			$result['quality'] = $quality;
+
+			$real_width = $width;
+			$real_height = $height;
+
+			if ($rotation && in_array(abs($rotation), array(90, 270)))
+			{
+				$real_width = $height;
+				$real_height = $width;
+			}
+
+			if ($reflection)
+			{
+				// default for nextgen was 40%, this is used in generate_image_clone as well
+				$reflection_amount = 40;
+				// Note, round() would probably be best here but using the same code that C_NggLegacy_Thumbnail uses for compatibility
+        $reflection_height = intval($real_height * ($reflection_amount / 100));
+        $real_height = $real_height + $reflection_height;
+			}
+
+			$result['real_width'] = $real_width;
+			$result['real_height'] = $real_height;
+		}
+
+		return $result;
+	}
+
+	/**
+	 * Returns an array of dimensional properties (width, height, real_width, real_height) of a resulting clone image if and when generated
+	 * @param string $image_path
+	 * @param string $clone_path
+	 * @param array $params
+	 * @return array
+	 */
+	function calculate_image_clone_dimensions($image_path, $clone_path, $params)
+	{
+		$retval = null;
+		$result = $this->object->calculate_image_clone_result($image_path, $clone_path, $params);
+
+		if ($result != null) {
+			$retval = array(
+				'width' => $result['width'],
+				'height' => $result['height'],
+				'real_width' => $result['real_width'],
+				'real_height' => $result['real_height']
+			);
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Generates a "clone" for an existing image, the clone can be altered using the $params array
+	 * @param string $image_path
+	 * @param string $clone_path
+	 * @param array $params
+	 * @return object
+	 */
+	function generate_image_clone($image_path, $clone_path, $params)
+	{
+		$width      = isset($params['width'])      ? $params['width']      : NULL;
+		$height     = isset($params['height'])     ? $params['height']     : NULL;
+		$quality    = isset($params['quality'])    ? $params['quality']    : NULL;
+		$type       = isset($params['type'])       ? $params['type']       : NULL;
+		$crop       = isset($params['crop'])       ? $params['crop']       : NULL;
+		$watermark  = isset($params['watermark'])  ? $params['watermark']  : NULL;
+		$reflection = isset($params['reflection']) ? $params['reflection'] : NULL;
+		$rotation   = isset($params['rotation']) ? $params['rotation'] : NULL;
+		$flip   = isset($params['flip']) ? $params['flip'] : NULL;
+		$crop_frame = isset($params['crop_frame']) ? $params['crop_frame'] : NULL;
+		$destpath   = NULL;
+		$thumbnail  = NULL;
+
+        // Do this before anything else can modify the original -- $detailed_size
+        // may hold IPTC metadata we need to write to our clone
+        $size = getimagesize($image_path, $detailed_size);
+
+		$result = $this->object->calculate_image_clone_result($image_path, $clone_path, $params);
+
+		// XXX this should maybe be removed and extra settings go into $params?
+		$settings = C_NextGen_Settings::get_instance();
+
+		// Ensure we have a valid image
+		if ($image_path && @file_exists($image_path) && $result != null && !isset($result['error']))
+		{
+			$image_dir = dirname($image_path);
+			$clone_path = $result['clone_path'];
+			$clone_dir = $result['clone_directory'];
+			$clone_suffix = $result['clone_suffix'];
+			$clone_format = $result['clone_format'];
+			$format_list = $this->object->get_image_format_list();
+
+			// Ensure target directory exists, but only create 1 subdirectory
+			if (!@file_exists($clone_dir))
+			{
+				if (strtolower(realpath($image_dir)) != strtolower(realpath($clone_dir)))
+				{
+					if (strtolower(realpath($image_dir)) == strtolower(realpath(dirname($clone_dir))))
+					{
+						wp_mkdir_p($clone_dir);
+					}
+				}
+			}
+
+			$method = $result['method'];
+			$width = $result['width'];
+			$height = $result['height'];
+			$quality = $result['quality'];
+			
+			if ($quality == null)
+			{
+				$quality = 100;
+			}
+
+			if ($method == 'wordpress')
+			{
+                $original = wp_get_image_editor($image_path);
+                $destpath = $clone_path;
+                if (!is_wp_error($original))
+                {
+                    $original->resize($width, $height, $crop);
+                    $original->set_quality($quality);
+                    $original->save($clone_path);
+                }
+			}
+			else if ($method == 'nextgen')
+			{
+				$destpath = $clone_path;
+				$thumbnail = new C_NggLegacy_Thumbnail($image_path, true);
+
+				if ($crop) {
+					$crop_area = $result['crop_area'];
+					$crop_x = $crop_area['x'];
+					$crop_y = $crop_area['y'];
+					$crop_width = $crop_area['width'];
+					$crop_height = $crop_area['height'];
+
+					$thumbnail->crop($crop_x, $crop_y, $crop_width, $crop_height);
+				}
+
+				$thumbnail->resize($width, $height);
+			}
+
+			// We successfully generated the thumbnail
+			if (is_string($destpath) && (@file_exists($destpath) || $thumbnail != null))
+			{
+				if ($clone_format != null)
+				{
+					if (isset($format_list[$clone_format]))
+					{
+						$clone_format_extension = $format_list[$clone_format];
+						$clone_format_extension_str = null;
+
+						if ($clone_format_extension != null)
+						{
+							$clone_format_extension_str = '.' . $clone_format_extension;
+						}
+
+						$destpath_info = pathinfo($destpath);
+						$destpath_extension = $destpath_info['extension'];
+						$destpath_extension_str = null;
+
+						if ($destpath_extension != null)
+						{
+							$destpath_extension_str = '.' . $destpath_extension;
+						}
+
+						if (strtolower($destpath_extension) != strtolower($clone_format_extension))
+						{
+							$destpath_dir = $destpath_info['dirname'];
+							$destpath_basename = $destpath_info['filename'];
+							$destpath_new = $destpath_dir . DIRECTORY_SEPARATOR . $destpath_basename . $clone_format_extension_str;
+
+							if ((@file_exists($destpath) && rename($destpath, $destpath_new)) || $thumbnail != null)
+							{
+								$destpath = $destpath_new;
+							}
+						}
+					}
+				}
+
+				if (is_null($thumbnail))
+				{
+					$thumbnail = new C_NggLegacy_Thumbnail($destpath, true);
+				}
+				else
+				{
+					$thumbnail->fileName = $destpath;
+				}
+
+				// This is quite odd, when watermark equals int(0) it seems all statements below ($watermark == 'image') and ($watermark == 'text') both evaluate as true
+				// so we set it at null if it evaluates to any null-like value
+				if ($watermark == null)
+				{
+					$watermark = null;
+				}
+				
+				if ($watermark == 1 || $watermark === true)
+				{
+					if (in_array(strval($settings->wmType), array('image', 'text')))
+					{
+						$watermark = $settings->wmType;
+					}
+					else
+					{
+						$watermark = 'text';
+					}
+				}
+				
+				$watermark = strval($watermark);
+
+				if ($watermark == 'image')
+				{
+					$thumbnail->watermarkImgPath = $settings['wmPath'];
+					$thumbnail->watermarkImage($settings['wmPos'], $settings['wmXpos'], $settings['wmYpos']);
+				}
+				else if ($watermark == 'text')
+				{
+					$thumbnail->watermarkText = $settings['wmText'];
+					$thumbnail->watermarkCreateText($settings['wmColor'], $settings['wmFont'], $settings['wmSize'], $settings['wmOpaque']);
+					$thumbnail->watermarkImage($settings['wmPos'], $settings['wmXpos'], $settings['wmYpos']);
+				}
+
+				if ($rotation && in_array(abs($rotation), array(90, 180, 270)))
+				{
+					$thumbnail->rotateImageAngle($rotation);
+				}
+
+				$flip = strtolower($flip);
+
+				if ($flip && in_array($flip, array('h', 'v', 'hv')))
+				{
+					$flip_h = in_array($flip, array('h', 'hv'));
+					$flip_v = in_array($flip, array('v', 'hv'));
+
+					$thumbnail->flipImage($flip_h, $flip_v);
+				}
+
+				if ($reflection)
+				{
+					$thumbnail->createReflection(40, 40, 50, FALSE, '#a4a4a4');
+				}
+
+				if ($clone_format != null && isset($format_list[$clone_format]))
+				{
+					// Force format
+					$thumbnail->format = strtoupper($format_list[$clone_format]);
+				}
+
+				$thumbnail->save($destpath, $quality);
+
+                // IF the original contained IPTC metadata we should attempt to copy it
+                if (isset($detailed_size['APP13'])) {
+                    $metadata = iptcembed($detailed_size['APP13'], $destpath);
+                    $fp = fopen($destpath, 'wb');
+                    fwrite($fp, $metadata);
+                    fclose($fp);
+                }
+			}
+		}
+
+		return $thumbnail;
+	}
+}
+
+class C_GalleryStorage_Driver_Base extends C_GalleryStorage_Base
+{
+    public static $_instances = array();
+
+	function define($context)
+	{
+		parent::define($context);
+		$this->add_mixin('Mixin_GalleryStorage_Driver_Base');
+		$this->implement('I_GalleryStorage_Driver');
+	}
+
+	function initialize()
+	{
+		parent::initialize();
+		$this->_gallery_mapper = $this->get_registry()->get_utility('I_Gallery_Mapper');
+		$this->_image_mapper = $this->get_registry()->get_utility('I_Image_Mapper');
+	}
+
+    public static function get_instance($context = False)
+    {
+        if (!isset(self::$_instances[$context]))
+        {
+            self::$_instances[$context] = new C_GalleryStorage_Driver_Base($context);
+        }
+        return self::$_instances[$context];
+    }
+
+
+	/**
+	 * Gets the class name of the driver used
+	 * @return string
+	 */
+	function get_driver_class_name()
+	{
+		return get_called_class();
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.image.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.image.php
new file mode 100644
index 0000000000000000000000000000000000000000..e0f012ef564d5c1d411769fd10b5945871f94f5e
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.image.php
@@ -0,0 +1,57 @@
+<?php
+
+
+class Mixin_NextGen_Gallery_Image_Validation extends Mixin
+{
+	function validation()
+	{
+		$this->validates_presence_of('galleryid', 'filename', 'alttext', 'exclude', 'sortorder', 'imagedate');
+        $this->validates_numericality_of('galleryid');
+        $this->validates_numericality_of($this->id());
+		$this->validates_numericality_of('sortorder');
+
+		return $this->object->is_valid();
+	}
+}
+
+/**
+ * Model for NextGen Gallery Images
+ */
+class C_Image extends C_DataMapper_Model
+{
+	var $_mapper_interface = 'I_Image_Mapper';
+
+    function define($properties=FALSE, $mapper=FALSE, $context=FALSE)
+    {
+        parent::define($mapper, $properties, $context);
+		$this->add_mixin('Mixin_NextGen_Gallery_Image_Validation');
+        $this->implement('I_Image');
+    }
+
+	/**
+	 * Instantiates a new model
+	 * @param array|stdClass $properties
+	 * @param C_DataMapper $mapper
+	 * @param string $context
+	 */
+	function initialize($properties = FALSE, $mapper=FALSE, $context=FALSE) {
+
+		// Get the mapper is not specified
+		if (!$mapper) {
+			$mapper = $this->get_registry()->get_utility($this->_mapper_interface);
+		}
+
+		// Initialize
+		parent::initialize($mapper, $properties);
+	}
+
+	/**
+	 * Returns the model representing the gallery associated with this image
+	 * @return C_Gallery|stdClass
+	 */
+    function get_gallery($model=FALSE)
+    {
+		$gallery_mapper = $this->get_registry()->get_utility('I_Gallery_Mapper');
+        return $gallery_mapper->find($this->galleryid, $model);
+    }
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.image_mapper.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.image_mapper.php
new file mode 100644
index 0000000000000000000000000000000000000000..5d747cb473280bfe9720a27c836d97bdd9d76bf9
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.image_mapper.php
@@ -0,0 +1,176 @@
+<?php
+
+class C_Image_Mapper extends C_CustomTable_DataMapper_Driver
+{
+    public static $_instances = array();
+
+	/**
+	 * Defines the gallery image mapper
+	 * @param type $context
+	 */
+	function define($context=FALSE)
+	{
+		// Add 'attachment' context
+		if (!is_array($context)) $context = array($context);
+		array_push($context, 'attachment');
+
+		$this->primary_key_column = 'pid';
+
+		parent::define('ngg_pictures', $context);
+		$this->add_mixin('Mixin_Gallery_Image_Mapper');
+		$this->add_post_hook(
+			'_convert_to_entity',
+			'Unserialize Metadata',
+			'Hook_Unserialize_Image_Metadata',
+			'unserialize_metadata'
+		);
+		$this->implement('I_Image_Mapper');
+		$this->set_model_factory_method('image');
+	}
+
+	function initialize()
+	{
+		parent::initialize('ngg_pictures');
+	}
+
+    static function get_instance($context = False)
+    {
+        if (!isset(self::$_instances[$context]))
+        {
+            self::$_instances[$context] = new C_Image_Mapper($context);
+        }
+        return self::$_instances[$context];
+    }
+}
+
+/**
+ * Sets the alttext property as the post title
+ */
+class Mixin_Gallery_Image_Mapper extends Mixin
+{
+	function destroy($image)
+	{
+		$retval = $this->call_parent('destroy',$image);
+		C_Photocrati_Cache::flush();
+		return $retval;
+	}
+
+	/**
+	 * Override the save method to avoid trying to save the 'new_sortorder' property
+	 * to the database, which will fail since the column doesn't exist in the
+	 * database.
+	 * TODO: This is just a workaround and should be removed when we implement
+	 * https://www.wrike.com/open.htm?id=8250095
+	 * @param stdClass|C_DataMapper_Model $entity
+	 * @return boolean
+	 */
+	function _convert_to_table_data($entity)
+	{
+		$new_sortorder 	= property_exists($entity, 'new_sortorder') ? $entity->new_sortorder : NULL;
+		unset($entity->new_sortorder);
+		$retval = $this->call_parent('_convert_to_table_data', $entity);
+		if ($new_sortorder) $entity->new_sortorder = $new_sortorder;
+		return $retval;
+	}
+
+
+    function _save_entity($entity)
+    {
+        // If successfully saved, then import metadata and
+        $retval = $this->call_parent('_save_entity', $entity);
+        if ($retval) {
+            include_once(NGGALLERY_ABSPATH.'/admin/functions.php');
+            $image_id = $this->get_id($entity);
+			if (!isset($entity->meta_data['saved'])) {
+				nggAdmin::import_MetaData($image_id);
+			}
+			C_Photocrati_Cache::flush();
+        }
+        return $retval;
+    }
+
+    /**
+     * Retrieves the id from an image
+     * @param $image
+     * @return bool
+     */
+    function get_id($image)
+    {
+        $retval = FALSE;
+
+        // Have we been passed an entity and is the id_field set?
+        if ($image instanceof stdClass) {
+            if (isset($image->id_field)) {
+                $retval = $image->{$image->id_field};
+            }
+        }
+
+        // Have we been passed a model?
+        else $retval = $image->id();
+
+        // If we still don't have an id, then we'll lookup the primary key
+        // and try fetching it manually
+        if (!$retval) {
+            $key = $this->object->get_primary_key_column();
+            $retval = $image->$key;
+
+        }
+
+        return $retval;
+    }
+
+
+	function get_post_title($entity)
+	{
+		return $entity->alttext;
+	}
+
+	function set_defaults($entity)
+	{
+		// If not set already, we'll add an exclude property. This is used
+		// by NextGEN Gallery itself, as well as the Attach to Post module
+		$this->object->_set_default_value($entity, 'exclude', 0);
+
+		// Ensure that the object has a description attribute
+		$this->object->_set_default_value($entity, 'description', '');
+
+		// If not set already, set a default sortorder
+		$this->object->_set_default_value($entity, 'sortorder', 0);
+
+		// The imagedate must be set
+        if ((!isset($entity->imagedate)) OR is_null($entity->imagedate) OR $entity->imagedate == '0000-00-00 00:00:00')
+            $entity->imagedate = date("Y-m-d H:i:s");
+
+		// If a filename is set, and no alttext is set, then set the alttext
+		// to the basename of the filename (legacy behavior)
+		if (isset($entity->filename)) {
+			$path_parts = pathinfo( $entity->filename);
+			$alttext = ( !isset($path_parts['filename']) ) ?
+				substr($path_parts['basename'], 0,strpos($path_parts['basename'], '.')) :
+				$path_parts['filename'];
+			$this->object->_set_default_value($entity, 'alttext', $alttext);
+		}
+
+        // Set unique slug
+        if (isset($entity->alttext)) {
+            $this->object->_set_default_value($entity, 'image_slug', nggdb::get_unique_slug( sanitize_title_with_dashes( $entity->alttext ), 'image' ));
+        }
+
+		// Ensure that the exclude parameter is an integer or boolean-evaluated
+		// value
+		if (is_string($entity->exclude)) $entity->exclude = intval($entity->exclude);
+	}
+}
+
+/**
+ * Unserializes the metadata when fetched from the database
+ */
+class Hook_Unserialize_Image_Metadata extends Hook
+{
+	function unserialize_metadata($entity)
+	{
+		if (isset($entity->meta_data) && is_string($entity->meta_data)) {
+			$entity->meta_data = $this->object->unserialize($entity->meta_data);
+		}
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.image_wrapper.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.image_wrapper.php
new file mode 100644
index 0000000000000000000000000000000000000000..c270e7835575ef41bf8e10ba0616919a2c53d79c
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.image_wrapper.php
@@ -0,0 +1,513 @@
+<?php
+
+/**
+ * This class provides a lazy-loading wrapper to the NextGen-Legacy "nggImage" class for use in legacy style templates
+ */
+class C_Image_Wrapper
+{
+    public $_cache;         // cache of retrieved values
+    public $_settings;      // I_Settings_Manager cache
+    public $_storage;       // I_Gallery_Storage cache
+    public $_galleries;     // cache of I_Gallery_Mapper (plural)
+    public $_orig_image;    // original provided image
+    public $_orig_image_id; // original image ID
+    public $_cache_overrides; // allow for forcing variable values
+    public $_legacy = FALSE;
+    public $_displayed_gallery; // cached object
+
+    /**
+     * Constructor. Converts the image class into an array and fills from defaults any missing values
+     *
+     * @param object $gallery Individual result from displayed_gallery->get_entities()
+     * @param object $displayed_gallery Displayed gallery -- MAY BE NULL
+     * @param bool $legacy Whether the image source is from NextGen Legacy or NextGen
+     * @return void
+     */
+    public function __construct($image, $displayed_gallery=NULL, $legacy = FALSE)
+    {
+        // for clarity
+        if ($displayed_gallery && isset($displayed_gallery->display_settings['number_of_columns']))
+        {
+            $columns = $displayed_gallery->display_settings['number_of_columns'];
+        }
+        else {
+            $columns = 0;
+        }
+
+        // Public variables
+        $defaults = array(
+            'errmsg'    => '',    // Error message to display, if any
+            'error'     => FALSE, // Error state
+            'imageURL'  => '',    // URL Path to the image
+            'thumbURL'  => '',    // URL Path to the thumbnail
+            'imagePath' => '',    // Server Path to the image
+            'thumbPath' => '',    // Server Path to the thumbnail
+            'href'      => '',    // A href link code
+
+            // Mostly constant
+            'thumbPrefix' => 'thumbs_',  // FolderPrefix to the thumbnail
+            'thumbFolder' => '/thumbs/', // Foldername to the thumbnail
+
+            // Image Data
+            'galleryid'   => 0,  // Gallery ID
+            'pid'         => 0,  // Image ID
+            'filename'    => '', // Image filename
+            'description' => '', // Image description
+            'alttext'     => '', // Image alttext
+            'imagedate'   => '', // Image date/time
+            'exclude'     => '', // Image exclude
+            'thumbcode'   => '', // Image effect code
+
+            // Gallery Data
+            'name'       => '', // Gallery name
+            'path'       => '', // Gallery path
+            'title'      => '', // Gallery title
+            'pageid'     => 0, // Gallery page ID
+            'previewpic' => 0,  // Gallery preview pic
+
+            'style'     => ($columns > 0) ? 'style="width:' . floor(100 / $columns) . '%;"' : '',
+            'hidden'    => FALSE,
+            'permalink' => '',
+            'tags'      => '',
+        );
+
+        // convert the image to an array and apply the defaults
+        $this->_orig_image = $image;
+        $image = (array)$image;
+        foreach ($defaults as $key => $val) {
+            if (!isset($image[$key]))
+            {
+                $image[$key] = $val;
+            }
+        }
+
+        // cache the results
+        ksort($image);
+        $id_field = (!empty($image['id_field']) ? $image['id_field'] : 'pid');
+        $this->_cache = (array) apply_filters('ngg_image_object', (object) $image, $image[$id_field]);
+        $this->_orig_image_id = $image[$id_field];
+        $this->_legacy = $legacy;
+        $this->_displayed_gallery = $displayed_gallery;
+    }
+
+    public function __set($name, $value)
+    {
+        $this->_cache[$name] = $value;
+    }
+
+    public function __isset($name)
+    {
+        return isset($this->_cache[$name]);
+    }
+
+    public function __unset($name)
+    {
+        unset($this->_cache[$name]);
+    }
+
+    /**
+     * Lazy-loader for image variables.
+     *
+     * @param string $name Parameter name
+     * @return mixed
+     */
+    public function __get($name)
+    {
+        if (isset($this->_cache_overrides[$name]))
+        {
+            return $this->_cache_overrides[$name];
+        }
+
+        // at the bottom we default to returning $this->_cache[$name].
+        switch ($name)
+        {
+            case 'alttext':
+                $this->_cache['alttext'] = (empty($this->_cache['alttext'])) ?  ' ' : html_entity_decode(stripslashes(nggGallery::i18n($this->_cache['alttext'], 'pic_' . $this->__get('id') . '_alttext')));
+                return $this->_cache['alttext'];
+
+            case 'author':
+                if ($this->_legacy)
+                {
+                    $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
+                }
+                else {
+                    $gallery_map = $this->get_gallery($this->__get('galleryid'));
+                    $gallery = $gallery_map->find($this->__get('galleryid'));
+                }
+                $this->_cache['author'] = $gallery->name;
+                return $this->_cache['author'];
+
+            case 'caption':
+                $caption = html_entity_decode(stripslashes(nggGallery::i18n($this->__get('description'), 'pic_' . $this->__get('id') . '_description')));
+                if (empty($caption))
+                {
+                    $caption = '&nbsp;';
+                }
+                $this->_cache['caption'] = $caption;
+                return $this->_cache['caption'];
+
+            case 'description':
+                $this->_cache['description'] = (empty($this->_cache['description'])) ? ' ' : html_entity_decode(stripslashes(nggGallery::i18n($this->_cache['description'], 'pic_' . $this->__get('id') . '_description')));
+                return $this->_cache['description'];
+
+            case 'galdesc':
+                if ($this->_legacy)
+                {
+                    $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
+                }
+                else {
+                    $gallery_map = $this->get_gallery($this->__get('galleryid'));
+                    $gallery = $gallery_map->find($this->__get('galleryid'));
+                }
+                $this->_cache['galdesc'] = $gallery->name;
+                return $this->_cache['galdesc'];
+
+            case 'gid':
+                if ($this->_legacy)
+                {
+                    $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
+                }
+                else {
+                    $gallery_map = $this->get_gallery($this->__get('galleryid'));
+                    $gallery = $gallery_map->find($this->__get('galleryid'));
+                }
+                $this->_cache['gid'] = $gallery->name;
+                return $this->_cache['gid'];
+
+            case 'href':
+                return $this->__get('imageHTML');
+            
+            case 'id':
+                return $this->_orig_image_id;
+
+            case 'imageHTML':
+                $tmp  = '<a href="' . $this->__get('imageURL') . '" title="'
+                      . htmlspecialchars(stripslashes(nggGallery::i18n($this->__get('description'), 'pic_' . $this->__get('id') . '_description')))
+                      . '" ' . $this->get_thumbcode($this->__get('name')) . '>' . '<img alt="' . $this->__get('alttext')
+                      . '" src="' . $this->__get('imageURL') . '"/>' . '</a>';
+                $this->_cache['href'] = $tmp;
+                $this->_cache['imageHTML'] = $tmp;
+                return $this->_cache['imageHTML'];
+
+            case 'imagePath':
+                $storage = $this->get_storage();
+                $this->_cache['imagePath'] = $storage->get_image_abspath($this->_orig_image, 'full');
+                return $this->_cache['imagePath'];
+
+            case 'imageURL':
+                $storage = $this->get_storage();
+                $this->_cache['imageURL'] = $storage->get_image_url($this->_orig_image, 'full');
+                return $this->_cache['imageURL'];
+
+            case 'linktitle':
+                $this->_cache['linktitle'] = htmlspecialchars(stripslashes(nggGallery::i18n($this->__get('description'), 'pic_' . $this->__get('id') . '_description')));
+                return $this->_cache['linktitle'];
+
+            case 'name':
+                if ($this->_legacy)
+                {
+                    $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
+                }
+                else {
+                    $gallery_map = $this->get_gallery($this->__get('galleryid'));
+                    $gallery = $gallery_map->find($this->__get('galleryid'));
+                }
+                $this->_cache['name'] = $gallery->name;
+                return $this->_cache['name'];
+
+            case 'pageid':
+                if ($this->_legacy)
+                {
+                    $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
+                }
+                else {
+                    $gallery_map = $this->get_gallery($this->__get('galleryid'));
+                    $gallery = $gallery_map->find($this->__get('galleryid'));
+                }
+                $this->_cache['pageid'] = $gallery->name;
+                return $this->_cache['pageid'];
+
+            case 'path':
+                if ($this->_legacy)
+                {
+                    $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
+                }
+                else {
+                    $gallery_map = $this->get_gallery($this->__get('galleryid'));
+                    $gallery = $gallery_map->find($this->__get('galleryid'));
+                }
+                $this->_cache['path'] = $gallery->name;
+                return $this->_cache['path'];
+
+            case 'permalink':
+                $this->_cache['permalink'] = $this->__get('imageURL');
+                return $this->_cache['permalink'];
+
+            case 'pid':
+                return $this->_orig_image_id;
+
+            case 'pidlink':
+                $application = C_Component_Registry::get_instance()->get_utility('I_Router')->get_routed_app();
+                $controller = C_Component_Registry::get_instance()->get_utility('I_Display_Type_Controller');
+                $this->_cache['pidlink'] = $controller->set_param_for(
+                    $application->get_routed_url(TRUE),
+                    'pid',
+                    $this->__get('image_slug')
+                );
+                return $this->_cache['pidlink'];
+
+            case 'previewpic':
+                if ($this->_legacy)
+                {
+                    $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
+                }
+                else {
+                    $gallery_map = $this->get_gallery($this->__get('galleryid'));
+                    $gallery = $gallery_map->find($this->__get('galleryid'));
+                }
+                $this->_cache['previewpic'] = $gallery->name;
+                return $this->_cache['previewpic'];
+
+            case 'size':
+				if (is_string($this->_orig_image->meta_data)) {
+					$this->_orig_image = C_Image_Mapper::get_instance()->unserialize(
+						$this->_orig_image->meta_data
+					);
+				}
+                $w = $this->_orig_image->meta_data['thumbnail']['width'];
+                $h = $this->_orig_image->meta_data['thumbnail']['height'];
+                return "width='{$w}' height='{$h}'";
+
+            case 'slug':
+                if ($this->_legacy)
+                {
+                    $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
+                }
+                else {
+                    $gallery_map = $this->get_gallery($this->__get('galleryid'));
+                    $gallery = $gallery_map->find($this->__get('galleryid'));
+                }
+                $this->_cache['slug'] = $gallery->name;
+                return $this->_cache['slug'];
+
+            case 'tags':
+                $this->_cache['tags'] = wp_get_object_terms($this->__get('id'), 'ngg_tag', 'fields=all');
+                return $this->_cache['tags'];
+
+            case 'thumbHTML':
+                $tmp = '<a href="' . $this->__get('imageURL') . '" title="'
+                     . htmlspecialchars(stripslashes(nggGallery::i18n($this->__get('description'), 'pic_' . $this->__get('id') . '_description')))
+                     . '" ' . $this->get_thumbcode($this->__get('name')) . '>' . '<img alt="' . $this->__get('alttext')
+                     . '" src="' . $this->thumbURL . '"/>' . '</a>';
+                $this->_cache['href'] = $tmp;
+                $this->_cache['thumbHTML'] = $tmp;
+                return $this->_cache['thumbHTML'];
+
+            case 'thumbPath':
+                $storage = $this->get_storage();
+                $this->_cache['thumbPath'] = $storage->get_image_abspath($this->_orig_image, 'thumbnail');
+                return $this->_cache['thumbPath'];
+
+            case 'thumbnailURL':
+                $storage = $this->get_storage();
+                $this->_cache['thumbnailURL'] = $storage->get_thumb_url($this->_orig_image);
+                return $this->_cache['thumbnailURL'];
+
+            case 'thumbcode':
+                $this->_cache['thumbcode'] = $this->get_thumbcode($this->__get('name'));
+                return $this->_cache['thumbcode'];
+
+            case 'thumbURL':
+                return $this->__get('thumbnailURL');
+
+            case 'title':
+                $this->_cache['title'] = stripslashes($this->__get('name'));
+                return $this->_cache['title'];
+
+            case 'url':
+                $storage = $this->get_storage();
+                $this->_cache['url'] = $storage->get_image_url($this->_orig_image, 'full');
+                return $this->_cache['url'];
+
+            default:
+                return $this->_cache[$name];
+        }
+    }
+
+    // called on initial nggLegacy image at construction. not sure what to do with it now.
+    function construct_ngg_Image($gallery)
+    {
+        do_action_ref_array('ngg_get_image', array(&$this));
+        unset($this->tags);
+    }
+
+    /**
+     * Retrieves and caches an I_Settings_Manager instance
+     *
+     * @return mixed
+     */
+    function get_settings()
+    {
+        if (is_null($this->_settings))
+        {
+            $this->_settings = C_NextGen_Settings::get_instance();
+        }
+        return $this->_settings;
+    }
+
+    /**
+     * Retrieves and caches an I_Gallery_Storage instance
+     *
+     * @return mixed
+     */
+    function get_storage()
+    {
+        if (is_null($this->_storage))
+        {
+            $this->_storage = C_Component_Registry::get_instance()->get_utility('I_Gallery_Storage');
+        }
+        return $this->_storage;
+    }
+
+    /**
+     * Retrieves I_Gallery_Mapper instance.
+     *
+     * @param int $gallery_id Gallery ID
+     * @return mixed
+     */
+    function get_gallery($gallery_id)
+    {
+        if (isset($this->container) && method_exists($this->container, 'get_gallery'))
+        {
+            return $this->container->get_gallery($gallery_id);
+        }
+        $gallery_map = C_Component_Registry::get_instance()->get_utility('I_Gallery_Mapper');
+        return $gallery_map->find($gallery_id);
+    }
+
+    /**
+     * Retrieves I_Gallery_Mapper instance.
+     *
+     * @param int $gallery_id Gallery ID
+     * @return mixed
+     */
+    function get_legacy_gallery($gallery_id)
+    {
+        return C_Component_Registry::get_instance()->get_utility('I_Gallery_Mapper')->find($gallery_id);
+    }
+
+    /**
+    * Get the thumbnail code (to add effects on thumbnail click)
+    *
+    * Applies the filter 'ngg_get_thumbcode'
+    */
+    function get_thumbcode($gallery_name = '')
+    {
+        if (empty($this->_displayed_gallery))
+        {
+            $effect_code = C_NextGen_Settings::get_instance()->thumbCode;
+            $effect_code = str_replace('%GALLERY_ID%', $gallery_name, $effect_code);
+            $effect_code = str_replace('%GALLERY_NAME%', $gallery_name, $effect_code);
+            $retval = $effect_code;
+        }
+        else {
+            $controller = C_Component_Registry::get_instance()->get_utility('I_Display_Type_Controller');
+            $retval = $controller->get_effect_code($this->_displayed_gallery);
+
+            // This setting requires that we disable the effect code
+            $ds = $this->_displayed_gallery->display_settings;
+            if (isset($ds['use_imagebrowser_effect']) && $ds['use_imagebrowser_effect'])
+                $retval = '';
+        }
+
+        $retval = apply_filters('ngg_get_thumbcode', $retval, $this);
+
+        $retval .= ' data-image-id="' . $this->__get('id') . '"';
+
+        $this->_cache['thumbcode'] = $retval;
+        return $retval;
+    }
+
+    /**
+     * For compatibility support
+     *
+     * @return mixed
+     */
+    function get_href_link()
+    {
+        return $this->__get('imageHTML');
+    }
+
+    /**
+     * For compatibility support
+     *
+     * @return mixed
+     */
+    function get_href_thumb_link()
+    {
+        return $this->__get('thumbHTML');
+    }
+
+    /**
+     * Function exists for legacy support but has been gutted to not do anything
+     *
+     * @param int $width
+     * @param int $height
+     * @param string $mode could be watermark | web20 | crop
+     * @return the url for the image or false if failed
+     */
+    function cached_singlepic_file($width = '', $height = '', $mode = '' )
+    {
+        $dynthumbs = C_Component_Registry::get_instance()->get_utility('I_Dynamic_Thumbnails_Manager');
+        $storage = $this->get_storage();
+
+        // determine what to do with 'mode'
+        $display_reflection = FALSE;
+        $display_watermark  = FALSE;
+
+        if (!is_array($mode))
+            $mode = explode(',', $mode);
+        if (in_array('web20', $mode))
+            $display_reflection = TRUE;
+        if (in_array('watermark', $mode))
+            $display_watermark = TRUE;
+
+        // and go for it
+        $params = array(
+            'width'      => $width,
+            'height'     => $height,
+            'watermark'  => $display_watermark,
+            'reflection' => $display_reflection
+        );
+
+        return $storage->get_image_url((object)$this->_cache, $dynthumbs->get_size_name($params));
+    }
+
+    /**
+     * Get the tags associated to this image
+     */
+    function get_tags()
+    {
+        return $this->__get('tags');
+    }
+
+    /**
+     * Get the permalink to the image
+     *
+     * TODO: Get a permalink to a page presenting the image
+     */
+    function get_permalink()
+    {
+        return $this->__get('permalink');
+    }
+
+    /**
+     * Returns the _cache array; used by nggImage
+     * @return array
+     */
+    function _get_image()
+    {
+        return $this->_cache;
+    }
+
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.image_wrapper_collection.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.image_wrapper_collection.php
new file mode 100644
index 0000000000000000000000000000000000000000..341882a5b3c51c8bed20a5202c91557df571bc40
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.image_wrapper_collection.php
@@ -0,0 +1,54 @@
+<?php
+
+class C_Image_Wrapper_Collection implements ArrayAccess
+{
+
+    public $container = array();
+    public $galleries = array();
+
+    public function offsetExists($offset)
+    {
+        return isset($this->container[$offset]);
+    }
+
+    public function offsetGet($offset)
+    {
+        return isset($this->container[$offset]) ? $this->container[$offset] : null;
+    }
+
+    public function offsetSet($offset, $value)
+    {
+        if (is_object($value))
+        {
+            $value->container = $this;
+        }
+
+        if (is_null($offset))
+        {
+            $this->container[] = $value;
+        }
+        else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    public function offsetUnset($offset)
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Retrieves and caches an I_Gallery_Mapper instance for this gallery id
+     *
+     * @param int $gallery_id Gallery ID
+     * @return mixed
+     */
+    public function get_gallery($gallery_id)
+    {
+        if (!isset($this->galleries[$gallery_id]) || is_null($this->galleries[$gallery_id]))
+        {
+            $this->galleries[$gallery_id] = C_Component_Registry::get_instance()->get_utility('I_Gallery_Mapper');
+        }
+        return $this->galleries[$gallery_id];
+    }
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.nextgen_data_installer.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.nextgen_data_installer.php
new file mode 100644
index 0000000000000000000000000000000000000000..c930dcdf6203b3513e25ce008676f77fc681b13a
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.nextgen_data_installer.php
@@ -0,0 +1,32 @@
+<?php
+
+class C_NextGen_Data_Installer
+{
+	function get_registry()
+	{
+		return C_Component_Registry::get_instance();
+	}
+
+	function uninstall($hard = FALSE)
+	{
+		if ($hard) {
+            /* Yes: this is commented twice.
+		// TODO for now never delete galleries/albums/content
+#			$mappers = array(
+#				$this->get_registry()->get_utility('I_Album_Mapper'),
+#				$this->get_registry()->get_utility('I_Gallery_Mapper'),
+#				$this->get_registry()->get_utility('I_Image_Mapper'),
+#			);
+
+#			foreach ($mappers as $mapper) {
+#				$mapper->delete()->run_query();
+#			}
+
+#			// Remove ngg tags
+#			global $wpdb;
+#			$wpdb->query("DELETE FROM {$wpdb->terms} WHERE term_id IN (SELECT term_id FROM {$wpdb->term_taxonomy} WHERE taxonomy='ngg_tag')");
+#			$wpdb->query("DELETE FROM {$wpdb->term_taxonomy} WHERE taxonomy='ngg_tag'");
+            */
+		}
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.nextgen_metadata.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.nextgen_metadata.php
new file mode 100644
index 0000000000000000000000000000000000000000..9e6030acbb820302d3b5c984b5bc68dfcb9b4dec
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.nextgen_metadata.php
@@ -0,0 +1,677 @@
+<?php
+
+class C_NextGen_Metadata extends C_Component
+{
+    // Image data
+    public $image     = '';    // The image object
+    public $file_path = '';    // Path to the image file
+    public $size      = FALSE; // The image size
+    public $exif_data = FALSE; // EXIF data array
+    public $iptc_data = FALSE; // IPTC data array
+    public $xmp_data  = FALSE; // XMP data array
+
+    // Filtered Data
+    public $exif_array = FALSE; // EXIF data array
+    public $iptc_array = FALSE; // IPTC data array
+    public $xmp_array  = FALSE; // XMP data array
+
+    public $sanitize = FALSE; // sanitize meta data on request
+
+    /**
+     * Class constructor
+     * 
+     * @param int $image Image ID
+     * @param bool $onlyEXIF TRUE = will parse only EXIF data
+     * @return bool FALSE if the file does not exist or metadat could not be read
+     */
+    public function __construct($image, $onlyEXIF = FALSE)
+    {
+        if (is_numeric($image))
+        {
+            $image = $this->get_registry()->get_utility('I_Image_Mapper')->find($image);
+        }
+
+        $this->image = apply_filters('ngg_find_image_meta', $image);
+
+        $this->file_path = $this->get_registry()->get_utility('I_Gallery_Storage')->get_image_abspath($this->image);
+
+        if (!@file_exists($this->file_path))
+        {
+            return FALSE;
+        }
+
+        $this->size = @getimagesize ($this->file_path , $metadata);
+
+        if ($this->size && is_array($metadata))
+        {
+            // get exif - data
+            if (is_callable('exif_read_data'))
+            {
+                $this->exif_data = @exif_read_data($this->file_path , 0, TRUE);
+            }
+
+            // stop here if we didn't need other meta data
+            if ($onlyEXIF)
+            {
+                return TRUE;
+            }
+
+            // get the iptc data - should be in APP13
+            if (is_callable('iptcparse') && isset($metadata['APP13']))
+            {
+                $this->iptc_data = @iptcparse($metadata['APP13']);
+            }
+
+            // get the xmp data in a XML format
+            if (is_callable('xml_parser_create'))
+            {
+                $this->xmp_data = $this->extract_XMP($this->file_path);
+            }
+
+            return TRUE;
+        }
+
+        return FALSE;
+    }
+
+    /**
+     * Return a parsed meta-data attribute of an object
+     *
+     * @param stdClass $object (optional)
+     * @return array|mixed Returns either the complete array or the single object
+     */
+    function get_saved_meta($object = FALSE)
+    {
+        $meta = $this->image->meta_data;
+
+        // check if we already import the meta data to the database
+        if (!is_array($meta) || !isset($meta['saved']) OR ($meta['saved'] != TRUE))
+        {
+            return FALSE;
+        }
+
+        // return one element if requested
+        if ($object)
+        {
+            return $meta[$object];
+        }
+
+        // remove saved parameter we don't need that to show
+        unset($meta['saved']);
+
+        // and remove empty tags or arrays
+        foreach ($meta as $key => $value) {
+            if (empty($value) OR is_array($value))
+            {
+                unset($meta[$key]);
+            }
+        }
+
+        // on request sanitize the output
+        if (TRUE == $this->sanitize)
+        {
+            array_walk($meta , create_function('&$value', '$value = esc_html($value);'));
+        }
+
+        return $meta;
+    }
+
+    /**
+     * Parses exif data into an array
+     * 
+     * @param stdClass $object 
+     * @see http://trac.wordpress.org/changeset/6313
+     * @return array structured EXIF data
+     */
+    function get_EXIF($object = FALSE)
+    {
+
+        if (!$this->exif_data)
+        {
+            return FALSE;
+        }
+
+        if (!is_array($this->exif_array))
+        {
+            $meta = array();
+
+            if (isset($this->exif_data['EXIF']))
+            {
+                $exif = $this->exif_data['EXIF'];
+
+                if (!empty($exif['FNumber']))
+                    $meta['aperture'] = 'F ' . round($this->exif_frac2dec($exif['FNumber']), 2);
+
+                if (!empty($exif['Model']))
+                    $meta['camera'] = trim($exif['Model']);
+
+                if (!empty($exif['DateTimeDigitized']))
+                    $meta['created_timestamp'] = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $this->exif_date2ts($exif['DateTimeDigitized']));
+                else if (!empty($exif['DateTimeOriginal']))
+                    $meta['created_timestamp'] = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $this->exif_date2ts($exif['DateTimeOriginal']));
+
+                if (!empty($exif['FocalLength']))
+                    $meta['focal_length'] = $this->exif_frac2dec($exif['FocalLength']) . __(' mm','nggallery');
+
+                if (!empty($exif['ISOSpeedRatings']))
+                    $meta['iso'] = $exif['ISOSpeedRatings'];
+
+                if (!empty($exif['ExposureTime']))
+                {
+                    $meta['shutter_speed']  = $this->exif_frac2dec ($exif['ExposureTime']);
+                    $meta['shutter_speed']  = ($meta['shutter_speed'] > 0.0 and $meta['shutter_speed'] < 1.0) ? ('1/' . round(1 / $meta['shutter_speed'], -1)) : ($meta['shutter_speed']);
+                    $meta['shutter_speed'] .= __(' sec','nggallery');
+                }
+
+                //Bit 0 indicates the flash firing status
+                if (!empty($exif['Flash']))
+                    $meta['flash'] =  ($exif['Flash'] & 1) ? __('Fired', 'nggallery') : __('Not fired',' nggallery');
+            }
+
+            // additional information
+            if (isset($this->exif_data['IFD0']))
+            {
+                $exif = $this->exif_data['IFD0'];
+
+                if (!empty($exif['Model']))
+                    $meta['camera'] = $exif['Model'];
+                if (!empty($exif['Make']))
+                    $meta['make'] = $exif['Make'];
+                if (!empty($exif['ImageDescription']))
+                    $meta['title'] = utf8_encode($exif['ImageDescription']);
+                if (!empty($exif['Orientation']))
+                    $meta['Orientation'] = $exif['Orientation'];
+            }
+
+            // this is done by Windows
+            if (isset($this->exif_data['WINXP']))
+            {
+                $exif = $this->exif_data['WINXP'];
+
+                if (!empty($exif['Title']) && empty($meta['title']))
+                    $meta['title'] = utf8_encode($exif['Title']);
+                if (!empty($exif['Author']))
+                    $meta['author'] = utf8_encode($exif['Author']);
+                if (!empty($exif['Keywords']))
+                    $meta['tags'] = utf8_encode($exif['Keywords']);
+                if (!empty($exif['Subject']))
+                    $meta['subject'] = utf8_encode($exif['Subject']);
+                if (!empty($exif['Comments']))
+                    $meta['caption'] = utf8_encode($exif['Comments']);
+            }
+
+            $this->exif_array = $meta;
+        }
+
+        // return one element if requested
+        if ($object == TRUE)
+        {
+            $value = isset($this->exif_array[$object]) ? $this->exif_array[$object] : FALSE;
+            return $value;
+        }
+
+        // on request sanitize the output
+        if ($this->sanitize == TRUE)
+        {
+            array_walk($this->exif_array , create_function('&$value', '$value = esc_html($value);'));
+        }
+
+        return $this->exif_array;
+
+    }
+
+    /**
+     * Convert a fraction string to a decimal
+     * 
+     * @param string $str
+     * @return string 
+     */
+    function exif_frac2dec($str)
+    {
+        @list($n, $d) = explode('/', $str);
+        if (!empty($d))
+        {
+            return $n / $d;
+        }
+        return $str;
+    }
+
+    /**
+     * Convert EXIF date format to a unix timestamp
+     * 
+     * @param $str
+     * @return int
+     */
+    function exif_date2ts($str)
+    {
+        @list($date, $time) = explode(' ', trim($str));
+        @list($y, $m, $d) = explode(':', $date);
+        return strtotime("{$y}-{$m}-{$d} {$time}");
+    }
+
+    /**
+     * Parses IPTC Data Information for EXIF Display
+     *
+     * @param mixed $output_tag
+     * @return array IPTC tags
+     */
+    function get_IPTC($object = FALSE)
+    {
+
+        if (!$this->iptc_data)
+        {
+            return FALSE;
+        }
+
+        if (!is_array($this->iptc_array))
+        {
+            // Set up array functions
+            $iptcTags = array(
+                "2#005" => 'title',
+                "2#007" => 'status',
+                "2#012" => 'subject',
+                "2#015" => 'category',
+                "2#025" => 'keywords',
+                "2#055" => 'created_date',
+                "2#060" => 'created_time',
+                "2#080" => 'author',
+                "2#085" => 'position',
+                "2#090" => 'city',
+                "2#092" => 'location',
+                "2#095" => 'state',
+                "2#100" => 'country_code',
+                "2#101" => 'country',
+                "2#105" => 'headline',
+                "2#110" => 'credit',
+                "2#115" => 'source',
+                "2#116" => 'copyright',
+                "2#118" => 'contact',
+                "2#120" => 'caption'
+            );
+
+            $meta = array();
+            foreach ($iptcTags as $key => $value) {
+                if (isset ($this->iptc_data[$key]))
+                {
+                    $meta[$value] = trim(utf8_encode(implode(", ", $this->iptc_data[$key])));
+                }
+
+            }
+            $this->iptc_array = $meta;
+        }
+
+        // return one element if requested
+        if ($object)
+        {
+            return (isset($this->iptc_array[$object])) ? $this->iptc_array[$object] : NULL;
+        }
+
+        // on request sanitize the output
+        if ($this->sanitize == TRUE)
+        {
+            array_walk($this->iptc_array , create_function('&$value', '$value = esc_html($value);'));
+        }
+
+        return $this->iptc_array;
+    }
+
+    /**
+     * Extracts XMP DATA
+     * 
+     * Code by Pekka Saarinen: http://photography-on-the.net
+     * @param mixed $filename
+     * @return XML data
+     */
+    function extract_XMP($filename)
+    {
+        // TODO: Requires a lot of memory; this could be done better
+        ob_start();
+        @readfile($filename);
+        $source = ob_get_contents();
+        ob_end_clean();
+
+        $start = strpos($source, "<x:xmpmeta");
+        $end   = strpos($source, "</x:xmpmeta>");
+        if ((!$start === FALSE) && (!$end === FALSE))
+        {
+            $length = $end - $start;
+            $xmp_data = substr($source, $start, $length+12);
+            unset($source);
+            return $xmp_data;
+        }
+
+        unset($source);
+        return FALSE;
+    }
+
+    /**
+     * @see http://php.net/manual/en/function.xml-parse-into-struct.php
+     * @author Alf Marius Foss Olsen & Alex Rabe
+     * @return XML Array or object
+     */
+    function get_XMP($object = FALSE)
+    {
+
+        if (!$this->xmp_data)
+        {
+            return FALSE;
+        }
+
+        if (!is_array($this->xmp_array))
+        {
+            $parser = xml_parser_create();
+            xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); // Dont mess with my cAsE sEtTings
+            xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); // Dont bother with empty info
+            xml_parse_into_struct($parser, $this->xmp_data, $values);
+            xml_parser_free($parser);
+
+            $xmlarray           = array(); // The XML array
+            $this->xmp_array    = array(); // The returned array
+            $stack              = array(); // tmp array used for stacking
+            $list_array         = array(); // tmp array for list elements
+            $list_element       = FALSE;   // rdf:li indicator
+
+            foreach ($values as $val) {
+
+                if ($val['type'] == "open")
+                {
+                    array_push($stack, $val['tag']);
+                }
+                elseif ($val['type'] == "close")
+                {
+                    // reset the compared stack
+                    if ($list_element == FALSE)
+                    {
+                        array_pop($stack);
+                    }
+                    // reset the rdf:li indicator & array
+                    $list_element = FALSE;
+                    $list_array   = array();
+
+                }
+                elseif ($val['type'] == "complete")
+                {
+                    if ($val['tag'] == "rdf:li")
+                    {
+                        // first go one element back
+                        if ($list_element == FALSE)
+                        {
+                            array_pop($stack);
+                        }
+                        $list_element = TRUE;
+
+                        // do not parse empty tags
+                        if (empty($val['value']))
+                        {
+                            continue;
+                        }
+
+                        // save it in our temp array
+                        $list_array[] = $val['value'];
+
+                        // in the case it's a list element we serialize it
+                        $value = implode(",", $list_array);
+                        $this->setArrayValue($xmlarray, $stack, $value);
+                    }
+                    else {
+                        array_push($stack, $val['tag']);
+
+                        // do not parse empty tags
+                        if (!empty($val['value']))
+                        {
+                            $this->setArrayValue($xmlarray, $stack, $val['value']);
+                        }
+                        array_pop($stack);
+                    }
+                }
+
+            }
+
+            // don't parse a empty array
+            if (empty($xmlarray) || empty($xmlarray['x:xmpmeta']))
+            {
+                return FALSE;
+            }
+
+            // cut off the useless tags
+            $xmlarray = $xmlarray['x:xmpmeta']['rdf:RDF']['rdf:Description'];
+
+            // Some values from the XMP format
+            $xmpTags = array(
+                'xap:CreateDate'            => 'created_timestamp',
+                'xap:ModifyDate'            => 'last_modfied',
+                'xap:CreatorTool'           => 'tool',
+                'dc:format'                 => 'format',
+                'dc:title'                  => 'title',
+                'dc:creator'                => 'author',
+                'dc:subject'                => 'keywords',
+                'dc:description'            => 'caption',
+                'photoshop:AuthorsPosition' => 'position',
+                'photoshop:City'            => 'city',
+                'photoshop:Country'         => 'country'
+            );
+
+            foreach ($xmpTags as $key => $value) {
+                if (isset($xmlarray[$key]))
+                {
+                    switch ($key) {
+                        case 'xap:CreateDate':
+                        case 'xap:ModifyDate':
+                            $this->xmp_array[$value] = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), strtotime($xmlarray[$key]));
+                            break;
+                        default :
+                            $this->xmp_array[$value] = $xmlarray[$key];
+                    }
+                }
+            }
+        }
+
+        // return one element if requested
+        if ($object != FALSE)
+        {
+            return isset($this->xmp_array[$object]) ? $this->xmp_array[$object] : FALSE;
+        }
+
+        // on request sanitize the output
+        if ($this->sanitize == TRUE)
+        {
+            array_walk($this->xmp_array , create_function('&$value', '$value = esc_html($value);'));
+        }
+
+        return $this->xmp_array;
+    }
+
+    function setArrayValue(&$array, $stack, $value)
+    {
+        if ($stack)
+        {
+            $key = array_shift($stack);
+            $this->setArrayValue($array[$key], $stack, $value);
+            return $array;
+        }
+        else {
+            $array = $value;
+        }
+    }
+
+    /**
+     * Return meta values from the available list
+     *
+     * @param string $object
+     * @return mixed $value
+     */
+    function get_META($object = FALSE)
+    {
+        // defined order first look into database, then XMP, IPTC and EXIF.
+        if ($value = $this->get_saved_meta($object))
+        {
+            return $value;
+        }
+
+        if ($value = $this->get_XMP($object))
+        {
+            return $value;
+        }
+
+        if ($value = $this->get_IPTC($object))
+        {
+            return $value;
+        }
+
+        if ($value = $this->get_EXIF($object))
+        {
+            return $value;
+        }
+
+        // nothing found
+        return FALSE;
+    }
+
+    /**
+     * nggMeta::i8n_name() -  localize the tag name
+     *
+     * @param mixed $key
+     * @return translated $key
+     */
+    function i8n_name($key)
+    {
+        $tagnames = array(
+            'aperture'          => __('Aperture', 'nggallery'),
+            'credit'            => __('Credit', 'nggallery'),
+            'camera'            => __('Camera', 'nggallery'),
+            'caption'           => __('Caption', 'nggallery'),
+            'created_timestamp' => __('Date/Time', 'nggallery'),
+            'copyright'         => __('Copyright', 'nggallery'),
+            'focal_length'      => __('Focal length', 'nggallery'),
+            'iso'               => __('ISO', 'nggallery'),
+            'shutter_speed'     => __('Shutter speed', 'nggallery'),
+            'title'             => __('Title', 'nggallery'),
+            'author'            => __('Author', 'nggallery'),
+            'tags'              => __('Tags', 'nggallery'),
+            'subject'           => __('Subject', 'nggallery'),
+            'make'              => __('Make', 'nggallery'),
+            'status'            => __('Edit Status', 'nggallery'),
+            'category'          => __('Category', 'nggallery'),
+            'keywords'          => __('Keywords', 'nggallery'),
+            'created_date'      => __('Date Created', 'nggallery'),
+            'created_time'      => __('Time Created', 'nggallery'),
+            'position'          => __('Author Position', 'nggallery'),
+            'city'              => __('City', 'nggallery'),
+            'location'          => __('Location', 'nggallery'),
+            'state'             => __('Province/State', 'nggallery'),
+            'country_code'      => __('Country code', 'nggallery'),
+            'country'           => __('Country', 'nggallery'),
+            'headline'          => __('Headline', 'nggallery'),
+            'credit'            => __('Credit', 'nggallery'),
+            'source'            => __('Source', 'nggallery'),
+            'copyright'         => __('Copyright Notice', 'nggallery'),
+            'contact'           => __('Contact', 'nggallery'),
+            'last_modfied'      => __('Last modified', 'nggallery'),
+            'tool'              => __('Program tool', 'nggallery'),
+            'format'            => __('Format', 'nggallery'),
+            'width'             => __('Image Width', 'nggallery'),
+            'height'            => __('Image Height', 'nggallery'),
+            'flash'             => __('Flash', 'nggallery')
+        );
+
+        if (isset($tagnames[$key]))
+        {
+            $key = $tagnames[$key];
+        }
+
+        return($key);
+
+    }
+
+    /**
+     * Return the Timestamp from the image. If possible it's read from exif data.
+     *
+     * @return
+     */
+    function get_date_time()
+    {
+        // get exif - data
+        if (isset($this->exif_data['EXIF']))
+        {
+            // try to read the date / time from the exif
+            if (empty($this->exif_data['EXIF']['DateTimeDigitized']))
+            {
+                $date_time = $this->exif_data['EXIF']['DateTimeOriginal'];
+            }
+            else {
+                $date_time = $this->exif_data['EXIF']['DateTimeDigitized'];
+            }
+
+            // if we didn't get the correct exif value we take filetime
+            if ($date_time == NULL)
+            {
+                $date_time = $this->exif_data['FILE']['FileDateTime'];
+            }
+            else {
+                $date_time = $this->exif_date2ts($date_time);
+            }
+        }
+        else {
+            // if no other date available, get the filetime
+            $date_time = @filectime($this->file_path);
+        }
+
+        // Return the MySQL format
+        $date_time = date('Y-m-d H:i:s', $date_time);
+
+        return $date_time;
+    }
+
+    /**
+     * This function return the most common metadata, via a filter we can add more
+     * Reason : GD manipulation removes that options
+     *
+     * @since V1.4.0
+     * @return void
+     */
+    function get_common_meta()
+    {
+        $meta = array(
+            'aperture' => 0,
+            'credit' => '',
+            'camera' => '',
+            'caption' => '',
+            'created_timestamp' => 0,
+            'copyright' => '',
+            'focal_length' => 0,
+            'iso' => 0,
+            'shutter_speed' => 0,
+            'flash' => 0,
+            'title' => '',
+            'keywords' => ''
+        );
+
+        $meta = apply_filters('ngg_read_image_metadata', $meta);
+
+        // meta should be still an array
+        if (!is_array($meta))
+        {
+            return FALSE;
+        }
+
+        foreach ($meta as $key => $value) {
+            $meta[$key] = $this->get_META($key);
+        }
+
+        //let's add now the size of the image
+        $meta['width']  = $this->size[0];
+        $meta['height'] = $this->size[1];
+
+        return $meta;
+    }
+
+    /**
+     * If needed sanitize each value before output
+     *
+     * @return void
+     */
+    function sanitize()
+    {
+        $this->sanitize = TRUE;
+    }
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.ngglegacy_gallerystorage_driver.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.ngglegacy_gallerystorage_driver.php
new file mode 100644
index 0000000000000000000000000000000000000000..c6db0052845aed9e7ad859d29c630c5059ac9a5a
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.ngglegacy_gallerystorage_driver.php
@@ -0,0 +1,794 @@
+<?php
+
+class Mixin_NggLegacy_GalleryStorage_Driver extends Mixin
+{
+	/**
+	 * Returns the named sizes available for images
+	 * @return array
+	 */
+	function get_image_sizes()
+	{
+		return array('full', 'thumbnail');
+	}
+
+
+	function get_upload_abspath($gallery=FALSE)
+	{
+		// Base upload path
+		$retval = C_NextGen_Settings::get_instance()->gallerypath;
+    $fs = $this->get_registry()->get_utility('I_Fs');
+
+		// If a gallery has been specified, then we'll
+		// append the slug
+		if ($gallery) {
+			if (!is_object($gallery)) {
+				$gallery = $this->object->_get_gallery_id($gallery);
+				$gallery = $this->object->_gallery_mapper->find($gallery);
+			}
+			
+			if ($gallery) {
+				$path = $gallery->path;
+				$base = basename($path);
+				$slug = $gallery->slug;
+				
+				if ($base == null) {
+					$base = $slug;
+				}
+				
+				$retval = $fs->join_paths($retval, $base);
+			}
+		}
+
+		// We need to make this an absolute path
+		if (strpos($retval, $fs->get_document_root()) === FALSE)
+            $retval = $fs->join_paths($fs->get_document_root(), $retval);
+
+		return $retval;
+	}
+
+
+	/**
+	 * Get the gallery path persisted in the database for the gallery
+	 * @param int|stdClass|C_NextGen_Gallery $gallery
+	 */
+	function get_gallery_abspath($gallery)
+	{
+		$retval = NULL;
+        $fs = $this->get_registry()->get_utility('I_Fs');
+
+		// Get the gallery entity from the database
+		if ($gallery) {
+			if (is_numeric($gallery)) {
+				$gallery = $this->object->_gallery_mapper->find($gallery);
+			}
+		}
+
+		// If a path was stored in the entity, then use that
+		if ($gallery && isset($gallery->path)) {
+			$retval = $fs->join_paths($fs->get_document_root(), $gallery->path);
+		}
+        elseif ($gallery) {
+            // fallback to the upload abspath
+            $storage = $this->object->get_registry()->get_utility('I_Gallery_Storage');
+            $retval = $storage->get_upload_abspath($gallery);
+        }
+
+		return $retval;
+	}
+
+
+	/**
+	 * Gets the absolute path where the image is stored
+	 * Can optionally return the path for a particular sized image
+	 */
+	function get_image_abspath($image, $size='full', $check_existance=FALSE)
+	{
+		$retval = NULL;
+        $fs = $this->get_registry()->get_utility('I_Fs');
+
+        // Ensure that we have a size
+		if (!$size) {
+			$size = 'full';
+		}
+
+		// If we have the id, get the actual image entity
+		if (is_numeric($image)) {
+			$image = $this->object->_image_mapper->find($image);
+		}
+
+		// Ensure we have the image entity - user could have passed in an
+		// incorrect id
+		if (is_object($image)) {
+			if (($gallery_path = $this->object->get_gallery_abspath($image->galleryid))) {
+				$folder = $prefix = $size;
+				switch ($size) {
+
+					# Images are stored in the associated gallery folder
+					case 'full':
+					case 'original':
+					case 'image':
+						$retval = $fs->join_paths($gallery_path, $image->filename);
+						break;
+
+					case 'thumbnails':
+					case 'thumbnail':
+					case 'thumb':
+					case 'thumbs':
+						$size = 'thumbnail';
+						$folder = 'thumbs';
+						$prefix = 'thumbs';
+						// deliberately no break here
+
+					// We assume any other size of image is stored in the a
+					//subdirectory of the same name within the gallery folder
+					// gallery folder, but with the size appended to the filename
+					default:
+						$image_path = $fs->join_paths($gallery_path, $folder);
+
+						// NGG 2.0 stores relative filenames in the meta data of
+						// an image. It does this because it uses filenames
+						// that follow conventional WordPress naming scheme.
+						if (isset($image->meta_data) && isset($image->meta_data[$size]) && isset($image->meta_data[$size]['filename'])) {
+							$image_path = $fs->join_paths($image_path, $image->meta_data[$size]['filename']);
+						}
+
+						// NGG Legacy does not store relative filenames in the
+						// image entity for sizes other than the original.
+						// Although the naming scheme for filenames differs from
+						// WordPress conventions, NGG legacy does follow it's
+						// own naming schema consistently so we can guess the path
+						else {
+							$image_path = $fs->join_paths($image_path, "{$prefix}_{$image->filename}");
+						}
+
+						// Should we check whether the image actually exists?
+						if ($check_existance && @file_exists($image_path)) {
+							$retval = $image_path;
+						}
+						elseif (!$check_existance) $retval = $image_path;
+						break;
+				}
+			}
+		}
+
+		return $retval;
+	}
+
+
+	/**
+	 * Gets the url of a particular-sized image
+	 * @param int|object $image
+	 * @param string $size
+	 * @returns array
+	 */
+	function get_image_url($image, $size='full')
+	{
+		$fs		= $this->get_registry()->get_utility('I_Fs');
+		$router = $this->get_registry()->get_utility('I_Router');
+		$request_uri = str_replace(
+			trailingslashit($fs->get_document_root()),
+			'',
+			$this->object->get_image_abspath($image, $size)
+		);
+        return $router->remove_url_segment('/index.php', $router->get_url($request_uri, FALSE, TRUE));
+	}
+
+	/**
+	 * Uploads an image for a particular gallerys
+	 * @param int|stdClass|C_NextGEN_Gallery $gallery
+	 * @param type $filename, specifies the name of the file
+	 * @param type $data if specified, expects base64 encoded string of data
+	 * @return C_Image
+	 */
+	function upload_image($gallery, $filename=FALSE, $data=FALSE)
+	{
+		$retval = NULL;
+
+		// Ensure that we have the data present that we require
+		if ((isset($_FILES['file']) && $_FILES['file']['error'] == 0)) {
+
+			//		$_FILES = Array(
+			//		 [file]	=>	Array (
+			//            [name] => Canada_landscape4.jpg
+			//            [type] => image/jpeg
+			//            [tmp_name] => /private/var/tmp/php6KO7Dc
+			//            [error] => 0
+			//            [size] => 64975
+			//         )
+			//
+			$file = $_FILES['file'];
+
+            if ($this->object->is_zip()) {
+                $retval = $this->object->upload_zip($gallery);
+            }
+            else {
+                $retval = $this->object->upload_base64_image(
+                    $gallery,
+                    file_get_contents($file['tmp_name']),
+                    $filename ? $filename : (isset($file['name']) ? $file['name'] : FALSE)
+                );
+            }
+		}
+		elseif ($data) {
+			$retval = $this->object->upload_base64_image(
+				$filename,
+				$data
+			);
+		}
+		else throw new E_UploadException();
+
+		return $retval;
+	}
+
+	function get_image_size_params($image, $size, $params = null, $skip_defaults = false)
+	{
+		// Get the image entity
+		if (is_numeric($image)) {
+			$image = $this->object->_image_mapper->find($image);
+		}
+
+		// Ensure we have a valid image
+		if ($image)
+		{
+			$settings = C_NextGen_Settings::get_instance();
+
+			if (!$skip_defaults)
+			{
+				// Get default settings
+				if ($size == 'full') {
+					if (!isset($params['quality'])) {
+						$params['quality'] = $settings->imgQuality;
+					}
+				}
+				else {
+					if (!isset($params['crop'])) {
+						$params['crop'] = $settings->thumbfix;
+					}
+
+					if (!isset($params['quality'])) {
+						$params['quality'] = $settings->thumbquality;
+					}
+				}
+
+				// Not sure why this was here... commenting out for now, always require watermark parameters to be explicit
+#				if (!isset($params['watermark'])) {
+#					$params['watermark'] = $settings->wmType;
+#				}
+			}
+
+			// width and height when omitted make generate_image_clone create a clone with original size, so try find defaults regardless of $skip_defaults
+			if (!isset($params['width']) || !isset($params['height'])) {
+				// First test if this is a "known" image size, i.e. if we store these sizes somewhere when users re-generate these sizes from the UI...this is required to be compatible with legacy
+				// try the 2 default built-in sizes, first thumbnail...
+				if ($size == 'thumbnail') {
+					if (!isset($params['width'])) {
+						$params['width'] = $settings->thumbwidth;
+					}
+
+					if (!isset($params['height'])) {
+						$params['height'] = $settings->thumbheight;
+					}
+				}
+				// ...and then full, which is the size specified in the global resize options
+				else if ($size == 'full') {
+					if (!isset($params['width'])) {
+						if ($settings->imgAutoResize) {
+							$params['width'] = $settings->imgWidth;
+						}
+					}
+
+					if (!isset($params['height'])) {
+						if ($settings->imgAutoResize) {
+							$params['height'] = $settings->imgHeight;
+						}
+					}
+				}
+				// Only re-use old sizes as last resort
+				else if (isset($image->meta_data) && isset($image->meta_data[$size])) {
+					$dimensions = $image->meta_data[$size];
+
+					if (!isset($params['width'])) {
+						$params['width'] = $dimensions['width'];
+					}
+
+					if (!isset($params['height'])) {
+						$params['height'] = $dimensions['height'];
+					}
+				}
+			}
+
+			if (!isset($params['crop_frame'])) {
+				$crop_frame_size_name = 'thumbnail';
+
+				if (isset($image->meta_data[$size]['crop_frame'])) {
+					$crop_frame_size_name = $size;
+				}
+
+				if (isset($image->meta_data[$crop_frame_size_name]['crop_frame'])) {
+					$params['crop_frame'] = $image->meta_data[$crop_frame_size_name]['crop_frame'];
+
+					if (!isset($params['crop_frame']['final_width'])) {
+						$params['crop_frame']['final_width'] = $image->meta_data[$crop_frame_size_name]['width'];
+					}
+
+					if (!isset($params['crop_frame']['final_height'])) {
+						$params['crop_frame']['final_height'] = $image->meta_data[$crop_frame_size_name]['height'];
+					}
+				}
+			}
+			else {
+				if (!isset($params['crop_frame']['final_width'])) {
+					$params['crop_frame']['final_width'] = $params['width'];
+				}
+
+				if (!isset($params['crop_frame']['final_height'])) {
+					$params['crop_frame']['final_height'] = $params['height'];
+				}
+			}
+		}
+
+		return $params;
+	}
+
+	/**
+	 * Returns an array of dimensional properties (width, height, real_width, real_height) of a resulting clone image if and when generated
+	 * @param string $image_path
+	 * @param string $clone_path
+	 * @param array $params
+	 * @return array
+	 */
+	function calculate_image_size_dimensions($image, $size, $params = null, $skip_defaults = false)
+	{
+		$retval = FALSE;
+
+		// Get the image entity
+		if (is_numeric($image)) {
+			$image = $this->object->_image_mapper->find($image);
+		}
+
+		// Ensure we have a valid image
+		if ($image)
+		{
+			$params = $this->object->get_image_size_params($image, $size, $params, $skip_defaults);
+
+			// Get the image filename
+			$image_path = $this->object->get_original_abspath($image, 'original');
+			$clone_path = $this->object->get_image_abspath($image, $size);
+
+			$retval = $this->object->calculate_image_clone_dimensions($image_path, $clone_path, $params);
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Generates a specific size for an image
+	 * @param int|stdClass|C_Image $image
+	 * @return bool|object
+	 */
+	function generate_image_size($image, $size, $params = null, $skip_defaults = false)
+	{
+		$retval = FALSE;
+
+		// Get the image entity
+		if (is_numeric($image)) {
+			$image = $this->object->_image_mapper->find($image);
+		}
+
+		// Ensure we have a valid image
+		if ($image)
+		{
+			$params = $this->object->get_image_size_params($image, $size, $params, $skip_defaults);
+			$settings = C_NextGen_Settings::get_instance();
+
+			// Get the image filename
+			$filename = $this->object->get_original_abspath($image, 'original');
+			$thumbnail = null;
+
+			if ($size == 'full' && $settings->imgBackup == 1) {
+				// XXX change this? 'full' should be the resized path and 'original' the _backup path
+				$backup_path = $this->object->get_backup_abspath($image);
+
+				if (!@file_exists($backup_path))
+				{
+					@copy($filename, $backup_path);
+				}
+			}
+
+			// Generate the thumbnail using WordPress
+			$existing_image_abpath = $this->object->get_image_abspath($image, $size);
+			$existing_image_dir = dirname($existing_image_abpath);
+
+			// removing the old thumbnail is actually not needed as generate_image_clone() will replace it, leaving commented in as reminder in case there are issues in the future
+			if (@file_exists($existing_image_abpath)) {
+				//unlink($existing_image_abpath);
+			}
+
+			wp_mkdir_p($existing_image_dir);
+
+			$clone_path = $existing_image_abpath;
+			$thumbnail = $this->object->generate_image_clone($filename, $clone_path, $params);
+
+			// We successfully generated the thumbnail
+			if ($thumbnail != null)
+			{
+				$clone_path = $thumbnail->fileName;
+
+				if (function_exists('getimagesize'))
+				{
+					$dimensions = getimagesize($clone_path);
+				}
+				else
+				{
+					$dimensions = array($params['width'], $params['height']);
+				}
+
+				if (!isset($image->meta_data))
+				{
+					$image->meta_data = array();
+				}
+
+				$size_meta = array(
+					'width'		=> $dimensions[0],
+					'height'	=> $dimensions[1],
+					'filename'	=> basename($clone_path),
+					'generated'	=> microtime()
+				);
+
+				if (isset($params['crop_frame'])) {
+					$size_meta['crop_frame'] = $params['crop_frame'];
+				}
+
+				$image->meta_data[$size] = $size_meta;
+
+				if ($size == 'full')
+				{
+					$image->meta_data['width'] = $size_meta['width'];
+					$image->meta_data['height'] = $size_meta['height'];
+				}
+
+				$retval = $this->object->_image_mapper->save($image);
+
+				if ($retval == 0) {
+					$retval = false;
+				}
+
+				if ($retval) {
+					$retval = $thumbnail;
+				}
+			}
+			else {
+				// Something went wrong. Thumbnail generation failed!
+			}
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Generates a thumbnail for an image
+	 * @param int|stdClass|C_Image $image
+	 * @return bool
+	 */
+	function generate_thumbnail($image, $params = null, $skip_defaults = false)
+	{
+		$sized_image = $this->object->generate_image_size($image, 'thumbnail', $params, $skip_defaults);
+		$retval = false;
+		
+		if ($sized_image != null)
+		{
+			$retval = true;
+		
+			$sized_image->destruct();
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Outputs/renders an image
+	 * @param int|stdClass|C_NextGen_Gallery_Image $image
+	 * @return bool
+	 */
+	function render_image($image, $size=FALSE)
+	{
+		$format_list = $this->object->get_image_format_list();
+		$abspath = $this->get_image_abspath($image, $size, true);
+
+		if ($abspath == null)
+		{
+			$thumbnail = $this->object->generate_image_size($image, $size);
+
+			if ($thumbnail != null)
+			{
+				$abspath = $thumbnail->fileName;
+
+				$thumbnail->destruct();
+			}
+		}
+
+		if ($abspath != null)
+		{
+			$data = @getimagesize($abspath);
+			$format = 'jpg';
+
+			if ($data != null && is_array($data) && isset($format_list[$data[2]]))
+			{
+				$format = $format_list[$data[2]];
+			}
+
+			// Clear output
+			while (ob_get_level() > 0)
+			{
+				ob_end_clean();
+			}
+
+			$format = strtolower($format);
+
+			// output image and headers
+			header('Content-type: image/' . $format);
+			readfile($abspath);
+
+			return true;
+		}
+
+		return false;
+	}
+
+	function delete_image($image, $size=FALSE)
+	{
+		$retval = FALSE;
+
+		// Ensure that we have the image entity
+		if (is_numeric($image))
+            $image = $this->object->_image_mapper->find($image);
+
+		if ($image)
+        {
+			// Delete only a particular image size
+			if ($size)
+            {
+				$abspath = $this->object->get_image_abspath($image, $size);
+				if ($abspath && @file_exists($abspath))
+                    unlink($abspath);
+				if (isset($image->meta_data) && isset($image->meta_data[$size]))
+                {
+					unset($image->meta_data[$size]);
+					$this->object->_image_mapper->save($image);
+				}
+			}
+			// Delete all sizes of the image
+			else {
+				// Get the paths to fullsize and thumbnail files
+				$abspaths = array(
+                    $this->object->get_full_abspath($image),
+                    $this->object->get_thumb_abspath($image)
+                );
+
+				if (isset($image->meta_data))
+                {
+                    foreach (array_keys($image->meta_data) as $size) {
+                        $abspaths[] = $this->object->get_image_abspath($image, $size);
+                    }
+                }
+
+				// Delete each image
+				foreach ($abspaths as $abspath) {
+					if ($abspath && @file_exists($abspath))
+                    {
+                        unlink($abspath);
+                    }
+                }
+
+				// Delete the entity
+				$this->object->_image_mapper->destroy($image);
+			}
+			$retval = TRUE;
+		}
+
+		return $retval;
+	}
+
+    /**
+     * Copies (or moves) images into another gallery
+     *
+     * @param array $images
+     * @param int|object $gallery
+     * @param boolean $db optionally only copy the image files
+     * @param boolean $move move the image instead of copying
+     * @return mixed NULL on failure, array|image-ids on success
+     */
+    function copy_images($images, $gallery, $db = TRUE, $move = FALSE)
+    {
+        // return values
+        $message        = '';
+        $new_image_pids = array();
+
+        $settings = C_NextGen_Settings::get_instance();
+        $fs = $this->get_registry()->get_utility('I_Fs');
+
+        // move_images() is a wrapper to this function so we implement both features here
+        $func = $move ? 'rename' : 'copy';
+
+        // ngg-legacy allows for arrays of just the ID
+        if (!is_array($images))
+        {
+            $images = array($images);
+        }
+
+        // Ensure we have a valid gallery
+        $gallery_id = $this->object->_get_gallery_id($gallery);
+        if (!$gallery_id)
+        {
+            return;
+        }
+
+        $image_key = $this->object->_image_mapper->get_primary_key_column();
+
+        // Check for folder permission
+        if (!is_dir($gallery->path) && !wp_mkdir_p($gallery->path))
+        {
+            $message .= sprintf(__('Unable to create directory %s.', 'nggallery'), esc_html(WINABSPATH . $gallery->path));
+            return;
+        }
+        if (!is_writable(WINABSPATH . $gallery->path))
+        {
+            $message .= sprintf(__('Unable to write to directory %s. Is this directory writable by the server?', 'nggallery'), esc_html(WINABSPATH . $gallery->path));
+            return;
+        }
+
+        foreach ($images as $image) {
+
+            // Ensure that there is capacity available
+            if ((is_multisite()) && $settings->get('wpmuQuotaCheck'))
+            {
+                require_once(ABSPATH . 'wp-admin/includes/ms.php');
+                if (upload_is_user_over_quota(FALSE)) {
+                    $message .= sprintf(__('Sorry, you have used your space allocation. Please delete some files to upload more files.', 'nggallery'));
+                    throw new E_NoSpaceAvailableException();
+                }
+            }
+
+            // Copy the db entry
+            if (is_numeric($image))
+            {
+                $image = $this->object->_image_mapper->find($image);
+            }
+            $old_pid = $image->$image_key;
+
+            if ($db)
+            {
+                $new_image = clone $image;
+                unset($new_image->$image_key);
+                $new_image->galleryid = $gallery_id;
+                $new_pid = $this->object->_image_mapper->save($new_image);
+                $new_image = $this->object->_image_mapper->find($new_image);
+            } else {
+                $new_pid = $old_pid;
+            }
+
+            if (!$new_pid) {
+                $message .= sprintf(__('Failed to copy database row for picture %s', 'nggallery'), $old_pid) . '<br />';
+                continue;
+            }
+
+            $new_image_pids[] = $new_pid;
+
+            // Copy each image size
+            foreach ($this->object->get_image_sizes() as $size) {
+
+                $orig_path = $this->object->get_image_abspath($image, $size, TRUE);
+                if (!$orig_path)
+                {
+                    $message .= sprintf(__('Failed to get image path for %s', 'nggallery'), esc_html($image->filename)) . '<br/>';
+                    continue;
+                }
+
+                $new_path = basename($orig_path);
+
+                $prefix       = '';
+                $prefix_count = 0;
+                while (@file_exists($gallery->path . DIRECTORY_SEPARATOR . $new_path))
+                {
+                    $prefix = 'copy_' . ($prefix_count++) . '_';
+                    $new_path = $prefix . $new_path;
+                }
+                $new_path = $fs->join_paths($gallery->path, $new_path);
+
+                // Copy files
+                if (!@$func($orig_path, $new_path))
+                {
+                    $message .= sprintf(__('Failed to copy image %1$s to %2$s', 'nggallery'), esc_html($orig_path), esc_html($new_path)) . '<br/>';
+                    continue;
+                }
+                else {
+                    $message .= sprintf(__('Copied image %1$s to %2$s', 'nggallery'), esc_html($orig_path), esc_html($new_path)) . '<br/>';
+                }
+
+                // Copy backup file, if possible
+                @$func($orig_path . '_backup', $new_path . '_backup');
+
+                if ($prefix != '')
+                {
+                    $message .= sprintf(__('Image %1$s (%2$s) copied as image %3$s (%4$s) &raquo; The file already existed in the destination gallery.', 'nggallery'), $old_pid, esc_html($orig_path), $new_pid, esc_html($new_path)) . '<br />';
+                }
+                else
+                {
+                    $message .= sprintf(__('Image %1$s (%2$s) copied as image %3$s (%4$s)', 'nggallery'), $old_pid, esc_html($orig_path), $new_pid, esc_html($new_path)) . '<br />';
+                }
+
+                // Copy tags
+                if ($db)
+                {
+                    $tags = wp_get_object_terms($old_pid, 'ngg_tag', 'fields=ids');
+                    $tags = array_map('intval', $tags);
+                    wp_set_object_terms($new_pid, $tags, 'ngg_tag', true);
+                }
+            }
+        }
+
+        $message .= '<hr />' . sprintf(__('Copied %1$s picture(s) to gallery %2$s .', 'nggallery'), count($new_image_pids), $gallery->title);
+
+        return $new_image_pids;
+    }
+
+    /**
+     * Recover image from backup copy and reprocess it
+     *
+     * @param int|stdClass|C_Image $image
+     * @return string result code
+     */
+    function recover_image($image) {
+
+        if (is_numeric($image))
+        {
+            $image = $this->object->_image_mapper->find($image);
+        }
+
+        if (isset($image->meta_data))
+        {
+            $orig_metadata = $image->meta_data;
+        }
+
+        $path = $this->object->get_registry()->get_utility('I_Gallery_Storage')->get_image_abspath($image);
+
+        if (!is_object($image))
+        {
+            return __("Could not find image", 'nggallery');
+        }
+
+        if (!is_writable($path) && !is_writable(dirname($path)))
+        {
+            return ' <strong>' . esc_html($image->filename) . __(' is not writeable', 'nggallery') . '</strong>';
+        }
+
+        if (!@file_exists($path . '_backup'))
+        {
+            return ' <strong>' . __('Backup file does not exist', 'nggallery') . '</strong>';
+        }
+
+        if (!@copy($path . '_backup', $path))
+        {
+            return ' <strong>' . __("Could not restore original image", 'nggallery') . '</strong>';
+        }
+
+        if (isset($orig_metadata))
+        {
+            $NextGen_Metadata = new C_NextGen_Metadata($image);
+            $new_metadata = $NextGen_Metadata->get_common_meta();
+            $image->meta_data = array_merge((array)$orig_metadata, (array)$new_metadata);
+            $this->object->_image_mapper->save($image);
+        }
+
+        return '1';
+    }
+}
+
+class C_NggLegacy_GalleryStorage_Driver extends C_GalleryStorage_Driver_Base
+{
+	function define($context=FALSE)
+	{
+		parent::define($context);
+		$this->add_mixin('Mixin_NggLegacy_GalleryStorage_Driver');
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.ngglegacy_thumbnail.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.ngglegacy_thumbnail.php
new file mode 100644
index 0000000000000000000000000000000000000000..6caa17da6a3b547de88a0f83b34bd6f2524e2149
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.ngglegacy_thumbnail.php
@@ -0,0 +1,1030 @@
+<?php
+/**
+ * gd.thumbnail.inc.php
+ * 
+ * @author 		Ian Selby (ian@gen-x-design.com)
+ * @copyright 	Copyright 2006-2011
+ * @version 	1.3.0 (based on 1.1.3)
+ * @modded      by Alex Rabe
+ * 
+ */
+
+/**
+ * PHP class for dynamically resizing, cropping, and rotating images for thumbnail purposes and either displaying them on-the-fly or saving them.
+ *
+ */
+class C_NggLegacy_Thumbnail {
+    /**
+     * Error message to display, if any
+     *
+     * @var string
+     */
+    var $errmsg;
+    /**
+     * Whether or not there is an error
+     *
+     * @var boolean
+     */
+    var $error;
+    /**
+     * Format of the image file
+     *
+     * @var string
+     */
+    var $format;
+    /**
+     * File name and path of the image file
+     *
+     * @var string
+     */
+    var $fileName;
+    /**
+     * Current dimensions of working image
+     *
+     * @var array
+     */
+    var $currentDimensions;
+    /**
+     * New dimensions of working image
+     *
+     * @var array
+     */
+    var $newDimensions;
+    /**
+     * Image resource for newly manipulated image
+     *
+     * @var resource
+     * @access private
+     */
+    var $newImage;
+    /**
+     * Image resource for image before previous manipulation
+     *
+     * @var resource
+     * @access private
+     */
+    var $oldImage;
+    /**
+     * Image resource for image being currently manipulated
+     *
+     * @var resource
+     * @access private
+     */
+    var $workingImage;
+    /**
+     * Percentage to resize image by
+     *
+     * @var int
+     * @access private
+     */
+    var $percent;
+    /**
+     * Maximum width of image during resize
+     *
+     * @var int
+     * @access private
+     */
+    var $maxWidth;
+    /**
+     * Maximum height of image during resize
+     *
+     * @var int
+     * @access private
+     */
+    var $maxHeight;
+    /**
+     * Image for Watermark
+     *
+     * @var string
+     * 
+     */
+    var $watermarkImgPath;
+    /**
+     * Text for Watermark
+     *
+     * @var string
+     * 
+     */
+    var $watermarkText;
+    /**
+     * Image Resource ID for Watermark
+     *
+     * @var string
+     * 
+     */
+    function __construct($fileName,$no_ErrorImage = false) {
+        //make sure the GD library is installed
+    	if(!function_exists("gd_info")) {
+        	echo 'You do not have the GD Library installed.  This class requires the GD library to function properly.' . "\n";
+        	echo 'visit http://us2.php.net/manual/en/ref.image.php for more information';
+        	C_NextGEN_Bootstrap::shutdown();
+        }
+    	//initialize variables
+        $this->errmsg               = '';
+        $this->error                = false;
+        $this->currentDimensions    = array();
+        $this->newDimensions        = array();
+        $this->fileName             = $fileName;
+        $this->percent              = 100;
+        $this->maxWidth             = 0;
+        $this->maxHeight            = 0;
+        $this->watermarkImgPath		= '';
+        $this->watermarkText		= '';
+
+        //check to see if file exists
+        if(!@file_exists($this->fileName)) {
+            $this->errmsg = 'File not found';
+            $this->error = true;
+        }
+        //check to see if file is readable
+        elseif(!is_readable($this->fileName)) {
+            $this->errmsg = 'File is not readable';
+            $this->error = true;
+        }
+        
+        //if there are no errors, determine the file format
+        if($this->error == false) {
+    		$data = @getimagesize($this->fileName);
+    		if (isset($data) && is_array($data)) {
+    		  $extensions = array('1' => 'GIF', '2' => 'JPG', '3' => 'PNG');
+    		  $extension = array_key_exists($data[2], $extensions) ?  $extensions[$data[2]] : '';
+                if($extension) {
+                    $this->format = $extension;
+                } else {
+                    $this->errmsg = 'Unknown file format';
+                    $this->error = true;
+                }
+            } else {
+                $this->errmsg = 'File is not an image';
+                $this->error = true;
+            }
+        }
+        
+		// increase memory-limit if possible, GD needs this for large images
+		// @ini_set('memory_limit', '128M');
+        
+		if($this->error == false) { 
+        // Check memory consumption if file exists
+			$this->checkMemoryForImage($this->fileName);
+		}
+
+        //initialize resources if no errors
+        if($this->error == false) { 
+
+            switch($this->format) {            	
+                case 'GIF':
+                    $this->oldImage = @ImageCreateFromGif($this->fileName);
+                    break;
+                case 'JPG':
+                       $this->oldImage = @ImageCreateFromJpeg($this->fileName);
+                    break;
+                case 'PNG':
+                    $this->oldImage = @ImageCreateFromPng($this->fileName);
+					break;
+            }
+			if (!$this->oldImage) { 
+				$this->errmsg = 'Create Image failed. Check memory limit';
+		        $this->error = true;
+		    } else {
+	            $size = GetImageSize($this->fileName);
+    	        $this->currentDimensions = array('width'=>$size[0],'height'=>$size[1]);
+	            $this->newImage = $this->oldImage;
+	        }
+        }
+
+
+        if($this->error == true) {
+        	if(!$no_ErrorImage)
+            	$this->showErrorImage();
+            return;
+        }
+    }
+
+    /**
+     * Calculate the memory limit
+     *
+     */
+	function checkMemoryForImage( $filename ){
+		
+		if ( (function_exists('memory_get_usage')) && (ini_get('memory_limit')) ) {
+			$imageInfo = getimagesize($filename);
+			switch($this->format) {            	
+                case 'GIF':
+                	// measured factor 1 is better
+                    $CHANNEL = 1;
+                    break;
+                case 'JPG':
+                    $CHANNEL = $imageInfo['channels'];
+                    break;
+                case 'PNG':
+					// didn't get the channel for png
+                    $CHANNEL = 3;
+					break;
+            }
+		    $MB = 1048576;  // number of bytes in 1M
+		    $K64 = 65536;    // number of bytes in 64K
+		    $TWEAKFACTOR = 1.68;  // Or whatever works for you
+		    $memoryNeeded = round( ( $imageInfo[0] * $imageInfo[1]
+		                                           * $imageInfo['bits']
+		                                           * $CHANNEL / 8
+		                             + $K64
+		                           ) * $TWEAKFACTOR
+		                         );
+		    $memoryNeeded = memory_get_usage() + $memoryNeeded;
+			// get memory limit
+			$memory_limit = ini_get('memory_limit');
+            
+            // PHP docs : Note that to have no memory limit, set this directive to -1.
+            if ($memory_limit == -1 ) return;
+            
+            // Just check megabyte limits, not higher
+            if ( strtolower(substr($memory_limit, -1)) == 'm' ) {
+                
+    			if ($memory_limit != '') {
+    				$memory_limit = substr($memory_limit, 0, -1) * 1024 * 1024;
+    			}
+    			
+    			if ($memoryNeeded > $memory_limit) {
+    				$memoryNeeded = round ($memoryNeeded / 1024 / 1024, 2);
+    				$this->errmsg = 'Exceed Memory limit. Require : '.$memoryNeeded. " MByte" ;
+    		        $this->error = true;
+    	        }
+            }
+		}
+	    return;
+	}
+	
+	   function __destruct() {
+	   	$this->destruct();
+	   }
+
+    /**
+     * Must be called to free up allocated memory after all manipulations are done
+     *
+     */
+    function destruct() {
+        if(is_resource($this->newImage)) @ImageDestroy($this->newImage);
+        if(is_resource($this->oldImage)) @ImageDestroy($this->oldImage);
+        if(is_resource($this->workingImage)) @ImageDestroy($this->workingImage);
+    }
+
+    /**
+     * Returns the current width of the image
+     *
+     * @return int
+     */
+    function getCurrentWidth() {
+        return $this->currentDimensions['width'];
+    }
+
+    /**
+     * Returns the current height of the image
+     *
+     * @return int
+     */
+    function getCurrentHeight() {
+        return $this->currentDimensions['height'];
+    }
+
+    /**
+     * Calculates new image width
+     *
+     * @param int $width
+     * @param int $height
+     * @return array
+     */
+    function calcWidth($width,$height) {
+        $newWp = (100 * $this->maxWidth) / $width;
+        $newHeight = ($height * $newWp) / 100;
+        
+        if (intval($newHeight) == $this->maxHeight - 1)
+        	$newHeight = $this->maxHeight;
+        	
+        return array('newWidth'=>intval($this->maxWidth),'newHeight'=>intval($newHeight));
+    }
+
+    /**
+     * Calculates new image height
+     *
+     * @param int $width
+     * @param int $height
+     * @return array
+     */
+    function calcHeight($width,$height) {
+        $newHp = (100 * $this->maxHeight) / $height;
+        $newWidth = ($width * $newHp) / 100;
+        
+        if (intval($newWidth) == $this->maxWidth - 1)
+        	$newWidth = $this->maxWidth;
+        	
+        return array('newWidth'=>intval($newWidth),'newHeight'=>intval($this->maxHeight));
+    }
+
+    /**
+     * Calculates new image size based on percentage
+     *
+     * @param int $width
+     * @param int $height
+     * @return array
+     */
+    function calcPercent($width,$height) {
+        $newWidth = ($width * $this->percent) / 100;
+        $newHeight = ($height * $this->percent) / 100;
+        return array('newWidth'=>intval($newWidth),'newHeight'=>intval($newHeight));
+    }
+
+    /**
+     * Calculates new image size based on width and height, while constraining to maxWidth and maxHeight
+     *
+     * @param int $width
+     * @param int $height
+     */
+    function calcImageSize($width,$height) {
+        $newSize = array('newWidth'=>$width,'newHeight'=>$height);
+
+        if($this->maxWidth > 0) {
+
+            $newSize = $this->calcWidth($width,$height);
+
+            if($this->maxHeight > 0 && $newSize['newHeight'] > $this->maxHeight) {
+                $newSize = $this->calcHeight($newSize['newWidth'],$newSize['newHeight']);
+            }
+
+            //$this->newDimensions = $newSize;
+        }
+
+        if($this->maxHeight > 0) {
+            $newSize = $this->calcHeight($width,$height);
+
+            if($this->maxWidth > 0 && $newSize['newWidth'] > $this->maxWidth) {
+                $newSize = $this->calcWidth($newSize['newWidth'],$newSize['newHeight']);
+            }
+
+            //$this->newDimensions = $newSize;
+        }
+
+        $this->newDimensions = $newSize;
+    }
+
+    /**
+     * Calculates new image size based percentage
+     *
+     * @param int $width
+     * @param int $height
+     */
+    function calcImageSizePercent($width,$height) {
+        if($this->percent > 0) {
+            $this->newDimensions = $this->calcPercent($width,$height);
+        }
+    }
+
+    /**
+     * Displays error image
+     *
+     */
+    function showErrorImage() {
+        header('Content-type: image/png');
+        $errImg = ImageCreate(220,25);
+        $bgColor = imagecolorallocate($errImg,0,0,0);
+        $fgColor1 = imagecolorallocate($errImg,255,255,255);
+        $fgColor2 = imagecolorallocate($errImg,255,0,0);
+        imagestring($errImg,3,6,6,'Error:',$fgColor2);
+        imagestring($errImg,3,55,6,$this->errmsg,$fgColor1);
+        imagepng($errImg);
+        imagedestroy($errImg);
+    }
+
+    /**
+     * Resizes image to fixed Width x Height
+     * 
+     * @param int $Width
+     * @param int $Height
+     */
+    function resizeFix($Width = 0, $Height = 0, $deprecated = 3) {
+        $this->newWidth = $Width;
+        $this->newHeight = $Height;
+
+		if(function_exists("ImageCreateTrueColor")) {
+			$this->workingImage = ImageCreateTrueColor($this->newWidth,$this->newHeight);
+		}
+		else {
+			$this->workingImage = ImageCreate($this->newWidth,$this->newHeight);
+		}
+
+//		ImageCopyResampled(
+		$this->imagecopyresampled(
+			$this->workingImage,
+			$this->oldImage,
+			0,
+			0,
+			0,
+			0,
+			$this->newWidth,
+			$this->newHeight,
+			$this->currentDimensions['width'],
+			$this->currentDimensions['height']
+		);
+
+		$this->oldImage = $this->workingImage;
+		$this->newImage = $this->workingImage;
+		$this->currentDimensions['width'] = $this->newWidth;
+		$this->currentDimensions['height'] = $this->newHeight;
+	}
+
+
+    /**
+     * Resizes image to maxWidth x maxHeight
+     *
+     * @param int $maxWidth
+     * @param int $maxHeight
+     */
+    function resize($maxWidth = 0, $maxHeight = 0, $deprecated = 3) {
+        $this->maxWidth = $maxWidth;
+        $this->maxHeight = $maxHeight;
+
+        $this->calcImageSize($this->currentDimensions['width'],$this->currentDimensions['height']);
+
+		if(function_exists("ImageCreateTrueColor")) {
+			$this->workingImage = ImageCreateTrueColor($this->newDimensions['newWidth'],$this->newDimensions['newHeight']);
+		}
+		else {
+			$this->workingImage = ImageCreate($this->newDimensions['newWidth'],$this->newDimensions['newHeight']);
+		}
+
+//		ImageCopyResampled(
+		$this->imagecopyresampled(
+			$this->workingImage,
+			$this->oldImage,
+			0,
+			0,
+			0,
+			0,
+			$this->newDimensions['newWidth'],
+			$this->newDimensions['newHeight'],
+			$this->currentDimensions['width'],
+			$this->currentDimensions['height']
+		);
+
+		$this->oldImage = $this->workingImage;
+		$this->newImage = $this->workingImage;
+		$this->currentDimensions['width'] = $this->newDimensions['newWidth'];
+		$this->currentDimensions['height'] = $this->newDimensions['newHeight'];
+	}
+
+	/**
+	 * Resizes the image by $percent percent
+	 *
+	 * @param int $percent
+	 */
+	function resizePercent($percent = 0) {
+	    $this->percent = $percent;
+
+	    $this->calcImageSizePercent($this->currentDimensions['width'],$this->currentDimensions['height']);
+
+		if(function_exists("ImageCreateTrueColor")) {
+			$this->workingImage = ImageCreateTrueColor($this->newDimensions['newWidth'],$this->newDimensions['newHeight']);
+		}
+		else {
+			$this->workingImage = ImageCreate($this->newDimensions['newWidth'],$this->newDimensions['newHeight']);
+		}
+
+		$this->ImageCopyResampled(
+			$this->workingImage,
+			$this->oldImage,
+			0,
+			0,
+			0,
+			0,
+			$this->newDimensions['newWidth'],
+			$this->newDimensions['newHeight'],
+			$this->currentDimensions['width'],
+			$this->currentDimensions['height']
+		);
+
+		$this->oldImage = $this->workingImage;
+		$this->newImage = $this->workingImage;
+		$this->currentDimensions['width'] = $this->newDimensions['newWidth'];
+		$this->currentDimensions['height'] = $this->newDimensions['newHeight'];
+	}
+
+	/**
+	 * Crops the image from calculated center in a square of $cropSize pixels
+	 *
+	 * @param int $cropSize
+	 */
+	function cropFromCenter($cropSize) {
+	    if($cropSize > $this->currentDimensions['width']) $cropSize = $this->currentDimensions['width'];
+	    if($cropSize > $this->currentDimensions['height']) $cropSize = $this->currentDimensions['height'];
+
+	    $cropX = intval(($this->currentDimensions['width'] - $cropSize) / 2);
+	    $cropY = intval(($this->currentDimensions['height'] - $cropSize) / 2);
+
+	    if(function_exists("ImageCreateTrueColor")) {
+			$this->workingImage = ImageCreateTrueColor($cropSize,$cropSize);
+		}
+		else {
+			$this->workingImage = ImageCreate($cropSize,$cropSize);
+		}
+
+		$this->imagecopyresampled(
+            $this->workingImage,
+            $this->oldImage,
+            0,
+            0,
+            $cropX,
+            $cropY,
+            $cropSize,
+            $cropSize,
+            $cropSize,
+            $cropSize
+		);
+
+		$this->oldImage = $this->workingImage;
+		$this->newImage = $this->workingImage;
+		$this->currentDimensions['width'] = $cropSize;
+		$this->currentDimensions['height'] = $cropSize;
+	}
+
+	/**
+	 * Advanced cropping function that crops an image using $startX and $startY as the upper-left hand corner.
+	 *
+	 * @param int $startX
+	 * @param int $startY
+	 * @param int $width
+	 * @param int $height
+	 */
+	function crop($startX, $startY, $width, $height) {
+	    //make sure the cropped area is not greater than the size of the image
+	    if($width > $this->currentDimensions['width']) $width = $this->currentDimensions['width'];
+	    if($height > $this->currentDimensions['height']) $height = $this->currentDimensions['height'];
+	    //make sure not starting outside the image
+	    if(($startX + $width) > $this->currentDimensions['width']) $startX = ($this->currentDimensions['width'] - $width);
+	    if(($startY + $height) > $this->currentDimensions['height']) $startY = ($this->currentDimensions['height'] - $height);
+	    if($startX < 0) $startX = 0;
+	    if($startY < 0) $startY = 0;
+
+	    if(function_exists("ImageCreateTrueColor")) {
+			$this->workingImage = ImageCreateTrueColor($width,$height);
+		}
+		else {
+			$this->workingImage = ImageCreate($width,$height);
+		}
+
+		$this->imagecopyresampled(
+            $this->workingImage,
+            $this->oldImage,
+            0,
+            0,
+            $startX,
+            $startY,
+            $width,
+            $height,
+            $width,
+            $height
+		);
+
+		$this->oldImage = $this->workingImage;
+		$this->newImage = $this->workingImage;
+		$this->currentDimensions['width'] = $width;
+		$this->currentDimensions['height'] = $height;
+	}
+
+	/**
+	 * Outputs the image to the screen, or saves to $name if supplied.  Quality of JPEG images can be controlled with the $quality variable
+	 *
+	 * @param int $quality
+	 * @param string $name
+	 */
+	function show($quality=100,$name = '') {
+	    switch($this->format) {
+	        case 'GIF':
+	            if($name != '') {
+	               @ImageGif($this->newImage,$name) or $this->error = true;
+	            }
+	            else {
+	               header('Content-type: image/gif');
+	               ImageGif($this->newImage);
+	            }
+	            break;
+	        case 'JPG':
+	            if($name != '') {
+	               @ImageJpeg($this->newImage,$name,$quality) or $this->error = true;
+	            }
+	            else {
+	               header('Content-type: image/jpeg');
+	               ImageJpeg($this->newImage,NULL,$quality);
+	            }
+	            break;
+	        case 'PNG':
+	            if($name != '') {
+	            	@ImagePng($this->newImage,$name) or $this->error = true;
+	            }
+	            else {
+	               header('Content-type: image/png');
+	               ImagePng($this->newImage);
+	            }
+	            break;
+	    }
+	}
+
+	/**
+	 * Saves image as $name (can include file path), with quality of # percent if file is a jpeg
+	 *
+	 * @param string $name
+	 * @param int $quality
+	 * @return bool errorstate
+	 */
+	function save($name,$quality=100) {
+	    $this->show($quality,$name);
+	    if ($this->error == true) {
+	    	$this->errmsg = 'Create Image failed. Check safe mode settings';
+	    	return false;
+	    }
+        
+        if( function_exists('do_action') )
+	       do_action('ngg_ajax_image_save', $name);
+
+	    return true;
+	}
+
+	/**
+	 * Creates Apple-style reflection under image, optionally adding a border to main image
+	 *
+	 * @param int $percent
+	 * @param int $reflection
+	 * @param int $white
+	 * @param bool $border
+	 * @param string $borderColor
+	 */
+	function createReflection($percent,$reflection,$white,$border = true,$borderColor = '#a4a4a4') {
+        $width = $this->currentDimensions['width'];
+        $height = $this->currentDimensions['height'];
+
+        $reflectionHeight = intval($height * ($reflection / 100));
+        $newHeight = $height + $reflectionHeight;
+        $reflectedPart = $height * ($percent / 100);
+
+        $this->workingImage = ImageCreateTrueColor($width,$newHeight);
+
+        ImageAlphaBlending($this->workingImage,true);
+
+        $colorToPaint = ImageColorAllocateAlpha($this->workingImage,255,255,255,0);
+        ImageFilledRectangle($this->workingImage,0,0,$width,$newHeight,$colorToPaint);
+
+        imagecopyresampled(
+                            $this->workingImage,
+                            $this->newImage,
+                            0,
+                            0,
+                            0,
+                            $reflectedPart,
+                            $width,
+                            $reflectionHeight,
+                            $width,
+                            ($height - $reflectedPart));
+        $this->imageFlipVertical();
+
+        imagecopy($this->workingImage,$this->newImage,0,0,0,0,$width,$height);
+
+        imagealphablending($this->workingImage,true);
+
+        for($i=0;$i<$reflectionHeight;$i++) {
+            $colorToPaint = imagecolorallocatealpha($this->workingImage,255,255,255,($i/$reflectionHeight*-1+1)*$white);
+            imagefilledrectangle($this->workingImage,0,$height+$i,$width,$height+$i,$colorToPaint);
+        }
+
+        if($border == true) {
+            $rgb = $this->hex2rgb($borderColor,false);
+            $colorToPaint = imagecolorallocate($this->workingImage,$rgb[0],$rgb[1],$rgb[2]);
+            imageline($this->workingImage,0,0,$width,0,$colorToPaint); //top line
+            imageline($this->workingImage,0,$height,$width,$height,$colorToPaint); //bottom line
+            imageline($this->workingImage,0,0,0,$height,$colorToPaint); //left line
+            imageline($this->workingImage,$width-1,0,$width-1,$height,$colorToPaint); //right line
+        }
+
+        $this->oldImage = $this->workingImage;
+		$this->newImage = $this->workingImage;
+		$this->currentDimensions['width'] = $width;
+		$this->currentDimensions['height'] = $newHeight;
+	}
+
+	/**
+	 * Flip an image.
+	 *
+	 * @param bool $horz flip the image in horizontal mode
+	 * @param bool $vert flip the image in vertical mode
+	 */
+	function flipImage( $horz = false, $vert = false ) {
+		
+		$sx = $vert ? ($this->currentDimensions['width'] - 1) : 0;
+		$sy = $horz ? ($this->currentDimensions['height'] - 1) : 0;
+		$sw = $vert ? -$this->currentDimensions['width'] : $this->currentDimensions['width'];
+		$sh = $horz ? -$this->currentDimensions['height'] : $this->currentDimensions['height'];
+		
+		$this->workingImage = imagecreatetruecolor( $this->currentDimensions['width'], $this->currentDimensions['height'] ); 
+		
+		$this->imagecopyresampled($this->workingImage, $this->oldImage, 0, 0, $sx, $sy, $this->currentDimensions['width'], $this->currentDimensions['height'], $sw, $sh) ;
+		$this->oldImage = $this->workingImage;
+		$this->newImage = $this->workingImage;
+		
+		return true;
+	}
+	
+	/**
+	 * Rotate an image clockwise or counter clockwise
+	 *
+	 * @param string $direction could be CW or CCW
+	 */
+	function rotateImage( $dir = 'CW' ) {
+		$angle = ($dir == 'CW') ? 90 : -90;
+		
+		return $this->rotateImageAngle($angle);
+	}
+		
+	/**
+	 * Rotate an image clockwise or counter clockwise
+	 *
+	 * @param string $direction could be CW or CCW
+	 */
+	function rotateImageAngle( $angle = 90 ) {
+		
+		if ( function_exists('imagerotate') ) {
+	        $this->workingImage = imagerotate($this->oldImage, 360 - $angle, 0); // imagerotate() rotates CCW 
+	        $this->currentDimensions['width']  = imagesx($this->workingImage);
+	    	$this->currentDimensions['height'] = imagesy($this->workingImage);
+    	    $this->oldImage = $this->workingImage;
+			$this->newImage = $this->workingImage;
+			return true;
+		}
+		
+		$this->workingImage = imagecreatetruecolor( $this->currentDimensions['height'], $this->currentDimensions['width'] ); 
+		
+	    imagealphablending($this->workingImage, false); 
+	    imagesavealpha($this->workingImage, true); 
+
+		switch ($angle) {
+			
+			case 90 :
+				for( $x = 0; $x < $this->currentDimensions['width']; $x++ ) { 
+	   	            for( $y = 0; $y < $this->currentDimensions['height']; $y++ ) { 
+	  	                if ( !imagecopy($this->workingImage, $this->oldImage, $this->currentDimensions['height'] - $y - 1, $x, $x, $y, 1, 1) ) 
+	  	                    return false; 
+	 	            } 
+	  	        } 
+			break;
+			
+			case -90 :
+				for( $x = 0; $x < $this->currentDimensions['width']; $x++ ) { 
+	 	            for( $y = 0; $y < $this->currentDimensions['height']; $y++ ) { 
+	 	                if ( !imagecopy($this->workingImage, $this->oldImage, $y, $this->currentDimensions['width'] - $x - 1, $x, $y, 1, 1) ) 
+	 	                    return false; 
+	 	            } 
+	 	        } 
+			break;
+						
+			default : 
+				return false;
+		}
+
+		$this->currentDimensions['width']  = imagesx($this->workingImage);
+	    $this->currentDimensions['height'] = imagesy($this->workingImage);			
+	    $this->oldImage = $this->workingImage;
+		$this->newImage = $this->workingImage;
+		
+	    return true;
+		
+	}	
+
+	/**
+	 * Inverts working image, used by reflection function
+	 * 
+	 * @access	private
+	 */
+	function imageFlipVertical() {
+	    $x_i = imagesx($this->workingImage);
+	    $y_i = imagesy($this->workingImage);
+
+	    for($x = 0; $x < $x_i; $x++) {
+	        for($y = 0; $y < $y_i; $y++) {
+	            imagecopy($this->workingImage,$this->workingImage,$x,$y_i - $y - 1, $x, $y, 1, 1);
+	        }
+	    }
+	}
+
+	/**
+	 * Converts hexidecimal color value to rgb values and returns as array/string
+	 *
+	 * @param string $hex
+	 * @param bool $asString
+	 * @return array|string
+	 */
+	function hex2rgb($hex, $asString = false) {
+        // strip off any leading #
+        if (0 === strpos($hex, '#')) {
+           $hex = substr($hex, 1);
+        } else if (0 === strpos($hex, '&H')) {
+           $hex = substr($hex, 2);
+        }
+
+        // break into hex 3-tuple
+        $cutpoint = ceil(strlen($hex) / 2)-1;
+        $rgb = explode(':', wordwrap($hex, $cutpoint, ':', $cutpoint), 3);
+
+        // convert each tuple to decimal
+        $rgb[0] = (isset($rgb[0]) ? hexdec($rgb[0]) : 0);
+        $rgb[1] = (isset($rgb[1]) ? hexdec($rgb[1]) : 0);
+        $rgb[2] = (isset($rgb[2]) ? hexdec($rgb[2]) : 0);
+
+        return ($asString ? "{$rgb[0]} {$rgb[1]} {$rgb[2]}" : $rgb);
+    }
+    
+	/**
+     * Based on the Watermark function by Marek Malcherek  
+     * http://www.malcherek.de
+     *
+ 	 * @param string $color
+	 * @param string $wmFont
+	 * @param int $wmSize
+ 	 * @param int $wmOpaque
+     */
+	function watermarkCreateText($color = '000000', $wmFont, $wmSize = 10, $wmOpaque = 90)
+    {
+		// set font path
+		$wmFontPath = NGGALLERY_ABSPATH . "fonts/" . $wmFont;
+		if (!is_readable($wmFontPath))
+			return;	
+			
+		// This function requires both the GD library and the FreeType library. 
+		if (!function_exists('ImageTTFBBox'))
+			return;
+
+        $words = preg_split('/ /', $this->watermarkText);
+        $lines = array();
+        $line = '';
+        $watermark_image_width = 0;
+
+        // attempt adding a new word until the width is too large; then start a new line and start again
+        foreach ($words as $word) {
+            // sanitize the text being input; imagettftext() can be sensitive
+            $TextSize = $this->ImageTTFBBoxDimensions(
+                $wmSize,
+                0,
+                $wmFontPath,
+                $line . preg_replace(
+                    '~^(&([a-zA-Z0-9]);)~',
+                    htmlentities('${1}'),
+                    mb_convert_encoding($word, "HTML-ENTITIES", "UTF-8")
+                )
+            );
+
+            if ($watermark_image_width == 0)
+                $watermark_image_width = $TextSize['width'];
+
+            if ($TextSize['width'] > $this->newDimensions['newWidth']) {
+                $lines[] = trim($line);
+                $line = '';
+            }
+            else {
+                if ($TextSize['width'] > $watermark_image_width)
+                    $watermark_image_width = $TextSize['width'];
+            }
+            $line .= $word . ' ';
+        }
+        $lines[] = trim($line);
+
+        // use this string to determine our largest possible line height
+        $line_dimensions = $this->ImageTTFBBoxDimensions($wmSize, 0, $wmFontPath, 'MXQJALYmxqjabdfghjklpqry019`@$^&*(,!132');
+        $line_height = $line_dimensions['height'] * 1.05;
+
+		// Create an image to apply our text to
+		$this->workingImage = ImageCreateTrueColor($watermark_image_width, count($lines) * $line_height);
+		ImageSaveAlpha($this->workingImage, true);
+		ImageAlphaBlending($this->workingImage, false);
+		$bgText = imagecolorallocatealpha($this->workingImage, 255, 255, 255, 127);
+		imagefill($this->workingImage, 0, 0, $bgText);
+		$wmTransp = 127 - ($wmOpaque * 1.27);
+		$rgb = $this->hex2rgb($color, false);
+		$TextColor = imagecolorallocatealpha($this->workingImage, $rgb[0], $rgb[1], $rgb[2], $wmTransp);
+
+		// Put text on the image, line-by-line
+        $y_pos = $wmSize;
+        foreach ($lines as $line) {
+            imagettftext($this->workingImage, $wmSize, 0, 0, $y_pos, $TextColor, $wmFontPath, $line);
+            $y_pos += $line_height;
+        }
+
+		$this->watermarkImgPath = $this->workingImage;
+
+		return;		
+	}
+
+    /**
+     * Calculates the width & height dimensions of ImageTTFBBox().
+     *
+     * Note: ImageTTFBBox() is unreliable with large font sizes
+     * @param $wmSize
+     * @param $fontAngle
+     * @param $wmFontPath
+     * @param $text
+     * @return array
+     */
+    function ImageTTFBBoxDimensions($wmSize, $fontAngle, $wmFontPath, $text)
+    {
+        $box = @ImageTTFBBox($wmSize, $fontAngle, $wmFontPath, $text) or die;
+        $max_x = max(array($box[0], $box[2], $box[4], $box[6]));
+        $max_y = max(array($box[1], $box[3], $box[5], $box[7]));
+        $min_x = min(array($box[0], $box[2], $box[4], $box[6]));
+        $min_y = min(array($box[1], $box[3], $box[5], $box[7]));
+        return array(
+            "width"  => ($max_x - $min_x),
+            "height" => ($max_y - $min_y)
+        );
+    }
+    
+    /**
+     * Modfied Watermark function by Steve Peart 
+     * http://parasitehosting.com/
+     *
+ 	 * @param string $relPOS
+	 * @param int $xPOS
+ 	 * @param int $yPOS
+     */
+    function watermarkImage( $relPOS = 'botRight', $xPOS = 0, $yPOS = 0) {
+    	
+		// if it's a resource ID take it as watermark text image
+    	if(is_resource($this->watermarkImgPath)) {
+    		$this->workingImage = $this->watermarkImgPath;
+    	} else {
+		// Would you really want to use anything other than a png? 
+		$this->workingImage = @imagecreatefrompng($this->watermarkImgPath);
+		// if it's not a valid file die...
+		if (empty($this->workingImage) or (!$this->workingImage))
+			return;
+		}
+		
+		imagealphablending($this->workingImage, false);
+		imagesavealpha($this->workingImage, true);
+		$sourcefile_width=imageSX($this->oldImage);
+		$sourcefile_height=imageSY($this->oldImage);
+		$watermarkfile_width=imageSX($this->workingImage);
+		$watermarkfile_height=imageSY($this->workingImage);
+
+		switch(substr($relPOS, 0, 3)){
+			case 'top': $dest_y = 0 + $yPOS; break;
+			case 'mid': $dest_y = ($sourcefile_height / 2) - ($watermarkfile_height / 2); break;
+			case 'bot': $dest_y = $sourcefile_height - $watermarkfile_height - $yPOS; break;
+			default   : $dest_y = 0; break;
+		}
+		switch(substr($relPOS, 3)){
+			case 'Left'	:	$dest_x = 0 + $xPOS; break;
+			case 'Center':	$dest_x = ($sourcefile_width / 2) - ($watermarkfile_width / 2); break;
+			case 'Right':	$dest_x = $sourcefile_width - $watermarkfile_width - $xPOS; break;
+			default : 		$dest_x = 0; break;
+		}
+		
+		// debug	
+		// $this->errmsg = 'X '.$dest_x.' Y '.$dest_y;
+		// $this->showErrorImage();
+
+		// if a gif, we have to upsample it to a truecolor image
+		if($this->format == 'GIF') {
+			$tempimage = imagecreatetruecolor($sourcefile_width,$sourcefile_height);
+			imagecopy($tempimage, $this->oldImage, 0, 0, 0, 0,$sourcefile_width, $sourcefile_height);
+			$this->newImage = $tempimage;
+		}
+		
+		imagecopy($this->newImage, $this->workingImage, $dest_x, $dest_y, 0, 0,$watermarkfile_width, $watermarkfile_height);
+	}
+	
+    /**
+     * Modfied imagecopyresampled function to save transparent images
+     * See : http://www.akemapa.com/2008/07/10/php-gd-resize-transparent-image-png-gif/
+     * @since 1.9.0
+     * 
+     * @param resource $dst_image
+     * @param resource $src_image
+     * @param int $dst_x
+     * @param int $dst_y
+     * @param int $src_x
+     * @param int $src_y
+     * @param int $dst_w
+     * @param int $dst_h
+     * @param int $src_w
+     * @param int $src_h
+     * @return bool
+     */
+    function imagecopyresampled( &$dst_image , $src_image , $dst_x , $dst_y , $src_x , $src_y , $dst_w , $dst_h , $src_w , $src_h) {
+        
+        // Check if this image is PNG or GIF, then set if Transparent  
+        if( $this->format == 'GIF' || $this->format == 'PNG'){
+            imagealphablending($dst_image, false);
+            imagesavealpha($dst_image, true);
+            $transparent = imagecolorallocatealpha($dst_image, 255, 255, 255, 127);
+            imagefilledrectangle($dst_image, 0, 0, $dst_w, $dst_h, $transparent);
+        }
+        
+        imagecopyresampled($dst_image , $src_image , $dst_x , $dst_y , $src_x , $src_y , $dst_w , $dst_h , $src_w , $src_h);
+        return true;         
+    }
+}
+?>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.wordpress_gallerystorage_driver.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.wordpress_gallerystorage_driver.php
new file mode 100644
index 0000000000000000000000000000000000000000..1dc36f6c78918f7fd505e4f6f892a9dd2c893a3e
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.wordpress_gallerystorage_driver.php
@@ -0,0 +1,92 @@
+<?php
+
+class Mixin_WordPress_GalleryStorage_Driver extends Mixin
+{
+	/**
+	 * Returns the named sizes available for images
+	 * @global array $_wp_additional_image_sizese
+	 * @return array
+	 */
+	function get_image_sizes()
+	{
+		global $_wp_additional_image_sizes;
+		$_wp_additional_image_sizes[] = 'full';
+		return $_wp_additional_image_sizes;
+	}
+
+
+	/**
+	 * Gets the upload path for new images in this gallery
+	 * This will always be the date-based directory
+	 * @param type $gallery
+	 * @return type
+	 */
+	function get_upload_abspath($gallery=FALSE)
+	{
+		// Gallery is used for this driver, as the upload path is
+		// the same, regardless of what gallery is used
+
+		$retval = FALSE;
+
+		$dir = wp_upload_dir(time());
+		if ($dir) $retval = $dir['path'];
+
+		return $retval;
+	}
+
+
+	/**
+	 * Will always return the same as get_upload_abspath(), as
+	 * WordPress storage is not organized by gallery but by date
+	 * @param int|object $gallery
+	 */
+	function get_gallery_abspath($gallery=FALSE)
+	{
+		return $this->object->get_upload_abspath();
+	}
+
+
+	/**
+	 * Gets the absolute path to a particular size of an image
+	 * @param int|object $image
+	 * @param string $size
+	 * @return string
+	 */
+	function get_image_abspath($image, $size='full')
+	{
+		return str_replace(
+			$this->get_registry()->get_utility('I_Router')->get_base_url(TRUE),
+			ABSPATH,
+			$this->object->get_image_abspath($image, $size)
+		);
+	}
+
+
+	/**
+	 * Gets the url of a particular sized image
+	 * @param int|object $image
+	 * @param type $size
+	 * @return string
+	 */
+	function get_image_url($image=FALSE, $size='full')
+	{
+		$retval = NULL;
+        $image_key = $this->get_registry()->get_utility('I_Displayed_Gallery_Mapper')->get_primary_key_column();
+
+		if ($image && (($image_id = $this->object->_get_image_id($image)))) {
+			$parts = wp_get_attachment_image_src($image->$image_key);
+			if ($parts) $retval = $parts['url'];
+		}
+
+		return $retval;
+	}
+}
+
+class C_WordPress_GalleryStorage_Driver extends C_GalleryStorage_Driver_Base
+{
+	function define($context=FALSE)
+	{
+		parent::define($context);
+		$this->add_mixin('Mixin_WordPress_GalleryStorage_Driver');
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/interface.album.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/interface.album.php
new file mode 100644
index 0000000000000000000000000000000000000000..72dd53de3e360e7823d46bf93a9c29e5f5f767f2
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/interface.album.php
@@ -0,0 +1,6 @@
+<?php
+
+class I_Album
+{
+
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/interface.album_mapper.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/interface.album_mapper.php
new file mode 100644
index 0000000000000000000000000000000000000000..046a31b8ae7927ee69306b566a9c6bfe8b1f473d
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/interface.album_mapper.php
@@ -0,0 +1,6 @@
+<?php
+
+interface I_Album_Mapper
+{
+	
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/interface.component_config.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/interface.component_config.php
new file mode 100644
index 0000000000000000000000000000000000000000..cef644569a7343bc18853a0d80ff6895d67881d1
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/interface.component_config.php
@@ -0,0 +1,10 @@
+<?php
+
+interface I_Component_Config
+{
+    function save();
+    
+    function delete();
+    
+    function is_valid();
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/interface.gallery.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/interface.gallery.php
new file mode 100644
index 0000000000000000000000000000000000000000..9aac58b81e5d48e00b0c6e22d54accff04ffdc01
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/interface.gallery.php
@@ -0,0 +1,5 @@
+<?php
+
+interface I_Gallery
+{   
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/interface.gallery_mapper.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/interface.gallery_mapper.php
new file mode 100644
index 0000000000000000000000000000000000000000..5f0312ad4e0b9055eb911f7db713abd68e06c332
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/interface.gallery_mapper.php
@@ -0,0 +1,6 @@
+<?php
+
+interface I_Gallery_Mapper
+{
+    static function get_instance($context = False);
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/interface.gallery_storage.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/interface.gallery_storage.php
new file mode 100644
index 0000000000000000000000000000000000000000..0c36505c173fc3b619fad57de4c693d5b0140e0d
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/interface.gallery_storage.php
@@ -0,0 +1,6 @@
+<?php
+
+interface I_Gallery_Storage
+{
+	static function get_instance($context = False);
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/interface.gallery_type.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/interface.gallery_type.php
new file mode 100644
index 0000000000000000000000000000000000000000..86a58a3a4956c5eebd2800dad2bc1b98b743f1f9
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/interface.gallery_type.php
@@ -0,0 +1,5 @@
+<?php
+
+interface I_Gallery_Type extends I_Component_Config
+{
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/interface.gallerystorage_driver.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/interface.gallerystorage_driver.php
new file mode 100644
index 0000000000000000000000000000000000000000..31d3bef3316e8fef5a8ee3f836af808eb82aa8ca
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/interface.gallerystorage_driver.php
@@ -0,0 +1,31 @@
+<?php
+
+interface I_GalleryStorage_Driver
+{
+	function get_image_sizes();
+	function get_image_abspath($image, $size=FALSE);
+	function get_full_abspath($image);
+    function get_cache_abspath($gallery = FALSE);
+	function get_original_abspath($image);
+	function get_upload_abspath($gallery=FALSE);
+	function get_upload_relpath($gallery=FALSE);
+	function get_gallery_abspath($gallery);
+	function get_backup_abspath($image);
+	function get_image_url($image, $size=FALSE);
+	function get_original_url($image);
+	function get_full_url($image);
+	function get_image_html($image, $size=FALSE);
+	function get_original_html($image);
+	function get_full_html($image);
+	function get_original_dimensions($image);
+	function get_full_dimensions($image);
+	function backup_image($image);
+	function move_images($images, $gallery, $db_entries=TRUE);
+	function copy_images($images, $gallery, $db_entries=TRUE);
+	function upload_image($gallery, $data=FALSE);
+	function get_driver_class_name();
+	function generate_image_clone($image_path, $clone_path, $params);
+	function generate_image_size($image, $size);
+	function generate_thumbnail($image);
+	function delete_image($image, $size=FALSE);
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/interface.image.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/interface.image.php
new file mode 100644
index 0000000000000000000000000000000000000000..793801707e191fbb84739c64ff964c87e4ec2d9a
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/interface.image.php
@@ -0,0 +1,6 @@
+<?php
+
+interface I_Image
+{
+    function get_gallery();
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/interface.image_mapper.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/interface.image_mapper.php
new file mode 100644
index 0000000000000000000000000000000000000000..b5b3400dfb639a032426bd81c3e4d8992eb58e5d
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/interface.image_mapper.php
@@ -0,0 +1,6 @@
+<?php
+
+interface I_Image_Mapper
+{
+    static function get_instance($context = False);
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/module.nextgen_data.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/module.nextgen_data.php
new file mode 100644
index 0000000000000000000000000000000000000000..5f956d6f8d2ffc57bc4454f1b6971069005afd33
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/module.nextgen_data.php
@@ -0,0 +1,99 @@
+<?php
+
+/***
+{
+		Module: photocrati-nextgen-data,
+		Depends: { photocrati-datamapper }
+}
+***/
+
+class M_NextGen_Data extends C_Base_Module
+{
+    function define()
+    {
+        parent::define(
+            'photocrati-nextgen-data',
+            'NextGEN Data Tier',
+            "Provides a data tier for NextGEN gallery based on the DataMapper module",
+            '0.3',
+            'http://www.photocrati.com',
+            'Photocrati Media',
+            'http://www.photocrati.com'
+        );
+
+		C_Photocrati_Installer::add_handler($this->module_id, 'C_NextGen_Data_Installer');
+    }
+
+    function _register_adapters()
+    {
+        $this->get_registry()->add_adapter('I_Component_Factory', 'A_NextGen_Data_Factory');
+		#$this->get_registry()->add_adapter('I_CustomPost_DataMapper', 'A_Attachment_DataMapper', 'attachment');
+		$this->get_registry()->add_adapter('I_CustomTable_DataMapper', 'A_CustomTable_Sorting_DataMapper');
+        $this->get_registry()->add_adapter('I_Installer', 'A_NextGen_Data_Installer');
+    }
+
+
+    function _register_utilities()
+    {
+		$this->get_registry()->add_utility('I_Gallery_Mapper', 'C_Gallery_Mapper');
+		$this->get_registry()->add_utility('I_Image_Mapper', 'C_Image_Mapper');
+        $this->get_registry()->add_utility('I_Album_Mapper', 'C_Album_Mapper');
+        $this->get_registry()->add_utility('I_Gallery_Storage', 'C_Gallery_Storage');
+    }
+
+    function get_type_list()
+    {
+        return array(
+            'A_Attachment_Datamapper' => 'adapter.attachment_datamapper.php',
+            'A_Customtable_Sorting_Datamapper' => 'adapter.customtable_sorting_datamapper.php',
+            'A_Nextgen_Data_Factory' => 'adapter.nextgen_data_factory.php',
+            'C_NextGen_Data_Installer' => 'class.nextgen_data_installer.php',
+            'A_Parse_Image_Metadata' => 'adapter.parse_image_metadata.php',
+            'C_Album' => 'class.album.php',
+            'C_Gallery' => 'class.gallery.php',
+            'C_Image' => 'class.image.php',
+            'C_Album_Mapper' => 'class.album_mapper.php',
+            'C_Gallerystorage_Base' => 'class.gallerystorage_base.php',
+            'C_Gallerystorage_Driver_Base' => 'class.gallerystorage_driver_base.php',
+            'C_Gallery_Mapper' => 'class.gallery_mapper.php',
+            'C_Gallery_Storage' => 'class.gallery_storage.php',
+            'C_Image_Mapper' => 'class.image_mapper.php',
+            'C_Image_Wrapper' => 'class.image_wrapper.php',
+            'C_Image_Wrapper_Collection' => 'class.image_wrapper_collection.php',
+            'C_Nextgen_Metadata' => 'class.nextgen_metadata.php',
+            'C_Ngglegacy_Gallerystorage_Driver' => 'class.ngglegacy_gallerystorage_driver.php',
+            'C_Ngglegacy_Thumbnail' => 'class.ngglegacy_thumbnail.php',
+            'C_Wordpress_Gallerystorage_Driver' => 'class.wordpress_gallerystorage_driver.php',
+            'I_Album' => 'interface.album.php',
+            'I_Gallery' => 'interface.gallery.php',
+            'I_Image' => 'interface.image.php',
+            'I_Album_Mapper' => 'interface.album_mapper.php',
+            'I_Component_Config' => 'interface.component_config.php',
+            'I_Gallerystorage_Driver' => 'interface.gallerystorage_driver.php',
+            'I_Gallery_Mapper' => 'interface.gallery_mapper.php',
+            'I_Gallery_Storage' => 'interface.gallery_storage.php',
+            'I_Gallery_Type' => 'interface.gallery_type.php',
+            'I_Image_Mapper' => 'interface.image_mapper.php'
+        );
+    }
+    
+    
+    function _register_hooks()
+    {
+    	add_filter('posts_orderby', array($this, 'wp_query_order_by'), 10, 2);
+    }
+    
+    function wp_query_order_by($order_by, $wp_query)
+    {
+    	if ($wp_query->get('datamapper_attachment'))
+    	{
+    		$order_parts = explode(' ', $order_by);
+    		$order_name = array_shift($order_parts);
+    		
+    		$order_by = 'ABS(' . $order_name . ') ' . implode(' ', $order_parts) . ', ' . $order_by;
+    	}
+    	
+    	return $order_by;
+    }
+}
+new M_NextGen_Data();
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/README.txt b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/README.txt
new file mode 100644
index 0000000000000000000000000000000000000000..17230e391286943d32b1c6bc48b7750da7989d08
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/README.txt
@@ -0,0 +1,148 @@
+GALLERY DISPLAY MODULE
+======================
+
+ == Introduction ==
+-------------------
+
+This module is responsible for displaying galleries. It's fundamental to this
+aspect. It provides the following:
+
+	=>	An interface to attach a collection of images to a post, and display
+		them using a particular "display type" (more on display types below)
+	=>	A page used to configure Display Settings for "display types"
+	=>	A shortcode for rendering a collection of images using a particular
+		"display type"
+
+
+== Terminology ==
+-------------------
+
+	*Display Type*
+	=>	Used to render a collection of images or galleries.
+	=>	Has the following properties: "name", "title", "entity_type", and
+		"settings".
+    =>  The "name" property is the name that will be referenced in code
+        and shortcodes. For example, "photocrati-nextgen_basic_thumbnails".
+	=>  The "title" property is the human-friendly name of the display type,
+		such as "NextGen Basic Thumbnails".
+	=>	The "entity_type" property specifies what kind of display type this is.
+		One of two values can be specified: "gallery" or "album". This
+		property essentially establishes whether the display type is a
+		"gallery type" or "album type".
+	=>	The "settings" property is an array of key/value pair settings, serving
+		as a global configuration to be taken into consideration when rendering
+		the display type on the front-end.
+	=>	Is persisted as a Custom Post using the C_CustomPost_DataMapper_Driver.
+
+	*Displayed Gallery*
+	=>	An entity representing the association between a collection of images,
+		a display type, and a list of display settings applied. Essentially,
+		a "displayed gallery" represents a gallery being rendered.
+	=>	In previous terminology, this was once called an "Attached Gallery".
+	=>	Has the following properties:
+		"source"
+			- determines where the images or galleries will be coming from
+			- acceptable values: "galleries", "albums", "recent_images",
+			  "random images", and "tags".
+		"container_ids":
+			- specifies what ids in particular the images or galleries will be
+			  coming from.
+			- If the "source" property is set to "galleries", then
+			  this property will be set to an array of gallery ids. If the
+			  "source" property is set to "albums", then this property will be
+			  set to an array of album ids.
+		"entity_ids":
+			- specifies what ids in particular to display.
+			- If the "source"
+			  property is set to "galleries", then this property will be set
+			  to an array of image ids. Otherwise, if the "source" property
+			  is set to "albums", then this property will be set to an array
+			  of gallery ids.
+			- this property is mutually exclusive of the "exclusions" property.
+			  You can either use this property to specify what entities in
+			  particular you would like to display, or you could leave this
+			  property empty and set the "exclusions" property to specify what
+			  entities in particular you don't want to display
+		"exclusions":
+			- specifies what entities in particular you'd like to exclude from
+			  being displayed.
+			- If the "source" property is set to "galleries", then this property
+			  is set to an array of image ids that you wish to exclude. If the
+			  "source" property is set to "albums", then this property is set to
+			  an array of gallery ids that you wish to exclude.
+
+
+== Display Types ==
+-------------------
+
+See above for an explanation of what a "display type" actually is. Display types
+are persisted as a Custom Post in WordPress via the C_Display_Type_Mapper class.
+A display type should always do the following:
+
+	1.	Define a new module to encapsulate the display type into a single unit
+	2.	Define an adapter for the C_Display_Type class.
+
+		C_Display_Type is a model used by the datamapper to perform validation
+		routines and set defaults. Each "display type module" should register
+		an adapter to provide validation routines specific to it's display type.
+		For an example, see "A_NextGen_Basic_Thumbnails".
+
+	3.	Define an adapter for the C_Display_Type_Controller class..
+
+		There are several important methods that each display type must override. 
+		=> index(), details the logic of how to render the display type on the front-end
+		
+		=> enqueue_frontend_resources(), used to enqueue any static resources (CSS or JS) using
+		   wp_enqueue_script() / wp_enqueue_style() for the front-end
+		
+		=> get_field_names(), returns a list of field names to render for the settings of
+		   the display tab. This settings tab is used both on the "Display Settings Page" as
+		   well in the "Display Settings Tab" of the "Attach to Post" interface. For each
+		   field name in the returned array, the C_Display_Type_Controller will try to execute
+		   a corresponding method in the format "_render_[field_name]_field($display_type)".
+		   For example, if you defined the following:
+		
+				function get_field_names()
+				{
+					return array(
+						'foobar'
+					);
+				}
+		
+			Then the C_Display_Type_Controller will try to execute: 
+			$this->_render_foobar_field($display_type);
+		   
+		
+		=> enqueue_backend_resources(), used to enqueue any used to enqueue any static 
+		   resources (CSS or JS) using wp_enqueue_script() / wp_enqueue_style() for the
+		   backend (settings)
+
+	4.	Define an adapter for the C_NextGen_Activator class.
+
+		The C_NextGen_Activator's install() method gets called when the WordPress plugin is
+		activated. Each display type needs an adapter that adds a post hook to the install()
+		method that will install the new display type, and perform any other initialization
+		for the module required. See adapter.nextgen_basic_thumbnails_activation.php for
+		an example.
+
+
+== Display Settings Page ==
+-------------------
+
+The display settings page is provided by the C_Display_Settings_Controller. It's
+an MVC Controller and has a single action, "index". This action is what renders
+the "Display Settings" page under the "Gallery" menu. The "Display Settings"
+page displays accordion tabs for each "Display Type" installed.
+
+Specifically, the index() method does the following:
+	=>	Finds all display types installed using the C_Display_Type_Mapper.
+	=>	Iterates over each display type and...
+			- If a post request, updates the display type
+			- Instantiates a new C_Display_Type_Controller, passing the display type
+			  name to the constructor.
+			- Calls C_Display_Type_Controller->enqueue_backend_resources() to
+			  enqueue necessary resources for the display type. This is useful if
+			  a display type settings tab uses a JavaScript-powered widget that
+			  requires an external script enqueued.
+			- Calls C_Display_Type_Controller->settings(), which renders the
+			  actual accordion tab to configure the display type's settings.
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/adapter.display_settings_controller.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/adapter.display_settings_controller.php
new file mode 100644
index 0000000000000000000000000000000000000000..56d4f0963836f20b6932f092c9c96d50c50a4211
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/adapter.display_settings_controller.php
@@ -0,0 +1,24 @@
+<?php
+
+class A_Display_Settings_Controller extends Mixin
+{
+	/**
+	 * Static resources required for the Display Settings page
+	 */
+	function enqueue_backend_resources()
+	{
+		$this->call_parent('enqueue_backend_resources');
+		wp_enqueue_style('nextgen_gallery_display_settings');
+		wp_enqueue_script('nextgen_gallery_display_settings');
+	}
+
+	function get_page_title()
+	{
+		return 'Gallery Settings';
+	}
+	
+	function get_required_permission()
+	{
+		return 'NextGEN Change options';
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/adapter.display_settings_page.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/adapter.display_settings_page.php
new file mode 100644
index 0000000000000000000000000000000000000000..b6e7f2c47cdca93561bcf249b023784cf3ed2c5e
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/adapter.display_settings_page.php
@@ -0,0 +1,13 @@
+<?php
+
+class A_Display_Settings_Page extends Mixin
+{
+	function initialize()
+	{
+		$this->object->add(
+			'ngg_display_settings',
+			'A_Display_Settings_Controller',
+			NGGFOLDER
+		);
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/adapter.gallery_display_ajax.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/adapter.gallery_display_ajax.php
new file mode 100644
index 0000000000000000000000000000000000000000..501fc5c0d82eddc01ed56fcb06ee2b557c690238
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/adapter.gallery_display_ajax.php
@@ -0,0 +1,24 @@
+<?php
+
+class A_Gallery_Display_Ajax extends Mixin
+{
+	function render_displayed_gallery_action()
+	{
+		$retval = array();
+
+		if (isset($_POST['ajax_referrer'])) {
+			$_SERVER['REQUEST_URI'] = $_POST['ajax_referrer'];
+			C_Router::get_instance()->serve_request();
+		}
+
+		if (isset($_POST['displayed_gallery_id'])) {
+			$displayed_gallery = new C_Displayed_Gallery();
+			$displayed_gallery->apply_transient($_POST['displayed_gallery_id']);
+			$renderer = C_Displayed_Gallery_Renderer::get_instance();
+			$retval['html'] = $renderer->render($displayed_gallery, TRUE);
+		}
+
+		return $retval;
+	}
+}
+
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/adapter.gallery_display_factory.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/adapter.gallery_display_factory.php
new file mode 100644
index 0000000000000000000000000000000000000000..0255cb34eec89fb1782c529d92659212b59bf5fd
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/adapter.gallery_display_factory.php
@@ -0,0 +1,38 @@
+<?php
+
+class A_Gallery_Display_Factory extends Mixin
+{
+	/**
+	 * Instantiates a Display Type
+	 * @param C_DataMapper $mapper
+	 * @param array|stdClass|C_DataMapper_Model $properties
+	 * @param string|array|FALSE $context
+	 */
+	function display_type($mapper=FALSE, $properties=array(), $context=FALSE)
+	{
+		return new C_Display_Type($mapper, $properties, $context);
+	}
+
+	/**
+	 * Instantiates a Displayed Gallery
+	 * @param C_DataMapper $mapper
+	 * @param array|stdClass|C_DataMapper_Model $properties
+	 * @param string|array|FALSE $context
+	 */
+	function displayed_gallery($mapper=FALSE, $properties=array(), $context=FALSE)
+	{
+		return new C_Displayed_Gallery($mapper, $properties, $context);
+	}
+
+	/**
+	 * Instantiates a Displayed Gallery Source
+	 * @param C_DataMapper $mapper
+	 * @param array|stdClass|C_DataMapper_Model $properties
+	 * @param string|array|FALSE $context
+	 * @return C_Displayed_Gallery_Source
+	 */
+	function displayed_gallery_source($mapper=FALSE, $properties=array(), $context=FALSE)
+	{
+		return new C_Displayed_Gallery_Source($mapper, $properties, $context);
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/adapter.gallery_display_view.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/adapter.gallery_display_view.php
new file mode 100644
index 0000000000000000000000000000000000000000..ef533f5d823015ac10b7f76f18135a24218f1f59
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/adapter.gallery_display_view.php
@@ -0,0 +1,43 @@
+<?php
+
+class A_Gallery_Display_View extends Mixin
+{
+    /**
+     * Check whether to render certain kinds of extra additions to the view for a displayed gallery
+     * @param object $displayed_gallery
+     * @param string $template_id
+     * @param C_MVC_View_Element $root_element
+     * @param string $addition_type what kind of addition is being made 'layout', 'decoration', 'style', 'logic' etc.
+     * @return string|NULL
+     */
+    function _check_addition_rendering($displayed_gallery, $template_id, $root_element, $addition_type)
+    {
+    	$view = $root_element->get_object();
+    	$mode = $view->get_param('render_mode');
+    	$ret = true;
+    	
+    	switch ($addition_type)
+    	{
+    		case 'layout':
+  			{
+    			$ret = !in_array($mode, array('bare', 'basic'));
+    			
+    			break;
+  			}
+    		case 'decoration':
+  			{
+    			break;
+  			}
+    		case 'style':
+  			{
+    			break;
+  			}
+    		case 'logic':
+  			{
+    			break;
+  			}
+    	}
+    	
+    	return $ret;
+    }
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/class.display_type.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/class.display_type.php
new file mode 100644
index 0000000000000000000000000000000000000000..2a5a3e9c2b45a4f171746a5e708322adc1589fee
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/class.display_type.php
@@ -0,0 +1,96 @@
+<?php
+
+/**
+ * A Display Type is a component which renders a collection of images
+ * in a "gallery".
+ *
+ * Properties:
+ * - entity_types (gallery, album)
+ * - name		 (nextgen_basic-thumbnails)
+ * - title		 (NextGEN Basic Thumbnails)
+ */
+class C_Display_Type extends C_DataMapper_Model
+{
+	var $_mapper_interface = 'I_Display_Type_Mapper';
+
+	function define($mapper, $properties, $context=FALSE)
+	{
+		parent::define($mapper, $properties, $context);
+		$this->add_mixin('Mixin_Display_Type_Validation');
+		$this->add_mixin('Mixin_Display_Type_Instance_Methods');
+		$this->implement('I_Display_Type');
+	}
+
+	/**
+	 * Initializes a display type with properties
+	 * @param FALSE|C_Display_Type_Mapper $mapper
+	 * @param array|stdClass|C_Display_Type $properties
+	 * @param FALSE|string|array $context
+	 */
+	function initialize($mapper=FALSE, $properties=array())
+	{
+		// If no mapper was specified, then get the mapper
+		if (!$mapper) $mapper = $this->get_registry()->get_utility($this->_mapper_interface);
+
+		// Construct the model
+		parent::initialize($mapper, $properties);
+	}
+
+
+	/**
+	 * Allows a setting to be retrieved directly, rather than through the
+	 * settings property
+	 * @param string $property
+	 * @return mixed
+	 */
+	function &__get($property)
+	{
+		if (isset($this->object->settings) && isset($this->object->settings[$property])) {
+			$retval = &$this->object->settings[$property];
+			return $retval;
+		}
+		else return parent::__get($property);
+	}
+}
+
+class Mixin_Display_Type_Validation extends Mixin
+{
+	function validation()
+	{
+		$this->object->validates_presence_of('entity_types');
+		$this->object->validates_presence_of('name');
+		$this->object->validates_presence_of('title');
+
+		return $this->object->is_valid();
+	}
+}
+
+/**
+ * Provides methods available for class instances
+ */
+class Mixin_Display_Type_Instance_Methods extends Mixin
+{
+	/**
+	 * Determines if this display type is compatible with a displayed gallery
+	 * source
+	 * @param stdClass|C_DataMapper_Model|C_Displayed_Gallery_Source $source
+	 * @return bool
+	 */
+	function is_compatible_with_source($source)
+	{
+		$success = TRUE;
+		foreach ($source->returns as $returned_entity_type) {
+			if (!in_array($returned_entity_type, $this->object->entity_types)) {
+				$success = FALSE;
+				break;
+			}
+		}
+
+		return $success;
+	}
+	
+	function get_order()
+	{
+		return NEXTGEN_DISPLAY_PRIORITY_BASE;
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/class.display_type_controller.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/class.display_type_controller.php
new file mode 100644
index 0000000000000000000000000000000000000000..cdc5920eb3ddbf35dff63c5ff0d5ad000dea931a
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/class.display_type_controller.php
@@ -0,0 +1,323 @@
+<?php
+
+/**
+ * A Controller which displays the settings form for the display type, as
+ * well as the front-end display
+ */
+class C_Display_Type_Controller extends C_MVC_Controller
+{
+	static $_instances = array();
+
+	function define($context=FALSE)
+	{
+		parent::define($context);
+		$this->add_mixin('Mixin_Display_Type_Controller');
+		$this->implement('I_Display_Type_Controller');
+	}
+
+
+	/**
+	 * Provides default behavior for rendering fields
+	 * @param string $method
+	 * @param array $args
+	 */
+	function __call($method, $args)
+	{
+		if (preg_match("/render_([\w_]+)/", $method, $matches) && !$this->has_method($method)) {
+			$field_name = $matches[1];
+			$value = isset($this->_display_type->$field_name) ?
+				$this->_display_type->$field_name : '';
+			return $this->render_partial($field_name, array(
+				'value' => $value, 'context' => $this->_display_type->context), TRUE
+			);
+		}
+		else {
+			return parent::__call($method, $args);
+		}
+	}
+
+
+	/**
+	 * Gets a singleton of the mapper
+	 * @param string|array $context
+	 * @return C_Display_Type_Controller
+	 */
+    public static function get_instance($context = FALSE)
+    {
+        if (!isset(self::$_instances[$context]))
+        {
+            self::$_instances[$context] = new C_Display_Type_Controller($context);
+        }
+        return self::$_instances[$context];
+    }
+}
+
+/**
+ * Provides instance methods for the C_Display_Type_Controller class
+ */
+class Mixin_Display_Type_Controller extends Mixin
+{
+	var $_render_mode;
+	
+	/**
+	 * Enqueues static resources required for lightbox effects
+	 * @param type $displayed_gallery
+	 */
+	function enqueue_lightbox_resources($displayed_gallery)
+	{
+		// Enqueue the lightbox effect library
+		$settings	= C_NextGen_Settings::get_instance();
+		$mapper		= $this->object->get_registry()->get_utility('I_Lightbox_Library_Mapper');
+		$library	= $mapper->find_by_name($settings->thumbEffect);
+
+        // Make the path to the static resources available for libraries
+        // Shutter-Reloaded in particular depends on this
+        $this->object->_add_script_data(
+            'ngg_common',
+            'nextgen_lightbox_settings',
+            array('static_path' => $this->object->get_static_relpath('', 'photocrati-lightbox')),
+            TRUE,
+            FALSE
+        );
+
+        {
+			$i=0;
+			foreach (explode("\n", $library->scripts) as $script) {
+				wp_enqueue_script(
+					$library->name.'-'.$i,
+					$script
+				);
+				if ($i == 0 AND isset($library->values)) {
+					foreach ($library->values as $name => $value) {
+						$this->object->_add_script_data(
+							$library->name . '-0',
+							$name,
+							$value,
+							FALSE
+						);
+					}
+				}
+				$i+=1;
+			}
+			$i=0;
+			foreach (explode("\n", $library->css_stylesheets) as $style) {
+				wp_enqueue_style(
+					$library->name.'-'.$i,
+					$style
+				);
+				$i+=1;
+			}
+		}
+	}
+
+
+	/**
+	 * This method should be overwritten by other adapters/mixins, and call
+	 * wp_enqueue_script() / wp_enqueue_style()
+	 */
+	function enqueue_frontend_resources($displayed_gallery)
+	{
+        // This script provides common JavaScript among all display types
+        wp_enqueue_script('ngg_common');
+
+		// Enqueue the display type library
+		wp_enqueue_script($displayed_gallery->display_type, $this->object->_get_js_lib_url($displayed_gallery));
+
+        // Add "galleries = {};"
+        $this->object->_add_script_data(
+            'ngg_common',
+            'galleries',
+            new stdClass,
+            TRUE,
+            FALSE
+        );
+
+        // Add "galleries.gallery_1 = {};"
+        $this->object->_add_script_data(
+            'ngg_common',
+            'galleries.gallery_' . $displayed_gallery->id(),
+            (array)$displayed_gallery->get_entity(),
+            FALSE
+        );
+
+        $this->object->enqueue_lightbox_resources($displayed_gallery);
+	}
+
+	function enqueue_ngg_styles()
+	{
+		wp_enqueue_style(
+			'nggallery',
+			C_NextGen_Style_Manager::get_instance()->get_selected_stylesheet_url()
+		);
+	}
+	
+	function get_render_mode()
+	{
+		return $this->object->_render_mode;
+	}
+	
+	function set_render_mode($mode)
+	{
+		$this->object->_render_mode = $mode;
+	}
+
+	/**
+	* Ensures that the minimum configuration of parameters are sent to a view
+	* @param $displayed_gallery
+	* @param null $params
+	* @return array|null
+	*/
+	function prepare_display_parameters($displayed_gallery, $params = null)
+	{
+		if ($params == null)
+		{
+			$params = array();
+		}
+		
+		$params['display_type_rendering'] = true;
+		$params['displayed_gallery'] = $displayed_gallery;
+		$params['render_mode'] = $this->object->get_render_mode();
+		
+		return $params;
+	}
+
+	/**
+	 * Renders the frontend display of the display type
+	 */
+	function index_action($displayed_gallery, $return=FALSE)
+	{
+		return $this->object->render_partial('photocrati-nextgen_gallery_display#index', array(), $return);
+	}
+
+	/**
+	 * Returns the url for the JavaScript library required
+	 * @return null|string
+	 */
+	function _get_js_lib_url()
+	{
+		return NULL;
+	}
+
+
+	/**
+	 * Returns the effect HTML code for the displayed gallery
+	 * @param type $displayed_gallery
+	 */
+	function get_effect_code($displayed_gallery)
+	{
+		$settings = C_NextGen_Settings::get_instance();
+		$effect_code = $settings->thumbCode;
+		$effect_code = str_replace('%GALLERY_ID%', $displayed_gallery->id(), $effect_code);
+		$effect_code = str_replace('%GALLERY_NAME%', $displayed_gallery->id(), $effect_code);
+		return $effect_code;
+	}
+
+
+	/**
+	 * Adds data to the DOM which is then accessible by a script
+	 * @param string $handle
+	 * @param string $object_name
+	 * @param mixed $object_value
+	 * @param bool $define
+	 */
+	function _add_script_data($handle, $object_name, $object_value, $define=TRUE, $override=FALSE)
+	{
+		$retval = FALSE;
+
+		// wp_localize_script allows you to add data to the DOM, associated
+		// with a particular script. You can even call wp_localize_script
+		// multiple times to add multiple objects to the DOM. However, there
+		// are a few problems with wp_localize_script:
+		//
+		// - If you call it with the same object_name more than once, you're
+		//   overwritting the first call.
+		// - You cannot namespace your objects due to the "var" keyword always
+		// - being used.
+		//
+		// To circumvent the above issues, we're going to use the WP_Scripts
+		// object to workaround the above issues
+		global $wp_scripts;
+
+		// Has the script been registered or enqueued yet?
+		if (isset($wp_scripts->registered[$handle])) {
+
+			// Get the associated data with this script
+			$script = &$wp_scripts->registered[$handle];
+			$data = &$script->extra['data'];
+
+			// Construct the addition
+			$addition = $define ? "\nvar {$object_name} = " . json_encode($object_value) . ';' :
+				"\n{$object_name} = " . json_encode($object_value) . ';';
+
+			// Add the addition
+			if ($override) {
+				$data .= $addition;
+				$retval = TRUE;
+			}
+			else if (strpos($data, $object_name) === FALSE) {
+				$data .= $addition;
+				$retval = TRUE;
+			}
+
+            $script->extra['data'] = $data;
+		}
+
+		return $retval;
+	}
+
+    // Returns the longest and widest dimensions from a list of entities
+    function get_entity_statistics($entities, $named_size, $style_images=FALSE)
+    {
+        $longest        = $widest = 0;
+        $storage        = $this->get_registry()->get_utility('I_Gallery_Storage');
+        $image_mapper   = FALSE; // we'll fetch this if needed
+
+        // Calculate longest and
+        foreach ($entities as $entity) {
+
+            // Get the image
+            $image = FALSE;
+            if (isset($entity->pid)) {
+                $image = $entity;
+            }
+            elseif (isset($entity->previewpic)) {
+                if (!$image_mapper) $image_mapper = $this->get_registry()->get_utility('I_Image_Mapper');
+                $image = $image_mapper->find($entity->previewpic);
+            }
+
+            // Once we have the image, get it's dimensions
+            if ($image) {
+                $dimensions = $storage->get_image_dimensions($image, $named_size);
+                if ($dimensions['width']  > $widest)    $widest     = $dimensions['width'];
+                if ($dimensions['height'] > $longest)   $longest    = $dimensions['height'];
+            }
+        }
+
+        // Second loop to style images
+        if ($style_images) foreach ($entities as &$entity) {
+
+            // Get the image
+            $image = FALSE;
+            if (isset($entity->pid)) {
+                $image = $entity;
+            }
+            elseif (isset($entity->previewpic)) {
+                if (!$image_mapper) $image_mapper = $this->get_registry()->get_utility('I_Image_Mapper');
+                $image = $image_mapper->find($entity->previewpic);
+            }
+
+            // Once we have the image, get it's dimension and calculate margins
+            if ($image) {
+                $dimensions = $storage->get_image_dimensions($image, $named_size);
+            }
+        }
+
+        return array(
+            'entities'  =>  $entities,
+            'longest'   =>  $longest,
+            'widest'    =>  $widest
+        );
+    }
+}
+
+
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/class.display_type_mapper.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/class.display_type_mapper.php
new file mode 100644
index 0000000000000000000000000000000000000000..8f7a466dde4ea588970ed35988fb110a6d6d7b31
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/class.display_type_mapper.php
@@ -0,0 +1,110 @@
+<?php
+
+/**
+ * Provides a datamapper to perform CRUD operations for Display Types
+ */
+class C_Display_Type_Mapper extends C_CustomPost_DataMapper_Driver
+{
+	public static $_instances = array();
+
+	function define($context=FALSE)
+	{
+		$object_name = 'display_type';
+
+		// Add the object name to the context of the object as well
+		// This allows us to adapt the driver itself, if required
+		if (!is_array($context)) $context = array($context);
+		array_push($context, $object_name);
+		parent::define(NULL, $context);
+
+		$this->add_mixin('Mixin_Display_Type_Mapper');
+		$this->implement('I_Display_Type_Mapper');
+		$this->set_model_factory_method($object_name);
+	}
+
+	function initialize($context=FALSE)
+	{
+		parent::initialize('display_type');
+	}
+
+
+	/**
+	 * Gets a singleton of the mapper
+	 * @param string|array $context
+	 * @return C_Display_Type_Mapper
+	 */
+    public static function get_instance($context = False)
+    {
+        if (!isset(self::$_instances[$context]))
+        {
+            self::$_instances[$context] = new C_Display_Type_Mapper($context);
+        }
+        return self::$_instances[$context];
+    }
+}
+
+
+/**
+ * Provides instance methods for the display type mapper
+ */
+class Mixin_Display_Type_Mapper extends Mixin
+{
+	/**
+	 * Locates a Display Type by names
+	 * @param string $name
+	 */
+	function find_by_name($name, $model=FALSE)
+	{
+		$retval = NULL;
+		$this->object->select();
+		$this->object->where(array('name = %s', $name));
+		$results = $this->object->run_query(FALSE, $model);
+		if ($results) $retval = $results[0];
+		return $retval;
+	}
+
+	/**
+	 * Finds display types used to display specific types of entities
+	 * @param string|array $entity_type e.g. image, gallery, album
+	 * @return array
+	 */
+	function find_by_entity_type($entity_type, $model=FALSE)
+	{
+		$find_entity_types = is_array($entity_type) ? $entity_type : array($entity_type);
+
+		$retval = NULL;
+		foreach ($this->object->find_all($model) as $display_type) {
+			foreach ($find_entity_types as $entity_type) {
+				if (in_array($entity_type, $display_type->entity_types)) {
+					$retval[] = $display_type;
+					break;
+				}
+			}
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Uses the title attribute as the post title
+	 * @param stdClass $entity
+	 * @return string
+	 */
+	function get_post_title($entity)
+	{
+		return $entity->title;
+	}
+
+
+	/**
+	 * Sets default values needed for display types
+	 */
+	function set_defaults($entity)
+	{
+		if (!isset($entity->settings)) $entity->settings = array();
+		$this->_set_default_value($entity, 'preview_image_relpath', '');
+		$this->_set_default_value($entity, 'default_source', '');
+        $this->_set_default_value($entity, 'view_order', NEXTGEN_DISPLAY_PRIORITY_BASE);
+        $this->_set_default_value($entity, 'settings', 'use_lightbox_effect', TRUE);
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery.php
new file mode 100644
index 0000000000000000000000000000000000000000..4bc977f300605e72ee9ff030297abb0934d55dc0
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery.php
@@ -0,0 +1,923 @@
+<?php
+
+/**
+ * Associates a Display Type with a collection of images
+ *
+ * * Properties:
+ * - source				(gallery, album, recent_images, random_images, etc)
+ * - container_ids		(gallery ids, album ids, tag ids, etc)
+ * - display_type		(name of the display type being used)
+ * - display_settings	(settings for the display type)
+ * - exclusions			(excluded entity ids)
+ * - entity_ids			(specific images/galleries to include, sorted)
+ * - order_by
+ * - order_direction
+ */
+class C_Displayed_Gallery extends C_DataMapper_Model
+{
+	var $_mapper_interface = 'I_Displayed_Gallery_Mapper';
+
+	function define($mapper=FALSE, $properties=FALSE, $context=FALSE)
+	{
+		parent::define($mapper, $properties, $context);
+		$this->add_mixin('Mixin_Displayed_Gallery_Validation');
+		$this->add_mixin('Mixin_Displayed_Gallery_Instance_Methods');
+		$this->add_mixin('Mixin_Displayed_Gallery_Queries');
+		$this->implement('I_Displayed_Gallery');
+	}
+
+
+	/**
+	 * Initializes a display type with properties
+	 * @param FALSE|C_Displayed_Gallery_Mapper $mapper
+	 * @param array|stdClass|C_Displayed_Gallery $properties
+	 * @param FALSE|string|array $context
+	 */
+	function initialize($mapper=FALSE, $properties=array())
+	{
+		if (!$mapper) $mapper = $this->get_registry()->get_utility($this->_mapper_interface);
+		parent::initialize($mapper, $properties);
+	}
+}
+
+/**
+ * Provides validation
+ */
+class Mixin_Displayed_Gallery_Validation extends Mixin
+{
+	function validation()
+	{
+		// Valid sources
+		$this->object->validates_presence_of('source');
+
+		// Valid display type?
+		$this->object->validates_presence_of('display_type');
+		if (($display_type = $this->object->get_display_type())) {
+			$display_type->settings = $this->object->display_settings;
+			if (!$display_type->validate()) {
+				foreach ($display_type->get_errors() as $property => $errors) {
+					foreach ($errors as $error) {
+						$this->object->add_error($error, $property);
+					}
+				}
+			}
+
+			// Is the display type compatible with the source? E.g., if we're
+			// using a display type that expects images, we can't be feeding it
+			// galleries and albums
+			if (($source = $this->object->get_source())) {
+				if (!$display_type->is_compatible_with_source($source)) {
+					$this->object->add_error(
+						_('Source not compatible with selected display type'),
+						'display_type'
+					);
+				}
+			}
+
+			// If no maximum_entity_count has been given, then set a maximum
+			if (!isset($this->object->maximum_entity_count)) {
+				$this->object->maximum_entity_count = C_Photocrati_Settings_Manager::get('maximum_entity_count', 500);
+			}
+
+		}
+		else {
+			$this->object->add_error('Invalid display type', 'display_type');
+		}
+
+		return $this->object->is_valid();
+	}
+}
+
+class Mixin_Displayed_Gallery_Queries extends Mixin
+{
+	function get_entities($limit=FALSE, $offset=FALSE, $id_only=FALSE, $returns='included')
+	{
+		$retval = array();
+
+		// If a maximum entity count has been set for the displayed gallery,
+		// then ensure that's honoured
+		if (isset($this->object->maximum_entity_count)) {
+			if (!$limit OR (is_numeric($limit) && $limit > $this->object->maximum_entity_count)) {
+				$limit = intval($this->object->maximum_entity_count);
+			}
+		}
+
+		// Ensure that all parameters have values that are expected
+		if ($this->object->_parse_parameters()) {
+
+			// Is this an image query?
+			$source_obj = $this->object->get_source();
+			if (in_array('image', $source_obj->returns)) {
+				$retval = $this->object->_get_image_entities($source_obj, $limit, $offset, $id_only, $returns);
+			}
+
+			// Is this a gallery/album query?
+			elseif (in_array('gallery', $source_obj->returns)) {
+				$retval = $this->object->_get_album_and_gallery_entities($source_obj, $limit, $offset, $id_only, $returns);
+			}
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Gets all images in the displayed gallery
+	 * @param C_Displayed_Gallery_Source $source_obj
+	 * @param int $limit
+	 * @param int $offset
+	 * @param boolean $id_only
+	 * @param string $returns
+	 */
+	function _get_image_entities($source_obj, $limit, $offset, $id_only, $returns)
+	{
+		// TODO: This method is very long, and therefore more difficult to read
+		// Find a way to minimalize or segment
+		$mapper	= $this->get_registry()->get_utility('I_Image_Mapper');
+		$image_key		= $mapper->get_primary_key_column();
+		$select			= $id_only ? $image_key : '*';
+		$sort_direction	= $this->object->order_direction;
+		$sort_by		= $this->object->order_by;
+
+		// Here's what this method is doing:
+		// 1) Determines what results need returned
+		// 2) Determines from what container ids the results should come from
+		// 3) Applies ORDER BY clause
+		// 4) Applies LIMIT/OFFSET clause
+		// 5) Executes the query and returns the result
+
+		// We start with the most difficult query. When returns is "both", we
+		// need to return a list of both included and excluded entity ids, and
+		// mark specifically which entities are excluded
+		if ($returns == 'both') {
+
+			// We need to add two dynamic columns, one called "sortorder" and
+			// the other called "exclude".
+			$if_true		= 1;
+			$if_false		= 0;
+			$excluded_set	= $this->object->entity_ids;
+			if (!$excluded_set) {
+				$if_true	= 0;
+				$if_false	= 1;
+				$excluded_set = $this->object->exclusions;
+			}
+			$sortorder_set	= $this->object->sortorder ? $this->object->sortorder :  $excluded_set;
+
+			// Add sortorder column
+			if ($sortorder_set) {
+				$select = $this->object->_add_find_in_set_column(
+					$select,
+					$image_key,
+					$sortorder_set,
+					'new_sortorder',
+					TRUE
+				);
+				// A user might want to sort the results by the order of
+				// images that they specified to be included. For that,
+				// we need some trickery by reversing the order direction
+				$sort_direction = $this->object->order_direction == 'ASC' ? 'DESC' : 'ASC';
+				$sort_by = 'new_sortorder';
+			}
+
+			// Add exclude column
+			if ($excluded_set) {
+				$select = $this->object->_add_find_in_set_column(
+					$select,
+					$image_key,
+					$excluded_set,
+					'exclude'
+				);
+				$select .= ", IF (exclude = 0 AND @exclude = 0, $if_true, $if_false) AS 'exclude'";
+			}
+
+			// Select what we want
+			$mapper->select($select);
+		}
+
+		// When returns is "included", the query is relatively simple. We
+		// just provide a where clause to limit how many images we're returning
+		// based on the entity_ids, exclusions, and container_ids parameters
+		if ($returns == 'included') {
+
+			// If the sortorder propery is available, then we need to override
+			// the sortorder
+			if ($this->object->sortorder) {
+				$select = $this->object->_add_find_in_set_column(
+					$select,
+					$image_key,
+					$this->object->sortorder,
+					'new_sortorder',
+					TRUE
+				);
+				$sort_direction = $this->object->order_direction == 'ASC' ? 'DESC' : 'ASC';
+				$sort_by = 'new_sortorder';
+			}
+			$mapper->select($select);
+
+			// Filter based on entity_ids selection
+			if ($this->object->entity_ids) {
+				$mapper->where(array("{$image_key} IN %s", $this->object->entity_ids));
+			}
+
+			// Filter based on exclusions selection
+			if ($this->object->exclusions) {
+				$mapper->where(array("{$image_key} NOT IN %s", $this->object->exclusions));
+			}
+
+			// Ensure that no images marked as excluded at the gallery level are
+			// returned
+			$mapper->where(array("exclude = %d", 0));
+		}
+
+		// When returns is "excluded", it's a little more complicated as the
+		// query is the negated form of the "included". entity_ids become the
+		// list of exclusions, and exclusions become the list of entity_ids to
+		// return. All results we return must be marked as excluded
+		elseif ($returns == 'excluded') {
+
+			// If the sortorder propery is available, then we need to override
+			// the sortorder
+			if ($this->object->sortorder) {
+				$select = $this->object->_add_find_in_set_column(
+					$select,
+					$image_key,
+					$this->object->sortorder,
+					'new_sortorder',
+					TRUE
+				);
+				$sort_direction = $this->object->order_direction == 'ASC' ? 'DESC' : 'ASC';
+				$sort_by = 'new_sortorder';
+			}
+
+			// Mark each result as excluded
+			$select .= ", 1 AS exclude";
+			$mapper->select($select);
+
+			// Is this case, entity_ids become the exclusions
+			$exclusions = $this->object->entity_ids;
+
+			// Remove the exclusions always takes precedence over entity_ids, so
+			// we adjust the list of ids
+			if ($this->object->exclusions) foreach ($this->object->exclusions as $excluded_entity_id) {
+				if (($index = array_search($excluded_entity_id, $exclusions)) !== FALSE) {
+					unset($exclusions[$index]);
+				}
+			}
+
+			// Filter based on exclusions selection
+			if ($exclusions) {
+				$mapper->where(array("{$image_key} NOT IN %s", $exclusions));
+			}
+
+			// Filter based on selected exclusions
+			else if ($this->object->exclusions) {
+				$mapper->where(array("{$image_key} IN %s", $this->object->exclusions));
+			}
+
+			// Ensure that images marked as excluded are returned as well
+			$mapper->where(array("exclude = 1"));
+		}
+
+		// Filter based on containers_ids. Container ids is a little more
+		// complicated as it can contain gallery ids or tags
+		if ($this->object->container_ids) {
+
+			// Container ids are tags
+			if ($source_obj->name == 'tags') {
+				$term_ids = $this->object->get_term_ids_for_tags($this->object->container_ids);
+				$mapper->where(array("{$image_key} IN %s",get_objects_in_term($term_ids, 'ngg_tag')));
+			}
+
+			// Container ids are gallery ids
+			else {
+				$mapper->where(array("galleryid IN %s", $this->object->container_ids));
+			}
+		}
+
+		// Filter based on excluded container ids
+		if ($this->object->excluded_container_ids) {
+
+			// Container ids are tags
+			if ($source_obj->name == 'tags') {
+				$term_ids = $this->object->get_term_ids_for_tags($this->object->excluded_container_ids);
+				$mapper->where(array("{$image_key} NOT IN %s",get_objects_in_term($term_ids, 'ngg_tag')));
+			}
+
+			// Container ids are gallery ids
+			else {
+				$mapper->where(array("galleryid NOT IN %s", $this->object->excluded_container_ids));
+			}
+		}
+
+		// Adjust the query more based on what source was selected
+		if ($this->object->source == 'recent_images') {
+			$sort_direction = 'DESC';
+			$sort_by = 'imagedate';
+		}
+        // If the source is random but entity_ids are present we assume that this is a temporary/"fake" random
+        // gallery created by randomly selecting X image ids that are then set as the gallery entity_ids
+		elseif ($this->object->source == 'random_images' && empty($this->object->entity_ids)) {
+			$sort_by = 'rand()';
+		}
+
+		// Apply a sorting order
+		if ($sort_by) $mapper->order_by($sort_by, $sort_direction);
+
+		// Apply a limit
+		if ($limit) {
+			if ($offset) $mapper->limit($limit, $offset);
+			else		 $mapper->limit($limit);
+		}
+
+		return $mapper->run_query();
+	}
+
+	/**
+	 * Gets all gallery and album entities from albums specified, if any
+	 * @param C_Displayed_Gallery_Source $source_obj
+	 * @param int $limit
+	 * @param int $offset
+	 * @param boolean $id_only
+	 * @param array $returns
+	 */
+	function _get_album_and_gallery_entities($source_obj, $limit=FALSE, $offset=FALSE, $id_only=FALSE, $returns='included')
+	{
+		// Albums queries and difficult and inefficient to perform due to the
+		// database schema. To complicate things, we're returning two different
+		// types of entities - galleries, and sub-albums.
+		// The user prefixes entity_id's with an 'a' to distinguish album ids
+		// from gallery ids. E.g. entity_ids=[1, "a2", 3]
+		$album_mapper	= $this->get_registry()->get_utility('I_Album_Mapper');
+		$album_key		= $album_mapper->get_primary_key_column();
+		$gallery_mapper	= $this->get_registry()->get_utility('I_Gallery_Mapper');
+		$gallery_key	= $gallery_mapper->get_primary_key_column();
+		$select			= $id_only ? $album_key.", sortorder" : '*';
+		$retval			= array();
+
+		// If no exclusions are specified, are entity_ids are specified,
+		// and we're to return is "included", then we have a relatively easy
+		// query to perform - we just fetch each entity listed in
+		// the entity_ids field
+		if ($returns == 'included' && $this->object->entity_ids && empty($this->object->exclusions)) {
+			$retval = $this->object->_entities_to_galleries_and_albums(
+				$this->object->entity_ids, $id_only, array(), $limit, $offset
+			);
+		}
+
+		// It's not going to be easy. We'll start by fetching the albums
+		// and retrieving each of their entities
+		else {
+			// Start the query
+			$album_mapper->select($select);
+
+            // Fetch the albums, and find the entity ids of the sub-albums and galleries
+            $entity_ids   = array();
+            $excluded_ids = array();
+
+			// Filter by container ids. If container_ids === '0' we retrieve all existing gallery_ids and use
+            // them as the available entity_ids for comparability with 1.9x
+            $container_ids = $this->object->container_ids;
+			if ($container_ids)
+            {
+                if ($container_ids !== array('0') && $container_ids !== array(''))
+                {
+                    $album_mapper->where(array("{$album_key} IN %s", $container_ids));
+                    foreach ($album_mapper->run_query() as $album) {
+                        $entity_ids = array_merge($entity_ids, (array) $album->sortorder);
+                    }
+                }
+                else if ($container_ids === array('0') || $container_ids === array('')) {
+                    foreach ($gallery_mapper->select($gallery_key)->run_query() as $gallery) {
+                        $entity_ids[] = $gallery->$gallery_key;
+                    }
+                }
+			}
+
+			// Break the list of entities into two groups, included entities
+			// and excluded entity ids
+			// --
+			// If a specific list of entity ids have been specified, then
+			// we know what entity ids are meant to be included. We can compute
+			// the intersect and also determine what entity ids are to be
+			// excluded
+			if ($this->object->entity_ids) {
+
+				// Determine the real list of included entity ids. Exclusions
+				// always take precedence
+				$included_ids = $this->object->entity_ids;
+				foreach ($this->object->exclusions as $excluded_id) {
+					if (($index = array_search($excluded_id, $included_entity_ids)) !== FALSE) {
+						unset($included_entity_ids[$index]);
+					}
+				}
+				$excluded_ids = array_diff($entity_ids, $included_ids);
+			}
+
+			// We only have a list of exclusions.
+			elseif ($this->object->exclusions) {
+				$included_ids = array_diff($entity_ids, $this->object->exclusions);
+				$excluded_ids = array_diff($entity_ids, $included_ids);
+			}
+
+			// We have no entity ids and no exclusions
+			else {
+				$included_ids = $entity_ids;
+			}
+
+			// We've built our two groups. Let's determine how we'll focus on them
+			// --
+			// We're interested in only the included ids
+			if ($returns == 'included')
+				$retval = $this->object->_entities_to_galleries_and_albums(
+                    $included_ids,
+                    $id_only,
+                    array(),
+                    $limit,
+                    $offset
+                );
+
+			// We're interested in only the excluded ids
+			elseif ($returns == 'excluded')
+				$retval = $this->object->_entities_to_galleries_and_albums(
+                    $excluded_ids,
+                    $id_only,
+                    $excluded_ids,
+                    $limit,
+                    $offset
+                );
+
+			// We're interested in both groups
+			else {
+				$retval = $this->object->_entities_to_galleries_and_albums(
+                    $entity_ids,
+                    $id_only,
+                    $excluded_ids,
+                    $limit,
+                    $offset
+                );
+			}
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Takes a list of entities, and returns the mapped galleries and sub-albums
+     *
+	 * @param array $entity_ids
+     * @param bool $id_only
+     * @param array $exclusions
+     * @param int $limit
+     * @param int $offset
+	 * @return array
+	 */
+	function _entities_to_galleries_and_albums($entity_ids,
+                                               $id_only = FALSE,
+                                               $exclusions = array(),
+                                               $limit = FALSE,
+                                               $offset = FALSE)
+	{
+		$retval			= array();
+		$gallery_ids	= array();
+		$album_ids		= array();
+		$album_mapper	= $this->get_registry()->get_utility('I_Album_Mapper');
+		$album_key		= $album_mapper->get_primary_key_column();
+		$gallery_mapper	= $this->get_registry()->get_utility('I_Gallery_Mapper');
+		$image_mapper = $this->object->get_registry()->get_utility('I_Image_Mapper');
+		$gallery_key	= $gallery_mapper->get_primary_key_column();
+		$album_select	= ($id_only ? $album_key : '*').", 1 AS is_album, 0 AS is_gallery, name AS title, albumdesc AS galdesc";
+		$gallery_select = ($id_only ? $gallery_key : '*').", 1 AS is_gallery, 0 AS is_album";
+
+		// Modify the sort order of the entities
+		if ($this->object->sortorder) {
+			$sortorder = array_intersect($this->object->sortorder, $entity_ids);
+			$entity_ids = array_merge($sortorder,array_diff($entity_ids, $sortorder));
+		}
+
+		// Segment entity ids into two groups - galleries and albums
+		foreach ($entity_ids as $entity_id) {
+			if (substr($entity_id, 0, 1) == 'a')
+				$album_ids[]	= intval(substr($entity_id, 1));
+			else
+				$gallery_ids[]	= intval($entity_id);
+		}
+
+		// Adjust query to include an exclude property
+		if ($exclusions) {
+			$album_select = $this->object->_add_find_in_set_column(
+				$album_select,
+				$album_key,
+				$this->object->exclusions,
+				'exclude'
+			);
+			$album_select = $this->object->_add_if_column(
+				$album_select,
+				'exclude',
+				0,
+				1
+			);
+			$gallery_select = $this->object->_add_find_in_set_column(
+				$gallery_select,
+				$gallery_key,
+				$this->object->exclusions,
+				'exclude'
+			);
+			$gallery_select = $this->object->_add_if_column(
+				$gallery_select,
+				'exclude',
+				0,
+				1
+			);
+		}
+
+		// Add sorting parameter to the gallery and album queries
+		if ($gallery_ids) {
+			$gallery_select = $this->object->_add_find_in_set_column(
+				$gallery_select,
+				$gallery_key,
+				$gallery_ids,
+				'ordered_by',
+				TRUE
+			);
+		}
+		else {
+			$gallery_select .= ", 0 AS ordered_by";
+		}
+		if ($album_ids) {
+			$album_select = $this->object->_add_find_in_set_column(
+				$album_select,
+				$album_key,
+				$album_ids,
+				'ordered_by',
+				TRUE
+			);
+		}
+		else {
+			$album_select .= ", 0 AS ordered_by";
+		}
+
+		// Fetch entities
+		$galleries	= $gallery_mapper->select($gallery_select)->where(
+			array("{$gallery_key} IN %s", $gallery_ids)
+		)->order_by('ordered_by', 'DESC')->run_query();
+		$counts = $image_mapper->select('galleryid, COUNT(*) as counter')->where(
+			array("galleryid IN %s", $gallery_ids))->group_by('galleryid')->run_query();
+		$albums		= $album_mapper->select($album_select)->where(
+			array("{$album_key} IN %s", $album_ids)
+		)->order_by('ordered_by', 'DESC')->run_query();
+
+		// Reorder entities according to order specified in entity_ids
+		foreach ($entity_ids as $entity_id) {
+			if (substr($entity_id, 0, 1) == 'a') {
+                $album = array_shift($albums);
+                if ($album) $retval[] = $album;
+            }
+
+			else {
+                $gallery = array_shift($galleries);
+                if ($gallery) {
+                	foreach ($counts as $id => $gal_count) {
+                		if ($gal_count->galleryid == $gallery->gid) {
+		              		$gallery->counter = intval($gal_count->counter);
+		              		unset($counts[$id]);
+                		}
+                	}
+
+                	$retval[] = $gallery;
+                }
+            }
+
+		}
+
+		// Sort the entities
+		if ($this->object->order_by && $this->object->order_by != 'sortorder')
+			usort($retval, array(&$this, '_sort_album_result'));
+		if ($this->object->order_direction == 'DESC')
+			$retval = array_reverse($retval);
+
+		// Limit the entities
+		if ($limit && $offset)
+			$retval = array_slice($retval, $offset, $limit);
+
+		return $retval;
+	}
+
+	/**
+	 * Returns the total number of entities in this displayed gallery
+	 * @param string $returns
+	 * @returns int
+	 */
+	function get_entity_count($returns='included')
+	{
+        $retval = 0;
+
+		// Is this an image query?
+		$source_obj = $this->object->get_source();
+		if (in_array('image', $source_obj->returns)) {
+			$retval =  count($this->object->_get_image_entities($source_obj, FALSE, FALSE, TRUE, $returns));
+		}
+
+		// Is this a gallery/album query?
+		elseif (in_array('gallery', $source_obj->returns)) {
+			$retval = count($this->object->_get_album_and_gallery_entities($source_obj, FALSE, FALSE, TRUE, $returns));
+		}
+
+        if (isset($this->object->maximum_entity_count)) {
+            $max = intval($this->object->maximum_entity_count);
+            if ($retval > $max) $retval = $max;
+        }
+
+        return $retval;
+	}
+
+	/**
+	 * Returns all included entities for the displayed gallery
+	 * @param int $limit
+	 * @param int $offset
+	 * @param boolean $id_only
+	 * @return array
+	 */
+	function get_included_entities($limit=FALSE, $offset=FALSE, $id_only=FALSE)
+	{
+		return $this->object->get_entities($limit, $offset, $id_only, 'included');
+	}
+
+	/**
+	 * Adds a FIND_IN_SET call to the select portion of the query, and
+	 * optionally defines a dynamic column
+	 * @param string $select
+	 * @param string $key
+	 * @param array $array
+	 * @param string $alias
+	 * @param boolean $add_column
+	 * @return string
+	 */
+	function _add_find_in_set_column($select, $key, $array, $alias, $add_column=FALSE)
+	{
+		$set = implode(",", array_reverse($array));
+		if (!$select) $select = "1";
+		$select .= ", @{$alias} := FIND_IN_SET({$key}, '{$set}')";
+		if ($add_column) $select .= " AS {$alias}";
+		return $select;
+	}
+
+
+	function _add_if_column($select, $alias, $true=1, $false=0)
+	{
+		if (!$select) $select = "1";
+		$select .= ", IF(@{$alias} = 0, {$true}, {$false}) AS {$alias}";
+		return $select;
+	}
+
+	/**
+	 * Returns a list of valid source names, paired with the name of the
+	 * underlying true source name
+	 * @return array
+	 */
+	function _get_source_map()
+	{
+		$sources = array();
+		$mapper = $this->get_registry()->get_utility('I_Displayed_Gallery_Source_Mapper');
+		foreach ($mapper->find_all() as $entity) {
+			$sources[$entity->name] = $entity->name;
+			foreach ($entity->aliases as $alias) $sources[$alias] = $entity->name;
+		}
+		return $sources;
+	}
+
+	/**
+	 * Parses the list of parameters provided in the displayed gallery, and
+	 * ensures everything meets expectations
+	 * @return boolean
+	 */
+	function _parse_parameters()
+	{
+		$valid = FALSE;
+
+		// Ensure that the source is valid
+		$sources = $this->object->_get_source_map();
+		if (isset($sources[$this->object->source])) {
+			$this->object->source = $sources[$this->object->source];
+			$valid = TRUE;
+		}
+
+		// Ensure that exclusions, entity_ids, and sortorder have valid elements.
+		// IE likes to send empty array as an array with a single element that
+		// has no value
+		if ($this->object->exclusions && !$this->object->exclusions[0]) {
+			$this->object->exclusions = array();
+		}
+		if ($this->object->entity_ids && !$this->object->entity_ids[0]) {
+			$this->object->entity_ids = array();
+		}
+		if ($this->object->sortorder && !$this->object->sortorder[0]) {
+			$this->object->sortorder = array();
+		}
+
+		return $valid;
+	}
+
+	/**
+	 * Returns a list of term ids for the list of tags
+	 * @global wpdb $wpdb
+	 * @param array $tags
+	 * @return array
+	 */
+	function get_term_ids_for_tags($tags=FALSE)
+	{
+		global $wpdb;
+
+        // If no tags were provided, get them from the container_ids
+        if (!$tags) $tags = $this->object->container_ids;
+
+		// Convert container ids to a string suitable for WHERE IN
+		$container_ids = array();
+        if (!in_array('all', array_map('strtolower', $tags))) {
+			foreach ($tags as $container) {
+				$container_ids[]= "'{$container}'";
+			}
+			$container_ids = implode(',', $container_ids);
+		}
+
+		// Construct query
+        $query = "SELECT {$wpdb->term_taxonomy}.term_id FROM {$wpdb->term_taxonomy}
+                  INNER JOIN {$wpdb->terms} ON {$wpdb->term_taxonomy}.term_id = {$wpdb->terms}.term_id
+                  WHERE {$wpdb->term_taxonomy}.term_id = {$wpdb->terms}.term_id
+                  AND {$wpdb->term_taxonomy}.taxonomy = %s";
+        if (!empty($container_ids))
+            $query .= " AND ({$wpdb->terms}.slug IN ({$container_ids}) OR {$wpdb->terms}.name IN ({$container_ids}))";
+        $query .= " ORDER BY {$wpdb->terms}.term_id";
+        $query = $wpdb->prepare($query, 'ngg_tag');
+
+		// Get all term_ids for each image tag slug
+		$term_ids = array();
+		foreach ($wpdb->get_results($query) as $row) {
+			$term_ids[] = $row->term_id;
+		}
+
+		return $term_ids;
+	}
+
+
+	/**
+	 * Sorts the results of an album query
+	 * @param stdClass $a
+	 * @param stdClass $b
+	 */
+	function _sort_album_result($a, $b)
+	{
+		$key = $this->object->order_by;
+		return strcmp($a->$key, $b->$key);
+	}
+}
+
+/**
+ * Provides instance methods useful for working with the C_Displayed_Gallery
+ * model
+ */
+class Mixin_Displayed_Gallery_Instance_Methods extends Mixin
+{
+	function get_entity()
+	{
+		$entity = $this->call_parent('get_entity');
+		unset($entity->post_author);
+		unset($entity->post_date);
+		unset($entity->post_date_gmt);
+		unset($entity->post_title);
+		unset($entity->post_excerpt);
+		unset($entity->post_status);
+		unset($entity->comment_status);
+		unset($entity->ping_status);
+		unset($entity->post_name);
+		unset($entity->to_ping);
+		unset($entity->pinged);
+		unset($entity->post_modified);
+		unset($entity->post_modified_gmt);
+		unset($entity->post_parent);
+		unset($entity->guid);
+		unset($entity->post_type);
+		unset($entity->post_mime_type);
+		unset($entity->comment_count);
+		unset($entity->filter);
+		unset($entity->post_content_filtered);
+
+		return $entity;
+	}
+
+
+	/**
+	 * Gets the display type object used in this displayed gallery
+	 * @return C_Display_Type
+	 */
+	function get_display_type()
+	{
+		$mapper = $this->object->get_registry()->get_utility('I_Display_Type_Mapper');
+		return  $mapper->find_by_name($this->object->display_type, TRUE);
+	}
+
+	/**
+	 * Gets the corresponding source instance
+	 * @return C_Displayed_Gallery_Source
+	 */
+	function get_source()
+	{
+		$sources = $this->object->_get_source_map();
+		$mapper = $this->get_registry()->get_utility('I_Displayed_Gallery_Source_Mapper');
+		$retval = $mapper->find_by_name($sources[$this->object->source], TRUE);
+		return $retval;
+	}
+
+	/**
+	 * Returns the galleries queries in this displayed gallery
+	 * @return array
+	 */
+	function get_galleries()
+	{
+		$retval = array();
+		if (($source = $this->object->get_source())) {
+			if (in_array('image', $source->returns)) {
+				$mapper			= $this->object->get_registry()->get_utility('I_Gallery_Mapper');
+				$gallery_key	= $mapper->get_primary_key_column();
+				$mapper->select();
+				if ($this->object->container_ids) {
+					$mapper->where(array("{$gallery_key} IN %s", $this->object->container_ids));
+				}
+				$retval			= $mapper->run_query();
+			}
+		}
+		return $retval;
+	}
+
+	/**
+	 * Gets albums queried in this displayed gallery
+	 * @return array
+	 */
+	function get_albums()
+	{
+		$retval = array();
+		if (($source = $this->object->get_source())) {
+			if (in_array('album', $source->returns)) {
+				$mapper		= $this->get_registry()->get_utility('I_Album_Mapper');
+				$album_key	= $mapper->get_primary_key_column();
+				if ($this->object->container_ids) {
+					$mapper->select()->where(array("{$album_key} IN %s", $this->object->container_ids));
+				}
+				$retval		= $mapper->run_query();
+			}
+		}
+		return $retval;
+	}
+
+    /**
+     * Returns a transient for the displayed gallery
+     * @return string
+     */
+    function to_transient()
+    {
+        // TODO: put this someplace more appropriate
+        // If the source is random do a separate image id lookup and fill those values into the gallery entity_ids
+        // This is necessary for compat w/Pro Lightbox so it can retrieve (through it's iframe request) the same images
+        // the viewer was previously looking at.
+        if (in_array($this->object->source, array('random', 'random_images')) && empty($this->object->entity_ids))
+        {
+            global $wpdb;
+
+            $image_ids = array();
+            $limit = (!empty($this->object->display_settings['images_per_page']) ? $this->object->display_settings['images_per_page'] : $this->object->maximum_entity_count);
+
+            $sql = "SELECT `pid` FROM `{$wpdb->nggpictures}` WHERE `exclude` = 0";
+            if (!empty($this->object->exclusions))
+                $sql .= sprintf(" AND `pid` NOT IN (%s)", implode(',', $this->object->exclusions));
+            $sql .= " ORDER BY RAND() LIMIT {$limit}";
+
+            foreach ($wpdb->get_results($sql, ARRAY_N) as $res) {
+                $image_ids[] = reset($res);
+            }
+
+            $this->object->entity_ids = $image_ids;
+        }
+
+		$group = 'displayed_galleries';
+		$key = C_Photocrati_Cache::generate_key($this->object->get_entity(), $group);
+		if (is_null(C_Photocrati_Cache::get($key, NULL, $group))) {
+			C_Photocrati_Cache::set($key, $this->object->get_entity(), $group, 1800);
+		}
+
+        return $key;
+    }
+
+
+    /**
+     * Applies the values of a transient to this object
+     * @param string $transient_id
+     */
+    function apply_transient($transient_id)
+    {
+		$retval = FALSE;
+		if (($transient = C_Photocrati_Cache::get($transient_id, FALSE, 'displayed_galleries'))) {
+			$this->object->_stdObject = $transient;
+			$retval = TRUE;
+		}
+
+		return $retval;
+    }
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery_mapper.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery_mapper.php
new file mode 100644
index 0000000000000000000000000000000000000000..bbacde657a26dd6de582cf9d3af9ae1c4ae76a54
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery_mapper.php
@@ -0,0 +1,101 @@
+<?php
+
+class C_Displayed_Gallery_Mapper extends C_CustomPost_DataMapper_Driver
+{
+	static $_instances = array();
+
+	function define($context=FALSE)
+	{
+		parent::define(NULL, array($context, 'display_gallery'));
+		$this->add_mixin('Mixin_Displayed_Gallery_Defaults');
+		$this->implement('I_Displayed_Gallery_Mapper');
+		$this->set_model_factory_method('displayed_gallery');
+//		$this->add_post_hook(
+//			'save',
+//			'Propagate thumbnail dimensions',
+//			'Hook_Propagate_Thumbnail_Dimensions_To_Settings'
+//		);
+	}
+
+
+	/**
+	 * Initializes the mapper
+	 * @param string|array|FALSE $context
+	 */
+	function initialize()
+	{
+		parent::initialize('displayed_gallery');
+	}
+
+
+	/**
+	 * Gets a singleton of the mapper
+	 * @param string|array $context
+	 * @return C_Displayed_Gallery_Mapper
+	 */
+    public static function get_instance($context = False)
+    {
+        if (!isset(self::$_instances[$context]))
+        {
+            self::$_instances[$context] = new C_Displayed_Gallery_Mapper($context);
+        }
+        return self::$_instances[$context];
+    }
+}
+
+/**
+ * Adds default values for the displayed gallery
+ */
+class Mixin_Displayed_Gallery_Defaults extends Mixin
+{
+	/**
+	 * Gets a display type object for a particular entity
+	 * @param stdClass|C_DataMapper_Model $entity
+	 * @return null|stdClass
+	 */
+	function get_display_type($entity)
+	{
+		$mapper = $this->object->get_registry()->get_utility('I_Display_Type_Mapper');
+		return $mapper->find_by_name($entity->display_type);
+	}
+
+	/**
+	 * Sets defaults needed for the entity
+	 * @param type $entity
+	 */
+	function set_defaults($entity)
+	{
+		// Ensure that we have a settings array
+		if (!isset($entity->display_settings)) $entity->display_settings = array();
+
+		// If the display type is set, then get it's settings and apply them as
+		// defaults to the "display_settings" of the displayed gallery
+		if (isset($entity->display_type)) {
+
+			// Get display type mapper
+			if (($display_type = $this->object->get_display_type($entity))) {
+				$entity->display_settings = $this->array_merge_assoc(
+					$display_type->settings, $entity->display_settings, TRUE
+				);
+			}
+		}
+
+		// Default ordering
+		$settings = C_NextGen_Settings::get_instance();
+		$this->object->_set_default_value($entity, 'order_by', $settings->galSort);
+		$this->object->_set_default_value($entity, 'order_direction', $settings->galSortDir);
+
+        // Ensure we have an exclusions array
+        $this->object->_set_default_value($entity, 'exclusions', array());
+
+		// Ensure other properties exist
+		$this->object->_set_default_value($entity, 'container_ids', array());
+		$this->object->_set_default_value($entity, 'excluded_container_ids', array());
+        $this->object->_seT_default_value($entity, 'sortorder',     array());
+		$this->object->_set_default_value($entity, 'entity_ids', array());
+		$this->object->_set_default_value($entity, 'returns', 'included');
+
+		// Set maximum_entity_count
+		$this->object->_set_default_value($entity, 'maximum_entity_count', $settings->maximum_entity_count);
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery_renderer.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery_renderer.php
new file mode 100644
index 0000000000000000000000000000000000000000..a3bbc9bfbc17a58da8dc1526eb5e5ca3dd48c96f
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery_renderer.php
@@ -0,0 +1,318 @@
+<?php
+
+class C_Displayed_Gallery_Renderer extends C_Component
+{
+    static $_instances = array();
+
+    /**
+     * Returns an instance of the class
+     * @param mixed $context
+     * @return C_Displayed_Gallery_Renderer
+     */
+    static function get_instance($context=FALSE)
+    {
+        if (!isset(self::$_instances[$context])) {
+            $klass = __CLASS__;
+            self::$_instances[$context]= new $klass($context);
+        }
+        return self::$_instances[$context];
+    }
+
+
+    /**
+     * Defines the object
+     * @param bool $context
+     */
+    function define($context=FALSE)
+    {
+        parent::define($context);
+        $this->add_mixin('Mixin_Displayed_Gallery_Renderer');
+        $this->implement('I_Displayed_Gallery_Renderer');
+    }
+}
+
+
+/**
+ * Provides the ability to render a display type
+ */
+class Mixin_Displayed_Gallery_Renderer extends Mixin
+{
+    /**
+     * Displays a "displayed gallery" instance
+     *
+     * Alias Properties:
+     * gallery_ids/album_ids/tag_ids == container_ids
+     * image_ids/gallery_ids		 == entity_ids
+     *
+     * Default Behavior:
+     * - if order_by and order_direction are missing, the default settings
+     *   are used from the "Other Options" page. The exception to this is
+     *   when entity_ids are selected, in which the order is custom unless
+     *   specified.
+     *
+     * How to use:
+     *
+     * To retrieve images from gallery 1 & 3, but exclude images 4 & 6:
+     * [ngg_images gallery_ids="1,3" exclusions="4,6" display_type="photocrati-nextgen_basic_thumbnails"]
+     *
+     * To retrieve images 1 & 2 from gallery 1:
+     * [ngg_images gallery_ids="1" image_ids="1,2" display_type="photocrati-nextgen_basic_thumbnails"]
+     *
+     * To retrieve images matching tags "landscapes" and "wedding shoots":
+     * [ngg_images tag_ids="landscapes,wedding shoots" display_type="photocrati-nextgen_basic_thumbnails"]
+     *
+     * To retrieve galleries from albums 1 & #, but exclude sub-album 1:
+     * [ngg_images album_ids="1,2" exclusions="a1" display_type="photocrati-nextgen_basic_compact_album"]
+     *
+     * To retrieve galleries from albums 1 & 2, but exclude gallery 1:
+     * [ngg_images album_ids="1,2" exclusions="1" display_type="photocrati-nextgen_basic_compact_album"]
+     *
+     * To retrieve image 2, 3, and 5 - independent of what container is used
+     * [ngg_images image_ids="2,3,5" display_type="photocrati-nextgen_basic_thumbnails"]
+     *
+     * To retrieve galleries 3 & 5, custom sorted, in album view
+     * [ngg_images source="albums" gallery_ids="3,5" display_type="photocrati-nextgen_basic_compact_album"]
+     *
+     * To retrieve recent images, sorted by alt/title text
+     * [ngg_images source="recent" order_by="alttext" display_type="photocrati-nextgen_basic_thumbnails"]
+     *
+     * To retrieve random image
+     * [ngg_images source="random" display_type="photocrati-nextgen_basic_thumbnails"]
+     *
+     * To retrieve a single image
+     * [ngg_images image_ids='8' display_type='photocrati-nextgen_basic_singlepic']
+     *
+     * To retrieve a tag cloud
+     * [ngg_images tagcloud=yes display_type='photocrati-nextgen_basic_tagcloud']
+     */
+    function display_images($params, $inner_content=NULL, $mode=NULL)
+    {
+        $retval = '';
+        $displayed_gallery = NULL;
+
+        // Get the NextGEN settings to provide some defaults
+        $settings = C_NextGen_Settings::get_instance();
+
+        // Configure the arguments
+        $defaults = array(
+            'id'				=>	NULL,
+            'source'			=>	'',
+            'container_ids'		=>	array(),
+            'gallery_ids'		=>	array(),
+            'album_ids'			=>	array(),
+            'tag_ids'			=>	array(),
+            'display_type'		=>	'',
+            'exclusions'		=>	array(),
+            'order_by'			=>	$settings->galSort,
+            'order_direction'	=>	$settings->galSortOrder,
+            'image_ids'			=>	array(),
+            'entity_ids'		=>	array(),
+            'tagcloud'          => FALSE,
+            'inner_content'     => $inner_content,
+            'returns'           => 'included',
+            'slug'              => NULL
+        );
+        $args = shortcode_atts($defaults, $params);
+
+        // Are we loading a specific displayed gallery that's persisted?
+        $mapper = $this->get_registry()->get_utility('I_Displayed_Gallery_Mapper');
+        if (!is_null($args['id'])) {
+            $displayed_gallery = $mapper->find($args['id']);
+            unset($mapper); // no longer needed
+        }
+
+        // We're generating a new displayed gallery
+        else {
+            // Perform some conversions...
+
+            // Galleries?
+            if ($args['gallery_ids'])
+            {
+                if ($args['source'] != 'albums' AND $args['source'] != 'album')
+                {
+                    $args['source']        = 'galleries';
+                    $args['container_ids'] = $args['gallery_ids'];
+                    if ($args['image_ids'])
+                        $args['entity_ids'] = $args['image_ids'];
+                }
+                elseif ($args['source'] == 'albums') {
+                    $args['entity_ids']	= $args['gallery_ids'];
+                }
+                unset($args['gallery_ids']);
+            }
+
+            // Albums ?
+            elseif ($args['album_ids'] || $args['album_ids'] === '0') {
+                $args['source'] = 'albums';
+                $args['container_ids'] = $args['album_ids'];
+                unset($args['albums_ids']);
+            }
+
+            // Tags ?
+            elseif ($args['tag_ids']) {
+                $args['source'] = 'tags';
+                $args['container_ids'] = $args['tag_ids'];
+                unset($args['tag_ids']);
+            }
+
+            // Specific images selected
+            elseif ($args['image_ids']) {
+                $args['source'] = 'galleries';
+                $args['entity_ids'] = $args['image_ids'];
+                unset($args['image_ids']);
+            }
+
+            // Tagcloud support
+            elseif ($args['tagcloud']) {
+                $args['source'] = 'tags';
+            }
+
+            // Convert strings to arrays
+            if (!is_array($args['container_ids']))
+                $args['container_ids'] = preg_split("/,|\|/", $args['container_ids']);
+
+            if (!is_array($args['exclusions']))
+                $args['exclusions'] = preg_split("/,|\|/", $args['exclusions']);
+
+            if (!is_array($args['entity_ids']))
+                $args['entity_ids'] = preg_split("/,|\|/", $args['entity_ids']);
+
+            // Get the display settings
+            foreach (array_keys($defaults) as $key) {
+                unset($params[$key]);
+            }
+
+            $args['display_settings'] = $params;
+
+            // Create the displayed gallery
+            $factory = $this->get_registry()->get_utility('I_Component_Factory');
+            $displayed_gallery = $factory->create('displayed_gallery', $mapper, $args);
+
+            unset($factory);
+        }
+
+        // Validate the displayed gallery
+        if ($displayed_gallery) {
+            if ($displayed_gallery->validate()) {
+
+                // Set a temporary id
+                $displayed_gallery->id($displayed_gallery->to_transient());
+
+
+                // Display!
+                return $this->object->render($displayed_gallery, TRUE, $mode);
+            }
+            else {
+                if (C_NextGEN_Bootstrap::$debug)
+                    $retval = "Invalid Displayed Gallery" . var_dump($displayed_gallery->get_errors());
+                else
+                    $retval = "Gallery not found. Please <strong>check your settings</strong>.";
+            }
+        }
+        else {
+            $retval = "Invalid Displayed Gallery";
+        }
+        return $retval;
+    }
+
+
+    /**
+     * Renders a displayed gallery on the frontend
+     * @param C_Displayed_Gallery|stdClass $displayed_gallery
+     */
+    function render($displayed_gallery, $return=FALSE, $mode = null)
+    {
+        // Simply throwing our rendered gallery into a feed will most likely not work correctly.
+        // The MediaRSS option in NextGEN is available as an alternative.
+        if(is_feed())
+            return '';
+
+    		if ($mode == null)
+    		{
+    			$mode = 'normal';
+    		}
+
+        // Save the displayed gallery as a transient if it hasn't already. Allows for ajax operations
+        // to add or modify the gallery without losing a retrievable ID
+        if (empty($displayed_gallery->transient_id))
+            $displayed_gallery->transient_id = $displayed_gallery->to_transient();
+
+        // Get the display type controller
+        $controller = $this->get_registry()->get_utility(
+            'I_Display_Type_Controller', $displayed_gallery->display_type
+        );
+
+		// Enqueue any necessary static resources
+		$controller->enqueue_frontend_resources($displayed_gallery);
+
+		// Get routing info
+		$router = $url = C_Router::get_instance();
+		$url    = $router->get_url($router->get_request_uri(), TRUE);
+
+		// Should we lookup in cache?
+		$lookup = TRUE;
+		if ($displayed_gallery->source == 'random_images') $lookup = FALSE;
+		elseif (is_array($displayed_gallery->container_ids) && in_array('All', $displayed_gallery->container_ids)) $lookup = FALSE;
+		elseif ($displayed_gallery->source == 'albums' && ($controller->param('gallery')) OR $controller->param('album')) $lookup = FALSE;
+		elseif (!$controller->cachable) $lookup = FALSE;
+
+		// Try cache lookup, if we're to do so
+		$key = null;
+		$html = FALSE;
+		if ($lookup) {
+			// Some settings affect display types
+			$settings = C_NextGen_Settings::get_instance();
+			$key_params = apply_filters('ngg_displayed_gallery_cache_params', array(
+				$displayed_gallery->get_entity(),
+				$url,
+				$mode,
+				$settings->activateTags,
+				$settings->appendType,
+				$settings->maxImages,
+				$settings->thumbEffect,
+				$settings->thumbCode,
+				$settings->galSort,
+				$settings->galSortDir
+			));
+
+			// Try getting the rendered HTML from the cache
+			$key  = C_Photocrati_Cache::generate_key($key_params);
+			$html = C_Photocrati_Cache::get($key, FALSE);
+
+			// TODO: This is hack. We need to figure out a more uniform way of detecting dynamic image urls
+			if (strpos($html, C_Photocrati_Settings_Manager::get_instance()->dynamic_thumbnail_slug) !== FALSE) {
+				$html = FALSE; // forces the cache to be re-generated
+			}
+		}
+
+		// If a cached version doesn't exist, then create the cache
+		if (!$html) {
+			$current_mode = $controller->get_render_mode();
+			$controller->set_render_mode($mode);
+			$html = $controller->index_action($displayed_gallery, TRUE);
+			if ($key != null) 
+				C_Photocrati_Cache::set($key, $html);
+			$controller->set_render_mode($current_mode);
+
+			// Compress the html to avoid wpautop problems
+			$html = $this->compress_html($html);
+		}
+
+		if (!$return) echo $html;
+
+		return $html;
+    }
+
+	/**
+	 * Removes any un-nessessary whitespace from the HTML
+	 * @param string $html
+	 * @return string
+	 */
+	function compress_html($html)
+	{
+		$html = preg_replace("/>\\s+/", ">", $html);
+		$html = preg_replace("/\\s+</", "<", $html);
+		$html = preg_replace("/<!--(?:(?!-->).)*-->/m", "", $html);
+		return $html;
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery_source.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery_source.php
new file mode 100644
index 0000000000000000000000000000000000000000..39a26ad4d91e98e4ea41ac44242da6a31a8037f4
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery_source.php
@@ -0,0 +1,49 @@
+<?php
+/**
+ * Properties:
+ * - title
+ * - name
+ * - returns
+ */
+class C_Displayed_Gallery_Source extends C_DataMapper_Model
+{
+	var $_mapper_interface = 'I_Displayed_Gallery_Source_Mapper';
+
+	function define($mapper, $properties, $context=FALSE)
+	{
+		parent::define($mapper, $properties, $context);
+		$this->add_mixin('Mixin_Displayed_Gallery_Source');
+		$this->implement('I_Displayed_Gallery_Source');
+	}
+
+
+	/**
+	 * Creates an instance of a displayed gallery source
+	 * @param type $mapper
+	 * @param type $properties
+	 */
+	function initialize($mapper=FALSE, $properties=array())
+	{
+		// If no mapper was specified, then get the mapper
+		if (!$mapper) $mapper = $this->get_registry()->get_utility($this->_mapper_interface);
+
+		// Construct the model
+		parent::initialize($mapper, $properties);
+	}
+}
+
+class Mixin_Displayed_Gallery_Source extends Mixin
+{
+	/**
+	 * Validates the object
+	 * @return bool
+	 */
+	function validation()
+	{
+		$this->object->validates_presence_of('title');
+		$this->object->validates_presence_of('name');
+		$this->object->validates_presence_of('returns');
+		$this->object->validates_uniqueness_of('name');
+		return $this->object->is_valid();
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery_source_mapper.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery_source_mapper.php
new file mode 100644
index 0000000000000000000000000000000000000000..5262f9eb3adcd2fb646b68ced79689d7357e4568
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery_source_mapper.php
@@ -0,0 +1,89 @@
+<?php
+
+class C_Displayed_Gallery_Source_Mapper extends C_CustomPost_DataMapper_Driver
+{
+
+	// We maintain singleton objects of this class for each particular context
+	// used
+	static $_instances = array();
+
+	/**
+	 * Returns an instance of this class using a particular context
+	 * @param string|array|bool $context
+	 * @return C_Displayed_Gallery_Source_Mapper
+	 */
+	static function &get_instance($context=FALSE)
+	{
+		if (!isset(self::$_instances[$context])) {
+			$klass = get_class();
+			self::$_instances[$context] = new $klass($context);
+		}
+		return self::$_instances[$context];
+	}
+
+	/**
+	 * Define the mapper
+	 * @param string|array|bool $context
+	 */
+	function define($context=FALSE)
+	{
+		$object_name = 'gal_display_source';
+
+		// Add the object name to the context of the object as well
+		// This allows us to adapt the driver itself, if required
+		if (!is_array($context)) $context = array($context);
+		array_push($context, $object_name);
+
+		// Define the driver
+		parent::define(NULL, $context);
+
+		// Add the mixin of instance methods
+		$this->add_mixin('Mixin_Displayed_Gallery_Source_Mapper');
+
+		// Implement the interface
+		$this->implement('I_Displayed_Gallery_Source_Mapper');
+
+		// Set the factory method for instantiating models
+		$this->set_model_factory_method('displayed_gallery_source');
+	}
+
+	/**
+	 * Initializes the datamapper driver
+	 */
+	function initialize()
+	{
+		parent::initialize('gal_display_source');
+	}
+}
+
+class Mixin_Displayed_Gallery_Source_Mapper extends Mixin
+{
+	/**
+	 * Provides a means to find a displayed gallery source with a particular name
+	 * @param string $name
+	 */
+	function find_by_name($name, $return_models=FALSE)
+	{
+		$retval = $this->object->find_all(array("name = %s", $name), $return_models);
+		return array_pop($retval);
+	}
+
+	/**
+	 * Uses the title attribute as the post title
+	 * @param stdClass $entity
+	 * @return string
+	 */
+	function get_post_title($entity)
+	{
+		return $entity->title;
+	}
+
+	/**
+	 * Sets default values for a source
+	 * @param stdClass|C_DataMapper_Model $entity
+	 */
+	function set_defaults($entity)
+	{
+		if (!isset($entity->aliases)) $entity->aliases = array();
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/class.gallery_display_installer.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/class.gallery_display_installer.php
new file mode 100644
index 0000000000000000000000000000000000000000..c6c9d7dc802b0bdd818f4c4b296cc82ac3b92a69
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/class.gallery_display_installer.php
@@ -0,0 +1,133 @@
+<?php
+
+class C_Gallery_Display_Installer
+{
+	function get_registry()
+	{
+		return C_Component_Registry::get_instance();
+	}
+
+	/**
+	 * Installs a display type
+	 * @param string $name
+	 * @param array $properties
+	 */
+	function install_display_type($name, $properties=array())
+	{
+		// Try to find the existing entity. If it doesn't exist, we'll create
+		$fs					= $this->get_registry()->get_utility('I_Fs');
+		$mapper				= $this->get_registry()->get_utility('I_Display_Type_Mapper');
+		$display_type		= $mapper->find_by_name($name);
+		if (!$display_type)	$display_type = new stdClass;
+
+		// Update the properties of the display type
+		$properties['name'] = $name;
+		foreach ($properties as $key=>$val) {
+			if ($key == 'preview_image_relpath') {
+				$val = $fs->find_static_relpath($val);
+			}
+			$display_type->$key = $val;
+		}
+
+		// Save the entity
+		$retval = $mapper->save($display_type);
+		return $retval;
+	}
+
+	function install_displayed_gallery_source($name, $properties)
+	{
+		// Try to find the existing source. If not found, then we'll create
+		$mapper = $this->get_registry()->get_utility('I_Displayed_Gallery_Source_Mapper');
+		$source = $mapper->find_by_name($name);
+		if (!$source) $source = new stdClass;
+
+		// Update the properties
+		foreach ($properties as $key=>$val) $source->$key = $val;
+		$source->name = $name;
+
+		// Save!
+		$mapper->save($source);
+		unset($mapper);
+	}
+
+	/**
+	 * Deletes all displayed galleries
+	 */
+	function uninstall_displayed_galleries()
+	{
+		$mapper = $this->get_registry()->get_utility('I_Displayed_Gallery_Mapper');
+		$mapper->delete()->run_query();
+	}
+
+	/**
+	 * Uninstalls all display types
+	 */
+	function uninstall_display_types()
+	{
+		$mapper = $this->get_registry()->get_utility('I_Display_Type_Mapper');
+		$mapper->delete()->run_query();
+	}
+
+	/**
+	 * Installs displayed gallery sources
+	 */
+	function install($reset=FALSE)
+	{
+		$this->install_displayed_gallery_source('galleries', array(
+			'title'		=>	'Galleries',
+			'returns'	=>	array('image'),
+			'aliases'	=>	array('gallery', 'images', 'image')
+		));
+
+		$this->install_displayed_gallery_source('albums', array(
+			'title'		=>	'Albums',
+			'returns'	=>	array('gallery', 'album'),
+			'aliases'	=>	array('album')
+		));
+
+		$this->install_displayed_gallery_source('tags', array(
+			'title'		=>	'Tags',
+			'returns'	=>	array('image'),
+			'aliases'	=>	array('tag', 'image_tag', 'image_tags')
+		));
+
+		$this->install_displayed_gallery_source('random_images', array(
+			'title'		=>	'Random Images',
+			'returns'	=>	array('image'),
+			'aliases'	=>	array('random', 'random_image')
+		));
+
+		$this->install_displayed_gallery_source('recent_images', array(
+			'title'		=>	'Recent images',
+			'returns'	=>	array('image'),
+			'aliases'	=>	array('recent', 'recent_image')
+		));
+	}
+
+	/**
+	 * Deletes all displayed gallery sources
+	 */
+	function uninstall_displayed_gallery_sources()
+	{
+		$mapper = $this->get_registry()->get_utility('I_Displayed_Gallery_Source_Mapper');
+		$mapper->delete()->run_query();
+	}
+
+	/**
+	 * Uninstalls this module
+	 */
+	function uninstall($hard = FALSE)
+	{
+		// Flush displayed gallery cache
+		C_Photocrati_Cache::flush();
+		C_Photocrati_Cache::flush('displayed_galleries');
+
+		$this->uninstall_display_types();
+		$this->uninstall_displayed_gallery_sources();
+		
+		// TODO temporary Don't remove galleries on uninstall
+		//if ($hard) $this->uninstall_displayed_galleries();
+	}
+
+
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/hook.propagate_thumbnail_dimensions_to_settings.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/hook.propagate_thumbnail_dimensions_to_settings.php
new file mode 100644
index 0000000000000000000000000000000000000000..b553984984fd857e139c4f68c0180d215fccd452
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/hook.propagate_thumbnail_dimensions_to_settings.php
@@ -0,0 +1,29 @@
+<?php
+
+/**
+ * Propagates saving thumbnail dimensions to global NextGEN Settings
+ */
+class Hook_Propagate_Thumbnail_Dimensions_To_Settings extends Hook
+{
+	function save($entity)
+	{
+		if ($this->object->get_method_property('save',
+		  ExtensibleObject::METHOD_PROPERTY_RETURN_VALUE)) {
+			$settings			= C_NextGen_Settings::get_instance();
+			$display_settings	= isset($entity->settings) ? $entity->settings : $entity->display_settings;
+			if (isset($display_settings['thumbnail_width']) && isset($display_settings['thumbnail_height'])) {
+				$width				= $display_settings['thumbnail_width'];
+				$height				= $display_settings['thumbnail_height'];
+				$new_dimension		= "{$width}x{$height}";
+				$dimensions			= $settings->thumbnail_dimensions;
+
+				if (!in_array($new_dimension, $dimensions)) {
+					$dimensions[]	= $new_dimension;
+					sort($dimensions);
+					$settings->thumbnail_dimensions = $dimensions;
+					$settings->save();
+				}
+			}
+		}
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/interface.display_settings_controller.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/interface.display_settings_controller.php
new file mode 100644
index 0000000000000000000000000000000000000000..e487e875db7e61600cf24683a512983bcd0316da
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/interface.display_settings_controller.php
@@ -0,0 +1,6 @@
+<?php
+
+interface I_Display_Settings_Controller
+{
+	
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/interface.display_type.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/interface.display_type.php
new file mode 100644
index 0000000000000000000000000000000000000000..f326df5366e7f8e54d15018b9ec9589eac72833f
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/interface.display_type.php
@@ -0,0 +1,6 @@
+<?php
+
+interface I_Display_Type extends I_DataMapper_Model
+{
+	function is_compatible_with_source($source);
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/interface.display_type_controller.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/interface.display_type_controller.php
new file mode 100644
index 0000000000000000000000000000000000000000..768b563bc4266da4a89b36677078f9574fbceb22
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/interface.display_type_controller.php
@@ -0,0 +1,6 @@
+<?php
+
+interface I_Display_Type_Controller extends I_MVC_Controller
+{
+
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/interface.display_type_form.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/interface.display_type_form.php
new file mode 100644
index 0000000000000000000000000000000000000000..38fd1f8dd4ff732ae09c2fde80744acec3fbe411
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/interface.display_type_form.php
@@ -0,0 +1,5 @@
+<?php
+
+interface I_Display_Type_Form
+{
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/interface.display_type_mapper.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/interface.display_type_mapper.php
new file mode 100644
index 0000000000000000000000000000000000000000..356c7828bb0cee43b49609312606b305c5e8f01e
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/interface.display_type_mapper.php
@@ -0,0 +1,6 @@
+<?php
+
+interface I_Display_Type_Mapper
+{
+	
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/interface.displayed_gallery.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/interface.displayed_gallery.php
new file mode 100644
index 0000000000000000000000000000000000000000..1198bfc4fac1193fbba375ca6886895776c23c62
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/interface.displayed_gallery.php
@@ -0,0 +1,6 @@
+<?php
+
+interface I_Displayed_Gallery extends I_DataMapper_Model
+{
+
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/interface.displayed_gallery_mapper.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/interface.displayed_gallery_mapper.php
new file mode 100644
index 0000000000000000000000000000000000000000..735436ee023edb483cc6c49ac1d63e0854941a1e
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/interface.displayed_gallery_mapper.php
@@ -0,0 +1,6 @@
+<?php
+
+interface I_Displayed_Gallery_Mapper
+{
+	
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/interface.displayed_gallery_renderer.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/interface.displayed_gallery_renderer.php
new file mode 100644
index 0000000000000000000000000000000000000000..2c25cea76376300b16bedd3bb0069dd512bdab98
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/interface.displayed_gallery_renderer.php
@@ -0,0 +1,6 @@
+<?php
+
+interface I_Displayed_Gallery_Renderer
+{
+
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/interface.displayed_gallery_source.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/interface.displayed_gallery_source.php
new file mode 100644
index 0000000000000000000000000000000000000000..ae1c0f264e87e5f3820dab51d69f8802080fef06
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/interface.displayed_gallery_source.php
@@ -0,0 +1,6 @@
+<?php
+
+interface I_Displayed_Gallery_Source
+{
+	
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/interface.displayed_gallery_source_mapper.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/interface.displayed_gallery_source_mapper.php
new file mode 100644
index 0000000000000000000000000000000000000000..dd3e64ddd1ad01024059ed7081cb416af8f5674b
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/interface.displayed_gallery_source_mapper.php
@@ -0,0 +1,10 @@
+<?php
+
+interface I_Displayed_Gallery_Source_Mapper
+{
+	/**
+	 * Provides a means to find a displayed gallery source with a particular name
+	 * @param string $name
+	 */
+	function find_by_name($name);
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/mixin.display_type_form.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/mixin.display_type_form.php
new file mode 100644
index 0000000000000000000000000000000000000000..bafc2fc0139451ac72373887806d731902c74b44
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/mixin.display_type_form.php
@@ -0,0 +1,57 @@
+<?php
+
+class Mixin_Display_Type_Form extends Mixin
+{
+	var $_model = null;
+	
+
+  function initialize()
+  {
+  	$this->object->implement('I_Display_Type_Form');
+  }
+  
+	/**
+	 * Returns the name of the display type. Sub-class should override
+	 * @throws Exception
+	 * @returns string
+	 */
+	function get_display_type_name()
+	{
+		throw new Exception(__METHOD__." not implemented");
+	}
+
+	/**
+	 * Returns the model (display type) used in the form
+	 * @return stdClass
+	 */
+	function get_model()
+	{
+		if ($this->_model == null)
+		{
+			$mapper = $this->get_registry()->get_utility('I_Display_Type_Mapper');
+			$this->_model = $mapper->find_by_name($this->object->get_display_type_name(), TRUE);
+		}
+		
+		return $this->_model;
+	}
+
+	/**
+	 * Returns the title of the form, which is the title of the display type
+	 * @returns string
+	 */
+	function get_title()
+	{
+		return $this->object->get_model()->title;
+	}
+        
+        
+        /**
+         * Saves the settings for the display type
+         * @param array $attributes
+         * @return boolean
+         */
+        function save_action($attributes=array())
+        {
+            return $this->object->get_model()->save(array('settings'=>$attributes));
+        }
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/module.nextgen_gallery_display.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/module.nextgen_gallery_display.php
new file mode 100644
index 0000000000000000000000000000000000000000..9eabfcd478bc883c5b3e733e71a3e3b49c8e4f17
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/module.nextgen_gallery_display.php
@@ -0,0 +1,303 @@
+<?php
+
+/***
+	{
+		Module: photocrati-nextgen_gallery_display,
+		Depends: { photocrati-simple_html_dom }
+	}
+***/
+
+define('NEXTGEN_DISPLAY_SETTINGS_SLUG', 'ngg_display_settings');
+define('NEXTGEN_DISPLAY_PRIORITY_BASE', 10000);
+define('NEXTGEN_DISPLAY_PRIORITY_STEP', 2000);
+
+class M_Gallery_Display extends C_Base_Module
+{
+	function define()
+	{
+		parent::define(
+			'photocrati-nextgen_gallery_display',
+			'Gallery Display',
+			'Provides the ability to display gallery of images',
+			'0.3',
+			'http://www.photocrati.com',
+			'Photocrati Media',
+			'http://www.photocrati.com'
+		);
+
+		include_once('class.gallery_display_installer.php');
+		C_Photocrati_Installer::add_handler($this->module_id, 'C_Gallery_Display_Installer');
+	}
+
+
+	/**
+	 * Register utilities required for this module
+	 */
+	function _register_utilities()
+	{
+		// This utility provides a controller to render the settings form
+		// for a display type, or render the front-end of a display type
+		$this->get_registry()->add_utility(
+			'I_Display_Type_Controller',
+			'C_Display_Type_Controller'
+		);
+
+		// This utility provides a datamapper for Display Types
+		$this->get_registry()->add_utility(
+			'I_Display_Type_Mapper',
+			'C_Display_Type_Mapper'
+		);
+
+		// This utility provides a datamapper for Displayed Galleries. A
+		// displayed gallery is the association between some entities (images
+		//or galleries) and a display type
+		$this->get_registry()->add_utility(
+			'I_Displayed_Gallery_Mapper',
+			'C_Displayed_Gallery_Mapper'
+		);
+
+		// This utility provides a datamapper for Displayed Gallery Sources. A
+		// source instructs a displayed gallery where the entities are to be
+		// fetched from - e.g. galleries, albums, etc.
+		$this->get_registry()->add_utility(
+			'I_Displayed_Gallery_Source_Mapper',
+			'C_Displayed_Gallery_Source_Mapper'
+		);
+
+        // This utility provides the capabilities of rendering a display type
+        $this->get_registry()->add_utility(
+            'I_Displayed_Gallery_Renderer',
+            'C_Displayed_Gallery_Renderer'
+        );
+	}
+
+	/**
+	 * Registers adapters required for this module
+	 */
+	function _register_adapters()
+	{
+		// Provides factory methods for creating display type and
+		// displayed gallery instances
+		$this->get_registry()->add_adapter(
+			'I_Component_Factory', 'A_Gallery_Display_Factory'
+		);
+
+		$this->get_registry()->add_adapter(
+			'I_Page_Manager',
+			'A_Display_Settings_Page'
+		);
+
+		$this->_get_registry()->add_adapter(
+			'I_Ajax_Controller',
+			'A_Gallery_Display_Ajax'
+		);
+
+		$this->get_registry()->add_adapter('I_MVC_View', 'A_Gallery_Display_View');
+	}
+
+	/**
+	 * Registers hooks for the WordPress framework
+	 */
+	function _register_hooks()
+	{
+		// Add a shortcode for displaying galleries
+		C_NextGen_Shortcode_Manager::add('ngg_images', array(&$this, 'display_images'));
+        add_action('init', array(&$this, '_register_resources'));
+        add_action('admin_bar_menu', array(&$this, 'add_admin_bar_menu'), 100);
+        add_filter('the_content', array($this, '_render_related_images'));
+	}
+
+  function _render_related_string()
+  {
+      $settings = C_NextGen_Settings::get_instance();
+      $type = $settings->appendType;
+      $maxImages = $settings->maxImages;
+      $sluglist = array();
+
+      switch ($type) {
+          case 'tags':
+              if (function_exists('get_the_tags'))
+              {
+                  $taglist = get_the_tags();
+                  if (is_array($taglist)) {
+                      foreach ($taglist as $tag) {
+                          $sluglist[] = $tag->slug;
+                      }
+                  }
+              }
+              break;
+          case 'category':
+              $catlist = get_the_category();
+              if (is_array($catlist))
+              {
+                  foreach ($catlist as $cat) {
+                      $sluglist[] = $cat->category_nicename;
+                  }
+              }
+              break;
+      }
+
+      $taglist = implode(',', $sluglist);
+
+      if ($taglist === 'uncategorized' || empty($taglist))
+          return;
+
+      $renderer = C_Component_Registry::get_instance()->get_utility('I_Displayed_Gallery_Renderer');
+      $view     = C_Component_Registry::get_instance()->get_utility('I_Component_Factory')
+                                                      ->create('mvc_view', '');
+      $retval = $renderer->display_images(array(
+          'source' => 'tags',
+          'container_ids' => $taglist,
+          'display_type' => NEXTGEN_GALLERY_BASIC_THUMBNAILS,
+          'images_per_page' => $maxImages,
+          'maximum_entity_count' => $maxImages,
+          'template' => $view->get_template_abspath('photocrati-nextgen_gallery_display#related'),
+          'show_all_in_lightbox' => FALSE,
+          'show_slideshow_link' => FALSE,
+          'disable_pagination' => TRUE,
+          'display_no_images_error' => FALSE
+      ));
+
+      return apply_filters('ngg_show_related_gallery_content', $retval, $taglist);
+  }
+
+	function _render_related_images($content)
+	{
+    $settings = C_NextGen_Settings::get_instance();
+      
+		if ($settings->get('activateTags')) {
+			$related = $this->_render_related_string();
+			
+			if ($related != null) {
+		    $heading = $settings->relatedHeading;
+				$content .= $heading . $related;
+			}
+		}
+		
+		return $content;
+	}
+
+    /**
+     * Adds menu item to the admin bar
+     */
+    function add_admin_bar_menu()
+    {
+        global $wp_admin_bar;
+
+        if ( current_user_can('NextGEN Change options') ) {
+            $wp_admin_bar->add_menu(array(
+                'parent' => 'ngg-menu',
+                'id' => 'ngg-menu-display_settings',
+                'title' => __('Gallery Settings', 'nggallery'),
+                'href' => admin_url('admin.php?page=ngg_display_settings')
+            ));
+        }
+    }
+
+    /**
+     * Registers our static settings resources so the ATP module can find them later
+     */
+    function _register_resources()
+    {
+        $router = $this->get_registry()->get_utility('I_Router');
+
+        wp_register_script(
+            'nextgen_gallery_display_settings',
+            $router->get_static_url('photocrati-nextgen_gallery_display#nextgen_gallery_display_settings.js'),
+            array('jquery-ui-accordion', 'jquery-ui-tooltip')
+        );
+
+        wp_register_style(
+            'nextgen_gallery_display_settings',
+            $router->get_static_url('photocrati-nextgen_gallery_display#nextgen_gallery_display_settings.css')
+        );
+
+        wp_register_style(
+            'nextgen_gallery_related_images',
+            $router->get_static_url('photocrati-nextgen_gallery_display#nextgen_gallery_related_images.css')
+        );
+        wp_enqueue_style('nextgen_gallery_related_images');
+
+        wp_register_script(
+            'jquery.nextgen_radio_toggle',
+            $router->get_static_url('photocrati-nextgen_gallery_display#jquery.nextgen_radio_toggle.js'),
+            array('jquery')
+        );
+
+        wp_register_script('ngg_common', $router->get_static_url('photocrati-nextgen_gallery_display#common.js'), array('jquery'));
+    }
+
+
+	/**
+	 * Adds the display settings page to wp-admin
+	 */
+	function add_display_settings_page()
+	{
+		add_submenu_page(
+			NGGFOLDER,
+			_('NextGEN Gallery & Album Settings'),
+			_('Gallery Settings'),
+			'NextGEN Change options',
+			NEXTGEN_DISPLAY_SETTINGS_SLUG,
+			array(&$this->controller, 'index_action')
+		);
+	}
+
+	/**
+	 * Provides the [display_images] shortcode
+	 * @param array $params
+	 * @param string $inner_content
+	 * @return string
+	 */
+	function display_images($params, $inner_content=NULL)
+	{
+		$renderer = $this->get_registry()->get_utility('I_Displayed_Gallery_Renderer');
+		return $renderer->display_images($params, $inner_content);
+	}
+
+    /**
+     * Gets a value from the parameter array, and if not available, uses the default value
+     *
+     * @param string $name
+     * @param mixed $default
+     * @param array $params
+     * @return mixed
+     */
+    function _get_param($name, $default, $params)
+    {
+        return (isset($params[$name])) ? $params[$name] : $default;
+    }
+
+    function get_type_list()
+    {
+        return array(
+			'A_Gallery_Display_Ajax'		=>	'adapter.gallery_display_ajax.php',
+            'A_Display_Settings_Controller' => 'adapter.display_settings_controller.php',
+            'A_Display_Settings_Page' 		=> 'adapter.display_settings_page.php',
+            'A_Gallery_Display_Factory' 	=> 'adapter.gallery_display_factory.php',
+            'C_Gallery_Display_Installer' 	=> 'class.gallery_display_installer.php',
+            'A_Gallery_Display_View' 		=> 'adapter.gallery_display_view.php',
+            'C_Displayed_Gallery' 			=> 'class.displayed_gallery.php',
+            'C_Displayed_Gallery_Mapper' 	=> 'class.displayed_gallery_mapper.php',
+            'C_Displayed_Gallery_Renderer' 	=> 'class.displayed_gallery_renderer.php',
+            'C_Displayed_Gallery_Source' 	=> 'class.displayed_gallery_source.php',
+            'C_Displayed_Gallery_Source_Mapper' => 'class.displayed_gallery_source_mapper.php',
+            'C_Display_Type' 				=> 'class.display_type.php',
+            'C_Display_Type_Controller' 	=> 'class.display_type_controller.php',
+            'C_Display_Type_Mapper' 		=> 'class.display_type_mapper.php',
+            'Hook_Propagate_Thumbnail_Dimensions_To_Settings' => 'hook.propagate_thumbnail_dimensions_to_settings.php',
+            'I_Displayed_Gallery' 			=> 'interface.displayed_gallery.php',
+            'I_Displayed_Gallery_Mapper' 	=> 'interface.displayed_gallery_mapper.php',
+            'I_Displayed_Gallery_Renderer' 	=> 'interface.displayed_gallery_renderer.php',
+            'I_Displayed_Gallery_Source' 	=> 'interface.displayed_gallery_source.php',
+            'I_Displayed_Gallery_Source_Mapper' => 'interface.displayed_gallery_source_mapper.php',
+            'I_Display_Settings_Controller' => 'interface.display_settings_controller.php',
+            'I_Display_Type' 				=> 'interface.display_type.php',
+            'I_Display_Type_Controller' 	=> 'interface.display_type_controller.php',
+            'I_Display_Type_Mapper' 		=> 'interface.display_type_mapper.php',
+            'Mixin_Display_Type_Form' 		=> 'mixin.display_type_form.php'
+        );
+    }
+}
+
+new M_Gallery_Display();
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/common.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/common.js
new file mode 100644
index 0000000000000000000000000000000000000000..717453a5a36da27ededa2806295afd84e04abbfa
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/common.js
@@ -0,0 +1,85 @@
+(function($){
+    window.NggPaginatedGallery = function(displayed_gallery_id, container, links) {
+        this.displayed_gallery_id = displayed_gallery_id;
+        this.links                = links;
+        this.container            = container;
+
+        this.get_displayed_gallery_obj = function(){
+            var index = 'gallery_'+this.displayed_gallery_id;
+            if (typeof(window.galleries[index]) == 'undefined')
+                return false;
+            else
+                return window.galleries[index];
+        };
+
+
+        this.enable_ajax_pagination = function(){
+            var transient_id = this.get_displayed_gallery_obj().transient_id;
+            var obj         = this;
+
+            // Attach a click event handler for each pagination link to
+            // adjust the request to be sent via XHR
+            this.links.each(function(){
+                var $link = $(this);
+                $link.click(function(e){
+                    e.preventDefault();
+
+                    // Describe AJAX request
+                    var request = {
+                        action: 'render_displayed_gallery',
+                        displayed_gallery_id: transient_id,
+                        ajax_referrer: $link.attr('href')
+                    }
+
+                    // Notify the user that we're busy
+                    obj.do_ajax(request);
+                });
+            });
+        };
+
+        this.do_ajax = function(request){
+
+            var container    = this.container;
+
+            // Adjust the user notification
+            window['ngg_ajax_operaton_count']++;
+            $('body, a').css('cursor', 'wait');
+
+            // Send the AJAX request
+            $.post(photocrati_ajax.url, request, function(response){
+
+                // Adjust the user notification
+                window['ngg_ajax_operaton_count']--;
+                if (window['ngg_ajax_operaton_count'] <= 0) {
+                    window['ngg_ajax_operaton_count'] = 0;
+                    $('body, a').css('cursor', 'auto');
+                }
+
+                // Ensure that the server returned JSON
+                if (typeof(response) != 'object') response = JSON.parse(response);
+                if (response) {
+                    container.replaceWith(response.html);
+
+                    // Let the user know that we've refreshed the content
+                    $(document).trigger('refreshed');
+                }
+            });
+        };
+
+        // Initialize
+        var displayed_gallery = this.get_displayed_gallery_obj();
+        if (displayed_gallery) {
+            if (typeof(displayed_gallery.display_settings['ajax_pagination']) != 'undefined') {
+                if (parseInt(displayed_gallery.display_settings['ajax_pagination'])) {
+                    this.enable_ajax_pagination();
+                }
+            }
+        }
+
+        // We maintain a count of all the current AJAX actions initiated
+        if (typeof(window['ngg_ajax_operation_count']) == 'undefined') {
+            window['ngg_ajax_operaton_count'] = 0;
+        }
+    };
+
+})(jQuery);
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/jquery.nextgen_radio_toggle.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/jquery.nextgen_radio_toggle.js
new file mode 100644
index 0000000000000000000000000000000000000000..bfbe721ba7d78149383b4eb48a55d3b2bdaa66ee
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/jquery.nextgen_radio_toggle.js
@@ -0,0 +1,17 @@
+(function($) {
+    // invoke this on your radio-button set with:
+    // val: 0|1 - whether to activate on 'on' or 'off'
+    // target: a jquery selector - the thing to toggle
+    $.fn.nextgen_radio_toggle_tr = function(val, target) {
+        return this.each(function() {
+            var $this = $(this);
+            $this.bind('change', function() {
+                if ($this.val() == val) {
+                    target.show('slow');
+                } else {
+                    target.hide('slow');
+                }
+            });
+        });
+    }
+})(jQuery);
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/nextgen_gallery_display_settings.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/nextgen_gallery_display_settings.css
new file mode 100644
index 0000000000000000000000000000000000000000..8dc1b740a407a2b0a4fb9fa57bd8ec346960d802
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/nextgen_gallery_display_settings.css
@@ -0,0 +1,52 @@
+.gallery_page_ngg_display_settings table {
+    height: 100%;
+}
+
+.gallery_page_ngg_display_settings table tr td:first-child {
+    vertical-align: top;
+    text-align: right;
+    padding-right: 7px;
+}
+
+.gallery_page_ngg_display_settings textarea {
+    height: 60px;
+}
+
+.gallery_page_ngg_display_settings textarea,
+.gallery_page_ngg_display_settings input[type=text] {
+    width: 155px;
+}
+
+.gallery_page_ngg_display_settings input[type=number] {
+    width: 75px;
+    text-align: center;
+}
+
+.gallery_page_ngg_display_settings select {
+    width: 155px;
+    text-align: center;
+}
+
+/* paired width & width unit field on same line */
+.gallery_page_ngg_display_settings select.nextgen_settings_field_width_and_unit,
+.gallery_page_ngg_display_settings input.nextgen_settings_field_width_and_unit {
+    text-align: center;
+    width: 75px;
+}
+
+/* paired width & height fields on same line */
+.gallery_page_ngg_display_settings input.nextgen_settings_field_width_and_height {
+    width: 65px;
+}
+
+.entity_errors {
+    color: red;
+}
+
+.entity_errors ul {
+    margin-left: 30px;
+}
+
+.entity_errors ul li {
+    list-style-type: disc;
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/nextgen_gallery_display_settings.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/nextgen_gallery_display_settings.js
new file mode 100644
index 0000000000000000000000000000000000000000..7ebb3ab57fc33631b92ca98bd1a7ee14b3028aea
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/nextgen_gallery_display_settings.js
@@ -0,0 +1,12 @@
+jQuery(function($) {
+
+    $('.accordion').accordion({
+        clearStyle: true,
+        autoHeight: false,
+        heightStyle: 'content'
+    });
+
+    $('input, textarea').placeholder();
+    $('label.tooltip, span.tooltip').tooltip();
+
+});
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/nextgen_gallery_related_images.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/nextgen_gallery_related_images.css
new file mode 100644
index 0000000000000000000000000000000000000000..fce8537e3d7d2d91d830c5ce356e152e3794d398
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/nextgen_gallery_related_images.css
@@ -0,0 +1,22 @@
+
+/* ----------- Related images -------------*/
+.ngg-related-gallery {
+	background:#F9F9F9;
+	border:1px solid #E0E0E0;
+	overflow:hidden;
+	margin-bottom:1em;
+	margin-top:1em;
+	padding:5px;
+}
+.ngg-related-gallery img {
+	border: 1px solid #DDDDDD;
+	float: left;
+	margin: 0pt 3px;
+	padding: 2px;
+	height: 50px;
+	width:  50px;
+}
+
+.ngg-related-gallery img:hover {
+	border: 1px solid #000000;
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/alt_view_link_text.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/alt_view_link_text.php
new file mode 100644
index 0000000000000000000000000000000000000000..30b255dccb8e6c9171515e88cc1533b1b508e9aa
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/alt_view_link_text.php
@@ -0,0 +1,18 @@
+<tr id='tr_<?php print esc_attr("{$display_type_name}_alt_view_link_text"); ?>' class='<?php print !empty($hidden) ? 'hidden' : ''; ?>'>
+    <td>
+        <label for='<?php echo esc_attr($display_type_name); ?>_alt_view_link_text' class='tooltip'>
+            <?php echo_h($alt_view_link_text_label); ?>
+			<span>
+				<?php echo_h($tooltip)?>
+			</span>
+        </label>
+    </td>
+    <td>
+        <input type='text'
+               id='<?php echo esc_attr($display_type_name); ?>_alt_view_link_text'
+               name='<?php echo esc_attr($display_type_name); ?>[alternative_view_link_text]'
+               class='alt_view_link_text'
+               placeholder='<?php _e('link text'); ?>'
+               value='<?php echo esc_attr($alternative_view_link_text); ?>'/>
+    </td>
+</tr>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/alternative_view.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/alternative_view.php
new file mode 100644
index 0000000000000000000000000000000000000000..cba056cdc88b92900badfc9c9f3383ab176571f3
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/alternative_view.php
@@ -0,0 +1,20 @@
+<tr id='tr_<?php print esc_attr("{$display_type_name}_alternative_view"); ?>' class='<?php print !empty($hidden) ? 'hidden' : ''; ?>'>
+    <td>
+        <label for='<?php echo esc_attr($display_type_name); ?>_alternative_view' class="tooltip">
+            <?php echo_h($show_alt_view_link_label); ?>
+			<span>
+				<?php echo_h($tooltip) ?>
+			</span>
+        </label>
+    </td>
+    <td>
+		<select class="ngg_alternative_view" name='<?php echo esc_attr($display_type_name); ?>[alternative_view]'>
+			<option value="0" <?php echo selected(0, $alternative_view) ?>>None</option>
+			<?php foreach ($altviews as $altview_name => $altview_properties): ?>
+			<option value="<?php echo esc_attr($altview_name)?>" <?php echo selected($altview_name, $alternative_view)?>>
+				<?php echo_h($altview_properties['title'])?>
+			</option>
+			<?php endforeach ?>
+		</select>
+    </td>
+</tr>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/container/after.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/container/after.php
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/container/before.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/container/before.php
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/image/after.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/image/after.php
new file mode 100644
index 0000000000000000000000000000000000000000..70552e75d3c7fca9349313360a96a92cd722f2f3
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/image/after.php
@@ -0,0 +1 @@
+</div> 
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/image/before.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/image/before.php
new file mode 100644
index 0000000000000000000000000000000000000000..f0b1d800521db5fe46927b402548d646f417e277
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/image/before.php
@@ -0,0 +1,7 @@
+<?php
+	if (!isset($id))
+	{
+		$id = 'ngg-image-' . $index;
+	}
+?>
+<div id="<?php echo_h($id) ?>" class="<?php echo_h($class) ?>" <?php if (isset($image->style)) echo $image->style; ?>>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/index.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/index.php
new file mode 100644
index 0000000000000000000000000000000000000000..8b5109d79ace1b029ea7232aac0161301d9642b2
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/index.php
@@ -0,0 +1,9 @@
+<h1>Default Gallery Type Template</h1>
+<p>
+	This is the default gallery type template, located in:<br/>
+	<b><?php echo_h(__FILE__)?></b>.
+</p>
+<p>
+	If you're seeing this, it's because the gallery type you selected has not
+	provided a template of it's own.
+</p>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/list/after.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/list/after.php
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/list/before.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/list/before.php
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/no_images_found.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/no_images_found.php
new file mode 100644
index 0000000000000000000000000000000000000000..1c719662da13da2c5f088124763640b8e81e31e5
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/no_images_found.php
@@ -0,0 +1 @@
+<p>no images were found</p>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/related.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/related.php
new file mode 100644
index 0000000000000000000000000000000000000000..46c185ecbaf094d84545ef4a24344d9d260c5a6a
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/related.php
@@ -0,0 +1,18 @@
+<div class="ngg-related-gallery">
+    <?php foreach ($images as $image) { ?>
+
+        <?php
+        $controller = C_Component_Registry::get_instance()->get_utility('I_Display_Type_Controller');
+        $effect_code = $controller->get_effect_code($gallery->displayed_gallery);
+        ?>
+
+        <a href="<?php echo $image->imageURL; ?>"
+           title="<?php echo stripslashes(nggGallery::i18n($image->description, 'pic_' . $image->pid . '_description')); ?>"
+           <?php echo $effect_code; ?>>
+            <img title="<?php echo stripslashes(nggGallery::i18n($image->alttext, 'pic_' . $image->pid . '_alttext')); ?>"
+                 alt="<?php echo stripslashes(nggGallery::i18n($image->alttext, 'pic_' . $image->pid . '_alttext')); ?>"
+                 data-image-id="<?php echo esc_attr($image->{$image->id_field})?>"
+                 src="<?php echo $image->thumbURL; ?>"/>
+        </a>
+    <?php } ?>
+</div>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/return_link_text.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/return_link_text.php
new file mode 100644
index 0000000000000000000000000000000000000000..bf93e50483720a409b6692e9c4ee2175f180bff5
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/return_link_text.php
@@ -0,0 +1,18 @@
+<tr id='tr_<?php print esc_attr("{$display_type_name}_return_link_text"); ?>' class='<?php print !empty($hidden) ? 'hidden' : ''; ?>'>
+    <td>
+        <label for='<?php echo esc_attr($display_type_name); ?>_return_link_text' class='tooltip'>
+            <?php echo_h($return_link_text_label); ?>
+			<span>
+				<?php echo_h($tooltip)?>
+			</span>
+        </label>
+    </td>
+    <td>
+        <input type='text'
+               id='<?php echo esc_attr($display_type_name); ?>_return_link_text'
+               name='<?php echo esc_attr($display_type_name); ?>[return_link_text]'
+               class='return_link_text'
+               placeholder='<?php _e('link text'); ?>'
+               value='<?php echo esc_attr($return_link_text); ?>'/>
+    </td>
+</tr>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/show_altview_link.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/show_altview_link.php
new file mode 100644
index 0000000000000000000000000000000000000000..82d608df5c6e4b7719dd108d81dd7e5f317abd47
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/show_altview_link.php
@@ -0,0 +1,27 @@
+<tr id='tr_<?php print esc_attr("{$display_type_name}_show_altview_link"); ?>' class='<?php print !empty($hidden) ? 'hidden' : ''; ?>'>
+    <td>
+        <label for='<?php echo esc_attr($display_type_name); ?>_show_altview_link' class='tooltip'>
+            <?php echo_h($show_alt_view_link_label); ?>
+			<span>
+                <?php echo_h($tooltip); ?>
+            </span>
+        </label>
+    </td>
+    <td>
+		<input type="radio"
+			id='<?php echo esc_attr($display_type_name); ?>_show_altview_link'
+			name='<?php echo esc_attr($display_type_name); ?>[show_alternative_view_link]'
+			class='show_altview_link'
+			value='1'
+			<?php echo checked(1, intval($show_alternative_view_link)); ?>'>
+		<label for='<?php echo esc_attr($display_type_name); ?>_show_altview_link'>Yes</label>
+		&nbsp;
+		<input type="radio"
+			id='<?php echo esc_attr($display_type_name); ?>_show_altview_link_no'
+			name='<?php echo esc_attr($display_type_name); ?>[show_alternative_view_link]'
+			class='show_altview_link'
+			value='0'
+			<?php echo checked(0, $show_alternative_view_link); ?>/>
+		<label for='<?php echo esc_attr($display_type_name); ?>_show_altview_link_no'>No</label>
+    </td>
+</tr>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/show_return_link.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/show_return_link.php
new file mode 100644
index 0000000000000000000000000000000000000000..7cbb716d62da345b3b21d2ee01b3b0125a082e7f
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/show_return_link.php
@@ -0,0 +1,27 @@
+<tr id='tr_<?php print esc_attr("{$display_type_name}_show_return_link"); ?>' class='<?php print !empty($hidden) ? 'hidden' : ''; ?>'>
+    <td>
+        <label for='<?php echo esc_attr($display_type_name); ?>_show_return_link' class="tooltip">
+            <?php echo_h($show_return_link_label); ?>
+			<span>
+				<?php echo_h($tooltip) ?>
+			</span>
+        </label>
+    </td>
+    <td>
+		<input type="radio"
+			id='<?php echo esc_attr($display_type_name); ?>_show_return_link'
+			name='<?php echo esc_attr($display_type_name); ?>[show_return_link]'
+			class='show_return_link'
+			value='1'
+			<?php echo checked(1, intval($show_return_link)); ?>'>
+		<label for='<?php echo esc_attr($display_type_name); ?>_show_return_link'>Yes</label>
+		&nbsp;
+		<input type="radio"
+			id='<?php echo esc_attr($display_type_name); ?>_show_return_link_no'
+			name='<?php echo esc_attr($display_type_name); ?>[show_return_link]'
+			class='show_return_link'
+			value='0'
+			<?php echo checked(0, $show_return_link); ?>/>
+		<label for='<?php echo esc_attr($display_type_name); ?>_show_return_link_no'>No</label>
+    </td>
+</tr>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.image_options_form.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.image_options_form.php
new file mode 100644
index 0000000000000000000000000000000000000000..509e4d193170d58f3277f980a1fdaec3bf25f367
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.image_options_form.php
@@ -0,0 +1,230 @@
+<?php
+
+class A_Image_Options_Form extends Mixin
+{
+	function get_model()
+	{
+		return C_Settings_Model::get_instance();
+	}
+
+	function get_title()
+	{
+		return 'Image Options';
+	}
+
+	/**
+	 * Returns the options available for sorting images
+	 * @return array
+	 */
+	function _get_image_sorting_options()
+	{
+		return array(
+			'Custom'					=>	'sortorder',
+			'Image ID'					=>	'pid',
+			'Filename'					=>	'filename',
+			'Alt/Title Text'			=>	'alttext',
+			'Date/Time'					=>	'imagedate'
+		);
+	}
+
+
+	/**
+	 * Returns the options available for sorting directions
+	 * @return array
+	 */
+	function _get_sorting_direction_options()
+	{
+		return array(
+			'Ascending'					=>	'ASC',
+			'Descending'				=>	'DESC'
+		);
+	}
+
+
+	/**
+	 * Returns the options available for matching related images
+	 */
+	function _get_related_image_match_options()
+	{
+		return array(
+			'Categories'				=>	'category',
+			'Tags'						=>	'tags'
+		);
+	}
+        
+        /**
+         * Tries to create the gallery storage directory if it doesn't exist
+         * already
+         * @return string
+         */
+        function _create_gallery_storage_dir($gallerypath=NULL)
+        {
+            $retval = TRUE;
+
+            if (!$gallerypath) $gallerypath = $this->object->get_model()->get('gallerypath');
+            $fs = $this->get_registry()->get_utility('I_Fs');
+            $gallerypath = $fs->get_abspath($gallerypath);
+            if (!@file_exists($gallerypath)) {
+                @mkdir($gallerypath);
+                $retval = @file_exists($gallerypath);
+            }
+            
+            return $retval;
+        }
+
+        /*
+         * Renders the form
+         */
+	function render()
+	{
+		if (!$this->object->_create_gallery_storage_dir()) {
+			$this->object->get_model()->add_error( _('Gallery path does not exist and could not be created'), 'gallerypath');
+		}
+            
+		$settings = $this->object->get_model();
+		return $this->render_partial('photocrati-nextgen_other_options#image_options_tab', array(
+			'gallery_path_label'			=>	_('Where would you like galleries stored?'),
+			'gallery_path_help'				=>	_('Where galleries and their images are stored'),
+			'gallery_path'					=>	$settings->gallerypath,
+			'delete_image_files_label'		=>	_('Delete Image Files?'),
+			'delete_image_files_help'		=>	_('When enabled, image files will be removed after a Gallery has been deleted'),
+			'delete_image_files'			=>	$settings->deleteImg,
+			'show_related_images_label'		=>	_('Show Related Images on Posts?'),
+			'show_related_images_help'		=>	_('When enabled, related images will be appended to each post by matching the posts tags/categories to image tags'),
+			'show_related_images'			=>	$settings->activateTags,
+			'related_images_hidden_label'	=>	_('(Show Customization Settings)'),
+			'related_images_active_label'	=>	_('(Hide Customization Settings)'),
+			'match_related_images_label'	=>	_('How should related images be match?'),
+			'match_related_images'			=>	$settings->appendType,
+			'match_related_image_options'	=>	$this->object->_get_related_image_match_options(),
+			'max_related_images_label'		=>	_('Maximum # of related images to display'),
+			'max_related_images'			=>	$settings->maxImages,
+			'related_images_heading_label'	=>	_('Heading for related images'),
+			'related_images_heading'			=>	$settings->relatedHeading,
+			'sorting_order_label'			=>	_("What's the default sorting method?"),
+			'sorting_order_options'			=>	$this->object->_get_image_sorting_options(),
+			'sorting_order'					=>	$settings->galSort,
+			'sorting_direction_label'		=>	_('Sort in what direction?'),
+			'sorting_direction_options'		=>	$this->object->_get_sorting_direction_options(),
+			'sorting_direction'				=>	$settings->galSortDir,
+			'automatic_resize_label'		=>	'Automatically resize images after upload',
+			'automatic_resize_help'			=>	'It is recommended that your images be resized to be web friendly',
+			'automatic_resize'				=>	$settings->imgAutoResize,
+			'resize_images_label'			=>	_('What should images be resized to?'),
+			'resize_images_help'			=>	_('After images are uploaded, they will be resized to the above dimensions and quality'),
+			'resized_image_width_label'		=>	_('Width:'),
+			'resized_image_height_label'	=>	_('Height:'),
+			'resized_image_quality_label'	=>	_('Quality:'),
+			'resized_image_width'			=>	$settings->imgWidth,
+			'resized_image_height'			=>  $settings->imgHeight,
+			'resized_image_quality'			=>	$settings->imgQuality,
+			'backup_images_label'			=>	_('Backup the original images?'),
+			'backup_images_yes_label'		=>	_('Yes'),
+			'backup_images_no_label'		=>	_('No'),
+			'backup_images'					=>	$settings->imgBackup
+                    
+		), TRUE);
+	}
+
+	function save_action($image_options)
+	{
+		$save = TRUE;
+		if (($image_options)) {
+
+			// Update the gallery path. Moves all images to the new location
+			if (isset($image_options['gallerypath']) && (!is_multisite() || get_current_blog_id() == 1)) {
+				$fs               = $this->get_registry()->get_utility('I_Fs');
+				$original_dir     = $fs->get_abspath($this->object->get_model()->get('gallerypath'));
+				$new_dir	  = $fs->get_abspath($image_options['gallerypath']);
+        $image_options['gallerypath'] = $fs->add_trailing_slash($image_options['gallerypath']);
+
+				// Note: the below file move is disabled because it's quite unreliable as it doesn't perform any checks
+				//       For instance changing gallery path from /wp-content to /wp-content/gallery would attempt a recursive copy and then delete ALL files under wp-content, which would be disastreus
+#				// If the gallery path has changed...
+#				if ($original_dir != $new_dir) {
+
+#                    // Try creating the new directory
+#                    if ($this->object->_create_gallery_storage_dir($new_dir) AND is_writable($new_dir)) {
+
+#					    // Try moving files
+#						$this->object->recursive_copy($original_dir, $new_dir);
+#						$this->object->recursive_delete($original_dir);
+
+#						// Update gallery paths
+#						$mapper = $this->get_registry()->get_utility('I_Gallery_Mapper');
+#						foreach ($mapper->find_all() as $gallery) {
+#							$gallery->path = $image_options['gallerypath'] . $gallery->name;
+#							$mapper->save($gallery);
+#						}
+#					}
+#					else {
+#						$this->get_model()->add_error("Unable to change gallery path. Insufficient filesystem permissions");
+#						$save = FALSE;
+#					}
+#				}
+			}
+			elseif (isset($image_options['gallerypath'])) {
+				unset($image_options['gallerypath']);
+			}
+
+			// Update image options
+			if ($save) $this->object->get_model()->set($image_options)->save();
+		}
+	}
+
+	/**
+	 * Copies one directory to another
+	 * @param string $src
+	 * @param string $dst
+	 * @return boolean
+	 */
+	function recursive_copy($src, $dst)
+	{
+		$retval = TRUE;
+		$dir = opendir($src);
+		@mkdir($dst);
+		while(false !== ( $file = readdir($dir)) ) {
+			if (( $file != '.' ) && ( $file != '..' )) {
+				if ( is_dir($src . '/' . $file) ) {
+					if (!$this->object->recursive_copy($src . '/' . $file,$dst . '/' . $file)) {
+						$retval = FALSE;
+						break;
+					}
+				}
+				else {
+					if (!copy($src . '/' . $file,$dst . '/' . $file)) {
+						$retval = FALSE;
+						break;
+					}
+				}
+			}
+		}
+		closedir($dir);
+		return $retval;
+	}
+
+	/**
+	 * Deletes all files within a particular directory
+	 * @param string $dir
+	 * @return boolean
+	 */
+	function recursive_delete($dir)
+	{
+		$retval = FALSE;
+        $fp = opendir($dir);
+		while(false !== ( $file = readdir($fp)) ) {
+			if (( $file != '.' ) && ( $file != '..' )) {
+                $file = $dir.'/'.$file;
+				if ( is_dir($file) ) {
+					$retval = $this->object->recursive_delete($file);
+				}
+				else {
+					$retval = unlink($file);
+				}
+			}
+		}
+        closedir($fp);
+        @rmdir($dir);
+		return $retval;
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.lightbox_manager_form.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.lightbox_manager_form.php
new file mode 100644
index 0000000000000000000000000000000000000000..c8e21908cba403354f33de6512eb0d822f8c35d4
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.lightbox_manager_form.php
@@ -0,0 +1,98 @@
+<?php
+
+class A_Lightbox_Manager_Form extends Mixin
+{
+	function get_model()
+	{
+		return C_Settings_Model::get_instance();
+	}
+
+	function get_title()
+	{
+		return 'Lightbox Effects';
+	}
+
+	function render()
+	{
+        $form_manager = C_Form_Manager::get_instance();
+		$mapper       = $this->object->get_registry()->get_utility('I_Lightbox_Library_Mapper');
+
+        // retrieve and render the settings forms for each library
+        $sub_fields = array();
+        $advanced_fields = array();
+
+        foreach ($form_manager->get_forms(NEXTGEN_LIGHTBOX_OPTIONS_SLUG, TRUE) as $form) {
+            $form->enqueue_static_resources();
+            $sub_fields[$form->context] = $form->render(FALSE);
+        }
+
+        foreach ($form_manager->get_forms(NEXTGEN_LIGHTBOX_ADVANCED_OPTIONS_SLUG, TRUE) as $form) {
+            $form->enqueue_static_resources();
+            $advanced_fields[$form->context] = $form->render(FALSE);
+        }
+
+		// Render container tab
+		return $this->render_partial(
+            'photocrati-nextgen_other_options#lightbox_library_tab',
+            array(
+                'lightbox_library_label' => _('What effect would you like to use?'),
+                'libs'       => $mapper->find_all(),
+                'id_field'   => $mapper->get_primary_key_column(),
+                'selected'   => $this->object->get_model()->thumbEffect,
+                'sub_fields' => $sub_fields,
+                'adv_fields' => $advanced_fields
+            ),
+            TRUE
+        );
+	}
+
+    function save_action()
+	{
+		// Ensure that a lightbox library was selected
+		if (($id = $this->object->param('lightbox_library_id')))
+        {
+			$settings = $this->object->get_model();
+
+			// Get the lightbox library mapper and find the library selected
+			$mapper = $this->object->get_registry()->get_utility('I_Lightbox_Library_Mapper');
+			$library = $mapper->find($id, TRUE);
+
+			// If a valid library, we have updated settings from the user, then
+			// try saving the changes
+			if ($library)
+            {
+				if (($params = $this->object->param($library->name))) {
+            		// bind our new values, use display_settings if it isn't a part of the core library
+					foreach ($params as $k => $v) {
+		                if (isset($library->$k)) {
+		                    $library->$k = $v;
+		                }
+		                else {
+		                    $library->display_settings[$k] = $v;
+		                }
+
+		            }
+		            
+					$mapper->save($library);
+				}
+		
+				// If the requested changes weren't valid, add the validation
+				// errors to the C_NextGen_Settings object
+				if ($settings->is_invalid())
+                {
+					foreach ($library->get_errors() as $property => $errs) {
+						foreach ($errs as $error) {
+                            $settings->add_error($error, $property);
+                        }
+					}
+				}
+				// The lightbox library update was successful. Update C_NextGen_Settings
+				else {
+					$settings->thumbEffect = $library->name;
+					$settings->thumbCode   = $library->code;
+					$settings->save();
+				}
+			}
+		}
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.miscellaneous_form.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.miscellaneous_form.php
new file mode 100644
index 0000000000000000000000000000000000000000..98d5cb232a9f2e5e4579eb8a2d26270b6d24bec2
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.miscellaneous_form.php
@@ -0,0 +1,78 @@
+<?php
+
+class A_Miscellaneous_Form extends Mixin
+{
+	function get_model()
+	{
+		return C_Settings_Model::get_instance('global');
+	}
+
+	function get_title()
+	{
+		return 'Miscellaneous';
+	}
+
+	function render()
+	{
+		return $this->object->render_partial(
+            'photocrati-nextgen_other_options#misc_tab',
+            array(
+                'mediarss_activated'       => C_NextGen_Settings::get_instance()->useMediaRSS,
+                'mediarss_activated_label' => _('Add MediaRSS link?'),
+                'mediarss_activated_help'  => _('When enabled, adds a MediaRSS link to your header. Third-party web services can use this to publish your galleries'),
+                'mediarss_activated_no'    => _('No'),
+                'mediarss_activated_yes'   => _('Yes'),
+
+                'cache_label'        => _('Clear image cache'),
+                'cache_confirmation' => _("Completely clear the NextGEN cache of all image modifications?\n\nChoose [Cancel] to Stop, [OK] to proceed."),
+
+                 'slug_field' => $this->_render_text_field(
+                     (object)array('name' => 'misc_settings'),
+                     'router_param_slug',
+                     'Permalink slug',
+                     $this->object->get_model()->router_param_slug
+                 ),
+
+                'maximum_entity_count_field' => $this->_render_number_field(
+                    (object)array('name' => 'misc_settings'),
+                    'maximum_entity_count',
+                    'Maximum image count',
+                    $this->object->get_model()->maximum_entity_count,
+                    'This is the maximum limit of images that NextGEN will restrict itself to querying',
+                    FALSE,
+                    '',
+                    1
+                )
+            ),
+            TRUE
+        );
+	}
+
+    function cache_action()
+    {
+        $cache   = $this->get_registry()->get_utility('I_Cache');
+        $cache->flush_galleries();
+		C_Photocrati_Cache::flush();
+		C_Photocrati_Cache::flush('displayed_galleries');
+    }
+
+	function save_action()
+	{
+		if (($settings = $this->object->param('misc_settings')))
+        {
+			// The Media RSS setting is actually a local setting, not a global one
+			$local_settings = C_NextGen_Settings::get_instance();
+			$local_settings->set('useMediaRSS', $settings['useMediaRSS']);
+			unset($settings['useMediaRSS']);
+
+			// If the router slug has changed, then flush the cache
+			if ($settings['router_param_slug'] != $this->object->get_model()->router_param_slug) {
+				C_Photocrati_Cache::flush();
+			}
+
+			// Save both setting groups
+			$this->object->get_model()->set($settings)->save();
+			$local_settings->save();
+		}
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.other_options_controller.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.other_options_controller.php
new file mode 100644
index 0000000000000000000000000000000000000000..eeb517969a50a66efeb964d655da9fd99a71d5c0
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.other_options_controller.php
@@ -0,0 +1,29 @@
+<?php
+
+class A_Other_Options_Controller extends Mixin
+{
+	function enqueue_backend_resources()
+	{
+		$this->call_parent('enqueue_backend_resources');
+		wp_enqueue_script(
+			'nextgen_settings_page',
+			$this->get_static_url('photocrati-nextgen_other_options#nextgen_settings_page.js'),
+			array('jquery-ui-accordion', 'jquery-ui-tooltip', 'wp-color-picker')
+		);
+
+		wp_enqueue_style(
+			'nextgen_settings_page',
+			$this->get_static_url('photocrati-nextgen_other_options#nextgen_settings_page.css')
+		);
+	}
+
+	function get_page_title()
+	{
+		return 'Other Options';
+	}
+	
+	function get_required_permission()
+	{
+		return 'NextGEN Change options';
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.other_options_forms.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.other_options_forms.php
new file mode 100644
index 0000000000000000000000000000000000000000..44d8c8b3806c3f26ae72396b0c639b9807aba231
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.other_options_forms.php
@@ -0,0 +1,42 @@
+<?php
+
+class A_Other_Options_Forms extends Mixin
+{
+	function initialize()
+	{
+		$forms = array(
+			'image_options'     => 'A_Image_Options_Form',
+			'thumbnail_options' => 'A_Thumbnail_Options_Form',
+			'lightbox_effects'  => 'A_Lightbox_Manager_Form',
+			'watermarks'        => 'A_Watermarks_Form'
+		);
+
+		if (!is_multisite() || (is_multisite() && C_NextGen_Settings::get_instance()->get('wpmuStyle')))
+			$forms['styles'] = 'A_Styles_Form';
+
+		if (is_super_admin() && (!is_multisite() || (is_multisite() && C_NextGen_Settings::get_instance()->get('wpmuRoles'))))
+			$forms['roles_and_capabilities'] = 'A_Roles_Form';
+
+		$forms += array(
+			'image_options'			=>	'A_Image_Options_Form',
+			'thumbnail_options'		=>	'A_Thumbnail_Options_Form',
+			'lightbox_effects'		=>	'A_Lightbox_Manager_Form',
+			'watermarks'			=>	'A_Watermarks_Form',
+			'styles'				=>	'A_Styles_Form',
+			'roles_and_capabilities'=>	'A_Roles_Form',
+			'miscellaneous'			=>	'A_Miscellaneous_Form'
+		);
+
+		$registry = $this->object->get_registry();
+
+		foreach ($forms as $form => $adapter) {
+			$registry->add_adapter('I_Form', $adapter, $form);
+
+			$this->object->add_form(
+				NEXTGEN_OTHER_OPTIONS_SLUG,
+				$form
+			);
+		}
+
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.other_options_page.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.other_options_page.php
new file mode 100644
index 0000000000000000000000000000000000000000..a2c5b0100b16c6de1e15f1d4d2ba5b46e9e5fd23
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.other_options_page.php
@@ -0,0 +1,13 @@
+<?php
+
+class A_Other_Options_Page extends Mixin
+{
+	function initialize()
+	{
+		$this->object->add(
+			NEXTGEN_OTHER_OPTIONS_SLUG,
+			'A_Other_Options_Controller',
+			NGGFOLDER
+		);
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.reset_form.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.reset_form.php
new file mode 100644
index 0000000000000000000000000000000000000000..4385692bc58e86227655237d0537677921cd805d
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.reset_form.php
@@ -0,0 +1,59 @@
+<?php
+
+class A_Reset_Form extends Mixin
+{
+	function get_title()
+	{
+		return 'Reset Options';
+	}
+
+	function render()
+	{
+		return $this->object->render_partial(
+            'photocrati-nextgen_other_options#reset_tab',
+            array(
+                'reset_value'			=> _('Reset all options to default settings'),
+                'reset_warning'			=> _('Replace all existing options and gallery options with their default settings'),
+                'reset_label'			=> _('Reset settings'),
+                'reset_confirmation'	=> _("Reset all options to default settings?\n\nChoose [Cancel] to Stop, [OK] to proceed.")
+                // 'uninstall_label'		=> _('Deactivate & Uninstall'),
+				// 'uninstall_confirmation'=>_("Completely uninstall NextGEN Gallery (will reset settings and de-activate)?\n\nChoose [Cancel] to Stop, [OK] to proceed."),
+            ),
+            TRUE
+        );
+	}
+
+	function reset_action()
+	{
+        global $wpdb;
+
+		$installer = C_Photocrati_Installer::get_instance();
+        $settings  = C_NextGen_Settings::get_instance();
+
+        // removes lightbox, display type, and source settings
+		$installer->uninstall(NEXTGEN_GALLERY_PLUGIN_BASENAME);
+
+        // removes ngg_options entry in wp_options
+        $settings->destroy();
+        $settings->save();
+
+        // TODO: remove this sometime after 2.0.21
+        //
+        // Some installations of NextGen that upgraded from 1.9x to 2.0x have duplicate display types installed,
+        // so for now (as of 2.0.21) we explicitly remove all display types from the db as a way of fixing this
+        $wpdb->query($wpdb->prepare("DELETE FROM {$wpdb->posts} WHERE post_type = %s", 'display_type'));
+
+        // trigger the install routine
+		$installer->update(TRUE);
+	}
+
+    /*
+	function uninstall_action()
+	{
+		$installer = C_Photocrati_Installer::get_instance();
+		$installer->uninstall(NEXTGEN_GALLERY_PLUGIN_BASENAME, TRUE);
+		deactivate_plugins(NEXTGEN_GALLERY_PLUGIN_BASENAME);
+		wp_redirect(admin_url('/plugins.php'));
+	}
+    */
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.roles_form.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.roles_form.php
new file mode 100644
index 0000000000000000000000000000000000000000..a5bfab8a0220adab73592ba009b97a4f71a74001
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.roles_form.php
@@ -0,0 +1,22 @@
+<?php
+
+class A_Roles_Form extends Mixin
+{
+	function get_title()
+	{
+		return 'Roles & Capabilities';
+	}
+
+	function render()
+	{
+		$view = path_join(NGGALLERY_ABSPATH, implode(DIRECTORY_SEPARATOR, array(
+			'admin', 'roles.php'
+		)));
+		include_once ( $view );
+		ob_start();
+		nggallery_admin_roles();
+		$retval = ob_get_contents();
+		ob_end_clean();
+		return $retval;
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.styles_form.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.styles_form.php
new file mode 100644
index 0000000000000000000000000000000000000000..f91b5ca7d68c9cd263fb4b7665fd85fbd1aeb716
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.styles_form.php
@@ -0,0 +1,45 @@
+<?php
+
+class A_Styles_Form extends Mixin
+{
+	function get_model()
+	{
+		return C_Settings_Model::get_instance();
+	}
+
+	function get_title()
+	{
+		return 'Styles';
+	}
+
+	function render()
+	{
+		return $this->object->render_partial('photocrati-nextgen_other_options#styling_tab', array(
+			'select_stylesheet_label'	=>	'What stylesheet would you like to use?',
+			'stylesheets'				=>	C_NextGen_Style_Manager::get_instance()->find_all_stylesheets(),
+			'activated_stylesheet'		=>	$this->object->get_model()->CSSfile,
+			'hidden_label'				=>	_('(Show Customization Options)'),
+			'active_label'				=>	_('(Hide Customization Options)'),
+			'cssfile_contents_label'	=>	_('File Content:'),
+			'writable_label'			=>	_('Changes you make to the contents will be saved to'),
+			'readonly_label'			=>	_('You could edit this file if it were writable')
+		), TRUE);
+	}
+
+	function save_action()
+	{
+		// Ensure that we have
+		if (($settings = $this->object->param('style_settings'))) {
+			$this->object->get_model()->set($settings)->save();
+
+			// Are we to modify the CSS file?
+			if (($contents = $this->object->param('cssfile_contents'))) {
+
+				// Find filename
+				$css_file		= $settings['CSSfile'];
+				$styles = C_NextGen_Style_Manager::get_instance();
+				$styles->save($contents, $css_file);
+			}
+		}
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.stylesheet_ajax_actions.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.stylesheet_ajax_actions.php
new file mode 100644
index 0000000000000000000000000000000000000000..83a0e931bc896ca8f053c3873a3d1e1aa09f355b
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.stylesheet_ajax_actions.php
@@ -0,0 +1,49 @@
+<?php
+
+/**
+ * Registers new AJAX functions for retrieving/updating
+ * the contents of CSS stylesheets
+ */
+class A_Stylesheet_Ajax_Actions extends Mixin
+{
+	/**
+	 * Retrieves the contents of the CSS stylesheet specified
+	 */
+	function get_stylesheet_contents_action()
+	{
+		$retval = array();
+
+		if ($this->object->_authorized_for_stylesheet_action()) {
+
+			$styles 	= C_NextGen_Style_Manager::get_instance();
+			$abspath	= $styles->find_selected_stylesheet_abspath($this->object->param('cssfile'));
+			$writepath	= $styles->get_selected_stylesheet_saved_abspath($this->object->param('cssfile'));
+			if (is_readable($abspath)) {
+				$retval['contents'] = file_get_contents($abspath);
+				$retval['writable'] = is_writable($abspath);
+				$retval['abspath']  = $abspath;
+				$retval['writepath']= $writepath;
+			}
+			else $retval['error'] = "Could not find stylesheet";
+		}
+		else {
+			$retval['error'] = 'Unauthorized';
+		}
+
+		return $retval;
+
+	}
+
+
+	/**
+	 * Determines if the request is authorized
+	 * @return boolean
+	 */
+	function _authorized_for_stylesheet_action()
+	{
+		$security = $this->get_registry()->get_utility('I_Security_Manager');
+		$sec_actor = $security->get_current_actor();
+		
+		return $sec_actor->is_allowed('nextgen_edit_style');
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.thumbnail_options_form.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.thumbnail_options_form.php
new file mode 100644
index 0000000000000000000000000000000000000000..e61a07577d183f71c7a92f120b9c99dd665dc78c
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.thumbnail_options_form.php
@@ -0,0 +1,42 @@
+<?php
+
+class A_Thumbnail_Options_Form extends Mixin
+{
+	function get_model()
+	{
+		return C_Settings_Model::get_instance();
+	}
+
+	function get_title()
+	{
+		return 'Thumbnail Options';
+	}
+
+	function render()
+	{
+		$settings = $this->object->get_model();
+		
+		return $this->render_partial('photocrati-nextgen_other_options#thumbnail_options_tab', array(
+			'thumbnail_dimensions_label'		=>	_('Default thumbnail dimensions:'),
+			'thumbnail_dimensions_help'		=>	_('When generating thumbnails, what image dimensions do you desire?'),
+			'thumbnail_dimensions_width'		=>	$settings->thumbwidth,
+			'thumbnail_dimensions_height'		=>	$settings->thumbheight,
+			'thumbnail_crop_label'		=>	_('Set fix dimension?'),
+			'thumbnail_crop_help'		=>	_('Ignore the aspect ratio, no portrait thumbnails?'),
+			'thumbnail_crop'				=>	$settings->thumbfix,
+			'thumbnail_quality_label'		=>	_('Adjust Thumbnail Quality?'),
+			'thumbnail_quality_help'		=>	_('When generating thumbnails, what image quality do you desire?'),
+			'thumbnail_quality'				=>	$settings->thumbquality,
+			'size_list_label'		=>	_('Size List'),
+			'size_list_help'		=>	_('List of default sizes used for thumbnails and images'),
+			'size_list'		=>	$settings->thumbnail_dimensions,
+		), TRUE);
+	}
+
+	function save_action()
+	{
+		if (($settings = $this->object->param('thumbnail_settings'))) {
+			$this->object->get_model()->set($settings)->save();
+		}
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.watermarking_ajax_actions.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.watermarking_ajax_actions.php
new file mode 100644
index 0000000000000000000000000000000000000000..ae793c42e45e2f3b067bfa776effa13f1643df4e
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.watermarking_ajax_actions.php
@@ -0,0 +1,44 @@
+<?php
+
+class A_Watermarking_Ajax_Actions extends Mixin
+{
+	/**
+	 * Gets the new watermark preview url based on the new settings
+	 * @return array
+	 */
+	function get_watermark_preview_url_action()
+	{
+		$security = $this->get_registry()->get_utility('I_Security_Manager');
+		$sec_actor = $security->get_current_actor();
+		
+		if ($sec_actor->is_allowed('nextgen_edit_settings')) {
+			$settings	= C_NextGen_Settings::get_instance();
+			$imagegen	= $this->get_registry()->get_utility('I_Dynamic_Thumbnails_Manager');
+			$mapper		= $this->get_registry()->get_utility('I_Image_Mapper');
+			$image		= $mapper->find_first();
+			$storage	= $this->object->get_registry()->get_utility('I_Gallery_Storage');
+			$sizeinfo	= array(
+				'quality'   => 100,
+		          'height'    => 250,
+		          'crop'      => FALSE,
+		          'watermark' => TRUE
+			);
+			$size			= $imagegen->get_size_name($sizeinfo);
+			$thumbnail_url	= $storage->get_image_url($image, $size);
+
+			// Temporarily update the watermark options. Generate a new image based
+			// on these settings
+			if (($watermark_options = $this->param('watermark_options'))) {
+				$watermark_options['wmFont'] = trim($watermark_options['wmFont']);
+				$settings->set($watermark_options);
+				$storage->generate_image_size($image, $size);
+				$thumbnail_url	= $storage->get_image_url($image, $size);
+				$settings->load();
+			}
+
+			return array('thumbnail_url' => $thumbnail_url);
+		}
+		
+		return null;
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.watermarks_form.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.watermarks_form.php
new file mode 100644
index 0000000000000000000000000000000000000000..1df3d16aa869c620b4beb6375abca125fedb0bd0
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/adapter.watermarks_form.php
@@ -0,0 +1,135 @@
+<?php
+
+class A_Watermarks_Form extends Mixin
+{
+	function get_model()
+	{
+		return C_Settings_Model::get_instance();
+	}
+
+	function get_title()
+	{
+		return 'Watermarks';
+	}
+
+	/**
+	 * Gets all fonts installed for watermarking
+	 * @return array
+	 */
+	function _get_watermark_fonts()
+	{
+		$retval = array();
+		foreach (scandir(path_join(NGGALLERY_ABSPATH, 'fonts')) as $filename) {
+			if (strpos($filename, '.') === 0) continue;
+			else $retval[] = $filename;
+		}
+		return $retval;
+	}
+
+	/**
+	 * Gets watermark sources, along with their respective fields
+	 * @return array
+	 */
+	function _get_watermark_sources()
+	{
+		// We do this so that an adapter can add new sources
+		return array(
+			'Using an Image'	=>	'image',
+			'Using Text'		=>	'text',
+		);
+	}
+
+	/**
+	 * Renders the fields for a watermark source (image, text)
+	 * @return string
+	 */
+	function _get_watermark_source_fields()
+	{
+		$retval = array();
+		foreach ($this->object->_get_watermark_sources() as $label => $value) {
+			$method = "_render_watermark_{$value}_fields";
+            if ($this->object->has_method($method)) {
+                $retval[$value] = $this->object->call_method($method);
+            }
+		}
+		return $retval;
+	}
+
+	/**
+	 * Render fields that are needed when 'image' is selected as a watermark
+	 * source
+	 * @return string
+	 */
+	function _render_watermark_image_fields()
+	{
+		return $this->object->render_partial('photocrati-nextgen_other_options#watermark_image_fields', array(
+			'image_url_label'			=>	_('Image URL:'),
+			'watermark_image_url'		=>	$this->object->get_model()->wmPath,
+		), TRUE);
+	}
+
+	/**
+	 * Render fields that are needed when 'text is selected as a watermark
+	 * source
+	 * @return string
+	 */
+	function _render_watermark_text_fields()
+	{
+		$settings = $this->object->get_model();
+		return $this->object->render_partial('photocrati-nextgen_other_options#watermark_text_fields', array(
+			'fonts'						=>	$this->object->_get_watermark_fonts($settings),
+			'font_family_label'			=>	_('Font Family:'),
+			'font_family'				=>	$settings->wmFont,
+			'font_size_label'			=>	_('Font Size:'),
+			'font_size'					=>	$settings->wmSize,
+			'font_color_label'			=>	_('Font Color:'),
+			'font_color'				=>	strpos($settings->wmColor, '#') === 0 ?
+											$settings->wmColor : "#{$settings->wmColor}",
+			'watermark_text_label'		=>	_('Text:'),
+			'watermark_text'			=>	$settings->wmText,
+			'opacity_label'				=>	_('Opacity:'),
+			'opacity'					=>	$settings->wmOpaque,
+		), TRUE);
+	}
+
+	function render()
+	{
+		$settings	= $this->get_model();
+		$registry	= $this->object->get_registry();
+		$storage	= $registry->get_utility('I_Gallery_Storage');
+		$image		= $registry->get_utility('I_Image_Mapper')->find_first();
+		$imagegen	= $registry->get_utility('I_Dynamic_Thumbnails_Manager');
+		$size		= $imagegen->get_size_name(array(
+			'height'	=>	250,
+			'crop'		=>	FALSE,
+			'watermark'	=>	TRUE
+		));
+		$thumb_url	= $image ? $storage->get_image_url($image, $size) : NULL;
+
+		return $this->render_partial('photocrati-nextgen_other_options#watermarks_tab', array(
+			'notice'					=>	_('Please note : You can only activate the watermark under -> Manage Gallery . This action cannot be undone.'),
+			'watermark_source_label'	=>	_('How will you generate a watermark?'),
+			'watermark_sources'			=>	$this->object->_get_watermark_sources(),
+			'watermark_fields'			=>	$this->object->_get_watermark_source_fields($settings),
+			'watermark_source'			=>	$settings->wmType,
+			'position_label'			=>	_('Position:'),
+			'position'					=>	$settings->wmPos,
+			'offset_label'				=>	_('Offset:'),
+			'offset_x'					=>	$settings->wmXpos,
+			'offset_y'					=>	$settings->wmYpos,
+			'hidden_label'				=>	_('(Show Customization Options)'),
+			'active_label'				=>	_('(Hide Customization Options)'),
+            'thumbnail_url'             => $thumb_url,
+            'preview_label'             => _('Preview of saved settings:'),
+            'refresh_label'             => _('Refresh preview image'),
+            'refresh_url'               => $settings->ajax_url
+		), TRUE);
+	}
+
+	function save_action()
+	{
+		if (($settings = $this->object->param('watermark_options'))) {
+			$this->object->get_model()->set($settings)->save();
+		}
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/class.settings_model.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/class.settings_model.php
new file mode 100644
index 0000000000000000000000000000000000000000..478a7eb6b1b1795aea8607eb25555d990ef9e50b
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/class.settings_model.php
@@ -0,0 +1,55 @@
+<?php
+
+class C_Settings_Model extends C_Component
+{
+	/**
+	 * @var C_NextGen_Settings_Base
+	 */
+	var $wrapper = NULL;
+
+	static $_instances = array();
+	static function get_instance($context=FALSE)
+	{
+		if (!isset(self::$_instances[$context])) {
+			$klass = get_class();
+			self::$_instances[$context] = new $klass;
+		}
+		return self::$_instances[$context];
+	}
+
+	function define($context=FALSE)
+	{
+		parent::define($context);
+		$this->add_mixin('Mixin_Validation');
+		if ($this->has_context('global') OR $this->has_context('site')) {
+			 $this->wrapper = C_NextGen_Settings::get_instance();
+		}
+		else $this->wrapper = C_NextGen_Settings::get_instance();
+	}
+
+	function __get($key)
+	{
+		return $this->wrapper->get($key);
+	}
+
+	function __set($key, $value)
+	{
+		$this->wrapper->set($key, $value);
+		return $this;
+	}
+
+	function __isset($key)
+	{
+		return $this->wrapper->is_set($key);
+	}
+
+	function __call($method, $args)
+	{
+		if (!$this->get_mixin_providing($method)) {
+			return call_user_func_array(array(&$this->wrapper, $method), $args);
+		}
+		else
+			return parent::__call($method, $args);
+
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/module.nextgen_other_options.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/module.nextgen_other_options.php
new file mode 100644
index 0000000000000000000000000000000000000000..568a1ed216c425eb748dd9016beed5fbcb343a18
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/module.nextgen_other_options.php
@@ -0,0 +1,89 @@
+<?php
+/*
+{
+	Module: photocrati-nextgen_other_options,
+	Depends: { photocrati-nextgen_admin }
+}
+ */
+
+define('NEXTGEN_OTHER_OPTIONS_SLUG', 'ngg_other_options');
+
+class M_NextGen_Other_Options extends C_Base_Module
+{
+	function define()
+	{
+		parent::define(
+			'photocrati-nextgen_other_options',
+			'Other Options',
+			'NextGEN Gallery Others Options Page',
+			'0.4',
+			'http://www.nextgen-gallery.com',
+			'Photocrati Media',
+			'http://www.photocrati.com'
+		);
+	}
+
+    function _register_hooks()
+    {
+        add_action('admin_bar_menu', array(&$this, 'add_admin_bar_menu'), 101);
+    }
+
+    function add_admin_bar_menu()
+    {
+        global $wp_admin_bar;
+
+        if ( current_user_can('NextGEN Change options') ) {
+            $wp_admin_bar->add_menu(array(
+                'parent' => 'ngg-menu',
+                'id' => 'ngg-menu-other_options',
+                'title' => __('Other Options', 'nggallery'),
+                'href' => admin_url('admin.php?page=ngg_other_options')
+            ));
+        }
+    }
+
+	function _register_adapters()
+	{
+		$this->get_registry()->add_adapter(
+			'I_Page_Manager',
+			'A_Other_Options_Page'
+		);
+
+		$this->get_registry()->add_adapter(
+			'I_Form_Manager',
+			'A_Other_Options_Forms'
+		);
+
+		$this->get_registry()->add_adapter(
+			'I_Ajax_Controller',
+			'A_Watermarking_Ajax_Actions'
+		);
+
+        $this->get_registry()->add_adapter(
+            'I_Ajax_Controller',
+            'A_Stylesheet_Ajax_Actions'
+        );
+	}
+
+    function get_type_list()
+    {
+        return array(
+            'A_Image_Options_Form' => 'adapter.image_options_form.php',
+            'A_Lightbox_Manager_Form' => 'adapter.lightbox_manager_form.php',
+            'A_Miscellaneous_Form' => 'adapter.miscellaneous_form.php',
+            'A_Other_Options_Controller' => 'adapter.other_options_controller.php',
+            'A_Other_Options_Forms' => 'adapter.other_options_forms.php',
+            'A_Other_Options_Page' => 'adapter.other_options_page.php',
+            'A_Reset_Form' => 'adapter.reset_form.php',
+            'A_Roles_Form' => 'adapter.roles_form.php',
+            'A_Styles_Form' => 'adapter.styles_form.php',
+            'A_Thumbnail_Options_Form' => 'adapter.thumbnail_options_form.php',
+            'A_Watermarking_Ajax_Actions' => 'adapter.watermarking_ajax_actions.php',
+            'A_Watermarks_Form' => 'adapter.watermarks_form.php',
+            'A_Stylesheet_Ajax_Actions' => 'adapter.stylesheet_ajax_actions.php',
+			'C_Settings_Model'	=>	'class.settings_model.php'
+        );
+    }
+}
+
+new M_NextGen_Other_Options;
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/static/nextgen_settings_page.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/static/nextgen_settings_page.css
new file mode 100644
index 0000000000000000000000000000000000000000..f76de63839b2a3ff2654c63def7859632febb97d
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/static/nextgen_settings_page.css
@@ -0,0 +1,115 @@
+.gallery_page_ngg_other_options table {
+	width: 80%;
+	height: 100%;
+}
+.gallery_page_ngg_other_options table tr td:first-child {
+    vertical-align: top;
+}
+.gallery_page_ngg_other_options table.image_options {
+	width: 100%;
+}
+
+.gallery_page_ngg_other_options table td.column1 {
+	width: 240px;
+}
+.gallery_page_ngg_other_options table td.column2 {
+	width: 200px;
+}
+.gallery_page_ngg_other_options .image_options label {
+	position: relative;
+	bottom: 2px;
+}
+
+.gallery_page_ngg_other_options textarea {
+	height: 100px;
+}
+
+.gallery_page_ngg_other_options textarea,
+.gallery_page_ngg_other_options input[type=text] {
+	width: 100%;
+}
+
+.gallery_page_ngg_other_options .image_options td{
+	padding-bottom: 8px;
+}
+
+.column_wrapper {
+	width: 100%;
+	padding-right: 7px;
+}
+
+#max_related_images {
+	width: auto;
+}
+
+#image_width,
+#image_height{
+	width: 40px;
+}
+
+#thumbnail_dimensions_width,
+#thumbnail_dimensions_height{
+	width: 100px;
+}
+.nextgen-thumb-size-custom br {
+display:none;
+}
+
+.gallery_page_ngg_other_options select.thumbnail_dimensions {
+	width: 300px;
+}
+
+.description_row{
+	position: relative;
+}
+.description_row .description {
+	width: auto;
+	position: absolute;
+	margin-top: -10px;
+	margin-bottom: 5px;
+	z-index: 10;
+}
+
+.full-width {
+	width: 100%;
+}
+
+.right-aligned {
+	text-align: right;
+}
+label.align-to-top,
+td.align-to-top {
+	vertical-align: top
+}
+
+#lightbox_library_advanced_settings td {
+	text-align: right;
+}
+
+#cssfile_contents {
+	background: #F9F9F9;
+	font-family: Consolas,Monaco,monospace;
+	font-size: 12px;
+	width: 100%;
+	height: 300px;
+	outline: 0;
+}
+
+#writable_identicator {
+	display: inline;
+}
+
+.entity_errors {
+	color: red;
+}
+
+.entity_errors ul {
+	margin-left: 30px;
+}
+.entity_errors ul li{
+	list-style-type: disc;
+}
+
+#nextgen_settings_preview_refresh {
+    display: block;
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/static/nextgen_settings_page.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/static/nextgen_settings_page.js
new file mode 100644
index 0000000000000000000000000000000000000000..19797414e85d2b2946355451dc8c8afeb8cf18bd
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/static/nextgen_settings_page.js
@@ -0,0 +1,120 @@
+jQuery(function($){
+
+    $('select.select2').select2();
+    $('label.tooltip, span.tooltip').tooltip();
+
+	/**** LIGHTBOX EFFECT TAB ****/
+
+    $('tbody#lightbox_library_' + $('#lightbox_library').find(':selected').data('library-name') + '_basic').removeClass('hidden');
+
+    // Only show the currently selected library; hide the rest
+    $('#lightbox_library').change(function() {
+        var name = $(this).find(':selected').data('library-name');
+        if ($('#lightbox_library_advanced_toggle').data('currently-hidden') == false) {
+            $('tbody.lightbox_library_advanced_settings').addClass('hidden');
+            $('tbody#lightbox_library_' + name + '_advanced').removeClass('hidden');
+        }
+
+        $('tbody.lightbox_library_settings').addClass('hidden');
+        $('tbody#lightbox_library_' + name + '_basic').removeClass('hidden');
+
+	}).change();
+
+    // "Show Advanced Settings" toggle; only display the currently selected library
+    $('#lightbox_library_advanced_toggle').bind('click', function(event) {
+        event.preventDefault();
+        if ($(this).data('currently-hidden') == true) {
+            var name = $('#lightbox_library').find(':selected').data('library-name');
+            $('tbody#lightbox_library_' + name + '_advanced').removeClass('hidden');
+            $(this).data('currently-hidden', false);
+
+        } else if($(this).data('currently-hidden') == false) {
+            $('tbody.lightbox_library_advanced_settings').addClass('hidden');
+            $(this).data('currently-hidden', true);
+        }
+    });
+
+	/**** WATERMARK TAB ****/
+
+	// Configure the watermark customization link
+	$('#watermark_customization').attr('rel', 'watermark_'+$('#watermark_source').val()+'_source');
+
+	// Configure the button to switch from watermark text to image
+	$('#watermark_source').change(function(){
+		$('#'+$('#watermark_customization').attr('rel')).css('display', '').addClass('hidden');
+		if (!$('#'+$(this).val()).hasClass('hidden')) {
+			$('#'+$(this).val()).removeClass('hidden');
+		}
+		$('#watermark_customization').attr('rel', 'watermark_'+$('#watermark_source').val()+'_source').click();
+	});
+
+    // Don't show any Watermark fields unless Watermarks are enabled
+    $('#watermark_source').change(function(){
+        var value = $(this).val();
+
+        $('.watermark_field').each(function(){
+            if (value == 0) {
+                $(this).fadeOut().addClass('hidden');
+            }
+            else {
+                $(this).fadeIn().removeClass('hidden');
+            }
+        });
+    }).change();
+
+
+    // sends the current settings to a special ajax endpoint which saves them, regenerates the url, and then reverts
+    // to the old settings. this submits the form and forces a refresh of the image through the time parameter
+    $('#nextgen_settings_preview_refresh').click(function(event) {
+        event.preventDefault();
+
+        var form = $(this).parents('form:first');
+        var self = $(this);
+        var orig_html = $(self).html();
+
+        $(self).attr('disabled', 'disabled').html('Processing...');
+        $('body').css('cursor', 'wait');
+
+        $.ajax({
+            type: form.attr('method'),
+            url: $(this).data('refresh-url'),
+            data: form.serialize()+"&action=get_watermark_preview_url",
+            dataType: 'json',
+            success: function(data) {
+                var img = self.prev();
+                var src = data.thumbnail_url;
+                queryPos = src.indexOf('?');
+                if (queryPos != -1) {
+                    src = src.substring(0, queryPos);
+                }
+
+                img.attr('src', src + '?' + new Date().getTime());
+                $(self).removeAttr('disabled').html(orig_html);
+                $('body').css('cursor', 'default');
+            },
+            error: function(xob, err, code) {        
+                $(self).removeAttr('disabled').html(orig_html);
+                $('body').css('cursor', 'default');
+            }
+        });
+        
+        return false;
+    });
+	/**** STYLES TAB ****/
+
+	// When the selected stylesheet changes, fetch it's contents
+	$('#activated_stylesheet').change(function(){
+		var selected = $(this).find(':selected');
+		var data = {
+			action:		'get_stylesheet_contents',
+			cssfile:	selected.val()
+		};
+		$.post(photocrati_ajax.url, data, function(res) {
+			if (typeof res !== 'object') res = JSON.parse(res);
+			$('#cssfile_contents').val(res.error ? res.error : res.contents);
+			var status = $('#writable_identicator');
+			if (res.writable) status.text(status.attr('writable_label')+' '+res.writepath);
+			else status.text(status.attr('readonly_label'));
+		});
+	}).change();
+});
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/image_options_tab.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/image_options_tab.php
new file mode 100644
index 0000000000000000000000000000000000000000..a47ba5522892db5eea7c20f20a97264483724b26
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/image_options_tab.php
@@ -0,0 +1,258 @@
+<table class="image_options">
+	<?php 
+	if (!is_multisite() || get_current_blog_id() == 1) {
+	?>
+	<tr>
+		<td class="column1">
+			<label for="gallery_path">
+				<?php echo_h($gallery_path_label)?>
+			</label>
+		</td>
+		<td colspan="2">
+			<input
+				id="gallery_path"
+				type="text"
+				name="image_options[gallerypath]"
+                data-original-value='<?php echo esc_attr($gallery_path); ?>'
+				value="<?php echo esc_attr($gallery_path) ?>"
+			/>
+			<p class="description">
+				<?php echo_h($gallery_path_help)?>
+			</p>
+		</td>
+	</tr>
+	<?php 
+	}
+	?>
+	<tr>
+		<td>
+			<label for="delete_images">
+				<?php echo_h($delete_image_files_label) ?>
+			</label>
+		</td>
+		<td colspan="2">
+			<p class="description">
+                <input type="radio"
+                       id="delete_images"
+                       name="image_options[deleteImg]"
+                       value="1"
+                       <?php checked(1, $delete_image_files); ?>/>
+                <label for="delete_images"><?php _e('Yes'); ?></label>
+                &nbsp;
+                <input type="radio"
+                       id="delete_images_no"
+                       name="image_options[deleteImg]"
+                       value="0"
+                       <?php checked(0, $delete_image_files); ?>/>
+                <label for="delete_images_no"><?php _e('No'); ?></label>
+                <?php echo_h($delete_image_files_help); ?>
+			</p>
+		</td>
+	</tr>
+	<tr>
+		<td>
+			<label for="automatic_resize">
+				<?php echo_h($automatic_resize_label)?>
+			</label>
+		</td>
+		<td colspan="2">
+			<p class="description">
+                <input type="radio"
+                       id="automatic_resize"
+                       name="image_options[imgAutoResize]"
+                       value="1"
+                    <?php checked(1, $automatic_resize ? 1 : 0); ?>/>
+                <label for="automatic_resize"><?php _e('Yes'); ?></label>
+                &nbsp;
+                <input type="radio"
+                       id="automatic_resize_no"
+                       name="image_options[imgAutoResize]"
+                       value="0"
+                    <?php checked(0, $automatic_resize ? 1 : 0); ?>/>
+                <label for="automatic_resize_no"><?php _e('No'); ?></label>
+                <?php echo_h($automatic_resize_help); ?>
+            </p>
+		</td>
+	</tr>
+	<tr>
+		<td>
+			<label for="resize_images">
+				<?php echo_h($resize_images_label) ?>
+			</label>
+		</td>
+		<td class="column2">
+			<label for="image_width"><?php echo_h($resized_image_width_label)?></label>
+			<input
+				type="text"
+				id="image_width"
+				maxlength="4"
+				name="image_options[imgWidth]"
+				value="<?php echo esc_attr($resized_image_width) ?>"
+			/>
+			&nbsp;<label for="image_height"><?php echo_h($resized_image_height_label)?></label>
+			<input
+				type="text"
+				id="image_height"
+				maxlength="4"
+				name="image_options[imgHeight]"
+				value="<?php echo esc_attr($resized_image_height) ?>"
+			/>
+		</td>
+		<td>
+			<div class="column_wrapper">
+				<label for="image_quality"><?php echo_h($resized_image_quality_label)?></label>
+				<select id="image_quality" name="image_options[imgQuality]">
+				<?php for($i=100; $i>50; $i--): ?>
+					<option
+						<?php selected($i, $resized_image_quality) ?>
+						value="<?php echo_h($i)?>"><?php echo_h($i) ?>%</option>
+				<?php endfor ?>
+				</select>
+			</div>
+		</td>
+	</tr>
+	<tr class="description_row">
+		<td class="column1"></td>
+		<td colspan="2">
+			<p class="description"><?php echo_h($resize_images_help) ?></p>
+		</td>
+	</tr>
+	<tr>
+		<td>
+			<label for="backup_images">
+				<?php echo_h($backup_images_label)?>
+			</label>
+		</td>
+		<td colspan="2">
+			<label for="backup_images_yes">
+				<?php echo_h($backup_images_yes_label)?>
+			</label>
+			<input
+				id="backup_images_yes"
+				name="image_options[imgBackup]"
+				value="1"
+				type="radio"
+				<?php checked(1, $backup_images ? 1 : 0)?>
+			/>
+			&nbsp;
+			<label for="backup_images_no">
+				<?php echo_h($backup_images_no_label)?>
+			</label>
+			<input
+				id="backup_images_no"
+				name="image_options[imgBackup]"
+				value="0"
+				type="radio"
+				<?php checked(0, $backup_images ? 1 : 0)?>
+			/>
+		</td>
+	</tr>
+	<tr id="sorting_options_row">
+		<td class="column1">
+			<label for="image_sorting_order">
+				<?php echo_h($sorting_order_label) ?>
+			</label>
+		</td>
+		<td>
+			<select name="image_options[galSort]" id="image_sorting_order">
+				<?php foreach ($sorting_order_options as $label => $value): ?>
+				<option value="<?php echo esc_attr($value) ?>" <?php selected($value, $sorting_order)?>>
+					<?php echo_h($label) ?>
+				</option>
+				<?php endforeach ?>
+			</select>
+		</td>
+		<td class="column3">
+			<label for="image_sorting_direction">
+				<?php echo_h($sorting_direction_label) ?>
+			</label>
+			<select name="image_options[galSortDir]" id="image_sorting_direction">
+			<?php foreach ($sorting_direction_options as $label => $value): ?>
+			<option value="<?php echo esc_attr($value) ?>" <?php selected($value, $sorting_direction)?>>
+				<?php echo_h($label) ?>
+			</option>
+			<?php endforeach ?>
+			</select>
+		</td>
+	</tr>
+	<tr>
+		<td>
+			<label for="show_related_images">
+				<?php echo_h($show_related_images_label)?>
+			</label>
+		</td>
+		<td colspan="2">
+			<p class="description">
+                <input type="radio"
+                       id="show_related_images"
+                       name="image_options[activateTags]"
+                       value="1"
+                       <?php checked(1, $show_related_images); ?>/>
+                <label for="show_related_images"><?php _e('Yes'); ?></label>
+                &nbsp;
+                <input type="radio"
+                       id="show_related_images_no"
+                       name="image_options[activateTags]"
+                       value="0"
+                       <?php checked(0, $show_related_images); ?>/>
+                <label for="show_related_images_no"><?php _e('No'); ?></label>
+                <?php echo_h($show_related_images_help); ?>
+			</p>
+		</td>
+	</tr>
+	<tr>
+		<td colspan="3">
+			<a
+				href="#"
+				class="nextgen_advanced_toggle_link"
+				id="related_images_advanced_toggle"
+				rel="related_images_advanced_form"
+				hidden_label="<?php echo esc_attr($related_images_hidden_label)?>"
+				active_label="<?php echo esc_attr($related_images_active_label)?>"
+			><?php echo_h($related_images_hidden_label) ?></a>
+		</td>
+	</tr>
+	<tbody id="related_images_advanced_form" class="hidden">
+		<tr>
+			<td>
+				<label for="match_related_images">
+					<?php echo_h($match_related_images_label) ?>
+				</label>
+			</td>
+			<td>
+				<select id="match_related_images" name="image_options[appendType]">
+				<?php foreach ($match_related_image_options as $label => $value): ?>
+					<option
+						value="<?php echo esc_attr($value)?>"
+						<?php selected($value, $match_related_images)?>
+					>
+					<?php echo_h($label) ?>
+					</option>
+				<?php endforeach ?>
+				</select>
+			</td>
+			<td class="column3">
+				<label for="max_related_images">
+					<?php echo_h($max_related_images_label)?>
+				</label>
+				<input
+					id="max_related_images"
+					type="text"
+					name="image_options[maxImages]"
+					value="<?php echo esc_attr($max_related_images)?>"
+				/>
+			</td>
+		</tr>
+		<tr>
+			<td>
+				<label for="related_images_heading">
+					<?php echo_h($related_images_heading_label) ?>
+				</label>
+			</td>
+			<td>
+				<input id="related_images_heading" type="text" name="image_options[relatedHeading]"
+							 value="<?php echo esc_attr($related_images_heading)?>"/>
+			</td>
+		</tr>
+	</tbody>
+</table>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/lightbox_library_tab.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/lightbox_library_tab.php
new file mode 100644
index 0000000000000000000000000000000000000000..7026a296f6d7867ef66a520617f1f4e55bc3af2e
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/lightbox_library_tab.php
@@ -0,0 +1,49 @@
+<table>
+	<!-- Lightbox Library Name -->
+	<tr>
+		<td class="column1">
+			<label for="lightbox_library"><?php echo_h($lightbox_library_label)?></label>
+		</td>
+		<td>
+			<select name="lightbox_library_id" id="lightbox_library">
+				<?php foreach ($libs as $lib) { ?>
+                    <option value="<?php echo esc_attr($lib->$id_field)?>"
+                            <?php selected($lib->name, $selected, TRUE)?>
+                            data-library-name='<?php echo $lib->name; ?>'>
+                        <?php if (isset($lib->title) && $lib->title) { ?>
+                            <?php echo_h($lib->title) ?>
+                        <?php } else { ?>
+                            <?php echo_h($lib->name) ?>
+                        <?php } ?>
+                    </option>
+				<?php } ?>
+			</select>
+		</td>
+	</tr>
+
+    <?php foreach ($sub_fields as $name => $form) { ?>
+        <tbody class="lightbox_library_settings hidden" id="lightbox_library_<?php print $name; ?>">
+            <?php echo $form; ?>
+        </tbody>
+    <?php } ?>
+
+    <tr>
+		<td colspan="2">
+			<a href="#"
+			   id="lightbox_library_advanced_toggle"
+			   data-hidden_label="<?php echo esc_attr(_('(Show Advanced Settings)'))?>"
+			   data-active_label="<?php echo esc_attr(_('(Hide Advanced Settings)'))?>"
+               data-currently-hidden='true'>
+                <?php echo_h(_("(Show Advanced Settings)"))?>
+			</a>
+		</td>
+	</tr>
+
+    <?php foreach ($adv_fields as $name => $form) { ?>
+        <tbody class="lightbox_library_advanced_settings hidden" id="lightbox_library_<?php print $name; ?>_advanced">
+            <?php echo $form; ?>
+        </tbody>
+    <?php } ?>
+
+	</tbody>
+</table>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/misc_tab.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/misc_tab.php
new file mode 100644
index 0000000000000000000000000000000000000000..a5f016a369a895152268993a604b028d59a8157d
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/misc_tab.php
@@ -0,0 +1,53 @@
+<table>
+	<tr>
+		<td class="column1">
+			<label for="mediarss_activated">
+				<?php echo_h($mediarss_activated_label)?>
+			</label>
+		</td>
+		<td>
+			<label for="mediarss_activated">
+				<?php echo_h($mediarss_activated_yes) ?>
+			</label>
+			<input
+                id='mediarss_activated'
+				type="radio"
+				name="misc_settings[useMediaRSS]"
+				value="1"
+				<?php checked(TRUE, $mediarss_activated ? TRUE : FALSE)?>
+			/>
+			&nbsp;
+			<label for="mediarss_activated_no">
+				<?php echo_h($mediarss_activated_no) ?>
+			</label>
+			<input
+                id='mediarss_activated_no'
+				type="radio"
+				name="misc_settings[useMediaRSS]"
+				value="0"
+				<?php checked(FALSE, $mediarss_activated ? TRUE : FALSE)?>
+			/>
+			<p class="description">
+				<?php echo_h($mediarss_activated_help)?>
+			</p>
+		</td>
+	</tr>
+    <tr>
+        <td class='column1'>
+            <?php echo $cache_label; ?>
+        </td>
+        <td>
+            <input type='submit'
+                   name="action_proxy"
+                   class="button delete button-secondary"
+                   data-proxy-value="cache"
+                   data-confirm="<?php echo $cache_confirmation; ?>"
+                   value='<?php echo $cache_label; ?>'
+                />
+        </td>
+    </tr>
+
+    <?php print $slug_field; ?>
+
+    <?php print $maximum_entity_count_field; ?>
+</table>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/reset_tab.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/reset_tab.php
new file mode 100644
index 0000000000000000000000000000000000000000..bdd95908b934f1d38a202b7fdd6aa0c2d4e035f2
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/reset_tab.php
@@ -0,0 +1,34 @@
+<table>
+    <tr>
+        <td class='column1'>
+            <span class='tooltip' title="<?php echo $reset_warning; ?>">
+                <?php echo $reset_label; ?>
+            </span>
+        </td>
+        <td>
+            <input type="submit"
+                   class="button-secondary"
+				   data-confirm="<?php echo $reset_confirmation; ?>"
+				   data-proxy-value="reset"
+                   name="action_proxy"
+                   value="<?php echo $reset_value; ?>"
+				/>
+        </td>
+    </tr>
+    <?php /*
+        <tr>
+            <td class='column1'>
+                <?php echo $uninstall_label; ?>
+            </td>
+            <td>
+                <input type='submit'
+                       name="action_proxy"
+                       class="button delete button-secondary"
+					   data-proxy-value="uninstall"
+					   data-confirm="<?php echo $uninstall_confirmation; ?>"
+					   value='<?php echo $uninstall_label; ?>'
+				/>
+            </td>
+        </tr>
+    */ ?>
+</table>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/styling_tab.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/styling_tab.php
new file mode 100644
index 0000000000000000000000000000000000000000..07125fac0ee7271a215e98bd2cacbcce360a8bc2
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/styling_tab.php
@@ -0,0 +1,53 @@
+<table class="full-width">
+	<tr>
+		<td class="column1">
+			<label for="activated_stylesheet">
+				<?php echo_h($select_stylesheet_label) ?>
+			</label>
+		</td>
+		<td>
+			<select id="activated_stylesheet" name="style_settings[CSSfile]">
+			<?php foreach ($stylesheets as $value => $p): ?>
+				<option
+					value="<?php echo esc_attr($value)?>"
+					description="<?php echo esc_attr($p['description'])?>"
+					author="<?php echo esc_attr($p['author'])?>"
+					version="<?php echo esc_attr($p['version'])?>"
+					<?php selected($value, $activated_stylesheet)?>
+				><?php echo_h($p['name'])?></option>
+			<?php endforeach ?>
+			</select>
+            <p class="description">
+				Place any custom stylesheets in <strong>wp-content/ngg_styles</strong><br/>
+                All stylesheets must contain a <a href='#' onclick='javascript:alert("/*\nCSS Name: Example\nDescription: This is an example stylesheet\nAuthor: John Smith\nVersion: 1.0\n*/");'>file header</a>
+            </p>
+		</td>
+	</tr>
+	<tr>
+		<td colspan="2">
+			<a
+				href="#"
+				id="advanced_stylesheet_options"
+				class="nextgen_advanced_toggle_link"
+				rel="advanced_stylesheet_form"
+				hidden_label="<?php echo esc_attr($hidden_label)?>"
+				active_label="<?php echo esc_attr($active_label)?>">
+				<?php echo_h($hidden_label) ?>
+			</a>
+		</td>
+	</tr>
+	<tr class="hidden" id="advanced_stylesheet_form">
+		<td colspan="2">
+			<label for="cssfile_contents" class="align-to-top">
+				<?php echo_h($cssfile_contents_label)?>
+			</label>
+			<p
+				class="description"
+				writable_label="<?php echo esc_attr($writable_label)?>"
+				readonly_label="<?php echo esc_attr($readonly_label)?>"
+				id="writable_identicator">
+			</p>
+			<textarea id="cssfile_contents" name="cssfile_contents"></textarea>
+		</td>
+	</tr>
+</table>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/thumbnail_options_tab.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/thumbnail_options_tab.php
new file mode 100644
index 0000000000000000000000000000000000000000..d6fa45c55b06ce04add14f5861f669fcab5afe34
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/thumbnail_options_tab.php
@@ -0,0 +1,94 @@
+<table class="thumbnail_options">
+	<tr>
+		<td>
+			<label for="thumbnail_dimensions_width">
+				<?php echo_h($thumbnail_dimensions_label) ?>
+			</label>
+		</td>
+		<td colspan="2">
+		<?php
+		  $thumbnails_template_width_value = $thumbnail_dimensions_width;
+		  $thumbnails_template_height_value = $thumbnail_dimensions_height;
+		  $thumbnails_template_width_id = 'thumbnail_dimensions_width';
+		  $thumbnails_template_height_id = 'thumbnail_dimensions_height';
+		  $thumbnails_template_width_name = 'thumbnail_settings[thumbwidth]';
+		  $thumbnails_template_height_name = 'thumbnail_settings[thumbheight]';
+		  include(path_join(NGGALLERY_ABSPATH, implode(DIRECTORY_SEPARATOR, array('admin', 'thumbnails-template.php'))));
+		?>
+			<p class="description"><?php echo_h($thumbnail_dimensions_help)?></p>
+		</td>
+	</tr>
+	<tr>
+		<td>
+			<label for="thumbnail_crop">
+				<?php echo_h($thumbnail_crop_label) ?>
+			</label>
+		</td>
+		<td colspan="2">
+            <input type="radio"
+                   id="thumbnail_crop"
+                   name="thumbnail_settings[thumbfix]"
+                   value="1"
+                <?php checked(1, $thumbnail_crop); ?>/>
+            <label for="thumbnail_crop"><?php _e('Yes'); ?></label>
+            &nbsp;
+            <input type="radio"
+                   id="thumbnail_crop_no"
+                   name="thumbnail_settings[thumbfix]"
+                   value="0"
+                <?php checked(0, $thumbnail_crop); ?>/>
+            <label for="thumbnail_crop_no"><?php _e('No'); ?></label>
+			<p class="description"><?php echo_h($thumbnail_crop_help); ?></p>
+		</td>
+	</tr>
+	<tr>
+		<td>
+			<label for="thumbnail_quality">
+				<?php echo_h($thumbnail_quality_label) ?>
+			</label>
+		</td>
+		<td colspan="2">
+			<select name="thumbnail_settings[thumbquality]" id="thumbnail_quality">
+			<?php for($i=100; $i>50; $i--): ?>
+				<option
+					<?php selected($i, $thumbnail_quality) ?>
+					value="<?php echo_h($i)?>"><?php echo_h($i) ?>%</option>
+			<?php endfor ?>
+			</select>
+			<p class="description"><?php echo_h($thumbnail_quality_help)?></p>
+		</td>
+	</tr>
+	<tr>
+		<td>
+			<label for="size_list">
+				<?php echo_h($size_list_label) ?>
+			</label>
+		</td>
+		<td colspan="2">
+		<?php
+			if ($size_list != null && is_array($size_list))
+			{
+		?>
+			<select class="select2 thumbnail_dimensions" name="size_settings[thumbnail_dimensions][]" id="thumbnail_dimensions" multiple="multiple">
+			<?php
+				foreach ($size_list as $size)
+				{
+			?>
+				<option
+					<?php selected($size, $size) ?>
+					value="<?php echo_h($size)?>"><?php echo_h($size) ?></option>
+			<?php
+				}
+			?>
+			</select>
+		<?php
+			}
+			else
+			{
+				echo "<i>No default sizes present.</i>";
+			}
+		?>
+			<p class="description"><?php echo_h($size_list_help)?></p>
+		</td>
+	</tr>
+</table>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/watermark_image_fields.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/watermark_image_fields.php
new file mode 100644
index 0000000000000000000000000000000000000000..a9d7fe2b9597119cb39da1405ae1cbdc94eeff8b
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/watermark_image_fields.php
@@ -0,0 +1,15 @@
+<tr>
+	<td class="column1">
+		<label for="watermark_image_url">
+			<?php echo_h($image_url_label)?>
+		</label>
+	</td>
+	<td>
+		<input
+			type="text"
+			name="watermark_options[wmPath]"
+			id="watermark_image_url"
+			value="<?php echo esc_attr($watermark_image_url)?>"
+		/>
+	</td>
+</tr>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/watermark_text_fields.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/watermark_text_fields.php
new file mode 100644
index 0000000000000000000000000000000000000000..cd7a8d8559906aae85dcc222ef96a595bfec278d
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/watermark_text_fields.php
@@ -0,0 +1,75 @@
+<tr>
+	<td class="column1 align-to-top">
+		<label for="watermark_text">
+			<?php echo_h($watermark_text_label)?>
+		</label>
+	</td>
+	<td>
+		<textarea name="watermark_options[wmText]" id="watermark_text"><?php echo_h($watermark_text)?></textarea>
+	</td>
+</tr>
+
+<tr>
+	<td>
+		<label for="watermark_opacity">
+			<?php echo_h($opacity_label)?>
+		</label>
+	</td>
+	<td>
+		<select name="watermark_options[wmOpaque]" id="watermark_opacity">
+		<?php for ($i=200; $i>1; $i--): ?>
+			<option <?php selected($i, $opacity)?>>
+				<?php echo_h($i)?>
+			</option>
+		<?php endfor ?>
+		</select>%
+	</td>
+</tr>
+
+<tr>
+	<td class="column1">
+		<label for="font_family">
+			<?php echo_h($font_family_label); ?>
+		</label>
+	</td>
+	<td>
+		<select id="font_family" name="watermark_options[wmFont]">
+		<?php foreach ($fonts as $font): ?>
+			<option <?php selected($font, $font_family); ?>>
+				<?php echo_h($font); ?>
+			</option>
+		<?php endforeach ?>
+		</select>
+	</td>
+</tr>
+
+<tr>
+	<td>
+		<label for="watermark_font_size">
+			<?php echo_h($font_size_label)?>
+		</label>
+	</td>
+	<td>
+		<select name="watermark_options[wmSize]" id="watermark_font_size">
+            <?php for($i=0; $i<200; $i++) { ?>
+                <option <?php selected($i, (int)$font_size) ?>><?php echo_h($i)?></option>
+            <?php } ?>
+		</select>px
+	</td>
+</tr>
+
+<tr>
+	<td class="align-to-top">
+		<label for="font_color">
+			<?php echo_h($font_color_label)?>
+		</label>
+	</td>
+	<td>
+        <input type='text'
+               id='font_color'
+               name='watermark_options[wmColor]'
+               class='nextgen_settings_field_colorpicker'
+               value='<?php print esc_attr($font_color); ?>'
+               data-default-color='<?php print esc_attr($font_color); ?>'/>
+	</td>
+</tr>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/watermarks_tab.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/watermarks_tab.php
new file mode 100644
index 0000000000000000000000000000000000000000..78c9817688dd27e39b04f07e00d3df39dd80acc8
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/watermarks_tab.php
@@ -0,0 +1,99 @@
+<table>
+	<tr>
+		<td class="column1">
+			<label for="watermark_source">
+				<?php echo_h($watermark_source_label)?>
+			</label>
+		</td>
+		<td>
+			<div class="column_wrapper">
+				<select name="watermark_options[wmType]" id="watermark_source">
+				<?php foreach ($watermark_sources as $label => $value): ?>
+					<option
+						value="<?php echo esc_attr($value)?>"
+						<?php selected($value, $watermark_source) ?>
+						><?php echo_h($label)?></option>
+				<?php endforeach ?>
+				</select>
+			</div>
+		</td>
+	</tr>
+
+    <tr class="watermark_field hidden">
+        <td>
+            <?php echo $position_label; ?>
+        </td>
+        <td>
+            <table class='nextgen_settings_position' border='1'>
+                <tr>
+                    <td><input type="radio" name="watermark_options[wmPos]" value="topLeft"   <?php checked('topLeft',   $position); ?>/></td>
+                    <td><input type="radio" name="watermark_options[wmPos]" value="topCenter" <?php checked('topCenter', $position); ?>/></td>
+                    <td><input type="radio" name="watermark_options[wmPos]" value="topRight"  <?php checked('topRight',  $position); ?>/></td>
+                </tr>
+                <tr>
+                    <td><input type="radio" name="watermark_options[wmPos]" value="midLeft"   <?php checked('midLeft',   $position); ?>/></td>
+                    <td><input type="radio" name="watermark_options[wmPos]" value="midCenter" <?php checked('midCenter', $position); ?>/></td>
+                    <td><input type="radio" name="watermark_options[wmPos]" value="midRight"  <?php checked('midRight',  $position); ?>/></td>
+                </tr>
+                <tr>
+                    <td><input type="radio" name="watermark_options[wmPos]" value="botLeft"   <?php checked('botLeft',   $position); ?>/></td>
+                    <td><input type="radio" name="watermark_options[wmPos]" value="botCenter" <?php checked('botCenter', $position); ?>/></td>
+                    <td><input type="radio" name="watermark_options[wmPos]" value="botRight"  <?php checked('botRight',  $position); ?>/></td>
+                </tr>
+            </table>
+        </td
+    </tr>
+
+    <tr class="watermark_field hidden">
+        <td>
+            <?php echo $offset_label; ?>
+        </td>
+        <td>
+            <label for='nextgen_settings_wmXpos'>w</label>
+            <input type='number'
+                   id='nextgen_settings_wmXpos'
+                   name='watermark_options[wmXpos]'
+                   placeholder='0'
+                   min='0'
+                   value='<?php echo $offset_x; ?>'/> /
+            <input type='number'
+                   id='nextgen_settings_wmYpos'
+                   name='watermark_options[wmYpos]'
+                   placeholder='0'
+                   min='0'
+                   value='<?php echo $offset_y; ?>'/>
+            <label for='nextgen_settings_wmYpos'>h</label>
+        </td>
+    </tr>
+
+    <?php if (!is_null($thumbnail_url)) { ?>
+        <tr class="watermark_field hidden">
+            <td>
+                <?php echo $preview_label; ?>
+            </td>
+            <td>
+                <img src='<?php echo $thumbnail_url; ?>'/>
+                <button id='nextgen_settings_preview_refresh' data-refresh-url='<?php echo $refresh_url; ?>'><?php echo $refresh_label; ?></button>
+            </td>
+        </tr>
+    <?php } ?>
+
+    <tr class="watermark_field hidden">
+		<td colspan="2">
+			<a
+				id="watermark_customization"
+				href="#"
+				class="nextgen_advanced_toggle_link"
+				hidden_label="<?php echo esc_attr($hidden_label)?>"
+				active_label="<?php echo esc_attr($active_label)?>"
+			>
+			<?php echo_h($hidden_label)?>
+			</a>
+		</td>
+	</tr>
+	<?php foreach ($watermark_fields as $source_name => $fields): ?>
+	<tbody class="hidden" id="watermark_<?php echo esc_attr($source_name) ?>_source">
+		<?php echo $fields ?>
+	</tbody>
+	<?php endforeach ?>
+</table>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pagination/mixin.nextgen_basic_pagination.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pagination/mixin.nextgen_basic_pagination.php
new file mode 100644
index 0000000000000000000000000000000000000000..7c24728d61076f3e06c730a738ae93ec196a2166
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pagination/mixin.nextgen_basic_pagination.php
@@ -0,0 +1,78 @@
+<?php
+
+/**
+ * Contains function(s) to generate a basic pagination widget
+ */
+class Mixin_NextGen_Basic_Pagination extends Mixin
+{
+
+    /**
+     * Returns a formatted HTML string of a pagination widget
+     *
+     * @param mixed $page
+     * @param int $totalElement
+     * @param int $maxElement
+     * @return array Of data holding prev & next url locations and a formatted HTML string
+     */
+    public function create_pagination($page, $totalElement, $maxElement = 0, $current_url = NULL)
+    {
+        $prev_symbol = apply_filters('ngg_prev_symbol', '&#9668;');
+        $next_symbol = apply_filters('ngg_next_symbol', '&#9658;');
+
+        if (empty($current_url))
+            $current_url = $this->object->get_routed_url(TRUE);
+
+        $return = array('prev' => '', 'next' => '', 'output' => '');
+
+        if ($maxElement <= 0)
+            return $return;
+
+        $total = $totalElement;
+
+        // create navigation
+        if ($total > $maxElement)
+        {
+            $r = '';
+            if (1 < $page)
+            {
+                $newpage = (1 == $page - 1) ? 1 : $page - 1;
+				$return['prev'] = $this->object->set_param_for($current_url, 'page', $newpage);
+                $r .=  '<a class="prev" data-pageid="' . $newpage . '" id="ngg-prev-' . $newpage . '" href="' . $return['prev'] . '">' . $prev_symbol . '</a>';
+            }
+
+            $total_pages = ceil($total / $maxElement);
+
+            if ($total_pages > 1)
+            {
+                for ($page_num = 1; $page_num <= $total_pages; $page_num++) {
+                    if ($page == $page_num)
+                    {
+                        $r .=  '<span class="current">' . $page_num . '</span>';
+                    }
+                    else {
+                        if ($page_num < 3 || ($page_num >= $page - 3 && $page_num <= $page + 3) || $page_num > $total_pages - 3)
+                        {
+                            $newpage = (1 == $page_num ) ? 1 : $page_num;
+							$link = $this->object->set_param_for($current_url, 'page', $newpage);
+                            $r .= '<a class="page-numbers" data-pageid="' . $newpage . '" href="' . $link . '">' . ($page_num) . '</a>';
+                        }
+                    }
+                }
+            }
+
+            if (($page) * $maxElement < $total || -1 == $total)
+            {
+                $newpage = $page + 1;
+				$return['next'] = $this->object->set_param_for($current_url, 'page', $newpage);
+                $r .=  '<a class="next" data-pageid="' . $newpage . '" id="ngg-next-' . $newpage . '" href="' . $return['next'] . '">' . $next_symbol . '</a>';
+            }
+
+            $return['output'] = "<div class='ngg-navigation'>{$r}</div>";
+        }
+        else {
+            $return['output'] = "<div class='ngg-clear'></div>";
+        }
+
+        return $return;
+    }
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pagination/module.nextgen_pagination.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pagination/module.nextgen_pagination.php
new file mode 100644
index 0000000000000000000000000000000000000000..4e4916aeec137af4fcb29dca8eca9d72bb2ed652
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pagination/module.nextgen_pagination.php
@@ -0,0 +1,30 @@
+<?php
+/*
+{
+    Module: photocrati-nextgen_pagination
+}
+*/
+class M_NextGen_Pagination extends C_Base_Module
+{
+    function define()
+    {
+        parent::define(
+            'photocrati-nextgen_pagination',
+            "Pagination",
+            "Provides pagination for display types",
+            '0.1',
+            "http://www.nextgen-gallery.com",
+            "Photocrati Media",
+            "http://www.photocrati.com"
+        );
+    }
+
+		function get_type_list()
+		{
+			return array(
+				'Mixin_Nextgen_Basic_Pagination' => 'mixin.nextgen_basic_pagination.php'
+			);
+		}
+}
+
+new M_NextGen_Pagination;
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pagination/static/style.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pagination/static/style.css
new file mode 100644
index 0000000000000000000000000000000000000000..d630e970efe1ea72fe60e3477d27cdce28284678
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pagination/static/style.css
@@ -0,0 +1,41 @@
+/* ----------- Gallery navigation -------------*/
+.ngg-navigation {
+    font-size: 0.9em !important;
+    clear: both !important;
+    display: block !important;
+    padding-top: 15px;
+    padding-bottom: 3px;
+    text-align: center;
+}
+
+.ngg-navigation span {
+    font-weight: bold;
+    margin: 0pt 6px;
+}
+
+.ngg-navigation a.page-numbers,
+.ngg-navigation a.next,
+.ngg-navigation a.prev,
+.ngg-navigation span.page-numbers,
+.ngg-navigation span.next,
+.ngg-navigation span.prev {
+    border: 1px solid #DDDDDD;
+    margin-right: 3px;
+    padding: 3px 8px;
+    text-decoration: none;
+}
+
+.ngg-navigation a.page-numbers:hover,
+.ngg-navigation a.next:hover,
+.ngg-navigation a.prev:hover,
+.ngg-navigation span.page-numbers:hover,
+.ngg-navigation span.next:hover,
+.ngg-navigation span.prev:hover {
+    background-color: #0066CC;
+    color: #FFFFFF !important;
+    text-decoration: none !important;
+}
+
+.ngg-clear {
+    clear: both;
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pro_upgrade/adapter.nextgen_pro_upgrade_controller.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pro_upgrade/adapter.nextgen_pro_upgrade_controller.php
new file mode 100644
index 0000000000000000000000000000000000000000..968554e372b2655c2a313af63d23262499383120
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pro_upgrade/adapter.nextgen_pro_upgrade_controller.php
@@ -0,0 +1,45 @@
+<?php
+
+class A_NextGen_Pro_Upgrade_Controller extends Mixin
+{
+    function enqueue_backend_resources()
+    {
+        $this->call_parent('enqueue_backend_resources');
+        wp_enqueue_style(
+            'nextgen_pro_upgrade_page',
+            $this->get_static_url('photocrati-nextgen_pro_upgrade#style.css')
+        );
+    }
+
+    function get_page_title()
+    {
+        return 'Upgrade to Pro';
+    }
+
+    function get_required_permission()
+    {
+        return 'NextGEN Change options';
+    }
+
+    function index_action()
+    {
+		$key = C_Photocrati_Cache::generate_key('nextgen_pro_upgrade_page');
+		if (($html = C_Photocrati_Cache::get('nextgen_pro_upgrade_page', FALSE))) {
+			echo $html;
+		}
+		else {
+			// Get page content
+			$params = array(
+				'btn_url' => $this->object->get_router()->get_static_url('photocrati-nextgen_pro_upgrade#button.png'),
+				'img_url' => $this->object->get_router()->get_static_url('photocrati-nextgen_pro_upgrade#proupgrade.gif')
+			);
+			$html = $this->render_view('photocrati-nextgen_pro_upgrade#index', $params, TRUE);
+
+			// Cache it
+			C_Photocrati_Cache::set($key, $html);
+
+			// Render it
+			echo $html;
+		}
+    }
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pro_upgrade/adapter.nextgen_pro_upgrade_page.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pro_upgrade/adapter.nextgen_pro_upgrade_page.php
new file mode 100644
index 0000000000000000000000000000000000000000..97f228ce745520150f7ecc49adb126d612384d2c
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pro_upgrade/adapter.nextgen_pro_upgrade_page.php
@@ -0,0 +1,20 @@
+<?php
+
+class A_NextGen_Pro_Upgrade_Page extends Mixin
+{
+    function initialize()
+    {
+        // Using include() to retrieve the is_plugin_active() is apparently The WordPress Way(tm)..
+        include_once(ABSPATH . 'wp-admin/includes/plugin.php');
+
+        // We shouldn't show the upgrade page if they already have the plugin and it's active
+        if (defined('NEXTGEN_GALLERY_PRO_PLUGIN_BASENAME') && is_plugin_active(NEXTGEN_GALLERY_PRO_PLUGIN_BASENAME))
+            return;
+
+        $this->object->add(
+            'ngg_pro_upgrade',
+            'A_NextGen_Pro_Upgrade_Controller',
+            NGGFOLDER
+        );
+    }
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pro_upgrade/module.nextgen_pro_upgrade.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pro_upgrade/module.nextgen_pro_upgrade.php
new file mode 100644
index 0000000000000000000000000000000000000000..3f9ee933c45099e823195329c9089aea1c0562f8
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pro_upgrade/module.nextgen_pro_upgrade.php
@@ -0,0 +1,38 @@
+<?php
+/*
+{
+	Module: photocrati-nextgen_pro_upgrade,
+	Depends: { photocrati-nextgen_admin }
+}
+*/
+
+class M_NextGen_Pro_Upgrade extends C_Base_Module
+{
+    function define()
+    {
+        parent::define(
+            'photocrati-nextgen_pro_upgrade',
+            'NextGEN Pro Page',
+            'NextGEN Gallery Pro Upgrade Page',
+            '0.1',
+            'http://www.nextgen-gallery.com',
+            'Photocrati Media',
+            'http://www.photocrati.com'
+        );
+    }
+
+    function _register_adapters()
+    {
+        $this->get_registry()->add_adapter('I_Page_Manager', 'A_NextGen_Pro_Upgrade_Page');
+    }
+
+    function get_type_list()
+    {
+        return array(
+            'A_NextGen_Pro_Upgrade_Controller' => 'adapter.nextgen_pro_upgrade_controller.php',
+            'A_NextGen_Pro_Upgrade_Page' => 'adapter.nextgen_pro_upgrade_page.php'
+        );
+    }
+}
+
+new M_NextGen_Pro_Upgrade;
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pro_upgrade/static/button.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pro_upgrade/static/button.png
new file mode 100644
index 0000000000000000000000000000000000000000..54d70ed904a4d931c17159f5b961bd7ea5c7700a
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pro_upgrade/static/button.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pro_upgrade/static/proupgrade.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pro_upgrade/static/proupgrade.gif
new file mode 100644
index 0000000000000000000000000000000000000000..0902c4c2400dccb36dcf63dcc36867f2334284e7
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pro_upgrade/static/proupgrade.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pro_upgrade/static/style.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pro_upgrade/static/style.css
new file mode 100644
index 0000000000000000000000000000000000000000..c5faca507b8184ed9324a739743f14ebd63d47c7
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pro_upgrade/static/style.css
@@ -0,0 +1,103 @@
+#nextgen_pro_upgrade_page {
+    font-size: 16px;
+}
+
+#nextgen_pro_upgrade_page h1 {
+    font-size: 2.5em;
+    margin-bottom: 40px;
+}
+
+#nextgen_pro_upgrade_page ul {
+    margin-left: 5px;
+    margin-right: 5px;
+    padding-top: 0;
+    list-style-type: disc;
+    list-style-position: inside;
+}
+
+#nextgen_pro_upgrade_page li {
+    padding: 0;
+    margin: 0;
+}
+
+#nextgen_pro_upgrade_page h3 {
+    margin-bottom: 0;
+    text-transform: uppercase;
+}
+
+#nextgen_pro_upgrade_page #first {
+    display: inline-block;
+    max-height: 335px;
+    width: 100%;
+}
+
+#nextgen_pro_upgrade_page #first h2 {
+    color: #afafaf;
+    line-height: 1.2em;
+    margin-top: 5px;
+}
+
+#nextgen_pro_upgrade_page #first .section {
+    min-width: 360px;
+    float: left;
+    margin-right: 30px;
+    margin-left: 15px;
+    font-size: 16px;
+}
+
+#nextgen_pro_upgrade_page #first .section ul {
+    margin-left: 0;
+    padding-left: 0;
+    line-height: 1.5em;
+    list-style-type: none;
+}
+
+#nextgen_pro_upgrade_page #first .section img {
+    margin-top: 25px;
+}
+
+#nextgen_pro_upgrade_page #first #image_wrapper {
+    overflow: hidden;
+}
+
+#nextgen_pro_upgrade_page #first #image_wrapper img {
+    width: 435px;
+    height: auto;
+    display: block;
+    border: 5px solid #ccc;
+}
+
+#nextgen_pro_upgrade_page #second {
+    clear: both;
+    margin-top: 40px;
+    display: inline-block;
+    width: 100%;
+    max-width: 1000px;
+}
+
+#nextgen_pro_upgrade_page #second .section {
+    float: left;
+    width: 26%;
+    text-align: center;
+    border-right: 1px solid #ccc;
+    min-width: 205px;
+    height: 210px;
+}
+
+#nextgen_pro_upgrade_page #second .section h3 {
+    color: #afafaf;
+}
+
+#nextgen_pro_upgrade_page #second ul {
+    list-style-type: none;
+    line-height: 1.2em;
+}
+
+#nextgen_pro_upgrade_page #second .section:first-child {
+    width: 32%;
+}
+
+#nextgen_pro_upgrade_page #second .section:last-child {
+    width: 32%;
+    border: none;
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pro_upgrade/templates/index.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pro_upgrade/templates/index.php
new file mode 100644
index 0000000000000000000000000000000000000000..013154eda10dde120ce69ebc90979f498eb7f54a
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pro_upgrade/templates/index.php
@@ -0,0 +1,59 @@
+<div id='nextgen_pro_upgrade_page'>
+    <h1>Upgrade to NextGen Pro</h1>
+
+    <div id='first'>
+        <div class='section'>
+            <h2>Add Beautiful, Mobile-Friendly<br/>Displays to NextGEN Gallery</h2>
+            <ul>
+                <li>Enjoy 6 gorgeous new gallery display types, our new</li>
+                <li>full screen and responsive Pro Lightbox, commenting,</li>
+                <li>social sharing, deep linking to individual images</li>
+                <li>within galleries, and premium one-on-one support</li>
+                <li>for both NextGEN Gallery and NextGEN Pro.</li>
+            </ul>
+
+            <a href='http://www.nextgen-gallery.com/nextgen-pro' target='_blank'>
+                <img src='<?php print $btn_url; ?>' alt='Learn More' title='Learn More'/>
+            </a>
+        </div>
+
+        <div id='image_wrapper'>
+            <img src='<?php print $img_url; ?>' alt='' title=''/>
+        </div>
+    </div>
+
+    <div id='second'>
+        <div class='section'>
+            <h3>6 New Gallery Displays!</h3>
+            <ul>
+                <li>Pro Masonry Galleries</li>
+                <li>Pro Filmstrip Galleries</li>
+                <li>Pro Filmbox Galleries</li>
+                <li>Pro Thumbnail Galleries</li>
+                <li>Pro Slideshow Galleries</li>
+                <li>Pro Blogstyle Galleries</li>
+                <li>All responsive!</li>
+            </ul>
+        </div>
+
+        <div class='section'>
+            <h3>Pro Lightbox</h3>
+            <ul>
+                <li>Fullscreen and Responsive</li>
+                <li>Social Sharing for Images</li>
+                <li>Commenting for Images</li>
+                <li>Deep Linking for Images</li>
+                <li>Swipe Support for Mobile</li>
+            </ul>
+        </div>
+
+        <div class='section'>
+            <h3>Premium Support</h3>
+            <ul>
+                <li>One-on-One Email Support</li>
+                <li>From the NextGEN Team for Both</li>
+                <li>NextGEN Gallery and NextGEN Pro</li>
+            </ul>
+        </div>
+    </div>
+</div>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_settings/class.nextgen_settings_installer.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_settings/class.nextgen_settings_installer.php
new file mode 100644
index 0000000000000000000000000000000000000000..d4a0557549bc145e82ec602c9e5010525f66d7a0
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_settings/class.nextgen_settings_installer.php
@@ -0,0 +1,170 @@
+<?php
+
+class C_NextGen_Settings_Installer
+{
+	private $_global_settings = array();
+	private $_local_settings  = array();
+
+	function __construct()
+	{
+		$this->blog_settings = C_NextGen_Settings::get_instance();
+		$this->site_settings = C_NextGen_Global_Settings::get_instance();
+
+		$this->_global_settings = array(
+			'gallerypath' => 'wp-content/blogs.dir/%BLOG_ID%/files/',
+			'wpmuCSSfile' => 'nggallery.css',
+			'wpmuStyle'   => FALSE,
+			'wpmuRoles'   => FALSE,
+			'wpmuImportFolder' => FALSE,
+			'wpmuZipUpload'    => FALSE,
+			'datamapper_driver'     => 'custom_table_datamapper',
+			'gallerystorage_driver' => 'ngglegacy_gallery_storage',
+			'maximum_entity_count'  => 500,
+			'router_param_slug'     => 'nggallery'
+		);
+
+		$this->_local_settings = array(
+			'gallerypath'	 => 'wp-content/gallery/',
+			'deleteImg'      => True,              // delete Images
+			'swfUpload'      => True,              // activate the batch upload
+			'usePermalinks'  => False,             // use permalinks for parameters
+			'permalinkSlug'  => 'nggallery',       // the default slug for permalinks
+			'graphicLibrary' => 'gd',              // default graphic library
+			'imageMagickDir' => '/usr/local/bin/', // default path to ImageMagick
+			'useMediaRSS'    => False,             // activate the global Media RSS file
+			'usePicLens'     => False,             // activate the PicLens Link for galleries
+
+			// Tags / categories
+			'activateTags' => 0,  // append related images
+			'appendType'   => 'tags', // look for category or tags
+			'maxImages'    => 7,      // number of images toshow
+			'relatedHeading'   => __('<h3>Related Images:</h3>', 'nggallery'), // subheading for related images
+
+			// Thumbnail Settings
+			'thumbwidth'   => 120,  // Thumb Width
+			'thumbheight'  => 90,   // Thumb height
+			'thumbfix'     => True, // Fix the dimension
+			'thumbquality' => 100,  // Thumb Quality
+
+			// Image Settings
+			'imgWidth'      => 800,   // Image Width
+			'imgHeight'     => 600,   // Image height
+			'imgQuality'    => 100,   // Image Quality
+			'imgBackup'     => True,  // Create a backup
+			'imgAutoResize' => False, // Resize after upload
+
+			// Gallery Settings
+			'galImages'         => '20', // Number of images per page
+			'galPagedGalleries' => 0,    // Number of galleries per page (in a album)
+			'galColumns'        => 0,    // Number of columns for the gallery
+			'galShowSlide'      => True, // Show slideshow
+			'galTextSlide'      => __('[Show slideshow]', 'nggallery'), // Text for slideshow
+			'galTextGallery'    => __('[Show thumbnails]', 'nggallery'), // Text for gallery
+			'galShowOrder'      => 'gallery',   // Show order
+			'galSort'           => 'sortorder', // Sort order
+			'galSortDir'        => 'ASC',       // Sort direction
+			'galNoPages'        => True,        // use no subpages for gallery
+			'galImgBrowser'     => 0,       // Show ImageBrowser => instead effect
+			'galHiddenImg'      => 0,       // For paged galleries we can hide image
+			'galAjaxNav'        => 0,       // AJAX Navigation for Shutter effect
+
+			// Thumbnail Effect
+			'thumbEffect'  => 'fancybox', // select effect
+			'thumbCode'    => 'class="ngg-fancybox" rel="%GALLERY_NAME%"',
+
+			// Watermark settings
+			'wmPos'    => 'botRight',             // Postion
+			'wmXpos'   => 5,                      // X Pos
+			'wmYpos'   => 5,                      // Y Pos
+			'wmType'   => 0,                 // Type : 'image' / 'text'
+			'wmPath'   => '',                     // Path to image
+			'wmFont'   => 'arial.ttf',            // Font type
+			'wmSize'   => 10,                     // Font Size
+			'wmText'   => get_option('blogname'), // Text
+			'wmColor'  => '000000',               // Font Color
+			'wmOpaque' => '100',                  // Font Opaque
+
+			// Image Rotator settings
+			'enableIR'          => 0,
+			'slideFx'           => 'fade',
+			'irURL'             => '',
+			'irXHTMLvalid'      => 0,
+			'irAudio'           => '',
+			'irWidth'           => 600,
+			'irHeight'          => 400,
+			'irShuffle'         => True,
+			'irLinkfromdisplay' => True,
+			'irShownavigation'  => 0,
+			'irShowicons'       => 0,
+			'irWatermark'       => 0,
+			'irOverstretch'     => 'True',
+			'irRotatetime'      => 10,
+			'irTransition'      => 'random',
+			'irKenburns'        => 0,
+			'irBackcolor'       => '000000',
+			'irFrontcolor'      => 'FFFFFF',
+			'irLightcolor'      => 'CC0000',
+			'irScreencolor'     => '000000',
+
+			// CSS Style
+			'activateCSS'       => 1, // activate the CSS file
+			'CSSfile'           => 'nggallery.css',     // set default css filename
+		);
+	}
+
+	function install_global_settings($reset=FALSE)
+	{
+		foreach ($this->_global_settings as $key => $value) {
+			if ($reset) $this->site_settings->set($key, NULL);
+			$this->site_settings->set_default_value($key, $value);
+		}
+	}
+
+	function install_local_settings($reset=FALSE)
+	{
+		foreach ($this->_local_settings as $key => $value) {
+			if ($reset) $this->blog_settings->set($key, NULL);
+			$this->blog_settings->set_default_value($key, $value);
+		}
+
+		if (is_multisite())
+		{
+			// If this is already network activated we just need to use the existing setting
+			// Note: attempting to use C_NextGen_Global_Settings here may result in an infinite loop,
+			// so get_site_option() is used to check
+			if ($options = get_site_option('ngg_options'))
+				$gallerypath = $options['gallerypath'];
+			else
+				$gallerypath = $this->_global_settings['gallerypath'];
+
+			$gallerypath = $this->gallerypath_replace($gallerypath);
+
+			// a gallerypath setting has already been set, so we explicitly set a default AND set a new value
+			$this->blog_settings->set_default_value('gallerypath', $gallerypath);
+			$this->blog_settings->set('gallerypath', $gallerypath);
+		}
+	}
+
+	function install($reset=FALSE)
+	{
+		$this->install_global_settings($reset);
+		$this->install_local_settings($reset);
+	}
+
+	function get_global_defaults()
+	{
+		return $this->_global_settings;
+	}
+
+	function get_local_defaults()
+	{
+		return $this->_local_settings;
+	}
+
+	function gallerypath_replace($gallerypath)
+	{
+		$gallerypath = str_replace('%BLOG_NAME%', get_bloginfo('name'),  $gallerypath);
+		$gallerypath = str_replace('%BLOG_ID%',   get_current_blog_id(), $gallerypath);
+		return $gallerypath;
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_settings/module.nextgen_settings.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_settings/module.nextgen_settings.php
new file mode 100644
index 0000000000000000000000000000000000000000..36e54f3dcb15c76957b68dd59daaab188201874c
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_settings/module.nextgen_settings.php
@@ -0,0 +1,38 @@
+<?php
+
+/***
+{
+	Module:	photocrati-nextgen_settings
+}
+***/
+
+class M_NextGen_Settings extends C_Base_Module
+{
+	/**
+	 * Defines the module
+	 */
+	function define()
+	{
+		parent::define(
+			'photocrati-nextgen_settings',
+			'NextGEN Gallery Settings',
+			'Provides central management for NextGEN Gallery settings',
+			'0.2',
+			'http://www.nextgen-gallery.com',
+			'Photocrati Media',
+			'http://www.photocrati.com'
+		);
+
+		include_once('class.nextgen_settings_installer.php');
+		C_Photocrati_Installer::add_handler($this->module_id, 'C_NextGen_Settings_Installer');
+	}
+
+    function get_type_list()
+    {
+        return array(
+            'C_NextGen_Settings_Installer' => 'class.nextgen_settings_installer.php'
+        );
+    }
+}
+
+new M_NextGen_Settings();
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_xmlrpc/module.nextgen_xmlrpc.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_xmlrpc/module.nextgen_xmlrpc.php
new file mode 100644
index 0000000000000000000000000000000000000000..ec313ad5ff4aee432840049b86a124714a30a521
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_xmlrpc/module.nextgen_xmlrpc.php
@@ -0,0 +1,602 @@
+<?php
+
+/***
+{
+	Module: photocrati-nextgen_xmlrpc
+}
+***/
+class M_NextGen_XmlRpc extends C_Base_Module
+{
+	function define()
+	{
+		parent::define(
+			'photocrati-nextgen_xmlrpc',
+			'NextGEN Gallery XML-RPC',
+			'Provides an XML-RPC API for NextGEN Gallery',
+			'0.1',
+			'http://www.nextgen-gallery.com',
+			'Photocrati Media',
+			'http://www.photocrati.com'
+		);
+	}
+
+	function _register_hooks()
+	{
+		add_filter('xmlrpc_methods', array(&$this, 'add_methods') );
+	}
+
+	function add_methods($methods)
+	{
+		$methods['ngg.installed'] = array(&$this, 'get_version');
+		// Image methods
+		$methods['ngg.getImage'] = array(&$this, 'get_image');
+		$methods['ngg.getImages'] = array(&$this, 'get_images');
+		$methods['ngg.uploadImage'] = array(&$this, 'upload_image');
+		$methods['ngg.editImage'] = array(&$this, 'edit_image');
+		$methods['ngg.deleteImage'] = array(&$this, 'delete_image');
+		// Gallery methods
+		$methods['ngg.getGallery'] = array(&$this, 'get_gallery');
+		$methods['ngg.getGalleries'] = array(&$this, 'get_galleries');
+		$methods['ngg.newGallery'] = array(&$this, 'create_gallery');
+		$methods['ngg.editGallery'] = array(&$this, 'edit_gallery');
+		$methods['ngg.deleteGallery'] = array(&$this, 'delete_gallery');
+		
+		// Album methods
+		$methods['ngg.getAlbum'] = array(&$this, 'get_album');
+		$methods['ngg.getAlbums'] = array(&$this, 'get_albums');
+		$methods['ngg.newAlbum'] = array(&$this, 'create_album');
+		$methods['ngg.editAlbum'] = array(&$this, 'edit_album');
+		$methods['ngg.deleteAlbum'] = array(&$this, 'delete_album');
+
+		return $methods;
+	}
+
+	/**
+	 * Gets the version of NextGEN Gallery installed
+	 * @return string
+	 */
+	function get_version()
+	{
+		return array('version' => NEXTGEN_GALLERY_PLUGIN_VERSION);
+	}
+
+	/**
+	 * Login a user
+	 * @param $username
+	 * @param $password
+	 * @return bool|WP_Error|WP_User
+	 */
+	function login($username, $password, $blog_id=1)
+	{
+		$retval = FALSE;
+
+		if (!is_a(($user_obj = wp_authenticate($username, $password)), 'WP_Error')) {
+			wp_set_current_user($user_obj->ID);
+			$retval = $user_obj;
+
+			if (is_multisite()) switch_to_blog($blog_id);
+		}
+
+		return $retval;
+	}
+
+	function can_manage_gallery($gallery_id_or_obj, $check_upload_capability=FALSE)
+	{
+		$retval = FALSE;
+
+		// Get the gallery object, if we don't have it already
+		$gallery = NULL;
+		if (is_int($gallery_id_or_obj)) {
+			$gallery_mapper = C_Gallery_Mapper::get_instance();
+			$gallery = $gallery_mapper->find($gallery_id_or_obj);
+		}
+
+		$security = $this->get_registry()->get_utility('I_Security_Manager');
+		$actor	  = $security->get_current_actor();
+		if ($actor->get_entity_id() == $gallery->author) 			$retval = TRUE;
+		elseif ($actor->is_allowed('nextgen_edit_gallery_unowned')) $retval = TRUE;
+
+		// Optionally, check if the user can upload to this gallery
+		if ($retval && $check_upload_capability) {
+			$retval = $actor->is_allowed('nextgen_upload_image');
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Returns a single image object
+	 * @param $args (blog_id, username, password, pid)
+	 */
+	function get_image($args, $return_model=FALSE)
+	{
+		$retval		= new IXR_Error(403, 'Invalid username or password');
+		$blog_id	= intval($args[0]);
+		$username	= strval($args[1]);
+		$password   = strval($args[2]);
+		$image_id	= intval($args[3]);
+
+		// Authenticate the user
+		if ($this->login($username, $password, $blog_id)) {
+
+			// Try to find the image
+			$image_mapper = C_Image_Mapper::get_instance();
+			if (($image = $image_mapper->find($image_id, TRUE))) {
+
+				// Try to find the gallery that the image belongs to
+				$gallery_mapper = C_Gallery_Mapper::get_instance();
+				if (($gallery = $gallery_mapper->find($image->galleryid))) {
+
+					// Does the user have sufficient capabilities?
+					if ($this->can_manage_gallery($gallery)) {
+						$storage = C_Gallery_Storage::get_instance();
+						$image->imageURL	= $storage->get_image_url($image);
+						$image->thumbURL	= $storage->get_thumb_url($image);
+						$image->imagePath	= $storage->get_image_abspath($image);
+						$image->thumbPath	= $storage->get_thumb_abspath($image);
+						$retval = $return_model ? $image : $image->get_entity();
+					}
+
+					else {
+						$retval = new IXR_Error(403, "You don't have permission to manage gallery #{$image->galleryid}");
+					}
+				}
+
+				// No gallery found
+				else {
+					$retval = new IXR_Error(404, "Gallery not found (with id #{$image->gallerid}");
+				}
+			}
+
+			// No image found
+			else $retval = FALSE;
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Returns a collection of images
+	 * @param $args (blog_id, username, password, gallery_id
+	 */
+	function get_images($args)
+	{
+		$retval		= new IXR_Error(403, 'Invalid username or password');
+		$blog_id	= intval($args[0]);
+		$username	= strval($args[1]);
+		$password   = strval($args[2]);
+		$gallery_id	= intval($args[3]);
+
+		// Authenticate the user
+		if ($this->login($username, $password, $blog_id)) {
+
+			// Try to find the gallery
+			$mapper = C_Gallery_Mapper::get_instance();
+			if (($gallery = $mapper->find($gallery_id, TRUE))) {
+
+				// Does the user have sufficient capabilities?
+				if ($this->can_manage_gallery($gallery)) {
+					$retval = $gallery->get_images();
+				}
+				else {
+					$retval = new IXR_Error(403, "You don't have permission to manage gallery #{$image->galleryid}");
+				}
+			}
+
+			// No gallery found
+			else {
+				$retval = new IXR_Error(404, "Gallery not found (with id #{$image->gallerid}");
+			}
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Uploads an image to a particular gallery
+	 * @param $args (blog_id, username, password, data)
+	 *
+	 * Data is an assoc array:
+	 *	          o string name
+	 *            o string type (optional)
+	 *	          o base64 bits
+	 *	          o bool overwrite (optional)
+	 *			  o int gallery
+	 *			  o int image_id  (optional)
+	 * @return image
+	 */
+	function upload_image($args)
+	{
+		$retval		= new IXR_Error(403, 'Invalid username or password');
+		$blog_id	= intval($args[0]);
+		$username	= strval($args[1]);
+		$password   = strval($args[2]);
+		$data		= $args[3];
+		$gallery_id = isset($data['gallery_id']) ? $data['gallery_id'] : $data['gallery'];
+
+		// Authenticate the user
+		if ($this->login($username, $password, $blog_id)) {
+
+			// Try to find the gallery
+			$mapper = C_Gallery_Mapper::get_instance();
+			if (($gallery = $mapper->find($gallery_id, TRUE))) {
+
+				// Does the user have sufficient capabilities?
+				if ($this->can_manage_gallery($gallery, TRUE)) {
+
+					// Upload the image
+					$storage	= C_Gallery_Storage::get_instance();
+					$image		= $storage->upload_base64_image($gallery, $data['bits'], $data['name'], $data['image_id']);
+					if ($image) {
+						$storage = C_Gallery_Storage::get_instance();
+						$image->imageURL	= $storage->get_image_url($image);
+						$image->thumbURL	= $storage->get_thumb_url($image);
+						$image->imagePath	= $storage->get_image_abspath($image);
+						$image->thumbPath	= $storage->get_thumb_abspath($image);
+						$retval = $image->get_entity();
+					}
+					else
+						$retval = new IXR_Error(500, "Could not upload image");
+				}
+				else {
+					$retval = new IXR_Error(403, "You don't have permission to upload to gallery #{$image->galleryid}");
+				}
+			}
+
+			// No gallery found
+			else {
+				$retval = new IXR_Error(404, "Gallery not found (with id #{$image->gallerid}");
+			}
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Edits an image object
+	 * @param $args (blog_id, username, password, image_id, alttext, description, exclude, other_properties
+	 */
+	function edit_image($args)
+	{
+		$alttext 		= strval($args[4]);
+		$description	= strval($args[5]);
+		$exclude		= intval($args[6]);
+		$properties		= isset($args[7]) ? (array)$args[7] : array();
+
+		$retval = $this->get_image($args, TRUE);
+		if (!($retval instanceof IXR_Error)) {
+			$retval->alttext 		= $alttext;
+			$retval->description 	= $description;
+			$retval->exclude		= $exclude;
+
+			// Other properties can be specified using an associative array
+			foreach ($properties as $key => $value) {
+				$retval->$key = $value;
+			}
+
+			$retval = $retval->save();
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Deletes an existing image from a gallery
+	 * @param $args (blog_id, username, password, image_id)
+	 */
+	function delete_image($args)
+	{
+		$retval = $this->get_image($args, TRUE);
+		if (!($retval instanceof IXR_Error)) {
+			$retval = $retval->destroy();
+		}
+		return $retval;
+	}
+
+	/**
+	 * Creates a new gallery
+	 * @param $args (blog_id, username, password, title)
+	 */
+	function create_gallery($args)
+	{
+		$retval		= new IXR_Error(403, 'Invalid username or password');
+		$blog_id	= intval($args[0]);
+		$username	= strval($args[1]);
+		$password   = strval($args[2]);
+		$title		= strval($args[3]);
+
+		// Authenticate the user
+		if ($this->login($username, $password, $blog_id)) {
+
+			$security = $this->get_registry()->get_utility('I_Security_Manager');
+			if ($security->is_allowed('nextgen_edit_gallery')) {
+				$mapper = C_Gallery_Mapper::get_instance();
+				if (($gallery = $mapper->create(array('title'	=>	$title))) && $gallery->save()) {
+					$retval = $gallery->id();
+				}
+				else $retval = new IXR_Error(500, "Unable to create gallery");
+
+			}
+			else $retval = new IXR_Error(403, "Sorry, but you must be able to manage galleries. Check your roles/capabilities.");
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Edits an existing gallery
+	 * @param $args (blog_id, username, password, gallery_id, name, title, description, preview_pic_id)
+	 */
+	function edit_gallery($args)
+	{
+		$retval		= new IXR_Error(403, 'Invalid username or password');
+		$blog_id	= intval($args[0]);
+		$username	= strval($args[1]);
+		$password   = strval($args[2]);
+		$gallery_id = intval($args[3]);
+		$name		= strval($args[4]);
+		$title		= strval($args[5]);
+		$image_id	= intval($args[6]);
+		$properties = isset($args[7]) ? (array) $args[7] : array();
+
+		// Authenticate the user
+		if ($this->login($username, $password, $blog_id)) {
+
+			$mapper = C_Gallery_Mapper::get_instance();
+			if (($gallery = $mapper->find($gallery_id, TRUE))) {
+				if ($this->can_manage_gallery($gallery)) {
+					$gallery->name	= $name;
+					$gallery->title = $title;
+					$gallery->previewpic = $image_id;
+					foreach ($properties as $key => $value) {
+						$gallery->$key = $value;
+					}
+					$retval = $gallery->save();
+				}
+				else $retval = new IXR_Error(403, "You don't have permission to modify this gallery");
+			}
+			else $retval = new IXR_Error(404, "Gallery #{$gallery_id} doesn't exist");
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Gets a single gallery instance
+	 * @param $args (blog_id, username, password, gallery_id)
+	 */
+	function get_gallery($args, $return_model=FALSE)
+	{
+		$retval		= new IXR_Error(403, 'Invalid username or password');
+		$blog_id	= intval($args[0]);
+		$username	= strval($args[1]);
+		$password   = strval($args[2]);
+		$gallery_id	= intval($args[3]);
+
+		// Authenticate the user
+		if ($this->login($username, $password, $blog_id)) {
+			$mapper = C_Gallery_Mapper::get_instance();
+			if (($gallery = $mapper->find($gallery_id, TRUE))) {
+				if ($this->can_manage_gallery($gallery)) {
+					$retval = $return_model ? $gallery : $gallery->get_entity();
+				}
+			}
+			else $retval = FALSE;
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Deletes a gallery
+	 * @param $args (blog_id, username, password, gallery_id)
+	 */
+	function delete_gallery($args)
+	{
+		$retval = $this->get_gallery($args, TRUE);
+
+		if (!($retval instanceof IXR_Error)) {
+			$retval = $retval->destroy();
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Creates a new album
+	 * @param $args (blog_id, username, password, title, previewpic, description, galleries
+	 */
+	function create_album($args)
+	{
+		$retval		= new IXR_Error(403, 'Invalid username or password');
+		$blog_id	= intval($args[0]);
+		$username	= strval($args[1]);
+		$password   = strval($args[2]);
+		$title		= intval($args[3]);
+		$previewpic = isset($args[4]) ? intval($args[4]): 0;
+		$desc		= isset($args[5]) ? strval($args[5]) : '';
+		$sortorder  = isset($args[6]) ? $args[6] : '';
+		$page_id	= isset($args[7]) ? intval($args[7]) : 0;
+
+		// Authenticate the user
+		if ($this->login($username, $password, $blog_id)) {
+
+			// Is request allowed?
+			$security = $this->get_registry()->get_utility('I_Security_Manager');
+			if ($security->is_allowed('nextgen_edit_album')) {
+
+				$mapper = C_Album_Mapper::get_instance();
+				$album = $mapper->create(array(
+					'name'			=>	$title,
+					'previewpic'	=>	$previewpic,
+					'albumdesc'		=>	$desc,
+					'sortorder'		=>	$sortorder,
+					'page_id'		=>	$page_id
+				));
+
+				if ($album->save()) $retval = $album->id();
+				else $retval = new IXR_Error(500, "Unable to create album");
+			}
+		}
+
+		return $retval;
+	}
+
+
+	/**
+	 * Returns all albums
+	 * @param $args (blog_id, username, password)
+	 * @return IXR_Error
+	 */
+	function get_albums($args)
+	{
+		$retval		= new IXR_Error(403, 'Invalid username or password');
+		$blog_id	= intval($args[0]);
+		$username	= strval($args[1]);
+		$password   = strval($args[2]);
+
+		// Authenticate the user
+		if ($this->login($username, $password, $blog_id)) {
+
+			// Are we allowed?
+			$security = $this->get_registry()->get_utility('I_Security_Manager');
+			if ($security->is_allowed('nextgen_edit_album')) {
+
+				// Fetch all albums
+				$mapper = C_Album_Mapper::get_instance();
+				$retval = array();
+				foreach ($mapper->find_all() as $album) {
+					// Vladimir's Lightroom plugins requires the 'id' to be a string
+					// Ask if he can accept integers as well. Currently, integers break
+					// his plugin
+					$album->id = (string) $album->id;
+					$album->galleries = $album->sortorder;
+
+					$retval[$album->{$album->id_field}] = (array) $album;
+				}
+			}
+			else $retval = new IXR_Error(403, "Sorry, you must be able to manage albums");
+
+
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Gets a single album
+	 * @param $args (blog_id, username, password, album_id)
+	 */
+	function get_album($args, $return_model=FALSE)
+	{
+		$retval		= new IXR_Error(403, 'Invalid username or password');
+		$blog_id	= intval($args[0]);
+		$username	= strval($args[1]);
+		$password   = strval($args[2]);
+		$album_id	= intval($args[3]);
+
+		// Authenticate the user
+		if ($this->login($username, $password, $blog_id)) {
+
+			// Are we allowed?
+			$security = $this->get_registry()->get_utility('I_Security_Manager');
+			if ($security->is_allowed('nextgen_edit_album')) {
+				$mapper = C_Album_Mapper::get_instance();
+				$album = $mapper->find($album_id, TRUE);
+
+				// Vladimir's Lightroom plugins requires the 'id' to be a string
+				// Ask if he can accept integers as well. Currently, integers break
+				// his plugin
+				$album->id = (string) $album->id;
+				$album->galleries = $album->sortorder;
+
+				$retval = $return_model ? $album : $album->get_entity();
+			}
+			else $retval = new IXR_Error(403, "Sorry, you must be able to manage albums");
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Deletes an existing album
+	 * @param $args (blog_id, username, password, album_id)
+	 */
+	function delete_album($args)
+	{
+		$retval = $this->get_album($args, TRUE);
+
+		if (!($retval instanceof IXR_Error)) {
+			$retval = $retval->destroy();
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Edit an existing album
+	 * @param $args (blog_id, username, password, album_id, name, preview pic id, description, galleries)
+	 */
+	function edit_album($args)
+	{
+		$retval = $this->get_album($args, TRUE);
+
+		if (!($retval instanceof IXR_Error)) {
+			$retval->name 		= strval($args[4]);
+			$retval->previewpic = intval($args[5]);
+			$retval->albumdesc	= strval($args[6]);
+			$retval->sortorder  = $args[7];
+
+			$properties = isset($args[8]) ? $args[8] : array();
+			foreach ($properties as $key => $value) $retval->$key = $value;
+			unset($retval->galleries);
+
+			$retval = $retval->save();
+		}
+
+		return $retval;
+	}
+
+
+	/**
+	 * Returns all galleries
+	 * @param $args (blog_id, username, password)
+	 */
+	function get_galleries($args)
+	{
+		$retval		= new IXR_Error(403, 'Invalid username or password');
+		$blog_id	= intval($args[0]);
+		$username	= strval($args[1]);
+		$password   = strval($args[2]);
+
+		// Authenticate the user
+		if ($this->login($username, $password, $blog_id)) {
+
+			// Do we have permission?
+			$security = $this->get_registry()->get_utility('I_Security_Manager');
+			if ($security->is_allowed('nextgen_edit_gallery')) {
+				$mapper 		= C_Gallery_Mapper::get_instance();
+				$image_mapper	= C_Image_Mapper::get_instance();
+				$storage		= C_Gallery_Storage::get_instance();
+				$retval			= array();
+				foreach ($mapper->find_all() as $gallery) {
+					// Vladimir's Lightroom plugins requires the 'id' to be a string
+					// Ask if he can accept integers as well. Currently, integers break
+					// his plugin
+					$gallery->gid = (string) $gallery->gid;
+
+					// Set other gallery properties
+					$image_counter = array_pop($image_mapper->select('COUNT(*) as counter')->where(array("galleryid = %d", $gallery->gid))->run_query());
+					$gallery->counter = $image_counter->counter;
+					$gallery->abspath = $storage->get_gallery_abspath($gallery);
+					$retval[$gallery->{$gallery->id_field}] = (array)$gallery;
+				}
+			}
+			else $retval = new IXR_Error( 401, __( 'Sorry, you must be able to manage galleries' ) );
+		}
+
+		return $retval;
+	}
+}
+
+new M_NextGen_XmlRpc;
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/admin.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/admin.php
new file mode 100644
index 0000000000000000000000000000000000000000..64b5f5cebbe8f57eaf7eb2934bd842af07b675b3
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/admin.php
@@ -0,0 +1,612 @@
+<?php
+/**
+ * nggAdminPanel - Admin Section for NextGEN Gallery
+ *
+ * @package NextGEN Gallery
+ * @author Alex Rabe
+ *
+ * @since 1.0.0
+ */
+class nggAdminPanel{
+
+	// constructor
+	function __construct() {
+
+		// Buffer the output
+		add_action('admin_init', array(&$this, 'start_buffer'));
+
+		// Add the admin menu
+		add_action( 'admin_menu', array (&$this, 'add_menu') );
+        add_action( 'admin_bar_menu', array(&$this, 'admin_bar_menu'), 99 );
+		add_action( 'network_admin_menu', array (&$this, 'add_network_admin_menu') );
+
+		// Add the script and style files
+		add_action('admin_print_scripts', array(&$this, 'load_scripts') );
+		add_action('admin_print_styles', array(&$this, 'load_styles') );
+
+		// Try to detect plugins that embed their own jQuery and jQuery UI
+		// libraries and load them in NGG's admin pages
+		add_action('admin_enqueue_scripts', array(&$this, 'buffer_scripts'), 0);
+		add_action('admin_print_scripts', array(&$this, 'output_scripts'), PHP_INT_MAX);
+
+        //TODO: remove after release of Wordpress 3.3
+		add_filter('contextual_help', array(&$this, 'show_help'), 10, 2);
+        add_filter('current_screen', array(&$this, 'edit_current_screen'));
+
+        // Add WPML hook to register description / alt text for translation
+        add_action('ngg_image_updated', array('nggGallery', 'RegisterString') );
+
+	}
+
+	function start_buffer()
+	{
+		// Notify of page event
+		if (isset($_REQUEST['page']) && $_POST) {
+			$event = array(
+				'event'	=>	str_replace('-', '_', str_replace('nggallery', '', $_REQUEST['page']))
+			);
+
+			// Do we have a list of galleries that are being affected?
+			if (isset($_REQUEST['doaction'])) {
+				$event['gallery_ids']	= $_REQUEST['doaction'];
+			}
+
+			// Do we have a particular gallery id?
+			elseif (isset($_REQUEST['gid'])) {
+				$event['gallery_id']	= $_REQUEST['gid'];
+			}
+
+			// Do we have an album id?
+			elseif (isset($_REQUEST['act_album']) && $_REQUEST['act_album']) {
+				$event['album_id']		= $_REQUEST['act_album'];
+			}
+			if (strpos($event['event'], '_') === 0) $event['event'] = substr($event['event'], 1);
+
+			do_action('ngg_page_event', $event);
+		}
+		ob_start();
+	}
+
+	/**
+	 * If a NGG page is being requested, we buffer any rendering of <script>
+	 * tags to detect conflicts and remove them if need be
+	 */
+	function buffer_scripts()
+	{
+		// Is this a NGG admin page?
+		if (isset($_REQUEST['page']) && strpos($_REQUEST['page'] ,'nggallery') !== FALSE) {
+			ob_start();
+		}
+	}
+
+	function output_scripts()
+	{
+		// Is this a NGG admin page?
+		if (isset($_REQUEST['page']) && strpos($_REQUEST['page'] ,'nggallery') !== FALSE) {
+			$plugin_folder		= NGGFOLDER;
+			$skipjs_count		= 0;
+			$html = ob_get_contents();
+			ob_end_clean();
+
+            if (!defined('NGG_JQUERY_CONFLICT_DETECTION')) {
+				define('NGG_JQUERY_CONFLICT_DETECTION', TRUE);
+			}
+
+			if (NGG_JQUERY_CONFLICT_DETECTION) {
+				// Detect custom jQuery script
+				if (preg_match_all("/<script.*wp-content.*jquery[-_\.](min\.)?js.*<\script>/", $html, $matches, PREG_SET_ORDER)) {
+					foreach ($matches as $match) {
+						$old_script = array_shift($match);
+						if (strpos($old_script, NEXTGEN_GALLERY_PLUGIN_DIR) === FALSE)
+							$html = str_replace($old_script, '', $html);
+					}
+				}
+
+				// Detect custom jQuery UI script and remove
+				if (preg_match_all("/<script.*wp-content.*jquery[-_\.]ui.*<\/script>/", $html, $matches, PREG_SET_ORDER)) {
+					$detected_jquery_ui = TRUE;
+					foreach ($matches as $match) {
+						$old_script = array_shift($match);
+						if (strpos($old_script, NEXTGEN_GALLERY_PLUGIN_DIR) === FALSE)
+							$html = str_replace($old_script, '', $html);
+					}
+				}
+
+				if (isset($_REQUEST['skipjs'])) {
+					foreach ($_REQUEST['skipjs'] as $js) {
+						$js = preg_quote($js);
+						if (preg_match_all("#<script.*{$js}.*</script>#", $html, $matches, PREG_SET_ORDER)) {
+							foreach ($matches as $match) {
+								$old_script = array_shift($match);
+								if (strpos($old_script, NGGFOLDER) === FALSE)
+									$html = str_replace($old_script, '', $html);
+							}
+						}
+					}
+					$skipjs_count = count($_REQUEST['skipjs']);
+				}
+
+
+				// Use WordPress built-in version of jQuery
+				$jquery_url = includes_url('js/jquery/jquery.js');
+				$html = implode('', array(
+					"<script type='text/javascript' src='{$jquery_url}'></script>\n",
+					"<script type='text/javascript'>
+					window.onerror = function(msg, url, line){
+						if (url.match(/\.js$|\.js\?/)) {
+							if (window.location.search.length > 0) {
+								if (window.location.search.indexOf(url) == -1)
+									window.location.search += '&skipjs[{$skipjs_count}]='+url;
+							}
+							else {
+								window.location.search = '?skipjs[{$skipjs_count}]='+url;
+							}
+						}
+						return true;
+					};</script>\n",
+					$html
+				));
+			}
+
+			echo $html;
+		}
+	}
+
+	// integrate the menu
+	function add_menu()  {
+
+		add_menu_page( _n( 'Gallery', 'Galleries', 1, 'nggallery' ), _n( 'Gallery', 'Galleries', 1, 'nggallery' ), 'NextGEN Gallery overview', NGGFOLDER, array (&$this, 'show_menu'), path_join(NGGALLERY_URLPATH, 'admin/images/nextgen_16_color.png') );
+	    add_submenu_page( NGGFOLDER , __('Overview', 'nggallery'), __('Overview', 'nggallery'), 'NextGEN Gallery overview', NGGFOLDER, array (&$this, 'show_menu'));
+	    add_submenu_page( NGGFOLDER , __('Manage Galleries', 'nggallery'), __('Manage Galleries', 'nggallery'), 'NextGEN Manage gallery', 'nggallery-manage-gallery', array (&$this, 'show_menu'));
+	    add_submenu_page( NGGFOLDER , _n( 'Manage Albums', 'Albums', 1, 'nggallery' ), _n( 'Manage Albums', 'Manage Albums', 1, 'nggallery' ), 'NextGEN Edit album', 'nggallery-manage-album', array (&$this, 'show_menu'));
+	    add_submenu_page( NGGFOLDER , __('Manage Tags', 'nggallery'), __('Manage Tags', 'nggallery'), 'NextGEN Manage tags', 'nggallery-tags', array (&$this, 'show_menu'));
+//	    if ( !is_multisite() || wpmu_site_admin() )
+//            add_submenu_page( NGGFOLDER , __('Reset / Uninstall', 'nggallery'), __('Reset / Uninstall', 'nggallery'), 'activate_plugins', 'nggallery-setup', array (&$this, 'show_menu'));
+
+		//register the column fields
+		$this->register_columns();
+	}
+
+	// integrate the network menu
+	function add_network_admin_menu()  {
+
+		add_menu_page( _n( 'Gallery', 'Galleries', 1, 'nggallery' ), _n( 'Gallery', 'Galleries', 1, 'nggallery' ), 'nggallery-wpmu', NGGFOLDER, array (&$this, 'show_network_settings'), path_join(NGGALLERY_URLPATH, 'admin/images/nextgen_16_color.png') );
+		add_submenu_page( NGGFOLDER , __('Network settings', 'nggallery'), __('Network settings', 'nggallery'), 'nggallery-wpmu', NGGFOLDER,  array (&$this, 'show_network_settings'));
+        // add_submenu_page( NGGFOLDER , __('Reset / Uninstall', 'nggallery'), __('Reset / Uninstall', 'nggallery'), 'activate_plugins', 'nggallery-setup', array (&$this, 'show_menu'));
+	}
+
+    /**
+     * Adding NextGEN Gallery to the Admin bar
+     *
+     * @since 1.9.0
+     *
+     * @return void
+     */
+    function admin_bar_menu() {
+    	// If the current user can't write posts, this is all of no use, so let's not output an admin menu
+    	if ( !current_user_can('NextGEN Gallery overview') )
+    		return;
+
+    	global $wp_admin_bar;
+
+    	$wp_admin_bar->add_menu( array( 'id' => 'ngg-menu', 'title' => __( 'Gallery' ), 'href' => admin_url('admin.php?page='. NGGFOLDER) ) );
+        $wp_admin_bar->add_menu( array( 'parent' => 'ngg-menu', 'id' => 'ngg-menu-overview', 'title' => __('Overview', 'nggallery'), 'href' => admin_url('admin.php?page='. NGGFOLDER) ) );
+        if ( current_user_can('NextGEN Upload images') )
+            $wp_admin_bar->add_menu( array( 'parent' => 'ngg-menu', 'id' => 'ngg-menu-add-gallery', 'title' => __('Add Gallery / Images', 'nggallery'), 'href' => admin_url('admin.php?page=ngg_addgallery') ) );
+        if ( current_user_can('NextGEN Manage gallery') )
+            $wp_admin_bar->add_menu( array( 'parent' => 'ngg-menu', 'id' => 'ngg-menu-manage-gallery', 'title' => __('Manage Galleries', 'nggallery'), 'href' => admin_url('admin.php?page=nggallery-manage-gallery') ) );
+        if ( current_user_can('NextGEN Edit album') )
+            $wp_admin_bar->add_menu( array( 'parent' => 'ngg-menu', 'id' => 'ngg-menu-manage-album', 'title' => _n( 'Manage Albums', 'Manage Albums', 1, 'nggallery' ), 'href' => admin_url('admin.php?page=nggallery-manage-album') ) );
+        if ( current_user_can('NextGEN Manage tags') )
+            $wp_admin_bar->add_menu( array( 'parent' => 'ngg-menu', 'id' => 'ngg-menu-tags', 'title' => __('Manage Tags', 'nggallery'), 'href' => admin_url('admin.php?page=nggallery-tags') ) );
+    }
+
+    // show the network page
+    function show_network_settings() {
+		include_once ( dirname (__FILE__) . '/style.php' );
+		include_once ( dirname (__FILE__) . '/wpmu.php' );
+		nggallery_wpmu_setup();
+    }
+
+	// load the script for the defined page and load only this code
+	function show_menu() {
+		global $ngg;
+
+		// Set installation date
+		if( empty($ngg->options['installDate']) ) {
+			$ngg->options['installDate'] = time();
+			update_option('ngg_options', $ngg->options);
+		}
+
+		// Show donation message only one time.
+		if (isset ( $_GET['hide_donation']) ) {
+			$ngg->options['hideDonation'] = true;
+			update_option('ngg_options', $ngg->options);
+		}
+
+		echo '<div id="ngg_page_content">';
+  		switch ($_GET['page']){
+			case "nggallery-manage-gallery" :
+				include_once ( dirname (__FILE__) . '/functions.php' );	// admin functions
+				include_once ( dirname (__FILE__) . '/manage.php' );	// nggallery_admin_manage_gallery
+				// Initate the Manage Gallery page
+				$ngg->manage_page = new nggManageGallery ();
+				// Render the output now, because you cannot access a object during the constructor is not finished
+				$ngg->manage_page->controller();
+				break;
+			case "nggallery-manage-album" :
+				include_once ( dirname (__FILE__) . '/album.php' );		// nggallery_admin_manage_album
+				$ngg->manage_album = new nggManageAlbum ();
+				$ngg->manage_album->controller();
+				break;
+			case "nggallery-options" :
+				include_once ( dirname (__FILE__) . '/settings.php' );	// nggallery_admin_options
+				$ngg->option_page = new nggOptions ();
+				$ngg->option_page->controller();
+				break;
+			case "nggallery-tags" :
+				include_once ( dirname (__FILE__) . '/tags.php' );		// nggallery_admin_tags
+				break;
+			case "nggallery-style" :
+				include_once ( dirname (__FILE__) . '/style.php' );		// nggallery_admin_style
+				nggallery_admin_style();
+				break;
+			case "nggallery-setup" :
+				include_once ( dirname (__FILE__) . '/setup.php' );		// nggallery_admin_setup
+				nggallery_admin_setup();
+				break;
+			case "nggallery-roles" :
+				include_once ( dirname (__FILE__) . '/roles.php' );		// nggallery_admin_roles
+				nggallery_admin_roles();
+				break;
+			case "nggallery-import" :
+				include_once ( dirname (__FILE__) . '/myimport.php' );	// nggallery_admin_import
+				nggallery_admin_import();
+				break;
+			case "nggallery-about" :
+				include_once ( dirname (__FILE__) . '/about.php' );		// nggallery_admin_about
+				nggallery_admin_about();
+				break;
+			case "nggallery" :
+			default :
+				include_once ( dirname (__FILE__) . '/overview.php' ); 	// nggallery_admin_overview
+				nggallery_admin_overview();
+				break;
+		}
+		echo "</div>";
+	}
+
+	function load_scripts() {
+		global $wp_version;
+
+		// no need to go on if it's not a plugin page
+		if( !isset($_GET['page']) )
+			return;
+
+		// If we're on a NextGen Page
+//		if (preg_match("/ngg|nextgen-gallery/", $_GET['page'])) {
+//			wp_register_script('ngg_social_media', path_join(
+//				NGGALLERY_URLPATH,
+//				'admin/js/ngg_social_media.js'
+//			), array('jquery'));
+//
+//			wp_register_style('ngg_social_media', path_join(
+//				NGGALLERY_URLPATH,
+//				'admin/css/ngg_social_media.css'
+//			));
+//
+//			wp_enqueue_style('ngg_social_media');
+//			wp_enqueue_script('ngg_social_media');
+//		}
+
+        // used to retrieve the uri of some module resources
+        $router = C_Component_Registry::get_instance()->get_utility('I_Router');
+
+		wp_register_script('ngg-ajax', NGGALLERY_URLPATH . 'admin/js/ngg.ajax.js', array('jquery'), '1.4.1');
+		wp_localize_script('ngg-ajax', 'nggAjaxSetup', array(
+					'url' => admin_url('admin-ajax.php'),
+					'action' => 'ngg_ajax_operation',
+					'operation' => '',
+					'nonce' => wp_create_nonce( 'ngg-ajax' ),
+					'ids' => '',
+					'permission' => __('You do not have the correct permission', 'nggallery'),
+					'error' => __('Unexpected Error', 'nggallery'),
+					'failure' => __('A failure occurred', 'nggallery')
+		) );
+        wp_register_script( 'ngg-plupload-handler', NGGALLERY_URLPATH .'admin/js/plupload.handler.js', array('plupload-all'), '0.0.1' );
+    	wp_localize_script( 'ngg-plupload-handler', 'pluploadL10n', array(
+    		'queue_limit_exceeded' => __('You have attempted to queue too many files.'),
+    		'file_exceeds_size_limit' => __('This file exceeds the maximum upload size for this site.'),
+    		'zero_byte_file' => __('This file is empty. Please try another.'),
+    		'invalid_filetype' => __('This file type is not allowed. Please try another.'),
+    		'not_an_image' => __('This file is not an image. Please try another.'),
+    		'image_memory_exceeded' => __('Memory exceeded. Please try another smaller file.'),
+    		'image_dimensions_exceeded' => __('This is larger than the maximum size. Please try another.'),
+    		'default_error' => __('An error occurred in the upload. Please try again later.'),
+    		'missing_upload_url' => __('There was a configuration error. Please contact the server administrator.'),
+    		'upload_limit_exceeded' => __('You may only upload 1 file.'),
+    		'http_error' => __('HTTP error.'),
+    		'upload_failed' => __('Upload failed.'),
+    		'io_error' => __('IO error.'),
+    		'security_error' => __('Security error.'),
+    		'file_cancelled' => __('File canceled.'),
+    		'upload_stopped' => __('Upload stopped.'),
+    		'dismiss' => __('Dismiss'),
+    		'crunching' => __('Crunching&hellip;'),
+    		'deleted' => __('moved to the trash.'),
+    		'error_uploading' => __('&#8220;%s&#8221; has failed to upload due to an error')
+    	) );
+		wp_register_script('ngg-progressbar', NGGALLERY_URLPATH .'admin/js/ngg.progressbar.js', array('jquery'), '2.0.1');
+        wp_register_script('jquery-ui-autocomplete', NGGALLERY_URLPATH .'admin/js/jquery.ui.autocomplete.min.js', array('jquery-ui-core', 'jquery-ui-widget'), '1.8.15');
+
+        // Enqueue the new Gritter-based progress bars
+        wp_enqueue_style('ngg_progressbar');
+        wp_enqueue_script('ngg_progressbar');
+
+		switch ($_GET['page']) {
+			case NGGFOLDER :
+				wp_enqueue_script( 'postbox' );
+				add_thickbox();
+			break;
+			case "nggallery-manage-gallery" :
+				wp_enqueue_script( 'postbox' );
+				wp_enqueue_script( 'ngg-ajax' );
+				wp_enqueue_script( 'ngg-progressbar' );
+				wp_enqueue_script( 'jquery-ui-dialog' );
+				wp_enqueue_script( 'jquery-ui-sortable' );
+    			wp_register_script('shutter', $router->get_static_url('photocrati-lightbox#shutter/shutter.js'), false ,'1.3.2');
+    			wp_localize_script('shutter', 'shutterSettings', array(
+    						'msgLoading' => __('L O A D I N G', 'nggallery'),
+    						'msgClose' => __('Click to Close', 'nggallery'),
+    						'imageCount' => '1'
+    			) );
+    			wp_enqueue_script( 'shutter' );
+			break;
+			case "nggallery-manage-album" :
+                wp_enqueue_script( 'jquery-ui-autocomplete' );
+                wp_enqueue_script( 'jquery-ui-dialog' );
+                wp_enqueue_script( 'jquery-ui-sortable' );
+                wp_enqueue_script( 'ngg-autocomplete', NGGALLERY_URLPATH .'admin/js/ngg.autocomplete.js', array('jquery-ui-autocomplete'), '1.0.1');
+			break;
+			case "nggallery-options" :
+				wp_enqueue_script( 'jquery-ui-tabs' );
+				//wp_enqueue_script( 'ngg-colorpicker', NGGALLERY_URLPATH .'admin/js/colorpicker/js/colorpicker.js', array('jquery'), '1.0');
+			break;
+			case "nggallery-add-gallery" :
+				wp_enqueue_script( 'jquery-ui-accordion' );
+				wp_enqueue_script( 'multifile', NGGALLERY_URLPATH .'admin/js/jquery.MultiFile.js', array('jquery'), '1.4.4' );
+                wp_enqueue_script( 'ngg-plupload-handler' );
+				wp_enqueue_script( 'ngg-ajax' );
+				wp_enqueue_script( 'ngg-progressbar' );
+                wp_enqueue_script( 'jquery-ui-dialog' );
+				wp_enqueue_script( 'jqueryFileTree', NGGALLERY_URLPATH .'admin/js/jqueryFileTree/jqueryFileTree.js', array('jquery'), '1.0.1' );
+			break;
+			case "nggallery-style" :
+				wp_enqueue_script( 'codepress' );
+				wp_enqueue_script( 'ngg-colorpicker', NGGALLERY_URLPATH .'admin/js/colorpicker/js/colorpicker.js', array('jquery'), '1.0');
+			break;
+
+		}
+	}
+
+
+	function enqueue_jquery_ui_theme()
+	{
+		$settings = C_NextGen_Settings::get_instance();
+		wp_enqueue_style(
+			$settings->jquery_ui_theme,
+			$settings->jquery_ui_theme_url,
+			array(),
+			$settings->jquery_ui_theme_version
+		);
+	}
+
+	function load_styles() {
+		global $ngg;
+
+        // load the icon for the navigation menu
+        wp_enqueue_style( 'nggmenu', NGGALLERY_URLPATH .'admin/css/menu.css', array() );
+		wp_register_style( 'nggadmin', NGGALLERY_URLPATH .'admin/css/nggadmin.css', false, '2.8.1', 'screen' );
+		wp_register_style( 'ngg-jqueryui', NGGALLERY_URLPATH .'admin/css/jquery.ui.css', false, '1.8.5', 'screen' );
+
+        // no need to go on if it's not a plugin page
+		if( !isset($_GET['page']) )
+			return;
+
+        // used to retrieve the uri of some module resources
+        $router = C_Component_Registry::get_instance()->get_utility('I_Router');
+
+		switch ($_GET['page']) {
+			case NGGFOLDER :
+				wp_enqueue_style( 'thickbox' );
+			case "nggallery-about" :
+				wp_enqueue_style( 'nggadmin' );
+                //TODO:Remove after WP 3.3 release
+                if ( !defined('IS_WP_3_3') )
+                    wp_admin_css( 'css/dashboard' );
+			break;
+			case "nggallery-add-gallery":
+				$this->enqueue_jquery_ui_theme();
+				wp_enqueue_style( 'jqueryFileTree', NGGALLERY_URLPATH .'admin/js/jqueryFileTree/jqueryFileTree.css', false, '1.0.1', 'screen' );
+			case "nggallery-options" :
+				wp_enqueue_style( 'nggtabs', NGGALLERY_URLPATH .'admin/css/jquery.ui.tabs.css', false, '2.5.0', 'screen' );
+				wp_enqueue_style( 'nggadmin' );
+            break;
+			case "nggallery-manage-gallery" :
+                wp_enqueue_script('jquery-ui-tooltip');
+                wp_enqueue_style('shutter', $router->get_static_url('photocrati-lightbox#shutter/shutter.css'), false, '1.3.2', 'screen');
+			case "nggallery-roles" :
+			case "nggallery-manage-album" :
+				$this->enqueue_jquery_ui_theme();
+				wp_enqueue_style( 'nggadmin' );
+			break;
+			case "nggallery-tags" :
+				wp_enqueue_style( 'nggtags', NGGALLERY_URLPATH .'admin/css/tags-admin.css', false, '2.6.1', 'screen' );
+				break;
+			case "nggallery-style" :
+				wp_admin_css( 'css/theme-editor' );
+				wp_enqueue_style('nggcolorpicker', NGGALLERY_URLPATH.'admin/js/colorpicker/css/colorpicker.css', false, '1.0', 'screen');
+				wp_enqueue_style('nggadmincp', NGGALLERY_URLPATH.'admin/css/nggColorPicker.css', false, '1.0', 'screen');
+			break;
+		}
+	}
+
+	function show_help($help, $screen) {
+
+		// since WP3.0 it's an object
+		if ( is_object($screen) )
+			$screen = $screen->id;
+
+		$link = '';
+		// menu title is localized...
+		$i18n = strtolower  ( _n( 'Gallery', 'Galleries', 1, 'nggallery' ) );
+
+		switch ($screen) {
+			case 'toplevel_page_' . NGGFOLDER :
+				$link  = __('<a href="http://www.nextgen-gallery.com" target="_blank">Introduction</a>', 'nggallery');
+			break;
+			case "{$i18n}_page_nggallery-about" :
+				$link  = __('<a href="http://www.nextgen-gallery.com/languages" target="_blank">Languages</a>', 'nggallery');
+			break;
+		}
+
+		if ( !empty($link) ) {
+			$help  = '<h5>' . __('Get help with NextGEN Gallery', 'nggallery') . '</h5>';
+			$help .= '<div class="metabox-prefs">';
+			$help .= $link;
+			$help .= "</div>\n";
+			$help .= '<h5>' . __('More Help & Info', 'nggallery') . '</h5>';
+			$help .= '<div class="metabox-prefs">';
+			$help .= __('<a href="http://wordpress.org/tags/nextgen-gallery?forum_id=10" target="_blank">Support Forums</a>', 'nggallery');
+			$help .= ' | <a href="http://www.nextgen-gallery.com/faq/" target="_blank">' . __('FAQ', 'nggallery') . '</a>';
+			$help .= ' | <a href="https://bitbucket.org/photocrati/nextgen-gallery/issues" target="_blank">' . __('Feature request', 'nggallery') . '</a>';
+			$help .= ' | <a href="http://www.nextgen-gallery.com/languages" target="_blank">' . __('Get your language pack', 'nggallery') . '</a>';
+			$help .= ' | <a href="https://bitbucket.org/photocrati/nextgen-gallery" target="_blank">' . __('Contribute development', 'nggallery') . '</a>';
+			$help .= ' | <a href="http://wordpress.org/extend/plugins/nextgen-gallery" target="_blank">' . __('Download latest version', 'nggallery') . '</a>';
+			$help .= "</div>\n";
+		}
+
+		return $help;
+	}
+
+    /**
+     * New wrapper for WordPress 3.3, so contextual help will be added to the admin bar
+     * Rework this see http://wpdevel.wordpress.com/2011/12/06/help-and-screen-api-changes-in-3-3/
+     *
+     * @since 1.9.0
+     * @param object $screen
+     * @return void
+     */
+    function add_contextual_help($screen) {
+
+        $help = $this->show_help('', $screen);
+        //add_contextual_help( $screen, $help );
+    }
+
+	/**
+	 * We need to manipulate the current_screen name so that we can show the correct column screen options
+	 *
+     * @since 1.8.0
+	 * @param object $screen
+	 * @return object $screen
+	 */
+	function edit_current_screen($screen) {
+
+    	if ( is_string($screen) )
+    		$screen = convert_to_screen($screen);
+
+		// menu title is localized, so we need to change the toplevel name
+		$i18n = strtolower  ( _n( 'Gallery', 'Galleries', 1, 'nggallery' ) );
+
+		switch ($screen->id) {
+			case "{$i18n}_page_nggallery-manage-gallery" :
+				// we would like to have screen option only at the manage images / gallery page
+				if ( isset ($_POST['sortGallery']) )
+					$screen = $screen;
+				else if ( (isset($_GET['mode']) && $_GET['mode'] == 'edit') || isset ($_POST['backToGallery']) )
+					$screen->base = $screen->id = 'nggallery-manage-images';
+				else if ( (isset($_GET['mode']) && $_GET['mode'] == 'sort') )
+					$screen = $screen;
+				else
+					$screen->base = $screen->id = 'nggallery-manage-gallery';
+			break;
+		}
+
+        if ( defined('IS_WP_3_3') )
+            $this->add_contextual_help($screen);
+
+		return $screen;
+	}
+
+	/**
+	 * We need to register the columns at a very early point
+	 *
+	 * @return void
+	 */
+	function register_columns() {
+		include_once ( dirname (__FILE__) . '/manage-images.php' );
+
+		$wp_list_table = new _NGG_Images_List_Table('nggallery-manage-images');
+
+		include_once ( dirname (__FILE__) . '/manage-galleries.php' );
+
+		$wp_list_table = new _NGG_Galleries_List_Table('nggallery-manage-gallery');
+	}
+
+	/**
+	 * Read an array from a remote url
+	 *
+	 * @param string $url
+	 * @return array of the content
+	 */
+	function get_remote_array($url) {
+
+        if ( function_exists('wp_remote_request') ) {
+
+            if ( false === ( $content = get_transient( 'ngg_request_' . md5($url) ) ) ) {
+
+    			$options = array();
+    			$options['headers'] = array(
+    				'User-Agent' => 'NextGEN Gallery Information Reader V' . NGGVERSION . '; (' . get_bloginfo('url') .')'
+    			 );
+
+    			$response = wp_remote_request($url, $options);
+
+    			if ( is_wp_error( $response ) )
+    				return false;
+
+    			if ( 200 != $response['response']['code'] )
+    				return false;
+
+                $content = $response['body'];
+                set_transient( 'ngg_request_' . md5($url), $content, 60*60*48 );
+            }
+
+			$content = unserialize($content);
+
+			if (is_array($content))
+				return $content;
+		}
+
+		return false;
+	}
+
+}
+
+function wpmu_site_admin() {
+	// Check for site admin
+	if ( function_exists('is_super_admin') )
+		if ( is_super_admin() )
+			return true;
+
+	return false;
+}
+
+function wpmu_enable_function($value) {
+	if (is_multisite()) {
+		$ngg_options = get_site_option('ngg_options');
+		return $ngg_options[$value];
+	}
+	// if this is not WPMU, enable it !
+	return true;
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/ajax.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/ajax.php
new file mode 100644
index 0000000000000000000000000000000000000000..e2ac69298ed6b2496610dc205f0b2f7e703bfa11
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/ajax.php
@@ -0,0 +1,402 @@
+<?php
+add_action('wp_ajax_ngg_ajax_operation', 'ngg_ajax_operation' );
+
+/**
+ * Image edit functions via AJAX
+ *
+ * @author Alex Rabe
+ *
+ *
+ * @return void
+ */
+function ngg_ajax_operation() {
+
+	global $wpdb;
+
+	// if nonce is not correct it returns -1
+	check_ajax_referer( "ngg-ajax" );
+
+	// check for correct capability
+	if ( !is_user_logged_in() )
+		die('-1');
+
+	// check for correct NextGEN capability
+	if ( !current_user_can('NextGEN Upload images') && !current_user_can('NextGEN Manage gallery') )
+		die('-1');
+
+	// include the ngg function
+	include_once (dirname (__FILE__) . '/functions.php');
+
+	// Get the image id
+	if ( isset($_POST['image'])) {
+		$id = (int) $_POST['image'];
+		// let's get the image data
+		$picture = nggdb::find_image( $id );
+		// what do you want to do ?
+		switch ( $_POST['operation'] ) {
+			case 'create_thumbnail' :
+				$result = nggAdmin::create_thumbnail($picture);
+			break;
+			case 'resize_image' :
+				$result = nggAdmin::resize_image($picture);
+			break;
+			case 'rotate_cw' :
+				$result = nggAdmin::rotate_image($picture, 'CW');
+				nggAdmin::create_thumbnail($picture);
+			break;
+			case 'rotate_ccw' :
+				$result = nggAdmin::rotate_image($picture, 'CCW');
+				nggAdmin::create_thumbnail($picture);
+			break;
+			case 'set_watermark' :
+				$result = nggAdmin::set_watermark($picture);
+			break;
+			case 'recover_image' :
+				$result = nggAdmin::recover_image($picture);
+			break;
+			case 'import_metadata' :
+				$result = nggAdmin::import_MetaData( $id );
+			break;
+			case 'get_image_ids' :
+				$result = nggAdmin::get_image_ids( $id );
+			break;
+			default :
+				do_action( 'ngg_ajax_' . $_POST['operation'] );
+				die('-1');
+			break;
+		}
+		// A success should return a '1'
+		die ($result);
+	}
+
+	// The script should never stop here
+	die('0');
+}
+
+add_action('wp_ajax_createNewThumb', 'createNewThumb');
+
+function createNewThumb() {
+
+    global $ngg;
+
+	// check for correct capability
+	if ( !is_user_logged_in() )
+		die('-1');
+
+	// check for correct NextGEN capability
+	if ( !current_user_can('NextGEN Manage gallery') )
+		die('-1');
+
+	$id 	 = (int) $_POST['id'];
+	$picture = nggdb::find_image( $id );
+
+	$x = round( $_POST['x'] * $_POST['rr'], 0);
+	$y = round( $_POST['y'] * $_POST['rr'], 0);
+	$w = round( $_POST['w'] * $_POST['rr'], 0);
+	$h = round( $_POST['h'] * $_POST['rr'], 0);
+	$crop_frame = array('x' => $x, 'y' => $y, 'width' => $w, 'height' => $h);
+
+	$registry = C_Component_Registry::get_instance();
+	$storage  = $registry->get_utility('I_Gallery_Storage');
+
+	// XXX NextGEN Legacy wasn't handling watermarks or reflections at this stage, so we're forcefully disabling them to maintain compatibility
+	$params = array('watermark' => false, 'reflection' => false, 'crop' => true, 'crop_frame' => $crop_frame);
+	$result = $storage->generate_thumbnail($id, $params);
+
+	if ($result) {
+		echo "OK";
+	} else {
+		header('HTTP/1.1 500 Internal Server Error');
+		echo "KO";
+	}
+
+	C_NextGEN_Bootstrap::shutdown();
+}
+
+add_action('wp_ajax_rotateImage', 'ngg_rotateImage');
+
+function ngg_rotateImage() {
+
+	// check for correct capability
+	if ( !is_user_logged_in() )
+		die('-1');
+
+	// check for correct NextGEN capability
+	if ( !current_user_can('NextGEN Manage gallery') )
+		die('-1');
+
+	require_once( dirname( dirname(__FILE__) ) . '/ngg-config.php');
+
+	// include the ngg function
+	include_once (dirname (__FILE__). '/functions.php');
+
+	$ngg_options = get_option('ngg_options');
+
+	$id = (int) $_POST['id'];
+	$result = '-1';
+
+	switch ( $_POST['ra'] ) {
+		case 'cw' :
+			$result = nggAdmin::rotate_image($id, 'CW');
+		break;
+		case 'ccw' :
+			$result = nggAdmin::rotate_image($id, 'CCW');
+		break;
+		case 'fv' :
+			// Note: H/V have been inverted here to make it more intuitive
+			$result = nggAdmin::rotate_image($id, 0, 'H');
+		break;
+		case 'fh' :
+			// Note: H/V have been inverted here to make it more intuitive
+			$result = nggAdmin::rotate_image($id, 0, 'V');
+		break;
+	}
+
+    // recreate the thumbnail
+    nggAdmin::create_thumbnail($id);
+
+	if ( $result == 1 )
+		die('1');
+
+	header('HTTP/1.1 500 Internal Server Error');
+	die( $result );
+
+}
+
+add_action('wp_ajax_ngg_dashboard', 'ngg_ajax_dashboard');
+
+function ngg_ajax_dashboard() {
+
+   	require_once( dirname( dirname(__FILE__) ) . '/admin/admin.php');
+	require_once( dirname( dirname(__FILE__) ) . '/admin/overview.php');
+
+   	if ( !current_user_can('NextGEN Gallery overview') )
+		die('-1');
+
+    @header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
+    @header( 'X-Content-Type-Options: nosniff' );
+
+    switch ( $_GET['jax'] ) {
+
+    case 'ngg_lastdonators' :
+    	ngg_overview_donators();
+    	break;
+
+    case 'dashboard_primary' :
+    	ngg_overview_news();
+    	break;
+
+    case 'ngg_locale' :
+    	ngg_locale();
+    	break;
+
+    case 'dashboard_plugins' :
+    	ngg_related_plugins();
+    	break;
+
+    }
+    die();
+}
+
+add_action('wp_ajax_ngg_file_browser', 'ngg_ajax_file_browser');
+
+/**
+ * jQuery File Tree PHP Connector
+ * @author Cory S.N. LaViska - A Beautiful Site (http://abeautifulsite.net/)
+ * @version 1.0.1
+ *
+ * @return string folder content
+ */
+function ngg_ajax_file_browser() {
+
+    global $ngg;
+
+	// check for correct NextGEN capability
+	if ( !current_user_can('NextGEN Upload images') && !current_user_can('NextGEN Manage gallery') )
+		die('No access');
+
+    if ( !defined('ABSPATH') )
+        die('No access');
+
+	// if nonce is not correct it returns -1
+	check_ajax_referer( 'ngg-ajax', 'nonce' );
+
+    //PHP4 compat script
+	if (!function_exists('scandir')) {
+		function scandir($dir, $listDirectories = false, $skipDots = true ) {
+			$dirArray = array();
+			if ($handle = opendir($dir) ) {
+				while (false !== ($file = readdir($handle))) {
+					if (($file != '.' && $file != '..' ) || $skipDots == true) {
+						if($listDirectories == false) { if(is_dir($file)) { continue; } }
+						array_push($dirArray, basename($file) );
+					}
+				}
+				closedir($handle);
+			}
+			return $dirArray;
+		}
+	}
+
+    // start from the default path
+    $root = trailingslashit ( WINABSPATH );
+    // get the current directory
+	$dir = trailingslashit ( urldecode($_POST['dir']) );
+
+	if( file_exists($root . $dir) ) {
+		$files = scandir($root . $dir);
+		natcasesort($files);
+
+        // The 2 counts for . and ..
+		if( count($files) > 2 ) {
+			echo "<ul class=\"jqueryDirTree\" style=\"display: none;\">";
+
+            // return only directories
+			foreach( $files as $file ) {
+
+			    //reserved name for the thumnbnails, don't use it as folder name
+                if ( $file == 'thumbs')
+                    continue;
+
+				if ( file_exists($root . $dir . $file) && $file != '.' && $file != '..' && is_dir($root . $dir . $file) ) {
+					echo "<li class=\"directory collapsed\"><a href=\"#\" rel=\"" . esc_html($dir . $file) . "/\">" . esc_html($file) . "</a></li>";
+				}
+			}
+
+			echo "</ul>";
+		}
+	}
+    die();
+}
+
+add_action( 'wp_ajax_ngg_rebuild_unique_slugs', 'ngg_ajax_rebuild_unique_slugs' );
+/**
+ * This rebuild the slugs for albums, galleries and images as ajax routine, max 50 elements per request
+ *
+ * @since 1.7.0
+ * @return string '1'
+ */
+function ngg_ajax_rebuild_unique_slugs() {
+    global $wpdb;
+
+    // check for correct NextGEN capability
+	if ( !current_user_can('NextGEN Change options') )
+		die('No access');
+
+	$action = $_POST['_action'];
+    $offset = (int) $_POST['offset'];
+
+    switch ($action) {
+        case 'images':
+        	$images = $wpdb->get_results("SELECT * FROM $wpdb->nggpictures ORDER BY pid ASC LIMIT $offset, 50", OBJECT_K);
+        	if ( is_array($images) ) {
+                foreach ($images as $image) {
+            		//slug must be unique, we use the alttext for that
+                    $image->slug = nggdb::get_unique_slug( sanitize_title( $image->alttext ), 'image', $image->pid );
+                    $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->nggpictures SET image_slug= '%s' WHERE pid = '%d'" , $image->slug, $image->pid ) );
+                }
+            }
+        break;
+        case 'gallery':
+        	$galleries = $wpdb->get_results("SELECT * FROM $wpdb->nggallery ORDER BY gid ASC LIMIT $offset, 50", OBJECT_K);
+        	if ( is_array($galleries) ) {
+                foreach ($galleries as $gallery) {
+            		//slug must be unique, we use the title for that
+                    $gallery->slug = nggdb::get_unique_slug( sanitize_title( $gallery->title ), 'gallery', $gallery->gid );
+                    $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->nggallery SET slug= '%s' WHERE gid = '%d'" , $gallery->slug, $gallery->gid ) );
+                }
+            }
+        break;
+        case 'album':
+        	$albumlist = $wpdb->get_results("SELECT * FROM $wpdb->nggalbum ORDER BY id ASC LIMIT $offset, 50", OBJECT_K);
+        	if ( is_array($albumlist) ) {
+                foreach ($albumlist as $album) {
+            		//slug must be unique, we use the name for that
+                    $album->slug = nggdb::get_unique_slug( sanitize_title( $album->name ), 'album', $album->id );
+                    $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->nggalbum SET slug= '%s' WHERE id = '%d'" , $album->slug, $album->id ) );
+                }
+            }
+        break;
+    }
+
+	die(1);
+}
+add_action('wp_ajax_ngg_image_check', 'ngg_ajax_image_check');
+/**
+ * Test for various image resolution
+ *
+ * @since 1.7.3
+ * @return result
+ */
+function ngg_ajax_image_check() {
+
+    // check for correct NextGEN capability
+	if ( !current_user_can('NextGEN Upload images') )
+		die('No access');
+
+    if ( !defined('ABSPATH') )
+        die('No access');
+
+    $step = (int) $_POST['step'];
+
+	// build the test sizes
+	$sizes = array();
+	$sizes[1] = array ( 'width' => 800,  'height' => 600);
+	$sizes[2] = array ( 'width' => 1024, 'height' => 768);
+	$sizes[3] = array ( 'width' => 1280, 'height' => 960);  // 1MP
+	$sizes[4] = array ( 'width' => 1600, 'height' => 1200); // 2MP
+	$sizes[5] = array ( 'width' => 2016, 'height' => 1512); // 3MP
+	$sizes[6] = array ( 'width' => 2272, 'height' => 1704); // 4MP
+	$sizes[7] = array ( 'width' => 2560, 'height' => 1920); // 5MP
+    $sizes[8] = array ( 'width' => 2848, 'height' => 2136); // 6MP
+    $sizes[9] = array ( 'width' => 3072, 'height' => 2304); // 7MP
+    $sizes[10] = array ( 'width' => 3264, 'height' => 2448); // 8MP
+    $sizes[11] = array ( 'width' => 4048, 'height' => 3040); // 12MP
+
+    if ( $step < 1 || $step > 11 )
+        die('No vaild value');
+
+    // let's test each image size
+    $temp = imagecreatetruecolor ($sizes[$step]['width'], $sizes[$step]['height'] );
+    imagedestroy ($temp);
+
+    $result = array ('stat' => 'ok', 'message' => sprintf(__('Could create image with %s x %s pixel', 'nggallery'), $sizes[$step]['width'], $sizes[$step]['height'] ) );
+
+	header('Content-Type: application/json; charset=' . get_option('blog_charset'), true);
+	echo json_encode($result);
+
+    die();
+}
+
+add_action('wp_ajax_ngg_test_head_footer', 'ngg_ajax_test_head_footer');
+/**
+ * Check for the header / footer, parts taken from Matt Martz (http://sivel.net/)
+ *
+ * @see https://gist.github.com/378450
+ * @since 1.7.3
+ * @return result
+ */
+function ngg_ajax_test_head_footer() {
+
+	// Build the url to call, NOTE: uses home_url and thus requires WordPress 3.0
+	$url = add_query_arg( array( 'test-head' => '', 'test-footer' => '' ), home_url() );
+	// Perform the HTTP GET ignoring SSL errors
+	$response = wp_remote_get( $url, array( 'sslverify' => false ) );
+	// Grab the response code and make sure the request was sucessful
+	$code = (int) wp_remote_retrieve_response_code( $response );
+	if ( $code == 200 ) {
+		global $head_footer_errors;
+		$head_footer_errors = array();
+
+		// Strip all tabs, line feeds, carriage returns and spaces
+		$html = preg_replace( '/[\t\r\n\s]/', '', wp_remote_retrieve_body( $response ) );
+
+		// Check to see if we found the existence of wp_head
+		if ( ! strstr( $html, '<!--wp_head-->' ) )
+			die('Missing the call to wp_head() in your theme, contact the theme author');
+		// Check to see if we found the existence of wp_footer
+		if ( ! strstr( $html, '<!--wp_footer-->' ) )
+			die('Missing the call to wp_footer() in your theme, contact the theme author');
+	}
+    die('success');
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/album.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/album.php
new file mode 100644
index 0000000000000000000000000000000000000000..db02e0eebab66bb2ca61c778d5cbbb81248922f1
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/album.php
@@ -0,0 +1,707 @@
+<?php
+
+if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
+
+class nggManageAlbum {
+
+	/**
+	 * The selected album ID
+	 *
+	 * @since 1.3.0
+	 * @access privat
+	 * @var int
+	 */
+	var $currentID = 0;
+
+	/**
+	 * The array for the galleries
+	 *
+	 * @since 1.3.0
+	 * @access privat
+	 * @var array
+	 */
+	var $galleries = false;
+
+	/**
+	 * The array for the albums
+	 *
+	 * @since 1.3.0
+	 * @access privat
+	 * @var array
+	 */
+	var $albums = false;
+
+	/**
+	 * The amount of all galleries
+	 *
+	 * @since 1.4.0
+	 * @access privat
+	 * @var int
+	 */
+	var $num_galleries = false;
+
+	/**
+	 * The amount of all albums
+	 *
+	 * @since 1.4.0
+	 * @access privat
+	 * @var int
+	 */
+	var $num_albums = false;
+
+	/**
+	 * PHP4 compatibility layer for calling the PHP5 constructor.
+	 *
+	 */
+	function nggManageAlbum() {
+		return $this->__construct();
+	}
+
+	/**
+	 * Gets the Pope component registry
+	 * @return C_Component_Registry
+	 */
+	function get_registry()
+	{
+		if (!isset($this->_registry)) {
+			$this->_registry = C_Component_Registry::get_instance();
+		}
+
+		return $this->_registry;
+	}
+
+	/**
+	 * Gets the album mapper
+	 * @return C_Album_Mapper
+	 */
+	function get_album_mapper()
+	{
+		if (!isset($this->_album_mapper)) {
+			$this->_album_mapper = $this->get_registry()->get_utility('I_Album_Mapper');
+		}
+
+		return $this->_album_mapper;
+	}
+
+	/**
+	 * Init the album output
+	 *
+	 */
+	function __construct() {
+		return true;
+	}
+
+	function controller() {
+		global $nggdb;
+
+		$this->currentID = isset($_REQUEST['act_album']) ? (int) $_REQUEST['act_album'] : 0 ;
+
+		if (isset ($_POST['update']) || isset( $_POST['delete'] ) || isset( $_POST['add'] ) )
+			$this->processor();
+
+		if (isset ($_POST['update_album']) )
+			$this->update_album();
+
+		// get first all galleries & albums
+		$this->albums = $nggdb->find_all_album();
+		$this->galleries  = $nggdb->find_all_galleries();
+		$this->num_albums  = count( $this->albums );
+		$this->num_galleries  = count( $this->galleries );
+		$this->output();
+
+	}
+
+	/**
+	 * Finds a suitable preview pic for the album if one hasn't been set
+	 * already
+	 * @param stdClass|C_Album $album
+	 * @return stdClass|C_Album
+	 */
+	function _set_album_preview_pic($album)
+	{
+		$set_previewpic = FALSE;
+		$sortorder		= $album->sortorder;
+
+		while(!$album->previewpic) {
+			// If the album is missing a preview pic, set one!
+			if (($first_entity = array_shift($sortorder))) {
+
+				// Is the first entity a gallery or album
+				if (substr($first_entity, 0, 1) == 'a') {
+					$subalbum = $this->get_album_mapper()->find(substr($first_entity, 1));
+					if ($subalbum->previewpic) {
+						$album->previewpic = $subalbum->previewpic;
+						$set_previewpic = TRUE;
+					}
+				}
+				else {
+					$gallery_mapper = $this->get_registry()->get_utility('I_Gallery_Mapper');
+					$gallery = $gallery_mapper->find($first_entity);
+					if ($gallery->previewpic) {
+						$album->previewpic = $gallery->previewpic;
+						$set_previewpic = TRUE;
+					}
+				}
+			}
+			else break;
+		}
+
+		return $album;
+	}
+
+	function processor() {
+		global $wpdb;
+
+		check_admin_referer('ngg_album');
+
+		// Create album
+		if ( isset($_POST['add']) && isset ($_POST['newalbum']) ) {
+
+			if (!nggGallery::current_user_can( 'NextGEN Add/Delete album' ))
+				wp_die(__('Cheatin&#8217; uh?'));
+
+			$album = new stdClass();
+			$album->name = $_POST['newalbum'];
+			$result = $this->get_album_mapper()->save($album);
+            $this->currentID = $album->{$album->id_field};
+			if (!$this->currentID) $this->currentID = 0;
+
+            //hook for other plugins
+            do_action('ngg_add_album', $this->currentID);
+
+			if ($result)
+				nggGallery::show_message(__('Update Successfully','nggallery'));
+		}
+
+		if ( isset($_POST['update']) && ($this->currentID > 0) ) {
+
+            $gid = array();
+
+			// Get the current album being updated
+			$album = $this->get_album_mapper()->find($this->currentID);
+
+			// Get the list of galleries/sub-albums to be added to this album
+			parse_str($_REQUEST['sortorder']);
+
+			// Set the new sortorder
+			$album->sortorder = $gid;
+
+			// Ensure that a preview pic has been sent
+			$this->_set_album_preview_pic($album);
+
+			// Save the changes
+			$this->get_album_mapper()->save($album);
+
+            //hook for other plugins
+            do_action('ngg_update_album_sortorder', $this->currentID);
+
+			nggGallery::show_message(__('Update Successfully','nggallery'));
+
+		}
+
+		if ( isset($_POST['delete']) ) {
+
+			if (!nggGallery::current_user_can( 'NextGEN Add/Delete album' ))
+				wp_die(__('Cheatin&#8217; uh?'));
+
+			$result = nggdb::delete_album( $this->currentID );
+
+            //hook for other plugins
+            do_action('ngg_delete_album', $this->currentID);
+
+            // jump back to main selection
+            $this->currentID = 0;
+
+			if ($result)
+				nggGallery::show_message(__('Album deleted','nggallery'));
+		}
+
+	}
+
+	function update_album() {
+		global $wpdb, $nggdb;
+
+		check_admin_referer('ngg_thickbox_form');
+
+		if (!nggGallery::current_user_can( 'NextGEN Edit album settings' ))
+			wp_die(__('Cheatin&#8217; uh?'));
+
+		$album = $this->get_album_mapper()->find($this->currentID, TRUE);
+		$album->name		= stripslashes($_POST['album_name']);
+		$album->albumdesc	= stripslashes($_POST['album_desc']);
+		$album->previewpic	= (int)$_POST['previewpic'];
+		$album->pageid		= (int)$_POST['pageid'];
+		$result = $album->save();
+
+		//hook for other plugin to update the fields
+		do_action('ngg_update_album', $this->currentID, $_POST);
+
+		if ($result)
+			nggGallery::show_message(__('Update Successfully','nggallery'));
+	}
+
+	function output() {
+
+	global $wpdb, $nggdb;
+
+	$this->currentID = isset($_REQUEST['act_album']) ? (int) $_REQUEST['act_album'] : 0 ;
+
+	//TODO:Code MUST be optimized, how to flag a used gallery better ?
+	$used_list = $this->get_used_galleries();
+
+?>
+
+<script type="text/javascript">
+
+jQuery(document).ready(
+	function($)
+	{
+		if ($(this).data('ready')) return;
+
+		if (window.Frame_Event_Publisher) {
+
+			// Refresh when a new gallery has been added
+			Frame_Event_Publisher.listen_for('attach_to_post:manage_galleries attach_to_post:new_gallery', function(){
+				window.location.href = window.location.href;
+			});
+
+			// Updates the thumbnail image when a previewpic has been modified
+			Frame_Event_Publisher.listen_for('attach_to_post:thumbnail_modified', function(data){
+				var image_id = data.image[data.image.id_field];
+				var $image = $('img[rel="'+image_id+'"]');
+				if ($image.length > 0) {
+					$image.attr('src', data.image.thumb_url);
+				}
+			});
+		}
+
+        jQuery("#previewpic").nggAutocomplete( {
+            type: 'image',domain: "<?php echo home_url('index.php', is_ssl() ? 'https' : 'http'); ?>",width: "95%"
+        });
+
+		jQuery('#selectContainer').sortable( {
+			items: '.groupItem',
+			placeholder: 'sort_placeholder',
+			opacity: 0.7,
+			tolerance: 'intersect',
+			distance: 2,
+			forcePlaceholderSize: true ,
+			connectWith: ['#galleryContainer']
+		} );
+
+		jQuery('#galleryContainer').sortable( {
+			items: '.groupItem',
+			placeholder: 'sort_placeholder',
+			opacity: 0.7,
+			tolerance: 'intersect',
+			distance: 2,
+			forcePlaceholderSize: true ,
+			connectWith: ['#selectContainer', '#albumContainer']
+		} );
+
+		jQuery('#albumContainer').sortable( {
+			items: '.groupItem',
+			placeholder: 'sort_placeholder',
+			opacity: 0.7,
+			tolerance: 'intersect',
+			distance: 2,
+			forcePlaceholderSize: true ,
+			connectWith: ['#galleryContainer']
+		} );
+
+		jQuery('a.min').on('click', toggleContent);
+
+		// Hide used galleries
+		jQuery('a#toggle_used').click(function()
+			{
+				jQuery('#selectContainer div.inUse').toggle();
+				return false;
+			}
+		);
+
+		// Maximize All Portlets (whole site, no differentiation)
+		jQuery('a#all_max').click(function()
+			{
+				jQuery('div.itemContent:hidden').show();
+				return false;
+			}
+		);
+
+		// Minimize All Portlets (whole site, no differentiation)
+		jQuery('a#all_min').click(function()
+			{
+				jQuery('div.itemContent:visible').hide();
+				return false;
+			}
+		);
+	   // Auto Minimize if more than 4 (whole site, no differentiation)
+	   if(jQuery('a.min').length > 4)
+	   {
+	   		jQuery('a.min').html('[+]');
+	   		jQuery('div.itemContent:visible').hide();
+	   		jQuery('#selectContainer div.inUse').toggle();
+	   };
+
+	   $(this).data('ready', true);
+	}
+);
+
+var toggleContent = function(e)
+{
+	var targetContent = jQuery('div.itemContent', this.parentNode.parentNode);
+	if (targetContent.css('display') == 'none') {
+		targetContent.slideDown(300);
+		jQuery(this).html('[-]');
+	} else {
+		targetContent.slideUp(300);
+		jQuery(this).html('[+]');
+	}
+	return false;
+};
+
+function ngg_serialize(s)
+{
+	//serial = jQuery.SortSerialize(s);
+	serial = jQuery('#galleryContainer').sortable('serialize');
+	jQuery('input[name=sortorder]').val(serial);
+	return serial;
+}
+
+function showDialog() {
+	jQuery( "#editalbum").dialog({
+		width: 640,
+        resizable : false,
+		modal: true,
+        title: '<?php echo esc_js( __('Edit Album', 'nggallery') ); ?>',
+		position: {
+			my:		'center',
+			at:		'center',
+			of:		window.parent
+		}
+	});
+    jQuery('#editalbum .dialog-cancel').click(function() { jQuery( "#editalbum" ).dialog("close"); });
+}
+
+</script>
+
+<div class="wrap album" id="wrap" >
+	<?php //include('templates/social_media_buttons.php'); ?>
+    <?php screen_icon( 'nextgen-gallery' ); ?>
+	<h2><?php esc_html_e('Manage Albums', 'nggallery') ?></h2>
+	<form id="selectalbum" method="POST" onsubmit="ngg_serialize()" accept-charset="utf-8">
+		<?php wp_nonce_field('ngg_album') ?>
+		<input name="sortorder" type="hidden" />
+		<div class="albumnav tablenav">
+			<div class="alignleft actions">
+				<?php esc_html_e('Select album', 'nggallery') ?>
+				<select id="act_album" name="act_album" onchange="this.form.submit();">
+					<option value="0" ><?php esc_html_e('No album selected', 'nggallery') ?></option>
+					<?php
+						if( is_array($this->albums) ) {
+							foreach($this->albums as $album) {
+								$selected = ($this->currentID == $album->id) ? 'selected="selected" ' : '';
+								echo '<option value="' . $album->id . '" ' . $selected . '>' . $album->id . ' - ' . esc_attr( $album->name ) . '</option>'."\n";
+							}
+						}
+					?>
+				</select>
+				<?php if ($this->currentID > 0){ ?>
+					<input class="button-primary" type="submit" name="update" value="<?php esc_attr_e('Update', 'nggallery'); ?>"/>
+					<?php if(nggGallery::current_user_can( 'NextGEN Edit album settings' )) { ?>
+					<input class="button-secondary" type="submit" name="showThickbox" value="<?php esc_attr_e( 'Edit album', 'nggallery'); ?>" onclick="showDialog(); return false;" />
+					<?php } ?>
+					<?php if(nggGallery::current_user_can( 'NextGEN Add/Delete album' )) { ?>
+					<input class="button-secondary action "type="submit" name="delete" value="<?php esc_attr_e('Delete', 'nggallery'); ?>" onclick="javascript:check=confirm('<?php echo esc_js('Delete album ?','nggallery'); ?>');if(check==false) return false;"/>
+					<?php } ?>
+				<?php } else { ?>
+					<?php if(nggGallery::current_user_can( 'NextGEN Add/Delete album' )) { ?>
+					<span><?php esc_html_e('Add new album', 'nggallery'); ?>&nbsp;</span>
+					<input class="search-input" id="newalbum" name="newalbum" type="text" value="" />
+					<input class="button-secondary action" type="submit" name="add" value="<?php esc_attr_e('Add', 'nggallery'); ?>"/>
+					<?php } ?>
+				<?php } ?>
+			</div>
+		</div>
+	</form>
+
+	<br class="clear"/>
+
+	<div>
+		<div style="float:right;">
+		  <a href="#" title="<?php esc_attr_e('Show / hide used galleries','nggallery'); ?>" id="toggle_used"><?php esc_html_e('[Show all]', 'nggallery'); ?></a>
+		| <a href="#" title="<?php esc_attr_e('Maximize the widget content','nggallery'); ?>" id="all_max"><?php esc_html_e('[Maximize]', 'nggallery'); ?></a>
+		| <a href="#" title="<?php esc_attr_e('Minimize the widget content','nggallery'); ?>" id="all_min"><?php esc_html_e('[Minimize]', 'nggallery'); ?></a>
+		</div>
+		<?php esc_html_e('After you create and select a album, you can drag and drop a gallery or another album into your new album below','nggallery'); ?>
+	</div>
+
+	<br class="clear" />
+
+	<div class="container">
+
+		<!-- /#album container -->
+		<div class="widget widget-right">
+			<div class="widget-top">
+				<h3><?php esc_html_e('Select album', 'nggallery'); ?></h3>
+			</div>
+			<div id="albumContainer" class="widget-holder">
+			<?php
+			if( is_array( $this->albums ) ) {
+				foreach($this->albums as $album) {
+					$this->get_container('a' . $album->id);
+				}
+			}
+		?>
+			</div>
+		</div>
+
+		<!-- /#select container -->
+		<div class="widget widget-right">
+			<div class="widget-top">
+				<h3><?php esc_html_e('Select gallery', 'nggallery'); ?></h3>
+			</div>
+			<div id="selectContainer" class="widget-holder">
+		<?php
+
+		if( is_array( $this->galleries ) ) {
+			//get the array of galleries
+			$sort_array =  $this->currentID > 0 ? (array) $this->albums[$this->currentID]->galleries : array() ;
+			foreach($this->galleries as $gallery) {
+				if (!in_array($gallery->gid, $sort_array)) {
+					if (in_array($gallery->gid,$used_list))
+						$this->get_container($gallery->gid,true);
+					else
+						$this->get_container($gallery->gid,false);
+				}
+			}
+		}
+		?>
+			</div>
+		</div>
+
+		<!-- /#target-album -->
+		<div class="widget target-album widget-left">
+
+		<?php
+			if ($this->currentID > 0){
+				$album = $this->albums[$this->currentID];
+				?>
+				<div class="widget-top">
+					<h3><?php esc_html_e('Album ID', 'nggallery');  ?> <?php echo $album->id . ' : ' . esc_html( $album->name ); ?> </h3>
+				</div>
+				<div id="galleryContainer" class="widget-holder target">
+				<?php
+				$sort_array = (array) $this->albums[$this->currentID]->galleries;
+				foreach($sort_array as $galleryid) {
+					$this->get_container($galleryid, false);
+				}
+			}
+			else
+			{
+				?>
+				<div class="widget-top">
+					<h3><?php esc_html_e('No album selected!', 'nggallery'); ?></h3>
+				</div>
+				<div class="widget-holder target">
+				<?php
+			}
+		?>
+			</div>
+		</div><!-- /#target-album -->
+
+	</div><!-- /#container -->
+</div><!-- /#wrap -->
+
+<?php if ($this->currentID > 0) : ?>
+<!-- #editalbum -->
+<div id="editalbum" style="display: none;" >
+	<form id="form-edit-album" method="POST" accept-charset="utf-8">
+	<?php wp_nonce_field('ngg_thickbox_form') ?>
+	<input type="hidden" id="current_album" name="act_album" value="<?php echo $this->currentID; ?>" />
+	<table width="100%" border="0" cellspacing="3" cellpadding="3" >
+	  	<tr>
+	    	<th>
+	    		<?php esc_html_e('Album name:', 'nggallery'); ?><br />
+				<input class="search-input" id="album_name" name="album_name" type="text" value="<?php echo esc_attr( $album->name ); ?>" style="width:95%" />
+	    	</th>
+	  	</tr>
+	  	<tr>
+	    	<th>
+	    		<?php esc_html_e('Album description:', 'nggallery'); ?><br />
+	    		<textarea class="search-input" id="album_desc" name="album_desc" cols="50" rows="2" style="width:95%" ><?php echo esc_attr( $album->albumdesc ); ?></textarea>
+	    	</th>
+	  	</tr>
+	  	<tr>
+	    	<th>
+	    		<?php esc_html_e('Select a preview image:', 'nggallery'); ?><br />
+					<select id="previewpic" name="previewpic" style="width:95%" >
+                        <?php if ($album->previewpic == 0) ?>
+		                <option value="0"><?php esc_html_e('No picture', 'nggallery'); ?></option>
+						<?php
+                            if ($album->previewpic == 0)
+                                echo '<option value="0" selected="selected">' . __('No picture', 'nggallery') . '</option>';
+                            else {
+                                $picture = nggdb::find_image($album->previewpic);
+                                echo '<option value="' . $picture->pid . '" selected="selected" >'. $picture->pid . ' - ' . ( empty($picture->alltext) ? esc_attr( $picture->filename ) : esc_attr( $picture->alltext ) ) .' </option>'."\n";
+                            }
+						?>
+					</select>
+	    	</th>
+	  	</tr>
+        <tr>
+            <th>
+                <?php esc_html_e('Page Link to', 'nggallery')?><br />
+                <?php
+                if (!isset($album->pageid))
+                    $album->pageid = 0;
+
+                wp_dropdown_pages(array(
+                    'echo' => TRUE,
+                    'name' => 'pageid',
+                    'selected' => $album->pageid,
+                    'show_option_none' => esc_html('Not linked', 'nggallery'),
+                    'option_none_value' => 0
+                )); ?>
+            </th>
+        </tr>
+
+        <?php do_action('ngg_edit_album_settings', $this->currentID); ?>
+
+	  	<tr align="right">
+	    	<td class="submit">
+	    		<input type="submit" class="button-primary" name="update_album" value="<?php esc_attr_e('OK', 'nggallery'); ?>" />
+	    		&nbsp;
+	    		<input class="button-secondary dialog-cancel" type="reset" value="<?php esc_attr_e('Cancel', 'nggallery'); ?>"/>
+	    	</td>
+		</tr>
+	</table>
+	</form>
+</div>
+<!-- /#editalbum -->
+<?php endif; ?>
+
+<?php
+
+	}
+
+	/**
+	 * Create the album or gallery container
+	 *
+	 * @param integer $id (the prefix 'a' indidcates that you look for a album
+	 * @param bool $used (object will be hidden)
+	 * @return $output
+	 */
+	function get_container($id = 0, $used = false) {
+		global $wpdb, $nggdb;
+
+		$obj =  array();
+		$preview_image = '';
+        $class = '';
+
+		// if the id started with a 'a', then it's a sub album
+		if (substr( $id, 0, 1) == 'a') {
+
+			if ( !$album = $this->albums[ substr( $id, 1) ] )
+				return;
+
+			$obj['id']   = $album->id;
+			$obj['name'] = $obj['title'] = $album->name;
+            $obj['type'] = 'album';
+			$class = 'album_obj';
+
+			// get the post name
+			$post = get_post($album->pageid);
+			$obj['pagenname'] = ($post == null) ? '---' : $post->post_title;
+
+			// for speed reason we limit it to 50
+			if ( $this->num_albums < 50 ) {
+				$thumbURL = "";
+				if ($album->previewpic) {
+					$image = $nggdb->find_image( $album->previewpic );
+                    if ($image) $thumbURL = @add_query_arg('timestamp', time(), $image->thumbURL);
+				}
+				$preview_image = $thumbURL  ? '<div class="inlinepicture"><img rel="'.$album->previewpic.'" src="' . esc_url( $thumbURL ). '" /></div>' : '';
+			}
+
+			// this indicates that we have a album container
+			$prefix = 'a';
+
+		} else {
+			if ( !$gallery = $nggdb->find_gallery( $id ) )
+				return;
+
+			$obj['id']    = $gallery->gid;
+			$obj['name']  = $gallery->name;
+			$obj['title'] = $gallery->title;
+            $obj['type']  = 'gallery';
+
+			// get the post name
+			$post = get_post($gallery->pageid);
+			$obj['pagenname'] = ($post == null) ? '---' : $post->post_title;
+
+			// for spped reason we limit it to 50
+			if ( $this->num_galleries < 50 ) {
+				// set image url
+				$thumbURL = "";
+				if ($gallery->previewpic) {
+					$image = $nggdb->find_image( $gallery->previewpic );
+					$thumbURL = @add_query_arg('timestamp', time(), $image->thumbURL);
+				}
+				$preview_image = ( !is_null($thumbURL) )  ? '<div class="inlinepicture"><img rel="'.$gallery->previewpic.'" src="' . esc_url( $thumbURL ). '" /></div>' : '';
+			}
+
+			$prefix = '';
+		}
+
+		// add class if it's in use in other albums
+		$used = $used ? ' inUse' : '';
+
+		echo '<div id="gid-' . $prefix . $obj['id'] . '" class="groupItem' . $used . '">
+				<div class="innerhandle">
+					<div class="item_top ' . $class . '">
+						<a href="#" class="min" title="close">[-]</a>
+						ID: ' . $obj['id'] . ' | ' . wp_html_excerpt( esc_html ( nggGallery::i18n( $obj['title'] ) ) , 25) . '
+					</div>
+					<div class="itemContent">
+							' . $preview_image . '
+							<p><strong>' . __('Name', 'nggallery') . ' : </strong>' . esc_html ( nggGallery::i18n( $obj['name'] ) ). '</p>
+							<p><strong>' . __('Title', 'nggallery') . ' : </strong>' . esc_html ( nggGallery::i18n( $obj['title'] ) ) . '</p>
+							<p><strong>' . __('Page', 'nggallery'). ' : </strong>' . esc_html ( nggGallery::i18n( $obj['pagenname'] ) ) . '</p>
+							' . apply_filters('ngg_display_album_item_content', '', $obj) . '
+						</div>
+				</div>
+			   </div>';
+	}
+
+	/**
+	 * get all used galleries from all albums
+	 *
+	 * @return array $used_galleries_ids
+	 */
+	function get_used_galleries() {
+
+		$used = array();
+
+		if ($this->albums) {
+			foreach($this->albums as $key => $value) {
+				$sort_array = $this->albums[$key]->galleries;
+				foreach($sort_array as $galleryid) {
+					if (!in_array($galleryid, $used))
+						$used[] = $galleryid;
+				}
+			}
+		}
+
+		return $used;
+	}
+
+	/**
+	 * PHP5 style destructor
+	 *
+	 * @return bool Always true
+	 */
+	function __destruct() {
+		return true;
+	}
+
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/images/dropdown.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/images/dropdown.png
new file mode 100644
index 0000000000000000000000000000000000000000..3ae61797fc9b2378cc12aa1211c1a6e192e9f393
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/images/dropdown.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/images/ui-anim_basic_16x16.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/images/ui-anim_basic_16x16.gif
new file mode 100644
index 0000000000000000000000000000000000000000..085ccaecaf5fa5c34bc14cd2c2ed5cbbd8e25dcb
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/images/ui-anim_basic_16x16.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/images/ui-icons_222222_256x240.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/images/ui-icons_222222_256x240.png
new file mode 100644
index 0000000000000000000000000000000000000000..b273ff111d219c9b9a8b96d57683d0075fb7871a
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/images/ui-icons_222222_256x240.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/images/ui-icons_cccccc_256x240.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/images/ui-icons_cccccc_256x240.png
new file mode 100644
index 0000000000000000000000000000000000000000..9254e05cfb964be56241b5bb4d0a0eb51c02df80
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/images/ui-icons_cccccc_256x240.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/images/ui-icons_ffffff_256x240.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/images/ui-icons_ffffff_256x240.png
new file mode 100644
index 0000000000000000000000000000000000000000..42f8f992c727ddaa617da224a522e463df690387
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/images/ui-icons_ffffff_256x240.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/jquery.ui.tabs.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/jquery.ui.tabs.css
new file mode 100644
index 0000000000000000000000000000000000000000..09f1892cf8418204695b8647fe6316229c925c69
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/jquery.ui.tabs.css
@@ -0,0 +1,158 @@
+/* Caution! Ensure accessibility in print and other media types... */
+@media projection, screen { /* Use class for showing/hiding tab content, so that visibility can be better controlled in different media types... */
+    .ui-tabs-hide {
+        display: none;
+    }
+}
+
+/* Hide useless elements in print layouts... */
+@media print {
+    .ui-tabs-nav {
+        display: none;
+    }
+}
+
+/* Skin */
+#slider {
+	border-color:#EBEBEB rgb(204, 204, 204) rgb(204, 204, 204) rgb(235, 235, 235);
+	border-style:solid;
+	border-width:1px;
+	margin:15px 15% 0pt 15px;
+	padding:2px;
+}
+#tabs{
+	display: block;
+	background:#F1F1F1 none repeat scroll 0%;
+	font-size:14px;
+	overflow:hidden;
+}
+
+.ui-tabs-nav {
+    list-style: none;
+    margin: 0;
+    padding: 0 0 0 10px;
+}
+.ui-tabs-nav:after { /* clearing without presentational markup, IE gets extra treatment */
+    display: block;
+    clear: both;
+    content: " ";
+}
+.ui-tabs-nav li {
+    float: left;
+    padding: 6px 5px;
+    min-width: 84px; /* be nice to Opera */
+    margin: 2px 2px 0px 1px !important;
+	text-decoration: none;
+	list-style: none;
+}
+.ui-tabs-nav a, .ui-tabs-nav a span {
+    display: block;
+    padding: 0 1px;
+}
+
+.ui-tabs-nav a {
+    margin: 1px 0 0; /* position: relative makes opacity fail for disabled tab in IE */
+    padding-left: 0;
+    color: #2583AD;
+    line-height: 1.2;
+    text-align: center;
+    text-decoration: none;
+    white-space: nowrap; /* required in IE 6 */    
+    outline: 0; /* prevent dotted border in Firefox */
+}
+.ui-tabs-nav .ui-tabs-selected{
+	background: #6D6D6D url(../images/menu-bits.gif) repeat-x scroll left top;
+	border-color: #6D6D6D;
+	color: #FFFFFF;
+	text-shadow:0 -1px 0 #666666;
+
+	-moz-border-radius-topright: 6px;
+	-khtml-border-top-right-radius: 6px;
+	-webkit-border-top-right-radius: 6px;
+	border-top-right-radius: 6px;
+	-moz-border-radius-topleft: 6px;
+	-khtml-border-top-left-radius: 6px;
+	-webkit-border-top-left-radius: 6px;
+	border-top-left-radius: 6px;
+}
+
+.ui-tabs-selected a,
+.ui-tabs-selected a:hover {
+	color:#FFFFFF !important;
+}
+
+.ui-tabs-nav .ui-tabs-selected a,
+.ui-tabs-nav .ui-tabs-selected a:hover  {
+    position: relative;
+    top: 1px;
+    z-index: 2;
+    margin-top: 0;
+}
+
+.ui-tabs-nav li a:hover {
+	color:#D54E21;
+}
+
+.ui-tabs-nav a span {
+    width: 64px; /* IE 6 treats width as min-width */
+    min-width: 64px;
+    height: 18px; /* IE 6 treats height as min-height */
+    min-height: 18px;
+    padding-top: 6px;
+    padding-right: 0;
+}
+*>.ui-tabs-nav a span { /* hide from IE 6 */
+    width: auto;
+    height: auto;
+}
+.ui-tabs-nav .ui-tabs-selected a span {
+    padding-bottom: 1px;
+}
+.ui-tabs-nav .ui-tabs-selected a, .ui-tabs-nav a:hover, .ui-tabs-nav a:focus, .ui-tabs-nav a:active {
+    background-position: 100% -150px;
+}
+.ui-tabs-nav a, .ui-tabs-nav .ui-tabs-disabled a:hover, .ui-tabs-nav .ui-tabs-disabled a:focus, .ui-tabs-nav .ui-tabs-disabled a:active {
+    background-position: 100% -100px;
+}
+.ui-tabs-nav .ui-tabs-selected a span, .ui-tabs-nav a:hover span, .ui-tabs-nav a:focus span, .ui-tabs-nav a:active span {
+    background-position: 0 -50px;
+}
+.ui-tabs-nav a span, .ui-tabs-nav .ui-tabs-disabled a:hover span, .ui-tabs-nav .ui-tabs-disabled a:focus span, .ui-tabs-nav .ui-tabs-disabled a:active span {
+    background-position: 0 0;
+}
+.ui-tabs-nav .ui-tabs-selected a:link, .ui-tabs-nav .ui-tabs-selected a:visited, .ui-tabs-nav .ui-tabs-disabled a:link, .ui-tabs-nav .ui-tabs-disabled a:visited { /* @ Opera, use pseudo classes otherwise it confuses cursor... */
+    cursor: text;
+}
+.ui-tabs-nav a:hover, .ui-tabs-nav a:focus, .ui-tabs-nav a:active,
+.ui-tabs-nav .ui-tabs-unselect a:hover, .ui-tabs-nav .ui-tabs-unselect a:focus, .ui-tabs-nav .ui-tabs-unselect a:active { /* @ Opera, we need to be explicit again here now... */
+    cursor: pointer;
+}
+.ui-tabs-disabled {
+    opacity: .4;
+    filter: alpha(opacity=40);
+}
+.ui-tabs-panel {
+    border-top: 1px solid #97a5b0 !important;
+    padding: 1em 8px;
+    background: #fff; /* declare background color for container to avoid distorted fonts in IE while fading */
+
+	/* overwrite wp-admin */
+	border:none !important;
+	height:100% !important;
+	margin:0pt 0pt 0pt 0px !important;
+	overflow:visible !important;
+}
+
+.ui-tabs-panel a {
+	display:inline;
+}
+
+
+/* Additional IE specific bug fixes... */
+* html .ui-tabs-nav { /* auto clear, @ IE 6 & IE 7 Quirks Mode */
+    display: inline-block;
+}
+*:first-child+html .ui-tabs-nav  { /* @ IE 7 Standards Mode - do not group selectors, otherwise IE 6 will ignore complete rule (because of the unknown + combinator)... */
+    display: inline-block;
+}
+
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/menu.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/menu.css
new file mode 100644
index 0000000000000000000000000000000000000000..f59d26c3e90d4e8f0c5649d6b51040c166200506
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/menu.css
@@ -0,0 +1,3 @@
+#icon-nextgen-gallery  {
+    background:url("../images/nextgen_32_grey.png") no-repeat scroll 1px 1px transparent;
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/nggColorPicker.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/nggColorPicker.css
new file mode 100644
index 0000000000000000000000000000000000000000..f772424108442d5df64fcde0809f1c985ed4910f
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/nggColorPicker.css
@@ -0,0 +1,14 @@
+#colorSelector{
+	background:transparent url(../images/select.png) repeat scroll 0 0;
+	height:36px;
+	position:relative;
+	width:36px;
+}
+#colorSelector div{
+	background:transparent url(../images/select.png) repeat scroll center center;
+	height:30px;
+	left:3px;
+	position:absolute;
+	top:3px;
+	width:30px;
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/nggSorter.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/nggSorter.css
new file mode 100644
index 0000000000000000000000000000000000000000..73a0ed8300c40e17b51fde88bd671be9f3ae3a4c
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/nggSorter.css
@@ -0,0 +1,76 @@
+.imageBox,.imageBoxHighlighted{
+	width:130px;	/* Total width of each image box */
+	height:160px;	/* Total height of each image box */
+	float:left;
+}
+.imageBox_theImage{
+	width:110px;	/* Width of image */
+	height:125px;	/* Height of image */
+	
+	/* 
+	Don't change these values *
+	*/
+	background-position: center;
+	background-repeat: no-repeat;		
+	margin: 0 auto;
+	margin-bottom:2px;
+}
+
+.imageBox .imageBox_theImage{
+	border:1px solid #DDD;	/* Border color for not selected images */
+	padding:2px;
+}
+.imageBoxHighlighted .imageBox_theImage{
+	border:3px solid #316AC5;	/* Border color for selected image */
+	padding:0px;
+
+}
+.imageBoxHighlighted span{	/* Title of selected image */
+	background-color: #316AC5;
+	color:#FFFFFF;
+	padding:2px;
+}
+
+.imageBox_label{	/* Title of images - both selected and not selected */
+	text-align:center;
+	font-family: arial;
+	font-size:11px;		
+	padding-top:2px;
+	margin: 0 auto;
+}
+
+/* 
+DIV that indicates where the dragged image will be placed	
+*/
+#insertionMarker{
+	height:150px;
+	width:6px;
+	position:absolute;
+}
+
+#insertionMarkerLine{
+	width:6px;	/* No need to change this value */
+	height:145px;	/* To adjust the height of the div that indicates where the dragged image will be dropped */
+
+}
+	
+#insertionMarker img{
+	float:left;
+}
+
+/*
+DIV that shows the image as you drag it 
+*/
+#dragDropContent{
+
+	opacity:0.4;	/* 40 % opacity */
+	filter:alpha(opacity=40);	/* 40 % opacity */
+
+	/* 
+	No need to change these three values 
+	*/
+	position:absolute;
+	z-index:10;
+	display:none;
+		
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/ngg_social_media.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/ngg_social_media.css
new file mode 100644
index 0000000000000000000000000000000000000000..7b8e23c4abe815bc4c9d5f145565d8aab604f2cf
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/ngg_social_media.css
@@ -0,0 +1,33 @@
+#ngg_social_media {
+	margin-top: -2px;
+	width: 85%;
+	position: relative;
+	overflow: hidden;
+	height: 20px;
+}
+
+.gallery_page_nggallery-manage-gallery #ngg_social_media,
+.gallery_page_nggallery-manage-album #ngg_social_media,
+.gallery_page_nggallery-tags #ngg_social_media,
+.gallery_page_nggallery-roles #ngg_social_media,
+.gallery_page_nggallery-about #ngg_social_media,
+.toplevel_page_nextgen-gallery #ngg_social_media {
+	float: right;
+	width: 55%;
+}
+
+#ngg_facebook_like {
+	position: absolute;
+	right: 0px;
+	width: 81px;
+	overflow: hidden;
+}
+
+#ngg_social_media .twitter-follow-button {
+	position: absolute;
+	right: 85px;
+}
+
+#slider {
+	margin-top: 5px !important;
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/nggadmin.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/nggadmin.css
new file mode 100644
index 0000000000000000000000000000000000000000..b3cc7f27779e7386234e8f3d695d185aaaefcfa5
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/nggadmin.css
@@ -0,0 +1,458 @@
+/*
+** NextGEN Gallery Style for Wordpress 3.3
+*/
+
+#iframely h2.title {
+	display: none;
+}
+
+/* SETTINGS FOR Overview Gallery */
+
+#newversion {
+	border-color:#CCCCCC;
+	border-style:solid;
+	border-width:1px;
+	margin-right:7px;
+	margin-top:10px;
+	padding:2px;
+}
+
+.ngg-dashboard-widget ul.settings span {
+	padding-left : 10px;
+	color:#2583AD;
+	font-weight:bold;
+}
+
+.ngg-overview .postbox .handlediv {
+	float:right;
+	height:24px;
+	width:24px;
+}
+
+.warning {
+    color: #9F6000;
+    background-color: #FEEFB3;
+    border: 1px solid;
+    margin: 5px 0px;
+    padding:5px;
+}
+
+#donator_message {
+	margin:5px 0 15px;
+	background-color:#BDE5F8;
+	border-color:#00529B;
+	-moz-border-radius-bottomleft:3px;
+	-moz-border-radius-bottomright:3px;
+	-moz-border-radius-topleft:3px;
+	-moz-border-radius-topright:3px;
+	border-style:solid;
+	border-width:1px;
+	margin:5px 15px 2px;
+	padding:0 0.6em;
+}
+
+#donator_message p{
+	line-height:1;
+	margin:0.5em 0;
+	padding:2px;
+	padding-bottom:10px;
+}
+
+#donator_message span{
+	padding-top:10px;
+	float:right;
+}
+
+#plugin_check img {
+    float: right;
+}
+
+#plugin_check p.message {
+	font-size: 90%;
+	color: #666;
+}
+/* SETTING FOR FLASH UPLOAD BUTTON */
+.swfupload {
+	position:absolute;
+	z-index:1;
+	vertical-align:top;
+}
+
+/* SETTINGS FOR THE OPTIONS TABLE */
+.ngg-options th {
+	width:22%;
+}
+
+a.switch-expert {
+	text-decoration:none;
+}
+
+/* WATERMARK */
+#wm-preview {
+	float:right;
+	font-size:90%;
+	width:35%;
+	border-color:#EBEBEB rgb(204, 204, 204) rgb(204, 204, 204) rgb(235, 235, 235);
+	border-style:solid;
+	border-width:1px;
+	margin-bottom:10px;
+	margin-left:10px;
+	margin-right:8px;
+	padding:2px;
+}
+#wm-preview h3{
+	background:#F9F9F9 none repeat scroll 0%;
+	font-size:14px;
+	font-weight:bold;
+	margin:0pt 0pt 10px;
+	padding:8px 5px;
+}
+
+#wm-position {
+	width:100%;
+	margin-left:40px;
+}
+
+.wm-table {
+	border-collapse:collapse;
+	margin-top:1em;
+	width: 60%;
+	clear:none;
+}
+.wm-table td {
+	border-bottom:8px solid #FFFFFF;
+	line-height:20px;
+	margin-bottom:9px;
+	padding:10px;
+}
+.wm-table th {
+	border-bottom:8px solid #FFFFFF;
+	padding:10px;
+	text-align:left;
+}
+.wm-table tr {
+	background:#F9F9F9 none repeat scroll 0%;
+}
+
+/* SETTINGS FOR MANAGE TABLE */
+
+div#poststuff #gallerydiv {
+	cursor:pointer;
+}
+
+p#ngg-inlinebutton {
+	float:right;
+	margin:0pt;
+	position:relative;
+	top:-25pt;
+}
+
+.fixed tbody th.column-cb {
+	padding:7px 0 22px;
+}
+
+.fixed .column-thumbnail{
+	width:85px;
+}
+
+.fixed .column-thumbnail img{
+	max-height:80px;
+	max-width:80px;
+}
+
+.fixed .column-id {
+	width: 5em;
+}
+
+.fixed .column-title {
+	width: 25%;
+}
+
+.fixed .column-description {
+	width: 40%;
+}
+
+.fixed .column-exclude, .fixed .column-action, .fixed .column-delete {
+	width: 10%;
+}
+
+/* SETTINGS FOR PROGRESS BAR */
+
+div .progressborder {
+	border:1px solid #DDDDDD;
+	display: block;
+	height: 30px;
+	background-color: #464646;
+	width: 100%;
+	margin-top: 15px;
+	margin-bottom: 15px;
+    -moz-border-radius: 5px;
+    -webkit-border-radius: 5px;
+    border-radius: 5px;
+}
+
+div .progressbar {
+	border: medium none ;
+	display: block;
+	height: 30px;
+	background-color: #D54E21;
+	width: 0%;
+    -moz-border-radius: 5px;
+    -webkit-border-radius: 5px;
+    border-radius: 5px;
+}
+
+div .progressbar span {
+	display: inline;
+	position: absolute;
+	color: white;
+	font-weight: bold;
+	padding: 5px 0 0 5px;
+}
+
+.show_details
+{
+	height: 16px;
+	line-height: 20px;
+	overflow: hidden;
+	min-width: 8em;
+	padding: 3px;
+	cursor:pointer;
+}
+
+.show_details span
+{
+	border-bottom:1px solid #999;
+	white-space:pre;
+}
+.show_details:hover
+{
+	height: auto;
+	overflow: visible;
+	border: 1px solid #999;
+}
+
+ /* SETTINGS FOR ALBUM PAGE */
+
+.albumnav select[name="act_album"] {
+	width:150px;
+}
+
+.albumnav span {
+	padding-left: 50px;
+}
+
+#editalbum select[name='pageid'] {
+    width: 95%;
+}
+
+div .groupItem
+{
+	cursor: move;
+	width: 295px;
+	padding: 5px;
+    line-height: 1.5;
+}
+
+div .innerhandle {
+	background-color:#FBFBFB;
+}
+
+.groupItem .item_top
+{
+	background-color:#2683AE;
+	color: #FFFFFF;
+	font-weight:bold;
+	line-height: 28px;
+	height: 28px;
+	padding: 0 5px;
+	-moz-border-radius: 3px;
+	-khtml-border-radius: 3px;
+	-webkit-border-radius: 3px;
+	border-radius: 3px;
+}
+
+.groupItem .album_obj
+{
+	background-color:#D54E21;
+}
+
+.groupItem .item_top a
+{
+	color:#FFFFFF;
+	float:right;
+	text-decoration: none;
+}
+
+.groupItem .item_top a:hover
+{
+	color:#FFFFFF;
+}
+
+.itemContent {
+	border-color:#DFDFDF;
+	border-style:none solid solid;
+	border-width:0 1px 1px;
+	padding:2px 0 20px 2px;
+}
+
+.itemContent p {
+	border: 0;
+	margin: 0;
+	padding: 0;
+}
+
+.inlinepicture
+{
+	float:left;
+	display:inline;
+	margin:0pt;
+	padding:0pt 3px 1px;
+}
+
+.inlinepicture img
+{
+	margin:3px;
+	max-height:60px;
+}
+
+.sort_placeholder
+{
+	border:1px dashed #bba !important;
+	margin: 5px;
+	background: #F9F9F9;
+}
+
+.container {
+	margin-top: 10px;
+}
+
+.target-album {
+	margin:10px 685px 10px 10px;
+}
+
+.widget-right {
+	float:right;
+	margin:0pt 10px;
+	width:315px;
+}
+
+.widget-holder {
+	min-height: 400px;
+	padding-top:1px;
+}
+
+.target {
+	background-color:#F1F1F1;
+}
+
+div.widget-top h3 {
+	text-align:center;
+	line-height:25px;
+	margin: 0;
+	padding: 5px 12px;
+	font-size: 13px;
+}
+
+div.widget-top {
+	text-shadow:0 1px 0 #FFFFFF;
+	background-repeat: repeat-x;
+	background-position: 0 0;
+	font-size: 13px;
+}
+
+.ui-autocomplete-start { background-position: 99% center; }
+
+/* SETTINGS FOR SORT GALLERY */
+
+#sortGallery {
+	position:relative;
+}
+
+p#sortButton{
+	margin:0;
+	position:absolute;
+	right:0;
+	top:0;
+}
+
+.imageBox,.imageBoxHighlighted{
+	width:130px;	/* Total width of each image box */
+	height:160px;	/* Total height of each image box */
+	float:left;
+	overflow: hidden;
+	text-overflow: ellipsis;
+	padding: 5px;
+}
+.imageBox_theImage{
+	width:110px;	/* Width of image */
+	height:125px;	/* Height of image */
+
+	background-position: center;
+	background-repeat: no-repeat;
+	margin: 0 auto;
+	margin-bottom:2px;
+}
+
+.imageBox_label{	/* Title of images - both selected and not selected */
+	text-align:center;
+	font-family: arial;
+	font-size:11px;
+	padding-top:2px;
+	margin: 0 auto;
+}
+
+/*
+DIV that indicates where the dragged image will be placed
+*/
+
+#insertionMarker{
+	height:150px;
+	width:6px;
+	position:absolute;
+}
+
+#insertionMarkerLine{
+	width:6px;		/* No need to change this value */
+	height:145px;	/* To adjust the height of the div that indicates where the dragged image will be dropped */
+
+}
+
+#insertionMarker img{
+	float:left;
+}
+
+/*
+DIV that shows the image as you drag it
+*/
+
+#dragDropContent{
+
+	opacity:0.4;	/* 40 % opacity */
+	filter:alpha(opacity=40);	/* 40 % opacity */
+
+	/*
+	No need to change these three values
+	*/
+	position:absolute;
+	z-index:10;
+	display:none;
+
+}
+
+/* UPGRADE PAGE */
+
+.error_inline {
+	background:#FFEBE8 none repeat scroll 0%;
+	border:1px solid #CC0000;
+	margin:5px auto;
+	padding:10px;
+}
+
+/* ABOUT PAGE */
+.ngg-list {
+	font-size:11px;
+	margin-left:15px;
+	list-style-position:inside;
+	list-style-type:disc;
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/tags-admin.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/tags-admin.css
new file mode 100644
index 0000000000000000000000000000000000000000..eec3fbe4109e5633babdc6aaef407dfd2ff6a5d9
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/tags-admin.css
@@ -0,0 +1,10 @@
+.ngg_wrap .auto_list{width:98%;margin:3px 0;padding:3px 5px;}
+.ngg_wrap .list_tags {width:240px;vertical-align:top;}
+.ngg_wrap .forms_manage {vertical-align:top;}
+.ngg_wrap .forms_manage h3 {margin-bottom:5px;}
+.ngg_wrap .forms_manage .form-table {margin-top:0;}
+.ngg_wrap .sort_order h3 {margin:0;}
+.ngg_wrap #ajax_area_tagslist {}
+.ngg_wrap #ajax_area_tagslist ul{list-style:square;margin:10px 0 10px 20px;padding:0;}
+.ngg_wrap #ajax_area_tagslist ul li{margin:0;padding:0;line-height:1.4;}
+.ngg_wrap #ajax_area_tagslist ul li span{cursor:pointer;}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/edit-thumbnail.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/edit-thumbnail.php
new file mode 100644
index 0000000000000000000000000000000000000000..3722f6a6686b88b618a2e595f8e9c8a67fc6a4a0
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/edit-thumbnail.php
@@ -0,0 +1,183 @@
+<?php
+
+/**
+
+Custom thumbnail for NGG
+Author : Simone Fumagalli | simone@iliveinperego.com
+More info and update : http://www.iliveinperego.com/custom_thumbnail_for_ngg/
+
+Credits:
+ NextGen Gallery : Alex Rabe | http://alexrabe.boelinger.com/wordpress-plugins/nextgen-gallery/
+ jCrop : Kelly Hallman <khallman@wrack.org> | http://deepliquid.com/content/Jcrop.html
+ 
+**/
+
+require_once( dirname( dirname(__FILE__) ) . '/ngg-config.php');
+require_once( NGGALLERY_ABSPATH . '/lib/image.php' );
+
+if ( !is_user_logged_in() )
+	die(__('Cheatin&#8217; uh?'));
+	
+if ( !current_user_can('NextGEN Manage gallery') ) 
+	die(__('Cheatin&#8217; uh?'));
+
+global $wpdb;
+
+$id = (int) $_GET['id'];
+
+// let's get the image data
+$picture = nggdb::find_image($id);
+
+include_once( nggGallery::graphic_library() );
+$ngg_options=get_option('ngg_options');
+
+$thumb = new ngg_Thumbnail($picture->imagePath, TRUE);
+$thumb->resize(350,350);
+// we need the new dimension
+$resizedPreviewInfo = $thumb->newDimensions;
+$thumb->destruct();
+
+$preview_image		= NGGALLERY_URLPATH . 'nggshow.php?pid=' . $picture->pid . '&amp;width=350&amp;height=350';
+$imageInfo			= @getimagesize($picture->imagePath);
+$rr = round($imageInfo[0] / $resizedPreviewInfo['newWidth'], 2);
+
+if ( ($ngg_options['thumbfix'] == 1) ) {
+	
+	$WidthHtmlPrev  = $ngg_options['thumbwidth'];
+	$HeightHtmlPrev = $ngg_options['thumbheight'];
+	
+} 
+else {
+	// H > W
+	if ($imageInfo[1] > $imageInfo[0]) {
+		$HeightHtmlPrev =  $ngg_options['thumbheight'];
+		$WidthHtmlPrev  = round($imageInfo[0] / ($imageInfo[1] / $ngg_options['thumbheight']),0);
+	} 
+	else {
+		$WidthHtmlPrev  =  $ngg_options['thumbwidth'];
+		$HeightHtmlPrev = round($imageInfo[1] / ($imageInfo[0] / $ngg_options['thumbwidth']),0);
+	}
+}
+
+$thumbnail_crop_frame = isset($picture->meta_data['thumbnail']['crop_frame']) ? $picture->meta_data['thumbnail']['crop_frame'] : null;
+$default_crop_js_parameter = null;
+
+if ($thumbnail_crop_frame != null)
+{
+	$crop_x = round(((float) $thumbnail_crop_frame['x']) / $rr);
+	$crop_y = round(((float) $thumbnail_crop_frame['y']) / $rr);
+	$crop_width = round(((float) $thumbnail_crop_frame['width']) / $rr);
+	$crop_height = round(((float) $thumbnail_crop_frame['height']) / $rr);
+	$crop_x2 = $crop_x + $crop_width;
+	$crop_y2 = $crop_y + $crop_height;
+	
+	$default_crop_js_parameter = 'setSelect: [' . $crop_x . ',' . $crop_y . ',' . $crop_x2 . ',' . $crop_y2 . '],';
+}
+
+?>
+<script src="<?php echo NGGALLERY_URLPATH; ?>/admin/js/Jcrop/js/jquery.Jcrop.js"></script>
+<link rel="stylesheet" href="<?php echo NGGALLERY_URLPATH; ?>/admin/js/Jcrop/css/jquery.Jcrop.css" type="text/css" />
+
+<script type="text/javascript">
+//<![CDATA[	
+	var status = 'start';
+	var xT, yT, wT, hT, selectedCoords;
+	var selectedImage = "thumb<?php echo $id ?>";
+
+	function showPreview(coords)
+	{
+		if (status != 'edit') {
+			jQuery('#actualThumb').hide();
+			jQuery('#previewNewThumb').show();
+			status = 'edit';	
+		}
+		
+		var rx = <?php echo $WidthHtmlPrev; ?> / coords.w;
+		var ry = <?php echo $HeightHtmlPrev; ?> / coords.h;
+		
+		jQuery('#imageToEditPreview').css({
+			width: Math.round(rx * <?php echo $resizedPreviewInfo['newWidth']; ?>) + 'px',
+			height: Math.round(ry * <?php echo $resizedPreviewInfo['newHeight']; ?>) + 'px',
+			marginLeft: '-' + Math.round(rx * coords.x) + 'px',
+			marginTop: '-' + Math.round(ry * coords.y) + 'px'
+		});
+		
+		xT = coords.x;
+		yT = coords.y;
+		wT = coords.w;
+		hT = coords.h;
+		
+		jQuery("#sizeThumb").html(xT+" "+yT+" "+wT+" "+hT);
+	};
+	
+	function updateThumb() {
+		
+		if ( (wT == 0) || (hT == 0) || (wT == undefined) || (hT == undefined) ) {
+			alert("<?php _e('Select with the mouse the area for the new thumbnail', 'nggallery'); ?>");
+			return false;			
+		}
+				
+		jQuery.ajax({
+		  url: ajaxurl,
+		  type : "POST",
+          data:  {x: xT, y: yT, w: wT, h: hT, action: 'createNewThumb', id: <?php echo $id; ?>, rr: <?php echo str_replace(',','.',$rr); ?>},
+		  cache: false,
+		  success: function(data){
+					var d = new Date();
+					newUrl = jQuery("#"+selectedImage).attr("src") + "?" + d.getTime();
+					jQuery("#"+selectedImage).attr("src" , newUrl);
+					
+					jQuery('#thumbMsg').html("<?php _e('Thumbnail updated', 'nggallery') ?>");
+					jQuery('#thumbMsg').css({'display':'block'});
+					setTimeout(function(){ jQuery('#thumbMsg').fadeOut('slow'); }, 1500);
+			},
+		  error: function() {
+		  			jQuery('#thumbMsg').html("<?php _e('Error updating thumbnail', 'nggallery') ?>");
+					jQuery('#thumbMsg').css({'display':'block'});
+					setTimeout(function(){ jQuery('#thumbMsg').fadeOut('slow'); }, 1500);
+		    }
+		});
+
+	};
+//]]>
+</script>
+
+<table width="98%" align="center" style="border:1px solid #DADADA">
+	<tr>
+		<td rowspan="3" valign="middle" align="center" width="350" style="background-color:#DADADA;">
+			<img src="<?php echo esc_url( $preview_image ); ?>" alt="" id="imageToEdit" />	
+		</td>
+		<td width="300" style="background-color : #DADADA;">
+			<small style="margin-left:6px; display:block;"><?php esc_html_e('Select the area for the thumbnail from the picture on the left.', 'nggallery'); ?></small>
+		</td>		
+	</tr>
+	<tr>
+		<td align="center" width="300" height="320">
+			<div id="previewNewThumb" style="display:none;width:<?php echo $WidthHtmlPrev; ?>px;height:<?php echo $HeightHtmlPrev; ?>px;overflow:hidden; margin-left:5px;">
+				<img src="<?php echo esc_url( $preview_image ); ?>" id="imageToEditPreview" />
+			</div>
+			<div id="actualThumb">
+				<img src="<?php echo esc_url( $picture->thumbURL ); ?>?<?php echo time()?>" />
+			</div>
+		</td>
+	</tr>
+	<tr style="background-color:#DADADA;">
+		<td>
+			<input type="button" name="update" value="<?php esc_attr_e('Update', 'nggallery'); ?>" onclick="updateThumb()" class="button-secondary" style="float:left; margin-left:4px;"/>
+			<div id="thumbMsg" style="color:#FF0000; display : none;font-size:11px; float:right; width:60%; height:2em; line-height:2em;"></div>
+		</td>
+	</tr>
+</table>
+
+<script type="text/javascript">
+//<![CDATA[
+	jQuery(document).ready(function(){
+		jQuery('#imageToEdit').Jcrop({
+			onChange: showPreview,
+			onSelect: showPreview,
+			<?php echo $default_crop_js_parameter; ?>
+			aspectRatio: <?php echo str_replace(',', '.', round($WidthHtmlPrev/$HeightHtmlPrev, 3)); ?>
+		});
+	});
+//]]>
+</script>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/functions.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/functions.php
new file mode 100644
index 0000000000000000000000000000000000000000..c5f1a32563f0a4902cc86c713b28ae3d27ab7bc4
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/functions.php
@@ -0,0 +1,1461 @@
+<?php
+
+if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
+
+/**
+ * nggAdmin - Class for admin operation
+ *
+ * @package NextGEN Gallery
+ * @author Alex Rabe
+ *
+ * @access public
+ */
+class nggAdmin{
+
+	/**
+	 * create a new gallery & folder
+	 *
+	 * @class nggAdmin
+	 * @param string $name of the gallery
+	 * @param string $defaultpath
+	 * @param bool $output if the function should show an error messsage or not
+	 * @return
+	 */
+	function create_gallery($title, $defaultpath, $output = true) {
+
+		global $user_ID;
+
+		// get the current user ID
+		get_currentuserinfo();
+
+		//cleanup pathname
+		$name = sanitize_file_name( sanitize_title($title)  );
+		$name = apply_filters('ngg_gallery_name', $name);
+		$nggRoot = WINABSPATH . $defaultpath;
+		$txt = '';
+
+		// No gallery name ?
+		if ( empty($name) ) {
+			if ($output) nggGallery::show_error( __('No valid gallery name!', 'nggallery') );
+			return false;
+		}
+
+		// check for main folder
+		if ( !is_dir($nggRoot) ) {
+			if ( !wp_mkdir_p( $nggRoot ) ) {
+				$txt  = __('Directory', 'nggallery').' <strong>' . esc_html( $defaultpath ) . '</strong> '.__('didn\'t exist. Please create first the main gallery folder ', 'nggallery').'!<br />';
+				$txt .= __('Check this link, if you didn\'t know how to set the permission :', 'nggallery').' <a href="http://codex.wordpress.org/Changing_File_Permissions">http://codex.wordpress.org/Changing_File_Permissions</a> ';
+				if ($output) nggGallery::show_error($txt);
+				return false;
+			}
+		}
+
+		// check for permission settings, Safe mode limitations are not taken into account.
+		if ( !is_writeable( $nggRoot ) ) {
+			$txt  = __('Directory', 'nggallery').' <strong>' . esc_html( $defaultpath ) . '</strong> '.__('is not writeable !', 'nggallery').'<br />';
+			$txt .= __('Check this link, if you didn\'t know how to set the permission :', 'nggallery').' <a href="http://codex.wordpress.org/Changing_File_Permissions">http://codex.wordpress.org/Changing_File_Permissions</a> ';
+			if ($output) nggGallery::show_error($txt);
+			return false;
+		}
+
+		// 1. Check for existing folder
+		if ( is_dir(WINABSPATH . $defaultpath . $name ) && !(SAFE_MODE) ) {
+			$suffix = 1;
+			do {
+				$alt_name = substr ($name, 0, 200 - ( strlen( $suffix ) + 1 ) ) . "_$suffix";
+				$dir_check = is_dir(WINABSPATH . $defaultpath . $alt_name );
+				$suffix++;
+			} while ( $dir_check );
+			$name = $alt_name;
+		}
+        // define relative path to gallery inside wp root folder
+        $nggpath = $defaultpath . $name;
+
+		// 2. Create new gallery folder
+		if ( !wp_mkdir_p (WINABSPATH . $nggpath) )
+		  $txt  = __('Unable to create directory ', 'nggallery') . esc_html( $nggpath ) . '!<br />';
+
+		// 3. Check folder permission
+		if ( !is_writeable(WINABSPATH . $nggpath ) )
+			$txt .= __('Directory', 'nggallery').' <strong>' . esc_html( $nggpath ) . '</strong> '.__('is not writeable !', 'nggallery').'<br />';
+
+		// 4. Now create thumbnail folder inside
+		if ( !is_dir(WINABSPATH . $nggpath . '/thumbs') ) {
+			if ( !wp_mkdir_p ( WINABSPATH . $nggpath . '/thumbs') )
+				$txt .= __('Unable to create directory ', 'nggallery').' <strong>' . esc_html( $nggpath ) . '/thumbs !</strong>';
+		}
+
+		if (SAFE_MODE) {
+			$help  = __('The server setting Safe-Mode is on !', 'nggallery');
+			$help .= '<br />'.__('If you have problems, please create directory', 'nggallery').' <strong>' . esc_html( $nggpath ) . '</strong> ';
+			$help .= __('and the thumbnails directory', 'nggallery').' <strong>' . esc_html( $nggpath ) . '/thumbs</strong> '.__('with permission 777 manually !', 'nggallery');
+			if ($output) nggGallery::show_message($help);
+		}
+
+		// show a error message
+		if ( !empty($txt) ) {
+			if (SAFE_MODE) {
+			// for safe_mode , better delete folder, both folder must be created manually
+				@rmdir(WINABSPATH . $nggpath . '/thumbs');
+				@rmdir(WINABSPATH . $nggpath);
+			}
+			if ($output) nggGallery::show_error($txt);
+			return false;
+		}
+
+        // now add the gallery to the database
+        $galleryID = nggdb::add_gallery($title, $nggpath, '', 0, 0, $user_ID );
+		// here you can inject a custom function
+		do_action('ngg_created_new_gallery', $galleryID);
+
+		// return only the id if defined
+		if ($output == false)
+			return $galleryID;
+
+		if ($galleryID != false) {
+			$message  = __('Gallery ID %1$s successfully created. You can show this gallery in your post or page with the shortcode %2$s.<br/>','nggallery');
+			$message  = sprintf($message, $galleryID, '<strong>[nggallery id=' . $galleryID . ']</strong>');
+			$message .= '<a href="' . admin_url() . 'admin.php?page=nggallery-manage-gallery&mode=edit&gid=' . $galleryID . '" >';
+			$message .= __('Edit gallery','nggallery');
+			$message .= '</a>';
+
+			if ($output) nggGallery::show_message($message);
+		}
+		return true;
+	}
+
+	/**
+	 * nggAdmin::import_gallery()
+	 * TODO: Check permission of existing thumb folder & images
+	 *
+	 * @class nggAdmin
+	 * @param string $galleryfolder contains relative path to the gallery itself
+	 * @return void
+	 */
+	function import_gallery($galleryfolder) {
+
+		global $wpdb, $user_ID;
+
+		// get the current user ID
+		get_currentuserinfo();
+
+		$created_msg = '';
+
+		// remove trailing slash at the end, if somebody use it
+		$galleryfolder = untrailingslashit($galleryfolder);
+		$gallerypath = WINABSPATH . $galleryfolder;
+
+		if (!is_dir($gallerypath)) {
+			nggGallery::show_error(__('Directory', 'nggallery').' <strong>' . esc_html( $gallerypath ) .'</strong> '.__('doesn&#96;t exist!', 'nggallery'));
+			return ;
+		}
+
+		// read list of images
+		$new_imageslist = nggAdmin::scandir($gallerypath);
+
+		if (empty($new_imageslist)) {
+			nggGallery::show_message(__('Directory', 'nggallery').' <strong>' . esc_html( $gallerypath ) . '</strong> '.__('contains no pictures', 'nggallery'));
+			return;
+		}
+
+		// check & create thumbnail folder
+		if ( !nggGallery::get_thumbnail_folder($gallerypath) )
+			return;
+
+		// take folder name as gallery name
+		$galleryname = basename($galleryfolder);
+		$galleryname = apply_filters('ngg_gallery_name', $galleryname);
+
+		// check for existing gallery folder
+		$gallery_id = $wpdb->get_var("SELECT gid FROM $wpdb->nggallery WHERE path = '$galleryfolder' ");
+
+		if (!$gallery_id) {
+            // now add the gallery to the database
+            $gallery_id = nggdb::add_gallery( $galleryname, $galleryfolder, '', 0, 0, $user_ID );
+			if (!$gallery_id) {
+				nggGallery::show_error(__('Database error. Could not add gallery!','nggallery'));
+				return;
+			}
+            else {
+                do_action('ngg_created_new_gallery', $gallery_id);
+            }
+			$created_msg = _n( 'Gallery', 'Galleries', 1, 'nggallery' ) . ' <strong>' . esc_html( $galleryname ) . '</strong> ' . __('successfully created!','nggallery') . '<br />';
+		}
+
+		// Look for existing image list
+		$old_imageslist = $wpdb->get_col("SELECT filename FROM $wpdb->nggpictures WHERE galleryid = '$gallery_id' ");
+
+		// if no images are there, create empty array
+		if ($old_imageslist == NULL)
+			$old_imageslist = array();
+
+		// check difference
+		$new_images = array_diff($new_imageslist, $old_imageslist);
+
+		// all images must be valid files
+		foreach($new_images as $key => $picture) {
+
+            // filter function to rename/change/modify image before
+            $picture = apply_filters('ngg_pre_add_new_image', $picture, $gallery_id);
+            $new_images[$key] = $picture;
+
+			if (!@getimagesize($gallerypath . '/' . $picture) ) {
+				unset($new_images[$key]);
+				@unlink($gallerypath . '/' . $picture);
+			}
+		}
+
+		// add images to database
+		$image_ids = nggAdmin::add_Images($gallery_id, $new_images);
+        do_action('ngg_after_new_images_added', $gallery_id, $image_ids);
+
+		//add the preview image if needed
+		nggAdmin::set_gallery_preview ( $gallery_id );
+
+		// now create thumbnails
+		nggAdmin::do_ajax_operation( 'create_thumbnail' , $image_ids, __('Create new thumbnails','nggallery') );
+
+		//TODO:Message will not shown, because AJAX routine require more time, message should be passed to AJAX
+		$message  = $created_msg . count($image_ids) .__(' picture(s) successfully added','nggallery');
+		$message .= ' [<a href="' . admin_url() . 'admin.php?page=nggallery-manage-gallery&mode=edit&gid=' . $gallery_id . '" >';
+		$message .=  __('Edit gallery','nggallery');
+		$message .= '</a>]';
+
+		nggGallery::show_message($message);
+
+		return;
+
+	}
+
+	/**
+	 * Scan folder for new images
+	 *
+	 * @class nggAdmin
+	 * @param string $dirname
+	 * @return array $files list of image filenames
+	 */
+	function scandir( $dirname = '.' ) {
+		$ext = apply_filters('ngg_allowed_file_types', array('jpeg', 'jpg', 'png', 'gif') );
+
+		$files = array();
+		if( $handle = opendir( $dirname ) ) {
+			while( false !== ( $file = readdir( $handle ) ) ) {
+				$info = pathinfo( $file );
+				// just look for images with the correct extension
+				if ( isset($info['extension']) ) {
+					if ( in_array( strtolower($info['extension']), $ext) ) {
+						if (!seems_utf8($file)) {
+							$file = utf8_encode( $file );
+						}
+
+						$files[] = $file;
+					}
+				}
+			}
+
+			closedir( $handle );
+		}
+		sort( $files );
+		return ( $files );
+	}
+
+	/**
+	 * nggAdmin::createThumbnail() - function to create or recreate a thumbnail
+	 *
+	 * @class nggAdmin
+	 * @param object | int $image contain all information about the image or the id
+	 * @return string result code
+	 * @since v1.0.0
+	 */
+	function create_thumbnail($image) {
+
+		if (is_object($image)) {
+			if (isset($image->id)) {
+				$image = $image->id;
+			}
+			elseif (isset($image->pid)) {
+				$image = $image->pid;
+			}
+		}
+
+		$registry = C_Component_Registry::get_instance();
+		$storage  = $registry->get_utility('I_Gallery_Storage');
+
+		// XXX NextGEN Legacy wasn't handling watermarks or reflections at this stage, so we're forcefully disabling them to maintain compatibility
+		$params = array('watermark' => false, 'reflection' => false);
+		$result = $storage->generate_thumbnail($image, $params);
+
+		if (!$result)
+		{
+			// XXX there isn't any error handling unfortunately at the moment in the generate_thumbnail functions, need a way to return proper error status
+			return __('Error while creating thumbnail.', 'nggallery');
+		}
+
+		// success
+		return '1';
+	}
+
+	/**
+	 * nggAdmin::resize_image() - create a new image, based on the height /width
+	 *
+	 * @class nggAdmin
+	 * @param object | int $image contain all information about the image or the id
+	 * @param integer $width optional
+	 * @param integer $height optional
+	 * @return string result code
+	 */
+	function resize_image($image, $width = 0, $height = 0) 
+	{
+		if (is_object($image)) {
+			if (isset($image->id)) {
+				$image = $image->id;
+			}
+			elseif (isset($image->pid)) {
+				$image = $image->pid;
+			}
+		}
+
+		$registry = C_Component_Registry::get_instance();
+    	$storage  = $registry->get_utility('I_Gallery_Storage');
+    	// XXX maybe get rid of this...it's needed to get width/height defaults, placing these directly in generate_image_size could have unwanted consequences
+		$settings = C_NextGen_Settings::get_instance();
+
+		// XXX NextGEN Legacy wasn't handling watermarks or reflections at this stage, so we're forcefully disabling them to maintain compatibility
+		$params = array('watermark' => false, 'reflection' => false);
+
+		if ($width > 0) {
+			$params['width'] = $width;
+		}
+		else {
+			$params['width'] = $settings->imgWidth;
+		}
+
+		if ($height > 0) {
+			$params['height'] = $height;
+		}
+		else {
+			$params['height'] = $settings->imgHeight;
+		}
+
+		$result = $storage->generate_image_size($image, 'full', $params);
+
+		if (!$result)
+		{
+			// XXX there isn't any error handling unfortunately at the moment in the generate_thumbnail functions, need a way to return proper error status
+			return __('Error while resizing image.', 'nggallery');
+		}
+
+		// success
+		return '1';
+	}
+
+	/**
+	 * Rotated/Flip an image based on the orientation flag or a definded angle
+	 *
+	 * @param int|object $image
+	 * @param string (optional) $dir, CW (clockwise)or CCW (counter clockwise), if set to false, the exif flag will be used
+	 * @param string (optional)  $flip, could be either false | V (flip vertical) | H (flip horizontal)
+	 * @return string result code
+	 */
+	function rotate_image($image, $dir = false, $flip = false) 
+	{
+        if (is_object($image)) {
+            if (isset($image->id))        $image = $image->id;
+            elseif (isset($image->pid))   $image = $image->pid;
+        }
+
+		$registry = C_Component_Registry::get_instance();
+        $storage  = $registry->get_utility('I_Gallery_Storage');
+
+		// XXX NextGEN Legacy wasn't handling watermarks or reflections at this stage, so we're forcefully disabling them to maintain compatibility
+		$params = array('watermark' => false, 'reflection' => false);
+		$rotation = null;
+
+		if ($dir === 'CW') {
+			$rotation = 90;
+		}
+		else if ($dir === 'CCW') {
+			$rotation = -90;
+		}
+		// if you didn't define a rotation, we look for the orientation flag in EXIF
+		else if ($dir === false) {
+			$meta = new nggMeta( $image);
+			$exif = $meta->get_EXIF();
+
+			if (isset($exif['Orientation'])) {
+				
+				switch ($exif['Orientation']) {
+					case 5 : // vertical flip + 90 rotate right
+						$flip = 'V';
+					case 6 : // 90 rotate right
+						$rotation = 90;
+						break;
+					case 7 : // horizontal flip + 90 rotate right
+						$flip = 'H';
+					case 8 : // 90 rotate left
+						$rotation = -90;
+						break;
+					case 4 : // vertical flip
+						$flip = 'V';
+						break;
+					case 3 : // 180 rotate left
+						$rotation = -180;
+						break;
+					case 2 : // horizontal flip
+						$flip = 'H';
+						break;
+					case 1 : // no action in the case it doesn't need a rotation
+					default:
+						return '0';
+						break;
+				}
+			} else
+                return '0';
+		}
+
+		if ($rotation != null) {
+			$params['rotation'] = $rotation;
+		}
+		
+		if ($flip != null) {
+			$params['flip'] = $flip;
+		}
+		
+		$result = $storage->generate_image_size($image, 'full', $params);
+
+		if (!$result)
+		{
+			// XXX there isn't any error handling unfortunately at the moment in the generate_thumbnail functions, need a way to return proper error status
+			return __('Error while rotating image.', 'nggallery');
+		}
+
+		// success
+		return '1';
+	}
+
+	/**
+	 * nggAdmin::set_watermark() - set the watermark for the image
+	 *
+	 * @class nggAdmin
+	 * @param object | int $image contain all information about the image or the id
+	 * @return string result code
+	 */
+	function set_watermark($image) {
+
+		if (is_object($image)) {
+			if (isset($image->id)) {
+				$image = $image->id;
+			}
+			elseif (isset($image->pid)) {
+				$image = $image->pid;
+			}
+		}
+
+		$registry = C_Component_Registry::get_instance();
+    $storage  = $registry->get_utility('I_Gallery_Storage');
+
+		// XXX NextGEN Legacy was only handling watermarks at this stage, so we're forcefully disabling all else
+		$params = array('watermark' => true, 'reflection' => false, 'crop' => false);
+		$result = $storage->generate_image_size($image, 'full', $params);
+
+		if (!$result)
+		{
+			// XXX there isn't any error handling unfortunately at the moment in the generate_thumbnail functions, need a way to return proper error status
+			return __('Error while applying watermark to image.', 'nggallery');
+		}
+
+		// success
+		return '1';
+	}
+
+	/**
+	 * Recover image from backup copy and reprocess it
+	 *
+	 * @class nggAdmin
+	 * @since 1.5.0
+	 * @param object | int $image contain all information about the image or the id
+	 * @return string result code
+	 */
+
+	function recover_image($image) {
+
+		global $ngg;
+
+		if ( is_numeric($image) )
+			$image = nggdb::find_image( $image );
+
+		if ( !is_object( $image ) )
+			return __('Object didn\'t contain correct data','nggallery');
+
+		if (!is_writable( $image->imagePath ))
+			return ' <strong>' . esc_html( $image->filename ) . __(' is not writeable','nggallery') . '</strong>';
+
+		if (!file_exists( $image->imagePath . '_backup' )) {
+			return ' <strong>'.__('File do not exists','nggallery').'</strong>';
+		}
+
+		if (!@copy( $image->imagePath . '_backup' , $image->imagePath) )
+			return ' <strong>'.__('Couldn\'t restore original image','nggallery').'</strong>';
+
+		require_once(NGGALLERY_ABSPATH . '/lib/meta.php');
+
+		$meta_obj = new nggMeta( $image->pid );
+
+        $common = $meta_obj->get_common_meta();
+        $common['saved']  = true;
+		$result = nggdb::update_image_meta($image->pid, $common);
+
+		return '1';
+
+	}
+
+	/**
+	 * Add images to database
+	 *
+	 * @class nggAdmin
+	 * @param int $galleryID
+	 * @param array $imageslist
+	 * @return array $image_ids Id's which are sucessful added
+	 */
+	function add_Images($galleryID, $imageslist) {
+
+		global $wpdb, $ngg;
+
+		$image_ids = array();
+
+		if ( is_array($imageslist) ) {
+			foreach($imageslist as $picture) {
+
+                // filter function to rename/change/modify image before
+                $picture = apply_filters('ngg_pre_add_new_image', $picture, $galleryID);
+
+				// strip off the extension of the filename
+				$path_parts = pathinfo( $picture );
+				$alttext = ( !isset($path_parts['filename']) ) ? substr($path_parts['basename'], 0,strpos($path_parts['basename'], '.')) : $path_parts['filename'];
+				// save it to the database
+                $pic_id = nggdb::add_image( $galleryID, $picture, '', $alttext );
+
+				if ( !empty($pic_id) )
+					$image_ids[] = $pic_id;
+
+				// add the metadata
+				nggAdmin::import_MetaData( $pic_id );
+
+				// auto rotate
+				nggAdmin::rotate_image( $pic_id );
+
+				// Autoresize image if required
+                if ($ngg->options['imgAutoResize']) {
+                	$imagetmp = nggdb::find_image( $pic_id );
+                	$sizetmp = @getimagesize ( $imagetmp->imagePath );
+                	$widthtmp  = $ngg->options['imgWidth'];
+                	$heighttmp = $ngg->options['imgHeight'];
+                	if (($sizetmp[0] > $widthtmp && $widthtmp) || ($sizetmp[1] > $heighttmp && $heighttmp)) {
+                			nggAdmin::resize_image( $pic_id );
+                	}
+                }
+
+				// action hook for post process after the image is added to the database
+				$image = array( 'id' => $pic_id, 'filename' => $picture, 'galleryID' => $galleryID);
+				do_action('ngg_added_new_image', $image);
+
+			}
+		} // is_array
+
+        // delete dirsize after adding new images
+        delete_transient( 'dirsize_cache' );
+
+		do_action('ngg_after_new_images_added', $galleryID, $image_ids );
+
+		return $image_ids;
+
+	}
+
+	/**
+	 * Import some meta data into the database (if avialable)
+	 *
+	 * @class nggAdmin
+	 * @param array|int $imagesIds
+	 * @return string result code
+	 */
+	function import_MetaData($imagesIds) {
+
+		global $wpdb;
+
+		require_once(NGGALLERY_ABSPATH . '/lib/image.php');
+
+		if (!is_array($imagesIds))
+			$imagesIds = array($imagesIds);
+
+		foreach($imagesIds as $imageID) {
+
+			$image = nggdb::find_image( $imageID );
+			if (!$image->error) {
+
+				$meta = nggAdmin::get_MetaData( $image->pid );
+
+				// get the title
+				$alttext = empty( $meta['title'] ) ? $image->alttext : $meta['title'];
+
+				// get the caption / description field
+				$description = empty( $meta['caption'] ) ? $image->description : $meta['caption'];
+
+				// get the file date/time from exif
+				$timestamp = $meta['timestamp'];
+				// first update database
+				$result = $wpdb->query(
+					$wpdb->prepare("UPDATE $wpdb->nggpictures SET
+						alttext = %s,
+						description = %s,
+						imagedate = %s
+					WHERE pid = %d", $alttext, $description, $timestamp, $image->pid) );
+
+				if ($result === false)
+					return ' <strong>' . esc_html( $image->filename ) . ' ' . __('(Error : Couldn\'t not update data base)', 'nggallery') . '</strong>';
+
+				//this flag will inform us that the import is already one time performed
+				$meta['common']['saved']  = true;
+				$result = nggdb::update_image_meta($image->pid, $meta['common']);
+
+				if ($result === false)
+					return ' <strong>' . esc_html( $image->filename ) . ' ' . __('(Error : Couldn\'t not update meta data)', 'nggallery') . '</strong>';
+
+				// add the tags if we found some
+				if ($meta['keywords']) {
+					$taglist = explode(',', $meta['keywords']);
+					wp_set_object_terms($image->pid, $taglist, 'ngg_tag');
+				}
+
+			} else
+				return ' <strong>' . esc_html( $image->filename ) . ' ' . __('(Error : Couldn\'t not find image)', 'nggallery') . '</strong>';// error check
+		}
+
+		return '1';
+	}
+
+	/**
+	 * nggAdmin::get_MetaData()
+	 *
+	 * @class nggAdmin
+	 * @require NextGEN Meta class
+	 * @param int $id image ID
+	 * @return array metadata
+	 */
+	function get_MetaData($id) {
+
+		require_once(NGGALLERY_ABSPATH . '/lib/meta.php');
+
+		$meta = array();
+
+		$pdata = new nggMeta( $id );
+
+		$meta['title'] = trim ( $pdata->get_META('title') );
+		$meta['caption'] = trim ( $pdata->get_META('caption') );
+		$meta['keywords'] = trim ( $pdata->get_META('keywords') );
+		$meta['timestamp'] = $pdata->get_date_time();
+		// this contain other useful meta information
+		$meta['common'] = $pdata->get_common_meta();
+        // hook for addon plugin to add more meta fields
+        $meta = apply_filters('ngg_get_image_metadata', $meta, $pdata);
+
+		return $meta;
+
+	}
+
+	/**
+	 * Maybe import some meta data to the database. The functions checks the flag 'saved'
+	 * and if based on compat reason (pre V1.4.0) we save then some meta datas to the database
+	 *
+	 * @since V1.4.0
+	 * @param int $id
+	 * @return result
+	 */
+	function maybe_import_meta( $id ) {
+
+		require_once(NGGALLERY_ABSPATH . '/lib/meta.php');
+
+		$meta_obj = new nggMeta( $id );
+
+		if ( $meta_obj->image->meta_data['saved'] != true ) {
+            $common = $meta_obj->get_common_meta();
+            //this flag will inform us that the import is already one time performed
+            $common['saved']  = true;
+			$result = nggdb::update_image_meta($id, $common);
+		} else
+			return false;
+
+		return $result;
+
+	}
+
+	/**
+	 * Unzip a file via the PclZip class
+	 *
+	 * @class nggAdmin
+	 * @require PclZip class
+	 * @param string $dir
+	 * @param string $file
+	 * @return bool
+	 */
+	function unzip($dir, $file) {
+
+		if(! class_exists('PclZip'))
+			require_once(ABSPATH . 'wp-admin/includes/class-pclzip.php');
+
+		$archive = new PclZip($file);
+
+		// extract all files in one folder
+		if ($archive->extract(PCLZIP_OPT_PATH, $dir, PCLZIP_OPT_REMOVE_ALL_PATH,
+                                PCLZIP_CB_PRE_EXTRACT, 'ngg_getOnlyImages',
+                                PCLZIP_CB_POST_EXTRACT, 'ngg_checkExtract') == 0) {
+			nggGallery::show_error( 'Error : ' . $archive->errorInfo(true) );
+			return false;
+		}
+
+		return true;
+	}
+
+	/**
+	 * nggAdmin::getOnlyImages()
+	 *
+	 * @class nggAdmin
+	 * @param mixed $p_event
+	 * @param mixed $p_header
+	 * @return bool
+	 */
+	function getOnlyImages($p_event, &$p_header)	{
+        // avoid null byte hack (THX to Dominic Szablewski)
+        if ( strpos($p_header['filename'], chr(0) ) !== false )
+            $p_header['filename'] = substr ( $p_header['filename'], 0, strpos($p_header['filename'], chr(0) ));
+        // check for extension
+		$info = pathinfo($p_header['filename']);
+		// check for extension
+		$ext = apply_filters('ngg_allowed_file_types', array('jpeg', 'jpg', 'png', 'gif') );
+		if ( in_array( strtolower($info['extension']), $ext) ) {
+			// For MAC skip the ".image" files
+			if ($info['basename']{0} ==  '.' )
+				return 0;
+			else {
+                // sanitize the file name before we do further processing
+                $info['basename'] = sanitize_file_name( $info['basename'] );
+                $p_header['filename'] = $info['dirname'] . '/' . $info['basename'];
+                return 1;
+			}
+
+		}
+		// ----- all other files are skipped
+		else {
+		  return 0;
+		}
+	}
+
+	/**
+	 * Import a ZIP file via a upload form or a URL
+	 *
+	 * @class nggAdmin
+	 * @param int (optional) $galleryID
+	 * @return bool $result
+	 */
+	function import_zipfile($galleryID) {
+
+		global $ngg, $wpdb;
+
+		if (nggWPMU::check_quota())
+			return false;
+
+		$defaultpath = $ngg->options['gallerypath'];
+		$zipurl = isset($_POST['zipurl']) ? $_POST['zipurl'] : '';
+
+		// if someone entered a URL try to upload it
+		if (!empty($zipurl) && (function_exists('curl_init')) ) {
+
+			if (!(preg_match('/^http(s)?:\/\//i', $zipurl) )) {
+				nggGallery::show_error( __('No valid URL path ','nggallery') );
+				return false;
+			}
+
+			$temp_zipfile = tempnam('/tmp', 'zipimport_');
+			$filename = basename($zipurl);
+
+			//Grab the zip via cURL
+			$save = fopen ( $temp_zipfile, "w" );
+			$ch = curl_init ();
+			curl_setopt ( $ch, CURLOPT_FILE, $save );
+			curl_setopt ( $ch, CURLOPT_HEADER, 0 );
+			curl_setopt ( $ch, CURLOPT_BINARYTRANSFER, 1 );
+			curl_setopt ( $ch, CURLOPT_URL, $zipurl );
+			$success = curl_exec ( $ch );
+			if (!$success)
+				nggGallery::show_error( __('Import via cURL failed.','nggallery') . ' Error code ' . curl_errno( $ch ) . ' : ' . curl_error( $ch ) );
+			curl_close ( $ch );
+			fclose($save);
+
+			if (!$success)
+				return false;
+
+		} else {
+
+			$temp_zipfile = $_FILES['zipfile']['tmp_name'];
+			$filename = $_FILES['zipfile']['name'];
+
+			// Chrome return a empty content-type : http://code.google.com/p/chromium/issues/detail?id=6800
+			if ( !preg_match('/chrome/i', $_SERVER['HTTP_USER_AGENT']) ) {
+				// check if file is a zip file
+				if ( !preg_match('/(zip|download|octet-stream)/i', $_FILES['zipfile']['type']) ) {
+					@unlink($temp_zipfile); // del temp file
+					nggGallery::show_error(__('Uploaded file was no or a faulty zip file ! The server recognized : ','nggallery') . $_FILES['zipfile']['type']);
+					return false;
+				}
+			}
+		}
+
+		// should this unpacked into a new folder ?
+		if ( $galleryID == '0' ) {
+			//cleanup and take the zipfile name as folder name
+			$foldername = sanitize_title(strtok ($filename, '.'));
+			$foldername = rtrim($defaultpath, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . ltrim($foldername, DIRECTORY_SEPARATOR);
+		} else {
+			// get foldername if selected
+			$foldername = $wpdb->get_var("SELECT path FROM $wpdb->nggallery WHERE gid = '$galleryID' ");
+		}
+
+		if ( empty($foldername) ) {
+			nggGallery::show_error( __('Could not get a valid foldername', 'nggallery') );
+			return false;
+		}
+
+		// set complete folder path
+		$newfolder = WINABSPATH . $foldername;
+
+		// check first if the traget folder exist
+		if (!is_dir($newfolder)) {
+			// create new directories
+			if (!wp_mkdir_p ($newfolder)) {
+				$message = sprintf(__('Unable to create directory %s. Is its parent directory writable by the server?', 'nggallery'), esc_html( $newfolder ) );
+				nggGallery::show_error($message);
+				return false;
+			}
+			if (!wp_mkdir_p ($newfolder . '/thumbs')) {
+				nggGallery::show_error(__('Unable to create directory ', 'nggallery') . esc_html( $newfolder ). '/thumbs !');
+				return false;
+			}
+		}
+
+		// unzip and del temp file
+		$result = nggAdmin::unzip($newfolder, $temp_zipfile);
+		@unlink($temp_zipfile);
+
+		if ($result) {
+			$message = __('Zip-File successfully unpacked','nggallery') . '<br />';
+
+			// parse now the folder and add to database
+			$message .= nggAdmin::import_gallery( $foldername );
+			nggGallery::show_message($message);
+		}
+
+		return true;
+	}
+
+	/**
+	 * Function for uploading of images via the upload form
+	 *
+	 * @class nggAdmin
+	 * @return void
+	 */
+	function upload_images() {
+
+		global $nggdb;
+
+		// WPMU action
+		if (nggWPMU::check_quota())
+			return;
+
+		// Images must be an array
+		$imageslist = array();
+
+		// get selected gallery
+		$galleryID = (int) $_POST['galleryselect'];
+
+		if ($galleryID == 0) {
+			nggGallery::show_error(__('No gallery selected !','nggallery'));
+			return;
+		}
+
+		// get the path to the gallery
+		$gallery = $nggdb->find_gallery($galleryID);
+
+		if ( empty($gallery->path) ){
+			nggGallery::show_error(__('Failure in database, no gallery path set !','nggallery'));
+			return;
+		}
+
+		// read list of images
+		$dirlist = nggAdmin::scandir($gallery->abspath);
+
+		$imagefiles = $_FILES['imagefiles'];
+
+		if (is_array($imagefiles)) {
+			foreach ($imagefiles['name'] as $key => $value) {
+
+				// look only for uploded files
+				if ($imagefiles['error'][$key] == 0) {
+
+					$temp_file = $imagefiles['tmp_name'][$key];
+
+					//clean filename and extract extension
+					$filepart = nggGallery::fileinfo( $imagefiles['name'][$key] );
+					$filename = $filepart['basename'];
+
+					// check for allowed extension and if it's an image file
+					$ext = array('jpg', 'png', 'gif');
+					if ( !in_array($filepart['extension'], $ext) || !@getimagesize($temp_file) ){
+						nggGallery::show_error('<strong>' . esc_html( $imagefiles['name'][$key] ) . ' </strong>' . __('is no valid image file!','nggallery'));
+						continue;
+					}
+
+					// check if this filename already exist in the folder
+					$i = 0;
+					while ( in_array( $filename, $dirlist ) ) {
+						$filename = $filepart['filename'] . '_' . $i++ . '.' .$filepart['extension'];
+					}
+
+					$dest_file = $gallery->abspath . '/' . $filename;
+
+					//check for folder permission
+					if ( !is_writeable($gallery->abspath) ) {
+						$message = sprintf(__('Unable to write to directory %s. Is this directory writable by the server?', 'nggallery'), esc_html($gallery->abspath) );
+						nggGallery::show_error($message);
+						return;
+					}
+
+					// save temp file to gallery
+					if ( !@move_uploaded_file($temp_file, $dest_file) ){
+						nggGallery::show_error(__('Error, the file could not be moved to : ','nggallery') . esc_html( $dest_file ) );
+						nggAdmin::check_safemode( $gallery->abspath );
+						continue;
+					}
+					if ( !nggAdmin::chmod($dest_file) ) {
+						nggGallery::show_error(__('Error, the file permissions could not be set','nggallery'));
+						continue;
+					}
+
+					// add to imagelist & dirlist
+					$imageslist[] = $filename;
+					$dirlist[] = $filename;
+
+				}
+			}
+		}
+
+		if (count($imageslist) > 0) {
+
+			// add images to database
+			$image_ids = nggAdmin::add_Images($galleryID, $imageslist);
+
+			//create thumbnails
+			nggAdmin::do_ajax_operation( 'create_thumbnail' , $image_ids, __('Create new thumbnails','nggallery') );
+
+			//add the preview image if needed
+			nggAdmin::set_gallery_preview ( $galleryID );
+
+			nggGallery::show_message( count($image_ids) . __(' Image(s) successfully added','nggallery'));
+		}
+
+		return;
+
+	}
+
+	/**
+	 * Upload function will be called via the Flash uploader
+	 *
+	 * @class nggAdmin
+	 * @param integer $galleryID
+	 * @return string $result
+	 */
+	static function swfupload_image($galleryID = 0) {
+
+		global $nggdb;
+
+		if ($galleryID == 0)
+			return __('No gallery selected !', 'nggallery');
+
+		// WPMU action
+		if (nggWPMU::check_quota())
+			return '0';
+
+		// Check the upload
+		if (!isset($_FILES['Filedata']) || !is_uploaded_file($_FILES['Filedata']['tmp_name']) || $_FILES['Filedata']['error'] != 0)
+			return __('Invalid upload. Error Code : ', 'nggallery') . $_FILES['Filedata']['error'];
+
+		// get the filename and extension
+		$temp_file = $_FILES['Filedata']['tmp_name'];
+
+		$filepart = nggGallery::fileinfo( $_FILES['Filedata']['name'] );
+		$filename = $filepart['basename'];
+
+		// check for allowed extension
+		$ext = apply_filters('ngg_allowed_file_types', array('jpeg', 'jpg', 'png', 'gif') );
+		if (!in_array( strtolower( $filepart['extension'] ), $ext))
+			return esc_html( $_FILES[$key]['name'] ) . __('is no valid image file!', 'nggallery');
+
+		// get the path to the gallery
+        $gallery = $nggdb->find_gallery( (int) $galleryID );
+		if ( empty($gallery->path) ){
+			@unlink($temp_file);
+			return __('Failure in database, no gallery path set !', 'nggallery');
+		}
+
+		// read list of images
+		$imageslist = nggAdmin::scandir( WINABSPATH . $gallery->path );
+
+		// check if this filename already exist
+		$i = 0;
+		while (in_array($filename, $imageslist)) {
+			$filename = $filepart['filename'] . '_' . $i++ . '.' . $filepart['extension'];
+		}
+
+		$dest_file = WINABSPATH . $gallery->path . '/' . $filename;
+
+		// save temp file to gallery
+		if ( !@move_uploaded_file($_FILES["Filedata"]['tmp_name'], $dest_file) ){
+			nggAdmin::check_safemode(WINABSPATH . $gallery->path);
+			return __('Error, the file could not be moved to : ','nggallery'). esc_html( $dest_file );
+		}
+
+		if ( !nggAdmin::chmod($dest_file) )
+			return __('Error, the file permissions could not be set','nggallery');
+
+		return '0';
+	}
+
+	/**
+	 * Set correct file permissions (taken from wp core)
+	 *
+	 * @class nggAdmin
+	 * @param string $filename
+	 * @return bool $result
+	 */
+	function chmod($filename = '') {
+
+		$stat = @ stat( dirname($filename) );
+		$perms = $stat['mode'] & 0000666; // Remove execute bits for files
+		if ( @chmod($filename, $perms) )
+			return true;
+
+		return false;
+	}
+
+	/**
+	 * Check UID in folder and Script
+	 * Read http://www.php.net/manual/en/features.safe-mode.php to understand safe_mode
+	 *
+	 * @class nggAdmin
+	 * @param string $foldername
+	 * @return bool $result
+	 */
+	function check_safemode($foldername) {
+
+		if ( SAFE_MODE ) {
+
+			$script_uid = ( ini_get('safe_mode_gid') ) ? getmygid() : getmyuid();
+			$folder_uid = fileowner($foldername);
+
+			if ($script_uid != $folder_uid) {
+				$message  = sprintf(__('SAFE MODE Restriction in effect! You need to create the folder <strong>%s</strong> manually','nggallery'), esc_html( $foldername ) );
+				$message .= '<br />' . sprintf(__('When safe_mode is on, PHP checks to see if the owner (%s) of the current script matches the owner (%s) of the file to be operated on by a file function or its directory','nggallery'), $script_uid, $folder_uid );
+				nggGallery::show_error($message);
+				return false;
+			}
+		}
+
+		return true;
+	}
+
+	/**
+	 * Capability check. Check is the ID fit's to the user_ID
+	 *
+	 * @class nggAdmin
+	 * @param int $check_ID is the user_id
+	 * @return bool $result
+	 */
+	function can_manage_this_gallery($check_ID) {
+
+		global $user_ID, $wp_roles;
+
+		if ( !current_user_can('NextGEN Manage others gallery') ) {
+			// get the current user ID
+			get_currentuserinfo();
+
+			if ( $user_ID != $check_ID)
+				return false;
+		}
+
+		return true;
+
+	}
+
+	/**
+	 * Move images from one folder to another
+	 *
+	 * @class nggAdmin
+	 * @param array|int $pic_ids ID's of the images
+	 * @param int $dest_gid destination gallery
+	 * @return void
+	 */
+	function move_images($pic_ids, $dest_gid) {
+
+		$errors = '';
+		$count = 0;
+
+		if ( !is_array($pic_ids) )
+			$pic_ids = array($pic_ids);
+
+		// Get destination gallery
+		$destination  = nggdb::find_gallery( $dest_gid );
+		$dest_abspath = WINABSPATH . $destination->path;
+
+		if ( $destination == null ) {
+			nggGallery::show_error(__('The destination gallery does not exist','nggallery'));
+			return;
+		}
+
+		// Check for folder permission
+		if ( !is_writeable( $dest_abspath ) ) {
+			$message = sprintf(__('Unable to write to directory %s. Is this directory writable by the server?', 'nggallery'), esc_html( $dest_abspath ) );
+			nggGallery::show_error($message);
+			return;
+		}
+
+		// Get pictures
+		$images = nggdb::find_images_in_list($pic_ids);
+
+		foreach ($images as $image) {
+
+			$i = 0;
+			$tmp_prefix = '';
+
+			$destination_file_name = $image->filename;
+			// check if the filename already exist, then we add a copy_ prefix
+			while (file_exists( $dest_abspath . '/' . $destination_file_name)) {
+				$tmp_prefix = 'copy_' . ($i++) . '_';
+				$destination_file_name = $tmp_prefix . $image->filename;
+			}
+
+			$destination_path = $dest_abspath . '/' . $destination_file_name;
+			$destination_thumbnail = $dest_abspath . '/thumbs/thumbs_' . $destination_file_name;
+
+			// Move files
+			if ( !@rename($image->imagePath, $destination_path) ) {
+				$errors .= sprintf(__('Failed to move image %1$s to %2$s','nggallery'),
+					'<strong>' . esc_html( $image->filename ) . '</strong>', esc_html( $destination_path ) ) . '<br />';
+				continue;
+			}
+
+            // Move backup file, if possible
+            @rename($image->imagePath . '_backup', $destination_path . '_backup');
+			// Move the thumbnail, if possible
+			@rename($image->thumbPath, $destination_thumbnail);
+
+			// Change the gallery id in the database , maybe the filename
+			if ( nggdb::update_image($image->pid, $dest_gid, $destination_file_name) )
+				$count++;
+
+		}
+
+		if ( $errors != '' )
+			nggGallery::show_error($errors);
+
+		$link = '<a href="' . admin_url() . 'admin.php?page=nggallery-manage-gallery&mode=edit&gid=' . $destination->gid . '" >' . esc_html( $destination->title ) . '</a>';
+		$messages  = sprintf(__('Moved %1$s picture(s) to gallery : %2$s .','nggallery'), $count, $link);
+		nggGallery::show_message($messages);
+
+		return;
+	}
+
+	/**
+	 * Copy images to another gallery
+	 *
+	 * @class nggAdmin
+	 * @param array|int $pic_ids ID's of the images
+	 * @param int $dest_gid destination gallery
+	 * @return void
+	 */
+	function copy_images($pic_ids, $dest_gid) {
+
+        require_once(NGGALLERY_ABSPATH . '/lib/meta.php');
+
+		$errors = $messages = '';
+
+		if (!is_array($pic_ids))
+			$pic_ids = array($pic_ids);
+
+		// Get destination gallery
+		$destination = nggdb::find_gallery( $dest_gid );
+		if ( $destination == null ) {
+			nggGallery::show_error(__('The destination gallery does not exist','nggallery'));
+			return;
+		}
+
+		// Check for folder permission
+		if (!is_writeable(WINABSPATH.$destination->path)) {
+			$message = sprintf(__('Unable to write to directory %s. Is this directory writable by the server?', 'nggallery'), esc_html( WINABSPATH.$destination->path) );
+			nggGallery::show_error($message);
+			return;
+		}
+
+		// Get pictures
+		$images = nggdb::find_images_in_list($pic_ids);
+		$destination_path = WINABSPATH . $destination->path;
+
+		foreach ($images as $image) {
+			// WPMU action
+			if ( nggWPMU::check_quota() )
+				return;
+
+			$i = 0;
+			$tmp_prefix = '';
+			$destination_file_name = $image->filename;
+			while (file_exists($destination_path . '/' . $destination_file_name)) {
+				$tmp_prefix = 'copy_' . ($i++) . '_';
+				$destination_file_name = $tmp_prefix . $image->filename;
+			}
+
+			$destination_file_path = $destination_path . '/' . $destination_file_name;
+			$destination_thumb_file_path = $destination_path . '/' . $image->thumbFolder . $image->thumbPrefix . $destination_file_name;
+
+			// Copy files
+			if ( !@copy($image->imagePath, $destination_file_path) ) {
+				$errors .= sprintf(__('Failed to copy image %1$s to %2$s','nggallery'),
+					esc_html( $image->filename ), esc_html( $destination_file_path) ) . '<br />';
+				continue;
+			}
+
+            // Copy backup file, if possible
+            @copy($image->imagePath . '_backup', $destination_file_path . '_backup');
+            // Copy the thumbnail if possible
+			@copy($image->thumbPath, $destination_thumb_file_path);
+
+			// Create new database entry for the image
+			$new_pid = nggdb::insert_image( $destination->gid, $destination_file_name, $image->alttext, $image->description, $image->exclude);
+
+			if (!isset($new_pid)) {
+				$errors .= sprintf(__('Failed to copy database row for picture %s','nggallery'), $image->pid) . '<br />';
+				continue;
+			}
+
+			// Copy tags
+			nggTags::copy_tags($image->pid, $new_pid);
+
+            // Copy meta information
+            $meta = new nggMeta($image->pid);
+            nggdb::update_image_meta( $new_pid, $meta->image->meta_data);
+
+			if ( $tmp_prefix != '' ) {
+				$messages .= sprintf(__('Image %1$s (%2$s) copied as image %3$s (%4$s) &raquo; The file already existed in the destination gallery.','nggallery'),
+					 $image->pid, esc_html($image->filename), $new_pid, esc_html($destination_file_name) ) . '<br />';
+			} else {
+				$messages .= sprintf(__('Image %1$s (%2$s) copied as image %3$s (%4$s)','nggallery'),
+					 $image->pid, esc_html($image->filename), $new_pid, esc_html($destination_file_name) ) . '<br />';
+			}
+
+		}
+
+		// Finish by showing errors or success
+		if ( $errors == '' ) {
+			$link = '<a href="' . admin_url() . 'admin.php?page=nggallery-manage-gallery&mode=edit&gid=' . $destination->gid . '" >' . esc_html($destination->title) . '</a>';
+			$messages .= '<hr />' . sprintf(__('Copied %1$s picture(s) to gallery: %2$s .','nggallery'), count($images), $link);
+		}
+
+		if ( $messages != '' )
+			nggGallery::show_message($messages);
+
+		if ( $errors != '' )
+			nggGallery::show_error($errors);
+
+		return;
+	}
+
+	/**
+	 * Initate the Ajax operation
+	 *
+	 * @class nggAdmin
+	 * @param string $operation name of the function which should be executed
+	 * @param array $image_array
+	 * @param string $title name of the operation
+	 * @return string the javascript output
+	 */
+	function do_ajax_operation( $operation, $image_array, $title = '' ) {
+
+		if ( !is_array($image_array) || empty($image_array) )
+			return;
+
+		$js_array  = implode('","', $image_array);
+
+		// send out some JavaScript, which initate the ajax operation
+		?>
+		<script type="text/javascript">
+
+			Images = new Array("<?php echo $js_array; ?>");
+
+			nggAjaxOptions = {
+				operation: "<?php echo $operation; ?>",
+				ids: Images,
+			  	header: "<?php echo $title; ?>",
+			  	maxStep: Images.length
+			};
+
+			jQuery(document).ready( function(){
+				nggProgressBar.init( nggAjaxOptions );
+				nggAjax.init( nggAjaxOptions );
+			} );
+		</script>
+
+		<?php
+	}
+
+	/**
+	 * nggAdmin::set_gallery_preview() - define a preview pic after the first upload, can be changed in the gallery settings
+	 *
+	 * @class nggAdmin
+	 * @param int $galleryID
+	 * @return void
+	 */
+	function set_gallery_preview( $galleryID ) {
+
+		global $wpdb;
+
+		$gallery = nggdb::find_gallery( $galleryID );
+
+		// in the case no preview image is setup, we do this now
+		if ($gallery->previewpic == 0) {
+			$firstImage = $wpdb->get_var("SELECT pid FROM $wpdb->nggpictures WHERE exclude != 1 AND galleryid = '$galleryID' ORDER by pid DESC limit 0,1");
+			if ($firstImage) {
+				$wpdb->query("UPDATE $wpdb->nggallery SET previewpic = '$firstImage' WHERE gid = '$galleryID'");
+				wp_cache_delete($galleryID, 'ngg_gallery');
+			}
+		}
+
+		return;
+	}
+
+	/**
+	 * Return a JSON coded array of Image ids for a requested gallery
+	 *
+	 * @class nggAdmin
+	 * @param int $galleryID
+	 * @return arry (JSON)
+	 */
+	function get_image_ids( $galleryID ) {
+
+		if ( !function_exists('json_encode') )
+			return(-2);
+
+		$gallery = nggdb::get_ids_from_gallery($galleryID, 'pid', 'ASC', false);
+
+		header('Content-Type: text/plain; charset=' . get_option('blog_charset'), true);
+		$output = json_encode($gallery);
+
+		return $output;
+	}
+
+	/**
+	 * Decode upload error to normal message
+	 *
+	 * @class nggAdmin
+	 * @access internal
+	 * @param int $code php upload error code
+	 * @return string message
+	 */
+
+	function decode_upload_error( $code ) {
+
+	        switch ($code) {
+	            case UPLOAD_ERR_INI_SIZE:
+	                $message = __ ( 'The uploaded file exceeds the upload_max_filesize directive in php.ini', 'nggallery' );
+	                break;
+	            case UPLOAD_ERR_FORM_SIZE:
+	                $message = __ ( 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form', 'nggallery' );
+	                break;
+	            case UPLOAD_ERR_PARTIAL:
+	                $message = __ ( 'The uploaded file was only partially uploaded', 'nggallery' );
+	                break;
+	            case UPLOAD_ERR_NO_FILE:
+	                $message = __ ( 'No file was uploaded', 'nggallery' );
+	                break;
+	            case UPLOAD_ERR_NO_TMP_DIR:
+	                $message = __ ( 'Missing a temporary folder', 'nggallery' );
+	                break;
+	            case UPLOAD_ERR_CANT_WRITE:
+	                $message = __ ( 'Failed to write file to disk', 'nggallery' );
+	                break;
+	            case UPLOAD_ERR_EXTENSION:
+	                $message = __ ( 'File upload stopped by extension', 'nggallery' );
+	                break;
+	            default:
+	                $message = __ ( 'Unknown upload error', 'nggallery' );
+	                break;
+	        }
+
+	        return $message;
+	}
+
+} // END class nggAdmin
+
+/**
+ * TODO: Cannot be member of a class ? Check PCLZIP later...
+ *
+ * @param mixed $p_event
+ * @param mixed $p_header
+ * @return
+ */
+function ngg_getOnlyImages($p_event, &$p_header)	{
+	return nggAdmin::getOnlyImages($p_event, $p_header);
+}
+
+/**
+ * Ensure after zip extraction that it could be only a image file
+ *
+ * @param mixed $p_event
+ * @param mixed $p_header
+ * @return 1
+ */
+function ngg_checkExtract($p_event, &$p_header)	{
+
+    // look for valid extraction
+    if ($p_header['status'] == 'ok') {
+        // check if it's any image file, delete all other files
+        if ( !@getimagesize ( $p_header['filename'] ))
+            unlink($p_header['filename']);
+    }
+
+    return 1;
+}
+
+// XXX temporary...used as a quick fix to refresh I_Settings_Manager when the nextgen option is updated manually in order to run Hooks etc.
+function ngg_refreshSavedSettings()
+{
+	if (class_exists('C_Component_Registry'))
+	{
+		$registry = C_Component_Registry::get_instance();
+		$settings = C_NextGen_Settings::get_instance();
+
+		if ($settings != null)
+		{
+			$width			= $settings->thumbwidth;
+			$height			= $settings->thumbheight;
+			$new_dimension	= "{$width}x{$height}";
+			$dimensions		= (array) $settings->thumbnail_dimensions;
+
+			if (!in_array($new_dimension, $dimensions)) {
+				$dimensions[]	= $new_dimension;
+				$settings->thumbnail_dimensions = $dimensions;
+				$settings->save();
+
+				return true;
+			}
+		}
+	}
+
+	return false;
+}
+?>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/facebook.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/facebook.png
new file mode 100644
index 0000000000000000000000000000000000000000..3e5dd39c36f9aeb71228b5cabc048883bf147658
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/facebook.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/googleplus.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/googleplus.png
new file mode 100644
index 0000000000000000000000000000000000000000..c42eab784578bf4e827722400f125760ebab527a
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/googleplus.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/icon-paypal.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/icon-paypal.gif
new file mode 100644
index 0000000000000000000000000000000000000000..a5470d2e6c21cb698acc5d6b8b80c59b6895e50e
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/icon-paypal.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/icon-rating.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/icon-rating.png
new file mode 100644
index 0000000000000000000000000000000000000000..eaa77e6b4aa72fefbeb22b410175864d8642cd80
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/icon-rating.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/icon-translate.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/icon-translate.png
new file mode 100644
index 0000000000000000000000000000000000000000..f8064599b1c09dccaf31beac8ec1cfafbe6bbe51
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/icon-translate.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/marker_bottom.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/marker_bottom.gif
new file mode 100644
index 0000000000000000000000000000000000000000..0a14a2bd3087bf76b5c4f6304c3c2db99a158861
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/marker_bottom.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/marker_middle.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/marker_middle.gif
new file mode 100644
index 0000000000000000000000000000000000000000..ea47c286fb5d35f06d2a5315b2c6941c918f1e3a
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/marker_middle.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/marker_top.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/marker_top.gif
new file mode 100644
index 0000000000000000000000000000000000000000..22760f2a505d95ca955e66a0c71c93d464883781
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/marker_top.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/menu-bits.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/menu-bits.gif
new file mode 100644
index 0000000000000000000000000000000000000000..9a10a9a168d6e17db802ded92ac0c3c990096a2d
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/menu-bits.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/nextgen.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/nextgen.png
new file mode 100644
index 0000000000000000000000000000000000000000..4e3f9ef42db4392ea9a12e4364c12093378b1214
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/nextgen.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/nextgen_16_color.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/nextgen_16_color.png
new file mode 100644
index 0000000000000000000000000000000000000000..acd45b8bcc4951519bf8b41a26fade87bcc417ce
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/nextgen_16_color.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/nextgen_16_grey.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/nextgen_16_grey.png
new file mode 100644
index 0000000000000000000000000000000000000000..7e8d9fa4b57a703878fc60398f35c602e5b387a8
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/nextgen_16_grey.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/nextgen_32_color.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/nextgen_32_color.png
new file mode 100644
index 0000000000000000000000000000000000000000..d9368695e3d1dfbd892904f3985c9f61f3a99b03
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/nextgen_32_color.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/nextgen_32_grey.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/nextgen_32_grey.png
new file mode 100644
index 0000000000000000000000000000000000000000..f22f3d87c0c56e78e68631cbf638b2954bb369b9
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/nextgen_32_grey.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/select.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/select.png
new file mode 100644
index 0000000000000000000000000000000000000000..21213bfd51b088497f3a9e423170cd65532d873d
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/select.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/twitter.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/twitter.png
new file mode 100644
index 0000000000000000000000000000000000000000..b7a687b9f2d60f0b2c2857f1aef7f3e7b1551ce7
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/images/twitter.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/index.html b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/install.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/install.php
new file mode 100644
index 0000000000000000000000000000000000000000..299285b0d93654c95f2de6dfef5d633e100a3677
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/install.php
@@ -0,0 +1,164 @@
+<?php
+if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
+
+/**
+ * creates all tables for the gallery
+ * called during register_activation hook
+ *
+ * @access internal
+ * @return void
+ */
+function nggallery_install () {
+
+   	global $wpdb , $wp_roles, $wp_version;
+
+	// Check for capability
+	if ( !current_user_can('activate_plugins') )
+		return;
+
+	// Set the capabilities for the administrator
+	$role = get_role('administrator');
+	// We need this role, no other chance
+	if ( empty($role) ) {
+		update_option( "ngg_init_check", __('Sorry, NextGEN Gallery works only with a role called administrator',"nggallery") );
+		return;
+	}
+
+	$role->add_cap('NextGEN Gallery overview');
+	$role->add_cap('NextGEN Use TinyMCE');
+	$role->add_cap('NextGEN Upload images');
+	$role->add_cap('NextGEN Manage gallery');
+	$role->add_cap('NextGEN Manage tags');
+	$role->add_cap('NextGEN Manage others gallery');
+	$role->add_cap('NextGEN Edit album');
+	$role->add_cap('NextGEN Change style');
+	$role->add_cap('NextGEN Change options');
+	$role->add_cap('NextGEN Attach Interface');
+
+	// upgrade function changed in WordPress 2.3
+	require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
+
+	// add charset & collate like wp core
+	$charset_collate = '';
+
+	if ( version_compare(mysql_get_server_info(), '4.1.0', '>=') ) {
+		if ( ! empty($wpdb->charset) )
+			$charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
+		if ( ! empty($wpdb->collate) )
+			$charset_collate .= " COLLATE $wpdb->collate";
+	}
+
+   	$nggpictures					= $wpdb->prefix . 'ngg_pictures';
+	$nggallery						= $wpdb->prefix . 'ngg_gallery';
+	$nggalbum						= $wpdb->prefix . 'ngg_album';
+
+	// Create pictures table
+	$sql = "CREATE TABLE " . $nggpictures . " (
+	pid BIGINT(20) NOT NULL AUTO_INCREMENT ,
+	image_slug VARCHAR(255) NOT NULL ,
+	post_id BIGINT(20) DEFAULT '0' NOT NULL ,
+	galleryid BIGINT(20) DEFAULT '0' NOT NULL ,
+	filename VARCHAR(255) NOT NULL ,
+	description MEDIUMTEXT NULL ,
+	alttext MEDIUMTEXT NULL ,
+	imagedate DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
+	exclude TINYINT NULL DEFAULT '0' ,
+	sortorder BIGINT(20) DEFAULT '0' NOT NULL ,
+	meta_data LONGTEXT,
+	PRIMARY KEY  (pid),
+	KEY post_id (post_id)
+	) $charset_collate;";
+	dbDelta($sql);
+
+	// Create gallery table
+	$sql = "CREATE TABLE " . $nggallery . " (
+	gid BIGINT(20) NOT NULL AUTO_INCREMENT ,
+	name VARCHAR(255) NOT NULL ,
+	slug VARCHAR(255) NOT NULL ,
+	path MEDIUMTEXT NULL ,
+	title MEDIUMTEXT NULL ,
+	galdesc MEDIUMTEXT NULL ,
+	pageid BIGINT(20) DEFAULT '0' NOT NULL ,
+	previewpic BIGINT(20) DEFAULT '0' NOT NULL ,
+	author BIGINT(20) DEFAULT '0' NOT NULL  ,
+	PRIMARY KEY  (gid)
+	) $charset_collate;";
+	dbDelta($sql);
+
+	// Create albums table
+	$sql = "CREATE TABLE " . $nggalbum . " (
+	id BIGINT(20) NOT NULL AUTO_INCREMENT ,
+	name VARCHAR(255) NOT NULL ,
+	slug VARCHAR(255) NOT NULL ,
+	previewpic BIGINT(20) DEFAULT '0' NOT NULL ,
+	albumdesc MEDIUMTEXT NULL ,
+	sortorder LONGTEXT NOT NULL,
+	pageid BIGINT(20) DEFAULT '0' NOT NULL,
+	PRIMARY KEY  (id)
+	) $charset_collate;";
+	dbDelta($sql);
+
+	// check one table again, to be sure
+	if( !$wpdb->get_var( "SHOW TABLES LIKE '$nggpictures'" ) ) {
+		update_option( "ngg_init_check", __('NextGEN Gallery : Tables could not created, please check your database settings',"nggallery") );
+		return;
+	}
+
+	$options = get_option('ngg_options');
+
+	// if all is passed , save the DBVERSION
+	add_option("ngg_db_version", NGG_DBVERSION);
+
+}
+
+/**
+ * Deregister a capability from all classic roles
+ *
+ * @access internal
+ * @param string $capability name of the capability which should be deregister
+ * @return void
+ */
+function ngg_remove_capability($capability){
+	// this function remove the $capability only from the classic roles
+	$check_order = array("subscriber", "contributor", "author", "editor", "administrator");
+
+	foreach ($check_order as $role) {
+
+		$role = get_role($role);
+		$role->remove_cap($capability) ;
+	}
+
+}
+
+/**
+ * Uninstall all settings and tables
+ * Called via Setup and register_unstall hook
+ *
+ * @access internal
+ * @return void
+ */
+function nggallery_uninstall() {
+	global $wpdb;
+	
+	// TODO don't remove data on uninstall
+	// first remove all tables
+#	$wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}ngg_pictures");
+#	$wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}ngg_gallery");
+#	$wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}ngg_album");
+
+	// then remove all options
+	delete_option( 'ngg_options' );
+	delete_option( 'ngg_db_version' );
+	delete_option( 'ngg_update_exists' );
+	delete_option( 'ngg_next_update' );
+
+	// now remove the capability
+	ngg_remove_capability("NextGEN Gallery overview");
+	ngg_remove_capability("NextGEN Use TinyMCE");
+	ngg_remove_capability("NextGEN Upload images");
+	ngg_remove_capability("NextGEN Manage gallery");
+	ngg_remove_capability("NextGEN Edit album");
+	ngg_remove_capability("NextGEN Change style");
+	ngg_remove_capability("NextGEN Change options");
+	ngg_remove_capability("NextGEN Attach Interface");
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/Jcrop/css/Jcrop.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/Jcrop/css/Jcrop.gif
new file mode 100644
index 0000000000000000000000000000000000000000..72ea7ccb5321d5384d70437cfaac73011237901e
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/Jcrop/css/Jcrop.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/Jcrop/css/jquery.Jcrop.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/Jcrop/css/jquery.Jcrop.css
new file mode 100644
index 0000000000000000000000000000000000000000..24925dc94dbd4fe9c02b9f14b7dcf3194b6db8f4
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/Jcrop/css/jquery.Jcrop.css
@@ -0,0 +1,35 @@
+/* Fixes issue here http://code.google.com/p/jcrop/issues/detail?id=1 */
+.jcrop-holder { text-align: left; }
+
+.jcrop-vline, .jcrop-hline
+{
+	font-size: 0;
+	position: absolute;
+	background: white url('Jcrop.gif') top left repeat;
+}
+.jcrop-vline { height: 100%; width: 1px !important; }
+.jcrop-hline { width: 100%; height: 1px !important; }
+.jcrop-handle {
+	font-size: 1px;
+	width: 7px !important;
+	height: 7px !important;
+	border: 1px #eee solid;
+	background-color: #333;
+	*width: 9px;
+	*height: 9px;
+}
+
+.jcrop-tracker { width: 100%; height: 100%; }
+
+.custom .jcrop-vline,
+.custom .jcrop-hline
+{
+	background: yellow;
+}
+.custom .jcrop-handle
+{
+	border-color: black;
+	background-color: #C7BB00;
+	-moz-border-radius: 3px;
+	-webkit-border-radius: 3px;
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/Jcrop/js/jquery.Jcrop.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/Jcrop/js/jquery.Jcrop.js
new file mode 100644
index 0000000000000000000000000000000000000000..ad261f97aecf7407bc4cca2b6aee92401eac3c91
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/Jcrop/js/jquery.Jcrop.js
@@ -0,0 +1,1197 @@
+/**
+ * jquery.Jcrop.js v0.9.8
+ * jQuery Image Cropping Plugin
+ * @author Kelly Hallman <khallman@gmail.com>
+ * Copyright (c) 2008-2009 Kelly Hallman - released under MIT License {{{
+ *
+ * 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 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.
+
+ * }}}
+ */
+
+(function($) {
+
+$.Jcrop = function(obj,opt)
+{
+	// Initialization {{{
+
+	// Sanitize some options {{{
+	var obj = obj, opt = opt;
+
+	if (typeof(obj) !== 'object') obj = $(obj)[0];
+	if (typeof(opt) !== 'object') opt = { };
+
+	// Some on-the-fly fixes for MSIE...sigh
+	if (!('trackDocument' in opt))
+	{
+		opt.trackDocument = $.browser.msie ? false : true;
+		if ($.browser.msie && $.browser.version.split('.')[0] == '8')
+			opt.trackDocument = true;
+	}
+
+	if (!('keySupport' in opt))
+			opt.keySupport = $.browser.msie ? false : true;
+		
+	// }}}
+	// Extend the default options {{{
+	var defaults = {
+
+		// Basic Settings
+		trackDocument:		false,
+		baseClass:			'jcrop',
+		addClass:			null,
+
+		// Styling Options
+		bgColor:			'black',
+		bgOpacity:			.6,
+		borderOpacity:		.4,
+		handleOpacity:		.5,
+
+		handlePad:			5,
+		handleSize:			9,
+		handleOffset:		5,
+		edgeMargin:			14,
+
+		aspectRatio:		0,
+		keySupport:			true,
+		cornerHandles:		true,
+		sideHandles:		true,
+		drawBorders:		true,
+		dragEdges:			true,
+
+		boxWidth:			0,
+		boxHeight:			0,
+
+		boundary:			8,
+		animationDelay:		20,
+		swingSpeed:			3,
+
+		allowSelect:		true,
+		allowMove:			true,
+		allowResize:		true,
+
+		minSelect:			[ 0, 0 ],
+		maxSize:			[ 0, 0 ],
+		minSize:			[ 0, 0 ],
+
+		// Callbacks / Event Handlers
+		onChange: function() { },
+		onSelect: function() { }
+
+	};
+	var options = defaults;
+	setOptions(opt);
+
+	// }}}
+	// Initialize some jQuery objects {{{
+
+	var $origimg = $(obj);
+	var $img = $origimg.clone().removeAttr('id').css({ position: 'absolute' });
+
+	$img.width($origimg.width());
+	$img.height($origimg.height());
+	$origimg.after($img).hide();
+
+	presize($img,options.boxWidth,options.boxHeight);
+
+	var boundx = $img.width(),
+		boundy = $img.height(),
+
+		$div = $('<div />')
+			.width(boundx).height(boundy)
+			.addClass(cssClass('holder'))
+			.css({
+				position: 'relative',
+				backgroundColor: options.bgColor
+			}).insertAfter($origimg).append($img);
+	;
+	
+	if (options.addClass) $div.addClass(options.addClass);
+	//$img.wrap($div);
+
+	var $img2 = $('<img />')/*{{{*/
+			.attr('src',$img.attr('src'))
+			.css('position','absolute')
+			.width(boundx).height(boundy)
+	;/*}}}*/
+	var $img_holder = $('<div />')/*{{{*/
+		.width(pct(100)).height(pct(100))
+		.css({
+			zIndex: 310,
+			position: 'absolute',
+			overflow: 'hidden'
+		})
+		.append($img2)
+	;/*}}}*/
+	var $hdl_holder = $('<div />')/*{{{*/
+		.width(pct(100)).height(pct(100))
+		.css('zIndex',320);
+	/*}}}*/
+	var $sel = $('<div />')/*{{{*/
+		.css({
+			position: 'absolute',
+			zIndex: 300
+		})
+		.insertBefore($img)
+		.append($img_holder,$hdl_holder)
+	;/*}}}*/
+
+	var bound = options.boundary;
+	var $trk = newTracker().width(boundx+(bound*2)).height(boundy+(bound*2))
+		.css({ position: 'absolute', top: px(-bound), left: px(-bound), zIndex: 290 })
+		.mousedown(newSelection);	
+	
+	/* }}} */
+	// Set more variables {{{
+
+	var xlimit, ylimit, xmin, ymin;
+	var xscale, yscale, enabled = true;
+	var docOffset = getPos($img),
+		// Internal states
+		btndown, lastcurs, dimmed, animating,
+		shift_down;
+
+	// }}}
+		
+
+		// }}}
+	// Internal Modules {{{
+
+	var Coords = function()/*{{{*/
+	{
+		var x1 = 0, y1 = 0, x2 = 0, y2 = 0, ox, oy;
+
+		function setPressed(pos)/*{{{*/
+		{
+			var pos = rebound(pos);
+			x2 = x1 = pos[0];
+			y2 = y1 = pos[1];
+		};
+		/*}}}*/
+		function setCurrent(pos)/*{{{*/
+		{
+			var pos = rebound(pos);
+			ox = pos[0] - x2;
+			oy = pos[1] - y2;
+			x2 = pos[0];
+			y2 = pos[1];
+		};
+		/*}}}*/
+		function getOffset()/*{{{*/
+		{
+			return [ ox, oy ];
+		};
+		/*}}}*/
+		function moveOffset(offset)/*{{{*/
+		{
+			var ox = offset[0], oy = offset[1];
+
+			if (0 > x1 + ox) ox -= ox + x1;
+			if (0 > y1 + oy) oy -= oy + y1;
+
+			if (boundy < y2 + oy) oy += boundy - (y2 + oy);
+			if (boundx < x2 + ox) ox += boundx - (x2 + ox);
+
+			x1 += ox;
+			x2 += ox;
+			y1 += oy;
+			y2 += oy;
+		};
+		/*}}}*/
+		function getCorner(ord)/*{{{*/
+		{
+			var c = getFixed();
+			switch(ord)
+			{
+				case 'ne': return [ c.x2, c.y ];
+				case 'nw': return [ c.x, c.y ];
+				case 'se': return [ c.x2, c.y2 ];
+				case 'sw': return [ c.x, c.y2 ];
+			}
+		};
+		/*}}}*/
+		function getFixed()/*{{{*/
+		{
+			if (!options.aspectRatio) return getRect();
+			// This function could use some optimization I think...
+			var aspect = options.aspectRatio,
+				min_x = options.minSize[0]/xscale, 
+				min_y = options.minSize[1]/yscale,
+				max_x = options.maxSize[0]/xscale, 
+				max_y = options.maxSize[1]/yscale,
+				rw = x2 - x1,
+				rh = y2 - y1,
+				rwa = Math.abs(rw),
+				rha = Math.abs(rh),
+				real_ratio = rwa / rha,
+				xx, yy
+			;
+			if (max_x == 0) { max_x = boundx * 10 }
+			if (max_y == 0) { max_y = boundy * 10 }
+			if (real_ratio < aspect)
+			{
+				yy = y2;
+				w = rha * aspect;
+				xx = rw < 0 ? x1 - w : w + x1;
+
+				if (xx < 0)
+				{
+					xx = 0;
+					h = Math.abs((xx - x1) / aspect);
+					yy = rh < 0 ? y1 - h: h + y1;
+				}
+				else if (xx > boundx)
+				{
+					xx = boundx;
+					h = Math.abs((xx - x1) / aspect);
+					yy = rh < 0 ? y1 - h : h + y1;
+				}
+			}
+			else
+			{
+				xx = x2;
+				h = rwa / aspect;
+				yy = rh < 0 ? y1 - h : y1 + h;
+				if (yy < 0)
+				{
+					yy = 0;
+					w = Math.abs((yy - y1) * aspect);
+					xx = rw < 0 ? x1 - w : w + x1;
+				}
+				else if (yy > boundy)
+				{
+					yy = boundy;
+					w = Math.abs(yy - y1) * aspect;
+					xx = rw < 0 ? x1 - w : w + x1;
+				}
+			}
+
+			// Magic %-)
+			if(xx > x1) { // right side
+			  if(xx - x1 < min_x) {
+				xx = x1 + min_x;
+			  } else if (xx - x1 > max_x) {
+				xx = x1 + max_x;
+			  }
+			  if(yy > y1) {
+				yy = y1 + (xx - x1)/aspect;
+			  } else {
+				yy = y1 - (xx - x1)/aspect;
+			  }
+			} else if (xx < x1) { // left side
+			  if(x1 - xx < min_x) {
+				xx = x1 - min_x
+			  } else if (x1 - xx > max_x) {
+				xx = x1 - max_x;
+			  }
+			  if(yy > y1) {
+				yy = y1 + (x1 - xx)/aspect;
+			  } else {
+				yy = y1 - (x1 - xx)/aspect;
+			  }
+			}
+
+			if(xx < 0) {
+				x1 -= xx;
+				xx = 0;
+			} else  if (xx > boundx) {
+				x1 -= xx - boundx;
+				xx = boundx;
+			}
+
+			if(yy < 0) {
+				y1 -= yy;
+				yy = 0;
+			} else  if (yy > boundy) {
+				y1 -= yy - boundy;
+				yy = boundy;
+			}
+
+			return last = makeObj(flipCoords(x1,y1,xx,yy));
+		};
+		/*}}}*/
+		function rebound(p)/*{{{*/
+		{
+			if (p[0] < 0) p[0] = 0;
+			if (p[1] < 0) p[1] = 0;
+
+			if (p[0] > boundx) p[0] = boundx;
+			if (p[1] > boundy) p[1] = boundy;
+
+			return [ p[0], p[1] ];
+		};
+		/*}}}*/
+		function flipCoords(x1,y1,x2,y2)/*{{{*/
+		{
+			var xa = x1, xb = x2, ya = y1, yb = y2;
+			if (x2 < x1)
+			{
+				xa = x2;
+				xb = x1;
+			}
+			if (y2 < y1)
+			{
+				ya = y2;
+				yb = y1;
+			}
+			return [ Math.round(xa), Math.round(ya), Math.round(xb), Math.round(yb) ];
+		};
+		/*}}}*/
+		function getRect()/*{{{*/
+		{
+			var xsize = x2 - x1;
+			var ysize = y2 - y1;
+
+			if (xlimit && (Math.abs(xsize) > xlimit))
+				x2 = (xsize > 0) ? (x1 + xlimit) : (x1 - xlimit);
+			if (ylimit && (Math.abs(ysize) > ylimit))
+				y2 = (ysize > 0) ? (y1 + ylimit) : (y1 - ylimit);
+
+			if (ymin && (Math.abs(ysize) < ymin))
+				y2 = (ysize > 0) ? (y1 + ymin) : (y1 - ymin);
+			if (xmin && (Math.abs(xsize) < xmin))
+				x2 = (xsize > 0) ? (x1 + xmin) : (x1 - xmin);
+
+			if (x1 < 0) { x2 -= x1; x1 -= x1; }
+			if (y1 < 0) { y2 -= y1; y1 -= y1; }
+			if (x2 < 0) { x1 -= x2; x2 -= x2; }
+			if (y2 < 0) { y1 -= y2; y2 -= y2; }
+			if (x2 > boundx) { var delta = x2 - boundx; x1 -= delta; x2 -= delta; }
+			if (y2 > boundy) { var delta = y2 - boundy; y1 -= delta; y2 -= delta; }
+			if (x1 > boundx) { var delta = x1 - boundy; y2 -= delta; y1 -= delta; }
+			if (y1 > boundy) { var delta = y1 - boundy; y2 -= delta; y1 -= delta; }
+
+			return makeObj(flipCoords(x1,y1,x2,y2));
+		};
+		/*}}}*/
+		function makeObj(a)/*{{{*/
+		{
+			return { x: a[0], y: a[1], x2: a[2], y2: a[3],
+				w: a[2] - a[0], h: a[3] - a[1] };
+		};
+		/*}}}*/
+
+		return {
+			flipCoords: flipCoords,
+			setPressed: setPressed,
+			setCurrent: setCurrent,
+			getOffset: getOffset,
+			moveOffset: moveOffset,
+			getCorner: getCorner,
+			getFixed: getFixed
+		};
+	}();
+
+	/*}}}*/
+	var Selection = function()/*{{{*/
+	{
+		var start, end, dragmode, awake, hdep = 370;
+		var borders = { };
+		var handle = { };
+		var seehandles = false;
+		var hhs = options.handleOffset;
+
+		/* Insert draggable elements {{{*/
+
+		// Insert border divs for outline
+		if (options.drawBorders) {
+			borders = {
+					top: insertBorder('hline')
+						.css('top',$.browser.msie?px(-1):px(0)),
+					bottom: insertBorder('hline'),
+					left: insertBorder('vline'),
+					right: insertBorder('vline')
+			};
+		}
+
+		// Insert handles on edges
+		if (options.dragEdges) {
+			handle.t = insertDragbar('n');
+			handle.b = insertDragbar('s');
+			handle.r = insertDragbar('e');
+			handle.l = insertDragbar('w');
+		}
+
+		// Insert side handles
+		options.sideHandles &&
+			createHandles(['n','s','e','w']);
+
+		// Insert corner handles
+		options.cornerHandles &&
+			createHandles(['sw','nw','ne','se']);
+
+		/*}}}*/
+		// Private Methods
+		function insertBorder(type)/*{{{*/
+		{
+			var jq = $('<div />')
+				.css({position: 'absolute', opacity: options.borderOpacity })
+				.addClass(cssClass(type));
+			$img_holder.append(jq);
+			return jq;
+		};
+		/*}}}*/
+		function dragDiv(ord,zi)/*{{{*/
+		{
+			var jq = $('<div />')
+				.mousedown(createDragger(ord))
+				.css({
+					cursor: ord+'-resize',
+					position: 'absolute',
+					zIndex: zi 
+				})
+			;
+			$hdl_holder.append(jq);
+			return jq;
+		};
+		/*}}}*/
+		function insertHandle(ord)/*{{{*/
+		{
+			return dragDiv(ord,hdep++)
+				.css({ top: px(-hhs+1), left: px(-hhs+1), opacity: options.handleOpacity })
+				.addClass(cssClass('handle'));
+		};
+		/*}}}*/
+		function insertDragbar(ord)/*{{{*/
+		{
+			var s = options.handleSize,
+				o = hhs,
+				h = s, w = s,
+				t = o, l = o;
+
+			switch(ord)
+			{
+				case 'n': case 's': w = pct(100); break;
+				case 'e': case 'w': h = pct(100); break;
+			}
+
+			return dragDiv(ord,hdep++).width(w).height(h)
+				.css({ top: px(-t+1), left: px(-l+1)});
+		};
+		/*}}}*/
+		function createHandles(li)/*{{{*/
+		{
+			for(i in li) handle[li[i]] = insertHandle(li[i]);
+		};
+		/*}}}*/
+		function moveHandles(c)/*{{{*/
+		{
+			var midvert  = Math.round((c.h / 2) - hhs),
+				midhoriz = Math.round((c.w / 2) - hhs),
+				north = west = -hhs+1,
+				east = c.w - hhs,
+				south = c.h - hhs,
+				x, y;
+
+			'e' in handle &&
+				handle.e.css({ top: px(midvert), left: px(east) }) &&
+				handle.w.css({ top: px(midvert) }) &&
+				handle.s.css({ top: px(south), left: px(midhoriz) }) &&
+				handle.n.css({ left: px(midhoriz) });
+
+			'ne' in handle &&
+				handle.ne.css({ left: px(east) }) &&
+				handle.se.css({ top: px(south), left: px(east) }) &&
+				handle.sw.css({ top: px(south) });
+
+			'b' in handle &&
+				handle.b.css({ top: px(south) }) &&
+				handle.r.css({ left: px(east) });
+		};
+		/*}}}*/
+		function moveto(x,y)/*{{{*/
+		{
+			$img2.css({ top: px(-y), left: px(-x) });
+			$sel.css({ top: px(y), left: px(x) });
+		};
+		/*}}}*/
+		function resize(w,h)/*{{{*/
+		{
+			$sel.width(w).height(h);
+		};
+		/*}}}*/
+		function refresh()/*{{{*/
+		{
+			var c = Coords.getFixed();
+
+			Coords.setPressed([c.x,c.y]);
+			Coords.setCurrent([c.x2,c.y2]);
+
+			updateVisible();
+		};
+		/*}}}*/
+
+		// Internal Methods
+		function updateVisible()/*{{{*/
+			{ if (awake) return update(); };
+		/*}}}*/
+		function update()/*{{{*/
+		{
+			var c = Coords.getFixed();
+
+			resize(c.w,c.h);
+			moveto(c.x,c.y);
+
+			options.drawBorders &&
+				borders['right'].css({ left: px(c.w-1) }) &&
+					borders['bottom'].css({ top: px(c.h-1) });
+
+			seehandles && moveHandles(c);
+			awake || show();
+
+			options.onChange(unscale(c));
+		};
+		/*}}}*/
+		function show()/*{{{*/
+		{
+			$sel.show();
+			$img.css('opacity',options.bgOpacity);
+			awake = true;
+		};
+		/*}}}*/
+		function release()/*{{{*/
+		{
+			disableHandles();
+			$sel.hide();
+			$img.css('opacity',1);
+			awake = false;
+		};
+		/*}}}*/
+		function showHandles()//{{{
+		{
+			if (seehandles)
+			{
+				moveHandles(Coords.getFixed());
+				$hdl_holder.show();
+			}
+		};
+		//}}}
+		function enableHandles()/*{{{*/
+		{ 
+			seehandles = true;
+			if (options.allowResize)
+			{
+				moveHandles(Coords.getFixed());
+				$hdl_holder.show();
+				return true;
+			}
+		};
+		/*}}}*/
+		function disableHandles()/*{{{*/
+		{
+			seehandles = false;
+			$hdl_holder.hide();
+		};
+		/*}}}*/
+		function animMode(v)/*{{{*/
+		{
+			(animating = v) ? disableHandles(): enableHandles();
+		};
+		/*}}}*/
+		function done()/*{{{*/
+		{
+			animMode(false);
+			refresh();
+		};
+		/*}}}*/
+
+		var $track = newTracker().mousedown(createDragger('move'))
+				.css({ cursor: 'move', position: 'absolute', zIndex: 360 })
+
+		$img_holder.append($track);
+		disableHandles();
+
+		return {
+			updateVisible: updateVisible,
+			update: update,
+			release: release,
+			refresh: refresh,
+			setCursor: function (cursor) { $track.css('cursor',cursor); },
+			enableHandles: enableHandles,
+			enableOnly: function() { seehandles = true; },
+			showHandles: showHandles,
+			disableHandles: disableHandles,
+			animMode: animMode,
+			done: done
+		};
+	}();
+	/*}}}*/
+	var Tracker = function()/*{{{*/
+	{
+		var onMove		= function() { },
+			onDone		= function() { },
+			trackDoc	= options.trackDocument;
+
+		if (!trackDoc)
+		{
+			$trk
+				.mousemove(trackMove)
+				.mouseup(trackUp)
+				.mouseout(trackUp)
+			;
+		}
+
+		function toFront()/*{{{*/
+		{
+			$trk.css({zIndex:450});
+			if (trackDoc)
+			{
+				$(document)
+					.mousemove(trackMove)
+					.mouseup(trackUp)
+				;
+			}
+		}
+		/*}}}*/
+		function toBack()/*{{{*/
+		{
+			$trk.css({zIndex:290});
+			if (trackDoc)
+			{
+				$(document)
+					.unbind('mousemove',trackMove)
+					.unbind('mouseup',trackUp)
+				;
+			}
+		}
+		/*}}}*/
+		function trackMove(e)/*{{{*/
+		{
+			onMove(mouseAbs(e));
+		};
+		/*}}}*/
+		function trackUp(e)/*{{{*/
+		{
+			e.preventDefault();
+			e.stopPropagation();
+
+			if (btndown)
+			{
+				btndown = false;
+
+				onDone(mouseAbs(e));
+				options.onSelect(unscale(Coords.getFixed()));
+				toBack();
+				onMove = function() { };
+				onDone = function() { };
+			}
+
+			return false;
+		};
+		/*}}}*/
+
+		function activateHandlers(move,done)/* {{{ */
+		{
+			btndown = true;
+			onMove = move;
+			onDone = done;
+			toFront();
+			return false;
+		};
+		/* }}} */
+
+		function setCursor(t) { $trk.css('cursor',t); };
+
+		$img.before($trk);
+		return {
+			activateHandlers: activateHandlers,
+			setCursor: setCursor
+		};
+	}();
+	/*}}}*/
+	var KeyManager = function()/*{{{*/
+	{
+		var $keymgr = $('<input type="radio" />')
+				.css({ position: 'absolute', left: '-30px' })
+				.keypress(parseKey)
+				.blur(onBlur),
+
+			$keywrap = $('<div />')
+				.css({
+					position: 'absolute',
+					overflow: 'hidden'
+				})
+				.append($keymgr)
+		;
+
+		function watchKeys()/*{{{*/
+		{
+			if (options.keySupport)
+			{
+				$keymgr.show();
+				$keymgr.focus();
+			}
+		};
+		/*}}}*/
+		function onBlur(e)/*{{{*/
+		{
+			$keymgr.hide();
+		};
+		/*}}}*/
+		function doNudge(e,x,y)/*{{{*/
+		{
+			if (options.allowMove) {
+				Coords.moveOffset([x,y]);
+				Selection.updateVisible();
+			};
+			e.preventDefault();
+			e.stopPropagation();
+		};
+		/*}}}*/
+		function parseKey(e)/*{{{*/
+		{
+			if (e.ctrlKey) return true;
+			shift_down = e.shiftKey ? true : false;
+			var nudge = shift_down ? 10 : 1;
+			switch(e.keyCode)
+			{
+				case 37: doNudge(e,-nudge,0); break;
+				case 39: doNudge(e,nudge,0); break;
+				case 38: doNudge(e,0,-nudge); break;
+				case 40: doNudge(e,0,nudge); break;
+
+				case 27: Selection.release(); break;
+
+				case 9: return true;
+			}
+
+			return nothing(e);
+		};
+		/*}}}*/
+		
+		if (options.keySupport) $keywrap.insertBefore($img);
+		return {
+			watchKeys: watchKeys
+		};
+	}();
+	/*}}}*/
+
+	// }}}
+	// Internal Methods {{{
+
+	function px(n) { return '' + parseInt(n) + 'px'; };
+	function pct(n) { return '' + parseInt(n) + '%'; };
+	function cssClass(cl) { return options.baseClass + '-' + cl; };
+	function getPos(obj)/*{{{*/
+	{
+		// Updated in v0.9.4 to use built-in dimensions plugin
+		var pos = $(obj).offset();
+		return [ pos.left, pos.top ];
+	};
+	/*}}}*/
+	function mouseAbs(e)/*{{{*/
+	{
+		return [ (e.pageX - docOffset[0]), (e.pageY - docOffset[1]) ];
+	};
+	/*}}}*/
+	function myCursor(type)/*{{{*/
+	{
+		if (type != lastcurs)
+		{
+			Tracker.setCursor(type);
+			//Handles.xsetCursor(type);
+			lastcurs = type;
+		}
+	};
+	/*}}}*/
+	function startDragMode(mode,pos)/*{{{*/
+	{
+		docOffset = getPos($img);
+		Tracker.setCursor(mode=='move'?mode:mode+'-resize');
+
+		if (mode == 'move')
+			return Tracker.activateHandlers(createMover(pos), doneSelect);
+
+		var fc = Coords.getFixed();
+		var opp = oppLockCorner(mode);
+		var opc = Coords.getCorner(oppLockCorner(opp));
+
+		Coords.setPressed(Coords.getCorner(opp));
+		Coords.setCurrent(opc);
+
+		Tracker.activateHandlers(dragmodeHandler(mode,fc),doneSelect);
+	};
+	/*}}}*/
+	function dragmodeHandler(mode,f)/*{{{*/
+	{
+		return function(pos) {
+			if (!options.aspectRatio) switch(mode)
+			{
+				case 'e': pos[1] = f.y2; break;
+				case 'w': pos[1] = f.y2; break;
+				case 'n': pos[0] = f.x2; break;
+				case 's': pos[0] = f.x2; break;
+			}
+			else switch(mode)
+			{
+				case 'e': pos[1] = f.y+1; break;
+				case 'w': pos[1] = f.y+1; break;
+				case 'n': pos[0] = f.x+1; break;
+				case 's': pos[0] = f.x+1; break;
+			}
+			Coords.setCurrent(pos);
+			Selection.update();
+		};
+	};
+	/*}}}*/
+	function createMover(pos)/*{{{*/
+	{
+		var lloc = pos;
+		KeyManager.watchKeys();
+
+		return function(pos)
+		{
+			Coords.moveOffset([pos[0] - lloc[0], pos[1] - lloc[1]]);
+			lloc = pos;
+			
+			Selection.update();
+		};
+	};
+	/*}}}*/
+	function oppLockCorner(ord)/*{{{*/
+	{
+		switch(ord)
+		{
+			case 'n': return 'sw';
+			case 's': return 'nw';
+			case 'e': return 'nw';
+			case 'w': return 'ne';
+			case 'ne': return 'sw';
+			case 'nw': return 'se';
+			case 'se': return 'nw';
+			case 'sw': return 'ne';
+		};
+	};
+	/*}}}*/
+	function createDragger(ord)/*{{{*/
+	{
+		return function(e) {
+			if (options.disabled) return false;
+			if ((ord == 'move') && !options.allowMove) return false;
+			btndown = true;
+			startDragMode(ord,mouseAbs(e));
+			e.stopPropagation();
+			e.preventDefault();
+			return false;
+		};
+	};
+	/*}}}*/
+	function presize($obj,w,h)/*{{{*/
+	{
+		var nw = $obj.width(), nh = $obj.height();
+		if ((nw > w) && w > 0)
+		{
+			nw = w;
+			nh = (w/$obj.width()) * $obj.height();
+		}
+		if ((nh > h) && h > 0)
+		{
+			nh = h;
+			nw = (h/$obj.height()) * $obj.width();
+		}
+		xscale = $obj.width() / nw;
+		yscale = $obj.height() / nh;
+		$obj.width(nw).height(nh);
+	};
+	/*}}}*/
+	function unscale(c)/*{{{*/
+	{
+		return {
+			x: parseInt(c.x * xscale), y: parseInt(c.y * yscale), 
+			x2: parseInt(c.x2 * xscale), y2: parseInt(c.y2 * yscale), 
+			w: parseInt(c.w * xscale), h: parseInt(c.h * yscale)
+		};
+	};
+	/*}}}*/
+	function doneSelect(pos)/*{{{*/
+	{
+		var c = Coords.getFixed();
+		if (c.w > options.minSelect[0] && c.h > options.minSelect[1])
+		{
+			Selection.enableHandles();
+			Selection.done();
+		}
+		else
+		{
+			Selection.release();
+		}
+		Tracker.setCursor( options.allowSelect?'crosshair':'default' );
+	};
+	/*}}}*/
+	function newSelection(e)/*{{{*/
+	{
+		if (options.disabled) return false;
+		if (!options.allowSelect) return false;
+		btndown = true;
+		docOffset = getPos($img);
+		Selection.disableHandles();
+		myCursor('crosshair');
+		var pos = mouseAbs(e);
+		Coords.setPressed(pos);
+		Tracker.activateHandlers(selectDrag,doneSelect);
+		KeyManager.watchKeys();
+		Selection.update();
+
+		e.stopPropagation();
+		e.preventDefault();
+		return false;
+	};
+	/*}}}*/
+	function selectDrag(pos)/*{{{*/
+	{
+		Coords.setCurrent(pos);
+		Selection.update();
+	};
+	/*}}}*/
+	function newTracker()
+	{
+		var trk = $('<div></div>').addClass(cssClass('tracker'));
+		$.browser.msie && trk.css({ opacity: 0, backgroundColor: 'white' });
+		return trk;
+	};
+
+	// }}}
+	// API methods {{{
+		
+	function animateTo(a)/*{{{*/
+	{
+		var x1 = a[0] / xscale,
+			y1 = a[1] / yscale,
+			x2 = a[2] / xscale,
+			y2 = a[3] / yscale;
+
+		if (animating) return;
+
+		var animto = Coords.flipCoords(x1,y1,x2,y2);
+		var c = Coords.getFixed();
+		var animat = initcr = [ c.x, c.y, c.x2, c.y2 ];
+		var interv = options.animationDelay;
+
+		var x = animat[0];
+		var y = animat[1];
+		var x2 = animat[2];
+		var y2 = animat[3];
+		var ix1 = animto[0] - initcr[0];
+		var iy1 = animto[1] - initcr[1];
+		var ix2 = animto[2] - initcr[2];
+		var iy2 = animto[3] - initcr[3];
+		var pcent = 0;
+		var velocity = options.swingSpeed;
+
+		Selection.animMode(true);
+
+		var animator = function()
+		{
+			return function()
+			{
+				pcent += (100 - pcent) / velocity;
+
+				animat[0] = x + ((pcent / 100) * ix1);
+				animat[1] = y + ((pcent / 100) * iy1);
+				animat[2] = x2 + ((pcent / 100) * ix2);
+				animat[3] = y2 + ((pcent / 100) * iy2);
+
+				if (pcent < 100) animateStart();
+					else Selection.done();
+
+				if (pcent >= 99.8) pcent = 100;
+
+				setSelectRaw(animat);
+			};
+		}();
+
+		function animateStart()
+			{ window.setTimeout(animator,interv); };
+
+		animateStart();
+	};
+	/*}}}*/
+	function setSelect(rect)//{{{
+	{
+		setSelectRaw([rect[0]/xscale,rect[1]/yscale,rect[2]/xscale,rect[3]/yscale]);
+	};
+	//}}}
+	function setSelectRaw(l) /*{{{*/
+	{
+		Coords.setPressed([l[0],l[1]]);
+		Coords.setCurrent([l[2],l[3]]);
+		Selection.update();
+	};
+	/*}}}*/
+	function setOptions(opt)/*{{{*/
+	{
+		if (typeof(opt) != 'object') opt = { };
+		options = $.extend(options,opt);
+
+		if (typeof(options.onChange)!=='function')
+			options.onChange = function() { };
+
+		if (typeof(options.onSelect)!=='function')
+			options.onSelect = function() { };
+
+	};
+	/*}}}*/
+	function tellSelect()/*{{{*/
+	{
+		return unscale(Coords.getFixed());
+	};
+	/*}}}*/
+	function tellScaled()/*{{{*/
+	{
+		return Coords.getFixed();
+	};
+	/*}}}*/
+	function setOptionsNew(opt)/*{{{*/
+	{
+		setOptions(opt);
+		interfaceUpdate();
+	};
+	/*}}}*/
+	function disableCrop()//{{{
+	{
+		options.disabled = true;
+		Selection.disableHandles();
+		Selection.setCursor('default');
+		Tracker.setCursor('default');
+	};
+	//}}}
+	function enableCrop()//{{{
+	{
+		options.disabled = false;
+		interfaceUpdate();
+	};
+	//}}}
+	function cancelCrop()//{{{
+	{
+		Selection.done();
+		Tracker.activateHandlers(null,null);
+	};
+	//}}}
+	function destroy()//{{{
+	{
+		$div.remove();
+		$origimg.show();
+	};
+	//}}}
+
+	function interfaceUpdate(alt)//{{{
+	// This method tweaks the interface based on options object.
+	// Called when options are changed and at end of initialization.
+	{
+		options.allowResize ?
+			alt?Selection.enableOnly():Selection.enableHandles():
+			Selection.disableHandles();
+
+		Tracker.setCursor( options.allowSelect? 'crosshair': 'default' );
+		Selection.setCursor( options.allowMove? 'move': 'default' );
+
+		$div.css('backgroundColor',options.bgColor);
+
+		if ('setSelect' in options) {
+			setSelect(opt.setSelect);
+			Selection.done();
+			delete(options.setSelect);
+		}
+
+		if ('trueSize' in options) {
+			xscale = options.trueSize[0] / boundx;
+			yscale = options.trueSize[1] / boundy;
+		}
+
+		xlimit = options.maxSize[0] || 0;
+		ylimit = options.maxSize[1] || 0;
+		xmin = options.minSize[0] || 0;
+		ymin = options.minSize[1] || 0;
+
+		if ('outerImage' in options)
+		{
+			$img.attr('src',options.outerImage);
+			delete(options.outerImage);
+		}
+
+		Selection.refresh();
+	};
+	//}}}
+
+	// }}}
+
+	$hdl_holder.hide();
+	interfaceUpdate(true);
+	
+	var api = {
+		animateTo: animateTo,
+		setSelect: setSelect,
+		setOptions: setOptionsNew,
+		tellSelect: tellSelect,
+		tellScaled: tellScaled,
+
+		disable: disableCrop,
+		enable: enableCrop,
+		cancel: cancelCrop,
+
+		focus: KeyManager.watchKeys,
+
+		getBounds: function() { return [ boundx * xscale, boundy * yscale ]; },
+		getWidgetSize: function() { return [ boundx, boundy ]; },
+
+		release: Selection.release,
+		destroy: destroy
+
+	};
+
+	$origimg.data('Jcrop',api);
+	return api;
+};
+
+$.fn.Jcrop = function(options)/*{{{*/
+{
+	function attachWhenDone(from)/*{{{*/
+	{
+		var loadsrc = options.useImg || from.src;
+		var img = new Image();
+		img.onload = function() { $.Jcrop(from,options); };
+		img.src = loadsrc;
+	};
+	/*}}}*/
+	if (typeof(options) !== 'object') options = { };
+
+	// Iterate over each object, attach Jcrop
+	this.each(function()
+	{
+		// If we've already attached to this object
+		if ($(this).data('Jcrop'))
+		{
+			// The API can be requested this way (undocumented)
+			if (options == 'api') return $(this).data('Jcrop');
+			// Otherwise, we just reset the options...
+			else $(this).data('Jcrop').setOptions(options);
+		}
+		// If we haven't been attached, preload and attach
+		else attachWhenDone(this);
+	});
+
+	// Return "this" so we're chainable a la jQuery plugin-style!
+	return this;
+};
+/*}}}*/
+
+})(jQuery);
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/css/colorpicker.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/css/colorpicker.css
new file mode 100644
index 0000000000000000000000000000000000000000..d687c9db827a175bb504f84241ad5355e58076b5
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/css/colorpicker.css
@@ -0,0 +1,161 @@
+.colorpicker {
+	width: 356px;
+	height: 176px;
+	overflow: hidden;
+	position: absolute;
+	background: url(../images/colorpicker_background.png);
+	font-family: Arial, Helvetica, sans-serif;
+	display: none;
+}
+.colorpicker_color {
+	width: 150px;
+	height: 150px;
+	left: 14px;
+	top: 13px;
+	position: absolute;
+	background: #f00;
+	overflow: hidden;
+	cursor: crosshair;
+}
+.colorpicker_color div {
+	position: absolute;
+	top: 0;
+	left: 0;
+	width: 150px;
+	height: 150px;
+	background: url(../images/colorpicker_overlay.png);
+}
+.colorpicker_color div div {
+	position: absolute;
+	top: 0;
+	left: 0;
+	width: 11px;
+	height: 11px;
+	overflow: hidden;
+	background: url(../images/colorpicker_select.gif);
+	margin: -5px 0 0 -5px;
+}
+.colorpicker_hue {
+	position: absolute;
+	top: 13px;
+	left: 171px;
+	width: 35px;
+	height: 150px;
+	cursor: n-resize;
+}
+.colorpicker_hue div {
+	position: absolute;
+	width: 35px;
+	height: 9px;
+	overflow: hidden;
+	background: url(../images/colorpicker_indic.gif) left top;
+	margin: -4px 0 0 0;
+	left: 0px;
+}
+.colorpicker_new_color {
+	position: absolute;
+	width: 60px;
+	height: 30px;
+	left: 213px;
+	top: 13px;
+	background: #f00;
+}
+.colorpicker_current_color {
+	position: absolute;
+	width: 60px;
+	height: 30px;
+	left: 283px;
+	top: 13px;
+	background: #f00;
+}
+.colorpicker input {
+	background-color: transparent;
+	border: 1px solid transparent;
+	position: absolute;
+	font-size: 10px;
+	font-family: Arial, Helvetica, sans-serif;
+	color: #898989;
+	top: 4px;
+	right: 11px;
+	text-align: right;
+	margin: 0;
+	padding: 0;
+	height: 13px;
+}
+.colorpicker_hex {
+	position: absolute;
+	width: 72px;
+	height: 22px;
+	background: url(../images/colorpicker_hex.png) top;
+	left: 212px;
+	top: 142px;
+}
+.colorpicker_hex input {
+	right: 6px;
+}
+.colorpicker_field {
+	height: 22px;
+	width: 62px;
+	background-position: top;
+	position: absolute;
+}
+.colorpicker_field span {
+	position: absolute;
+	width: 12px;
+	height: 22px;
+	overflow: hidden;
+	top: 0;
+	right: 0;
+	cursor: n-resize;
+}
+.colorpicker_rgb_r {
+	background-image: url(../images/colorpicker_rgb_r.png);
+	top: 52px;
+	left: 212px;
+}
+.colorpicker_rgb_g {
+	background-image: url(../images/colorpicker_rgb_g.png);
+	top: 82px;
+	left: 212px;
+}
+.colorpicker_rgb_b {
+	background-image: url(../images/colorpicker_rgb_b.png);
+	top: 112px;
+	left: 212px;
+}
+.colorpicker_hsb_h {
+	background-image: url(../images/colorpicker_hsb_h.png);
+	top: 52px;
+	left: 282px;
+}
+.colorpicker_hsb_s {
+	background-image: url(../images/colorpicker_hsb_s.png);
+	top: 82px;
+	left: 282px;
+}
+.colorpicker_hsb_b {
+	background-image: url(../images/colorpicker_hsb_b.png);
+	top: 112px;
+	left: 282px;
+}
+.colorpicker_submit {
+	position: absolute;
+	width: 22px;
+	height: 22px;
+	background: url(../images/colorpicker_submit.png) top;
+	left: 322px;
+	top: 142px;
+	overflow: hidden;
+}
+.colorpicker_focus {
+	background-position: center;
+}
+.colorpicker_hex.colorpicker_focus {
+	background-position: bottom;
+}
+.colorpicker_submit.colorpicker_focus {
+	background-position: bottom;
+}
+.colorpicker_slider {
+	background-position: bottom;
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/blank.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/blank.gif
new file mode 100644
index 0000000000000000000000000000000000000000..75b945d2553848b8b6f41fe5e24599c0687b8472
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/blank.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/colorpicker_background.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/colorpicker_background.png
new file mode 100644
index 0000000000000000000000000000000000000000..8401572f1939a1a24c1963513573b0194ad36ee0
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/colorpicker_background.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/colorpicker_hex.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/colorpicker_hex.png
new file mode 100644
index 0000000000000000000000000000000000000000..4e532d7c65393fe56d7463e1da3faa591f03de84
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/colorpicker_hex.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/colorpicker_hsb_b.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/colorpicker_hsb_b.png
new file mode 100644
index 0000000000000000000000000000000000000000..dfac595d017e279ff670df2c816e02d922660d9f
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/colorpicker_hsb_b.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/colorpicker_hsb_h.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/colorpicker_hsb_h.png
new file mode 100644
index 0000000000000000000000000000000000000000..3977ed9f21e3186eefd37b198a7cc3f8de6c69cb
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/colorpicker_hsb_h.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/colorpicker_hsb_s.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/colorpicker_hsb_s.png
new file mode 100644
index 0000000000000000000000000000000000000000..a2a699736c24b34c60afac8cea399b2c4afcf9a1
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/colorpicker_hsb_s.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/colorpicker_indic.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/colorpicker_indic.gif
new file mode 100644
index 0000000000000000000000000000000000000000..f9fa95e2825eadd2d779ad270a71eddb94f94748
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/colorpicker_indic.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/colorpicker_overlay.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/colorpicker_overlay.png
new file mode 100644
index 0000000000000000000000000000000000000000..561cdd9c59a498b499cbfd1295dc4d2037e235ff
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/colorpicker_overlay.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/colorpicker_rgb_b.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/colorpicker_rgb_b.png
new file mode 100644
index 0000000000000000000000000000000000000000..dfac595d017e279ff670df2c816e02d922660d9f
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/colorpicker_rgb_b.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/colorpicker_rgb_g.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/colorpicker_rgb_g.png
new file mode 100644
index 0000000000000000000000000000000000000000..72b32760a5c40b7ab834d176ac588750a06f13f2
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/colorpicker_rgb_g.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/colorpicker_rgb_r.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/colorpicker_rgb_r.png
new file mode 100644
index 0000000000000000000000000000000000000000..4855fe03f8ea8d88b4f8ae625c7958eea65208ac
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/colorpicker_rgb_r.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/colorpicker_select.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/colorpicker_select.gif
new file mode 100644
index 0000000000000000000000000000000000000000..599f7f13a6854d198f501588948ffcf97bf9f365
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/colorpicker_select.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/colorpicker_submit.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/colorpicker_submit.png
new file mode 100644
index 0000000000000000000000000000000000000000..7f4c0825f53cc4faba8fc9e043502276765da1f5
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/colorpicker_submit.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/custom_background.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/custom_background.png
new file mode 100644
index 0000000000000000000000000000000000000000..cf55ffdd68ed42f2d70bd7ec2010cee86c110816
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/custom_background.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/custom_hex.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/custom_hex.png
new file mode 100644
index 0000000000000000000000000000000000000000..888f444495b3e08dbfa91181bf94d90bf48c85c8
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/custom_hex.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/custom_hsb_b.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/custom_hsb_b.png
new file mode 100644
index 0000000000000000000000000000000000000000..2f99dae8e6ef73e91a5d6283d2a732b6372d5e27
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/custom_hsb_b.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/custom_hsb_h.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/custom_hsb_h.png
new file mode 100644
index 0000000000000000000000000000000000000000..a217e9218e6a512b507a35e8a6141f0e56193439
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/custom_hsb_h.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/custom_hsb_s.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/custom_hsb_s.png
new file mode 100644
index 0000000000000000000000000000000000000000..7826b415077be23ed1b1bf05b2da62d4aa5b1c67
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/custom_hsb_s.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/custom_indic.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/custom_indic.gif
new file mode 100644
index 0000000000000000000000000000000000000000..222fb94cfd66bd2bd525891024289d8ee7adc321
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/custom_indic.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/custom_rgb_b.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/custom_rgb_b.png
new file mode 100644
index 0000000000000000000000000000000000000000..80764e5d6dd8aac3c5ef87d83b45d29780af1fe9
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/custom_rgb_b.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/custom_rgb_g.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/custom_rgb_g.png
new file mode 100644
index 0000000000000000000000000000000000000000..fc9778be1eb862a7ada05ae4a34726df0a2c73af
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/custom_rgb_g.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/custom_rgb_r.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/custom_rgb_r.png
new file mode 100644
index 0000000000000000000000000000000000000000..91b0cd4c520013444ae3a64c7e10b28060992557
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/custom_rgb_r.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/custom_submit.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/custom_submit.png
new file mode 100644
index 0000000000000000000000000000000000000000..cd202cd93b753b31926593e79eb3756cd58bd677
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/custom_submit.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/select.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/select.png
new file mode 100644
index 0000000000000000000000000000000000000000..21213bfd51b088497f3a9e423170cd65532d873d
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/select.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/select2.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/select2.png
new file mode 100644
index 0000000000000000000000000000000000000000..2cd2cabeb6777c724034d5b0e0efd664011f515c
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/select2.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/slider.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/slider.png
new file mode 100644
index 0000000000000000000000000000000000000000..8b03da96ebd45d66729466d43f263854ce7a0c49
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/images/slider.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/js/colorpicker.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/js/colorpicker.js
new file mode 100644
index 0000000000000000000000000000000000000000..45f56ced7aff8c353d67e64b83592074de815614
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/colorpicker/js/colorpicker.js
@@ -0,0 +1,484 @@
+/**
+ *
+ * Color picker
+ * Author: Stefan Petre www.eyecon.ro
+ * 
+ * Dual licensed under the MIT and GPL licenses
+ * 
+ */
+(function ($) {
+	var ColorPicker = function () {
+		var
+			ids = {},
+			inAction,
+			charMin = 65,
+			visible,
+			tpl = '<div class="colorpicker"><div class="colorpicker_color"><div><div></div></div></div><div class="colorpicker_hue"><div></div></div><div class="colorpicker_new_color"></div><div class="colorpicker_current_color"></div><div class="colorpicker_hex"><input type="text" maxlength="6" size="6" /></div><div class="colorpicker_rgb_r colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_g colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_h colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_s colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_submit"></div></div>',
+			defaults = {
+				eventName: 'click',
+				onShow: function () {},
+				onBeforeShow: function(){},
+				onHide: function () {},
+				onChange: function () {},
+				onSubmit: function () {},
+				color: 'ff0000',
+				livePreview: true,
+				flat: false
+			},
+			fillRGBFields = function  (hsb, cal) {
+				var rgb = HSBToRGB(hsb);
+				$(cal).data('colorpicker').fields
+					.eq(1).val(rgb.r).end()
+					.eq(2).val(rgb.g).end()
+					.eq(3).val(rgb.b).end();
+			},
+			fillHSBFields = function  (hsb, cal) {
+				$(cal).data('colorpicker').fields
+					.eq(4).val(hsb.h).end()
+					.eq(5).val(hsb.s).end()
+					.eq(6).val(hsb.b).end();
+			},
+			fillHexFields = function (hsb, cal) {
+				$(cal).data('colorpicker').fields
+					.eq(0).val(HSBToHex(hsb)).end();
+			},
+			setSelector = function (hsb, cal) {
+				$(cal).data('colorpicker').selector.css('backgroundColor', '#' + HSBToHex({h: hsb.h, s: 100, b: 100}));
+				$(cal).data('colorpicker').selectorIndic.css({
+					left: parseInt(150 * hsb.s/100, 10),
+					top: parseInt(150 * (100-hsb.b)/100, 10)
+				});
+			},
+			setHue = function (hsb, cal) {
+				$(cal).data('colorpicker').hue.css('top', parseInt(150 - 150 * hsb.h/360, 10));
+			},
+			setCurrentColor = function (hsb, cal) {
+				$(cal).data('colorpicker').currentColor.css('backgroundColor', '#' + HSBToHex(hsb));
+			},
+			setNewColor = function (hsb, cal) {
+				$(cal).data('colorpicker').newColor.css('backgroundColor', '#' + HSBToHex(hsb));
+			},
+			keyDown = function (ev) {
+				var pressedKey = ev.charCode || ev.keyCode || -1;
+				if ((pressedKey > charMin && pressedKey <= 90) || pressedKey == 32) {
+					return false;
+				}
+				var cal = $(this).parent().parent();
+				if (cal.data('colorpicker').livePreview === true) {
+					change.apply(this);
+				}
+			},
+			change = function (ev) {
+				var cal = $(this).parent().parent(), col;
+				if (this.parentNode.className.indexOf('_hex') > 0) {
+					cal.data('colorpicker').color = col = HexToHSB(fixHex(this.value));
+				} else if (this.parentNode.className.indexOf('_hsb') > 0) {
+					cal.data('colorpicker').color = col = fixHSB({
+						h: parseInt(cal.data('colorpicker').fields.eq(4).val(), 10),
+						s: parseInt(cal.data('colorpicker').fields.eq(5).val(), 10),
+						b: parseInt(cal.data('colorpicker').fields.eq(6).val(), 10)
+					});
+				} else {
+					cal.data('colorpicker').color = col = RGBToHSB(fixRGB({
+						r: parseInt(cal.data('colorpicker').fields.eq(1).val(), 10),
+						g: parseInt(cal.data('colorpicker').fields.eq(2).val(), 10),
+						b: parseInt(cal.data('colorpicker').fields.eq(3).val(), 10)
+					}));
+				}
+				if (ev) {
+					fillRGBFields(col, cal.get(0));
+					fillHexFields(col, cal.get(0));
+					fillHSBFields(col, cal.get(0));
+				}
+				setSelector(col, cal.get(0));
+				setHue(col, cal.get(0));
+				setNewColor(col, cal.get(0));
+				cal.data('colorpicker').onChange.apply(cal, [col, HSBToHex(col), HSBToRGB(col)]);
+			},
+			blur = function (ev) {
+				var cal = $(this).parent().parent();
+				cal.data('colorpicker').fields.parent().removeClass('colorpicker_focus');
+			},
+			focus = function () {
+				charMin = this.parentNode.className.indexOf('_hex') > 0 ? 70 : 65;
+				$(this).parent().parent().data('colorpicker').fields.parent().removeClass('colorpicker_focus');
+				$(this).parent().addClass('colorpicker_focus');
+			},
+			downIncrement = function (ev) {
+				var field = $(this).parent().find('input').focus();
+				var current = {
+					el: $(this).parent().addClass('colorpicker_slider'),
+					max: this.parentNode.className.indexOf('_hsb_h') > 0 ? 360 : (this.parentNode.className.indexOf('_hsb') > 0 ? 100 : 255),
+					y: ev.pageY,
+					field: field,
+					val: parseInt(field.val(), 10),
+					preview: $(this).parent().parent().data('colorpicker').livePreview					
+				};
+				$(document).bind('mouseup', current, upIncrement);
+				$(document).bind('mousemove', current, moveIncrement);
+			},
+			moveIncrement = function (ev) {
+				ev.data.field.val(Math.max(0, Math.min(ev.data.max, parseInt(ev.data.val + ev.pageY - ev.data.y, 10))));
+				if (ev.data.preview) {
+					change.apply(ev.data.field.get(0), [true]);
+				}
+				return false;
+			},
+			upIncrement = function (ev) {
+				change.apply(ev.data.field.get(0), [true]);
+				ev.data.el.removeClass('colorpicker_slider').find('input').focus();
+				$(document).unbind('mouseup', upIncrement);
+				$(document).unbind('mousemove', moveIncrement);
+				return false;
+			},
+			downHue = function (ev) {
+				var current = {
+					cal: $(this).parent(),
+					y: $(this).offset().top
+				};
+				current.preview = current.cal.data('colorpicker').livePreview;
+				$(document).bind('mouseup', current, upHue);
+				$(document).bind('mousemove', current, moveHue);
+			},
+			moveHue = function (ev) {
+				change.apply(
+					ev.data.cal.data('colorpicker')
+						.fields
+						.eq(4)
+						.val(parseInt(360*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.y))))/150, 10))
+						.get(0),
+					[ev.data.preview]
+				);
+				return false;
+			},
+			upHue = function (ev) {
+				fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
+				fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
+				$(document).unbind('mouseup', upHue);
+				$(document).unbind('mousemove', moveHue);
+				return false;
+			},
+			downSelector = function (ev) {
+				var current = {
+					cal: $(this).parent(),
+					pos: $(this).offset()
+				};
+				current.preview = current.cal.data('colorpicker').livePreview;
+				$(document).bind('mouseup', current, upSelector);
+				$(document).bind('mousemove', current, moveSelector);
+			},
+			moveSelector = function (ev) {
+				change.apply(
+					ev.data.cal.data('colorpicker')
+						.fields
+						.eq(6)
+						.val(parseInt(100*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.pos.top))))/150, 10))
+						.end()
+						.eq(5)
+						.val(parseInt(100*(Math.max(0,Math.min(150,(ev.pageX - ev.data.pos.left))))/150, 10))
+						.get(0),
+					[ev.data.preview]
+				);
+				return false;
+			},
+			upSelector = function (ev) {
+				fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
+				fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
+				$(document).unbind('mouseup', upSelector);
+				$(document).unbind('mousemove', moveSelector);
+				return false;
+			},
+			enterSubmit = function (ev) {
+				$(this).addClass('colorpicker_focus');
+			},
+			leaveSubmit = function (ev) {
+				$(this).removeClass('colorpicker_focus');
+			},
+			clickSubmit = function (ev) {
+				var cal = $(this).parent();
+				var col = cal.data('colorpicker').color;
+				cal.data('colorpicker').origColor = col;
+				setCurrentColor(col, cal.get(0));
+				cal.data('colorpicker').onSubmit(col, HSBToHex(col), HSBToRGB(col), cal.data('colorpicker').el);
+			},
+			show = function (ev) {
+				var cal = $('#' + $(this).data('colorpickerId'));
+				cal.data('colorpicker').onBeforeShow.apply(this, [cal.get(0)]);
+				var pos = $(this).offset();
+				var viewPort = getViewport();
+				var top = pos.top + this.offsetHeight;
+				var left = pos.left;
+				if (top + 176 > viewPort.t + viewPort.h) {
+					top -= this.offsetHeight + 176;
+				}
+				if (left + 356 > viewPort.l + viewPort.w) {
+					left -= 356;
+				}
+				cal.css({left: left + 'px', top: top + 'px'});
+				if (cal.data('colorpicker').onShow.apply(this, [cal.get(0)]) != false) {
+					cal.show();
+				}
+				$(document).bind('mousedown', {cal: cal}, hide);
+				return false;
+			},
+			hide = function (ev) {
+				if (!isChildOf(ev.data.cal.get(0), ev.target, ev.data.cal.get(0))) {
+					if (ev.data.cal.data('colorpicker').onHide.apply(this, [ev.data.cal.get(0)]) != false) {
+						ev.data.cal.hide();
+					}
+					$(document).unbind('mousedown', hide);
+				}
+			},
+			isChildOf = function(parentEl, el, container) {
+				if (parentEl == el) {
+					return true;
+				}
+				if (parentEl.contains) {
+					return parentEl.contains(el);
+				}
+				if ( parentEl.compareDocumentPosition ) {
+					return !!(parentEl.compareDocumentPosition(el) & 16);
+				}
+				var prEl = el.parentNode;
+				while(prEl && prEl != container) {
+					if (prEl == parentEl)
+						return true;
+					prEl = prEl.parentNode;
+				}
+				return false;
+			},
+			getViewport = function () {
+				var m = document.compatMode == 'CSS1Compat';
+				return {
+					l : window.pageXOffset || (m ? document.documentElement.scrollLeft : document.body.scrollLeft),
+					t : window.pageYOffset || (m ? document.documentElement.scrollTop : document.body.scrollTop),
+					w : window.innerWidth || (m ? document.documentElement.clientWidth : document.body.clientWidth),
+					h : window.innerHeight || (m ? document.documentElement.clientHeight : document.body.clientHeight)
+				};
+			},
+			fixHSB = function (hsb) {
+				return {
+					h: Math.min(360, Math.max(0, hsb.h)),
+					s: Math.min(100, Math.max(0, hsb.s)),
+					b: Math.min(100, Math.max(0, hsb.b))
+				};
+			}, 
+			fixRGB = function (rgb) {
+				return {
+					r: Math.min(255, Math.max(0, rgb.r)),
+					g: Math.min(255, Math.max(0, rgb.g)),
+					b: Math.min(255, Math.max(0, rgb.b))
+				};
+			},
+			fixHex = function (hex) {
+				var len = 6 - hex.length;
+				if (len > 0) {
+					var o = [];
+					for (var i=0; i<len; i++) {
+						o.push('0');
+					}
+					o.push(hex);
+					hex = o.join('');
+				}
+				return hex;
+			}, 
+			HexToRGB = function (hex) {
+				var hex = parseInt(((hex.indexOf('#') > -1) ? hex.substring(1) : hex), 16);
+				return {r: hex >> 16, g: (hex & 0x00FF00) >> 8, b: (hex & 0x0000FF)};
+			},
+			HexToHSB = function (hex) {
+				return RGBToHSB(HexToRGB(hex));
+			},
+			RGBToHSB = function (rgb) {
+				var hsb = {
+					h: 0,
+					s: 0,
+					b: 0
+				};
+				var min = Math.min(rgb.r, rgb.g, rgb.b);
+				var max = Math.max(rgb.r, rgb.g, rgb.b);
+				var delta = max - min;
+				hsb.b = max;
+				if (max != 0) {
+					
+				}
+				hsb.s = max != 0 ? 255 * delta / max : 0;
+				if (hsb.s != 0) {
+					if (rgb.r == max) {
+						hsb.h = (rgb.g - rgb.b) / delta;
+					} else if (rgb.g == max) {
+						hsb.h = 2 + (rgb.b - rgb.r) / delta;
+					} else {
+						hsb.h = 4 + (rgb.r - rgb.g) / delta;
+					}
+				} else {
+					hsb.h = -1;
+				}
+				hsb.h *= 60;
+				if (hsb.h < 0) {
+					hsb.h += 360;
+				}
+				hsb.s *= 100/255;
+				hsb.b *= 100/255;
+				return hsb;
+			},
+			HSBToRGB = function (hsb) {
+				var rgb = {};
+				var h = Math.round(hsb.h);
+				var s = Math.round(hsb.s*255/100);
+				var v = Math.round(hsb.b*255/100);
+				if(s == 0) {
+					rgb.r = rgb.g = rgb.b = v;
+				} else {
+					var t1 = v;
+					var t2 = (255-s)*v/255;
+					var t3 = (t1-t2)*(h%60)/60;
+					if(h==360) h = 0;
+					if(h<60) {rgb.r=t1;	rgb.b=t2; rgb.g=t2+t3}
+					else if(h<120) {rgb.g=t1; rgb.b=t2;	rgb.r=t1-t3}
+					else if(h<180) {rgb.g=t1; rgb.r=t2;	rgb.b=t2+t3}
+					else if(h<240) {rgb.b=t1; rgb.r=t2;	rgb.g=t1-t3}
+					else if(h<300) {rgb.b=t1; rgb.g=t2;	rgb.r=t2+t3}
+					else if(h<360) {rgb.r=t1; rgb.g=t2;	rgb.b=t1-t3}
+					else {rgb.r=0; rgb.g=0;	rgb.b=0}
+				}
+				return {r:Math.round(rgb.r), g:Math.round(rgb.g), b:Math.round(rgb.b)};
+			},
+			RGBToHex = function (rgb) {
+				var hex = [
+					rgb.r.toString(16),
+					rgb.g.toString(16),
+					rgb.b.toString(16)
+				];
+				$.each(hex, function (nr, val) {
+					if (val.length == 1) {
+						hex[nr] = '0' + val;
+					}
+				});
+				return hex.join('');
+			},
+			HSBToHex = function (hsb) {
+				return RGBToHex(HSBToRGB(hsb));
+			},
+			restoreOriginal = function () {
+				var cal = $(this).parent();
+				var col = cal.data('colorpicker').origColor;
+				cal.data('colorpicker').color = col;
+				fillRGBFields(col, cal.get(0));
+				fillHexFields(col, cal.get(0));
+				fillHSBFields(col, cal.get(0));
+				setSelector(col, cal.get(0));
+				setHue(col, cal.get(0));
+				setNewColor(col, cal.get(0));
+			};
+		return {
+			init: function (opt) {
+				opt = $.extend({}, defaults, opt||{});
+				if (typeof opt.color == 'string') {
+					opt.color = HexToHSB(opt.color);
+				} else if (opt.color.r != undefined && opt.color.g != undefined && opt.color.b != undefined) {
+					opt.color = RGBToHSB(opt.color);
+				} else if (opt.color.h != undefined && opt.color.s != undefined && opt.color.b != undefined) {
+					opt.color = fixHSB(opt.color);
+				} else {
+					return this;
+				}
+				return this.each(function () {
+					if (!$(this).data('colorpickerId')) {
+						var options = $.extend({}, opt);
+						options.origColor = opt.color;
+						var id = 'collorpicker_' + parseInt(Math.random() * 1000);
+						$(this).data('colorpickerId', id);
+						var cal = $(tpl).attr('id', id);
+						if (options.flat) {
+							cal.appendTo(this).show();
+						} else {
+							cal.appendTo(document.body);
+						}
+						options.fields = cal
+											.find('input')
+												.bind('keyup', keyDown)
+												.bind('change', change)
+												.bind('blur', blur)
+												.bind('focus', focus);
+						cal
+							.find('span').bind('mousedown', downIncrement).end()
+							.find('>div.colorpicker_current_color').bind('click', restoreOriginal);
+						options.selector = cal.find('div.colorpicker_color').bind('mousedown', downSelector);
+						options.selectorIndic = options.selector.find('div div');
+						options.el = this;
+						options.hue = cal.find('div.colorpicker_hue div');
+						cal.find('div.colorpicker_hue').bind('mousedown', downHue);
+						options.newColor = cal.find('div.colorpicker_new_color');
+						options.currentColor = cal.find('div.colorpicker_current_color');
+						cal.data('colorpicker', options);
+						cal.find('div.colorpicker_submit')
+							.bind('mouseenter', enterSubmit)
+							.bind('mouseleave', leaveSubmit)
+							.bind('click', clickSubmit);
+						fillRGBFields(options.color, cal.get(0));
+						fillHSBFields(options.color, cal.get(0));
+						fillHexFields(options.color, cal.get(0));
+						setHue(options.color, cal.get(0));
+						setSelector(options.color, cal.get(0));
+						setCurrentColor(options.color, cal.get(0));
+						setNewColor(options.color, cal.get(0));
+						if (options.flat) {
+							cal.css({
+								position: 'relative',
+								display: 'block'
+							});
+						} else {
+							$(this).bind(options.eventName, show);
+						}
+					}
+				});
+			},
+			showPicker: function() {
+				return this.each( function () {
+					if ($(this).data('colorpickerId')) {
+						show.apply(this);
+					}
+				});
+			},
+			hidePicker: function() {
+				return this.each( function () {
+					if ($(this).data('colorpickerId')) {
+						$('#' + $(this).data('colorpickerId')).hide();
+					}
+				});
+			},
+			setColor: function(col) {
+				if (typeof col == 'string') {
+					col = HexToHSB(col);
+				} else if (col.r != undefined && col.g != undefined && col.b != undefined) {
+					col = RGBToHSB(col);
+				} else if (col.h != undefined && col.s != undefined && col.b != undefined) {
+					col = fixHSB(col);
+				} else {
+					return this;
+				}
+				return this.each(function(){
+					if ($(this).data('colorpickerId')) {
+						var cal = $('#' + $(this).data('colorpickerId'));
+						cal.data('colorpicker').color = col;
+						cal.data('colorpicker').origColor = col;
+						fillRGBFields(col, cal.get(0));
+						fillHSBFields(col, cal.get(0));
+						fillHexFields(col, cal.get(0));
+						setHue(col, cal.get(0));
+						setSelector(col, cal.get(0));
+						setCurrentColor(col, cal.get(0));
+						setNewColor(col, cal.get(0));
+					}
+				});
+			}
+		};
+	}();
+	$.fn.extend({
+		ColorPicker: ColorPicker.init,
+		ColorPickerHide: ColorPicker.hidePicker,
+		ColorPickerShow: ColorPicker.showPicker,
+		ColorPickerSetColor: ColorPicker.setColor
+	});
+})(jQuery)
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/jquery.MultiFile.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/jquery.MultiFile.js
new file mode 100644
index 0000000000000000000000000000000000000000..9d9ce05f0ec45a0f5b766297ab4e285b4b4fbc1f
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/jquery.MultiFile.js
@@ -0,0 +1,535 @@
+/*
+ ### jQuery Multiple File Upload Plugin v1.46 - 2009-05-12 ###
+ * Home: http://www.fyneworks.com/jquery/multiple-file-upload/
+ * Code: http://code.google.com/p/jquery-multifile-plugin/
+ *
+ * Dual licensed under the MIT and GPL licenses:
+ *   http://www.opensource.org/licenses/mit-license.php
+ *   http://www.gnu.org/licenses/gpl.html
+ ###
+*/
+
+/*# AVOID COLLISIONS #*/
+;if(window.jQuery) (function($){
+/*# AVOID COLLISIONS #*/
+ 
+	// plugin initialization
+	$.fn.MultiFile = function(options){
+		if(this.length==0) return this; // quick fail
+		
+		// Handle API methods
+		if(typeof arguments[0]=='string'){
+			// Perform API methods on individual elements
+			if(this.length>1){
+				var args = arguments;
+				return this.each(function(){
+					$.fn.MultiFile.apply($(this), args);
+    });
+			};
+			// Invoke API method handler
+			$.fn.MultiFile[arguments[0]].apply(this, $.makeArray(arguments).slice(1) || []);
+			// Quick exit...
+			return this;
+		};
+		
+		// Initialize options for this call
+		var options = $.extend(
+			{}/* new object */,
+			$.fn.MultiFile.options/* default options */,
+			options || {} /* just-in-time options */
+		);
+		
+		// Empty Element Fix!!!
+		// this code will automatically intercept native form submissions
+		// and disable empty file elements
+		$('form')
+		.not('MultiFile-intercepted')
+		.addClass('MultiFile-intercepted')
+		.submit($.fn.MultiFile.disableEmpty);
+		
+		//### http://plugins.jquery.com/node/1363
+		// utility method to integrate this plugin with others...
+		if($.fn.MultiFile.options.autoIntercept){
+			$.fn.MultiFile.intercept( $.fn.MultiFile.options.autoIntercept /* array of methods to intercept */ );
+			$.fn.MultiFile.options.autoIntercept = null; /* only run this once */
+		};
+		
+		// loop through each matched element
+		this
+		 .not('.MultiFile-applied')
+			.addClass('MultiFile-applied')
+		.each(function(){
+			//#####################################################################
+			// MAIN PLUGIN FUNCTIONALITY - START
+			//#####################################################################
+			
+       // BUG 1251 FIX: http://plugins.jquery.com/project/comments/add/1251
+       // variable group_count would repeat itself on multiple calls to the plugin.
+       // this would cause a conflict with multiple elements
+       // changes scope of variable to global so id will be unique over n calls
+       window.MultiFile = (window.MultiFile || 0) + 1;
+       var group_count = window.MultiFile;
+       
+       // Copy parent attributes - Thanks to Jonas Wagner
+       // we will use this one to create new input elements
+       var MultiFile = {e:this, E:$(this), clone:$(this).clone()};
+       
+       //===
+       
+       //# USE CONFIGURATION
+       if(typeof options=='number') options = {max:options};
+       var o = $.extend({},
+        $.fn.MultiFile.options,
+        options || {},
+   					($.metadata? MultiFile.E.metadata(): ($.meta?MultiFile.E.data():null)) || {}, /* metadata options */
+								{} /* internals */
+       );
+       // limit number of files that can be selected?
+       if(!(o.max>0) /*IsNull(MultiFile.max)*/){
+        o.max = MultiFile.E.attr('maxlength');
+        if(!(o.max>0) /*IsNull(MultiFile.max)*/){
+         o.max = (String(MultiFile.e.className.match(/\b(max|limit)\-([0-9]+)\b/gi) || ['']).match(/[0-9]+/gi) || [''])[0];
+         if(!(o.max>0)) o.max = -1;
+         else           o.max = String(o.max).match(/[0-9]+/gi)[0];
+        }
+       };
+       o.max = new Number(o.max);
+       // limit extensions?
+       o.accept = o.accept || MultiFile.E.attr('accept') || '';
+       if(!o.accept){
+        o.accept = (MultiFile.e.className.match(/\b(accept\-[\w\|]+)\b/gi)) || '';
+        o.accept = new String(o.accept).replace(/^(accept|ext)\-/i,'');
+       };
+       
+       //===
+       
+       // APPLY CONFIGURATION
+							$.extend(MultiFile, o || {});
+       MultiFile.STRING = $.extend({},$.fn.MultiFile.options.STRING,MultiFile.STRING);
+       
+       //===
+       
+       //#########################################
+       // PRIVATE PROPERTIES/METHODS
+       $.extend(MultiFile, {
+        n: 0, // How many elements are currently selected?
+        slaves: [], files: [],
+        instanceKey: MultiFile.e.id || 'MultiFile'+String(group_count), // Instance Key?
+        generateID: function(z){ return MultiFile.instanceKey + (z>0 ?'_F'+String(z):''); },
+        trigger: function(event, element){
+         var handler = MultiFile[event], value = $(element).attr('value');
+         if(handler){
+          var returnValue = handler(element, value, MultiFile);
+          if( returnValue!=null ) return returnValue;
+         }
+         return true;
+        }
+       });
+       
+       //===
+       
+       // Setup dynamic regular expression for extension validation
+       // - thanks to John-Paul Bader: http://smyck.de/2006/08/11/javascript-dynamic-regular-expresions/
+       if(String(MultiFile.accept).length>1){
+								MultiFile.accept = MultiFile.accept.replace(/\W+/g,'|').replace(/^\W|\W$/g,'');
+        MultiFile.rxAccept = new RegExp('\\.('+(MultiFile.accept?MultiFile.accept:'')+')$','gi');
+       };
+       
+       //===
+       
+       // Create wrapper to hold our file list
+       MultiFile.wrapID = MultiFile.instanceKey+'_wrap'; // Wrapper ID?
+       MultiFile.E.wrap('<div class="MultiFile-wrap" id="'+MultiFile.wrapID+'"></div>');
+       MultiFile.wrapper = $('#'+MultiFile.wrapID+'');
+       
+       //===
+       
+       // MultiFile MUST have a name - default: file1[], file2[], file3[]
+       MultiFile.e.name = MultiFile.e.name || 'file'+ group_count +'[]';
+       
+       //===
+       
+							if(!MultiFile.list){
+								// Create a wrapper for the list
+								// * OPERA BUG: NO_MODIFICATION_ALLOWED_ERR ('list' is a read-only property)
+								// this change allows us to keep the files in the order they were selected
+								MultiFile.wrapper.append( '<div class="MultiFile-list" id="'+MultiFile.wrapID+'_list"></div>' );
+								MultiFile.list = $('#'+MultiFile.wrapID+'_list');
+							};
+       MultiFile.list = $(MultiFile.list);
+							
+       //===
+       
+       // Bind a new element
+       MultiFile.addSlave = function( slave, slave_count ){
+								//if(window.console) console.log('MultiFile.addSlave',slave_count);
+								
+        // Keep track of how many elements have been displayed
+        MultiFile.n++;
+        // Add reference to master element
+        slave.MultiFile = MultiFile;
+								
+								// BUG FIX: http://plugins.jquery.com/node/1495
+								// Clear identifying properties from clones
+								if(slave_count>0) slave.id = slave.name = '';
+								
+        // Define element's ID and name (upload components need this!)
+        //slave.id = slave.id || MultiFile.generateID(slave_count);
+								if(slave_count>0) slave.id = MultiFile.generateID(slave_count);
+								//FIX for: http://code.google.com/p/jquery-multifile-plugin/issues/detail?id=23
+        
+        // 2008-Apr-29: New customizable naming convention (see url below)
+        // http://groups.google.com/group/jquery-dev/browse_frm/thread/765c73e41b34f924#
+        slave.name = String(MultiFile.namePattern
+         /*master name*/.replace(/\$name/gi,$(MultiFile.clone).attr('name'))
+         /*master id  */.replace(/\$id/gi,  $(MultiFile.clone).attr('id'))
+         /*group count*/.replace(/\$g/gi,   group_count)//(group_count>0?group_count:''))
+         /*slave count*/.replace(/\$i/gi,   slave_count)//(slave_count>0?slave_count:''))
+        );
+        
+        // If we've reached maximum number, disable input slave
+        if( (MultiFile.max > 0) && ((MultiFile.n-1) > (MultiFile.max)) )//{ // MultiFile.n Starts at 1, so subtract 1 to find true count
+         slave.disabled = true;
+        //};
+        
+        // Remember most recent slave
+        MultiFile.current = MultiFile.slaves[slave_count] = slave;
+        
+								// We'll use jQuery from now on
+								slave = $(slave);
+        
+        // Clear value
+        slave.val('').attr('value','')[0].value = '';
+        
+								// Stop plugin initializing on slaves
+								slave.addClass('MultiFile-applied');
+								
+        // Triggered when a file is selected
+        slave.change(function(){
+          //if(window.console) console.log('MultiFile.slave.change',slave_count);
+ 								 
+          // Lose focus to stop IE7 firing onchange again
+          $(this).blur();
+          
+          //# Trigger Event! onFileSelect
+          if(!MultiFile.trigger('onFileSelect', this, MultiFile)) return false;
+          //# End Event!
+          
+          //# Retrive value of selected file from element
+          var ERROR = '', v = String(this.value || ''/*.attr('value)*/);
+          
+          // check extension
+          if(MultiFile.accept && v && !v.match(MultiFile.rxAccept))//{
+            ERROR = MultiFile.STRING.denied.replace('$ext', String(v.match(/\.\w{1,4}$/gi)));
+           //}
+          //};
+          
+          // Disallow duplicates
+										for(var f in MultiFile.slaves)//{
+           if(MultiFile.slaves[f] && MultiFile.slaves[f]!=this)//{
+  										//console.log(MultiFile.slaves[f],MultiFile.slaves[f].value);
+            if(MultiFile.slaves[f].value==v)//{
+             ERROR = MultiFile.STRING.duplicate.replace('$file', v.match(/[^\/\\]+$/gi));
+            //};
+           //};
+          //};
+          
+          // Create a new file input element
+          var newEle = $(MultiFile.clone).clone();// Copy parent attributes - Thanks to Jonas Wagner
+          //# Let's remember which input we've generated so
+          // we can disable the empty ones before submission
+          // See: http://plugins.jquery.com/node/1495
+          newEle.addClass('MultiFile');
+          
+          // Handle error
+          if(ERROR!=''){
+            // Handle error
+            MultiFile.error(ERROR);
+												
+            // 2007-06-24: BUG FIX - Thanks to Adrian Wr�bel <adrian [dot] wrobel [at] gmail.com>
+            // Ditch the trouble maker and add a fresh new element
+            MultiFile.n--;
+            MultiFile.addSlave(newEle[0], slave_count);
+            slave.parent().prepend(newEle);
+            slave.remove();
+            return false;
+          };
+          
+          // Hide this element (NB: display:none is evil!)
+          $(this).css({ position:'absolute', top: '-3000px' });
+          
+          // Add new element to the form
+          slave.after(newEle);
+          
+          // Update list
+          MultiFile.addToList( this, slave_count );
+          
+          // Bind functionality
+          MultiFile.addSlave( newEle[0], slave_count+1 );
+          
+          //# Trigger Event! afterFileSelect
+          if(!MultiFile.trigger('afterFileSelect', this, MultiFile)) return false;
+          //# End Event!
+          
+        }); // slave.change()
+								
+								// Save control to element
+								$(slave).data('MultiFile', MultiFile);
+								
+       };// MultiFile.addSlave
+       // Bind a new element
+       
+       
+       
+       // Add a new file to the list
+       MultiFile.addToList = function( slave, slave_count ){
+        //if(window.console) console.log('MultiFile.addToList',slave_count);
+								
+        //# Trigger Event! onFileAppend
+        if(!MultiFile.trigger('onFileAppend', slave, MultiFile)) return false;
+        //# End Event!
+        
+        // Create label elements
+        var
+         r = $('<div class="MultiFile-label"></div>'),
+         v = String(slave.value || ''/*.attr('value)*/),
+         a = $('<span class="MultiFile-title" title="'+MultiFile.STRING.selected.replace('$file', v)+'">'+MultiFile.STRING.file.replace('$file', v.match(/[^\/\\]+$/gi)[0])+'</span>'),
+         b = $('<a class="MultiFile-remove" href="#'+MultiFile.wrapID+'">'+MultiFile.STRING.remove+'</a>');
+        
+        // Insert label
+        MultiFile.list.append(
+         r.append(b, ' ', a)
+        );
+        
+        b
+								.click(function(){
+         
+          //# Trigger Event! onFileRemove
+          if(!MultiFile.trigger('onFileRemove', slave, MultiFile)) return false;
+          //# End Event!
+          
+          MultiFile.n--;
+          MultiFile.current.disabled = false;
+          
+          // Remove element, remove label, point to current
+										MultiFile.slaves[slave_count] = null;
+										$(slave).remove();
+										$(this).parent().remove();
+										
+          // Show most current element again (move into view) and clear selection
+          $(MultiFile.current).css({ position:'', top: '' });
+										$(MultiFile.current).reset().val('').attr('value', '')[0].value = '';
+          
+          //# Trigger Event! afterFileRemove
+          if(!MultiFile.trigger('afterFileRemove', slave, MultiFile)) return false;
+          //# End Event!
+										
+          return false;
+        });
+        
+        //# Trigger Event! afterFileAppend
+        if(!MultiFile.trigger('afterFileAppend', slave, MultiFile)) return false;
+        //# End Event!
+        
+       }; // MultiFile.addToList
+       // Add element to selected files list
+       
+       
+       
+       // Bind functionality to the first element
+       if(!MultiFile.MultiFile) MultiFile.addSlave(MultiFile.e, 0);
+       
+       // Increment control count
+       //MultiFile.I++; // using window.MultiFile
+       MultiFile.n++;
+							
+							// Save control to element
+							MultiFile.E.data('MultiFile', MultiFile);
+							
+
+			//#####################################################################
+			// MAIN PLUGIN FUNCTIONALITY - END
+			//#####################################################################
+		}); // each element
+	};
+	
+	/*--------------------------------------------------------*/
+	
+	/*
+		### Core functionality and API ###
+	*/
+	$.extend($.fn.MultiFile, {
+  /**
+   * This method removes all selected files
+   *
+   * Returns a jQuery collection of all affected elements.
+   *
+   * @name reset
+   * @type jQuery
+   * @cat Plugins/MultiFile
+   * @author Diego A. (http://www.fyneworks.com/)
+   *
+   * @example $.fn.MultiFile.reset();
+   */
+  reset: function(){
+			var settings = $(this).data('MultiFile');
+			//if(settings) settings.wrapper.find('a.MultiFile-remove').click();
+			if(settings) settings.list.find('a.MultiFile-remove').click();
+   return $(this);
+  },
+  
+  
+  /**
+   * This utility makes it easy to disable all 'empty' file elements in the document before submitting a form.
+   * It marks the affected elements so they can be easily re-enabled after the form submission or validation.
+   *
+   * Returns a jQuery collection of all affected elements.
+   *
+   * @name disableEmpty
+   * @type jQuery
+   * @cat Plugins/MultiFile
+   * @author Diego A. (http://www.fyneworks.com/)
+   *
+   * @example $.fn.MultiFile.disableEmpty();
+   * @param String class (optional) A string specifying a class to be applied to all affected elements - Default: 'mfD'.
+   */
+  disableEmpty: function(klass){ klass = (typeof(klass)=='string'?klass:'')||'mfD';
+   var o = [];
+   $('input:file.MultiFile').each(function(){ if($(this).val()=='') o[o.length] = this; });
+   return $(o).each(function(){ this.disabled = true }).addClass(klass);
+  },
+  
+  
+		/**
+			* This method re-enables 'empty' file elements that were disabled (and marked) with the $.fn.MultiFile.disableEmpty method.
+			*
+			* Returns a jQuery collection of all affected elements.
+			*
+			* @name reEnableEmpty
+			* @type jQuery
+			* @cat Plugins/MultiFile
+			* @author Diego A. (http://www.fyneworks.com/)
+			*
+			* @example $.fn.MultiFile.reEnableEmpty();
+			* @param String klass (optional) A string specifying the class that was used to mark affected elements - Default: 'mfD'.
+			*/
+  reEnableEmpty: function(klass){ klass = (typeof(klass)=='string'?klass:'')||'mfD';
+   return $('input:file.'+klass).removeClass(klass).each(function(){ this.disabled = false });
+  },
+  
+  
+		/**
+			* This method will intercept other jQuery plugins and disable empty file input elements prior to form submission
+			*
+	
+			* @name intercept
+			* @cat Plugins/MultiFile
+			* @author Diego A. (http://www.fyneworks.com/)
+			*
+			* @example $.fn.MultiFile.intercept();
+			* @param Array methods (optional) Array of method names to be intercepted
+			*/
+  intercepted: {},
+  intercept: function(methods, context, args){
+   var method, value; args = args || [];
+   if(args.constructor.toString().indexOf("Array")<0) args = [ args ];
+   if(typeof(methods)=='function'){
+    $.fn.MultiFile.disableEmpty();
+    value = methods.apply(context || window, args);
+				//SEE-http://code.google.com/p/jquery-multifile-plugin/issues/detail?id=27
+				setTimeout(function(){ $.fn.MultiFile.reEnableEmpty() },1000);
+    return value;
+   };
+   if(methods.constructor.toString().indexOf("Array")<0) methods = [methods];
+   for(var i=0;i<methods.length;i++){
+    method = methods[i]+''; // make sure that we have a STRING
+    if(method) (function(method){ // make sure that method is ISOLATED for the interception
+     $.fn.MultiFile.intercepted[method] = $.fn[method] || function(){};
+     $.fn[method] = function(){
+      $.fn.MultiFile.disableEmpty();
+      value = $.fn.MultiFile.intercepted[method].apply(this, arguments);
+						//SEE-http://code.google.com/p/jquery-multifile-plugin/issues/detail?id=27
+      setTimeout(function(){ $.fn.MultiFile.reEnableEmpty() },1000);
+      return value;
+     }; // interception
+    })(method); // MAKE SURE THAT method IS ISOLATED for the interception
+   };// for each method
+  }
+ });
+	
+	/*--------------------------------------------------------*/
+	
+	/*
+		### Default Settings ###
+		eg.: You can override default control like this:
+		$.fn.MultiFile.options.accept = 'gif|jpg';
+	*/
+	$.fn.MultiFile.options = { //$.extend($.fn.MultiFile, { options: {
+		accept: '', // accepted file extensions
+		max: -1,    // maximum number of selectable files
+		
+		// name to use for newly created elements
+		namePattern: '$name', // same name by default (which creates an array)
+		
+		// STRING: collection lets you show messages in different languages
+		STRING: {
+			remove:'x',
+			denied:'You cannot select a $ext file.\nTry again...',
+			file:'$file',
+			selected:'File selected: $file',
+			duplicate:'This file has already been selected:\n$file'
+		},
+		
+		// name of methods that should be automcatically intercepted so the plugin can disable
+		// extra file elements that are empty before execution and automatically re-enable them afterwards
+  autoIntercept: [ 'submit', 'ajaxSubmit', 'ajaxForm', 'validate' /* array of methods to intercept */ ],
+		
+		// error handling function
+		error: function(s){
+			/*
+			ERROR! blockUI is not currently working in IE
+			if($.blockUI){
+				$.blockUI({
+					message: s.replace(/\n/gi,'<br/>'),
+					css: { 
+						border:'none', padding:'15px', size:'12.0pt',
+						backgroundColor:'#900', color:'#fff',
+						opacity:'.8','-webkit-border-radius': '10px','-moz-border-radius': '10px'
+					}
+				});
+				window.setTimeout($.unblockUI, 2000);
+			}
+			else//{// save a byte!
+			*/
+			 alert(s);
+			//}// save a byte!
+		}
+ }; //} });
+	
+	/*--------------------------------------------------------*/
+	
+	/*
+		### Additional Methods ###
+		Required functionality outside the plugin's scope
+	*/
+	
+	// Native input reset method - because this alone doesn't always work: $(element).val('').attr('value', '')[0].value = '';
+	$.fn.reset = function(){ return this.each(function(){ try{ this.reset(); }catch(e){} }); };
+	
+	/*--------------------------------------------------------*/
+	
+	/*
+		### Default implementation ###
+		The plugin will attach itself to file inputs
+		with the class 'multi' when the page loads
+	*/
+	$(function(){
+  //$("input:file.multi").MultiFile();
+  $("input[type=file].multi").MultiFile();
+ });
+	
+	
+	
+/*# AVOID COLLISIONS #*/
+})(jQuery);
+/*# AVOID COLLISIONS #*/
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/jquery.MultiFile.pack.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/jquery.MultiFile.pack.js
new file mode 100644
index 0000000000000000000000000000000000000000..548dfadb55f58cece4fc24e06bf7e35965ae72af
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/jquery.MultiFile.pack.js
@@ -0,0 +1,11 @@
+/*
+ ### jQuery Multiple File Upload Plugin v1.46 - 2009-05-12 ###
+ * Home: http://www.fyneworks.com/jquery/multiple-file-upload/
+ * Code: http://code.google.com/p/jquery-multifile-plugin/
+ *
+ * Dual licensed under the MIT and GPL licenses:
+ *   http://www.opensource.org/licenses/mit-license.php
+ *   http://www.gnu.org/licenses/gpl.html
+ ###
+*/
+eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';3(U.1u)(6($){$.7.2=6(h){3(5.V==0)8 5;3(T S[0]==\'19\'){3(5.V>1){m i=S;8 5.M(6(){$.7.2.13($(5),i)})};$.7.2[S[0]].13(5,$.1N(S).27(1)||[]);8 5};m h=$.N({},$.7.2.F,h||{});$(\'2d\').1B(\'2-R\').Q(\'2-R\').1n($.7.2.Z);3($.7.2.F.15){$.7.2.1M($.7.2.F.15);$.7.2.F.15=10};5.1B(\'.2-1e\').Q(\'2-1e\').M(6(){U.2=(U.2||0)+1;m e=U.2;m g={e:5,E:$(5),L:$(5).L()};3(T h==\'21\')h={l:h};m o=$.N({},$.7.2.F,h||{},($.1m?g.E.1m():($.1S?g.E.17():10))||{},{});3(!(o.l>0)){o.l=g.E.D(\'28\');3(!(o.l>0)){o.l=(u(g.e.1D.B(/\\b(l|23)\\-([0-9]+)\\b/q)||[\'\']).B(/[0-9]+/q)||[\'\'])[0];3(!(o.l>0))o.l=-1;2b o.l=u(o.l).B(/[0-9]+/q)[0]}};o.l=18 2f(o.l);o.j=o.j||g.E.D(\'j\')||\'\';3(!o.j){o.j=(g.e.1D.B(/\\b(j\\-[\\w\\|]+)\\b/q))||\'\';o.j=18 u(o.j).t(/^(j|1d)\\-/i,\'\')};$.N(g,o||{});g.A=$.N({},$.7.2.F.A,g.A);$.N(g,{n:0,J:[],2c:[],1c:g.e.I||\'2\'+u(e),1i:6(z){8 g.1c+(z>0?\'1Z\'+u(z):\'\')},G:6(a,b){m c=g[a],k=$(b).D(\'k\');3(c){m d=c(b,k,g);3(d!=10)8 d}8 1a}});3(u(g.j).V>1){g.j=g.j.t(/\\W+/g,\'|\').t(/^\\W|\\W$/g,\'\');g.1k=18 2t(\'\\\\.(\'+(g.j?g.j:\'\')+\')$\',\'q\')};g.O=g.1c+\'1P\';g.E.1l(\'<P X="2-1l" I="\'+g.O+\'"></P>\');g.1q=$(\'#\'+g.O+\'\');g.e.H=g.e.H||\'p\'+e+\'[]\';3(!g.K){g.1q.1g(\'<P X="2-K" I="\'+g.O+\'1F"></P>\');g.K=$(\'#\'+g.O+\'1F\')};g.K=$(g.K);g.16=6(c,d){g.n++;c.2=g;3(d>0)c.I=c.H=\'\';3(d>0)c.I=g.1i(d);c.H=u(g.1j.t(/\\$H/q,$(g.L).D(\'H\')).t(/\\$I/q,$(g.L).D(\'I\')).t(/\\$g/q,e).t(/\\$i/q,d));3((g.l>0)&&((g.n-1)>(g.l)))c.14=1a;g.Y=g.J[d]=c;c=$(c);c.1b(\'\').D(\'k\',\'\')[0].k=\'\';c.Q(\'2-1e\');c.1V(6(){$(5).1X();3(!g.G(\'1Y\',5,g))8 y;m a=\'\',v=u(5.k||\'\');3(g.j&&v&&!v.B(g.1k))a=g.A.1o.t(\'$1d\',u(v.B(/\\.\\w{1,4}$/q)));1p(m f 2a g.J)3(g.J[f]&&g.J[f]!=5)3(g.J[f].k==v)a=g.A.1r.t(\'$p\',v.B(/[^\\/\\\\]+$/q));m b=$(g.L).L();b.Q(\'2\');3(a!=\'\'){g.1s(a);g.n--;g.16(b[0],d);c.1t().2e(b);c.C();8 y};$(5).1v({1w:\'1O\',1x:\'-1Q\'});c.1R(b);g.1y(5,d);g.16(b[0],d+1);3(!g.G(\'1T\',5,g))8 y});$(c).17(\'2\',g)};g.1y=6(c,d){3(!g.G(\'1U\',c,g))8 y;m r=$(\'<P X="2-1W"></P>\'),v=u(c.k||\'\'),a=$(\'<1z X="2-1A" 1A="\'+g.A.12.t(\'$p\',v)+\'">\'+g.A.p.t(\'$p\',v.B(/[^\\/\\\\]+$/q)[0])+\'</1z>\'),b=$(\'<a X="2-C" 2y="#\'+g.O+\'">\'+g.A.C+\'</a>\');g.K.1g(r.1g(b,\' \',a));b.1C(6(){3(!g.G(\'22\',c,g))8 y;g.n--;g.Y.14=y;g.J[d]=10;$(c).C();$(5).1t().C();$(g.Y).1v({1w:\'\',1x:\'\'});$(g.Y).11().1b(\'\').D(\'k\',\'\')[0].k=\'\';3(!g.G(\'24\',c,g))8 y;8 y});3(!g.G(\'25\',c,g))8 y};3(!g.2)g.16(g.e,0);g.n++;g.E.17(\'2\',g)})};$.N($.7.2,{11:6(){m a=$(5).17(\'2\');3(a)a.K.26(\'a.2-C\').1C();8 $(5)},Z:6(a){a=(T(a)==\'19\'?a:\'\')||\'1E\';m o=[];$(\'1h:p.2\').M(6(){3($(5).1b()==\'\')o[o.V]=5});8 $(o).M(6(){5.14=1a}).Q(a)},1f:6(a){a=(T(a)==\'19\'?a:\'\')||\'1E\';8 $(\'1h:p.\'+a).29(a).M(6(){5.14=y})},R:{},1M:6(b,c,d){m e,k;d=d||[];3(d.1G.1H().1I("1J")<0)d=[d];3(T(b)==\'6\'){$.7.2.Z();k=b.13(c||U,d);1K(6(){$.7.2.1f()},1L);8 k};3(b.1G.1H().1I("1J")<0)b=[b];1p(m i=0;i<b.V;i++){e=b[i]+\'\';3(e)(6(a){$.7.2.R[a]=$.7[a]||6(){};$.7[a]=6(){$.7.2.Z();k=$.7.2.R[a].13(5,S);1K(6(){$.7.2.1f()},1L);8 k}})(e)}}});$.7.2.F={j:\'\',l:-1,1j:\'$H\',A:{C:\'x\',1o:\'2g 2h 2i a $1d p.\\2j 2k...\',p:\'$p\',12:\'2l 12: $p\',1r:\'2m p 2n 2o 2p 12:\\n$p\'},15:[\'1n\',\'2q\',\'2r\',\'2s\'],1s:6(s){2u(s)}};$.7.11=6(){8 5.M(6(){2v{5.11()}2w(e){}})};$(6(){$("1h[2x=p].20").2()})})(1u);',62,159,'||MultiFile|if||this|function|fn|return|||||||||||accept|value|max|var|||file|gi|||replace|String||||false||STRING|match|remove|attr||options|trigger|name|id|slaves|list|clone|each|extend|wrapID|div|addClass|intercepted|arguments|typeof|window|length||class|current|disableEmpty|null|reset|selected|apply|disabled|autoIntercept|addSlave|data|new|string|true|val|instanceKey|ext|applied|reEnableEmpty|append|input|generateID|namePattern|rxAccept|wrap|metadata|submit|denied|for|wrapper|duplicate|error|parent|jQuery|css|position|top|addToList|span|title|not|click|className|mfD|_list|constructor|toString|indexOf|Array|setTimeout|1000|intercept|makeArray|absolute|_wrap|3000px|after|meta|afterFileSelect|onFileAppend|change|label|blur|onFileSelect|_F|multi|number|onFileRemove|limit|afterFileRemove|afterFileAppend|find|slice|maxlength|removeClass|in|else|files|form|prepend|Number|You|cannot|select|nTry|again|File|This|has|already|been|ajaxSubmit|ajaxForm|validate|RegExp|alert|try|catch|type|href'.split('|'),0,{}))
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/jquery.ui.autocomplete.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/jquery.ui.autocomplete.js
new file mode 100644
index 0000000000000000000000000000000000000000..2450e7c62f029ec558ff5713cbf33d4bcd8e999a
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/jquery.ui.autocomplete.js
@@ -0,0 +1,612 @@
+/*
+ * jQuery UI Autocomplete 1.8.15
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Autocomplete
+ *
+ * Depends:
+ *	jquery.ui.core.js
+ *	jquery.ui.widget.js
+ *	jquery.ui.position.js
+ */
+(function( $, undefined ) {
+
+// used to prevent race conditions with remote data sources
+var requestIndex = 0;
+
+$.widget( "ui.autocomplete", {
+	options: {
+		appendTo: "body",
+		autoFocus: false,
+		delay: 300,
+		minLength: 1,
+		position: {
+			my: "left top",
+			at: "left bottom",
+			collision: "none"
+		},
+		source: null
+	},
+
+	pending: 0,
+
+	_create: function() {
+		var self = this,
+			doc = this.element[ 0 ].ownerDocument,
+			suppressKeyPress;
+
+		this.element
+			.addClass( "ui-autocomplete-input" )
+			.attr( "autocomplete", "off" )
+			// TODO verify these actually work as intended
+			.attr({
+				role: "textbox",
+				"aria-autocomplete": "list",
+				"aria-haspopup": "true"
+			})
+			.bind( "keydown.autocomplete", function( event ) {
+				if ( self.options.disabled || self.element.propAttr( "readOnly" ) ) {
+					return;
+				}
+
+				suppressKeyPress = false;
+				var keyCode = $.ui.keyCode;
+				switch( event.keyCode ) {
+				case keyCode.PAGE_UP:
+					self._move( "previousPage", event );
+					break;
+				case keyCode.PAGE_DOWN:
+					self._move( "nextPage", event );
+					break;
+				case keyCode.UP:
+					self._move( "previous", event );
+					// prevent moving cursor to beginning of text field in some browsers
+					event.preventDefault();
+					break;
+				case keyCode.DOWN:
+					self._move( "next", event );
+					// prevent moving cursor to end of text field in some browsers
+					event.preventDefault();
+					break;
+				case keyCode.ENTER:
+				case keyCode.NUMPAD_ENTER:
+					// when menu is open and has focus
+					if ( self.menu.active ) {
+						// #6055 - Opera still allows the keypress to occur
+						// which causes forms to submit
+						suppressKeyPress = true;
+						event.preventDefault();
+					}
+					//passthrough - ENTER and TAB both select the current element
+				case keyCode.TAB:
+					if ( !self.menu.active ) {
+						return;
+					}
+					self.menu.select( event );
+					break;
+				case keyCode.ESCAPE:
+					self.element.val( self.term );
+					self.close( event );
+					break;
+				default:
+					// keypress is triggered before the input value is changed
+					clearTimeout( self.searching );
+					self.searching = setTimeout(function() {
+						// only search if the value has changed
+						if ( self.term != self.element.val() ) {
+							self.selectedItem = null;
+							self.search( null, event );
+						}
+					}, self.options.delay );
+					break;
+				}
+			})
+			.bind( "keypress.autocomplete", function( event ) {
+				if ( suppressKeyPress ) {
+					suppressKeyPress = false;
+					event.preventDefault();
+				}
+			})
+			.bind( "focus.autocomplete", function() {
+				if ( self.options.disabled ) {
+					return;
+				}
+
+				self.selectedItem = null;
+				self.previous = self.element.val();
+			})
+			.bind( "blur.autocomplete", function( event ) {
+				if ( self.options.disabled ) {
+					return;
+				}
+
+				clearTimeout( self.searching );
+				// clicks on the menu (or a button to trigger a search) will cause a blur event
+				self.closing = setTimeout(function() {
+					self.close( event );
+					self._change( event );
+				}, 150 );
+			});
+		this._initSource();
+		this.response = function() {
+			return self._response.apply( self, arguments );
+		};
+		this.menu = $( "<ul></ul>" )
+			.addClass( "ui-autocomplete" )
+			.appendTo( $( this.options.appendTo || "body", doc )[0] )
+			// prevent the close-on-blur in case of a "slow" click on the menu (long mousedown)
+			.mousedown(function( event ) {
+				// clicking on the scrollbar causes focus to shift to the body
+				// but we can't detect a mouseup or a click immediately afterward
+				// so we have to track the next mousedown and close the menu if
+				// the user clicks somewhere outside of the autocomplete
+				var menuElement = self.menu.element[ 0 ];
+				if ( !$( event.target ).closest( ".ui-menu-item" ).length ) {
+					setTimeout(function() {
+						$( document ).one( 'mousedown', function( event ) {
+							if ( event.target !== self.element[ 0 ] &&
+								event.target !== menuElement &&
+								!$.ui.contains( menuElement, event.target ) ) {
+								self.close();
+							}
+						});
+					}, 1 );
+				}
+
+				// use another timeout to make sure the blur-event-handler on the input was already triggered
+				setTimeout(function() {
+					clearTimeout( self.closing );
+				}, 13);
+			})
+			.menu({
+				focus: function( event, ui ) {
+					var item = ui.item.data( "item.autocomplete" );
+					if ( false !== self._trigger( "focus", event, { item: item } ) ) {
+						// use value to match what will end up in the input, if it was a key event
+						if ( /^key/.test(event.originalEvent.type) ) {
+							self.element.val( item.value );
+						}
+					}
+				},
+				selected: function( event, ui ) {
+					var item = ui.item.data( "item.autocomplete" ),
+						previous = self.previous;
+
+					// only trigger when focus was lost (click on menu)
+					if ( self.element[0] !== doc.activeElement ) {
+						self.element.focus();
+						self.previous = previous;
+						// #6109 - IE triggers two focus events and the second
+						// is asynchronous, so we need to reset the previous
+						// term synchronously and asynchronously :-(
+						setTimeout(function() {
+							self.previous = previous;
+							self.selectedItem = item;
+						}, 1);
+					}
+
+					if ( false !== self._trigger( "select", event, { item: item } ) ) {
+						self.element.val( item.value );
+					}
+					// reset the term after the select event
+					// this allows custom select handling to work properly
+					self.term = self.element.val();
+
+					self.close( event );
+					self.selectedItem = item;
+				},
+				blur: function( event, ui ) {
+					// don't set the value of the text field if it's already correct
+					// this prevents moving the cursor unnecessarily
+					if ( self.menu.element.is(":visible") &&
+						( self.element.val() !== self.term ) ) {
+						self.element.val( self.term );
+					}
+				}
+			})
+			.zIndex( this.element.zIndex() + 1 )
+			// workaround for jQuery bug #5781 http://dev.jquery.com/ticket/5781
+			.css({ top: 0, left: 0 })
+			.hide()
+			.data( "menu" );
+		if ( $.fn.bgiframe ) {
+			 this.menu.element.bgiframe();
+		}
+	},
+
+	destroy: function() {
+		this.element
+			.removeClass( "ui-autocomplete-input" )
+			.removeAttr( "autocomplete" )
+			.removeAttr( "role" )
+			.removeAttr( "aria-autocomplete" )
+			.removeAttr( "aria-haspopup" );
+		this.menu.element.remove();
+		$.Widget.prototype.destroy.call( this );
+	},
+
+	_setOption: function( key, value ) {
+		$.Widget.prototype._setOption.apply( this, arguments );
+		if ( key === "source" ) {
+			this._initSource();
+		}
+		if ( key === "appendTo" ) {
+			this.menu.element.appendTo( $( value || "body", this.element[0].ownerDocument )[0] )
+		}
+		if ( key === "disabled" && value && this.xhr ) {
+			this.xhr.abort();
+		}
+	},
+
+	_initSource: function() {
+		var self = this,
+			array,
+			url;
+		if ( $.isArray(this.options.source) ) {
+			array = this.options.source;
+			this.source = function( request, response ) {
+				response( $.ui.autocomplete.filter(array, request.term) );
+			};
+		} else if ( typeof this.options.source === "string" ) {
+			url = this.options.source;
+			this.source = function( request, response ) {
+				if ( self.xhr ) {
+					self.xhr.abort();
+				}
+				self.xhr = $.ajax({
+					url: url,
+					data: request,
+					dataType: "json",
+					autocompleteRequest: ++requestIndex,
+					success: function( data, status ) {
+						if ( this.autocompleteRequest === requestIndex ) {
+							response( data );
+						}
+					},
+					error: function() {
+						if ( this.autocompleteRequest === requestIndex ) {
+							response( [] );
+						}
+					}
+				});
+			};
+		} else {
+			this.source = this.options.source;
+		}
+	},
+
+	search: function( value, event ) {
+		value = value != null ? value : this.element.val();
+
+		// always save the actual value, not the one passed as an argument
+		this.term = this.element.val();
+
+		if ( value.length < this.options.minLength ) {
+			return this.close( event );
+		}
+
+		clearTimeout( this.closing );
+		if ( this._trigger( "search", event ) === false ) {
+			return;
+		}
+
+		return this._search( value );
+	},
+
+	_search: function( value ) {
+		this.pending++;
+		this.element.addClass( "ui-autocomplete-loading" );
+
+		this.source( { term: value }, this.response );
+	},
+
+	_response: function( content ) {
+		if ( !this.options.disabled && content && content.length ) {
+			content = this._normalize( content );
+			this._suggest( content );
+			this._trigger( "open" );
+		} else {
+			this.close();
+		}
+		this.pending--;
+		if ( !this.pending ) {
+			this.element.removeClass( "ui-autocomplete-loading" );
+		}
+	},
+
+	close: function( event ) {
+		clearTimeout( this.closing );
+		if ( this.menu.element.is(":visible") ) {
+			this.menu.element.hide();
+			this.menu.deactivate();
+			this._trigger( "close", event );
+		}
+	},
+	
+	_change: function( event ) {
+		if ( this.previous !== this.element.val() ) {
+			this._trigger( "change", event, { item: this.selectedItem } );
+		}
+	},
+
+	_normalize: function( items ) {
+		// assume all items have the right format when the first item is complete
+		if ( items.length && items[0].label && items[0].value ) {
+			return items;
+		}
+		return $.map( items, function(item) {
+			if ( typeof item === "string" ) {
+				return {
+					label: item,
+					value: item
+				};
+			}
+			return $.extend({
+				label: item.label || item.value,
+				value: item.value || item.label
+			}, item );
+		});
+	},
+
+	_suggest: function( items ) {
+		var ul = this.menu.element
+			.empty()
+			.zIndex( this.element.zIndex() + 1 );
+		this._renderMenu( ul, items );
+		// TODO refresh should check if the active item is still in the dom, removing the need for a manual deactivate
+		this.menu.deactivate();
+		this.menu.refresh();
+
+		// size and position menu
+		ul.show();
+		this._resizeMenu();
+		ul.position( $.extend({
+			of: this.element
+		}, this.options.position ));
+
+		if ( this.options.autoFocus ) {
+			this.menu.next( new $.Event("mouseover") );
+		}
+	},
+
+	_resizeMenu: function() {
+		var ul = this.menu.element;
+		ul.outerWidth( Math.max(
+			ul.width( "" ).outerWidth(),
+			this.element.outerWidth()
+		) );
+	},
+
+	_renderMenu: function( ul, items ) {
+		var self = this;
+		$.each( items, function( index, item ) {
+			self._renderItem( ul, item );
+		});
+	},
+
+	_renderItem: function( ul, item) {
+		return $( "<li></li>" )
+			.data( "item.autocomplete", item )
+			.append( $( "<a></a>" ).text( item.label ) )
+			.appendTo( ul );
+	},
+
+	_move: function( direction, event ) {
+		if ( !this.menu.element.is(":visible") ) {
+			this.search( null, event );
+			return;
+		}
+		if ( this.menu.first() && /^previous/.test(direction) ||
+				this.menu.last() && /^next/.test(direction) ) {
+			this.element.val( this.term );
+			this.menu.deactivate();
+			return;
+		}
+		this.menu[ direction ]( event );
+	},
+
+	widget: function() {
+		return this.menu.element;
+	}
+});
+
+$.extend( $.ui.autocomplete, {
+	escapeRegex: function( value ) {
+		return value.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
+	},
+	filter: function(array, term) {
+		var matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), "i" );
+		return $.grep( array, function(value) {
+			return matcher.test( value.label || value.value || value );
+		});
+	}
+});
+
+}( jQuery ));
+
+/*
+ * jQuery UI Menu (not officially released)
+ * 
+ * This widget isn't yet finished and the API is subject to change. We plan to finish
+ * it for the next release. You're welcome to give it a try anyway and give us feedback,
+ * as long as you're okay with migrating your code later on. We can help with that, too.
+ *
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Menu
+ *
+ * Depends:
+ *	jquery.ui.core.js
+ *  jquery.ui.widget.js
+ */
+(function($) {
+
+$.widget("ui.menu", {
+	_create: function() {
+		var self = this;
+		this.element
+			.addClass("ui-menu ui-widget ui-widget-content ui-corner-all")
+			.attr({
+				role: "listbox",
+				"aria-activedescendant": "ui-active-menuitem"
+			})
+			.click(function( event ) {
+				if ( !$( event.target ).closest( ".ui-menu-item a" ).length ) {
+					return;
+				}
+				// temporary
+				event.preventDefault();
+				self.select( event );
+			});
+		this.refresh();
+	},
+	
+	refresh: function() {
+		var self = this;
+
+		// don't refresh list items that are already adapted
+		var items = this.element.children("li:not(.ui-menu-item):has(a)")
+			.addClass("ui-menu-item")
+			.attr("role", "menuitem");
+		
+		items.children("a")
+			.addClass("ui-corner-all")
+			.attr("tabindex", -1)
+			// mouseenter doesn't work with event delegation
+			.mouseenter(function( event ) {
+				self.activate( event, $(this).parent() );
+			})
+			.mouseleave(function() {
+				self.deactivate();
+			});
+	},
+
+	activate: function( event, item ) {
+		this.deactivate();
+		if (this.hasScroll()) {
+			var offset = item.offset().top - this.element.offset().top,
+				scroll = this.element.scrollTop(),
+				elementHeight = this.element.height();
+			if (offset < 0) {
+				this.element.scrollTop( scroll + offset);
+			} else if (offset >= elementHeight) {
+				this.element.scrollTop( scroll + offset - elementHeight + item.height());
+			}
+		}
+		this.active = item.eq(0)
+			.children("a")
+				.addClass("ui-state-hover")
+				.attr("id", "ui-active-menuitem")
+			.end();
+		this._trigger("focus", event, { item: item });
+	},
+
+	deactivate: function() {
+		if (!this.active) { return; }
+
+		this.active.children("a")
+			.removeClass("ui-state-hover")
+			.removeAttr("id");
+		this._trigger("blur");
+		this.active = null;
+	},
+
+	next: function(event) {
+		this.move("next", ".ui-menu-item:first", event);
+	},
+
+	previous: function(event) {
+		this.move("prev", ".ui-menu-item:last", event);
+	},
+
+	first: function() {
+		return this.active && !this.active.prevAll(".ui-menu-item").length;
+	},
+
+	last: function() {
+		return this.active && !this.active.nextAll(".ui-menu-item").length;
+	},
+
+	move: function(direction, edge, event) {
+		if (!this.active) {
+			this.activate(event, this.element.children(edge));
+			return;
+		}
+		var next = this.active[direction + "All"](".ui-menu-item").eq(0);
+		if (next.length) {
+			this.activate(event, next);
+		} else {
+			this.activate(event, this.element.children(edge));
+		}
+	},
+
+	// TODO merge with previousPage
+	nextPage: function(event) {
+		if (this.hasScroll()) {
+			// TODO merge with no-scroll-else
+			if (!this.active || this.last()) {
+				this.activate(event, this.element.children(".ui-menu-item:first"));
+				return;
+			}
+			var base = this.active.offset().top,
+				height = this.element.height(),
+				result = this.element.children(".ui-menu-item").filter(function() {
+					var close = $(this).offset().top - base - height + $(this).height();
+					// TODO improve approximation
+					return close < 10 && close > -10;
+				});
+
+			// TODO try to catch this earlier when scrollTop indicates the last page anyway
+			if (!result.length) {
+				result = this.element.children(".ui-menu-item:last");
+			}
+			this.activate(event, result);
+		} else {
+			this.activate(event, this.element.children(".ui-menu-item")
+				.filter(!this.active || this.last() ? ":first" : ":last"));
+		}
+	},
+
+	// TODO merge with nextPage
+	previousPage: function(event) {
+		if (this.hasScroll()) {
+			// TODO merge with no-scroll-else
+			if (!this.active || this.first()) {
+				this.activate(event, this.element.children(".ui-menu-item:last"));
+				return;
+			}
+
+			var base = this.active.offset().top,
+				height = this.element.height();
+				result = this.element.children(".ui-menu-item").filter(function() {
+					var close = $(this).offset().top - base + height - $(this).height();
+					// TODO improve approximation
+					return close < 10 && close > -10;
+				});
+
+			// TODO try to catch this earlier when scrollTop indicates the last page anyway
+			if (!result.length) {
+				result = this.element.children(".ui-menu-item:first");
+			}
+			this.activate(event, result);
+		} else {
+			this.activate(event, this.element.children(".ui-menu-item")
+				.filter(!this.active || this.first() ? ":last" : ":first"));
+		}
+	},
+
+	hasScroll: function() {
+		return this.element.height() < this.element[ $.fn.prop ? "prop" : "attr" ]("scrollHeight");
+	},
+
+	select: function( event ) {
+		this._trigger("selected", event, { item: this.active });
+	}
+});
+
+}(jQuery));
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/jquery.ui.autocomplete.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/jquery.ui.autocomplete.min.js
new file mode 100644
index 0000000000000000000000000000000000000000..fafc380e5ab33361cb79b65019cd1f4cc39f4872
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/jquery.ui.autocomplete.min.js
@@ -0,0 +1,32 @@
+/*
+ * jQuery UI Autocomplete 1.8.15
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Autocomplete
+ *
+ * Depends:
+ *	jquery.ui.core.js
+ *	jquery.ui.widget.js
+ *	jquery.ui.position.js
+ */
+(function(d){var e=0;d.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var a=this,b=this.element[0].ownerDocument,g;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!(a.options.disabled||a.element.propAttr("readOnly"))){g=
+false;var f=d.ui.keyCode;switch(c.keyCode){case f.PAGE_UP:a._move("previousPage",c);break;case f.PAGE_DOWN:a._move("nextPage",c);break;case f.UP:a._move("previous",c);c.preventDefault();break;case f.DOWN:a._move("next",c);c.preventDefault();break;case f.ENTER:case f.NUMPAD_ENTER:if(a.menu.active){g=true;c.preventDefault()}case f.TAB:if(!a.menu.active)return;a.menu.select(c);break;case f.ESCAPE:a.element.val(a.term);a.close(c);break;default:clearTimeout(a.searching);a.searching=setTimeout(function(){if(a.term!=
+a.element.val()){a.selectedItem=null;a.search(null,c)}},a.options.delay);break}}}).bind("keypress.autocomplete",function(c){if(g){g=false;c.preventDefault()}}).bind("focus.autocomplete",function(){if(!a.options.disabled){a.selectedItem=null;a.previous=a.element.val()}}).bind("blur.autocomplete",function(c){if(!a.options.disabled){clearTimeout(a.searching);a.closing=setTimeout(function(){a.close(c);a._change(c)},150)}});this._initSource();this.response=function(){return a._response.apply(a,arguments)};
+this.menu=d("<ul></ul>").addClass("ui-autocomplete").appendTo(d(this.options.appendTo||"body",b)[0]).mousedown(function(c){var f=a.menu.element[0];d(c.target).closest(".ui-menu-item").length||setTimeout(function(){d(document).one("mousedown",function(h){h.target!==a.element[0]&&h.target!==f&&!d.ui.contains(f,h.target)&&a.close()})},1);setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(c,f){f=f.item.data("item.autocomplete");false!==a._trigger("focus",c,{item:f})&&/^key/.test(c.originalEvent.type)&&
+a.element.val(f.value)},selected:function(c,f){var h=f.item.data("item.autocomplete"),i=a.previous;if(a.element[0]!==b.activeElement){a.element.focus();a.previous=i;setTimeout(function(){a.previous=i;a.selectedItem=h},1)}false!==a._trigger("select",c,{item:h})&&a.element.val(h.value);a.term=a.element.val();a.close(c);a.selectedItem=h},blur:function(){a.menu.element.is(":visible")&&a.element.val()!==a.term&&a.element.val(a.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");
+d.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();d.Widget.prototype.destroy.call(this)},_setOption:function(a,b){d.Widget.prototype._setOption.apply(this,arguments);a==="source"&&this._initSource();if(a==="appendTo")this.menu.element.appendTo(d(b||"body",this.element[0].ownerDocument)[0]);a==="disabled"&&
+b&&this.xhr&&this.xhr.abort()},_initSource:function(){var a=this,b,g;if(d.isArray(this.options.source)){b=this.options.source;this.source=function(c,f){f(d.ui.autocomplete.filter(b,c.term))}}else if(typeof this.options.source==="string"){g=this.options.source;this.source=function(c,f){a.xhr&&a.xhr.abort();a.xhr=d.ajax({url:g,data:c,dataType:"json",autocompleteRequest:++e,success:function(h){this.autocompleteRequest===e&&f(h)},error:function(){this.autocompleteRequest===e&&f([])}})}}else this.source=
+this.options.source},search:function(a,b){a=a!=null?a:this.element.val();this.term=this.element.val();if(a.length<this.options.minLength)return this.close(b);clearTimeout(this.closing);if(this._trigger("search",b)!==false)return this._search(a)},_search:function(a){this.pending++;this.element.addClass("ui-autocomplete-loading");this.source({term:a},this.response)},_response:function(a){if(!this.options.disabled&&a&&a.length){a=this._normalize(a);this._suggest(a);this._trigger("open")}else this.close();
+this.pending--;this.pending||this.element.removeClass("ui-autocomplete-loading")},close:function(a){clearTimeout(this.closing);if(this.menu.element.is(":visible")){this.menu.element.hide();this.menu.deactivate();this._trigger("close",a)}},_change:function(a){this.previous!==this.element.val()&&this._trigger("change",a,{item:this.selectedItem})},_normalize:function(a){if(a.length&&a[0].label&&a[0].value)return a;return d.map(a,function(b){if(typeof b==="string")return{label:b,value:b};return d.extend({label:b.label||
+b.value,value:b.value||b.label},b)})},_suggest:function(a){var b=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(b,a);this.menu.deactivate();this.menu.refresh();b.show();this._resizeMenu();b.position(d.extend({of:this.element},this.options.position));this.options.autoFocus&&this.menu.next(new d.Event("mouseover"))},_resizeMenu:function(){var a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth(),this.element.outerWidth()))},_renderMenu:function(a,b){var g=this;
+d.each(b,function(c,f){g._renderItem(a,f)})},_renderItem:function(a,b){return d("<li></li>").data("item.autocomplete",b).append(d("<a></a>").text(b.label)).appendTo(a)},_move:function(a,b){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term);this.menu.deactivate()}else this.menu[a](b);else this.search(null,b)},widget:function(){return this.menu.element}});d.extend(d.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,
+"\\$&")},filter:function(a,b){var g=new RegExp(d.ui.autocomplete.escapeRegex(b),"i");return d.grep(a,function(c){return g.test(c.label||c.value||c)})}})})(jQuery);
+(function(d){d.widget("ui.menu",{_create:function(){var e=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(a){if(d(a.target).closest(".ui-menu-item a").length){a.preventDefault();e.select(a)}});this.refresh()},refresh:function(){var e=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex",
+-1).mouseenter(function(a){e.activate(a,d(this).parent())}).mouseleave(function(){e.deactivate()})},activate:function(e,a){this.deactivate();if(this.hasScroll()){var b=a.offset().top-this.element.offset().top,g=this.element.scrollTop(),c=this.element.height();if(b<0)this.element.scrollTop(g+b);else b>=c&&this.element.scrollTop(g+b-c+a.height())}this.active=a.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",e,{item:a})},deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id");
+this._trigger("blur");this.active=null}},next:function(e){this.move("next",".ui-menu-item:first",e)},previous:function(e){this.move("prev",".ui-menu-item:last",e)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(e,a,b){if(this.active){e=this.active[e+"All"](".ui-menu-item").eq(0);e.length?this.activate(b,e):this.activate(b,this.element.children(a))}else this.activate(b,
+this.element.children(a))},nextPage:function(e){if(this.hasScroll())if(!this.active||this.last())this.activate(e,this.element.children(".ui-menu-item:first"));else{var a=this.active.offset().top,b=this.element.height(),g=this.element.children(".ui-menu-item").filter(function(){var c=d(this).offset().top-a-b+d(this).height();return c<10&&c>-10});g.length||(g=this.element.children(".ui-menu-item:last"));this.activate(e,g)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active||
+this.last()?":first":":last"))},previousPage:function(e){if(this.hasScroll())if(!this.active||this.first())this.activate(e,this.element.children(".ui-menu-item:last"));else{var a=this.active.offset().top,b=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var g=d(this).offset().top-a+b-d(this).height();return g<10&&g>-10});result.length||(result=this.element.children(".ui-menu-item:first"));this.activate(e,result)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active||
+this.first()?":last":":first"))},hasScroll:function(){return this.element.height()<this.element[d.fn.prop?"prop":"attr"]("scrollHeight")},select:function(e){this._trigger("selected",e,{item:this.active})}})})(jQuery);
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/jqueryFileTree/images/directory.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/jqueryFileTree/images/directory.png
new file mode 100644
index 0000000000000000000000000000000000000000..784e8fa48234f4f64b6922a6758f254ee0ca08ec
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/jqueryFileTree/images/directory.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/jqueryFileTree/images/folder_open.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/jqueryFileTree/images/folder_open.png
new file mode 100644
index 0000000000000000000000000000000000000000..4e3548352fc4a82e91ebc7e79907565e40aae457
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/jqueryFileTree/images/folder_open.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/jqueryFileTree/images/spinner.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/jqueryFileTree/images/spinner.gif
new file mode 100644
index 0000000000000000000000000000000000000000..85b99d46b9911ba53a792d716d9f688f3bb3c784
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/jqueryFileTree/images/spinner.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/jqueryFileTree/jqueryFileTree.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/jqueryFileTree/jqueryFileTree.css
new file mode 100644
index 0000000000000000000000000000000000000000..39b5770cf4547631ab0083c926f84c418a8bfe44
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/jqueryFileTree/jqueryFileTree.css
@@ -0,0 +1,81 @@
+#file_browser {
+	border: 2px solid #999;
+	height: 200px;
+	overflow: auto;
+	padding: 4px 8px;
+	background: #fff;
+	margin: 4px 0px;
+	width: 350px;
+	position:relative;
+	display:none;
+}
+.browsefiles {margin-left:5px;}
+
+ul.jqueryDirTree {
+	font-family: Verdana, sans-serif;
+	font-size: 11px;
+	line-height: 18px;
+	padding: 0px;
+	margin: 0px;
+}
+
+ul.jqueryDirTree li {
+	list-style: none;
+	padding: 2px 0px;
+	padding-left: 20px;
+	margin: 0px;
+	white-space: nowrap;
+}
+
+ul.jqueryDirTree a {
+	color: #333;
+	text-decoration: none;
+	display: block;
+	padding: 0px 2px;
+}
+
+ul.jqueryDirTree a:hover {
+	background: #bdf;
+}
+ul.jqueryDirTree li.active a {
+	background: #bdf;
+}
+ul.jqueryDirTree li.active li a {
+	background: none;
+}
+ul.jqueryDirTree li.active li a:hover {
+	background: #bdf;
+}
+
+/* Core Styles */
+.jqueryDirTree li.directory { background: url(images/directory.png) left top no-repeat; }
+.jqueryDirTree li.expanded { background: url(images/folder_open.png) left top no-repeat; }
+.jqueryDirTree li.file { background: url(images/file.png) left top no-repeat; }
+.jqueryDirTree li.wait { background: url(images/spinner.gif) left top no-repeat; }
+/* File Extensions*/
+.jqueryDirTree li.ext_3gp { background: url(images/film.png) left top no-repeat; }
+.jqueryDirTree li.ext_avi { background: url(images/film.png) left top no-repeat; }
+.jqueryDirTree li.ext_bat { background: url(images/application.png) left top no-repeat; }
+.jqueryDirTree li.ext_bmp { background: url(images/picture.png) left top no-repeat; }
+.jqueryDirTree li.ext_com { background: url(images/application.png) left top no-repeat; }
+.jqueryDirTree li.ext_exe { background: url(images/application.png) left top no-repeat; }
+.jqueryDirTree li.ext_gif { background: url(images/picture.png) left top no-repeat; }
+.jqueryDirTree li.ext_fla { background: url(images/flash.png) left top no-repeat; }
+.jqueryDirTree li.ext_jpg { background: url(images/picture.png) left top no-repeat; }
+.jqueryDirTree li.ext_jpeg { background: url(images/picture.png) left top no-repeat; }
+.jqueryDirTree li.ext_m4p { background: url(images/music.png) left top no-repeat; }
+.jqueryDirTree li.ext_mov { background: url(images/film.png) left top no-repeat; }
+.jqueryDirTree li.ext_mp3 { background: url(images/music.png) left top no-repeat; }
+.jqueryDirTree li.ext_mp4 { background: url(images/film.png) left top no-repeat; }
+.jqueryDirTree li.ext_mpg { background: url(images/film.png) left top no-repeat; }
+.jqueryDirTree li.ext_mpeg { background: url(images/film.png) left top no-repeat; }
+.jqueryDirTree li.ext_ogg { background: url(images/music.png) left top no-repeat; }
+.jqueryDirTree li.ext_pcx { background: url(images/picture.png) left top no-repeat; }
+.jqueryDirTree li.ext_pdf { background: url(images/pdf.png) left top no-repeat; }
+.jqueryDirTree li.ext_png { background: url(images/picture.png) left top no-repeat; }
+.jqueryDirTree li.ext_swf { background: url(images/flash.png) left top no-repeat; }
+.jqueryDirTree li.ext_tif { background: url(images/picture.png) left top no-repeat; }
+.jqueryDirTree li.ext_tiff { background: url(images/picture.png) left top no-repeat; }
+.jqueryDirTree li.ext_wav { background: url(images/music.png) left top no-repeat; }
+.jqueryDirTree li.ext_wmv { background: url(images/film.png) left top no-repeat; }
+.jqueryDirTree li.ext_zip { background: url(images/zip.png) left top no-repeat; }
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/jqueryFileTree/jqueryFileTree.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/jqueryFileTree/jqueryFileTree.js
new file mode 100644
index 0000000000000000000000000000000000000000..79fb6794268c56a177b62a6316c3c9c7a69fc19d
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/jqueryFileTree/jqueryFileTree.js
@@ -0,0 +1,98 @@
+// jQuery File Tree Plugin
+//
+// Version 1.01
+//
+// Cory S.N. LaViska
+// A Beautiful Site (http://abeautifulsite.net/)
+// 24 March 2008
+//
+// Visit http://abeautifulsite.net/notebook.php?article=58 for more information
+//
+// Usage: $('.fileTreeDemo').fileTree( options, callback )
+//
+// Options:  root           - root folder to display; default = /
+//           script         - location of the serverside AJAX file to use; default = jqueryFileTree.php
+//           folderEvent    - event to trigger expand/collapse; default = click
+//           expandSpeed    - default = 500 (ms); use -1 for no animation
+//           collapseSpeed  - default = 500 (ms); use -1 for no animation
+//           expandEasing   - easing function to use on expand (optional)
+//           collapseEasing - easing function to use on collapse (optional)
+//           multiFolder    - whether or not to limit the browser to one subfolder at a time
+//           loadMessage    - Message to display while initial tree loads (can be HTML)
+//
+// History:
+//
+// 1.01 - updated to work with foreign characters in directory/file names (12 April 2008)
+// 1.00 - released (24 March 2008)
+//
+// TERMS OF USE
+// 
+// This plugin is dual-licensed under the GNU General Public License and the MIT License and
+// is copyright 2008 A Beautiful Site, LLC. 
+//
+if(jQuery) (function($){
+	
+	$.extend($.fn, {
+		fileTree: function(o, h) {
+			// Defaults
+			if( !o ) var o = {};
+			if( o.root == undefined ) o.root = '/';
+			if( o.script == undefined ) o.script = 'jqueryFileTree.php';
+			if( o.folderEvent == undefined ) o.folderEvent = 'dblclick';
+			if( o.expandSpeed == undefined ) o.expandSpeed= 200;
+			if( o.collapseSpeed == undefined ) o.collapseSpeed= 500;
+			if( o.expandEasing == undefined ) o.expandEasing = null;
+			if( o.collapseEasing == undefined ) o.collapseEasing = null;
+			if( o.multiFolder == undefined ) o.multiFolder = true;
+			if( o.loadMessage == undefined ) o.loadMessage = 'Loading...';
+			
+			$(this).each( function() {
+				
+				function showTree(c, t) {
+					$(c).addClass('wait');
+					$(".jqueryFileTree.start").remove();
+					$.post(o.script, { dir: t }, function(data) {
+						$(c).find('.start').html('');
+						$(c).removeClass('wait').append(data);
+						if( o.root == t ) 
+							$(c).find('UL:hidden').show(); 
+						else 
+							$(c).find('UL:hidden').slideDown({ duration: o.expandSpeed, easing: o.expandEasing });
+						bindTree(c);
+					});
+				}
+				
+				function bindTree(t) {
+					$(t).find('li a').bind(o.folderEvent, function() {
+						if( $(this).parent().hasClass('collapsed') ) {
+							// Expand
+							if( !o.multiFolder ) {
+								$(this).parent().parent().find('ul').slideUp({ duration: o.collapseSpeed, easing: o.collapseEasing });
+								$(this).parent().parent().find('li.directory').removeClass('expanded').addClass('collapsed');
+							}
+							$(this).parent().find('ul').remove(); // cleanup
+							showTree( $(this).parent(), escape($(this).attr('rel').match( /.*\// )) );
+							$(this).parent().removeClass('collapsed').addClass('expanded');
+						} else {
+							// Collapse
+							$(this).parent().find('ul').slideUp({ duration: o.collapseSpeed, easing: o.collapseEasing });
+							$(this).parent().removeClass('expanded').addClass('collapsed');
+						}
+						return false;
+					});
+					$(t).find('li a').bind('click', function() { 
+						h($(this).attr('rel'));
+						$(this).parents('#file_browser').find('.active').removeClass('active');
+						$(this).parent().addClass('active');
+						return false;
+					}); 
+				}
+				// Loading message
+				$(this).html('<ul class="jqueryFileTree start"><li class="wait">' + o.loadMessage + '<li></ul>');
+				// Get the initial file list
+				showTree( $(this), escape(o.root) );
+			});
+		}
+	});
+	
+})(jQuery);
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/ngg.ajax.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/ngg.ajax.js
new file mode 100644
index 0000000000000000000000000000000000000000..e23799cc64a49c7defcbbee5fcb66e2cbf3e8523
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/ngg.ajax.js
@@ -0,0 +1,127 @@
+/*
+ * Ajax Plugin for NextGEN gallery
+ * Version:  1.4.1
+ * Author : Alex Rabe
+ * 
+ */ 
+(function($) {
+nggAjax = {
+		settings: {
+			url: nggAjaxSetup.url, 
+			type: "POST",
+			action: nggAjaxSetup.action,
+			operation : nggAjaxSetup.operation,
+			nonce: nggAjaxSetup.nonce,
+			ids: nggAjaxSetup.ids,
+			permission: nggAjaxSetup.permission,
+			error: nggAjaxSetup.error,
+			failure: nggAjaxSetup.failure,
+			timeout: 10000
+		},
+	
+		run: function( index ) {
+			s = this.settings;
+			var req = $.ajax({
+				type: "POST",
+			   	url: s.url,
+			   	data:"action=" + s.action + "&operation=" + s.operation + "&_wpnonce=" + s.nonce + "&image=" + s.ids[index],
+			   	cache: false,
+			   	timeout: 10000,
+			   	success: function(msg){
+			   		switch ( parseInt(msg) ) {
+			   			case -1:
+					   		nggProgressBar.addNote( nggAjax.settings.permission );
+						break;
+			   			case 0:
+					   		nggProgressBar.addNote( nggAjax.settings.error );
+						break;
+			   			case 1:
+					   		// show nothing, its better
+						break;
+						default:
+							// Return the message
+							nggProgressBar.addNote( "<strong>ID " + nggAjax.settings.ids[index] + ":</strong> " + nggAjax.settings.failure, msg );
+						break; 			   			
+			   		}
+
+			    },
+			    error: function (jqXHR, textStatus, errorThrown) {
+			    	var msg = jqXHR.responseText;
+			    	
+			    	if (msg == '') {
+			    		msg = '( ' + errorThrown + ' )';
+			    	}
+					nggProgressBar.addNote( "<strong>ID " + nggAjax.settings.ids[index] + ":</strong> " + nggAjax.settings.failure, msg);
+				},
+				complete: function () {
+					index++;
+					nggProgressBar.increase( index );
+					// parse the whole array
+					if (index < nggAjax.settings.ids.length)
+						nggAjax.run( index );
+					else 
+						nggProgressBar.finished();
+				} 
+			});
+		},
+
+		readIDs: function( index ) {
+			s = this.settings;
+			var req = $.ajax({
+				type: "POST",
+			   	url: s.url,
+			   	data:"action=" + s.action + "&operation=" + s.operation + "&_wpnonce=" + s.nonce + "&image=" + s.ids[index],
+			   	dataType: "json",
+	   			cache: false,
+			   	timeout: 10000,
+			   	success: function(msg){
+  					// join the array
+			 		imageIDS = imageIDS.concat(msg);
+				},
+			    error: function (msg) {
+					nggProgressBar.addNote( "<strong>ID " + nggAjax.settings.ids[index] + ":</strong> " + nggAjax.settings.failure, msg.responseText );
+				},
+				complete: function () {
+					index++;
+					nggProgressBar.increase( index );
+					// parse the whole array
+					if (index < nggAjax.settings.ids.length)
+						nggAjax.readIDs( index );
+					else {
+						// and now run the image operation
+						index  = 0;
+						nggAjax.settings.ids = imageIDS;
+						nggAjax.settings.operation = nextOperation;
+						nggAjax.settings.maxStep = imageIDS.length;
+						nggProgressBar.init( nggAjax.settings );
+						nggAjax.run( index );
+					}
+				} 
+			});
+		},
+	
+		init: function( s ) {
+			if (this.inited)
+				return;
+
+			var index  = 0;
+								
+			// get the settings
+			this.settings = $.extend( {}, this.settings, {}, s || {} );
+			
+			// a gallery operation need first all image ids via ajax
+			if ( this.settings.operation.substring(0, 8) == 'gallery_' ) {
+				nextOperation = this.settings.operation.substring(8);
+				//first run, get all the ids
+				this.settings.operation = 'get_image_ids';
+				imageIDS = new Array();
+				this.readIDs( index );
+			} else {
+				// start the ajax process
+				this.run( index );				
+			}
+			
+			this.inited = true;
+		}
+	}
+}(jQuery));
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/ngg.autocomplete.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/ngg.autocomplete.js
new file mode 100644
index 0000000000000000000000000000000000000000..7d697518c20c37c931a4a6b27aaf8b1850100870
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/ngg.autocomplete.js
@@ -0,0 +1,77 @@
+/*
+ * Implementation of jQuery UI Autocomplete
+ * see http://jqueryui.com/demos/autocomplete/
+ * Version:  1.0.1
+ * Author : Alex Rabe
+ * 
+ */ 
+jQuery.fn.nggAutocomplete = function ( args ) { 
+    
+    var defaults = { type: 'image',
+                     domain: '',
+                     limit: 50 };
+    
+    var s = jQuery.extend( {}, defaults, args);
+    
+    var settings = { method: 'autocomplete',
+                    type: s.type,
+                    format: 'json',
+                    callback: 'json',
+                    limit: s.limit };
+                     
+    var obj = this.selector;
+    var id  = jQuery(this).attr('id');
+    var cache = {}, lastXhr;
+    
+    // get current value of drop down field
+    var c_text = jQuery(obj + ' :selected').text();
+    var c_val  = jQuery(obj).val();
+    // IE7 / IE 8 didnt get often the correct width
+    if (s.width == undefined)  
+        var c_width = jQuery(this).width();
+    else
+        var c_width = s.width;
+    //hide first the drop down field
+    jQuery(obj).hide();
+    jQuery(obj).after('<input name="' + id + '_ac" type="text" id="' + id + '_ac"/>');
+    // Fill up current value & style
+    jQuery(obj + "_ac").val(c_text);
+    jQuery(obj + "_ac").css('width', c_width);
+    // Add the dropdown icon
+    jQuery(obj + "_ac").addClass('ui-autocomplete-start');
+    jQuery(obj + "_ac").autocomplete({
+		source: function( request, response ) {
+			var term = request.term;
+			if ( term in cache ) {
+				response( cache[ term ] );
+				return;
+			}
+            // adding more $_GET parameter
+            request = jQuery.extend( {}, settings, request);
+			lastXhr = jQuery.getJSON( s.domain, request, function( data, status, xhr ) {
+				// add term to cache
+                cache[ term ] = data;
+				if ( xhr === lastXhr )
+					response( data );
+			});
+        },
+        minLength: 0,
+        select: function( event, ui ) {
+            // adding this to the dropdown list
+            jQuery(obj).append( new Option(ui.item.label, ui.item.id) );
+            // now select it
+            jQuery(obj).val(ui.item.id);
+            jQuery(obj + "_ac").removeClass('ui-autocomplete-start');
+	   }
+	});
+
+   	jQuery(obj + "_ac").click(function() {
+   	    
+   	    var search = jQuery(obj + "_ac").val();
+        // if the value is prefilled, we pass a empty string
+        if ( search == c_text)
+            search = '';            
+        // pass empty string as value to search for, displaying all results
+        jQuery(obj + "_ac").autocomplete('search', search );
+	});
+};
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/ngg.progressbar.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/ngg.progressbar.js
new file mode 100644
index 0000000000000000000000000000000000000000..14f0838edafb3b92c87327e00cd9e93fd3b7ba1b
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/ngg.progressbar.js
@@ -0,0 +1,140 @@
+/*
+ * Progress bar Plugin for NextGEN gallery
+ * Version:  2.0.3
+ * Author : Alex Rabe
+ *
+ */
+(function($) {
+	nggProgressBar = {
+
+		settings: {
+				id:	'progressbar',
+				maxStep: 100,
+				wait: false,
+				header: '',
+                init:false
+		},
+
+		init: function( s ) {
+			s = this.settings = $.extend( {}, this.settings, {}, s || {} );
+			width = Math.round( ( 100 / s.maxStep ) * 100 ) /100;
+			// add the initial progressbar
+			if ( $( "#" + s.id + "_dialog" ).length == 0) {
+				s.header = (s.header.length > 0) ? s.header : '' ;
+				$("body").append('<div id="' + s.id + '_dialog"><div id="' + s.id + '" class="progressborder"><div class="' + s.id + '"><span>0%</span></div></div></div>');
+                // we open the dialog
+                $( "#" + s.id + "_dialog" ).dialog({
+            		width: 640,
+                    resizable : true,
+            		modal: true,
+                    title: s.header,
+					position: {
+						my:		'center',
+						at:		'center',
+						of:		this.find_parent(window)
+					}
+            	});
+			}
+            // get the pointer to the dialog
+            this.div = $('#' + s.id + '_dialog');
+            s.init = true;
+		},
+
+		/**
+		* Finds the parent window for the current child window
+		*/
+	   find_parent: function(child){
+		   var retval = child;
+		   try {
+		   	if (retval && retval.parent)
+		   		retval = retval.parent;
+		   }
+		   catch (Exception){
+		   }
+		   return retval;
+	   },
+
+		addMessage: function( message ) {
+			s = this.settings;
+			if (!s.init) this.init();
+			var div = this.div;
+			if ( div.find("#" + s.id + "_message").length == 0)
+				div.append('<div class="' + s.id + '_message"><span style="display:block" id="' + s.id + '_message">' + message + '</span></div>');
+			else
+				$("#" + s.id + "_message").html( message );
+		},
+
+		addNote: function( note, detail ) {
+			s = this.settings;
+			if (!s.init) this.init();
+			var div = this.div;
+			s.wait = true;
+			if ( div.find("#" + s.id + "_note").length == 0)
+				div.append('<ul id="' + s.id + '_note">&nbsp;</ul>');
+
+			if (detail)
+				$("#" + s.id + "_note").append("<li>" + note + "<div class='show_details'><span>[more]</span><br />" + detail + "</div></li>");
+			else
+				$("#" + s.id + "_note").append("<li>" + note + "</li>");
+            // increase the height to show the note
+            div.dialog("option", "height", 220);
+		},
+
+		increase: function( step ) {
+			s = this.settings;
+			var value = step * width + "%";
+			var rvalue = Math.round (step * width) + "%" ;
+			$("#" + s.id + " div").width( value );
+			$("#" + s.id + " span").html( rvalue );
+
+            // Try to restore ATP tabs
+            $(this.find_parent(window).document).scrollTop(0);
+            var tinymce_frame = $(this.find_parent(window).frameElement).parent();
+            var css_top = tinymce_frame.css('top');
+            setTimeout(function(){
+                tinymce_frame.css('top', 0);
+            }, 1);
+            setTimeout(function(){
+                tinymce_frame.css('top', css_top);
+            }, 3);
+		},
+
+		finished: function() {
+			s = this.settings;
+			$("#" + s.id + " div").width( '100%' );
+			$("#" + s.id + " span").html( '100%' );
+			// in the case we add a note , we should wait for a click
+			var div = this.div;
+			var progressBar = this;
+			if (s.wait) {
+                $("#" + s.id).delay(1000).hide("slow");
+				div.click(function () {
+					progressBar.remove_dialog(false, 0);
+	    		});
+	    	}
+			else {
+                window.setTimeout(function() {
+					progressBar.remove_dialog(true, 1);
+                }, 1000);
+	    	}
+		},
+
+		remove_dialog: function(delay, value){
+			// Destroy the dialog
+			if (delay)
+				$("#" + s.id + "_dialog" ).delay(4000).dialog("destroy");
+			else
+				$("#" + s.id + "_dialog").dialog("destroy");
+
+			// Remove the dialog element
+			$("#" + s.id + "_dialog").remove();
+
+			// In the case it's the manage page, force a submit
+			$('.nggform').prepend("<input type=\"hidden\" name=\"ajax_callback\" value=\""+value+"\">");
+			if (delay)
+				$('.nggform').delay(4000).submit();
+			else
+				$('.nggform').submit();
+		}
+	};
+})(jQuery);
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/ngg_social_media.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/ngg_social_media.js
new file mode 100644
index 0000000000000000000000000000000000000000..b4d496b58c258cc2639a4f301a11ebc36942c18a
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/ngg_social_media.js
@@ -0,0 +1,8 @@
+!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
+(function(d, s, id) {
+  var js, fjs = d.getElementsByTagName(s)[0];
+  if (d.getElementById(id)) return;
+  js = d.createElement(s); js.id = id;
+  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
+  fjs.parentNode.insertBefore(js, fjs);
+}(document, 'script', 'facebook-jssdk'));
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/plupload.handler.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/plupload.handler.js
new file mode 100644
index 0000000000000000000000000000000000000000..3d8f5b9a731c461e5d3c563e8e332cd226eb4ef7
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/js/plupload.handler.js
@@ -0,0 +1,247 @@
+/**
+ * NextGEN Gallery - plupload Handlers
+ *
+ * Built on top of the plupload library
+ *   http://www.plupload.com version 1.4.2
+ *
+ *  version 1.0.0
+ */
+
+// on load change the upload to plupload
+function initUploader() {
+
+	jQuery(document).ready(function($){
+
+    	/* Not working in chrome, needs rework
+        var dropElm = jQuery('#' + uploader.settings.drop_element);
+    	if (dropElm.length && uploader.features.dragdrop) {
+    		dropElm.bind('dragenter', function() {
+    			jQuery(this).css('border', '3px dashed #cccccc');
+    		});
+    		dropElm.bind('dragout drop', function() {
+    			jQuery(this).css('border', 'none');
+    		});
+    	}*/
+
+        // enable or disable the resize feature
+		jQuery('#image_resize').bind('change', function() {
+			var arg = jQuery(this).prop('checked');
+			setResize( arg );
+
+			if ( arg )
+				setUserSetting('ngg_upload_resize', '1');
+			else
+				deleteUserSetting('ngg_upload_resize');
+		});
+
+        // get user settings from cookie
+        setResize( getUserSetting('ngg_upload_resize', false) );
+
+        if ( uploader.features.dragdrop )
+				jQuery('.ngg-dragdrop-info').show();
+
+        jQuery("#uploadimage_btn").after("<input class='button-primary' type='button' name='uploadimage' id='plupload_btn' value='" + uploader.settings.i18n.upload + "' />")
+                                  .remove();
+    	jQuery("#plupload_btn").click( function() { uploader.start(); } );
+	});
+}
+
+// called when a file is added
+function fileQueued( fileObj ) {
+    debug('[FilesAdded]', fileObj);
+
+	filesize = " (" + plupload.formatSize(fileObj.size) + ") ";
+	jQuery("#txtFileName").val(fileObj.name);
+	jQuery("#uploadQueue")
+		.append("<div id='" + fileObj.id + "' class='nggUploadItem'> [<a href=''>" + uploader.settings.i18n.remove + "</a>] " + fileObj.name + filesize + "</div>")
+		.children("div:last").slideDown("slow")
+		.end();
+    jQuery('#' + fileObj.id + ' a').click(function(e) {
+        jQuery('#' + fileObj.id).remove();
+		uploader.removeFile(fileObj);
+		e.preventDefault();
+	});
+}
+
+// called before the uploads start
+function uploadStart(fileObj) {
+    debug('[uploadStart]');
+    nggProgressBar.init(nggAjaxOptions);
+	// check if a gallery is selected
+	if (jQuery('#galleryselect').val() > "0") {
+	    debug('[gallery selected]');
+		// update the selected gallery in the post_params
+		uploader.settings.multipart_params.galleryselect = jQuery('#galleryselect').val();
+	} else {
+        debug('[gallery not selected]');
+		jQuery('#uploadimage_form').prepend("<input type=\"hidden\" name=\"swf_callback\" value=\"-1\">");
+		jQuery("#uploadimage_form").submit();
+	}
+	return true;
+}
+
+// called during the upload progress
+function uploadProgress(fileObj, bytesDone, bytesTotal) {
+	var percent = 100;
+	if (bytesTotal != undefined)
+		percent = Math.ceil((bytesDone / bytesTotal) * 100);
+    debug('[uploadProgress]', fileObj.name + ' : ' + percent + "%");
+    nggProgressBar.increase( percent );
+	jQuery("#progressbar span").text(percent + "% - " + fileObj.name);
+}
+
+// called when all files are uploaded
+function uploadComplete(fileObj) {
+    debug('[uploadComplete]');
+
+	// Upload the next file until queue is empty
+	if ( uploader.total.queued == 0) {
+        //TODO: we submit here no error code
+		jQuery('#uploadimage_form').prepend("<input type=\"hidden\" name=\"swf_callback\" value=\"0\">");
+        nggProgressBar.finished();
+		jQuery("#uploadimage_form").submit();
+	}
+}
+
+// called when the file is uploaded
+function uploadSuccess(fileObj, serverData) {
+    debug('[uploadSuccess]', serverData);
+
+    if (serverData.response != 0 && serverData.response != '<pre>0</pre>')
+        nggProgressBar.addNote("<strong>ERROR</strong>: " + fileObj.name + " : " + serverData.response);
+
+	jQuery("#" + fileObj.id).hide("slow");
+	jQuery("#" + fileObj.id).remove();
+}
+
+function cancelUpload() {
+	uploader.stop();
+	jQuery.each(uploader.files, function(i,file) {
+		if (file.status == plupload.STOPPED)
+			jQuery('#' + file.id).remove();
+	});
+}
+
+function uploadError(fileObj, errorCode, message) {
+    debug('[uploadError]', errorCode, message);
+	switch (errorCode) {
+		case plupload.FAILED:
+			error_name = fileObj.name + " : " + pluploadL10n.upload_failed;
+			break;
+		case plupload.FILE_EXTENSION_ERROR:
+			error_name = fileObj.name + " : " + pluploadL10n.invalid_filetype;
+			break;
+		case plupload.FILE_SIZE_ERROR:
+			error_name = fileObj.name + " : " + pluploadL10n.upload_limit_exceeded;
+			break;
+		case plupload.IMAGE_FORMAT_ERROR:
+			error_name = fileObj.name + " : " + pluploadL10n.not_an_image;
+			break;
+		case plupload.IMAGE_MEMORY_ERROR:
+			error_name = fileObj.name + " : " + pluploadL10n.image_memory_exceeded;
+			break;
+		case plupload.IMAGE_DIMENSIONS_ERROR:
+			error_name = fileObj.name + " : " + pluploadL10n.image_dimensions_exceeded;
+			break;
+		case plupload.GENERIC_ERROR:
+			error_name = pluploadL10n.upload_failed;
+			break;
+		case plupload.IO_ERROR:
+			error_name = pluploadL10n.io_error;
+			break;
+		case plupload.HTTP_ERROR:
+			error_name = pluploadL10n.http_error;
+			break;
+		case plupload.INIT_ERROR:
+            /* what should we do in this case ? */
+			//switchUploader(0);
+			//jQuery('.upload-html-bypass').hide();
+			break;
+		case plupload.SECURITY_ERROR:
+			error_name = pluploadL10n.security_error;
+			break;
+		case plupload.UPLOAD_ERROR.UPLOAD_STOPPED:
+		case plupload.UPLOAD_ERROR.FILE_CANCELLED:
+			break;
+		default:
+			FileError(fileObj, pluploadL10n.default_error);
+	}
+	nggProgressBar.addNote("<strong>ERROR " + error_name + " </strong>: " + message);
+
+	jQuery("#" + fileObj.id).hide("slow");
+	jQuery("#" + fileObj.id).remove();
+}
+
+// client side resize feature
+function setResize(arg) {
+	if ( arg ) {
+        debug('[enable resize]');
+		if ( uploader.features.jpgresize )
+			uploader.settings['resize'] = { width: resize_width, height: resize_height, quality: resize_quality };
+		else
+			uploader.settings.multipart_params.image_resize = true;
+	} else {
+        debug('[disable resize]');
+		delete(uploader.settings.resize);
+		delete(uploader.settings.multipart_params.image_resize);
+	}
+}
+
+function debug() {
+    if ( uploader.settings.debug ) {
+        plupload.each(arguments, function(message) {
+        	var exceptionMessage, exceptionValues = [];
+
+        	// Check for an exception object and print it nicely
+        	if (typeof message === "object" && typeof message.name === "string" && typeof message.message === "string") {
+        		for (var key in message) {
+        			if (message.hasOwnProperty(key)) {
+        				exceptionValues.push(key + ": " + message[key]);
+        			}
+        		}
+        		exceptionMessage = exceptionValues.join("\n") || "";
+        		exceptionValues = exceptionMessage.split("\n");
+        		exceptionMessage = "EXCEPTION: " + exceptionValues.join("\nEXCEPTION: ");
+        		if (window.console)
+        			console.log(exceptionMessage);
+        		else
+        			debugConsole(exceptionMessage);
+        	} else {
+        		if (window.console)
+        			console.log(message);
+        		else
+        			debugConsole(message);
+        	}
+        });
+    }
+};
+
+function debugConsole(message) {
+	var console, documentForm;
+
+	try {
+		console = document.getElementById("plupload_Console");
+
+		if (!console) {
+			documentForm = document.createElement("form");
+			document.getElementsByTagName("body")[0].appendChild(documentForm);
+
+			console = document.createElement("textarea");
+			console.id = "plupload_Console";
+			console.style.fontFamily = "monospace";
+			console.setAttribute("wrap", "off");
+			console.wrap = "off";
+			console.style.overflow = "auto";
+			console.style.width = "99%";
+			console.style.height = "350px";
+			console.style.margin = "5px";
+			documentForm.appendChild(console);
+		}
+
+		console.value += message + "\n";
+
+		console.scrollTop = console.scrollHeight - console.clientHeight;
+	} catch (ex) {
+		alert("Exception: " + ex.name + " Message: " + ex.message);
+	}
+};
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php
new file mode 100644
index 0000000000000000000000000000000000000000..fd4f37dda533d99d02df341639ad2fe40803525f
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php
@@ -0,0 +1,455 @@
+<?php
+
+if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { 	die('You are not allowed to call this page directly.'); }
+
+// *** show main gallery list
+function nggallery_manage_gallery_main() {
+
+	global $ngg, $nggdb, $wp_query;
+
+	//Build the pagination for more than 25 galleries
+    $_GET['paged'] = isset($_GET['paged']) && ($_GET['paged'] > 0) ? absint($_GET['paged']) : 1;
+
+    $items_per_page = 25;
+
+	$start = ( $_GET['paged'] - 1 ) * $items_per_page;
+
+    $order = ( isset ( $_GET['order'] ) && $_GET['order'] == 'desc' ) ? 'DESC' : 'ASC';
+    $orderby = ( isset ( $_GET['orderby'] ) && ( in_array( $_GET['orderby'], array('gid', 'title', 'author') )) ) ? $_GET['orderby'] : 'gid';
+
+	$gallerylist = $nggdb->find_all_galleries( $orderby, $order , TRUE, $items_per_page, $start, false);
+	$wp_list_table = new _NGG_Galleries_List_Table('nggallery-manage-gallery');
+
+	?>
+	<script type="text/javascript">
+	<!--
+
+	// Listen for frame events
+	jQuery(function($){
+		if ($(this).data('ready')) return;
+
+		if (window.Frame_Event_Publisher) {
+
+			// If a new gallery is added, refresh the page
+			Frame_Event_Publisher.listen_for('attach_to_post:new_gallery attach_to_post:manage_images attach_to_post:images_added',function(){
+				window.location.href = window.location.href;
+			});
+		}
+
+		$(this).data('ready', true);
+	});
+
+
+	function checkAll(form)
+	{
+		for (i = 0, n = form.elements.length; i < n; i++) {
+			if(form.elements[i].type == "checkbox") {
+				if(form.elements[i].name == "doaction[]") {
+					if(form.elements[i].checked == true)
+						form.elements[i].checked = false;
+					else
+						form.elements[i].checked = true;
+				}
+			}
+		}
+	}
+
+	function getNumChecked(form)
+	{
+		var num = 0;
+		for (i = 0, n = form.elements.length; i < n; i++) {
+			if(form.elements[i].type == "checkbox") {
+				if(form.elements[i].name == "doaction[]")
+					if(form.elements[i].checked == true)
+						num++;
+			}
+		}
+		return num;
+	}
+
+	// this function check for a the number of selected images, sumbmit false when no one selected
+	function checkSelected() {
+
+        if (typeof document.activeElement == "undefined" && document.addEventListener) {
+        	document.addEventListener("focus", function (e) {
+        		document.activeElement = e.target;
+        	}, true);
+        }
+
+        if ( document.activeElement.name == 'post_paged' )
+            return true;
+
+		var numchecked = getNumChecked(document.getElementById('editgalleries'));
+
+		if(numchecked < 1) {
+			alert('<?php echo esc_js(__('No images selected', 'nggallery')); ?>');
+			return false;
+		}
+
+		actionId = jQuery('#bulkaction').val();
+
+		switch (actionId) {
+			case "resize_images":
+                showDialog('resize_images', '<?php echo esc_js(__('Resize images','nggallery')); ?>');
+				return false;
+				break;
+			case "new_thumbnail":
+				showDialog('new_thumbnail', '<?php echo esc_js(__('Create new thumbnails','nggallery')); ?>');
+				return false;
+				break;
+		}
+
+		return confirm('<?php echo sprintf(esc_js(__("You are about to start the bulk edit for %s galleries \n \n 'Cancel' to stop, 'OK' to proceed.",'nggallery')), "' + numchecked + '") ; ?>');
+	}
+
+	function showDialog( windowId, title ) {
+		var form = document.getElementById('editgalleries');
+		var elementlist = "";
+		for (i = 0, n = form.elements.length; i < n; i++) {
+			if(form.elements[i].type == "checkbox") {
+				if(form.elements[i].name == "doaction[]")
+					if(form.elements[i].checked == true)
+						if (elementlist == "")
+							elementlist = form.elements[i].value;
+						else
+							elementlist += "," + form.elements[i].value ;
+			}
+		}
+		jQuery("#" + windowId + "_bulkaction").val(jQuery("#bulkaction").val());
+		jQuery("#" + windowId + "_imagelist").val(elementlist);
+        // now show the dialog
+    	jQuery( "#" + windowId ).dialog({
+    		width: 640,
+            resizable : false,
+    		modal: true,
+            title: title,
+			position: {
+				my:		'center',
+				at:		'center',
+				of:		window.parent
+			}
+    	});
+        jQuery("#" + windowId + ' .dialog-cancel').click(function() { jQuery( "#" + windowId ).dialog("close"); });
+	}
+
+	function showAddGallery() {
+    	jQuery( "#addGallery").dialog({
+    		width: 640,
+            resizable : false,
+    		modal: true,
+            title: '<?php echo esc_js(__('Add new gallery','nggallery')); ?>',
+			position: {
+				my:		'center',
+				at:		'center',
+				of:		window.parent
+			}
+    	});
+        jQuery("#addGallery .dialog-cancel").click(function() { jQuery( "#addGallery" ).dialog("close"); });
+	}
+	//-->
+	</script>
+	<div class="wrap">
+		<?php //include('templates/social_media_buttons.php'); ?>
+		<?php screen_icon( 'nextgen-gallery' ); ?>
+		<h2><?php echo _n( 'Manage Galleries', 'Manage Galleries', 2, 'nggallery'); ?></h2>
+		<form class="search-form" action="" method="get">
+		<p class="search-box">
+			<label class="hidden" for="media-search-input"><?php _e( 'Search Images', 'nggallery' ); ?>:</label>
+			<input type="hidden" id="page-name" name="page" value="nggallery-manage-gallery" />
+			<input type="text" id="media-search-input" name="s" value="<?php the_search_query(); ?>" />
+			<input type="submit" value="<?php _e( 'Search Images', 'nggallery' ); ?>" class="button" />
+		</p>
+		</form>
+		<form id="editgalleries" class="nggform" method="POST" action="<?php echo $ngg->manage_page->base_page . '&amp;paged=' . $_GET['paged']; ?>" accept-charset="utf-8">
+		<?php wp_nonce_field('ngg_bulkgallery') ?>
+		<input type="hidden" name="page" value="manage-galleries" />
+
+		<div class="tablenav top">
+
+			<div class="alignleft actions">
+				<?php if ( function_exists('json_encode') ) : ?>
+				<select name="bulkaction" id="bulkaction">
+					<option value="no_action" ><?php _e("Bulk actions",'nggallery'); ?></option>
+					<option value="delete_gallery" ><?php _e("Delete",'nggallery'); ?></option>
+                    <option value="set_watermark" ><?php _e("Set watermark",'nggallery'); ?></option>
+					<option value="new_thumbnail" ><?php _e("Create new thumbnails",'nggallery'); ?></option>
+					<option value="resize_images" ><?php _e("Resize images",'nggallery'); ?></option>
+					<option value="import_meta" ><?php _e("Import metadata",'nggallery'); ?></option>
+					<option value="recover_images" ><?php _e("Recover from backup",'nggallery'); ?></option>
+				</select>
+				<input name="showThickbox" class="button-secondary" type="submit" value="<?php _e('Apply','nggallery'); ?>" onclick="if ( !checkSelected() ) return false;" />
+				<?php endif; ?>
+				<?php if ( current_user_can('NextGEN Upload images') && nggGallery::current_user_can( 'NextGEN Add new gallery' ) ) : ?>
+					<input name="doaction" class="button-secondary action" type="submit" onclick="showAddGallery(); return false;" value="<?php _e('Add new gallery', 'nggallery') ?>"/>
+				<?php endif; ?>
+			</div>
+
+
+        <?php $ngg->manage_page->pagination( 'top', $_GET['paged'], $nggdb->paged['total_objects'], $nggdb->paged['objects_per_page']  ); ?>
+
+		</div>
+		<table class="wp-list-table widefat fixed" cellspacing="0">
+			<thead>
+			<tr>
+<?php $wp_list_table->print_column_headers(true); ?>
+			</tr>
+			</thead>
+			<tfoot>
+			<tr>
+<?php $wp_list_table->print_column_headers(false); ?>
+			</tr>
+			</tfoot>
+			<tbody id="the-list">
+<?php
+
+if($gallerylist) {
+    //get the columns
+	$gallery_columns = $wp_list_table->get_columns();
+	$hidden_columns  = get_hidden_columns('nggallery-manage-gallery');
+	$num_columns     = count($gallery_columns) - count($hidden_columns);
+
+	foreach($gallerylist as $gallery) {
+		$alternate = ( !isset($alternate) || $alternate == 'class="alternate"' ) ? '' : 'class="alternate"';
+		$gid = $gallery->gid;
+		$name = (empty($gallery->title) ) ? $gallery->name : $gallery->title;
+		$author_user = get_userdata( (int) $gallery->author );
+		?>
+		<tr id="gallery-<?php echo $gid ?>" <?php echo $alternate; ?> >
+		<?php
+		foreach($gallery_columns as $gallery_column_key => $column_display_name) {
+			$class = "class=\"$gallery_column_key column-$gallery_column_key\"";
+
+			$style = '';
+			if ( in_array($gallery_column_key, $hidden_columns) )
+				$style = ' style="display:none;"';
+
+			$attributes = "$class$style";
+
+			switch ($gallery_column_key) {
+				case 'cb' :
+					?>
+        			<th scope="row" class="column-cb check-column">
+        				<?php if (nggAdmin::can_manage_this_gallery($gallery->author)) { ?>
+        					<input name="doaction[]" type="checkbox" value="<?php echo $gid ?>" />
+        				<?php } ?>
+        			</th>
+        			<?php
+    			break;
+    			case 'id' :
+    			    ?>
+					<td <?php echo $attributes ?>><?php echo $gid; ?></td>
+					<?php
+    			break;
+    			case 'title' :
+    			    ?>
+        			<td class="title column-title">
+        				<?php if (nggAdmin::can_manage_this_gallery($gallery->author)) { ?>
+        					<a href="<?php echo wp_nonce_url( $ngg->manage_page->base_page . '&amp;mode=edit&amp;gid=' . $gid, 'ngg_editgallery')?>" class='edit' title="<?php _e('Edit'); ?>" >
+        						<?php echo esc_html( nggGallery::i18n($name) ); ?>
+        					</a>
+        				<?php } else { ?>
+        					<?php echo esc_html( nggGallery::i18n($gallery->title) ); ?>
+        				<?php } ?>
+                        <div class="row-actions"></div>
+        			</td>
+        			<?php
+    			break;
+    			case 'description' :
+    			    ?>
+					<td <?php echo $attributes ?>><?php echo esc_html( nggGallery::i18n($gallery->galdesc) ); ?>&nbsp;</td>
+					<?php
+    			break;
+    			case 'author' :
+    			    ?>
+					<td <?php echo $attributes ?>><?php echo esc_html( $author_user->display_name ); ?></td>
+					<?php
+    			break;
+    			case 'page_id' :
+    			    ?>
+        			<td <?php echo $attributes ?>><?php echo $gallery->pageid; ?></td>
+        			<?php
+    			break;
+    			case 'quantity' :
+    			    ?>
+        			<td <?php echo $attributes ?>><?php echo $gallery->counter; ?></td>
+        			<?php
+    			break;
+    			default :
+					?>
+					<td <?php echo $attributes ?>><?php do_action('ngg_manage_gallery_custom_column', $gallery_column_key, $gid); ?></td>
+					<?php
+				break;
+				}
+	        } ?>
+		</tr>
+		<?php
+	}
+} else {
+	echo '<tr><td colspan="7" align="center"><strong>' . __('No entries found', 'nggallery') . '</strong></td></tr>';
+}
+?>
+			</tbody>
+		</table>
+        <div class="tablenav bottom">
+		<?php $ngg->manage_page->pagination( 'bottom', $_GET['paged'], $nggdb->paged['total_objects'], $nggdb->paged['objects_per_page']  ); ?>
+        </div>
+		</form>
+	</div>
+	<!-- #addGallery -->
+	<div id="addGallery" style="display: none;" >
+		<form id="form-tags" method="POST" accept-charset="utf-8">
+		<?php wp_nonce_field('ngg_addgallery'); ?>
+		<input type="hidden" name="page" value="manage-galleries" />
+		<table width="100%" border="0" cellspacing="3" cellpadding="3" >
+		  	<tr>
+		    	<td>
+					<strong><?php _e('New Gallery', 'nggallery') ;?>:</strong> <input type="text" size="35" name="galleryname" value="" /><br />
+					<?php if(!is_multisite()) { ?>
+					<?php _e('Create a new , empty gallery below the folder', 'nggallery') ;?>  <strong><?php echo $ngg->options['gallerypath']; ?></strong><br />
+					<?php } ?>
+					<i>( <?php _e('Allowed characters for file and folder names are', 'nggallery') ;?>: a-z, A-Z, 0-9, -, _ )</i>
+				</td>
+		  	</tr>
+            <?php do_action('ngg_add_new_gallery_form'); ?>
+		  	<tr align="right">
+		    	<td class="submit">
+		    		<input class="button-primary" type="submit" name="addgallery" value="<?php _e('OK','nggallery'); ?>" />
+		    		&nbsp;
+		    		<input class="button-secondary dialog-cancel" type="reset" value="&nbsp;<?php _e('Cancel', 'nggallery'); ?>&nbsp;" />
+		    	</td>
+			</tr>
+		</table>
+		</form>
+	</div>
+	<!-- /#addGallery -->
+
+	<!-- #resize_images -->
+	<div id="resize_images" style="display: none;" >
+		<form id="form-resize-images" method="POST" accept-charset="utf-8">
+		<?php wp_nonce_field('ngg_thickbox_form') ?>
+		<input type="hidden" id="resize_images_imagelist" name="TB_imagelist" value="" />
+		<input type="hidden" id="resize_images_bulkaction" name="TB_bulkaction" value="" />
+		<input type="hidden" name="page" value="manage-galleries" />
+		<table width="100%" border="0" cellspacing="3" cellpadding="3" >
+			<tr valign="top">
+				<td>
+					<strong><?php _e('Resize Images to', 'nggallery'); ?>:</strong>
+				</td>
+				<td>
+					<input type="text" size="5" name="imgWidth" value="<?php echo $ngg->options['imgWidth']; ?>" /> x <input type="text" size="5" name="imgHeight" value="<?php echo $ngg->options['imgHeight']; ?>" />
+					<br /><small><?php _e('Width x height (in pixel). NextGEN Gallery will keep ratio size','nggallery') ?></small>
+				</td>
+			</tr>
+		  	<tr align="right">
+		    	<td colspan="2" class="submit">
+		    		<input class="button-primary" type="submit" name="TB_ResizeImages" value="<?php _e('OK', 'nggallery'); ?>" />
+		    		&nbsp;
+		    		<input class="button-secondary dialog-cancel" type="reset" value="&nbsp;<?php _e('Cancel', 'nggallery'); ?>&nbsp;" />
+		    	</td>
+			</tr>
+		</table>
+		</form>
+	</div>
+	<!-- /#resize_images -->
+
+	<!-- #new_thumbnail -->
+	<div id="new_thumbnail" style="display: none;" >
+		<form id="form-new-thumbnail" method="POST" accept-charset="utf-8">
+		<?php wp_nonce_field('ngg_thickbox_form') ?>
+		<input type="hidden" id="new_thumbnail_imagelist" name="TB_imagelist" value="" />
+		<input type="hidden" id="new_thumbnail_bulkaction" name="TB_bulkaction" value="" />
+		<input type="hidden" name="page" value="manage-galleries" />
+		<table width="100%" border="0" cellspacing="3" cellpadding="3" >
+			<tr valign="top">
+				<th align="left"><?php _e('Width x height (in pixel)','nggallery') ?></th>
+				<td>
+				<?php include(dirname(__FILE__) . '/thumbnails-template.php'); ?>
+				</td>
+			</tr>
+			<tr valign="top">
+				<th align="left"><?php _e('Set fix dimension','nggallery') ?></th>
+				<td><input type="checkbox" name="thumbfix" value="1" <?php checked('1', $ngg->options['thumbfix']); ?> />
+				<br /><small><?php _e('Ignore the aspect ratio, no portrait thumbnails','nggallery') ?></small></td>
+			</tr>
+		  	<tr align="right">
+		    	<td colspan="2" class="submit">
+		    		<input class="button-primary" type="submit" name="TB_NewThumbnail" value="<?php _e('OK', 'nggallery');?>" />
+		    		&nbsp;
+		    		<input class="button-secondary dialog-cancel" type="reset" value="&nbsp;<?php _e('Cancel', 'nggallery'); ?>&nbsp;" />
+		    	</td>
+			</tr>
+		</table>
+		</form>
+	</div>
+	<!-- /#new_thumbnail -->
+
+<?php
+}
+
+/**
+ * Construtor class to create the table layout
+ *
+ * @package WordPress
+ * @subpackage List_Table
+ * @since 1.8.0
+ * @access private
+ */
+class _NGG_Galleries_List_Table extends WP_List_Table {
+	var $_screen;
+	var $_columns;
+
+	function _NGG_Galleries_List_Table( $screen ) {
+		if ( is_string( $screen ) )
+			$screen = convert_to_screen( $screen );
+
+		$this->_screen = $screen;
+		$this->_columns = array() ;
+
+		add_filter( 'manage_' . $screen->id . '_columns', array( &$this, 'get_columns' ), 0 );
+	}
+
+	function get_column_info() {
+		$columns = get_column_headers( $this->_screen );
+		$hidden = get_hidden_columns( $this->_screen );
+		$_sortable = $this->get_sortable_columns();
+
+		foreach ( $_sortable as $id => $data ) {
+			if ( empty( $data ) )
+				continue;
+
+			$data = (array) $data;
+			if ( !isset( $data[1] ) )
+				$data[1] = false;
+
+			$sortable[$id] = $data;
+		}
+
+		return array( $columns, $hidden, $sortable );
+	}
+
+    // define the columns to display, the syntax is 'internal name' => 'display name'
+	function get_columns() {
+    	$columns = array();
+
+    	$columns['cb'] = '<input name="checkall" type="checkbox" onclick="checkAll(document.getElementById(\'editgalleries\'));" />';
+    	$columns['id'] = __('ID');
+    	$columns['title'] = _n( 'Gallery', 'Galleries', 1, 'nggallery');
+    	$columns['description'] = __('Description', 'nggallery');
+    	$columns['author'] = __('Author', 'nggallery');
+    	$columns['page_id'] = __('Page ID', 'nggallery');
+    	$columns['quantity'] = _n( 'Image', 'Images', 2, 'nggallery' );
+
+    	$columns = apply_filters('ngg_manage_gallery_columns', $columns);
+
+    	return $columns;
+	}
+
+	function get_sortable_columns() {
+		return array(
+			'id'    => array( 'gid', true ),
+			'title'   => 'title',
+			'author'   => 'author'
+		);
+	}
+}
+?>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php
new file mode 100644
index 0000000000000000000000000000000000000000..6a19c61fb547f13f0b4206ffda6a216639608e4b
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php
@@ -0,0 +1,756 @@
+<?php
+
+if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) {	die('You are not allowed to call this page directly.');}
+
+function nggallery_picturelist() {
+// *** show picture list
+	global $wpdb, $nggdb, $user_ID, $ngg;
+
+	// Look if its a search result
+	$is_search = isset ($_GET['s']) ? true : false;
+	$counter	= 0;
+
+    $wp_list_table = new _NGG_Images_List_Table('nggallery-manage-images');
+
+    if ($is_search) {
+
+		// fetch the imagelist
+		$picturelist = $ngg->manage_page->search_result;
+
+		// we didn't set a gallery or a pagination
+		$act_gid     = 0;
+		$_GET['paged'] = 1;
+		$page_links = false;
+
+	} else {
+
+		// GET variables
+		$act_gid    = $ngg->manage_page->gid;
+
+		// Load the gallery metadata
+		$gallery = $nggdb->find_gallery($act_gid);
+
+		if (!$gallery) {
+			nggGallery::show_error(__('Gallery not found.', 'nggallery'));
+			return;
+		}
+
+		// Check if you have the correct capability
+		if (!nggAdmin::can_manage_this_gallery($gallery->author)) {
+			nggGallery::show_error(__('Sorry, you have no access here', 'nggallery'));
+			return;
+		}
+
+		// look for pagination
+        $_GET['paged'] = isset($_GET['paged']) && ($_GET['paged'] > 0) ? absint($_GET['paged']) : 1;
+
+		$start = ( $_GET['paged'] - 1 ) * 50;
+
+		// get picture values
+		$picturelist = $nggdb->get_gallery($act_gid, $ngg->options['galSort'], $ngg->options['galSortDir'], false, 50, $start );
+
+		// get the current author
+		$act_author_user    = get_userdata( (int) $gallery->author );
+
+	}
+
+		// list all galleries
+		$gallerylist = $nggdb->find_all_galleries();
+
+		//get the columns
+		$image_columns   = $wp_list_table->get_columns();
+		$hidden_columns  = get_hidden_columns('nggallery-manage-images');
+		$num_columns     = count($image_columns) - count($hidden_columns);
+
+		$attr = (nggGallery::current_user_can( 'NextGEN Edit gallery options' )) ? '' : 'disabled="disabled"';
+
+?>
+<script type="text/javascript">
+<!--
+function showDialog( windowId, title ) {
+	var form = document.getElementById('updategallery');
+	var elementlist = "";
+	for (i = 0, n = form.elements.length; i < n; i++) {
+		if(form.elements[i].type == "checkbox") {
+			if(form.elements[i].name == "doaction[]")
+				if(form.elements[i].checked == true)
+					if (elementlist == "")
+						elementlist = form.elements[i].value;
+					else
+						elementlist += "," + form.elements[i].value ;
+		}
+	}
+	jQuery("#" + windowId + "_bulkaction").val(jQuery("#bulkaction").val());
+	jQuery("#" + windowId + "_imagelist").val(elementlist);
+    // now show the dialog
+	jQuery( "#" + windowId ).dialog({
+		width: 640,
+        resizable : false,
+		modal: true,
+        title: title,
+		position: {
+			my:		'center',
+			at:		'center',
+			of:		window.parent
+		}
+	});
+    jQuery("#" + windowId + ' .dialog-cancel').click(function() { jQuery( "#" + windowId ).dialog("close"); });
+}
+
+jQuery(function (){
+
+    jQuery('span.tooltip, label.tooltip').tooltip();
+
+    // load a content via ajax
+    jQuery('a.ngg-dialog').click(function() {
+    	var dialogs = jQuery('.ngg-overlay-dialog:visible');
+    	if (dialogs.size() > 0) {
+    		return false;
+    	}
+
+      if ( jQuery( "#spinner" ).length == 0) {
+      	jQuery("body").append('<div id="spinner"></div>');
+      }
+
+    	var $this = jQuery(this);
+      var results = new RegExp('[\\?&]w=([^&#]*)').exec(this.href);
+    	var width  = ( results ) ? results[1] : 600;
+      var results = new RegExp('[\\?&]h=([^&#]*)').exec(this.href);
+	    var height = ( results ) ? results[1] : 440;
+      var container = window;
+
+      if (window.parent) {
+      	container = window.parent;
+      }
+
+      jQuery('#spinner').fadeIn();
+      jQuery('#spinner').position({ my: "center", at: "center", of: container });
+
+      var dialog = jQuery('<div class="ngg-overlay-dialog" style="display:hidden"></div>').appendTo('body');
+      // load the remote content
+      dialog.load(
+          this.href,
+          {},
+          function () {
+              jQuery('#spinner').hide();
+
+              dialog.dialog({
+                  title: ($this.attr('title')) ? $this.attr('title') : '',
+                  position: { my: "center", at: "center", of: container },
+                  width: width,
+                  height: height,
+                  modal: true,
+                  resizable: false,
+                  close: function() { dialog.remove(); }
+              }).width(width - 30).height(height - 30);
+          }
+      );
+
+      //prevent the browser to follow the link
+      return false;
+    });
+});
+
+function checkAll(form)
+{
+	for (i = 0, n = form.elements.length; i < n; i++) {
+		if(form.elements[i].type == "checkbox") {
+			if(form.elements[i].name == "doaction[]") {
+				if(form.elements[i].checked == true)
+					form.elements[i].checked = false;
+				else
+					form.elements[i].checked = true;
+			}
+		}
+	}
+}
+
+function getNumChecked(form)
+{
+	var num = 0;
+	for (i = 0, n = form.elements.length; i < n; i++) {
+		if(form.elements[i].type == "checkbox") {
+			if(form.elements[i].name == "doaction[]")
+				if(form.elements[i].checked == true)
+					num++;
+		}
+	}
+	return num;
+}
+
+// this function check for a the number of selected images, sumbmit false when no one selected
+function checkSelected() {
+
+	var numchecked = getNumChecked(document.getElementById('updategallery'));
+
+    if (typeof document.activeElement == "undefined" && document.addEventListener) {
+    	document.addEventListener("focus", function (e) {
+    		document.activeElement = e.target;
+    	}, true);
+    }
+
+    if ( document.activeElement.name == 'post_paged' )
+        return true;
+
+	if(numchecked < 1) {
+		alert('<?php echo esc_js(__('No images selected', 'nggallery')); ?>');
+		return false;
+	}
+
+	actionId = jQuery('#bulkaction').val();
+
+	switch (actionId) {
+		case "copy_to":
+			showDialog('selectgallery', '<?php echo esc_js(__('Copy image to...','nggallery')); ?>');
+			return false;
+			break;
+		case "move_to":
+			showDialog('selectgallery', '<?php echo esc_js(__('Move image to...','nggallery')); ?>');
+			return false;
+			break;
+		case "add_tags":
+			showDialog('entertags', '<?php echo esc_js(__('Add new tags','nggallery')); ?>');
+			return false;
+			break;
+		case "delete_tags":
+			showDialog('entertags', '<?php echo esc_js(__('Delete tags','nggallery')); ?>');
+			return false;
+			break;
+		case "overwrite_tags":
+			showDialog('entertags', '<?php echo esc_js(__('Overwrite','nggallery')); ?>');
+			return false;
+			break;
+		case "resize_images":
+			showDialog('resize_images', '<?php echo esc_js(__('Resize images','nggallery')); ?>');
+			return false;
+			break;
+		case "new_thumbnail":
+			showDialog('new_thumbnail', '<?php echo esc_js(__('Create new thumbnails','nggallery')); ?>');
+			return false;
+			break;
+	}
+
+	return confirm('<?php echo sprintf(esc_js(__("You are about to start the bulk edit for %s images \n \n 'Cancel' to stop, 'OK' to proceed.",'nggallery')), "' + numchecked + '") ; ?>');
+}
+
+jQuery(document).ready( function($) {
+	if ($(this).data('ready')) return;
+
+	// close postboxes that should be closed
+	jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');
+	postboxes.add_postbox_toggles('ngg-manage-gallery');
+
+	$(this).data('ready', true);
+});
+
+//-->
+</script>
+<div class="wrap">
+<?php //include('templates/social_media_buttons.php'); ?>
+<?php screen_icon( 'nextgen-gallery' ); ?>
+<?php if ($is_search) :?>
+<h2><?php printf( __('Search results for &#8220;%s&#8221;', 'nggallery'), esc_html( get_search_query() ) ); ?></h2>
+<form class="search-form" action="" method="get">
+<p class="search-box">
+	<label class="hidden" for="media-search-input"><?php _e( 'Search Images', 'nggallery' ); ?>:</label>
+	<input type="hidden" id="page-name" name="page" value="nggallery-manage-gallery" />
+	<input type="text" id="media-search-input" name="s" value="<?php the_search_query(); ?>" />
+	<input type="submit" value="<?php _e( 'Search Images', 'nggallery' ); ?>" class="button" />
+</p>
+</form>
+
+<br style="clear: both;" />
+
+<form id="updategallery" class="nggform" method="POST" action="<?php echo $ngg->manage_page->base_page . '&amp;mode=edit&amp;s=' . get_search_query(); ?>" accept-charset="utf-8">
+<?php wp_nonce_field('ngg_updategallery') ?>
+<input type="hidden" name="page" value="manage-images" />
+
+<?php else :?>
+<h2><?php echo _n( 'Gallery', 'Galleries', 1, 'nggallery' ); ?> : <?php echo esc_html ( nggGallery::i18n($gallery->title) ); ?></h2>
+
+<br style="clear: both;" />
+
+<form id="updategallery" class="nggform" method="POST" action="<?php echo $ngg->manage_page->base_page . '&amp;mode=edit&amp;gid=' . $act_gid . '&amp;paged=' . $_GET['paged']; ?>" accept-charset="utf-8">
+<?php wp_nonce_field('ngg_updategallery') ?>
+<input type="hidden" name="page" value="manage-images" />
+
+<?php if ( nggGallery::current_user_can( 'NextGEN Edit gallery options' )) : ?>
+<div id="poststuff">
+	<?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
+	<div id="gallerydiv" class="postbox <?php echo postbox_classes('gallerydiv', 'ngg-manage-gallery'); ?>" >
+		<h3><?php _e('Gallery settings', 'nggallery') ?><small> (<?php _e('Click here for more settings', 'nggallery') ?>)</small></h3>
+		<div class="inside">
+			<table class="form-table" >
+				<tr>
+					<th align="left"><?php _e('Title') ?>:</th>
+					<th align="left"><input <?php nggGallery::current_user_can_form( 'NextGEN Edit gallery title' ); ?> type="text" size="50" name="title" value="<?php echo esc_attr(stripslashes($gallery->title)); ?>"  /></th>
+					<th align="right"><?php _e('Page Link to', 'nggallery') ?>:</th>
+					<th align="left">
+					<select <?php nggGallery::current_user_can_form( 'NextGEN Edit gallery page id' ); ?>  name="pageid" style="width:95%">
+						<option value="0" ><?php _e('Not linked', 'nggallery') ?></option>
+                        <?php foreach (get_pages() as $page): ?>
+                            <option <?php selected($gallery->pageid, $page->ID) ?> value="<?php echo esc_attr($page->ID)?>"><?php echo esc_html($page->post_title)?></option>
+                        <?php endforeach ?>
+					</select>
+					</th>
+				</tr>
+				<tr>
+					<th align="left"><?php _e('Description') ?>:</th>
+					<th align="left"><textarea  <?php nggGallery::current_user_can_form( 'NextGEN Edit gallery description' ); ?> name="gallerydesc" cols="30" rows="3" style="width: 95%" ><?php echo esc_attr(stripslashes($gallery->galdesc)); ?></textarea></th>
+					<th align="right"><?php _e('Preview image', 'nggallery') ?>:</th>
+					<th align="left">
+						<select <?php nggGallery::current_user_can_form( 'NextGEN Edit gallery preview pic' ); ?> name="previewpic" style="width:95%" >
+							<option value="0" ><?php _e('No Picture', 'nggallery') ?></option>
+							<?php
+                                // ensure that a preview pic from a other page is still shown here
+                                if ( intval($gallery->previewpic) != 0) {
+                                    if ( !array_key_exists ($gallery->previewpic, $picturelist )){
+                                        $previewpic = $nggdb->find_image($gallery->previewpic);
+                                        if ($previewpic)
+                                            echo '<option value="'.$previewpic->pid.'" selected="selected" >'.$previewpic->pid.' - ' . esc_attr( $previewpic->filename ) . '</option>'."\n";
+                                    }
+                                }
+								if(is_array($picturelist)) {
+									foreach($picturelist as $picture) {
+                                        if ($picture->exclude) continue;
+										$selected = ($picture->pid == $gallery->previewpic) ? 'selected="selected" ' : '';
+										echo '<option value="'.$picture->pid.'" '.$selected.'>'.$picture->pid.' - ' . esc_attr( $picture->filename ) . '</option>'."\n";
+									}
+								}
+							?>
+						</select>
+					</th>
+				</tr>
+				<tr>
+					<th align="left"><?php _e('Path', 'nggallery') ?>:</th>
+					<th align="left"><input readonly="readonly" type="text" size="50" name="path" value="<?php echo $gallery->path; ?>"  /></th>
+					<th align="right"><?php _e('Author', 'nggallery'); ?>:</th>
+					<th align="left">
+					<?php
+						$editable_ids = $ngg->manage_page->get_editable_user_ids( $user_ID );
+						if ( $editable_ids && count( $editable_ids ) > 1 && nggGallery::current_user_can( 'NextGEN Edit gallery author')  )
+							wp_dropdown_users( array('include' => $editable_ids, 'name' => 'author', 'selected' => empty( $gallery->author ) ? 0 : $gallery->author ) );
+						else
+							echo $act_author_user->display_name;
+					?>
+					</th>
+				</tr>
+				<?php if(current_user_can( 'publish_pages' )) : ?>
+				<tr>
+					<th align="left">&nbsp;</th>
+					<th align="left">&nbsp;</th>
+					<th align="right">
+                        <label for='ngg_settings_parent_id'
+                               class='tooltip'
+                               title="Clicking <?php _e('Add Page'); ?> will create a new page with the same name as this gallery and will display the gallery on that new page. You can create a sub-page by selecting the parent page from the drop down.">
+                            <?php _e('Create new page', 'nggallery') ?>:
+                        </label>
+                    </th>
+					<th align="left">
+					<select name="parent_id" style="width:95%" id='ngg_settings_parent_id'>
+						<option value="0"><?php _e ('Main page (No parent)', 'nggallery'); ?></option>
+						<?php foreach (get_pages() as $page): ?>
+                        <option value="<?php echo esc_attr($page->ID)?>"><?php echo esc_html($page->post_title)?></option>
+                        <?php endforeach ?>
+					</select>
+					<input class="button-secondary action" type="submit" name="addnewpage" value="<?php _e ('Add page', 'nggallery'); ?>" id="group"/>
+					</th>
+				</tr>
+				<?php endif; ?>
+                <?php do_action('ngg_manage_gallery_settings', $act_gid); ?>
+
+			</table>
+
+			<div class="submit">
+				<?php
+        if ( wpmu_enable_function('wpmuScanFolder') && nggGallery::current_user_can( 'NextGEN Scan folder' ) ) :
+				?>
+				<input type="submit" class="button-secondary" name="scanfolder" value="<?php _e("Scan Folder for new images",'nggallery'); ?> " />
+				<?php endif; ?>
+				<input type="submit" class="button-primary action" name="updatepictures" value="<?php _e("Save Changes",'nggallery'); ?>" />
+			</div>
+
+		</div>
+	</div>
+</div> <!-- poststuff -->
+<?php endif; ?>
+
+<?php endif; ?>
+
+<div class="tablenav top ngg-tablenav">
+    <?php $ngg->manage_page->pagination( 'top', $_GET['paged'], $nggdb->paged['total_objects'], $nggdb->paged['objects_per_page']  ); ?>
+	<div class="alignleft actions">
+	<select id="bulkaction" name="bulkaction">
+		<option value="no_action" ><?php _e("Bulk actions",'nggallery'); ?></option>
+		<option value="set_watermark" ><?php _e("Set watermark",'nggallery'); ?></option>
+		<option value="new_thumbnail" ><?php _e("Create new thumbnails",'nggallery'); ?></option>
+		<option value="resize_images" ><?php _e("Resize images",'nggallery'); ?></option>
+		<option value="recover_images" ><?php _e("Recover from backup",'nggallery'); ?></option>
+		<option value="delete_images" ><?php _e("Delete images",'nggallery'); ?></option>
+		<option value="import_meta" ><?php _e("Import metadata",'nggallery'); ?></option>
+		<option value="rotate_cw" ><?php _e("Rotate images clockwise",'nggallery'); ?></option>
+		<option value="rotate_ccw" ><?php _e("Rotate images counter-clockwise",'nggallery'); ?></option>
+		<option value="copy_to" ><?php _e("Copy to...",'nggallery'); ?></option>
+		<option value="move_to"><?php _e("Move to...",'nggallery'); ?></option>
+		<option value="add_tags" ><?php _e("Add tags",'nggallery'); ?></option>
+		<option value="delete_tags" ><?php _e("Delete tags",'nggallery'); ?></option>
+		<option value="overwrite_tags" ><?php _e("Overwrite tags",'nggallery'); ?></option>
+	</select>
+	<input class="button-secondary" type="submit" name="showThickbox" value="<?php _e('Apply', 'nggallery'); ?>" onclick="if ( !checkSelected() ) return false;" />
+
+	<?php if (($ngg->options['galSort'] == "sortorder") && (!$is_search) ) { ?>
+		<input class="button-secondary" type="submit" name="sortGallery" value="<?php _e('Sort gallery', 'nggallery');?>" />
+	<?php } ?>
+
+	<input type="submit" name="updatepictures" class="button-primary action"  value="<?php _e('Save Changes', 'nggallery');?>" />
+	</div>
+</div>
+
+<table id="ngg-listimages" class="widefat fixed" cellspacing="0" >
+
+	<thead>
+	<tr>
+<?php $wp_list_table->print_column_headers(true); ?>
+	</tr>
+	</thead>
+	<tfoot>
+	<tr>
+<?php $wp_list_table->print_column_headers(false); ?>
+	</tr>
+	</tfoot>
+	<tbody id="the-list">
+<?php
+if($picturelist) {
+
+	$thumbsize 	= '';
+
+	if ($ngg->options['thumbfix'])
+		$thumbsize = 'width="' . $ngg->options['thumbwidth'] . '" height="' . $ngg->options['thumbheight'] . '"';
+
+	foreach($picturelist as $picture) {
+
+		//for search result we need to check the capatibiliy
+		if ( !nggAdmin::can_manage_this_gallery($picture->author) && $is_search )
+			continue;
+
+		$counter++;
+		$pid       = (int) $picture->pid;
+		$alternate = ( !isset($alternate) || $alternate == 'alternate' ) ? '' : 'alternate';
+		$exclude   = ( $picture->exclude ) ? 'checked="checked"' : '';
+		$date = mysql2date(get_option('date_format'), $picture->imagedate);
+		$time = mysql2date(get_option('time_format'), $picture->imagedate);
+
+		?>
+		<tr id="picture-<?php echo $pid ?>" class="<?php echo $alternate ?> iedit"  valign="top">
+			<?php
+			foreach($image_columns as $image_column_key => $column_display_name) {
+				$class = "class='$image_column_key column-$image_column_key'";
+
+				$style = '';
+				if ( in_array($image_column_key, $hidden_columns) )
+					$style = ' style="display:none;"';
+
+				$attributes = $class . $style;
+
+				switch ($image_column_key) {
+					case 'cb' :
+                        $attributes = 'class="column-cb check-column"' . $style;
+						?>
+						<th <?php echo $attributes ?> scope="row"><input name="doaction[]" type="checkbox" value="<?php echo $pid ?>" /></th>
+						<?php
+					break;
+					case 'id' :
+						?>
+						<td <?php echo $attributes ?> style=""><?php echo $pid; ?>
+							<input type="hidden" name="pid[]" value="<?php echo $pid ?>" />
+						</td>
+						<?php
+					break;
+					case 'filename' :
+                        $attributes = 'class="title column-filename column-title"' . $style;
+						?>
+						<td <?php echo $attributes ?>>
+							<strong><a href="<?php echo esc_url( $picture->imageURL ); ?>" class="thickbox" title="<?php echo esc_attr ($picture->filename); ?>">
+								<?php echo ( empty($picture->alttext) ) ? esc_html( $picture->filename ) : esc_html( stripslashes(nggGallery::i18n($picture->alttext)) ); ?>
+							</a></strong>
+							<br /><?php echo $date; ?>
+							<?php if ( !empty($picture->meta_data) ): ?>
+							<br /><?php echo $picture->meta_data['width']; ?> x <?php echo $picture->meta_data['height']; ?> <?php _e('pixel', 'nggallery'); ?>
+
+							<?php endif; ?>
+							<p>
+							<?php
+							$actions = array();
+							$actions['view']   = '<a class="shutter" href="' . esc_url( $picture->imageURL ) . '" title="' . esc_attr( sprintf(__('View "%s"'), sanitize_title ($picture->filename) )) . '">' . __('View', 'nggallery') . '</a>';
+							$actions['meta']   = '<a class="ngg-dialog" href="' . NGGALLERY_URLPATH . 'admin/showmeta.php?id=' . $pid . '" title="' . __('Show Meta data','nggallery') . '">' . __('Meta', 'nggallery') . '</a>';
+							$actions['custom_thumb']   = '<a class="ngg-dialog" href="' . NGGALLERY_URLPATH . 'admin/edit-thumbnail.php?id=' . $pid . '" title="' . __('Customize thumbnail','nggallery') . '">' . __('Edit thumb', 'nggallery') . '</a>';
+							$actions['rotate'] = '<a class="ngg-dialog" href="' . NGGALLERY_URLPATH . 'admin/rotate.php?id=' . $pid . '" title="' . __('Rotate','nggallery') . '">' . __('Rotate', 'nggallery') . '</a>';
+							if ( current_user_can( 'publish_posts' ) )
+                                $actions['publish'] = '<a class="ngg-dialog" href="' . NGGALLERY_URLPATH . 'admin/publish.php?id=' . $pid . '&h=230" title="' . __('Publish this image','nggallery') . '">' . __('Publish', 'nggallery') . '</a>';
+							if ( file_exists( $picture->imagePath . '_backup' ) )
+                                $actions['recover']   = '<a class="confirmrecover" href="' .wp_nonce_url("admin.php?page=nggallery-manage-gallery&amp;mode=recoverpic&amp;gid=" . $act_gid . "&amp;pid=" . $pid, 'ngg_recoverpicture'). '" title="' . __('Recover','nggallery') . '" onclick="javascript:check=confirm( \'' . esc_attr(sprintf(__('Recover "%s" ?' , 'nggallery'), $picture->filename)). '\');if(check==false) return false;">' . __('Recover', 'nggallery') . '</a>';
+							$actions['delete'] = '<a class="submitdelete" href="' . wp_nonce_url("admin.php?page=nggallery-manage-gallery&amp;mode=delpic&amp;gid=" . $act_gid . "&amp;pid=" . $pid, 'ngg_delpicture'). '" class="delete column-delete" onclick="javascript:check=confirm( \'' . esc_attr(sprintf(__('Delete "%s" ?' , 'nggallery'), $picture->filename)). '\');if(check==false) return false;">' . __('Delete') . '</a>';
+							$action_count = count($actions);
+							$i = 0;
+							echo '<div class="row-actions">';
+							foreach ( $actions as $action => $link ) {
+								++$i;
+								( $i == $action_count ) ? $sep = '' : $sep = ' | ';
+								echo "<span class='$action'>$link$sep</span>";
+							}
+							echo '</div>';
+							?></p>
+						</td>
+						<?php
+					break;
+					case 'thumbnail' :
+                        $attributes = 'class="id column-thumbnail media-icon"' . $style;
+						?>
+						<td <?php echo $attributes ?>><a href="<?php echo esc_url ( add_query_arg('i', mt_rand(), $picture->imageURL) ); ?>" class="shutter" title="<?php echo $picture->filename ?>">
+								<img class="thumb" src="<?php echo esc_url ( add_query_arg('i', mt_rand(), $picture->thumbURL) ); ?>" id="thumb<?php echo $pid ?>" />
+							</a>
+						</td>
+						<?php
+					break;
+					case 'alt_title_desc' :
+						?>
+						<td <?php echo $attributes ?>>
+							<input name="alttext[<?php echo $pid ?>]" type="text" style="width:95%; margin-bottom: 2px;" value="<?php echo esc_attr(stripslashes($picture->alttext)) ?>" /><br/>
+							<textarea name="description[<?php echo $pid ?>]" style="width:95%; margin-top: 2px;" rows="2" ><?php echo esc_attr(stripslashes($picture->description)) ?></textarea>
+						</td>
+						<?php
+					break;
+					case 'exclude' :
+						?>
+						<td <?php echo $attributes ?>><input name="exclude[<?php echo $pid ?>]" type="checkbox" value="1" <?php echo $exclude ?> /></td>
+						<?php
+					break;
+					case 'tags' :
+						$picture->tags = wp_get_object_terms($pid, 'ngg_tag', 'fields=names');
+						if (is_array ($picture->tags) ) $picture->tags = implode(', ', $picture->tags);
+						?>
+						<td <?php echo $attributes ?>><textarea name="tags[<?php echo $pid ?>]" style="width:95%;" rows="2"><?php echo $picture->tags ?></textarea></td>
+						<?php
+					break;
+					default :
+						?>
+						<td <?php echo $attributes ?>><?php do_action('ngg_manage_image_custom_column', $image_column_key, $pid); ?></td>
+						<?php
+					break;
+				}
+			?>
+			<?php } ?>
+		</tr>
+		<?php
+	}
+}
+
+// In the case you have no capaptibility to see the search result
+if ( $counter == 0 )
+	echo '<tr><td colspan="' . $num_columns . '" align="center"><strong>'.__('No entries found','nggallery').'</strong></td></tr>';
+
+?>
+
+		</tbody>
+	</table>
+    <div class="tablenav bottom">
+    <input type="submit" class="button-primary action" name="updatepictures" value="<?php _e('Save Changes', 'nggallery'); ?>" />
+    <?php $ngg->manage_page->pagination( 'bottom', $_GET['paged'], $nggdb->paged['total_objects'], $nggdb->paged['objects_per_page']  ); ?>
+    </div>
+	</form>
+	<br class="clear"/>
+	</div><!-- /#wrap -->
+
+	<!-- #entertags -->
+	<div id="entertags" style="display: none;" >
+		<form id="form-tags" method="POST" accept-charset="utf-8">
+		<?php wp_nonce_field('ngg_thickbox_form') ?>
+		<input type="hidden" id="entertags_imagelist" name="TB_imagelist" value="" />
+		<input type="hidden" id="entertags_bulkaction" name="TB_bulkaction" value="" />
+		<input type="hidden" name="page" value="manage-images" />
+		<table width="100%" border="0" cellspacing="3" cellpadding="3" >
+		  	<tr>
+		    	<th><?php _e("Enter the tags",'nggallery'); ?> : <input name="taglist" type="text" style="width:90%" value="" /></th>
+		  	</tr>
+		  	<tr align="right">
+		    	<td class="submit">
+		    		<input class="button-primary" type="submit" name="TB_EditTags" value="<?php _e("OK",'nggallery'); ?>" />
+		    		&nbsp;
+		    		<input class="button-secondary dialog-cancel" type="reset" value="&nbsp;<?php _e("Cancel",'nggallery'); ?>&nbsp;" />
+		    	</td>
+			</tr>
+		</table>
+		</form>
+	</div>
+	<!-- /#entertags -->
+
+	<!-- #selectgallery -->
+	<div id="selectgallery" style="display: none;" >
+		<form id="form-select-gallery" method="POST" accept-charset="utf-8">
+		<?php wp_nonce_field('ngg_thickbox_form') ?>
+		<input type="hidden" id="selectgallery_imagelist" name="TB_imagelist" value="" />
+		<input type="hidden" id="selectgallery_bulkaction" name="TB_bulkaction" value="" />
+		<input type="hidden" name="page" value="manage-images" />
+		<table width="100%" border="0" cellspacing="3" cellpadding="3" >
+		  	<tr>
+		    	<th>
+		    		<?php _e('Select the destination gallery:', 'nggallery'); ?>&nbsp;
+		    		<select name="dest_gid" style="width:90%" >
+		    			<?php
+		    				foreach ($gallerylist as $gallery) {
+		    					if ($gallery->gid != $act_gid) {
+		    			?>
+						<option value="<?php echo $gallery->gid; ?>" ><?php echo $gallery->gid; ?> - <?php echo esc_attr( stripslashes($gallery->title) ); ?></option>
+						<?php
+		    					}
+		    				}
+		    			?>
+		    		</select>
+		    	</th>
+		  	</tr>
+		  	<tr align="right">
+		    	<td class="submit">
+		    		<input type="submit" class="button-primary" name="TB_SelectGallery" value="<?php _e("OK",'nggallery'); ?>" />
+		    		&nbsp;
+		    		<input class="button-secondary dialog-cancel" type="reset" value="<?php _e("Cancel",'nggallery'); ?>" />
+		    	</td>
+			</tr>
+		</table>
+		</form>
+	</div>
+	<!-- /#selectgallery -->
+
+	<!-- #resize_images -->
+	<div id="resize_images" style="display: none;" >
+		<form id="form-resize-images" method="POST" accept-charset="utf-8">
+		<?php wp_nonce_field('ngg_thickbox_form') ?>
+		<input type="hidden" id="resize_images_imagelist" name="TB_imagelist" value="" />
+		<input type="hidden" id="resize_images_bulkaction" name="TB_bulkaction" value="" />
+		<input type="hidden" name="page" value="manage-images" />
+		<table width="100%" border="0" cellspacing="3" cellpadding="3" >
+			<tr valign="top">
+				<td>
+					<strong><?php _e('Resize Images to', 'nggallery'); ?>:</strong>
+				</td>
+				<td>
+					<input type="text" size="5" name="imgWidth" value="<?php echo $ngg->options['imgWidth']; ?>" /> x <input type="text" size="5" name="imgHeight" value="<?php echo $ngg->options['imgHeight']; ?>" />
+					<br /><small><?php _e('Width x height (in pixel). NextGEN Gallery will keep ratio size','nggallery') ?></small>
+				</td>
+			</tr>
+		  	<tr align="right">
+		    	<td colspan="2" class="submit">
+		    		<input class="button-primary" type="submit" name="TB_ResizeImages" value="<?php _e('OK', 'nggallery'); ?>" />
+		    		&nbsp;
+		    		<input class="button-secondary dialog-cancel" type="reset" value="&nbsp;<?php _e('Cancel', 'nggallery'); ?>&nbsp;" />
+		    	</td>
+			</tr>
+		</table>
+		</form>
+	</div>
+	<!-- /#resize_images -->
+
+	<!-- #new_thumbnail -->
+	<div id="new_thumbnail" style="display: none;" >
+		<form id="form-new-thumbnail" method="POST" accept-charset="utf-8">
+		<?php wp_nonce_field('ngg_thickbox_form') ?>
+		<input type="hidden" id="new_thumbnail_imagelist" name="TB_imagelist" value="" />
+		<input type="hidden" id="new_thumbnail_bulkaction" name="TB_bulkaction" value="" />
+		<input type="hidden" name="page" value="manage-images" />
+    <table width="100%" border="0" cellspacing="3" cellpadding="3" >
+			<tr valign="top">
+				<th align="left"><?php _e('Width x height (in pixel)','nggallery') ?></th>
+				<td>
+				<?php include(dirname(__FILE__) . '/thumbnails-template.php'); ?>
+				</td>
+			</tr>
+			<tr valign="top">
+				<th align="left"><?php _e('Set fix dimension','nggallery') ?></th>
+				<td><input type="checkbox" name="thumbfix" value="1" <?php checked('1', $ngg->options['thumbfix']); ?> />
+				<br /><small><?php _e('Ignore the aspect ratio, no portrait thumbnails','nggallery') ?></small></td>
+			</tr>
+		  	<tr align="right">
+		    	<td colspan="2" class="submit">
+		    		<input class="button-primary" type="submit" name="TB_NewThumbnail" value="<?php _e('OK', 'nggallery');?>" />
+		    		&nbsp;
+		    		<input class="button-secondary dialog-cancel" type="reset" value="&nbsp;<?php _e('Cancel', 'nggallery'); ?>&nbsp;" />
+		    	</td>
+			</tr>
+		</table>
+		</form>
+	</div>
+	<!-- /#new_thumbnail -->
+
+	<script type="text/javascript">
+	/* <![CDATA[ */
+	jQuery(document).ready(function(){columns.init('nggallery-manage-images');});
+	/* ]]> */
+	</script>
+	<?php
+}
+
+/**
+ * Construtor class to create the table layout
+ *
+ * @package WordPress
+ * @subpackage List_Table
+ * @since 1.8.0
+ * @access private
+ */
+class _NGG_Images_List_Table extends WP_List_Table {
+	var $_screen;
+	var $_columns;
+
+	function _NGG_Images_List_Table( $screen ) {
+		if ( is_string( $screen ) )
+			$screen = convert_to_screen( $screen );
+
+		$this->_screen = $screen;
+		$this->_columns = array() ;
+
+		add_filter( 'manage_' . $screen->id . '_columns', array( &$this, 'get_columns' ), 0 );
+	}
+
+	function get_column_info() {
+
+		$columns = get_column_headers( $this->_screen );
+		$hidden = get_hidden_columns( $this->_screen );
+		$_sortable = $this->get_sortable_columns();
+        $sortable = array();
+
+		foreach ( $_sortable as $id => $data ) {
+			if ( empty( $data ) )
+				continue;
+
+			$data = (array) $data;
+			if ( !isset( $data[1] ) )
+				$data[1] = false;
+
+			$sortable[$id] = $data;
+		}
+
+		return array( $columns, $hidden, $sortable );
+	}
+
+    // define the columns to display, the syntax is 'internal name' => 'display name'
+	function get_columns() {
+    	$columns = array();
+
+    	$columns['cb'] = '<input name="checkall" type="checkbox" onclick="checkAll(document.getElementById(\'updategallery\'));" />';
+    	$columns['id'] = __('ID');
+    	$columns['thumbnail'] = __('Thumbnail', 'nggallery');
+    	$columns['filename'] = __('Filename', 'nggallery');
+    	$columns['alt_title_desc'] = __('Alt &amp; Title Text', 'nggallery') . ' / ' . __('Description', 'nggallery');
+    	$columns['tags'] = __('Tags (comma separated list)', 'nggallery');
+    	$columns['exclude'] = __('exclude', 'nggallery');
+
+    	$columns = apply_filters('ngg_manage_images_columns', $columns);
+
+    	return $columns;
+	}
+
+	function get_sortable_columns() {
+		return array();
+	}
+}
+
+?>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/manage-sort.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/manage-sort.php
new file mode 100644
index 0000000000000000000000000000000000000000..71538a2cafd0053db765b7b0b7887895d6305638
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/manage-sort.php
@@ -0,0 +1,138 @@
+<?php
+
+/**
+ * @author Alex Rabe
+ *
+ */
+
+function nggallery_sortorder($galleryID = 0){
+	global $wpdb, $ngg, $nggdb;
+
+	if ($galleryID == 0) return;
+
+	$galleryID = (int) $galleryID;
+
+	if (isset ($_POST['updateSortorder']))  {
+		check_admin_referer('ngg_updatesortorder');
+		// get variable new sortorder
+		parse_str($_POST['sortorder']);
+		if (is_array($sortArray)){
+			$neworder = array();
+			foreach($sortArray as $pid) {
+				$pid = substr($pid, 4); // get id from "pid-x"
+				$neworder[] = (int) $pid;
+			}
+			$sortindex = 1;
+			foreach($neworder as $pic_id) {
+				$wpdb->query("UPDATE $wpdb->nggpictures SET sortorder = '$sortindex' WHERE pid = $pic_id");
+				$sortindex++;
+			}
+
+			C_Photocrati_Cache::flush();
+
+			do_action('ngg_gallery_sort', $galleryID);
+
+			nggGallery::show_message(__('Sort order changed','nggallery'));
+		}
+	}
+
+	// look for presort args
+	$presort = isset($_GET['presort']) ? $_GET['presort'] : false;
+	$dir = ( isset($_GET['dir']) && $_GET['dir'] == 'DESC' ) ? 'DESC' : 'ASC';
+	$sortitems = array('pid', 'filename', 'alttext', 'imagedate');
+	// ensure that nobody added some evil sorting :-)
+	if (in_array( $presort, $sortitems) )
+		$picturelist = $nggdb->get_gallery($galleryID, $presort, $dir, false);
+	else
+		$picturelist = $nggdb->get_gallery($galleryID, 'sortorder', $dir, false);
+
+	//this is the url without any presort variable
+	$clean_url = 'admin.php?page=nggallery-manage-gallery&amp;mode=sort&amp;gid=' . $galleryID;
+	//if we go back , then the mode should be edit
+	$back_url  = 'admin.php?page=nggallery-manage-gallery&amp;mode=edit&amp;gid=' . $galleryID;
+
+	// In the case somebody presort, then we take this url
+	if ( isset($_GET['dir']) || isset($_GET['presort']) )
+		$base_url = $_SERVER['REQUEST_URI'];
+	else
+		$base_url = $clean_url;
+
+?>
+	<script type="text/javascript">
+		// seralize the ImageOrder
+		function saveImageOrder()
+		{
+			var serial = "";
+			var objects = document.getElementsByTagName('div');
+			for(var no=0;no<objects.length;no++){
+				if(objects[no].className=='imageBox' || objects[no].className=='imageBoxHighlighted'){
+					if (serial.length > 0)	serial = serial + '&'
+					serial = serial + "sortArray[]=" + objects[no].id;
+				}
+			}
+			jQuery('input[name=sortorder]').val(serial);
+			// debug( 'This is the new order of the images(IDs) : <br>' + orderString );
+
+		}
+		jQuery(document).ready(function($) {
+			if ($(this).data('ready')) return;
+
+			// Enable sorting
+			$(".jqui-sortable").sortable({items: 'div.imageBox'});
+
+			// Listen for events in other frames
+			if (window.Frame_Event_Publisher) {
+				Frame_Event_Publisher.listen_for('attach_to_post:manage_galleries attach_to_post:manage_images', function(){
+					window.location.href = window.location.href;
+				});
+			}
+
+			$(this).data('ready', true);
+		});
+
+
+	</script>
+	<div class="wrap">
+		<form id="sortGallery" method="POST" action="<?php echo $clean_url ?>" onsubmit="saveImageOrder()" accept-charset="utf-8">
+			<h2><?php _e('Sort Gallery', 'nggallery') ?></h2>
+			<div class="tablenav">
+				<div class="alignleft actions">
+					<?php wp_nonce_field('ngg_updatesortorder') ?>
+					<input class="button-primary action" type="submit" name="updateSortorder" onclick="saveImageOrder()" value="<?php _e('Update Sort Order', 'nggallery') ?>" />
+				</div>
+				<div class="alignright actions">
+					<a href="<?php echo esc_url( $back_url ); ?>" class="button"><?php _e('Back to gallery', 'nggallery'); ?></a>
+				</div>
+			</div>
+			<input name="sortorder" type="hidden" />
+			<ul class="subsubsub">
+				<li><?php _e('Presort', 'nggallery') ?> :</li>
+				<li><a href="<?php echo esc_attr(remove_query_arg('presort', $base_url)); ?>" <?php if ($presort == '') echo 'class="current"'; ?>><?php _e('Unsorted', 'nggallery') ?></a> |</li>
+				<li><a href="<?php echo esc_attr(add_query_arg('presort', 'pid', $base_url)); ?>" <?php if ($presort == 'pid') echo 'class="current"'; ?>><?php _e('Image ID', 'nggallery') ?></a> |</li>
+				<li><a href="<?php echo esc_attr(add_query_arg('presort', 'filename', $base_url)); ?>" <?php if ($presort == 'filename') echo 'class="current"'; ?>><?php _e('Filename', 'nggallery') ?></a> |</li>
+				<li><a href="<?php echo esc_attr(add_query_arg('presort', 'alttext', $base_url)); ?>" <?php if ($presort == 'alttext') echo 'class="current"'; ?>><?php _e('Alt/Title text', 'nggallery') ?></a> |</li>
+				<li><a href="<?php echo esc_attr(add_query_arg('presort', 'imagedate', $base_url)); ?>" <?php if ($presort == 'imagedate') echo 'class="current"'; ?>><?php _e('Date/Time', 'nggallery') ?></a> |</li>
+				<li><a href="<?php echo esc_attr(add_query_arg('dir', 'ASC', $base_url)); ?>" <?php if ($dir == 'ASC') echo 'class="current"'; ?>><?php _e('Ascending', 'nggallery') ?></a> |</li>
+				<li><a href="<?php echo esc_attr(add_query_arg('dir', 'DESC', $base_url)); ?>" <?php if ($dir == 'DESC') echo 'class="current"'; ?>><?php _e('Descending', 'nggallery') ?></a></li>
+			</ul>
+		</form>
+		<div id="debug" style="clear:both"></div>
+		<div class='jqui-sortable'>
+			<?php
+			if($picturelist) {
+				foreach($picturelist as $picture) {
+					?>
+					<div class="imageBox" id="pid-<?php echo $picture->pid ?>">
+						<div class="imageBox_theImage" style="background-image:url('<?php echo esc_url( $picture->thumbURL ); ?>')"></div>
+						<div class="imageBox_label"><span><?php echo esc_html( stripslashes($picture->alttext) ); ?></span></div>
+					</div>
+					<?php
+				}
+			}
+			?>
+		</div>
+	</div>
+
+<?php
+}
+?>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/manage.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/manage.php
new file mode 100644
index 0000000000000000000000000000000000000000..df1de53d80d71b469d26e7cc816034c0d8070c27
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/manage.php
@@ -0,0 +1,659 @@
+<?php
+
+if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { 	die('You are not allowed to call this page directly.'); }
+
+class nggManageGallery {
+
+	var $mode = 'main';
+	var $gid = false;
+	var $pid = false;
+	var $base_page = 'admin.php?page=nggallery-manage-gallery';
+	var $search_result = false;
+
+	// initiate the manage page
+	function nggManageGallery() {
+
+		// GET variables
+		if( isset($_GET['gid']) )
+			$this->gid  = (int) $_GET['gid'];
+		if( isset($_GET['pid']) )
+			$this->pid  = (int) $_GET['pid'];
+		if( isset($_GET['mode']) )
+			$this->mode = trim ($_GET['mode']);
+        // Check for pagination request, avoid post process of other submit button, exclude search results
+        if ( isset($_POST['post_paged']) && !isset($_GET['s'] ) ) {
+            if ( $_GET['paged'] != $_POST['post_paged'] ) {
+                $_GET['paged'] = absint( $_POST['post_paged'] );
+                return;
+            }
+        }
+        // Should be only called via manage galleries overview
+		if ( isset($_POST['page']) && $_POST['page'] == 'manage-galleries' )
+			$this->post_processor_galleries();
+		// Should be only called via a edit single gallery page
+		if ( isset($_POST['page']) && $_POST['page'] == 'manage-images' )
+			$this->post_processor_images();
+		// Should be called via a publish dialog
+		if ( isset($_POST['page']) && $_POST['page'] == 'publish-post' )
+			$this->publish_post();
+		//Look for other POST process
+		if ( !empty($_POST) || !empty($_GET) )
+			$this->processor();
+
+	}
+
+	function controller() {
+
+		switch($this->mode) {
+			case 'sort':
+				include_once (dirname (__FILE__) . '/manage-sort.php');
+				nggallery_sortorder($this->gid);
+			break;
+			case 'edit':
+				include_once (dirname (__FILE__) . '/manage-images.php');
+				nggallery_picturelist();
+			break;
+			case 'main':
+			default:
+				include_once (dirname (__FILE__) . '/manage-galleries.php');
+				nggallery_manage_gallery_main();
+			break;
+		}
+	}
+
+	function processor() {
+
+		global $wpdb, $ngg, $nggdb;
+
+		// Delete a picture
+		if ($this->mode == 'delpic') {
+
+			//TODO:Remove also Tag reference
+			check_admin_referer('ngg_delpicture');
+			$image = $nggdb->find_image( $this->pid );
+			if ($image) {
+				if ($ngg->options['deleteImg']) {
+					@unlink($image->imagePath);
+					@unlink($image->thumbPath);
+					@unlink($image->imagePath . '_backup' );
+				}
+				$mapper = C_Image_Mapper::get_instance();
+				$mapper->destroy($this->pid);
+				do_action('ngg_delete_picture', $this->pid);
+
+                if ($result)
+                    nggGallery::show_message( __('Picture','nggallery').' \''.$this->pid.'\' '.__('deleted successfully','nggallery') );
+            }
+
+		 	$this->mode = 'edit'; // show pictures
+
+		}
+
+		// Recover picture from backup
+		if ($this->mode == 'recoverpic') {
+
+			check_admin_referer('ngg_recoverpicture');
+			$image = $nggdb->find_image( $this->pid );
+            // bring back the old image
+			nggAdmin::recover_image($image);
+            nggAdmin::create_thumbnail($image);
+
+            nggGallery::show_message(__('Operation successful. Please clear your browser cache.',"nggallery"));
+
+		 	$this->mode = 'edit'; // show pictures
+
+		}
+
+		// will be called after a ajax operation
+		if (isset ($_POST['ajax_callback']))  {
+				if ($_POST['ajax_callback'] == 1)
+					nggGallery::show_message(__('Operation successful. Please clear your browser cache.',"nggallery"));
+		}
+
+		// show sort order
+		if ( isset ($_POST['sortGallery']) )
+			$this->mode = 'sort';
+
+		if ( isset ($_GET['s']) )
+			$this->search_images();
+
+	}
+
+	function post_processor_galleries() {
+		global $wpdb, $ngg, $nggdb;
+
+		// bulk update in a single gallery
+		if (isset ($_POST['bulkaction']) && isset ($_POST['doaction']))  {
+
+			check_admin_referer('ngg_bulkgallery');
+
+			switch ($_POST['bulkaction']) {
+				case 'no_action';
+				// No action
+					break;
+				case 'recover_images':
+				// Recover images from backup
+					// A prefix 'gallery_' will first fetch all ids from the selected galleries
+					nggAdmin::do_ajax_operation( 'gallery_recover_image' , $_POST['doaction'], __('Recover from backup','nggallery') );
+					break;
+				case 'set_watermark':
+				// Set watermark
+					// A prefix 'gallery_' will first fetch all ids from the selected galleries
+					nggAdmin::do_ajax_operation( 'gallery_set_watermark' , $_POST['doaction'], __('Set watermark','nggallery') );
+					break;
+				case 'import_meta':
+				// Import Metadata
+					// A prefix 'gallery_' will first fetch all ids from the selected galleries
+					nggAdmin::do_ajax_operation( 'gallery_import_metadata' , $_POST['doaction'], __('Import metadata','nggallery') );
+					break;
+				case 'delete_gallery':
+				// Delete gallery
+					if ( is_array($_POST['doaction']) ) {
+                        $deleted = false;
+						foreach ( $_POST['doaction'] as $id ) {
+                			// get the path to the gallery
+                			$gallery = nggdb::find_gallery($id);
+                			if ($gallery){
+                				//TODO:Remove also Tag reference, look here for ids instead filename
+                				$imagelist = $wpdb->get_col("SELECT filename FROM $wpdb->nggpictures WHERE galleryid = '$gallery->gid' ");
+                				if ($ngg->options['deleteImg']) {
+                					if (is_array($imagelist)) {
+                						foreach ($imagelist as $filename) {
+                							@unlink(WINABSPATH . $gallery->path . '/thumbs/thumbs_' . $filename);
+                							@unlink(WINABSPATH . $gallery->path .'/'. $filename);
+                                            @unlink(WINABSPATH . $gallery->path .'/'. $filename . '_backup');
+                						}
+                					}
+                					// delete folder
+               						@rmdir( WINABSPATH . $gallery->path . '/thumbs' );
+               						@rmdir( WINABSPATH . $gallery->path );
+                				}
+                			}
+                            do_action('ngg_delete_gallery', $id);
+                			$deleted = nggdb::delete_gallery( $id );
+  						}
+
+						if($deleted)
+                            nggGallery::show_message(__('Gallery deleted successfully ', 'nggallery'));
+
+					}
+					break;
+			}
+		}
+
+		if (isset ($_POST['addgallery']) && isset ($_POST['galleryname'])){
+
+			check_admin_referer('ngg_addgallery');
+
+			if ( !nggGallery::current_user_can( 'NextGEN Add new gallery' ))
+				wp_die(__('Cheatin&#8217; uh?'));
+
+			// get the default path for a new gallery
+			$defaultpath = $ngg->options['gallerypath'];
+			$newgallery = esc_attr( $_POST['galleryname']);
+			if ( !empty($newgallery) )
+				nggAdmin::create_gallery($newgallery, $defaultpath);
+
+            do_action( 'ngg_update_addgallery_page' );
+		}
+
+		if (isset ($_POST['TB_bulkaction']) && isset ($_POST['TB_ResizeImages']))  {
+
+			check_admin_referer('ngg_thickbox_form');
+
+			//save the new values for the next operation
+			$ngg->options['imgWidth']  = (int) $_POST['imgWidth'];
+			$ngg->options['imgHeight'] = (int) $_POST['imgHeight'];
+			// What is in the case the user has no if cap 'NextGEN Change options' ? Check feedback
+			update_option('ngg_options', $ngg->options);
+
+			$gallery_ids  = explode(',', $_POST['TB_imagelist']);
+			// A prefix 'gallery_' will first fetch all ids from the selected galleries
+			nggAdmin::do_ajax_operation( 'gallery_resize_image' , $gallery_ids, __('Resize images','nggallery') );
+		}
+
+		if (isset ($_POST['TB_bulkaction']) && isset ($_POST['TB_NewThumbnail']))  {
+
+			check_admin_referer('ngg_thickbox_form');
+
+			//save the new values for the next operation
+			$ngg->options['thumbwidth']  = (int)  $_POST['thumbwidth'];
+			$ngg->options['thumbheight'] = (int)  $_POST['thumbheight'];
+			$ngg->options['thumbfix']    = isset ($_POST['thumbfix']) ? true : false;
+			// What is in the case the user has no if cap 'NextGEN Change options' ? Check feedback
+			update_option('ngg_options', $ngg->options);
+			ngg_refreshSavedSettings();
+
+			$gallery_ids  = explode(',', $_POST['TB_imagelist']);
+			// A prefix 'gallery_' will first fetch all ids from the selected galleries
+			nggAdmin::do_ajax_operation( 'gallery_create_thumbnail' , $gallery_ids, __('Create new thumbnails','nggallery') );
+		}
+
+	}
+
+	function post_processor_images() {
+		global $wpdb, $ngg, $nggdb;
+
+		// bulk update in a single gallery
+		if (isset ($_POST['bulkaction']) && isset ($_POST['doaction']))  {
+
+			check_admin_referer('ngg_updategallery');
+
+			switch ($_POST['bulkaction']) {
+				case 'no_action';
+					break;
+				case 'rotate_cw':
+					nggAdmin::do_ajax_operation( 'rotate_cw' , $_POST['doaction'], __('Rotate images', 'nggallery') );
+					break;
+				case 'rotate_ccw':
+					nggAdmin::do_ajax_operation( 'rotate_ccw' , $_POST['doaction'], __('Rotate images', 'nggallery') );
+					break;
+				case 'recover_images':
+					nggAdmin::do_ajax_operation( 'recover_image' , $_POST['doaction'], __('Recover from backup', 'nggallery') );
+					break;
+				case 'set_watermark':
+					nggAdmin::do_ajax_operation( 'set_watermark' , $_POST['doaction'], __('Set watermark', 'nggallery') );
+					break;
+				case 'delete_images':
+					if ( is_array($_POST['doaction']) ) {
+						foreach ( $_POST['doaction'] as $imageID ) {
+							$image = $nggdb->find_image( $imageID );
+							if ($image) {
+								if ($ngg->options['deleteImg']) {
+									@unlink($image->imagePath);
+									@unlink($image->thumbPath);
+									@unlink($image->imagePath."_backup");
+								}
+                                do_action('ngg_delete_picture', $image->pid);
+								$delete_pic = nggdb::delete_image( $image->pid );
+							}
+						}
+						if($delete_pic)
+							nggGallery::show_message(__('Pictures deleted successfully ', 'nggallery'));
+					}
+					break;
+				case 'import_meta':
+					nggAdmin::do_ajax_operation( 'import_metadata' , $_POST['doaction'], __('Import metadata', 'nggallery') );
+					break;
+			}
+		}
+
+		if (isset ($_POST['TB_bulkaction']) && isset ($_POST['TB_ResizeImages']))  {
+
+			check_admin_referer('ngg_thickbox_form');
+
+			//save the new values for the next operation
+			$ngg->options['imgWidth']  = (int) $_POST['imgWidth'];
+			$ngg->options['imgHeight'] = (int) $_POST['imgHeight'];
+
+			update_option('ngg_options', $ngg->options);
+
+			$pic_ids  = explode(',', $_POST['TB_imagelist']);
+			nggAdmin::do_ajax_operation( 'resize_image' , $pic_ids, __('Resize images','nggallery') );
+		}
+
+		if (isset ($_POST['TB_bulkaction']) && isset ($_POST['TB_NewThumbnail']))  {
+
+			check_admin_referer('ngg_thickbox_form');
+
+			//save the new values for the next operation
+			$ngg->options['thumbwidth']  = (int) $_POST['thumbwidth'];
+			$ngg->options['thumbheight'] = (int) $_POST['thumbheight'];
+			$ngg->options['thumbfix']    = isset ( $_POST['thumbfix'] ) ? true : false;
+			update_option('ngg_options', $ngg->options);
+			ngg_refreshSavedSettings();
+
+			$pic_ids  = explode(',', $_POST['TB_imagelist']);
+			nggAdmin::do_ajax_operation( 'create_thumbnail' , $pic_ids, __('Create new thumbnails','nggallery') );
+		}
+
+		if (isset ($_POST['TB_bulkaction']) && isset ($_POST['TB_SelectGallery']))  {
+
+			check_admin_referer('ngg_thickbox_form');
+
+			$pic_ids  = explode(',', $_POST['TB_imagelist']);
+			$dest_gid = (int) $_POST['dest_gid'];
+
+			switch ($_POST['TB_bulkaction']) {
+				case 'copy_to':
+				// Copy images
+					nggAdmin::copy_images( $pic_ids, $dest_gid );
+					break;
+				case 'move_to':
+				// Move images
+					nggAdmin::move_images( $pic_ids, $dest_gid );
+					break;
+			}
+		}
+
+		if (isset ($_POST['TB_bulkaction']) && isset ($_POST['TB_EditTags']))  {
+			// do tags update
+
+			check_admin_referer('ngg_thickbox_form');
+
+			// get the images list
+			$pic_ids = explode(',', $_POST['TB_imagelist']);
+			$taglist = explode(',', $_POST['taglist']);
+			$taglist = array_map('trim', $taglist);
+
+			if (is_array($pic_ids)) {
+
+				foreach($pic_ids as $pic_id) {
+
+					// which action should be performed ?
+					switch ($_POST['TB_bulkaction']) {
+						case 'no_action';
+						// No action
+							break;
+						case 'overwrite_tags':
+						// Overwrite tags
+							wp_set_object_terms($pic_id, $taglist, 'ngg_tag');
+							break;
+						case 'add_tags':
+						// Add / append tags
+							wp_set_object_terms($pic_id, $taglist, 'ngg_tag', TRUE);
+							break;
+						case 'delete_tags':
+						// Delete tags
+							$oldtags = wp_get_object_terms($pic_id, 'ngg_tag', 'fields=names');
+							// get the slugs, to vaoid  case sensitive problems
+							$slugarray = array_map('sanitize_title', $taglist);
+							$oldtags = array_map('sanitize_title', $oldtags);
+							// compare them and return the diff
+							$newtags = array_diff($oldtags, $slugarray);
+							wp_set_object_terms($pic_id, $newtags, 'ngg_tag');
+							break;
+					}
+				}
+
+				nggGallery::show_message( __('Tags changed', 'nggallery') );
+			}
+		}
+
+		if (isset ($_POST['updatepictures']) )  {
+		// Update pictures
+
+			check_admin_referer('ngg_updategallery');
+
+			if ( nggGallery::current_user_can( 'NextGEN Edit gallery options' )  && !isset ($_GET['s']) ) {
+
+				if ( nggGallery::current_user_can( 'NextGEN Edit gallery title' )) {
+				    // don't forget to update the slug
+				    $slug = nggdb::get_unique_slug( sanitize_title( $_POST['title'] ), 'gallery', $this->gid );
+				    $wpdb->query( $wpdb->prepare ("UPDATE $wpdb->nggallery SET title= '%s', slug= '%s' WHERE gid = %d", stripslashes($_POST['title']), $slug, $this->gid) );
+				}
+				if ( nggGallery::current_user_can( 'NextGEN Edit gallery path' ))
+					$wpdb->query( $wpdb->prepare ("UPDATE $wpdb->nggallery SET path= '%s' WHERE gid = %d", untrailingslashit ( str_replace('\\', '/', trim( stripslashes($_POST['path']) )) ), $this->gid ) );
+				if ( nggGallery::current_user_can( 'NextGEN Edit gallery description' ))
+					$wpdb->query( $wpdb->prepare ("UPDATE $wpdb->nggallery SET galdesc= '%s' WHERE gid = %d", stripslashes($_POST['gallerydesc']), $this->gid) );
+				if ( nggGallery::current_user_can( 'NextGEN Edit gallery page id' ))
+					$wpdb->query( $wpdb->prepare ("UPDATE $wpdb->nggallery SET pageid= '%d' WHERE gid = %d", (int) $_POST['pageid'], $this->gid) );
+				if ( nggGallery::current_user_can( 'NextGEN Edit gallery preview pic' ))
+					$wpdb->query( $wpdb->prepare ("UPDATE $wpdb->nggallery SET previewpic= '%d' WHERE gid = %d", (int) $_POST['previewpic'], $this->gid) );
+				if ( isset ($_POST['author']) && nggGallery::current_user_can( 'NextGEN Edit gallery author' ) )
+					$wpdb->query( $wpdb->prepare ("UPDATE $wpdb->nggallery SET author= '%d' WHERE gid = %d", (int) $_POST['author'], $this->gid) );
+
+                wp_cache_delete($this->gid, 'ngg_gallery');
+
+			}
+
+			$this->update_pictures();
+
+			//hook for other plugin to update the fields
+			do_action('ngg_update_gallery', $this->gid, $_POST);
+
+			nggGallery::show_message(__('Update successful',"nggallery"));
+		}
+
+		if (isset ($_POST['scanfolder']))  {
+		// Rescan folder
+			check_admin_referer('ngg_updategallery');
+
+			$gallerypath = $wpdb->get_var("SELECT path FROM $wpdb->nggallery WHERE gid = '$this->gid' ");
+			nggAdmin::import_gallery($gallerypath);
+		}
+
+		if (isset ($_POST['addnewpage']))  {
+		// Add a new page
+
+			check_admin_referer('ngg_updategallery');
+
+			$parent_id      = esc_attr($_POST['parent_id']);
+			$gallery_title  = esc_attr($_POST['title']);
+			$gallery_name   = $wpdb->get_var("SELECT name FROM $wpdb->nggallery WHERE gid = '$this->gid' ");
+
+			// Create a WP page
+			global $user_ID;
+
+			$page['post_type']    = 'page';
+			$page['post_content'] = '[nggallery id=' . $this->gid . ']';
+			$page['post_parent']  = $parent_id;
+			$page['post_author']  = $user_ID;
+			$page['post_status']  = 'publish';
+			$page['post_title']   = $gallery_title == '' ? $gallery_name : $gallery_title;
+			$page = apply_filters('ngg_add_new_page', $page, $this->gid);
+
+			$gallery_pageid = wp_insert_post ($page);
+			if ($gallery_pageid != 0) {
+				$result = $wpdb->query("UPDATE $wpdb->nggallery SET title= '$gallery_title', pageid = '$gallery_pageid' WHERE gid = '$this->gid'");
+				wp_cache_delete($this->gid, 'ngg_gallery');
+                nggGallery::show_message( __('New gallery page ID','nggallery'). ' ' . $gallery_pageid . ' -> <strong>' . $gallery_title . '</strong> ' .__('created','nggallery') );
+			}
+
+            do_action('ngg_gallery_addnewpage', $this->gid);
+		}
+	}
+
+   	/**
+   	 * Publish a new post with the shortcode from the selected image
+     *
+   	 * @since 1.7.0
+   	 * @return void
+   	 */
+   	function publish_post() {
+
+   	    check_admin_referer('publish-post');
+
+		// Create a WP page
+		global $user_ID, $ngg;
+
+		$ngg->options['publish_width']  = (int) $_POST['width'];
+		$ngg->options['publish_height'] = (int) $_POST['height'];
+		$ngg->options['publish_align'] = $_POST['align'];
+        $align = ( $ngg->options['publish_align'] == 'none') ? '' : 'float='.$ngg->options['publish_align'];
+
+		//save the new values for the next operation
+		update_option('ngg_options', $ngg->options);
+
+		$post['post_type']    = 'post';
+		$post['post_content'] = '[singlepic id=' . intval($_POST['pid']) . ' w=' . $ngg->options['publish_width'] . ' h=' . $ngg->options['publish_height'] . ' ' . $align . ']';
+		$post['post_author']  = $user_ID;
+		$post['post_status']  = isset ( $_POST['publish'] ) ? 'publish' : 'draft';
+		$post['post_title']   = $_POST['post_title'];
+		$post = apply_filters('ngg_add_new_post', $post, $_POST['pid']);
+
+		$post_id = wp_insert_post ($post);
+
+		if ($post_id != 0)
+            nggGallery::show_message( __('Published a new post','nggallery') );
+
+    }
+
+	function update_pictures() {
+		global $wpdb, $nggdb;
+
+		//TODO:Error message when update failed
+
+		$description = 	isset ( $_POST['description'] ) ? $_POST['description'] : array();
+		$alttext = 		isset ( $_POST['alttext'] ) ? $_POST['alttext'] : array();
+		$exclude = 		isset ( $_POST['exclude'] ) ? $_POST['exclude'] : false;
+		$taglist = 		isset ( $_POST['tags'] ) ? $_POST['tags'] : false;
+		$pictures = 	isset ( $_POST['pid'] ) ? $_POST['pid'] : false;
+
+		if ( is_array($pictures) ){
+			foreach( $pictures as $pid ){
+                $image = $nggdb->find_image( $pid );
+                if ($image) {
+                    // description field
+                    $image->description = stripslashes($description[$image->pid]);
+
+                    // only uptade this field if someone change the alttext
+                    if ( $image->alttext != $alttext[$image->pid] ) {
+                        $image->alttext = stripslashes($alttext[$image->pid]);
+                        $image->image_slug = nggdb::get_unique_slug( sanitize_title( $image->alttext ), 'image', $image->pid );
+                    }
+
+                    // set exclude flag
+                    if ( is_array($exclude) )
+    					$image->exclude = ( array_key_exists($image->pid, $exclude) )? 1 : 0;
+    				else
+    					$image->exclude = 0;
+
+                    // update the database
+                    $wpdb->query( $wpdb->prepare ("UPDATE $wpdb->nggpictures SET image_slug = '%s', alttext = '%s', description = '%s', exclude = %d WHERE pid = %d",
+                                                                                 $image->image_slug, $image->alttext, $image->description, $image->exclude, $image->pid) );
+                    // remove from cache
+                    wp_cache_delete($image->pid, 'ngg_image');
+
+                    // hook for other plugins after image is updated
+                    do_action('ngg_image_updated', $image);
+                }
+
+            }
+        }
+
+        //TODO: This produce 300-400 queries !
+		if ( is_array($taglist) ){
+			foreach($taglist as $key=>$value) {
+				$tags = explode(',', $value);
+				wp_set_object_terms($key, $tags, 'ngg_tag');
+			}
+		}
+
+		return;
+	}
+
+	// Check if user can select a author
+	function get_editable_user_ids( $user_id, $exclude_zeros = true ) {
+		global $wpdb;
+
+		$user = new WP_User( $user_id );
+
+		if ( ! $user->has_cap('NextGEN Manage others gallery') ) {
+			if ( $user->has_cap('NextGEN Manage gallery') || $exclude_zeros == false )
+				return array($user->id);
+			else
+				return false;
+		}
+
+		$level_key = $wpdb->prefix . 'user_level';
+		$query = "SELECT user_id FROM $wpdb->usermeta WHERE meta_key = '$level_key'";
+		if ( $exclude_zeros )
+			$query .= " AND meta_value != '0'";
+
+		return $wpdb->get_col( $query );
+	}
+
+	function search_images() {
+		global $nggdb;
+
+		if ( empty($_GET['s']) )
+			return;
+		//on what ever reason I need to set again the query var
+		set_query_var('s', $_GET['s']);
+		$request = get_search_query();
+
+        // look now for the images
+        $search_for_images = (array) $nggdb->search_for_images( $request );
+        $search_for_tags   = (array) nggTags::find_images_for_tags( $request , 'ASC' );
+
+        // finally merge the two results together
+        $this->search_result = array_merge( $search_for_images , $search_for_tags );
+
+        // TODO: Currently we didn't support a proper pagination
+        $nggdb->paged['total_objects'] = $nggdb->paged['objects_per_page'] = count ($this->search_result) ;
+        $nggdb->paged['max_objects_per_page'] = 1;
+
+		// show pictures page
+		$this->mode = 'edit';
+	}
+
+	/**
+	 * Display the pagination.
+	 *
+	 * @since 1.8.0
+     * @author taken from WP core (see includes/class-wp-list-table.php)
+	 * @return string echo the html pagination bar
+	 */
+	function pagination( $which, $current, $total_items, $per_page ) {
+
+        $total_pages = ($per_page > 0) ? ceil( $total_items / $per_page ) : 1;
+
+		$output = '<span class="displaying-num">' . sprintf( _n( '1 item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>';
+
+		$current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
+
+		$current_url = remove_query_arg( array( 'hotkeys_highlight_last', 'hotkeys_highlight_first' ), $current_url );
+
+		$page_links = array();
+
+		$disable_first = $disable_last = '';
+		if ( $current == 1 )
+			$disable_first = ' disabled';
+		if ( $current == $total_pages )
+			$disable_last = ' disabled';
+
+		$page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
+			'first-page' . $disable_first,
+			esc_attr__( 'Go to the first page' ),
+			esc_url( remove_query_arg( 'paged', $current_url ) ),
+			'&laquo;'
+		);
+
+		$page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
+			'prev-page' . $disable_first,
+			esc_attr__( 'Go to the previous page' ),
+			esc_url( add_query_arg( 'paged', max( 1, $current-1 ), $current_url ) ),
+			'&lsaquo;'
+		);
+
+		if ( 'bottom' == $which )
+			$html_current_page = $current;
+		else
+			$html_current_page = sprintf( "<input class='current-page' title='%s' type='text' name='%s' value='%s' size='%d' />",
+				esc_attr__( 'Current page' ),
+				esc_attr( 'post_paged' ),
+				$current,
+				strlen( $total_pages )
+			);
+
+		$html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) );
+		$page_links[] = '<span class="paging-input">' . sprintf( _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages ) . '</span>';
+
+		$page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
+			'next-page' . $disable_last,
+			esc_attr__( 'Go to the next page' ),
+			esc_url( add_query_arg( 'paged', min( $total_pages, $current+1 ), $current_url ) ),
+			'&rsaquo;'
+		);
+
+		$page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
+			'last-page' . $disable_last,
+			esc_attr__( 'Go to the last page' ),
+			esc_url( add_query_arg( 'paged', $total_pages, $current_url ) ),
+			'&raquo;'
+		);
+
+		$output .= "\n<span class='pagination-links'>" . join( "\n", $page_links ) . '</span>';
+
+		if ( $total_pages )
+			$page_class = $total_pages < 2 ? ' one-page' : '';
+		else
+			$page_class = ' no-pages';
+
+		$pagination = "<div class='tablenav-pages{$page_class}'>$output</div>";
+
+		echo $pagination;
+	}
+
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/media-upload.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/media-upload.php
new file mode 100644
index 0000000000000000000000000000000000000000..88f7945f866ec142978f71a182958b08e16c5b78
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/media-upload.php
@@ -0,0 +1,303 @@
+<?php
+
+/**
+ * @title  Add action/filter for the upload tab 
+ * @author Alex Rabe
+ * 
+ */
+
+function ngg_wp_upload_tabs ($tabs) {
+
+	$newtab = array('nextgen' => __('NextGEN Gallery','nggallery'));
+ 
+    return array_merge($tabs,$newtab);
+}
+	
+add_filter('media_upload_tabs', 'ngg_wp_upload_tabs');
+
+function media_upload_nextgen() {
+	
+    // Not in use
+    $errors = false;
+    
+	// Generate TinyMCE HTML output
+	if ( isset($_POST['send']) ) {
+		$keys = array_keys($_POST['send']);
+		$send_id = (int) array_shift($keys);
+		$image = $_POST['image'][$send_id];
+		$alttext = stripslashes( htmlspecialchars ($image['alttext'], ENT_QUOTES));
+		$description = stripslashes (htmlspecialchars($image['description'], ENT_QUOTES));
+		
+		// here is no new line allowed
+		$clean_description = preg_replace("/\n|\r\n|\r$/", " ", $description);
+		$img = nggdb::find_image($send_id);
+		$thumbcode = $img->get_thumbcode();
+		$class="ngg-singlepic ngg-{$image['align']}";
+
+        // Create a shell displayed-gallery so we can inspect its settings
+        $registry = C_Component_Registry::get_instance();
+        $mapper   = $registry->get_utility('I_Displayed_Gallery_Mapper');
+        $factory  = $registry->get_utility('I_Component_Factory');
+        $args = array(
+            'display_type' => NEXTGEN_BASIC_SINGLEPIC_MODULE_NAME
+        );
+        $displayed_gallery = $factory->create('displayed_gallery', $mapper, $args);
+        $width  = $displayed_gallery->display_settings['width'];
+        $height = $displayed_gallery->display_settings['height'];
+
+		// Build output
+		if ($image['size'] == "thumbnail") 
+			$html = "<img src='{$image['thumb']}' alt='{$alttext}' class='{$class}' />";
+        else
+            $html = '';
+
+		// Wrap the link to the fullsize image around
+		$html = "<a {$thumbcode} href='{$image['url']}' title='{$clean_description}'>{$html}</a>";
+
+		if ($image['size'] == "full") 
+			$html = "<img src='{$image['url']}' alt='{$alttext}' class='{$class}' />";
+		
+		if ($image['size'] == "singlepic") 
+			$html = "[singlepic id={$send_id} w={$width} h={$height} float={$image['align']}]";
+			
+		media_upload_nextgen_save_image();
+		
+		// Return it to TinyMCE
+		return media_send_to_editor($html);
+	}
+	
+	// Save button
+	if ( isset($_POST['save']) ) {
+		media_upload_nextgen_save_image();
+	}
+		
+	return wp_iframe( 'media_upload_nextgen_form', $errors );
+}
+
+add_action('media_upload_nextgen', 'media_upload_nextgen');
+
+function media_upload_nextgen_save_image() {
+		
+		global $wpdb;
+		
+		check_admin_referer('ngg-media-form');
+		
+		if ( !empty($_POST['image']) ) foreach ( $_POST['image'] as $image_id => $image ) {
+		
+    		// create a unique slug
+            $image_slug = nggdb::get_unique_slug( sanitize_title( $image['alttext'] ), 'image' ); 
+    		$wpdb->query( $wpdb->prepare ("UPDATE $wpdb->nggpictures SET image_slug= '%s', alttext= '%s', description = '%s' WHERE pid = %d", $image_slug, $image['alttext'], $image['description'], $image_id));
+            wp_cache_delete($image_id, 'ngg_image');
+	}
+}
+
+function media_upload_nextgen_form($errors) {
+
+	global $wpdb, $wp_query, $wp_locale, $type, $tab, $post_mime_types, $ngg, $nggdb;
+	
+	media_upload_header();
+
+	$post_id 	= intval($_REQUEST['post_id']);
+	$galleryID 	= 0;
+	$total 		= 1;
+	$picarray 	= array();
+	$chromeless = !empty($_GET['chromeless']) ? $_GET['chromeless'] : null;
+	$chromeless_url = $chromeless ? ('&chromeless=' . $chromeless) : null;
+	
+	$form_action_url = site_url( "wp-admin/media-upload.php?type={$GLOBALS['type']}&tab=nextgen&post_id=$post_id" . $chromeless_url, 'admin');
+
+	// Get number of images in gallery	
+	if ( isset($_REQUEST['select_gal']) ){
+		$galleryID = (int) $_REQUEST['select_gal'];
+		$total = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->nggpictures WHERE galleryid = '$galleryID'");
+	}
+	
+	// Build navigation
+	$_GET['paged'] = isset($_GET['paged']) ? intval($_GET['paged']) : 0;
+	if ( $_GET['paged'] < 1 )
+		$_GET['paged'] = 1;
+	$start = ( $_GET['paged'] - 1 ) * 10;
+	if ( $start < 1 )
+		$start = 0;
+
+	// Get the images
+	if ( $galleryID != 0 )
+		$picarray = $wpdb->get_col("SELECT pid FROM $wpdb->nggpictures WHERE galleryid = '$galleryID' AND exclude != 1 ORDER BY {$ngg->options['galSort']} {$ngg->options['galSortDir']} LIMIT $start, 10 ");	
+
+	// WP-Core code for Post-thumbnail
+	$calling_post_id = 0;
+	if ( isset( $_GET['post_id'] ) )
+		$calling_post_id = $_GET['post_id'];
+		
+?>
+
+<script type="text/javascript"> 
+<!--
+	function NGGSetAsThumbnail(id, nonce){
+		var $link = jQuery('a#ngg-post-thumbnail-' + id);
+	
+		$link.text( setPostThumbnailL10n.saving );
+		jQuery.post(ajaxurl, {
+			action:"ngg_set_post_thumbnail", post_id: post_id, thumbnail_id: id, cookie: encodeURIComponent(document.cookie)
+		}, function(str){
+			var win = window.dialogArguments || opener || parent || top;
+			$link.text( setPostThumbnailL10n.setThumbnail );
+			if ( str == '0' ) {
+				alert( setPostThumbnailL10n.error );
+			} else if (str == '-1') {
+				// image removed
+			} else {
+				WPSetAsThumbnail(str, nonce);
+			}
+		}
+		);
+	}
+//-->
+</script>
+
+<form id="filter" action="" method="get">
+<input type="hidden" name="type" value="<?php echo esc_attr( $GLOBALS['type'] ); ?>" />
+<input type="hidden" name="tab" value="<?php echo esc_attr( $GLOBALS['tab'] ); ?>" />
+<?php 
+if ($chromeless)
+{ 
+?>
+<input type="hidden" name="chromeless" value="<?php echo esc_attr( $chromeless ); ?>" />
+<?php	
+}
+?>
+<input type="hidden" name="post_id" value="<?php echo (int) $post_id; ?>" />
+
+<div class="tablenav">
+	<?php
+	$page_links = paginate_links( array(
+		'base' => add_query_arg( 'paged', '%#%' ),
+		'format' => '',
+		'total' => ceil($total / 10),
+		'current' => $_GET['paged']
+	));
+	
+	if ( $page_links )
+		echo "<div class='tablenav-pages'>$page_links</div>";
+	?>
+	
+	<div class="alignleft actions">
+		<select id="select_gal" name="select_gal" style="width:120px;">;
+			<option value="0" <?php selected('0', $galleryID); ?> ><?php esc_attr( _e('No gallery',"nggallery") ); ?></option>
+			<?php
+			// Show gallery selection
+			$gallerylist = $nggdb->find_all_galleries();
+			if(is_array($gallerylist)) {
+				foreach($gallerylist as $gallery) {
+					$selected = ($gallery->gid == $galleryID )?	' selected="selected"' : "";
+					echo '<option value="'.$gallery->gid.'"'.$selected.' >'.$gallery->title.'</option>'."\n";
+				}
+			}
+			?>
+		</select>
+		<input type="submit" id="show-gallery" value="<?php esc_attr( _e('Select &#187;','nggallery') ); ?>" class="button-secondary" />
+	</div>
+	<br style="clear:both;" />
+</div>
+</form>
+
+<form enctype="multipart/form-data" method="post" action="<?php echo esc_attr($form_action_url); ?>" class="media-upload-form" id="library-form">
+
+	<?php wp_nonce_field('ngg-media-form'); ?>
+
+	<script type="text/javascript">
+	<!--
+	jQuery(function($){
+		var preloaded = $(".media-item.preloaded");
+		if ( preloaded.length > 0 ) {
+			preloaded.each(function(){prepareMediaItem({id:this.id.replace(/[^0-9]/g, '')},'');});
+			updateMediaForm();
+		}
+	});
+	-->
+	</script>
+	
+	<div id="media-items">
+	<?php
+	if( is_array($picarray) ) {
+		foreach ($picarray as $picid) {
+			//TODO:Reduce SQL Queries
+			$picture = nggdb::find_image($picid);
+			?>
+			<div id='media-item-<?php echo $picid ?>' class='media-item preloaded'>
+			  <div class='filename'></div>
+			  <a class='toggle describe-toggle-on' href='#'><?php esc_attr( _e('Show', "nggallery") ); ?></a>
+			  <a class='toggle describe-toggle-off' href='#'><?php esc_attr( _e('Hide', "nggallery") );?></a>
+			  <div class='filename new'><?php echo ( empty($picture->alttext) ) ? wp_html_excerpt( esc_html( $picture->filename ),60) : stripslashes( wp_html_excerpt( esc_html( $picture->alttext ),60) ); ?></div>
+			  <table class='slidetoggle describe startclosed'><tbody>
+				  <tr>
+					<td rowspan='4'><img class='thumbnail' alt='<?php echo esc_attr( $picture->alttext ); ?>' src='<?php echo esc_attr( $picture->thumbURL ); ?>'/></td>
+					<td><?php esc_html( _e('Image ID:', "nggallery") ); ?><?php echo $picid ?></td>
+				  </tr>
+				  <tr><td><?php echo esc_html( $picture->filename ); ?></td></tr>
+				  <tr><td><?php echo esc_html( stripslashes($picture->alttext) ); ?></td></tr>
+				  <tr><td>&nbsp;</td></tr>
+				  <tr>
+					<td class="label"><label for="image[<?php echo $picid ?>][alttext]"><?php esc_attr_e('Alt/Title text', "nggallery") ;?></label></td>
+					<td class="field"><input id="image[<?php echo $picid ?>][alttext]" name="image[<?php echo $picid ?>][alttext]" value="<?php esc_attr_e( stripslashes($picture->alttext) ); ?>" type="text"/></td>
+				  </tr>	
+				  <tr>
+					<td class="label"><label for="image[<?php echo $picid ?>][description]"><?php esc_attr_e("Description","nggallery") ; ?></label></td>
+						<td class="field"><textarea name="image[<?php echo $picid ?>][description]" id="image[<?php echo $picid ?>][description]"><?php esc_attr_e( stripslashes($picture->description) ); ?></textarea></td>
+				  </tr>
+					<tr class="align">
+						<td class="label"><label for="image[<?php echo $picid ?>][align]"><?php esc_attr_e("Alignment"); ?></label></td>
+						<td class="field">
+							<input name="image[<?php echo $picid ?>][align]" id="image-align-none-<?php echo $picid ?>" checked="checked" value="none" type="radio" />
+							<label for="image-align-none-<?php echo $picid ?>" class="align image-align-none-label"><?php esc_attr_e("None") ;?></label>
+							<input name="image[<?php echo $picid ?>][align]" id="image-align-left-<?php echo $picid ?>" value="left" type="radio" />
+							<label for="image-align-left-<?php echo $picid ?>" class="align image-align-left-label"><?php esc_attr_e("Left") ;?></label>
+							<input name="image[<?php echo $picid ?>][align]" id="image-align-center-<?php echo $picid ?>" value="center" type="radio" />
+							<label for="image-align-center-<?php echo $picid ?>" class="align image-align-center-label"><?php esc_attr_e("Center") ;?></label>
+							<input name="image[<?php echo $picid ?>][align]" id="image-align-right-<?php echo $picid ?>" value="right" type="radio" />
+							<label for="image-align-right-<?php echo $picid ?>" class="align image-align-right-label"><?php esc_attr_e("Right") ;?></label>
+						</td>
+					</tr>
+					<tr class="image-size">
+						<th class="label"><label for="image[<?php echo $picid ?>][size]"><span class="alignleft"><?php esc_attr_e("Size") ; ?></span></label>
+						</th>
+						<td class="field">
+							<input name="image[<?php echo $picid ?>][size]" id="image-size-thumb-<?php echo $picid ?>" type="radio" checked="checked" value="thumbnail" />
+							<label for="image-size-thumb-<?php echo $picid ?>"><?php esc_attr_e("Thumbnail") ; ?></label>
+							<input name="image[<?php echo $picid ?>][size]" id="image-size-full-<?php echo $picid ?>" type="radio" value="full" />
+							<label for="image-size-full-<?php echo $picid ?>"><?php esc_attr_e("Full size") ; ?></label>
+							<input name="image[<?php echo $picid ?>][size]" id="image-size-singlepic-<?php echo $picid ?>" type="radio" value="singlepic" />
+							<label for="image-size-singlepic-<?php echo $picid ?>"><?php esc_attr_e("Singlepic", "nggallery") ; ?></label>
+						</td>
+					</tr>
+				   <tr class="submit">
+						<td>
+							<input type="hidden" name="image[<?php echo $picid ?>][thumb]" value="<?php echo esc_attr( $picture->thumbURL ); ?>" />
+							<input type="hidden" name="image[<?php echo $picid ?>][url]" value="<?php echo esc_attr( $picture->imageURL ); ?>" />
+						</td>
+						<td class="savesend">
+							<?php
+							if ( $calling_post_id && current_theme_supports( 'post-thumbnails', get_post_type( $calling_post_id ) ) )
+								$ajax_nonce = wp_create_nonce( "set_post_thumbnail-$calling_post_id" );
+								echo "<a class='ngg-post-thumbnail' id='ngg-post-thumbnail-" . $picid . "' href='#' onclick='NGGSetAsThumbnail(\"$picid\", \"$ajax_nonce\");return false;'>" . esc_html__( 'Use as featured image' ) . "</a>";
+							?>
+							<button type="submit" class="button" value="1" name="send[<?php echo $picid ?>]"><?php esc_html_e( 'Insert into Post' ); ?></button>
+						</td>
+				   </tr>
+			  </tbody></table>
+			</div>
+		<?php		  
+		}
+	}
+	?>
+	</div>
+	<p class="ml-submit">
+		<input type="submit" class="button savebutton" name="save" value="<?php esc_attr( _e('Save all changes','nggallery') ); ?>" />
+	</p>
+	<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
+	<input type="hidden" name="select_gal" id="select_gal" value="<?php echo (int) $galleryID; ?>" />
+</form>
+
+<?php
+}
+?>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/overview.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/overview.php
new file mode 100644
index 0000000000000000000000000000000000000000..435eefeb7c094045a484bc14635be0df7e0fd414
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/overview.php
@@ -0,0 +1,691 @@
+<?php
+if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
+
+/**
+ * nggallery_admin_overview()
+ *
+ * Add the admin overview the dashboard style
+ * @return mixed content
+ */
+function nggallery_admin_overview()  {
+	?>
+	<div class="wrap ngg-wrap">
+        <?php screen_icon( 'nextgen-gallery' ); ?>
+		<h2><?php _e('NextGEN Gallery Overview', 'nggallery') ?></h2>
+        <?php if (version_compare(PHP_VERSION, '5.0.0', '<')) ngg_check_for_PHP5(); ?>
+		<div id="dashboard-widgets-container" class="ngg-overview">
+		    <div id="dashboard-widgets" class="metabox-holder">
+				<div id="post-body">
+					<div id="dashboard-widgets-main-content">
+						<div class="postbox-container" id="main-container" style="width:75%;">
+							<?php do_meta_boxes('ngg_overview', 'left', ''); ?>
+						</div>
+			    		<div class="postbox-container" id="side-container" style="width:24%;">
+							<?php do_meta_boxes('ngg_overview', 'right', ''); ?>
+						</div>
+					</div>
+				</div>
+		    </div>
+		</div>
+	</div>
+	<script type="text/javascript">
+		//<![CDATA[
+        var ajaxWidgets, ajaxPopulateWidgets;
+
+        jQuery(document).ready( function($) {
+        	// These widgets are sometimes populated via ajax
+        	ajaxWidgets = [
+        		'dashboard_primary',
+        		'ngg_locale',
+        		'dashboard_plugins'
+        	];
+
+        	ajaxPopulateWidgets = function(el) {
+        		show = function(id, i) {
+        			var p, e = $('#' + id + ' div.inside:visible').find('.widget-loading');
+        			if ( e.length ) {
+        				p = e.parent();
+        				setTimeout( function(){
+        					p.load('admin-ajax.php?action=ngg_dashboard&jax=' + id, '', function() {
+        						p.hide().slideDown('normal', function(){
+        							$(this).css('display', '');
+        							if ( 'dashboard_plugins' == id && $.isFunction(tb_init) )
+        								tb_init('#dashboard_plugins a.thickbox');
+        						});
+        					});
+        				}, i * 500 );
+        			}
+        		};
+        		if ( el ) {
+        			el = el.toString();
+        			if ( $.inArray(el, ajaxWidgets) != -1 )
+        				show(el, 0);
+        		} else {
+        			$.each( ajaxWidgets, function(i) {
+        				show(this, i);
+        			});
+        		}
+        	};
+        	ajaxPopulateWidgets();
+        } );
+
+		jQuery(document).ready( function($) {
+			// postboxes setup
+			postboxes.add_postbox_toggles('ngg-overview');
+		});
+		//]]>
+	</script>
+	<?php
+}
+
+/**
+ * Load the meta boxes
+ *
+ */
+add_meta_box('dashboard_right_now', __('Welcome to NextGEN Gallery !', 'nggallery'), 'ngg_overview_right_now', 'ngg_overview', 'left', 'core');
+add_meta_box('ngg_meta_box', __('Do you like this Plugin?', 'nggallery'), 'ngg_likeThisMetaBox', 'ngg_overview', 'right', 'core');
+if ( !(get_locale() == 'en_US') )
+	add_meta_box('ngg_locale', __('Translation', 'nggallery'), 'ngg_widget_locale', 'ngg_overview', 'right', 'core');
+//add_meta_box('dashboard_primary', __('Latest News', 'nggallery'), 'ngg_widget_overview_news', 'ngg_overview', 'left', 'core');
+add_meta_box('ngg_about_meta_box', __('About', 'nggallery'), 'ngg_AboutMetaBox', 'ngg_overview', 'left', 'core');
+//add_meta_box('ngg_lastdonators', __('Recent donators', 'nggallery'), 'ngg_widget_overview_donators', 'ngg_overview', 'right', 'core');
+if ( !is_multisite() || is_super_admin() ) {
+    add_meta_box('ngg_server', __('Server Settings', 'nggallery'), 'ngg_overview_server', 'ngg_overview', 'right', 'core');
+}
+
+function ngg_AboutMetaBox()
+{
+	?>
+    <div id="poststuff">
+        <p><?php _e("NextGEN Gallery is one of the most popular Wordpress plugins of all time with over 7 million downloads. It is developed and supported by Photocrati Media. We'd like to offer a special thanks to Alex Rabe, who first developed the plugin and maintained it through 2011.", 'nggallery'); ?></p>
+        <p><?php _e("<strong>NEED  HELP?</strong> If you need help or assistance please visit the <a href='http://wordpress.org/support/plugin/nextgen-gallery'>NextGEN Gallery forums on WordPress.org</a>. Please note that we actively monitor and  participate in the forums, but given that NextGEN Gallery is a free  product, we don't guarantee replies to support queries.", 'nggallery'); ?></p>
+        <p><?php _e("<strong>EXTENDING NEXTGEN?</strong> There are many third party plugins that add displays and functionality for NextGEN Gallery. See our <a href='http://www.nextgen-gallery.com/nextgen-gallery-extension-plugins/'>Complete List of NextGEN Extension  Plugins</a>.", 'nggallery'); ?></p>
+	</div>
+	<?php
+}
+
+function ngg_likeThisMetaBox() {
+
+	echo '<p>';
+    echo sprintf(__('This plugin is primarily developed, maintained, supported and documented by <a href="%s" target="_blank">Photocrati Media</a> with a lot of love & effort. Any kind of contribution would be highly appreciated. Thanks!', 'nggallery'), 'http://www.photocrati.com/');
+	echo '</p><ul>';
+
+    $url = 'http://wordpress.org/plugins/nextgen-gallery/' ;
+    echo "<li style='padding-left: 38px; background:transparent url(" . NGGALLERY_URLPATH . "admin/images/icon-rating.png ) no-repeat scroll center left; background-position: 16px 50%; text-decoration: none;'><a href='{$url}' target='_blank'>";
+    _e('Please click "Works" on WordPress.org', 'nggallery');
+    echo "</a></li>";
+
+	$url = 'http://wordpress.org/plugins/nextgen-gallery/' ;
+	echo "<li style='padding-left: 38px; background:transparent url(" . NGGALLERY_URLPATH . "admin/images/icon-rating.png ) no-repeat scroll center left; background-position: 16px 50%; text-decoration: none;'><a href='{$url}' target='_blank'>";
+	_e('Give it a good rating on WordPress.org', 'nggallery');
+	echo "</a></li>";
+
+	$url = 'http://www.nextgen-gallery.com';
+	echo "<li style='padding-left: 38px; background:transparent url(" . NGGALLERY_URLPATH . "admin/images/nextgen.png ) no-repeat scroll center left; background-position: 16px 50%; text-decoration: none;'><a href='{$url}' target='_blank'>";
+	_e("Visit the plugin homepage", 'nggallery');
+	echo "</a></li>";
+
+	$url = 'http://www.nextgen-gallery.com/languages/';
+	echo "<li style='padding-left: 38px; background:transparent url(" . NGGALLERY_URLPATH . "admin/images/icon-translate.png ) no-repeat scroll center left; background-position: 16px 50%; text-decoration: none;'><a href='{$url}' target='_blank'>";
+	_e("Help translating it", 'nggallery');
+	echo "</a></li>";
+
+	echo '</ul>';
+
+	echo '
+	<div class="social" style="text-align:center;margin:15px 0 10px 0;"><span class="social" style="margin-right:5px;"><a target="_blank" href="http://twitter.com/NextGENGallery"><img title="Follow NextGEN on Twitter" alt="Twitter" src="' . NGGALLERY_URLPATH . 'admin/images/twitter.png"></a></span><span class="social" style="margin-right:5px;"><a target="_blank" href="http://www.facebook.com/NextGENGallery"><img title="Like NextGEN on Facebook" alt="Facebook" src="' . NGGALLERY_URLPATH . 'admin/images/facebook.png"></a></span><span class="social"><a target="_blank" href="http://plus.google.com/101643895780935290171"><img title="Add NextGEN to your circles" alt="GooglePlus" src="' . NGGALLERY_URLPATH . 'admin/images/googleplus.png"></a></span></div>';
+}
+
+/**
+ * Show the server settings in a dashboard widget
+ *
+ * @return void
+ */
+function ngg_overview_server() {
+?>
+<div id="dashboard_server_settings" class="dashboard-widget-holder wp_dashboard_empty">
+	<div class="ngg-dashboard-widget">
+	  	<div class="dashboard-widget-content">
+      		<ul class="settings">
+      		<?php ngg_get_serverinfo(); ?>
+            </ul>
+            <p><strong><?php _e('Graphic Library', 'nggallery'); ?></strong></p>
+            <ul class="settings">
+            <?php ngg_gd_info(); ?>
+	   		</ul>
+		</div>
+    </div>
+</div>
+<?php
+}
+
+/**
+ * Show the most recent donators
+ *
+ * @return void
+ */
+function ngg_widget_overview_donators() {
+    echo '<p class="widget-loading hide-if-no-js">' . __( 'Loading&#8230;' ) . '</p><p class="describe hide-if-js">' . __('This widget requires JavaScript.') . '</p>';
+}
+
+function ngg_overview_donators() {
+	global $ngg;
+
+	$i = 0;
+	$list = '';
+
+	$supporter = nggAdminPanel::get_remote_array($ngg->donators);
+
+	// Ensure that this is a array
+	if ( !is_array($supporter) )
+		return _e('Thanks to all donators...', 'nggallery');
+
+	$supporter = array_reverse($supporter);
+
+	foreach ($supporter as $name => $url) {
+		$i++;
+		if ($url)
+			$list .= "<li><a href=\"$url\">$name</a></li>\n";
+		else
+			$list .= "<li>$name</li>";
+		if ($i > 4)
+			break;
+	}
+
+?>
+<div id="dashboard_server_settings" class="dashboard-widget-holder">
+	<div class="ngg-dashboard-widget">
+	  	<div class="dashboard-widget-content">
+	  		<ul class="settings">
+			<?php echo $list; ?>
+			</ul>
+			<p class="textright">
+				<a class="button" href="admin.php?page=nggallery-about#donators"><?php _e('View all', 'nggallery'); ?></a>
+			</p>
+		</div>
+    </div>
+</div>
+<?php
+}
+
+/**
+ * Show the latest NextGEN Gallery news
+ *
+ * @return void
+ */
+function ngg_widget_overview_news() {
+    echo '<p class="widget-loading hide-if-no-js">' . __( 'Loading&#8230;' ) . '</p><p class="describe hide-if-js">' . __('This widget requires JavaScript.') . '</p>';
+}
+function ngg_overview_news(){
+
+?>
+<div class="rss-widget">
+    <?php
+    $rss = @fetch_feed( 'http://feeds.feedburner.com/nextgen-gallery' );
+
+    if ( is_object($rss) ) {
+
+        if ( is_wp_error($rss) ) {
+            echo '<p>' . sprintf(__('Newsfeed could not be loaded.  Check the <a href="%s">front page</a> to check for updates.', 'nggallery'), 'http://www.nextgen-gallery.com/') . '</p>';
+    		return;
+        }
+
+        echo '<ul>';
+		foreach ( $rss->get_items(0, 3) as $item ) {
+    		$link = $item->get_link();
+    		while ( stristr($link, 'http') != $link )
+    			$link = substr($link, 1);
+    		$link = esc_url(strip_tags($link));
+    		$title = esc_attr(strip_tags($item->get_title()));
+    		if ( empty($title) )
+    			$title = __('Untitled');
+
+    		$desc = str_replace( array("\n", "\r"), ' ', esc_attr( strip_tags( @html_entity_decode( $item->get_description(), ENT_QUOTES, get_option('blog_charset') ) ) ) );
+    		$desc = wp_html_excerpt( $desc, 360 );
+
+    		// Append ellipsis. Change existing [...] to [&hellip;].
+    		if ( '[...]' == substr( $desc, -5 ) )
+    			$desc = substr( $desc, 0, -5 ) . '[&hellip;]';
+    		elseif ( '[&hellip;]' != substr( $desc, -10 ) )
+    			$desc .= ' [&hellip;]';
+
+    		$desc = esc_html( $desc );
+
+			$date = $item->get_date();
+            $diff = '';
+
+			if ( $date ) {
+
+                $diff = human_time_diff( strtotime($date, time()) );
+
+				if ( $date_stamp = strtotime( $date ) )
+					$date = ' <span class="rss-date">' . date_i18n( get_option( 'date_format' ), $date_stamp ) . '</span>';
+				else
+					$date = '';
+			}
+        ?>
+          <li><a class="rsswidget" title="" target="_blank" href='<?php echo $link; ?>'><?php echo $title; ?></a>
+		  <span class="rss-date"><?php echo $date; ?></span>
+          <div class="rssSummary"><strong><?php echo $diff; ?></strong> - <?php echo $desc; ?></div></li>
+        <?php
+        }
+        echo '</ul>';
+      }
+    ?>
+</div>
+<?php
+}
+
+/**
+ * Show a summary of the used images
+ *
+ * @return void
+ */
+function ngg_overview_right_now() {
+	global $wpdb;
+	$images    = intval( $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->nggpictures") );
+	$galleries = intval( $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->nggallery") );
+	$albums    = intval( $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->nggalbum") );
+?>
+<div class="table table_content">
+	<p class="sub"><?php _e('At a Glance', 'nggallery'); ?></p>
+	<table>
+		<tbody>
+			<tr class="first">
+				<td class="first b"><a href="admin.php?page=ngg_addgallery"><?php echo $images; ?></a></td>
+				<td class="t"><a href="admin.php?page=ngg_addgallery"><?php echo _n( 'Image', 'Images', $images, 'nggallery' ); ?></a></td>
+				<td class="b"></td>
+				<td class="last"></td>
+			</tr>
+			<tr>
+				<td class="first b"><a href="admin.php?page=nggallery-manage-gallery"><?php echo $galleries; ?></a></td>
+				<td class="t"><a href="admin.php?page=nggallery-manage-gallery"><?php echo _n( 'Gallery', 'Galleries', $galleries, 'nggallery' ); ?></a></td>
+				<td class="b"></td>
+				<td class="last"></td>
+			</tr>
+			<tr>
+				<td class="first b"><a href="admin.php?page=nggallery-manage-album"><?php echo $albums; ?></a></td>
+				<td class="t"><a href="admin.php?page=nggallery-manage-album"><?php echo _n( 'Album', 'Albums', $albums, 'nggallery' ); ?></a></td>
+				<td class="b"></td>
+				<td class="last"></td>
+			</tr>
+		</tbody>
+	</table>
+</div>
+<div class="versions" style="padding-top:14px">
+    <br class="clear" />
+</div>
+<?php
+if ( is_multisite() )
+    ngg_dashboard_quota();
+}
+
+// Display File upload quota on dashboard
+function ngg_dashboard_quota() {
+
+	if ( get_site_option( 'upload_space_check_disabled' ) )
+		return;
+
+    if ( !wpmu_enable_function('wpmuQuotaCheck') )
+        return;
+
+	$quota = get_space_allowed();
+	$used = get_dirsize( BLOGUPLOADDIR ) / 1024 / 1024;
+
+	if ( $used > $quota )
+		$percentused = '100';
+	else
+		$percentused = ( $used / $quota ) * 100;
+	$used_color = ( $percentused < 70 ) ? ( ( $percentused >= 40 ) ? 'waiting' : 'approved' ) : 'spam';
+	$used = round( $used, 2 );
+	$percentused = number_format( $percentused );
+
+	?>
+	<p class="sub musub" style="position:static" ><?php _e( 'Storage Space' ); ?></p>
+	<div class="table table_content musubtable">
+	<table>
+		<tr class="first">
+			<td class="first b b-posts"><?php printf( __( '<a href="%1$s" title="Manage Uploads" class="musublink">%2$sMB</a>' ), esc_url( admin_url( 'admin.php?page=nggallery-manage-gallery' ) ), $quota ); ?></td>
+			<td class="t posts"><?php _e( 'Space Allowed' ); ?></td>
+		</tr>
+	</table>
+	</div>
+	<div class="table table_discussion musubtable">
+	<table>
+		<tr class="first">
+			<td class="b b-comments"><?php printf( __( '<a href="%1$s" title="Manage Uploads" class="musublink">%2$sMB (%3$s%%)</a>' ), esc_url( admin_url( 'admin.php?page=nggallery-manage-gallery' ) ), $used, $percentused ); ?></td>
+			<td class="last t comments <?php echo $used_color;?>"><?php _e( 'Space Used' );?></td>
+		</tr>
+	</table>
+	</div>
+	<br class="clear" />
+	<?php
+}
+
+/**
+ * Looks up for translation file
+ *
+ * @return void
+ */
+function ngg_widget_locale() {
+
+	require_once(NGGALLERY_ABSPATH . '/lib/locale.php');
+
+	$locale = new ngg_locale();
+
+	$overview_url = admin_url() . 'admin.php?page=' . NGGFOLDER;
+
+	// Check if someone would like to update the translation file
+	if ( isset($_GET['locale']) && $_GET['locale'] == 'update' ) {
+		check_admin_referer('ngg_update_locale');
+
+		$result = $locale->download_locale();
+
+		if ($result == true) {
+		?>
+		<p class="hint"><?php _e('Translation file successful updated. Please reload page.', 'nggallery'); ?></p>
+		<p class="textright">
+			<a class="button" href="<?php echo esc_url(strip_tags($overview_url)); ?>"><?php _e('Reload page', 'nggallery'); ?></a>
+		</p>
+		<?php
+		} else {
+		?>
+		<p class="hint"><?php _e('Translation file couldn\'t be updated', 'nggallery'); ?></p>
+		<?php
+		}
+
+		return;
+	}
+
+    echo '<p class="widget-loading hide-if-no-js">' . __( 'Loading&#8230;' ) . '</p><p class="describe hide-if-js">' . __('This widget requires JavaScript.') . '</p>';
+}
+
+function ngg_locale() {
+	global $ngg;
+
+	require_once(NGGALLERY_ABSPATH . '/lib/locale.php');
+
+	$locale = new ngg_locale();
+	$overview_url = admin_url() . 'admin.php?page=' . NGGFOLDER;
+    $result = $locale->check();
+	$update_url    = wp_nonce_url ( $overview_url . '&amp;locale=update', 'ngg_update_locale');
+
+	//Translators can change this text via gettext
+	if ($result == 'installed') {
+		echo $ngg->translator;
+		if ( !is_wp_error($locale->response) && $locale->response['response']['code'] == '200') {
+		?>
+		<p class="textright">
+			<a class="button" href="<?php echo esc_url( strip_tags($update_url) ); ?>"><?php _e('Update', 'nggallery'); ?></a>
+		</p>
+		<?php
+		}
+	}
+
+	//Translators can change this text via gettext
+	if ($result == 'available') {
+		?>
+		<p><strong>Download now your language file !</strong></p>
+		<p class="textright">
+			<a class="button" href="<?php echo esc_url( strip_tags($update_url) ); ?>"><?php _e('Download', 'nggallery'); ?></a>
+		</p>
+		<?php
+	}
+
+
+	if ($result == 'not_exist')
+		echo '<p class="hint">'. sprintf( '<strong>Would you like to help translating this plugin?</strong> <a target="_blank" href="%s">Download</a> the current pot file and read <a href="http://www.nextgen-gallery.com/translating-nextgen-gallery/">here</a> how you can translate the plugin.', NGGALLERY_URLPATH . 'lang/nggallery.pot').'</p>';
+
+}
+
+/**
+ * Show GD Library version information
+ *
+ * @return void
+ */
+function ngg_gd_info() {
+
+	if(function_exists("gd_info")){
+		$info = gd_info();
+		$keys = array_keys($info);
+		for($i=0; $i<count($keys); $i++) {
+			if(is_bool($info[$keys[$i]]))
+				echo "<li> " . $keys[$i] ." : <span>" . ngg_gd_yesNo($info[$keys[$i]]) . "</span></li>\n";
+			else
+				echo "<li> " . $keys[$i] ." : <span>" . $info[$keys[$i]] . "</span></li>\n";
+		}
+	}
+	else {
+		echo '<h4>'.__('No GD support', 'nggallery').'!</h4>';
+	}
+}
+
+/**
+ * Return localized Yes or no
+ *
+ * @param bool $bool
+ * @return return 'Yes' | 'No'
+ */
+function ngg_gd_yesNo( $bool ){
+	if($bool)
+		return __('Yes', 'nggallery');
+	else
+		return __('No', 'nggallery');
+}
+
+
+/**
+ * Show up some server infor's
+ * @author GamerZ (http://www.lesterchan.net)
+ *
+ * @return void
+ */
+function ngg_get_serverinfo() {
+
+	global $wpdb, $ngg;
+	// Get MYSQL Version
+	$sqlversion = $wpdb->get_var("SELECT VERSION() AS version");
+	// GET SQL Mode
+	$mysqlinfo = $wpdb->get_results("SHOW VARIABLES LIKE 'sql_mode'");
+	if (is_array($mysqlinfo)) $sql_mode = $mysqlinfo[0]->Value;
+	if (empty($sql_mode)) $sql_mode = __('Not set', 'nggallery');
+	// Get PHP Safe Mode
+	if(ini_get('safe_mode')) $safe_mode = __('On', 'nggallery');
+	else $safe_mode = __('Off', 'nggallery');
+	// Get PHP allow_url_fopen
+	if(ini_get('allow_url_fopen')) $allow_url_fopen = __('On', 'nggallery');
+	else $allow_url_fopen = __('Off', 'nggallery');
+	// Get PHP Max Upload Size
+	if(ini_get('upload_max_filesize')) $upload_max = ini_get('upload_max_filesize');
+	else $upload_max = __('N/A', 'nggallery');
+	// Get PHP Output buffer Size
+	if(ini_get('pcre.backtrack_limit')) $backtrack_limit = ini_get('pcre.backtrack_limit');
+	else $backtrack_limit = __('N/A', 'nggallery');
+	// Get PHP Max Post Size
+	if(ini_get('post_max_size')) $post_max = ini_get('post_max_size');
+	else $post_max = __('N/A', 'nggallery');
+	// Get PHP Max execution time
+	if(ini_get('max_execution_time')) $max_execute = ini_get('max_execution_time');
+	else $max_execute = __('N/A', 'nggallery');
+	// Get PHP Memory Limit
+	if(ini_get('memory_limit')) $memory_limit = $ngg->memory_limit;
+	else $memory_limit = __('N/A', 'nggallery');
+	// Get actual memory_get_usage
+	if (function_exists('memory_get_usage')) $memory_usage = round(memory_get_usage() / 1024 / 1024, 2) . __(' MByte', 'nggallery');
+	else $memory_usage = __('N/A', 'nggallery');
+	// required for EXIF read
+	if (is_callable('exif_read_data')) $exif = __('Yes', 'nggallery'). " ( V" . substr(phpversion('exif'),0,4) . ")" ;
+	else $exif = __('No', 'nggallery');
+	// required for meta data
+	if (is_callable('iptcparse')) $iptc = __('Yes', 'nggallery');
+	else $iptc = __('No', 'nggallery');
+	// required for meta data
+	if (is_callable('xml_parser_create')) $xml = __('Yes', 'nggallery');
+	else $xml = __('No', 'nggallery');
+
+?>
+	<li><?php _e('Operating System', 'nggallery'); ?> : <span><?php echo PHP_OS; ?>&nbsp;(<?php echo (PHP_INT_SIZE * 8) ?>&nbsp;Bit)</span></li>
+	<li><?php _e('Server', 'nggallery'); ?> : <span><?php echo $_SERVER["SERVER_SOFTWARE"]; ?></span></li>
+	<li><?php _e('Memory usage', 'nggallery'); ?> : <span><?php echo $memory_usage; ?></span></li>
+	<li><?php _e('MYSQL Version', 'nggallery'); ?> : <span><?php echo $sqlversion; ?></span></li>
+	<li><?php _e('SQL Mode', 'nggallery'); ?> : <span><?php echo $sql_mode; ?></span></li>
+	<li><?php _e('PHP Version', 'nggallery'); ?> : <span><?php echo PHP_VERSION; ?></span></li>
+	<li><?php _e('PHP Safe Mode', 'nggallery'); ?> : <span><?php echo $safe_mode; ?></span></li>
+	<li><?php _e('PHP Allow URL fopen', 'nggallery'); ?> : <span><?php echo $allow_url_fopen; ?></span></li>
+	<li><?php _e('PHP Memory Limit', 'nggallery'); ?> : <span><?php echo $memory_limit; ?></span></li>
+	<li><?php _e('PHP Max Upload Size', 'nggallery'); ?> : <span><?php echo $upload_max; ?></span></li>
+	<li><?php _e('PHP Max Post Size', 'nggallery'); ?> : <span><?php echo $post_max; ?></span></li>
+	<li><?php _e('PCRE Backtracking Limit', 'nggallery'); ?> : <span><?php echo $backtrack_limit; ?></span></li>
+	<li><?php _e('PHP Max Script Execute Time', 'nggallery'); ?> : <span><?php echo $max_execute; ?>s</span></li>
+	<li><?php _e('PHP Exif support', 'nggallery'); ?> : <span><?php echo $exif; ?></span></li>
+	<li><?php _e('PHP IPTC support', 'nggallery'); ?> : <span><?php echo $iptc; ?></span></li>
+	<li><?php _e('PHP XML support', 'nggallery'); ?> : <span><?php echo $xml; ?></span></li>
+<?php
+}
+
+/**
+ * Inform about the end of PHP4
+ *
+ * @return void
+ */
+function ngg_check_for_PHP5() {
+    ?>
+	<div class="updated">
+		<p><?php _e('NextGEN Gallery contains some functions which are only available under PHP 5.2. You are using the old PHP 4 version, upgrade now! It\'s no longer supported by the PHP group. Many shared hosting providers offer both PHP 4 and PHP 5, running simultaneously. Ask your provider if they can do this.', 'nggallery'); ?></p>
+	</div>
+    <?php
+}
+
+/**
+ * ngg_get_phpinfo() - Extract all of the data from phpinfo into a nested array
+ *
+ * @author jon@sitewizard.ca
+ * @return array
+ */
+function ngg_get_phpinfo() {
+
+	ob_start();
+	phpinfo();
+	$phpinfo = array('phpinfo' => array());
+
+	if ( preg_match_all('#(?:<h2>(?:<a name=".*?">)?(.*?)(?:</a>)?</h2>)|(?:<tr(?: class=".*?")?><t[hd](?: class=".*?")?>(.*?)\s*</t[hd]>(?:<t[hd](?: class=".*?")?>(.*?)\s*</t[hd]>(?:<t[hd](?: class=".*?")?>(.*?)\s*</t[hd]>)?)?</tr>)#s', ob_get_clean(), $matches, PREG_SET_ORDER) )
+	    foreach($matches as $match) {
+	        if(strlen($match[1]))
+	            $phpinfo[$match[1]] = array();
+	        elseif(isset($match[3]))
+	            $phpinfo[end(array_keys($phpinfo))][$match[2]] = isset($match[4]) ? array($match[3], $match[4]) : $match[3];
+	        else
+	            $phpinfo[end(array_keys($phpinfo))][] = $match[2];
+	    }
+
+	return $phpinfo;
+}
+
+function ngg_list_contributors()	{
+/* The list of my contributors. Thanks to all of them !*/
+
+	$contributors = array(
+	'Anty (Code contributor)' => 'http://www.anty.at/',
+	'Bjoern von Prollius (Code contributor)' => 'http://www.prollius.de/',
+	'Simone Fumagalli (Code contributor)' => 'http://www.iliveinperego.com/',
+	'Vincent Prat (Code contributor)' => 'http://www.vincentprat.info',
+	'Frederic De Ranter (AJAX code contributor)' => 'http://li.deranter.com/',
+	'Christian Arnold (Code contributor)' => 'http://blog.arctic-media.de/',
+	'Thomas Matzke (Album code contributor)' => 'http://mufuschnu.mu.funpic.de/',
+	'KeViN (Sidebar Widget developer)' => 'http://www.kev.hu/',
+	'Lazy (German Translation)' => 'http://www.lazychris.de/',
+	'Lise (French Translation)' => 'http://liseweb.fr/',
+	'Anja (Dutch Translation)' => 'http://www.werkgroepen.net/wordpress',
+	'Adrian (Indonesian Translation)' => 'http://adrian.web.id/',
+	'Gaspard Tseng / SillyCCSmile (Chinese Translation)' => '',
+	'Mika Pennanen (Finnish Translation)' => 'http://kapsi.fi/~penni',
+	'Wojciech Owczarek (Polish Translation)' => 'http://www.owczi.net',
+	'Dilip Ramirez (Spanish Translation)' => 'http://jmtd.110mb.com/blog',
+	'Oleinikov Vedmak Evgeny (Russian Translation)' => 'http://ka-2-03.mirea.org/',
+	'Sebastien MALHERBE	(Logo design)' => 'http://www.7vision.com/',
+	'Claudia (German documentation)' => 'http://www.blog-werkstatt.de/',
+	'Robert (German documentation)' => 'http://www.curlyrob.de/',
+	'Pierpaolo Mannone (Italian Translation)' => 'http://www.interscambiocasa.com/',
+	'Mattias Tengblad (Swedish Translation)' => 'http://wp-support.se/',
+	'M&uuml;fit Kiper (Swedish Translation)' => 'http://www.kiper.se/',
+	'Gil Yaker (Documentation)' => 'http://bamboosoup.com/',
+	'Morten Johansen (Danish Translation)' => 'http://www.fr3ak.dk/',
+	'Vidar Seland (Norwegian Translation)' => 'http://www.viidar.net/',
+	'Emre G&uuml;ler (Turkish Translation)' => 'http://www.emreguler.com/',
+	'Emilio Lauretti (Italian Translation)' => '',
+	'Jan Angelovic (Czech Translation)' => 'http://www.angelovic.cz/',
+	'Laki (Slovak Translation)' => 'http://www.laki.sk/',
+	'Rowan Crane (WPMU support)' => 'http://blog.rowancrane.com/',
+	'Kuba Zwolinski (Polish Translation)' => 'http://kubazwolinski.com/',
+	'Rina Jiang (Chinese Translation)' => 'http://http://mysticecho.net/',
+	'Anthony (Chinese Translation)' => 'http://www.angryouth.com/',
+	'Milan Vasicek (Czech Translation)' => 'http://www.NoWorkTeam.cz/',
+	'Joo Gi-young (Korean Translation)' => 'http://lombric.linuxstudy.pe.kr/wp/',
+	'Oleg A. Safonov (Russian Translation)' => 'http://blog.olart.ru',
+	'AleXander Kirichev (Bulgarian Translation)' => 'http://xsakex.art-bg.org/',
+	'Richer Yang (Chinese Translation)' => 'http://fantasyworld.idv.tw/',
+	'Bill Jones (Forums contributor)' => 'http://jonesphoto.bluehorizoninternet.com/',
+	'TheDonSansone (Forums contributor)' => 'http://abseiling.200blogs.co.uk/',
+	'Komyshov (Russian Translation)' => 'http://kf-web.ru/',
+	'aleX Zhang (Chinese Translation)' => 'http://zhangfei.info/',
+	'TheSoloist (Chinese Translation)' => 'http://www.soloist-ic.cn/',
+	'Nica Luigi Cristian (Romanian Translation)' => 'http://www.cristiannica.com/',
+	'Zdenek Hatas (Czech Translation)' => '',
+	'David Potter (Documentation and Help)' => 'http://dpotter.net/',
+	'Carlale Chen (Chinese Translation)' => 'http://0-o-0.cc/',
+	'Nica Luigi Cristian (Romanian Translation)' => 'http://www.cristiannica.com/',
+	'Igor Shevkoplyas (Russian Translation)' => 'http://www.russian-translation-matters.com',
+	'Alexandr Kindras (Code contributor)' => 'http://www.fixdev.com',
+	'Manabu Togawa (Japanese Translation)' => 'http://www.churadesign.com/',
+	'Serhiy Tretyak (Ukrainian Translation)' => 'http://designpoint.com.ua/',
+	'Janis Grinvalds (Latvian Translation)' => 'http://riga.bmxrace.lv/',
+	'Kristoffer Th&oslash;ring (Norwegian Translation)' => '',
+	'Flactarus (Italian Translation)' => 'http://www.giroevago.it',
+	'Felip Alfred Galit&oacute; i Trilla (Catalan Translation)' => 'http://www.bratac.cat',
+	'Luka Komac (Slovenian Translation)' => 'http://www.komac.biz',
+    'Dimitris Ikonomou / Nikos Mouratidis (Greek Translation)' => 'http://www.kepik.gr'
+	);
+
+	ksort($contributors);
+	$i = count($contributors);
+	foreach ($contributors as $name => $url)
+	{
+		if ($url)
+			echo "<a href=\"$url\" target=\"_blank\">$name</a>";
+		else
+			echo $name;
+		$i--;
+		if ($i == 1)
+			echo " & ";
+		elseif ($i)
+			echo ", ";
+	}
+}
+
+function ngg_list_support()	{
+/* The list of my supporters. Thanks to all of them !*/
+
+	global $ngg;
+
+	$supporter = nggAdminPanel::get_remote_array($ngg->donators);
+
+	// Ensure that this is a array
+	if ( !is_array($supporter) )
+		return _e('and all donators...', 'nggallery');
+
+	ksort($supporter);
+	$i = count($supporter);
+	foreach ($supporter as $name => $url)
+	{
+		if ($url)
+			echo "<a href=\"$url\" target=\"_blank\">$name</a>";
+		else
+			echo $name;
+		$i--;
+		if ($i == 1)
+			echo " & ";
+		elseif ($i)
+			echo ", ";
+	}
+}
+?>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/publish.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/publish.php
new file mode 100644
index 0000000000000000000000000000000000000000..cd8c9047640c0a874778e8e1503f727957066988
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/publish.php
@@ -0,0 +1,64 @@
+<?php
+
+require_once( dirname( dirname(__FILE__) ) . '/ngg-config.php');
+require_once( NGGALLERY_ABSPATH . '/lib/image.php' );
+
+if ( !is_user_logged_in() )
+	die(__('Cheatin&#8217; uh?'));
+	
+if ( !current_user_can('NextGEN Manage gallery') ) 
+	die(__('Cheatin&#8217; uh?'));
+
+if ( !current_user_can( 'publish_posts' ) )
+    die(__('Cheatin&#8217; uh?'));
+
+global $wpdb;
+
+$id = (int) $_GET['id'];
+
+// let's get the image data
+$picture = nggdb::find_image($id);
+
+// use defaults the first time
+$width  = empty ($ngg->options['publish_width'])  ? $ngg->options['thumbwidth'] : $ngg->options['publish_width'];
+$height = empty ($ngg->options['publish_height']) ? $ngg->options['thumbheight'] : $ngg->options['publish_height'];
+$align  = empty ($ngg->options['publish_align'])  ? 'none' : $ngg->options['publish_align'];
+
+?>
+
+<form id="form-publish-post" method="POST" accept-charset="utf-8">
+<?php wp_nonce_field('publish-post') ?>
+<input type="hidden" name="page" value="publish-post" />
+<input type="hidden" name="pid" value="<?php echo $picture->pid; ?>" />
+<table width="100%" border="0" cellspacing="3" cellpadding="3" >
+	<tr valign="top">
+		<th align="left"><?php _e('Post title','nggallery') ?></th>
+		<td><input type="text" size="70" name="post_title" value="<?php echo esc_attr( $picture->alttext);  ?>" />
+		<br /><small><?php _e('Enter the post title ','nggallery') ?></small></td>
+	</tr>
+	<tr valign="top">
+		<th align="left"><?php _e('Width x height (in pixel)','nggallery') ?></th>
+		<td><input type="text" size="5" maxlength="5" name="width" value="<?php echo $width; ?>" /> x <input type="text" size="5" maxlength="5" name="height" value="<?php echo $height; ?>" />
+		<br /><small><?php _e('Size of the image','nggallery') ?></small></td>
+	</tr>
+	<tr valign="top">
+		<th align="left"><?php _e('Alignment','nggallery') ?></th>
+		<td><input type="radio" value="none" <?php checked('none', $align); ?> id="image-align-none" name="align"/>
+            <label class="align" for="image-align-none"><?php _e('None','nggallery'); ?></label>
+            <input type="radio" value="left" <?php checked('left', $align); ?> id="image-align-left" name="align"/>
+            <label class="align" for="image-align-left"><?php _e('Left','nggallery'); ?></label>
+            <input type="radio" value="center" <?php checked('center', $align); ?> id="image-align-center" name="align"/>
+            <label class="align" for="image-align-center"><?php _e('Center','nggallery'); ?></label>
+            <input type="radio" value="right" <?php checked('right', $align); ?> id="image-align-right" name="align"/>
+            <label class="align" for="image-align-right"><?php _e('Right','nggallery'); ?></label>
+        </td>
+	</tr>
+  	<tr align="right">
+    	<td colspan="2" class="submit">
+    		<input class="button-primary" type="submit" name="publish" value="<?php _e('Publish', 'nggallery');?>" />
+    		&nbsp;
+    		<input class="button-secondary" type="submit" name="draft" value="&nbsp;<?php _e('Draft', 'nggallery'); ?>&nbsp;" />
+    	</td>
+	</tr>
+</table>
+</form>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/roles.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/roles.php
new file mode 100644
index 0000000000000000000000000000000000000000..fdd488c7788dc06c88ee49be510edd190a1db058
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/roles.php
@@ -0,0 +1,137 @@
+<?php
+
+if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
+
+function nggallery_admin_roles()  {
+
+if ( !empty($_POST) ) {
+
+	check_admin_referer('ngg_addroles');
+
+	// now set or remove the capability
+	ngg_set_capability($_POST['general'],"NextGEN Gallery overview");
+	ngg_set_capability($_POST['tinymce'],"NextGEN Use TinyMCE");
+	ngg_set_capability($_POST['add_gallery'],"NextGEN Upload images");
+	ngg_set_capability($_POST['manage_gallery'],"NextGEN Manage gallery");
+	ngg_set_capability($_POST['manage_others'],"NextGEN Manage others gallery");
+	ngg_set_capability($_POST['manage_tags'],"NextGEN Manage tags");
+	ngg_set_capability($_POST['edit_album'],"NextGEN Edit album");
+	ngg_set_capability($_POST['change_style'],"NextGEN Change style");
+	ngg_set_capability($_POST['change_options'],"NextGEN Change options");
+	ngg_set_capability($_POST['attach_interface'],"NextGEN Attach Interface");
+}
+
+?>
+	<div class="wrap">
+	<p><?php _e('Select the lowest role which should be able to access the following capabilities. NextGEN Gallery supports the standard roles from WordPress.', 'nggallery') ?> <br />
+	   <?php _e('For a more flexible user management you can use the', 'nggallery') ?> <a href="http://wordpress.org/extend/plugins/capsman/" target="_blank">Capability Manager</a>.</p>
+		<?php wp_nonce_field('ngg_addroles') ?>
+			<table class="form-table">
+			<tr valign="top">
+				<th scope="row"><?php _e('Main NextGEN Gallery overview', 'nggallery') ;?>:</th>
+				<td><label for="general"><select name="general" id="general"><?php wp_dropdown_roles( ngg_get_role('NextGEN Gallery overview') ); ?></select></label></td>
+			</tr>
+			<tr valign="top">
+				<th scope="row"><?php _e('Use TinyMCE Button / Upload tab', 'nggallery') ;?>:</th>
+				<td><label for="tinymce"><select name="tinymce" id="tinymce"><?php wp_dropdown_roles( ngg_get_role('NextGEN Use TinyMCE') ); ?></select></label></td>
+			</tr>
+			<tr valign="top">
+				<th scope="row"><?php _e('Add gallery / Upload images', 'nggallery') ;?>:</th>
+				<td><label for="add_gallery"><select name="add_gallery" id="add_gallery"><?php wp_dropdown_roles( ngg_get_role('NextGEN Upload images') ); ?></select></label></td>
+			</tr>
+			<tr valign="top">
+				<th scope="row"><?php _e('Manage gallery', 'nggallery') ;?>:</th>
+				<td><label for="manage_gallery"><select name="manage_gallery" id="manage_gallery"><?php wp_dropdown_roles( ngg_get_role('NextGEN Manage gallery') ); ?></select></label></td>
+			</tr>
+			<tr valign="top">
+				<th scope="row"><?php _e('Manage others gallery', 'nggallery') ;?>:</th>
+				<td><label for="manage_others"><select name="manage_others" id="manage_others"><?php wp_dropdown_roles( ngg_get_role('NextGEN Manage others gallery') ); ?></select></label></td>
+			</tr>
+			<tr valign="top">
+				<th scope="row"><?php _e('Manage tags', 'nggallery') ;?>:</th>
+				<td><label for="manage_tags"><select name="manage_tags" id="manage_tags"><?php wp_dropdown_roles( ngg_get_role('NextGEN Manage tags') ); ?></select></label></td>
+			</tr>
+			<tr valign="top">
+				<th scope="row"><?php _e('Edit Album', 'nggallery') ;?>:</th>
+				<td><label for="edit_album"><select name="edit_album" id="edit_album"><?php wp_dropdown_roles( ngg_get_role('NextGEN Edit album') ); ?></select></label></td>
+			</tr>
+			<tr valign="top">
+				<th scope="row"><?php _e('Change style', 'nggallery') ;?>:</th>
+				<td><label for="change_style"><select name="change_style" id="change_style"><?php wp_dropdown_roles( ngg_get_role('NextGEN Change style') ); ?></select></label></td>
+			</tr>
+			<tr valign="top">
+				<th scope="row"><?php _e('Change options', 'nggallery') ;?>:</th>
+				<td><label for="change_options"><select name="change_options" id="change_options"><?php wp_dropdown_roles( ngg_get_role('NextGEN Change options') ); ?></select></label></td>
+			</tr>
+			<tr valign="top">
+				<th scope="row"><?php _e('NextGEN Attach Interface', 'nggallery') ;?>:</th>
+				<td><label for="attach_interface"><select name="attach_interface" id="attach_interface"><?php wp_dropdown_roles( ngg_get_role('NextGEN Attach Interface') ); ?></select></label></td>
+			</tr>
+			</table>
+	</div>
+<?php
+
+}
+
+function ngg_get_sorted_roles() {
+	// This function returns all roles, sorted by user level (lowest to highest)
+	global $wp_roles;
+	$roles = $wp_roles->role_objects;
+	$sorted = array();
+
+	if( class_exists('RoleManager') ) {
+		foreach( $roles as $role_key => $role_name ) {
+			$role = get_role($role_key);
+			if( empty($role) ) continue;
+			$role_user_level = array_reduce(array_keys($role->capabilities), array('WP_User', 'level_reduction'), 0);
+			$sorted[$role_user_level] = $role;
+		}
+		$sorted = array_values($sorted);
+	} else {
+		$role_order = array("subscriber", "contributor", "author", "editor", "administrator");
+		foreach($role_order as $role_key) {
+			$sorted[$role_key] = get_role($role_key);
+		}
+	}
+	return $sorted;
+}
+
+function ngg_get_role($capability){
+	// This function return the lowest roles which has the capabilities
+	$check_order = ngg_get_sorted_roles();
+
+	$args = array_slice(func_get_args(), 1);
+	$args = array_merge(array($capability), $args);
+
+	foreach ($check_order as $check_role) {
+		if ( empty($check_role) )
+			return false;
+
+		if (call_user_func_array(array(&$check_role, 'has_cap'), $args))
+			return $check_role->name;
+	}
+	return false;
+}
+
+function ngg_set_capability($lowest_role, $capability){
+	// This function set or remove the $capability
+	$check_order = ngg_get_sorted_roles();
+
+	$add_capability = false;
+
+	foreach ($check_order as $the_role) {
+		$role = $the_role->name;
+
+		if ( $lowest_role == $role )
+			$add_capability = true;
+
+		// If you rename the roles, then please use a role manager plugin
+
+		if ( empty($the_role) )
+			continue;
+
+		$add_capability ? $the_role->add_cap($capability) : $the_role->remove_cap($capability) ;
+	}
+}
+
+?>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/rotate.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/rotate.php
new file mode 100644
index 0000000000000000000000000000000000000000..4899df5a162d8cbaca003eb0f04a8c5e3d501c19
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/rotate.php
@@ -0,0 +1,98 @@
+<?php
+/**
+
+Custom thumbnail for NGG
+Author : Simone Fumagalli | simone@iliveinperego.com
+More info and update : http://www.iliveinperego.com/rotate_for_ngg/
+
+Credits:
+ NextGen Gallery : Alex Rabe | http://alexrabe.boelinger.com/wordpress-plugins/nextgen-gallery/
+ 
+**/
+
+require_once( dirname( dirname(__FILE__) ) . '/ngg-config.php');
+require_once( NGGALLERY_ABSPATH . '/lib/image.php' );
+
+if ( !is_user_logged_in() )
+	die(__('Cheatin&#8217; uh?'));
+	
+if ( !current_user_can('NextGEN Manage gallery') ) 
+	die(__('Cheatin&#8217; uh?'));
+
+global $wpdb;
+
+$id = (int) $_GET['id'];
+
+// let's get the image data
+$picture = nggdb::find_image($id);
+
+include_once( nggGallery::graphic_library() );
+$ngg_options = get_option('ngg_options');
+
+$thumb = new ngg_Thumbnail($picture->imagePath, TRUE);
+$thumb->resize(350,350);
+
+// we need the new dimension
+$resizedPreviewInfo = $thumb->newDimensions;
+$thumb->destruct();
+
+$preview_image		= trailingslashit( home_url() ) . 'index.php?callback=image&amp;pid=' . $picture->pid . '&amp;width=350&amp;height=350';
+
+?>
+
+<script type='text/javascript'>
+	var selectedImage = "thumb<?php echo $id ?>";
+	
+	function rotateImage() {
+		
+		var rotate_angle = jQuery('input[name=ra]:checked').val();
+		
+		jQuery.ajax({
+		  url: ajaxurl,
+		  type : "POST",
+		  data:  {action: 'rotateImage', id: <?php echo $id ?>, ra: rotate_angle},
+		  cache: false,
+		  success: function (msg) { 
+				var d = new Date();
+				newUrl = jQuery("#"+selectedImage).attr("src") + "?" + d.getTime();
+				jQuery("#"+selectedImage).attr("src" , newUrl);
+					
+		  	showMessage('<?php _e('Image rotated', 'nggallery'); ?>') 
+		  },
+		  error: function (msg, status, errorThrown) { showMessage('<?php _e('Error rotating thumbnail', 'nggallery'); ?>') }
+		});
+
+	}
+	
+	function showMessage(message) {
+		jQuery('#thumbMsg').html(message);
+		jQuery('#thumbMsg').css({'display':'block'});
+		setTimeout(function(){ jQuery('#thumbMsg').fadeOut('slow'); }, 1500);
+		
+		var d = new Date();
+		newUrl = jQuery("#imageToEdit").attr("src") + "?" + d.getTime();
+		jQuery("#imageToEdit").attr("src" , newUrl);
+							
+	}
+</script>
+
+<table width="98%" align="center" style="border:1px solid #DADADA">
+	<tr style="height : 360px;">
+		<td valign="middle" align="center" style="background-color:#DADADA; width : 370px;">
+			<img src="<?php echo esc_url( $preview_image ); ?>" alt="" id="imageToEdit" />	
+		</td>
+		<td>
+			<input type="radio" name="ra" value="cw" /><?php esc_html_e('90&deg; clockwise', 'nggallery'); ?><br />
+			<input type="radio" name="ra" value="ccw" /><?php esc_html_e('90&deg; anticlockwise', 'nggallery'); ?><br />
+			<input type="radio" name="ra" value="fv" /><?php esc_html_e('Flip vertically', 'nggallery'); ?><br />
+			<input type="radio" name="ra" value="fh" /><?php esc_html_e('Flip horizontally', 'nggallery'); ?>
+		</td>		
+	</tr>
+	<tr style="background-color:#DADADA;">
+
+		<td colspan="2">
+			<input type="button" name="update" value="<?php esc_attr_e('Update', 'nggallery'); ?>" onclick="rotateImage()" class="button-secondary" style="float:right; margin-left:4px;"/>
+			<div id="thumbMsg" style="color:#FF0000; display : none;font-size:11px; float:right; width:60%; height:2em; line-height:2em;"></div>
+		</td>
+	</tr>
+</table>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/settings.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/settings.php
new file mode 100644
index 0000000000000000000000000000000000000000..0f1ebba393d20d21c26f5befae89b01b79bbca17
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/settings.php
@@ -0,0 +1,943 @@
+<?php
+if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
+
+/**
+ * Rebuild slugs for albums, galleries and images via AJAX request
+ *
+ * @sine 1.7.0
+ * @access internal
+ */
+class ngg_rebuild_unique_slugs {
+
+	function start_rebuild() {
+        global $wpdb;
+
+        $total = array();
+        // get the total number of images
+		$total['images'] = intval( $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->nggpictures") );
+        $total['gallery'] = intval( $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->nggallery") );
+        $total['album'] = intval( $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->nggalbum") );
+
+		$messages = array(
+			'images' => __( 'Rebuild image structure : %s / %s images', 'nggallery' ),
+			'gallery' => __( 'Rebuild gallery structure : %s / %s galleries', 'nggallery' ),
+            'album' => __( 'Rebuild album structure : %s / %s albums', 'nggallery' ),
+		);
+
+?>
+<?php
+
+        foreach ( array_keys( $messages ) as $key ) {
+
+    		$message = sprintf( $messages[ $key ] ,
+    			"<span class='ngg-count-current'>0</span>",
+    			"<span class='ngg-count-total'>" . $total[ $key ] . "</span>"
+    		);
+
+    		echo "<div class='$key updated'><p class='ngg'>$message</p></div>";
+        }
+
+		$ajax_url = add_query_arg( 'action', 'ngg_rebuild_unique_slugs', admin_url( 'admin-ajax.php' ) );
+?>
+<script type="text/javascript">
+jQuery(document).ready(function($) {
+	var ajax_url = '<?php echo $ajax_url; ?>',
+		_action = 'images',
+		images = <?php echo $total['images']; ?>,
+		gallery = <?php echo $total['gallery']; ?>,
+        album = <?php echo $total['album']; ?>,
+        total = 0,
+        offset = 0,
+		count = 50;
+
+	var $display = $('.ngg-count-current');
+    $('.finished, .gallery, .album').hide();
+    total = images;
+
+	function call_again() {
+		if ( offset > total ) {
+		    offset = 0;
+            // 1st run finished
+            if (_action == 'images') {
+                _action = 'gallery';
+                total = gallery;
+                $('.images, .gallery').toggle();
+                $display.html(offset);
+                call_again();
+                return;
+            }
+            // 2nd run finished
+            if (_action == 'gallery') {
+                _action = 'album';
+                total = album;
+                $('.gallery, .album').toggle();
+                $display.html(offset);
+                call_again();
+                return;
+            }
+            // 3rd run finished, exit now
+            if (_action == 'album') {
+    			$('.ngg')
+    				.html('<?php _e( 'Done.', 'nggallery' ); ?>')
+    				.parent('div').hide();
+                $('.finished').show();
+    			return;
+            }
+		}
+
+		$.post(ajax_url, {'_action': _action, 'offset': offset}, function(response) {
+			$display.html(offset);
+
+			offset += count;
+			call_again();
+		});
+	}
+
+	call_again();
+});
+</script>
+<?php
+	}
+}
+
+class nggOptions {
+
+    /**
+     * PHP4 compatibility layer for calling the PHP5 constructor.
+     *
+     */
+    function nggOptions() {
+        return $this->__construct();
+    }
+
+    /**
+     * nggOptions::__construct()
+     *
+     * @return void
+     */
+    function __construct() {
+
+       	// same as $_SERVER['REQUEST_URI'], but should work under IIS 6.0
+	   $this->filepath    = admin_url() . 'admin.php?page=' . $_GET['page'];
+
+  		//Look for POST updates
+		if ( !empty($_POST) )
+			$this->processor();
+    }
+
+	/**
+	 * Save/Load options and add a new hook for plugins
+	 *
+	 * @return void
+	 */
+	function processor() {
+
+    	global $ngg, $nggRewrite;
+
+    	$old_state = $ngg->options['usePermalinks'];
+        $old_slug  = $ngg->options['permalinkSlug'];
+
+    	if ( isset($_POST['irDetect']) ) {
+    		check_admin_referer('ngg_settings');
+    		$ngg->options['irURL'] = ngg_search_imagerotator();
+    		update_option('ngg_options', $ngg->options);
+    	}
+
+    	if ( isset($_POST['updateoption']) ) {
+    		check_admin_referer('ngg_settings');
+    		// get the hidden option fields, taken from WP core
+    		if ( $_POST['page_options'] )
+    			$options = explode(',', stripslashes($_POST['page_options']));
+
+    		if ($options) {
+    			foreach ($options as $option) {
+    				$option = trim($option);
+    				$value = isset($_POST[$option]) ? trim($_POST[$option]) : false;
+    		//		$value = sanitize_option($option, $value); // This does stripslashes on those that need it
+    				$ngg->options[$option] = $value;
+    			}
+
+                // do not allow a empty string
+                if ( empty ( $ngg->options['permalinkSlug'] ) )
+                    $ngg->options['permalinkSlug'] = 'nggallery';
+
+        		// the path should always end with a slash
+        		$ngg->options['gallerypath']    = trailingslashit($ngg->options['gallerypath']);
+        		$ngg->options['imageMagickDir'] = trailingslashit($ngg->options['imageMagickDir']);
+
+        		// the custom sortorder must be ascending
+        		$ngg->options['galSortDir'] = ($ngg->options['galSort'] == 'sortorder') ? 'ASC' : $ngg->options['galSortDir'];
+    		}
+    		// Save options
+    		update_option('ngg_options', $ngg->options);
+
+    		// Flush Rewrite rules
+    		if ( $old_state != $ngg->options['usePermalinks'] || $old_slug != $ngg->options['permalinkSlug'] )
+    			$nggRewrite->flush();
+
+    	 	nggGallery::show_message(__('Update Successfully','nggallery'));
+    	}
+
+    	if ( isset($_POST['clearcache']) ) {
+    		check_admin_referer('ngg_settings');
+
+    		$path = WINABSPATH . $ngg->options['gallerypath'] . 'cache/';
+
+    		if (is_dir($path))
+    	    	if ($handle = opendir($path)) {
+    				while (false !== ($file = readdir($handle))) {
+    			    	if ($file != '.' && $file != '..') {
+    			          @unlink($path . '/' . $file);
+    	          		}
+    	        	}
+    	      		closedir($handle);
+    			}
+
+    		nggGallery::show_message(__('Cache cleared','nggallery'));
+    	}
+
+    	if ( isset($_POST['createslugs']) ) {
+    		check_admin_referer('ngg_settings');
+            ngg_rebuild_unique_slugs::start_rebuild();
+    	}
+
+        do_action( 'ngg_update_options_page' );
+
+    }
+
+    /**
+     * Render the page content
+     *
+     * @return void
+     */
+    function controller() {
+
+        // get list of tabs
+        $tabs = $this->tabs_order();
+
+	?>
+	<script type="text/javascript">
+		jQuery(document).ready(function(){
+		    jQuery('html,body').scrollTop(0);
+			jQuery("a.switch-expert").hide();
+            /*
+            jQuery(".expert").hide();
+			jQuery("a.switch-expert").click(function(e) {
+				jQuery(".expert").toggle();
+				return false;
+			});
+            */
+            jQuery('#slider').tabs({ fxFade: true, fxSpeed: 'fast' });
+			jQuery('#slider').css('display', 'block');
+            /*
+			jQuery('.picker').ColorPicker({
+				onSubmit: function(hsb, hex, rgb, el) {
+					jQuery(el).val(hex);
+					jQuery(el).ColorPickerHide();
+				},
+				onBeforeShow: function () {
+					jQuery(this).ColorPickerSetColor(this.value);
+				}
+			})
+			.bind('keyup', function(){
+				jQuery(this).ColorPickerSetColor(this.value);
+			});
+            */
+		});
+
+		function insertcode(value) {
+			var effectcode;
+			switch (value) {
+			  case "none":
+			    effectcode = "";
+			    jQuery('#tbImage').hide("slow");
+			    break;
+			  case "thickbox":
+			    effectcode = 'class="thickbox" rel="%GALLERY_NAME%"';
+			    jQuery('#tbImage').show("slow");
+			    break;
+			  case "lightbox":
+			    effectcode = 'rel="lightbox[%GALLERY_NAME%]"';
+			    jQuery('#tbImage').hide("slow");
+			    break;
+			  case "highslide":
+			    effectcode = 'class="highslide" onclick="return hs.expand(this, { slideshowGroup: %GALLERY_NAME% })"';
+			    jQuery('#tbImage').hide("slow");
+			    break;
+			  case "shutter":
+			    effectcode = 'class="shutterset_%GALLERY_NAME%"';
+			    jQuery('#tbImage').hide("slow");
+			    break;
+			  default:
+			    break;
+			}
+			jQuery("#thumbCode").val(effectcode);
+		};
+
+		function setcolor(fileid, color) {
+			jQuery(fileid).css("background-color", '#' + color );
+		};
+	</script>
+	<?php include('templates/social_media_buttons.php'); ?>
+	<div id="slider" class="wrap" style="display: none;">
+        <ul id="tabs">
+            <?php
+        	foreach($tabs as $tab_key => $tab_name) {
+        	   echo "\n\t\t<li><a href='#$tab_key'>$tab_name</a></li>";
+            }
+            ?>
+		</ul>
+        <?php
+        foreach($tabs as $tab_key => $tab_name) {
+            echo "\n\t<div id='$tab_key'>\n";
+            // Looks for the internal class function, otherwise enable a hook for plugins
+            if ( method_exists( $this, "tab_$tab_key" ))
+                call_user_func( array( &$this , "tab_$tab_key") );
+            else
+                do_action( 'ngg_tab_content_' . $tab_key );
+             echo "\n\t</div>";
+        }
+        ?>
+    </div>
+    <?php
+
+    }
+
+    /**
+     * Create array for tabs and add a filter for other plugins to inject more tabs
+     *
+     * @return array $tabs
+     */
+    function tabs_order() {
+
+    	$tabs = array();
+
+    	$tabs['generaloptions'] = __('General Options', 'nggallery');
+    	$tabs['thumbnails'] = __('Thumbnails', 'nggallery');
+    	$tabs['images'] = __('Images', 'nggallery');
+    	$tabs['gallery'] = _n( 'Gallery', 'Galleries', 1, 'nggallery' );
+    	$tabs['effects'] = __('Effects', 'nggallery');
+    	$tabs['watermark'] = __('Watermark', 'nggallery');
+    	$tabs['slideshow'] = __('Slideshow', 'nggallery');
+
+    	$tabs = apply_filters('ngg_settings_tabs', $tabs);
+
+    	return $tabs;
+
+    }
+
+    function tab_generaloptions() {
+        global $ngg;
+
+    ?>
+        <!-- General Options -->
+		<h2><?php _e('General Options','nggallery'); ?></h2>
+		<form name="generaloptions" method="post" action="<?php echo $this->filepath; ?>">
+		<?php wp_nonce_field('ngg_settings') ?>
+		<input type="hidden" name="page_options" value="gallerypath,deleteImg,useMediaRSS,usePicLens,usePermalinks,permalinkSlug,graphicLibrary,imageMagickDir,activateTags,appendType,maxImages" />
+			<table class="form-table ngg-options">
+				<tr valign="top">
+					<th align="left"><?php _e('Gallery path','nggallery'); ?></th>
+					<td><input <?php if (is_multisite()) echo 'readonly = "readonly"'; ?> type="text" size="35" name="gallerypath" value="<?php echo $ngg->options['gallerypath']; ?>" />
+					<span class="setting-description"><?php _e('This is the default path for all galleries','nggallery') ?></span></td>
+				</tr>
+				<tr class="expert" valign="top">
+					<th align="left"><?php _e('Delete image files','nggallery'); ?></th>
+					<td><input <?php if (is_multisite()) echo 'readonly = "readonly"'; ?> type="checkbox" name="deleteImg" value="1" <?php checked('1', $ngg->options['deleteImg']); ?> />
+					<?php _e('Delete files, when removing a gallery in the database','nggallery'); ?></td>
+				</tr>
+				<tr valign="top">
+					<th align="left"><?php _e('Activate permalinks','nggallery') ?></th>
+					<td><input type="checkbox" name="usePermalinks" value="1" <?php checked('1', $ngg->options['usePermalinks']); ?> />
+					<?php _e('When you activate this option, you need to update your permalink structure one time.','nggallery'); ?>
+                    <?php _e('Gallery slug name :','nggallery'); ?>
+                    <input type="text" size="15" name="permalinkSlug" value="<?php echo $ngg->options['permalinkSlug']; ?>" /></td>
+				</tr>
+				<tr class="expert">
+					<th valign="top"><?php _e('Create new URL friendly image slugs','nggallery'); ?></th>
+					<td><input type="submit" name="createslugs" class="button-secondary"  value="<?php _e('Proceed now','nggallery') ;?> &raquo;"/></td>
+				</tr>
+				<tr class="expert">
+					<th valign="top"><?php _e('Select graphic library','nggallery'); ?></th>
+					<td><label><input name="graphicLibrary" type="radio" value="gd" <?php checked('gd', $ngg->options['graphicLibrary']); ?> /> <?php _e('GD Library', 'nggallery') ;?></label><br />
+					<label><input name="graphicLibrary" type="radio" value="im" <?php checked('im', $ngg->options['graphicLibrary']); ?> /> <?php _e('ImageMagick (Experimental). Path to the library :', 'nggallery') ;?>&nbsp;
+					<input <?php if (is_multisite()) echo 'readonly = "readonly"'; ?> type="text" size="35" name="imageMagickDir" value="<?php echo $ngg->options['imageMagickDir']; ?>" /></label>
+					</td>
+				</tr>
+				<tr>
+					<th align="left"><?php _e('Activate Media RSS feed','nggallery'); ?></th>
+					<td><input type="checkbox" name="useMediaRSS" value="1" <?php checked('1', $ngg->options['useMediaRSS']); ?> />
+					<span class="setting-description"><?php _e('A RSS feed will be added to you blog header. Useful for CoolIris/PicLens','nggallery') ?></span></td>
+				</tr>
+				<tr>
+					<th align="left"><?php _e('Activate PicLens/CoolIris support','nggallery'); ?> (<a href="http://www.cooliris.com">CoolIris</a>)</th>
+					<td><input type="checkbox" name="usePicLens" value="1" <?php checked('1', $ngg->options['usePicLens']); ?> />
+					<span class="setting-description"><?php _e('When you activate this option, some javascript is added to your site footer. Make sure that wp_footer is called in your theme.','nggallery') ?></span></td>
+				</tr>
+			</table>
+			<h3 class="expert"><?php _e('Tags / Categories','nggallery'); ?></h3>
+			<table class="expert form-table ngg-options">
+				<tr>
+					<th valign="top"><?php _e('Activate related images','nggallery'); ?></th>
+					<td><input name="activateTags" type="checkbox" value="1" <?php checked('1', $ngg->options['activateTags']); ?> />
+					<?php _e('This option will append related images to every post','nggallery'); ?>
+					</td>
+				</tr>
+				<tr>
+					<th valign="top"><?php _e('Match with','nggallery'); ?></th>
+					<td><label><input name="appendType" type="radio" value="category" <?php checked('category', $ngg->options['appendType']); ?> /> <?php _e('Categories', 'nggallery') ;?></label><br />
+					<label><input name="appendType" type="radio" value="tags" <?php checked('tags', $ngg->options['appendType']); ?> /> <?php _e('Tags', 'nggallery') ;?></label>
+					</td>
+				</tr>
+				<tr>
+					<th valign="top"><?php _e('Max. number of images','nggallery'); ?></th>
+					<td><input type="text" name="maxImages" value="<?php echo $ngg->options['maxImages']; ?>" size="3" maxlength="3" />
+					<span class="setting-description"><?php _e('0 will show all images','nggallery'); ?></span>
+					</td>
+				</tr>
+			</table>
+		<div class="alignright"><a href="" class="switch-expert" >[<?php _e('More settings','nggallery'); ?>]</a></div>
+		<div class="submit"><input class="button-primary" type="submit" name="updateoption" value="<?php _e('Save Changes'); ?>"/></div>
+		</form>
+    <?php
+    }
+
+    function tab_thumbnails() {
+        global $ngg;
+    ?>
+	<!-- Thumbnail settings -->
+		<h2><?php _e('Thumbnail settings','nggallery'); ?></h2>
+		<form name="thumbnailsettings" method="POST" action="<?php echo $this->filepath.'#thumbnails'; ?>" >
+		<?php wp_nonce_field('ngg_settings') ?>
+		<input type="hidden" name="page_options" value="thumbwidth,thumbheight,thumbfix,thumbquality" />
+			<p><?php _e('Please note : If you change the settings, you need to recreate the thumbnails under -> Manage Gallery .', 'nggallery') ?></p>
+			<table class="form-table ngg-options">
+				<tr valign="top">
+					<th align="left"><?php _e('Width x height (in pixel)','nggallery'); ?></th>
+					<td>
+					<?php // TODO, use template here as well? I don't think this file is used anymore...
+								// include(dirname(__FILE__) . '/thumbnails-template.php'); 
+					?>
+					<input type="text" size="4" maxlength="4" name="thumbwidth" value="<?php echo $ngg->options['thumbwidth']; ?>" /> x <input type="text" size="4" maxlength="4" name="thumbheight" value="<?php echo $ngg->options['thumbheight']; ?>" />
+					<span class="setting-description"><?php _e('These values are maximum values ','nggallery'); ?></span>
+					</td>
+				</tr>
+				<tr valign="top">
+					<th align="left"><?php _e('Set fix dimension','nggallery'); ?></th>
+					<td><input type="checkbox" name="thumbfix" value="1" <?php checked('1', $ngg->options['thumbfix']); ?> />
+					<?php _e('Ignore the aspect ratio, no portrait thumbnails','nggallery') ?></td>
+				</tr>
+				<tr class="expert" valign="top">
+					<th align="left"><?php _e('Thumbnail quality','nggallery'); ?></th>
+					<td><input type="text" size="3" maxlength="3" name="thumbquality" value="<?php echo $ngg->options['thumbquality']; ?>" /> %</td>
+				</tr>
+			</table>
+		<div class="alignright"><a href="" class="switch-expert" >[<?php _e('More settings','nggallery'); ?>]</a></div>
+		<div class="submit"><input class="button-primary" type="submit" name="updateoption" value="<?php _e('Save Changes') ;?>"/></div>
+		</form>
+    <?php
+    }
+
+    function tab_images() {
+        global $ngg;
+    ?>
+		<!-- Image settings -->
+		<h2><?php _e('Image settings','nggallery'); ?></h2>
+		<form name="imagesettings" method="POST" action="<?php echo $this->filepath.'#images'; ?>" >
+		<?php wp_nonce_field('ngg_settings') ?>
+		<input type="hidden" name="page_options" value="imgResize,imgWidth,imgHeight,imgQuality,imgBackup,imgAutoResize" />
+			<table class="form-table ngg-options">
+				<tr valign="top">
+					<th valign="top"><label for="fixratio"><?php _e('Resize Images','nggallery') ?></label></th>
+					<td><input type="text" size="5" name="imgWidth" value="<?php echo $ngg->options['imgWidth']; ?>" /> x <input type="text" size="5" name="imgHeight" value="<?php echo $ngg->options['imgHeight']; ?>" />
+					<span class="setting-description"><?php _e('Width x height (in pixel). NextGEN Gallery will keep ratio size','nggallery') ?></span></td>
+				</tr>
+				<tr valign="top">
+					<th valign="top"><?php _e('Image quality','nggallery'); ?></th>
+					<td><input type="text" size="3" maxlength="3" name="imgQuality" value="<?php echo $ngg->options['imgQuality']; ?>" /> %</td>
+				</tr>
+				<tr>
+					<th valign="top"><?php _e('Backup original images','nggallery'); ?></th>
+					<td><input type="checkbox" name="imgBackup" value="1"<?php echo ($ngg->options['imgBackup'] == 1) ? ' checked ="chechked"' : ''; ?>/>
+					<span class="setting-description"><?php _e('Creates a backup for inserted images','nggallery'); ?></span></td>
+				</tr>
+				<tr>
+					<th valign="top"><?php _e('Automatically resize','nggallery'); ?></th>
+					<td><input type="checkbox" name="imgAutoResize" value="1"<?php echo ($ngg->options['imgAutoResize'] == 1) ? ' checked ="chechked"' : ''; ?>/>
+					<span class="setting-description"><?php _e('Automatically resize images on upload.','nggallery') ?></span></td>
+				</tr>
+			</table>
+			<h3 class="expert"><?php _e('Single picture','nggallery') ?></h3>
+			<table class="expert form-table ngg-options">
+				<tr>
+					<th valign="top"><?php _e('Clear cache folder','nggallery'); ?></th>
+					<td><input type="submit" name="clearcache" class="button-secondary"  value="<?php _e('Proceed now','nggallery') ;?> &raquo;"/></td>
+				</tr>
+			</table>
+		<div class="alignright"><a href="" class="switch-expert" >[<?php _e('More settings','nggallery'); ?>]</a></div>
+		<div class="submit"><input class="button-primary" type="submit" name="updateoption" value="<?php _e('Save Changes') ;?>"/></div>
+		</form>
+
+    <?php
+    }
+
+    function tab_gallery() {
+        global $ngg;
+    ?>
+		<!-- Gallery settings -->
+		<h2><?php _e('Gallery settings','nggallery'); ?></h2>
+		<form name="galleryform" method="POST" action="<?php echo $this->filepath.'#gallery'; ?>" >
+		<?php wp_nonce_field('ngg_settings') ?>
+		<input type="hidden" name="page_options" value="galNoPages,galImages,galColumns,galShowSlide,galTextSlide,galTextGallery,galShowOrder,galImgBrowser,galSort,galSortDir,galHiddenImg,galAjaxNav" />
+			<table class="form-table ngg-options">
+				<tr class="expert" >
+					<th valign="top"><?php _e('Deactivate gallery page link','nggallery') ?></th>
+					<td><input name="galNoPages" type="checkbox" value="1" <?php checked('1', $ngg->options['galNoPages']); ?> />
+					<?php _e('The album will not link to a gallery subpage. The gallery is shown on the same page.','nggallery') ?>
+					</td>
+				</tr>
+				<tr>
+					<th valign="top"><?php _e('Number of images per page','nggallery') ?></th>
+					<td><input type="text" name="galImages" value="<?php echo $ngg->options['galImages']; ?>" size="3" maxlength="3" />
+					<span class="setting-description"><?php _e('0 will disable pagination, all images on one page','nggallery') ?></span>
+					</td>
+				</tr>
+				<tr>
+					<th valign="top"><?php _e('Number of columns','nggallery'); ?></th>
+					<td><input type="text" name="galColumns" value="<?php echo $ngg->options['galColumns']; ?>" size="3" maxlength="3" />
+					<span class="setting-description"><?php _e('0 will display as much as possible based on the width of your theme. Setting normally only required for captions below the images','nggallery') ?></span>
+					</td>
+				</tr>
+				<tr>
+					<th valign="top"><?php _e('Integrate slideshow','nggallery'); ?></th>
+					<td><input name="galShowSlide" type="checkbox" value="1" <?php checked('1', $ngg->options['galShowSlide']); ?> />
+						<input type="text" name="galTextSlide" value="<?php echo $ngg->options['galTextSlide'] ?>" size="20" />
+						<input type="text" name="galTextGallery" value="<?php echo $ngg->options['galTextGallery'] ?>" size="20" />
+					</td>
+				</tr>
+				<tr class="expert" >
+					<th valign="top"><?php _e('Show first','nggallery'); ?></th>
+					<td><label><input name="galShowOrder" type="radio" value="gallery" <?php checked('gallery', $ngg->options['galShowOrder']); ?> /> <?php _e('Thumbnails', 'nggallery') ;?></label><br />
+					<label><input name="galShowOrder" type="radio" value="slide" <?php checked('slide', $ngg->options['galShowOrder']); ?> /> <?php _e('Slideshow', 'nggallery') ;?></label>
+					</td>
+				</tr>
+				<tr class="expert" >
+					<th valign="top"><?php _e('Show ImageBrowser','nggallery'); ?></th>
+					<td><input name="galImgBrowser" type="checkbox" value="1" <?php checked('1', $ngg->options['galImgBrowser']); ?> />
+					<?php _e('The gallery will open the ImageBrowser instead the effect.', 'nggallery'); ?>
+					</td>
+				</tr>
+				<tr class="expert" >
+					<th valign="top"><?php _e('Add hidden images','nggallery'); ?></th>
+					<td><input name="galHiddenImg" type="checkbox" value="1" <?php checked('1', $ngg->options['galHiddenImg']); ?> />
+					<?php _e('If pagination is used, this option will still show all images in the modal window (Thickbox, Lightbox etc.). Note : This increases the page load','nggallery'); ?>
+					</td>
+				</tr>
+				<tr class="expert" >
+					<th valign="top"><?php _e('Enable AJAX pagination','nggallery'); ?></th>
+					<td><input name="galAjaxNav" type="checkbox" value="1" <?php checked('1', $ngg->options['galAjaxNav']); ?> />
+					<?php _e('Browse images without reload the page. Note : Works only in combination with Shutter effect','nggallery'); ?>
+					</td>
+				</tr>
+			</table>
+			<h3 class="expert" ><?php _e('Sort options','nggallery') ?></h3>
+			<table class="expert form-table ngg-options">
+				<tr>
+					<th valign="top"><?php _e('Sort thumbnails','nggallery') ?></th>
+					<td>
+					<label><input name="galSort" type="radio" value="sortorder" <?php checked('sortorder', $ngg->options['galSort']); ?> /> <?php _e('Custom order', 'nggallery') ;?></label><br />
+					<label><input name="galSort" type="radio" value="pid" <?php checked('pid', $ngg->options['galSort']); ?> /> <?php _e('Image ID', 'nggallery') ;?></label><br />
+					<label><input name="galSort" type="radio" value="filename" <?php checked('filename', $ngg->options['galSort']); ?> /> <?php _e('File name', 'nggallery') ;?></label><br />
+					<label><input name="galSort" type="radio" value="alttext" <?php checked('alttext', $ngg->options['galSort']); ?> /> <?php _e('Alt / Title text', 'nggallery') ;?></label><br />
+					<label><input name="galSort" type="radio" value="imagedate" <?php checked('imagedate', $ngg->options['galSort']); ?> /> <?php _e('Date / Time', 'nggallery') ;?></label>
+					</td>
+				</tr>
+				<tr>
+					<th valign="top"><?php _e('Sort direction','nggallery') ?></th>
+					<td><label><input name="galSortDir" type="radio" value="ASC" <?php checked('ASC', $ngg->options['galSortDir']); ?> /> <?php _e('Ascending', 'nggallery') ;?></label><br />
+					<label><input name="galSortDir" type="radio" value="DESC" <?php checked('DESC', $ngg->options['galSortDir']); ?> /> <?php _e('Descending', 'nggallery') ;?></label>
+					</td>
+				</tr>
+			</table>
+		<div class="alignright"><a href="" class="switch-expert" >[<?php _e('More settings','nggallery'); ?>]</a></div>
+		<div class="submit"><input class="button-primary" type="submit" name="updateoption" value="<?php _e('Save Changes') ;?>"/></div>
+		</form>
+    <?php
+    }
+
+    function tab_effects() {
+        global $ngg;
+    ?>
+		<!-- Effects settings -->
+		<h2><?php _e('Effects','nggallery'); ?></h2>
+		<form name="effectsform" method="POST" action="<?php echo $this->filepath.'#effects'; ?>" >
+		<?php wp_nonce_field('ngg_settings') ?>
+		<input type="hidden" name="page_options" value="thumbEffect,thumbCode" />
+		<p><?php _e('Here you can select the thumbnail effect, NextGEN Gallery will integrate the required HTML code in the images. Please note that only the Shutter and Thickbox effect will automatic added to your theme.','nggallery'); ?>
+		<?php _e('With the placeholder','nggallery'); ?><strong> %GALLERY_NAME% </strong> <?php _e('you can activate a navigation through the images (depend on the effect). Change the code line only , when you use a different thumbnail effect or you know what you do.','nggallery'); ?></p>
+			<table class="form-table ngg-options">
+				<tr valign="top">
+					<th><?php _e('JavaScript Thumbnail effect','nggallery') ?></th>
+					<td>
+					<select size="1" id="thumbEffect" name="thumbEffect" onchange="insertcode(this.value)">
+						<option value="none" <?php selected('none', $ngg->options['thumbEffect']); ?> ><?php _e('None', 'nggallery') ;?></option>
+						<option value="thickbox" <?php selected('thickbox', $ngg->options['thumbEffect']); ?> ><?php _e('Thickbox', 'nggallery') ;?></option>
+						<option value="lightbox" <?php selected('lightbox', $ngg->options['thumbEffect']); ?> ><?php _e('Lightbox', 'nggallery') ;?></option>
+						<option value="highslide" <?php selected('highslide', $ngg->options['thumbEffect']); ?> ><?php _e('Highslide', 'nggallery') ;?></option>
+						<option value="shutter" <?php selected('shutter', $ngg->options['thumbEffect']); ?> ><?php _e('Shutter', 'nggallery') ;?></option>
+						<option value="custom" <?php selected('custom', $ngg->options['thumbEffect']); ?> ><?php _e('Custom', 'nggallery') ;?></option>
+					</select>
+					</td>
+				</tr>
+				<tr class="expert" valign="top">
+					<th><?php _e('Link Code line','nggallery') ?></th>
+					<td><textarea id="thumbCode" name="thumbCode" cols="50" rows="5"><?php echo htmlspecialchars(stripslashes($ngg->options['thumbCode'])); ?></textarea></td>
+				</tr>
+			</table>
+		<div class="alignright"><a href="" class="switch-expert" >[<?php _e('More settings','nggallery'); ?>]</a></div>
+		<div class="submit"><input class="button-primary" type="submit" name="updateoption" value="<?php _e('Save Changes') ;?>"/></div>
+		</form>
+
+    <?php
+    }
+
+    function tab_watermark() {
+
+        global $wpdb, $ngg;
+
+        // take the first image as sample
+        $imageID  = $wpdb->get_var("SELECT MIN(pid) FROM $wpdb->nggpictures");
+        $imageURL = ($imageID) ? $imageURL = '<img src="'. home_url('index.php') . '?callback=image&amp;pid=' . intval ($imageID) . '&amp;mode=watermark&amp;width=300&amp;height=250" />' : '';
+
+	?>
+	<!-- Watermark settings -->
+		<h2><?php _e('Watermark','nggallery'); ?></h2>
+		<p><?php _e('Please note : You can only activate the watermark under -> Manage Gallery . This action cannot be undone.', 'nggallery') ?></p>
+		<form name="watermarkform" method="POST" action="<?php echo $this->filepath.'#watermark'; ?>" >
+		<?php wp_nonce_field('ngg_settings') ?>
+		<input type="hidden" name="page_options" value="wmPos,wmXpos,wmYpos,wmType,wmPath,wmFont,wmSize,wmColor,wmText,wmOpaque" />
+		<div id="wm-preview">
+			<h3><?php _e('Preview','nggallery') ?></h3>
+			<p style="text-align:center;"><?php echo $imageURL; ?></p>
+			<h3><?php _e('Position','nggallery') ?></h3>
+			<div>
+			    <table id="wm-position">
+				<tr>
+					<td valign="top">
+						<strong><?php _e('Position','nggallery') ?></strong>
+						<table border="1">
+							<tr>
+								<td><input type="radio" name="wmPos" value="topLeft" <?php checked('topLeft', $ngg->options['wmPos']); ?> /></td>
+								<td><input type="radio" name="wmPos" value="topCenter" <?php checked('topCenter', $ngg->options['wmPos']); ?> /></td>
+								<td><input type="radio" name="wmPos" value="topRight" <?php checked('topRight', $ngg->options['wmPos']); ?> /></td>
+							</tr>
+							<tr>
+								<td><input type="radio" name="wmPos" value="midLeft" <?php checked('midLeft', $ngg->options['wmPos']); ?> /></td>
+								<td><input type="radio" name="wmPos" value="midCenter" <?php checked('midCenter', $ngg->options['wmPos']); ?> /></td>
+								<td><input type="radio" name="wmPos" value="midRight" <?php checked('midRight', $ngg->options['wmPos']); ?> /></td>
+							</tr>
+							<tr>
+								<td><input type="radio" name="wmPos" value="botLeft" <?php checked('botLeft', $ngg->options['wmPos']); ?> /></td>
+								<td><input type="radio" name="wmPos" value="botCenter" <?php checked('botCenter', $ngg->options['wmPos']); ?> /></td>
+								<td><input type="radio" name="wmPos" value="botRight" <?php checked('botRight', $ngg->options['wmPos']); ?> /></td>
+							</tr>
+						</table>
+					</td>
+					<td valign="top">
+						<strong><?php _e('Offset','nggallery') ?></strong>
+						<table border="0">
+							<tr>
+								<td>x</td>
+								<td><input type="text" name="wmXpos" value="<?php echo $ngg->options['wmXpos'] ?>" size="4" /> px</td>
+							</tr>
+							<tr>
+								<td>y</td>
+								<td><input type="text" name="wmYpos" value="<?php echo $ngg->options['wmYpos'] ?>" size="4" /> px</td>
+							</tr>
+						</table>
+					</td>
+				</tr>
+				</table>
+			</div>
+		</div>
+			<h3><label><input type="radio" name="wmType" value="image" <?php checked('image', $ngg->options['wmType']); ?> /> <?php _e('Use image as watermark','nggallery') ?></label></h3>
+			<table class="wm-table form-table">
+				<tr>
+					<th><?php _e('URL to file','nggallery') ?></th>
+					<td><input type="text" size="40" name="wmPath" value="<?php echo $ngg->options['wmPath']; ?>" /><br />
+					<?php if(!ini_get('allow_url_fopen')) _e('The accessing of URL files is disabled at your server (allow_url_fopen)','nggallery') ?> </td>
+				</tr>
+			</table>
+			<h3><label><input type="radio" name="wmType" value="text" <?php checked('text', $ngg->options['wmType']); ?> /> <?php _e('Use text as watermark','nggallery') ?></label></h3>
+			<table class="wm-table form-table">
+				<tr>
+					<th><?php _e('Font','nggallery') ?></th>
+					<td><select name="wmFont" size="1">	<?php
+							$fontlist = ngg_get_TTFfont();
+							foreach ( $fontlist as $fontfile ) {
+								echo "\n".'<option value="'.$fontfile.'" '.ngg_input_selected($fontfile, $ngg->options['wmFont']).' >'.$fontfile.'</option>';
+							}
+							?>
+						</select><br /><span class="setting-description">
+						<?php if ( !function_exists('ImageTTFBBox') )
+								_e('This function will not work, cause you need the FreeType library','nggallery');
+							  else
+							  	_e('You can upload more fonts in the folder <strong>nggallery/fonts</strong>','nggallery'); ?>
+                        </span>
+					</td>
+				</tr>
+				<tr>
+					<th><?php _e('Size','nggallery') ?></th>
+					<td><input type="text" name="wmSize" value="<?php echo $ngg->options['wmSize']; ?>" size="4" maxlength="2" /> px</td>
+				</tr>
+				<tr>
+					<th><?php _e('Color','nggallery') ?></th>
+					<td><input class="picker" type="text" size="6" maxlength="6" id="wmColor" name="wmColor" onchange="setcolor('#previewText', this.value)" value="<?php echo $ngg->options['wmColor'] ?>" />
+					<input type="text" size="1" readonly="readonly" id="previewText" style="background-color: #<?php echo $ngg->options['wmColor']; ?>" /> <?php _e('(hex w/o #)','nggallery') ?></td>
+				</tr>
+				<tr>
+					<th valign="top"><?php _e('Text','nggallery') ?></th>
+					<td><textarea name="wmText" cols="40" rows="4"><?php echo $ngg->options['wmText'] ?></textarea></td>
+				</tr>
+				<tr>
+					<th><?php _e('Opaque','nggallery') ?></th>
+					<td><input type="text" name="wmOpaque" value="<?php echo $ngg->options['wmOpaque'] ?>" size="3" maxlength="3" /> % </td>
+				</tr>
+			</table>
+		<div class="clear"> &nbsp; </div>
+		<div class="submit"><input class="button-primary" type="submit" name="updateoption" value="<?php _e('Save Changes') ;?>"/></div>
+		</form>
+    <?php
+    }
+
+    function tab_slideshow() {
+
+        global $ngg;
+    ?>
+    	<!-- Slideshow settings -->
+    	<form name="player_options" method="POST" action="<?php echo $this->filepath.'#slideshow'; ?>" >
+    	<?php wp_nonce_field('ngg_settings'); ?>
+    	<input type="hidden" name="page_options" value="slideFx,enableIR,irURL,irWidth,irHeight,irShuffle,irLinkfromdisplay,irShownavigation,irShowicons,irWatermark,irOverstretch,irRotatetime,irTransition,irKenburns,irBackcolor,irFrontcolor,irLightcolor,irScreencolor,irAudio,irXHTMLvalid" />
+    	<h2><?php _e('Slideshow','nggallery'); ?></h2>
+			<table class="form-table ngg-options">
+				<tr>
+					<th><?php _e('Default size (W x H)','nggallery') ?></th>
+					<td><input type="text" size="3" maxlength="4" name="irWidth" value="<?php echo $ngg->options['irWidth']; ?>" /> x
+					<input type="text" size="3" maxlength="4" name="irHeight" value="<?php echo $ngg->options['irHeight']; ?>" /></td>
+				</tr>
+				<tr>
+					<th><?php _e('Duration time','nggallery') ?></th>
+					<td><input type="text" size="3" maxlength="3" name="irRotatetime" value="<?php echo $ngg->options['irRotatetime'] ?>" /> <?php _e('sec.', 'nggallery') ;?></td>
+				</tr>
+				<tr>
+				    <th><?php _e('Transition / Fade effect','nggallery') ?></th>
+					<td>
+					<select size="1" name="slideFx">
+						<option value="fade" <?php selected('fade', $ngg->options['slideFx']); ?> ><?php _e('fade', 'nggallery') ;?></option>
+						<option value="blindX" <?php selected('blindX', $ngg->options['slideFx']); ?> ><?php _e('blindX', 'nggallery') ;?></option>
+						<option value="cover" <?php selected('cover', $ngg->options['slideFx']); ?> ><?php _e('cover', 'nggallery') ;?></option>
+						<option value="scrollUp" <?php selected('scrollUp', $ngg->options['slideFx']); ?> ><?php _e('scrollUp', 'nggallery') ;?></option>
+						<option value="scrollDown" <?php selected('scrollDown', $ngg->options['slideFx']); ?> ><?php _e('scrollDown', 'nggallery') ;?></option>
+						<option value="shuffle" <?php selected('shuffle', $ngg->options['slideFx']); ?> ><?php _e('shuffle', 'nggallery') ;?></option>
+						<option value="toss" <?php selected('toss', $ngg->options['slideFx']); ?> ><?php _e('toss', 'nggallery') ;?></option>
+						<option value="wipe" <?php selected('wipe', $ngg->options['slideFx']); ?> ><?php _e('wipe', 'nggallery') ;?></option>
+					</select>
+                    <span class="description"><?php _e('See here for more information about the effects :', 'nggallery') ?> <a href="http://jquery.malsup.com/cycle/browser.html" target="_blank" >jQuery Cycle</a></span>
+                    </td>
+				</tr>
+ 			    </table>
+    			<h3 class="expert" ><?php _e('Settings for the JW Image Rotator','nggallery') ?></h3>
+				<p>
+					NextGEN Galery flash slideshows use the JW Image Rotator Version 3.17 by <a target='_blank' href='http://www.longtailvideo.com/players/jw-image-rotator/'>Long Tail Video</a>.
+					This file is bundled with NextGEN Gallery 1.9.9 and above. Press the button below to search for it automatically. For earlier versions of NextGEN Gallery, you'll need to
+					upload the file manually to the <a href='http://codex.wordpress.org/Uploading_Files' target='_blank'>WordPress Uploads directory</a>.
+				</p>
+            	<?php if (empty($ngg->options['irURL']) && ($ngg->options['enableIR'] == '1')) { ?>
+        			<div id="message" class="error inline">
+        			<p>
+        				<?php _e('The path to JW Image Rotator is not defined, the slideshow will not work.','nggallery'); ?><br />
+        				Press the button below to search for the file.
+        			</p>
+        			</div>
+            	<?php }?>
+    			<table class="expert form-table ngg-options">
+				<tr>
+					<th><?php _e('Enable flash slideshow','nggallery') ?></th>
+					<td><input name="enableIR" type="checkbox" value="1" <?php checked('1', $ngg->options['enableIR']); ?> />
+                    <span class="setting-description"><?php _e('Integrate the flash based slideshow for all flash supported devices','nggallery') ?></span></td>
+				</tr>
+				<tr>
+					<th><?php _e('Path to the JW Image Rotator (URL)','nggallery') ?></th>
+					<td>
+						<input type="text" size="50" id="irURL" name="irURL" value="<?php echo $ngg->options['irURL']; ?>" />
+						<input type="submit" name="irDetect" class="button-secondary"  value="<?php _e('Search now','nggallery') ;?> &raquo;"/>
+						<br /><span class="setting-description"><?php _e('Press the button below to search for the JW Image Rotator','nggallery') ?></span>
+					</td>
+				</tr>
+				<tr>
+					<th><?php _e('Shuffle mode','nggallery') ?></th>
+					<td><input name="irShuffle" type="checkbox" value="1" <?php checked('1', $ngg->options['irShuffle']); ?> /></td>
+				</tr>
+				<tr class="expert">
+					<th><?php _e('Show next image on click','nggallery') ?></th>
+					<td><input name="irLinkfromdisplay" type="checkbox" value="1" <?php checked('1', $ngg->options['irLinkfromdisplay']); ?> /></td>
+				</tr>
+				<tr class="expert">
+					<th><?php _e('Show navigation bar','nggallery') ?></th>
+					<td><input name="irShownavigation" type="checkbox" value="1" <?php checked('1', $ngg->options['irShownavigation']); ?> /></td>
+				</tr>
+				<tr class="expert">
+					<th><?php _e('Show loading icon','nggallery') ?></th>
+					<td><input name="irShowicons" type="checkbox" value="1" <?php checked('1', $ngg->options['irShowicons']); ?> /></td>
+				</tr>
+				<tr class="expert">
+					<th><?php _e('Use watermark logo','nggallery') ?></th>
+					<td><input name="irWatermark" type="checkbox" value="1" <?php checked('1', $ngg->options['irWatermark']); ?> />
+					<span class="setting-description"><?php _e('You can change the logo at the watermark settings','nggallery') ?></span></td>
+				</tr>
+				<tr class="expert">
+					<th><?php _e('Stretch image','nggallery') ?></th>
+					<td>
+					<select size="1" name="irOverstretch">
+						<option value="true" <?php selected('true', $ngg->options['irOverstretch']); ?> ><?php _e('true', 'nggallery') ;?></option>
+						<option value="false" <?php selected('false', $ngg->options['irOverstretch']); ?> ><?php _e('false', 'nggallery') ;?></option>
+						<option value="fit" <?php selected('fit', $ngg->options['irOverstretch']); ?> ><?php _e('fit', 'nggallery') ;?></option>
+						<option value="none" <?php selected('none', $ngg->options['irOverstretch']); ?> ><?php _e('none', 'nggallery') ;?></option>
+					</select>
+					</td>
+				</tr>
+				<tr>
+					<th><?php _e('Transition / Fade effect','nggallery') ?></th>
+					<td>
+					<select size="1" name="irTransition">
+						<option value="fade" <?php selected('fade', $ngg->options['irTransition']); ?> ><?php _e('fade', 'nggallery') ;?></option>
+						<option value="bgfade" <?php selected('bgfade', $ngg->options['irTransition']); ?> ><?php _e('bgfade', 'nggallery') ;?></option>
+						<option value="slowfade" <?php selected('slowfade', $ngg->options['irTransition']); ?> ><?php _e('slowfade', 'nggallery') ;?></option>
+						<option value="circles" <?php selected('circles', $ngg->options['irTransition']); ?> ><?php _e('circles', 'nggallery') ;?></option>
+						<option value="bubbles" <?php selected('bubbles', $ngg->options['irTransition']); ?> ><?php _e('bubbles', 'nggallery') ;?></option>
+						<option value="blocks" <?php selected('blocks', $ngg->options['irTransition']); ?> ><?php _e('blocks', 'nggallery') ;?></option>
+						<option value="fluids" <?php selected('fluids', $ngg->options['irTransition']); ?> ><?php _e('fluids', 'nggallery') ;?></option>
+						<option value="flash" <?php selected('flash', $ngg->options['irTransition']); ?> ><?php _e('flash', 'nggallery') ;?></option>
+						<option value="lines" <?php selected('lines', $ngg->options['irTransition']); ?> ><?php _e('lines', 'nggallery') ;?></option>
+						<option value="random" <?php selected('random', $ngg->options['irTransition']); ?> ><?php _e('random', 'nggallery') ;?></option>
+					</select>
+                    </td>
+				</tr>
+				<tr class="expert">
+					<th><?php _e('Use slow zooming effect','nggallery') ?></th>
+					<td><input name="irKenburns" type="checkbox" value="1" <?php checked('1', $ngg->options['irKenburns']); ?> /></td>
+				</tr>
+				<tr>
+					<th><?php _e('Background Color','nggallery') ?></th>
+					<td><input class="picker" type="text" size="6" maxlength="6" id="irBackcolor" name="irBackcolor" onchange="setcolor('#previewBack', this.value)" value="<?php echo $ngg->options['irBackcolor'] ?>" />
+					<input type="text" size="1" readonly="readonly" id="previewBack" style="background-color: #<?php echo $ngg->options['irBackcolor'] ?>" /></td>
+				</tr>
+				<tr>
+					<th><?php _e('Texts / Buttons Color','nggallery') ?></th>
+					<td><input class="picker" type="text" size="6" maxlength="6" id="irFrontcolor" name="irFrontcolor" onchange="setcolor('#previewFront', this.value)" value="<?php echo $ngg->options['irFrontcolor'] ?>" />
+					<input type="text" size="1" readonly="readonly" id="previewFront" style="background-color: #<?php echo $ngg->options['irFrontcolor'] ?>" /></td>
+				</tr>
+				<tr class="expert">
+					<th><?php _e('Rollover / Active Color','nggallery') ?></th>
+					<td><input class="picker" type="text" size="6" maxlength="6" id="irLightcolor" name="irLightcolor" onchange="setcolor('#previewLight', this.value)" value="<?php echo $ngg->options['irLightcolor'] ?>" />
+					<input type="text" size="1" readonly="readonly" id="previewLight" style="background-color: #<?php echo $ngg->options['irLightcolor'] ?>" /></td>
+				</tr>
+				<tr class="expert">
+					<th><?php _e('Screen Color','nggallery') ?></th>
+					<td><input class="picker" type="text" size="6" maxlength="6" id="irScreencolor" name="irScreencolor" onchange="setcolor('#previewScreen', this.value)" value="<?php echo $ngg->options['irScreencolor'] ?>" />
+					<input type="text" size="1" readonly="readonly" id="previewScreen" style="background-color: #<?php echo $ngg->options['irScreencolor'] ?>" /></td>
+				</tr>
+				<tr class="expert">
+					<th><?php _e('Background music (URL)','nggallery') ?></th>
+					<td><input type="text" size="50" id="irAudio" name="irAudio" value="<?php echo $ngg->options['irAudio'] ?>" /></td>
+				</tr>
+				<tr class="expert">
+					<th ><?php _e('Try XHTML validation (with CDATA)','nggallery') ?></th>
+					<td><input name="irXHTMLvalid" type="checkbox" value="1" <?php checked('1', $ngg->options['irXHTMLvalid']); ?> />
+					<span class="setting-description"><?php _e('Important : Could causes problem at some browser. Please recheck your page.','nggallery') ?></span></td>
+				</tr>
+				</table>
+			<div class="alignright"><a href="" class="switch-expert" >[<?php _e('More settings','nggallery'); ?>]</a></div>
+			<div class="submit"><input class="button-primary" type="submit" name="updateoption" value="<?php _e('Save Changes') ;?>"/></div>
+	</form>
+    <?php
+    }
+}
+
+function ngg_get_TTFfont() {
+
+	$ttf_fonts = array ();
+
+	// Files in wp-content/plugins/nggallery/fonts directory
+	$plugin_root = NGGALLERY_ABSPATH . 'fonts';
+
+	$plugins_dir = @ dir($plugin_root);
+	if ($plugins_dir) {
+		while (($file = $plugins_dir->read()) !== false) {
+			if (preg_match('|^\.+$|', $file))
+				continue;
+			if (is_dir($plugin_root.'/'.$file)) {
+				$plugins_subdir = @ dir($plugin_root.'/'.$file);
+				if ($plugins_subdir) {
+					while (($subfile = $plugins_subdir->read()) !== false) {
+						if (preg_match('|^\.+$|', $subfile))
+							continue;
+						if (preg_match('|\.ttf$|', $subfile))
+							$ttf_fonts[] = "$file/$subfile";
+					}
+				}
+			} else {
+				if (preg_match('|\.ttf$|', $file))
+					$ttf_fonts[] = $file;
+			}
+		}
+	}
+
+	return $ttf_fonts;
+}
+
+function ngg_search_imagerotator() {
+	global $wpdb;
+
+	$upload = wp_upload_dir();
+
+	// look first at the old place and move it to wp-content/uploads
+	if ( file_exists( NGGALLERY_ABSPATH . 'imagerotator.swf' ) )
+		@rename(NGGALLERY_ABSPATH . 'imagerotator.swf', $upload['basedir'] . '/imagerotator.swf');
+
+	// This should be the new place
+	if ( file_exists( $upload['basedir'] . '/imagerotator.swf' ) )
+		return $upload['baseurl'] . '/imagerotator.swf';
+
+	// Find the path to the imagerotator via the media library
+	if ( $path = $wpdb->get_var( "SELECT guid FROM {$wpdb->posts} WHERE guid LIKE '%imagerotator.swf%'" ) )
+		return $path;
+
+	// maybe it's located at wp-content
+	if ( file_exists( WP_CONTENT_DIR . '/imagerotator.swf' ) )
+		return WP_CONTENT_URL . '/imagerotator.swf';
+
+	// or in the plugin folder
+	if ( file_exists( WP_PLUGIN_DIR . '/imagerotator.swf' ) )
+		return WP_PLUGIN_URL . '/imagerotator.swf';
+
+	// this is deprecated and will be ereased during a automatic upgrade
+	if ( file_exists( NGGALLERY_ABSPATH . 'imagerotator.swf' ) )
+		return NGGALLERY_URLPATH . 'imagerotator.swf';
+
+	return '';
+}
+
+/**********************************************************/
+// taken from WP Core
+
+function ngg_input_selected( $selected, $current) {
+	if ( $selected == $current)
+		return ' selected="selected"';
+}
+
+function ngg_input_checked( $checked, $current) {
+	if ( $checked == $current)
+		return ' checked="checked"';
+}
+?>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/setup.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/setup.php
new file mode 100644
index 0000000000000000000000000000000000000000..0f078cd85a7fdc9fcc5380efaf2e6e5f238cc78f
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/setup.php
@@ -0,0 +1,58 @@
+<?php  
+if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
+
+	function nggallery_admin_setup()  {	
+		global $wpdb, $ngg;
+				
+		if (isset($_POST['resetdefault'])) {	
+			check_admin_referer('ngg_uninstall');
+						
+			include_once ( dirname (__FILE__).  '/install.php');
+			
+			ngg_default_options();
+			$ngg->load_options();
+			
+			nggGallery::show_message(__('Reset all settings to default parameter','nggallery'));
+		}
+
+		if (isset($_POST['uninstall'])) {	
+			
+			check_admin_referer('ngg_uninstall');
+			
+			include_once ( dirname (__FILE__).  '/install.php');
+
+			nggallery_uninstall();
+				 	
+		 	nggGallery::show_message(__('Uninstall sucessful ! Now delete the plugin and enjoy your life ! Good luck !','nggallery'));
+		}
+	?>
+	<div class="wrap">
+	<h2><?php _e('Reset options', 'nggallery') ;?></h2>
+		<form name="resetsettings" method="post">
+			<?php wp_nonce_field('ngg_uninstall') ?>
+			<p><?php _e('Reset all options/settings to the default installation.', 'nggallery') ;?></p>
+			<div align="center"><input type="submit" class="button" name="resetdefault" value="<?php _e('Reset settings', 'nggallery') ;?>" onclick="javascript:check=confirm('<?php _e('Reset all options to default settings ?\n\nChoose [Cancel] to Stop, [OK] to proceed.\n','nggallery'); ?>');if(check==false) return false;" /></div>
+		</form>
+	</div>
+	<?php if ( !is_multisite() || wpmu_site_admin() ) : ?>
+	<div class="wrap">
+	<h2><?php _e('Uninstall plugin tables', 'nggallery') ;?></h2>
+		
+		<form name="resetsettings" method="post">
+		<div>
+			<?php wp_nonce_field('ngg_uninstall') ?>
+			<p><?php _e('You don\'t like NextGEN Gallery ?', 'nggallery') ;?></p>
+			<p><?php _e('No problem, before you deactivate this plugin press the Uninstall Button, because deactivating NextGEN Gallery does not remove any data that may have been created. ', 'nggallery') ;?>
+		</div>
+		<p><font color="red"><strong><?php _e('WARNING:', 'nggallery') ;?></strong><br />
+		<?php _e('Once uninstalled, this cannot be undone. You should use a Database Backup plugin of WordPress to backup all the tables first. NextGEN gallery is stored in the tables', 'nggallery') ;?> <strong><?php echo $wpdb->nggpictures; ?></strong>, <strong><?php echo $wpdb->nggalbum; ?></strong> <?php _e('and', 'nggallery') ;?> <strong><?php echo $wpdb->nggalbum; ?></strong>.</font></p>
+		<div align="center">
+			<input type="submit" name="uninstall" class="button delete" value="<?php _e('Uninstall plugin', 'nggallery') ?>" onclick="javascript:check=confirm('<?php _e('You are about to Uninstall this plugin from WordPress.\nThis action is not reversible.\n\nChoose [Cancel] to Stop, [OK] to Uninstall.\n','nggallery'); ?>');if(check==false) return false;"/>
+		</div>
+		</form>
+	</div>
+	<?php endif; ?>
+
+	<?php
+}
+?>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php
new file mode 100644
index 0000000000000000000000000000000000000000..5ef1f24b2fa812cbca372630133776881a78985c
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php
@@ -0,0 +1,124 @@
+<?php
+
+// look up for the path
+require_once( dirname( dirname(__FILE__) ) . '/ngg-config.php');
+
+require_once(NGGALLERY_ABSPATH . '/lib/meta.php');
+require_once(NGGALLERY_ABSPATH . '/lib/image.php');
+
+if ( !is_user_logged_in() )
+	die(__('Cheatin&#8217; uh?'));
+	
+if ( !current_user_can('NextGEN Manage gallery') ) 
+	die(__('Cheatin&#8217; uh?'));
+
+global $wpdb;
+
+$id = (int) $_GET['id'];
+// let's get the meta data'
+$meta = new nggMeta($id);
+$dbdata = $meta->get_saved_meta();
+$exifdata = $meta->get_EXIF();
+$iptcdata = $meta->get_IPTC();
+$xmpdata = $meta->get_XMP();
+$class = '';
+
+?>
+	<!-- META DATA -->
+	<fieldset class="options nggallery">
+	<h3><?php _e('Meta Data','nggallery'); ?></h3>
+	<?php if ($dbdata) { ?>
+		<table id="the-list-x" width="100%" cellspacing="3" cellpadding="3">
+			<thead>
+				<tr>
+					<th scope="col"><?php _e('Tag','nggallery'); ?></th>
+					<th scope="col"><?php _e('Value','nggallery'); ?></th>
+				</tr>
+			</thead>
+	<?php 
+			foreach ($dbdata as $key => $value){
+				if ( is_array($value) ) continue;
+				$class = ( $class == 'class="alternate"' ) ? '' : 'class="alternate"';
+				echo '<tr '.$class.'>	
+						<td style="width:230px">'. esc_html( $meta->i8n_name($key) ).'</td>
+						<td>' . esc_html( $value ) . '</td>
+					</tr>';
+			}
+	?>
+		</table>
+	<?php  } else echo "<strong>" . __('No meta data saved','nggallery') . "</strong>"; ?>
+	</fieldset>
+	
+	<!-- EXIF DATA -->
+	<?php if ($exifdata) { ?>
+	<fieldset class="options nggallery">
+	<h3><?php _e('EXIF Data','nggallery'); ?></h3>
+	<?php if ($exifdata) { ?>
+		<table id="the-list-x" width="100%" cellspacing="3" cellpadding="3">
+			<thead>
+				<tr>
+					<th scope="col"><?php _e('Tag','nggallery'); ?></th>
+					<th scope="col"><?php _e('Value','nggallery'); ?></th>
+				</tr>
+			</thead>
+	<?php 
+			foreach ($exifdata as $key => $value){
+				$class = ( $class == 'class="alternate"' ) ? '' : 'class="alternate"';
+				echo '<tr '.$class.'>	
+						<td style="width:230px">' . esc_html ( $meta->i8n_name($key) ) . '</td>
+						<td>' . esc_html( $value ) .'</td>
+					</tr>';
+			}
+	?>
+		</table>
+	<?php  } else echo "<strong>". __('No exif data','nggallery'). "</strong>"; ?>
+	</fieldset>
+	<?php  } ?>
+	
+	<!-- IPTC DATA -->
+	<?php if ($iptcdata) { ?>
+	<fieldset class="options nggallery">
+	<h3><?php _e('IPTC Data','nggallery'); ?></h3>
+		<table id="the-list-x" width="100%" cellspacing="3" cellpadding="3">
+			<thead>
+				<tr>
+					<th scope="col"><?php _e('Tag','nggallery'); ?></th>
+					<th scope="col"><?php _e('Value','nggallery'); ?></th>
+				</tr>
+			</thead>
+	<?php 
+			foreach ($iptcdata as $key => $value){
+				$class = ( $class == 'class="alternate"' ) ? '' : 'class="alternate"';
+				echo '<tr '.$class.'>	
+						<td style="width:230px">' . esc_html( $meta->i8n_name($key) ) . '</td>
+						<td>' . esc_html( $value ) . '</td>
+					</tr>';
+			}
+	?>
+		</table>
+	</fieldset>
+	<?php  } ?>
+
+	<!-- XMP DATA -->
+	<?php if ($xmpdata) { ?>
+	<fieldset class="options nggallery">
+	<h3><?php _e('XMP Data','nggallery'); ?></h3>
+		<table id="the-list-x" width="100%" cellspacing="3" cellpadding="3">
+			<thead>
+				<tr>
+					<th scope="col"><?php _e('Tag','nggallery'); ?></th>
+					<th scope="col"><?php _e('Value','nggallery'); ?></th>
+				</tr>
+			</thead>
+	<?php 
+			foreach ($xmpdata as $key => $value){
+				$class = ( $class == 'class="alternate"' ) ? '' : 'class="alternate"';
+				echo '<tr '.$class.'>	
+						<td style="width:230px">' . esc_html( $meta->i8n_name($key) ) . '</td>
+						<td>' . esc_html( $value ) . '</td>
+					</tr>';
+			}
+	?>
+		</table>
+	</fieldset>
+	<?php  } ?>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/style.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/style.php
new file mode 100644
index 0000000000000000000000000000000000000000..c9e4b3c97a1c6ea12fb9386b715c352f746d313e
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/style.php
@@ -0,0 +1,250 @@
+<?php
+if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
+
+function nggallery_admin_style()  {
+
+global $ngg;
+
+if ( $theme_css_exists = file_exists (TEMPLATEPATH . "/nggallery.css") ) {
+
+	$real_file = TEMPLATEPATH . "/nggallery.css";
+	$file_show = 'nggallery.css ' . __('(From the theme folder)','nggallery');
+
+} else {
+
+	if (isset($_POST['css'])) {
+		check_admin_referer('ngg_style');
+		$act_cssfile = $_POST['css'];
+
+		if ( isset( $_POST['activate'] ) ) {
+			// save option now
+			$ngg->options['activateCSS'] = $_POST['activateCSS'];
+			$ngg->options['CSSfile'] = $act_cssfile;
+			update_option('ngg_options', $ngg->options);
+			nggGallery::show_message(__('Update Successfully','nggallery'));
+		}
+	} else {
+		// get the options
+		if (isset($_POST['file']))
+			$act_cssfile = $_POST['file'];
+		else
+			$act_cssfile = $ngg->options['CSSfile'];
+	}
+
+	// set the path
+	$real_file = NGGALLERY_ABSPATH . "css/" . $act_cssfile;
+}
+
+if (isset($_POST['updatecss'])) {
+
+	check_admin_referer('ngg_style');
+
+	if ( !current_user_can('edit_themes') )
+	wp_die('<p>'.__('You do not have sufficient permissions to edit templates for this blog.').'</p>');
+
+	$newcontent = stripslashes($_POST['newcontent']);
+
+	if (is_writeable($real_file)) {
+		$f = fopen($real_file, 'w+');
+		fwrite($f, $newcontent);
+
+		fclose($f);
+		nggGallery::show_message(__('CSS file successfully updated','nggallery'));
+	}
+}
+
+// get the content of the file
+//TODO: BUG : Read failed after write a file, maybe a Cache problem
+$error = ( !is_file($real_file) );
+
+if (!$error && filesize($real_file) > 0) {
+	$f = fopen($real_file, 'r');
+	$content = fread($f, filesize($real_file));
+	$content = htmlspecialchars($content);
+}
+
+?>
+<script type="text/javascript">
+	jQuery(document).ready(function(){
+		jQuery('#colorSelector').ColorPicker({
+			color: '#0000ff',
+			onShow: function (colpkr) {
+				jQuery(colpkr).fadeIn(500);
+				return false;
+			},
+			onHide: function (colpkr) {
+				jQuery(colpkr).fadeOut(500);
+				return false;
+			},
+			onChange: function (hsb, hex, rgb) {
+				jQuery('#colorSelector div').css('backgroundColor', '#' + hex);
+			}
+		});
+	});
+</script>
+<div class="wrap">
+
+	<div class="bordertitle">
+		<?php if (!$theme_css_exists) : ?>
+		<form id="themeselector" name="cssfiles" method="post">
+		<?php wp_nonce_field('ngg_style') ?>
+		<strong><?php _e('Activate and use style sheet:','nggallery') ?></strong>
+		<input type="checkbox" name="activateCSS" value="1" <?php checked('1', $ngg->options['activateCSS']); ?> />
+			<select name="css" id="theme" style="margin: 0pt; padding: 0pt;" onchange="this.form.submit();">
+			<?php
+				$csslist = ngg_get_cssfiles();
+				foreach ($csslist as $key =>$a_cssfile) {
+					$css_name = $a_cssfile['Name'];
+					if ($key == $act_cssfile) {
+						$file_show = $key;
+						$selected = " selected='selected'";
+						$act_css_description = $a_cssfile['Description'];
+						$act_css_author = $a_cssfile['Author'];
+						$act_css_version = $a_cssfile['Version'];
+					}
+					else $selected = '';
+					$css_name = esc_attr($css_name);
+					echo "\n\t<option value=\"$key\" $selected>$css_name</option>";
+				}
+			?>
+			</select>
+			<input class="button" type="submit" name="activate" value="<?php _e('Activate','nggallery') ?> &raquo;" class="button" />
+		</form>
+		<?php endif; ?>
+	</div>
+	<br style="clear: both;"/>
+
+<?php if (!is_multisite() || wpmu_site_admin() ) { ?>
+	<div class="tablenav">
+	  <?php
+		if ( is_writeable($real_file) ) {
+			echo '<big>' . sprintf(__('Editing <strong>%s</strong>','nggallery'), $file_show) . '</big>';
+		} else {
+			echo '<big>' . sprintf(__('Browsing <strong>%s</strong>','nggallery'), $file_show) . '</big>';
+		}
+		?>
+	</div>
+	<br style="clear: both;"/>
+
+	<div id="templateside">
+	<?php if (!$theme_css_exists) : ?>
+		<ul>
+			<li><strong><?php _e('Author','nggallery') ?> :</strong> <?php echo $act_css_author ?></li>
+			<li><strong><?php _e('Version','nggallery') ?> :</strong> <?php echo $act_css_version ?></li>
+			<li><strong><?php _e('Description','nggallery') ?> :<br /></strong> <?php echo $act_css_description ?></li>
+		</ul>
+		<p><?php _e('Tip : Copy your stylesheet (nggallery.css) to your theme folder, so it will be not lost during a upgrade','nggallery') ?></p>
+	<?php else: ?>
+		<p><?php _e('Your theme contain a NextGEN Gallery stylesheet (nggallery.css), this file will be used','nggallery') ?></p>
+	<?php endif; ?>
+    	<p><?php _e('Tip No. 2: Use the color picker below to help you find the right color scheme for your gallery!','nggallery') ?></p>
+    	<div id="colorSelector">
+        	<div></div>
+        </div>
+	</div>
+		<?php
+		if (!$error) {
+		?>
+		<form name="template" id="template" method="post">
+			 <?php wp_nonce_field('ngg_style') ?>
+			 <div><textarea cols="70" rows="25" name="newcontent" id="newcontent" tabindex="1"  class="codepress css"><?php echo $content ?></textarea>
+			 <input type="hidden" name="updatecss" value="updatecss" />
+			 <input type="hidden" name="file" value="<?php echo $file_show ?>" />
+			 </div>
+	<?php if ( is_writeable($real_file) ) : ?>
+		<p class="submit">
+			<input class="button-primary action" type="submit" name="submit" value="<?php _e('Update File','nggallery') ?>" tabindex="2" />
+		</p>
+	<?php else : ?>
+	<p><em><?php _e('If this file were writable you could edit it.','nggallery'); ?></em></p>
+	<?php endif; ?>
+		</form>
+		<?php
+		} else {
+			echo '<div class="error"><p>' . __('Oops, no such file exists! Double check the name and try again, merci.','nggallery') . '</p></div>';
+		}
+		?>
+	<div class="clear"> &nbsp; </div>
+</div> <!-- wrap-->
+
+<?php
+	}
+
+} // END nggallery_admin_style()
+
+/**********************************************************/
+// ### Code from wordpress plugin import
+// read in the css files
+function ngg_get_cssfiles() {
+	global $cssfiles;
+
+	if (isset ($cssfiles)) {
+		return $cssfiles;
+	}
+
+	$cssfiles = array ();
+
+	// Files in wp-content/plugins/nggallery/css directory
+	$plugin_root = NGGALLERY_ABSPATH . "css";
+
+	$plugins_dir = @ dir($plugin_root);
+	if ($plugins_dir) {
+		while (($file = $plugins_dir->read()) !== false) {
+			if (preg_match('|^\.+$|', $file))
+				continue;
+			if (is_dir($plugin_root.'/'.$file)) {
+				$plugins_subdir = @ dir($plugin_root.'/'.$file);
+				if ($plugins_subdir) {
+					while (($subfile = $plugins_subdir->read()) !== false) {
+						if (preg_match('|^\.+$|', $subfile))
+							continue;
+						if (preg_match('|\.css$|', $subfile))
+							$plugin_files[] = "$file/$subfile";
+					}
+				}
+			} else {
+				if (preg_match('|\.css$|', $file))
+					$plugin_files[] = $file;
+			}
+		}
+	}
+
+	if ( !$plugins_dir || !$plugin_files )
+		return $cssfiles;
+
+	foreach ( $plugin_files as $plugin_file ) {
+		if ( !is_readable("$plugin_root/$plugin_file"))
+			continue;
+
+		$plugin_data = ngg_get_cssfiles_data("$plugin_root/$plugin_file");
+
+		if ( empty ($plugin_data['Name']) )
+			continue;
+
+		$cssfiles[plugin_basename($plugin_file)] = $plugin_data;
+	}
+
+	uasort($cssfiles, create_function('$a, $b', 'return strnatcasecmp($a["Name"], $b["Name"]);'));
+
+	return $cssfiles;
+}
+
+// parse the Header information
+function ngg_get_cssfiles_data($plugin_file) {
+	$plugin_data = implode('', file($plugin_file));
+	preg_match("|CSS Name:(.*)|i", $plugin_data, $plugin_name);
+	preg_match("|Description:(.*)|i", $plugin_data, $description);
+	preg_match("|Author:(.*)|i", $plugin_data, $author_name);
+	if (preg_match("|Version:(.*)|i", $plugin_data, $version))
+		$version = trim($version[1]);
+	else
+		$version = '';
+
+	$description = wptexturize(trim($description[1]));
+
+	$name = trim($plugin_name[1]);
+	$author = trim($author_name[1]);
+
+	return array ('Name' => $name, 'Description' => $description, 'Author' => $author, 'Version' => $version );
+}
+?>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/tags.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/tags.php
new file mode 100644
index 0000000000000000000000000000000000000000..30d74e396920c1fa92fb7879407b8e905fe72390
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/tags.php
@@ -0,0 +1,292 @@
+<?php
+/**
+* Tag management page. Inspired from the Simple Tags plugin by Amaury Balmer.
+* http://code.google.com/p/simple-tags/
+*/
+
+if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { 	die('You are not allowed to call this page directly.'); }
+
+$action_status = array('message' => '', 'status' => 'ok');
+
+if ( isset($_POST['tag_action']) ) {
+
+	check_admin_referer('nggallery_admin_tags');
+
+	if ( $_POST['tag_action'] == 'renametag' ) {
+		$oldtag = (isset($_POST['renametag_old'])) ? $_POST['renametag_old'] : '';
+		$newtag = (isset($_POST['renametag_new'])) ? $_POST['renametag_new'] : '';
+		$action_status = nggTags::rename_tags( $oldtag, $newtag );
+	} elseif ( $_POST['tag_action'] == 'deletetag' ) {
+		$todelete = (isset($_POST['deletetag_name'])) ? $_POST['deletetag_name'] : '';
+		$action_status = nggTags::delete_tags( $todelete );
+	} elseif ( $_POST['tag_action'] == 'editslug' ) {
+		$matchtag = (isset($_POST['tagname_match'])) ? $_POST['tagname_match'] : '';
+		$newslug   = (isset($_POST['tagslug_new'])) ? $_POST['tagslug_new'] : '';
+		$action_status = nggTags::edit_tag_slug( $matchtag, $newslug );
+	}
+}
+
+// Som useful variables
+$admin_base_url = admin_url() . 'admin.php?page=nggallery-tags';
+$nb_tags = 50; // Number of tags to show on a single page
+
+// Manage URL
+
+$sort_order = ( isset($_GET['tag_sortorder']) ) ? esc_attr( stripslashes($_GET['tag_sortorder']) ) : 'desc';
+$search_url = ( isset($_GET['search']) ) ? '&amp;search=' . esc_attr ( stripslashes($_GET['search']) ) : '';
+$action_url = $admin_base_url . '&amp;tag_sortorder=' . $sort_order. $search_url;
+
+// Tags Filters
+$order_array = array(
+	'desc' => __('Most popular', 'nggallery'),
+	'asc' => __('Least used', 'nggallery'),
+	'natural' => __('Alphabetical', 'nggallery'));
+
+// Build Tags Param
+$param = 'hide_empty=false';
+switch ($sort_order) {
+	case 'natural' :
+		$param .= '&number='.$nb_tags.'&orderby=name&order=asc';
+		break;
+	case 'asc' :
+		$param .= '&number='.$nb_tags.'&orderby=count&order=asc';
+		break;
+	default :
+		$param .= '&number='.$nb_tags.'&orderby=count&order=desc';
+		break;
+}
+
+
+// Search
+if ( !empty($_GET['search']) ) {
+	$search = stripslashes($_GET['search']);
+	$param .= '&name__like=' . $search;
+}
+
+// Offset
+if ( !empty($_GET['offset']) ) {
+	$param .= '&offset=' . intval( $_GET['offset'] );
+}
+
+// Navigation urls
+if ( empty($_GET['offset']) ) {
+	$offset = 0;
+} else {
+	$offset = intval( $_GET['offset'] );
+}
+
+$tag_count = (int)wp_count_terms('ngg_tag', 'ignore_empty=true');
+
+if ($offset + $nb_tags < $tag_count) {
+	$next_offset = '' . min($offset + $nb_tags, $tag_count - $nb_tags);
+} else {
+	$next_offset = '';
+}
+
+if ($nb_tags < $tag_count && $offset>0) {
+	$prev_offset = '' . max($offset - $nb_tags, 0);
+} else {
+	$prev_offset = '';
+}
+
+?>
+<style>
+	.disabled, .disabled:hover { border-color: #E5E5E5; color: #999999; cursor: default; }
+</style>
+
+<div class="wrap ngg_wrap">
+	<?php //include('templates/social_media_buttons.php'); ?>
+    <?php screen_icon( 'nextgen-gallery' ); ?>
+	<h2><?php _e('Manage image tags', 'nggallery'); ?></h2>
+
+	<?php if ($action_status['message']!='') : ?>
+	<div id="message" class="<?php echo ($action_status['status']=='ok' ? 'updated' : $action_status['status']); ?> fade">
+		<p><strong><?php echo $action_status['message']; ?></strong></p>
+	</div>
+	<?php endif; ?>
+
+	<table>
+		<tr>
+			<td class="list_tags">
+				<fieldset class="options" id="taglist">
+					<h3><?php _e('Existing Tags', 'nggallery'); ?></h3>
+
+					<form method="get">
+						<p>
+							<label for="search"><?php _e('Search tags', 'nggallery'); ?></label><br />
+							<input type="hidden" name="page" value="<?php echo esc_attr( stripslashes($_GET['page']) ); ?>" />
+							<input type="hidden" name="tag_sortorder" value="<?php echo $sort_order; ?>" />
+							<input type="text" name="search" id="search" size="10" value="<?php if (isset($_GET['search'])) echo esc_attr( stripslashes($_GET['search']) ); ?>" />
+							<input class="button" type="submit" value="<?php _e('Go', 'nggallery'); ?>" />
+						</p>
+					</form>
+
+					<div class="sort_order">
+						<h3><?php _e('Sort Order:', 'nggallery'); ?></h3>
+						<?php
+						$output = array();
+						foreach( $order_array as $sort => $title ) {
+							$output[] = ($sort == $sort_order) ? '<span style="color: red;">'.$title.'</span>' : '<a href="'. $admin_base_url . '&amp;tag_sortorder=' . $sort . $search_url .'">'.$title.'</a>';
+						}
+						echo implode('<br />', $output);
+						$output = array();
+						unset($output);
+						?>
+					</div>
+
+					<div id="ajax_area_tagslist">
+						<ul>
+							<?php
+							$tags = (array) nggTags::find_tags($param, true);
+							foreach( $tags as $tag ) {
+                                //TODO:Tag link should be call a list of images in manage gallery
+                                //echo '<li><span>' . $tag->name . '</span>&nbsp;<a href="'.(ngg_get_tag_link( $tag->term_id )).'" title="'.sprintf(__('View all images tagged with %s', 'nggallery'), $tag->name).'">('.$tag->count.')</a></li>'."\n";
+                                echo '<li><span>' . esc_html( $tag->name ). '</span>&nbsp;'.'('. esc_html( $tag->count ).')</li>'."\n";
+
+							}
+							unset($tags);
+							?>
+						</ul>
+
+						<?php if ( $prev_offset!='' || $next_offset!='' ) : ?>
+						<div class="navigation">
+
+							<?php if ($prev_offset!='') { ?>
+							<form method="get" style="display: inline;">
+								<span>
+									<input type="hidden" name="page" value="<?php echo esc_attr( stripslashes($_GET['page']) ); ?>" />
+									<input type="hidden" name="tag_sortorder" value="<?php echo $sort_order; ?>" />
+									<input type="hidden" name="offset" value="<?php echo $prev_offset; ?>" />
+									<input class="button" type="submit" value="&laquo; <?php _e('Previous tags', 'nggallery'); ?>" />
+								</span>
+							</form>
+							<?php } else { ?>
+								<span><span class="button disabled">&laquo; <?php _e('Previous tags', 'nggallery'); ?></span></span>
+							<?php } ?>
+
+							<?php if ($next_offset!='') { ?>
+							<form method="get" style="display: inline;">
+								<span>
+									<input type="hidden" name="page" value="<?php echo esc_attr( stripslashes($_GET['page']) ); ?>" />
+									<input type="hidden" name="tag_sortorder" value="<?php echo $sort_order; ?>" />
+									<input type="hidden" name="offset" value="<?php echo $next_offset; ?>" />
+									<input class="button" type="submit" value="<?php _e('Next tags', 'nggallery'); ?> &raquo;" />
+								</span>
+							</form>
+							<?php } else { ?>
+								<span><span class="button disabled"><?php _e('Previous tags', 'nggallery'); ?> &raquo;</span></span>
+							<?php } ?>
+						</div>
+						<?php endif; ?>
+					</div>
+				</fieldset>
+			</td>
+			<td class="forms_manage">
+				<h3><?php _e('Rename Tag', 'nggallery'); ?></h3>
+				<form action="<?php echo $action_url; ?>" method="post">
+					<input type="hidden" name="tag_action" value="renametag" />
+					<?php wp_nonce_field('nggallery_admin_tags'); ?>
+
+					<table class="form-table">
+						<tr valign="top">
+							<td colspan="2">
+								<p><?php _e('Enter the tag to rename and its new value.  You can use this feature to merge tags too. Click "Rename" and all posts which use this tag will be updated.', 'nggallery'); ?></p>
+								<p><?php _e('You can specify multiple tags to rename by separating them with commas.', 'nggallery'); ?></p>
+							</td>
+						</tr>
+						<tr valign="top">
+							<th scope="row"><label for="renametag_old"><?php _e('Tag(s) to rename:', 'nggallery'); ?></label></th>
+							<td><input type="text" id="renametag_old" name="renametag_old" value="" size="40" /></td>
+						</tr>
+						<tr valign="top">
+							<th scope="row"><label for="renametag_new"><?php _e('New tag name(s):', 'nggallery'); ?></label></th>
+							<td>
+								<input type="text" id="renametag_new" name="renametag_new" value="" size="40" />
+								<input class="button" type="submit" name="rename" value="<?php _e('Rename', 'nggallery'); ?>" />
+							</td>
+						</tr>
+					</table>
+				</form>
+
+				<h3><?php _e('Delete Tag', 'nggallery'); ?></h3>
+				<form action="<?php echo $action_url; ?>" method="post">
+					<input type="hidden" name="tag_action" value="deletetag" />
+					<?php wp_nonce_field('nggallery_admin_tags'); ?>
+
+					<table class="form-table">
+						<tr valign="top">
+							<td colspan="2">
+								<p><?php _e('Enter the name of the tag to delete.  This tag will be removed from all posts.', 'nggallery'); ?></p>
+								<p><?php _e('You can specify multiple tags to delete by separating them with commas', 'nggallery'); ?>.</p>
+							</td>
+						</tr>
+						<tr valign="top">
+							<th scope="row"><label for="deletetag_name"><?php _e('Tag(s) to delete:', 'nggallery'); ?></label></th>
+							<td>
+								<input type="text" id="deletetag_name" name="deletetag_name" value="" size="40" />
+								<input class="button" type="submit" name="delete" value="<?php _e('Delete', 'nggallery'); ?>" />
+							</td>
+						</tr>
+					</table>
+				</form>
+
+				<h3><?php _e('Edit Tag Slug', 'nggallery'); ?></h3>
+				<form action="<?php echo $action_url; ?>" method="post">
+					<input type="hidden" name="tag_action" value="editslug" />
+                    <?php wp_nonce_field('nggallery_admin_tags'); ?>
+
+					<table class="form-table">
+						<tr valign="top">
+							<td colspan="2">
+								<p><?php _e('Enter the tag name to edit and its new slug. This will be used in tagcloud links. <a href="http://codex.wordpress.org/Glossary#Slug" target="_blank">Slug definition</a>', 'nggallery'); ?></p>
+								<p><?php _e('You can specify multiple tags to rename by separating them with commas.', 'nggallery'); ?></p>
+							</td>
+						</tr>
+						<tr valign="top">
+							<th scope="row"><label for="tagname_match"><?php _e('Tag(s) to match:', 'nggallery'); ?></label></th>
+							<td><input type="text" id="tagname_match" name="tagname_match" value="" size="40" /></td>
+						</tr>
+						<tr valign="top">
+							<th scope="row"><label for="tagslug_new"><?php _e('Slug(s) to set:', 'nggallery'); ?></label></th>
+							<td>
+								<input type="text" id="tagslug_new" name="tagslug_new" value="" size="40" />
+								<input class="button" type="submit" name="edit" value="<?php _e('Edit', 'nggallery'); ?>" />
+							</td>
+						</tr>
+					</table>
+				</form>
+			</td>
+		</tr>
+	</table>
+  	<script type="text/javascript">
+  	// <![CDATA[
+  		// Register onclick event
+  		function registerClick() {
+  			jQuery('#taglist ul li span').bind("click", function(){
+				addTag(this.innerHTML, "renametag_old");
+				addTag(this.innerHTML, "deletetag_name");
+				addTag(this.innerHTML, "tagname_match");
+			});
+  		}
+
+		// Register initial event
+ 		jQuery(document).ready(function() {
+			registerClick();
+		});
+
+		// Add tag into input
+		function addTag( tag, name_element ) {
+			var input_element = document.getElementById( name_element );
+
+			if ( input_element.value.length > 0 && !input_element.value.match(/,\s*$/) )
+				input_element.value += ", ";
+
+			var re = new RegExp(tag + ",");
+			if ( !input_element.value.match(re) )
+				input_element.value += tag + ", ";
+
+			return true;
+		}
+	// ]]>
+	</script>
+</div>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/templates/facebook_like_button.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/templates/facebook_like_button.php
new file mode 100644
index 0000000000000000000000000000000000000000..310b7f2b92165e4030a2b405f77698c019d8279d
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/templates/facebook_like_button.php
@@ -0,0 +1,2 @@
+<div id="fb-root"></div>
+<div id="ngg_facebook_like" class="fb-like" data-href="http://www.facebook.com/nextgengallery" data-send="false" data-layout="button_count" data-width="450" data-show-faces="false"></div>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/templates/social_media_buttons.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/templates/social_media_buttons.php
new file mode 100644
index 0000000000000000000000000000000000000000..4720bf36a4a5c17c9002260b68d25e64bb501d39
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/templates/social_media_buttons.php
@@ -0,0 +1,4 @@
+<div id="ngg_social_media">
+	<?php include('twitter_follow_link.php'); ?>
+	<?php include('facebook_like_button.php'); ?>
+</div>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/templates/twitter_follow_link.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/templates/twitter_follow_link.php
new file mode 100644
index 0000000000000000000000000000000000000000..61e951e76d1a928102ecb98416f387a9a834765a
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/templates/twitter_follow_link.php
@@ -0,0 +1,8 @@
+<a
+	href='https://twitter.com/NextGENGallery'
+	id="ngg_twitter_follow"
+	class='twitter-follow-button'
+	data-show-count='false'
+	data-lang='en'>
+	Follow @NextGENGallery
+</a>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/thumbnails-template.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/thumbnails-template.php
new file mode 100644
index 0000000000000000000000000000000000000000..0037cb4548d9aa3b4c4ff4ffdccc18c8a73103fd
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/thumbnails-template.php
@@ -0,0 +1,104 @@
+<?php
+$nextgen_thumb_size_custom_style = null;
+
+// defaults for the later form input
+if (empty($thumbnails_template_name))
+    $thumbnails_template_name = 'thumbsize';
+if (empty($thumbnails_template_width_name))
+    $thumbnails_template_width_name = 'thumbwidth';
+if (empty($thumbnails_template_height_name))
+    $thumbnails_template_height_name = 'thumbheight';
+if (empty($thumbnails_template_id))
+    $thumbnails_template_id = 'thumbsize';
+if (empty($thumbnails_template_width_id))
+    $thumbnails_template_width_id = '';
+if (empty($thumbnails_template_height_id))
+    $thumbnails_template_height_id = '';
+
+if (class_exists('C_Component_Registry'))
+{
+	$registry = C_Component_Registry::get_instance();
+	$settings = C_NextGen_Settings::get_instance();
+
+	if ($settings != null)
+	{
+		$thumb_sizes = $settings->thumbnail_dimensions;
+
+        if (empty($thumbnails_template_width_value))
+            $thumbnails_template_width_value = $settings->thumbwidth;
+        if (empty($thumbnails_template_height_value))
+            $thumbnails_template_height_value = $settings->thumbheight;
+
+		if (!is_null($thumb_sizes) && is_array($thumb_sizes))
+		{
+			$size_selected = NULL;
+			$size_select_html = "<select name='{$thumbnails_template_name}' id='{$thumbnails_template_id}' onchange='"
+                . "var jt = jQuery(this);"
+                . " var szcust = jt.next(\".nextgen-thumb-size-custom\");"
+                . " if (jt.val() == \"custom\") {"
+                . " szcust.find(\"[name=\\\"{$thumbnails_template_width_name}\\\"]\").val(\"{$thumbnails_template_width_value}\");"
+                . " szcust.find(\"[name=\\\"{$thumbnails_template_height_name}\\\"]\").val(\"{$thumbnails_template_height_value}\");"
+                . " szcust.show();"
+                . " } else {"
+                . " var parts = jt.val().split(\"x\");"
+                . " szcust.hide();"
+                . " szcust.find(\"[name=\\\"{$thumbnails_template_width_name}\\\"]\").val(parts[0]);"
+                . " szcust.find(\"[name=\\\"{$thumbnails_template_height_name}\\\"]\").val(parts[1]);"
+                . " }'>";
+
+			foreach ($thumb_sizes as $thumb_size)
+			{
+				$thumb_size_parts = explode('x', $thumb_size);
+				$thumb_width = $thumb_size_parts[0];
+				$thumb_height = $thumb_size_parts[1];
+
+				$size_select_html .= "\n" . '<option value="' . $thumb_size . '"';
+
+				if ($thumbnails_template_width_value == $thumb_width && $thumbnails_template_height_value == $thumb_height)
+				{
+					$size_selected = $thumb_size;
+					$size_select_html .= ' selected';
+				}
+
+				$size_select_html .= '>' . $thumb_size . '</option>';
+			}
+
+			$size_select_html .= "\n" . '<option value="custom"';
+
+			if (is_null($size_selected))
+			{
+				$size_select_html .= ' selected';
+			}
+			else {
+				$nextgen_thumb_size_custom_style .= 'display: none;';
+			}
+
+			$size_select_html .= '>' . __('Custom', 'nggallery') . '</option>';
+
+			$size_select_html .= '</select>';
+
+			echo $size_select_html;
+		}
+	}
+}
+
+if (!is_null($nextgen_thumb_size_custom_style))
+	$nextgen_thumb_size_custom_style = ' style="' . $nextgen_thumb_size_custom_style . '"';
+
+?><span class="nextgen-thumb-size-custom" <?php echo $nextgen_thumb_size_custom_style; ?>>
+    <input type="text"
+           size="5"
+           maxlength="5"
+           id='<?php echo $thumbnails_template_width_id; ?>'
+           name="<?php echo $thumbnails_template_width_name; ?>"
+           value="<?php echo $thumbnails_template_width_value; ?>"/>
+    x
+    <input type="text"
+           size="5"
+           maxlength="5"
+           id='<?php echo $thumbnails_template_height_id; ?>'
+           name="<?php echo $thumbnails_template_height_name; ?>"
+           value="<?php echo $thumbnails_template_height_value; ?>"/>
+    <br/>
+    <small><?php _e('These are maximum values', 'nggallery'); ?></small>
+</span>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/upgrade.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/upgrade.php
new file mode 100644
index 0000000000000000000000000000000000000000..5b17cd99d5c804b0907331fe92171305e1652f87
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/upgrade.php
@@ -0,0 +1,283 @@
+<?php
+
+/**
+ * ngg_convert_tags() - Import the tags into the wp tables (only required for pre V1.00 versions)
+ *
+ * @return Success Message
+ */
+function ngg_convert_tags() {
+	global $wpdb, $wp_taxonomies;
+
+	// get the obsolete tables
+	$wpdb->nggtags						= $wpdb->prefix . 'ngg_tags';
+	$wpdb->nggpic2tags					= $wpdb->prefix . 'ngg_pic2tags';
+
+	$picturelist = $wpdb->get_col("SELECT pid FROM $wpdb->nggpictures");
+	if ( is_array($picturelist) ) {
+		foreach($picturelist as $id) {
+			$tags = array();
+			$tagarray = $wpdb->get_results("SELECT t.*, tt.* FROM $wpdb->nggpic2tags AS t INNER JOIN $wpdb->nggtags AS tt ON t.tagid = tt.id WHERE t.picid = '$id' ORDER BY tt.slug ASC ");
+			if (!empty($tagarray)){
+				foreach($tagarray as $element) {
+					$tags[$element->id] = $element->name;
+				}
+				wp_set_object_terms($id, $tags, 'ngg_tag');
+			}
+		}
+	}
+}
+
+/**
+ * ngg_convert_filestructure() - converter for old thumnail folder structure
+ *
+ * @return void
+ */
+function ngg_convert_filestructure() {
+	global $wpdb;
+
+	$gallerylist = $wpdb->get_results("SELECT * FROM $wpdb->nggallery ORDER BY gid ASC", OBJECT_K);
+	if ( is_array($gallerylist) ) {
+		$errors = array();
+		foreach($gallerylist as $gallery) {
+			$gallerypath = WINABSPATH.$gallery->path;
+
+			// old mygallery check, convert the wrong folder/ file name now
+			if (@is_dir($gallerypath . '/tumbs')) {
+				if ( !@rename($gallerypath . '/tumbs' , $gallerypath .'/thumbs') )
+					$errors[] = $gallery->path . '/thumbs';
+				// read list of images
+				$imageslist = nggAdmin::scandir($gallerypath . '/thumbs');
+				if ( !empty($imageslist)) {
+					foreach($imageslist as $image) {
+						$purename = substr($image, 4);
+						if ( !@rename($gallerypath . '/thumbs/' . $image, $gallerypath . '/thumbs/thumbs_' . $purename ))
+							$errors[] = $gallery->path . '/thumbs/thumbs_' . $purename ;
+					}
+				}
+			}
+		}
+
+		if (!empty($errors)) {
+			echo "<div class='error_inline'><p>". __('Some folders/files could not renamed, please recheck the permission and rescan the folder in the manage gallery section.', 'nggallery') ."</p>";
+			foreach($errors as $value) {
+				echo __('Rename failed', 'nggallery') . ' : <strong>' . $value . "</strong><br />\n";
+			}
+			echo '</div>';
+		}
+	}
+}
+
+/**
+ * Move the imagerotator outside the plugin folder, as we remove it from the REPO with the next update
+ *
+ * @return string $path URL to the imagerotator
+ */
+function ngg_move_imagerotator() {
+
+	$upload = wp_upload_dir();
+
+	// look first at the old place and move it
+	if ( file_exists( NGGALLERY_ABSPATH . 'imagerotator.swf' ) )
+		@rename(NGGALLERY_ABSPATH . 'imagerotator.swf', $upload['basedir'] . '/imagerotator.swf');
+
+	// If it's successful then we return the new path
+	if ( file_exists( $upload['basedir'] . '/imagerotator.swf' ) )
+		return $upload['baseurl'] . '/imagerotator.swf';
+
+	//In some worse case it's still at the old place
+	if ( file_exists( NGGALLERY_ABSPATH . 'imagerotator.swf' ) )
+		return NGGALLERY_URLPATH . 'imagerotator.swf';
+
+	// if something failed, we must return a empty string
+	return '';
+}
+
+/**
+ * ngg_import_date_time() - Read the timestamp from exif and insert it into the database
+ *
+ * @return void
+ */
+function ngg_import_date_time() {
+	global $wpdb;
+
+	$imagelist = $wpdb->get_results("SELECT t.*, tt.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid ORDER BY tt.pid ASC");
+	if ( is_array($imagelist) ) {
+		foreach ($imagelist as $image) {
+			$picture = new nggImage($image);
+			$meta = new nggMeta($picture->pid, true);
+			$date = $meta->get_date_time();
+			$wpdb->query("UPDATE $wpdb->nggpictures SET imagedate = '$date' WHERE pid = '$picture->pid'");
+		}
+	}
+}
+
+/**
+ * Adding a new column if needed
+ * Example : ngg_maybe_add_column( $wpdb->nggpictures, 'imagedate', "DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER alttext");
+ *
+ * @param string $table_name Database table name.
+ * @param string $column_name Database column name to create.
+ * @param string $create_ddl SQL statement to create column
+ * @return bool True, when done with execution.
+ */
+function ngg_maybe_add_column($table_name, $column_name, $create_ddl) {
+	global $wpdb;
+
+	foreach ($wpdb->get_col("SHOW COLUMNS FROM $table_name") as $column ) {
+		if ($column == $column_name)
+			return true;
+	}
+
+	//didn't find it try to create it.
+	$wpdb->query("ALTER TABLE $table_name ADD $column_name " . $create_ddl);
+
+	// we cannot directly tell that whether this succeeded!
+	foreach ($wpdb->get_col("SHOW COLUMNS FROM $table_name") as $column ) {
+		if ($column == $column_name)
+			return true;
+	}
+
+	echo("Could not add column $column_name in table $table_name<br />\n");
+	return false;
+}
+
+/**
+ * nggallery_upgrade_page() - This page showsup , when the database version doesn't fir to the script NGG_DBVERSION constant.
+ *
+ * @return Upgrade Message
+ */
+function nggallery_upgrade_page()  {
+
+	$filepath    = admin_url() . 'admin.php?page=' . $_GET['page'];
+
+	if ( isset($_GET['upgrade']) && $_GET['upgrade'] == 'now') {
+		nggallery_start_upgrade($filepath);
+		return;
+	}
+?>
+<div class="wrap">
+	<h2><?php _e('Upgrade NextGEN Gallery', 'nggallery') ;?></h2>
+	<p><?php _e('The script detect that you upgrade from a older version.', 'nggallery') ;?>
+	   <?php _e('Your database tables for NextGEN Gallery is out-of-date, and must be upgraded before you can continue.', 'nggallery'); ?>
+       <?php _e('If you would like to downgrade later, please make first a complete backup of your database and the images.', 'nggallery') ;?></p>
+	<p><?php _e('The upgrade process may take a while, so please be patient.', 'nggallery'); ?></p>
+	<h3><a href="<?php echo $filepath;?>&amp;upgrade=now"><?php _e('Start upgrade now', 'nggallery'); ?>...</a></h3>
+</div>
+<?php
+}
+
+/**
+ * nggallery_start_upgrade() - Proceed the upgrade routine
+ *
+ * @param mixed $filepath
+ * @return void
+ */
+function nggallery_start_upgrade($filepath) {
+?>
+<div class="wrap">
+	<h2><?php _e('Upgrade NextGEN Gallery', 'nggallery') ;?></h2>
+	<p><?php ngg_upgrade();?></p>
+	<p class="finished"><?php _e('Upgrade finished...', 'nggallery') ;?></p>
+	<h3><a class="finished" href="<?php echo $filepath;?>"><?php _e('Continue', 'nggallery'); ?>...</a></h3>
+</div>
+<?php
+}
+
+/**
+ * Rebuild slugs for albums, galleries and images via AJAX request
+ *
+ * @sine 1.7.0
+ * @access internal
+ */
+class ngg_rebuild_unique_slugs {
+
+	function start_rebuild() {
+        global $wpdb;
+
+        $total = array();
+        // get the total number of images
+		$total['images'] = intval( $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->nggpictures") );
+        $total['gallery'] = intval( $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->nggallery") );
+        $total['album'] = intval( $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->nggalbum") );
+
+		$messages = array(
+			'images' => __( 'Rebuild image structure : %s / %s images', 'nggallery' ),
+			'gallery' => __( 'Rebuild gallery structure : %s / %s galleries', 'nggallery' ),
+            'album' => __( 'Rebuild album structure : %s / %s albums', 'nggallery' ),
+		);
+
+?>
+<?php
+
+        foreach ( array_keys( $messages ) as $key ) {
+
+    		$message = sprintf( $messages[ $key ] ,
+    			"<span class='ngg-count-current'>0</span>",
+    			"<span class='ngg-count-total'>" . $total[ $key ] . "</span>"
+    		);
+
+    		echo "<div class='$key updated'><p class='ngg'>$message</p></div>";
+        }
+
+		$ajax_url = add_query_arg( 'action', 'ngg_rebuild_unique_slugs', admin_url( 'admin-ajax.php' ) );
+?>
+<script type="text/javascript">
+jQuery(document).ready(function($) {
+	var ajax_url = '<?php echo $ajax_url; ?>',
+		_action = 'images',
+		images = <?php echo $total['images']; ?>,
+		gallery = <?php echo $total['gallery']; ?>,
+        album = <?php echo $total['album']; ?>,
+        total = 0,
+        offset = 0,
+		count = 50;
+
+	var $display = $('.ngg-count-current');
+    $('.finished, .gallery, .album').hide();
+    total = images;
+
+	function call_again() {
+		if ( offset > total ) {
+		    offset = 0;
+            // 1st run finished
+            if (_action == 'images') {
+                _action = 'gallery';
+                total = gallery;
+                $('.images, .gallery').toggle();
+                $display.html(offset);
+                call_again();
+                return;
+            }
+            // 2nd run finished
+            if (_action == 'gallery') {
+                _action = 'album';
+                total = album;
+                $('.gallery, .album').toggle();
+                $display.html(offset);
+                call_again();
+                return;
+            }
+            // 3rd run finished, exit now
+            if (_action == 'album') {
+    			$('.ngg')
+    				.html('<?php _e( 'Done.', 'nggallery' ); ?>')
+    				.parent('div').hide();
+                $('.finished').show();
+    			return;
+            }
+		}
+
+		$.post(ajax_url, {'_action': _action, 'offset': offset}, function(response) {
+			$display.html(offset);
+
+			offset += count;
+			call_again();
+		});
+	}
+
+	call_again();
+});
+</script>
+<?php
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/upload.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/upload.php
new file mode 100644
index 0000000000000000000000000000000000000000..bba50f810bd88cb6d5b9883f845947e138620bb2
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/upload.php
@@ -0,0 +1,47 @@
+<?php
+/**
+ * Accepts file uploads from swfupload.
+ *
+ * @package NextGEN-Gallery
+ * @subpackage Administration
+ */
+
+// Flash often fails to send cookies with the POST or upload, so we need to pass it in GET or POST instead
+// We then have to validate the cookie manually. NOTE: WordPress functions, like
+// get_current_user_id() and the like are NOT available in this file.
+if ( is_ssl() && empty($_COOKIE[SECURE_AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) )
+	$_COOKIE[SECURE_AUTH_COOKIE] = $_REQUEST['auth_cookie'];
+elseif ( empty($_COOKIE[AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) )
+	$_COOKIE[AUTH_COOKIE] = $_REQUEST['auth_cookie'];
+if ( empty($_COOKIE[LOGGED_IN_COOKIE]) && !empty($_REQUEST['logged_in_cookie']) )
+	$_COOKIE[LOGGED_IN_COOKIE] = $_REQUEST['logged_in_cookie'];
+
+header('Content-Type: text/plain; charset=' . get_option('blog_charset'));
+
+$logged_in = FALSE;
+
+if (wp_validate_auth_cookie()) {
+	$results = wp_parse_auth_cookie();
+	if (isset($results['username']) && isset($results['expiration'])) {
+		if (time() < floatval($results['expiration'])) {
+			if (($userdata = get_user_by('login', $results['username'])))
+				$logged_in = $userdata->ID;
+		}
+	}
+}
+
+if (!$logged_in)
+    die("Login failure. -1");
+else if (!user_can($logged_in, 'NextGEN Upload images'))
+    die('You do not have permission to upload files. -2');
+
+//check for nggallery
+if ( !defined('NGGALLERY_ABSPATH') )
+	die('NextGEN Gallery not available. -3');
+
+include_once (NGGALLERY_ABSPATH. 'admin/functions.php');
+
+// get the gallery
+$galleryID = (int) $_POST['galleryselect'];
+
+echo nggAdmin::swfupload_image($galleryID);
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/wpmu.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/wpmu.php
new file mode 100644
index 0000000000000000000000000000000000000000..b569ed2c8b71fd0ae9451258901609c4c50cb0c5
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/wpmu.php
@@ -0,0 +1,117 @@
+<?php  
+if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
+
+	function nggallery_wpmu_setup()  {	
+	
+	//to be sure
+	if ( !is_super_admin() )
+ 		die('You are not allowed to call this page.');
+
+    $messagetext = '';
+
+	// get the options
+	$ngg_options = get_site_option('ngg_options');
+
+	if ( isset($_POST['updateoption']) ) {	
+		check_admin_referer('ngg_wpmu_settings');
+		// get the hidden option fields, taken from WP core
+		if ( $_POST['page_options'] )	
+			$options = explode(',', stripslashes($_POST['page_options']));
+		if ($options) {
+			foreach ($options as $option) {
+				$option = trim($option);
+				$value = isset($_POST[$option]) ? trim($_POST[$option]) : false;
+		//		$value = sanitize_option($option, $value); // This does strip slashes on those that need it
+				$ngg_options[$option] = $value;
+			}
+		}
+
+        // the path should always end with a slash	
+        $ngg_options['gallerypath']    = trailingslashit($ngg_options['gallerypath']);
+		update_site_option('ngg_options', $ngg_options);
+        
+	 	$messagetext = __('Update successfully','nggallery');
+	}		
+
+    // Show donation message only one time.
+    if (isset ( $_GET['hideSupportInfo']) ) {
+    	$ngg_options['hideSupportInfo'] = true;
+    	update_site_option('ngg_options', $ngg_options);			
+    }
+	
+	// message windows
+	if( !empty($messagetext) ) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$messagetext.'</p></div>'; }
+	
+	?>
+
+	<div class="wrap">
+		<h2><?php _e('Network Options','nggallery'); ?></h2>
+		<form name="generaloptions" method="post">
+		<?php wp_nonce_field('ngg_wpmu_settings') ?>
+		<input type="hidden" name="page_options" value="gallerypath,wpmuQuotaCheck,wpmuZipUpload,wpmuImportFolder,wpmuStyle,wpmuRoles,wpmuCSSfile" />
+			<table class="form-table">
+				<tr valign="top">
+					<th align="left"><?php _e('Gallery path','nggallery') ?></th>
+					<td><input type="text" size="50" name="gallerypath" value="<?php echo $ngg_options['gallerypath']; ?>" /><br />
+					<?php _e('This is the default path for all blogs. With the placeholder %BLOG_ID% you can organize the folder structure better.','nggallery') ?>
+                    <?php echo str_replace('%s', '<code>wp-content/blogs.dir/%BLOG_ID%/files/</code>', __('The default setting should be %s', 'nggallery')); ?>
+                    </td>
+				</tr>
+				<tr>
+					<th valign="top"><?php _e('Enable upload quota check','nggallery') ?>:</th>
+					<td><input name="wpmuQuotaCheck" type="checkbox" value="1" <?php checked('1', $ngg_options['wpmuQuotaCheck']); ?> />
+					<?php _e('Should work if the gallery is bellow the blog.dir','nggallery') ?>
+					</td>
+				</tr>
+				<tr>
+					<th valign="top"><?php _e('Enable zip upload option','nggallery') ?>:</th>
+					<td><input name="wpmuZipUpload" type="checkbox" value="1" <?php checked('1', $ngg_options['wpmuZipUpload']); ?> />
+					<?php _e('Allow users to upload zip folders.','nggallery') ?>
+					</td>
+				</tr>
+				<tr>
+					<th valign="top"><?php _e('Enable import function','nggallery') ?>:</th>
+					<td><input name="wpmuImportFolder" type="checkbox" value="1" <?php checked('1', $ngg_options['wpmuImportFolder']); ?> />
+					<?php _e('Allow users to import images folders from the server.','nggallery') ?>
+					</td>
+				</tr>
+				<tr>
+					<th valign="top"><?php _e('Enable style selection','nggallery') ?>:</th>
+					<td><input name="wpmuStyle" type="checkbox" value="1" <?php checked('1', $ngg_options['wpmuStyle']); ?> />
+					<?php _e('Allow users to choose a style for the gallery.','nggallery') ?>
+					</td>
+				</tr>
+				<tr>
+					<th valign="top"><?php _e('Enable roles/capabilities','nggallery') ?>:</th>
+					<td><input name="wpmuRoles" type="checkbox" value="1" <?php checked('1', $ngg_options['wpmuRoles']); ?> />
+					<?php _e('Allow users to change the roles for other blog authors.','nggallery') ?>
+					</td>
+				</tr>
+				<tr>
+					<th valign="top"><?php _e('Default style','nggallery') ?>:</th>
+					<td>
+					<select name="wpmuCSSfile">
+					<?php
+                        // $csslist = ngg_get_cssfiles();
+                        $csslist = C_NextGen_Style_Manager::get_instance()->find_all_stylesheets();
+						foreach ($csslist as $key => $a_cssfile) {
+							$css_name = $a_cssfile['name'];
+							if ($key == $ngg_options['wpmuCSSfile']) {
+								$selected = " selected='selected'";
+							}
+							else $selected = '';
+							$css_name = esc_attr($css_name);
+							echo "\n\t<option value=\"{$key}\" {$selected}>{$css_name}</option>";
+						}
+					?>
+					</select><br />
+					<?php _e('Choose the default style for the galleries.','nggallery') ?>
+					</td>
+				</tr>
+			</table> 				
+			<div class="submit"><input type="submit" name="updateoption" value="<?php _e('Update') ;?>"/></div>
+		</form>	
+	</div>	
+
+	<?php
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/class.ngglegacy_installer.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/class.ngglegacy_installer.php
new file mode 100644
index 0000000000000000000000000000000000000000..a795275b7a3b877d5e34f5f14cc3749a622862dd
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/class.ngglegacy_installer.php
@@ -0,0 +1,16 @@
+<?php
+
+class C_NggLegacy_Installer
+{
+	function install()
+	{
+		include_once('admin/install.php');
+		nggallery_install();
+	}
+
+	function uninstall($hard=FALSE)
+	{
+		delete_option('ngg_init_check');
+		delete_option('ngg_update_exists');
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/css/nggallery.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/css/nggallery.css
new file mode 100644
index 0000000000000000000000000000000000000000..13046decd8c3fad509e5376c13b386e49c8768be
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/css/nggallery.css
@@ -0,0 +1,8 @@
+/*
+CSS Name: Default Styles
+Description: NextGEN Default Gallery Stylesheet
+Author: Photocrati Media
+Version: 2.12
+
+This stylesheet is provided to allow users the ability of overriding the default styles for all display types
+*/
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/fonts/arial.ttf b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/fonts/arial.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..886789b85b4b4e662519fcb7fe4d88ddf2205c5b
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/fonts/arial.ttf differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/images/ajax-loader.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/images/ajax-loader.gif
new file mode 100644
index 0000000000000000000000000000000000000000..d0bce1542342e912da81a2c260562df172f30d73
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/images/ajax-loader.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/images/loader.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/images/loader.gif
new file mode 100644
index 0000000000000000000000000000000000000000..0ca7ada960568fff04400cda966fbdcb106abfa2
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/images/loader.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/images/mrss-icon.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/images/mrss-icon.gif
new file mode 100644
index 0000000000000000000000000000000000000000..e022fbdab42036d584eeffde8895035d81f880b8
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/images/mrss-icon.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/images/piclens.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/images/piclens.gif
new file mode 100644
index 0000000000000000000000000000000000000000..c96671f45d8e101a943fe77f3d3bb4497ff3c030
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/images/piclens.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/index.html b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lang/nggallery-de_DE.mo b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lang/nggallery-de_DE.mo
new file mode 100644
index 0000000000000000000000000000000000000000..dc252917407ec21c1c1cde03bb459a5f96ed2867
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lang/nggallery-de_DE.mo differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lang/nggallery-de_DE.po b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lang/nggallery-de_DE.po
new file mode 100644
index 0000000000000000000000000000000000000000..6c93c3b4190c2c800312d7978c84bda59f11f6f5
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lang/nggallery-de_DE.po
@@ -0,0 +1,3956 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: NextGEN Gallery\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-10-23 18:03+0100\n"
+"PO-Revision-Date: 2012-02-17 17:07+0100\n"
+"Last-Translator: Alex Rabe\n"
+"Language-Team: Alex Rabe\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-KeywordsList: __;_e;_n:1,2;esc_html_e;esc_attr_e\n"
+"X-Poedit-Basepath: .\n"
+"X-Poedit-Country: GERMANY\n"
+"X-Poedit-SourceCharset: utf-8\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"X-Poedit-Language: German\n"
+"X-Poedit-SearchPath-0: .\n"
+"X-Poedit-SearchPath-1: ..\n"
+
+#: ../nggallery.php:100
+msgid "<strong>Translation by : </strong><a target=\"_blank\" href=\"http://alexrabe.de/wordpress-plugins/nextgen-gallery/languages/\">See here</a>"
+msgstr "<strong>Übersetzt von : </strong><a target=\"_blank\" href=\"http://alexrabe.de/wordpress-plugins/wordtube/translation-of-plugins/\">Alex Rabe</a>"
+
+#: ../nggallery.php:101
+msgid "<strong>This translation is not yet updated for Version 1.9.0</strong>. If you would like to help with translation, download the current po from the plugin folder and read <a href=\"http://alexrabe.de/wordpress-plugins/wordtube/translation-of-plugins/\">here</a> how you can translate the plugin."
+msgstr "Sollten jemand Rechtschreibfehler, Deppenapostrophe oder andere deutsche Ungereimtheiten finden, freue ich mich jederzeit über einen kurzen Hinweis</p>"
+
+#: ../nggallery.php:205
+msgid "Sorry, NextGEN Gallery works only with a Memory Limit of 16 MB or higher"
+msgstr "Tut mir leid, aber NextGEN-Galerie benötigt mindestens 16MB Speicher (Memory Limit) oder mehr"
+
+#: ../nggallery.php:225
+msgid "Please update the database of NextGEN Gallery."
+msgstr "Bitte aktualisiere die Datenbank von NextGEN Gallery."
+
+#: ../nggallery.php:225
+msgid "Click here to proceed."
+msgstr "Hier klicken um fortzufahren."
+
+#: ../nggallery.php:248
+msgid "Picture tag"
+msgstr "Bilder-Stichwort"
+
+#: ../nggallery.php:249
+msgid "Picture tag: %2$l."
+msgstr "Bilder-Stichwort: %2$l."
+
+#: ../nggallery.php:250
+msgid "Separate picture tags with commas."
+msgstr "Trenne Stichwörter mittels Komma"
+
+#: ../nggallery.php:357
+#: ../admin/admin.php:256
+msgid "L O A D I N G"
+msgstr "B I T T E &nbsp;&nbsp;W A R T E N"
+
+#: ../nggallery.php:358
+#: ../admin/admin.php:257
+msgid "Click to Close"
+msgstr "Klicken zum Schliessen "
+
+#: ../nggallery.php:379
+msgid "loading"
+msgstr "lade..."
+
+#: ../nggallery.php:517
+#: ../nggfunctions.php:941
+#: ../admin/admin.php:37
+#: ../admin/admin.php:79
+msgid "Overview"
+msgstr "Übersicht"
+
+#: ../nggallery.php:518
+msgid "Get help"
+msgstr "Hilfe"
+
+#: ../nggallery.php:519
+msgid "Contribute"
+msgstr "Mithelfen"
+
+#: ../nggallery.php:520
+msgid "Donate"
+msgstr "Spenden"
+
+#: ../nggfunctions.php:42
+msgid "The <a href=\"http://www.macromedia.com/go/getflashplayer\">Flash Player</a> and <a href=\"http://www.mozilla.com/firefox/\">a browser with Javascript support</a> are needed."
+msgstr "Es wird der <a href=\"http://www.macromedia.com/go/getflashplayer\">Adobe Flash Player</a>  benötigt und <a href=\"http://www.mozilla.com/firefox/\">im Browser muss Javascript</a> aktiviert sein."
+
+#: ../nggfunctions.php:164
+#: ../nggfunctions.php:642
+msgid "[Gallery not found]"
+msgstr "[Galerie nicht gefunden]"
+
+#: ../nggfunctions.php:450
+msgid "[Album not found]"
+msgstr "[Album nicht gefunden]"
+
+#: ../nggfunctions.php:771
+msgid "[SinglePic not found]"
+msgstr "[Bild nicht gefunden]"
+
+#: ../nggfunctions.php:906
+msgid "Related images for"
+msgstr "Verwandte Bilder von"
+
+#: ../admin/about.php:10
+msgid "Copyright notes / Credits"
+msgstr "Copyright Hinweise / Credits"
+
+#: ../admin/about.php:13
+msgid "NextGEN DEV Team"
+msgstr "NextGEN-DEV-Team"
+
+#: ../admin/about.php:15
+msgid "This plugin is primarily developed, maintained, supported, documented by"
+msgstr "Dieses Plugin wird hauptsächlich entwickelt, dokumentiert und supported von"
+
+#: ../admin/about.php:15
+msgid "There are many other folks who have made contributions to this project :"
+msgstr "Folgende Personen haben die Entwicklung unterstützt :"
+
+#: ../admin/about.php:20
+msgid "Contributors / Tribute to"
+msgstr "Anerkennung / Hinweise"
+
+#: ../admin/about.php:22
+msgid "If you study the code of this plugin, you will find out that we mixed a lot of good already existing code and ideas together."
+msgstr "Falls Du Dir den Sourcecode dieses Plugins ansiehst, wirst Du merken, dass wir verschiedene gute Scripte sowie Ideen verwendet haben."
+
+#: ../admin/about.php:23
+msgid "So, we would like to thank the following people for their pioneer work (without this work it's impossible to create such a plugin so fast)"
+msgstr "Wir möchten folgenden Menschen für Ihre Pionier-Arbeit danken (ohne diese Vorleistung wäre es unmöglich, ein Plugin so schnell zu entwickeln)"
+
+#: ../admin/about.php:25
+msgid "for their great documented code"
+msgstr "für ihren großartig dokumentierten Code"
+
+#: ../admin/about.php:26
+msgid "for jQuery, which is the best Web2.0 framework"
+msgstr "für jQuery, das Beste Web 2.0 Framework"
+
+#: ../admin/about.php:27
+msgid "for the fantastic PHP Thumbnail Class"
+msgstr "für die fantastische PHP-Thumbnail-Klasse"
+
+#: ../admin/about.php:28
+msgid "for a lot of very useful plugins and ideas"
+msgstr "für viele nützliche Plugins und Ideen"
+
+#: ../admin/about.php:29
+msgid "for Shutter Reloaded, a real lightweight image effect"
+msgstr "für Shutter Reloaded, ein wirklich smarten Bildeffekt"
+
+#: ../admin/about.php:30
+msgid "for the best Media Flash Scripts on earth"
+msgstr "für die besten Media-Flash-Scripte"
+
+#: ../admin/about.php:31
+msgid "for the Gallery Icon"
+msgstr "für das Galerie Icon"
+
+#: ../admin/about.php:32
+msgid "for the Watermark plugin"
+msgstr "für das Wasserzeichen-Plugin"
+
+#: ../admin/about.php:34
+msgid "If you didn't find your name on this list and there is some code which I integrate in my plugin, don't hesitate to send me a mail."
+msgstr "Falls Du Deinen Namen nicht auf dieser Liste findest und es aber Code gibt, den ich in meinem Plugin verwendet habe, so schicken mir bitte sofort eine E-Mail."
+
+#: ../admin/about.php:38
+msgid "How to support ?"
+msgstr "Unterstützung / Hilfe"
+
+#: ../admin/about.php:40
+msgid "There exist several ways to contribute, help or support us in this work. Non of them are mandatory."
+msgstr "Es existieren verschiedene Möglichkeiten, diese Arbeit zu unterstützen."
+
+#: ../admin/about.php:42
+msgid "Send us bugfixes / code changes"
+msgstr "Schicke uns Verbesserungen / Bugfixes"
+
+#: ../admin/about.php:42
+msgid "The most motivated support for this plugin are your ideas and brain work"
+msgstr "Der beste Support für dieses Plugin sind Deine Ideen und Gedanken"
+
+#: ../admin/about.php:43
+msgid "Translate the plugin"
+msgstr "Übersetze das Plugin"
+
+#: ../admin/about.php:43
+msgid "To help people to work with this plugin, I would like to have it in all available languages"
+msgstr "Um jedem das Arbeiten mit diesem Plugin zu vereinfachen, würde ich es gerne in allen möglichen Sprachen anbieten"
+
+#: ../admin/about.php:44
+msgid "Donate the work via paypal"
+msgstr "Zeig Dich für diese Arbeit per PayPal dankbar"
+
+#: ../admin/about.php:57
+msgid "No doubt a very useful and easy motivation :-)"
+msgstr "Kein Zweifel, eine schöne und einfache Motivationshilfe"
+
+#: ../admin/about.php:59
+msgid "Place a link to the plugin in your blog/webpage"
+msgstr "Setze einen Link zu diesem Plugin auf Deinen Blog"
+
+#: ../admin/about.php:59
+msgid "Yes, share and trackback is also a good support for this work "
+msgstr "Natürlich sind Trackbacks und Links auch ein guter Support für diese Arbeit"
+
+#: ../admin/about.php:64
+msgid "Thanks!"
+msgstr "Vielen Dank!"
+
+#: ../admin/about.php:66
+msgid "We would like to thank this people which support us in the work :"
+msgstr "Ich möchte mich bei diesen Menschen für Ihre Unterstützung bedanken:"
+
+#: ../admin/about.php:166
+msgid "and all donators..."
+msgstr "und allen anderen Spendern..."
+
+#: ../admin/addgallery.php:46
+#: ../admin/addgallery.php:57
+#: ../admin/addgallery.php:69
+#: ../admin/addgallery.php:80
+#: ../admin/album.php:96
+#: ../admin/album.php:124
+#: ../admin/album.php:142
+#: ../admin/edit-thumbnail.php:19
+#: ../admin/edit-thumbnail.php:22
+#: ../admin/manage.php:186
+msgid "Cheatin&#8217; uh?"
+msgstr "Cheatin&#8217; uh?"
+
+#: ../admin/addgallery.php:62
+msgid "Upload failed!"
+msgstr "Upload fehlgeschlagen!"
+
+#: ../admin/addgallery.php:85
+#: ../admin/addgallery.php:93
+msgid "Upload failed! "
+msgstr "Upload fehlgeschlagen!"
+
+#: ../admin/addgallery.php:90
+#: ../admin/functions.php:943
+#: ../admin/functions.php:1043
+msgid "No gallery selected !"
+msgstr "Keine Galerie ausgewählt !"
+
+#: ../admin/addgallery.php:180
+#: ../admin/addgallery.php:263
+msgid "Image Files"
+msgstr "Bilder"
+
+#: ../admin/addgallery.php:195
+#: ../admin/addgallery.php:284
+#: ../admin/addgallery.php:312
+msgid "remove"
+msgstr "Entfernen"
+
+#: ../admin/addgallery.php:196
+#: ../admin/addgallery.php:285
+#: ../admin/addgallery.php:466
+msgid "Browse..."
+msgstr "Durchsuche..."
+
+#: ../admin/addgallery.php:197
+#: ../admin/addgallery.php:235
+#: ../admin/addgallery.php:286
+#: ../admin/addgallery.php:298
+#: ../admin/addgallery.php:537
+msgid "Upload images"
+msgstr "Bilder hochladen"
+
+#: ../admin/addgallery.php:376
+#: ../admin/addgallery.php:484
+msgid "Upload Images"
+msgstr "Bilder hochladen"
+
+#: ../admin/addgallery.php:379
+#: ../admin/addgallery.php:396
+#: ../admin/manage-galleries.php:119
+#: ../admin/manage-galleries.php:156
+msgid "Add new gallery"
+msgstr "Neue Galerie erstellen"
+
+#: ../admin/addgallery.php:382
+#: ../admin/addgallery.php:418
+msgid "Upload a Zip-File"
+msgstr "Zip-Datei hochladen"
+
+#: ../admin/addgallery.php:385
+#: ../admin/addgallery.php:460
+msgid "Import image folder"
+msgstr "Bilder-Verzeichnis importieren"
+
+#: ../admin/addgallery.php:401
+#: ../admin/manage-galleries.php:279
+msgid "New Gallery"
+msgstr "Neue Galerie"
+
+#: ../admin/addgallery.php:404
+#: ../admin/manage-galleries.php:281
+msgid "Create a new , empty gallery below the folder"
+msgstr "Erstelle eine neue, leere Galerie unter dem Verzeichnis"
+
+#: ../admin/addgallery.php:406
+#: ../admin/manage-galleries.php:283
+msgid "Allowed characters for file and folder names are"
+msgstr "Erlaubte Zeichen für die Datei- und Verzeichnisnamen sind"
+
+#: ../admin/addgallery.php:410
+msgid "Add gallery"
+msgstr "Galerie hinzufügen"
+
+#: ../admin/addgallery.php:423
+msgid "Select Zip-File"
+msgstr "Wähle Zip-Datei"
+
+#: ../admin/addgallery.php:425
+msgid "Upload a zip file with images"
+msgstr "Lade eine Zip-Datei mit Bildern hoch"
+
+#: ../admin/addgallery.php:429
+msgid "or enter a Zip-File URL"
+msgstr "oder gib eine URL zur ZIP-Datei an"
+
+#: ../admin/addgallery.php:431
+msgid "Import a zip file with images from a url"
+msgstr "Lade eine Zip-Datei mit Bildern über ein URL hoch"
+
+#: ../admin/addgallery.php:435
+#: ../admin/addgallery.php:512
+msgid "in to"
+msgstr "in"
+
+#: ../admin/addgallery.php:437
+msgid "a new gallery"
+msgstr "eine neue Galerie"
+
+#: ../admin/addgallery.php:448
+msgid "Note : The upload limit on your server is "
+msgstr "Hinweis : Das Upload-Limit auf dem Server beträgt "
+
+#: ../admin/addgallery.php:452
+msgid "Start upload"
+msgstr "Upload starten"
+
+#: ../admin/addgallery.php:465
+msgid "Import from Server path:"
+msgstr "Importieren aus Server-Pfad:"
+
+#: ../admin/addgallery.php:468
+msgid "Note : Change the default path in the gallery settings"
+msgstr "Hinweis : Der Standard-Pfad kann in den Einstellungen angepasst werden"
+
+#: ../admin/addgallery.php:470
+msgid " Please note : For safe-mode = ON you need to add the subfolder thumbs manually"
+msgstr "Achtung : Da der Safe-Mode (PHP.INI) eingeschaltet ist, mußt Du das Unterverzeichnis für die Vorschaubilder (\"thumbs\") manuell (per FTP) anlegen"
+
+#: ../admin/addgallery.php:473
+msgid "Import folder"
+msgstr "Verzeichnis importieren"
+
+#: ../admin/addgallery.php:490
+msgid "Upload image"
+msgstr "Bild hochladen"
+
+#: ../admin/addgallery.php:495
+msgid "Choose files to upload"
+msgstr "Wähle die Bilder zum Upload aus"
+
+#: ../admin/addgallery.php:496
+msgid "Select Files"
+msgstr "Wähle Datei"
+
+#: ../admin/addgallery.php:498
+msgid "Or you can drop the files into this window."
+msgstr "Du kannst auch die Bilder per Drag & Drop in den Browser schieben."
+
+#: ../admin/addgallery.php:501
+#, php-format
+msgid "Scale images to max width %1$dpx or max height %2$dpx"
+msgstr "Skaliere die Bilder mit einer max. Breite von %1$dpx oder max. Höhe von %2$dpx"
+
+#: ../admin/addgallery.php:514
+msgid "Choose gallery"
+msgstr "Wähle Galerie"
+
+#: ../admin/addgallery.php:533
+msgid "The batch upload requires Adobe Flash 10, disable it if you have problems"
+msgstr "Das Batch-Upload benötigt Adbode Flash 10, wenn es Probleme gibt deaktiviere es besser."
+
+#: ../admin/addgallery.php:533
+msgid "Disable flash upload"
+msgstr "Deaktiviere Batch-Upload"
+
+#: ../admin/addgallery.php:535
+msgid "Upload multiple files at once by ctrl/shift-selecting in dialog"
+msgstr "Wähle im Dialog mit Ctrl/Shift mehrere Bilder gleichzeitig aus."
+
+#: ../admin/addgallery.php:535
+msgid "Enable flash based upload"
+msgstr "Aktiviere Flash Batch Upload"
+
+#: ../admin/admin.php:36
+#: ../admin/admin.php:59
+#: ../admin/admin.php:78
+#: ../admin/admin.php:352
+#: ../admin/admin.php:444
+#: ../admin/functions.php:178
+#: ../admin/manage-galleries.php:127
+#: ../admin/manage-galleries.php:407
+#: ../admin/manage-images.php:239
+msgid "Gallery"
+msgid_plural "Galleries"
+msgstr[0] "Galerie"
+msgstr[1] "Galerien"
+
+#: ../admin/admin.php:38
+#: ../admin/admin.php:81
+msgid "Add Gallery / Images"
+msgstr "Galerie / Bilder hinzufügen"
+
+#: ../admin/admin.php:39
+#: ../admin/admin.php:83
+msgid "Manage Gallery"
+msgstr "Galerie verwalten"
+
+#: ../admin/admin.php:40
+#: ../admin/admin.php:85
+msgid "Album"
+msgid_plural "Albums"
+msgstr[0] "Album"
+msgstr[1] "Alben"
+
+#: ../admin/admin.php:41
+#: ../admin/admin.php:87
+msgid "Tags"
+msgstr "Stichwörter"
+
+#: ../admin/admin.php:42
+#: ../admin/admin.php:89
+msgid "Options"
+msgstr "Optionen"
+
+#: ../admin/admin.php:44
+#: ../admin/admin.php:91
+msgid "Style"
+msgstr "Style"
+
+#: ../admin/admin.php:46
+msgid "Roles"
+msgstr "Zugriff"
+
+#: ../admin/admin.php:47
+msgid "About this Gallery"
+msgstr "Über diese Galerie"
+
+#: ../admin/admin.php:47
+#: ../admin/admin.php:92
+msgid "About"
+msgstr "Über"
+
+#: ../admin/admin.php:50
+#: ../admin/admin.php:61
+msgid "Reset / Uninstall"
+msgstr "Rücksetzen"
+
+#: ../admin/admin.php:60
+msgid "Network settings"
+msgstr "Netzwerk Einstellungen"
+
+#: ../admin/admin.php:131
+#, php-format
+msgid "Thanks for using this plugin, I hope you are satisfied ! If you would like to support the further development, please consider a <strong><a href=\"%s\">donation</a></strong>! If you still need some help, please post your questions <a href=\"http://wordpress.org/tags/nextgen-gallery?forum_id=10\">here</a> ."
+msgstr "Vielen Dank, dass Du dieses Plugin nutzt. Ich hoffe, Du bist soweit zufrieden! Wenn Du die Weiterentwicklung unterstützen möchtest, würde ich mich über eine kleine <strong><a href=\"%s\">Spende</a></strong> freuen! Wenn Du Fragen oder Problem hast, schreib sie doch <a href=\"http://wordpress.org/tags/nextgen-gallery?forum_id=10\">hier</a>  ins Forum."
+
+#: ../admin/admin.php:134
+msgid "OK, hide this message now !"
+msgstr "OK, danke für die Info !"
+
+#: ../admin/admin.php:213
+msgid "You do not have the correct permission"
+msgstr "Du hast keine Zugriffsrechte"
+
+#: ../admin/admin.php:214
+msgid "Unexpected Error"
+msgstr "Unerwarteter Fehler"
+
+#: ../admin/admin.php:215
+msgid "A failure occurred"
+msgstr "Ein Fehler ist aufgetreten"
+
+#: ../admin/admin.php:219
+msgid "You have attempted to queue too many files."
+msgstr "Du hast zu viele Bilder versucht zu laden."
+
+#: ../admin/admin.php:220
+msgid "This file exceeds the maximum upload size for this site."
+msgstr "Diese Datei übersteigt die zugelassene Uploadmenge."
+
+#: ../admin/admin.php:221
+msgid "This file is empty. Please try another."
+msgstr "Diese Datei ist leer."
+
+#: ../admin/admin.php:222
+msgid "This file type is not allowed. Please try another."
+msgstr "Dieser Dateityp ist nicht erlaubt."
+
+#: ../admin/admin.php:223
+msgid "This file is not an image. Please try another."
+msgstr "Diese Datei ist kein Bild. Bitte versuche es mit einer anderen Datei."
+
+#: ../admin/admin.php:224
+msgid "Memory exceeded. Please try another smaller file."
+msgstr "Speicher überschritten. Bitte verkleinere das Bild zuerst"
+
+#: ../admin/admin.php:225
+msgid "This is larger than the maximum size. Please try another."
+msgstr "Die Datei ist zu groß. "
+
+#: ../admin/admin.php:226
+msgid "An error occurred in the upload. Please try again later."
+msgstr "Währende dem upload trat ein Fehler. Bitte verusche es später nochmal."
+
+#: ../admin/admin.php:227
+msgid "There was a configuration error. Please contact the server administrator."
+msgstr "Es besteht ein Konfigurationsfehler."
+
+#: ../admin/admin.php:228
+msgid "You may only upload 1 file."
+msgstr "Du kannst nur ein Bild uploaden."
+
+#: ../admin/admin.php:229
+msgid "HTTP error."
+msgstr "HTTP Fehler."
+
+#: ../admin/admin.php:230
+msgid "Upload failed."
+msgstr "Upload fehlgeschlagen!"
+
+#: ../admin/admin.php:231
+msgid "IO error."
+msgstr "IO Fehler."
+
+#: ../admin/admin.php:232
+msgid "Security error."
+msgstr "Sicherheitsfehler."
+
+#: ../admin/admin.php:233
+msgid "File canceled."
+msgstr "Datei abbgebrochen."
+
+#: ../admin/admin.php:234
+msgid "Upload stopped."
+msgstr "Upload angehalten."
+
+#: ../admin/admin.php:235
+msgid "Dismiss"
+msgstr "Verwerfen"
+
+#: ../admin/admin.php:236
+msgid "Crunching&hellip;"
+msgstr "Bearbeiten&hellip;"
+
+#: ../admin/admin.php:237
+msgid "moved to the trash."
+msgstr "in den Papierkorb geschoben."
+
+#: ../admin/admin.php:238
+#, php-format
+msgid "&#8220;%s&#8221; has failed to upload due to an error"
+msgstr "&#8220;%s&#8221; konnte auf Grund eines Fehler nicht geladen werden."
+
+#: ../admin/admin.php:356
+msgid "<a href=\"http://dpotter.net/Technical/2008/03/nextgen-gallery-review-introduction/\" target=\"_blank\">Introduction</a>"
+msgstr "<a href=\"http://www.curlyrob.de/curlyrob/?page_id=129\" target=\"_blank\">Einführung</a>"
+
+#: ../admin/admin.php:359
+msgid "<a href=\"http://dpotter.net/Technical/2008/03/nextgen-gallery-review-introduction/\" target=\"_blank\">Setup</a>"
+msgstr "<a href=\"http://www.curlyrob.de/curlyrob/?page_id=129\" target=\"_blank\">Setup</a>"
+
+#: ../admin/admin.php:362
+msgid "<a href=\"http://alexrabe.de/wordpress-plugins/nextgen-gallery/languages/\" target=\"_blank\">Translation by alex rabe</a>"
+msgstr "<a href=\"http://alexrabe.de/wordpress-plugins/nextgen-gallery/languages/\" target=\"_blank\">Unterstütze bei der Übersetzung</a>"
+
+#: ../admin/admin.php:365
+msgid "<a href=\"http://dpotter.net/Technical/2008/03/nextgen-gallery-review-introduction/\" target=\"_blank\">Roles / Capabilities</a>"
+msgstr "<a href=\"http://www.curlyrob.de/curlyrob/?page_id=129\" target=\"_blank\">Einführung</a>"
+
+#: ../admin/admin.php:368
+msgid "<a href=\"http://dpotter.net/Technical/2008/03/nextgen-gallery-review-introduction/\" target=\"_blank\">Styles</a>"
+msgstr "<a href=\"http://www.curlyrob.de/curlyrob/?page_id=129\" target=\"_blank\">Einführung</a>"
+
+#: ../admin/admin.php:369
+msgid "Templates"
+msgstr "Vorlagen"
+
+#: ../admin/admin.php:372
+#: ../admin/admin.php:378
+msgid "<a href=\"http://dpotter.net/Technical/2008/03/nextgen-gallery-review-introduction/\" target=\"_blank\">Gallery management</a>"
+msgstr "<a href=\"http://www.curlyrob.de/curlyrob/?page_id=129\" target=\"_blank\">Einführung</a>"
+
+#: ../admin/admin.php:373
+msgid "Gallery example"
+msgstr "Galerie Beispiel"
+
+#: ../admin/admin.php:379
+#: ../admin/admin.php:389
+msgid "Gallery tags"
+msgstr "Galerie Stichwörter"
+
+#: ../admin/admin.php:382
+msgid "<a href=\"http://dpotter.net/Technical/2008/03/nextgen-gallery-review-introduction/\" target=\"_blank\">Album management</a>"
+msgstr "<a href=\"http://www.curlyrob.de/curlyrob/?page_id=129\" target=\"_blank\">Einführung</a>"
+
+#: ../admin/admin.php:383
+msgid "Album example"
+msgstr "Album Beispiel"
+
+#: ../admin/admin.php:384
+#: ../admin/admin.php:390
+msgid "Album tags"
+msgstr "Album Stichwörter"
+
+#: ../admin/admin.php:387
+msgid "<a href=\"http://dpotter.net/Technical/2008/03/nextgen-gallery-review-introduction/\" target=\"_blank\">Gallery tags</a>"
+msgstr "<a href=\"http://www.curlyrob.de/curlyrob/?page_id=129\" target=\"_blank\">Einführung</a>"
+
+#: ../admin/admin.php:388
+msgid "Related images"
+msgstr "Verwandte Bilder"
+
+#: ../admin/admin.php:393
+msgid "<a href=\"http://dpotter.net/Technical/2008/03/nextgen-gallery-review-image-management/\" target=\"_blank\">Image management</a>"
+msgstr "<a href=\"http://dpotter.net/Technical/2008/03/nextgen-gallery-review-image-management/\" target=\"_blank\">Bilderverwaltung (englisch)</a>"
+
+#: ../admin/admin.php:394
+msgid "Custom fields"
+msgstr "Spezialfelder"
+
+#: ../admin/admin.php:399
+msgid "Get help with NextGEN Gallery"
+msgstr "Weitere Hilfe zu NextGEN Gallery"
+
+#: ../admin/admin.php:403
+msgid "More Help & Info"
+msgstr "Weitere Hilfe & Informationen"
+
+#: ../admin/admin.php:405
+msgid "<a href=\"http://wordpress.org/tags/nextgen-gallery?forum_id=10\" target=\"_blank\">Support Forums</a>"
+msgstr "<a href=\"http://wordpress.org/tags/nextgen-gallery?forum_id=10\" target=\"_blank\">Support Forum (englisch)</a>"
+
+#: ../admin/admin.php:406
+msgid "FAQ"
+msgstr "FAQ (englisch)"
+
+#: ../admin/admin.php:407
+msgid "Feature request"
+msgstr "Wünsch Dir was"
+
+#: ../admin/admin.php:408
+msgid "Get your language pack"
+msgstr "Lade Deine Sprachdatei"
+
+#: ../admin/admin.php:409
+msgid "Contribute development"
+msgstr "Bei der Entwicklung helfen"
+
+#: ../admin/admin.php:410
+msgid "Download latest version"
+msgstr "Aktuelle Version downloaden"
+
+#: ../admin/ajax.php:312
+msgid "You are not allowed to be here"
+msgstr "Keine Zugangsberechtigung"
+
+#: ../admin/ajax.php:410
+#, php-format
+msgid "Could create image with %s x %s pixel"
+msgstr "Konnte ein Bild mit %s x %s Pixel erstellen"
+
+#: ../admin/album.php:102
+#: ../admin/album.php:117
+#: ../admin/album.php:158
+msgid "Update Successfully"
+msgstr "Update erfolgreich"
+
+#: ../admin/album.php:131
+msgid "Album deleted"
+msgstr "Album gelöscht"
+
+#: ../admin/album.php:269
+msgid "Edit Album"
+msgstr "Album erstellen"
+
+#: ../admin/album.php:278
+msgid "Manage Albums"
+msgstr "Verwalte Alben"
+
+#: ../admin/album.php:284
+#: ../admin/album.php:333
+msgid "Select album"
+msgstr "Wähle Album"
+
+#: ../admin/album.php:286
+msgid "No album selected"
+msgstr "Kein Album ausgewählt"
+
+#: ../admin/album.php:297
+#: ../admin/edit-thumbnail.php:155
+msgid "Update"
+msgstr "Aktualisiere"
+
+#: ../admin/album.php:299
+msgid "Edit album"
+msgstr "Album ändern"
+
+#: ../admin/album.php:302
+#: ../admin/manage-galleries.php:146
+#: ../admin/manage-images.php:448
+msgid "Delete"
+msgstr "Lösche"
+
+#: ../admin/album.php:306
+msgid "Add new album"
+msgstr "Album hinzufügen"
+
+#: ../admin/album.php:308
+msgid "Add"
+msgstr "Hinzufügen"
+
+#: ../admin/album.php:319
+msgid "Show / hide used galleries"
+msgstr "Zeige / Verstecke verwendete Galerien"
+
+#: ../admin/album.php:319
+msgid "[Show all]"
+msgstr "[Alle zeigen]"
+
+#: ../admin/album.php:320
+msgid "Maximize the widget content"
+msgstr "Maximiere die Widgets"
+
+#: ../admin/album.php:320
+msgid "[Maximize]"
+msgstr "[Vergrößern]"
+
+#: ../admin/album.php:321
+msgid "Minimize the widget content"
+msgstr "Minimiere die Widgets"
+
+#: ../admin/album.php:321
+msgid "[Minimize]"
+msgstr "[Verkleinern]"
+
+#: ../admin/album.php:323
+msgid "After you create and select a album, you can drag and drop a gallery or another album into your new album below"
+msgstr "Nachdem Du ein Album erstellt und ausgewählt hast, kannst Du per Drag & Drop eine Galerie oder ein anderes Album in das neue Album ziehen"
+
+#: ../admin/album.php:349
+msgid "Select gallery"
+msgstr "Wähle Galerie"
+
+#: ../admin/album.php:378
+msgid "Album ID"
+msgstr "Album ID"
+
+#: ../admin/album.php:391
+msgid "No album selected!"
+msgstr "Kein Album ausgewählt"
+
+#: ../admin/album.php:411
+msgid "Album name:"
+msgstr "Album Name :"
+
+#: ../admin/album.php:417
+msgid "Album description:"
+msgstr "Beschreibung:"
+
+#: ../admin/album.php:423
+msgid "Select a preview image:"
+msgstr "Wähle Vorschaubild:"
+
+#: ../admin/album.php:426
+#: ../admin/album.php:429
+msgid "No picture"
+msgstr "Kein Bild"
+
+#: ../admin/album.php:440
+#: ../admin/manage-images.php:257
+msgid "Page Link to"
+msgstr "Seite verlinkt zu"
+
+#: ../admin/album.php:442
+#: ../admin/manage-images.php:260
+msgid "Not linked"
+msgstr "Nicht verlinkt"
+
+#: ../admin/album.php:455
+#: ../admin/manage-galleries.php:288
+#: ../admin/manage-galleries.php:317
+#: ../admin/manage-galleries.php:347
+#: ../admin/manage-images.php:533
+#: ../admin/manage-images.php:569
+#: ../admin/manage-images.php:598
+#: ../admin/manage-images.php:628
+msgid "OK"
+msgstr "OK"
+
+#: ../admin/album.php:457
+#: ../admin/manage-galleries.php:290
+#: ../admin/manage-galleries.php:319
+#: ../admin/manage-galleries.php:349
+#: ../admin/manage-images.php:535
+#: ../admin/manage-images.php:571
+#: ../admin/manage-images.php:600
+#: ../admin/manage-images.php:630
+msgid "Cancel"
+msgstr "Abbrechen"
+
+#: ../admin/album.php:543
+msgid "Name"
+msgstr "Name"
+
+#: ../admin/album.php:544
+#: ../admin/manage-images.php:255
+msgid "Title"
+msgstr "Titel"
+
+#: ../admin/album.php:545
+msgid "Page"
+msgstr "Seite"
+
+#: ../admin/edit-thumbnail.php:105
+msgid "Select with the mouse the area for the new thumbnail"
+msgstr "Wähle mit der Maus den Bereich für das neue Thumbnail"
+
+#: ../admin/edit-thumbnail.php:119
+msgid "Thumbnail updated"
+msgstr "Thumbnail geändert"
+
+#: ../admin/edit-thumbnail.php:124
+msgid "Error updating thumbnail"
+msgstr "Konnte Vorschaubild nicht erzeugen"
+
+#: ../admin/edit-thumbnail.php:140
+msgid "Select the area for the thumbnail from the picture on the left."
+msgstr "Wähle den Ausschnitt für das Vorschaubild innerhalb des Bildes"
+
+#: ../admin/functions.php:39
+msgid "No valid gallery name!"
+msgstr "Kein gültiger Galerie-Name!"
+
+#: ../admin/functions.php:46
+#: ../admin/functions.php:55
+#: ../admin/functions.php:80
+#: ../admin/functions.php:149
+#: ../admin/functions.php:157
+msgid "Directory"
+msgstr "Verzeichnis"
+
+#: ../admin/functions.php:46
+msgid "didn't exist. Please create first the main gallery folder "
+msgstr "nicht gefunden. Bitte erstelle zuerst das Hauptverzeichnis."
+
+#: ../admin/functions.php:47
+#: ../admin/functions.php:56
+msgid "Check this link, if you didn't know how to set the permission :"
+msgstr "Dieser Link zeigt Dir, wie man Verzeichnisrechte ändert :"
+
+#: ../admin/functions.php:55
+#: ../admin/functions.php:80
+msgid "is not writeable !"
+msgstr "ist schreibgeschützt !"
+
+#: ../admin/functions.php:76
+#: ../admin/functions.php:85
+#: ../admin/functions.php:902
+msgid "Unable to create directory "
+msgstr "Kann Verzeichnis nicht erstellen "
+
+#: ../admin/functions.php:89
+msgid "The server setting Safe-Mode is on !"
+msgstr "Auf dem Server ist Safe-Mode aktiviert (PHP.INI)"
+
+#: ../admin/functions.php:90
+msgid "If you have problems, please create directory"
+msgstr "Wenn Probleme auftreten, erstelle bitte das Verzeichnis"
+
+#: ../admin/functions.php:91
+msgid "and the thumbnails directory"
+msgstr "und das Thumbnails-Verzeichnis"
+
+#: ../admin/functions.php:91
+msgid "with permission 777 manually !"
+msgstr "mit den Berechtigungen 777 manuell !"
+
+#: ../admin/functions.php:116
+#, php-format
+msgid "Gallery ID %1$s successfully created. You can show this gallery in your post or page with the shortcode %2$s.<br/>"
+msgstr "Galerie ID %1$s erstellt..<br/>Du kannst diese Galerie jetzt mit dem Stichwort %2$s in einen Artikel einbinden.<br/>"
+
+#: ../admin/functions.php:119
+#: ../admin/functions.php:217
+msgid "Edit gallery"
+msgstr "Galerie ändern"
+
+#: ../admin/functions.php:149
+msgid "doesn&#96;t exist!"
+msgstr "gibt es nicht !"
+
+#: ../admin/functions.php:157
+msgid "contains no pictures"
+msgstr "enthält keine Bilder"
+
+#: ../admin/functions.php:175
+msgid "Database error. Could not add gallery!"
+msgstr "Datenbank-Fehler. Kann Galerie nicht hinzufügen!"
+
+#: ../admin/functions.php:178
+msgid "successfully created!"
+msgstr "erfolgreich erstellt!"
+
+#: ../admin/functions.php:212
+#: ../admin/functions.php:1019
+#: ../admin/manage-galleries.php:81
+#: ../admin/manage-galleries.php:148
+#: ../admin/manage-images.php:203
+#: ../admin/manage-images.php:342
+#: ../admin/manage.php:223
+#: ../admin/manage.php:299
+msgid "Create new thumbnails"
+msgstr "Neue Vorschaubilder erstellen"
+
+#: ../admin/functions.php:215
+msgid " picture(s) successfully added"
+msgstr " Bild(er) erfolgreich hinzugefügt"
+
+#: ../admin/functions.php:270
+#: ../admin/functions.php:350
+#: ../admin/functions.php:405
+#: ../admin/functions.php:502
+#: ../admin/functions.php:556
+msgid "Object didn't contain correct data"
+msgstr "Das Objekt enhält nicht die notwendigen Daten"
+
+#: ../admin/functions.php:278
+msgid " is not writeable "
+msgstr "ist schreibgeschützt !"
+
+#: ../admin/functions.php:360
+#: ../admin/functions.php:408
+#: ../admin/functions.php:508
+#: ../admin/functions.php:559
+msgid " is not writeable"
+msgstr "ist schreibgeschützt !"
+
+#: ../admin/functions.php:562
+msgid "File do not exists"
+msgstr "Datei existiert nicht"
+
+#: ../admin/functions.php:566
+msgid "Couldn't restore original image"
+msgstr "Konnte Originalbild nicht wiederherstellen"
+
+#: ../admin/functions.php:682
+msgid "(Error : Couldn't not update data base)"
+msgstr "(Fehler : Konnte Datenbank nicht aktualisieren)"
+
+#: ../admin/functions.php:689
+msgid "(Error : Couldn't not update meta data)"
+msgstr "(Fehler : Konnte Metadaten nicht speichern)"
+
+#: ../admin/functions.php:698
+msgid "(Error : Couldn't not find image)"
+msgstr "(Fehler : Konnte das Bild nicht finden)"
+
+#: ../admin/functions.php:836
+msgid "No valid URL path "
+msgstr "Kein gültiger URL-Pfad"
+
+#: ../admin/functions.php:852
+msgid "Import via cURL failed."
+msgstr "Import via cURL abgebrochen"
+
+#: ../admin/functions.php:869
+msgid "Uploaded file was no or a faulty zip file ! The server recognized : "
+msgstr "Die hochgeladene Datei war keine korrekte Zip-Datei. Servermeldung :"
+
+#: ../admin/functions.php:886
+msgid "Could not get a valid foldername"
+msgstr "Konnte keinen gültigen Verzeichnisnamen finden"
+
+#: ../admin/functions.php:897
+#, php-format
+msgid "Unable to create directory %s. Is its parent directory writable by the server?"
+msgstr "Kann das Verzeichnis %s nicht erstellen. Ist das Hauptverzeichnis vielleicht schreibgeschützt ?"
+
+#: ../admin/functions.php:912
+msgid "Zip-File successfully unpacked"
+msgstr "Zip-Datei erfolgreich entpackt"
+
+#: ../admin/functions.php:951
+#: ../admin/functions.php:1068
+msgid "Failure in database, no gallery path set !"
+msgstr "Datenbankfehler! Kein Galerie-Pfad gesetzt !"
+
+#: ../admin/functions.php:975
+#: ../admin/functions.php:1062
+msgid "is no valid image file!"
+msgstr "ist keine zulässige Bilddatei !"
+
+#: ../admin/functions.php:989
+#: ../admin/functions.php:1187
+#: ../admin/functions.php:1264
+#, php-format
+msgid "Unable to write to directory %s. Is this directory writable by the server?"
+msgstr "Kann das Verzeichnis %s nicht erstellen. Ist das Hauptverzeichnis vielleicht schreibgeschützt ?"
+
+#: ../admin/functions.php:996
+#: ../admin/functions.php:1085
+msgid "Error, the file could not be moved to : "
+msgstr "Fehler: Diese Datei kann nicht verschoben werden zu :"
+
+#: ../admin/functions.php:1001
+#: ../admin/functions.php:1089
+msgid "Error, the file permissions could not be set"
+msgstr "Fehler: Die Berechtigungen für diese Datei können nicht gesetzt werden"
+
+#: ../admin/functions.php:1024
+msgid " Image(s) successfully added"
+msgstr " Bild(er) erfolgreich hinzugefügt"
+
+#: ../admin/functions.php:1051
+msgid "Invalid upload. Error Code : "
+msgstr "Ungültiger Upload. Fehler Code :"
+
+#: ../admin/functions.php:1127
+#, php-format
+msgid "SAFE MODE Restriction in effect! You need to create the folder <strong>%s</strong> manually"
+msgstr "SAFE MODE Einschränkungen ist aktiv. Du musst das Verzeichnis <strong>%s</strong> manuell anlegen."
+
+#: ../admin/functions.php:1128
+#, php-format
+msgid "When safe_mode is on, PHP checks to see if the owner (%s) of the current script matches the owner (%s) of the file to be operated on by a file function or its directory"
+msgstr "Wenn der Safe-Mode eingeschaltet ist, überprüft PHP, ob der Besitzer (%s) des Skript mit dem Besitzer (%s) der Datei/Verzeichnis übereinstimmt."
+
+#: ../admin/functions.php:1181
+#: ../admin/functions.php:1258
+msgid "The destination gallery does not exist"
+msgstr "Die ausgewählte Galerie existiert nicht"
+
+#: ../admin/functions.php:1212
+#, php-format
+msgid "Failed to move image %1$s to %2$s"
+msgstr "Konnte das Bild %1$s nicht nach %2$s verschieben"
+
+#: ../admin/functions.php:1232
+#, php-format
+msgid "Moved %1$s picture(s) to gallery : %2$s ."
+msgstr " %1$s Bild(er) in Galerie : %2$s verschoben."
+
+#: ../admin/functions.php:1291
+#, php-format
+msgid "Failed to copy image %1$s to %2$s"
+msgstr "Konnte das Bild %1$s nicht nach %2$s kopieren"
+
+#: ../admin/functions.php:1305
+#, php-format
+msgid "Failed to copy database row for picture %s"
+msgstr "Fehler bei der Datenbank-Operation für Bild %s"
+
+#: ../admin/functions.php:1317
+#, php-format
+msgid "Image %1$s (%2$s) copied as image %3$s (%4$s) &raquo; The file already existed in the destination gallery."
+msgstr "Bild %1$s (%2$s) als Bild %3$s (%4$s) kopiert &raquo; Die Datei existierte bereits."
+
+#: ../admin/functions.php:1320
+#, php-format
+msgid "Image %1$s (%2$s) copied as image %3$s (%4$s)"
+msgstr "Bild %1$s (%2$s) kopiert als Bild %3$s (%4$s)"
+
+#: ../admin/functions.php:1329
+#, php-format
+msgid "Copied %1$s picture(s) to gallery: %2$s ."
+msgstr "Kopiere %1$s Bild(er) in die Galerie : %2$s ."
+
+#: ../admin/functions.php:1437
+msgid "The uploaded file exceeds the upload_max_filesize directive in php.ini"
+msgstr "Die Datei überschreitet die erlaubte Grösse (upload_max_filesize) in der php.ini"
+
+#: ../admin/functions.php:1440
+msgid "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form"
+msgstr "Die Datei ist zu gross"
+
+#: ../admin/functions.php:1443
+msgid "The uploaded file was only partially uploaded"
+msgstr "Die Datei wurde nur teilweise hochgeladen"
+
+#: ../admin/functions.php:1446
+msgid "No file was uploaded"
+msgstr "Keinen Datei wurde geladen"
+
+#: ../admin/functions.php:1449
+msgid "Missing a temporary folder"
+msgstr "Konnte temporäres Verzeichnis nicht finden"
+
+#: ../admin/functions.php:1452
+msgid "Failed to write file to disk"
+msgstr "Konnte Datei nicht speichern"
+
+#: ../admin/functions.php:1455
+msgid "File upload stopped by extension"
+msgstr "Upload dieser Dateierweiterung nicht erlaubt"
+
+#: ../admin/functions.php:1458
+msgid "Unknown upload error"
+msgstr "Unbekannter Uploadfehler"
+
+#: ../admin/install.php:23
+msgid "Sorry, NextGEN Gallery works only with a role called administrator"
+msgstr "Tut mir leid, aber NextGEN Gallery benötigt zwingend die Rolle \"Administrator\""
+
+#: ../admin/install.php:112
+msgid "NextGEN Gallery : Tables could not created, please check your database settings"
+msgstr "NextGEN Gallery : Tabellen konnten nicht erstellt werden, überprüfe Deine Datenbank"
+
+#: ../admin/install.php:170
+msgid "[Show as slideshow]"
+msgstr "[Zeige als Diashow]"
+
+#: ../admin/install.php:171
+msgid "[Show picture list]"
+msgstr "[Zeige Bilder-Liste]"
+
+#: ../admin/manage-galleries.php:69
+#: ../admin/manage-images.php:171
+msgid "No images selected"
+msgstr "Keine Bilder ausgewählt"
+
+#: ../admin/manage-galleries.php:77
+#: ../admin/manage-galleries.php:149
+#: ../admin/manage-images.php:199
+#: ../admin/manage-images.php:343
+#: ../admin/manage.php:207
+#: ../admin/manage.php:285
+msgid "Resize images"
+msgstr "Bilder verkleinern"
+
+#: ../admin/manage-galleries.php:86
+#, php-format
+msgid ""
+"You are about to start the bulk edit for %s galleries \n"
+" \n"
+" 'Cancel' to stop, 'OK' to proceed."
+msgstr ""
+"Du startest die Bearbeitung von %s Galerien \n"
+" \n"
+" 'Abbrechen' um zu stoppen, 'OK' um die Bearbeitung durchzuführen."
+
+#: ../admin/manage-galleries.php:130
+#: ../admin/manage-galleries.php:133
+#: ../admin/manage-images.php:225
+#: ../admin/manage-images.php:228
+msgid "Search Images"
+msgstr "Suche Bilder"
+
+#: ../admin/manage-galleries.php:145
+#: ../admin/manage-images.php:340
+msgid "Bulk actions"
+msgstr "Aktion wählen"
+
+#: ../admin/manage-galleries.php:147
+#: ../admin/manage-images.php:341
+#: ../admin/manage.php:140
+#: ../admin/manage.php:249
+msgid "Set watermark"
+msgstr "Wasserzeichen setzen"
+
+#: ../admin/manage-galleries.php:150
+#: ../admin/manage-images.php:346
+#: ../admin/manage.php:145
+#: ../admin/manage.php:269
+msgid "Import metadata"
+msgstr "Metadaten importieren"
+
+#: ../admin/manage-galleries.php:151
+#: ../admin/manage-images.php:344
+#: ../admin/manage.php:135
+#: ../admin/manage.php:246
+msgid "Recover from backup"
+msgstr "Original wiederherstellen"
+
+#: ../admin/manage-galleries.php:153
+#: ../admin/manage-images.php:355
+msgid "Apply"
+msgstr "Übernehmen"
+
+#: ../admin/manage-galleries.php:220
+msgid "Edit"
+msgstr "Bearbeiten"
+
+#: ../admin/manage-galleries.php:261
+#: ../admin/manage-images.php:506
+msgid "No entries found"
+msgstr "Keine Einträge gefunden"
+
+#: ../admin/manage-galleries.php:308
+#: ../admin/manage-images.php:589
+msgid "Resize Images to"
+msgstr "Verkleinere Bilder auf"
+
+#: ../admin/manage-galleries.php:312
+#: ../admin/manage-images.php:593
+msgid "Width x height (in pixel). NextGEN Gallery will keep ratio size"
+msgstr "Breite x Höhe (in Pixel). Das Seitenverhältnis wird berücksichtigt."
+
+#: ../admin/manage-galleries.php:336
+#: ../admin/manage-images.php:617
+msgid "Width x height (in pixel)"
+msgstr "Breite x Höhe (in Pixel)"
+
+#: ../admin/manage-galleries.php:338
+#: ../admin/manage-images.php:619
+msgid "These values are maximum values "
+msgstr "Diese Angaben sind maximale Angaben."
+
+#: ../admin/manage-galleries.php:341
+#: ../admin/manage-images.php:622
+msgid "Set fix dimension"
+msgstr "Setze feste Größe"
+
+#: ../admin/manage-galleries.php:343
+#: ../admin/manage-images.php:624
+msgid "Ignore the aspect ratio, no portrait thumbnails"
+msgstr "Ignoriere Bildseitenverhältnis"
+
+#: ../admin/manage-galleries.php:406
+#: ../admin/manage-images.php:694
+msgid "ID"
+msgstr "ID"
+
+#: ../admin/manage-galleries.php:408
+#: ../admin/manage-images.php:266
+#: ../admin/manage-images.php:697
+msgid "Description"
+msgstr "Beschreibung"
+
+#: ../admin/manage-galleries.php:409
+#: ../admin/manage-images.php:295
+msgid "Author"
+msgstr "Autor"
+
+#: ../admin/manage-galleries.php:410
+msgid "Page ID"
+msgstr "Seiten-ID"
+
+#: ../admin/manage-galleries.php:411
+msgid "Image"
+msgid_plural "Images"
+msgstr[0] "Bild"
+msgstr[1] "Bilder"
+
+#: ../admin/manage-images.php:34
+msgid "Gallery not found."
+msgstr "Galerie nicht gefunden"
+
+#: ../admin/manage-images.php:40
+msgid "Sorry, you have no access here"
+msgstr "Sorry, Du hast nicht genügend Rechte"
+
+#: ../admin/manage-images.php:179
+msgid "Copy image to..."
+msgstr "Kopiere nach..."
+
+#: ../admin/manage-images.php:183
+msgid "Move image to..."
+msgstr "Verschiebe nach..."
+
+#: ../admin/manage-images.php:187
+msgid "Add new tags"
+msgstr "Stichwörter hinzufügen"
+
+#: ../admin/manage-images.php:191
+#: ../admin/manage-images.php:352
+msgid "Delete tags"
+msgstr "Stichwörter löschen"
+
+#: ../admin/manage-images.php:195
+msgid "Overwrite"
+msgstr "Überschreiben"
+
+#: ../admin/manage-images.php:208
+#, php-format
+msgid ""
+"You are about to start the bulk edit for %s images \n"
+" \n"
+" 'Cancel' to stop, 'OK' to proceed."
+msgstr ""
+"Du startest die Bearbeitung von %s Bildern \n"
+" \n"
+" 'Abbrechen' um zu stoppen, 'OK' um die Bearbeitung durchzuführen."
+
+#: ../admin/manage-images.php:222
+#, php-format
+msgid "Search results for &#8220;%s&#8221;"
+msgstr "Suchergebinsse für &#8220;%s&#8221;"
+
+#: ../admin/manage-images.php:251
+msgid "Gallery settings"
+msgstr "Galerie Einstellungen"
+
+#: ../admin/manage-images.php:251
+msgid "Click here for more settings"
+msgstr "Hier klicken für weitere Einstellungen"
+
+#: ../admin/manage-images.php:268
+msgid "Preview image"
+msgstr "Vorschau-Bild"
+
+#: ../admin/manage-images.php:271
+msgid "No Picture"
+msgstr "Kein Bild"
+
+#: ../admin/manage-images.php:293
+msgid "Path"
+msgstr "Pfad"
+
+#: ../admin/manage-images.php:310
+msgid "Create new page"
+msgstr "Neue Seite erstellen"
+
+#: ../admin/manage-images.php:313
+msgid "Main page (No parent)"
+msgstr "Hauptseite (keine Unterseite)"
+
+#: ../admin/manage-images.php:316
+msgid "Add page"
+msgstr "Seite hinzufügen"
+
+#: ../admin/manage-images.php:325
+msgid "Scan Folder for new images"
+msgstr "Überprüfe Verzeichnis nach neuen Bildern"
+
+#: ../admin/manage-images.php:326
+#: ../admin/manage-images.php:361
+#: ../admin/manage-images.php:513
+msgid "Save Changes"
+msgstr "Änderungen speichern"
+
+#: ../admin/manage-images.php:345
+msgid "Delete images"
+msgstr "Bilder löschen"
+
+#: ../admin/manage-images.php:347
+msgid "Rotate images clockwise"
+msgstr "Rechts drehen"
+
+#: ../admin/manage-images.php:348
+msgid "Rotate images counter-clockwise"
+msgstr "Links drehen"
+
+#: ../admin/manage-images.php:349
+msgid "Copy to..."
+msgstr "Kopiere nach..."
+
+#: ../admin/manage-images.php:350
+msgid "Move to..."
+msgstr "Verschiebe nach..."
+
+#: ../admin/manage-images.php:351
+msgid "Add tags"
+msgstr "Stichwörter hinzufügen"
+
+#: ../admin/manage-images.php:353
+msgid "Overwrite tags"
+msgstr "Stichwörter überschreiben"
+
+#: ../admin/manage-images.php:358
+msgid "Sort gallery"
+msgstr "Sortiere Bilder"
+
+#: ../admin/manage-images.php:434
+msgid "pixel"
+msgstr "pixel"
+
+#: ../admin/manage-images.php:440
+#, php-format
+msgid "View \"%s\""
+msgstr "Anzeigen \"%s\""
+
+#: ../admin/manage-images.php:440
+msgid "View"
+msgstr "Ansehen"
+
+#: ../admin/manage-images.php:441
+msgid "Show Meta data"
+msgstr "Zeige Metadaten"
+
+#: ../admin/manage-images.php:441
+msgid "Meta"
+msgstr "Meta"
+
+#: ../admin/manage-images.php:442
+msgid "Customize thumbnail"
+msgstr "Thumbnails anpassen"
+
+#: ../admin/manage-images.php:442
+msgid "Edit thumb"
+msgstr "Thumbnail ändern"
+
+#: ../admin/manage-images.php:443
+msgid "Rotate"
+msgstr "Drehen"
+
+#: ../admin/manage-images.php:445
+msgid "Publish this image"
+msgstr "Bild veröffentlichen"
+
+#: ../admin/manage-images.php:445
+msgid "Publish"
+msgstr "Veröffentlichen"
+
+#: ../admin/manage-images.php:447
+msgid "Recover"
+msgstr "Rücksetzen"
+
+#: ../admin/manage-images.php:447
+#, php-format
+msgid "Recover \"%s\" ?"
+msgstr " \"%s\" wiederherstellen ?"
+
+#: ../admin/manage-images.php:448
+#, php-format
+msgid "Delete \"%s\" ?"
+msgstr "Lösche \"%s\" ?"
+
+#: ../admin/manage-images.php:529
+msgid "Enter the tags"
+msgstr "Stichwörter angeben"
+
+#: ../admin/manage-images.php:553
+msgid "Select the destination gallery:"
+msgstr "Galerie auswählen:"
+
+#: ../admin/manage-images.php:695
+msgid "Thumbnail"
+msgstr "Thumbnail"
+
+#: ../admin/manage-images.php:696
+#: ../admin/manage-sort.php:77
+msgid "Filename"
+msgstr "Dateiname"
+
+#: ../admin/manage-images.php:697
+msgid "Alt &amp; Title Text"
+msgstr "Alt &amp; Titel Text"
+
+#: ../admin/manage-images.php:698
+msgid "Tags (comma separated list)"
+msgstr "Stichwörter (Tags)"
+
+#: ../admin/manage-images.php:699
+msgid "exclude"
+msgstr "ausschließen"
+
+#: ../admin/manage-sort.php:33
+msgid "Sort order changed"
+msgstr "Reihenfolge aktualisiert"
+
+#: ../admin/manage-sort.php:62
+msgid "Sort Gallery"
+msgstr "Sortiere Bilder"
+
+#: ../admin/manage-sort.php:66
+msgid "Update Sort Order"
+msgstr "Sortierung speichern"
+
+#: ../admin/manage-sort.php:69
+msgid "Back to gallery"
+msgstr "Zurueck zur Galerie"
+
+#: ../admin/manage-sort.php:74
+msgid "Presort"
+msgstr "Vorsortieren"
+
+#: ../admin/manage-sort.php:75
+msgid "Unsorted"
+msgstr "Unsortiert"
+
+#: ../admin/manage-sort.php:76
+msgid "Image ID"
+msgstr "Bilder ID"
+
+#: ../admin/manage-sort.php:78
+msgid "Alt/Title text"
+msgstr "Alt / Titel Text"
+
+#: ../admin/manage-sort.php:79
+msgid "Date/Time"
+msgstr "Datum/Zeit"
+
+#: ../admin/manage-sort.php:80
+msgid "Ascending"
+msgstr "Aufsteigend"
+
+#: ../admin/manage-sort.php:81
+msgid "Descending"
+msgstr "Absteigend"
+
+#: ../admin/manage.php:84
+msgid "Picture"
+msgstr "Bild"
+
+#: ../admin/manage.php:84
+msgid "deleted successfully"
+msgstr "erfolgreich gelöscht"
+
+#: ../admin/manage.php:99
+#: ../admin/manage.php:108
+msgid "Operation successful. Please clear your browser cache."
+msgstr "Thumbnails erfolgreich erstellt. Bitte Browser-Cache löschen."
+
+#: ../admin/manage.php:175
+msgid "Gallery deleted successfully "
+msgstr "Galerie gelöscht"
+
+#: ../admin/manage.php:240
+#: ../admin/manage.php:243
+msgid "Rotate images"
+msgstr "Bild drehen"
+
+#: ../admin/manage.php:265
+msgid "Pictures deleted successfully "
+msgstr "Bilder erfolgreich gelöscht"
+
+#: ../admin/manage.php:361
+msgid "Tags changed"
+msgstr "Stichwörter geändert"
+
+#: ../admin/manage.php:397
+msgid "Update successful"
+msgstr "Aktualisierung erfolgreich"
+
+#: ../admin/manage.php:432
+msgid "New gallery page ID"
+msgstr "Neue Galerie Seiten ID"
+
+#: ../admin/manage.php:432
+msgid "created"
+msgstr "erstellt"
+
+#: ../admin/manage.php:468
+msgid "Published a new post"
+msgstr "Veröffentliche einen neuen Beitrag"
+
+#: ../admin/manage.php:582
+#, php-format
+msgid "1 item"
+msgid_plural "%s items"
+msgstr[0] "1 Element"
+msgstr[1] "%s Elemente"
+
+#: ../admin/media-upload.php:11
+msgid "NextGEN Gallery"
+msgstr "NextGEN Gallery"
+
+#: ../admin/media-upload.php:166
+msgid "No gallery"
+msgstr "Keine Galerie"
+
+#: ../admin/media-upload.php:178
+msgid "Select &#187;"
+msgstr "Wähle &#187;"
+
+#: ../admin/media-upload.php:209
+msgid "Show"
+msgstr "Zeige"
+
+#: ../admin/media-upload.php:210
+msgid "Hide"
+msgstr "Verstecke"
+
+#: ../admin/media-upload.php:215
+msgid "Image ID:"
+msgstr "Bild ID:"
+
+#: ../admin/media-upload.php:229
+#: ../admin/publish.php:55
+msgid "Alignment"
+msgstr "Ausrichtung"
+
+#: ../admin/media-upload.php:232
+#: ../admin/publish.php:57
+#: ../admin/settings.php:480
+msgid "None"
+msgstr "Keiner"
+
+#: ../admin/media-upload.php:234
+#: ../admin/publish.php:59
+#: ../admin/tinymce/window.php:120
+msgid "Left"
+msgstr "Links"
+
+#: ../admin/media-upload.php:236
+#: ../admin/publish.php:61
+#: ../admin/tinymce/window.php:121
+msgid "Center"
+msgstr "Zentrieren"
+
+#: ../admin/media-upload.php:238
+#: ../admin/publish.php:63
+#: ../admin/tinymce/window.php:122
+msgid "Right"
+msgstr "Rechts"
+
+#: ../admin/media-upload.php:242
+#: ../admin/settings.php:587
+msgid "Size"
+msgstr "Größe"
+
+#: ../admin/media-upload.php:248
+msgid "Full size"
+msgstr "Volle Größe"
+
+#: ../admin/media-upload.php:250
+msgid "Singlepic"
+msgstr "Einzelbilder"
+
+#: ../admin/media-upload.php:263
+msgid "Insert into Post"
+msgstr "In den Beitrag einfügen"
+
+#: ../admin/media-upload.php:274
+msgid "Save all changes"
+msgstr "Änderungen speichern"
+
+#: ../admin/overview.php:14
+msgid "NextGEN Gallery Overview"
+msgstr "NextGEN Gallery Übersicht"
+
+#: ../admin/overview.php:86
+msgid "Welcome to NextGEN Gallery !"
+msgstr "Willkomen bei NextGEN Gallery"
+
+#: ../admin/overview.php:87
+msgid "Do you like this Plugin?"
+msgstr "Bist Du mit dem Plugin zufrieden ?"
+
+#: ../admin/overview.php:89
+msgid "Translation"
+msgstr "Übersetzung"
+
+#: ../admin/overview.php:90
+msgid "Latest News"
+msgstr "Letzte Informationen"
+
+#: ../admin/overview.php:91
+msgid "Recent donators"
+msgstr "Neueste Spender"
+
+#: ../admin/overview.php:93
+msgid "Plugin Check"
+msgstr "Plugin prüfen"
+
+#: ../admin/overview.php:94
+msgid "Server Settings"
+msgstr "Server- Einstellungen"
+
+#: ../admin/overview.php:95
+msgid "Related plugins"
+msgstr "Verwandte Plugins"
+
+#: ../admin/overview.php:101
+#, php-format
+msgid "This plugin is primarily developed, maintained, supported and documented by <a href=\"%s\">Alex Rabe</a> with a lot of love & effort. Any kind of contribution would be highly appreciated. Thanks!"
+msgstr "Dieses Plugin wird mit viel Mühe & Leidenschaft entwickelt, dokumentiert und supported von <a href=\"%s\">Alex Rabe</a>. Vielleicht möchtest Du dich ja dankbar zeigen. "
+
+#: ../admin/overview.php:106
+msgid "Give it a good rating on WordPress.org."
+msgstr "Bitte bewerte das Plugin bei WordPress.org."
+
+#: ../admin/overview.php:111
+msgid "Donate the work via paypal."
+msgstr "Zeig Dich für diese Arbeit per PayPal dankbar"
+
+#: ../admin/overview.php:116
+msgid "Help translating it."
+msgstr "Hilf das Plugin zu übersetzen."
+
+#: ../admin/overview.php:252
+msgid "Running..."
+msgstr "Läuft... Bitte warten"
+
+#: ../admin/overview.php:299
+msgid "Check plugin/theme conflict"
+msgstr "Plugin/Theme Konflikt prüfen"
+
+#: ../admin/overview.php:300
+#: ../admin/overview.php:306
+#: ../admin/overview.php:312
+msgid "Not tested"
+msgstr "Nicht getested"
+
+#: ../admin/overview.php:301
+msgid "No conflict could be detected"
+msgstr "Es konnte kein Konflikt festgestellt werden"
+
+#: ../admin/overview.php:302
+msgid "Test failed, disable other plugins & switch to default theme"
+msgstr "Test fehlgeschlagen, deaktiviere andere Plugins & aktiviere das Default Theme"
+
+#: ../admin/overview.php:305
+msgid "Test image function"
+msgstr "Teste Bildbearbeitung"
+
+#: ../admin/overview.php:307
+msgid "The plugin could create images"
+msgstr "Es konnte ein Bild erstellt werden"
+
+#: ../admin/overview.php:308
+msgid "Couldn't create image, check your memory limit"
+msgstr "Konnte kein Bild erzeugen, überprüfe dein Speicherlimit (Server)"
+
+#: ../admin/overview.php:311
+msgid "Check theme compatibility"
+msgstr "Theme Kompatibilität prüfen"
+
+#: ../admin/overview.php:313
+msgid "Your theme should work fine with NextGEN Gallery"
+msgstr "Dein Theme sollte mit NextGEN Gallery funktionieren"
+
+#: ../admin/overview.php:314
+msgid "wp_head()/wp_footer() is missing, contact the theme author"
+msgstr "wp_head()/wp_footer() wurde nicht gefunden, kontaktiere den Theme Author"
+
+#: ../admin/overview.php:318
+msgid "Check plugin"
+msgstr "Plugin prüfen"
+
+#: ../admin/overview.php:339
+msgid "Graphic Library"
+msgstr "Grafik-Bibliothek"
+
+#: ../admin/overview.php:355
+#: ../admin/overview.php:404
+#: ../admin/overview.php:591
+#: ../admin/overview.php:781
+msgid "Loading&#8230;"
+msgstr "Lade&#8230;"
+
+#: ../admin/overview.php:355
+#: ../admin/overview.php:404
+#: ../admin/overview.php:591
+#: ../admin/overview.php:781
+msgid "This widget requires JavaScript."
+msgstr "Dieses Widget braucht JavaScript."
+
+#: ../admin/overview.php:368
+msgid "Thanks to all donators..."
+msgstr "Danke an alle Spender..."
+
+#: ../admin/overview.php:390
+msgid "View all"
+msgstr "Alle ansehen"
+
+#: ../admin/overview.php:416
+#, php-format
+msgid "Newsfeed could not be loaded.  Check the <a href=\"%s\">front page</a> to check for updates."
+msgstr "Der Newsfeed kann nicht geladen werden. Schaue auf die <a href=\"%s\">Hauptseite</a>, um Updates mitzubekommen."
+
+#: ../admin/overview.php:428
+msgid "Untitled"
+msgstr "Kein Titel"
+
+#: ../admin/overview.php:478
+msgid "At a Glance"
+msgstr "Übersicht"
+
+#: ../admin/overview.php:504
+msgid "Upload pictures"
+msgstr "Bilder hochladen"
+
+#: ../admin/overview.php:505
+msgid "Here you can control your images, galleries and albums."
+msgstr "Hier kannst Du die  Bilder, Galerien und Alben verwalten."
+
+#: ../admin/overview.php:535
+msgid "Storage Space"
+msgstr "Speicherplatz"
+
+#: ../admin/overview.php:539
+#, php-format
+msgid "<a href=\"%1$s\" title=\"Manage Uploads\" class=\"musublink\">%2$sMB</a>"
+msgstr "<a href=\"%1$s\" title=\"Verwalte Uploads\" class=\"musublink\">%2$sMB</a>"
+
+#: ../admin/overview.php:540
+msgid "Space Allowed"
+msgstr "Speicher verfügbar"
+
+#: ../admin/overview.php:547
+#, php-format
+msgid "<a href=\"%1$s\" title=\"Manage Uploads\" class=\"musublink\">%2$sMB (%3$s%%)</a>"
+msgstr "<a href=\"%1$s\" title=\"Verwalte Uploads\" class=\"musublink\">%2$sMB (%3$s%%)</a>"
+
+#: ../admin/overview.php:548
+msgid "Space Used"
+msgstr "Verbrauchter Uploadspeicher"
+
+#: ../admin/overview.php:577
+msgid "Translation file successful updated. Please reload page."
+msgstr "Übersetzungsdatei aktualisiert. Bitte Seite neu laden."
+
+#: ../admin/overview.php:579
+msgid "Reload page"
+msgstr "Seite neu laden"
+
+#: ../admin/overview.php:584
+msgid "Translation file couldn't be updated"
+msgstr "Übersetzung konnte nicht aktualisiert werden"
+
+#: ../admin/overview.php:621
+msgid "Download"
+msgstr "Jetzt updaten"
+
+#: ../admin/overview.php:650
+msgid "No GD support"
+msgstr "Keine GD Unterstützung"
+
+#: ../admin/overview.php:662
+#: ../admin/overview.php:708
+#: ../admin/overview.php:711
+#: ../admin/overview.php:714
+msgid "Yes"
+msgstr "Ja"
+
+#: ../admin/overview.php:664
+#: ../admin/overview.php:709
+#: ../admin/overview.php:712
+#: ../admin/overview.php:715
+msgid "No"
+msgstr "Nein"
+
+#: ../admin/overview.php:682
+msgid "Not set"
+msgstr "Nicht gesetzt"
+
+#: ../admin/overview.php:684
+#: ../admin/overview.php:687
+msgid "On"
+msgstr "An"
+
+#: ../admin/overview.php:685
+#: ../admin/overview.php:688
+msgid "Off"
+msgstr "Aus"
+
+#: ../admin/overview.php:691
+#: ../admin/overview.php:694
+#: ../admin/overview.php:697
+#: ../admin/overview.php:700
+#: ../admin/overview.php:703
+#: ../admin/overview.php:706
+msgid "N/A"
+msgstr "N/A"
+
+#: ../admin/overview.php:705
+msgid " MByte"
+msgstr " MByte"
+
+#: ../admin/overview.php:718
+msgid "Operating System"
+msgstr "Betriebssystem"
+
+#: ../admin/overview.php:719
+msgid "Server"
+msgstr "Server"
+
+#: ../admin/overview.php:720
+msgid "Memory usage"
+msgstr "Speicherverbrauch"
+
+#: ../admin/overview.php:721
+msgid "MYSQL Version"
+msgstr "MySQL Version"
+
+#: ../admin/overview.php:722
+msgid "SQL Mode"
+msgstr "SQL Modus"
+
+#: ../admin/overview.php:723
+msgid "PHP Version"
+msgstr "PHP Version"
+
+#: ../admin/overview.php:724
+msgid "PHP Safe Mode"
+msgstr "PHP Safe Mode"
+
+#: ../admin/overview.php:725
+msgid "PHP Allow URL fopen"
+msgstr "PHP Allow URL fopen"
+
+#: ../admin/overview.php:726
+msgid "PHP Memory Limit"
+msgstr "PHP Memory Limit"
+
+#: ../admin/overview.php:727
+msgid "PHP Max Upload Size"
+msgstr "PHP Max Upload Größe"
+
+#: ../admin/overview.php:728
+msgid "PHP Max Post Size"
+msgstr "PHP Max Post Größe"
+
+#: ../admin/overview.php:729
+msgid "PCRE Backtracking Limit"
+msgstr "PCRE Backtracking Limit"
+
+#: ../admin/overview.php:730
+msgid "PHP Max Script Execute Time"
+msgstr "PHP Max Script Execute Time"
+
+#: ../admin/overview.php:731
+msgid "PHP Exif support"
+msgstr "PHP Exif Modul"
+
+#: ../admin/overview.php:732
+msgid "PHP IPTC support"
+msgstr "PHP IPTC Modul"
+
+#: ../admin/overview.php:733
+msgid "PHP XML support"
+msgstr "PHP XML Modul"
+
+#: ../admin/overview.php:745
+msgid "NextGEN Gallery contains some functions which are only available under PHP 5.2. You are using the old PHP 4 version, upgrade now! It's no longer supported by the PHP group. Many shared hosting providers offer both PHP 4 and PHP 5, running simultaneously. Ask your provider if they can do this."
+msgstr "NextGEN Gallery enthält einige Funktionen, die nur unter PHP 5.2 verfügbar sind. Du nutzt immer noch die alte PHP 4 Version. Bitte aktualisiere so bald wie möglich diese Version, sie wird nicht mehr gepflegt und weiterentwicklelt. Die meisten Hoster bieten bereits PHP5 an. Bitte kontaktiere Deinen Provider und frag kurz nach, ob sie ein Update durchführen können."
+
+#: ../admin/overview.php:841
+msgid "Install"
+msgstr "Installieren"
+
+#: ../admin/pointer.php:22
+msgid "<h3>Client side resize</h3><p>You can now resize the images before you start with the upload.</p>"
+msgstr "<h3>Neue Funktion</h3><p>Du kannst nun die Bilder bereits vor dem Upload beschneiden.</p>"
+
+#: ../admin/publish.php:45
+msgid "Post title"
+msgstr "Beitragstitel"
+
+#: ../admin/publish.php:47
+msgid "Enter the post title "
+msgstr "Artikelüberschrift "
+
+#: ../admin/publish.php:52
+msgid "Size of the image"
+msgstr "Größe des Bildes"
+
+#: ../admin/publish.php:70
+msgid "Draft"
+msgstr "Entwurf"
+
+#: ../admin/roles.php:22
+msgid "Updated capabilities"
+msgstr "Zugriffsrechte geändert"
+
+#: ../admin/roles.php:28
+msgid "Roles / capabilities"
+msgstr "Rollen / Zugriffsrechte"
+
+#: ../admin/roles.php:29
+msgid "Select the lowest role which should be able to access the following capabilities. NextGEN Gallery supports the standard roles from WordPress."
+msgstr "Wähle die niedrigste Rolle aus, die Zugriff haben soll. NextGEN Gallery unterstützt nur die Standard-Wordpress-Rollen-Fähigkeiten von WordPress."
+
+#: ../admin/roles.php:30
+msgid "For a more flexible user management you can use the"
+msgstr "Nutze für eine flexiblere Rechteverwaltung den "
+
+#: ../admin/roles.php:35
+msgid "Main NextGEN Gallery overview"
+msgstr "NextGEN Galerie Übersicht"
+
+#: ../admin/roles.php:39
+msgid "Use TinyMCE Button / Upload tab"
+msgstr "TinyMCE Button / Upload Tab"
+
+#: ../admin/roles.php:43
+msgid "Add gallery / Upload images"
+msgstr "Galerie einrichten / Bilder hochladen"
+
+#: ../admin/roles.php:47
+msgid "Manage gallery"
+msgstr "Galerie verwalten"
+
+#: ../admin/roles.php:51
+msgid "Manage others gallery"
+msgstr "Alle Galerien verwalten"
+
+#: ../admin/roles.php:55
+msgid "Manage tags"
+msgstr "Verwalte Stichwörter"
+
+#: ../admin/roles.php:63
+msgid "Change style"
+msgstr "Style anpassen"
+
+#: ../admin/roles.php:67
+msgid "Change options"
+msgstr "Optionen änderen"
+
+#: ../admin/roles.php:71
+msgid "Update capabilities"
+msgstr "Rechte aktualisieren"
+
+#: ../admin/rotate.php:55
+msgid "Image rotated"
+msgstr "Bild gedreht"
+
+#: ../admin/rotate.php:56
+msgid "Error rotating thumbnail"
+msgstr "Konnte Bild nicht bearbeiten"
+
+#: ../admin/rotate.php:81
+msgid "90&deg; clockwise"
+msgstr "90° rechts drehen"
+
+#: ../admin/rotate.php:82
+msgid "90&deg; anticlockwise"
+msgstr "90° links drehen"
+
+#: ../admin/rotate.php:83
+msgid "Flip vertically"
+msgstr "Vertikal spiegeln"
+
+#: ../admin/rotate.php:84
+msgid "Flip horizontally"
+msgstr "Horizontal spiegeln"
+
+#: ../admin/settings.php:97
+msgid "Cache cleared"
+msgstr "Cache löschen"
+
+#: ../admin/settings.php:217
+#: ../admin/settings.php:236
+msgid "General Options"
+msgstr "Allg. Optionen"
+
+#: ../admin/settings.php:218
+#: ../admin/settings.php:417
+msgid "Thumbnails"
+msgstr "Thumbnails"
+
+#: ../admin/settings.php:219
+msgid "Images"
+msgstr "Bilder"
+
+#: ../admin/settings.php:221
+#: ../admin/settings.php:469
+msgid "Effects"
+msgstr "Effekte"
+
+#: ../admin/settings.php:222
+#: ../admin/settings.php:511
+#: ../admin/tinymce/window.php:110
+msgid "Watermark"
+msgstr "Wasserzeichen"
+
+#: ../admin/settings.php:223
+#: ../admin/settings.php:418
+#: ../admin/settings.php:618
+#: ../admin/tinymce/window.php:63
+msgid "Slideshow"
+msgstr "Slideshow"
+
+#: ../admin/settings.php:242
+#: ../admin/wpmu.php:68
+msgid "Gallery path"
+msgstr "Galerie-Pfad"
+
+#: ../admin/settings.php:244
+msgid "This is the default path for all galleries"
+msgstr "Dies ist der Standard-Pfad für alle Galerien"
+
+#: ../admin/settings.php:247
+msgid "Delete image files"
+msgstr "Lösche Bilddateien"
+
+#: ../admin/settings.php:249
+msgid "Delete files, when removing a gallery in the database"
+msgstr "Löscht auch die Dateien, falls die Galerie aus der Datenbank entfernt wird"
+
+#: ../admin/settings.php:252
+msgid "Activate permalinks"
+msgstr "Aktiviere Permalinks"
+
+#: ../admin/settings.php:254
+msgid "When you activate this option, you need to update your permalink structure one time."
+msgstr "Wenn Du diese Option aktivierst, muss Du einmal die Permalink Struktur aktualisieren."
+
+#: ../admin/settings.php:255
+msgid "Gallery slug name :"
+msgstr "Galerie Schlagwort :"
+
+#: ../admin/settings.php:259
+msgid "Create new URL friendly image slugs"
+msgstr "Erstelle neue URL lesbare Schlagwörter "
+
+#: ../admin/settings.php:260
+#: ../admin/settings.php:371
+msgid "Proceed now"
+msgstr "Jetzt durchführen"
+
+#: ../admin/settings.php:263
+msgid "Select graphic library"
+msgstr "Wähle Grafik-Bibliothek"
+
+#: ../admin/settings.php:264
+msgid "GD Library"
+msgstr "GD Bibliothek"
+
+#: ../admin/settings.php:265
+msgid "ImageMagick (Experimental). Path to the library :"
+msgstr "ImageMagick (Experimental). Pfad zur Bibliothek :"
+
+#: ../admin/settings.php:270
+msgid "Activate Media RSS feed"
+msgstr "Aktiviere Media-RSS-Feed"
+
+#: ../admin/settings.php:272
+msgid "A RSS feed will be added to you blog header. Useful for CoolIris/PicLens"
+msgstr "Ein Bilder-RSS Feed wird zum Blog hinzugefügt"
+
+#: ../admin/settings.php:275
+msgid "Activate PicLens/CoolIris support"
+msgstr "Aktiviere PicLens/CoolIris"
+
+#: ../admin/settings.php:277
+msgid "When you activate this option, some javascript is added to your site footer. Make sure that wp_footer is called in your theme."
+msgstr "Dieser Effekt fügt ein neues Javascript zu Deinem Theme hinzu. Beachte, dass wp_footer() in Deinen Vorlagen aufgerufen wird."
+
+#: ../admin/settings.php:280
+msgid "Tags / Categories"
+msgstr "Stichwörter /  Kategorien"
+
+#: ../admin/settings.php:283
+msgid "Activate related images"
+msgstr "Verwandte Bilder anzeigen"
+
+#: ../admin/settings.php:285
+msgid "This option will append related images to every post"
+msgstr "Diese Option hängt verwandte Bilder an jeden Beitrag"
+
+#: ../admin/settings.php:289
+msgid "Match with"
+msgstr "Vergleiche mit"
+
+#: ../admin/settings.php:290
+msgid "Categories"
+msgstr "Kategorien"
+
+#: ../admin/settings.php:295
+msgid "Max. number of images"
+msgstr "Max. Anzahl der Bilder"
+
+#: ../admin/settings.php:297
+msgid "0 will show all images"
+msgstr "0 zeige alle verwandten Bilder"
+
+#: ../admin/settings.php:301
+#: ../admin/settings.php:332
+#: ../admin/settings.php:374
+#: ../admin/settings.php:459
+#: ../admin/settings.php:494
+#: ../admin/settings.php:755
+msgid "More settings"
+msgstr "Mehr Einstellungen"
+
+#: ../admin/settings.php:311
+msgid "Thumbnail settings"
+msgstr "Thumbnail-Einstellungen"
+
+#: ../admin/settings.php:315
+msgid "Please note : If you change the settings, you need to recreate the thumbnails under -> Manage Gallery ."
+msgstr "Bitte beachten : Änderungen der Einstellungen werden erst übernommen, wenn Du neue Thumbnails unter -> \"Gallery verwalten\" erstellst"
+
+#: ../admin/settings.php:328
+msgid "Thumbnail quality"
+msgstr "Thumbnail Qualität"
+
+#: ../admin/settings.php:342
+msgid "Image settings"
+msgstr "Bild-Einstellungen"
+
+#: ../admin/settings.php:348
+msgid "Resize Images"
+msgstr "Bilder verkleinern"
+
+#: ../admin/settings.php:353
+msgid "Image quality"
+msgstr "Bild Qualität"
+
+#: ../admin/settings.php:357
+msgid "Backup original images"
+msgstr "Backup von Original-Bildern "
+
+#: ../admin/settings.php:359
+msgid "Creates a backup for inserted images"
+msgstr "Backup der Bilder anlegen"
+
+#: ../admin/settings.php:362
+msgid "Automatically resize"
+msgstr "Grösse automatisch anpassen"
+
+#: ../admin/settings.php:364
+msgid "Automatically resize images on upload."
+msgstr "Passt die Grösse automatisch beim Upload an"
+
+#: ../admin/settings.php:367
+msgid "Single picture"
+msgstr "Einzelbilder"
+
+#: ../admin/settings.php:370
+msgid "Clear cache folder"
+msgstr "Lösche Cache-Verzeichnis"
+
+#: ../admin/settings.php:391
+msgid "Deactivate gallery page link"
+msgstr "Keine Seitenverzweigung"
+
+#: ../admin/settings.php:393
+msgid "The album will not link to a gallery subpage. The gallery is shown on the same page."
+msgstr "Ein Album benötigt dann keinen Link zur Seite. Die Galerie wird direkt angezeigt."
+
+#: ../admin/settings.php:397
+msgid "Number of images per page"
+msgstr "Anzahl der Bilder pro Seite"
+
+#: ../admin/settings.php:399
+msgid "0 will disable pagination, all images on one page"
+msgstr "0 schaltet Blätterfunktion ab ( = alle Bilder auf einer Seite )"
+
+#: ../admin/settings.php:403
+msgid "Number of columns"
+msgstr "Anzahl der Spalten"
+
+#: ../admin/settings.php:405
+msgid "0 will display as much as possible based on the width of your theme. Setting normally only required for captions below the images"
+msgstr "Mit \"0\" werden soviele Bilder wie möglich in einer Reihe dargestellt. Die Einstellung ist normalerweise nur für Beschriftungen unterhalb der Bilder sinnvoll."
+
+#: ../admin/settings.php:409
+msgid "Integrate slideshow"
+msgstr "Slideshow verwenden"
+
+#: ../admin/settings.php:416
+msgid "Show first"
+msgstr "Zeige als Erstes"
+
+#: ../admin/settings.php:422
+msgid "Show ImageBrowser"
+msgstr "Zeige Bilder-Browser"
+
+#: ../admin/settings.php:424
+msgid "The gallery will open the ImageBrowser instead the effect."
+msgstr "Es wird der Bilder-Browser angezeigt (Kein JavaScript Effekt)"
+
+#: ../admin/settings.php:428
+msgid "Add hidden images"
+msgstr "Versteckte Bilder hinzufügen"
+
+#: ../admin/settings.php:430
+msgid "If pagination is used, this option will still show all images in the modal window (Thickbox, Lightbox etc.). Note : This increases the page load"
+msgstr "Wenn Du die Blätterfunktion nutzt, dann kannst Du mit dieser Option alle Bilder im Modal-Fenster (Thickbox,Lightbox etc.) anzeigen. Berücksichtige, dass die Ladezeit der Seite erhöht wird."
+
+#: ../admin/settings.php:434
+msgid "Enable AJAX pagination"
+msgstr "Aktiviere AJAX-Navigation"
+
+#: ../admin/settings.php:436
+msgid "Browse images without reload the page. Note : Works only in combination with Shutter effect"
+msgstr "Ermöglicht das Blättern zwischen den Bildern ohne die Seite neu zu laden. Hinweis : Funktioniert nur mit dem Shutter-Effekt."
+
+#: ../admin/settings.php:440
+msgid "Sort options"
+msgstr "Sortierung"
+
+#: ../admin/settings.php:443
+msgid "Sort thumbnails"
+msgstr "Thumbnails sortieren"
+
+#: ../admin/settings.php:445
+msgid "Custom order"
+msgstr "Benutzerdefiniert"
+
+#: ../admin/settings.php:447
+msgid "File name"
+msgstr "Dateiname"
+
+#: ../admin/settings.php:448
+msgid "Alt / Title text"
+msgstr "Alt / Titel Text"
+
+#: ../admin/settings.php:449
+msgid "Date / Time"
+msgstr "Datum/Zeit"
+
+#: ../admin/settings.php:453
+msgid "Sort direction"
+msgstr "Sortierreihenfolge"
+
+#: ../admin/settings.php:473
+msgid "Here you can select the thumbnail effect, NextGEN Gallery will integrate the required HTML code in the images. Please note that only the Shutter and Thickbox effect will automatic added to your theme."
+msgstr "Hier kannst Du den Effekt für die Thumbnails auswählen. NextGEN Galerie wird den benötigten HTML-Code verwenden. Bitte beachte, dass nur Shutter und der Thickbox Effekt automatisch in Dein Theme von Wordpress integriert wird. Alle anderen Effekte mußt Du selbst in die header.php eintragen (JS)."
+
+#: ../admin/settings.php:474
+msgid "With the placeholder"
+msgstr "Mit Platzhalter"
+
+#: ../admin/settings.php:474
+msgid "you can activate a navigation through the images (depend on the effect). Change the code line only , when you use a different thumbnail effect or you know what you do."
+msgstr "Du kannst eine Navigation durch die Bilder aktivieren (hängt vom Effekt ab). Ändere nur die Codezeile, falls Du einen anderen Effekt für die Thumbnails verwendest oder einfach weißt, was Du tust."
+
+#: ../admin/settings.php:477
+msgid "JavaScript Thumbnail effect"
+msgstr "JavaScript Thumbnail Effekt"
+
+#: ../admin/settings.php:481
+msgid "Thickbox"
+msgstr "Thickbox"
+
+#: ../admin/settings.php:482
+msgid "Lightbox"
+msgstr "Lightbox"
+
+#: ../admin/settings.php:483
+msgid "Highslide"
+msgstr "Highslide"
+
+#: ../admin/settings.php:484
+msgid "Shutter"
+msgstr "Shutter"
+
+#: ../admin/settings.php:485
+msgid "Custom"
+msgstr "Eigener"
+
+#: ../admin/settings.php:490
+msgid "Link Code line"
+msgstr "Link-Code-Zeile"
+
+#: ../admin/settings.php:512
+msgid "Please note : You can only activate the watermark under -> Manage Gallery . This action cannot be undone."
+msgstr "Bitte beachten : Das Wasserzeichen kann nur unter der Galerieverwaltung gesetzt werden. "
+
+#: ../admin/settings.php:517
+msgid "Preview"
+msgstr "Vorschau"
+
+#: ../admin/settings.php:519
+#: ../admin/settings.php:524
+msgid "Position"
+msgstr "Position"
+
+#: ../admin/settings.php:544
+msgid "Offset"
+msgstr "Abstand"
+
+#: ../admin/settings.php:560
+msgid "Use image as watermark"
+msgstr "Benutze das Bild als Wasserzeichen"
+
+#: ../admin/settings.php:563
+msgid "URL to file"
+msgstr "URL zur Datei"
+
+#: ../admin/settings.php:565
+msgid "The accessing of URL files is disabled at your server (allow_url_fopen)"
+msgstr "Der Dateizugriff von URLs ist auf diesem Server deaktiviert (allow_url_fopen)"
+
+#: ../admin/settings.php:568
+msgid "Use text as watermark"
+msgstr "Benutze Text als Wasserzeichen"
+
+#: ../admin/settings.php:571
+msgid "Font"
+msgstr "Schriftart"
+
+#: ../admin/settings.php:580
+msgid "This function will not work, cause you need the FreeType library"
+msgstr "Diese Funktion benötigt die FreeType-Bibliothek"
+
+#: ../admin/settings.php:582
+msgid "You can upload more fonts in the folder <strong>nggallery/fonts</strong>"
+msgstr "Du kannst mehr Schriftarten in das Verzeichniss <strong>nggallery/fonts</strong> hochladen."
+
+#: ../admin/settings.php:591
+msgid "Color"
+msgstr "Farbe"
+
+#: ../admin/settings.php:593
+msgid "(hex w/o #)"
+msgstr "(hex w/o #)"
+
+#: ../admin/settings.php:596
+msgid "Text"
+msgstr "Text"
+
+#: ../admin/settings.php:600
+msgid "Opaque"
+msgstr "Transparenz"
+
+#: ../admin/settings.php:621
+msgid "Default size (W x H)"
+msgstr "Standard Größe (B x H)"
+
+#: ../admin/settings.php:626
+msgid "Duration time"
+msgstr "Dauer"
+
+#: ../admin/settings.php:627
+msgid "sec."
+msgstr "Sek."
+
+#: ../admin/settings.php:630
+#: ../admin/settings.php:705
+msgid "Transition / Fade effect"
+msgstr "Fade Effekt"
+
+#: ../admin/settings.php:633
+#: ../admin/settings.php:708
+msgid "fade"
+msgstr "Fade"
+
+#: ../admin/settings.php:634
+msgid "blindX"
+msgstr "blindX"
+
+#: ../admin/settings.php:635
+msgid "cover"
+msgstr "Blenden"
+
+#: ../admin/settings.php:636
+msgid "scrollUp"
+msgstr "ScrollUp"
+
+#: ../admin/settings.php:637
+msgid "scrollDown"
+msgstr "ScrollDown"
+
+#: ../admin/settings.php:638
+msgid "shuffle"
+msgstr "Shuffle"
+
+#: ../admin/settings.php:639
+msgid "toss"
+msgstr "Schüttel"
+
+#: ../admin/settings.php:640
+msgid "wipe"
+msgstr "wischen"
+
+#: ../admin/settings.php:642
+msgid "See here for more information about the effects :"
+msgstr "Hier bekommst du mehr Informationen über die Effekte :"
+
+#: ../admin/settings.php:646
+msgid "Settings for the JW Image Rotator"
+msgstr "JW-Image-Rotator Einstellungen"
+
+#: ../admin/settings.php:647
+msgid "The settings are only used in the JW Image Rotator Version"
+msgstr "Die Einstellungen werden im JW-Image-Rotator benutzt, in der Version"
+
+#: ../admin/settings.php:648
+msgid "See more information for the Flash Player on the web page"
+msgstr "Weitere Informationen auf der Flash-Player-Homepage"
+
+#: ../admin/settings.php:653
+msgid "The path to imagerotator.swf is not defined, the slideshow will not work."
+msgstr "Der Pfad zu imagerotator.swf ist nicht gesetzt, die Flash-Diaschau kann dann nicht angezeigt werden"
+
+#: ../admin/settings.php:654
+msgid "If you would like to use the JW Image Rotatator, please download the player <a href=\"http://www.longtailvideo.com/players/jw-image-rotator/\" target=\"_blank\" >here</a> and upload it to your Upload folder (Default is wp-content/uploads)."
+msgstr "Wenn Du den JW-Image-Rotator (Slideshow) nutzen möchtest, lade Dir die aktuelle Version <a href=\"http://www.longtailvideo.com/players/jw-image-rotator/\" target=\"_blank\" >hier</a> herunter und übertrage sie dann in Dein WordPress-Upload-Verzeichnis (normalerweise wp-content/uploads),"
+
+#: ../admin/settings.php:660
+msgid "Enable flash slideshow"
+msgstr "Aktiviere Flash Slideshow"
+
+#: ../admin/settings.php:662
+msgid "Integrate the flash based slideshow for all flash supported devices"
+msgstr "Verwende die Flash Slideshow für alle Flash-unterstützte Geräte"
+
+#: ../admin/settings.php:665
+msgid "Path to the Imagerotator (URL)"
+msgstr "Pfad zum JW-Image-Rotator (URL)"
+
+#: ../admin/settings.php:668
+msgid "Search now"
+msgstr "Suche jetzt"
+
+#: ../admin/settings.php:669
+msgid "Press the button to search automatically for the imagerotator, if you uploaded it to wp-content/uploads or a subfolder"
+msgstr "Drücke 'Suche jetzt' um automatisch den Pfad zum Image-Rotator zu ermitteln, sofern Du den Player in wp-content/uploads oder ein Unterverzeichnis hochgeladen hast."
+
+#: ../admin/settings.php:673
+msgid "Shuffle mode"
+msgstr "Shuffle Modus"
+
+#: ../admin/settings.php:677
+msgid "Show next image on click"
+msgstr "Zeige nächstes Bild bei Klick"
+
+#: ../admin/settings.php:681
+msgid "Show navigation bar"
+msgstr "Zeige Navigations-Leiste"
+
+#: ../admin/settings.php:685
+msgid "Show loading icon"
+msgstr "Zeige Lade-Bildchen"
+
+#: ../admin/settings.php:689
+msgid "Use watermark logo"
+msgstr "Wasserzeichen anzeigen"
+
+#: ../admin/settings.php:691
+msgid "You can change the logo at the watermark settings"
+msgstr "Du kannst den Pfad in Einstellungen für das Wasserzeichen angeben"
+
+#: ../admin/settings.php:694
+msgid "Stretch image"
+msgstr "Bild dehnen"
+
+#: ../admin/settings.php:697
+msgid "true"
+msgstr "Ja"
+
+#: ../admin/settings.php:698
+msgid "false"
+msgstr "Nein"
+
+#: ../admin/settings.php:699
+msgid "fit"
+msgstr "Passend"
+
+#: ../admin/settings.php:700
+msgid "none"
+msgstr "keiner"
+
+#: ../admin/settings.php:709
+msgid "bgfade"
+msgstr "BGFade"
+
+#: ../admin/settings.php:710
+msgid "slowfade"
+msgstr "Slowfade"
+
+#: ../admin/settings.php:711
+msgid "circles"
+msgstr "Kreise"
+
+#: ../admin/settings.php:712
+msgid "bubbles"
+msgstr "Blasen"
+
+#: ../admin/settings.php:713
+msgid "blocks"
+msgstr "Blöcke"
+
+#: ../admin/settings.php:714
+msgid "fluids"
+msgstr "Fluids"
+
+#: ../admin/settings.php:715
+msgid "flash"
+msgstr "Flash"
+
+#: ../admin/settings.php:716
+msgid "lines"
+msgstr "Linien"
+
+#: ../admin/settings.php:717
+msgid "random"
+msgstr "Zufall"
+
+#: ../admin/settings.php:722
+msgid "Use slow zooming effect"
+msgstr "nutze Zoom-Effekt"
+
+#: ../admin/settings.php:726
+msgid "Background Color"
+msgstr "Hintergrund (BG) Farbe"
+
+#: ../admin/settings.php:731
+msgid "Texts / Buttons Color"
+msgstr "Text- / Button Farbe"
+
+#: ../admin/settings.php:736
+msgid "Rollover / Active Color"
+msgstr "Rollover / Aktiv (Link) Farbe"
+
+#: ../admin/settings.php:741
+msgid "Screen Color"
+msgstr "Seiten-Farbe"
+
+#: ../admin/settings.php:746
+msgid "Background music (URL)"
+msgstr "Hintergrundmusik (URL)"
+
+#: ../admin/settings.php:750
+msgid "Try XHTML validation (with CDATA)"
+msgstr "Integriere XHTML-Validierung (mittels CDATA)"
+
+#: ../admin/settings.php:752
+msgid "Important : Could causes problem at some browser. Please recheck your page."
+msgstr "Wichtig : Es könnten Probleme bei einigen Browser entstehen. Unbedingt Seite danach prüfen."
+
+#: ../admin/setup.php:15
+msgid "Reset all settings to default parameter"
+msgstr "Stelle alle Einstellungen auf Anfangswerte zurück"
+
+#: ../admin/setup.php:26
+msgid "Uninstall sucessful ! Now delete the plugin and enjoy your life ! Good luck !"
+msgstr "Deinstallation erfolgreich! Nun kannst Du das Plugin löschen und Dein Leben weiterhin genießen! Stay geeky! Viel Glück!"
+
+#: ../admin/setup.php:30
+msgid "Reset options"
+msgstr "Optionen zurücksetzen"
+
+#: ../admin/setup.php:33
+msgid "Reset all options/settings to the default installation."
+msgstr "Alle Optionen/Einstellungen zurücksetzen"
+
+#: ../admin/setup.php:34
+msgid "Reset settings"
+msgstr "Einstellungen zurücksetzen"
+
+#: ../admin/setup.php:34
+msgid ""
+"Reset all options to default settings ?\\n"
+"\\n"
+"Choose [Cancel] to Stop, [OK] to proceed.\\n"
+msgstr ""
+"Alle Optionen zu Standard zurücksetzen ?\\n"
+"\\n"
+"Wähle [Cancel] um abzubrechen, [OK] zum Fortfahren.\\n"
+
+#: ../admin/setup.php:39
+msgid "Uninstall plugin tables"
+msgstr "Plugin Tabellen (DB) entfernen"
+
+#: ../admin/setup.php:44
+msgid "You don't like NextGEN Gallery ?"
+msgstr "Du magst die NextGEN Gallery nicht ?"
+
+#: ../admin/setup.php:45
+msgid "No problem, before you deactivate this plugin press the Uninstall Button, because deactivating NextGEN Gallery does not remove any data that may have been created. "
+msgstr "Null Problemo. Einfach nur vor dem Deaktivieren dieses Plugins den Uninstall-Button betätigen, damit alle Tabellen der Galerie entfernt werden."
+
+#: ../admin/setup.php:47
+msgid "WARNING:"
+msgstr "WARNUNG:"
+
+#: ../admin/setup.php:48
+msgid "Once uninstalled, this cannot be undone. You should use a Database Backup plugin of WordPress to backup all the tables first. NextGEN gallery is stored in the tables"
+msgstr "Eine einmalig durchgeführte Deinstallation kann nicht mehr rückgängig gemacht werden, da alle Tabellen der Galerie aus der Datenbank entfernt werden und KEIN Backup dieser Galerie-Tabellen angelegt wird."
+
+#: ../admin/setup.php:48
+msgid "and"
+msgstr "und"
+
+#: ../admin/setup.php:50
+msgid "Uninstall plugin"
+msgstr "Plugin deinstallieren"
+
+#: ../admin/setup.php:50
+msgid ""
+"You are about to Uninstall this plugin from WordPress.\\n"
+"This action is not reversible.\\n"
+"\\n"
+"Choose [Cancel] to Stop, [OK] to Uninstall.\\n"
+msgstr ""
+"Du bist dabei, das Plugin zu deinstallieren.\\n"
+"Diese Aktion kann NICHT rückgängig gemacht werden.\\n"
+"\\n"
+"Wähle [Cancel] zum Abbrechen, [OK] zum Deinstallieren.\\n"
+
+#: ../admin/showmeta.php:29
+msgid "Meta Data"
+msgstr "Metadaten"
+
+#: ../admin/showmeta.php:34
+#: ../admin/showmeta.php:60
+#: ../admin/showmeta.php:85
+#: ../admin/showmeta.php:109
+msgid "Tag"
+msgstr "Stichwort"
+
+#: ../admin/showmeta.php:35
+#: ../admin/showmeta.php:61
+#: ../admin/showmeta.php:86
+#: ../admin/showmeta.php:110
+msgid "Value"
+msgstr "Wert"
+
+#: ../admin/showmeta.php:49
+msgid "No meta data saved"
+msgstr "Keine Metadaten gespeichert"
+
+#: ../admin/showmeta.php:55
+msgid "EXIF Data"
+msgstr "EXIF-Daten"
+
+#: ../admin/showmeta.php:74
+msgid "No exif data"
+msgstr "Keine Exif-Daten"
+
+#: ../admin/showmeta.php:81
+msgid "IPTC Data"
+msgstr "IPTC-Daten"
+
+#: ../admin/showmeta.php:105
+msgid "XMP Data"
+msgstr "XMP-Daten"
+
+#: ../admin/style.php:11
+msgid "(From the theme folder)"
+msgstr "(Aus dem Theme Verzeichnis)"
+
+#: ../admin/style.php:43
+msgid "You do not have sufficient permissions to edit templates for this blog."
+msgstr "Du hast nicht die benötigten Rechte, um Vorlagen in diesem Blog zu bearbeiten."
+
+#: ../admin/style.php:52
+msgid "CSS file successfully updated"
+msgstr "CSS-Datei erfolgreich aktualisiert"
+
+#: ../admin/style.php:89
+msgid "Style Editor"
+msgstr "CSS-Editor"
+
+#: ../admin/style.php:93
+msgid "Activate and use style sheet:"
+msgstr "Aktiviere und nutze Stylesheet:"
+
+#: ../admin/style.php:113
+msgid "Activate"
+msgstr "Aktiviere"
+
+#: ../admin/style.php:123
+#, php-format
+msgid "Editing <strong>%s</strong>"
+msgstr "Bearbeite <strong>%s</strong>"
+
+#: ../admin/style.php:125
+#, php-format
+msgid "Browsing <strong>%s</strong>"
+msgstr "Durchsuche <strong>%s</strong>"
+
+#: ../admin/style.php:135
+msgid "Version"
+msgstr "Version"
+
+#: ../admin/style.php:138
+msgid "Tip : Copy your stylesheet (nggallery.css) to your theme folder, so it will be not lost during a upgrade"
+msgstr "Kleiner Tipp: Kopiere das Stylesheet (nggallery.css) in Dein Theme-Verzeichnis, dadurch wird es beim nächsten Update nicht überschrieben."
+
+#: ../admin/style.php:140
+msgid "Your theme contain a NextGEN Gallery stylesheet (nggallery.css), this file will be used"
+msgstr "Dein Theme-Paket enthält ein NextGEN-Gallery-Stylesheet (nggallery.css), dieses Sheet wird automatisch eingebunden"
+
+#: ../admin/style.php:142
+msgid "Tip No. 2: Use the color picker below to help you find the right color scheme for your gallery!"
+msgstr "2.Tipp : Benutze die Farbauswahl, um den zugehörigen HTML-Farbcode zu erhalten"
+
+#: ../admin/style.php:158
+msgid "Update File"
+msgstr "Datei aktualisieren"
+
+#: ../admin/style.php:161
+msgid "If this file were writable you could edit it."
+msgstr "Wenn diese Datei beschreibbar wäre, könntest Du sie bearbeiten."
+
+#: ../admin/style.php:166
+msgid "Oops, no such file exists! Double check the name and try again, merci."
+msgstr "Oha, eine solche Datei existiert nicht! Bitte überprüfe den Namen und probiere es erneut. Danke."
+
+#: ../admin/tags.php:38
+msgid "Most popular"
+msgstr "Beliebteste Stichwörter"
+
+#: ../admin/tags.php:39
+msgid "Least used"
+msgstr "Zuletzt benutzt"
+
+#: ../admin/tags.php:40
+msgid "Alphabetical"
+msgstr "Alphabetisch"
+
+#: ../admin/tags.php:96
+msgid "Manage image tags"
+msgstr "Verwalte Bilder-Stichwörter"
+
+#: ../admin/tags.php:108
+msgid "Existing Tags"
+msgstr "Vorhandene Stichwörter"
+
+#: ../admin/tags.php:112
+msgid "Search tags"
+msgstr "Suche nach Stichwörter"
+
+#: ../admin/tags.php:116
+msgid "Go"
+msgstr "Start"
+
+#: ../admin/tags.php:121
+msgid "Sort Order:"
+msgstr "Sortierung :"
+
+#: ../admin/tags.php:156
+#: ../admin/tags.php:160
+#: ../admin/tags.php:173
+msgid "Previous tags"
+msgstr "Vorheriges Stichwort"
+
+#: ../admin/tags.php:169
+msgid "Next tags"
+msgstr "Nächstes Stichwort"
+
+#: ../admin/tags.php:181
+msgid "Rename Tag"
+msgstr "Schlagwort umbenennen"
+
+#: ../admin/tags.php:189
+msgid "Enter the tag to rename and its new value.  You can use this feature to merge tags too. Click \"Rename\" and all posts which use this tag will be updated."
+msgstr "Trage das Stichwort ein, das Du umbenennen willst und seinen neuen Wert/Namen. Du kannst diese Funktion auch nutzen, um Stichwörter zusammenzuführen. Klicke auf \"Umbenennen\" und alle Bilder, die das Stichwort verwenden, werden aktualisiert."
+
+#: ../admin/tags.php:190
+#: ../admin/tags.php:238
+msgid "You can specify multiple tags to rename by separating them with commas."
+msgstr "Mehrere Stichwörter zum Umbenennen durch Komma trennen"
+
+#: ../admin/tags.php:194
+msgid "Tag(s) to rename:"
+msgstr "Stichwörter umbennenen:"
+
+#: ../admin/tags.php:198
+msgid "New tag name(s):"
+msgstr "Neuer Name für das Stichwort"
+
+#: ../admin/tags.php:201
+msgid "Rename"
+msgstr "Umbenennen"
+
+#: ../admin/tags.php:207
+msgid "Delete Tag"
+msgstr "Stichwort löschen"
+
+#: ../admin/tags.php:215
+msgid "Enter the name of the tag to delete.  This tag will be removed from all posts."
+msgstr "Trage das zu löschende Stichwort ein. Das Stichwort wird aus allen Bildern entfernt."
+
+#: ../admin/tags.php:216
+msgid "You can specify multiple tags to delete by separating them with commas"
+msgstr "Du kannst mehrere Stichwörter zum Löschen markieren, indem Du sie mit Kommas trennst"
+
+#: ../admin/tags.php:220
+msgid "Tag(s) to delete:"
+msgstr "Folgede Stichwörter löschen:"
+
+#: ../admin/tags.php:229
+msgid "Edit Tag Slug"
+msgstr "Ändere Schlagwort"
+
+#: ../admin/tags.php:237
+msgid "Enter the tag name to edit and its new slug. <a href=\"http://codex.wordpress.org/Glossary#Slug\">Slug definition</a>"
+msgstr "Trage den Namen des zu ändernden Stichworts und seinen neuen \"Slug\" ein. <a href=\"http://codex.wordpress.org/Glossary#Slug\">Was ist ein Slug?</a>"
+
+#: ../admin/tags.php:242
+msgid "Tag(s) to match:"
+msgstr "Stichwörter vergleichen :"
+
+#: ../admin/tags.php:246
+msgid "Slug(s) to set:"
+msgstr "Schlagwörter setzen:"
+
+#: ../admin/upgrade.php:22
+msgid "Upgrade database structure..."
+msgstr "Aktualisiere die Datenbank-Strukturen..."
+
+#: ../admin/upgrade.php:108
+#: ../admin/upgrade.php:119
+#: ../admin/upgrade.php:126
+#: ../admin/upgrade.php:137
+#: ../admin/upgrade.php:151
+msgid "finished"
+msgstr "beendet"
+
+#: ../admin/upgrade.php:117
+msgid "Update file structure..."
+msgstr "Aktualisiere Verzeichnisse..."
+
+#: ../admin/upgrade.php:124
+msgid "Import date and time information..."
+msgstr "Importiere Datum/Uhrzeit..."
+
+#: ../admin/upgrade.php:132
+msgid "Move imagerotator to new location..."
+msgstr "Verschiebe den Image-Rotator in ein neues Verzeichnis..."
+
+#: ../admin/upgrade.php:143
+msgid "Update settings..."
+msgstr "Einstellungen gespeichert..."
+
+#: ../admin/upgrade.php:157
+msgid "Updated widget structure. If you used NextGEN Widgets, you need to setup them again..."
+msgstr "Die Widgets wurden überarbeitet. Wenn Du NextGEN Widgets nutzt, musst du Sie nun neu einfügen..."
+
+#: ../admin/upgrade.php:165
+#: ../admin/upgrade.php:187
+msgid "Updated options."
+msgstr "Einstellungen gespeichert."
+
+#: ../admin/upgrade.php:172
+msgid "Create unique slug"
+msgstr "Permalinks erstellen"
+
+#: ../admin/upgrade.php:173
+msgid "One of the upcomming features are a reworked permalinks structure."
+msgstr "Die Permalinkstruktur wird in einer kommenden Version überarbeitet."
+
+#: ../admin/upgrade.php:174
+msgid "Therefore it's needed to have a unique identifier for each image, gallery and album."
+msgstr "Deshalb ist es notwendig ein eindeutiges Schlagwort für jedes Bild, Galerie und Album zu erzeugen."
+
+#: ../admin/upgrade.php:175
+msgid "Depend on the amount of database entries this will take a while, don't reload this page."
+msgstr "Diese Operation kann je nach Anzahl der Bilder eine Weile daueren, bitte die Seite nicht neu laden."
+
+#: ../admin/upgrade.php:195
+msgid "Could not find NextGEN Gallery database tables, upgrade failed !"
+msgstr "Konnte die NextGEN Gallery Tabellen nicht finden, Upgrade fehlgeschlagen !"
+
+#: ../admin/upgrade.php:258
+msgid "Some folders/files could not renamed, please recheck the permission and rescan the folder in the manage gallery section."
+msgstr "Einige Verzeichnisse / Bilder konnten nicht umbenannt werden, bitte überprüfe die Zugriffsrechte und scanne dann das Verzeichnis neu ein."
+
+#: ../admin/upgrade.php:260
+msgid "Rename failed"
+msgstr "Konnte nicht umbenannt werden"
+
+#: ../admin/upgrade.php:356
+#: ../admin/upgrade.php:375
+msgid "Upgrade NextGEN Gallery"
+msgstr "NextGEN-Gallery aktualisieren"
+
+#: ../admin/upgrade.php:357
+msgid "The script detect that you upgrade from a older version."
+msgstr "Es wurde eine ältere NextGEN-Datenbank erkannt."
+
+#: ../admin/upgrade.php:358
+msgid "Your database tables for NextGEN Gallery is out-of-date, and must be upgraded before you can continue."
+msgstr "Deine Datenbanktabellen für NextGEN-Gallery sind nicht auf dem aktuellen Stand, sie müssen jetzt aktualisiert werden."
+
+#: ../admin/upgrade.php:359
+msgid "If you would like to downgrade later, please make first a complete backup of your database and the images."
+msgstr "Wenn Du wieder auf eine ältere Version zurückgehen möchtest, solltest Du vorher die Datenbank sichern."
+
+#: ../admin/upgrade.php:360
+msgid "The upgrade process may take a while, so please be patient."
+msgstr "Der Upgrade-Prozess kann etwas dauern, bitte sei geduldig..."
+
+#: ../admin/upgrade.php:361
+msgid "Start upgrade now"
+msgstr "Aktualisierung  starten"
+
+#: ../admin/upgrade.php:377
+msgid "Upgrade finished..."
+msgstr "Upgrade beendet..."
+
+#: ../admin/upgrade.php:378
+msgid "Continue"
+msgstr "Weiter"
+
+#: ../admin/upgrade.php:401
+#, php-format
+msgid "Rebuild image structure : %s / %s images"
+msgstr "Erzeuge Permalinks für Bilder : %s / %s Bilder"
+
+#: ../admin/upgrade.php:402
+#, php-format
+msgid "Rebuild gallery structure : %s / %s galleries"
+msgstr "Erzeuge Permalinks für Galerien : %s / %s Galerien"
+
+#: ../admin/upgrade.php:403
+#, php-format
+msgid "Rebuild album structure : %s / %s albums"
+msgstr "Erzeuge Permalinks für Alben : %s / %s Alben"
+
+#: ../admin/upgrade.php:460
+msgid "Done."
+msgstr "Fertig."
+
+#: ../admin/wpmu.php:33
+msgid "Update successfully"
+msgstr "Aktualisierung erfolgreich"
+
+#: ../admin/wpmu.php:45
+#, php-format
+msgid "Thanks for using this plugin, NextGEN Gallery is initially developed for self hosted blogs. A multisite setup is possible, but cannot currently fully supported, as it can have several special condition ( i.e. Domain mapping).<br /> If you would like to support the further development, please consider a <strong><a href=\"%s\">donation</a></strong>! If you still need some help, please post your questions <a href=\"http://wordpress.org/tags/nextgen-gallery?forum_id=10\">here</a> ."
+msgstr "Vielen Dank, dass Du dieses Plugin nutzt. NextGEN Gallery wurde für einfache Blogs entwickelt. Die Nutzung im Netzwerk (Multisite) ist möglich, aber wird nicht vollständig unterstützt (z.B. Domain Mapping).<br /> Wenn Du die Weiterentwicklung unterstützen möchtest, würde ich mich über eine kleine <strong><a href=\"%s\">Spende</a></strong> freuen! Wenn Du Fragen oder Problem hast, schreib sie doch <a href=\"http://wordpress.org/tags/nextgen-gallery?forum_id=10\">hier</a>  ins Forum."
+
+#: ../admin/wpmu.php:62
+msgid "Network Options"
+msgstr "Netzwerk Optionen"
+
+#: ../admin/wpmu.php:70
+msgid "This is the default path for all blogs. With the placeholder %BLOG_ID% you can organize the folder structure better."
+msgstr "Dieses ist der Default-Pfad für alle Blogs. Mit dem Platzhalter %BLOG_ID% wird die Ordnerstruktur gesteuert. Der Pfad muss mit / enden."
+
+#: ../admin/wpmu.php:71
+#, php-format
+msgid "The default setting should be %s"
+msgstr "Grundeinstellung ist %s"
+
+#: ../admin/wpmu.php:75
+msgid "Enable upload quota check"
+msgstr "Schalte die Uploadbegrenzung ein"
+
+#: ../admin/wpmu.php:77
+msgid "Should work if the gallery is bellow the blog.dir"
+msgstr "Sollte funktionieren, wenn die Galerien sich unterhalb blog.dir befinden"
+
+#: ../admin/wpmu.php:81
+msgid "Enable zip upload option"
+msgstr "Erlaube ZIP-Upload"
+
+#: ../admin/wpmu.php:83
+msgid "Allow users to upload zip folders."
+msgstr "Erlaubt die Nutzung des ZIP-Upload"
+
+#: ../admin/wpmu.php:87
+msgid "Enable import function"
+msgstr "Erlaube Import Funktion"
+
+#: ../admin/wpmu.php:89
+msgid "Allow users to import images folders from the server."
+msgstr "Erlaube dem User Bilder direkt aus den Server Verzeichnissen zu importieren."
+
+#: ../admin/wpmu.php:93
+msgid "Enable style selection"
+msgstr "Freie CSS-Style-Auswahl"
+
+#: ../admin/wpmu.php:95
+msgid "Allow users to choose a style for the gallery."
+msgstr "Erlaube dem User, ein CSS für die Galerie zu wählen"
+
+#: ../admin/wpmu.php:99
+msgid "Enable roles/capabilities"
+msgstr "Rollen / Zugriffsrechte freischalten"
+
+#: ../admin/wpmu.php:101
+msgid "Allow users to change the roles for other blog authors."
+msgstr "Erlaube dem User die Anpassung der Zugangsberechtigung"
+
+#: ../admin/wpmu.php:105
+msgid "Default style"
+msgstr "Standard-CSS-Style"
+
+#: ../admin/wpmu.php:122
+msgid "Choose the default style for the galleries."
+msgstr "Wähle das Default-Stylesheet für die Galerien"
+
+#: ../admin/tinymce/window.php:56
+msgid "Select or enter gallery"
+msgstr "Wähle oder Suche Galerie"
+
+#: ../admin/tinymce/window.php:61
+#: ../admin/tinymce/window.php:82
+msgid "Show as"
+msgstr "Zeige als"
+
+#: ../admin/tinymce/window.php:62
+msgid "Image list"
+msgstr "Bilder-Liste"
+
+#: ../admin/tinymce/window.php:64
+msgid "Imagebrowser"
+msgstr "Bilder-Browser"
+
+#: ../admin/tinymce/window.php:77
+msgid "Select or enter album"
+msgstr "Wähle oder Suche Album"
+
+#: ../admin/tinymce/window.php:83
+msgid "Extended version"
+msgstr "Erweiterte Version"
+
+#: ../admin/tinymce/window.php:84
+msgid "Compact version"
+msgstr "Kompakte Version"
+
+#: ../admin/tinymce/window.php:97
+msgid "Select or enter picture"
+msgstr "Wähle oder Suche Bild"
+
+#: ../admin/tinymce/window.php:102
+msgid "Width x Height"
+msgstr "Breite x Höhe"
+
+#: ../admin/tinymce/window.php:106
+msgid "Effect"
+msgstr "Effekt"
+
+#: ../admin/tinymce/window.php:109
+msgid "No effect"
+msgstr "Kein Effekt"
+
+#: ../admin/tinymce/window.php:111
+msgid "Web 2.0"
+msgstr "Web 2.0"
+
+#: ../admin/tinymce/window.php:116
+msgid "Float"
+msgstr "Float"
+
+#: ../admin/tinymce/window.php:119
+msgid "No float"
+msgstr "Kein Float"
+
+#: ../admin/tinymce/window.php:138
+msgid "Insert"
+msgstr "Einfügen"
+
+#: ../lib/core.php:407
+#, php-format
+msgid "Note : Based on your server memory limit you should not upload larger images then <strong>%d x %d</strong> pixel"
+msgstr "Hinweis: Basierend auf der Speicherbegrenzung auf dem Server, solltest Du keine Bilder grösser als <strong>%d x %d</strong> Pixel hochladen"
+
+#: ../lib/locale.php:120
+msgid "Invalid URL Provided."
+msgstr "Ungültige URL"
+
+#: ../lib/locale.php:124
+#: ../lib/locale.php:128
+msgid "Could not create Temporary file."
+msgstr "Konnte temporäre Datei nicht erstellen"
+
+#: ../lib/meta.php:124
+msgid " mm"
+msgstr " mm"
+
+#: ../lib/meta.php:130
+msgid " sec"
+msgstr " Sek."
+
+#: ../lib/meta.php:134
+msgid "Fired"
+msgstr "ausgelöst"
+
+#: ../lib/meta.php:134
+msgid "Not fired"
+msgstr "Nicht ausgelöst"
+
+#: ../lib/meta.php:430
+msgid "Aperture"
+msgstr "Blende"
+
+#: ../lib/meta.php:431
+#: ../lib/meta.php:456
+msgid "Credit"
+msgstr "Autor"
+
+#: ../lib/meta.php:432
+msgid "Camera"
+msgstr "Kamera"
+
+#: ../lib/meta.php:433
+msgid "Caption"
+msgstr "Beschreibung"
+
+#: ../lib/meta.php:435
+msgid "Copyright"
+msgstr "Rechte"
+
+#: ../lib/meta.php:436
+msgid "Focal length"
+msgstr "Brennweite"
+
+#: ../lib/meta.php:437
+msgid "ISO"
+msgstr "ISO"
+
+#: ../lib/meta.php:438
+msgid "Shutter speed"
+msgstr "Belichtungszeit"
+
+#: ../lib/meta.php:442
+msgid "Subject"
+msgstr "Betreff"
+
+#: ../lib/meta.php:443
+msgid "Make"
+msgstr "Hersteller"
+
+#: ../lib/meta.php:444
+msgid "Edit Status"
+msgstr "Ändere Status"
+
+#: ../lib/meta.php:445
+msgid "Category"
+msgstr "Kategorie"
+
+#: ../lib/meta.php:446
+msgid "Keywords"
+msgstr "Schlüsselwörter"
+
+#: ../lib/meta.php:447
+msgid "Date Created"
+msgstr "erstellt (Datum)"
+
+#: ../lib/meta.php:448
+msgid "Time Created"
+msgstr "erstellt (Zeit)"
+
+#: ../lib/meta.php:449
+msgid "Author Position"
+msgstr "Autor Position"
+
+#: ../lib/meta.php:450
+msgid "City"
+msgstr "Stadt"
+
+#: ../lib/meta.php:451
+msgid "Location"
+msgstr "Ort"
+
+#: ../lib/meta.php:452
+msgid "Province/State"
+msgstr "Staat / PLZ"
+
+#: ../lib/meta.php:453
+msgid "Country code"
+msgstr "Landescode"
+
+#: ../lib/meta.php:454
+msgid "Country"
+msgstr "Land"
+
+#: ../lib/meta.php:455
+msgid "Headline"
+msgstr "Kopfzeile"
+
+#: ../lib/meta.php:457
+msgid "Source"
+msgstr "Quelle"
+
+#: ../lib/meta.php:458
+msgid "Copyright Notice"
+msgstr "Copyright Hinweise / Credits"
+
+#: ../lib/meta.php:459
+msgid "Contact"
+msgstr "Kontakt"
+
+#: ../lib/meta.php:460
+msgid "Last modified"
+msgstr "Zuletzt geändert"
+
+#: ../lib/meta.php:461
+msgid "Program tool"
+msgstr "Programm"
+
+#: ../lib/meta.php:462
+msgid "Format"
+msgstr "Format"
+
+#: ../lib/meta.php:463
+msgid "Image Width"
+msgstr "Breite"
+
+#: ../lib/meta.php:464
+msgid "Image Height"
+msgstr "Höhe"
+
+#: ../lib/meta.php:465
+msgid "Flash"
+msgstr "Blitz"
+
+#: ../lib/multisite.php:23
+msgid "Sorry, you have used your space allocation. Please delete some files to upload more files."
+msgstr "Schade, Dein freier Speicher scheint aufgebraucht zu sein. Bitte lösche zuerst ein paar Bilder."
+
+#: ../lib/ngg-db.php:331
+#: ../lib/ngg-db.php:332
+msgid "Album overview"
+msgstr "Album Übersicht"
+
+#: ../lib/shortcodes.php:311
+msgid "[Pictures not found]"
+msgstr "[Bilder nicht gefunden]"
+
+#: ../lib/tags.php:35
+msgid "No new tag specified!"
+msgstr "Kein neues Stichwort definiert!"
+
+#: ../lib/tags.php:50
+msgid "No new/old valid tag specified!"
+msgstr "Kein neues Stichwort definiert!"
+
+#: ../lib/tags.php:86
+msgid "No tag renamed."
+msgstr "Kein Stichwort umbenannt."
+
+#: ../lib/tags.php:88
+#, php-format
+msgid "Renamed tag(s) &laquo;%1$s&raquo; to &laquo;%2$s&raquo;"
+msgstr "Es wurden die Stichwörter &laquo;%1$s&raquo; bis &laquo;%2$s&raquo; umbenannt"
+
+#: ../lib/tags.php:95
+msgid "No valid new tag."
+msgstr "Kein gültiges Stichwort"
+
+#: ../lib/tags.php:112
+msgid "No objects (post/page) found for specified old tags."
+msgstr "Keine Objekte (Seite/Beitrag) enthält das ausgewählte Stichwort"
+
+#: ../lib/tags.php:141
+msgid "No tag merged."
+msgstr "Keine Stichwörter zusammengeführt."
+
+#: ../lib/tags.php:143
+#, php-format
+msgid "Merge tag(s) &laquo;%1$s&raquo; to &laquo;%2$s&raquo;. %3$s objects edited."
+msgstr "Stichwörter &laquo;%1$s&raquo; bis &laquo;%2$s&raquo; zusammengeführt. %3$s Objekte geändert."
+
+#: ../lib/tags.php:146
+msgid "Error. No enough tags for rename. Too for merge. Choose !"
+msgstr "Fehler. Es wurden nicht genug Stichwörter ausgewählt."
+
+#: ../lib/tags.php:163
+msgid "No tag specified!"
+msgstr "Kein Stichwort angegeben"
+
+#: ../lib/tags.php:186
+msgid "No tag deleted."
+msgstr "Kein Stichwort gelöscht"
+
+#: ../lib/tags.php:188
+#, php-format
+msgid "%1s tag(s) deleted."
+msgstr "%1s Stichwörter gelöscht"
+
+#: ../lib/tags.php:202
+msgid "No new slug(s) specified!"
+msgstr "Keine neuen Stichwörter ausgewählt"
+
+#: ../lib/tags.php:214
+msgid "Tags number and slugs number isn't the same!"
+msgstr "Stichwort und Schlagwort ist nicht das Gleiche!"
+
+#: ../lib/tags.php:241
+msgid "No slug edited."
+msgstr "Kein Stichwort geändert"
+
+#: ../lib/tags.php:243
+#, php-format
+msgid "%s slug(s) edited."
+msgstr "%s Stichwörter geändert"
+
+#: ../lib/xmlrpc.php:66
+#, php-format
+msgid "XML-RPC services are disabled on this blog.  An admin user can enable them at %s"
+msgstr "XML-RPC Service ist ausgeschaltet. Der Administrator kann es hier %s einschalten"
+
+#: ../lib/xmlrpc.php:73
+msgid "Bad login/pass combination."
+msgstr "Username/Password falsch"
+
+#: ../lib/xmlrpc.php:129
+msgid "You are not allowed to upload files to this site."
+msgstr "Du hast keine Berechtigung, Bilder hochzuladen"
+
+#: ../lib/xmlrpc.php:135
+#: ../lib/xmlrpc.php:680
+msgid "Could not find gallery "
+msgstr "Konnte Galerie nicht finden"
+
+#: ../lib/xmlrpc.php:140
+#: ../lib/xmlrpc.php:685
+msgid "You are not allowed to upload files to this gallery."
+msgstr "Du hast keine Berechtigung, Bilder in diese Galerie zuladen"
+
+#: ../lib/xmlrpc.php:152
+msgid "This is no valid image file."
+msgstr "Das ist keine zulässige Bilddatei!"
+
+#: ../lib/xmlrpc.php:164
+msgid "Could not find image id "
+msgstr "Konnte die Bild-ID nicht finden"
+
+#: ../lib/xmlrpc.php:171
+#, php-format
+msgid "Failed to delete image %1$s "
+msgstr "Konnte das Bild %1$s nicht löschen"
+
+#: ../lib/xmlrpc.php:180
+#, php-format
+msgid "Could not write file %1$s (%2$s)"
+msgstr "Konnte die Datei %1$s (%2$s) nicht schreiben "
+
+#: ../lib/xmlrpc.php:247
+#: ../lib/xmlrpc.php:299
+msgid "Invalid image ID"
+msgstr "Keine gültige Bilder ID"
+
+#: ../lib/xmlrpc.php:250
+#: ../lib/xmlrpc.php:302
+msgid "Sorry, you must be able to edit this image"
+msgstr "Sorry, Du hast nicht das Recht, dieses Bild zu bearbeiten"
+
+#: ../lib/xmlrpc.php:308
+msgid "Sorry, could not update the image"
+msgstr "Konnte das Bild nicht aktualisieren"
+
+#: ../lib/xmlrpc.php:344
+#: ../lib/xmlrpc.php:576
+#: ../lib/xmlrpc.php:642
+msgid "Sorry, you must be able to manage galleries"
+msgstr "Sorry, Du hast nicht das Recht, diese Galerie zu bearbeiten"
+
+#: ../lib/xmlrpc.php:350
+msgid "Sorry, could not create the gallery"
+msgstr "Konnte die Galerie nicht anlegen"
+
+#: ../lib/xmlrpc.php:393
+#: ../lib/xmlrpc.php:573
+msgid "Invalid gallery ID"
+msgstr "Keine gültige Galerie ID"
+
+#: ../lib/xmlrpc.php:396
+msgid "Sorry, you must be able to manage this gallery"
+msgstr "Sorry, Du hast nicht das Recht, diese Galerie zu bearbeiten"
+
+#: ../lib/xmlrpc.php:402
+msgid "Sorry, could not update the gallery"
+msgstr "Konnte die Galerie nicht aktualisieren"
+
+#: ../lib/xmlrpc.php:442
+#: ../lib/xmlrpc.php:494
+#: ../lib/xmlrpc.php:536
+#: ../lib/xmlrpc.php:609
+msgid "Sorry, you must be able to manage albums"
+msgstr "Sorry, Du hast nicht das Recht, dieses Album zu bearbeiten"
+
+#: ../lib/xmlrpc.php:448
+msgid "Sorry, could not create the album"
+msgstr "Konnte das Album nicht anlegen"
+
+#: ../lib/xmlrpc.php:491
+#: ../lib/xmlrpc.php:533
+msgid "Invalid album ID"
+msgstr "Ungültige Album ID"
+
+#: ../lib/xmlrpc.php:500
+msgid "Sorry, could not update the album"
+msgstr "Konnte das Album nicht aktualisieren"
+
+#: ../view/album-compact.php:32
+#: ../view/album-extend.php:30
+msgid "Photos"
+msgstr "Fotos"
+
+#: ../view/gallery-caption.php:32
+#: ../view/gallery.php:32
+#: ../widgets/media-rss-widget.php:122
+msgid "[View with PicLens]"
+msgstr "[Mit PicLens anzeigen]"
+
+#: ../view/imagebrowser-caption.php:26
+#: ../view/imagebrowser-exif.php:30
+#: ../view/imagebrowser.php:26
+msgid "Back"
+msgstr "Zurueck"
+
+#: ../view/imagebrowser-caption.php:29
+#: ../view/imagebrowser-exif.php:33
+#: ../view/imagebrowser.php:29
+msgid "Next"
+msgstr "Vor"
+
+#: ../view/imagebrowser-caption.php:31
+#: ../view/imagebrowser-exif.php:35
+#: ../view/imagebrowser.php:31
+msgid "of"
+msgstr "von"
+
+#: ../view/imagebrowser-exif.php:38
+msgid "Meta data"
+msgstr "Metadaten"
+
+#: ../view/imagebrowser-exif.php:42
+msgid "Camera / Type"
+msgstr "Kameratyp"
+
+#: ../view/imagebrowser-exif.php:50
+msgid "Focal Length"
+msgstr "Brennweite"
+
+#: ../widgets/media-rss-widget.php:19
+msgid "Widget that displays Media RSS links for NextGEN Gallery."
+msgstr "Hiermit können NextGEN-Bilder als Media RSS eingebunden werden"
+
+#: ../widgets/media-rss-widget.php:20
+msgid "NextGEN Media RSS"
+msgstr "NextGEN Media RSS"
+
+#: ../widgets/media-rss-widget.php:68
+msgid "Media RSS"
+msgstr "Media RSS"
+
+#: ../widgets/media-rss-widget.php:69
+msgid "Link to the main image feed"
+msgstr "Link zum Bilder-Feed"
+
+#: ../widgets/media-rss-widget.php:79
+#: ../widgets/widgets.php:201
+msgid "Title :"
+msgstr "Titel :"
+
+#: ../widgets/media-rss-widget.php:87
+msgid "Show Media RSS icon"
+msgstr "Zeige Media RSS Icon"
+
+#: ../widgets/media-rss-widget.php:93
+msgid "Show the Media RSS link"
+msgstr "Zeige den globalen Media RSS Link"
+
+#: ../widgets/media-rss-widget.php:98
+msgid "Text for Media RSS link:"
+msgstr "Text für den globalen Media RSS Link:"
+
+#: ../widgets/media-rss-widget.php:104
+msgid "Tooltip text for Media RSS link:"
+msgstr "Tooltipp-Text für den globalen Media RSS Link."
+
+#: ../widgets/widgets.php:22
+msgid "Show a NextGEN Gallery Slideshow"
+msgstr "Binde eine NextGEN-Gallery-Slideshow ein"
+
+#: ../widgets/widgets.php:23
+msgid "NextGEN Slideshow"
+msgstr "NextGEN-Diashow"
+
+#: ../widgets/widgets.php:64
+msgid "<a href=\"http://www.macromedia.com/go/getflashplayer\">Get the Flash Player</a> to see the slideshow."
+msgstr "<a href=\"http://www.macromedia.com/go/getflashplayer\">Lade Dir den Flash Player</a>, um die Diashow zu sehen."
+
+#: ../widgets/widgets.php:121
+msgid "Title:"
+msgstr "Titel:"
+
+#: ../widgets/widgets.php:123
+msgid "Select Gallery:"
+msgstr "Wähle Galerie"
+
+#: ../widgets/widgets.php:125
+msgid "All images"
+msgstr "Alle Bilder"
+
+#: ../widgets/widgets.php:137
+msgid "Height:"
+msgstr "Höhe:"
+
+#: ../widgets/widgets.php:138
+msgid "Width:"
+msgstr "Breite:"
+
+#: ../widgets/widgets.php:160
+msgid "Add recent or random images from the galleries"
+msgstr "Füge die neusten Bilder oder Zufallsbilder aus NextGEN-Gallery ein"
+
+#: ../widgets/widgets.php:161
+msgid "NextGEN Widget"
+msgstr "NextGEN-Widget"
+
+#: ../widgets/widgets.php:207
+msgid "Show :"
+msgstr "Zeige als :"
+
+#: ../widgets/widgets.php:213
+msgid "Original images"
+msgstr "Original Bilder"
+
+#: ../widgets/widgets.php:222
+msgid "recent added "
+msgstr "zuletzt hinzugefügt"
+
+#: ../widgets/widgets.php:228
+msgid "Enable IE8 Web Slices"
+msgstr "IE8 Web Slices aktivieren"
+
+#: ../widgets/widgets.php:233
+msgid "Width x Height :"
+msgstr "Breite x Höhe :"
+
+#: ../widgets/widgets.php:239
+msgid "Select :"
+msgstr "Wähle :"
+
+#: ../widgets/widgets.php:241
+msgid "All galleries"
+msgstr "Alle Galerien"
+
+#: ../widgets/widgets.php:242
+msgid "Only which are not listed"
+msgstr "Nur ungelistete"
+
+#: ../widgets/widgets.php:243
+msgid "Only which are listed"
+msgstr "Nur gelistete"
+
+#: ../widgets/widgets.php:249
+msgid "Gallery ID :"
+msgstr "Galerie-ID :"
+
+#: ../widgets/widgets.php:251
+msgid "Gallery IDs, separated by commas."
+msgstr "Galerie-IDs, mit Kommas getrennt"
+
+#: ../xml/media-rss.php:50
+msgid "No galleries have been yet created."
+msgstr "Keine Galerie wurde derzeit erstellt."
+
+#: ../xml/media-rss.php:69
+#, php-format
+msgid "The gallery ID=%s does not exist."
+msgstr "Die Galerie ID=%s existiert nicht."
+
+#: ../xml/media-rss.php:100
+msgid "No album ID has been provided as parameter"
+msgstr "Es wurde kein Album als Parameter übergeben"
+
+#: ../xml/media-rss.php:108
+#, php-format
+msgid "The album ID=%s does not exist."
+msgstr "Album-ID  %s existiert nicht"
+
+#: ../xml/media-rss.php:115
+msgid "Invalid MediaRSS command"
+msgstr "Ungültiger Media-RSS-Befehl"
+
+#~ msgid "Cache single pictures"
+#~ msgstr "Nutze Cache für Einzelbilder"
+
+#~ msgid "Creates a file for each singlepic settings. Reduce the CPU load"
+#~ msgstr ""
+#~ "Erstellt ein Cache-Bild für jedes Einzelbild (singlepic). Reduziert die "
+#~ "CPU Belastung."
+
+#~ msgid "Currently not used, prepare database for upcoming version"
+#~ msgstr "Derzeit nicht genutzt, Vorbereitung für kommende Versionen"
+
+#~ msgid "Send a gift to show your appreciation."
+#~ msgstr "Schau doch einfach auf meinen Wunschzettel."
+
+#~ msgid "&laquo;"
+#~ msgstr "&laquo;"
+
+#~ msgid "&raquo;"
+#~ msgstr "&raquo;"
+
+#~ msgid "Displaying %s&#8211;%s of %s"
+#~ msgstr "Zeige %s&#8211;%s von %s"
+
+#~ msgid "Delete album ?"
+#~ msgstr "Album löschen ?"
+
+#~ msgid "A new version of NextGEN Gallery is available !"
+#~ msgstr "Eine neue Version von NextGEN Gallery ist jetzt verfügbar"
+
+#~ msgid "Download here"
+#~ msgstr "Hier downloaden"
+
+#~ msgid "already exists"
+#~ msgstr "gibt es bereits"
+
+#~ msgid "Gallery Overview"
+#~ msgstr "Galerie Übersicht"
+
+#~ msgid "Quantity"
+#~ msgstr "Anzahl"
+
+#~ msgid "Action"
+#~ msgstr "Aktion"
+
+#~ msgid "Delete this gallery ?"
+#~ msgstr "Diese Galerie löschen ?"
+
+#~ msgid "General WordPress MU Settings"
+#~ msgstr "WordPress-MU-Einstellungen"
+
+#~ msgid "No album"
+#~ msgstr "Kein Album"
+
+#~ msgid "for the Fugue Iconset"
+#~ msgstr "für das Fugue-Iconset"
+
+#~ msgid "Gallery Administrator"
+#~ msgstr "Galerie-Administrator"
+
+#~ msgid "Gallery Editor"
+#~ msgstr "Galerie-Mitarbeiter"
+
+#~ msgid "You currently have %s rights."
+#~ msgstr "Du hast derzeit %s Rechte."
+
+#~ msgid "Upload Space Remaining:"
+#~ msgstr "Verbleibender Speicher:"
+
+#~ msgid "View all images tagged with %s"
+#~ msgstr "Zeige alle Bilder, die mit dem Stichwort %s markiert sind"
+
+#~ msgid "Upgrade sucessful"
+#~ msgstr "Aktualisierung erfolgreich"
+
+#~ msgid ""
+#~ "<strong>Would you like to help to translate this plugin ?</strong> <a "
+#~ "target=\"_blank\" href=\"%s\">Download</a> the current pot file and read "
+#~ "<a href=\"http://alexrabe.de/wordpress-plugins/wordtube/translation-of-"
+#~ "plugins/\">here</a> how you can translate the plugin."
+#~ msgstr ""
+#~ "<strong>Would you like to help to translate this plugin ?</strong> <a "
+#~ "target=\"_blank\" href=\"%s\">Download</a> the current pot file and read "
+#~ "<a href=\"http://alexrabe.de/wordpress-plugins/wordtube/translation-of-"
+#~ "plugins/\">here</a> how you can translate the plugin."
+
+#~ msgid ""
+#~ "<strong>Translation by : </strong><a target=\"_blank\" href=\"\">N/A</a>"
+#~ msgstr ""
+#~ "<strong>Übersetzt von : </strong><a target=\"_blank\" href=\"\">Alex "
+#~ "Rabe</a>"
+
+#~ msgid "Setup Gallery"
+#~ msgstr "Galerie Setup"
+
+#~ msgid "Setup"
+#~ msgstr "Setup"
+
+#~ msgid "PHP Output Buffer Size"
+#~ msgstr "PHP Output Buffer Größe"
+
+#~ msgid "for PclZip , a PHP library that manage ZIP archives"
+#~ msgstr "für PclZip, eine ZIP PHP Library"
+
+#~ msgid "Crop square thumbnail from image"
+#~ msgstr "Mittige Thumbnails aus Bildern ausschneiden"
+
+#~ msgid "Create square thumbnails, use only the width setting :"
+#~ msgstr "Erstellt viereckige Thumbnails, nutzt nur den Wert der Breite :"
+
+#, fuzzy
+#~ msgid "Search Media"
+#~ msgstr "Suche nach Stichwörter"
+
+#~ msgid "Select Gallery"
+#~ msgstr "Wähle Galerie"
+
+#~ msgid "Album Page ID"
+#~ msgstr "Album Seiten ID (Page ID)"
+
+#~ msgid "Import a folder with all images."
+#~ msgstr "Importiere ein Verzeichnis mit Bildern."
+
+#~ msgid "Show tags"
+#~ msgstr "Zeige Tags"
+
+#~ msgid "Hide tags"
+#~ msgstr "Verstecke Tags"
+
+#~ msgid "Delete this file ?"
+#~ msgstr "Diese Datei löschen ?"
+
+#~ msgid ""
+#~ "You are about to copy or move %s images \n"
+#~ " \n"
+#~ " 'Cancel' to stop, 'OK' to proceed."
+#~ msgstr ""
+#~ "Willst du wirklich %s Bild(er) verschieben \n"
+#~ " \n"
+#~ " 'Abbrechen' um zu stoppen, 'OK' um die Bearbeitung durchzuführen."
+
+#~ msgid "Show thumbnails "
+#~ msgstr "Thumbnails zeigen"
+
+#~ msgid "Add Gallery"
+#~ msgstr "Bilder/Galerie hinzufügen"
+
+#~ msgid "Manage galleries"
+#~ msgstr "Galerie verwalten"
+
+#~ msgid ""
+#~ "There are totally %1$s pictures in %2$s galleries, which are spread "
+#~ "across %3$s albums."
+#~ msgstr ""
+#~ "Es gibt insgesamt %1$s Bilder in %2$s Galerien - verteilt in %3$s Alben."
+
+#~ msgid "GD support"
+#~ msgstr "GD Unterstützung"
+
+#~ msgid "ImageMagick"
+#~ msgstr "ImageMagick"
+
+#~ msgid "Add Metadata :"
+#~ msgstr "Metadaten hinzufügen :"
+
+#~ msgid "Import EXIF, IPTC or XMP data (if available)"
+#~ msgstr "EXIF, IPTC oder XMP Daten importieren (wenn verfügbar)"
+
+#~ msgid "New Version available"
+#~ msgstr "Neue Version verfügbar !!"
+
+#~ msgid ""
+#~ "The server reports that a new NextGEN Gallery Version is now available. "
+#~ "Please visit the plugin homepage for more information."
+#~ msgstr ""
+#~ "Der Server benachrichtigt Dich über eine neu verfügbare Version der "
+#~ "NextGEN Galerie. Bitte besuche die Plugin Homepage um weitere "
+#~ "Informationen zu erhalten."
+
+#~ msgid "Resample Mode"
+#~ msgstr "Resample Modus"
+
+#~ msgid "Value between 1-5 (higher value, more CPU load)"
+#~ msgstr "Wähle zwischen 1-5 (je höhere desto länger braucht der Server)"
+
+#~ msgid "NextGEN Gallery %d"
+#~ msgstr "NextGEN Gallery %d"
+
+#~ msgid "How many NextGEN Gallery widgets would you like?"
+#~ msgstr "Wie viele NextGEN Gallery Widgets möchtest du haben ?"
+
+#~ msgid "Save"
+#~ msgstr "Speichern"
+
+#~ msgid "for Simple:Press Forum, it saved me a lot of time"
+#~ msgstr "für das  Simple:Press Forum, welches mir viel Zeit sparte"
+
+#~ msgid "Sorry, NextGEN Gallery works only under WordPress 2.5 or higher"
+#~ msgstr ""
+#~ "Tut mir leid aber NextGEN Gallery arbeitet nur ab WordPress 2.5 und "
+#~ "aufwärts"
+
+#~ msgid "Watch gallery"
+#~ msgstr "Galerie ansehen"
+
+#~ msgid "from"
+#~ msgstr "von"
+
+#~ msgid " : Image resized..."
+#~ msgstr " : Bild angepasst..."
+
+#~ msgid "Some pictures are not writeable :"
+#~ msgstr "Einige Bilder sind schreibgeschützt :"
+
+#~ msgid " : Watermark created..."
+#~ msgstr " : Wasserzeichen gesetzt..."
+
+#~ msgid " : Thumbnail created..."
+#~ msgstr ": Thumbnail erstellt..."
+
+#~ msgid "Follow thumbnails could not created."
+#~ msgstr "Folgende Thumbnails konnten nicht erstellt werden  :"
+
+#~ msgid "Some thumbnails are not writeable :"
+#~ msgstr "Einige Thumbnails sind schreibgeschützt :"
+
+#~ msgid "Watermark successfully added"
+#~ msgstr "Wasserzeichen erfolgreich erstellt"
+
+#~ msgid "Images successfully resized"
+#~ msgstr "Bilder erfolgreich verkleinert"
+
+#~ msgid " (require WordPress 2.3 or higher)"
+#~ msgstr " (benötigt WordPress 2.3 oder höher)"
+
+#~ msgid "Show thumbnail description"
+#~ msgstr "Zeige Bildbeschreibung"
+
+#~ msgid "Description text"
+#~ msgstr "Beschreibung"
+
+#~ msgid "Import a folder with images. Please note :"
+#~ msgstr "Importiere ein Verzeichnis mit Bildern. Bitte beachte:"
+
+#~ msgid "For safe-mode = ON you need to add the subfolder thumbs manually"
+#~ msgstr ""
+#~ "Da der Safe-Mode  (PHP.INI) eingeschaltet ist, mußt Du das "
+#~ "Unterverzeichnis für die Vorschaubilder (\"thumbs\") manuell (per FTP) "
+#~ "anlegen"
+
+#~ msgid "The Zip-file is too large. Exceed Memory limit !"
+#~ msgstr "Das Zip-File ist zu groß. Speicherlimit überschritten !"
+
+#~ msgid "Summary"
+#~ msgstr "Zusammenfassung"
+
+#~ msgid "Welcome"
+#~ msgstr "Willkommen"
+
+#~ msgid ""
+#~ "Welcome to NextGEN Gallery. Here you can control your images, galleries "
+#~ "and albums. You currently have %s rights."
+#~ msgstr ""
+#~ "Willkommen zur NextGEN Galerie. Hier kannst Du Deine Bilder, Galerien und "
+#~ "Alben verwalten. Du hast im Moment %s Rechte."
+
+#~ msgid "Add a new gallery or import pictures"
+#~ msgstr "Neue Galerie erstellen oder Bilder importieren"
+
+#~ msgid "Manage galleries and images"
+#~ msgstr "Verwalte Galerien und Bilder"
+
+#~ msgid "URL"
+#~ msgstr "URL"
+
+#~ msgid "Delete File"
+#~ msgstr "Datei löschen"
+
+#~ msgid "Delete image ?"
+#~ msgstr "Bilder löschen ?"
+
+#~ msgid "Browse your files"
+#~ msgstr "Durchsuche deine Dateien"
+
+#~ msgid "Direct link to file"
+#~ msgstr "Link zur Datei"
+
+#~ msgid "Show:"
+#~ msgstr "Zeige als:"
+
+#~ msgid "Link to:"
+#~ msgstr "Link zu:"
+
+#~ msgid "Send to editor &raquo;"
+#~ msgstr "Zum  Editor schicken &raquo;"
+
+#~ msgid ""
+#~ "Are you sure you want to delete the file '%s'?\n"
+#~ "Click ok to delete or cancel to go back."
+#~ msgstr "Bist du sicher das Du diese Datei '%s' löschen willst ?"
+
+#~ msgid "Alt/Titel text"
+#~ msgstr "Alt / Titel Text"
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lang/nggallery.pot b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lang/nggallery.pot
new file mode 100644
index 0000000000000000000000000000000000000000..590320276b77ec51496d3a28488cf7028bedd7be
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lang/nggallery.pot
@@ -0,0 +1,3640 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: NextGEN Gallery\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-10-23 18:02+0100\n"
+"PO-Revision-Date: 2011-10-23 18:03+0100\n"
+"Last-Translator: Alex Rabe\n"
+"Language-Team: Alex Rabe\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-KeywordsList: _n:1,2;__;_e;esc_attr_e;esc_html_e\n"
+"X-Poedit-Basepath: .\n"
+"X-Poedit-Country: GERMANY\n"
+"X-Poedit-SourceCharset: utf-8\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"X-Poedit-SearchPath-0: .\n"
+"X-Poedit-SearchPath-1: ..\n"
+
+#: ../nggallery.php:100
+msgid "<strong>Translation by : </strong><a target=\"_blank\" href=\"http://alexrabe.de/wordpress-plugins/nextgen-gallery/languages/\">See here</a>"
+msgstr ""
+
+#: ../nggallery.php:101
+msgid "<strong>This translation is not yet updated for Version 1.9.0</strong>. If you would like to help with translation, download the current po from the plugin folder and read <a href=\"http://alexrabe.de/wordpress-plugins/wordtube/translation-of-plugins/\">here</a> how you can translate the plugin."
+msgstr ""
+
+#: ../nggallery.php:205
+msgid "Sorry, NextGEN Gallery works only with a Memory Limit of 16 MB or higher"
+msgstr ""
+
+#: ../nggallery.php:225
+msgid "Please update the database of NextGEN Gallery."
+msgstr ""
+
+#: ../nggallery.php:225
+msgid "Click here to proceed."
+msgstr ""
+
+#: ../nggallery.php:248
+msgid "Picture tag"
+msgstr ""
+
+#: ../nggallery.php:249
+msgid "Picture tag: %2$l."
+msgstr ""
+
+#: ../nggallery.php:250
+msgid "Separate picture tags with commas."
+msgstr ""
+
+#: ../nggallery.php:357
+#: ../admin/admin.php:256
+msgid "L O A D I N G"
+msgstr ""
+
+#: ../nggallery.php:358
+#: ../admin/admin.php:257
+msgid "Click to Close"
+msgstr ""
+
+#: ../nggallery.php:379
+msgid "loading"
+msgstr ""
+
+#: ../nggallery.php:517
+#: ../nggfunctions.php:941
+#: ../admin/admin.php:37
+#: ../admin/admin.php:79
+msgid "Overview"
+msgstr ""
+
+#: ../nggallery.php:518
+msgid "Get help"
+msgstr ""
+
+#: ../nggallery.php:519
+msgid "Contribute"
+msgstr ""
+
+#: ../nggallery.php:520
+msgid "Donate"
+msgstr ""
+
+#: ../nggfunctions.php:42
+msgid "The <a href=\"http://www.macromedia.com/go/getflashplayer\">Flash Player</a> and <a href=\"http://www.mozilla.com/firefox/\">a browser with Javascript support</a> are needed."
+msgstr ""
+
+#: ../nggfunctions.php:164
+#: ../nggfunctions.php:642
+msgid "[Gallery not found]"
+msgstr ""
+
+#: ../nggfunctions.php:450
+msgid "[Album not found]"
+msgstr ""
+
+#: ../nggfunctions.php:771
+msgid "[SinglePic not found]"
+msgstr ""
+
+#: ../nggfunctions.php:906
+msgid "Related images for"
+msgstr ""
+
+#: ../admin/about.php:10
+msgid "Copyright notes / Credits"
+msgstr ""
+
+#: ../admin/about.php:13
+msgid "NextGEN DEV Team"
+msgstr ""
+
+#: ../admin/about.php:15
+msgid "This plugin is primarily developed, maintained, supported, documented by"
+msgstr ""
+
+#: ../admin/about.php:15
+msgid "There are many other folks who have made contributions to this project :"
+msgstr ""
+
+#: ../admin/about.php:20
+msgid "Contributors / Tribute to"
+msgstr ""
+
+#: ../admin/about.php:22
+msgid "If you study the code of this plugin, you will find out that we mixed a lot of good already existing code and ideas together."
+msgstr ""
+
+#: ../admin/about.php:23
+msgid "So, we would like to thank the following people for their pioneer work (without this work it's impossible to create such a plugin so fast)"
+msgstr ""
+
+#: ../admin/about.php:25
+msgid "for their great documented code"
+msgstr ""
+
+#: ../admin/about.php:26
+msgid "for jQuery, which is the best Web2.0 framework"
+msgstr ""
+
+#: ../admin/about.php:27
+msgid "for the fantastic PHP Thumbnail Class"
+msgstr ""
+
+#: ../admin/about.php:28
+msgid "for a lot of very useful plugins and ideas"
+msgstr ""
+
+#: ../admin/about.php:29
+msgid "for Shutter Reloaded, a real lightweight image effect"
+msgstr ""
+
+#: ../admin/about.php:30
+msgid "for the best Media Flash Scripts on earth"
+msgstr ""
+
+#: ../admin/about.php:31
+msgid "for the Gallery Icon"
+msgstr ""
+
+#: ../admin/about.php:32
+msgid "for the Watermark plugin"
+msgstr ""
+
+#: ../admin/about.php:34
+msgid "If you didn't find your name on this list and there is some code which I integrate in my plugin, don't hesitate to send me a mail."
+msgstr ""
+
+#: ../admin/about.php:38
+msgid "How to support ?"
+msgstr ""
+
+#: ../admin/about.php:40
+msgid "There exist several ways to contribute, help or support us in this work. Non of them are mandatory."
+msgstr ""
+
+#: ../admin/about.php:42
+msgid "Send us bugfixes / code changes"
+msgstr ""
+
+#: ../admin/about.php:42
+msgid "The most motivated support for this plugin are your ideas and brain work"
+msgstr ""
+
+#: ../admin/about.php:43
+msgid "Translate the plugin"
+msgstr ""
+
+#: ../admin/about.php:43
+msgid "To help people to work with this plugin, I would like to have it in all available languages"
+msgstr ""
+
+#: ../admin/about.php:44
+msgid "Donate the work via paypal"
+msgstr ""
+
+#: ../admin/about.php:57
+msgid "No doubt a very useful and easy motivation :-)"
+msgstr ""
+
+#: ../admin/about.php:59
+msgid "Place a link to the plugin in your blog/webpage"
+msgstr ""
+
+#: ../admin/about.php:59
+msgid "Yes, share and trackback is also a good support for this work "
+msgstr ""
+
+#: ../admin/about.php:64
+msgid "Thanks!"
+msgstr ""
+
+#: ../admin/about.php:66
+msgid "We would like to thank this people which support us in the work :"
+msgstr ""
+
+#: ../admin/about.php:166
+msgid "and all donators..."
+msgstr ""
+
+#: ../admin/addgallery.php:46
+#: ../admin/addgallery.php:57
+#: ../admin/addgallery.php:69
+#: ../admin/addgallery.php:80
+#: ../admin/album.php:96
+#: ../admin/album.php:124
+#: ../admin/album.php:142
+#: ../admin/edit-thumbnail.php:19
+#: ../admin/edit-thumbnail.php:22
+#: ../admin/manage.php:186
+msgid "Cheatin&#8217; uh?"
+msgstr ""
+
+#: ../admin/addgallery.php:62
+msgid "Upload failed!"
+msgstr ""
+
+#: ../admin/addgallery.php:85
+#: ../admin/addgallery.php:93
+msgid "Upload failed! "
+msgstr ""
+
+#: ../admin/addgallery.php:90
+#: ../admin/functions.php:943
+#: ../admin/functions.php:1043
+msgid "No gallery selected !"
+msgstr ""
+
+#: ../admin/addgallery.php:180
+#: ../admin/addgallery.php:263
+msgid "Image Files"
+msgstr ""
+
+#: ../admin/addgallery.php:195
+#: ../admin/addgallery.php:284
+#: ../admin/addgallery.php:312
+msgid "remove"
+msgstr ""
+
+#: ../admin/addgallery.php:196
+#: ../admin/addgallery.php:285
+#: ../admin/addgallery.php:466
+msgid "Browse..."
+msgstr ""
+
+#: ../admin/addgallery.php:197
+#: ../admin/addgallery.php:235
+#: ../admin/addgallery.php:286
+#: ../admin/addgallery.php:298
+#: ../admin/addgallery.php:537
+msgid "Upload images"
+msgstr ""
+
+#: ../admin/addgallery.php:376
+#: ../admin/addgallery.php:484
+msgid "Upload Images"
+msgstr ""
+
+#: ../admin/addgallery.php:379
+#: ../admin/addgallery.php:396
+#: ../admin/manage-galleries.php:119
+#: ../admin/manage-galleries.php:156
+msgid "Add new gallery"
+msgstr ""
+
+#: ../admin/addgallery.php:382
+#: ../admin/addgallery.php:418
+msgid "Upload a Zip-File"
+msgstr ""
+
+#: ../admin/addgallery.php:385
+#: ../admin/addgallery.php:460
+msgid "Import image folder"
+msgstr ""
+
+#: ../admin/addgallery.php:401
+#: ../admin/manage-galleries.php:279
+msgid "New Gallery"
+msgstr ""
+
+#: ../admin/addgallery.php:404
+#: ../admin/manage-galleries.php:281
+msgid "Create a new , empty gallery below the folder"
+msgstr ""
+
+#: ../admin/addgallery.php:406
+#: ../admin/manage-galleries.php:283
+msgid "Allowed characters for file and folder names are"
+msgstr ""
+
+#: ../admin/addgallery.php:410
+msgid "Add gallery"
+msgstr ""
+
+#: ../admin/addgallery.php:423
+msgid "Select Zip-File"
+msgstr ""
+
+#: ../admin/addgallery.php:425
+msgid "Upload a zip file with images"
+msgstr ""
+
+#: ../admin/addgallery.php:429
+msgid "or enter a Zip-File URL"
+msgstr ""
+
+#: ../admin/addgallery.php:431
+msgid "Import a zip file with images from a url"
+msgstr ""
+
+#: ../admin/addgallery.php:435
+#: ../admin/addgallery.php:512
+msgid "in to"
+msgstr ""
+
+#: ../admin/addgallery.php:437
+msgid "a new gallery"
+msgstr ""
+
+#: ../admin/addgallery.php:448
+msgid "Note : The upload limit on your server is "
+msgstr ""
+
+#: ../admin/addgallery.php:452
+msgid "Start upload"
+msgstr ""
+
+#: ../admin/addgallery.php:465
+msgid "Import from Server path:"
+msgstr ""
+
+#: ../admin/addgallery.php:468
+msgid "Note : Change the default path in the gallery settings"
+msgstr ""
+
+#: ../admin/addgallery.php:470
+msgid " Please note : For safe-mode = ON you need to add the subfolder thumbs manually"
+msgstr ""
+
+#: ../admin/addgallery.php:473
+msgid "Import folder"
+msgstr ""
+
+#: ../admin/addgallery.php:490
+msgid "Upload image"
+msgstr ""
+
+#: ../admin/addgallery.php:495
+msgid "Choose files to upload"
+msgstr ""
+
+#: ../admin/addgallery.php:496
+msgid "Select Files"
+msgstr ""
+
+#: ../admin/addgallery.php:498
+msgid "Or you can drop the files into this window."
+msgstr ""
+
+#: ../admin/addgallery.php:501
+#, php-format
+msgid "Scale images to max width %1$dpx or max height %2$dpx"
+msgstr ""
+
+#: ../admin/addgallery.php:514
+msgid "Choose gallery"
+msgstr ""
+
+#: ../admin/addgallery.php:533
+msgid "The batch upload requires Adobe Flash 10, disable it if you have problems"
+msgstr ""
+
+#: ../admin/addgallery.php:533
+msgid "Disable flash upload"
+msgstr ""
+
+#: ../admin/addgallery.php:535
+msgid "Upload multiple files at once by ctrl/shift-selecting in dialog"
+msgstr ""
+
+#: ../admin/addgallery.php:535
+msgid "Enable flash based upload"
+msgstr ""
+
+#: ../admin/admin.php:36
+#: ../admin/admin.php:59
+#: ../admin/admin.php:78
+#: ../admin/admin.php:352
+#: ../admin/admin.php:444
+#: ../admin/functions.php:178
+#: ../admin/manage-galleries.php:127
+#: ../admin/manage-galleries.php:407
+#: ../admin/manage-images.php:239
+msgid "Gallery"
+msgid_plural "Galleries"
+msgstr[0] ""
+msgstr[1] ""
+
+#: ../admin/admin.php:38
+#: ../admin/admin.php:81
+msgid "Add Gallery / Images"
+msgstr ""
+
+#: ../admin/admin.php:39
+#: ../admin/admin.php:83
+msgid "Manage Gallery"
+msgstr ""
+
+#: ../admin/admin.php:40
+#: ../admin/admin.php:85
+msgid "Album"
+msgid_plural "Albums"
+msgstr[0] ""
+msgstr[1] ""
+
+#: ../admin/admin.php:41
+#: ../admin/admin.php:87
+msgid "Tags"
+msgstr ""
+
+#: ../admin/admin.php:42
+#: ../admin/admin.php:89
+msgid "Options"
+msgstr ""
+
+#: ../admin/admin.php:44
+#: ../admin/admin.php:91
+msgid "Style"
+msgstr ""
+
+#: ../admin/admin.php:46
+msgid "Roles"
+msgstr ""
+
+#: ../admin/admin.php:47
+msgid "About this Gallery"
+msgstr ""
+
+#: ../admin/admin.php:47
+#: ../admin/admin.php:92
+msgid "About"
+msgstr ""
+
+#: ../admin/admin.php:50
+#: ../admin/admin.php:61
+msgid "Reset / Uninstall"
+msgstr ""
+
+#: ../admin/admin.php:60
+msgid "Network settings"
+msgstr ""
+
+#: ../admin/admin.php:131
+#, php-format
+msgid "Thanks for using this plugin, I hope you are satisfied ! If you would like to support the further development, please consider a <strong><a href=\"%s\">donation</a></strong>! If you still need some help, please post your questions <a href=\"http://wordpress.org/tags/nextgen-gallery?forum_id=10\">here</a> ."
+msgstr ""
+
+#: ../admin/admin.php:134
+msgid "OK, hide this message now !"
+msgstr ""
+
+#: ../admin/admin.php:213
+msgid "You do not have the correct permission"
+msgstr ""
+
+#: ../admin/admin.php:214
+msgid "Unexpected Error"
+msgstr ""
+
+#: ../admin/admin.php:215
+msgid "A failure occurred"
+msgstr ""
+
+#: ../admin/admin.php:219
+msgid "You have attempted to queue too many files."
+msgstr ""
+
+#: ../admin/admin.php:220
+msgid "This file exceeds the maximum upload size for this site."
+msgstr ""
+
+#: ../admin/admin.php:221
+msgid "This file is empty. Please try another."
+msgstr ""
+
+#: ../admin/admin.php:222
+msgid "This file type is not allowed. Please try another."
+msgstr ""
+
+#: ../admin/admin.php:223
+msgid "This file is not an image. Please try another."
+msgstr ""
+
+#: ../admin/admin.php:224
+msgid "Memory exceeded. Please try another smaller file."
+msgstr ""
+
+#: ../admin/admin.php:225
+msgid "This is larger than the maximum size. Please try another."
+msgstr ""
+
+#: ../admin/admin.php:226
+msgid "An error occurred in the upload. Please try again later."
+msgstr ""
+
+#: ../admin/admin.php:227
+msgid "There was a configuration error. Please contact the server administrator."
+msgstr ""
+
+#: ../admin/admin.php:228
+msgid "You may only upload 1 file."
+msgstr ""
+
+#: ../admin/admin.php:229
+msgid "HTTP error."
+msgstr ""
+
+#: ../admin/admin.php:230
+msgid "Upload failed."
+msgstr ""
+
+#: ../admin/admin.php:231
+msgid "IO error."
+msgstr ""
+
+#: ../admin/admin.php:232
+msgid "Security error."
+msgstr ""
+
+#: ../admin/admin.php:233
+msgid "File canceled."
+msgstr ""
+
+#: ../admin/admin.php:234
+msgid "Upload stopped."
+msgstr ""
+
+#: ../admin/admin.php:235
+msgid "Dismiss"
+msgstr ""
+
+#: ../admin/admin.php:236
+msgid "Crunching&hellip;"
+msgstr ""
+
+#: ../admin/admin.php:237
+msgid "moved to the trash."
+msgstr ""
+
+#: ../admin/admin.php:238
+#, php-format
+msgid "&#8220;%s&#8221; has failed to upload due to an error"
+msgstr ""
+
+#: ../admin/admin.php:356
+msgid "<a href=\"http://dpotter.net/Technical/2008/03/nextgen-gallery-review-introduction/\" target=\"_blank\">Introduction</a>"
+msgstr ""
+
+#: ../admin/admin.php:359
+msgid "<a href=\"http://dpotter.net/Technical/2008/03/nextgen-gallery-review-introduction/\" target=\"_blank\">Setup</a>"
+msgstr ""
+
+#: ../admin/admin.php:362
+msgid "<a href=\"http://alexrabe.de/wordpress-plugins/nextgen-gallery/languages/\" target=\"_blank\">Translation by alex rabe</a>"
+msgstr ""
+
+#: ../admin/admin.php:365
+msgid "<a href=\"http://dpotter.net/Technical/2008/03/nextgen-gallery-review-introduction/\" target=\"_blank\">Roles / Capabilities</a>"
+msgstr ""
+
+#: ../admin/admin.php:368
+msgid "<a href=\"http://dpotter.net/Technical/2008/03/nextgen-gallery-review-introduction/\" target=\"_blank\">Styles</a>"
+msgstr ""
+
+#: ../admin/admin.php:369
+msgid "Templates"
+msgstr ""
+
+#: ../admin/admin.php:372
+#: ../admin/admin.php:378
+msgid "<a href=\"http://dpotter.net/Technical/2008/03/nextgen-gallery-review-introduction/\" target=\"_blank\">Gallery management</a>"
+msgstr ""
+
+#: ../admin/admin.php:373
+msgid "Gallery example"
+msgstr ""
+
+#: ../admin/admin.php:379
+#: ../admin/admin.php:389
+msgid "Gallery tags"
+msgstr ""
+
+#: ../admin/admin.php:382
+msgid "<a href=\"http://dpotter.net/Technical/2008/03/nextgen-gallery-review-introduction/\" target=\"_blank\">Album management</a>"
+msgstr ""
+
+#: ../admin/admin.php:383
+msgid "Album example"
+msgstr ""
+
+#: ../admin/admin.php:384
+#: ../admin/admin.php:390
+msgid "Album tags"
+msgstr ""
+
+#: ../admin/admin.php:387
+msgid "<a href=\"http://dpotter.net/Technical/2008/03/nextgen-gallery-review-introduction/\" target=\"_blank\">Gallery tags</a>"
+msgstr ""
+
+#: ../admin/admin.php:388
+msgid "Related images"
+msgstr ""
+
+#: ../admin/admin.php:393
+msgid "<a href=\"http://dpotter.net/Technical/2008/03/nextgen-gallery-review-image-management/\" target=\"_blank\">Image management</a>"
+msgstr ""
+
+#: ../admin/admin.php:394
+msgid "Custom fields"
+msgstr ""
+
+#: ../admin/admin.php:399
+msgid "Get help with NextGEN Gallery"
+msgstr ""
+
+#: ../admin/admin.php:403
+msgid "More Help & Info"
+msgstr ""
+
+#: ../admin/admin.php:405
+msgid "<a href=\"http://wordpress.org/tags/nextgen-gallery?forum_id=10\" target=\"_blank\">Support Forums</a>"
+msgstr ""
+
+#: ../admin/admin.php:406
+msgid "FAQ"
+msgstr ""
+
+#: ../admin/admin.php:407
+msgid "Feature request"
+msgstr ""
+
+#: ../admin/admin.php:408
+msgid "Get your language pack"
+msgstr ""
+
+#: ../admin/admin.php:409
+msgid "Contribute development"
+msgstr ""
+
+#: ../admin/admin.php:410
+msgid "Download latest version"
+msgstr ""
+
+#: ../admin/ajax.php:312
+msgid "You are not allowed to be here"
+msgstr ""
+
+#: ../admin/ajax.php:410
+#, php-format
+msgid "Could create image with %s x %s pixel"
+msgstr ""
+
+#: ../admin/album.php:102
+#: ../admin/album.php:117
+#: ../admin/album.php:158
+msgid "Update Successfully"
+msgstr ""
+
+#: ../admin/album.php:131
+msgid "Album deleted"
+msgstr ""
+
+#: ../admin/album.php:269
+msgid "Edit Album"
+msgstr ""
+
+#: ../admin/album.php:278
+msgid "Manage Albums"
+msgstr ""
+
+#: ../admin/album.php:284
+#: ../admin/album.php:333
+msgid "Select album"
+msgstr ""
+
+#: ../admin/album.php:286
+msgid "No album selected"
+msgstr ""
+
+#: ../admin/album.php:297
+#: ../admin/edit-thumbnail.php:155
+msgid "Update"
+msgstr ""
+
+#: ../admin/album.php:299
+msgid "Edit album"
+msgstr ""
+
+#: ../admin/album.php:302
+#: ../admin/manage-galleries.php:146
+#: ../admin/manage-images.php:448
+msgid "Delete"
+msgstr ""
+
+#: ../admin/album.php:306
+msgid "Add new album"
+msgstr ""
+
+#: ../admin/album.php:308
+msgid "Add"
+msgstr ""
+
+#: ../admin/album.php:319
+msgid "Show / hide used galleries"
+msgstr ""
+
+#: ../admin/album.php:319
+msgid "[Show all]"
+msgstr ""
+
+#: ../admin/album.php:320
+msgid "Maximize the widget content"
+msgstr ""
+
+#: ../admin/album.php:320
+msgid "[Maximize]"
+msgstr ""
+
+#: ../admin/album.php:321
+msgid "Minimize the widget content"
+msgstr ""
+
+#: ../admin/album.php:321
+msgid "[Minimize]"
+msgstr ""
+
+#: ../admin/album.php:323
+msgid "After you create and select a album, you can drag and drop a gallery or another album into your new album below"
+msgstr ""
+
+#: ../admin/album.php:349
+msgid "Select gallery"
+msgstr ""
+
+#: ../admin/album.php:378
+msgid "Album ID"
+msgstr ""
+
+#: ../admin/album.php:391
+msgid "No album selected!"
+msgstr ""
+
+#: ../admin/album.php:411
+msgid "Album name:"
+msgstr ""
+
+#: ../admin/album.php:417
+msgid "Album description:"
+msgstr ""
+
+#: ../admin/album.php:423
+msgid "Select a preview image:"
+msgstr ""
+
+#: ../admin/album.php:426
+#: ../admin/album.php:429
+msgid "No picture"
+msgstr ""
+
+#: ../admin/album.php:440
+#: ../admin/manage-images.php:257
+msgid "Page Link to"
+msgstr ""
+
+#: ../admin/album.php:442
+#: ../admin/manage-images.php:260
+msgid "Not linked"
+msgstr ""
+
+#: ../admin/album.php:455
+#: ../admin/manage-galleries.php:288
+#: ../admin/manage-galleries.php:317
+#: ../admin/manage-galleries.php:347
+#: ../admin/manage-images.php:533
+#: ../admin/manage-images.php:569
+#: ../admin/manage-images.php:598
+#: ../admin/manage-images.php:628
+msgid "OK"
+msgstr ""
+
+#: ../admin/album.php:457
+#: ../admin/manage-galleries.php:290
+#: ../admin/manage-galleries.php:319
+#: ../admin/manage-galleries.php:349
+#: ../admin/manage-images.php:535
+#: ../admin/manage-images.php:571
+#: ../admin/manage-images.php:600
+#: ../admin/manage-images.php:630
+msgid "Cancel"
+msgstr ""
+
+#: ../admin/album.php:543
+msgid "Name"
+msgstr ""
+
+#: ../admin/album.php:544
+#: ../admin/manage-images.php:255
+msgid "Title"
+msgstr ""
+
+#: ../admin/album.php:545
+msgid "Page"
+msgstr ""
+
+#: ../admin/edit-thumbnail.php:105
+msgid "Select with the mouse the area for the new thumbnail"
+msgstr ""
+
+#: ../admin/edit-thumbnail.php:119
+msgid "Thumbnail updated"
+msgstr ""
+
+#: ../admin/edit-thumbnail.php:124
+msgid "Error updating thumbnail"
+msgstr ""
+
+#: ../admin/edit-thumbnail.php:140
+msgid "Select the area for the thumbnail from the picture on the left."
+msgstr ""
+
+#: ../admin/functions.php:39
+msgid "No valid gallery name!"
+msgstr ""
+
+#: ../admin/functions.php:46
+#: ../admin/functions.php:55
+#: ../admin/functions.php:80
+#: ../admin/functions.php:149
+#: ../admin/functions.php:157
+msgid "Directory"
+msgstr ""
+
+#: ../admin/functions.php:46
+msgid "didn't exist. Please create first the main gallery folder "
+msgstr ""
+
+#: ../admin/functions.php:47
+#: ../admin/functions.php:56
+msgid "Check this link, if you didn't know how to set the permission :"
+msgstr ""
+
+#: ../admin/functions.php:55
+#: ../admin/functions.php:80
+msgid "is not writeable !"
+msgstr ""
+
+#: ../admin/functions.php:76
+#: ../admin/functions.php:85
+#: ../admin/functions.php:902
+msgid "Unable to create directory "
+msgstr ""
+
+#: ../admin/functions.php:89
+msgid "The server setting Safe-Mode is on !"
+msgstr ""
+
+#: ../admin/functions.php:90
+msgid "If you have problems, please create directory"
+msgstr ""
+
+#: ../admin/functions.php:91
+msgid "and the thumbnails directory"
+msgstr ""
+
+#: ../admin/functions.php:91
+msgid "with permission 777 manually !"
+msgstr ""
+
+#: ../admin/functions.php:116
+#, php-format
+msgid "Gallery ID %1$s successfully created. You can show this gallery in your post or page with the shortcode %2$s.<br/>"
+msgstr ""
+
+#: ../admin/functions.php:119
+#: ../admin/functions.php:217
+msgid "Edit gallery"
+msgstr ""
+
+#: ../admin/functions.php:149
+msgid "doesn&#96;t exist!"
+msgstr ""
+
+#: ../admin/functions.php:157
+msgid "contains no pictures"
+msgstr ""
+
+#: ../admin/functions.php:175
+msgid "Database error. Could not add gallery!"
+msgstr ""
+
+#: ../admin/functions.php:178
+msgid "successfully created!"
+msgstr ""
+
+#: ../admin/functions.php:212
+#: ../admin/functions.php:1019
+#: ../admin/manage-galleries.php:81
+#: ../admin/manage-galleries.php:148
+#: ../admin/manage-images.php:203
+#: ../admin/manage-images.php:342
+#: ../admin/manage.php:223
+#: ../admin/manage.php:299
+msgid "Create new thumbnails"
+msgstr ""
+
+#: ../admin/functions.php:215
+msgid " picture(s) successfully added"
+msgstr ""
+
+#: ../admin/functions.php:270
+#: ../admin/functions.php:350
+#: ../admin/functions.php:405
+#: ../admin/functions.php:502
+#: ../admin/functions.php:556
+msgid "Object didn't contain correct data"
+msgstr ""
+
+#: ../admin/functions.php:278
+msgid " is not writeable "
+msgstr ""
+
+#: ../admin/functions.php:360
+#: ../admin/functions.php:408
+#: ../admin/functions.php:508
+#: ../admin/functions.php:559
+msgid " is not writeable"
+msgstr ""
+
+#: ../admin/functions.php:562
+msgid "File do not exists"
+msgstr ""
+
+#: ../admin/functions.php:566
+msgid "Couldn't restore original image"
+msgstr ""
+
+#: ../admin/functions.php:682
+msgid "(Error : Couldn't not update data base)"
+msgstr ""
+
+#: ../admin/functions.php:689
+msgid "(Error : Couldn't not update meta data)"
+msgstr ""
+
+#: ../admin/functions.php:698
+msgid "(Error : Couldn't not find image)"
+msgstr ""
+
+#: ../admin/functions.php:836
+msgid "No valid URL path "
+msgstr ""
+
+#: ../admin/functions.php:852
+msgid "Import via cURL failed."
+msgstr ""
+
+#: ../admin/functions.php:869
+msgid "Uploaded file was no or a faulty zip file ! The server recognized : "
+msgstr ""
+
+#: ../admin/functions.php:886
+msgid "Could not get a valid foldername"
+msgstr ""
+
+#: ../admin/functions.php:897
+#, php-format
+msgid "Unable to create directory %s. Is its parent directory writable by the server?"
+msgstr ""
+
+#: ../admin/functions.php:912
+msgid "Zip-File successfully unpacked"
+msgstr ""
+
+#: ../admin/functions.php:951
+#: ../admin/functions.php:1068
+msgid "Failure in database, no gallery path set !"
+msgstr ""
+
+#: ../admin/functions.php:975
+#: ../admin/functions.php:1062
+msgid "is no valid image file!"
+msgstr ""
+
+#: ../admin/functions.php:989
+#: ../admin/functions.php:1187
+#: ../admin/functions.php:1264
+#, php-format
+msgid "Unable to write to directory %s. Is this directory writable by the server?"
+msgstr ""
+
+#: ../admin/functions.php:996
+#: ../admin/functions.php:1085
+msgid "Error, the file could not be moved to : "
+msgstr ""
+
+#: ../admin/functions.php:1001
+#: ../admin/functions.php:1089
+msgid "Error, the file permissions could not be set"
+msgstr ""
+
+#: ../admin/functions.php:1024
+msgid " Image(s) successfully added"
+msgstr ""
+
+#: ../admin/functions.php:1051
+msgid "Invalid upload. Error Code : "
+msgstr ""
+
+#: ../admin/functions.php:1127
+#, php-format
+msgid "SAFE MODE Restriction in effect! You need to create the folder <strong>%s</strong> manually"
+msgstr ""
+
+#: ../admin/functions.php:1128
+#, php-format
+msgid "When safe_mode is on, PHP checks to see if the owner (%s) of the current script matches the owner (%s) of the file to be operated on by a file function or its directory"
+msgstr ""
+
+#: ../admin/functions.php:1181
+#: ../admin/functions.php:1258
+msgid "The destination gallery does not exist"
+msgstr ""
+
+#: ../admin/functions.php:1212
+#, php-format
+msgid "Failed to move image %1$s to %2$s"
+msgstr ""
+
+#: ../admin/functions.php:1232
+#, php-format
+msgid "Moved %1$s picture(s) to gallery : %2$s ."
+msgstr ""
+
+#: ../admin/functions.php:1291
+#, php-format
+msgid "Failed to copy image %1$s to %2$s"
+msgstr ""
+
+#: ../admin/functions.php:1305
+#, php-format
+msgid "Failed to copy database row for picture %s"
+msgstr ""
+
+#: ../admin/functions.php:1317
+#, php-format
+msgid "Image %1$s (%2$s) copied as image %3$s (%4$s) &raquo; The file already existed in the destination gallery."
+msgstr ""
+
+#: ../admin/functions.php:1320
+#, php-format
+msgid "Image %1$s (%2$s) copied as image %3$s (%4$s)"
+msgstr ""
+
+#: ../admin/functions.php:1329
+#, php-format
+msgid "Copied %1$s picture(s) to gallery: %2$s ."
+msgstr ""
+
+#: ../admin/functions.php:1437
+msgid "The uploaded file exceeds the upload_max_filesize directive in php.ini"
+msgstr ""
+
+#: ../admin/functions.php:1440
+msgid "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form"
+msgstr ""
+
+#: ../admin/functions.php:1443
+msgid "The uploaded file was only partially uploaded"
+msgstr ""
+
+#: ../admin/functions.php:1446
+msgid "No file was uploaded"
+msgstr ""
+
+#: ../admin/functions.php:1449
+msgid "Missing a temporary folder"
+msgstr ""
+
+#: ../admin/functions.php:1452
+msgid "Failed to write file to disk"
+msgstr ""
+
+#: ../admin/functions.php:1455
+msgid "File upload stopped by extension"
+msgstr ""
+
+#: ../admin/functions.php:1458
+msgid "Unknown upload error"
+msgstr ""
+
+#: ../admin/install.php:23
+msgid "Sorry, NextGEN Gallery works only with a role called administrator"
+msgstr ""
+
+#: ../admin/install.php:112
+msgid "NextGEN Gallery : Tables could not created, please check your database settings"
+msgstr ""
+
+#: ../admin/install.php:170
+msgid "[Show slideshow]"
+msgstr ""
+
+#: ../admin/install.php:171
+msgid "[Show thumbnails]"
+msgstr ""
+
+#: ../admin/manage-galleries.php:69
+#: ../admin/manage-images.php:171
+msgid "No images selected"
+msgstr ""
+
+#: ../admin/manage-galleries.php:77
+#: ../admin/manage-galleries.php:149
+#: ../admin/manage-images.php:199
+#: ../admin/manage-images.php:343
+#: ../admin/manage.php:207
+#: ../admin/manage.php:285
+msgid "Resize images"
+msgstr ""
+
+#: ../admin/manage-galleries.php:86
+#, php-format
+msgid ""
+"You are about to start the bulk edit for %s galleries \n"
+" \n"
+" 'Cancel' to stop, 'OK' to proceed."
+msgstr ""
+
+#: ../admin/manage-galleries.php:130
+#: ../admin/manage-galleries.php:133
+#: ../admin/manage-images.php:225
+#: ../admin/manage-images.php:228
+msgid "Search Images"
+msgstr ""
+
+#: ../admin/manage-galleries.php:145
+#: ../admin/manage-images.php:340
+msgid "Bulk actions"
+msgstr ""
+
+#: ../admin/manage-galleries.php:147
+#: ../admin/manage-images.php:341
+#: ../admin/manage.php:140
+#: ../admin/manage.php:249
+msgid "Set watermark"
+msgstr ""
+
+#: ../admin/manage-galleries.php:150
+#: ../admin/manage-images.php:346
+#: ../admin/manage.php:145
+#: ../admin/manage.php:269
+msgid "Import metadata"
+msgstr ""
+
+#: ../admin/manage-galleries.php:151
+#: ../admin/manage-images.php:344
+#: ../admin/manage.php:135
+#: ../admin/manage.php:246
+msgid "Recover from backup"
+msgstr ""
+
+#: ../admin/manage-galleries.php:153
+#: ../admin/manage-images.php:355
+msgid "Apply"
+msgstr ""
+
+#: ../admin/manage-galleries.php:220
+msgid "Edit"
+msgstr ""
+
+#: ../admin/manage-galleries.php:261
+#: ../admin/manage-images.php:506
+msgid "No entries found"
+msgstr ""
+
+#: ../admin/manage-galleries.php:308
+#: ../admin/manage-images.php:589
+msgid "Resize Images to"
+msgstr ""
+
+#: ../admin/manage-galleries.php:312
+#: ../admin/manage-images.php:593
+msgid "Width x height (in pixel). NextGEN Gallery will keep ratio size"
+msgstr ""
+
+#: ../admin/manage-galleries.php:336
+#: ../admin/manage-images.php:617
+msgid "Width x height (in pixel)"
+msgstr ""
+
+#: ../admin/manage-galleries.php:338
+#: ../admin/manage-images.php:619
+msgid "These values are maximum values "
+msgstr ""
+
+#: ../admin/manage-galleries.php:341
+#: ../admin/manage-images.php:622
+msgid "Set fix dimension"
+msgstr ""
+
+#: ../admin/manage-galleries.php:343
+#: ../admin/manage-images.php:624
+msgid "Ignore the aspect ratio, no portrait thumbnails"
+msgstr ""
+
+#: ../admin/manage-galleries.php:406
+#: ../admin/manage-images.php:694
+msgid "ID"
+msgstr ""
+
+#: ../admin/manage-galleries.php:408
+#: ../admin/manage-images.php:266
+#: ../admin/manage-images.php:697
+msgid "Description"
+msgstr ""
+
+#: ../admin/manage-galleries.php:409
+#: ../admin/manage-images.php:295
+msgid "Author"
+msgstr ""
+
+#: ../admin/manage-galleries.php:410
+msgid "Page ID"
+msgstr ""
+
+#: ../admin/manage-galleries.php:411
+msgid "Image"
+msgid_plural "Images"
+msgstr[0] ""
+msgstr[1] ""
+
+#: ../admin/manage-images.php:34
+msgid "Gallery not found."
+msgstr ""
+
+#: ../admin/manage-images.php:40
+msgid "Sorry, you have no access here"
+msgstr ""
+
+#: ../admin/manage-images.php:179
+msgid "Copy image to..."
+msgstr ""
+
+#: ../admin/manage-images.php:183
+msgid "Move image to..."
+msgstr ""
+
+#: ../admin/manage-images.php:187
+msgid "Add new tags"
+msgstr ""
+
+#: ../admin/manage-images.php:191
+#: ../admin/manage-images.php:352
+msgid "Delete tags"
+msgstr ""
+
+#: ../admin/manage-images.php:195
+msgid "Overwrite"
+msgstr ""
+
+#: ../admin/manage-images.php:208
+#, php-format
+msgid ""
+"You are about to start the bulk edit for %s images \n"
+" \n"
+" 'Cancel' to stop, 'OK' to proceed."
+msgstr ""
+
+#: ../admin/manage-images.php:222
+#, php-format
+msgid "Search results for &#8220;%s&#8221;"
+msgstr ""
+
+#: ../admin/manage-images.php:251
+msgid "Gallery settings"
+msgstr ""
+
+#: ../admin/manage-images.php:251
+msgid "Click here for more settings"
+msgstr ""
+
+#: ../admin/manage-images.php:268
+msgid "Preview image"
+msgstr ""
+
+#: ../admin/manage-images.php:271
+msgid "No Picture"
+msgstr ""
+
+#: ../admin/manage-images.php:293
+msgid "Path"
+msgstr ""
+
+#: ../admin/manage-images.php:310
+msgid "Create new page"
+msgstr ""
+
+#: ../admin/manage-images.php:313
+msgid "Main page (No parent)"
+msgstr ""
+
+#: ../admin/manage-images.php:316
+msgid "Add page"
+msgstr ""
+
+#: ../admin/manage-images.php:325
+msgid "Scan Folder for new images"
+msgstr ""
+
+#: ../admin/manage-images.php:326
+#: ../admin/manage-images.php:361
+#: ../admin/manage-images.php:513
+msgid "Save Changes"
+msgstr ""
+
+#: ../admin/manage-images.php:345
+msgid "Delete images"
+msgstr ""
+
+#: ../admin/manage-images.php:347
+msgid "Rotate images clockwise"
+msgstr ""
+
+#: ../admin/manage-images.php:348
+msgid "Rotate images counter-clockwise"
+msgstr ""
+
+#: ../admin/manage-images.php:349
+msgid "Copy to..."
+msgstr ""
+
+#: ../admin/manage-images.php:350
+msgid "Move to..."
+msgstr ""
+
+#: ../admin/manage-images.php:351
+msgid "Add tags"
+msgstr ""
+
+#: ../admin/manage-images.php:353
+msgid "Overwrite tags"
+msgstr ""
+
+#: ../admin/manage-images.php:358
+msgid "Sort gallery"
+msgstr ""
+
+#: ../admin/manage-images.php:434
+msgid "pixel"
+msgstr ""
+
+#: ../admin/manage-images.php:440
+#, php-format
+msgid "View \"%s\""
+msgstr ""
+
+#: ../admin/manage-images.php:440
+msgid "View"
+msgstr ""
+
+#: ../admin/manage-images.php:441
+msgid "Show Meta data"
+msgstr ""
+
+#: ../admin/manage-images.php:441
+msgid "Meta"
+msgstr ""
+
+#: ../admin/manage-images.php:442
+msgid "Customize thumbnail"
+msgstr ""
+
+#: ../admin/manage-images.php:442
+msgid "Edit thumb"
+msgstr ""
+
+#: ../admin/manage-images.php:443
+msgid "Rotate"
+msgstr ""
+
+#: ../admin/manage-images.php:445
+msgid "Publish this image"
+msgstr ""
+
+#: ../admin/manage-images.php:445
+msgid "Publish"
+msgstr ""
+
+#: ../admin/manage-images.php:447
+msgid "Recover"
+msgstr ""
+
+#: ../admin/manage-images.php:447
+#, php-format
+msgid "Recover \"%s\" ?"
+msgstr ""
+
+#: ../admin/manage-images.php:448
+#, php-format
+msgid "Delete \"%s\" ?"
+msgstr ""
+
+#: ../admin/manage-images.php:529
+msgid "Enter the tags"
+msgstr ""
+
+#: ../admin/manage-images.php:553
+msgid "Select the destination gallery:"
+msgstr ""
+
+#: ../admin/manage-images.php:695
+msgid "Thumbnail"
+msgstr ""
+
+#: ../admin/manage-images.php:696
+#: ../admin/manage-sort.php:77
+msgid "Filename"
+msgstr ""
+
+#: ../admin/manage-images.php:697
+msgid "Alt &amp; Title Text"
+msgstr ""
+
+#: ../admin/manage-images.php:698
+msgid "Tags (comma separated list)"
+msgstr ""
+
+#: ../admin/manage-images.php:699
+msgid "exclude"
+msgstr ""
+
+#: ../admin/manage-sort.php:33
+msgid "Sort order changed"
+msgstr ""
+
+#: ../admin/manage-sort.php:62
+msgid "Sort Gallery"
+msgstr ""
+
+#: ../admin/manage-sort.php:66
+msgid "Update Sort Order"
+msgstr ""
+
+#: ../admin/manage-sort.php:69
+msgid "Back to gallery"
+msgstr ""
+
+#: ../admin/manage-sort.php:74
+msgid "Presort"
+msgstr ""
+
+#: ../admin/manage-sort.php:75
+msgid "Unsorted"
+msgstr ""
+
+#: ../admin/manage-sort.php:76
+msgid "Image ID"
+msgstr ""
+
+#: ../admin/manage-sort.php:78
+msgid "Alt/Title text"
+msgstr ""
+
+#: ../admin/manage-sort.php:79
+msgid "Date/Time"
+msgstr ""
+
+#: ../admin/manage-sort.php:80
+msgid "Ascending"
+msgstr ""
+
+#: ../admin/manage-sort.php:81
+msgid "Descending"
+msgstr ""
+
+#: ../admin/manage.php:84
+msgid "Picture"
+msgstr ""
+
+#: ../admin/manage.php:84
+msgid "deleted successfully"
+msgstr ""
+
+#: ../admin/manage.php:99
+#: ../admin/manage.php:108
+msgid "Operation successful. Please clear your browser cache."
+msgstr ""
+
+#: ../admin/manage.php:175
+msgid "Gallery deleted successfully "
+msgstr ""
+
+#: ../admin/manage.php:240
+#: ../admin/manage.php:243
+msgid "Rotate images"
+msgstr ""
+
+#: ../admin/manage.php:265
+msgid "Pictures deleted successfully "
+msgstr ""
+
+#: ../admin/manage.php:361
+msgid "Tags changed"
+msgstr ""
+
+#: ../admin/manage.php:397
+msgid "Update successful"
+msgstr ""
+
+#: ../admin/manage.php:432
+msgid "New gallery page ID"
+msgstr ""
+
+#: ../admin/manage.php:432
+msgid "created"
+msgstr ""
+
+#: ../admin/manage.php:468
+msgid "Published a new post"
+msgstr ""
+
+#: ../admin/manage.php:582
+#, php-format
+msgid "1 item"
+msgid_plural "%s items"
+msgstr[0] ""
+msgstr[1] ""
+
+#: ../admin/media-upload.php:11
+msgid "NextGEN Gallery"
+msgstr ""
+
+#: ../admin/media-upload.php:166
+msgid "No gallery"
+msgstr ""
+
+#: ../admin/media-upload.php:178
+msgid "Select &#187;"
+msgstr ""
+
+#: ../admin/media-upload.php:209
+msgid "Show"
+msgstr ""
+
+#: ../admin/media-upload.php:210
+msgid "Hide"
+msgstr ""
+
+#: ../admin/media-upload.php:215
+msgid "Image ID:"
+msgstr ""
+
+#: ../admin/media-upload.php:229
+#: ../admin/publish.php:55
+msgid "Alignment"
+msgstr ""
+
+#: ../admin/media-upload.php:232
+#: ../admin/publish.php:57
+#: ../admin/settings.php:480
+msgid "None"
+msgstr ""
+
+#: ../admin/media-upload.php:234
+#: ../admin/publish.php:59
+#: ../admin/tinymce/window.php:120
+msgid "Left"
+msgstr ""
+
+#: ../admin/media-upload.php:236
+#: ../admin/publish.php:61
+#: ../admin/tinymce/window.php:121
+msgid "Center"
+msgstr ""
+
+#: ../admin/media-upload.php:238
+#: ../admin/publish.php:63
+#: ../admin/tinymce/window.php:122
+msgid "Right"
+msgstr ""
+
+#: ../admin/media-upload.php:242
+#: ../admin/settings.php:587
+msgid "Size"
+msgstr ""
+
+#: ../admin/media-upload.php:248
+msgid "Full size"
+msgstr ""
+
+#: ../admin/media-upload.php:250
+msgid "Singlepic"
+msgstr ""
+
+#: ../admin/media-upload.php:263
+msgid "Insert into Post"
+msgstr ""
+
+#: ../admin/media-upload.php:274
+msgid "Save all changes"
+msgstr ""
+
+#: ../admin/overview.php:14
+msgid "NextGEN Gallery Overview"
+msgstr ""
+
+#: ../admin/overview.php:86
+msgid "Welcome to NextGEN Gallery !"
+msgstr ""
+
+#: ../admin/overview.php:87
+msgid "Do you like this Plugin?"
+msgstr ""
+
+#: ../admin/overview.php:89
+msgid "Translation"
+msgstr ""
+
+#: ../admin/overview.php:90
+msgid "Latest News"
+msgstr ""
+
+#: ../admin/overview.php:91
+msgid "Recent donators"
+msgstr ""
+
+#: ../admin/overview.php:93
+msgid "Plugin Check"
+msgstr ""
+
+#: ../admin/overview.php:94
+msgid "Server Settings"
+msgstr ""
+
+#: ../admin/overview.php:95
+msgid "Related plugins"
+msgstr ""
+
+#: ../admin/overview.php:101
+#, php-format
+msgid "This plugin is primarily developed, maintained, supported and documented by <a href=\"%s\">Alex Rabe</a> with a lot of love & effort. Any kind of contribution would be highly appreciated. Thanks!"
+msgstr ""
+
+#: ../admin/overview.php:106
+msgid "Give it a good rating on WordPress.org."
+msgstr ""
+
+#: ../admin/overview.php:111
+msgid "Donate the work via paypal."
+msgstr ""
+
+#: ../admin/overview.php:116
+msgid "Help translating it."
+msgstr ""
+
+#: ../admin/overview.php:252
+msgid "Running..."
+msgstr ""
+
+#: ../admin/overview.php:299
+msgid "Check plugin/theme conflict"
+msgstr ""
+
+#: ../admin/overview.php:300
+#: ../admin/overview.php:306
+#: ../admin/overview.php:312
+msgid "Not tested"
+msgstr ""
+
+#: ../admin/overview.php:301
+msgid "No conflict could be detected"
+msgstr ""
+
+#: ../admin/overview.php:302
+msgid "Test failed, disable other plugins & switch to default theme"
+msgstr ""
+
+#: ../admin/overview.php:305
+msgid "Test image function"
+msgstr ""
+
+#: ../admin/overview.php:307
+msgid "The plugin could create images"
+msgstr ""
+
+#: ../admin/overview.php:308
+msgid "Couldn't create image, check your memory limit"
+msgstr ""
+
+#: ../admin/overview.php:311
+msgid "Check theme compatibility"
+msgstr ""
+
+#: ../admin/overview.php:313
+msgid "Your theme should work fine with NextGEN Gallery"
+msgstr ""
+
+#: ../admin/overview.php:314
+msgid "wp_head()/wp_footer() is missing, contact the theme author"
+msgstr ""
+
+#: ../admin/overview.php:318
+msgid "Check plugin"
+msgstr ""
+
+#: ../admin/overview.php:339
+msgid "Graphic Library"
+msgstr ""
+
+#: ../admin/overview.php:355
+#: ../admin/overview.php:404
+#: ../admin/overview.php:591
+#: ../admin/overview.php:781
+msgid "Loading&#8230;"
+msgstr ""
+
+#: ../admin/overview.php:355
+#: ../admin/overview.php:404
+#: ../admin/overview.php:591
+#: ../admin/overview.php:781
+msgid "This widget requires JavaScript."
+msgstr ""
+
+#: ../admin/overview.php:368
+msgid "Thanks to all donators..."
+msgstr ""
+
+#: ../admin/overview.php:390
+msgid "View all"
+msgstr ""
+
+#: ../admin/overview.php:416
+#, php-format
+msgid "Newsfeed could not be loaded.  Check the <a href=\"%s\">front page</a> to check for updates."
+msgstr ""
+
+#: ../admin/overview.php:428
+msgid "Untitled"
+msgstr ""
+
+#: ../admin/overview.php:478
+msgid "At a Glance"
+msgstr ""
+
+#: ../admin/overview.php:504
+msgid "Upload pictures"
+msgstr ""
+
+#: ../admin/overview.php:505
+msgid "Here you can control your images, galleries and albums."
+msgstr ""
+
+#: ../admin/overview.php:535
+msgid "Storage Space"
+msgstr ""
+
+#: ../admin/overview.php:539
+#, php-format
+msgid "<a href=\"%1$s\" title=\"Manage Uploads\" class=\"musublink\">%2$sMB</a>"
+msgstr ""
+
+#: ../admin/overview.php:540
+msgid "Space Allowed"
+msgstr ""
+
+#: ../admin/overview.php:547
+#, php-format
+msgid "<a href=\"%1$s\" title=\"Manage Uploads\" class=\"musublink\">%2$sMB (%3$s%%)</a>"
+msgstr ""
+
+#: ../admin/overview.php:548
+msgid "Space Used"
+msgstr ""
+
+#: ../admin/overview.php:577
+msgid "Translation file successful updated. Please reload page."
+msgstr ""
+
+#: ../admin/overview.php:579
+msgid "Reload page"
+msgstr ""
+
+#: ../admin/overview.php:584
+msgid "Translation file couldn't be updated"
+msgstr ""
+
+#: ../admin/overview.php:621
+msgid "Download"
+msgstr ""
+
+#: ../admin/overview.php:650
+msgid "No GD support"
+msgstr ""
+
+#: ../admin/overview.php:662
+#: ../admin/overview.php:708
+#: ../admin/overview.php:711
+#: ../admin/overview.php:714
+msgid "Yes"
+msgstr ""
+
+#: ../admin/overview.php:664
+#: ../admin/overview.php:709
+#: ../admin/overview.php:712
+#: ../admin/overview.php:715
+msgid "No"
+msgstr ""
+
+#: ../admin/overview.php:682
+msgid "Not set"
+msgstr ""
+
+#: ../admin/overview.php:684
+#: ../admin/overview.php:687
+msgid "On"
+msgstr ""
+
+#: ../admin/overview.php:685
+#: ../admin/overview.php:688
+msgid "Off"
+msgstr ""
+
+#: ../admin/overview.php:691
+#: ../admin/overview.php:694
+#: ../admin/overview.php:697
+#: ../admin/overview.php:700
+#: ../admin/overview.php:703
+#: ../admin/overview.php:706
+msgid "N/A"
+msgstr ""
+
+#: ../admin/overview.php:705
+msgid " MByte"
+msgstr ""
+
+#: ../admin/overview.php:718
+msgid "Operating System"
+msgstr ""
+
+#: ../admin/overview.php:719
+msgid "Server"
+msgstr ""
+
+#: ../admin/overview.php:720
+msgid "Memory usage"
+msgstr ""
+
+#: ../admin/overview.php:721
+msgid "MYSQL Version"
+msgstr ""
+
+#: ../admin/overview.php:722
+msgid "SQL Mode"
+msgstr ""
+
+#: ../admin/overview.php:723
+msgid "PHP Version"
+msgstr ""
+
+#: ../admin/overview.php:724
+msgid "PHP Safe Mode"
+msgstr ""
+
+#: ../admin/overview.php:725
+msgid "PHP Allow URL fopen"
+msgstr ""
+
+#: ../admin/overview.php:726
+msgid "PHP Memory Limit"
+msgstr ""
+
+#: ../admin/overview.php:727
+msgid "PHP Max Upload Size"
+msgstr ""
+
+#: ../admin/overview.php:728
+msgid "PHP Max Post Size"
+msgstr ""
+
+#: ../admin/overview.php:729
+msgid "PCRE Backtracking Limit"
+msgstr ""
+
+#: ../admin/overview.php:730
+msgid "PHP Max Script Execute Time"
+msgstr ""
+
+#: ../admin/overview.php:731
+msgid "PHP Exif support"
+msgstr ""
+
+#: ../admin/overview.php:732
+msgid "PHP IPTC support"
+msgstr ""
+
+#: ../admin/overview.php:733
+msgid "PHP XML support"
+msgstr ""
+
+#: ../admin/overview.php:745
+msgid "NextGEN Gallery contains some functions which are only available under PHP 5.2. You are using the old PHP 4 version, upgrade now! It's no longer supported by the PHP group. Many shared hosting providers offer both PHP 4 and PHP 5, running simultaneously. Ask your provider if they can do this."
+msgstr ""
+
+#: ../admin/overview.php:841
+msgid "Install"
+msgstr ""
+
+#: ../admin/pointer.php:22
+msgid "<h3>Client side resize</h3><p>You can now resize the images before you start with the upload.</p>"
+msgstr ""
+
+#: ../admin/publish.php:45
+msgid "Post title"
+msgstr ""
+
+#: ../admin/publish.php:47
+msgid "Enter the post title "
+msgstr ""
+
+#: ../admin/publish.php:52
+msgid "Size of the image"
+msgstr ""
+
+#: ../admin/publish.php:70
+msgid "Draft"
+msgstr ""
+
+#: ../admin/roles.php:22
+msgid "Updated capabilities"
+msgstr ""
+
+#: ../admin/roles.php:28
+msgid "Roles / capabilities"
+msgstr ""
+
+#: ../admin/roles.php:29
+msgid "Select the lowest role which should be able to access the following capabilities. NextGEN Gallery supports the standard roles from WordPress."
+msgstr ""
+
+#: ../admin/roles.php:30
+msgid "For a more flexible user management you can use the"
+msgstr ""
+
+#: ../admin/roles.php:35
+msgid "Main NextGEN Gallery overview"
+msgstr ""
+
+#: ../admin/roles.php:39
+msgid "Use TinyMCE Button / Upload tab"
+msgstr ""
+
+#: ../admin/roles.php:43
+msgid "Add gallery / Upload images"
+msgstr ""
+
+#: ../admin/roles.php:47
+msgid "Manage gallery"
+msgstr ""
+
+#: ../admin/roles.php:51
+msgid "Manage others gallery"
+msgstr ""
+
+#: ../admin/roles.php:55
+msgid "Manage tags"
+msgstr ""
+
+#: ../admin/roles.php:63
+msgid "Change style"
+msgstr ""
+
+#: ../admin/roles.php:67
+msgid "Change options"
+msgstr ""
+
+#: ../admin/roles.php:71
+msgid "Update capabilities"
+msgstr ""
+
+#: ../admin/rotate.php:55
+msgid "Image rotated"
+msgstr ""
+
+#: ../admin/rotate.php:56
+msgid "Error rotating thumbnail"
+msgstr ""
+
+#: ../admin/rotate.php:81
+msgid "90&deg; clockwise"
+msgstr ""
+
+#: ../admin/rotate.php:82
+msgid "90&deg; anticlockwise"
+msgstr ""
+
+#: ../admin/rotate.php:83
+msgid "Flip vertically"
+msgstr ""
+
+#: ../admin/rotate.php:84
+msgid "Flip horizontally"
+msgstr ""
+
+#: ../admin/settings.php:97
+msgid "Cache cleared"
+msgstr ""
+
+#: ../admin/settings.php:217
+#: ../admin/settings.php:236
+msgid "General Options"
+msgstr ""
+
+#: ../admin/settings.php:218
+#: ../admin/settings.php:417
+msgid "Thumbnails"
+msgstr ""
+
+#: ../admin/settings.php:219
+msgid "Images"
+msgstr ""
+
+#: ../admin/settings.php:221
+#: ../admin/settings.php:469
+msgid "Effects"
+msgstr ""
+
+#: ../admin/settings.php:222
+#: ../admin/settings.php:511
+#: ../admin/tinymce/window.php:110
+msgid "Watermark"
+msgstr ""
+
+#: ../admin/settings.php:223
+#: ../admin/settings.php:418
+#: ../admin/settings.php:618
+#: ../admin/tinymce/window.php:63
+msgid "Slideshow"
+msgstr ""
+
+#: ../admin/settings.php:242
+#: ../admin/wpmu.php:68
+msgid "Gallery path"
+msgstr ""
+
+#: ../admin/settings.php:244
+msgid "This is the default path for all galleries"
+msgstr ""
+
+#: ../admin/settings.php:247
+msgid "Delete image files"
+msgstr ""
+
+#: ../admin/settings.php:249
+msgid "Delete files, when removing a gallery in the database"
+msgstr ""
+
+#: ../admin/settings.php:252
+msgid "Activate permalinks"
+msgstr ""
+
+#: ../admin/settings.php:254
+msgid "When you activate this option, you need to update your permalink structure one time."
+msgstr ""
+
+#: ../admin/settings.php:255
+msgid "Gallery slug name :"
+msgstr ""
+
+#: ../admin/settings.php:259
+msgid "Create new URL friendly image slugs"
+msgstr ""
+
+#: ../admin/settings.php:260
+#: ../admin/settings.php:371
+msgid "Proceed now"
+msgstr ""
+
+#: ../admin/settings.php:263
+msgid "Select graphic library"
+msgstr ""
+
+#: ../admin/settings.php:264
+msgid "GD Library"
+msgstr ""
+
+#: ../admin/settings.php:265
+msgid "ImageMagick (Experimental). Path to the library :"
+msgstr ""
+
+#: ../admin/settings.php:270
+msgid "Activate Media RSS feed"
+msgstr ""
+
+#: ../admin/settings.php:272
+msgid "A RSS feed will be added to you blog header. Useful for CoolIris/PicLens"
+msgstr ""
+
+#: ../admin/settings.php:275
+msgid "Activate PicLens/CoolIris support"
+msgstr ""
+
+#: ../admin/settings.php:277
+msgid "When you activate this option, some javascript is added to your site footer. Make sure that wp_footer is called in your theme."
+msgstr ""
+
+#: ../admin/settings.php:280
+msgid "Tags / Categories"
+msgstr ""
+
+#: ../admin/settings.php:283
+msgid "Activate related images"
+msgstr ""
+
+#: ../admin/settings.php:285
+msgid "This option will append related images to every post"
+msgstr ""
+
+#: ../admin/settings.php:289
+msgid "Match with"
+msgstr ""
+
+#: ../admin/settings.php:290
+msgid "Categories"
+msgstr ""
+
+#: ../admin/settings.php:295
+msgid "Max. number of images"
+msgstr ""
+
+#: ../admin/settings.php:297
+msgid "0 will show all images"
+msgstr ""
+
+#: ../admin/settings.php:301
+#: ../admin/settings.php:332
+#: ../admin/settings.php:374
+#: ../admin/settings.php:459
+#: ../admin/settings.php:494
+#: ../admin/settings.php:755
+msgid "More settings"
+msgstr ""
+
+#: ../admin/settings.php:311
+msgid "Thumbnail settings"
+msgstr ""
+
+#: ../admin/settings.php:315
+msgid "Please note : If you change the settings, you need to recreate the thumbnails under -> Manage Gallery ."
+msgstr ""
+
+#: ../admin/settings.php:328
+msgid "Thumbnail quality"
+msgstr ""
+
+#: ../admin/settings.php:342
+msgid "Image settings"
+msgstr ""
+
+#: ../admin/settings.php:348
+msgid "Resize Images"
+msgstr ""
+
+#: ../admin/settings.php:353
+msgid "Image quality"
+msgstr ""
+
+#: ../admin/settings.php:357
+msgid "Backup original images"
+msgstr ""
+
+#: ../admin/settings.php:359
+msgid "Creates a backup for inserted images"
+msgstr ""
+
+#: ../admin/settings.php:362
+msgid "Automatically resize"
+msgstr ""
+
+#: ../admin/settings.php:364
+msgid "Automatically resize images on upload."
+msgstr ""
+
+#: ../admin/settings.php:367
+msgid "Single picture"
+msgstr ""
+
+#: ../admin/settings.php:370
+msgid "Clear cache folder"
+msgstr ""
+
+#: ../admin/settings.php:391
+msgid "Deactivate gallery page link"
+msgstr ""
+
+#: ../admin/settings.php:393
+msgid "The album will not link to a gallery subpage. The gallery is shown on the same page."
+msgstr ""
+
+#: ../admin/settings.php:397
+msgid "Number of images per page"
+msgstr ""
+
+#: ../admin/settings.php:399
+msgid "0 will disable pagination, all images on one page"
+msgstr ""
+
+#: ../admin/settings.php:403
+msgid "Number of columns"
+msgstr ""
+
+#: ../admin/settings.php:405
+msgid "0 will display as much as possible based on the width of your theme. Setting normally only required for captions below the images"
+msgstr ""
+
+#: ../admin/settings.php:409
+msgid "Integrate slideshow"
+msgstr ""
+
+#: ../admin/settings.php:416
+msgid "Show first"
+msgstr ""
+
+#: ../admin/settings.php:422
+msgid "Show ImageBrowser"
+msgstr ""
+
+#: ../admin/settings.php:424
+msgid "The gallery will open the ImageBrowser instead the effect."
+msgstr ""
+
+#: ../admin/settings.php:428
+msgid "Add hidden images"
+msgstr ""
+
+#: ../admin/settings.php:430
+msgid "If pagination is used, this option will still show all images in the modal window (Thickbox, Lightbox etc.). Note : This increases the page load"
+msgstr ""
+
+#: ../admin/settings.php:434
+msgid "Enable AJAX pagination"
+msgstr ""
+
+#: ../admin/settings.php:436
+msgid "Browse images without reload the page. Note : Works only in combination with Shutter effect"
+msgstr ""
+
+#: ../admin/settings.php:440
+msgid "Sort options"
+msgstr ""
+
+#: ../admin/settings.php:443
+msgid "Sort thumbnails"
+msgstr ""
+
+#: ../admin/settings.php:445
+msgid "Custom order"
+msgstr ""
+
+#: ../admin/settings.php:447
+msgid "File name"
+msgstr ""
+
+#: ../admin/settings.php:448
+msgid "Alt / Title text"
+msgstr ""
+
+#: ../admin/settings.php:449
+msgid "Date / Time"
+msgstr ""
+
+#: ../admin/settings.php:453
+msgid "Sort direction"
+msgstr ""
+
+#: ../admin/settings.php:473
+msgid "Here you can select the thumbnail effect, NextGEN Gallery will integrate the required HTML code in the images. Please note that only the Shutter and Thickbox effect will automatic added to your theme."
+msgstr ""
+
+#: ../admin/settings.php:474
+msgid "With the placeholder"
+msgstr ""
+
+#: ../admin/settings.php:474
+msgid "you can activate a navigation through the images (depend on the effect). Change the code line only , when you use a different thumbnail effect or you know what you do."
+msgstr ""
+
+#: ../admin/settings.php:477
+msgid "JavaScript Thumbnail effect"
+msgstr ""
+
+#: ../admin/settings.php:481
+msgid "Thickbox"
+msgstr ""
+
+#: ../admin/settings.php:482
+msgid "Lightbox"
+msgstr ""
+
+#: ../admin/settings.php:483
+msgid "Highslide"
+msgstr ""
+
+#: ../admin/settings.php:484
+msgid "Shutter"
+msgstr ""
+
+#: ../admin/settings.php:485
+msgid "Custom"
+msgstr ""
+
+#: ../admin/settings.php:490
+msgid "Link Code line"
+msgstr ""
+
+#: ../admin/settings.php:512
+msgid "Please note : You can only activate the watermark under -> Manage Gallery . This action cannot be undone."
+msgstr ""
+
+#: ../admin/settings.php:517
+msgid "Preview"
+msgstr ""
+
+#: ../admin/settings.php:519
+#: ../admin/settings.php:524
+msgid "Position"
+msgstr ""
+
+#: ../admin/settings.php:544
+msgid "Offset"
+msgstr ""
+
+#: ../admin/settings.php:560
+msgid "Use image as watermark"
+msgstr ""
+
+#: ../admin/settings.php:563
+msgid "URL to file"
+msgstr ""
+
+#: ../admin/settings.php:565
+msgid "The accessing of URL files is disabled at your server (allow_url_fopen)"
+msgstr ""
+
+#: ../admin/settings.php:568
+msgid "Use text as watermark"
+msgstr ""
+
+#: ../admin/settings.php:571
+msgid "Font"
+msgstr ""
+
+#: ../admin/settings.php:580
+msgid "This function will not work, cause you need the FreeType library"
+msgstr ""
+
+#: ../admin/settings.php:582
+msgid "You can upload more fonts in the folder <strong>nggallery/fonts</strong>"
+msgstr ""
+
+#: ../admin/settings.php:591
+msgid "Color"
+msgstr ""
+
+#: ../admin/settings.php:593
+msgid "(hex w/o #)"
+msgstr ""
+
+#: ../admin/settings.php:596
+msgid "Text"
+msgstr ""
+
+#: ../admin/settings.php:600
+msgid "Opaque"
+msgstr ""
+
+#: ../admin/settings.php:621
+msgid "Default size (W x H)"
+msgstr ""
+
+#: ../admin/settings.php:626
+msgid "Duration time"
+msgstr ""
+
+#: ../admin/settings.php:627
+msgid "sec."
+msgstr ""
+
+#: ../admin/settings.php:630
+#: ../admin/settings.php:705
+msgid "Transition / Fade effect"
+msgstr ""
+
+#: ../admin/settings.php:633
+#: ../admin/settings.php:708
+msgid "fade"
+msgstr ""
+
+#: ../admin/settings.php:634
+msgid "blindX"
+msgstr ""
+
+#: ../admin/settings.php:635
+msgid "cover"
+msgstr ""
+
+#: ../admin/settings.php:636
+msgid "scrollUp"
+msgstr ""
+
+#: ../admin/settings.php:637
+msgid "scrollDown"
+msgstr ""
+
+#: ../admin/settings.php:638
+msgid "shuffle"
+msgstr ""
+
+#: ../admin/settings.php:639
+msgid "toss"
+msgstr ""
+
+#: ../admin/settings.php:640
+msgid "wipe"
+msgstr ""
+
+#: ../admin/settings.php:642
+msgid "See here for more information about the effects :"
+msgstr ""
+
+#: ../admin/settings.php:646
+msgid "Settings for the JW Image Rotator"
+msgstr ""
+
+#: ../admin/settings.php:647
+msgid "The settings are only used in the JW Image Rotator Version"
+msgstr ""
+
+#: ../admin/settings.php:648
+msgid "See more information for the Flash Player on the web page"
+msgstr ""
+
+#: ../admin/settings.php:653
+msgid "The path to imagerotator.swf is not defined, the slideshow will not work."
+msgstr ""
+
+#: ../admin/settings.php:654
+msgid "If you would like to use the JW Image Rotatator, please download the player <a href=\"http://www.longtailvideo.com/players/jw-image-rotator/\" target=\"_blank\" >here</a> and upload it to your Upload folder (Default is wp-content/uploads)."
+msgstr ""
+
+#: ../admin/settings.php:660
+msgid "Enable flash slideshow"
+msgstr ""
+
+#: ../admin/settings.php:662
+msgid "Integrate the flash based slideshow for all flash supported devices"
+msgstr ""
+
+#: ../admin/settings.php:665
+msgid "Path to the Imagerotator (URL)"
+msgstr ""
+
+#: ../admin/settings.php:668
+msgid "Search now"
+msgstr ""
+
+#: ../admin/settings.php:669
+msgid "Press the button to search automatically for the imagerotator, if you uploaded it to wp-content/uploads or a subfolder"
+msgstr ""
+
+#: ../admin/settings.php:673
+msgid "Shuffle mode"
+msgstr ""
+
+#: ../admin/settings.php:677
+msgid "Show next image on click"
+msgstr ""
+
+#: ../admin/settings.php:681
+msgid "Show navigation bar"
+msgstr ""
+
+#: ../admin/settings.php:685
+msgid "Show loading icon"
+msgstr ""
+
+#: ../admin/settings.php:689
+msgid "Use watermark logo"
+msgstr ""
+
+#: ../admin/settings.php:691
+msgid "You can change the logo at the watermark settings"
+msgstr ""
+
+#: ../admin/settings.php:694
+msgid "Stretch image"
+msgstr ""
+
+#: ../admin/settings.php:697
+msgid "true"
+msgstr ""
+
+#: ../admin/settings.php:698
+msgid "false"
+msgstr ""
+
+#: ../admin/settings.php:699
+msgid "fit"
+msgstr ""
+
+#: ../admin/settings.php:700
+msgid "none"
+msgstr ""
+
+#: ../admin/settings.php:709
+msgid "bgfade"
+msgstr ""
+
+#: ../admin/settings.php:710
+msgid "slowfade"
+msgstr ""
+
+#: ../admin/settings.php:711
+msgid "circles"
+msgstr ""
+
+#: ../admin/settings.php:712
+msgid "bubbles"
+msgstr ""
+
+#: ../admin/settings.php:713
+msgid "blocks"
+msgstr ""
+
+#: ../admin/settings.php:714
+msgid "fluids"
+msgstr ""
+
+#: ../admin/settings.php:715
+msgid "flash"
+msgstr ""
+
+#: ../admin/settings.php:716
+msgid "lines"
+msgstr ""
+
+#: ../admin/settings.php:717
+msgid "random"
+msgstr ""
+
+#: ../admin/settings.php:722
+msgid "Use slow zooming effect"
+msgstr ""
+
+#: ../admin/settings.php:726
+msgid "Background Color"
+msgstr ""
+
+#: ../admin/settings.php:731
+msgid "Texts / Buttons Color"
+msgstr ""
+
+#: ../admin/settings.php:736
+msgid "Rollover / Active Color"
+msgstr ""
+
+#: ../admin/settings.php:741
+msgid "Screen Color"
+msgstr ""
+
+#: ../admin/settings.php:746
+msgid "Background music (URL)"
+msgstr ""
+
+#: ../admin/settings.php:750
+msgid "Try XHTML validation (with CDATA)"
+msgstr ""
+
+#: ../admin/settings.php:752
+msgid "Important : Could causes problem at some browser. Please recheck your page."
+msgstr ""
+
+#: ../admin/setup.php:15
+msgid "Reset all settings to default parameter"
+msgstr ""
+
+#: ../admin/setup.php:26
+msgid "Uninstall sucessful ! Now delete the plugin and enjoy your life ! Good luck !"
+msgstr ""
+
+#: ../admin/setup.php:30
+msgid "Reset options"
+msgstr ""
+
+#: ../admin/setup.php:33
+msgid "Reset all options/settings to the default installation."
+msgstr ""
+
+#: ../admin/setup.php:34
+msgid "Reset settings"
+msgstr ""
+
+#: ../admin/setup.php:34
+msgid ""
+"Reset all options to default settings ?\\n"
+"\\n"
+"Choose [Cancel] to Stop, [OK] to proceed.\\n"
+msgstr ""
+
+#: ../admin/setup.php:39
+msgid "Uninstall plugin tables"
+msgstr ""
+
+#: ../admin/setup.php:44
+msgid "You don't like NextGEN Gallery ?"
+msgstr ""
+
+#: ../admin/setup.php:45
+msgid "No problem, before you deactivate this plugin press the Uninstall Button, because deactivating NextGEN Gallery does not remove any data that may have been created. "
+msgstr ""
+
+#: ../admin/setup.php:47
+msgid "WARNING:"
+msgstr ""
+
+#: ../admin/setup.php:48
+msgid "Once uninstalled, this cannot be undone. You should use a Database Backup plugin of WordPress to backup all the tables first. NextGEN gallery is stored in the tables"
+msgstr ""
+
+#: ../admin/setup.php:48
+msgid "and"
+msgstr ""
+
+#: ../admin/setup.php:50
+msgid "Uninstall plugin"
+msgstr ""
+
+#: ../admin/setup.php:50
+msgid ""
+"You are about to Uninstall this plugin from WordPress.\\n"
+"This action is not reversible.\\n"
+"\\n"
+"Choose [Cancel] to Stop, [OK] to Uninstall.\\n"
+msgstr ""
+
+#: ../admin/showmeta.php:29
+msgid "Meta Data"
+msgstr ""
+
+#: ../admin/showmeta.php:34
+#: ../admin/showmeta.php:60
+#: ../admin/showmeta.php:85
+#: ../admin/showmeta.php:109
+msgid "Tag"
+msgstr ""
+
+#: ../admin/showmeta.php:35
+#: ../admin/showmeta.php:61
+#: ../admin/showmeta.php:86
+#: ../admin/showmeta.php:110
+msgid "Value"
+msgstr ""
+
+#: ../admin/showmeta.php:49
+msgid "No meta data saved"
+msgstr ""
+
+#: ../admin/showmeta.php:55
+msgid "EXIF Data"
+msgstr ""
+
+#: ../admin/showmeta.php:74
+msgid "No exif data"
+msgstr ""
+
+#: ../admin/showmeta.php:81
+msgid "IPTC Data"
+msgstr ""
+
+#: ../admin/showmeta.php:105
+msgid "XMP Data"
+msgstr ""
+
+#: ../admin/style.php:11
+msgid "(From the theme folder)"
+msgstr ""
+
+#: ../admin/style.php:43
+msgid "You do not have sufficient permissions to edit templates for this blog."
+msgstr ""
+
+#: ../admin/style.php:52
+msgid "CSS file successfully updated"
+msgstr ""
+
+#: ../admin/style.php:89
+msgid "Style Editor"
+msgstr ""
+
+#: ../admin/style.php:93
+msgid "Activate and use style sheet:"
+msgstr ""
+
+#: ../admin/style.php:113
+msgid "Activate"
+msgstr ""
+
+#: ../admin/style.php:123
+#, php-format
+msgid "Editing <strong>%s</strong>"
+msgstr ""
+
+#: ../admin/style.php:125
+#, php-format
+msgid "Browsing <strong>%s</strong>"
+msgstr ""
+
+#: ../admin/style.php:135
+msgid "Version"
+msgstr ""
+
+#: ../admin/style.php:138
+msgid "Tip : Copy your stylesheet (nggallery.css) to your theme folder, so it will be not lost during a upgrade"
+msgstr ""
+
+#: ../admin/style.php:140
+msgid "Your theme contain a NextGEN Gallery stylesheet (nggallery.css), this file will be used"
+msgstr ""
+
+#: ../admin/style.php:142
+msgid "Tip No. 2: Use the color picker below to help you find the right color scheme for your gallery!"
+msgstr ""
+
+#: ../admin/style.php:158
+msgid "Update File"
+msgstr ""
+
+#: ../admin/style.php:161
+msgid "If this file were writable you could edit it."
+msgstr ""
+
+#: ../admin/style.php:166
+msgid "Oops, no such file exists! Double check the name and try again, merci."
+msgstr ""
+
+#: ../admin/tags.php:38
+msgid "Most popular"
+msgstr ""
+
+#: ../admin/tags.php:39
+msgid "Least used"
+msgstr ""
+
+#: ../admin/tags.php:40
+msgid "Alphabetical"
+msgstr ""
+
+#: ../admin/tags.php:96
+msgid "Manage image tags"
+msgstr ""
+
+#: ../admin/tags.php:108
+msgid "Existing Tags"
+msgstr ""
+
+#: ../admin/tags.php:112
+msgid "Search tags"
+msgstr ""
+
+#: ../admin/tags.php:116
+msgid "Go"
+msgstr ""
+
+#: ../admin/tags.php:121
+msgid "Sort Order:"
+msgstr ""
+
+#: ../admin/tags.php:156
+#: ../admin/tags.php:160
+#: ../admin/tags.php:173
+msgid "Previous tags"
+msgstr ""
+
+#: ../admin/tags.php:169
+msgid "Next tags"
+msgstr ""
+
+#: ../admin/tags.php:181
+msgid "Rename Tag"
+msgstr ""
+
+#: ../admin/tags.php:189
+msgid "Enter the tag to rename and its new value.  You can use this feature to merge tags too. Click \"Rename\" and all posts which use this tag will be updated."
+msgstr ""
+
+#: ../admin/tags.php:190
+#: ../admin/tags.php:238
+msgid "You can specify multiple tags to rename by separating them with commas."
+msgstr ""
+
+#: ../admin/tags.php:194
+msgid "Tag(s) to rename:"
+msgstr ""
+
+#: ../admin/tags.php:198
+msgid "New tag name(s):"
+msgstr ""
+
+#: ../admin/tags.php:201
+msgid "Rename"
+msgstr ""
+
+#: ../admin/tags.php:207
+msgid "Delete Tag"
+msgstr ""
+
+#: ../admin/tags.php:215
+msgid "Enter the name of the tag to delete.  This tag will be removed from all posts."
+msgstr ""
+
+#: ../admin/tags.php:216
+msgid "You can specify multiple tags to delete by separating them with commas"
+msgstr ""
+
+#: ../admin/tags.php:220
+msgid "Tag(s) to delete:"
+msgstr ""
+
+#: ../admin/tags.php:229
+msgid "Edit Tag Slug"
+msgstr ""
+
+#: ../admin/tags.php:237
+msgid "Enter the tag name to edit and its new slug. <a href=\"http://codex.wordpress.org/Glossary#Slug\">Slug definition</a>"
+msgstr ""
+
+#: ../admin/tags.php:242
+msgid "Tag(s) to match:"
+msgstr ""
+
+#: ../admin/tags.php:246
+msgid "Slug(s) to set:"
+msgstr ""
+
+#: ../admin/upgrade.php:22
+msgid "Upgrade database structure..."
+msgstr ""
+
+#: ../admin/upgrade.php:108
+#: ../admin/upgrade.php:119
+#: ../admin/upgrade.php:126
+#: ../admin/upgrade.php:137
+#: ../admin/upgrade.php:151
+msgid "finished"
+msgstr ""
+
+#: ../admin/upgrade.php:117
+msgid "Update file structure..."
+msgstr ""
+
+#: ../admin/upgrade.php:124
+msgid "Import date and time information..."
+msgstr ""
+
+#: ../admin/upgrade.php:132
+msgid "Move imagerotator to new location..."
+msgstr ""
+
+#: ../admin/upgrade.php:143
+msgid "Update settings..."
+msgstr ""
+
+#: ../admin/upgrade.php:157
+msgid "Updated widget structure. If you used NextGEN Widgets, you need to setup them again..."
+msgstr ""
+
+#: ../admin/upgrade.php:165
+#: ../admin/upgrade.php:187
+msgid "Updated options."
+msgstr ""
+
+#: ../admin/upgrade.php:172
+msgid "Create unique slug"
+msgstr ""
+
+#: ../admin/upgrade.php:173
+msgid "One of the upcomming features are a reworked permalinks structure."
+msgstr ""
+
+#: ../admin/upgrade.php:174
+msgid "Therefore it's needed to have a unique identifier for each image, gallery and album."
+msgstr ""
+
+#: ../admin/upgrade.php:175
+msgid "Depend on the amount of database entries this will take a while, don't reload this page."
+msgstr ""
+
+#: ../admin/upgrade.php:195
+msgid "Could not find NextGEN Gallery database tables, upgrade failed !"
+msgstr ""
+
+#: ../admin/upgrade.php:258
+msgid "Some folders/files could not renamed, please recheck the permission and rescan the folder in the manage gallery section."
+msgstr ""
+
+#: ../admin/upgrade.php:260
+msgid "Rename failed"
+msgstr ""
+
+#: ../admin/upgrade.php:356
+#: ../admin/upgrade.php:375
+msgid "Upgrade NextGEN Gallery"
+msgstr ""
+
+#: ../admin/upgrade.php:357
+msgid "The script detect that you upgrade from a older version."
+msgstr ""
+
+#: ../admin/upgrade.php:358
+msgid "Your database tables for NextGEN Gallery is out-of-date, and must be upgraded before you can continue."
+msgstr ""
+
+#: ../admin/upgrade.php:359
+msgid "If you would like to downgrade later, please make first a complete backup of your database and the images."
+msgstr ""
+
+#: ../admin/upgrade.php:360
+msgid "The upgrade process may take a while, so please be patient."
+msgstr ""
+
+#: ../admin/upgrade.php:361
+msgid "Start upgrade now"
+msgstr ""
+
+#: ../admin/upgrade.php:377
+msgid "Upgrade finished..."
+msgstr ""
+
+#: ../admin/upgrade.php:378
+msgid "Continue"
+msgstr ""
+
+#: ../admin/upgrade.php:401
+#, php-format
+msgid "Rebuild image structure : %s / %s images"
+msgstr ""
+
+#: ../admin/upgrade.php:402
+#, php-format
+msgid "Rebuild gallery structure : %s / %s galleries"
+msgstr ""
+
+#: ../admin/upgrade.php:403
+#, php-format
+msgid "Rebuild album structure : %s / %s albums"
+msgstr ""
+
+#: ../admin/upgrade.php:460
+msgid "Done."
+msgstr ""
+
+#: ../admin/wpmu.php:33
+msgid "Update successfully"
+msgstr ""
+
+#: ../admin/wpmu.php:45
+#, php-format
+msgid "Thanks for using this plugin, NextGEN Gallery is initially developed for self hosted blogs. A multisite setup is possible, but cannot currently fully supported, as it can have several special condition ( i.e. Domain mapping).<br /> If you would like to support the further development, please consider a <strong><a href=\"%s\">donation</a></strong>! If you still need some help, please post your questions <a href=\"http://wordpress.org/tags/nextgen-gallery?forum_id=10\">here</a> ."
+msgstr ""
+
+#: ../admin/wpmu.php:62
+msgid "Network Options"
+msgstr ""
+
+#: ../admin/wpmu.php:70
+msgid "This is the default path for all blogs. With the placeholder %BLOG_ID% you can organize the folder structure better."
+msgstr ""
+
+#: ../admin/wpmu.php:71
+#, php-format
+msgid "The default setting should be %s"
+msgstr ""
+
+#: ../admin/wpmu.php:75
+msgid "Enable upload quota check"
+msgstr ""
+
+#: ../admin/wpmu.php:77
+msgid "Should work if the gallery is bellow the blog.dir"
+msgstr ""
+
+#: ../admin/wpmu.php:81
+msgid "Enable zip upload option"
+msgstr ""
+
+#: ../admin/wpmu.php:83
+msgid "Allow users to upload zip folders."
+msgstr ""
+
+#: ../admin/wpmu.php:87
+msgid "Enable import function"
+msgstr ""
+
+#: ../admin/wpmu.php:89
+msgid "Allow users to import images folders from the server."
+msgstr ""
+
+#: ../admin/wpmu.php:93
+msgid "Enable style selection"
+msgstr ""
+
+#: ../admin/wpmu.php:95
+msgid "Allow users to choose a style for the gallery."
+msgstr ""
+
+#: ../admin/wpmu.php:99
+msgid "Enable roles/capabilities"
+msgstr ""
+
+#: ../admin/wpmu.php:101
+msgid "Allow users to change the roles for other blog authors."
+msgstr ""
+
+#: ../admin/wpmu.php:105
+msgid "Default style"
+msgstr ""
+
+#: ../admin/wpmu.php:122
+msgid "Choose the default style for the galleries."
+msgstr ""
+
+#: ../admin/tinymce/window.php:56
+msgid "Select or enter gallery"
+msgstr ""
+
+#: ../admin/tinymce/window.php:61
+#: ../admin/tinymce/window.php:82
+msgid "Show as"
+msgstr ""
+
+#: ../admin/tinymce/window.php:62
+msgid "Image list"
+msgstr ""
+
+#: ../admin/tinymce/window.php:64
+msgid "Imagebrowser"
+msgstr ""
+
+#: ../admin/tinymce/window.php:77
+msgid "Select or enter album"
+msgstr ""
+
+#: ../admin/tinymce/window.php:83
+msgid "Extended version"
+msgstr ""
+
+#: ../admin/tinymce/window.php:84
+msgid "Compact version"
+msgstr ""
+
+#: ../admin/tinymce/window.php:97
+msgid "Select or enter picture"
+msgstr ""
+
+#: ../admin/tinymce/window.php:102
+msgid "Width x Height"
+msgstr ""
+
+#: ../admin/tinymce/window.php:106
+msgid "Effect"
+msgstr ""
+
+#: ../admin/tinymce/window.php:109
+msgid "No effect"
+msgstr ""
+
+#: ../admin/tinymce/window.php:111
+msgid "Web 2.0"
+msgstr ""
+
+#: ../admin/tinymce/window.php:116
+msgid "Float"
+msgstr ""
+
+#: ../admin/tinymce/window.php:119
+msgid "No float"
+msgstr ""
+
+#: ../admin/tinymce/window.php:138
+msgid "Insert"
+msgstr ""
+
+#: ../lib/core.php:407
+#, php-format
+msgid "Note : Based on your server memory limit you should not upload larger images then <strong>%d x %d</strong> pixel"
+msgstr ""
+
+#: ../lib/locale.php:120
+msgid "Invalid URL Provided."
+msgstr ""
+
+#: ../lib/locale.php:124
+#: ../lib/locale.php:128
+msgid "Could not create Temporary file."
+msgstr ""
+
+#: ../lib/meta.php:124
+msgid " mm"
+msgstr ""
+
+#: ../lib/meta.php:130
+msgid " sec"
+msgstr ""
+
+#: ../lib/meta.php:134
+msgid "Fired"
+msgstr ""
+
+#: ../lib/meta.php:134
+msgid "Not fired"
+msgstr ""
+
+#: ../lib/meta.php:430
+msgid "Aperture"
+msgstr ""
+
+#: ../lib/meta.php:431
+#: ../lib/meta.php:456
+msgid "Credit"
+msgstr ""
+
+#: ../lib/meta.php:432
+msgid "Camera"
+msgstr ""
+
+#: ../lib/meta.php:433
+msgid "Caption"
+msgstr ""
+
+#: ../lib/meta.php:435
+msgid "Copyright"
+msgstr ""
+
+#: ../lib/meta.php:436
+msgid "Focal length"
+msgstr ""
+
+#: ../lib/meta.php:437
+msgid "ISO"
+msgstr ""
+
+#: ../lib/meta.php:438
+msgid "Shutter speed"
+msgstr ""
+
+#: ../lib/meta.php:442
+msgid "Subject"
+msgstr ""
+
+#: ../lib/meta.php:443
+msgid "Make"
+msgstr ""
+
+#: ../lib/meta.php:444
+msgid "Edit Status"
+msgstr ""
+
+#: ../lib/meta.php:445
+msgid "Category"
+msgstr ""
+
+#: ../lib/meta.php:446
+msgid "Keywords"
+msgstr ""
+
+#: ../lib/meta.php:447
+msgid "Date Created"
+msgstr ""
+
+#: ../lib/meta.php:448
+msgid "Time Created"
+msgstr ""
+
+#: ../lib/meta.php:449
+msgid "Author Position"
+msgstr ""
+
+#: ../lib/meta.php:450
+msgid "City"
+msgstr ""
+
+#: ../lib/meta.php:451
+msgid "Location"
+msgstr ""
+
+#: ../lib/meta.php:452
+msgid "Province/State"
+msgstr ""
+
+#: ../lib/meta.php:453
+msgid "Country code"
+msgstr ""
+
+#: ../lib/meta.php:454
+msgid "Country"
+msgstr ""
+
+#: ../lib/meta.php:455
+msgid "Headline"
+msgstr ""
+
+#: ../lib/meta.php:457
+msgid "Source"
+msgstr ""
+
+#: ../lib/meta.php:458
+msgid "Copyright Notice"
+msgstr ""
+
+#: ../lib/meta.php:459
+msgid "Contact"
+msgstr ""
+
+#: ../lib/meta.php:460
+msgid "Last modified"
+msgstr ""
+
+#: ../lib/meta.php:461
+msgid "Program tool"
+msgstr ""
+
+#: ../lib/meta.php:462
+msgid "Format"
+msgstr ""
+
+#: ../lib/meta.php:463
+msgid "Image Width"
+msgstr ""
+
+#: ../lib/meta.php:464
+msgid "Image Height"
+msgstr ""
+
+#: ../lib/meta.php:465
+msgid "Flash"
+msgstr ""
+
+#: ../lib/multisite.php:23
+msgid "Sorry, you have used your space allocation. Please delete some files to upload more files."
+msgstr ""
+
+#: ../lib/ngg-db.php:331
+#: ../lib/ngg-db.php:332
+msgid "Album overview"
+msgstr ""
+
+#: ../lib/shortcodes.php:311
+msgid "[Pictures not found]"
+msgstr ""
+
+#: ../lib/tags.php:35
+msgid "No new tag specified!"
+msgstr ""
+
+#: ../lib/tags.php:50
+msgid "No new/old valid tag specified!"
+msgstr ""
+
+#: ../lib/tags.php:86
+msgid "No tag renamed."
+msgstr ""
+
+#: ../lib/tags.php:88
+#, php-format
+msgid "Renamed tag(s) &laquo;%1$s&raquo; to &laquo;%2$s&raquo;"
+msgstr ""
+
+#: ../lib/tags.php:95
+msgid "No valid new tag."
+msgstr ""
+
+#: ../lib/tags.php:112
+msgid "No objects (post/page) found for specified old tags."
+msgstr ""
+
+#: ../lib/tags.php:141
+msgid "No tag merged."
+msgstr ""
+
+#: ../lib/tags.php:143
+#, php-format
+msgid "Merge tag(s) &laquo;%1$s&raquo; to &laquo;%2$s&raquo;. %3$s objects edited."
+msgstr ""
+
+#: ../lib/tags.php:146
+msgid "Error. No enough tags for rename. Too for merge. Choose !"
+msgstr ""
+
+#: ../lib/tags.php:163
+msgid "No tag specified!"
+msgstr ""
+
+#: ../lib/tags.php:186
+msgid "No tag deleted."
+msgstr ""
+
+#: ../lib/tags.php:188
+#, php-format
+msgid "%1s tag(s) deleted."
+msgstr ""
+
+#: ../lib/tags.php:202
+msgid "No new slug(s) specified!"
+msgstr ""
+
+#: ../lib/tags.php:214
+msgid "Tags number and slugs number isn't the same!"
+msgstr ""
+
+#: ../lib/tags.php:241
+msgid "No slug edited."
+msgstr ""
+
+#: ../lib/tags.php:243
+#, php-format
+msgid "%s slug(s) edited."
+msgstr ""
+
+#: ../lib/xmlrpc.php:66
+#, php-format
+msgid "XML-RPC services are disabled on this blog.  An admin user can enable them at %s"
+msgstr ""
+
+#: ../lib/xmlrpc.php:73
+msgid "Bad login/pass combination."
+msgstr ""
+
+#: ../lib/xmlrpc.php:129
+msgid "You are not allowed to upload files to this site."
+msgstr ""
+
+#: ../lib/xmlrpc.php:135
+#: ../lib/xmlrpc.php:680
+msgid "Could not find gallery "
+msgstr ""
+
+#: ../lib/xmlrpc.php:140
+#: ../lib/xmlrpc.php:685
+msgid "You are not allowed to upload files to this gallery."
+msgstr ""
+
+#: ../lib/xmlrpc.php:152
+msgid "This is no valid image file."
+msgstr ""
+
+#: ../lib/xmlrpc.php:164
+msgid "Could not find image id "
+msgstr ""
+
+#: ../lib/xmlrpc.php:171
+#, php-format
+msgid "Failed to delete image %1$s "
+msgstr ""
+
+#: ../lib/xmlrpc.php:180
+#, php-format
+msgid "Could not write file %1$s (%2$s)"
+msgstr ""
+
+#: ../lib/xmlrpc.php:247
+#: ../lib/xmlrpc.php:299
+msgid "Invalid image ID"
+msgstr ""
+
+#: ../lib/xmlrpc.php:250
+#: ../lib/xmlrpc.php:302
+msgid "Sorry, you must be able to edit this image"
+msgstr ""
+
+#: ../lib/xmlrpc.php:308
+msgid "Sorry, could not update the image"
+msgstr ""
+
+#: ../lib/xmlrpc.php:344
+#: ../lib/xmlrpc.php:576
+#: ../lib/xmlrpc.php:642
+msgid "Sorry, you must be able to manage galleries"
+msgstr ""
+
+#: ../lib/xmlrpc.php:350
+msgid "Sorry, could not create the gallery"
+msgstr ""
+
+#: ../lib/xmlrpc.php:393
+#: ../lib/xmlrpc.php:573
+msgid "Invalid gallery ID"
+msgstr ""
+
+#: ../lib/xmlrpc.php:396
+msgid "Sorry, you must be able to manage this gallery"
+msgstr ""
+
+#: ../lib/xmlrpc.php:402
+msgid "Sorry, could not update the gallery"
+msgstr ""
+
+#: ../lib/xmlrpc.php:442
+#: ../lib/xmlrpc.php:494
+#: ../lib/xmlrpc.php:536
+#: ../lib/xmlrpc.php:609
+msgid "Sorry, you must be able to manage albums"
+msgstr ""
+
+#: ../lib/xmlrpc.php:448
+msgid "Sorry, could not create the album"
+msgstr ""
+
+#: ../lib/xmlrpc.php:491
+#: ../lib/xmlrpc.php:533
+msgid "Invalid album ID"
+msgstr ""
+
+#: ../lib/xmlrpc.php:500
+msgid "Sorry, could not update the album"
+msgstr ""
+
+#: ../view/album-compact.php:32
+#: ../view/album-extend.php:30
+msgid "Photos"
+msgstr ""
+
+#: ../view/gallery-caption.php:32
+#: ../view/gallery.php:32
+#: ../widgets/media-rss-widget.php:122
+msgid "[View with PicLens]"
+msgstr ""
+
+#: ../view/imagebrowser-caption.php:26
+#: ../view/imagebrowser-exif.php:30
+#: ../view/imagebrowser.php:26
+msgid "Back"
+msgstr ""
+
+#: ../view/imagebrowser-caption.php:29
+#: ../view/imagebrowser-exif.php:33
+#: ../view/imagebrowser.php:29
+msgid "Next"
+msgstr ""
+
+#: ../view/imagebrowser-caption.php:31
+#: ../view/imagebrowser-exif.php:35
+#: ../view/imagebrowser.php:31
+msgid "of"
+msgstr ""
+
+#: ../view/imagebrowser-exif.php:38
+msgid "Meta data"
+msgstr ""
+
+#: ../view/imagebrowser-exif.php:42
+msgid "Camera / Type"
+msgstr ""
+
+#: ../view/imagebrowser-exif.php:50
+msgid "Focal Length"
+msgstr ""
+
+#: ../widgets/media-rss-widget.php:19
+msgid "Widget that displays Media RSS links for NextGEN Gallery."
+msgstr ""
+
+#: ../widgets/media-rss-widget.php:20
+msgid "NextGEN Media RSS"
+msgstr ""
+
+#: ../widgets/media-rss-widget.php:68
+msgid "Media RSS"
+msgstr ""
+
+#: ../widgets/media-rss-widget.php:69
+msgid "Link to the main image feed"
+msgstr ""
+
+#: ../widgets/media-rss-widget.php:79
+#: ../widgets/widgets.php:201
+msgid "Title :"
+msgstr ""
+
+#: ../widgets/media-rss-widget.php:87
+msgid "Show Media RSS icon"
+msgstr ""
+
+#: ../widgets/media-rss-widget.php:93
+msgid "Show the Media RSS link"
+msgstr ""
+
+#: ../widgets/media-rss-widget.php:98
+msgid "Text for Media RSS link:"
+msgstr ""
+
+#: ../widgets/media-rss-widget.php:104
+msgid "Tooltip text for Media RSS link:"
+msgstr ""
+
+#: ../widgets/widgets.php:22
+msgid "Show a NextGEN Gallery Slideshow"
+msgstr ""
+
+#: ../widgets/widgets.php:23
+msgid "NextGEN Slideshow"
+msgstr ""
+
+#: ../widgets/widgets.php:64
+msgid "<a href=\"http://www.macromedia.com/go/getflashplayer\">Get the Flash Player</a> to see the slideshow."
+msgstr ""
+
+#: ../widgets/widgets.php:121
+msgid "Title:"
+msgstr ""
+
+#: ../widgets/widgets.php:123
+msgid "Select Gallery:"
+msgstr ""
+
+#: ../widgets/widgets.php:125
+msgid "All images"
+msgstr ""
+
+#: ../widgets/widgets.php:137
+msgid "Height:"
+msgstr ""
+
+#: ../widgets/widgets.php:138
+msgid "Width:"
+msgstr ""
+
+#: ../widgets/widgets.php:160
+msgid "Add recent or random images from the galleries"
+msgstr ""
+
+#: ../widgets/widgets.php:161
+msgid "NextGEN Widget"
+msgstr ""
+
+#: ../widgets/widgets.php:207
+msgid "Show :"
+msgstr ""
+
+#: ../widgets/widgets.php:213
+msgid "Original images"
+msgstr ""
+
+#: ../widgets/widgets.php:222
+msgid "recent added "
+msgstr ""
+
+#: ../widgets/widgets.php:228
+msgid "Enable IE8 Web Slices"
+msgstr ""
+
+#: ../widgets/widgets.php:233
+msgid "Width x Height :"
+msgstr ""
+
+#: ../widgets/widgets.php:239
+msgid "Select :"
+msgstr ""
+
+#: ../widgets/widgets.php:241
+msgid "All galleries"
+msgstr ""
+
+#: ../widgets/widgets.php:242
+msgid "Only which are not listed"
+msgstr ""
+
+#: ../widgets/widgets.php:243
+msgid "Only which are listed"
+msgstr ""
+
+#: ../widgets/widgets.php:249
+msgid "Gallery ID :"
+msgstr ""
+
+#: ../widgets/widgets.php:251
+msgid "Gallery IDs, separated by commas."
+msgstr ""
+
+#: ../xml/media-rss.php:50
+msgid "No galleries have been yet created."
+msgstr ""
+
+#: ../xml/media-rss.php:69
+#, php-format
+msgid "The gallery ID=%s does not exist."
+msgstr ""
+
+#: ../xml/media-rss.php:100
+msgid "No album ID has been provided as parameter"
+msgstr ""
+
+#: ../xml/media-rss.php:108
+#, php-format
+msgid "The album ID=%s does not exist."
+msgstr ""
+
+#: ../xml/media-rss.php:115
+msgid "Invalid MediaRSS command"
+msgstr ""
+
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/class.ngg_serializable.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/class.ngg_serializable.php
new file mode 100644
index 0000000000000000000000000000000000000000..c63af43743e123f6f5f32df17e27ea2341cfcbcd
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/class.ngg_serializable.php
@@ -0,0 +1,45 @@
+<?php
+
+class Ngg_Serializable
+{
+	/**
+	 * Serializes the data
+	 * @param mixed $value
+	 * @return string
+	 */
+	function serialize($value)
+	{
+		//Using json_encode here because PHP's serialize is not Unicode safe
+		return base64_encode(json_encode($value));
+	}
+
+
+	/**
+	 * Unserializes data using our proprietary format
+	 * @param string $value
+	 * @return mixed
+	 */
+	function unserialize($value)
+	{
+		$retval = NULL;
+		if (is_string($value))
+		{
+			$retval = stripcslashes($value);
+
+			if (strlen($value) > 1)
+			{
+				//Using json_decode here because PHP's unserialize is not Unicode safe
+				$retval = json_decode(base64_decode($retval), TRUE);
+
+				// JSON Decoding failed. Perhaps it's PHP serialized data?
+				if ($retval === NULL) {
+					$er = error_reporting(0);
+					$retval = unserialize($value);
+					error_reporting($er);
+				}
+			}
+		}
+
+		return $retval;
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/core.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/core.php
new file mode 100644
index 0000000000000000000000000000000000000000..110b9e42f2b88ae92188dd518375147e186a4b2a
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/core.php
@@ -0,0 +1,600 @@
+<?php
+/**
+* Main PHP class for the WordPress plugin NextGEN Gallery
+*
+* @author Alex Rabe
+*
+*
+*/
+class nggGallery {
+
+	/**
+	* Show a error messages
+	*/
+	static function show_error($message) {
+		echo '<div class="wrap"><h2></h2><div class="error" id="error"><p>' . $message . '</p></div></div>' . "\n";
+	}
+
+	/**
+	* Show a system messages
+	*/
+	static function show_message($message) {
+		echo '<div class="wrap"><h2></h2><div class="updated fade" id="message"><p>' . $message . '</p></div></div>' . "\n";
+	}
+
+	/**
+	* get the thumbnail url to the image
+	*/
+	static function get_thumbnail_url($imageID, $picturepath = '', $fileName = ''){
+		// get the complete url to the thumbnail
+		global $wpdb;
+
+		// safety first
+		$imageID = (int) $imageID;
+
+		// get gallery values
+		if ( empty($fileName) ) {
+			list($fileName, $picturepath ) = $wpdb->get_row("SELECT p.filename, g.path FROM $wpdb->nggpictures AS p INNER JOIN $wpdb->nggallery AS g ON (p.galleryid = g.gid) WHERE p.pid = '$imageID' ", ARRAY_N);
+		}
+
+		if ( empty($picturepath) ) {
+			$picturepath = $wpdb->get_var("SELECT g.path FROM $wpdb->nggpictures AS p INNER JOIN $wpdb->nggallery AS g ON (p.galleryid = g.gid) WHERE p.pid = '$imageID' ");
+		}
+
+		// set gallery url
+		$folder_url 	= site_url() . '/' . $picturepath.nggGallery::get_thumbnail_folder($picturepath, FALSE);
+		$thumbnailURL	= $folder_url . 'thumbs_' . $fileName;
+
+		return $thumbnailURL;
+	}
+
+	/**
+	* get the complete url to the image
+	*/
+	static function get_image_url($imageID, $picturepath = '', $fileName = '') {
+		global $wpdb;
+
+		// safety first
+		$imageID = (int) $imageID;
+
+		// get gallery values
+		if (empty($fileName)) {
+			list($fileName, $picturepath ) = $wpdb->get_row("SELECT p.filename, g.path FROM $wpdb->nggpictures AS p INNER JOIN $wpdb->nggallery AS g ON (p.galleryid = g.gid) WHERE p.pid = '$imageID' ", ARRAY_N);
+		}
+
+		if (empty($picturepath)) {
+			$picturepath = $wpdb->get_var("SELECT g.path FROM $wpdb->nggpictures AS p INNER JOIN $wpdb->nggallery AS g ON (p.galleryid = g.gid) WHERE p.pid = '$imageID' ");
+		}
+
+		// set gallery url
+		$imageURL 	= site_url() . '/' . $picturepath . '/' . $fileName;
+
+		return $imageURL;
+	}
+
+	/**
+	* nggGallery::get_thumbnail_folder()
+	*
+	* @param mixed $gallerypath
+	* @param bool $include_Abspath
+	* @return string $foldername
+	*/
+	static function create_thumbnail_folder($gallerypath, $include_Abspath = TRUE) {
+		if (!$include_Abspath) {
+			$gallerypath = WINABSPATH . $gallerypath;
+		}
+
+		if (!file_exists($gallerypath)) {
+			return FALSE;
+		}
+
+		if (is_dir($gallerypath . '/thumbs/')) {
+			return '/thumbs/';
+		}
+
+		if (is_admin()) {
+			if (!is_dir($gallerypath . '/thumbs/')) {
+				if ( !wp_mkdir_p($gallerypath . '/thumbs/') ) {
+					if (SAFE_MODE) {
+						nggAdmin::check_safemode($gallerypath . '/thumbs/');
+					} else {
+						nggGallery::show_error(__('Unable to create directory ', 'nggallery') . $gallerypath . '/thumbs !');
+					}
+					return FALSE;
+				}
+				return '/thumbs/';
+			}
+		}
+
+		return FALSE;
+
+	}
+
+	/**
+	* nggGallery::get_thumbnail_folder()
+	*
+	* @param mixed $gallerypath
+	* @param bool $include_Abspath
+	* @deprecated use create_thumbnail_folder() if needed;
+	* @return string $foldername
+	*/
+	static function get_thumbnail_folder($gallerypath, $include_Abspath = TRUE) {
+		return nggGallery::create_thumbnail_folder($gallerypath, $include_Abspath);
+	}
+
+	/**
+	* nggGallery::get_thumbnail_prefix() - obsolete
+	*
+	* @param string $gallerypath
+	* @param bool   $include_Abspath
+	* @deprecated prefix is now fixed to "thumbs_";
+	* @return string  "thumbs_";
+	*/
+	static function get_thumbnail_prefix($gallerypath, $include_Abspath = TRUE) {
+		return 'thumbs_';
+	}
+
+	/**
+	* nggGallery::get_option() - get the options and overwrite them with custom meta settings
+	*
+	* @param string $key
+	* @return array $options
+	*/
+	static function get_option($key) {
+        global $post;
+
+		// get first the options from the database
+		$options = get_option($key);
+
+        if ( $post == null )
+            return $options;
+
+		// Get all key/value data for the current post.
+		$meta_array = get_post_custom();
+
+		// Ensure that this is a array
+		if ( !is_array($meta_array) )
+			$meta_array = array($meta_array);
+
+		// assign meta key to db setting key
+		$meta_tags = array(
+			'string' => array(
+				'ngg_gal_ShowOrder' 		=> 'galShowOrder',
+				'ngg_gal_Sort' 				=> 'galSort',
+				'ngg_gal_SortDirection' 	=> 'galSortDir',
+				'ngg_gal_ShowDescription'	=> 'galShowDesc',
+				'ngg_ir_Audio' 				=> 'irAudio',
+				'ngg_ir_Overstretch'		=> 'irOverstretch',
+				'ngg_ir_Transition'			=> 'irTransition',
+				'ngg_ir_Backcolor' 			=> 'irBackcolor',
+				'ngg_ir_Frontcolor' 		=> 'irFrontcolor',
+				'ngg_ir_Lightcolor' 		=> 'irLightcolor',
+                'ngg_slideshowFX'			=> 'slideFx',
+			),
+
+			'int' => array(
+				'ngg_gal_Images' 			=> 'galImages',
+				'ngg_gal_Columns'			=> 'galColumns',
+				'ngg_paged_Galleries'		=> 'galPagedGalleries',
+				'ngg_ir_Width' 				=> 'irWidth',
+				'ngg_ir_Height' 			=> 'irHeight',
+				'ngg_ir_Rotatetime' 		=> 'irRotatetime'
+			),
+
+			'bool' => array(
+				'ngg_gal_ShowSlide'			=> 'galShowSlide',
+				'ngg_gal_ShowPiclense'		=> 'usePicLens',
+				'ngg_gal_ImageBrowser' 		=> 'galImgBrowser',
+				'ngg_gal_HideImages' 		=> 'galHiddenImg',
+				'ngg_ir_Shuffle' 			=> 'irShuffle',
+				'ngg_ir_LinkFromDisplay' 	=> 'irLinkfromdisplay',
+				'ngg_ir_ShowNavigation'		=> 'irShownavigation',
+				'ngg_ir_ShowWatermark' 		=> 'irWatermark',
+				'ngg_ir_Kenburns' 			=> 'irKenburns'
+			)
+		);
+
+		foreach ($meta_tags as $typ => $meta_keys){
+			foreach ($meta_keys as $key => $db_value){
+				// if the kex exist overwrite it with the custom field
+				if (array_key_exists($key, $meta_array)){
+					switch ($typ) {
+					case 'string':
+						$options[$db_value] = (string) esc_attr($meta_array[$key][0]);
+						break;
+					case 'int':
+						$options[$db_value] = (int) $meta_array[$key][0];
+						break;
+					case 'bool':
+						$options[$db_value] = (bool) $meta_array[$key][0];
+						break;
+					}
+				}
+			}
+		}
+
+		return $options;
+	}
+
+	/**
+	* nggGallery::scale_image() - Scale down a image
+	*
+	* @param mixed $location (filename)
+	* @param int $maxw - max width
+	* @param int $maxh -  max height
+	* @return array (width, heigth)
+	*/
+	static function scale_image($location, $maxw = 0, $maxh = 0){
+		$img = @getimagesize($location);
+		if ($img){
+			$w = $img[0];
+			$h = $img[1];
+
+			$dim = array('w','h');
+			foreach($dim AS $val) {
+				$max = "max{$val}";
+				if(${$val} > ${$max} && ${$max}){
+					$alt = ($val == 'w') ? 'h' : 'w';
+					$ratio = ${$alt} / ${$val};
+					${$val} = ${$max};
+					${$alt} = ${$val} * $ratio;
+				}
+			}
+
+			return array( $w, $h );
+		}
+		return false;
+	}
+
+	/**
+	* Renders a section of user display code.  The code is first checked for in the current theme display directory
+	* before defaulting to the plugin
+	* Call the function :	nggGallery::render ('template_name', array ('var1' => $var1, 'var2' => $var2));
+	*
+	* @autor John Godley
+	* @param string $template_name Name of the template file (without extension)
+	* @param string $vars Array of variable name=>value that is available to the display code (optional)
+	* @param bool $callback In case we check we didn't find template we tested it one time more (optional)
+	* @return void
+	**/
+	static function render($template_name, $vars = array (), $callback = false) {
+		foreach ($vars AS $key => $val) {
+			$$key = $val;
+		}
+
+		// hook into the render feature to allow other plugins to include templates
+		$custom_template = apply_filters( 'ngg_render_template', false, $template_name );
+
+		if ( ( $custom_template != false ) &&  file_exists ($custom_template) ) {
+			include ( $custom_template );
+		} else if (file_exists(WP_CONTENT_DIR . "/{$template_name}.php")) {
+			include (WP_CONTENT_DIR . "/{$template_name}.php");
+		} else if (file_exists(WP_CONTENT_DIR . "/{$template_name}.php")) {
+			include (WP_CONTENT_DIR . "/nggallery/{$template_name}.php");
+		} else if (file_exists (STYLESHEETPATH . "/nggallery/$template_name.php")) {
+			include (STYLESHEETPATH . "/nggallery/$template_name.php");
+		} else if (file_exists (NGGALLERY_ABSPATH . "/view/$template_name.php")) {
+			include (NGGALLERY_ABSPATH . "/view/$template_name.php");
+		} else if ( $callback === true ) {
+            echo "<p>Rendering of template $template_name.php failed</p>";
+		} else {
+            //test without the "-template" name one time more
+            $template_name = array_shift( explode('-', $template_name , 2) );
+            nggGallery::render ($template_name, $vars , true);
+		}
+	}
+
+	/**
+	* Captures an section of user display code.
+	*
+	* @autor John Godley
+	* @param string $template_name Name of the template file (without extension)
+	* @param string $vars Array of variable name=>value that is available to the display code (optional)
+	* @return void
+	**/
+	static function capture ($template_name, $vars = array ()) {
+		ob_start ();
+		nggGallery::render ($template_name, $vars);
+		$output = ob_get_contents ();
+		ob_end_clean ();
+
+		return $output;
+	}
+
+	/**
+	 * nggGallery::graphic_library() - switch between GD and ImageMagick
+	 *
+	 * @return path to the selected library
+	 */
+	static function graphic_library() {
+
+		$ngg_options = get_option('ngg_options');
+
+		if ( $ngg_options['graphicLibrary'] == 'im')
+			return NGGALLERY_ABSPATH . '/lib/imagemagick.inc.php';
+		else
+			return NGGALLERY_ABSPATH . '/lib/gd.thumbnail.inc.php';
+
+	}
+
+	/**
+	 * Look for the stylesheet in the theme folder
+	 *
+	 * @return string path to stylesheet
+	 */
+	static function get_theme_css_file() {
+
+  		// allow other plugins to include a custom stylesheet
+		$stylesheet = apply_filters( 'ngg_load_stylesheet', false );
+
+		if ( $stylesheet !== false )
+			return ( $stylesheet );
+		elseif ( file_exists (STYLESHEETPATH . '/nggallery.css') )
+			return get_stylesheet_directory_uri() . '/nggallery.css';
+		else
+			return false;
+	}
+
+	/**
+	 * Support for i18n with wpml, polyglot or qtrans
+	 *
+	 * @param string $in
+	 * @param string $name (optional) required for wpml to determine the type of translation
+	 * @return string $in localized
+	 */
+	static function i18n($in, $name = null) {
+
+		if ( function_exists( 'langswitch_filter_langs_with_message' ) )
+			$in = langswitch_filter_langs_with_message($in);
+
+		if ( function_exists( 'polyglot_filter' ))
+			$in = polyglot_filter($in);
+
+		if ( function_exists( 'qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage' ))
+			$in = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($in);
+
+        if (is_string($name) && !empty($name) && function_exists('icl_translate'))
+            $in = icl_translate('plugin_ngg', $name, $in, true);
+
+		$in = apply_filters('localization', $in);
+
+		return $in;
+	}
+
+    /**
+     * This function register strings for the use with WPML plugin (see http://wpml.org/ )
+     *
+     * @param object $image
+     * @return void
+     */
+    static function RegisterString($image) {
+        if (function_exists('icl_register_string')) {
+            global $wpdb;
+            icl_register_string('plugin_ngg', 'pic_' . $image->pid . '_description', $image->description, TRUE);
+            icl_register_string('plugin_ngg', 'pic_' . $image->pid . '_alttext', $image->alttext, TRUE);
+        }
+    }
+
+	/**
+	 * Check the memory_limit and calculate a recommended memory size
+	 *
+	 * @since V1.2.0
+	 * @return string message about recommended image size
+	 */
+	static function check_memory_limit() {
+
+		if ( (function_exists('memory_get_usage')) && (ini_get('memory_limit')) ) {
+
+			// get memory limit
+			$memory_limit = ini_get('memory_limit');
+			if ($memory_limit != '')
+				$memory_limit = substr($memory_limit, 0, -1) * 1024 * 1024;
+
+			// calculate the free memory
+			$freeMemory = $memory_limit - memory_get_usage();
+
+			// build the test sizes
+			$sizes = array();
+			$sizes[] = array ( 'width' => 800,  'height' => 600);
+			$sizes[] = array ( 'width' => 1024, 'height' => 768);
+			$sizes[] = array ( 'width' => 1280, 'height' => 960);  // 1MP
+			$sizes[] = array ( 'width' => 1600, 'height' => 1200); // 2MP
+			$sizes[] = array ( 'width' => 2016, 'height' => 1512); // 3MP
+			$sizes[] = array ( 'width' => 2272, 'height' => 1704); // 4MP
+			$sizes[] = array ( 'width' => 2560, 'height' => 1920); // 5MP
+
+			// test the classic sizes
+			foreach ($sizes as $size){
+				// very, very rough estimation
+				if ($freeMemory < round( $size['width'] * $size['height'] * 5.09 )) {
+                	$result = sprintf(  __( 'Note : Based on your server memory limit you should not upload larger images then <strong>%d x %d</strong> pixel', 'nggallery' ), $size['width'], $size['height']);
+					return $result;
+				}
+			}
+		}
+		return;
+	}
+
+	/**
+	 * Slightly modfifed version of pathinfo(), clean up filename & rename jpeg to jpg
+	 *
+	 * @param string $name The name being checked.
+	 * @return array containing information about file
+	 */
+	static function fileinfo( $name ) {
+
+		$name_old = $name;
+		//Sanitizes a filename replacing whitespace with dashes
+		$name = sanitize_file_name($name);
+
+		//get the parts of the name
+		$filepart = pathinfo ( strtolower($name) );
+		$filepart_old = pathinfo ( strtolower($name_old) );
+
+		if ( empty($filepart) )
+			return false;
+
+		if ( empty($filepart['extension']) && !empty($filepart_old['extension'])) {
+			$filepart = pathinfo ( strtolower($name . '.' . $filepart_old['extension']) );
+		}
+
+		// required until PHP 5.2.0
+		if ( empty($filepart['filename']) )
+			$filepart['filename'] = substr($filepart['basename'],0 ,strlen($filepart['basename']) - (strlen($filepart['extension']) + 1) );
+
+		// XXX this sanitation seems unneeded, not sure why it's here...it forces all non-ASCII chars to be URL-encoded
+		//$filepart['filename'] = sanitize_title_with_dashes( $filepart['filename'] );
+
+		//extension jpeg will not be recognized by the slideshow, so we rename it
+		$filepart['extension'] = ($filepart['extension'] == 'jpeg') ? 'jpg' : $filepart['extension'];
+
+		//combine the new file name
+		$filepart['basename'] = $filepart['filename'] . '.' . $filepart['extension'];
+
+		return $filepart;
+	}
+
+	/**
+	 * Check for extended capabilites. Must previously registers with add_ngg_capabilites()
+	 *
+	 * @since 1.5.0
+	 * @param string $capability
+	 * @return bool $result of capability check
+	 */
+	static function current_user_can( $capability ) {
+
+		global $_ngg_capabilites;
+
+		if ( is_array($_ngg_capabilites) )
+			if ( in_array($capability , $_ngg_capabilites) )
+				return current_user_can( $capability );
+
+		return true;
+	}
+
+	/**
+	 * Check for extended capabilites and echo disabled="disabled" for input form
+	 *
+	 * @since 1.5.0
+	 * @param string $capability
+	 * @return void
+	 */
+	static function current_user_can_form( $capability ) {
+
+		if ( !nggGallery::current_user_can( $capability ))
+			echo 'disabled="disabled"';
+	}
+
+	/**
+	 * Register more capabilities for custom use and add it to the administrator
+	 *
+	 * @since 1.5.0
+	 * @param string $capability
+	 * @param bool $register the new capability automatic to the admin role
+	 * @return void
+	 */
+	static function add_capabilites( $capability , $register = true ) {
+		global $_ngg_capabilites;
+
+		if ( !is_array($_ngg_capabilites) )
+			$_ngg_capabilites = array();
+
+		$_ngg_capabilites[] = $capability;
+
+		if ( $register ) {
+			$role = get_role('administrator');
+			if ( !empty($role) )
+				$role->add_cap( $capability );
+		}
+
+	}
+
+    /**
+     * Check for mobile user agent
+     *
+     * @since 1.6.0
+     * @author Part taken from WPtouch plugin (http://www.bravenewcode.com)
+     * @return bool $result of  check
+     */
+    static function detect_mobile_phone() {
+
+        $useragents = array();
+
+        // Check if WPtouch is running
+        if ( function_exists('bnc_wptouch_get_user_agents') )
+            $useragents = bnc_wptouch_get_user_agents();
+        else {
+        	$useragents = array(
+                "iPhone",  			 // Apple iPhone
+        		"iPod", 			 // Apple iPod touch
+        		"Android", 			 // 1.5+ Android
+        		"dream", 		     // Pre 1.5 Android
+        		"CUPCAKE", 			 // 1.5+ Android
+        		"blackberry9500",	 // Storm
+        		"blackberry9530",	 // Storm
+        		"blackberry9520",	 // Storm	v2
+        		"blackberry9550",	 // Storm v2
+        		"blackberry9800",	 // Torch
+        		"webOS",			 // Palm Pre Experimental
+        		"incognito", 		 // Other iPhone browser
+        		"webmate" 			 // Other iPhone browser
+        	);
+
+        	asort( $useragents );
+         }
+
+        // Godfather Steve says no to flash
+        if ( is_array($useragents) )
+            $useragents[] = "iPad";  // Apple iPad;
+
+        // WPtouch User Agent Filter
+        $useragents = apply_filters( 'wptouch_user_agents', $useragents );
+
+ 		foreach ( $useragents as $useragent ) {
+			if ( preg_match( "#$useragent#i", $_SERVER['HTTP_USER_AGENT'] ) )
+				return true;
+		}
+
+        return false;
+    }
+
+    /**
+     * get_memory_usage
+     *
+     * @access only for debug purpose
+     * @since 1.8.3
+     * @param string $text
+     * @return void
+     */
+    static function get_memory( $text = '' ) {
+        global $memory;
+
+        $memory_peak = memory_get_usage();
+        $diff = 0;
+
+		if ( isset($memory) )
+            $diff = $memory_peak - $memory;
+
+        $exp = ($diff < 0) ? '-' : '';
+        $diff = ($exp == '-') ? 0 - $diff : $diff;
+
+        $memory = $memory_peak;
+
+        $unit = array('b','kb','mb','gb','tb','pb');
+        $rounded = @round($diff/pow(1024,($i=floor(log($diff,1024)))),2).' '.$unit[$i];
+
+        echo $text . ': ' . $exp . $rounded .'<br />';
+
+    }
+
+    /**
+     * Show NextGEN Version in header
+     * @since 1.9.0
+     *
+     * @return void
+     */
+    static function nextgen_version() {
+        global $ngg;
+        echo apply_filters('show_nextgen_version', '<!-- <meta name="NextGEN" version="'. $ngg->version . '" /> -->' . "\n");
+    }
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/gd.thumbnail.inc.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/gd.thumbnail.inc.php
new file mode 100644
index 0000000000000000000000000000000000000000..e8b7ac53894a64027a1d4fb4f73d46c4ae8d3f9c
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/gd.thumbnail.inc.php
@@ -0,0 +1,943 @@
+<?php
+/**
+ * gd.thumbnail.inc.php
+ *
+ * @author 		Ian Selby (ian@gen-x-design.com)
+ * @copyright 	Copyright 2006-2011
+ * @version 	1.3.0 (based on 1.1.3)
+ * @modded      by Alex Rabe
+ *
+ */
+
+/**
+ * PHP class for dynamically resizing, cropping, and rotating images for thumbnail purposes and either displaying them on-the-fly or saving them.
+ *
+ */
+class ngg_Thumbnail {
+    /**
+     * Error message to display, if any
+     *
+     * @var string
+     */
+    var $errmsg;
+    /**
+     * Whether or not there is an error
+     *
+     * @var boolean
+     */
+    var $error;
+    /**
+     * Format of the image file
+     *
+     * @var string
+     */
+    var $format;
+    /**
+     * File name and path of the image file
+     *
+     * @var string
+     */
+    var $fileName;
+    /**
+     * Current dimensions of working image
+     *
+     * @var array
+     */
+    var $currentDimensions;
+    /**
+     * New dimensions of working image
+     *
+     * @var array
+     */
+    var $newDimensions;
+    /**
+     * Image resource for newly manipulated image
+     *
+     * @var resource
+     * @access private
+     */
+    var $newImage;
+    /**
+     * Image resource for image before previous manipulation
+     *
+     * @var resource
+     * @access private
+     */
+    var $oldImage;
+    /**
+     * Image resource for image being currently manipulated
+     *
+     * @var resource
+     * @access private
+     */
+    var $workingImage;
+    /**
+     * Percentage to resize image by
+     *
+     * @var int
+     * @access private
+     */
+    var $percent;
+    /**
+     * Maximum width of image during resize
+     *
+     * @var int
+     * @access private
+     */
+    var $maxWidth;
+    /**
+     * Maximum height of image during resize
+     *
+     * @var int
+     * @access private
+     */
+    var $maxHeight;
+    /**
+     * Image for Watermark
+     *
+     * @var string
+     *
+     */
+    var $watermarkImgPath;
+    /**
+     * Text for Watermark
+     *
+     * @var string
+     *
+     */
+    var $watermarkText;
+    /**
+     * Image Resource ID for Watermark
+     *
+     * @var string
+     *
+     */
+    function ngg_Thumbnail($fileName,$no_ErrorImage = false) {
+        //make sure the GD library is installed
+    	if(!function_exists("gd_info")) {
+        	echo 'You do not have the GD Library installed.  This class requires the GD library to function properly.' . "\n";
+        	echo 'visit http://us2.php.net/manual/en/ref.image.php for more information';
+			C_NextGEN_Bootstrap::shutdown();
+        }
+    	//initialize variables
+        $this->errmsg               = '';
+        $this->error                = false;
+        $this->currentDimensions    = array();
+        $this->newDimensions        = array();
+        $this->fileName             = $fileName;
+        $this->percent              = 100;
+        $this->maxWidth             = 0;
+        $this->maxHeight            = 0;
+        $this->watermarkImgPath		= '';
+        $this->watermarkText		= '';
+
+        //check to see if file exists
+        if(!file_exists($this->fileName)) {
+            $this->errmsg = 'File not found';
+            $this->error = true;
+        }
+        //check to see if file is readable
+        elseif(!is_readable($this->fileName)) {
+            $this->errmsg = 'File is not readable';
+            $this->error = true;
+        }
+
+        //if there are no errors, determine the file format
+        if($this->error == false) {
+    		$data = @getimagesize($this->fileName);
+    		if (isset($data) && is_array($data)) {
+    		  $extensions = array('1' => 'GIF', '2' => 'JPG', '3' => 'PNG');
+    		  $extension = array_key_exists($data[2], $extensions) ?  $extensions[$data[2]] : '';
+                if($extension) {
+                    $this->format = $extension;
+                } else {
+                    $this->errmsg = 'Unknown file format';
+                    $this->error = true;
+                }
+            } else {
+                $this->errmsg = 'File is not an image';
+                $this->error = true;
+            }
+        }
+
+		// increase memory-limit if possible, GD needs this for large images
+		// @ini_set('memory_limit', '128M');
+
+		if($this->error == false) {
+        // Check memory consumption if file exists
+			$this->checkMemoryForImage($this->fileName);
+		}
+
+        //initialize resources if no errors
+        if($this->error == false) {
+
+            switch($this->format) {
+                case 'GIF':
+                    $this->oldImage = ImageCreateFromGif($this->fileName);
+                    break;
+                case 'JPG':
+                       $this->oldImage = ImageCreateFromJpeg($this->fileName);
+                    break;
+                case 'PNG':
+                    $this->oldImage = ImageCreateFromPng($this->fileName);
+					break;
+            }
+			if (!$this->oldImage) {
+				$this->errmsg = 'Create Image failed. Check memory limit';
+		        $this->error = true;
+		    } else {
+	            $size = GetImageSize($this->fileName);
+    	        $this->currentDimensions = array('width'=>$size[0],'height'=>$size[1]);
+	            $this->newImage = $this->oldImage;
+	        }
+        }
+
+
+        if($this->error == true) {
+        	if(!$no_ErrorImage)
+            	$this->showErrorImage();
+            return;
+        }
+    }
+
+    /**
+     * Calculate the memory limit
+     *
+     */
+	function checkMemoryForImage( $filename ){
+
+		if ( (function_exists('memory_get_usage')) && (ini_get('memory_limit')) ) {
+			$imageInfo = getimagesize($filename);
+			switch($this->format) {
+                case 'GIF':
+                	// measured factor 1 is better
+                    $CHANNEL = 1;
+                    break;
+                case 'JPG':
+                    $CHANNEL = $imageInfo['channels'];
+                    break;
+                case 'PNG':
+					// didn't get the channel for png
+                    $CHANNEL = 3;
+					break;
+            }
+		    $MB = 1048576;  // number of bytes in 1M
+		    $K64 = 65536;    // number of bytes in 64K
+		    $TWEAKFACTOR = 1.68;  // Or whatever works for you
+		    $memoryNeeded = round( ( $imageInfo[0] * $imageInfo[1]
+		                                           * $imageInfo['bits']
+		                                           * $CHANNEL / 8
+		                             + $K64
+		                           ) * $TWEAKFACTOR
+		                         );
+		    $memoryNeeded = memory_get_usage() + $memoryNeeded;
+			// get memory limit
+			$memory_limit = ini_get('memory_limit');
+
+            // PHP docs : Note that to have no memory limit, set this directive to -1.
+            if ($memory_limit == -1 ) return;
+
+            // Just check megabyte limits, not higher
+            if ( strtolower(substr($memory_limit, -1)) == 'm' ) {
+
+    			if ($memory_limit != '') {
+    				$memory_limit = substr($memory_limit, 0, -1) * 1024 * 1024;
+    			}
+
+    			if ($memoryNeeded > $memory_limit) {
+    				$memoryNeeded = round ($memoryNeeded / 1024 / 1024, 2);
+    				$this->errmsg = 'Exceed Memory limit. Require : '.$memoryNeeded. " MByte" ;
+    		        $this->error = true;
+    	        }
+            }
+		}
+	    return;
+	}
+
+    /**
+     * Must be called to free up allocated memory after all manipulations are done
+     *
+     */
+    function destruct() {
+        if(is_resource($this->newImage)) @ImageDestroy($this->newImage);
+        if(is_resource($this->oldImage)) @ImageDestroy($this->oldImage);
+        if(is_resource($this->workingImage)) @ImageDestroy($this->workingImage);
+    }
+
+    /**
+     * Returns the current width of the image
+     *
+     * @return int
+     */
+    function getCurrentWidth() {
+        return $this->currentDimensions['width'];
+    }
+
+    /**
+     * Returns the current height of the image
+     *
+     * @return int
+     */
+    function getCurrentHeight() {
+        return $this->currentDimensions['height'];
+    }
+
+    /**
+     * Calculates new image width
+     *
+     * @param int $width
+     * @param int $height
+     * @return array
+     */
+    function calcWidth($width,$height) {
+        $newWp = (100 * $this->maxWidth) / $width;
+        $newHeight = ($height * $newWp) / 100;
+        return array('newWidth'=>intval($this->maxWidth),'newHeight'=>intval($newHeight));
+    }
+
+    /**
+     * Calculates new image height
+     *
+     * @param int $width
+     * @param int $height
+     * @return array
+     */
+    function calcHeight($width,$height) {
+        $newHp = (100 * $this->maxHeight) / $height;
+        $newWidth = ($width * $newHp) / 100;
+        return array('newWidth'=>intval($newWidth),'newHeight'=>intval($this->maxHeight));
+    }
+
+    /**
+     * Calculates new image size based on percentage
+     *
+     * @param int $width
+     * @param int $height
+     * @return array
+     */
+    function calcPercent($width,$height) {
+        $newWidth = ($width * $this->percent) / 100;
+        $newHeight = ($height * $this->percent) / 100;
+        return array('newWidth'=>intval($newWidth),'newHeight'=>intval($newHeight));
+    }
+
+    /**
+     * Calculates new image size based on width and height, while constraining to maxWidth and maxHeight
+     *
+     * @param int $width
+     * @param int $height
+     */
+    function calcImageSize($width,$height) {
+        $newSize = array('newWidth'=>$width,'newHeight'=>$height);
+
+        if($this->maxWidth > 0) {
+
+            $newSize = $this->calcWidth($width,$height);
+
+            if($this->maxHeight > 0 && $newSize['newHeight'] > $this->maxHeight) {
+                $newSize = $this->calcHeight($newSize['newWidth'],$newSize['newHeight']);
+            }
+
+            //$this->newDimensions = $newSize;
+        }
+
+        if($this->maxHeight > 0) {
+            $newSize = $this->calcHeight($width,$height);
+
+            if($this->maxWidth > 0 && $newSize['newWidth'] > $this->maxWidth) {
+                $newSize = $this->calcWidth($newSize['newWidth'],$newSize['newHeight']);
+            }
+
+            //$this->newDimensions = $newSize;
+        }
+
+        $this->newDimensions = $newSize;
+    }
+
+    /**
+     * Calculates new image size based percentage
+     *
+     * @param int $width
+     * @param int $height
+     */
+    function calcImageSizePercent($width,$height) {
+        if($this->percent > 0) {
+            $this->newDimensions = $this->calcPercent($width,$height);
+        }
+    }
+
+    /**
+     * Displays error image
+     *
+     */
+    function showErrorImage() {
+        header('Content-type: image/png');
+        $errImg = ImageCreate(220,25);
+        $bgColor = imagecolorallocate($errImg,0,0,0);
+        $fgColor1 = imagecolorallocate($errImg,255,255,255);
+        $fgColor2 = imagecolorallocate($errImg,255,0,0);
+        imagestring($errImg,3,6,6,'Error:',$fgColor2);
+        imagestring($errImg,3,55,6,$this->errmsg,$fgColor1);
+        imagepng($errImg);
+        imagedestroy($errImg);
+    }
+
+    /**
+     * Resizes image to fixed Width x Height
+     *
+     * @param int $Width
+     * @param int $Height
+     */
+    function resizeFix($Width = 0, $Height = 0, $deprecated = 3) {
+        $this->newWidth = $Width;
+        $this->newHeight = $Height;
+
+		if(function_exists("ImageCreateTrueColor")) {
+			$this->workingImage = ImageCreateTrueColor($this->newWidth,$this->newHeight);
+		}
+		else {
+			$this->workingImage = ImageCreate($this->newWidth,$this->newHeight);
+		}
+
+//		ImageCopyResampled(
+		$this->imagecopyresampled(
+			$this->workingImage,
+			$this->oldImage,
+			0,
+			0,
+			0,
+			0,
+			$this->newWidth,
+			$this->newHeight,
+			$this->currentDimensions['width'],
+			$this->currentDimensions['height']
+		);
+
+		$this->oldImage = $this->workingImage;
+		$this->newImage = $this->workingImage;
+		$this->currentDimensions['width'] = $this->newWidth;
+		$this->currentDimensions['height'] = $this->newHeight;
+	}
+
+
+    /**
+     * Resizes image to maxWidth x maxHeight
+     *
+     * @param int $maxWidth
+     * @param int $maxHeight
+     */
+    function resize($maxWidth = 0, $maxHeight = 0, $deprecated = 3) {
+        $this->maxWidth = $maxWidth;
+        $this->maxHeight = $maxHeight;
+
+        $this->calcImageSize($this->currentDimensions['width'],$this->currentDimensions['height']);
+
+		if(function_exists("ImageCreateTrueColor")) {
+			$this->workingImage = ImageCreateTrueColor($this->newDimensions['newWidth'],$this->newDimensions['newHeight']);
+		}
+		else {
+			$this->workingImage = ImageCreate($this->newDimensions['newWidth'],$this->newDimensions['newHeight']);
+		}
+
+//		ImageCopyResampled(
+		$this->imagecopyresampled(
+			$this->workingImage,
+			$this->oldImage,
+			0,
+			0,
+			0,
+			0,
+			$this->newDimensions['newWidth'],
+			$this->newDimensions['newHeight'],
+			$this->currentDimensions['width'],
+			$this->currentDimensions['height']
+		);
+
+		$this->oldImage = $this->workingImage;
+		$this->newImage = $this->workingImage;
+		$this->currentDimensions['width'] = $this->newDimensions['newWidth'];
+		$this->currentDimensions['height'] = $this->newDimensions['newHeight'];
+	}
+
+	/**
+	 * Resizes the image by $percent percent
+	 *
+	 * @param int $percent
+	 */
+	function resizePercent($percent = 0) {
+	    $this->percent = $percent;
+
+	    $this->calcImageSizePercent($this->currentDimensions['width'],$this->currentDimensions['height']);
+
+		if(function_exists("ImageCreateTrueColor")) {
+			$this->workingImage = ImageCreateTrueColor($this->newDimensions['newWidth'],$this->newDimensions['newHeight']);
+		}
+		else {
+			$this->workingImage = ImageCreate($this->newDimensions['newWidth'],$this->newDimensions['newHeight']);
+		}
+
+		$this->ImageCopyResampled(
+			$this->workingImage,
+			$this->oldImage,
+			0,
+			0,
+			0,
+			0,
+			$this->newDimensions['newWidth'],
+			$this->newDimensions['newHeight'],
+			$this->currentDimensions['width'],
+			$this->currentDimensions['height']
+		);
+
+		$this->oldImage = $this->workingImage;
+		$this->newImage = $this->workingImage;
+		$this->currentDimensions['width'] = $this->newDimensions['newWidth'];
+		$this->currentDimensions['height'] = $this->newDimensions['newHeight'];
+	}
+
+	/**
+	 * Crops the image from calculated center in a square of $cropSize pixels
+	 *
+	 * @param int $cropSize
+	 */
+	function cropFromCenter($cropSize) {
+	    if($cropSize > $this->currentDimensions['width']) $cropSize = $this->currentDimensions['width'];
+	    if($cropSize > $this->currentDimensions['height']) $cropSize = $this->currentDimensions['height'];
+
+	    $cropX = intval(($this->currentDimensions['width'] - $cropSize) / 2);
+	    $cropY = intval(($this->currentDimensions['height'] - $cropSize) / 2);
+
+	    if(function_exists("ImageCreateTrueColor")) {
+			$this->workingImage = ImageCreateTrueColor($cropSize,$cropSize);
+		}
+		else {
+			$this->workingImage = ImageCreate($cropSize,$cropSize);
+		}
+
+		$this->imagecopyresampled(
+            $this->workingImage,
+            $this->oldImage,
+            0,
+            0,
+            $cropX,
+            $cropY,
+            $cropSize,
+            $cropSize,
+            $cropSize,
+            $cropSize
+		);
+
+		$this->oldImage = $this->workingImage;
+		$this->newImage = $this->workingImage;
+		$this->currentDimensions['width'] = $cropSize;
+		$this->currentDimensions['height'] = $cropSize;
+	}
+
+	/**
+	 * Advanced cropping function that crops an image using $startX and $startY as the upper-left hand corner.
+	 *
+	 * @param int $startX
+	 * @param int $startY
+	 * @param int $width
+	 * @param int $height
+	 */
+	function crop($startX, $startY, $width, $height) {
+	    //make sure the cropped area is not greater than the size of the image
+	    if($width > $this->currentDimensions['width']) $width = $this->currentDimensions['width'];
+	    if($height > $this->currentDimensions['height']) $height = $this->currentDimensions['height'];
+	    //make sure not starting outside the image
+	    if(($startX + $width) > $this->currentDimensions['width']) $startX = ($this->currentDimensions['width'] - $width);
+	    if(($startY + $height) > $this->currentDimensions['height']) $startY = ($this->currentDimensions['height'] - $height);
+	    if($startX < 0) $startX = 0;
+	    if($startY < 0) $startY = 0;
+
+	    if(function_exists("ImageCreateTrueColor")) {
+			$this->workingImage = ImageCreateTrueColor($width,$height);
+		}
+		else {
+			$this->workingImage = ImageCreate($width,$height);
+		}
+
+		$this->imagecopyresampled(
+            $this->workingImage,
+            $this->oldImage,
+            0,
+            0,
+            $startX,
+            $startY,
+            $width,
+            $height,
+            $width,
+            $height
+		);
+
+		$this->oldImage = $this->workingImage;
+		$this->newImage = $this->workingImage;
+		$this->currentDimensions['width'] = $width;
+		$this->currentDimensions['height'] = $height;
+	}
+
+	/**
+	 * Outputs the image to the screen, or saves to $name if supplied.  Quality of JPEG images can be controlled with the $quality variable
+	 *
+	 * @param int $quality
+	 * @param string $name
+	 */
+	function show($quality=100,$name = '') {
+	    switch($this->format) {
+	        case 'GIF':
+	            if($name != '') {
+	               @ImageGif($this->newImage,$name) or $this->error = true;
+	            }
+	            else {
+	               header('Content-type: image/gif');
+	               ImageGif($this->newImage);
+	            }
+	            break;
+	        case 'JPG':
+	            if($name != '') {
+	               @ImageJpeg($this->newImage,$name,$quality) or $this->error = true;
+	            }
+	            else {
+	               header('Content-type: image/jpeg');
+	               ImageJpeg($this->newImage,NULL,$quality);
+	            }
+	            break;
+	        case 'PNG':
+	            if($name != '') {
+	            	@ImagePng($this->newImage,$name) or $this->error = true;
+	            }
+	            else {
+	               header('Content-type: image/png');
+	               ImagePng($this->newImage);
+	            }
+	            break;
+	    }
+	}
+
+	/**
+	 * Saves image as $name (can include file path), with quality of # percent if file is a jpeg
+	 *
+	 * @param string $name
+	 * @param int $quality
+	 * @return bool errorstate
+	 */
+	function save($name,$quality=100) {
+	    $this->show($quality,$name);
+	    if ($this->error == true) {
+	    	$this->errmsg = 'Create Image failed. Check safe mode settings';
+	    	return false;
+	    }
+
+        if( function_exists('do_action') )
+	       do_action('ngg_ajax_image_save', $name);
+
+	    return true;
+	}
+
+	/**
+	 * Creates Apple-style reflection under image, optionally adding a border to main image
+	 *
+	 * @param int $percent
+	 * @param int $reflection
+	 * @param int $white
+	 * @param bool $border
+	 * @param string $borderColor
+	 */
+	function createReflection($percent,$reflection,$white,$border = true,$borderColor = '#a4a4a4') {
+        $width = $this->currentDimensions['width'];
+        $height = $this->currentDimensions['height'];
+
+        $reflectionHeight = intval($height * ($reflection / 100));
+        $newHeight = $height + $reflectionHeight;
+        $reflectedPart = $height * ($percent / 100);
+
+        $this->workingImage = ImageCreateTrueColor($width,$newHeight);
+
+        ImageAlphaBlending($this->workingImage,true);
+
+        $colorToPaint = ImageColorAllocateAlpha($this->workingImage,255,255,255,0);
+        ImageFilledRectangle($this->workingImage,0,0,$width,$newHeight,$colorToPaint);
+
+        imagecopyresampled(
+                            $this->workingImage,
+                            $this->newImage,
+                            0,
+                            0,
+                            0,
+                            $reflectedPart,
+                            $width,
+                            $reflectionHeight,
+                            $width,
+                            ($height - $reflectedPart));
+        $this->imageFlipVertical();
+
+        imagecopy($this->workingImage,$this->newImage,0,0,0,0,$width,$height);
+
+        imagealphablending($this->workingImage,true);
+
+        for($i=0;$i<$reflectionHeight;$i++) {
+            $colorToPaint = imagecolorallocatealpha($this->workingImage,255,255,255,($i/$reflectionHeight*-1+1)*$white);
+            imagefilledrectangle($this->workingImage,0,$height+$i,$width,$height+$i,$colorToPaint);
+        }
+
+        if($border == true) {
+            $rgb = $this->hex2rgb($borderColor,false);
+            $colorToPaint = imagecolorallocate($this->workingImage,$rgb[0],$rgb[1],$rgb[2]);
+            imageline($this->workingImage,0,0,$width,0,$colorToPaint); //top line
+            imageline($this->workingImage,0,$height,$width,$height,$colorToPaint); //bottom line
+            imageline($this->workingImage,0,0,0,$height,$colorToPaint); //left line
+            imageline($this->workingImage,$width-1,0,$width-1,$height,$colorToPaint); //right line
+        }
+
+        $this->oldImage = $this->workingImage;
+		$this->newImage = $this->workingImage;
+		$this->currentDimensions['width'] = $width;
+		$this->currentDimensions['height'] = $newHeight;
+	}
+
+	/**
+	 * Flip an image.
+	 *
+	 * @param bool $horz flip the image in horizontal mode
+	 * @param bool $vert flip the image in vertical mode
+	 */
+	function flipImage( $horz = false, $vert = false ) {
+
+		$sx = $vert ? ($this->currentDimensions['width'] - 1) : 0;
+		$sy = $horz ? ($this->currentDimensions['height'] - 1) : 0;
+		$sw = $vert ? -$this->currentDimensions['width'] : $this->currentDimensions['width'];
+		$sh = $horz ? -$this->currentDimensions['height'] : $this->currentDimensions['height'];
+
+		$this->workingImage = imagecreatetruecolor( $this->currentDimensions['width'], $this->currentDimensions['height'] );
+
+		$this->imagecopyresampled($this->workingImage, $this->oldImage, 0, 0, $sx, $sy, $this->currentDimensions['width'], $this->currentDimensions['height'], $sw, $sh) ;
+		$this->oldImage = $this->workingImage;
+		$this->newImage = $this->workingImage;
+
+		return true;
+	}
+
+	/**
+	 * Rotate an image clockwise or counter clockwise
+	 *
+	 * @param string $direction could be CW or CCW
+	 */
+	function rotateImage( $dir = 'CW' ) {
+
+		$angle = ($dir == 'CW') ? 90 : -90;
+
+		if ( function_exists('imagerotate') ) {
+	        $this->workingImage = imagerotate($this->oldImage, 360 - $angle, 0); // imagerotate() rotates CCW
+	        $this->currentDimensions['width']  = imagesx($this->workingImage);
+	    	$this->currentDimensions['height'] = imagesy($this->workingImage);
+    	    $this->oldImage = $this->workingImage;
+			$this->newImage = $this->workingImage;
+			return true;
+		}
+
+		$this->workingImage = imagecreatetruecolor( $this->currentDimensions['height'], $this->currentDimensions['width'] );
+
+	    imagealphablending($this->workingImage, false);
+	    imagesavealpha($this->workingImage, true);
+
+		switch ($angle) {
+
+			case 90 :
+				for( $x = 0; $x < $this->currentDimensions['width']; $x++ ) {
+	   	            for( $y = 0; $y < $this->currentDimensions['height']; $y++ ) {
+	  	                if ( !imagecopy($this->workingImage, $this->oldImage, $this->currentDimensions['height'] - $y - 1, $x, $x, $y, 1, 1) )
+	  	                    return false;
+	 	            }
+	  	        }
+			break;
+
+			case -90 :
+				for( $x = 0; $x < $this->currentDimensions['width']; $x++ ) {
+	 	            for( $y = 0; $y < $this->currentDimensions['height']; $y++ ) {
+	 	                if ( !imagecopy($this->workingImage, $this->oldImage, $y, $this->currentDimensions['width'] - $x - 1, $x, $y, 1, 1) )
+	 	                    return false;
+	 	            }
+	 	        }
+			break;
+
+			default :
+				return false;
+		}
+
+		$this->currentDimensions['width']  = imagesx($this->workingImage);
+	    $this->currentDimensions['height'] = imagesy($this->workingImage);
+	    $this->oldImage = $this->workingImage;
+		$this->newImage = $this->workingImage;
+
+	    return true;
+
+	}
+
+	/**
+	 * Inverts working image, used by reflection function
+	 *
+	 * @access	private
+	 */
+	function imageFlipVertical() {
+	    $x_i = imagesx($this->workingImage);
+	    $y_i = imagesy($this->workingImage);
+
+	    for($x = 0; $x < $x_i; $x++) {
+	        for($y = 0; $y < $y_i; $y++) {
+	            imagecopy($this->workingImage,$this->workingImage,$x,$y_i - $y - 1, $x, $y, 1, 1);
+	        }
+	    }
+	}
+
+	/**
+	 * Converts hexidecimal color value to rgb values and returns as array/string
+	 *
+	 * @param string $hex
+	 * @param bool $asString
+	 * @return array|string
+	 */
+	function hex2rgb($hex, $asString = false) {
+        // strip off any leading #
+        if (0 === strpos($hex, '#')) {
+           $hex = substr($hex, 1);
+        } else if (0 === strpos($hex, '&H')) {
+           $hex = substr($hex, 2);
+        }
+
+        // break into hex 3-tuple
+        $cutpoint = ceil(strlen($hex) / 2)-1;
+        $rgb = explode(':', wordwrap($hex, $cutpoint, ':', $cutpoint), 3);
+
+        // convert each tuple to decimal
+        $rgb[0] = (isset($rgb[0]) ? hexdec($rgb[0]) : 0);
+        $rgb[1] = (isset($rgb[1]) ? hexdec($rgb[1]) : 0);
+        $rgb[2] = (isset($rgb[2]) ? hexdec($rgb[2]) : 0);
+
+        return ($asString ? "{$rgb[0]} {$rgb[1]} {$rgb[2]}" : $rgb);
+    }
+
+	/**
+     * Based on the Watermark function by Marek Malcherek
+     * http://www.malcherek.de
+     *
+ 	 * @param string $color
+	 * @param string $wmFont
+	 * @param int $wmSize
+ 	 * @param int $wmOpaque
+     */
+	function watermarkCreateText($color = '000000',$wmFont, $wmSize = 10, $wmOpaque = 90 ){
+		// set font path
+		$wmFontPath = NGGALLERY_ABSPATH."fonts/".$wmFont;
+		if ( !is_readable($wmFontPath))
+			return;
+
+		// This function requires both the GD library and the FreeType library.
+		if ( !function_exists('ImageTTFBBox') )
+			return;
+
+		$TextSize = @ImageTTFBBox($wmSize, 0, $wmFontPath, $this->watermarkText) or die;
+		$TextWidth = abs($TextSize[2]) + abs($TextSize[0]);
+		$TextHeight = abs($TextSize[7]) + abs($TextSize[1]);
+		// Create Image for Text
+		$this->workingImage = ImageCreateTrueColor($TextWidth, $TextHeight);
+		ImageSaveAlpha($this->workingImage, true);
+		ImageAlphaBlending($this->workingImage, false);
+		$bgText = imagecolorallocatealpha($this->workingImage, 255, 255, 255, 127);
+		imagefill($this->workingImage, 0, 0, $bgText);
+		$wmTransp = 127 -( $wmOpaque * 1.27 );
+		$rgb = $this->hex2rgb($color,false);
+		$TextColor = imagecolorallocatealpha($this->workingImage, $rgb[0], $rgb[1], $rgb[2], $wmTransp);
+
+		// Create Text on image
+		imagettftext($this->workingImage, $wmSize, 0, 0, abs($TextSize[5]), $TextColor, $wmFontPath, $this->watermarkText);
+		$this->watermarkImgPath = $this->workingImage;
+
+		return;
+	}
+
+    /**
+     * Modfied Watermark function by Steve Peart
+     * http://parasitehosting.com/
+     *
+ 	 * @param string $relPOS
+	 * @param int $xPOS
+ 	 * @param int $yPOS
+     */
+    function watermarkImage( $relPOS = 'botRight', $xPOS = 0, $yPOS = 0) {
+
+		// if it's a resource ID take it as watermark text image
+    	if(is_resource($this->watermarkImgPath)) {
+    		$this->workingImage = $this->watermarkImgPath;
+    	} else {
+		// Would you really want to use anything other than a png?
+		$this->workingImage = @imagecreatefrompng($this->watermarkImgPath);
+		// if it's not a valid file die...
+		if (empty($this->workingImage) or (!$this->workingImage))
+			return;
+		}
+
+		imagealphablending($this->workingImage, false);
+		imagesavealpha($this->workingImage, true);
+		$sourcefile_width=imageSX($this->oldImage);
+		$sourcefile_height=imageSY($this->oldImage);
+		$watermarkfile_width=imageSX($this->workingImage);
+		$watermarkfile_height=imageSY($this->workingImage);
+		switch(substr($relPOS, 0, 3)){
+			case 'top': $dest_y = 0 + $yPOS; break;
+			case 'mid': $dest_y = ($sourcefile_height / 2) - ($watermarkfile_height / 2); break;
+			case 'bot': $dest_y = $sourcefile_height - $watermarkfile_height - $yPOS; break;
+			default   : $dest_y = 0; break;
+		}
+		switch(substr($relPOS, 3)){
+			case 'Left'	:	$dest_x = 0 + $xPOS; break;
+			case 'Center':	$dest_x = ($sourcefile_width / 2) - ($watermarkfile_width / 2); break;
+			case 'Right':	$dest_x = $sourcefile_width - $watermarkfile_width - $xPOS; break;
+			default : 		$dest_x = 0; break;
+		}
+
+		// debug
+		// $this->errmsg = 'X '.$dest_x.' Y '.$dest_y;
+		// $this->showErrorImage();
+
+		// if a gif, we have to upsample it to a truecolor image
+		if($this->format == 'GIF') {
+			$tempimage = imagecreatetruecolor($sourcefile_width,$sourcefile_height);
+			imagecopy($tempimage, $this->oldImage, 0, 0, 0, 0,$sourcefile_width, $sourcefile_height);
+			$this->newImage = $tempimage;
+		}
+
+		imagecopy($this->newImage, $this->workingImage, $dest_x, $dest_y, 0, 0,$watermarkfile_width, $watermarkfile_height);
+	}
+
+    /**
+     * Modfied imagecopyresampled function to save transparent images
+     * See : http://www.akemapa.com/2008/07/10/php-gd-resize-transparent-image-png-gif/
+     * @since 1.9.0
+     *
+     * @param resource $dst_image
+     * @param resource $src_image
+     * @param int $dst_x
+     * @param int $dst_y
+     * @param int $src_x
+     * @param int $src_y
+     * @param int $dst_w
+     * @param int $dst_h
+     * @param int $src_w
+     * @param int $src_h
+     * @return bool
+     */
+    function imagecopyresampled( &$dst_image , $src_image , $dst_x , $dst_y , $src_x , $src_y , $dst_w , $dst_h , $src_w , $src_h) {
+
+        // Check if this image is PNG or GIF, then set if Transparent
+        if( $this->format == 'GIF' || $this->format == 'PNG'){
+            imagealphablending($dst_image, false);
+            imagesavealpha($dst_image, true);
+            $transparent = imagecolorallocatealpha($dst_image, 255, 255, 255, 127);
+            imagefilledrectangle($dst_image, 0, 0, $dst_w, $dst_h, $transparent);
+        }
+
+        imagecopyresampled($dst_image , $src_image , $dst_x , $dst_y , $src_x , $src_y , $dst_w , $dst_h , $src_w , $src_h);
+        return true;
+    }
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/image.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/image.php
new file mode 100644
index 0000000000000000000000000000000000000000..c874d2a21bcc080f71830b7be4ae9fd3b77eacb3
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/image.php
@@ -0,0 +1,83 @@
+<?php
+if (!class_exists('nggImage'))
+{
+    /**
+     * This is a wrapper class to the C_Image_Wrapper which provides all of the necessary logic for
+     * retrieving attributes as needed.
+     *
+     * NOTE: it isn't possible yet (as of PHP 5.4) to use overloaded properties in any language constructs other than
+     * isset(). To work around this with the wrapper class (which uses overloaded properties) we make a copy of any
+     * attributes set to this object.
+     */
+    class nggImage extends Ngg_Serializable
+    {
+        public $_ngiw;
+        public $_propogate = TRUE;
+
+
+        // TODO: Make nggImage a subclass of C_Component and use the wrapper functionality
+        function __construct($image)
+        {
+            $image->meta_data = $this->unserialize($image->meta_data);
+            C_Component_Registry::get_instance();
+            $this->_ngiw = new C_Image_Wrapper($image, NULL, TRUE);
+        }
+
+        public function __set($name, $value)
+        {
+            $this->$name = $value;
+            if ($this->_propogate)
+                $this->_ngiw->__set($name, $value);
+        }
+
+        public function __isset($name)
+        {
+            return $this->_ngiw->__isset($name);
+        }
+
+        public function __unset($name)
+        {
+            return $this->_ngiw->__unset($name);
+        }
+
+        public function __get($name)
+        {
+            $this->_propogate = FALSE;
+            $this->$name = $this->_ngiw->__get($name);
+            $this->_propogate = TRUE;
+            return $this->$name;
+        }
+
+        function get_thumbcode($galleryname = '')
+        {
+            return $this->_ngiw->get_thumbcode($galleryname);
+        }
+
+        function get_href_link()
+        {
+            return $this->_ngiw->get_href_link();
+        }
+
+        function get_href_thumb_link()
+        {
+            return $this->_ngiw->get_href_thumb_link();
+        }
+
+        function cached_singlepic_file($width = '', $height = '', $mode = '' )
+        {
+            return $this->_ngiw->cached_singlepic_file($width, $height, $mode);
+        }
+
+        function get_tags()
+        {
+            return $this->_ngiw->get_tags();
+        }
+
+        function get_permalink()
+        {
+            return $this->_ngiw->get_permalink();
+        }
+
+    }
+
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/imagemagick.inc.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/imagemagick.inc.php
new file mode 100644
index 0000000000000000000000000000000000000000..fb9b5eb88b445d141e5b60dbcb452372fbf155f3
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/imagemagick.inc.php
@@ -0,0 +1,597 @@
+<?php
+/**
+* imagemagick.inc.php
+*
+* @author 		Frederic De Ranter
+* @copyright	Copyright 2008
+* @version 		0.4 (PHP4)
+* @based 		on thumbnail.inc.php by Ian Selby (gen-x-design.com)
+* @since		NextGEN V1.0.0
+*
+*/
+/**
+* PHP class for dynamically resizing, cropping, and rotating images for thumbnail purposes and either displaying them on-the-fly or saving them.
+* with ImageMagick
+*/
+
+class ngg_Thumbnail {
+/**
+* Error message to display, if any
+* @var string
+*/
+var $errmsg;
+/**
+* Whether or not there is an error
+* @var boolean
+*/
+var $error;
+/**
+* File name and path of the image file
+* @var string
+*/
+var $fileName;
+/**
+* Image meta data if any is available (jpeg/tiff) via the exif library
+* @var array
+*/
+var $imageMeta;
+/**
+* Current dimensions of working image
+* @var array
+*/
+var $currentDimensions;
+/**
+* New dimensions of working image
+* @var array
+*/
+var $newDimensions;
+/**
+* Percentage to resize image b
+* @var int
+* @access private
+*/
+var $percent;
+/**
+* Maximum width of image during resize
+* @var int
+* @access private
+*/
+var $maxWidth;
+/**
+* Maximum height of image during resize
+* @var int
+* @access private
+*/
+var $maxHeight;
+/**
+* Image for Watermark
+* @var string
+*/
+var $watermarkImgPath;
+/**
+* Text for Watermark
+* @var string
+*/
+var $watermarkText;
+/**
+* Path to ImageMagick convert
+* @var string
+*/
+var $imageMagickDir;
+/**
+* String to execute ImageMagick convert.
+* @var string
+*/
+var $imageMagickExec;
+/**
+* String to execute ImageMagick composite.
+* @var string
+*/
+var $imageMagickComp;
+/**
+* String to execute ImageMagick (before the filename).
+* @var string
+*/
+var $imageMagickBefore;
+
+  /*
+   * in: filename, error
+   * out: nothing 
+   * init of class: init of variables, detect needed memory (gd), image format (gd), detect image size (GetImageSize is general PHP, not GD), Image Meta?
+   */
+
+	function ngg_Thumbnail($fileName, $no_ErrorImage = false) {
+		
+		//initialize variables
+      	$this->errmsg				= '';
+      	$this->error				= false;
+      	$this->currentDimensions	= array();
+      	$this->newDimensions		= array();
+      	$this->fileName				= $fileName;
+      	$this->imageMeta			= array();
+      	$this->percent				= 100;
+      	$this->maxWidth				= 0;
+      	$this->maxHeight			= 0;
+      	$this->watermarkImgPath		= '';
+      	$this->watermarkText		= '';
+		$this->imageMagickExec		= '';
+      	$this->imageMagickComp		= '';
+      	$this->imageMagickBefore	= '';
+
+		//make sure ImageMagick is installed
+		$this->checkVersion();
+      
+		//check to see if file exists
+		if(!file_exists($this->fileName)) {
+			$this->errmsg = 'File not found';
+			$this->error = true;
+		}
+		//check to see if file is readable
+		elseif(!is_readable($this->fileName)) {
+			$this->errmsg = 'File is not readable';
+			$this->error = true;
+		}
+
+		if($this->error == false) { 
+	    	$size = GetImageSize($this->fileName);
+      		$this->currentDimensions = array('width'=>$size[0],'height'=>$size[1]);
+	  	}
+	    
+		if($this->error == true) {
+			// for SinglePic send the error message out
+	    	if(!$no_ErrorImage) 
+	    		echo $this->errmsg;
+	    	return;
+	    }
+	}
+
+	function checkVersion() {
+		
+		// very often exec()or passthru() is disabled. No chance for Imagick
+		if ( ini_get('disable_functions') ) {
+			$not_allowed = ini_get('disable_functions');
+			if ( stristr($not_allowed, 'exec') || stristr($not_allowed, 'passthru') ) {
+				$this->errmsg = 'exec() or passthru() is not allowed. Could not execute Imagick';
+				$this->error = true;
+				return false;
+			}
+		}
+		
+		// get the path to imageMagick
+		$ngg_options = get_option('ngg_options');
+		$this->imageMagickDir = trim( $ngg_options['imageMagickDir']);
+		$this->imageMagickDir = str_replace( "\\", "/", $this->imageMagickDir );
+
+		// Try to get the ImageMagick version		
+		$magickv = $this->execute('convert', '-version');
+		
+		if ( empty($magickv) ) {
+			$this->errmsg = 'Could not execute ImageMagick. Check path ';
+			$this->error = true;
+			return false;
+		}
+		
+		// We need as least version 6 or higher	
+		$helper = preg_match('/Version: ImageMagick ([0-9])/', $magickv[0], $magickversion);
+		if ( !$magickversion[0] > '5' ) {
+			$this->errmsg = 'Require ImageMagick Version 6 or higher';
+			$this->error = true;
+			return false;
+		}
+
+      	return true;
+	}
+	
+
+	/**
+     * Execute ImageMagick/GraphicsMagick commands
+     *
+     * @param string $cmd an ImageMagick command (eg. "convert")
+     * @param string $args the arguments which should be passed
+     * @param bool �passthru(optional) output the result to the webserver instead
+     * @return void | if passthru return the image
+     */
+	function execute( $cmd, $args, $passthru = false) {
+		
+		// in error case we do not continue
+		if($this->error == true)
+			return;
+
+		//if path is not empty
+		if ($this->imageMagickDir != '') {
+		// the path must have a slash at the end
+			if ( $this->imageMagickDir{strlen($this->imageMagickDir)-1} != '/')
+		    	$this->imageMagickDir .= '/';
+		}
+	
+		//$args = escapeshellarg($args);
+		//var_dump( escapeshellcmd ( "{$this->imageMagickDir}/{$cmd} {$args}" ) ); return;
+		//$this->errmsg = escapeshellcmd( "{$this->imageMagickDir}{$cmd} {$args}" );
+		
+		if ( !$passthru ) {
+			exec( "{$this->imageMagickDir}{$cmd} {$args}", $result );
+			//var_dump( "{$this->imageMagickDir}/{$cmd} {$args}" );
+			return $result;
+			
+		}
+		//var_dump( escapeshellcmd ( "{$this->imageMagickDir}/{$cmd} {$args}" ) ); return;
+
+		// for single pic we need the direct output
+		header('Content-type: image/jpeg');
+		$this->errmsg = "{$this->imageMagickDir}{$cmd} {$args}";
+		passthru( "{$this->imageMagickDir}{$cmd} {$args}" );
+	}
+
+
+    /**
+     * Must be called to free up allocated memory after all manipulations are done
+     */
+    function destruct() {
+     	//not needed for ImageMagick
+		return;
+    }
+    
+    /**
+     * Returns the current width of the image
+     * @return int
+     */
+    function getCurrentWidth() {
+        return $this->currentDimensions['width'];
+    }
+
+    /**
+     * Returns the current height of the image
+     * @return int
+     */
+    function getCurrentHeight() {
+        return $this->currentDimensions['height'];
+    }
+
+    /**
+     * Calculates new image width
+     * @param int $width
+     * @param int $height
+     * @return array
+     */
+    function calcWidth($width, $height) {
+        $newWp = (100 * $this->maxWidth) / $width;
+        $newHeight = ($height * $newWp) / 100;
+        return array('newWidth'=>intval($this->maxWidth), 'newHeight'=>intval($newHeight));
+    }
+
+    /**
+     * Calculates new image height
+     * @param int $width
+     * @param int $height
+     * @return array
+     */
+    function calcHeight($width, $height) {
+        $newHp = (100 * $this->maxHeight) / $height;
+        $newWidth = ($width * $newHp) / 100;
+        return array('newWidth'=>intval($newWidth), 'newHeight'=>intval($this->maxHeight));
+    }
+
+    /**
+     * Calculates new image size based on percentage
+     * @param int $width
+     * @param int $height
+     * @return array
+     */
+    function calcPercent($width, $height) {
+        $newWidth = ($width * $this->percent) / 100;
+        $newHeight = ($height * $this->percent) / 100;
+        return array('newWidth'=>intval($newWidth), 'newHeight'=>intval($newHeight));
+    }
+
+    /**
+     * Calculates new image size based on width and height, while constraining to maxWidth and maxHeight
+     * @param int $width
+     * @param int $height
+     */
+    function calcImageSize($width,$height) {
+        $newSize = array('newWidth'=>$width,'newHeight'=>$height);
+
+        if($this->maxWidth > 0) {
+
+            $newSize = $this->calcWidth($width,$height);
+
+            if($this->maxHeight > 0 && $newSize['newHeight'] > $this->maxHeight) {
+                $newSize = $this->calcHeight($newSize['newWidth'],$newSize['newHeight']);
+            }
+
+            //$this->newDimensions = $newSize;
+        }
+
+        if($this->maxHeight > 0) {
+            $newSize = $this->calcHeight($width,$height);
+
+            if($this->maxWidth > 0 && $newSize['newWidth'] > $this->maxWidth) {
+                $newSize = $this->calcWidth($newSize['newWidth'],$newSize['newHeight']);
+            }
+
+            //$this->newDimensions = $newSize;
+        }
+
+        $this->newDimensions = $newSize;
+    }
+
+    /**
+     * Calculates new image size based percentage
+     * @param int $width
+     * @param int $height
+     */
+    function calcImageSizePercent($width,$height) {
+        if($this->percent > 0) {
+            $this->newDimensions = $this->calcPercent($width,$height);
+        }
+    }
+
+    /**
+     * Resizes image to maxWidth x maxHeight
+     *
+     * @param int $maxWidth
+     * @param int $maxHeight
+     */
+	  
+	function resize($maxWidth = 0, $maxHeight = 0, $resampleMode = 3) {
+		$this->maxWidth = $maxWidth;
+    	$this->maxHeight = $maxHeight;
+
+    	$this->calcImageSize($this->currentDimensions['width'],$this->currentDimensions['height']);
+
+		//string to resize the picture to $this->newDimensions['newWidth'],$this->newDimensions['newHeight']
+		//should result in: -thumbnail $this->newDimensions['newWidth']x$this->newDimensions['newHeight']
+		if($maxWidth=='0')
+			$this->imageMagickExec .= " -resize x".$maxHeight;
+		elseif($maxHeight=='0')
+			$this->imageMagickExec .= " -resize ".$maxWidth."x";
+		elseif($maxHeight!='0' && $maxWidth!='0')
+			$this->imageMagickExec .= " -resize ".$maxWidth."x".$maxHeight;
+			
+		// next calculations should be done with the 'new' dimensions
+		$this->currentDimensions['width'] = $this->newDimensions['newWidth'];
+		$this->currentDimensions['height'] = $this->newDimensions['newHeight'];
+		
+	}
+
+	/**
+	 * Flip an image.
+	 *
+	 * @param bool $horz flip the image in horizontal mode
+	 * @param bool $vert flip the image in vertical mode
+	 */
+	function flipImage( $horz = false, $vert = false ) {
+		
+		//TODO: need to be added
+
+	}
+	
+	/**
+     * Rotates image either 90 degrees clockwise or counter-clockwise
+     *
+     * @param string $direction
+     */
+	function rotateImage($dir = 'CW') {
+		
+		$angle = ($dir == 'CW') ? 90 : -90;
+
+  		$this->imageMagickExec .= " -rotate $angle ";
+		
+		$newWidth = $this->currentDimensions['height'];
+	   	$newHeight = $this->currentDimensions['width'];
+		$this->currentDimensions['width'] = $newWidth;
+		$this->currentDimensions['height'] = $newHeight;
+	}
+
+   /**
+	 * Crops the image from calculated center in a square of $cropSize pixels
+	 *
+	 * @param int $cropSize
+	 */
+	function cropFromCenter($cropSize, $resampleMode = 3) {
+	   if($cropSize > $this->currentDimensions['width']) $cropSize = $this->currentDimensions['width'];
+	   if($cropSize > $this->currentDimensions['height']) $cropSize = $this->currentDimensions['height'];
+
+	   //$cropX = intval(($this->currentDimensions['width'] - $cropSize) / 2);
+	   //$cropY = intval(($this->currentDimensions['height'] - $cropSize) / 2);
+
+		//string to crop the picture to $cropSize,$cropSize (from center)
+		//result: -gravity Center -crop $cropSizex$cropSize+0+0
+		$this->imageMagickExec .= ' -gravity Center -crop ' . $cropSize . 'x' . $cropSize . '+0+0';
+		
+		// next calculations should be done with the 'new' dimensions
+		$this->currentDimensions['width'] = $cropSize;
+		$this->currentDimensions['height'] = $cropSize;		
+	}
+
+	/**
+	 * Advanced cropping function that crops an image using $startX and $startY as the upper-left hand corner.
+	 *
+	 * @param int $startX
+	 * @param int $startY
+	 * @param int $width
+	 * @param int $height
+	 */
+	function crop($startX,$startY,$width,$height) {
+	    //make sure the cropped area is not greater than the size of the image
+	   if($width > $this->currentDimensions['width']) $width = $this->currentDimensions['width'];
+	   if($height > $this->currentDimensions['height']) $height = $this->currentDimensions['height'];
+	    //make sure not starting outside the image
+	   if(($startX + $width) > $this->currentDimensions['width']) $startX = ($this->currentDimensions['width'] - $width);
+	   if(($startY + $height) > $this->currentDimensions['height']) $startY = ($this->currentDimensions['height'] - $height);
+	   if($startX < 0) $startX = 0;
+	   if($startY < 0) $startY = 0;
+
+		//string to crop the picture to $width,$height (from $startX,$startY)
+		//result: -crop $widthx$height+$startX+$startY
+		$this->imageMagickExec .= ' -crop ' . $width . 'x' . $height . '+' . $startX .'+' . $startY;
+
+		$this->currentDimensions['width'] = $width;
+		$this->currentDimensions['height'] = $height;
+	}
+
+	/**
+	 * Creates Apple-style reflection under image, optionally adding a border to main image
+	 *
+	 * @param int $percent
+	 * @param int $reflection
+	 * @param int $white
+	 * @param bool $border
+	 * @param string $borderColor
+	 */
+	function createReflection($percent, $reflection, $white, $border = true, $borderColor = '#a4a4a4') {
+
+	    $width = $this->currentDimensions['width'];
+	    $height = $this->currentDimensions['height'];
+	
+	    $reflectionHeight = intval($height * ($reflection / 100));
+	    $newHeight = $height + $reflectionHeight;
+	        //$reflectedPart = $height * ((100-$percent) / 100);
+	    $reflectedsize = intval($height * ((100 - (100 - $percent) + $reflection) / 100)); 
+			
+		$this->imageMagickBefore = "-size $width" . "x" ."$newHeight xc:white ";
+			
+		if($border == true) {
+			$this->imageMagickBefore .= " \( ";	 
+			$this->imageMagickExec = " -bordercolor '$borderColor' -border 1 \) ";
+		}
+
+		$this->imageMagickExec .= " -geometry +0+0 -composite ";
+		$gradientWhite = 100-$white;
+		$this->imageMagickExec .= " \( '$this->fileName' -flip -resize $width"."x"."$reflectedsize\! \( -size $width"."x"."$reflectionHeight gradient: -fill black -colorize $gradientWhite \) +matte -compose copy_opacity -composite \) -geometry +0+$height -composite ";
+
+		$this->currentDimensions['width'] = $width;
+		$this->currentDimensions['height'] = $newHeight;
+	}
+	
+	/**
+ 	 * @param string $color
+	 * @param string $wmFont
+	 * @param int $wmSize
+ 	 * @param int $wmOpaque
+     */
+	function watermarkCreateText($color = '000000', $wmFont, $wmSize = 10, $wmOpaque = 90 ){
+		//create a watermark.png image with the requested text.
+		
+		// set font path
+		$wmFontPath = NGGALLERY_ABSPATH . 'fonts/' . $wmFont;
+		if ( !is_readable($wmFontPath) )
+			return;	
+			
+		/*
+		$exec = "convert -size 800x500 xc:grey30 -font $wmFontPath -pointsize $wmSize -gravity center -draw \"fill '#$color$wmOpaque'  text 0,0  '$this->watermarkText'\" stamp_fgnd.png"; 
+		$make_magick = system($exec);
+		$exec = "convert -size 800x500 xc:black -font $wmFontPath -pointsize $wmSize -gravity center -draw \"fill white  text  1,1  '$this->watermarkText'  text  0,0  '$this->watermarkText' fill black  text -1,-1 '$this->watermarkText'\" +matte stamp_mask.png";
+		$make_magick = system($exec);
+		$exec = "composite -compose CopyOpacity  stamp_mask.png  stamp_fgnd.png  watermark.png";*/
+
+		//convert the opacity between FF or 00; 100->0 and 0->FF (256)
+		$opacity = dechex( round( (100-$wmOpaque) * 256/100 ) );
+		if ($opacity == "0") {$opacity = "00";} 
+		
+		$cmd = "-size 800x500 xc:none -fill '#{$color}{$opacity}' -font {$wmFontPath} -pointsize {$wmSize} -gravity center -annotate 0 '{$this->watermarkText}' watermark_text.png";
+		$this->execute('convert', $cmd);
+		
+		$cmd = "-trim +repage watermark_text.png";		 
+		$this->execute('mogrify', $cmd);
+	
+		$this->watermarkImgPath = NGGALLERY_ABSPATH . 'watermark_text.png';
+
+		return;		
+	}
+    
+    /**
+     *
+ 	 * @param string $relPOS
+	 * @param int $xPOS
+ 	 * @param int $yPOS
+     */
+    function watermarkImage( $relPOS = 'botRight', $xPOS = 0, $yPOS = 0) {
+
+		// if it's not a valid file die... 
+		/*if ( !is_readable($this->watermarkImgPath))
+		{
+			echo $this->watermarkImgPath;
+			return;
+		}	*/
+
+		$size = GetImageSize($this->watermarkImgPath);
+    	$watermarkDimensions = array('width'=>$size[0],'height'=>$size[1]);
+		
+		$sourcefile_width=$this->currentDimensions['width'];
+		$sourcefile_height=$this->currentDimensions['height'];
+		
+		$watermarkfile_width=$watermarkDimensions['width'];
+		$watermarkfile_height=$watermarkDimensions['height'];
+
+		switch( substr($relPOS, 0, 3) ){
+			case 'top': $dest_y = 0 + $yPOS; break;
+			case 'mid': $dest_y = ($sourcefile_height / 2) - ($watermarkfile_height / 2); break;
+			case 'bot': $dest_y = $sourcefile_height - $watermarkfile_height - $yPOS; break;
+			default   : $dest_y = 0; break;
+		}
+		switch( substr($relPOS, 3) ){
+			case 'Left'	:	$dest_x = 0 + $xPOS; break;
+			case 'Center':	$dest_x = ($sourcefile_width / 2) - ($watermarkfile_width / 2); break;
+			case 'Right':	$dest_x = $sourcefile_width - $watermarkfile_width - $xPOS; break;
+			default : 		$dest_x = 0; break;
+		}
+		if ($dest_y<0) {
+			$dest_y = $dest_y; 
+		} else { 
+			$dest_y = '+' . $dest_y;
+		}
+		if ($dest_x<0) {
+			$dest_x = $dest_x; 
+		} else { 
+			$dest_x = '+' . $dest_x;
+		}
+		
+		$this->imageMagickComp .=  "'$this->watermarkImgPath' -geometry $dest_x$dest_y  -composite";
+		//" -dissolve 80% -geometry +$dest_x+$dest_y $this->watermarkImgPath";
+	}
+    
+	/**
+	 * Saves image as $name (can include file path), with quality of # percent if file is a jpeg
+	 *
+	 * @param string $name
+	 * @param int $quality
+	 * @return bool errorstate
+	 */
+	function save( $name, $quality = 85 ) {
+	    $this->show($quality,$name);
+	    if ($this->error == true) {
+	    	//$this->errmsg = 'Create Image failed. Check safe mode settings';
+	    	return false;
+	    }
+        
+        if( function_exists('do_action') )
+	       do_action('ngg_ajax_image_save', $name);
+
+	    return true;
+	}
+	    
+	/**
+	 * Outputs the image to the screen, or saves to $name if supplied.  Quality of JPEG images can be controlled with the $quality variable
+	 *
+	 * @param int $quality
+	 * @param string $name
+	 */
+	function show( $quality = 85, $name = '') {
+		//save the image if we get a filename
+		if( $name != '' ) {
+			$args = "{$this->imageMagickBefore} ";
+			$args .= escapeshellarg("$this->fileName");
+			$args .= " $this->imageMagickExec $this->imageMagickComp -quality '$quality' ";
+			$args .= escapeshellarg("$name");
+			//$args = "{$this->imageMagickBefore} '$this->fileName' $this->imageMagickExec $this->imageMagickComp -quality $quality '$name'";
+			$this->execute('convert', $args);
+			//$this->error = true;			
+	  } else {
+	  	//return a raw image stream
+			$args = "{$this->imageMagickBefore} '$this->fileName' $this->imageMagickExec $this->imageMagickComp -quality $quality JPG:-"; 
+			$this->execute('convert', $args, true);
+			$this->error = true;
+		}
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/locale.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/locale.php
new file mode 100644
index 0000000000000000000000000000000000000000..3b96aa6a6f3b9c3b520aa7b32cd8a55d768d2aa6
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/locale.php
@@ -0,0 +1,151 @@
+<?php
+if ( !class_exists('ngg_locale') ) :
+/**
+ * Install locale files from WordPress.org plugin repository
+ * 
+ * @version 1.0.0
+ * @author Alex Rabe
+ * 
+ * @package NextGEN Gallery
+ * @since 1.5.0
+ */
+
+class ngg_locale {
+
+	/**
+     * Current locale
+     *
+     * @var string
+     */
+    var $locale = '';
+
+	/**
+     * Plugin domain name
+     *
+     * @var string
+     */
+    var $domain = 'nggallery';
+
+	/**
+     * URL to the translation files
+     *
+     * @var string
+     */
+    var $remote_locale_url = 'http://nextgen-gallery.googlecode.com/files/';
+
+	/**
+     * Plugin path to the langauage files 
+     *
+     * @var string
+     */
+    var $plugin_locale_path = 'lang';
+
+	/**
+     * Server path to the locale file on the server
+     *
+     * @var string
+     */
+    var $mo_file = '';
+
+	/**
+     * URL to the locale file from the remote server
+     *
+     * @var string
+     */
+    var $mo_url = '';
+    
+	/**
+     * Repsonse code for request
+     *
+     * @var array
+     */
+    var $repsonse = '';
+
+    /**
+     * PHP4 compatibility layer for calling the PHP5 constructor.
+     * 
+     */
+    function install_locale() {
+        return $this->__construct();
+    }
+
+    /**
+     * Init the Database Abstraction layer for NextGEN Gallery
+     * 
+     */ 
+    function __construct() {
+    	$this->plugin_locale_path = NGGALLERY_ABSPATH . 'lang/';
+    	$this->locale = get_locale();
+
+    	$this->mo_file = trailingslashit($this->plugin_locale_path) . $this->domain . '-' . $this->locale . '.mo';
+		$this->mo_url  = trailingslashit($this->remote_locale_url) . $this->domain . '-' . $this->locale . '.mo';
+    }
+    
+	/**
+	 * This functions checks if a translation is at wp.org available
+	 * Please note, if a language file is already loaded it exits as well
+	 *
+	 * @return string result of check ( default | installed | not_exist | available )
+	 */
+    function check() {
+    	
+    	// we do not need to check for translation if you use english
+    	if ( ($this->locale == 'en_US') )
+    		return 'default';
+		
+		$this->response = wp_remote_get($this->mo_url, array('timeout' => 300));
+    		
+    	// if a language file exist, do not load it again
+		if ( is_readable( $this->mo_file ) ) 
+			return 'installed';
+
+		// if no translation file exists exit the check
+		if ( is_wp_error($this->response) || $this->response['response']['code'] != '200' )
+			return 'not_exist';
+		
+		return 'available';		
+    }
+
+	/**
+	 * Downloads a locale to the plugin folder using the WordPress HTTP Class.
+	 *
+	 * @author taken from WP core 
+	 * @return mixed WP_Error on failure, true on success.
+	 */
+	function download_locale() {
+		
+		$url = $this->mo_url;
+
+		if ( ! $url )
+			return new WP_Error('http_no_url', __('Invalid URL Provided.'));
+	
+		$filename = $this->mo_file;
+		if ( ! $filename )
+			return new WP_Error('http_no_file', __('Could not create Temporary file.'));
+	
+		$handle = @fopen($filename, 'wb');
+		if ( ! $handle )
+			return new WP_Error('http_no_file', __('Could not create Temporary file.'));
+	
+		$response = wp_remote_get($url, array('timeout' => 300));
+
+		if ( is_wp_error($response) ) {
+			fclose($handle);
+			unlink($filename);
+			return $response;
+		}
+	
+		if ( $response['response']['code'] != '200' ){
+			fclose($handle);
+			unlink($filename);
+			return new WP_Error('http_404', trim($response['response']['message']));
+		}
+	
+		fwrite($handle, $response['body']);
+		fclose($handle);
+	
+		return true;
+	}
+
+}
+endif;
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/media-rss.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/media-rss.php
new file mode 100644
index 0000000000000000000000000000000000000000..f35cb09bbb74c4db804f00364fc70d5f386b01f7
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/media-rss.php
@@ -0,0 +1,244 @@
+<?php
+/**
+* Class to produce Media RSS nodes
+* 
+* @author 		Vincent Prat
+* @copyright 	Copyright 2008-2011
+*/
+class nggMediaRss {
+	
+	/**
+	 * Function called by the wp_head action to output the RSS link for medias
+	 */
+	function add_mrss_alternate_link() {
+		echo "<link id='MediaRSS' rel='alternate' type='application/rss+xml' title='NextGEN Gallery RSS Feed' href='" . nggMediaRss::get_mrss_url() . "' />\n";		
+	}
+	
+	/**
+	 * Add the javascript required to enable PicLens/CoolIris support 
+	 */
+	function add_piclens_javascript() {
+        if (is_ssl())
+            wp_enqueue_script( 'piclens', 'https://lite.piclens.com/current/piclens_optimized.js', array(), false, true);
+		else
+            wp_enqueue_script( 'piclens', 'http://lite.piclens.com/current/piclens_optimized.js', array(), false, true);
+	}
+	
+	/**
+	 * Get the URL of the general media RSS
+	 */
+	function get_mrss_url() {	
+		return NGGALLERY_URLPATH . 'xml/media-rss.php';
+	}
+	
+	/**
+	 * Get the URL of a gallery media RSS
+	 */
+	function get_gallery_mrss_url($gid, $prev_next = false) {		
+		return nggMediaRss::get_mrss_url() . '?' . ('gid=' . $gid . ($prev_next ? '&prev_next=true' : '') . '&mode=gallery');
+	}
+	
+	/**
+	 * Get the URL of an album media RSS
+	 */
+	function get_album_mrss_url($aid) {		
+		return nggMediaRss::get_mrss_url() . '?' . ('aid=' . $aid . '&mode=album');
+	}
+	
+	/**
+	 * Get the URL of the media RSS for last pictures
+	 */
+	function get_last_pictures_mrss_url($page = 0, $show = 30) {		
+		return nggMediaRss::get_mrss_url() . '?' . ('show=' . $show . '&page=' . $page . '&mode=last_pictures');
+	}
+	
+	/**
+	 * Get the XML <rss> node corresponding to the last pictures registered
+	 *
+	 * @param page The current page (defaults to 0)
+	 * @param show The number of pictures to include in one field (default 30) 
+	 */
+	function get_last_pictures_mrss($page = 0, $show = 30) {
+		$images = nggdb::find_last_images($page, $show);
+		
+		$title = stripslashes(get_option('blogname'));
+		$description = stripslashes(get_option('blogdescription'));
+		$link = site_url();
+		$prev_link = ($page > 0) ? nggMediaRss::get_last_pictures_mrss_url($page-1, $show) : '';
+		$next_link = count($images)!=0 ? nggMediaRss::get_last_pictures_mrss_url($page+1, $show) : '';
+		
+		return nggMediaRss::get_mrss_root_node($title, $description, $link, $prev_link, $next_link, $images);
+	}
+	
+	/**
+	 * Get the XML <rss> node corresponding to a gallery
+	 *
+	 * @param $gallery (object) The gallery to include in RSS
+	 * @param $prev_gallery (object) The previous gallery to link in RSS (null if none)
+	 * @param $next_gallery (object) The next gallery to link in RSS (null if none)
+	 */
+	function get_gallery_mrss($gallery, $prev_gallery = null, $next_gallery = null) {
+		
+		$ngg_options = nggGallery::get_option('ngg_options');
+		//Set sort order value, if not used (upgrade issue)
+		$ngg_options['galSort'] = ($ngg_options['galSort']) ? $ngg_options['galSort'] : 'pid';
+		$ngg_options['galSortDir'] = ($ngg_options['galSortDir'] == 'DESC') ? 'DESC' : 'ASC';
+	
+		$title = stripslashes(nggGallery::i18n($gallery->title));
+		$description = stripslashes(nggGallery::i18n($gallery->galdesc));
+		$link = nggMediaRss::get_permalink($gallery->pageid);
+		$prev_link = ( $prev_gallery != null) ? nggMediaRss::get_gallery_mrss_url($prev_gallery->gid, true) : '';
+		$next_link = ( $next_gallery != null) ? nggMediaRss::get_gallery_mrss_url($next_gallery->gid, true) : '';
+		$images = nggdb::get_gallery($gallery->gid, $ngg_options['galSort'], $ngg_options['galSortDir']);
+
+		return nggMediaRss::get_mrss_root_node($title, $description, $link, $prev_link, $next_link, $images);
+	}
+	
+	/**
+	 * Get the XML <rss> node corresponding to an album
+	 *
+	 * @param $album The album to include in RSS
+	 */
+	function get_album_mrss($album) {
+
+		$title = stripslashes(nggGallery::i18n($album->name));
+		$description = '';
+		$link = nggMediaRss::get_permalink(0);
+		$prev_link = '';
+		$next_link = '';
+		$images = nggdb::find_images_in_album($album->id);
+		
+		return nggMediaRss::get_mrss_root_node($title, $description, $link, $prev_link, $next_link, $images);
+	}
+	
+	/**
+	 * Get the XML <rss> node
+	 */
+	function get_mrss_root_node($title, $description, $link, $prev_link, $next_link, $images) {	
+		
+		if ($prev_link != '' || $next_link != '')
+			$out = "<rss version='2.0' xmlns:media='http://search.yahoo.com/mrss/' xmlns:atom='http://www.w3.org/2005/Atom'>\n" ;
+		else
+			$out = "<rss version='2.0' xmlns:media='http://search.yahoo.com/mrss/'>\n";
+		
+		$out .= "\t<channel>\n";
+		
+		$out .= nggMediaRss::get_generator_mrss_node();
+		$out .= nggMediaRss::get_title_mrss_node($title);
+		$out .= nggMediaRss::get_description_mrss_node($description);
+		$out .= nggMediaRss::get_link_mrss_node($link);
+		
+        if ($prev_link != '' || $next_link != '')
+        	$out .= nggMediaRss::get_self_node(nggMediaRss::get_mrss_url());	
+		if ($prev_link!='') {
+			$out .= nggMediaRss::get_previous_link_mrss_node($prev_link);
+		}
+		if ($next_link!='') { 
+			$out .= nggMediaRss::get_next_link_mrss_node($next_link);
+		} 
+		
+		foreach ($images as $image) {
+			$out .= nggMediaRss::get_image_mrss_node($image);
+		}
+		
+		$out .= "\t</channel>\n";
+		$out .= "</rss>\n";
+		
+		return $out;
+	}	
+	
+	/**
+	 * Get the XML <generator> node
+	 */
+	function get_generator_mrss_node($indent = "\t\t") {	
+		return $indent . "<generator><![CDATA[NextGEN Gallery [http://nextgen-gallery.com]]]></generator>\n";
+	}	
+	
+	/**
+	 * Get the XML <title> node
+	 */
+	function get_title_mrss_node($title, $indent = "\t\t") {	
+		return $indent . "<title>" . $title . "</title>\n";
+	}	
+	
+	/**
+	 * Get the XML <description> node
+	 */
+	function get_description_mrss_node($description, $indent = "\t\t") {	
+		return $indent . "<description>" . $description . "</description>\n";
+	}	
+	
+	/**
+	 * Get the XML <link> node
+	 */
+	function get_link_mrss_node($link, $indent = "\t\t") {	
+		return $indent . "<link><![CDATA[" . htmlspecialchars($link) . "]]></link>\n";
+	}	
+
+	/**
+	 * Get the XML <atom:link self> node
+	 */
+	function get_self_node($link, $indent = "\t\t") {
+		return $indent . "<atom:link rel='self' href='" . htmlspecialchars($link) . "' type='application/rss+xml' />\n";
+	}
+	
+	/**
+	 * Get the XML <atom:link previous> node
+	 */
+	function get_previous_link_mrss_node($link, $indent = "\t\t") {	
+		return $indent . "<atom:link rel='previous' href='" . htmlspecialchars($link) . "' />\n";
+	}	
+	
+	/**
+	 * Get the XML <atom:link next> node
+	 */
+	function get_next_link_mrss_node($link, $indent = "\t\t") {	
+		return $indent . "<atom:link rel='next' href='" . htmlspecialchars($link) . "' />\n";
+	}	
+	
+	/**
+	 * Get the XML <item> node corresponding to one single image
+	 *
+	 * @param $image The image object
+	 */
+	function get_image_mrss_node($image, $indent = "\t\t" ) {		
+		$ngg_options = nggGallery::get_option('ngg_options');
+		
+		$tags = $image->get_tags();
+		$tag_names = '';
+		foreach ($tags as $tag) {
+			$tag_names .= ($tag_names=='' ? $tag->name : ', ' . $tag->name);
+		}
+		
+		$title = html_entity_decode(stripslashes($image->alttext));
+		$desc = html_entity_decode(stripslashes($image->description));
+		
+		$thumbwidth = $ngg_options['thumbwidth'];
+		$thumbheight = ($ngg_options['thumbfix'] ? $ngg_options['thumbheight'] : $thumbwidth); 	
+		
+		$out  = $indent . "<item>\n";
+		$out .= $indent . "\t<title><![CDATA[" . nggGallery::i18n($title, 'pic_' . $image->pid . '_alttext') . "]]></title>\n";
+		$out .= $indent . "\t<description><![CDATA[" . nggGallery::i18n($desc, 'pic_' . $image->pid . '_description') . "]]></description>\n";
+		$out .= $indent . "\t<link><![CDATA[" . $image->get_permalink() . "]]></link>\n";
+        $out .= $indent . "\t<guid>image-id:" . $image->pid . "</guid>\n";
+		$out .= $indent . "\t<media:content url='" . esc_url($image->imageURL) . "' medium='image' />\n";
+		$out .= $indent . "\t<media:title><![CDATA[" . nggGallery::i18n($title, 'pic_' . $image->pid . '_alttext') . "]]></media:title>\n";
+		$out .= $indent . "\t<media:description><![CDATA[" . nggGallery::i18n($desc, 'pic_' . $image->pid . '_description') . "]]></media:description>\n";
+		$out .= $indent . "\t<media:thumbnail url='" . esc_url($image->thumbURL) . "' width='" . $thumbwidth . "' height='" . $thumbheight . "' />\n";
+		$out .= $indent . "\t<media:keywords><![CDATA[" . nggGallery::i18n($tag_names) . "]]></media:keywords>\n";
+		$out .= $indent . "\t<media:copyright><![CDATA[Copyright (c) " . get_option("blogname") . " (" . site_url() . ")]]></media:copyright>\n";
+		$out .= $indent . "</item>\n";
+
+		return $out;
+	}
+	
+	function get_permalink($page_id) {		 
+		if ($page_id == 0)	
+			$permalink = site_url();		 
+		else 
+			$permalink = get_permalink($page_id);
+				 
+		return $permalink;		 
+	}	
+		
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/meta.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/meta.php
new file mode 100644
index 0000000000000000000000000000000000000000..1e15980f101ebe303152a362d4a98037a33ca2cb
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/meta.php
@@ -0,0 +1,588 @@
+<?php
+
+/**
+ * Image METADATA PHP class for the WordPress plugin NextGEN Gallery
+ * nggmeta.lib.php
+ *
+ * @author Alex Rabe
+ *
+ *
+ */
+
+class nggMeta{
+
+	/**** Image Data ****/
+    var $image			=	'';		// The image object
+    var $size			=	false;	// The image size
+	var $exif_data 		= 	false;	// EXIF data array
+	var $iptc_data 		= 	false;	// IPTC data array
+	var $xmp_data  		= 	false;	// XMP data array
+	/**** Filtered Data ****/
+	var $exif_array 	= 	false;	// EXIF data array
+	var $iptc_array 	= 	false;	// IPTC data array
+	var $xmp_array  	= 	false;	// XMP data array
+
+    var $sanitize       =   false;  // sanitize meta data on request
+
+    /**
+     * Parses the nggMeta data only if needed
+     * @param int $image path to a image
+     * @param bool $onlyEXIF parse only exif if needed
+     * @return
+     */
+    function nggMeta($pic_id, $onlyEXIF = false) {
+
+        //get the path and other data about the image
+        $this->image = nggdb::find_image( $pic_id );
+
+        $this->image = apply_filters( 'ngg_find_image_meta', $this->image  );
+
+        if ( !file_exists( $this->image->imagePath ) )
+            return false;
+
+        $this->size = @getimagesize ( $this->image->imagePath , $metadata );
+
+        if ($this->size && is_array($metadata)) {
+
+            // get exif - data
+            if ( is_callable('exif_read_data'))
+                $this->exif_data = @exif_read_data($this->image->imagePath , 0, true );
+
+            // stop here if we didn't need other meta data
+            if ($onlyEXIF)
+                return true;
+
+            // get the iptc data - should be in APP13
+            if ( is_callable('iptcparse') && isset($metadata['APP13']) )
+                $this->iptc_data = @iptcparse($metadata['APP13']);
+
+            // get the xmp data in a XML format
+            if ( is_callable('xml_parser_create'))
+                $this->xmp_data = $this->extract_XMP($this->image->imagePath );
+
+            return true;
+        }
+
+        return false;
+    }
+
+    /**
+     * return the saved meta data from the database
+     *
+     * @since 1.4.0
+     * @param string $object (optional)
+     * @return array|mixed return either the complete array or the single object
+     */
+    function get_saved_meta($object = false) {
+
+        $meta = $this->image->meta_data;
+
+        if (!isset($meta['saved'])) $meta['saved'] = FALSE;
+
+		//check if we already import the meta data to the database
+		if (!is_array($meta) || ($meta['saved'] != true))
+			return false;
+
+        // return one element if requested
+        if ($object)
+            return $meta[$object];
+
+        //removed saved parameter we don't need that to show
+        unset($meta['saved']);
+
+        // and remove empty tags or arrays
+        foreach ($meta as $key => $value) {
+            if ( empty($value) OR is_array($value))
+                unset($meta[$key]);
+        }
+
+        // on request sanitize the output
+        if ( $this->sanitize == true )
+            array_walk( $meta , create_function('&$value', '$value = esc_html($value);'));
+
+        return $meta;
+    }
+
+    /**
+     * nggMeta::get_EXIF()
+     * See also http://trac.wordpress.org/changeset/6313
+     *
+     * @return structured EXIF data
+     */
+    function get_EXIF($object = false) {
+
+        if ( !$this->exif_data )
+            return false;
+
+        if (!is_array($this->exif_array)){
+
+            $meta= array();
+
+            if ( isset($this->exif_data['EXIF']) ) {
+                $exif = $this->exif_data['EXIF'];
+
+                if (!empty($exif['FNumber']))
+                    $meta['aperture'] = 'F ' . round( $this->exif_frac2dec( $exif['FNumber'] ), 2 );
+                if (!empty($exif['Model']))
+                    $meta['camera'] = trim( $exif['Model'] );
+                if (!empty($exif['DateTimeDigitized']))
+                    $meta['created_timestamp'] = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $this->exif_date2ts($exif['DateTimeDigitized']));
+                else if (!empty($exif['DateTimeOriginal']))
+                    $meta['created_timestamp'] = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $this->exif_date2ts($exif['DateTimeOriginal']));
+				else if (!empty($exif['FileDateTime']))
+					$meta['created_timestamp'] = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $this->exif_date2ts($exif['FileDateTime']));
+                if (!empty($exif['FocalLength']))
+                    $meta['focal_length'] = $this->exif_frac2dec( $exif['FocalLength'] ) . __(' mm','nggallery');
+                if (!empty($exif['ISOSpeedRatings']))
+                    $meta['iso'] = $exif['ISOSpeedRatings'];
+                if (!empty($exif['ExposureTime'])) {
+                    $meta['shutter_speed']  = $this->exif_frac2dec ($exif['ExposureTime']);
+                    $meta['shutter_speed']  =($meta['shutter_speed'] > 0.0 and $meta['shutter_speed'] < 1.0) ? ( '1/' . round( 1 / $meta['shutter_speed'], -1) ) : ($meta['shutter_speed']);
+                    $meta['shutter_speed'] .=  __(' sec','nggallery');
+                }
+                //Bit 0 indicates the flash firing status
+                if (!empty($exif['Flash']))
+                    $meta['flash'] =  ( $exif['Flash'] & 1 ) ? __('Fired', 'nggallery') : __('Not fired',' nggallery');
+            }
+
+            // additional information
+            if ( isset($this->exif_data['IFD0']) ) {
+                $exif = $this->exif_data['IFD0'];
+
+                if (!empty($exif['Model']))
+                    $meta['camera'] = $exif['Model'];
+                if (!empty($exif['Make']))
+                    $meta['make'] = $exif['Make'];
+                if (!empty($exif['ImageDescription']))
+                    $meta['title'] = utf8_encode($exif['ImageDescription']);
+                if (!empty($exif['Orientation']))
+                    $meta['Orientation'] = $exif['Orientation'];
+            }
+
+            // this is done by Windows
+            if ( isset($this->exif_data['WINXP']) ) {
+                $exif = $this->exif_data['WINXP'];
+
+                if (!empty($exif['Title']) && empty($meta['title']))
+                    $meta['title'] = utf8_encode($exif['Title']);
+                if (!empty($exif['Author']))
+                    $meta['author'] = utf8_encode($exif['Author']);
+                if (!empty($exif['Keywords']))
+                    $meta['tags'] = utf8_encode($exif['Keywords']);
+                if (!empty($exif['Subject']))
+                    $meta['subject'] = utf8_encode($exif['Subject']);
+                if (!empty($exif['Comments']))
+                    $meta['caption'] = utf8_encode($exif['Comments']);
+            }
+
+            $this->exif_array = $meta;
+        }
+
+        // return one element if requested
+        if ( $object == true ) {
+            $value = isset($this->exif_array[$object]) ? $this->exif_array[$object] : false;
+            return $value;
+        }
+
+        // on request sanitize the output
+        if ( $this->sanitize == true )
+            array_walk( $this->exif_array , create_function('&$value', '$value = esc_html($value);'));
+
+        return $this->exif_array;
+
+    }
+
+    // convert a fraction string to a decimal
+    function exif_frac2dec($str) {
+        @list( $n, $d ) = explode( '/', $str );
+        if ( !empty($d) )
+            return $n / $d;
+        return $str;
+    }
+
+    // convert the exif date format to a unix timestamp
+    function exif_date2ts($str) {
+        // seriously, who formats a date like 'YYYY:MM:DD hh:mm:ss'?
+        @list( $date, $time ) = explode( ' ', trim($str) );
+        @list( $y, $m, $d ) = explode( ':', $date );
+
+        return strtotime( "{$y}-{$m}-{$d} {$time}" );
+    }
+
+    /**
+     * nggMeta::readIPTC() - IPTC Data Information for EXIF Display
+     *
+     * @param mixed $output_tag
+     * @return IPTC-tags
+     */
+    function get_IPTC($object = false) {
+
+        if (!$this->iptc_data)
+            return false;
+
+        if (!is_array($this->iptc_array)){
+
+            // --------- Set up Array Functions --------- //
+            $iptcTags = array (
+                "2#005" => 'title',
+                "2#007" => 'status',
+                "2#012" => 'subject',
+                "2#015" => 'category',
+                "2#025" => 'keywords',
+                "2#055" => 'created_date',
+                "2#060" => 'created_time',
+                "2#080" => 'author',
+                "2#085" => 'position',
+                "2#090" => 'city',
+                "2#092" => 'location',
+                "2#095" => 'state',
+                "2#100" => 'country_code',
+                "2#101" => 'country',
+                "2#105" => 'headline',
+                "2#110" => 'credit',
+                "2#115" => 'source',
+                "2#116" => 'copyright',
+                "2#118" => 'contact',
+                "2#120" => 'caption'
+            );
+
+            $meta = array();
+            foreach ($iptcTags as $key => $value) {
+                if (isset ( $this->iptc_data[$key] ) )
+                    $meta[$value] = trim(utf8_encode(implode(", ", $this->iptc_data[$key])));
+
+            }
+            $this->iptc_array = $meta;
+        }
+
+        // return one element if requested
+        if ($object)
+            return (isset($this->iptc_array[$object])) ? $this->iptc_array[$object] : NULL;
+
+        // on request sanitize the output
+        if ( $this->sanitize == true )
+            array_walk( $this->iptc_array , create_function('&$value', '$value = esc_html($value);'));
+
+        return $this->iptc_array;
+    }
+
+    /**
+     * nggMeta::extract_XMP()
+     * get XMP DATA
+     * code by Pekka Saarinen http://photography-on-the.net
+     *
+     * @param mixed $filename
+     * @return XML data
+     */
+    function extract_XMP( $filename ) {
+
+        //TODO:Require a lot of memory, could be better
+        ob_start();
+        @readfile($filename);
+        $source = ob_get_contents();
+        ob_end_clean();
+
+        $start = strpos( $source, "<x:xmpmeta"   );
+        $end   = strpos( $source, "</x:xmpmeta>" );
+        if ((!$start === false) && (!$end === false)) {
+            $lenght = $end - $start;
+            $xmp_data = substr($source, $start, $lenght+12 );
+            unset($source);
+            return $xmp_data;
+        }
+
+        unset($source);
+        return false;
+    }
+
+    /**
+     * nggMeta::get_XMP()
+     *
+     * @package Taken from http://php.net/manual/en/function.xml-parse-into-struct.php
+     * @author Alf Marius Foss Olsen & Alex Rabe
+     * @return XML Array or object
+     *
+     */
+    function get_XMP($object = false) {
+
+        if(!$this->xmp_data)
+            return false;
+
+        if (!is_array($this->xmp_array)){
+
+            $parser = xml_parser_create();
+            xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); // Dont mess with my cAsE sEtTings
+            xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); // Dont bother with empty info
+            xml_parse_into_struct($parser, $this->xmp_data, $values);
+            xml_parser_free($parser);
+
+            $xmlarray			= array();	// The XML array
+            $this->xmp_array  	= array();	// The returned array
+            $stack        		= array();	// tmp array used for stacking
+            $list_array   		= array();	// tmp array for list elements
+            $list_element 		= false;	// rdf:li indicator
+
+            foreach($values as $val) {
+
+                if($val['type'] == "open") {
+                    array_push($stack, $val['tag']);
+
+                } elseif($val['type'] == "close") {
+                    // reset the compared stack
+                    if ($list_element == false)
+                        array_pop($stack);
+                    // reset the rdf:li indicator & array
+                    $list_element = false;
+                    $list_array   = array();
+
+                } elseif($val['type'] == "complete") {
+                    if ($val['tag'] == "rdf:li") {
+                        // first go one element back
+                        if ($list_element == false)
+                            array_pop($stack);
+                        $list_element = true;
+                        // do not parse empty tags
+                        if ( empty($val['value']) ) continue;
+                        // save it in our temp array
+                        $list_array[] = $val['value'];
+                        // in the case it's a list element we seralize it
+                        $value = implode(",", $list_array);
+                        $this->setArrayValue($xmlarray, $stack, $value);
+                    } else {
+                        array_push($stack, $val['tag']);
+                        // do not parse empty tags
+                        if ( !empty($val['value']) )
+                            $this->setArrayValue($xmlarray, $stack, $val['value']);
+                        array_pop($stack);
+                    }
+                }
+
+            } // foreach
+
+            // don't parse a empty array
+            if( empty($xmlarray) || empty($xmlarray['x:xmpmeta']) )
+                return false;
+
+            // cut off the useless tags
+            $xmlarray = $xmlarray['x:xmpmeta']['rdf:RDF']['rdf:Description'];
+
+            // --------- Some values from the XMP format--------- //
+            $xmpTags = array (
+                'xap:CreateDate' 			=> 'created_timestamp',
+                'xap:ModifyDate'  			=> 'last_modfied',
+                'xap:CreatorTool' 			=> 'tool',
+                'dc:format' 				=> 'format',
+                'dc:title'					=> 'title',
+                'dc:creator' 				=> 'author',
+                'dc:subject' 				=> 'keywords',
+                'dc:description' 			=> 'caption',
+                'photoshop:AuthorsPosition' => 'position',
+                'photoshop:City'			=> 'city',
+                'photoshop:Country' 		=> 'country'
+            );
+
+            foreach ($xmpTags as $key => $value) {
+                // if the kex exist
+                if ( isset($xmlarray[$key]) ) {
+                    switch ($key) {
+                        case 'xap:CreateDate':
+                        case 'xap:ModifyDate':
+                            $this->xmp_array[$value] = date_i18n(get_option('date_format').' '.get_option('time_format'), strtotime($xmlarray[$key]));
+                            break;
+                        default :
+                            $this->xmp_array[$value] = $xmlarray[$key];
+                    }
+                }
+            }
+
+        }
+
+        // return one element if requested
+        if ($object != false )
+            return isset($this->xmp_array[$object]) ? $this->xmp_array[$object] : false;
+
+        // on request sanitize the output
+        if ( $this->sanitize == true )
+            array_walk( $this->xmp_array , create_function('&$value', '$value = esc_html($value);'));
+
+        return $this->xmp_array;
+    }
+
+    function setArrayValue(&$array, $stack, $value) {
+        if ($stack) {
+            $key = array_shift($stack);
+            $this->setArrayValue($array[$key], $stack, $value);
+            return $array;
+        } else {
+            $array = $value;
+        }
+    }
+
+    /**
+     * nggMeta::get_META() - return a meta value form the available list
+     *
+     * @param string $object
+     * @return mixed $value
+     */
+    function get_META($object = false) {
+
+        // defined order first look into database, then XMP, IPTC and EXIF.
+        if ($value = $this->get_saved_meta($object))
+            return $value;
+        if ($value = $this->get_XMP($object))
+            return $value;
+        if ($value = $this->get_IPTC($object))
+            return $value;
+        if ($value = $this->get_EXIF($object))
+            return $value;
+
+        // nothing found ?
+        return false;
+    }
+
+    /**
+     * nggMeta::i8n_name() -  localize the tag name
+     *
+     * @param mixed $key
+     * @return translated $key
+     */
+    function i8n_name($key) {
+
+        $tagnames = array(
+            'aperture' 			=> __('Aperture','nggallery'),
+            'credit' 			=> __('Credit','nggallery'),
+            'camera' 			=> __('Camera','nggallery'),
+            'caption' 			=> __('Caption','nggallery'),
+            'created_timestamp' => __('Date/Time','nggallery'),
+            'copyright' 		=> __('Copyright','nggallery'),
+            'focal_length' 		=> __('Focal length','nggallery'),
+            'iso' 				=> __('ISO','nggallery'),
+            'shutter_speed' 	=> __('Shutter speed','nggallery'),
+            'title' 			=> __('Title','nggallery'),
+            'author' 			=> __('Author','nggallery'),
+            'tags' 				=> __('Tags','nggallery'),
+            'subject' 			=> __('Subject','nggallery'),
+            'make' 				=> __('Make','nggallery'),
+            'status' 			=> __('Edit Status','nggallery'),
+            'category'			=> __('Category','nggallery'),
+            'keywords' 			=> __('Keywords','nggallery'),
+            'created_date' 		=> __('Date Created','nggallery'),
+            'created_time'		=> __('Time Created','nggallery'),
+            'position'			=> __('Author Position','nggallery'),
+            'city'				=> __('City','nggallery'),
+            'location'			=> __('Location','nggallery'),
+            'state' 			=> __('Province/State','nggallery'),
+            'country_code'		=> __('Country code','nggallery'),
+            'country'			=> __('Country','nggallery'),
+            'headline' 			=> __('Headline','nggallery'),
+            'credit'			=> __('Credit','nggallery'),
+            'source'			=> __('Source','nggallery'),
+            'copyright'			=> __('Copyright Notice','nggallery'),
+            'contact'			=> __('Contact','nggallery'),
+            'last_modfied'		=> __('Last modified','nggallery'),
+            'tool'				=> __('Program tool','nggallery'),
+            'format'			=> __('Format','nggallery'),
+            'width'				=> __('Image Width','nggallery'),
+            'height'			=> __('Image Height','nggallery'),
+            'flash'				=> __('Flash','nggallery')
+        );
+
+        if ( isset($tagnames[$key]) )
+            $key = $tagnames[$key];
+
+        return($key);
+
+    }
+
+    /**
+     * Return the Timestamp from the image , if possible it's read from exif data
+     * @return int
+     */
+    function get_date_time() {
+
+		$date = time();
+
+		// Try XMP first
+		if (isset($this->xmp_array['created_timestamp'])) {
+			$date = @strtotime($this->xmp_array['created_timestamp']);
+		}
+
+		// Then EXIF
+		else if (isset($this->exif_array['created_timestamp'])) {
+			$date = @strtotime($this->exif_array['created_timestamp']);
+		}
+
+		// Then IPTC
+		else if (isset($this->iptc_array['created_date'])) {
+			$date = $this->iptc_array['created_date'];
+			if (isset($this->iptc_array['created_time'])) {
+				$date .= " {$this->iptc_array['created_time']}";
+			}
+			$date = @strtotime($date);
+		}
+
+		// If all else fails, use the file creation time
+		else if ($this->image->imagePath) {
+			$date = @filectime($this->image->imagePath);
+		}
+
+		// Failback
+		if (!$date) $date = time();
+
+        // Return the MySQL format
+        $date_time = date( 'Y-m-d H:i:s', $date);
+
+        return $date_time;
+    }
+
+    /**
+     * This function return the most common metadata, via a filter we can add more
+     * Reason : GD manipulation removes that options
+     *
+     * @since V1.4.0
+     * @return void
+     */
+    function get_common_meta() {
+        global $wpdb;
+
+        $meta = array(
+            'aperture' => 0,
+            'credit' => '',
+            'camera' => '',
+            'caption' => '',
+            'created_timestamp' => 0,
+            'copyright' => '',
+            'focal_length' => 0,
+            'iso' => 0,
+            'shutter_speed' => 0,
+            'flash' => 0,
+            'title' => '',
+            'keywords' => ''
+        );
+
+        $meta = apply_filters( 'ngg_read_image_metadata', $meta  );
+
+        // meta should be still an array
+        if ( !is_array($meta) )
+            return false;
+
+        foreach ($meta as $key => $value) {
+            $meta[$key] = $this->get_META($key);
+        }
+
+        //let's add now the size of the image
+        $meta['width']  = $this->size[0];
+        $meta['height'] = $this->size[1];
+
+        return $meta;
+    }
+
+    /**
+     * If needed sanitize each value before output
+     *
+     * @return void
+     */
+    function sanitize () {
+        $this->sanitize = true;
+    }
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/multisite.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/multisite.php
new file mode 100644
index 0000000000000000000000000000000000000000..e8f36a9893db4eaf6a4b4763470e9d49a31fcba5
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/multisite.php
@@ -0,0 +1,57 @@
+<?php
+/**
+* Main PHP Class for Multisite setup
+* 
+* @author Alex Rabe 
+* 
+* 
+*/
+class nggWPMU{
+
+	/**
+	 * Check the Quota under WPMU. Only needed for this case
+	 * 
+	 * @class nggWPMU
+	 * @return bool $result
+	 */
+	function check_quota() {
+        	if ( get_site_option( 'upload_space_check_disabled' ) )
+        		return false;
+
+			if ( (is_multisite()) && nggWPMU::wpmu_enable_function('wpmuQuotaCheck'))
+				if( $error = upload_is_user_over_quota( false ) ) {
+					nggGallery::show_error( __( 'Sorry, you have used your space allocation. Please delete some files to upload more files.','nggallery' ) );
+					return true;
+				}
+			return false;
+	}
+    
+    /**
+     * Check for site admin
+     * 
+     * @return
+     */
+    function wpmu_site_admin() {
+
+    	if ( function_exists('is_super_admin') )
+    		if ( is_super_admin() )
+    			return true;
+    			
+    	return false;
+    }
+
+    /**
+     * Check for site wide options
+     * 
+     * @param string $value
+     * @return value
+     */
+    function wpmu_enable_function($value) {
+    	if (is_multisite()) {
+    		$ngg_options = get_site_option('ngg_options');
+    		return $ngg_options[$value];
+    	}
+    	// if this is not WPMU, enable it !
+    	return true;
+    }    
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/navigation.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/navigation.php
new file mode 100644
index 0000000000000000000000000000000000000000..39e933aca28db402a7b611fb961635dabe046d94
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/navigation.php
@@ -0,0 +1,123 @@
+<?php
+/**
+ * nggNavigation - PHP class for the pagination
+ *
+ * @package NextGEN Gallery
+ * @author Alex Rabe
+ *
+ * @version 1.0.1
+ * @access public
+ */
+class nggNavigation {
+
+	/**
+	 * Return the navigation output
+	 *
+	 * @access public
+	 * @var string
+	 */
+	var $output = false;
+
+	/**
+	 * Link to previous page
+	 *
+	 * @access public
+	 * @var string
+	 */
+	var $prev = false;
+
+	/**
+	 * Link to next page
+	 *
+	 * @access public
+	 * @var string
+	 */
+	var $next = false;
+
+	/**
+	 * PHP4 compatibility layer for calling the PHP5 constructor.
+	 *
+	 */
+	function nggNavigation() {
+		return $this->__construct();
+	}
+
+	/**
+	 * Main constructor - Does nothing.
+	 * Call create_navigation() method when you need a navigation.
+	 *
+	 */
+	function __construct() {
+		return;
+	}
+
+	/**
+	 * nggNavigation::create_navigation()
+	 *
+	 * @param mixed $page
+	 * @param integer $totalElement
+	 * @param integer $maxElement
+	 * @return string pagination content
+	 */
+	function create_navigation($page, $totalElement, $maxElement = 0) {
+		global $nggRewrite;
+
+        $prev_symbol = apply_filters('ngg_prev_symbol', '&#9668;');
+		$next_symbol = apply_filters('ngg_prev_symbol', '&#9658;');
+
+		if ($maxElement > 0) {
+			$total = $totalElement;
+
+			// create navigation
+			if ( $total > $maxElement ) {
+				$total_pages = ceil( $total / $maxElement );
+				$r = '';
+				if ( 1 < $page ) {
+					$args['nggpage'] = ( 1 == $page - 1 ) ? FALSE : $page - 1;
+					$previous = $args['nggpage'];
+					if (FALSE == $args['nggpage']) {
+						$previous = 1;
+					}
+//					$this->prev = real_site_url($_SERVER['REQUEST_URI']);
+					$this->prev = add_query_arg('nggpage', $args['nggpage'], $_SERVER['REQUEST_URI']);
+//					$this->prev = $nggRewrite->get_permalink ( $args );
+					$r .=  '<a class="prev" id="ngg-prev-' . $previous . '" href="' . $this->prev . '">' . $prev_symbol . '</a>';
+				}
+
+				$total_pages = ceil( $total / $maxElement );
+
+				if ( $total_pages > 1 ) {
+					for ( $page_num = 1; $page_num <= $total_pages; $page_num++ ) {
+						if ( $page == $page_num ) {
+							$r .=  '<span class="current">' . $page_num . '</span>';
+						} else {
+							$p = false;
+							if ( $page_num < 3 || ( $page_num >= $page - 3 && $page_num <= $page + 3 ) || $page_num > $total_pages - 3 ) {
+								$args['nggpage'] = ( 1 == $page_num ) ? FALSE : $page_num;
+								$link = add_query_arg('nggpage', $args['nggpage'], $_SERVER['REQUEST_URI']);
+								$r .= '<a class="page-numbers" href="' . $link . '">' . ( $page_num ) . '</a>';
+								$in = true;
+							} elseif ( $in == true ) {
+								$r .= '<span class="more">...</span>';
+								$in = false;
+							}
+						}
+					}
+				}
+
+				if ( ( $page ) * $maxElement < $total || -1 == $total ) {
+					$args['nggpage'] = $page + 1;
+					$this->next = add_query_arg('nggpage', $args['nggpage'], $_SERVER['REQUEST_URI']);
+//					$this->next = $nggRewrite->get_permalink ( $args );
+					$r .=  '<a class="next" id="ngg-next-' . $args['nggpage'] . '" href="' . $this->next . '">' . $next_symbol . '</a>';
+				}
+
+				$this->output = "<div class='ngg-navigation'>$r</div>";
+			} else {
+				$this->output = "<div class='ngg-clear'></div>"."\n";
+			}
+		}
+
+		return $this->output;
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/ngg-db.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/ngg-db.php
new file mode 100644
index 0000000000000000000000000000000000000000..b4491ffd3fd88128e832a0471ed6deb4160bac99
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/ngg-db.php
@@ -0,0 +1,1121 @@
+<?php
+if ( !class_exists('nggdb') ) :
+/**
+ * NextGEN Gallery Database Class
+ *
+ * @author Alex Rabe, Vincent Prat
+ *
+ * @since 1.0.0
+ */
+class nggdb {
+
+    /**
+     * Holds the list of all galleries
+     *
+     * @since 1.1.0
+     * @access public
+     * @var object|array
+     */
+    var $galleries = false;
+
+    /**
+     * Holds the list of all images
+     *
+     * @since 1.3.0
+     * @access public
+     * @var object|array
+     */
+    var $images = false;
+
+    /**
+     * Holds the list of all albums
+     *
+     * @since 1.3.0
+     * @access public
+     * @var object|array
+     */
+    var $albums = false;
+
+    /**
+     * The array for the pagination
+     *
+     * @since 1.1.0
+     * @access public
+     * @var array
+     */
+    var $paged = false;
+
+    /**
+     * PHP4 compatibility layer for calling the PHP5 constructor.
+     *
+     */
+    function nggdb() {
+        return $this->__construct();
+    }
+
+    /**
+     * Init the Database Abstraction layer for NextGEN Gallery
+     *
+     */
+    function __construct() {
+        global $wpdb;
+
+        $this->galleries = array();
+        $this->images    = array();
+        $this->albums    = array();
+        $this->paged     = array();
+
+        register_shutdown_function(array(&$this, '__destruct'));
+
+    }
+
+    /**
+     * PHP5 style destructor and will run when database object is destroyed.
+     *
+     * @return bool Always true
+     */
+    function __destruct() {
+        return true;
+    }
+
+    /**
+     * Get all the album and unserialize the content
+     *
+     * @since 1.3.0
+     * @param string $order_by
+     * @param string $order_dir
+     * @param int $limit number of albums, 0 shows all albums
+     * @param int $start the start index for paged albums
+     * @return array $album
+     */
+    function find_all_album( $order_by = 'id', $order_dir = 'ASC', $limit = 0, $start = 0) {
+        global $wpdb;
+
+        $order_dir = ( $order_dir == 'DESC') ? 'DESC' : 'ASC';
+        $limit_by  = ( $limit > 0 ) ? 'LIMIT ' . intval($start) . ',' . intval($limit) : '';
+        $this->albums = $wpdb->get_results("SELECT * FROM $wpdb->nggalbum ORDER BY {$order_by} {$order_dir} {$limit_by}" , OBJECT_K );
+
+        if ( !$this->albums )
+            return array();
+
+        // XXX nggdb is used statically, cannot inherit from Ngg_Serializable
+        $serializer = new Ngg_Serializable();
+
+        foreach ($this->albums as $key => $value) {
+            $this->albums[$key]->galleries = empty ($this->albums[$key]->sortorder) ? array() : (array) $serializer->unserialize($this->albums[$key]->sortorder)  ;
+            $this->albums[$key]->name = stripslashes( $this->albums[$key]->name );
+            $this->albums[$key]->albumdesc = stripslashes( $this->albums[$key]->albumdesc );
+            wp_cache_add($key, $this->albums[$key], 'ngg_album');
+        }
+
+        return $this->albums;
+    }
+
+    /**
+     * Get all the galleries
+     *
+     * @param string $order_by
+     * @param string $order_dir
+     * @param bool $counter (optional) Select true  when you need to count the images
+     * @param int $limit number of paged galleries, 0 shows all galleries
+     * @param int $start the start index for paged galleries
+     * @param bool $exclude
+     * @return array $galleries
+     */
+    function find_all_galleries($order_by = 'gid', $order_dir = 'ASC', $counter = false, $limit = 0, $start = 0, $exclude = true) {
+        global $wpdb;
+
+        // Check for the exclude setting
+        $exclude_clause = ($exclude) ? ' AND exclude<>1 ' : '';
+        $order_dir = ( $order_dir == 'DESC') ? 'DESC' : 'ASC';
+        $limit_by  = ( $limit > 0 ) ? 'LIMIT ' . intval($start) . ',' . intval($limit) : '';
+        $this->galleries = $wpdb->get_results( "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->nggallery ORDER BY {$order_by} {$order_dir} {$limit_by}", OBJECT_K );
+
+        // Count the number of galleries and calculate the pagination
+        if ($limit > 0) {
+            $this->paged['total_objects'] = intval ( $wpdb->get_var( "SELECT FOUND_ROWS()" ) );
+            $this->paged['objects_per_page'] = max ( count( $this->galleries ), $limit );
+            $this->paged['max_objects_per_page'] = ( $limit > 0 ) ? ceil( $this->paged['total_objects'] / intval($limit)) : 1;
+        }
+
+        if ( !$this->galleries )
+            return array();
+
+        // get the galleries information
+        foreach ($this->galleries as $key => $value) {
+            $galleriesID[] = $key;
+            // init the counter values
+            $this->galleries[$key]->counter = 0;
+            $this->galleries[$key]->title = stripslashes($this->galleries[$key]->title);
+            $this->galleries[$key]->galdesc  = stripslashes($this->galleries[$key]->galdesc);
+			$this->galleries[$key]->abspath = WINABSPATH . $this->galleries[$key]->path;
+            wp_cache_add($key, $this->galleries[$key], 'ngg_gallery');
+        }
+
+        // if we didn't need to count the images then stop here
+        if ( !$counter )
+            return $this->galleries;
+
+        // get the counter values
+        $picturesCounter = $wpdb->get_results('SELECT galleryid, COUNT(*) as counter FROM '.$wpdb->nggpictures.' WHERE galleryid IN (\''.implode('\',\'', $galleriesID).'\') ' . $exclude_clause . ' GROUP BY galleryid', OBJECT_K);
+
+        if ( !$picturesCounter )
+            return $this->galleries;
+
+        // add the counter to the gallery objekt
+        foreach ($picturesCounter as $key => $value) {
+            $this->galleries[$value->galleryid]->counter = $value->counter;
+            wp_cache_set($value->galleryid, $this->galleries[$value->galleryid], 'ngg_gallery');
+        }
+
+        return $this->galleries;
+    }
+
+    /**
+     * Get a gallery given its ID
+     *
+     * @param int|string $id or $slug
+     * @return A nggGallery object (null if not found)
+     */
+    function find_gallery( $id ) {
+        global $wpdb;
+
+        if( is_numeric($id) ) {
+
+            if ( $gallery = wp_cache_get($id, 'ngg_gallery') )
+                return $gallery;
+
+            $gallery = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->nggallery WHERE gid = %d", $id ) );
+
+        } else
+            $gallery = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->nggallery WHERE slug = %s", $id ) );
+
+        // Build the object from the query result
+        if ($gallery) {
+            // it was a bad idea to use a object, stripslashes_deep() could not used here, learn from it
+            $gallery->title = stripslashes($gallery->title);
+            $gallery->galdesc  = stripslashes($gallery->galdesc);
+
+            $gallery->abspath = WINABSPATH . $gallery->path;
+            //TODO:Possible failure , $id could be a number or name
+            wp_cache_add($id, $gallery, 'ngg_gallery');
+
+            return $gallery;
+        } else
+            return false;
+    }
+
+    /**
+     * This function return all information about the gallery and the images inside
+     *
+     * @param int|string $id or $name
+     * @param string $order_by
+     * @param string $order_dir (ASC |DESC)
+     * @param bool $exclude
+     * @param int $limit number of paged galleries, 0 shows all galleries
+     * @param int $start the start index for paged galleries
+     * @param bool $json remove the key for associative array in json request
+     * @return An array containing the nggImage objects representing the images in the gallery.
+     */
+    function get_gallery($id, $order_by = 'sortorder', $order_dir = 'ASC', $exclude = true, $limit = 0, $start = 0, $json = false) {
+
+        global $wpdb;
+
+        // init the gallery as empty array
+        $gallery = array();
+        $i = 0;
+
+        // Check for the exclude setting
+        $exclude_clause = ($exclude) ? ' AND tt.exclude<>1 ' : '';
+
+        // Say no to any other value
+        $order_dir		= ( $order_dir == 'DESC') ? 'DESC' : 'ASC';
+        $order_by		= ( empty($order_by) ) ? 'sortorder' : $order_by;
+		$order_clause	= "ABS(tt.{$order_by}) {$order_dir}, tt.{$order_by} {$order_dir}";
+//		$order_clause	= "LENGTH(tt.{$order_by}) {$order_dir}, tt.{$order_by} {$order_dir}";
+
+        // Should we limit this query ?
+        $limit_by  = ( $limit > 0 ) ? 'LIMIT ' . intval($start) . ',' . intval($limit) : '';
+
+        // Query database
+        if( is_numeric($id) )
+            $result = $wpdb->get_results( $wpdb->prepare( "SELECT SQL_CALC_FOUND_ROWS tt.*, t.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE t.gid = %d {$exclude_clause} ORDER BY {$order_clause} {$limit_by}", $id ), OBJECT_K );
+        else
+            $result = $wpdb->get_results( $wpdb->prepare( "SELECT SQL_CALC_FOUND_ROWS tt.*, t.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE t.slug = %s {$exclude_clause} ORDER BY {$order_clause} {$limit_by}", $id ), OBJECT_K );
+
+        // Count the number of images and calculate the pagination
+        if ($limit > 0) {
+            $this->paged['total_objects'] = intval ( $wpdb->get_var( "SELECT FOUND_ROWS()" ) );
+            $this->paged['objects_per_page'] = max ( count( $result ), $limit );
+            $this->paged['max_objects_per_page'] = ( $limit > 0 ) ? ceil( $this->paged['total_objects'] / intval($limit)) : 1;
+        }
+
+        // Build the object
+        if ($result) {
+
+            // Now added all image data
+            foreach ($result as $key => $value) {
+                // due to a browser bug we need to remove the key for associative array for json request
+                // (see http://code.google.com/p/chromium/issues/detail?id=883)
+                if ($json) $key = $i++;
+                $gallery[$key] = new nggImage( $value ); // keep in mind each request require 8-16 kb memory usage
+
+            }
+        }
+
+        // Could not add to cache, the structure is different to find_gallery() cache_add, need rework
+        //wp_cache_add($id, $gallery, 'ngg_gallery');
+
+        return $gallery;
+    }
+
+    /**
+     * This function return all information about the gallery and the images inside
+     *
+     * @param int|string $id or $name
+     * @param string $orderby
+     * @param string $order (ASC |DESC)
+     * @param bool $exclude
+     * @return An array containing the nggImage objects representing the images in the gallery.
+     */
+    function get_ids_from_gallery($id, $order_by = 'sortorder', $order_dir = 'ASC', $exclude = true) {
+
+        global $wpdb;
+
+        // Check for the exclude setting
+        $exclude_clause = ($exclude) ? ' AND tt.exclude<>1 ' : '';
+
+        // Say no to any other value
+        $order_dir = ( $order_dir == 'DESC') ? 'DESC' : 'ASC';
+        $order_by  = ( empty($order_by) ) ? 'sortorder' : $order_by;
+
+        // Query database
+        if( is_numeric($id) )
+            $result = $wpdb->get_col( $wpdb->prepare( "SELECT tt.pid FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE t.gid = %d $exclude_clause ORDER BY tt.{$order_by} $order_dir", $id ) );
+        else
+            $result = $wpdb->get_col( $wpdb->prepare( "SELECT tt.pid FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE t.slug = %s $exclude_clause ORDER BY tt.{$order_by} $order_dir", $id ) );
+
+        return $result;
+    }
+
+    /**
+     * Delete a gallery AND all the pictures associated to this gallery!
+     *
+     * @id The gallery ID
+     */
+    function delete_gallery( $id ) {
+        global $wpdb;
+
+        $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->nggpictures WHERE galleryid = %d", $id) );
+        $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->nggallery WHERE gid = %d", $id) );
+
+        wp_cache_delete($id, 'ngg_gallery');
+
+        //TODO:Remove all tag relationship
+        return true;
+    }
+
+    /**
+     * Get an album given its ID
+     *
+     * @id The album ID or name
+     * @return A nggGallery object (false if not found)
+     */
+    function find_album( $id ) {
+        global $wpdb;
+
+        // Query database
+        if ( is_numeric($id) && $id != 0 ) {
+            if ( $album = wp_cache_get($id, 'ngg_album') )
+                return $album;
+
+            $album = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->nggalbum WHERE id = %d", $id) );
+        } elseif ( $id == 'all' || (is_numeric($id) && $id == 0) ) {
+            // init the object and fill it
+            $album = new stdClass();
+            $album->id = 'all';
+            $album->name = __('Album overview','nggallery');
+            $album->albumdesc  = __('Album overview','nggallery');
+            $album->previewpic = 0;
+            $album->sortorder  =  serialize( $wpdb->get_col("SELECT gid FROM $wpdb->nggallery") );
+        } else {
+            $album = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->nggalbum WHERE slug = %s", $id) );
+        }
+
+        // Unserialize the galleries inside the album
+        if ( $album ) {
+			// XXX nggdb is used statically, cannot inherit from Ngg_Serializable
+			$serializer = new Ngg_Serializable();
+
+            if ( !empty( $album->sortorder ) )
+                $album->gallery_ids = $serializer->unserialize( $album->sortorder );
+
+            // it was a bad idea to use a object, stripslashes_deep() could not used here, learn from it
+            $album->albumdesc  = stripslashes($album->albumdesc);
+            $album->name       = stripslashes($album->name);
+
+            wp_cache_add($album->id, $album, 'ngg_album');
+            return $album;
+        }
+
+        return false;
+    }
+
+    /**
+     * Delete an album
+     *
+     * @id The album ID
+     */
+    function delete_album( $id ) {
+        global $wpdb;
+
+        $result = $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->nggalbum WHERE id = %d", $id) );
+        wp_cache_delete($id, 'ngg_album');
+
+        return $result;
+    }
+
+    /**
+     * Insert an image in the database
+     *
+     * @return the ID of the inserted image
+     */
+    function insert_image($gid, $filename, $alttext, $desc, $exclude) {
+        global $wpdb;
+
+        $result = $wpdb->query(
+              "INSERT INTO $wpdb->nggpictures (galleryid, filename, description, alttext, exclude) VALUES "
+            . "('$gid', '$filename', '$desc', '$alttext', '$exclude');");
+        $pid = (int) $wpdb->insert_id;
+        wp_cache_delete($gid, 'ngg_gallery');
+
+        return $pid;
+    }
+
+    /**
+     * nggdb::update_image() - Update an image in the database
+     *
+     * @param int $pid   id of the image
+     * @param (optional) string|int $galleryid
+     * @param (optional) string $filename
+     * @param (optional) string $description
+     * @param (optional) string $alttext
+     * @param (optional) int $exclude (0 or 1)
+     * @param (optional) int $sortorder
+     * @return bool result of update query
+     */
+    function update_image($pid, $galleryid = false, $filename = false, $description = false, $alttext = false, $exclude = false, $sortorder = false) {
+
+        global $wpdb;
+
+        $sql = array();
+        $pid = (int) $pid;
+
+        // slug must be unique, we use the alttext for that
+        $slug = nggdb::get_unique_slug( sanitize_title( $alttext ), 'image' );
+
+        $update = array(
+            'image_slug'  => $slug,
+            'galleryid'   => $galleryid,
+            'filename'    => $filename,
+            'description' => $description,
+            'alttext'     => $alttext,
+            'exclude'     => $exclude,
+            'sortorder'   => $sortorder);
+
+        // create the sql parameter "name = value"
+        foreach ($update as $key => $value)
+            if ($value !== false)
+                $sql[] = $key . " = '" . $value . "'";
+
+        // create the final string
+        $sql = implode(', ', $sql);
+
+        if ( !empty($sql) && $pid != 0)
+            $result = $wpdb->query( "UPDATE $wpdb->nggpictures SET $sql WHERE pid = $pid" );
+
+        wp_cache_delete($pid, 'ngg_image');
+
+        return $result;
+    }
+
+     /**
+     * nggdb::update_gallery() - Update an gallery in the database
+     *
+     * @since V1.7.0
+     * @param int $id   id of the gallery
+     * @param (optional) string $title or name of the gallery
+     * @param (optional) string $path
+     * @param (optional) string $description
+     * @param (optional) int $pageid
+     * @param (optional) int $previewpic
+     * @param (optional) int $author
+     * @return bool result of update query
+     */
+    function update_gallery($id, $name = false, $path = false, $title = false, $description = false, $pageid = false, $previewpic = false, $author = false) {
+
+        global $wpdb;
+
+        $sql = array();
+        $id = (int) $id;
+
+        // slug must be unique, we use the title for that
+        $slug = nggdb::get_unique_slug( sanitize_title( $title ), 'gallery' );
+
+        $update = array(
+            'name'       => $name,
+            'slug'       => $slug,
+            'path'       => $path,
+            'title'      => $title,
+            'galdesc'    => $description,
+            'pageid'     => $pageid,
+            'previewpic' => $previewpic,
+            'author'     => $author);
+
+        // create the sql parameter "name = value"
+        foreach ($update as $key => $value)
+            if ($value !== false)
+                $sql[] = $key . " = '" . $value . "'";
+
+        // create the final string
+        $sql = implode(', ', $sql);
+
+        if ( !empty($sql) && $id != 0)
+            $result = $wpdb->query( "UPDATE $wpdb->nggallery SET $sql WHERE gid = $id" );
+
+        wp_cache_delete($id, 'ngg_gallery');
+
+        return $result;
+    }
+
+     /**
+     * nggdb::update_album() - Update an album in the database
+     *
+     * @since V1.7.0
+     * @param int $ id   id of the album
+     * @param (optional) string $title
+     * @param (optional) int $previewpic
+     * @param (optional) string $description
+     * @param (optional) serialized array $sortorder
+     * @param (optional) int $pageid
+     * @return bool result of update query
+     */
+    function update_album($id, $name = false, $previewpic = false, $description = false, $sortorder = false, $pageid = false ) {
+
+        global $wpdb;
+
+        $sql = array();
+        $id = (int) $id;
+
+        // slug must be unique, we use the title for that
+        $slug = nggdb::get_unique_slug( sanitize_title( $name ), 'album' );
+
+        $update = array(
+            'name'       => $name,
+            'slug'       => $slug,
+            'previewpic' => $previewpic,
+            'albumdesc'  => $description,
+            'sortorder'  => $sortorder,
+            'pageid'     => $pageid);
+
+        // create the sql parameter "name = value"
+        foreach ($update as $key => $value)
+            if ($value !== false)
+                $sql[] = $key . " = '" . $value . "'";
+
+        // create the final string
+        $sql = implode(', ', $sql);
+
+        if ( !empty($sql) && $id != 0)
+            $result = $wpdb->query( "UPDATE $wpdb->nggalbum SET $sql WHERE id = $id" );
+
+        wp_cache_delete($id, 'ngg_album');
+
+        return $result;
+    }
+
+    /**
+     * Get an image given its ID
+     *
+     * @param  int|string The image ID or Slug
+     * @return object A nggImage object representing the image (false if not found)
+     */
+    function find_image( $id ) {
+        global $wpdb;
+
+        if( is_numeric($id) ) {
+
+            if ( $image = wp_cache_get($id, 'ngg_image') )
+                return $image;
+
+            $result = $wpdb->get_row( $wpdb->prepare( "SELECT tt.*, t.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE tt.pid = %d ", $id ) );
+        } else
+            $result = $wpdb->get_row( $wpdb->prepare( "SELECT tt.*, t.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE tt.image_slug = %s ", $id ) );
+
+        // Build the object from the query result
+        if ($result) {
+            $image = new nggImage($result);
+            return $image;
+        }
+
+        return false;
+    }
+
+    /**
+     * Get images given a list of IDs
+     *
+     * @param $pids array of picture_ids
+     * @return An array of nggImage objects representing the images
+     */
+    function find_images_in_list( $pids, $exclude = false, $order = 'ASC' ) {
+        global $wpdb;
+
+        $result = array();
+
+        // Check for the exclude setting
+        $exclude_clause = ($exclude) ? ' AND t.exclude <> 1 ' : '';
+
+        // Check for the exclude setting
+        $order_clause = ($order == 'RAND') ? 'ORDER BY rand() ' : ' ORDER BY t.pid ASC' ;
+
+        if ( is_array($pids) ) {
+            $id_list = "'" . implode("', '", $pids) . "'";
+
+            // Save Query database
+            $images = $wpdb->get_results("SELECT t.*, tt.* FROM $wpdb->nggpictures AS t INNER JOIN $wpdb->nggallery AS tt ON t.galleryid = tt.gid WHERE t.pid IN ($id_list) $exclude_clause $order_clause", OBJECT_K);
+
+            // Build the image objects from the query result
+            if ($images) {
+                foreach ($images as $key => $image)
+                    $result[$key] = new nggImage( $image );
+            }
+        }
+        return $result;
+    }
+
+    /**
+    * Add an image to the database
+    *
+	* @since V1.4.0
+	* @param int $pid   id of the gallery
+    * @param (optional) string|int $galleryid
+    * @param (optional) string $filename
+    * @param (optional) string $description
+    * @param (optional) string $alttext
+    * @param (optional) array $meta data
+    * @param (optional) int $post_id (required for sync with WP media lib)
+    * @param (optional) string $imagedate
+    * @param (optional) int $exclude (0 or 1)
+    * @param (optional) int $sortorder
+    * @return bool result of the ID of the inserted image
+    */
+    function add_image( $id = false, $filename = false, $description = '', $alttext = '', $meta_data = false, $post_id = 0, $imagedate = '0000-00-00 00:00:00', $exclude = 0, $sortorder = 0  ) {
+        global $wpdb;
+
+		if ( is_array($meta_data) )
+			$meta_data = serialize($meta_data);
+
+        // slug must be unique, we use the alttext for that
+        $slug = nggdb::get_unique_slug( sanitize_title( $alttext ), 'image' );
+
+		// Add the image
+		if ( false === $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->nggpictures (image_slug, galleryid, filename, description, alttext, meta_data, post_id, imagedate, exclude, sortorder)
+													 VALUES (%s, %d, %s, %s, %s, %s, %d, %s, %d, %d)", $slug, $id, $filename, $description, $alttext, $meta_data, $post_id, $imagedate, $exclude, $sortorder ) ) ) {
+			return false;
+		}
+
+		$imageID = (int) $wpdb->insert_id;
+
+		// Remove from cache the galley, needs to be rebuild now
+	    wp_cache_delete( $id, 'ngg_gallery');
+
+		//and give me the new id
+		return $imageID;
+    }
+
+    /**
+    * Add an album to the database
+    *
+	* @since V1.7.0
+    * @param (optional) string $title
+    * @param (optional) int $previewpic
+    * @param (optional) string $description
+    * @param (optional) serialized array $sortorder
+    * @param (optional) int $pageid
+    * @return bool result of the ID of the inserted album
+    */
+    function add_album( $name = false, $previewpic = 0, $description = '', $sortorder = 0, $pageid = 0  ) {
+        global $wpdb;
+
+        // name must be unique, we use the title for that
+        $slug = nggdb::get_unique_slug( sanitize_title( $name ), 'album' );
+
+		// Add the album
+		if ( false === $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->nggalbum (name, slug, previewpic, albumdesc, sortorder, pageid)
+													 VALUES (%s, %s, %d, %s, %s, %d)", $name, $slug, $previewpic, $description, $sortorder, $pageid ) ) ) {
+			return false;
+		}
+
+		$albumID = (int) $wpdb->insert_id;
+
+		//and give me the new id
+		return $albumID;
+    }
+
+    /**
+    * Add an gallery to the database
+    *
+	* @since V1.7.0
+    * @param (optional) string $title or name of the gallery
+    * @param (optional) string $path
+    * @param (optional) string $description
+    * @param (optional) int $pageid
+    * @param (optional) int $previewpic
+    * @param (optional) int $author
+    * @return bool result of the ID of the inserted gallery
+    */
+    function add_gallery( $title = '', $path = '', $description = '', $pageid = 0, $previewpic = 0, $author = 0  ) {
+        global $wpdb;
+
+        // slug must be unique, we use the title for that
+        $slug = nggdb::get_unique_slug( sanitize_title( $title ), 'gallery' );
+
+        // Note : The field 'name' is deprecated, it's currently kept only for compat reason with older shortcodes, we copy the slug into this field
+		if ( false === $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->nggallery (name, slug, path, title, galdesc, pageid, previewpic, author)
+													 VALUES (%s, %s, %s, %s, %s, %d, %d, %d)", $slug, $slug, $path, $title, $description, $pageid, $previewpic, $author ) ) ) {
+			return false;
+		}
+
+		$galleryID = (int) $wpdb->insert_id;
+
+		//and give me the new id
+		return $galleryID;
+    }
+
+    /**
+    * Delete an image entry from the database
+    * @param integer $id is the Image ID
+    */
+    function delete_image( $id ) {
+        global $wpdb;
+
+        // Delete the image
+        $result = $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->nggpictures WHERE pid = %d", $id) );
+
+        // Delete tag references
+        wp_delete_object_term_relationships( $id, 'ngg_tag');
+
+        // Remove from cache
+        wp_cache_delete( $id, 'ngg_image');
+
+        return $result;
+    }
+
+    /**
+     * Get the last images registered in the database with a maximum number of $limit results
+     *
+     * @param integer $page start offset as page number (0,1,2,3,4...)
+     * @param integer $limit the number of result
+     * @param bool $exclude do not show exluded images
+     * @param int $galleryId Only look for images with this gallery id, or in all galleries if id is 0
+     * @param string $orderby is one of "id" (default, order by pid), "date" (order by exif date), sort (order by user sort order)
+     * @return
+     */
+    function find_last_images($page = 0, $limit = 30, $exclude = true, $galleryId = 0, $orderby = "id") {
+        global $wpdb;
+
+        // Check for the exclude setting
+        $exclude_clause = ($exclude) ? ' AND exclude<>1 ' : '';
+
+        // a limit of 0 makes no sense
+        $limit = ($limit == 0) ? 30 : $limit;
+        // calculate the offset based on the pagr number
+        $offset = (int) $page * $limit;
+
+        $galleryId = (int) $galleryId;
+        $gallery_clause = ($galleryId === 0) ? '' : ' AND galleryid = ' . $galleryId . ' ';
+
+        // default order by pid
+        $order = 'pid DESC';
+        switch ($orderby) {
+            case 'date':
+                $order = 'imagedate DESC';
+                break;
+            case 'sort':
+                $order = 'sortorder ASC';
+                break;
+        }
+
+        $result = array();
+        $gallery_cache = array();
+
+        // Query database
+        $images = $wpdb->get_results("SELECT * FROM $wpdb->nggpictures WHERE 1=1 $exclude_clause $gallery_clause ORDER BY $order LIMIT $offset, $limit");
+
+        // Build the object from the query result
+        if ($images) {
+            foreach ($images as $key => $image) {
+
+                // cache a gallery , so we didn't need to lookup twice
+                if (!array_key_exists($image->galleryid, $gallery_cache))
+                    $gallery_cache[$image->galleryid] = nggdb::find_gallery($image->galleryid);
+
+                // Join gallery information with picture information
+                foreach ($gallery_cache[$image->galleryid] as $index => $value)
+                    $image->$index = $value;
+
+                // Now get the complete image data
+                $result[$key] = new nggImage( $image );
+            }
+        }
+
+        return $result;
+    }
+
+    /**
+     * nggdb::get_random_images() - Get an random image from one ore more gally
+     *
+     * @param integer $number of images
+     * @param integer $galleryID optional a Gallery
+     * @return A nggImage object representing the image (null if not found)
+     */
+    function get_random_images($number = 1, $galleryID = 0) {
+        global $wpdb;
+
+        $number = (int) $number;
+        $galleryID = (int) $galleryID;
+        $images = array();
+
+        // Query database
+        if ($galleryID == 0)
+            $result = $wpdb->get_results("SELECT t.*, tt.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE tt.exclude != 1 ORDER by rand() limit $number");
+        else
+            $result = $wpdb->get_results("SELECT t.*, tt.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE t.gid = $galleryID AND tt.exclude != 1 ORDER by rand() limit {$number}");
+
+        // Return the object from the query result
+        if ($result) {
+            foreach ($result as $image) {
+                $images[] = new nggImage( $image );
+            }
+            return $images;
+        }
+
+        return null;
+    }
+
+    /**
+     * Get all the images from a given album
+     *
+     * @param object|int $album The album object or the id
+     * @param string $order_by
+     * @param string $order_dir
+     * @param bool $exclude
+     * @return An array containing the nggImage objects representing the images in the album.
+     */
+    function find_images_in_album($album, $order_by = 'galleryid', $order_dir = 'ASC', $exclude = true) {
+        global $wpdb;
+
+        if ( !is_object($album) )
+            $album = nggdb::find_album( $album );
+
+        // Get gallery list
+        $gallery_list = implode(',', $album->gallery_ids);
+        // Check for the exclude setting
+        $exclude_clause = ($exclude) ? ' AND tt.exclude<>1 ' : '';
+
+        // Say no to any other value
+        $order_dir = ( $order_dir == 'DESC') ? 'DESC' : 'ASC';
+        $order_by  = ( empty($order_by) ) ? 'galleryid' : $order_by;
+
+        $result = $wpdb->get_results("SELECT t.*, tt.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE tt.galleryid IN ($gallery_list) $exclude_clause ORDER BY tt.$order_by $order_dir");
+        // Return the object from the query result
+        if ($result) {
+            foreach ($result as $image) {
+                $images[] = new nggImage( $image );
+            }
+            return $images;
+        }
+
+        return null;
+    }
+
+    /**
+     * search for images and return the result
+     *
+     * @since 1.3.0
+     * @param string $request
+     * @param int $limit number of results, 0 shows all results
+     * @return Array Result of the request
+     */
+    function search_for_images( $request, $limit = 0 ) {
+        global $wpdb;
+
+        // If a search pattern is specified, load the posts that match
+        if ( !empty($request) ) {
+            // added slashes screw with quote grouping when done early, so done later
+            $request = stripslashes($request);
+
+            // split the words it a array if seperated by a space or comma
+            preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $request, $matches);
+            $search_terms = array_map(create_function('$a', 'return trim($a, "\\"\'\\n\\r ");'), $matches[0]);
+
+            $n = '%';
+            $searchand = '';
+            $search = '';
+
+            foreach( (array) $search_terms as $term) {
+                $term = addslashes_gpc($term);
+                $search .= "{$searchand}((tt.description LIKE '{$n}{$term}{$n}') OR (tt.alttext LIKE '{$n}{$term}{$n}') OR (tt.filename LIKE '{$n}{$term}{$n}'))";
+                $searchand = ' AND ';
+            }
+
+            $term = $wpdb->escape($request);
+            if (count($search_terms) > 1 && $search_terms[0] != $request )
+                $search .= " OR (tt.description LIKE '{$n}{$term}{$n}') OR (tt.alttext LIKE '{$n}{$term}{$n}') OR (tt.filename LIKE '{$n}{$term}{$n}')";
+
+            if ( !empty($search) )
+                $search = " AND ({$search}) ";
+
+            $limit_by  = ( $limit > 0 ) ? 'LIMIT ' . intval($limit) : '';
+        } else
+            return false;
+
+        // build the final query
+        $query = "SELECT t.*, tt.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE 1=1 $search ORDER BY tt.pid ASC $limit_by";
+        $result = $wpdb->get_results($query);
+
+        // TODO: Currently we didn't support a proper pagination
+        $this->paged['total_objects'] = $this->paged['objects_per_page'] = intval ( $wpdb->get_var( "SELECT FOUND_ROWS()" ) );
+        $this->paged['max_objects_per_page'] = 1;
+
+        // Return the object from the query result
+        if ($result) {
+            foreach ($result as $image) {
+                $images[] = new nggImage( $image );
+            }
+            return $images;
+        }
+
+        return null;
+    }
+
+    /**
+     * search for galleries and return the result
+     *
+     * @since 1.7.0
+     * @param string $request
+     * @param int $limit number of results, 0 shows all results
+     * @return Array Result of the request
+     */
+    function search_for_galleries( $request, $limit = 0 ) {
+        global $wpdb;
+
+        // If a search pattern is specified, load the posts that match
+        if ( !empty($request) ) {
+            // added slashes screw with quote grouping when done early, so done later
+            $request = stripslashes($request);
+
+            // split the words it a array if seperated by a space or comma
+            preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $request, $matches);
+            $search_terms = array_map(create_function('$a', 'return trim($a, "\\"\'\\n\\r ");'), $matches[0]);
+
+            $n = '%';
+            $searchand = '';
+            $search = '';
+
+            foreach( (array) $search_terms as $term) {
+                $term = addslashes_gpc($term);
+                $search .= "{$searchand}((title LIKE '{$n}{$term}{$n}') OR (name LIKE '{$n}{$term}{$n}') )";
+                $searchand = ' AND ';
+            }
+
+            $term = $wpdb->escape($request);
+            if (count($search_terms) > 1 && $search_terms[0] != $request )
+                $search .= " OR (title LIKE '{$n}{$term}{$n}') OR (name LIKE '{$n}{$term}{$n}')";
+
+            if ( !empty($search) )
+                $search = " AND ({$search}) ";
+
+            $limit  = ( $limit > 0 ) ? 'LIMIT ' . intval($limit) : '';
+        } else
+            return false;
+
+        // build the final query
+        $query = "SELECT * FROM $wpdb->nggallery WHERE 1=1 $search ORDER BY title ASC $limit";
+        $result = $wpdb->get_results($query);
+
+        return $result;
+    }
+
+    /**
+     * search for albums and return the result
+     *
+     * @since 1.7.0
+     * @param string $request
+     * @param int $limit number of results, 0 shows all results
+     * @return Array Result of the request
+     */
+    function search_for_albums( $request, $limit = 0 ) {
+        global $wpdb;
+
+        // If a search pattern is specified, load the posts that match
+        if ( !empty($request) ) {
+            // added slashes screw with quote grouping when done early, so done later
+            $request = stripslashes($request);
+
+            // split the words it a array if seperated by a space or comma
+            preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $request, $matches);
+            $search_terms = array_map(create_function('$a', 'return trim($a, "\\"\'\\n\\r ");'), $matches[0]);
+
+            $n = '%';
+            $searchand = '';
+            $search = '';
+
+            foreach( (array) $search_terms as $term) {
+                $term = addslashes_gpc($term);
+                $search .= "{$searchand}(name LIKE '{$n}{$term}{$n}')";
+                $searchand = ' AND ';
+            }
+
+            $term = $wpdb->escape($request);
+            if (count($search_terms) > 1 && $search_terms[0] != $request )
+                $search .= " OR (name LIKE '{$n}{$term}{$n}')";
+
+            if ( !empty($search) )
+                $search = " AND ({$search}) ";
+
+            $limit  = ( $limit > 0 ) ? 'LIMIT ' . intval($limit) : '';
+        } else
+            return false;
+
+        // build the final query
+        $query = "SELECT * FROM $wpdb->nggalbum WHERE 1=1 $search ORDER BY name ASC $limit";
+        $result = $wpdb->get_results($query);
+
+        return $result;
+    }
+
+    /**
+     * search for a filename
+     *
+     * @since 1.4.0
+     * @param string $filename
+     * @param int (optional) $galleryID
+     * @return Array Result of the request
+     */
+    function search_for_file( $filename, $galleryID = false ) {
+        global $wpdb;
+
+        // If a search pattern is specified, load the posts that match
+        if ( !empty($filename) ) {
+            // added slashes screw with quote grouping when done early, so done later
+            $term = $wpdb->escape($filename);
+
+           	$where_clause = '';
+            if ( is_numeric($galleryID) ) {
+            	$id = (int) $galleryID;
+            	$where_clause = " AND tt.galleryid = {$id}";
+            }
+        }
+
+        // build the final query
+        $query = "SELECT t.*, tt.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE tt.filename = '{$term}' {$where_clause} ORDER BY tt.pid ASC ";
+		$result = $wpdb->get_row($query);
+
+        // Return the object from the query result
+        if ($result) {
+        	$image = new nggImage( $result );
+            return $image;
+        }
+
+        return null;
+    }
+
+
+    /**
+     * Update or add meta data for an image
+     *
+     * @since 1.4.0
+     * @param int $id The image ID
+     * @param array $values An array with existing or new values
+     * @return bool result of query
+     */
+    function update_image_meta( $id, $new_values ) {
+        global $wpdb;
+
+        // XXX nggdb is used statically, cannot inherit from Ngg_Serializable
+        $serializer = new Ngg_Serializable();
+
+        // Query database for existing values
+        // Use cache object
+        $old_values = $wpdb->get_var( $wpdb->prepare( "SELECT meta_data FROM $wpdb->nggpictures WHERE pid = %d ", $id ) );
+        $old_values = $serializer->unserialize( $old_values );
+
+        $meta = array_merge( (array)$old_values, (array)$new_values );
+
+        $result = $wpdb->query( $wpdb->prepare("UPDATE $wpdb->nggpictures SET meta_data = %s WHERE pid = %d", serialize($meta), $id) );
+
+        wp_cache_delete($id, 'ngg_image');
+
+        return $result;
+    }
+
+    /**
+     * Computes a unique slug for the gallery,album or image, when given the desired slug.
+     *
+     * @since 1.7.0
+     * @author taken from WP Core includes/post.php
+     * @param string $slug the desired slug (post_name)
+     * @param string $type ('image', 'album' or 'gallery')
+     * @param int (optional) $id of the object, so that it's not checked against itself
+     * @return string unique slug for the object, based on $slug (with a -1, -2, etc. suffix)
+     */
+    function get_unique_slug( $slug, $type, $id = 0 ) {
+
+    	global $wpdb;
+
+        switch ($type) {
+            case 'image':
+        		$check_sql = "SELECT image_slug FROM $wpdb->nggpictures WHERE image_slug = %s AND NOT pid = %d LIMIT 1";
+            break;
+            case 'album':
+        		$check_sql = "SELECT slug FROM $wpdb->nggalbum WHERE slug = %s AND NOT id = %d LIMIT 1";
+            break;
+            case 'gallery':
+        		$check_sql = "SELECT slug FROM $wpdb->nggallery WHERE slug = %s AND NOT gid = %d LIMIT 1";
+            break;
+            default:
+                return false;
+        }
+
+        //if you didn't give us a name we take the type
+        $slug = empty($slug) ? $type: $slug;
+
+   		// Slugs must be unique across all objects.
+        $slug_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug, $id ) );
+
+		if ( $slug_check ) {
+			$suffix = 2;
+			do {
+				$alt_name = substr ($slug, 0, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix";
+				$slug_check = $wpdb->get_var( $wpdb->prepare($check_sql, $alt_name, $id ) );
+				$suffix++;
+			} while ( $slug_check );
+			$slug = $alt_name;
+		}
+
+       	return $slug;
+    }
+
+}
+endif;
+
+if ( ! isset($GLOBALS['nggdb']) ) {
+    /**
+     * Initate the NextGEN Gallery Database Object, for later cache reasons
+     * @global object $nggdb Creates a new nggdb object
+     * @since 1.1.0
+     */
+    unset($GLOBALS['nggdb']);
+    $GLOBALS['nggdb'] = new nggdb() ;
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/post-thumbnail.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/post-thumbnail.php
new file mode 100644
index 0000000000000000000000000000000000000000..a23e36f1deab612264ef547745eef5c596e4b54b
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/post-thumbnail.php
@@ -0,0 +1,365 @@
+<?php
+// see : http://wordpress.org/support/topic/plugin-nextgen-gallery-ngg-and-featured-image-issue?replies=14
+/**
+ * nggPostThumbnail - Class for adding the post thumbnail feature
+ * 
+ * @package NextGEN Gallery
+ * @author Alex Rabe 
+ * 
+ * @version 1.0.2
+ * @access internal
+ */
+class nggPostThumbnail {
+
+	/**
+	 * PHP4 compatibility layer for calling the PHP5 constructor.
+	 * 
+	 */
+	function nggPostThumbnail() {
+		return $this->__construct();
+	}
+
+	/**
+	 * Main constructor - Add filter and action hooks
+	 * 
+	 */	
+	function __construct() {
+		
+		add_filter( 'admin_post_thumbnail_html', array( $this, 'admin_post_thumbnail'), 10, 2 );
+		add_action( 'wp_ajax_ngg_set_post_thumbnail', array( $this, 'ajax_set_post_thumbnail') );
+		// Adding filter for the new post_thumbnail
+		add_filter( 'post_thumbnail_html', array( $this, 'ngg_post_thumbnail'), 10, 5 );
+		return;		
+	}
+
+	/**
+	 * Filter for the post meta box. look for a NGG image if the ID is "ngg-<imageID>"
+	 * 
+	 * @param string $content
+	 * @return string html output
+	 */
+	function admin_post_thumbnail( $content, $post_id = null ) 
+	{
+    if ($post_id == null)
+    {
+			global $post;
+
+		  if ( !is_object($post) )
+		     return $content;
+       
+      $post_id = $post->ID;
+    }
+        
+		$thumbnail_id = get_post_meta($post_id, '_thumbnail_id', true);
+
+		// in the case it's a ngg image it return ngg-<imageID>
+		if ( strpos($thumbnail_id, 'ngg-') === false) 
+		{
+			global $wp_version;
+			
+			if (version_compare($wp_version, '3.5', '>=') && $thumbnail_id <= 0)
+			{
+				$iframe_src = get_upload_iframe_src('image');
+				$iframe_src = remove_query_arg('TB_iframe', $iframe_src);
+				$iframe_src = add_query_arg('tab', 'nextgen', $iframe_src);
+				$iframe_src = add_query_arg('chromeless', '1', $iframe_src);
+				$iframe_src = add_query_arg('TB_iframe', '1', $iframe_src);
+			
+			  $set_thumbnail_link = '<p class="hide-if-no-js"><a title="' . esc_attr__( 'Set NextGEN featured image' ) . '" href="' . esc_url( $iframe_src ) . '" id="set-ngg-post-thumbnail" class="thickbox">%s</a></p>';
+			  
+			  $content .= sprintf($set_thumbnail_link, esc_html__( 'Set NextGEN featured image' ));
+			}
+			
+			return $content;
+		}
+			
+		// cut off the 'ngg-'
+		$thumbnail_id = substr( $thumbnail_id, 4);
+
+		return $this->_wp_post_thumbnail_html( $thumbnail_id );		
+	}
+	
+	/**
+	 * Filter for the post content
+	 * 
+	 * @param string $html
+	 * @param int $post_id
+	 * @param int $post_thumbnail_id
+	 * @param string|array $size Optional. Image size.  Defaults to 'thumbnail'.
+	 * @param string|array $attr Optional. Query string or array of attributes.
+	 * @return string html output
+	 */
+	function ngg_post_thumbnail( $html, $post_id, $post_thumbnail_id, $size = 'post-thumbnail', $attr = '' ) {
+
+		global $post, $_wp_additional_image_sizes;
+
+		// in the case it's a ngg image it return ngg-<imageID>
+		if ( strpos($post_thumbnail_id, 'ngg-') === false)
+			return $html;
+
+		// cut off the 'ngg-'
+		$post_thumbnail_id = substr( $post_thumbnail_id, 4);
+
+		// get the options
+		$ngg_options = nggGallery::get_option('ngg_options');
+
+		// get the image data
+		$image = nggdb::find_image($post_thumbnail_id);
+
+		if (!$image) 
+			return $html;
+
+		$img_src = false;		
+		$class = 'wp-post-image ngg-image-' . $image->pid . ' ';
+        
+        if (is_array($size) || is_array($_wp_additional_image_sizes) && isset($_wp_additional_image_sizes[$size])) {		        	        		
+			$class .= isset($attr['class']) ? esc_attr($attr['class']) : '';
+		
+			if( is_array($size)){
+				//the parameters is given as an array rather than a predfined image
+				$width = absint( $size[0] );
+				$height = absint( $size[1] );
+				if(isset($size[2]) && $size[2] === true) {
+					$mode = 'crop';
+				} else if(isset($size[2])){
+					$mode = $size[2];
+				} else {
+					$mode = '';					
+				}
+			} else {
+				$width = absint( $_wp_additional_image_sizes[$size]['width'] );
+				$height = absint( $_wp_additional_image_sizes[$size]['height'] );
+        $mode = ($_wp_additional_image_sizes[$size]['crop']) ? 'crop' : '';
+			}
+
+      // check fo cached picture
+          if ( $post->post_status == 'publish' )
+              $img_src = $image->cached_singlepic_file( $width, $height, $mode );                
+  
+			// if we didn't use a cached image then we take the on-the-fly mode 
+		        if ($img_src ==  false) 
+		        	$img_src = trailingslashit( home_url() ) . 'index.php?callback=image&amp;pid=' . $image->pid . '&amp;width=' . $width . '&amp;height=' . $height . '&amp;mode=crop';
+                
+		} else {
+			$img_src = $image->thumbURL;
+		}
+		
+		$alttext = isset($attr['alt']) ? $attr['alt'] : $image->alttext;
+		$titletext = isset($attr['title']) ? $attr['title'] : $image->title;
+
+		$html = '<img src="' . esc_attr($img_src) . '" alt="' . esc_attr($alttext) . '" title="' . esc_attr($titletext) .'" class="'.$class.'" />';
+
+		return $html;
+	}
+	
+	/**
+	 * nggPostThumbnail::ajax_set_post_thumbnail()
+	 * 
+	 * @return void
+	 */
+	function ajax_set_post_thumbnail() 
+	{
+		global $post_ID;
+
+		// check for correct capability
+		if ( !is_user_logged_in() )
+			die( '-1' );
+
+		// get the post id as global variable, otherwise the ajax_nonce failed later
+		$post_ID = intval( $_POST['post_id'] );
+
+		if ( !current_user_can( 'edit_post', $post_ID ) )
+			die( '-1' );
+
+		$thumbnail_id = intval( $_POST['thumbnail_id'] );
+
+		// delete the image
+		if ( $thumbnail_id == '-1' ) {
+			delete_post_meta( $post_ID, '_thumbnail_id' );
+			die('0');
+		}
+
+		if ($thumbnail_id != null)
+		{
+			$registry = C_Component_Registry::get_instance();
+		  $imap = $registry->get_utility('I_Image_Mapper');
+		  $storage  = $registry->get_utility('I_Gallery_Storage');
+		  
+		  $image = $imap->find($thumbnail_id);
+		
+			// for NGG we look for the image id
+			if ($image)
+			{
+				$image_id = $thumbnail_id;
+				
+				$args = array(
+					'post_type' => 'attachment',
+					'meta_key' => '_ngg_image_id',
+					'meta_compare' => '==',
+					'meta_value' => $image_id
+				);
+				
+				$upload_dir = wp_upload_dir();
+				$basedir = $upload_dir['basedir'];
+				$thumbs_dir = path_join($basedir, 'ngg_featured');
+				$gallery_abspath = $storage->get_gallery_abspath($image->galleryid);
+				$image_abspath = $storage->get_full_abspath($image);
+				$target_path = null;
+	
+				$posts = get_posts($args);
+				$attachment_id = null;
+				
+				if ($posts != null)
+				{
+					$attachment_id = $posts[0]->ID;
+				}
+				else
+				{
+					$url = $storage->get_full_url($image);
+					
+					$target_relpath = null;
+					$target_basename = basename($image_abspath);
+					
+					if (strpos($image_abspath, $gallery_abspath) === 0)
+					{
+						$target_relpath = substr($image_abspath, strlen($gallery_abspath));
+					}
+					else if ($image->galleryid)
+					{
+						$target_relpath = path_join(strval($image->galleryid), $target_basename);
+					}
+					else
+					{
+						$target_relpath = $target_basename;
+					}
+					
+					$target_relpath = trim($target_relpath, '\\/');
+					$target_path = path_join($thumbs_dir, $target_relpath);
+					$max_count = 100;
+					$count = 0;
+					
+					while (file_exists($target_path) && $count <= $max_count)
+					{
+						$count++;
+						
+						$pathinfo = pathinfo($target_path);
+						$dirname = $pathinfo['dirname'];
+						$filename = $pathinfo['filename'];
+						$extension = $pathinfo['extension'];
+						
+						$rand = mt_rand(1, 9999);
+						$basename = $filename . '_' . sprintf('%04d', $rand) . '.' . $extension;
+						
+						$target_path = path_join($dirname, $basename);
+					}
+					
+					if (file_exists($target_path))
+					{
+						// XXX handle very rare case in which $max_count wasn't enough?
+					}
+					
+					$target_dir = dirname($target_path);
+					
+					wp_mkdir_p($target_dir);
+					
+					if (@copy($image_abspath, $target_path))
+					{
+						$size = @getimagesize($target_path);
+						$image_type = ($size) ? $size['mime'] : 'image/jpeg';
+				
+						$title = sanitize_file_name($image->alttext);
+						$caption = sanitize_file_name($image->description);
+				
+						$attachment = array(
+							'post_title' => $title,
+							'post_content' => $caption,
+							'post_status' => 'attachment',
+							'post_parent' => 0,
+							'post_mime_type' => $image_type,
+							'guid' => $url
+						);
+
+						// Save the data
+						$attachment_id = wp_insert_attachment($attachment, $target_path);
+				
+						if ($attachment_id)
+						{
+							wp_update_attachment_metadata($attachment_id, wp_generate_attachment_metadata($attachment_id, $target_path));
+					
+							update_post_meta($attachment_id, '_ngg_image_id', $image_id);
+						}
+					}
+				}
+			
+				if ($attachment_id)
+				{
+					//$attachment = get_post($attachment_id);
+					//$attachment_meta = wp_get_attachment_metadata($attachment_id);
+					$attachment_file = get_attached_file($attachment_id);
+					$target_path = $attachment_file;
+					
+					if (filemtime($image_abspath) > filemtime($target_path))
+					{
+						if (@copy($image_abspath, $target_path))
+						{
+							wp_update_attachment_metadata($attachment_id, wp_generate_attachment_metadata($attachment_id, $target_path));
+						}
+					}
+					
+					die(strval($attachment_id));
+				}
+			}
+		}
+		
+		die('0');
+	}
+
+	/**
+	 * Output HTML for the post thumbnail meta-box.
+	 *
+	 * @see wp-admin\includes\post.php
+	 * @param int $thumbnail_id ID of the image used for thumbnail
+	 * @return string html output
+	 */
+	function _wp_post_thumbnail_html( $thumbnail_id = NULL ) {
+	   
+		global $_wp_additional_image_sizes, $post_ID;
+
+	    $set_thumbnail_link = '<p class="hide-if-no-js"><a title="' . esc_attr__( 'Set featured image' ) . '" href="' . esc_url( get_upload_iframe_src('image') ) . '" id="set-post-thumbnail" class="thickbox">%s</a></p>';
+	    $content = sprintf($set_thumbnail_link, esc_html__( 'Set featured image' ));
+		
+        $image = nggdb::find_image($thumbnail_id);
+        $img_src = false;
+
+		// get the options
+		$ngg_options = nggGallery::get_option('ngg_options');
+        
+		if ( $image ) {
+            if ( is_array($_wp_additional_image_sizes) && isset($_wp_additional_image_sizes['post-thumbnail']) ){
+                // Use post thumbnail settings if defined
+     			$width = absint( $_wp_additional_image_sizes['post-thumbnail']['width'] );
+    			$height = absint( $_wp_additional_image_sizes['post-thumbnail']['height'] );
+                $mode = $_wp_additional_image_sizes['post-thumbnail']['crop'] ? 'crop' : '';
+    		    // check fo cached picture
+   		        $img_src = $image->cached_singlepic_file( $width, $height, $mode );                
+            }
+
+		    // if we didn't use a cached image then we take the on-the-fly mode 
+		    if ( $img_src == false ) 
+		        $img_src = trailingslashit( home_url() ) . 'index.php?callback=image&amp;pid=' . $image->pid . '&amp;width=' . $width . '&amp;height=' . $height . '&amp;mode=crop';
+			
+            $thumbnail_html = '<img width="266" src="'. $img_src . '" alt="'.$image->alttext.'" title="'.$image->alttext.'" />';
+            
+			if ( !empty( $thumbnail_html ) ) {
+    			$ajax_nonce = wp_create_nonce( "set_post_thumbnail-$post_ID" );
+    			$content = sprintf($set_thumbnail_link, $thumbnail_html);
+    			$content .= '<p class="hide-if-no-js"><a href="#" id="remove-post-thumbnail" onclick="WPRemoveThumbnail(\'' . $ajax_nonce . '\');return false;">' . esc_html__( 'Remove featured image' ) . '</a></p>';
+			}
+		}
+
+		return $content;
+	}	
+	
+}
+
+$nggPostThumbnail = new nggPostThumbnail();
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/rewrite.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/rewrite.php
new file mode 100644
index 0000000000000000000000000000000000000000..6f2e9bd1deb0e05ce63f876a2847e9f8879cf344
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/rewrite.php
@@ -0,0 +1,423 @@
+<?php
+
+/**
+* nggRewrite - Rewrite Rules for NextGEN Gallery
+*
+* sorry wp-guys I didn't understand this at all.
+* I tried it a couple of hours : this is the only pooooor result
+*
+* @package NextGEN Gallery
+* @author Alex Rabe
+*
+*/
+class nggRewrite {
+
+	/**
+	 * Default slug name
+	 *
+	 * @since 1.8.0
+	 * @var string
+	 */
+	var $slug = 'nggallery';
+
+	/**
+	 * Contain the main rewrite structure
+	 *
+	 * @since 1.8.3
+	 * @var array
+	 */
+    var $ngg_rules = '';
+
+	/**
+	* Constructor
+	*/
+	function nggRewrite() {
+
+		// read the option setting
+		$this->options = get_option('ngg_options');
+
+		// get later from the options
+        $this->slug = $this->options['permalinkSlug'];
+
+		/*WARNING: Do nothook rewrite rule regentation on the init hook for anything other than dev. */
+		//add_action('init',array(&$this, 'flush'));
+
+		add_filter('query_vars', array(&$this, 'add_queryvars') );
+		add_filter('wp_title' , array(&$this, 'rewrite_title') );
+
+        //DD32 recommend : http://groups.google.com/group/wp-hackers/browse_thread/thread/50ac0d07e30765e9
+        //add_filter('rewrite_rules_array', array($this, 'RewriteRules'));
+
+		if ($this->options['usePermalinks'])
+			add_action('generate_rewrite_rules', array(&$this, 'RewriteRules'));
+
+        // setup the main rewrite structure for the plugin
+        $this->ngg_rules = array(
+            '/page-([0-9]+)/' => '&nggpage=[matches]',
+    		'/image/([^/]+)/' => '&pid=[matches]',
+    		'/image/([^/]+)/page-([0-9]+)/' => '&pid=[matches]&nggpage=[matches]',
+    		'/slideshow/' => '&show=slide',
+    		'/images/' => '&show=gallery',
+    		'/tags/([^/]+)/' => '&gallerytag=[matches]',
+    		'/tags/([^/]+)/page-([0-9]+)/' => '&gallerytag=[matches]&nggpage=[matches]',
+    		'/([^/]+)/' => '&album=[matches]',
+    		'/([^/]+)/page-([0-9]+)/' => '&album=[matches]&nggpage=[matches]',
+    		'/([^/]+)/([^/]+)/' => '&album=[matches]&gallery=[matches]',
+    		'/([^/]+)/([^/]+)/slideshow/' => '&album=[matches]&gallery=[matches]&show=slide',
+    		'/([^/]+)/([^/]+)/images/' => '&album=[matches]&gallery=[matches]&show=gallery',
+    		'/([^/]+)/([^/]+)/page-([0-9]+)/' => '&album=[matches]&gallery=[matches]&nggpage=[matches]',
+    		'/([^/]+)/([^/]+)/page-([0-9]+)/slideshow/' => '&album=[matches]&gallery=[matches]&nggpage=[matches]&show=slide',
+    		'/([^/]+)/([^/]+)/page-([0-9]+)/images/' => '&album=[matches]&gallery=[matches]&nggpage=[matches]&show=gallery',
+    		'/([^/]+)/([^/]+)/image/([^/]+)/' => '&album=[matches]&gallery=[matches]&pid=[matches]'
+        );
+
+
+	} // end of initialization
+
+	/**
+	* Get the permalink to a picture/album/gallery given its ID/name/...
+	*/
+	function get_permalink( $args ) {
+		global $wp_rewrite, $wp_query;
+
+        // taken from is_frontpage plugin, required for static homepage
+        $show_on_front = get_option('show_on_front');
+        $page_on_front = get_option('page_on_front');
+
+		//TODO: Watch out for ticket http://trac.wordpress.org/ticket/6627
+		if ($wp_rewrite->using_permalinks() && $this->options['usePermalinks'] ) {
+			$post = &get_post(get_the_ID());
+
+			// If the album is not set before get it from the wp_query ($_GET)
+            if ( !isset ($args['album'] ) )
+                $album = get_query_var('album');
+			if ( !empty( $album ) )
+				$args ['album'] = $album;
+
+			$gallery = get_query_var('gallery');
+			if ( !empty( $gallery ) )
+				$args ['gallery'] = $gallery;
+
+			$gallerytag = get_query_var('gallerytag');
+			if ( !empty( $gallerytag ) )
+				$args ['gallerytag'] = $gallerytag;
+
+			/** urlconstructor =  post url | slug | tags | [nav] | [show]
+				tags : 	album, gallery 	-> /album-([0-9]+)/gallery-([0-9]+)/
+						pid 			-> /image/([0-9]+)/
+						gallerytag		-> /tags/([^/]+)/
+				nav	 : 	nggpage			-> /page-([0-9]+)/
+				show : 	show=slide		-> /slideshow/
+						show=gallery	-> /images/
+			**/
+
+			// 1. Post / Page url + main slug
+            $url = trailingslashit ( get_permalink ($post->ID) ) . $this->slug;
+            //TODO: For static home pages generate the link to the selected page, still doesn't work
+            if (($show_on_front == 'page') && ($page_on_front == get_the_ID()))
+                $url = trailingslashit ( $post->guid ) . $this->slug;
+
+			// 2. Album, pid or tags
+			if (isset ($args['album']) && ($args['gallery'] == false) )
+				$url .= '/' . $args['album'];
+			elseif  (isset ($args['album']) && isset ($args['gallery']) )
+				$url .= '/' . $args['album'] . '/' . $args['gallery'];
+
+			if  (isset ($args['gallerytag']))
+				$url .= '/tags/' . $args['gallerytag'];
+
+			if  (isset ($args['pid']))
+				$url .= '/image/' . $args['pid'];
+
+			// 3. Navigation
+			if  (isset ($args['nggpage']) && ($args['nggpage']) )
+				$url .= '/page-' . $args['nggpage'];
+            elseif (isset ($args['nggpage']) && ($args['nggpage'] === false) && ( count($args) == 1 ) )
+                $url = trailingslashit ( get_permalink ($post->ID) ); // special case instead of showing page-1, we show the clean url
+
+			// 4. Show images or Slideshow
+			if  (isset ($args['show']))
+				$url .= ( $args['show'] == 'slide' ) ? '/slideshow' : '/images';
+
+			return apply_filters('ngg_get_permalink', $url, $args);
+
+		} else {
+			// we need to add the page/post id at the start_page otherwise we don't know which gallery is clicked
+			if (is_home())
+				$args['pageid'] = get_the_ID();
+
+			if (($show_on_front == 'page') && ($page_on_front == get_the_ID()))
+				$args['page_id'] = get_the_ID();
+
+			if ( !is_singular() )
+				$query = htmlspecialchars( add_query_arg($args, get_permalink( get_the_ID() )) );
+			else
+				$query = htmlspecialchars( add_query_arg( $args ) );
+
+            return apply_filters('ngg_get_permalink', $query, $args);
+		}
+	}
+
+	/**
+	* The permalinks needs to be flushed after activation
+	*/
+	function flush() {
+		global $wp_rewrite, $ngg;
+
+        // reload slug, maybe it changed during the flush routine
+        $this->slug = $ngg->options['permalinkSlug'];
+
+		if ($ngg->options['usePermalinks'])
+			add_action('generate_rewrite_rules', array(&$this, 'RewriteRules'));
+
+		$wp_rewrite->flush_rules();
+	}
+
+	/**
+	* add some more vars to the big wp_query
+	*/
+	function add_queryvars( $query_vars ){
+
+		$query_vars[] = 'pid';
+		$query_vars[] = 'pageid';
+		$query_vars[] = 'nggpage';
+		$query_vars[] = 'gallery';
+		$query_vars[] = 'album';
+		$query_vars[] = 'gallerytag';
+		$query_vars[] = 'show';
+        $query_vars[] = 'callback';
+
+		return $query_vars;
+	}
+
+	/**
+	* rewrite the blog title if the gallery is used
+	*/
+	function rewrite_title($title) {
+
+		$new_title = '';
+		// the separataor
+		$sep = ' &laquo; ';
+
+		// $_GET from wp_query
+		$pid     = get_query_var('pid');
+		$pageid  = get_query_var('pageid');
+		$nggpage = get_query_var('nggpage');
+		$gallery = get_query_var('gallery');
+		$album   = get_query_var('album');
+		$tag  	 = get_query_var('gallerytag');
+		$show    = get_query_var('show');
+
+		//TODO: I could parse for the Picture name , gallery etc, but this increase the queries
+		//TODO: Class nggdb need to cache the query for the nggfunctions.php
+
+		if ( $show == 'slide' )
+			$new_title .= __('Slideshow', 'nggallery') . $sep ;
+		elseif ( $show == 'show' )
+			$new_title .= __('Gallery', 'nggallery') . $sep ;
+
+		if ( !empty($pid) )
+			$new_title .= __('Picture', 'nggallery') . ' ' . esc_attr($pid) . $sep ;
+
+		if ( !empty($album) )
+			$new_title .= __('Album', 'nggallery') . ' ' . esc_attr($album) . $sep ;
+
+		if ( !empty($gallery) )
+			$new_title .= __('Gallery', 'nggallery') . ' ' . esc_attr($gallery) . $sep ;
+
+		if ( !empty($nggpage) )
+			$new_title .= __('Page', 'nggallery') . ' ' . esc_attr($nggpage) . $sep ;
+
+		//esc_attr should avoid XSS like http://domain/?gallerytag=%3C/title%3E%3Cscript%3Ealert(document.cookie)%3C/script%3E
+		if ( !empty($tag) )
+			$new_title .= esc_attr($tag) . $sep;
+
+		//prepend the data
+		$title = $new_title . $title;
+
+		return $title;
+	}
+
+	/**
+	 * Canonical support for a better SEO (Dupilcat content), not longer nedded for Wp 2.9
+	 * See : http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html
+	 *
+	 * @deprecated
+	 * @return string $meta
+	 */
+	function add_canonical_meta()
+    {
+            // create the meta link
+ 			$meta  = "\n<link rel='canonical' href='" . get_permalink() ."' />";
+ 			// add a filter for SEO plugins, so they can remove it
+ 			echo apply_filters('ngg_add_canonical_meta', $meta);
+
+        return;
+    }
+
+	/**
+	* The actual rewrite rules
+	*/
+	function RewriteRules($wp_rewrite) {
+        global $ngg;
+
+		$rewrite_rules = array (
+            // XML request
+            $this->slug . '/slideshow/([0-9]+)/?$' => 'index.php?imagerotator=true&gid=$matches[1]'
+		);
+
+        $rewrite_rules = array_merge($rewrite_rules, $this->generate_rewrite_rules() );
+		$wp_rewrite->rules = array_merge($rewrite_rules, $wp_rewrite->rules);
+	}
+
+	/**
+	 * Mainly a copy of the same function in wp-includes\rewrite.php
+     * Adding the NGG tags to each post & page. Never found easier and proper way to handle this with other functions.
+	 *
+	 * @return array the permalink structure
+	 */
+	function generate_rewrite_rules() {
+        global $wp_rewrite;
+
+        $rewrite_rules = array();
+        $permalink_structure =  $wp_rewrite->permalink_structure;
+
+        //get everything up to the first rewrite tag
+		$front = substr($permalink_structure, 0, strpos($permalink_structure, '%'));
+		//build an array of the tags (note that said array ends up being in $tokens[0])
+		preg_match_all('/%.+?%/', $permalink_structure, $tokens);
+
+		$num_tokens = count($tokens[0]);
+
+		$this->index = $wp_rewrite->index; //probably 'index.php'
+
+		//build a list from the rewritecode and queryreplace arrays, that will look something like
+		//tagname=$matches[i] where i is the current $i
+		for ( $i = 0; $i < $num_tokens; ++$i ) {
+			if ( 0 < $i )
+				$queries[$i] = $queries[$i - 1] . '&';
+			else
+				$queries[$i] = '';
+
+			$query_token = str_replace($wp_rewrite->rewritecode, $wp_rewrite->queryreplace, $tokens[0][$i]) . $wp_rewrite->preg_index($i+1);
+			$queries[$i] .= $query_token;
+		}
+
+		//get the structure, minus any cruft (stuff that isn't tags) at the front
+		$structure = $permalink_structure;
+		if ( $front != '/' )
+			$structure = str_replace($front, '', $structure);
+
+		//create a list of dirs to walk over, making rewrite rules for each level
+		//so for example, a $structure of /%year%/%month%/%postname% would create
+		//rewrite rules for /%year%/, /%year%/%month%/ and /%year%/%month%/%postname%
+		$structure = trim($structure, '/');
+
+		//strip slashes from the front of $front
+		$struct = preg_replace('|^/+|', '', $front);
+
+		//get the struct for this dir, and trim slashes off the front
+		$struct .= $structure . '/'; //accumulate. see comment near explode('/', $structure) above
+		$struct = ltrim($struct, '/');
+
+		//replace tags with regexes
+		$match = str_replace($wp_rewrite->rewritecode, $wp_rewrite->rewritereplace, $struct);
+
+		//make a list of tags, and store how many there are in $num_toks
+		$num_toks = preg_match_all('/%.+?%/', $struct, $toks);
+
+		//get the 'tagname=$matches[i]'
+		$query = ( isset($queries) && is_array($queries) ) ? $queries[$num_toks - 1] : '';
+
+        if ( $num_toks ) {
+            // In the case we build for each and every page ( based on a simple %pagename% rule ) the rewrite rules,
+            // we need to add them first, then the post rules
+            if ( $wp_rewrite->use_verbose_page_rules )
+                $rewrite_rules = array_merge ( $this->page_rewrite_rules(), $this->add_rewrite_rules( $match, $query, $num_toks ) );
+            else
+                $rewrite_rules = array_merge ( $this->add_rewrite_rules( $match, $query, $num_toks ), $this->page_rewrite_rules() );
+        }
+
+        return $rewrite_rules;
+	}
+
+	/**
+	 * Retrieve all of the rewrite rules for pages.
+	 *
+	 * If the 'use_verbose_page_rules' property is false, then there will only
+	 * be a single rewrite rule for pages for those matching '%pagename%'. With
+	 * the property set to true, the attachments and the pages will be added for
+	 * each individual attachment URI and page URI, respectively.
+	 *
+	 * @since 1.8.3
+	 * @access public
+	 * @return array
+	 */
+	function page_rewrite_rules() {
+        global $wp_rewrite;
+
+		$rewrite_rules = array();
+
+		if ( ! $wp_rewrite->use_verbose_page_rules ) {
+
+            $rewrite_rules = $this->add_rewrite_rules( "(.+?)/", 'pagename=$matches[1]', 1 );
+    		return $rewrite_rules;
+		}
+
+		$page_uris = $wp_rewrite->page_uri_index();
+		$uris = $page_uris[0];
+
+		if ( is_array( $uris ) ) {
+
+			foreach ( $uris as $uri => $pagename ) {
+                $rewrite_rules = array_merge($rewrite_rules, $this->add_rewrite_rules( "($uri)/", 'pagename=$matches[1]', 1 ) );
+			}
+
+		}
+
+		return $rewrite_rules;
+	}
+
+    /**
+     * Build the final structure of the rewrite rules based on match/query
+     *
+     * @since 1.8.3
+     * @param string $match
+     * @param string $query
+     * @param int $num_toks
+     * @return array
+     */
+    function add_rewrite_rules( $match, $query, $num_toks ) {
+        global $wp_rewrite;
+
+        $rewrite_rules = array();
+
+        foreach ( $this->ngg_rules as $regex => $new_query) {
+
+            // first add your nextgen slug
+            $final_match = $match . $this->slug;
+
+            //add regex parameter
+            $final_match .= $regex;
+            // check how often we found matches fields
+            $count = substr_count($new_query, '[matches]');
+            // we need to know how many tags before
+            $offset = $num_toks;
+            // build the query and count up the matches : tagname=$matches[x]
+            for ( $i = 0; $i < $count; $i++ ) {
+                $new_query = preg_replace('/\[matches\]/', '$matches[' . ++$offset . ']', $new_query, 1);
+            }
+            $final_query = $query . $new_query;
+
+            //close the match and finalise the query
+            $final_match .= '?$';
+            $final_query = $this->index . '?' . $final_query;
+
+            $rewrite_rules = array_merge($rewrite_rules, array($final_match => $final_query));
+
+        }
+
+		return $rewrite_rules;
+    }
+
+}  // of nggRewrite CLASS
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/shortcodes.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/shortcodes.php
new file mode 100644
index 0000000000000000000000000000000000000000..130f2abcd5183bdcaa3d482390851f755bc7f426
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/shortcodes.php
@@ -0,0 +1,141 @@
+<?php
+/**
+ * @author Alex Rabe, Vincent Prat
+ *
+ * @since 1.0.0
+ * @description Use WordPress Shortcode API for more features
+ * @Docs http://codex.wordpress.org/Shortcode_API
+ * @todo This file should be merged into another file
+ */
+
+class NextGEN_shortcodes {
+
+    // register the new shortcodes
+    function NextGEN_shortcodes() {
+
+		// Long posts should require a higher limit, see http://core.trac.wordpress.org/ticket/8553
+        $pcre_limit = 500000;
+        if ((int)ini_get('pcre.backtrack_ limit') < $pcre_limit) {
+            @ini_set('pcre.backtrack_limit', $pcre_limit);
+        }
+
+
+        // convert the old shortcode
+        add_filter('the_content', array(&$this, 'convert_shortcode'));
+
+		// ngglegacy display types use globals. These globals need to be reset
+		// at the start of every loop
+		add_filter('loop_start',  array(&$this, 'reset_globals'));
+    }
+
+	function reset_globals()
+	{
+		unset($GLOBALS['subalbum']);
+		unset($GLOBALS['nggShowGallery']);
+	}
+
+     /**
+       * NextGEN_shortcodes::convert_shortcode()
+       * convert old shortcodes to the new WordPress core style
+       * [gallery=1]  ->> [nggallery id=1]
+       *
+       * @param string $content Content to search for shortcodes
+       * @return string Content with new shortcodes.
+       */
+    function convert_shortcode($content) {
+
+        $ngg_options = nggGallery::get_option('ngg_options');
+
+        if ( stristr( $content, '[singlepic' )) {
+            $search = "@\[singlepic=(\d+)(|,\d+|,)(|,\d+|,)(|,watermark|,web20|,)(|,right|,center|,left|,)\]@i";
+            if (preg_match_all($search, $content, $matches, PREG_SET_ORDER)) {
+
+                foreach ($matches as $match) {
+                    // remove the comma
+                    $match[2] = ltrim($match[2], ',');
+                    $match[3] = ltrim($match[3], ',');
+                    $match[4] = ltrim($match[4], ',');
+                    $match[5] = ltrim($match[5], ',');
+                    $replace = "[singlepic id=\"{$match[1]}\" w=\"{$match[2]}\" h=\"{$match[3]}\" mode=\"{$match[4]}\" float=\"{$match[5]}\" ]";
+                    $content = str_replace ($match[0], $replace, $content);
+                }
+            }
+        }
+
+        if ( stristr( $content, '[album' )) {
+            $search = "@(?:<p>)*\s*\[album\s*=\s*(\w+|^\+)(|,extend|,compact)\]\s*(?:</p>)*@i";
+            if (preg_match_all($search, $content, $matches, PREG_SET_ORDER)) {
+
+                foreach ($matches as $match) {
+                    // remove the comma
+                    $match[2] = ltrim($match[2],',');
+                    $replace = "[album id=\"{$match[1]}\" template=\"{$match[2]}\"]";
+                    $content = str_replace ($match[0], $replace, $content);
+                }
+            }
+        }
+
+        if ( stristr( $content, '[gallery' )) {
+            $search = "@(?:<p>)*\s*\[gallery\s*=\s*(\w+|^\+)\]\s*(?:</p>)*@i";
+            if (preg_match_all($search, $content, $matches, PREG_SET_ORDER)) {
+
+                foreach ($matches as $match) {
+                    $replace = "[nggallery id=\"{$match[1]}\"]";
+                    $content = str_replace ($match[0], $replace, $content);
+                }
+            }
+        }
+
+        if ( stristr( $content, '[imagebrowser' )) {
+            $search = "@(?:<p>)*\s*\[imagebrowser\s*=\s*(\w+|^\+)\]\s*(?:</p>)*@i";
+            if (preg_match_all($search, $content, $matches, PREG_SET_ORDER)) {
+
+                foreach ($matches as $match) {
+                    $replace = "[imagebrowser id=\"{$match[1]}\"]";
+                    $content = str_replace ($match[0], $replace, $content);
+                }
+            }
+        }
+
+        if ( stristr( $content, '[slideshow' )) {
+            $search = "@(?:<p>)*\s*\[slideshow\s*=\s*(\w+|^\+)(|,(\d+)|,)(|,(\d+))\]\s*(?:</p>)*@i";
+            if (preg_match_all($search, $content, $matches, PREG_SET_ORDER)) {
+
+                foreach ($matches as $match) {
+                    // remove the comma
+                    $match[3] = ltrim($match[3],',');
+                    $match[5] = ltrim($match[5],',');
+                    $replace = "[slideshow id=\"{$match[1]}\" w=\"{$match[3]}\" h=\"{$match[5]}\"]";
+                    $content = str_replace ($match[0], $replace, $content);
+                }
+            }
+        }
+
+        if ( stristr( $content, '[tags' )) {
+            $search = "@(?:<p>)*\s*\[tags\s*=\s*(.*?)\s*\]\s*(?:</p>)*@i";
+            if (preg_match_all($search, $content, $matches, PREG_SET_ORDER)) {
+
+                foreach ($matches as $match) {
+                    $replace = "[nggtags gallery=\"{$match[1]}\"]";
+                    $content = str_replace ($match[0], $replace, $content);
+                }
+            }
+        }
+
+        if ( stristr( $content, '[albumtags' )) {
+            $search = "@(?:<p>)*\s*\[albumtags\s*=\s*(.*?)\s*\]\s*(?:</p>)*@i";
+            if (preg_match_all($search, $content, $matches, PREG_SET_ORDER)) {
+
+                foreach ($matches as $match) {
+                    $replace = "[nggtags album=\"{$match[1]}\"]";
+                    $content = str_replace ($match[0], $replace, $content);
+                }
+            }
+        }
+
+        return $content;
+    }
+}
+
+// let's use it
+$nggShortcodes = new NextGEN_Shortcodes;
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/sitemap.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/sitemap.php
new file mode 100644
index 0000000000000000000000000000000000000000..7512e4e8240528b465bff94534ad2c93106d0b30
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/sitemap.php
@@ -0,0 +1,127 @@
+<?php
+/**
+* Main PHP Class for XML Image Sitemaps
+*
+* @author 		Alex Rabe
+* @version      1.0
+* @copyright 	Copyright 2011
+*
+*/
+class nggSitemaps {
+
+    var $images	= array();
+
+    /**
+     * nggSitemaps::__construct()
+     *
+     * @return
+     */
+    function __construct() {
+
+        add_filter('wpseo_sitemap_urlimages', array( &$this, 'add_wpseo_xml_sitemap_images'), 10, 2);
+
+    }
+
+    /**
+     * Filter support for WordPress SEO by Yoast 0.4.0 or higher ( http://wordpress.org/extend/plugins/wordpress-seo/ )
+     *
+     * @since Version 1.8.0
+     * @param array $images
+     * @param int $post ID
+     * @return array $image list of all founded images
+     */
+    function add_wpseo_xml_sitemap_images( $images, $post_id )  {
+
+        $this->images = $images;
+
+        // first get the content of the post/page
+        $p = get_post($post_id);
+
+        // Backward check for older images
+        $p->post_content = NextGEN_Shortcodes::convert_shortcode($p->post_content);
+
+        // Don't process the images in the normal way
+  		remove_all_shortcodes();
+
+        // We cannot parse at this point a album, just galleries & single images
+		C_NextGen_Shortcode_Manager::add( 'singlepic', array(&$this, 'add_images' ) );
+		C_NextGen_Shortcode_Manager::add( 'thumb', array(&$this, 'add_images' ) );
+		C_NextGen_Shortcode_Manager::add( 'nggallery', array(&$this, 'add_gallery') );
+		C_NextGen_Shortcode_Manager::add( 'imagebrowser', array(&$this, 'add_gallery' ) );
+		C_NextGen_Shortcode_Manager::add( 'slideshow', array(&$this, 'add_gallery' ) );
+
+        // Search now for shortcodes
+        do_shortcode( $p->post_content );
+
+        return $this->images;
+    }
+
+    /**
+     * Parse the gallery/imagebrowser/slideshow shortcode and return all images into an array
+     *
+     * @param string $atts
+     * @return
+     */
+    function add_gallery( $atts ) {
+
+        global $wpdb;
+
+        extract(shortcode_atts(array(
+            'id'        => 0
+        ), $atts ));
+
+        // backward compat for user which uses the name instead, still deprecated
+        if( !is_numeric($id) )
+            $id = $wpdb->get_var( $wpdb->prepare ("SELECT gid FROM $wpdb->nggallery WHERE name = '%s' ", $id) );
+
+        $images = nggdb::get_gallery($id, 'pid', 'ASC', true, 1000);
+
+        foreach ($images as $image) {
+            $newimage = array();
+            $newimage['src']   = $newimage['sc'] = $image->imageURL;
+            if ( !empty($image->title) )
+                $newimage['title'] = $image->title;
+            if ( !empty($image->alttext) )
+                $newimage['alt']   = $image->alttext;
+            $this->images[] = $newimage;
+        }
+
+        return '';
+    }
+
+    /**
+     * Parse the single image shortcode and return all images into an array
+     *
+     * @param array $atts
+     * @return
+     */
+    function add_images( $atts ) {
+
+        extract(shortcode_atts(array(
+            'id'        => 0
+        ), $atts ));
+
+        // make an array out of the ids (for thumbs shortcode))
+        $pids = explode( ',', $id );
+
+        // Some error checks
+        if ( count($pids) == 0 )
+            return;
+
+        $images = nggdb::find_images_in_list( $pids );
+
+        foreach ($images as $image) {
+            $newimage = array();
+            $newimage['src']   = $newimage['sc'] = $image->imageURL;
+            if ( !empty($image->title) )
+                $newimage['title'] = $image->title;
+            if ( !empty($image->alttext) )
+                $newimage['alt']   = $image->alttext;
+            $this->images[] = $newimage;
+        }
+
+        return '';
+    }
+
+}
+$nggSitemaps = new nggSitemaps();
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/swfobject.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/swfobject.php
new file mode 100644
index 0000000000000000000000000000000000000000..d01abbb8b9bf2a784ae7b39727d46cf72103efc2
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/swfobject.php
@@ -0,0 +1,195 @@
+<?php
+if ( !class_exists('swfobject') ) :
+/**
+ * swfobject - PHP class for creating dynamic content of SWFObject V2.1
+ * 
+ * @author Alex Rabe
+ * @package NextGEN Gallery
+ * @version 0.6
+ * 
+ * @access public
+ * @example http://code.google.com/p/swfobject/
+ */
+class swfobject {
+	/**
+     * id of the HTML element
+     *
+     * @var string
+     */
+    var $id;
+	/**
+     * specifies the width of your SWF
+     *
+     * @var string
+     * @private
+     */
+    var $width;
+	/**
+     * specifies the height of your SWF
+     *
+     * @var string
+     * @privat
+     */
+    var $height;
+	/**
+     * the javascript output
+     *
+     * @var string
+     */
+    var $js;
+	/**
+     * the replacemnt message
+     *
+     * @var string
+     */
+    var $message = 'The <a href="http://www.macromedia.com/go/getflashplayer">Flash Player</a> and <a href="http://www.mozilla.com/firefox/">a browser with Javascript support</a> are needed..';			
+	/**
+     * the classname for the div element
+     *
+     * @var string
+     */
+    var $classname = 'swfobject';			
+	/**
+     * array of flashvars
+     *
+     * @var array
+     */
+    var $flashvars;
+    /**
+     * array of nested object element params
+     *
+     * @var array
+     */
+    var $params;
+    /**
+     * array of object's attributest
+     *
+     * @var array
+     */
+    var $attributes;
+
+	/**
+	 * swfobject::swfobject()
+	 * 
+	 * @param string $swfUrl (required) specifies the URL of your SWF
+	 * @param string $id (required) specifies the id of the HTML element (containing your alternative content) you would like to have replaced by your Flash content
+	 * @param string $width (required) specifies the width of your SWF
+	 * @param string $height (required) specifies the height of your SWF
+	 * @param string $version (required) specifies the Flash player version your SWF is published for (format is: "major.minor.release")
+	 * @param string $expressInstallSwfurl (optional) specifies the URL of your express install SWF and activates Adobe express install
+	 * @param array $flashvars (optional) specifies your flashvars with name:value pairs
+	 * @param array $params (optional) specifies your nested object element params with name:value pair
+	 * @param array $attributes (optional) specifies your object's attributes with name:value pairs
+	 * @return string the content
+	 */
+	function swfobject( $swfUrl, $id, $width, $height, $version, $expressInstallSwfurl = false, $flashvars = false, $params = false, $attributes = false ) {
+	
+		global $swfCounter;
+		
+		// look for a other swfobject instance
+		if ( !isset($swfCounter) )
+			$swfCounter = 1;
+		
+		$this->id = $id . '_' . $swfCounter;
+		$this->width = $width;
+		$this->height = $height;		
+		
+		$this->flashvars  = ( is_array($flashvars) )  ? $flashvars : array();
+		$this->params     = ( is_array($params) )     ? $params : array();
+		$this->attributes = ( is_array($attributes) ) ? $attributes : array();
+
+		$this->embedSWF = 'swfobject.embedSWF("'. $swfUrl .'", "'. $this->id .'", "'. $width .'", "'. $height .'", "'. $version .'", '. $expressInstallSwfurl .', this.flashvars, this.params , this.attr );' . "\n";
+	}
+	
+	function output () {
+		
+		global $swfCounter;
+		
+		// count up if we have more than one swfobject
+		$swfCounter++;
+		
+		$out  = "\n" . '<div class="'. $this->classname .'" id="'. $this->id  .'" style="width:'.$this->width .'px; height:'. $this->height .'px;">';
+		$out .= "\n" . $this->message;
+		$out .= "\n" . '</div>';
+		
+		return $out;
+	}
+	
+	function javascript () {
+
+		//Build javascript
+		$this->js  = "\nvar " . $this->id  . " = {\n";
+		$this->js .= $this->add_js_parameters('params', $this->params) . ",\n";
+		$this->js .= $this->add_js_parameters('flashvars', $this->flashvars) . ",\n";
+		$this->js .= $this->add_js_parameters('attr', $this->attributes) . ",\n";
+		$this->js .= "\tstart : function() {" . "\n\t\t";
+		$this->js .= $this->embedSWF;
+		$this->js .= "\t}\n}\n";
+		$this->js .= $this->id  . '.start();';
+	
+		return $this->js;
+	}
+	
+	function add_flashvars ( $key, $value, $default = '', $type = '', $prefix = '' ) {
+
+		if ( is_bool( $value ) )
+			$value = ( $value ) ? 'true' : 'false';
+		elseif ( $type == 'bool' )
+			$value = ( $value == '1' ) ? 'true' : 'false';
+		
+		// do not add the variable if we hit the default setting 	
+		if ( $value == $default )	
+			return;
+			
+		$this->flashvars[$key] = $prefix . $value;
+		return;
+	}
+
+	function add_params ( $key, $value, $default = '', $type = '', $prefix = '' ) {
+
+		if ( is_bool( $value ) )
+			$value = ( $value ) ? 'true' : 'false';
+		elseif ( $type == 'bool' )
+			$value = ( $value == '1' ) ? 'true' : 'false';
+		
+		// do not add the variable if we hit the default setting 	
+		if ( $value == $default )	
+			return;
+			
+		$this->params[$key] = $prefix . $value;
+		return;
+	}
+
+	function add_attributes ( $key, $value, $default = '', $type = '', $prefix = '' ) {
+
+		if ( is_bool( $value ) )
+			$value = ( $value ) ? 'true' : 'false';
+		elseif ( $type == 'bool' )
+			$value = ( $value == '1' ) ? 'true' : 'false';
+		
+		// do not add the variable if we hit the default setting 	
+		if ( $value == $default )	
+			return;
+		
+		$this->attributes[$key] = $prefix . $value;
+		return;
+	}
+	
+	function add_js_parameters( $name, $params ) {
+		$list = '';
+		if ( is_array($params) ) {
+			foreach ($params as $key => $value) {
+				if  ( !empty($list) )
+					$list .= ",";
+				if (false === strrpos($key, '.') )		
+					$list .= "\n\t\t" . $key . ' : ' . '"' . $value .'"';
+				else
+					$list .= "\n\t\t'" . $key . '\' : ' . '"' . $value .'"';	
+			}
+		}
+		$js = "\t" . $name . ' : {' . $list . '}';		
+		return $js;		
+	}
+	
+}
+endif;
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/tags.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/tags.php
new file mode 100644
index 0000000000000000000000000000000000000000..d1479158ab4103e22e7f4bf27a22fd903bf56adf
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/tags.php
@@ -0,0 +1,386 @@
+<?php
+
+/**
+* Tag PHP class for the WordPress plugin NextGEN Gallery
+* nggallery.lib.php
+*
+* @author Alex Rabe
+*
+*
+*/
+class nggTags {
+
+	/**
+	 * Copy tags
+	 */
+	function copy_tags($src_pid, $dest_pid) {
+		$tags = wp_get_object_terms( $src_pid, 'ngg_tag', 'fields=ids' );
+		$tags = array_map('intval', $tags);
+		wp_set_object_terms( $dest_pid, $tags, 'ngg_tag', true );
+
+		return implode(',', $tags);
+	}
+
+	/**
+	 * Rename tags
+	 */
+	function rename_tags($old = '', $new = '') {
+
+		$return_value = array(
+			'status' => 'ok',
+			'message' => ''
+		);
+
+		if ( trim( str_replace(',', '', stripslashes($new)) ) == '' ) {
+			$return_value['message'] = __('No new tag specified!', 'nggallery');
+			$return_value['status'] = 'error';
+			return $return_value;
+		}
+
+		// String to array
+		$old_tags = explode(',', $old);
+		$new_tags = explode(',', $new);
+
+		// Remove empty element and trim
+		$old_tags = array_filter($old_tags, 'nggtags_delete_empty_element');
+		$new_tags = array_filter($new_tags, 'nggtags_delete_empty_element');
+
+		// If old/new tag are empty => exit !
+		if ( empty($old_tags) || empty($new_tags) ) {
+			$return_value['message'] = __('No new/old valid tag specified!', 'nggallery');
+			$return_value['status'] = 'error';
+			return $return_value;
+		}
+
+		$counter = 0;
+		if( count($old_tags) == count($new_tags) ) { // Rename only
+			foreach ( (array) $old_tags as $i => $old_tag ) {
+				$new_name = $new_tags[$i];
+
+				// Get term by name
+				$term = get_term_by('name', $old_tag, 'ngg_tag');
+				if ( !$term ) {
+					continue;
+				}
+
+				// Get objects from term ID
+				$objects_id = get_objects_in_term( $term->term_id, 'ngg_tag', array('fields' => 'all_with_object_id'));
+
+				// Delete old term
+				wp_delete_term( $term->term_id, 'ngg_tag' );
+
+				// Set objects to new term ! (Append no replace)
+				foreach ( (array) $objects_id as $object_id ) {
+					wp_set_object_terms( $object_id, $new_name, 'ngg_tag', true );
+				}
+
+				// Clean cache
+				clean_object_term_cache( $objects_id, 'ngg_tag');
+				clean_term_cache($term->term_id, 'ngg_tag');
+
+				// Increment
+				$counter++;
+			}
+
+			if ( $counter == 0  ) {
+				$return_value['message'] = __('No tag renamed.', 'nggallery');
+			} else {
+				$return_value['message'] = sprintf(__('Renamed tag(s) &laquo;%1$s&raquo; to &laquo;%2$s&raquo;', 'nggallery'), $old, $new);
+			}
+		}
+		elseif ( count($new_tags) == 1  ) { // Merge
+			// Set new tag
+			$new_tag = $new_tags[0];
+			if ( empty($new_tag) ) {
+				$return_value['message'] = __('No valid new tag.', 'nggallery');
+				$return_value['status'] = 'error';
+				return $return_value;
+			}
+
+			// Get terms ID from old terms names
+			$terms_id = array();
+			foreach ( (array) $old_tags as $old_tag ) {
+				$term = get_term_by('name', addslashes($old_tag), 'ngg_tag');
+				$terms_id[] = (int) $term->term_id;
+			}
+
+			// Get objects from terms ID
+			$objects_id = get_objects_in_term( $terms_id, 'ngg_tag', array('fields' => 'all_with_object_id'));
+
+			// No objects ? exit !
+			if ( !$objects_id ) {
+				$return_value['message'] = __('No objects (post/page) found for specified old tags.', 'nggallery');
+				$return_value['status'] = 'error';
+				return $return_value;
+			}
+
+			// Delete old terms
+			foreach ( (array) $terms_id as $term_id ) {
+				wp_delete_term( $term_id, 'ngg_tag' );
+			}
+
+			// Set objects to new term ! (Append no replace)
+			foreach ( (array) $objects_id as $object_id ) {
+				wp_set_object_terms( $object_id, $new_tag, 'ngg_tag', true );
+				$counter++;
+			}
+
+			// Test if term is also a category
+			if ( term_exists($new_tag, 'category') ) {
+				// Edit the slug to use the new term
+				$slug = sanitize_title($new_tag);
+				nggTags::edit_tag_slug( $new_tag, $slug );
+				unset($slug);
+			}
+
+			// Clean cache
+			clean_object_term_cache( $objects_id, 'ngg_tag');
+			clean_term_cache($terms_id, 'ngg_tag');
+
+			if ( $counter == 0  ) {
+				$return_value['message'] = __('No tag merged.', 'nggallery');
+			} else {
+				$return_value['message'] = sprintf(__('Merge tag(s) &laquo;%1$s&raquo; to &laquo;%2$s&raquo;. %3$s objects edited.', 'nggallery'), $old, $new, $counter);
+			}
+		} else { // Error
+			$return_value['message'] = sprintf(__('Error. No enough tags for rename. Too for merge. Choose !', 'nggallery'), $old);
+			$return_value['status'] = 'error';
+		}
+
+        do_action('ngg_manage_tags', $new_tags);
+
+		return $return_value;
+	}
+
+	/**
+	 * Delete tags
+	 */
+	function delete_tags($delete) {
+		$return_value = array(
+			'status' => 'ok',
+			'message' => ''
+		);
+
+		if ( trim( str_replace(',', '', stripslashes($delete)) ) == '' ) {
+			$return_value['message'] = __('No tag specified!', 'nggallery');
+			$return_value['status'] = 'error';
+			return $return_value;
+		}
+
+		// In array + filter
+		$delete_tags = explode(',', $delete);
+		$delete_tags = array_filter($delete_tags, 'nggtags_delete_empty_element');
+
+		// Delete tags
+		$counter = 0;
+		foreach ( (array) $delete_tags as $tag ) {
+			$term = get_term_by('name', $tag, 'ngg_tag');
+			$term_id = (int) $term->term_id;
+
+			if ( $term_id != 0 ) {
+				wp_delete_term( $term_id, 'ngg_tag');
+				clean_term_cache( $term_id, 'ngg_tag');
+				$counter++;
+			}
+		}
+
+		if ( $counter == 0  ) {
+			$return_value['message'] = __('No tag deleted.', 'nggallery');
+		} else {
+			$return_value['message'] = sprintf(__('%1s tag(s) deleted.', 'nggallery'), $counter);
+		}
+
+        do_action('ngg_manage_tags', $delete_tags);
+	}
+
+	/**
+	 * Edit tag slug given the name of the tag
+	 */
+	function edit_tag_slug( $names = '', $slugs = '' ) {
+		$return_value = array(
+			'status' => 'ok',
+			'message' => ''
+		);
+
+		if ( trim( str_replace(',', '', stripslashes($slugs)) ) == '' ) {
+			$return_value['message'] = __('No new slug(s) specified!', 'nggallery');
+			$return_value['status'] = 'error';
+			return $return_value;
+		}
+
+		$match_names = explode(',', $names);
+		$new_slugs = explode(',', $slugs);
+
+		$match_names = array_filter($match_names, 'nggtags_delete_empty_element');
+		$new_slugs = array_filter($new_slugs, 'nggtags_delete_empty_element');
+
+		if ( count($match_names) != count($new_slugs) ) {
+			$return_value['message'] = __('Tags number and slugs number isn\'t the same!', 'nggallery');
+			$return_value['status'] = 'error';
+			return $return_value;
+		} else {
+			$counter = 0;
+			foreach ( (array) $match_names as $i => $match_name ) {
+				// Sanitize slug + Escape
+				$new_slug = sanitize_title($new_slugs[$i]);
+
+				// Get term by name
+				$term = get_term_by('name', $match_name, 'ngg_tag');
+				if ( !$term ) {
+					continue;
+				}
+
+				// Increment
+				$counter++;
+
+				// Update term
+				wp_update_term($term->term_id, 'ngg_tag', array('slug' => $new_slug));
+
+				// Clean cache
+				clean_term_cache($term->term_id, 'ngg_tag');
+			}
+		}
+
+		if ( $counter == 0  ) {
+			$return_value['message'] = __('No slug edited.', 'nggallery');
+		} else {
+			$return_value['message'] = sprintf(__('%s slug(s) edited.', 'nggallery'), $counter);
+		}
+
+		return $return_value;
+	}
+
+	/**
+	 * Get a list of the tags used by the images
+	 */
+	function find_all_tags() {
+		return get_terms('ngg_tag', '');
+	}
+
+	/**
+	 *
+	 */
+	function find_tags( $args = '', $skip_cache = false ) {
+		$taxonomy = 'ngg_tag';
+
+		if ( $skip_cache == true ) {
+			$terms = get_terms( $taxonomy, $args );
+		} else {
+			$key = md5(serialize($args));
+
+			// Get cache if exist
+			//--
+			if ( $cache = wp_cache_get( 'ngg_get_tags', 'nggallery' ) ) {
+				if ( isset( $cache[$key] ) ) {
+					return apply_filters('get_tags', $cache[$key], $args);
+				}
+			}
+
+			// Get tags
+			//--
+			$terms = get_terms( $taxonomy, $args );
+			if ( empty($terms) ) {
+				return array();
+			}
+
+			$cache[$key] = $terms;
+			wp_cache_set( 'ngg_get_tags', $cache, 'nggallery' );
+		}
+
+		$terms = apply_filters('get_tags', $terms, $args);
+		return $terms;
+	}
+
+	/**
+	* Get images corresponding to a list of tags
+	*/
+	/**
+	 * nggTags::find_images_for_tags()
+	 *
+	 * @param mixed $taglist
+	 * @param string $mode could be 'ASC' or 'RAND'
+	 * @return array of images
+	 */
+	function find_images_for_tags($taglist, $mode = "ASC") {
+		// return the images based on the tag
+		global $wpdb;
+
+		// extract it into a array
+		$taglist = explode(",", $taglist);
+
+		if ( !is_array($taglist) )
+			$taglist = array($taglist);
+
+		$taglist = array_map('trim', $taglist);
+		$new_slugarray = array_map('sanitize_title', $taglist);
+		$sluglist   = "'" . implode("', '", $new_slugarray) . "'";
+
+		//Treat % as a litteral in the database, for unicode support
+		$sluglist=str_replace("%","%%",$sluglist);
+
+		// first get all $term_ids with this tag
+		$term_ids = $wpdb->get_col( $wpdb->prepare("SELECT term_id FROM $wpdb->terms WHERE slug IN ($sluglist) ORDER BY term_id ASC ", NULL));
+		$picids = get_objects_in_term($term_ids, 'ngg_tag');
+
+		//Now lookup in the database
+		if ($mode == 'RAND')
+			$pictures = nggdb::find_images_in_list($picids, true, 'RAND' );
+		else
+			$pictures = nggdb::find_images_in_list($picids, true, 'ASC');
+
+		return $pictures;
+	}
+
+	/**
+	* Return one image based on the tag. Required for a tag based album overview
+	*/
+	function get_album_images($taglist) {
+		global $wpdb;
+
+		$taxonomy = 'ngg_tag';
+
+		// extract it into a array
+		$taglist = explode(',', $taglist);
+
+		if (!is_array($taglist)) {
+			$taglist = array($taglist);
+		}
+
+		$taglist = array_map('trim', $taglist);
+		$slugarray = array_map('sanitize_title', $taglist);
+		$slugarray = array_unique($slugarray);
+
+		$picarray = array();
+
+		foreach($slugarray as $slug) {
+			// get random picture of tag
+			$tsql  = "SELECT p.*, g.*, t.*, tt.* FROM $wpdb->term_relationships AS tr";
+			$tsql .= " INNER JOIN $wpdb->nggpictures AS p ON (tr.object_id = p.pid)";
+			$tsql .= " INNER JOIN $wpdb->nggallery AS g ON (g.gid = p.galleryid)";
+			$tsql .= " INNER JOIN $wpdb->term_taxonomy AS tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id)";
+			$tsql .= " INNER JOIN $wpdb->terms AS t ON (tt.term_id = t.term_id)";
+			$tsql .= " WHERE tt.taxonomy = '$taxonomy' AND t.slug = '$slug' ORDER BY rand() limit 1 ";
+			$pic_data = $wpdb->get_row($tsql, OBJECT);
+
+			if ($pic_data) $picarray[] = $pic_data;
+		}
+
+		return $picarray;
+	}
+}
+
+/**
+ * trim and remove empty element
+ *
+ * @param string $element
+ * @return string
+ */
+if (!function_exists('nggtags_delete_empty_element')) {
+	function nggtags_delete_empty_element( &$element ) {
+		$element = stripslashes($element);
+		$element = trim($element);
+		if ( !empty($element) ) {
+			return $element;
+		}
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/module.ngglegacy.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/module.ngglegacy.php
new file mode 100644
index 0000000000000000000000000000000000000000..710edb760dc915299c4aa807cc607b45c4f1b3d3
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/module.ngglegacy.php
@@ -0,0 +1,51 @@
+<?php
+
+/***
+	{
+		Module: photocrati-nextgen-legacy
+	}
+ ***/
+
+define(
+	'NEXTGEN_GALLERY_NGGLEGACY_MOD_DIR',
+	path_join(NEXTGEN_GALLERY_MODULE_DIR, basename(dirname(__FILE__)))
+);
+
+define(
+	'NEXTGEN_GALLERY_NGGLEGACY_MOD_URL',
+	path_join(NEXTGEN_GALLERY_MODULE_URL, basename(dirname(__FILE__)))
+);
+
+class M_NggLegacy extends C_Base_Module
+{
+	function define()
+	{
+		parent::define(
+			'photocrati-nextgen-legacy',
+			'NextGEN Legacy',
+			'Embeds the original version of NextGEN 1.9.3 by Alex Rabe',
+			'0.2',
+			'http://www.nextgen-gallery.com',
+			'Photocrati Media',
+			'http://www.photocrati.com'
+		);
+
+		include_once('class.ngglegacy_installer.php');
+		C_Photocrati_Installer::add_handler($this->module_id, 'C_NggLegacy_Installer');
+	}
+
+	function initialize()
+	{
+		parent::initialize();
+		include_once(path_join(dirname(__FILE__), 'nggallery.php'));
+	}
+
+	function get_type_list()
+	{
+		return array(
+			'C_NggLegacy_Installer' => 'class.ngglegacy_installer.php'
+		);
+	}
+}
+
+new M_NggLegacy();
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/ngg-config.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/ngg-config.php
new file mode 100644
index 0000000000000000000000000000000000000000..8ef1a1a46b1f4495da54b551ef069e3adbd82673
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/ngg-config.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Bootstrap file for getting the ABSPATH constant to wp-load.php
+ * This is requried when a plugin requires access not via the admin screen.
+ *
+ * If the wp-load.php file is not found, then an error will be displayed
+ *
+ * @package WordPress
+ * @since Version 2.6
+ */
+
+/** Define the server path to the file wp-config here, if you placed WP-CONTENT outside the classic file structure */
+
+$path  = ''; // It should be end with a trailing slash
+
+/** That's all, stop editing from here **/
+
+if ( !defined('WP_LOAD_PATH') ) {
+
+	// classic root path if wp-content and plugins is below wp-config.php
+	$legacy_root = dirname(dirname(dirname(dirname(__FILE__)))) . '/' ;
+
+	// root path when ngglegacy is embedded as a Pope module
+	$pope_root = dirname(dirname(dirname(dirname($legacy_root)))) . '/';
+
+	if (file_exists( $legacy_root . 'wp-load.php') )
+		define( 'WP_LOAD_PATH', $legacy_root);
+	elseif (file_exists( $pope_root.'wp-load.php' ) )
+		define( 'WP_LOAD_PATH', $pope_root );
+	else
+		if (file_exists( $path . 'wp-load.php') )
+			define( 'WP_LOAD_PATH', $path);
+		else
+			throw new RuntimeException("Could not find wp-load.php");
+}
+
+// let's load WordPress
+require_once( WP_LOAD_PATH . 'wp-load.php');
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/nggallery.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/nggallery.php
new file mode 100644
index 0000000000000000000000000000000000000000..ae66f6f71888f6e3ec2e7f65b946274b104ad460
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/nggallery.php
@@ -0,0 +1,455 @@
+<?php
+
+// Stop direct call
+if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
+
+/**
+ * Loads the NextGEN plugin
+ */
+if (!class_exists('nggLoader')) {
+	class nggLoader {
+
+		var $version     = NEXTGEN_GALLERY_PLUGIN_VERSION;
+		var $dbversion   = '1.8.1';
+		var $minimum_WP  = '3.6';
+		var $donators    = 'http://www.nextgen-gallery.com/donators.php';
+		var $options     = '';
+		var $manage_page;
+		var $add_PHP5_notice = false;
+		var $plugin_name = '';
+
+		function nggLoader() {
+
+			// Stop the plugin if we missed the requirements
+			if ( ( !$this->required_version() ) || ( !$this->check_memory_limit() ) )
+				return;
+
+			// Determine plugin basename based on whether NGG is being used in
+			// it's legacy form, or as a Photocrati Gallery
+			if (defined('NEXTGEN_GALLERY_PLUGIN_BASENAME')) $this->plugin_name = NEXTGEN_GALLERY_PLUGIN_BASENAME;
+			else $this->plugin_name = basename(dirname(__FILE__)).'/'.basename(__FILE__);
+
+			// Get some constants first
+			$this->load_options();
+			$this->define_constant();
+			$this->define_tables();
+			$this->load_dependencies();
+			$this->start_rewrite_module();
+
+			// Init options & tables during activation & deregister init option
+			register_activation_hook( $this->plugin_name, array(&$this, 'activate') );
+			register_deactivation_hook( $this->plugin_name, array(&$this, 'deactivate') );
+
+			// Register a uninstall hook to remove all tables & option automatic
+			register_uninstall_hook( $this->plugin_name, array(__CLASS__, 'uninstall') );
+
+			// Start this plugin once all other plugins are fully loaded
+			add_action( 'plugins_loaded', array(&$this, 'start_plugin') );
+
+			// Register_taxonomy must be used during the init
+			add_action( 'init', array(&$this, 'register_taxonomy') );
+			add_action( 'wpmu_new_blog', array(&$this, 'multisite_new_blog'), 10, 6);
+
+			// Add a message for PHP4 Users, can disable the update message later on
+			if (version_compare(PHP_VERSION, '5.0.0', '<'))
+				add_filter('transient_update_plugins', array(&$this, 'disable_upgrade'));
+
+			//Add some links on the plugin page
+			add_filter('plugin_row_meta', array(&$this, 'add_plugin_links'), 10, 2);
+
+			// Check for the header / footer
+			add_action( 'init', array(&$this, 'test_head_footer_init' ) );
+
+			// Show NextGEN version in header
+			add_action('wp_head', array('nggGallery', 'nextgen_version') );
+		}
+
+		function start_plugin() {
+
+			global $nggRewrite;
+
+			// Load the language file
+			$this->load_textdomain();
+
+			// All credits to the tranlator
+			$this->translator  = '<p class="hint">'. __('<strong>Translation by : </strong><a target="_blank" href="http://alexrabe.de/wordpress-plugins/nextgen-gallery/languages/">See here</a>', 'nggallery') . '</p>';
+			$this->translator .= '<p class="hint">'. __('<strong>This translation is not yet updated for Version 1.9.0</strong>. If you would like to help with translation, download the current po from the plugin folder and read <a href="http://alexrabe.de/wordpress-plugins/wordtube/translation-of-plugins/">here</a> how you can translate the plugin.', 'nggallery') . '</p>';
+
+			// Content Filters
+			add_filter('ngg_gallery_name', 'sanitize_title');
+
+			// Check if we are in the admin area
+			if ( is_admin() ) {
+
+				// Pass the init check or show a message
+				if (get_option( 'ngg_init_check' ) != false )
+					add_action( 'admin_notices', create_function('', 'echo \'<div id="message" class="error"><p><strong>' . get_option( "ngg_init_check" ) . '</strong></p></div>\';') );
+
+			} else {
+
+				// Add MRSS to wp_head
+				if ( $this->options['useMediaRSS'] )
+					add_action('wp_head', array('nggMediaRss', 'add_mrss_alternate_link'));
+
+				// Look for XML request, before page is render
+				add_action('parse_request',  array(&$this, 'check_request') );
+
+			}
+		}
+
+        /**
+         * Checks the 'callback' parameter for possible ajax-like actions to take
+         *
+         * @param $wp
+         */
+        function check_request($wp)
+        {
+            $app = C_Component_Registry::get_instance()->get_utility('I_Router')->get_routed_app();
+
+			if (!$app->get_parameter('callback'))
+                return;
+
+            switch ($app->get_parameter('callback')) {
+                case 'imagerotator':
+                    require_once (dirname (__FILE__) . '/xml/imagerotator.php');
+                    break;
+                case 'json':
+                    require_once (dirname (__FILE__) . '/xml/json.php');
+                    break;
+                case 'image':
+                    require_once (dirname (__FILE__) . '/nggshow.php');
+                    break;
+                default:
+                    return;
+            }
+			C_NextGEN_Bootstrap::shutdown();
+		}
+
+		function required_version() {
+
+			global $wp_version;
+
+			// Check for WP version installation
+			$wp_ok  =  version_compare($wp_version, $this->minimum_WP, '>=');
+
+			if ( ($wp_ok == FALSE) ) {
+				add_action(
+					'admin_notices',
+					create_function(
+						'',
+						'global $ngg; printf (\'<div id="message" class="error"><p><strong>\' . __(\'Sorry, NextGEN Gallery works only under WordPress %s or higher\', "nggallery" ) . \'</strong></p></div>\', $ngg->minimum_WP );'
+					)
+				);
+				return false;
+			}
+
+			return true;
+
+		}
+
+		function check_memory_limit() {
+
+			// get the real memory limit before some increase it
+			$this->memory_limit = ini_get('memory_limit');
+
+			// PHP docs : Note that to have no memory limit, set this directive to -1.
+			if ($this->memory_limit == -1 ) return true;
+
+			// Yes, we reached Gigabyte limits, so check if it's a megabyte limit
+			if (strtolower( substr($this->memory_limit, -1) ) == 'm') {
+
+				$this->memory_limit = (int) substr( $this->memory_limit, 0, -1);
+
+				//This works only with enough memory, 16MB is silly, wordpress requires already 16MB :-)
+				if ( ($this->memory_limit != 0) && ($this->memory_limit < 16 ) ) {
+					add_action(
+						'admin_notices',
+						create_function(
+							'',
+							'echo \'<div id="message" class="error"><p><strong>' . __('Sorry, NextGEN Gallery works only with a Memory Limit of 16 MB or higher', 'nggallery') . '</strong></p></div>\';'
+						)
+					);
+					return false;
+				}
+			}
+
+			return true;
+
+		}
+
+		function define_tables() {
+			global $wpdb;
+
+			// add database pointer
+			$wpdb->nggpictures					= $wpdb->prefix . 'ngg_pictures';
+			$wpdb->nggallery					= $wpdb->prefix . 'ngg_gallery';
+			$wpdb->nggalbum						= $wpdb->prefix . 'ngg_album';
+
+		}
+
+		function register_taxonomy() {
+			global $wp_rewrite;
+
+			// Register the NextGEN taxonomy
+			$args = array(
+					'label' => __('Picture tag', 'nggallery'),
+					'template' => __('Picture tag: %2$l.', 'nggallery'),
+					'helps' => __('Separate picture tags with commas.', 'nggallery'),
+					'sort' => true,
+					'args' => array('orderby' => 'term_order')
+					);
+
+			register_taxonomy( 'ngg_tag', 'nggallery', $args );
+		}
+
+		function define_constant() {
+
+			global $wp_version;
+
+			//TODO:SHOULD BE REMOVED LATER
+			define('NGGVERSION', $this->version);
+			// Minimum required database version
+			define('NGG_DBVERSION', $this->dbversion);
+
+			// required for Windows & XAMPP
+			define('WINABSPATH', str_replace("\\", "/", ABSPATH) );
+
+			// define URL
+			define('NGGFOLDER', dirname( $this->plugin_name ) );
+
+			define(
+				'NGGALLERY_ABSPATH',
+				defined('NEXTGEN_GALLERY_NGGLEGACY_MOD_DIR') ?
+					trailingslashit(NEXTGEN_GALLERY_NGGLEGACY_MOD_DIR) :
+					trailingslashit(dirname(__FILE__))
+			);
+
+			define(
+				'NGGALLERY_URLPATH',
+				defined('NEXTGEN_GALLERY_NGGLEGACY_MOD_URL') ?
+					trailingslashit(NEXTGEN_GALLERY_NGGLEGACY_MOD_URL) :
+					trailingslashit( plugins_url( NGGFOLDER ) )
+			);
+
+			// look for imagerotator
+			define('NGGALLERY_IREXIST', !empty( $this->options['irURL'] ));
+
+			// get value for safe mode
+			if ( (gettype( ini_get('safe_mode') ) == 'string') ) {
+				// if sever did in in a other way
+				if ( ini_get('safe_mode') == 'off' ) define('SAFE_MODE', FALSE);
+				else define( 'SAFE_MODE', ini_get('safe_mode') );
+			} else
+			define( 'SAFE_MODE', ini_get('safe_mode') );
+
+			if ( version_compare($wp_version, '3.2.999', '>') )
+				define('IS_WP_3_3', TRUE);
+
+		}
+
+		function load_dependencies() {
+
+			// Load global libraries												// average memory usage (in bytes)
+			require_once (dirname (__FILE__) . '/lib/core.php');					//  94.840
+			require_once (dirname (__FILE__) . '/lib/class.ngg_serializable.php');					//  94.840
+			require_once (dirname (__FILE__) . '/lib/ngg-db.php');					// 132.400
+			require_once (dirname (__FILE__) . '/lib/image.php');					//  59.424
+			require_once (dirname (__FILE__) . '/lib/tags.php');				    // 117.136
+			require_once (dirname (__FILE__) . '/lib/post-thumbnail.php');			//  n.a.
+			require_once (dirname (__FILE__) . '/lib/multisite.php');
+			require_once (dirname (__FILE__) . '/lib/sitemap.php');
+
+			// Load frontend libraries
+			require_once (dirname (__FILE__) . '/lib/navigation.php');		        // 242.016
+			require_once (dirname (__FILE__) . '/nggfunctions.php');		        // n.a.
+			require_once (dirname (__FILE__) . '/lib/shortcodes.php'); 		        // 92.664
+
+			// We didn't need all stuff during a AJAX operation
+			if ( defined('DOING_AJAX') )
+				require_once (dirname (__FILE__) . '/admin/ajax.php');
+			else {
+				require_once (dirname (__FILE__) . '/lib/meta.php');				// 131.856
+				require_once (dirname (__FILE__) . '/lib/media-rss.php');			//  82.768
+				require_once (dirname (__FILE__) . '/lib/rewrite.php');				//  71.936
+
+				// Load backend libraries
+				if ( is_admin() ) {
+					require_once (dirname (__FILE__) . '/admin/admin.php');
+					require_once (dirname (__FILE__) . '/admin/media-upload.php');
+					$this->nggAdminPanel = new nggAdminPanel();
+				}
+			}
+		}
+
+		function load_textdomain() {
+
+			load_plugin_textdomain('nggallery', false, NGGFOLDER . '/lang');
+
+		}
+
+		function load_thickbox_images() {
+			// WP core reference relative to the images. Bad idea
+			echo "\n" . '<script type="text/javascript">tb_pathToImage = "' . site_url() . '/wp-includes/js/thickbox/loadingAnimation.gif";tb_closeImage = "' . site_url() . '/wp-includes/js/thickbox/tb-close.png";</script>'. "\n";
+		}
+
+		function load_options() {
+			// Load the options
+			$this->options = get_option('ngg_options');
+		}
+
+		// Add rewrite rules
+		function start_rewrite_module() {
+			// global $nggRewrite;
+			// if (class_exists('nggRewrite'))
+			//	$nggRewrite = new nggRewrite();
+		}
+
+		// THX to Shiba for the code
+		// See: http://shibashake.com/wordpress-theme/write-a-plugin-for-wordpress-multi-site
+		function multisite_new_blog($blog_id, $user_id, $domain, $path, $site_id, $meta ) {
+			global $wpdb;
+
+			include_once (dirname (__FILE__) . '/admin/install.php');
+
+			if (is_plugin_active_for_network( $this->plugin_name )) {
+				$current_blog = $wpdb->blogid;
+				switch_to_blog($blog_id);
+				nggallery_install();
+				switch_to_blog($current_blog);
+			}
+		}
+
+		/**
+		 * Removes all transients created by NextGEN. Called during activation
+		 * and deactivation routines
+		 */
+		static function remove_transients()
+		{
+			global $wpdb, $_wp_using_ext_object_cache;
+
+			// Fetch all transients
+			$query = "
+				SELECT option_name FROM {$wpdb->options}
+				WHERE option_name LIKE '%ngg_request%'
+			";
+			$transient_names = $wpdb->get_col($query);;
+
+			// Delete all transients in the database
+			$query = "
+				DELETE FROM {$wpdb->options}
+				WHERE option_name LIKE '%ngg_request%'
+			";
+			$wpdb->query($query);
+
+			// If using an external caching mechanism, delete the cached items
+			if ($_wp_using_ext_object_cache) {
+				foreach ($transient_names as $transient) {
+					wp_cache_delete($transient, 'transient');
+					wp_cache_delete(substr($transient, 11), 'transient');
+				}
+			}
+		}
+
+		function activate() {
+			global $wpdb;
+			//Starting from version 1.8.0 it's works only with PHP5.2
+			if (version_compare(PHP_VERSION, '5.2.0', '<')) {
+					deactivate_plugins($this->plugin_name); // Deactivate ourself
+					wp_die("Sorry, but you can't run this plugin, it requires PHP 5.2 or higher.");
+					return;
+			}
+
+			// Clean up transients
+			self::remove_transients();
+
+			include_once (dirname (__FILE__) . '/admin/install.php');
+
+			if (is_multisite()) {
+				$network=isset($_SERVER['SCRIPT_NAME'])?$_SERVER['SCRIPT_NAME']:"";
+				$activate=isset($_GET['action'])?$_GET['action']:"";
+				$isNetwork=($network=='/wp-admin/network/plugins.php')?true:false;
+				$isActivation=($activate=='deactivate')?false:true;
+
+				if ($isNetwork and $isActivation){
+					$old_blog = $wpdb->blogid;
+					$blogids = $wpdb->get_col($wpdb->prepare("SELECT blog_id FROM $wpdb->blogs", NULL));
+					foreach ($blogids as $blog_id) {
+						switch_to_blog($blog_id);
+						nggallery_install();
+					}
+					switch_to_blog($old_blog);
+					return;
+				}
+			}
+
+			// check for tables
+			nggallery_install();
+			// remove the update message
+			delete_option( 'ngg_update_exists' );
+
+		}
+
+		function deactivate() {
+
+			// remove & reset the init check option
+			delete_option( 'ngg_init_check' );
+			delete_option( 'ngg_update_exists' );
+
+			// Clean up transients
+			self::remove_transients();
+		}
+
+		function uninstall() {
+			// Clean up transients
+			self::remove_transients();
+
+			include_once (dirname (__FILE__) . '/admin/install.php');
+			nggallery_uninstall();
+		}
+
+		function disable_upgrade($option){
+
+			// PHP5.2 is required for NGG V1.4.0
+			if ( version_compare($option->response[ $this->plugin_name ]->new_version, '1.4.0', '>=') )
+				return $option;
+
+			if( isset($option->response[ $this->plugin_name ]) ){
+				//Clear it''s download link
+				$option->response[ $this->plugin_name ]->package = '';
+
+				//Add a notice message
+				if ($this->add_PHP5_notice == false){
+					add_action( "in_plugin_update_message-$this->plugin_name", create_function('', 'echo \'<br /><span style="color:red">Please update to PHP5.2 as soon as possible, the plugin is not tested under PHP4 anymore</span>\';') );
+					$this->add_PHP5_notice = true;
+				}
+			}
+			return $option;
+		}
+
+		// Add links to Plugins page
+		function add_plugin_links($links, $file) {
+
+			if ( $file == $this->plugin_name ) {
+				$links[] = '<a href="http://wordpress.org/support/plugin/nextgen-gallery">' . __('Get help', 'nggallery') . '</a>';
+				$links[] = '<a href="https://bitbucket.org/photocrati/nextgen-gallery">' . __('Contribute', 'nggallery') . '</a>';
+			}
+			return $links;
+		}
+
+		// Check for the header / footer, parts taken from Matt Martz (http://sivel.net/)
+		function test_head_footer_init() {
+
+			// If test-head query var exists hook into wp_head
+			if ( isset( $_GET['test-head'] ) )
+				add_action( 'wp_head', create_function('', 'echo \'<!--wp_head-->\';'), 99999 );
+
+			// If test-footer query var exists hook into wp_footer
+			if ( isset( $_GET['test-footer'] ) )
+				add_action( 'wp_footer', create_function('', 'echo \'<!--wp_footer-->\';'), 99999 );
+		}
+	}
+
+	// Let's start the holy plugin
+	global $ngg;
+	$ngg = new nggLoader();
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/nggfunctions.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/nggfunctions.php
new file mode 100644
index 0000000000000000000000000000000000000000..0a548492dd313ba56f7693c393232acec34a7805
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/nggfunctions.php
@@ -0,0 +1,288 @@
+<?php
+
+if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
+
+/**
+ * nggShowImageBrowser()
+ *
+ * @access public
+ * @param int|string $galleryID or gallery name
+ * @param string $template (optional) name for a template file, look for imagebrowser-$template
+ * @return the content
+ */
+function nggShowImageBrowser($galleryID, $template = '') {
+
+    global $wpdb;
+
+    $ngg_options = nggGallery::get_option('ngg_options');
+
+    //Set sort order value, if not used (upgrade issue)
+    $ngg_options['galSort'] = ($ngg_options['galSort']) ? $ngg_options['galSort'] : 'pid';
+    $ngg_options['galSortDir'] = ($ngg_options['galSortDir'] == 'DESC') ? 'DESC' : 'ASC';
+
+    // get the pictures
+    $picturelist = nggdb::get_gallery($galleryID, $ngg_options['galSort'], $ngg_options['galSortDir']);
+
+    if ( is_array($picturelist) )
+        $out = nggCreateImageBrowser($picturelist, $template);
+    else
+        $out = __('[Gallery not found]','nggallery');
+
+    $out = apply_filters('ngg_show_imagebrowser_content', $out, $galleryID);
+
+    return $out;
+
+}
+
+/**
+ * nggCreateImageBrowser()
+ *
+ * @access internal
+ * @param array $picturelist
+ * @param string $template (optional) name for a template file, look for imagebrowser-$template
+ * @return the content
+ */
+function nggCreateImageBrowser($picturelist, $template = '') {
+
+    global $nggRewrite, $ngg;
+
+    require_once( dirname (__FILE__) . '/lib/meta.php' );
+
+    // $_GET from wp_query
+    $pid  = get_query_var('pid');
+
+    // we need to know the current page id
+    $current_page = (get_the_ID() == false) ? 0 : get_the_ID();
+
+    // create a array with id's for better walk inside
+    foreach ($picturelist as $picture)
+        $picarray[] = $picture->pid;
+
+    $total = count($picarray);
+
+    if ( !empty( $pid )) {
+        if ( is_numeric($pid) )
+            $act_pid = intval($pid);
+        else {
+            // in the case it's a slug we need to search for the pid
+            foreach ($picturelist as $key => $picture) {
+                if ($picture->image_slug == $pid) {
+                    $act_pid = $key;
+                    break;
+                }
+            }
+        }
+    } else {
+        reset($picarray);
+        $act_pid = current($picarray);
+    }
+
+    // get ids for back/next
+    $key = array_search($act_pid, $picarray);
+    if (!$key) {
+        $act_pid = reset($picarray);
+        $key = key($picarray);
+    }
+    $back_pid = ( $key >= 1 ) ? $picarray[$key-1] : end($picarray) ;
+    $next_pid = ( $key < ($total-1) ) ? $picarray[$key+1] : reset($picarray) ;
+
+    // get the picture data
+    $picture = nggdb::find_image($act_pid);
+
+    // if we didn't get some data, exit now
+    if ($picture == null)
+        return;
+
+    // add more variables for render output
+    $picture->href_link = $picture->get_href_link();
+    $args ['pid'] = ($ngg->options['usePermalinks']) ? $picturelist[$back_pid]->image_slug : $back_pid;
+    $picture->previous_image_link = $nggRewrite->get_permalink( $args );
+    $picture->previous_pid = $back_pid;
+    $args ['pid'] = ($ngg->options['usePermalinks']) ? $picturelist[$next_pid]->image_slug : $next_pid;
+    $picture->next_image_link  = $nggRewrite->get_permalink( $args );
+    $picture->next_pid = $next_pid;
+    $picture->number = $key + 1;
+    $picture->total = $total;
+    $picture->linktitle = ( empty($picture->description) ) ? ' ' : htmlspecialchars ( stripslashes(nggGallery::i18n($picture->description, 'pic_' . $picture->pid . '_description')) );
+    $picture->alttext = ( empty($picture->alttext) ) ?  ' ' : html_entity_decode ( stripslashes(nggGallery::i18n($picture->alttext, 'pic_' . $picture->pid . '_alttext')) );
+    $picture->description = ( empty($picture->description) ) ? ' ' : html_entity_decode ( stripslashes(nggGallery::i18n($picture->description, 'pic_' . $picture->pid . '_description')) );
+    $picture->anchor = 'ngg-imagebrowser-' . $picture->galleryid . '-' . $current_page;
+
+    // filter to add custom content for the output
+    $picture = apply_filters('ngg_image_object', $picture, $act_pid);
+
+    // let's get the meta data
+    $meta = new nggMeta($act_pid);
+    $meta->sanitize();
+    $exif = $meta->get_EXIF();
+    $iptc = $meta->get_IPTC();
+    $xmp  = $meta->get_XMP();
+    $db   = $meta->get_saved_meta();
+
+    //if we get no exif information we try the database
+    $exif = ($exif == false) ? $db : $exif;
+
+    // look for imagebrowser-$template.php or pure imagebrowser.php
+    $filename = ( empty($template) ) ? 'imagebrowser' : 'imagebrowser-' . $template;
+
+    // create the output
+    $out = nggGallery::capture ( $filename , array ('image' => $picture , 'meta' => $meta, 'exif' => $exif, 'iptc' => $iptc, 'xmp' => $xmp, 'db' => $db) );
+
+    return $out;
+
+}
+
+/**
+ * nggShowRelatedGallery() - create a gallery based on the tags
+ *
+ * @access public
+ * @param string $taglist list of tags as csv
+ * @param integer $maxImages (optional) limit the number of images to show
+ * @return the content
+ */
+function nggShowRelatedGallery($taglist, $maxImages = 0) {
+
+    $ngg_options = nggGallery::get_option('ngg_options');
+
+    // get now the related images
+    $picturelist = nggTags::find_images_for_tags($taglist, 'RAND');
+
+    // go on if not empty
+    if ( empty($picturelist) )
+        return;
+
+    // cut the list to maxImages
+    if ( $maxImages > 0 )
+        array_splice($picturelist, $maxImages);
+
+    // *** build the gallery output
+    $out   = '<div class="ngg-related-gallery">';
+    foreach ($picturelist as $picture) {
+
+        // get the effect code
+        $thumbcode = $picture->get_thumbcode( __('Related images for', 'nggallery') . ' ' . get_the_title());
+
+        $out .= '<a href="' . $picture->imageURL . '" title="' . stripslashes(nggGallery::i18n($picture->description, 'pic_' . $picture->pid . '_description')) . '" ' . $thumbcode . ' >';
+        $out .= '<img title="' . stripslashes(nggGallery::i18n($picture->alttext, 'pic_' . $picture->pid . '_alttext')) . '" alt="' . stripslashes(nggGallery::i18n($picture->alttext, 'pic_' . $picture->pid . '_alttext')) . '" src="' . $picture->thumbURL . '" />';
+        $out .= '</a>' . "\n";
+    }
+    $out .= '</div>' . "\n";
+
+    $out = apply_filters('ngg_show_related_gallery_content', $out, $taglist);
+
+    return $out;
+}
+
+/**
+ * nggShowRelatedImages() - return related images based on category or tags
+ *
+ * @access public
+ * @param string $type could be 'tags' or 'category'
+ * @param integer $maxImages of images
+ * @return the content
+ */
+function nggShowRelatedImages($type = '', $maxImages = 0) {
+    $ngg_options = nggGallery::get_option('ngg_options');
+
+    if ($type == '') {
+        $type = $ngg_options['appendType'];
+        $maxImages = $ngg_options['maxImages'];
+    }
+
+    $sluglist = array();
+
+    switch ($type) {
+        case 'tags':
+            if (function_exists('get_the_tags')) {
+                $taglist = get_the_tags();
+
+                if (is_array($taglist)) {
+                    foreach ($taglist as $tag) {
+                        $sluglist[] = $tag->slug;
+                    }
+                }
+            }
+        break;
+
+        case 'category':
+            $catlist = get_the_category();
+
+            if (is_array($catlist)) {
+                foreach ($catlist as $cat) {
+                    $sluglist[] = $cat->category_nicename;
+                }
+            }
+        break;
+    }
+
+    $sluglist = implode(',', $sluglist);
+    $out = nggShowRelatedGallery($sluglist, $maxImages);
+
+    return $out;
+}
+
+/**
+ * Template function for theme authors
+ *
+ * @access public
+ * @param string  (optional) $type could be 'tags' or 'category'
+ * @param integer (optional) $maxNumbers of images
+ * @return void
+ */
+function the_related_images($type = 'tags', $maxNumbers = 7) {
+    echo nggShowRelatedImages($type, $maxNumbers);
+}
+
+/**
+ * Wrapper to I_Displayed_Gallery_Renderer->display_images(); this will display
+ * a basic thumbnails gallery
+ *
+ * @param int $galleryID Gallery ID
+ * @param string $template Path to template file
+ * @param bool $images_per_page Basic thumbnails setting
+ */
+function nggShowGallery($galleryID, $template = '', $images_per_page = FALSE)
+{
+    $args = array(
+        'source' => 'galleries',
+        'container_ids' => $galleryID
+    );
+
+    if (apply_filters('ngg_show_imagebrowser_first', FALSE, $galleryID))
+        $args['display_type'] = NEXTGEN_GALLERY_NEXTGEN_BASIC_IMAGEBROWSER;
+    else
+        $args['display_type'] = NEXTGEN_GALLERY_BASIC_THUMBNAILS;
+
+    if (!empty($template))
+        $args['template'] = $template;
+    if (!empty($images_per_page))
+        $args['images_per_page'] = $images_per_page;
+
+    echo C_Component_Registry::get_instance()
+                             ->get_utility('I_Displayed_Gallery_Renderer')
+                             ->display_images($args);
+}
+
+
+/**
+ * Wrapper to I_Displayed_Gallery_Renderer->display_images(); this will display
+ * a basic slideshow gallery
+ *
+ * @param int $galleryID Gallery ID
+ * @param int $width Gallery width
+ * @param int $height Gallery height
+ */
+function nggShowSlideshow($galleryID, $width, $height)
+{
+    $args = array(
+        'source'         => 'galleries',
+        'container_ids'  => $galleryID,
+        'gallery_width'  => $width,
+        'gallery_height' => $height,
+        'display_type'   => NEXTGEN_GALLERY_BASIC_SLIDESHOW
+    );
+
+    echo C_Component_Registry::get_instance()
+                             ->get_utility('I_Displayed_Gallery_Renderer')
+                             ->display_images($args);
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/nggshow.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/nggshow.php
new file mode 100644
index 0000000000000000000000000000000000000000..38fada2b229d92c3af913be804d003479de67709
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/nggshow.php
@@ -0,0 +1,65 @@
+<?php
+// Load wp-config
+if ( !defined('ABSPATH') ) 
+	require_once( dirname(__FILE__) . '/ngg-config.php');
+
+// reference thumbnail class
+include_once( nggGallery::graphic_library() );
+include_once('lib/core.php');
+
+// get the plugin options
+$ngg_options = get_option('ngg_options');	
+
+// Some parameters from the URL
+if ( !isset($_GET['pid']) ) C_NextGEN_Bootstrap::shutdown();
+    
+$pictureID = (int) $_GET['pid'];
+$mode = isset($_GET['mode']) ? $_GET['mode'] : '';
+
+// let's get the image data
+$picture  = nggdb::find_image( $pictureID );
+
+if ( !is_object($picture) ) C_NextGEN_Bootstrap::shutdown();
+    
+$thumb = new ngg_Thumbnail( $picture->imagePath );
+
+// Resize if necessary
+if ( !empty($_GET['width']) || !empty($_GET['height']) ) {
+ 	// Sanitize
+ 	$w = ( !empty($_GET['width'])) ? intval($_GET['width']) : 0;
+ 	$h = ( !empty($_GET['height'])) ? intval($_GET['height']) : 0;
+	// limit the maxium size, prevent server memory overload
+	if ($w > 1920) $w = 1920;
+	if ($h > 1280) $h = 1280;
+    // Crop mode for post thumbnail
+    if ($mode == 'crop') {
+		// calculates the new dimentions for a downsampled image
+        list ( $ratio_w, $ratio_h ) = wp_constrain_dimensions($thumb->currentDimensions['width'], $thumb->currentDimensions['height'], $w, $h);
+        // check ratio to decide which side should be resized
+        ( $ratio_h <  $h || $ratio_w ==  $w ) ? $thumb->resize(0, $h) : $thumb->resize($w, 0);
+        // get the best start postion to crop from the middle    
+        $ypos = ($thumb->currentDimensions['height'] - $h) / 2;
+		$thumb->crop(0, $ypos, $w, $h);	
+    } else
+        $thumb->resize( $w, $h );   
+}
+
+// Apply effects according to the mode parameter
+if ($mode == 'watermark') {
+	if ($ngg_options['wmType'] == 'image') {
+		$thumb->watermarkImgPath = $ngg_options['wmPath'];
+		$thumb->watermarkImage($ngg_options['wmPos'], $ngg_options['wmXpos'], $ngg_options['wmYpos']); 
+	} else if ($ngg_options['wmType'] == 'text') {
+		$thumb->watermarkText = $ngg_options['wmText'];
+		$thumb->watermarkCreateText($ngg_options['wmColor'], $ngg_options['wmFont'], $ngg_options['wmSize'], $ngg_options['wmOpaque']);
+		$thumb->watermarkImage($ngg_options['wmPos'], $ngg_options['wmXpos'], $ngg_options['wmYpos']);  
+	}
+} else if ($mode == 'web20') {
+	$thumb->createReflection(40,40,50,false,'#a4a4a4');
+}
+
+// Show thumbnail
+$thumb->show();
+$thumb->destruct();
+
+C_NextGEN_Bootstrap::shutdown();
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/Black_Minimalism.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/Black_Minimalism.css
new file mode 100644
index 0000000000000000000000000000000000000000..3f5721659e335133d8bb259b22bbbdac122eae56
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/Black_Minimalism.css
@@ -0,0 +1,49 @@
+/*
+CSS Name: Black Minimalism Theme
+Description: For Black Minimalism Theme
+Author: Alex Rabe
+Version: 1.60
+
+This stylesheet modifies the NextGEN defaults to be more compatible with the Black Minimalism theme
+*/
+
+/* ----------- Album Styles Extend -------------*/
+
+.ngg-thumbnail {
+    margin: 0pt !important;
+    margin-right: 12px !important;
+}
+
+/* ----------- Gallery style -------------*/
+
+.ngg-gallery-thumbnail-box {
+    width: 20%;
+}
+
+.ngg-gallery-thumbnail {
+    background: url('shadowAlpha.png') no-repeat bottom right !important;
+    background: url('shadow.gif') no-repeat bottom right;
+    margin: 10px 0 0 10px !important;
+}
+
+.ngg-gallery-thumbnail img {
+    margin: -6px 6px 6px -6px;
+}
+
+/* ----------- Gallery navigation -------------*/
+
+.ngg-navigation a.page-numbers,
+.ngg-navigation a.next,
+.ngg-navigation a.prev,
+.ngg-navigation span.page-numbers,
+.ngg-navigation span.next,
+.ngg-navigation span.prev {
+    border: 1px solid #660000;
+    padding: 3px 7px;
+}
+
+/* ----------- Related images -------------*/
+
+.ngg-related-gallery img {
+    margin: 0pt 2px;
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/default.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/default.css
new file mode 100644
index 0000000000000000000000000000000000000000..ef2ec17826423d937a9b50d18aa73e8c0aa48842
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/default.css
@@ -0,0 +1,32 @@
+/*
+CSS Name: Default Styles
+Description: NextGEN Default Gallery Stylesheet
+Author: Photocrati Media
+Version: 2.12
+
+These are the default NextGEN rules and are loaded on each page.
+*/
+
+/* ----------- Related images -------------*/
+
+.ngg-related-gallery {
+    background: #F9F9F9;
+    border: 1px solid #E0E0E0;
+    overflow: hidden;
+    margin-bottom: 1em;
+    margin-top: 1em;
+    padding: 5px;
+}
+
+.ngg-related-gallery img {
+    border: 1px solid #DDDDDD;
+    float: left;
+    margin: 0pt 3px;
+    padding: 2px;
+    height: 50px;
+    width: 50px;
+}
+
+.ngg-related-gallery img:hover {
+    border: 1px solid #000000;
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/hovereffect.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/hovereffect.css
new file mode 100644
index 0000000000000000000000000000000000000000..5eb14bfc1d05da7f716ea8de463adffc14afd917
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/hovereffect.css
@@ -0,0 +1,142 @@
+/*
+CSS Name: Hovereffect Styles
+Description: Hover Stylesheet based on the idea of Hoverbox from http://host.sonspring.com/hoverbox/
+Author: Alex Rabe - Orginal by Nathan Smith
+Version: 1.60
+
+This applies a styling effect similiar to the Hoverbox style
+*/
+
+/* ----------- Album Styles Extend -------------*/
+
+.ngg-albumtitle {
+    border-bottom: 1px dashed #AAAAAA;
+    padding-bottom: 3px;
+}
+
+.ngg-thumbnail {
+    background: #EEEEEE none repeat scroll 0% 50%;
+    border-color: #DDDDDD rgb(187, 187, 187) rgb(170, 170, 170) rgb(204, 204, 204);
+    border-style: solid;
+    border-width: 1px;
+    color: inherit;
+    margin-right: 5px;
+    padding: 5px;
+}
+
+.ngg-thumbnail img {
+    filter: alpha(opacity = 100);
+    -moz-opacity: .99;
+    opacity: .99;
+    background: #FFFFFF none repeat scroll 0%;
+    border-color: #AAAAAA rgb(204, 204, 204) rgb(221, 221, 221) rgb(187, 187, 187);
+    border-style: solid;
+    border-width: 1px;
+    color: inherit;
+    padding: 2px;
+    vertical-align: top;
+}
+
+.ngg-thumbnail img:hover {
+    filter: alpha(opacity = 90);
+    -moz-opacity: .9;
+    opacity: .9;
+    border-color: #000000;
+}
+
+/* ----------- Gallery style -------------*/
+
+.ngg-galleryoverview {
+    overflow: hidden;
+    margin-top: 10px;
+    width: 100%;
+    clear: both;
+    display: block !important;
+}
+
+.ngg-gallery-thumbnail-box {
+    background: #EEEEEE none repeat scroll 0% 50%;
+    border-color: #DDDDDD rgb(187, 187, 187) rgb(170, 170, 170) rgb(204, 204, 204);
+    border-style: solid;
+    border-width: 1px;
+    color: inherit;
+    display: inline;
+    margin: 3px;
+    padding: 5px;
+    position: relative;
+}
+
+.ngg-gallery-thumbnail img {
+    filter: alpha(opacity = 100);
+    -moz-opacity: .99;
+    opacity: .99;
+    background: #FFFFFF none repeat scroll 0%;
+    border-color: #AAAAAA rgb(204, 204, 204) rgb(221, 221, 221) rgb(187, 187, 187);
+    border-style: solid;
+    border-width: 1px;
+    color: inherit;
+    padding: 2px;
+    vertical-align: top;
+}
+
+.ngg-gallery-thumbnail img:hover {
+    filter: alpha(opacity = 90);
+    -moz-opacity: .9;
+    opacity: .9;
+    border-color: #000000;
+}
+
+/* ----------- Gallery navigation -------------*/
+
+.ngg-navigation a.page-numbers,
+.ngg-navigation a.next,
+.ngg-navigation a.prev,
+.ngg-navigation span.page-numbers,
+.ngg-navigation span.next,
+.ngg-navigation span.prev {
+    padding: 3px 7px;
+}
+
+/* ----------- Image browser style -------------*/
+
+.ngg-imagebrowser h3 {
+    text-align: center;
+    padding-bottom: 10px;
+}
+
+.ngg-imagebrowser .pic {
+    background: #EEEEEE none repeat scroll 0% 50%;
+    border-color: #DDDDDD rgb(187, 187, 187) rgb(170, 170, 170) rgb(204, 204, 204);
+    border-style: solid;
+    border-width: 1px;
+    color: inherit;
+    display: block;
+    padding: 10px;
+}
+
+.ngg-imagebrowser img {
+    margin: -3px;
+    background: #FFFFFF none repeat scroll 0%;
+    border-color: #AAAAAA rgb(204, 204, 204) rgb(221, 221, 221) rgb(187, 187, 187);
+    border-style: solid;
+    border-width: 1px;
+    color: inherit;
+    padding: 2px;
+    vertical-align: top;
+}
+
+.ngg-imagebrowser-nav {
+    padding: 10px;
+
+}
+
+.ngg-imagebrowser-nav .back:hover,
+.ngg-imagebrowser-nav .next:hover {
+    border: 1px solid #000000;
+}
+
+.ngg-imagebrowser-nav .back a:hover,
+.ngg-imagebrowser-nav .next a:hover {
+    text-decoration: none !important;
+}
+
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/ngg_dkret3.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/ngg_dkret3.css
new file mode 100644
index 0000000000000000000000000000000000000000..c085a492012dc48f9bf2596dd6217205973b070c
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/ngg_dkret3.css
@@ -0,0 +1,42 @@
+/*
+CSS Name: dkret3 Theme
+Description: NextGEN dkret3 style with a shadow effect
+Author: Jörn Kretzschmar (based on Alex Rabes Default Style)
+Version: 1.3
+
+This stylesheet modifies the NextGEN defaults to be more compatible with the dkret3 theme
+*/
+
+/* ----------- Gallery style -------------*/
+
+.ngg-gallery-thumbnail {
+    background: url('shadowAlpha.png') no-repeat bottom right !important;
+    background: url('shadow.gif') no-repeat bottom right;
+    margin: 10px 0 0 10px !important;
+}
+
+.ngg-gallery-thumbnail img {
+    margin: -6px 6px 6px -6px;
+}
+
+.ngg-gallery-thumbnail span {
+    display: none;
+}
+
+/* ----------- Gallery navigation -------------*/
+
+.ngg-navigation a.page-numbers,
+.ngg-navigation a.next,
+.ngg-navigation a.prev,
+.ngg-navigation span.page-numbers,
+.ngg-navigation span.next,
+.ngg-navigation span.prev {
+    padding: 3px 7px;
+}
+
+/* ----------- Sidebar widget -------------*/
+
+.ngg-widget,
+.ngg-widget-slideshow {
+    text-align: center;
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/ngg_k2.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/ngg_k2.css
new file mode 100644
index 0000000000000000000000000000000000000000..b6dac58b0f620056cf30a48d9cb85e0b9c510f85
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/ngg_k2.css
@@ -0,0 +1,84 @@
+/*
+CSS Name: K2 Theme
+Description: NextGEN Style for K2 Theme
+Author: Alex Rabe
+Version: 1.60
+
+This stylesheet modifies the NextGEN defaults to be more compatible with the K2 theme
+*/
+
+/* ----------- Album Styles Extend -------------*/
+
+.ngg-albumoverview {
+    margin: 10px 0px 0px 0px !important;
+}
+
+.ngg-album {
+    margin: 0px 0px 5px !important;
+}
+
+.ngg-albumtitle {
+    margin: 0px 0px 10px 0px !important;
+}
+
+.ngg-albumcontent {
+    margin: 0px !important;
+}
+
+.ngg-thumbnail {
+    float: left;
+    margin: 0px 12px 0px 0px !important;
+}
+
+.ngg-thumbnail img {
+    margin: 4px 0px 4px 5px !important;
+}
+
+/* ----------- Album Styles Compact -------------*/
+
+.ngg-album-link {
+    margin: 0px !important;
+}
+
+.ngg-album-compact h4 {
+    margin-bottom: 0px !important;
+    margin-top: 0px !important;
+    padding: 0px !important;
+}
+
+/* ----------- Gallery style -------------*/
+
+.ngg-gallery-thumbnail-box {
+    margin: 0px !important;
+}
+
+.ngg-gallery-thumbnail {
+    background: url('shadowAlpha.png') no-repeat bottom right !important;
+    background: url('shadow.gif') no-repeat bottom right;
+    margin: 10px 0 0 10px !important;
+}
+
+.ngg-gallery-thumbnail img {
+    margin: -6px 6px 6px -6px !important;
+}
+
+/* ----------- Gallery navigation -------------*/
+
+.ngg-navigation a.page-numbers,
+.ngg-navigation a.next,
+.ngg-navigation a.prev,
+.ngg-navigation span.page-numbers,
+.ngg-navigation span.next,
+.ngg-navigation span.prev {
+    padding: 3px 7px;
+}
+
+/* ----------- Related images -------------*/
+
+.ngg-related-gallery img {
+    margin: 0pt 2px;
+}
+
+.ngg-related-gallery img:hover {
+    border: 1px solid #000000;
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/ngg_shadow.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/ngg_shadow.css
new file mode 100644
index 0000000000000000000000000000000000000000..ebab00b867d3bf7c5a514483eddde9a47570789c
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/ngg_shadow.css
@@ -0,0 +1,24 @@
+/*
+CSS Name: Shadow Effect
+Description: NextGEN Default Style with a Shadow effect
+Author: Alex Rabe
+Version: 1.60
+
+Applies a shadow effect to gallery thumbnails and enables display of their description text
+*/
+
+/* ----------- Gallery style -------------*/
+
+.ngg-gallery-thumbnail {
+    background: url('shadowAlpha.png') no-repeat bottom right !important;
+    background: url('shadow.gif') no-repeat bottom right;
+    margin: 10px 0 0 10px !important;
+}
+
+.ngg-gallery-thumbnail img {
+    margin: -6px 6px 6px -6px;
+}
+
+.ngg-gallery-thumbnail span {
+    display: none;
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/ngg_shadow2.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/ngg_shadow2.css
new file mode 100644
index 0000000000000000000000000000000000000000..290fa1c1133bced1cf1e22060a116bd163865ea9
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/ngg_shadow2.css
@@ -0,0 +1,30 @@
+/*
+CSS Name: Shadow Effect with Description text
+Description: NextGEN Default Style with a Shadow effect and description text below the thumbnail
+Author: Alex Rabe
+Version: 1.60
+
+Applies a shadow effect to gallery thumbnails and enables display of their description text
+*/
+
+/* ----------- Gallery style -------------*/
+
+.ngg-gallery-thumbnail {
+    background: url('shadowAlpha.png') no-repeat bottom right !important;
+    background: url('shadow.gif') no-repeat bottom right;
+    margin: 10px 0 0 10px !important;
+    padding: 10px 15px 10px 15px;
+    border-color: #EEEEEE;
+    border-style: solid none none solid;
+    border-width: 1px medium medium 1px;
+}
+
+.ngg-gallery-thumbnail img {
+    margin: -6px 6px 6px -6px;
+}
+
+.ngg-gallery-thumbnail span {
+    margin: -6px 6px 6px -6px;
+    text-align: center;
+    color: #808080;
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/shadow.gif b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/shadow.gif
new file mode 100644
index 0000000000000000000000000000000000000000..af7f537e391f08327e417c7be6323c917d5d3788
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/shadow.gif differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/shadowAlpha.png b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/shadowAlpha.png
new file mode 100644
index 0000000000000000000000000000000000000000..a2561df971728d988424100c74c817916eca1979
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/shadowAlpha.png differ
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/album-compact.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/album-compact.php
new file mode 100644
index 0000000000000000000000000000000000000000..375e7c4bd3b86d1f902d0107872b4825b7ef6fb1
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/album-compact.php
@@ -0,0 +1,43 @@
+<?php
+/**
+Template Page for the album overview
+
+Follow variables are useable :
+
+	$album     	 : Contain information about the album
+	$galleries   : Contain all galleries inside this album
+	$pagination  : Contain the pagination content
+
+ You can check the content when you insert the tag <?php var_dump($variable) ?>
+ If you would like to show the timestamp of the image ,you can use <?php echo $exif['created_timestamp'] ?>
+**/
+?>
+<?php if (!defined ('ABSPATH')) die ('No direct access allowed'); ?><?php if (!empty ($galleries)) : ?>
+
+<div class="ngg-albumoverview">
+
+	<!-- List of galleries -->
+	<?php foreach ($galleries as $gallery) : ?>
+
+	<div class="ngg-album-compact">
+		<div class="ngg-album-compactbox">
+			<div class="ngg-album-link">
+				<a class="Link" href="<?php echo $gallery->pagelink ?>">
+					<img class="Thumb" alt="<?php echo $gallery->title ?>" src="<?php echo $gallery->previewurl ?>"/>
+				</a>
+			</div>
+		</div>
+		<h4><a class="ngg-album-desc" title="<?php echo $gallery->title ?>" href="<?php echo $gallery->pagelink ?>" ><?php echo $gallery->title ?></a></h4>
+		<?php if (@$gallery->counter > 0) : ?>
+		<p><strong><?php echo $gallery->counter ?></strong>&nbsp;<?php _e('Photos', 'nggallery') ?></p>
+		<?php endif; ?>
+	</div>
+
+ 	<?php endforeach; ?>
+
+	<!-- Pagination -->
+    <br class="ngg-clear"/>
+ 	<?php echo $pagination ?>
+</div>
+
+<?php endif; ?>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/album-extend.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/album-extend.php
new file mode 100644
index 0000000000000000000000000000000000000000..289095867b536644e38cf6c250f563e88311a9cd
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/album-extend.php
@@ -0,0 +1,43 @@
+<?php 
+/**
+Template Page for the album overview (extended)
+
+Follow variables are useable :
+
+	$album     	 : Contain information about the album
+	$galleries   : Contain all galleries inside this album
+	$pagination  : Contain the pagination content
+
+ You can check the content when you insert the tag <?php var_dump($variable) ?>
+ If you would like to show the timestamp of the image ,you can use <?php echo $exif['created_timestamp'] ?>
+**/
+?>
+<?php if (!defined ('ABSPATH')) die ('No direct access allowed'); ?><?php if (!empty ($galleries)) : ?>
+
+<div class="ngg-albumoverview">	
+	<!-- List of galleries -->
+	<?php foreach ($galleries as $gallery) : ?>
+
+	<div class="ngg-album">
+		<div class="ngg-albumtitle"><a href="<?php echo $gallery->pagelink ?>"><?php echo $gallery->title ?></a></div>
+			<div class="ngg-albumcontent">
+				<div class="ngg-thumbnail">
+					<a href="<?php echo $gallery->pagelink ?>"><img class="Thumb" alt="<?php echo $gallery->title ?>" src="<?php echo $gallery->previewurl ?>"/></a>
+				</div>
+				<div class="ngg-description">
+				<p><?php echo $gallery->galdesc ?></p>
+				<?php if (@$gallery->counter > 0) : ?>
+				<p><strong><?php echo $gallery->counter ?></strong>&nbsp;<?php _e('Photos', 'nggallery') ?></p>
+				<?php endif; ?>
+			</div>
+		</div>
+	</div>
+
+ 	<?php endforeach; ?>
+ 	
+	<!-- Pagination -->
+ 	<?php echo $pagination ?>
+ 	
+</div>
+
+<?php endif; ?>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/gallery-caption.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/gallery-caption.php
new file mode 100644
index 0000000000000000000000000000000000000000..f43d832600ad3815bb3c351829a485a12c66f3fe
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/gallery-caption.php
@@ -0,0 +1,62 @@
+<?php 
+/**
+Template Page for the gallery overview
+
+Follow variables are useable :
+
+	$gallery     : Contain all about the gallery
+	$images      : Contain all images, path, title
+	$pagination  : Contain the pagination content
+
+ You can check the content when you insert the tag <?php var_dump($variable) ?>
+ If you would like to show the timestamp of the image ,you can use <?php echo $exif['created_timestamp'] ?>
+**/
+?>
+<?php if (!defined ('ABSPATH')) die ('No direct access allowed'); ?><?php if (!empty ($gallery)) : ?>
+
+<div class="ngg-galleryoverview ngg-template-caption" id="<?php echo $gallery->anchor ?>">
+
+<?php if ($gallery->show_slideshow) { ?>
+	<!-- Slideshow link -->
+	<div class="slideshowlink">
+		<a class="slideshowlink" href="<?php echo $gallery->slideshow_link ?>">
+			<?php echo $gallery->slideshow_link_text ?>
+		</a>
+	</div>
+<?php } ?>
+
+<?php if ($gallery->show_piclens) { ?>
+	<!-- Piclense link -->
+	<div class="piclenselink">
+		<a class="piclenselink" href="<?php echo $gallery->piclens_link ?>">
+			<?php _e('[View with PicLens]','nggallery'); ?>
+		</a>
+	</div>
+<?php } ?>
+	
+	<!-- Thumbnails -->
+    <?php $i = 0; ?>
+	<?php foreach ( $images as $image ) : ?>
+	
+	<div id="ngg-image-<?php echo $image->pid ?>" class="ngg-gallery-thumbnail-box" <?php echo $image->style ?> >
+		<div class="ngg-gallery-thumbnail" >
+			<a href="<?php echo $image->imageURL ?>" title="<?php echo $image->description ?>" <?php echo $image->thumbcode ?> >
+				<?php if ( !$image->hidden ) { ?>
+				<img title="<?php echo $image->alttext ?>" alt="<?php echo $image->alttext ?>" src="<?php echo $image->thumbnailURL ?>" <?php echo $image->size ?> />
+				<?php } ?>
+			</a>
+			<span><?php echo $image->caption ?></span>
+		</div>
+	</div>
+	<?php if ( $image->hidden ) continue; ?>
+	<?php if ( $gallery->columns > 0 && ++$i % $gallery->columns == 0 ) { ?>
+	<br style="clear: both" />
+	<?php } ?>
+ 	<?php endforeach; ?>
+ 	
+	<!-- Pagination -->
+ 	<?php echo $pagination ?>
+ 	
+</div>
+
+<?php endif; ?>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/gallery-carousel.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/gallery-carousel.php
new file mode 100644
index 0000000000000000000000000000000000000000..de01c900894b94628e2d5dde82a757dd8e459e80
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/gallery-carousel.php
@@ -0,0 +1,56 @@
+<?php 
+/**
+Template Page for the gallery carousel
+
+Follow variables are useable :
+
+	$gallery     : Contain all about the gallery
+	$images      : Contain all images, path, title
+	$pagination  : Contain the pagination content
+	$current     : Contain the selected image
+	$prev/$next  : Contain link to the next/previous gallery page
+	
+
+ You can check the content when you insert the tag <?php var_dump($variable) ?>
+ If you would like to show the timestamp of the image ,you can use <?php echo $exif['created_timestamp'] ?>
+**/
+?>
+<?php if (!defined ('ABSPATH')) die ('No direct access allowed'); ?><?php if (!empty ($gallery)) : ?>
+
+<div class="ngg-galleryoverview">
+
+	<div class="pic"><img title="<?php echo $current->alttext ?>" alt="<?php echo $current->alttext ?>" src="<?php echo $current->url; ?>" /></div>
+	
+	<ul class="ngg-gallery-list">
+	
+		<!-- PREV LINK -->	
+		<?php if ($prev) : ?>
+		<li class="ngg-prev">
+			<a class="prev" href="<?php echo $prev ?>">&#9668;</a>
+		</li>
+		<?php endif; ?>
+		
+		<!-- Thumbnail list -->
+		<?php foreach ( $images as $image ) : ?>
+		<?php if ( $image->hidden ) continue; ?> 
+		
+		<li id="ngg-image-<?php echo $image->pid ?>" class="ngg-thumbnail-list <?php if ($image->pid == $current->pid) echo 'selected' ?>" >
+			<a href="<?php echo $image->pidlink ?>" title="<?php echo $image->description ?>" >
+				<img title="<?php echo $image->alttext ?>" alt="<?php echo $image->alttext ?>" src="<?php echo $image->thumbnailURL ?>" <?php echo $image->size ?> />
+			</a>
+		</li>
+
+	 	<?php endforeach; ?>
+	 	
+	 	<!-- NEXT LINK -->
+		<?php if ($next) : ?>
+		<li class="ngg-next">
+			<a class="next" href="<?php echo $next ?>">&#9658;</a>
+		</li>
+		<?php endif; ?>
+	 	
+	</ul>
+ 	
+</div>
+
+<?php endif; ?>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/gallery.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/gallery.php
new file mode 100644
index 0000000000000000000000000000000000000000..c8332a2455f4de60ec733bbbc0ba89317ae55064
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/gallery.php
@@ -0,0 +1,66 @@
+<?php 
+/**
+Template Page for the gallery overview
+
+Follow variables are useable :
+
+	$gallery     : Contain all about the gallery
+	$images      : Contain all images, path, title
+	$pagination  : Contain the pagination content
+
+ You can check the content when you insert the tag <?php var_dump($variable) ?>
+ If you would like to show the timestamp of the image ,you can use <?php echo $exif['created_timestamp'] ?>
+**/
+?>
+<?php if (!defined ('ABSPATH')) die ('No direct access allowed'); ?><?php if (!empty ($gallery)) : ?>
+
+<div class="ngg-galleryoverview" id="<?php echo $gallery->anchor ?>">
+
+<?php if ($gallery->show_slideshow) { ?>
+	<!-- Slideshow link -->
+	<div class="slideshowlink">
+		<a class="slideshowlink" href="<?php echo $gallery->slideshow_link ?>">
+			<?php echo $gallery->slideshow_link_text ?>
+		</a>
+	</div>
+<?php } ?>
+
+<?php if ($gallery->show_piclens) { ?>
+	<!-- Piclense link -->
+	<div class="piclenselink">
+		<a class="piclenselink" href="<?php echo $gallery->piclens_link ?>">
+			<?php _e('[View with PicLens]','nggallery'); ?>
+		</a>
+	</div>
+<?php } ?>
+	
+	<!-- Thumbnails -->
+    <?php $i = 0; ?>
+	<?php foreach ( $images as $image ) : ?>
+	
+	<div id="ngg-image-<?php echo $image->pid ?>" class="ngg-gallery-thumbnail-box" <?php echo $image->style ?> >
+		<div class="ngg-gallery-thumbnail" >
+			<a href="<?php echo $image->imageURL ?>" title="<?php echo $image->description ?>" <?php echo $image->thumbcode ?> >
+				<?php if ( !$image->hidden ) { ?>
+				<img title="<?php echo $image->alttext ?>" alt="<?php echo $image->alttext ?>" src="<?php echo $image->thumbnailURL ?>" <?php echo $image->size ?> />
+				<?php } ?>
+			</a>
+		</div>
+	</div>
+
+    <?php if ( $image->hidden ) continue; ?>
+    <?php if ($gallery->columns > 0): ?>
+        <?php if ((($i + 1) % $gallery->columns) == 0 ): ?>
+            <br style="clear: both" />
+        <?php endif; ?>
+    <?php endif; ?>
+    <?php $i++; ?>
+
+ 	<?php endforeach; ?>
+ 	
+	<!-- Pagination -->
+ 	<?php echo $pagination ?>
+ 	
+</div>
+
+<?php endif; ?>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/imagebrowser-caption.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/imagebrowser-caption.php
new file mode 100644
index 0000000000000000000000000000000000000000..8085de97e6961d8cb0f379d49572cd8e4b03366d
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/imagebrowser-caption.php
@@ -0,0 +1,37 @@
+<?php 
+/**
+Template Page for the image browser
+
+Follow variables are useable :
+
+	$image : Contain all about the image 
+	$meta  : Contain the raw Meta data from the image 
+	$exif  : Contain the clean up Exif data 
+	$iptc  : Contain the clean up IPTC data 
+	$xmp   : Contain the clean up XMP data 
+
+ You can check the content when you insert the tag <?php var_dump($variable) ?>
+ If you would like to show the timestamp of the image ,you can use <?php echo $exif['created_timestamp'] ?>
+**/
+?>
+<?php if (!defined ('ABSPATH')) die ('No direct access allowed'); ?><?php if (!empty ($image)) : ?>
+
+<div class="ngg-imagebrowser" id="<?php echo $image->anchor ?>">
+
+	<h3><?php echo $image->alttext ?></h3>
+
+	<div class="pic"><?php echo $image->href_link ?></div>
+	<div class="ngg-imagebrowser-nav"> 
+		<div class="back">
+			<a class="ngg-browser-prev" id="ngg-prev-<?php echo $image->previous_pid ?>" href="<?php echo $image->previous_image_link ?>">&#9668; <?php _e('Back', 'nggallery') ?></a>
+		</div>
+		<div class="next">
+			<a class="ngg-browser-next" id="ngg-next-<?php echo $image->next_pid ?>" href="<?php echo $image->next_image_link ?>"><?php _e('Next', 'nggallery') ?> &#9658;</a>
+		</div>
+		<div class="counter"><?php _e('Picture', 'nggallery') ?> <?php echo $image->number ?> <?php _e('of', 'nggallery')?> <?php echo $image->total ?></div>
+		<div class="ngg-imagebrowser-desc"><p><?php echo $image->description ?></p></div>
+	</div>	
+
+</div>	
+
+<?php endif; ?>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/imagebrowser-exif.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/imagebrowser-exif.php
new file mode 100644
index 0000000000000000000000000000000000000000..cdf7a61cb49412886ab955077c8b04a5b4fb7abe
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/imagebrowser-exif.php
@@ -0,0 +1,67 @@
+<?php 
+/**
+Template Page for the image browser with a exif data example
+
+Follow variables are useable :
+
+	$image : Contain all about the image 
+	$meta  : Contain the raw Meta data from the image 
+	$exif  : Contain the clean up Exif data from file
+	$iptc  : Contain the clean up IPTC data from file 
+	$xmp   : Contain the clean up XMP data  from file
+	$db    : Contain the clean up META data from the database (should be imported during upload)
+
+Please note : A Image resize or watermarking operation will remove all meta information, exif will in this case loaded from database 
+
+ You can check the content when you insert the tag <?php var_dump($variable) ?>
+ If you would like to show the timestamp of the image ,you can use <?php echo $exif['created_timestamp'] ?>
+**/
+
+?>
+<?php if (!defined ('ABSPATH')) die ('No direct access allowed'); ?><?php if (!empty ($image)) : ?>
+
+<div class="ngg-imagebrowser" id="<?php echo $image->anchor ?>">
+
+	<h3><?php echo $image->alttext ?></h3>
+
+	<div class="pic"><?php echo $image->href_link ?></div>
+	<div class="ngg-imagebrowser-nav"> 
+		<div class="back">
+			<a class="ngg-browser-prev" id="ngg-prev-<?php echo $image->previous_pid ?>" href="<?php echo $image->previous_image_link ?>">&#9668; <?php _e('Back', 'nggallery') ?></a>
+		</div>
+		<div class="next">
+			<a class="ngg-browser-next" id="ngg-next-<?php echo $image->next_pid ?>" href="<?php echo $image->next_image_link ?>"><?php _e('Next', 'nggallery') ?> &#9658;</a>
+		</div>
+		<div class="counter"><?php _e('Picture', 'nggallery') ?> <?php echo $image->number ?> <?php _e('of', 'nggallery')?> <?php echo $image->total ?></div>
+		<div class="ngg-imagebrowser-desc"><p><?php echo $image->description ?></p></div>
+		<!-- Exif data -->
+		<h3><?php _e('Meta data', 'nggallery') ?></h3>
+		<table class="exif-data">
+			<tbody>
+			<tr>
+				<th width="140"><?php _e('Camera / Type', 'nggallery') ?></th>
+				<td><?php echo @$exif['camera'] ?></td>
+			</tr>
+			<tr>
+				<th><?php _e('Aperture', 'nggallery') ?></th>
+				<td><?php echo @$exif['aperture'] ?></td>
+			</tr>
+			<tr>
+				<th><?php _e('Focal Length', 'nggallery') ?></th>
+				<td><?php echo @$exif['focal_length'] ?></td>
+			</tr>
+			<tr>
+				<th><?php _e('Shutter speed', 'nggallery') ?></th>
+				<td><?php echo @$exif['shutter_speed'] ?></td>
+			</tr>
+			<tr>
+				<th><?php _e('Date / Time', 'nggallery') ?></th>
+				<td><?php echo @$exif['created_timestamp'] ?></td>
+			</tr>
+			</tbody>
+		</table>
+	</div>	
+
+</div>	
+
+<?php endif; ?>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/imagebrowser.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/imagebrowser.php
new file mode 100644
index 0000000000000000000000000000000000000000..8085de97e6961d8cb0f379d49572cd8e4b03366d
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/imagebrowser.php
@@ -0,0 +1,37 @@
+<?php 
+/**
+Template Page for the image browser
+
+Follow variables are useable :
+
+	$image : Contain all about the image 
+	$meta  : Contain the raw Meta data from the image 
+	$exif  : Contain the clean up Exif data 
+	$iptc  : Contain the clean up IPTC data 
+	$xmp   : Contain the clean up XMP data 
+
+ You can check the content when you insert the tag <?php var_dump($variable) ?>
+ If you would like to show the timestamp of the image ,you can use <?php echo $exif['created_timestamp'] ?>
+**/
+?>
+<?php if (!defined ('ABSPATH')) die ('No direct access allowed'); ?><?php if (!empty ($image)) : ?>
+
+<div class="ngg-imagebrowser" id="<?php echo $image->anchor ?>">
+
+	<h3><?php echo $image->alttext ?></h3>
+
+	<div class="pic"><?php echo $image->href_link ?></div>
+	<div class="ngg-imagebrowser-nav"> 
+		<div class="back">
+			<a class="ngg-browser-prev" id="ngg-prev-<?php echo $image->previous_pid ?>" href="<?php echo $image->previous_image_link ?>">&#9668; <?php _e('Back', 'nggallery') ?></a>
+		</div>
+		<div class="next">
+			<a class="ngg-browser-next" id="ngg-next-<?php echo $image->next_pid ?>" href="<?php echo $image->next_image_link ?>"><?php _e('Next', 'nggallery') ?> &#9658;</a>
+		</div>
+		<div class="counter"><?php _e('Picture', 'nggallery') ?> <?php echo $image->number ?> <?php _e('of', 'nggallery')?> <?php echo $image->total ?></div>
+		<div class="ngg-imagebrowser-desc"><p><?php echo $image->description ?></p></div>
+	</div>	
+
+</div>	
+
+<?php endif; ?>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/singlepic.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/singlepic.php
new file mode 100644
index 0000000000000000000000000000000000000000..5f8d0ef670e6a4ed7711929b3eaa480ae240838b
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/singlepic.php
@@ -0,0 +1,31 @@
+<?php 
+/**
+Template Page for the single pic
+
+Follow variables are useable :
+
+	$image : Contain all about the image 
+	$meta  : Contain the raw Meta data from the image 
+	$exif  : Contain the clean up Exif data from file
+	$iptc  : Contain the clean up IPTC data from file 
+	$xmp   : Contain the clean up XMP data  from file
+	$db    : Contain the clean up META data from the database (should be imported during upload)
+
+Please note : A Image resize or watermarking operation will remove all meta information, exif will in this case loaded from database 
+
+ You can check the content when you insert the tag <?php var_dump($variable) ?>
+ If you would like to show the timestamp of the image ,you can use <?php echo $exif['created_timestamp'] ?>
+**/
+?>
+<?php if (!defined ('ABSPATH')) die ('No direct access allowed'); ?><?php if (!empty ($image)) : ?>
+<a href="<?php echo $image->imageURL; ?>"
+   title="<?php echo $image->linktitle; ?>"
+   <?php if(!empty($target)) { ?>target="<?php echo esc_attr($target); ?>"<?php } ?>
+   <?php echo $image->thumbcode; ?>>
+	<img class="<?php echo $image->classname; ?>"
+         src="<?php echo $image->thumbnailURL; ?>"
+         alt="<?php echo $image->alttext; ?>"
+         title="<?php echo $image->alttext; ?>"/>
+</a>
+<?php if (!empty ($image->caption)) : ?><span><?php echo $image->caption ?></span><?php endif; ?>
+<?php endif; ?>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/xml/imagerotator.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/xml/imagerotator.php
new file mode 100644
index 0000000000000000000000000000000000000000..96d0b8f22deb4cb129da062d291807fa19a74cbb
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/xml/imagerotator.php
@@ -0,0 +1,52 @@
+<?php
+
+/*
++----------------------------------------------------------------+
++	imageRotartor-XML
++	by Alex Rabe
++   	required for NextGEN Gallery
++----------------------------------------------------------------+
+*/
+
+// look up for the path
+if ( !defined('ABSPATH') ) 
+    require_once( dirname(__FILE__) . '/../ngg-config.php');
+
+global $wpdb;
+
+$ngg_options = get_option ('ngg_options');
+$siteurl	 = site_url();
+
+// get the gallery id
+$galleryID = (int) $_GET['gid'];
+
+// get the pictures
+if ($galleryID == 0) {
+	$thepictures = $wpdb->get_results("SELECT t.*, tt.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE tt.exclude != 1 ORDER BY tt.{$ngg_options['galSort']} {$ngg_options['galSortDir']} ");
+} else {
+	$thepictures = $wpdb->get_results("SELECT t.*, tt.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE t.gid = '$galleryID' AND tt.exclude != 1 ORDER BY tt.{$ngg_options['galSort']} {$ngg_options['galSortDir']} ");
+}
+
+// Create XML output
+header("content-type:text/xml;charset=utf-8");
+
+echo "<playlist version='1' xmlns='http://xspf.org/ns/0/'>\n";
+echo "	<title>".stripslashes(nggGallery::i18n($thepictures[0]->name))."</title>\n";
+echo "	<trackList>\n";
+
+if (is_array ($thepictures)){
+	foreach ($thepictures as $picture) {
+		echo "		<track>\n";
+		if (!empty($picture->description))	
+		echo "			<title>".strip_tags(stripslashes(html_entity_decode(nggGallery::i18n($picture->description, 'pic_' . $picture->pid . '_description'))))."</title>\n";
+		else if (!empty($picture->alttext))	
+		echo "			<title>".stripslashes(nggGallery::i18n($picture->alttext, 'pic_' . $picture->pid . '_alttext'))."</title>\n";
+		else 
+		echo "			<title>".$picture->filename."</title>\n";
+		echo "			<location>".$siteurl."/".$picture->path."/".$picture->filename."</location>\n";
+		echo "		</track>\n";
+	}
+}
+ 
+echo "	</trackList>\n";
+echo "</playlist>\n";
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/xml/json.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/xml/json.php
new file mode 100644
index 0000000000000000000000000000000000000000..781ffaabf1259b4c0272165855ff40fdab81f3dc
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/xml/json.php
@@ -0,0 +1,275 @@
+<?php
+/**
+* REST Application Programming Interface PHP class for the WordPress plugin NextGEN Gallery
+* Should emulate some kind of Flickr JSON callback : ?callback=json&format=json&api_key=1234567890&method=search&term=myterm
+* 
+* @version      1.1.0
+* @author Alex Rabe 
+* 
+* @require		PHP 5.2.0 or higher
+* 
+*/
+
+class nggAPI {
+
+	/**
+	  *	$_GET Variables 
+	  * 
+	  * @since 1.5.0
+	  * @access private
+	  * @var string
+	  */
+    var $format		=	false;		// $_GET['format'] 	: Return a XML oder JSON output
+	var $api_key	=	false;		// $_GET['api_key']	: Protect the access via a random key (required if user is not logged into backend)
+	var $method		=	false;		// $_GET['method']	: search | gallery | image | album | tag | autocomplete
+	var $term		=	false;		// $_GET['term']   	: The search term (required for method search | tag)
+	var $id			=	false;		// $_GET['id']	  	: object id (required for method gallery | image | album )
+	var $limit		=	false;		// $_GET['limit']	: maximum of images which we request
+    var $type		=	false;		// $_GET['type']	: gallery | image | album (required for method autocomplete)
+    
+	/**
+	 * Contain the final output
+	 *
+	 * @since 1.5.0
+	 * @access private
+	 * @var string
+	 */	
+	var $output		=	'';
+
+	/**
+	 * Holds the requested information as array
+	 *
+	 * @since 1.5.0
+	 * @access private
+	 * @var array
+	 */	
+	var $result		=	'';
+	
+	/**
+	 * Init the variables
+	 * 
+	 */	
+	function __construct() {
+		
+        if ( !defined('ABSPATH') )
+            die('You are not allowed to call this page directly.');
+
+		if ( !function_exists('json_encode') )
+			wp_die('Json_encode not available. You need to use PHP 5.2');
+		
+		// Read the parameter on init
+		$this->format 	= isset($_GET['format']) ? strtolower( $_GET['format'] ) : false;
+		$this->api_key 	= isset($_GET['api_key'])? $_GET['api_key'] : false; 
+		$this->method 	= isset($_GET['method']) ? strtolower( $_GET['method'] ) : false; 
+		$this->term		= isset($_GET['term'])   ? urldecode( $_GET['term'] ) : false; 
+		$this->id 		= isset($_GET['id'])     ? (int) $_GET['id'] : 0;
+		$this->limit 	= isset($_GET['limit'])  ? (int) $_GET['limit'] : 0;
+        $this->type		= isset($_GET['type'])   ? strtolower( $_GET['type'] ) : false; 		
+		$this->result	= array();
+        $this->list     = false;
+		
+		$this->start_process();
+		$this->render_output();
+	}
+
+	function start_process() {
+	   
+        global $ngg;
+		
+		if ( !$this->valid_access() ) 
+			return;
+		
+		switch ( $this->method ) {
+			case 'search' :
+				//search for some images
+				$this->result['images'] = array_merge( (array) nggdb::search_for_images( $this->term ), (array) nggTags::find_images_for_tags( $this->term , 'ASC' ));
+			break;
+			case 'album' :
+				//search for some album  //TODO : Get images for each gallery, could end in a big db query
+				$this->result['album'] = nggdb::find_album( $this->id );
+			break;            
+			case 'gallery' :
+				//search for some gallery
+				$this->result['images'] = ($this->id == 0) ? nggdb::find_last_images( 0 , 100 ) : nggdb::get_gallery( $this->id, $ngg->options['galSort'], $ngg->options['galSortDir'], true, 0, 0, true );
+			break;
+			case 'image' :
+				//search for some image
+				$this->result['images'] = nggdb::find_image( $this->id );
+			break;
+			case 'tag' :
+				//search for images based on tags
+				$this->result['images'] = nggTags::find_images_for_tags( $this->term , 'ASC' );
+			break;
+			case 'recent' :
+				//search for images based on tags
+				$this->result['images'] = nggdb::find_last_images( 0 , $this->limit );
+			break;
+			case 'autocomplete' :
+				//return images, galleries or albums for autocomplete drop down list
+				return $this->autocomplete();                
+			break;
+			case 'version' :
+				$this->result = array ('stat' => 'ok', 'version' => $ngg->version);
+				return;           
+			break;
+			default :
+				$this->result = array ('stat' => 'fail', 'code' => '98', 'message' => 'Method not known.');
+				return false;	
+			break;		
+		}
+
+		// result should be fine	
+		$this->result['stat'] = 'ok';	
+	}
+	
+	function valid_access() {
+		
+		// if we are logged in, then we can go on
+		if ( is_user_logged_in() )
+			return true;
+		
+		//TODO:Implement an API KEY check later
+		if 	($this->api_key != false)
+			return true;
+		
+		$this->result = array ('stat' => 'fail', 'code' => '99', 'message' => 'Insufficient permissions. Method requires read privileges; none granted.');
+		return false;
+	}
+
+	/**
+	 * return search result for autocomplete request from backend
+	 * 
+     * @since 1.7.0
+	 * @return void
+	 */
+	function autocomplete() {
+        global $nggdb;
+        
+        switch ( $this->type ) {
+			case 'image' :
+            
+                // return the last entries in case of an empty search string
+                if ( empty($this->term) )
+				    $list = $nggdb->find_last_images(0, $this->limit, false);
+                else
+                    $list = $nggdb->search_for_images($this->term, $this->limit);
+                    
+                if( is_array($list) ) {
+        			foreach($list as $image) {
+                        // reorder result to array-object
+                        $obj = new stdClass();
+                        $obj->id = $image->pid;
+                        $name = ( empty($image->alttext) ? $image->filename : $image->alttext );
+                        //TODO : need to rework save/load 
+                        $name = stripslashes( htmlspecialchars_decode($name, ENT_QUOTES));
+                        $obj->label = $image->pid . ' - ' . $name;
+                        $obj->value = $name;
+                        $this->result[] = $obj;
+        			}
+        		}
+
+                return $this->result;
+            break;
+			case 'gallery' :
+            
+                if ( empty($this->term) )
+                    $list = $nggdb->find_all_galleries('gid', 'DESC', false, $this->limit );
+                else
+                    $list = $nggdb->search_for_galleries($this->term, $this->limit);   
+                     
+                if( is_array($list) ) {
+        			foreach($list as $gallery) {
+                        // reorder result to array-object
+                        $obj = new stdClass();
+                        $obj->id = $gallery->gid;
+                        $name = ( empty($gallery->title) ) ? $gallery->name : $gallery->title;
+                        $name = stripslashes( htmlspecialchars_decode($name, ENT_QUOTES));
+                        $obj->label = $gallery->gid . ' - ' . $name;
+                        $obj->value = $name;
+                        $this->result[] = $obj;
+        			}
+        		}
+                return $this->result;
+            break;
+			case 'album' :
+            
+                if ( empty($this->term) )
+                    $list = $nggdb->find_all_album('id', 'DESC', $this->limit );
+                else
+                    $list = $nggdb->search_for_albums($this->term, $this->limit); 
+                                    
+                if( is_array($list) ) {
+        			foreach($list as $album) {
+                        // reorder result to array-object            			 
+                        $obj = new stdClass();
+                        $obj->id = $album->id;
+                        $album->name = stripslashes( htmlspecialchars_decode($album->name, ENT_QUOTES));
+                        $obj->label = $album->id . ' - ' . $album->name;
+                        $obj->value = $album->name;
+                        $this->result[] = $obj;
+        			}
+        		}
+                return $this->result;
+            break;
+			default :
+				$this->result = array ('stat' => 'fail', 'code' => '98', 'message' => 'Type not known.');
+				return false;	
+			break;	
+        }
+    }
+
+    /**
+     * Iterates through a multidimensional array
+     * 
+     * @author Boris Glumpler
+     * @param array $arr
+     * @return void
+     */
+    function create_xml_array( &$arr )
+    {
+        $xml = '';
+        
+        if( is_object( $arr ) )
+            $arr = get_object_vars( $arr );
+
+        foreach( (array)$arr as $k => $v ) {
+            if( is_object( $v ) )
+                $v = get_object_vars( $v );
+            //nodes must contain letters   
+            if( is_numeric( $k ) )
+                $k = 'id-'.$k;                
+            if( is_array( $v ) )
+                $xml .= "<$k>\n". $this->create_xml_array( $v ). "</$k>\n";
+            else
+                $xml .= "<$k>$v</$k>\n";
+        }
+        
+        return $xml;
+    }
+	
+	function render_output() {
+		
+		if ($this->format == 'json') {
+			header('Content-Type: application/json; charset=' . get_option('blog_charset'), true);
+			$this->output = json_encode($this->result);
+		} else {
+			header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
+			$this->output  = "<?xml version='1.0' encoding='UTF-8' standalone='yes'?>\n";
+			$this->output .= "<nextgen-gallery>" . $this->create_xml_array( $this->result )  . "</nextgen-gallery>\n";
+		}	
+		
+	}
+
+	/**
+	 * PHP5 style destructor and will run when the class is finished.
+	 *
+	 * @return output
+	 */
+	function __destruct() {
+		echo $this->output;
+	}
+
+}
+
+// let's use it
+$nggAPI = new nggAPI;
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/xml/media-rss.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/xml/media-rss.php
new file mode 100644
index 0000000000000000000000000000000000000000..fa80a4b9a7c3bdf3fb34a007c1be7fb5ccbdfa47
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/xml/media-rss.php
@@ -0,0 +1,123 @@
+<?php
+/**
+* Media RSS presenting the pictures in counter chronological order.
+* 
+* @author Vincent Prat (http://www.vincentprat.info)
+*
+* @param mode The content we want to display (last_pictures|gallery|album). 
+* 			  Defaults to last_pictures.
+* 
+* Parameters for mode = last_pictures
+* 
+* 	@param page The current picture ID (defaults to 0)
+* 	@param show The number of pictures to include in one field (default 10) 
+* 
+* Parameters for mode = gallery
+* 
+* 	@param gid The gallery ID to show (defaults to first gallery)
+* 	@param prev_next Whether to link to previous and next galleries (true|false).
+* 					 Default to false.
+* 
+* Parameters for mode = album
+* 
+* 	@param aid The album ID to show
+*/
+
+// Load required files and set some useful variables
+require_once(dirname(__FILE__) . "/../ngg-config.php");
+require_once(dirname(__FILE__) . "/../lib/media-rss.php");
+
+// Check we have the required GET parameters
+$mode = isset ($_GET['mode']) ? $_GET['mode'] : 'last_pictures';
+
+// Act according to the required mode
+$rss = '';
+if ( $mode == 'last_pictures' ) {
+	
+	// Get additional parameters
+	$page = isset ($_GET['page']) ? (int) $_GET['page'] : 0;
+	$show = isset ($_GET['show']) ? (int) $_GET['show'] : 10;
+	
+	$rss = nggMediaRss::get_last_pictures_mrss($page, $show);
+    	
+} else if ( $mode == 'gallery' ) {
+		
+	// Get all galleries
+	$galleries = $nggdb->find_all_galleries();
+
+	if ( count($galleries) == 0 ) {
+		header('content-type:text/plain;charset=utf-8');
+		echo sprintf(__("No galleries have been yet created.","nggallery"), $gid);
+		exit;
+	}
+	
+	// Get additional parameters
+	$gid = isset ($_GET['gid']) ? (int) $_GET['gid'] : 0;
+	
+	//if no gid is present, take the first gallery
+	if ( $gid == 0 ) {
+        $first = current($galleries);
+        $gid = $first->gid;
+	}
+	    
+	
+	// Set the main gallery object
+	$gallery = $galleries[$gid];
+	
+	if (!isset($gallery) || $gallery==null) {
+		header('content-type:text/plain;charset=utf-8');
+		echo sprintf(__("The gallery ID=%s does not exist.","nggallery"), intval($gid) );
+		exit;
+	}
+
+	// show other galleries if needed
+	$prev_next = ( isset($_GET['prev_next']) && $_GET['prev_next'] == 'true' ) ? true : false;
+	$prev_gallery = $next_gallery =  null;
+	
+	// Get previous and next galleries if required
+	if ($prev_next) {
+		reset($galleries);
+		while( current($galleries) ){
+ 			if( key($galleries) == $gid )
+				break;
+			next($galleries);
+		}
+		// one step back
+		$prev_gallery  = prev( $galleries);
+		// two step forward... Could be easier ? How ?
+		next($galleries);
+		$next_gallery  = next($galleries);
+	}
+
+	$rss = nggMediaRss::get_gallery_mrss($gallery, $prev_gallery, $next_gallery);	
+	
+} else if ( $mode == 'album' ) {
+	
+	// Get additional parameters
+    $aid = isset ($_GET['aid']) ? (int) $_GET['aid'] : 0;	
+	if ( $aid == 0 ) {
+		header('content-type:text/plain;charset=utf-8');
+		_e("No album ID has been provided as parameter", "nggallery");
+		exit;
+	}
+	
+	// Get the album object
+	$album = nggdb::find_album($aid);
+	if (!isset($album) || $album==null ) {
+		header('content-type:text/plain;charset=utf-8');
+		echo sprintf(__("The album ID=%s does not exist.", "nggallery"), intval($aid) );
+		exit;
+	}
+	
+	$rss = nggMediaRss::get_album_mrss($album);	
+} else {
+	header('content-type:text/plain;charset=utf-8');
+	echo __('Invalid MediaRSS command', 'nggallery');
+	exit;
+}
+
+
+// Output header for media RSS
+header("content-type:text/xml;charset=utf-8");
+echo "<?xml version='1.0' encoding='UTF-8' standalone='yes'?>\n";
+echo $rss;
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/adapter.routing_app_factory.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/adapter.routing_app_factory.php
new file mode 100644
index 0000000000000000000000000000000000000000..ec82508c68977ed34402d5d83110c5ff84526a13
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/adapter.routing_app_factory.php
@@ -0,0 +1,9 @@
+<?php
+
+class A_Routing_App_Factory extends Mixin
+{
+    function routing_app($context = FALSE, $router = FALSE)
+    {
+        return new C_Routing_App($context, $router);
+    }
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/class.http_response_controller.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/class.http_response_controller.php
new file mode 100644
index 0000000000000000000000000000000000000000..bd0fa3b5f0666767ec27adb5338542164dd980ba
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/class.http_response_controller.php
@@ -0,0 +1,47 @@
+<?php
+
+class C_Http_Response_Controller extends C_MVC_Controller
+{
+	static $_instances = array();
+
+	function define($context=FALSE)
+	{
+		parent::define($context);
+		$this->add_mixin('Mixin_Http_Response_Actions');
+		$this->implement('I_Http_Response');
+	}
+
+	static function get_instance($context=FALSE)
+	{
+		if (!isset(self::$_instances[$context])) {
+			$klass = get_class();
+			self::$_instances[$context] = new $klass($context);
+		}
+		return self::$_instances[$context];
+	}
+}
+
+class Mixin_Http_Response_Actions extends Mixin
+{
+	function http_301_action()
+	{
+		header('HTTP/1.1 301 Permanent Redirect');
+		header("Location: {$this->object->get_routed_url()}");
+	}
+
+	function http_302_action()
+	{
+		header('HTTP/1.1 302 Temporary Redirect');
+		header("Location: {$this->object->get_routed_url()}");
+	}
+
+	function http_500_action()
+	{
+
+	}
+
+	function http_404_action()
+	{
+
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/class.router.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/class.router.php
new file mode 100644
index 0000000000000000000000000000000000000000..f7a6d9aae278fc35228cc0a6ffa08347531f7dd2
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/class.router.php
@@ -0,0 +1,299 @@
+<?php
+
+class Mixin_Router extends Mixin
+{
+	function set_routed_app($app)
+    {
+        $this->object->_routed_app = $app;
+    }
+
+    function &get_routed_app()
+    {
+		$retval = $this->object->_routed_app ? $this->object->_routed_app : $this->object->get_default_app();
+        return $retval;
+    }
+
+	function &get_default_app()
+	{
+		if (is_null($this->object->_default_app))
+			$this->object->_default_app = $this->object->create_app();
+		$retval = $this->object->_default_app;
+
+		return $retval;
+	}
+
+	function route($patterns, $handler=FALSE)
+	{
+		$this->object->get_default_app()->route($patterns, $handler);
+	}
+
+	function rewrite($src, $dst, $redirect=FALSE)
+	{
+		$this->object->get_default_app()->rewrite($src, $dst, $redirect);
+	}
+
+	function get_parameter($key, $prefix=NULL, $default=NULL)
+	{
+		return $this->object->get_routed_app()->get_parameter($key, $prefix, $default);
+	}
+
+	function param($key, $prefix=NULL, $default=NULL)
+	{
+		return $this->object->get_parameter($key, $prefix, $default);
+	}
+
+	function has_parameter_segments()
+	{
+		return $this->object->get_routed_app()->has_parameter_segments();
+	}
+
+	function passthru()
+	{
+		return $this->object->get_default_app()->passthru();
+	}
+
+	/**
+	 * Gets url for the router
+	 * @param string $uri
+	 * @return string
+	 */
+	function get_url($uri='/', $with_qs=TRUE, $site_url = FALSE)
+	{
+		$retval = $this->object->join_paths(
+			$this->object->get_base_url($site_url),
+			$uri
+		);
+		if ($with_qs) {
+			$parts = parse_url($retval);
+			if (!isset($parts['query']))
+				$parts['query'] = $this->object->get_querystring();
+			else
+				$parts['query'] = $this->object->join_querystrings($parts['query'], $this->object->get_querystring());
+
+			$retval = $this->object->construct_url_from_parts($parts);
+
+		}
+		return $retval;
+	}
+
+	/**
+	 * Currents the relative url
+	 * @param string $uri
+	 * @param boolean $with_qs
+	 * @return string
+	 */
+	function get_relative_url($uri='/', $with_qs=TRUE)
+	{
+		$url = $this->object->get_url($uri, $with_qs=TRUE);
+		$retval = str_replace($this->object->get_base_url(), '', $url);
+		if (strpos($retval, '/') !== 0) $retval = '/'.$retval;
+		return $retval;
+	}
+
+
+	/**
+	 * Returns a static url
+	 * @param string $path
+	 * @param string $module
+	 * @return string
+	 */
+	function get_static_url($path, $module=FALSE)
+	{
+		$fs = $this->get_registry()->get_utility('I_Fs');
+		$path = $fs->find_abspath($path, $module);
+
+		$base_url = $this->object->get_base_url(TRUE);
+		$base_url = $this->object->remove_url_segment('/index.php', $base_url);
+
+		$path = str_replace(
+			$fs->get_document_root(),
+			$base_url,
+			$path
+		);
+
+        // adjust for possible windows hosts
+        $path = str_replace('\\', '/', $path);
+        return $path;
+	}
+
+
+	/**
+	 * Gets the routed url
+	 * @returns string
+	 */
+	function get_routed_url()
+	{
+		$retval = $this->object->get_url($this->object->get_request_uri());
+
+		if (($app = $this->object->get_routed_app())) {
+			$retval = $this->object->get_url($app->get_app_uri());
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Gets the base url for the router
+     *
+     * @param bool $site_url Unused
+	 * @return string
+	 */
+	function get_base_url($site_url = FALSE)
+	{
+		$protocol = $this->object->is_https()? 'https://' : 'http://';
+		$retval = "{$protocol}{$_SERVER['SERVER_NAME']}{$this->object->context}";
+		return untrailingslashit($retval);
+	}
+
+	/**
+	 * Determines if the current request is over HTTPs or not
+	 */
+	function is_https()
+	{
+		return (
+			(!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off') || 
+			(!empty($_SERVER['HTTP_USESSL']) && strtolower($_SERVER['HTTP_USESSL']) !== 'off') || 
+			(!empty($_SERVER['REDIRECT_HTTPS']) && strtolower($_SERVER['REDIRECT_HTTPS']) !== 'off') || 
+			$_SERVER['SERVER_PORT'] == 443);
+	}
+
+
+    /**
+     * Serve request using defined Routing Apps
+     *
+     * @param string|FALSE $request_uri
+     */
+    function serve_request()
+    {
+		$served = FALSE;
+		
+        // iterate over all apps, and serve the route
+        foreach ($this->object->get_apps() as $app) {
+            if (($served = $app->serve_request($this->object->context)))
+                break;
+        }
+
+		return $served;
+    }
+
+	/**
+	 * Gets the querystring of the current request
+	 * @return string
+	 */
+	function get_querystring()
+	{
+		return isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : null ;
+	}
+
+
+	function set_querystring($value)
+	{
+		$_SERVER['QUERY_STRING'] = $value;
+	}
+
+	/**
+	 * Gets the request for the router
+	 * @return string
+	 */
+    function get_request_uri($with_params=TRUE)
+    {
+		if (isset($_SERVER['PATH_INFO']))
+			$retval = $_SERVER['PATH_INFO'];
+		elseif (isset($_SERVER['ORIG_REQUEST_URI']))
+			$retval = $_SERVER['ORIG_REQUEST_URI'];
+		else
+			$retval = $_SERVER['REQUEST_URI'];
+
+		// Remove the querystring
+		if (($index = strpos($retval, '?')) !== FALSE) {
+			$retval = substr($retval, 0, $index);
+		}
+
+		// Remove the router's context
+		$retval = preg_replace('#^'.preg_quote($this->object->context, '#').'#', '', $retval);
+
+		// Remove the params
+		if (!$with_params)
+			$retval = $this->object->strip_param_segments($retval);
+
+		// Ensure that request uri starts with a slash
+		if (strpos($retval, '/') !== 0) $retval = "/{$retval}";
+
+		return $retval;
+    }
+
+	/**
+	 * Gets the method of the HTTP request
+	 * @return string
+	 */
+	function get_request_method()
+	{
+		return $this->object->_request_method;
+	}
+
+
+    function &create_app($name = '/')
+    {
+        $factory = $this->get_registry()->get_utility('I_Component_Factory');
+        $app = $factory->create('routing_app', $name);
+        $this->object->_apps[] = $app;
+        return $app;
+    }
+
+    /**
+     * Gets a list of apps registered for the router
+     *
+     * @return array
+     */
+    function get_apps()
+    {
+        usort($this->object->_apps, array(&$this, '_sort_apps'));
+		return array_reverse($this->object->_apps);
+    }
+
+	/**
+	 * Sorts apps.This is needed because we want the most specific app to be
+	 * executed first
+	 * @param C_Routed_App $a
+	 * @param C_Routed_App $b
+	 * @return int
+	 */
+	function _sort_apps($a, $b)
+	{
+		return strnatcmp($a->context, $b->context);
+	}
+}
+
+/**
+ * A router is configured to match patterns against a url and route the request to a particular controller and action
+ */
+class C_Router extends C_Component
+{
+    static $_instances	= array();
+	var $_apps			= array();
+	var $_default_app	= NULL;
+
+    function define($context = FALSE)
+    {
+		if (!$context OR $context == 'all') $context = '/';
+		parent::define($context);
+		$this->add_mixin('Mixin_Url_Manipulation');
+        $this->add_mixin('Mixin_Router');
+		$this->implement('I_Router');
+    }
+
+	function initialize()
+	{
+		parent::initialize();
+		$this->_request_method	= $_SERVER['REQUEST_METHOD'];
+	}
+
+    static function &get_instance($context = False)
+    {
+		if (!isset(self::$_instances[$context])) {
+			$klass = get_class();
+			self::$_instances[$context] = new $klass($context);
+		}
+		return self::$_instances[$context];
+    }
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/class.router_installer.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/class.router_installer.php
new file mode 100644
index 0000000000000000000000000000000000000000..9b3cc474e479b012da2f3aa657047403f639491d
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/class.router_installer.php
@@ -0,0 +1,12 @@
+<?php
+
+class C_Router_Installer
+{
+	function install()
+	{
+		$settings = C_NextGen_Settings::get_instance();
+		$settings->set_default_value('router_param_separator', '--');
+		$settings->set_default_value('router_param_prefix', '');
+		$settings->set_default_value('router_param_slug', 'nggallery');
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/class.routing_app.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/class.routing_app.php
new file mode 100644
index 0000000000000000000000000000000000000000..36ad05b11de5520bd2cf8dd27097ea0c0b8ad850
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/class.routing_app.php
@@ -0,0 +1,824 @@
+<?php
+class Mixin_Routing_App extends Mixin
+{
+    /**
+     * Creates a new route endpoint with the assigned handler
+     *
+     * @param array $routes URL to route, eg /page/{page}/
+     * @param array $handler Formatted array
+     */
+    function route($routes, $handler)
+    {
+        // ensure that the routing patterns array exists
+        if (!is_array($this->object->_routing_patterns))
+            $this->object->_routing_patterns = array();
+
+        if (!is_array($routes))
+            $routes = array($routes);
+
+        // fetch all routing patterns
+        $patterns = $this->object->_routing_patterns;
+
+        foreach ($routes as $route) {
+            // add the routing pattern
+            $patterns[$this->object->_route_to_regex($route)] = $handler;
+        }
+
+        // update routing patterns
+        $this->object->_routing_patterns = $patterns;
+    }
+
+    /**
+     * Handles internal url rewriting with optional HTTP redirection,
+     *
+     * @param string $src Original URL
+     * @param string $dst Destination URL
+     * @param bool $redirect FALSE for internal handling, otherwise the HTTP code to send
+     */
+    function rewrite($src, $dst, $redirect = FALSE, $stop=FALSE)
+    {
+        // ensure that rewrite patterns array exists
+        if (!is_array($this->object->_rewrite_patterns))
+            $this->object->_rewrite_patterns = array();
+
+        // fetch all rewrite patterns
+        $patterns = $this->object->_rewrite_patterns;
+
+		// Assign rewrite definition
+		$definition = array(
+			'dst' => $dst, 'redirect' => $redirect, 'stop'	=> $stop
+		);
+
+		// We treat wildcards much differently then normal rewrites
+		if (preg_match("/\\{[\\.\\\\*]/", $src)) {
+			$pattern  = str_replace('{*}',	'(.*?)',  $src);
+			$pattern  = str_replace('{.*}', '(.*?)',	 $pattern);
+			$pattern  = str_replace('{\\w}', '([\\w-_]*)', $pattern);
+			$pattern  = str_replace('{\\d}', '(\\d*)', $pattern);
+			$src = '#'.(strpos($src, '/') === 0 ? '^':'').$pattern.'/?$#';
+			$definition['wildcards'] = TRUE;
+		}
+
+		// Normal rewrite
+		else $src = $this->object->_route_to_regex($src);
+
+        // add the rewrite pattern
+        $patterns[$src] = $definition;
+
+        // update rewrite patterns;
+        $this->object->_rewrite_patterns = $patterns;
+    }
+
+	/**
+	 * Gets an instance of the router
+	 * @return type
+	 */
+	function get_router()
+	{
+		return $this->object->get_registry()->get_utility('I_Router');
+	}
+
+	function get_app_url($request_uri=FALSE, $with_qs=FALSE)
+	{
+		return $this->object->get_router()->get_url($this->object->get_app_uri($request_uri), $with_qs);
+	}
+
+
+	function get_routed_url($with_qs=TRUE)
+	{
+		return $this->object->get_app_url(FALSE, $with_qs);
+	}
+
+	function get_app_uri($request_uri=FALSE)
+	{
+		if (!$request_uri) $request_uri = $this->object->get_app_request_uri();
+		return $this->object->join_paths(
+			$this->object->context,
+			$request_uri
+		);
+	}
+
+	function get_app_request_uri()
+	{
+		$retval = FALSE;
+
+		if ($this->object->_request_uri) $retval = $this->object->_request_uri;
+		else if (($retval = $this->object->does_app_serve_request())) {
+			if (strpos($retval, '/') !== 0) $retval = '/'.$retval;
+			$this->object->set_app_request_uri($retval);
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Sets the application request uri
+	 * @param type $uri
+	 */
+	function set_app_request_uri($uri)
+	{
+		$this->object->_request_uri = $uri;
+	}
+
+	/**
+	 * Gets the application's routing regex pattern
+	 * @return string
+	 */
+	function get_app_routing_pattern()
+	{
+		return $this->object->_route_to_regex($this->object->context);
+	}
+
+
+	/**
+	 * Determines whether this app serves the request
+	 * @return boolean|string
+	 */
+	function does_app_serve_request()
+	{
+		$retval = FALSE;
+
+		$request_uri = $this->object->get_router()->get_request_uri(TRUE);
+
+		// Is the context present in the uri?
+		if (($index = strpos($request_uri, $this->object->context)) !== FALSE) {
+			$starts_with_slash = strpos($this->object->context, '/') === 0;
+			if (($starts_with_slash && $index === 0) OR (!$starts_with_slash)) {
+				$regex = implode('', array(
+					'#',
+					($starts_with_slash ? '^':''),
+					preg_quote($this->object->context, '#'),
+					'#'
+				));
+				$retval = preg_replace($regex, '', $request_uri);
+				if (!$retval) $retval = '/';
+				if (strpos($retval, '/') !== 0) $retval = '/'.$retval;
+				if (substr($retval, -1) != '/') $retval = $retval.'/';
+			}
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Performs the url rewriting routines. Returns the HTTP status code used to
+	 * redirect, if we're to do so. Otherwise FALSE
+	 * @return int|bool
+	 */
+	function do_rewrites($request_uri=FALSE)
+	{
+		$redirect = FALSE;
+
+		// Get the request uri if not provided
+		if (!$request_uri) $request_uri = $this->object->get_app_request_uri();
+
+		// ensure that rewrite patterns array exists
+        if (!is_array($this->object->_rewrite_patterns))
+            $this->object->_rewrite_patterns = array();
+
+		// Process each rewrite rule
+		// start rewriting urls
+		foreach ($this->object->_rewrite_patterns as $pattern => $details) {
+
+			// Remove this pattern from future processing for this request
+			unset($this->object->_rewrite_patterns[$pattern]);
+
+			// Wildcards are processed much differently
+			if (isset($details['wildcards']) && $details['wildcards']) {
+				if (preg_match($pattern, $request_uri, $matches)) {
+					foreach ($matches as $index => $match) {
+						if ($index == 0) {
+							$request_uri = str_replace($match, $details['dst'], $request_uri);
+							continue;
+						}
+						$request_uri = str_replace(
+							"{{$index}}", $match, $request_uri
+						);
+					}
+
+					// Set the redirect flag if we're to do so
+					if (isset($details['redirect']) && $details['redirect']) {
+						$redirect = $details['redirect'] === TRUE ?
+							302 : intval($details['redirect']);
+						break;
+					}
+
+					// Stop processing rewrite patterns?
+					if ($details['stop']) break;
+				}
+			}
+
+			// Normal rewrite pattern
+			elseif (preg_match_all($pattern, $request_uri, $matches, PREG_SET_ORDER))
+			{
+				// Assign new request URI
+				$request_uri = $details['dst'];
+
+				// Substitute placeholders
+				foreach ($matches as $match) {
+					if ($redirect) break;
+					foreach ($match as $key => $val) {
+
+						// If we have a placeholder that needs swapped, swap
+						// it now
+						if (is_numeric($key)) continue;
+						$request_uri = str_replace("{{$key}}", $val, $request_uri);
+					}
+					// Set the redirect flag if we're to do so
+					if (isset($details['redirect']) && $details['redirect']) {
+						$redirect = $details['redirect'] === TRUE ?
+							302 : intval($details['redirect']);
+						break;
+					}
+
+				}
+			}
+		}
+
+		// Cache all known data about the application request
+		$this->object->set_app_request_uri($request_uri);
+		$this->object->get_router()->set_routed_app($this->object);
+
+		return $redirect;
+	}
+
+
+    /**
+     * Determines if the current routing app meets our requirements and serves them
+     *
+     * @return bool
+     */
+    function serve_request()
+    {
+        $served = FALSE;
+
+        // ensure that the routing patterns array exists
+        if (!is_array($this->object->_routing_patterns))
+            $this->object->_routing_patterns = array();
+
+        // if the application root matches, then we'll try to route the request
+        if (($request_uri = $this->object->get_app_request_uri())){
+
+			// Perform URL rewrites
+			$redirect = $this->object->do_rewrites($request_uri);;
+
+			// Are we to perform a redirect?
+			if ($redirect) {
+				$this->object->execute_route_handler(
+					$this->object->parse_route_handler($redirect)
+				);
+			}
+
+			// Handle routed endpoints
+			else {
+				foreach ($this->object->_routing_patterns as $pattern => $handler) {
+					if (preg_match($pattern, $this->object->get_app_request_uri(), $matches)) {
+						$served = TRUE;
+
+						// Add placeholder parameters
+						foreach ($matches as $key => $value) {
+							if (is_numeric($key)) continue;
+							$this->object->set_parameter_value($key, $value, NULL);
+						}
+
+						// If a handler is attached to the route, execute it. A
+						// handler can be
+						// - FALSE, meaning don't do any post-processing to the route
+						// - A string, such as controller#action
+						// - An array: array(
+						//   'controller' => 'I_Test_Controller',
+						//   'action'	  => 'index',
+						//   'context'	  => 'all', (optional)
+						//   'method'	  => array('GET') (optional)
+						// )
+						if ($handler && $handler = $this->object->parse_route_handler($handler)) {
+							// Is this handler for the current HTTP request method?
+							if (isset($handler['method'])) {
+								if (!is_array($handler['method'])) $handler['$method'] = array($handler['method']);
+								if (in_array($this->object->get_router()->get_request_method(), $handler['method'])) {
+									$this->object->execute_route_handler($handler);
+								}
+							}
+
+							// This handler is for all request methods
+							else {
+								$this->object->execute_route_handler($handler);
+							}
+						}
+						else if (!$handler) {
+							$this->object->passthru();
+						}
+					}
+				}
+			}
+        }
+
+        return $served;
+    }
+
+	/**
+	 * Executes an action of a particular controller
+	 * @param array $handler
+	 */
+	function execute_route_handler($handler)
+	{
+		// Get action
+		$action = $handler['action'];
+
+		// Get controller
+		$controller = $this->object->get_registry()->get_utility(
+			$handler['controller'], $handler['context']
+		);
+
+		// Call action
+		$controller->$action();
+
+		// Clean Exit (fastcgi safe)
+		C_NextGEN_Bootstrap::shutdown();
+	}
+
+	/**
+	 * Parses the route handler
+	 * @param mixed $handler
+	 * @return array
+	 */
+	function parse_route_handler($handler)
+	{
+		if (is_string($handler)) {
+			$handler = array_combine(array('controller', 'action'), explode('#', $handler));
+		}
+		elseif (is_numeric($handler)) {
+			$handler = array(
+				'controller'	=>	'I_Http_Response',
+				'action'		=>	'http_'.$handler,
+			);
+		}
+		if (!isset($handler['context'])) $handler['context'] = FALSE;
+		if (strpos($handler['action'], '_action') === FALSE) $handler['action'] .= '_action';
+
+		return $handler;
+	}
+
+
+	function add_placeholder_params_from_matches($matches)
+	{
+		// Add the placeholder parameter values to the _params array
+		foreach ($matches as $key => $value) {
+			if (is_numeric($key)) continue;
+			$this->object->add_placeholder_param(
+				$key, $value, $matches[0]
+			);
+		}
+	}
+
+	/**
+	 * Used to pass execution to PHP and perhaps an above framework
+	 */
+	function passthru()
+	{
+	}
+
+
+	/**
+	 * Adds a placeholder parameter
+	 * @param string $name
+	 * @param stirng $value
+	 * @param string $source
+	 */
+	function add_placeholder_param($name, $value, $source=NULL)
+	{
+		if (!is_array($this->object->_parameters)) {
+			$this->object->_parameters = array('global');
+		}
+		if (!isset($this->object->_parameters['global'])) {
+			$this->object->_parameters['global'] = array();
+		}
+		$this->object->_parameters['global'][] = array(
+			'id'	=>	'',
+			'name'	=>	$name,
+			'value'	=>	$value,
+			'source'=>	$source
+		);
+	}
+
+    /**
+     * Converts the route to the regex
+     *
+     * @param string $route
+     * @return string
+     */
+    function _route_to_regex($route)
+    {
+		// Get the settings manager
+		$settings = $this->object->_settings;
+		$param_slug = $settings->router_param_slug;
+
+        // convert route to RegEx pattern
+        $route_regex = preg_quote(
+            str_replace(
+                array('{', '}'),
+                array('~', '~'),
+                $route
+            ), '#'
+        );
+
+		// Wrap the route
+		$route_regex = '('.$route_regex.')';
+
+		// If the route starts with a slash, then it must appear at the beginning
+		// of a request uri
+		if (strpos($route, '/') === 0) $route_regex = '^'.$route_regex;
+
+		// If the route is not /, and perhaps /foo, then we need to optionally
+		// look for a trailing slash as well
+		if ($route != '/') $route_regex .= '/?';
+
+		// If parameters come after a slug, it might appear as well
+		if ($param_slug) {
+			$route_regex .= "(".preg_quote($param_slug, '#').'/)?';
+		}
+
+		// Parameter might follow the request uri
+		$route_regex .= "(/?([^/]+\-\-)?[^/]+\-\-[^/]+/?){0,}";
+
+		// Create the regex
+        $route_regex = '#' . $route_regex . '/?$#i';
+
+        // convert placeholders to regex as well
+        return preg_replace('/~([^~]+)~/i', ($param_slug ? '('.preg_quote($param_slug,'#').'\K)?' : '').'(?P<\1>[^/]+)/?', $route_regex);
+    }
+
+	/**
+	 * Gets a request parameter from either the request uri or querystring
+	 * This method takes into consideration the values of the router_param_prefix
+	 * and router_param_separator settings when searching for the parameter
+	 *
+	 * Parameter can take on the following forms:
+	 * /key--value
+	 * /[MVC_PARAM_PREFIX]key--value
+	 * /[MVC_PARAM_PREFIX]-key--value
+	 * /[MVC_PARAM_PREFIX]_key--value
+	 * /id--key--value
+	 * /id--[MVC_PARAM_PREFIX]key--value
+	 * /id--[MVC_PARAM_PREFIX]-key--value
+	 * /id--[MVC_PARAM_PREFIX]_key--value
+	 *
+	 * @param string $key
+	 * @param mixed $id
+	 * @param mixed $default
+	 * @return mixed
+	 */
+	function get_parameter($key, $id=NULL, $default=NULL, $segment=FALSE, $url=FALSE)
+	{
+		$retval				= $default;
+		$settings			= $this->object->_settings;
+		$quoted_key			= preg_quote($key,'#');
+		$id					= $id ? preg_quote($id,'#') : "[^/]+";
+		$param_prefix		= preg_quote($settings->router_param_prefix,'#');
+		$param_sep			= preg_quote($settings->router_param_separator,'#');
+		$param_regex		= "#/((?P<id>{$id}){$param_sep})?({$param_prefix}[-_]?)?{$quoted_key}{$param_sep}(?P<value>[^/\?]+)/?#i";
+		$found				= FALSE;
+		$sources			= $url ? array('custom' => $url) : $this->object->get_parameter_sources();
+
+		foreach ($sources as $source_name => $source) {
+			if (preg_match($param_regex, $source, $matches)) {
+				if ($segment)
+					$retval = array('segment' => $matches[0], 'source' => $source_name);
+				else
+                    $retval = $matches['value'];
+				$found = TRUE;
+				break;
+			}
+		}
+
+		// Lastly, check the $_REQUEST
+		if (!$found && !$url && isset($_REQUEST[$key]))
+            $retval = $this->object->recursive_stripslashes($_REQUEST[$key]);
+
+		return $retval;
+	}
+
+	/**
+	 * Sets the value of a particular parameter
+	 * @param string $key
+	 * @param mixed $value
+	 * @param mixed $id
+	 */
+	function set_parameter_value($key, $value, $id=NULL, $use_prefix=FALSE, $url=FALSE)
+	{
+		// Remove the parameter from both the querystring and request uri
+		$retval		= $this->object->remove_parameter($key, $id, $url);
+
+		// Get the settings manager
+		$settings	= $this->object->_settings;
+		$param_slug = $settings->router_param_slug;
+
+		// We're modifying a url passed in
+		if ($url) {
+			$parts = parse_url($retval);
+			if (!isset($parts['path'])) $parts['path'] = '';
+			$parts['path'] = $this->object->join_paths(
+				$parts['path'],
+                $param_slug && strpos($parts['path'], $param_slug) === FALSE ? $param_slug : '',
+				$this->object->create_parameter_segment($key, $value, $id, $use_prefix)
+			);
+			$retval = $this->object->construct_url_from_parts($parts);
+		}
+
+		// We're modifying the current request
+		else {
+			// This parameter is being appended to the current request uri
+			$this->object->add_parameter_to_app_request_uri($key, $value, $id, $use_prefix);
+
+			// Return the new full url
+			$retval = $this->object->get_routed_url();
+		}
+
+		return trailingslashit($retval);
+	}
+
+	/**
+	 * Alias for remove_parameter()
+	 * @param string $key
+	 * @param mixed $id
+	 * @return string
+	 */
+	function remove_param($key, $id=NULL, $url=FALSE)
+	{
+		return $this->object->remove_parameter($key, $id, $url);
+	}
+
+	/**
+	 * Removes a parameter from the querystring and application request URI
+	 * and returns the full application URL
+	 * @param string $key
+	 * @param mixed $id
+	 * @return string
+	 */
+	function remove_parameter($key, $id=NULL, $url=FALSE)
+	{
+		$retval			= $url;
+		$settings		= $this->object->_settings;
+		$param_sep		= $settings->router_param_separator;
+		$param_prefix	= $settings->router_param_prefix ? preg_quote($settings->router_param_prefix, '#') : '';
+		$param_slug		= $settings->router_param_slug ? preg_quote($settings->router_param_slug, '#') : FALSE;
+
+		// Is the parameter already part of the request? If so, modify that
+		// parmaeter
+		if (($segment = $this->object->get_parameter_segment($key, $id, $url))) {
+ 			extract($segment);
+
+			if ($source == 'querystring') {
+				$preg_id	= $id ? '\d+' : preg_quote($id,'#');
+				$preg_key	= preg_quote($key, '#');
+				$regex = implode('', array(
+					'#',
+					$id ? "{$preg_id}{$param_sep}" : '',
+					"(({$param_prefix})?[-_]?)?{$preg_key}({$param_sep}|=)[^\/&]+&?#i"
+				));
+				$qs = preg_replace($regex, '', $this->get_router()->get_querystring());
+				$this->object->get_router()->set_querystring($qs);
+				$retval = $this->object->get_routed_url();
+			}
+			elseif ($source == 'request_uri') {
+				$uri = $this->object->get_app_request_uri();
+				$uri = $this->object->join_paths(explode($segment, $uri));
+				if ($settings->router_param_slug && preg_match("#{$param_slug}/?$#i", $uri, $match)) {
+					$retval = $this->object->remove_url_segment($match[0], $retval);
+				}
+				$this->object->set_app_request_uri($uri);
+				$retval = $this->object->get_routed_url();
+			}
+			else {
+				$retval = $this->object->join_paths(explode($segment, $url));
+				if ($settings->router_param_slug && preg_match("#/{$param_slug}$#i", $retval, $match)) {
+					$retval = $this->object->remove_url_segment($match[0], $retval);
+				}
+			}
+		}
+
+        $retval = rtrim($retval, ' ?&');
+
+		return $retval;
+	}
+
+
+	/**
+	 * Adds a parameter to the application's request URI
+	 * @param string $key
+	 * @param mixed $value
+	 * @param mixed $id
+	 */
+	function add_parameter_to_app_request_uri($key, $value, $id=NULL, $use_prefix=FALSE)
+	{
+		$settings	= $this->object->_settings;
+		$param_slug = $settings->router_param_slug;
+		
+		$uri		= $this->object->get_app_request_uri();
+		$parts		= array($uri);
+		if ($param_slug && strpos($uri, $param_slug) === FALSE) $parts[] = $param_slug;
+		$parts[]	= $this->object->create_parameter_segment($key, $value, $id, $use_prefix);
+		$this->object->set_app_request_uri($this->object->join_paths($parts));
+
+		return $this->object->get_app_request_uri();
+	}
+
+
+	/**
+	 * Creates a parameter segment
+	 * @param string $key
+	 * @param mixed $value
+	 * @param mixed $id
+	 * @return string
+	 */
+	function create_parameter_segment($key, $value, $id=NULL, $use_prefix=FALSE)
+	{
+		$settings	= $this->object->_settings;
+		if ($use_prefix) $key = $settings->router_param_prefix.$key;
+		if ($value === TRUE) $value = 1;
+		elseif ($value == FALSE) $value = 0; // null and false values
+		$retval = $key . $settings->router_param_separator . $value;
+		if ($id) $retval = $id . $settings->router_param_separator . $retval;
+		return $retval;
+	}
+
+	/**
+	 * Alias for set_parameter_value
+	 * @param string $key
+	 * @param mixed $value
+	 * @param mixed $id
+	 */
+	function set_parameter($key, $value, $id=NULL, $use_prefix=FALSE, $url=FALSE)
+	{
+		return $this->object->set_parameter_value($key, $value, $id, $use_prefix, $url);
+	}
+
+	/**
+	 * Alias for set_parameter_value
+	 * @param string $key
+	 * @param mixed $value
+	 * @param mixed $id
+	 */
+	function set_param($key, $value, $id=NULL, $use_prefix=FALSE, $url=FALSE)
+	{
+		return $this->object->set_parameter_value($key, $value, $id, $use_prefix=FALSE, $url);
+	}
+
+	/**
+	 * Gets a parameter's value
+	 * @param string $key
+	 * @param mixed $id
+	 * @param mixed $default
+	 * @return mixed
+	 */
+	function get_parameter_value($key, $id=NULL, $default=NULL, $url=FALSE)
+	{
+		return $this->object->get_parameter($key, $id, $default, FALSE, $url);
+	}
+
+	/**
+	 * Gets a parameter's matching URI segment
+	 * @param string $key
+	 * @param mixed $id
+	 * @param mixed $default
+	 * @return mixed
+	 */
+	function get_parameter_segment($key, $id=NULL, $url=FALSE)
+	{
+		return $this->object->get_parameter($key, $id, NULL, TRUE, $url);
+	}
+
+	/**
+	 * Gets sources used for parsing and extracting parameters
+	 * @return array
+	 */
+	function get_parameter_sources()
+	{
+		return array(
+			'querystring'	=>	$this->object->get_formatted_querystring(),
+			'request_uri'	=>	$this->object->get_app_request_uri(),
+			'postdata'		=>	$this->object->get_postdata()
+		);
+	}
+
+	function get_postdata()
+	{
+		$retval		= '/' . urldecode(file_get_contents("php://input"));
+		$settings	= $this->object->_settings;
+		$retval = str_replace(
+			array('&', '='),
+			array('/', $settings->router_param_separator),
+			$retval
+		);
+
+		return $retval;
+	}
+
+
+	function get_formatted_querystring()
+	{
+		$retval		= '/'.$this->object->get_router()->get_querystring();
+		$settings	= $this->object->_settings;
+		$retval		= str_replace(
+			array('&', '='),
+			array('/', $settings->router_param_separator),
+			$retval
+		);
+
+		return $retval;
+	}
+
+	function has_parameter_segments()
+	{
+		$retval			= FALSE;
+		$settings		= $this->object->_settings;
+		$request_uri	= $this->object->get_app_request_uri();
+		$sep			= preg_quote($settings->router_param_separator,'#');
+
+		// If we detect the MVC_PARAM_SLUG, then we assume that we have parameters
+		if ($settings->router_param_slug && strpos($request_uri, '/'.$settings->router_param_slug) !== FALSE) {
+			$retval = TRUE;
+		}
+
+		// If the above didn't pass, then we try finding parameters in our
+		// desired format
+		if (!$retval) {
+			$regex			= implode('', array(
+				'#',
+				$settings->router_param_slug ? '/'.preg_quote($settings->router_param_slug,'#').'/?' : '',
+				"(/?([^/]+{$sep})?[^/]+{$sep}[^/]+/?){0,}",
+				'$#'
+			));
+			$retval = preg_match($regex, $request_uri);
+		}
+
+		return $retval;
+	}
+
+    /**
+     * Recursively calls stripslashes() on strings, arrays, and objects
+     *
+     * @param mixed $value Value to be processed
+     * @return mixed Resulting value
+     */
+    function recursive_stripslashes($value)
+    {
+        if (is_string($value))
+        {
+            $value = stripslashes($value);
+        }
+        elseif (is_array($value)) {
+            foreach ($value as &$tmp) {
+                $tmp = $this->object->recursive_stripslashes($tmp);
+            }
+        }
+        elseif (is_object($value))
+        {
+            foreach (get_object_vars($value) as $key => $data) {
+                $value->{$key} = recursive_stripslashes($data);
+            }
+        }
+
+        return $value;
+    }
+}
+
+class C_Routing_App extends C_Component
+{
+    static $_instances		= array();
+	var    $_request_uri	= FALSE;
+	var $_settings = null;
+
+    function define($context= FALSE)
+    {
+        parent::define($context);
+		$this->add_mixin('Mixin_Url_Manipulation');
+        $this->add_mixin('Mixin_Routing_App');
+		$this->implement('I_Routing_App');
+    }
+    
+    function initialize()
+    {
+        parent::initialize();
+		$this->_settings = $this->object->get_routing_settings();
+    }
+    
+    function get_routing_settings()
+    {
+        $settings	= C_NextGen_Settings::get_instance();
+        $object = new stdClass();
+        $object->router_param_separator = $settings->router_param_separator;
+        $object->router_param_slug = $settings->router_param_slug;
+        $object->router_param_prefix = $settings->router_param_prefix;
+
+        return $object;
+    }
+
+    static function &get_instance($context = False)
+    {
+        if (!isset(self::$_instances[$context])) {
+            self::$_instances[$context] = new C_Routing_App($context);
+        }
+        return self::$_instances[$context];
+    }
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/interface.http_response.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/interface.http_response.php
new file mode 100644
index 0000000000000000000000000000000000000000..880d2a0fc08c5cdee8a7fc0683f0ad58d4e632a0
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/interface.http_response.php
@@ -0,0 +1,7 @@
+<?php
+
+interface I_Http_Response
+{
+	function http_301_action();
+	function http_302_action();
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/interface.router.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/interface.router.php
new file mode 100644
index 0000000000000000000000000000000000000000..94f5a10fc47f51d55ee8e319adc9809d2d33336a
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/interface.router.php
@@ -0,0 +1,8 @@
+<?php
+
+interface I_Router
+{
+    function serve_request();
+
+    static function get_instance();
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/interface.routing_app.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/interface.routing_app.php
new file mode 100644
index 0000000000000000000000000000000000000000..f42984f08f51230525af0d16b680635877f44e0c
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/interface.routing_app.php
@@ -0,0 +1,6 @@
+<?php
+
+interface I_Routing_App
+{
+	function passthru();
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/mixin.url_manipulation.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/mixin.url_manipulation.php
new file mode 100644
index 0000000000000000000000000000000000000000..97522f7fb88cc57695951253ebacce2d29f12c63
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/mixin.url_manipulation.php
@@ -0,0 +1,180 @@
+<?php
+
+class Mixin_Url_Manipulation extends Mixin
+{
+	function join_paths()
+	{
+		$args = func_get_args();
+		return $this->get_registry()->get_utility('I_Fs')->join_paths($args);
+	}
+
+	/**
+	 * Removes a segment from a url
+	 * @param string $segment
+	 * @param string $url
+	 * @return string
+	 */
+	function remove_url_segment($segment, $url)
+	{
+		$retval = $url;
+		$parts	= parse_url($url);
+
+		// If the url has a path, then we can remove a segment
+		if (isset($parts['path'])) {
+			if (substr($segment, -1) == '/') $segment = substr($segment, -1);
+			$segment = preg_quote($segment, '#');
+			if (preg_match("#{$segment}#", $parts['path'], $matches)) {
+				$parts['path'] = str_replace(
+					'//',
+					'/',
+					str_replace($matches[0], '', $parts['path'])
+				);
+				$retval = $this->object->construct_url_from_parts($parts);
+			}
+		}
+		return $retval;
+	}
+
+
+    /**
+     * Flattens an array of arrays to a single array
+     * @param array $array
+     * @param array $parent (optional)
+     * @param bool $exclude_duplicates (optional - defaults to TRUE)
+     * @return array
+     */
+    function _flatten_array($array, $parent=NULL, $exclude_duplicates=TRUE)
+    {
+        if (is_array($array)) {
+
+            // We're to add each element to the parent array
+            if ($parent) {
+                foreach ($array as $index => $element) {
+                    foreach ($this->_flatten_array($array) as $sub_element) {
+                        if ($exclude_duplicates) {
+                            if (!in_array($sub_element, $parent)) {
+                                $parent[] = $sub_element;
+                            }
+                        }
+                        else $parent[] = $sub_element;
+                    }
+                }
+                $array = $parent;
+            }
+
+            // We're starting the process..
+            else {
+                $index = 0;
+                while (isset($array[$index])) {
+                    $element = $array[$index];
+                    if (is_array($element)) {
+                        $array = $this->_flatten_array($element, $array);
+                        unset($array[$index]);
+                    }
+                    $index += 1;
+                }
+                $array = array_values($array);
+            }
+        }
+        else {
+            $array = array($array);
+        }
+
+        return $array;
+    }
+
+
+	function join_querystrings()
+	{
+		$parts	= array();
+		$retval = array();
+		$params = func_get_args();
+		$parts = $this->_flatten_array($params);
+		foreach ($parts as $part) {
+            $part = explode("&", $part);
+            foreach ($part as $segment) {
+                $segment = explode("=", $segment);
+                $key = $segment[0];
+                $value = isset($segment[1]) ? $segment[1] : '';
+                $retval[$key] = $value;
+
+            }
+		}
+		return $this->object->assoc_array_to_querystring($retval);
+	}
+
+    function assoc_array_to_querystring($arr)
+    {
+        $retval = array();
+        foreach ($arr as $key => $val) {
+            if (strlen($key))
+                $retval[] = strlen($val) ? "{$key}={$val}" : $key;
+        }
+        return implode("&", $retval);
+    }
+
+
+	/**
+	 * Constructs a url from individual parts, created by parse_url
+	 * @param array $parts
+	 * @return string
+	 */
+	function construct_url_from_parts($parts)
+	{
+        // let relative paths be relative, and full paths full
+        $prefix = '';
+        if (!empty($parts['scheme']) && !empty($parts['host'])) {
+            $prefix = $parts['scheme'] . '://' . $parts['host'];
+            if (!empty($parts['port']))
+                $prefix .= ':' . $parts['port'];
+        }
+
+		$retval =  $this->object->join_paths(
+            $prefix,
+			isset($parts['path']) ? $parts['path'] : ''
+		);
+		if (isset($parts['query']) && $parts['query']) $retval .= "?{$parts['query']}";
+
+		return $retval;
+	}
+
+	function get_parameter_segments($request_uri)
+	{
+		return str_replace($this->strip_param_segments($request_uri), '', $request_uri);
+	}
+
+	/**
+	 * Returns the request uri with the parameter segments stripped
+	 * @param string $request_uri
+	 * @return string
+	 */
+	function strip_param_segments($request_uri, $remove_slug=TRUE)
+	{
+		$retval		 = $request_uri ? $request_uri : '/';
+		$settings	 = C_NextGen_Settings::get_instance();
+		$sep		 = preg_quote($settings->router_param_separator, '#');
+		$param_regex = "#((?P<id>\w+){$sep})?(?<key>\w+){$sep}(?P<value>.+)/?$#";
+		$slug		 = $settings->router_param_slug && $remove_slug ? '/' . preg_quote($settings->router_param_slug,'#') : '';
+		$slug_regex	 = '#'.$slug.'/?$#';
+
+		// Remove all parameters
+		while (preg_match($param_regex, $retval, $matches)) {
+			$match_regex = '#'.preg_quote(array_shift($matches),'#').'$#';
+			$retval = preg_replace($match_regex, '', $retval);
+		}
+
+		// Remove the slug or trailing slash
+		if (preg_match($slug_regex, $retval, $matches)) {
+			$match_regex = '#'.preg_quote(array_shift($matches),'#').'$#';
+			$retval = preg_replace($match_regex, '', $retval);
+		}
+
+		// If there's a slug, we can assume everything after is a parameter,
+		// even if it's not in our desired format.
+		$retval = preg_replace('#'.$slug.'.*$#', '', $retval);
+
+		if (!$retval) $retval = '/';
+
+		return $retval;
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/module.router.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/module.router.php
new file mode 100644
index 0000000000000000000000000000000000000000..f35c2c48bcc8661a22eb82432309c3603c0416b9
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/module.router.php
@@ -0,0 +1,52 @@
+<?php
+/*
+{
+	Module: photocrati-router,
+	Depends: { photocrati-fs }
+}
+ */
+class M_Router extends C_Base_Module
+{
+	function define()
+	{
+		parent::define(
+			'photocrati-router',
+			'Router for Pope',
+			'Provides routing capabilities for Pope modules',
+			'0.4',
+			'http://www.photocrati.com',
+			'Photocrati Media',
+			'http://www.photocrati.com'
+		);
+
+		include_once('class.router_installer.php');
+		C_Photocrati_Installer::add_handler($this->module_id, 'C_Router_Installer');
+	}
+
+	function _register_utilities()
+	{
+		$this->get_registry()->add_utility('I_Router', 'C_Router');
+	}
+
+	function _register_adapters()
+	{
+		$this->get_registry()->add_adapter('I_Component_Factory', 'A_Routing_App_Factory');
+	}
+
+    function get_type_list()
+    {
+        return array(
+			'C_Router_Installer'	=> 'class.router_installer.php',
+            'A_Routing_App_Factory' => 'adapter.routing_app_factory.php',
+            'C_Router' => 'class.router.php',
+            'C_Http_Response_Controller' => 'class.http_response_controller.php',
+            'C_Routing_App' => 'class.routing_app.php',
+            'I_Router' => 'interface.router.php',
+            'I_Http_Response' => 'interface.http_response.php',
+            'I_Routing_App' => 'interface.routing_app.php',
+            'Mixin_Url_Manipulation' => 'mixin.url_manipulation.php'
+        );
+    }
+}
+
+new M_Router;
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/README b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/README
new file mode 100644
index 0000000000000000000000000000000000000000..aaf6a06841afe9ba4be050224b42d1cc74de87b7
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/README
@@ -0,0 +1,24 @@
+Example pseudo-code:
+	
+$security = $this->get_registry()->get_utility('I_Security_Manager');
+
+
+// generating some kind of security-enabled request
+$sec_token = $security->get_request_token('nextgen_edit_thumbnail', array('id' => 1));
+
+$markup = '<form id="form-1" [...]>' . $sec_token->get_form_html(array('prefix' => 'form-1')) . '</form>';
+
+
+// somewhere else, in POST/GET handler
+$sec_token = $security->get_request_token('nextgen_edit_thumbnail', array('id' => 1));
+$sec_actor = $security->get_current_actor();
+
+if ($sec_token->check_current_request() && $sec_actor->is_allowed('nextgen_edit_thumbnail', array('id' => 1)))
+{
+	// proceed with action nextgen_edit_thumbnail
+}
+else
+{
+	// security error!
+}
+
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/adapter.security_factory.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/adapter.security_factory.php
new file mode 100644
index 0000000000000000000000000000000000000000..442f7fba43cb705fcc110704798637a7ea09d51a
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/adapter.security_factory.php
@@ -0,0 +1,29 @@
+<?php
+
+class A_Security_Factory extends Mixin
+{
+	function wordpress_security_manager($context=FALSE)
+	{
+		return new C_WordPress_Security_Manager($context);
+	}
+
+	function security_manager($context=FALSE)
+	{
+		return $this->object->wordpress_security_manager($context);
+	}
+
+	function wordpress_security_actor($context=FALSE)
+	{
+		return new C_WordPress_Security_Actor($context);
+	}
+
+	function wordpress_security_token($context=FALSE)
+	{
+		return new C_Wordpress_Security_Token($context);
+	}
+
+	function security_token($context)
+	{
+		return $this->object->wordpress_security_token($context);
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/class.security_actor.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/class.security_actor.php
new file mode 100644
index 0000000000000000000000000000000000000000..b00ace6c0b50958795f12e6802b9c68b677e1455
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/class.security_actor.php
@@ -0,0 +1,144 @@
+<?php
+
+class Mixin_Security_Actor extends Mixin
+{
+	function add_capability($capability_name)
+	{
+		return false;
+	}
+	
+	function remove_capability($capability_name)
+	{
+		return false;
+	}
+	
+	function is_allowed($capability_name, $args = null)
+	{
+		return false;
+	}
+	
+	function is_user()
+	{
+		return false;
+	}
+}
+
+class Mixin_Security_Actor_Entity extends Mixin
+{
+	var $entity_object = null;
+	var $entity_props = null;
+
+	// Note, an Actor with null $entity is considered a "Guest", i.e. no privileges
+	function set_entity($entity, $entity_props = null)
+	{
+		$this->object->entity_object = $entity;
+		$this->object->entity_props = $entity_props;
+	}
+	
+	function get_entity($entity = null)
+	{
+		if ($entity == null)
+		{
+			$entity = $this->object->entity_object;
+		}
+		
+		if ($entity != null && $entity == $this->object->entity_object)
+		{
+			return $entity;
+		}
+		
+		return null;
+	}
+	
+	function get_entity_id($entity = null)
+	{
+		$entity = $this->object->get_entity($entity);
+		
+		if ($entity != null)
+		{
+			$entity_props = $this->object->entity_props;
+			
+			if (isset($entity_props['id']))
+			{
+				return $entity_props['id'];
+			}
+		}
+		
+		return null;
+	}
+	
+	function get_entity_type($entity = null)
+	{
+		$entity = $this->object->get_entity($entity);
+		
+		if ($entity != null)
+		{
+			$entity_props = $this->object->entity_props;
+			
+			if (isset($entity_props['type']))
+			{
+				return $entity_props['type'];
+			}
+		}
+		
+		return null;
+	}
+}
+
+// XXX not used yet
+class Mixin_Security_Entity_List extends Mixin
+{
+	var $_entity_list;
+	
+	function add_entity($entity, $entity_props = null)
+	{
+		if (!$this->object->is_entity($entity))
+		{
+			$entity_props = array_merge((array) $entity_props, array('object' => $entity));
+			
+			$this->object->_entity_list[] = $entity_props;
+		}
+	}
+	
+	function remove_entity($entity)
+	{
+		if ($this->object->is_entity($entity))
+		{
+		}
+	}
+	
+	function is_entity($entity)
+	{
+		return $this->object->get_entity_set($entity);
+	}
+	
+	function get_entity_set($entity)
+	{
+		foreach ($this->_entity_list as $entity_set)
+		{
+			
+		}
+	}
+	
+	function get_entity_id($entity)
+	{
+		
+	}
+	
+	function get_entity_type($entity)
+	{
+		
+	}
+}
+
+class C_Security_Actor extends C_Component
+{
+	function define($context=FALSE)
+	{
+		parent::define($context);
+
+		$this->implement('I_Security_Actor');
+		$this->add_mixin('Mixin_Security_Actor');
+		$this->add_mixin('Mixin_Security_Actor_Entity');
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/class.security_manager.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/class.security_manager.php
new file mode 100644
index 0000000000000000000000000000000000000000..50c4a31009ed9045350494f7e48eb78149985515
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/class.security_manager.php
@@ -0,0 +1,58 @@
+<?php
+
+class Mixin_Security_Manager extends Mixin
+{
+	function is_allowed($capability_name, $args = null)
+	{
+		$actor = $this->object->get_current_actor();
+		
+		if ($actor != null)
+		{
+			return $actor->is_allowed($capability_name, $args);
+		}
+		
+		return false;
+	}
+	
+	function get_actor($actor_id, $actor_type = null, $args = null)
+	{
+		return null;
+	}
+	
+	function get_current_actor()
+	{
+		return null;
+	}
+}
+
+class Mixin_Security_Manager_Request extends Mixin
+{
+	function get_request_token($action_name, $args = null)
+	{
+		return null;
+	}
+}
+
+class C_Security_Manager extends C_Component
+{
+    static $_instances = array();
+
+    function define($context=FALSE)
+    {
+			parent::define($context);
+
+			$this->implement('I_Security_Manager');
+			$this->add_mixin('Mixin_Security_Manager');
+			$this->add_mixin('Mixin_Security_Manager_Request');
+    }
+
+    static function get_instance($context = False)
+    {
+			if (!isset(self::$_instances[$context]))
+			{
+					self::$_instances[$context] = new C_Security_Manager($context);
+			}
+
+			return self::$_instances[$context];
+    }
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/class.security_token.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/class.security_token.php
new file mode 100644
index 0000000000000000000000000000000000000000..980cf1666f32de9df0c1cb316c87f3c91b671fb7
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/class.security_token.php
@@ -0,0 +1,68 @@
+<?php
+
+class Mixin_Security_Token extends Mixin
+{
+	function get_request_list($args = null)
+	{
+		return array();
+	}
+	
+	function get_form_html($args = null)
+	{
+		return null;
+	}
+	
+	function check_request($request_values)
+	{
+		return false;
+	}
+	
+	function check_current_request()
+	{
+		return $this->object->check_request($_REQUEST);
+	}
+}
+
+class Mixin_Security_Token_Property extends Mixin
+{
+	var $_action_name;
+	var $_args;
+	
+	function init_token($action_name, $args = null)
+	{
+		$this->object->_action_name = $action_name;
+		$this->object->_args = $args;
+	}
+	
+	function get_action_name()
+	{
+		return $this->object->_action_name;
+	}
+	
+	function get_property($name)
+	{
+		if (isset($this->object->_args[$name]))
+		{
+			return $this->object->_args[$name];
+		}
+		
+		return null;
+	}
+	
+	function get_property_list()
+	{
+		return array_keys((array) $this->object->_args);
+	}
+}
+	
+class C_Security_Token extends C_Component
+{
+	function define($context=FALSE)
+	{
+		parent::define($context);
+
+		$this->implement('I_Security_Token');
+		$this->add_mixin('Mixin_Security_Token');
+		$this->add_mixin('Mixin_Security_Token_Property');
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/class.wordpress_security_actor.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/class.wordpress_security_actor.php
new file mode 100644
index 0000000000000000000000000000000000000000..6876e94f5886dfd244e540da704558fe991c5bd7
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/class.wordpress_security_actor.php
@@ -0,0 +1,138 @@
+<?php
+
+class Mixin_WordPress_Security_Actor extends Mixin
+{
+	function add_capability($capability_name)
+	{
+		$entity = $this->object->get_entity();
+		
+		if ($entity != null)
+		{
+			$capability_name = $this->object->get_native_action($capability_name);
+			
+			$entity->add_cap($capability_name);
+			
+			return true;
+		}
+		
+		return false;
+	}
+	
+	function remove_capability($capability_name)
+	{
+		$entity = $this->object->get_entity();
+		
+		if ($entity != null && $this->object->is_allowed($capability_name))
+		{
+			$capability_name = $this->object->get_native_action($capability_name);
+			
+			$entity->remove_cap($capability_name);
+			
+			return true;
+		}
+		
+		return false;
+	}
+	
+	function is_allowed($capability_name, $args = null)
+	{
+		$entity = $this->object->get_entity();
+		
+		if ($entity != null)
+		{
+			$capability_name = $this->object->get_native_action($capability_name, $args);
+			
+			return $entity->has_cap($capability_name);
+		}
+		
+		return false;
+	}
+	
+	function is_user()
+	{
+		return $this->object->get_entity_type() == 'user';
+	}
+	
+	function get_native_action($capability_name, $args = null)
+	{
+		return $capability_name;
+	}
+}
+
+class Mixin_WordPress_Security_Action_Converter extends Mixin
+{
+	function get_native_action($capability_name, $args = null)
+	{
+		switch ($capability_name)
+		{
+			case 'nextgen_edit_settings':
+			{
+				$capability_name = 'NextGEN Change options';
+				
+				break;
+			}
+			case 'nextgen_edit_style':
+			{
+				$capability_name = 'NextGEN Change style';
+				
+				break;
+			}
+			case 'nextgen_edit_display_settings':
+			{
+				$capability_name = 'NextGEN Change options';
+				
+				break;
+			}
+			case 'nextgen_edit_displayed_gallery':
+			{
+				$capability_name = 'NextGEN Attach Interface';
+				
+				break;
+			}
+			case 'nextgen_edit_gallery':
+			{
+				$capability_name = 'NextGEN Manage gallery';
+				
+				break;
+			}
+			case 'nextgen_edit_gallery_unowned':
+			{
+				$capability_name = 'NextGEN Manage others gallery';
+				
+				break;
+			}
+			case 'nextgen_upload_image':
+			{
+				$capability_name = 'NextGEN Upload images';
+				
+				break;
+			}
+			case 'nextgen_edit_album_settings':
+			{
+				$capability_name = 'NextGEN Edit album settings';
+
+				break;
+			}
+
+			case 'nextgen_edit_album':
+			{
+				$capability_name = 'NextGEN Edit album';
+
+				break;
+			}
+		}
+		
+		return $capability_name;
+	}
+}
+
+class C_WordPress_Security_Actor extends C_Security_Actor
+{
+	function define($context=FALSE)
+	{
+		parent::define($context);
+
+		$this->add_mixin('Mixin_WordPress_Security_Actor');
+		$this->add_mixin('Mixin_WordPress_Security_Action_Converter');
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/class.wordpress_security_manager.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/class.wordpress_security_manager.php
new file mode 100644
index 0000000000000000000000000000000000000000..ce655d082d0014c4c6e353b4c2587a3e4ee65256
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/class.wordpress_security_manager.php
@@ -0,0 +1,113 @@
+<?php
+
+class Mixin_WordPress_Security_Manager extends Mixin
+{
+	function get_actor($actor_id, $actor_type = null, $args = null)
+	{
+		if ($actor_type == null)
+		{
+			$actor_type = 'user';
+		}
+
+		$object = null;
+
+		if ($actor_id != null)
+		{
+			switch ($actor_type)
+			{
+				case 'user':
+				{
+					$object = get_userdata($actor_id);
+
+					if ($object == false)
+					{
+						$object = null;
+					}
+
+					break;
+				}
+				case 'role':
+				{
+					$object = get_role($actor_id);
+
+					if ($object == false)
+					{
+						$object = null;
+					}
+
+					break;
+				}
+			}
+		}
+
+		if ($object != null)
+		{
+			$factory = $this->get_registry()->get_utility('I_Component_Factory');
+			$actor	 = $factory->create('wordpress_security_actor', $actor_type);
+			$entity_props = array(
+				'type' => $actor_type,
+				'id' => $actor_id,
+			);
+
+			$actor->set_entity($object, $entity_props);
+
+			return $actor;
+		}
+
+		return $this->object->get_guest_actor();
+	}
+
+	function get_current_actor()
+	{
+		return $this->object->get_actor(get_current_user_id(), 'user');
+	}
+
+	function get_guest_actor()
+	{
+		$factory = $this->get_registry()->get_utility('I_Component_Factory');
+		$actor   = $factory->create('wordpress_security_actor', 'user');
+		$entity_props = array(
+			'type' => 'user'
+		);
+
+		$actor->set_entity(null, $entity_props);
+
+		return $actor;
+	}
+}
+
+class Mixin_WordPress_Security_Manager_Request extends Mixin
+{
+	function get_request_token($action_name, $args = null)
+	{
+		$factory = $this->get_registry()->get_utility('I_Component_Factory');
+		$token	 = $factory->create('wordpress_security_token');
+		$token->init_token($action_name, $args);
+
+		return $token;
+	}
+}
+
+class C_WordPress_Security_Manager extends C_Security_Manager
+{
+    static $_instances = array();
+
+    function define($context=FALSE)
+    {
+		parent::define($context);
+
+		$this->add_mixin('Mixin_WordPress_Security_Manager');
+		$this->add_mixin('Mixin_WordPress_Security_Manager_Request');
+    }
+
+    static function get_instance($context = False)
+    {
+		if (!isset(self::$_instances[$context]))
+		{
+			$klass = get_class();
+			self::$_instances[$context] = new $klass($context);
+		}
+
+		return self::$_instances[$context];
+    }
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/class.wordpress_security_token.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/class.wordpress_security_token.php
new file mode 100644
index 0000000000000000000000000000000000000000..520bff313699946368618d4370bd142860a1fc48
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/class.wordpress_security_token.php
@@ -0,0 +1,100 @@
+<?php
+
+class Mixin_Wordpress_Security_Token extends Mixin
+{
+	function get_request_list($args = null)
+	{
+		$prefix = isset($args['prefix']) ? $args['prefix'] : null;
+		$action_name = $this->object->get_action_name();
+		$list = array();
+		
+		if ($prefix != null)
+		{
+			$list[$action_name . '_prefix'] = $prefix;
+		}
+		
+		$action = $this->object->get_nonce_name();
+		$list[$prefix . $action_name . '_sec'] = wp_create_nonce($action);
+		
+		return $list;
+	}
+	
+	function get_form_html($args = null)
+	{
+		$list = $this->object->get_request_list($args);
+		$out = null;
+		
+		foreach ($list as $name => $value)
+		{
+			$out .= '<input type="hidden" name="' . esc_attr($name) . '" value="' . esc_attr($value) . '" />';
+		}
+		
+		return $out;
+	}
+	
+	function get_json($args = null)
+	{
+		$list = $this->object->get_request_list($args);
+		
+		return json_encode($list);
+	}
+	
+	function check_request($request_values)
+	{
+		$action_name = $this->object->get_action_name();
+		$action = $this->object->get_nonce_name();
+		
+		$prefix = isset($request_values[$action_name . '_prefix']) ? $request_values[$action_name . '_prefix'] : null;
+		
+		if (isset($request_values[$prefix . $action_name . '_sec']))
+		{
+			$nonce = $request_values[$prefix . $action_name . '_sec'];
+			
+			$result = wp_verify_nonce($nonce, $action);
+			
+			if ($result)
+			{
+				return true;
+			}
+		}
+		
+		return false;
+	}
+	
+	function get_nonce_name()
+	{
+		$action_name = $this->object->get_action_name();
+		$prop_list = $this->object->get_property_list();
+		
+		$action = $action_name;
+		
+		foreach ($prop_list as $prop_name)
+		{
+			$property = $this->object->get_property($prop_name);
+			$action .= '_' . strval($property);
+		}
+		
+		return $action;
+	}
+}
+
+class Mixin_Wordpress_Security_Token_MVC extends Mixin
+{
+	function check_request($request_values)
+	{
+		// XXX check URL parameters passed with the MVC module
+		//
+		return $this->call_parent('check_request', $request_values);
+	}
+}
+	
+class C_Wordpress_Security_Token extends C_Security_Token
+{
+	function define($context=FALSE)
+	{
+		parent::define($context);
+
+		$this->add_mixin('Mixin_Wordpress_Security_Token');
+		$this->add_mixin('Mixin_Wordpress_Security_Token_MVC');
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/interface.security_actor.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/interface.security_actor.php
new file mode 100644
index 0000000000000000000000000000000000000000..ca55c61f6807e4342c6702720644ecead6e6525d
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/interface.security_actor.php
@@ -0,0 +1,12 @@
+<?php
+
+interface I_Security_Actor
+{
+	function add_capability($capability_name);
+	
+	function remove_capability($capability_name);
+	
+	function is_allowed($capability_name, $args = null);
+	
+	function is_user();
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/interface.security_manager.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/interface.security_manager.php
new file mode 100644
index 0000000000000000000000000000000000000000..97f4067ca654ad31894b92689d65deab40e46c39
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/interface.security_manager.php
@@ -0,0 +1,12 @@
+<?php
+
+interface I_Security_Manager
+{
+	function is_allowed($capability_name, $args = null);
+	
+	function get_actor($actor_id, $actor_type = null, $args = null);
+	
+	function get_current_actor();
+	
+	function get_request_token($action_name, $args = null);
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/interface.security_token.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/interface.security_token.php
new file mode 100644
index 0000000000000000000000000000000000000000..f0b75d0c7d702394c35134547b1b852e5b2dbf5f
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/interface.security_token.php
@@ -0,0 +1,14 @@
+<?php
+
+interface I_Security_Token
+{
+	function get_request_list($args = null);
+	
+	function get_form_html($args = null);
+	
+	function get_json($args = null);
+	
+	function check_request($request_values);
+	
+	function check_current_request();
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/module.security.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/module.security.php
new file mode 100644
index 0000000000000000000000000000000000000000..65e6f71a395893285a4b2cd9f49667fe50c23463
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/module.security.php
@@ -0,0 +1,52 @@
+<?php
+
+/***
+ {
+	Module: photocrati-security
+ }
+ ***/
+
+class M_Security extends C_Base_Module
+{
+	function define()
+	{
+		parent::define(
+			'photocrati-security',
+			'Security',
+			'Provides utilities to check for credentials and security',
+			'0.1',
+			'http://www.nextgen-gallery.com',
+			'Photocrati Media',
+			'http://www.photocrati.com'
+		);
+	}
+
+	function _register_adapters()
+	{
+		$this->get_registry()->add_adapter('I_Component_Factory', 'A_Security_Factory');
+	}
+
+	function _register_utilities()
+	{
+		$this->get_registry()->add_utility('I_Security_Manager', 'C_WordPress_Security_Manager');
+	}
+
+    function get_type_list()
+    {
+        return array(
+            'A_Security_Factory' => 'adapter.security_factory.php',
+            'C_Security_Actor' => 'class.security_actor.php',
+            'C_Security_Manager' => 'class.security_manager.php',
+            'C_Security_Token' => 'class.security_token.php',
+            'C_Wordpress_Security_Actor' => 'class.wordpress_security_actor.php',
+            'C_Wordpress_Security_Manager' => 'class.wordpress_security_manager.php',
+            'C_Wordpress_Security_Token' => 'class.wordpress_security_token.php',
+            'I_Security_Actor' => 'interface.security_actor.php',
+            'I_Security_Manager' => 'interface.security_manager.php',
+            'I_Security_Token' => 'interface.security_token.php'
+        );
+    }
+
+}
+
+new M_Security();
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/simplehtmldom/module.simple_html_dom.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/simplehtmldom/module.simple_html_dom.php
new file mode 100644
index 0000000000000000000000000000000000000000..f53b6a38c68b08bb4e5690d61ebdd3cbe709fa8b
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/simplehtmldom/module.simple_html_dom.php
@@ -0,0 +1,33 @@
+<?php
+
+/***
+	{
+		Module: photocrati-simple_html_dom
+	}
+***/
+
+if (!function_exists(('file_get_html'))) require_once('simplehtmldom/simple_html_dom.php');
+
+class M_Simple_Html_Dom extends C_Base_Module
+{
+    function define()
+    {
+        parent::define(
+            'photocrati-simple_html_dom',
+            'Simple HTML Dom',
+            'Provides the simple_html_dom utility for other modules to use',
+            '1.5',
+            'http://www.photocrati.com',
+            'Photocrati Media',
+            'http://www.photocrati.com'
+        );
+    }
+
+		function get_type_list()
+		{
+			return array(
+			);
+		}
+}
+
+new M_Simple_Html_Dom();
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/simplehtmldom/simplehtmldom/simple_html_dom.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/simplehtmldom/simplehtmldom/simple_html_dom.php
new file mode 100644
index 0000000000000000000000000000000000000000..a92a94a46783953fb1801a736d17d30260b22f58
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/simplehtmldom/simplehtmldom/simple_html_dom.php
@@ -0,0 +1,1742 @@
+<?php
+/**
+ * Website: http://sourceforge.net/projects/simplehtmldom/
+ * Additional projects that may be used: http://sourceforge.net/projects/debugobject/
+ * Acknowledge: Jose Solorzano (https://sourceforge.net/projects/php-html/)
+ * Contributions by:
+ *	 Yousuke Kumakura (Attribute filters)
+ *	 Vadim Voituk (Negative indexes supports of "find" method)
+ *	 Antcs (Constructor with automatically load contents either text or file/url)
+ *
+ * all affected sections have comments starting with "PaperG"
+ *
+ * Paperg - Added case insensitive testing of the value of the selector.
+ * Paperg - Added tag_start for the starting index of tags - NOTE: This works but not accurately.
+ *  This tag_start gets counted AFTER \r\n have been crushed out, and after the remove_noice calls so it will not reflect the REAL position of the tag in the source,
+ *  it will almost always be smaller by some amount.
+ *  We use this to determine how far into the file the tag in question is.  This "percentage will never be accurate as the $dom->size is the "real" number of bytes the dom was created from.
+ *  but for most purposes, it's a really good estimation.
+ * Paperg - Added the forceTagsClosed to the dom constructor.  Forcing tags closed is great for malformed html, but it CAN lead to parsing errors.
+ * Allow the user to tell us how much they trust the html.
+ * Paperg add the text and plaintext to the selectors for the find syntax.  plaintext implies text in the innertext of a node.  text implies that the tag is a text node.
+ * This allows for us to find tags based on the text they contain.
+ * Create find_ancestor_tag to see if a tag is - at any level - inside of another specific tag.
+ * Paperg: added parse_charset so that we know about the character set of the source document.
+ *  NOTE:  If the user's system has a routine called get_last_retrieve_url_contents_content_type availalbe, we will assume it's returning the content-type header from the
+ *  last transfer or curl_exec, and we will parse that and use it in preference to any other method of charset detection.
+ *
+ * Found infinite loop in the case of broken html in restore_noise.  Rewrote to protect from that.
+ * PaperG (John Schlick) Added get_display_size for "IMG" tags.
+ *
+ * Licensed under The MIT License
+ * Redistributions of files must retain the above copyright notice.
+ *
+ * @author S.C. Chen <me578022@gmail.com>
+ * @author John Schlick
+ * @author Rus Carroll
+ * @version 1.5 ($Rev: 208 $)
+ * @package PlaceLocalInclude
+ * @subpackage simple_html_dom
+ */
+
+/**
+ * All of the Defines for the classes below.
+ * @author S.C. Chen <me578022@gmail.com>
+ */
+define('HDOM_TYPE_ELEMENT', 1);
+define('HDOM_TYPE_COMMENT', 2);
+define('HDOM_TYPE_TEXT',	3);
+define('HDOM_TYPE_ENDTAG',  4);
+define('HDOM_TYPE_ROOT',	5);
+define('HDOM_TYPE_UNKNOWN', 6);
+define('HDOM_QUOTE_DOUBLE', 0);
+define('HDOM_QUOTE_SINGLE', 1);
+define('HDOM_QUOTE_NO',	 3);
+define('HDOM_INFO_BEGIN',   0);
+define('HDOM_INFO_END',	 1);
+define('HDOM_INFO_QUOTE',   2);
+define('HDOM_INFO_SPACE',   3);
+define('HDOM_INFO_TEXT',	4);
+define('HDOM_INFO_INNER',   5);
+define('HDOM_INFO_OUTER',   6);
+define('HDOM_INFO_ENDSPACE',7);
+define('DEFAULT_TARGET_CHARSET', 'UTF-8');
+define('DEFAULT_BR_TEXT', "\r\n");
+define('DEFAULT_SPAN_TEXT', " ");
+define('MAX_FILE_SIZE', 600000);
+// helper functions
+// -----------------------------------------------------------------------------
+// get html dom from file
+// $maxlen is defined in the code as PHP_STREAM_COPY_ALL which is defined as -1.
+function file_get_html($url, $use_include_path = false, $context=null, $offset = -1, $maxLen=-1, $lowercase = true, $forceTagsClosed=true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
+{
+	// We DO force the tags to be terminated.
+	$dom = new simple_html_dom(null, $lowercase, $forceTagsClosed, $target_charset, $stripRN, $defaultBRText, $defaultSpanText);
+	// For sourceforge users: uncomment the next line and comment the retreive_url_contents line 2 lines down if it is not already done.
+	$contents = file_get_contents($url, $use_include_path, $context, $offset);
+	// Paperg - use our own mechanism for getting the contents as we want to control the timeout.
+	//$contents = retrieve_url_contents($url);
+	if (empty($contents) || strlen($contents) > MAX_FILE_SIZE)
+	{
+		return false;
+	}
+	// The second parameter can force the selectors to all be lowercase.
+	$dom->load($contents, $lowercase, $stripRN);
+	return $dom;
+}
+
+// get html dom from string
+function str_get_html($str, $lowercase=true, $forceTagsClosed=true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
+{
+	$dom = new simple_html_dom(null, $lowercase, $forceTagsClosed, $target_charset, $stripRN, $defaultBRText, $defaultSpanText);
+	if (empty($str) || strlen($str) > MAX_FILE_SIZE)
+	{
+		$dom->clear();
+		return false;
+	}
+	$dom->load($str, $lowercase, $stripRN);
+	return $dom;
+}
+
+// dump html dom tree
+function dump_html_tree($node, $show_attr=true, $deep=0)
+{
+	$node->dump($node);
+}
+
+
+/**
+ * simple html dom node
+ * PaperG - added ability for "find" routine to lowercase the value of the selector.
+ * PaperG - added $tag_start to track the start position of the tag in the total byte index
+ *
+ * @package PlaceLocalInclude
+ */
+class simple_html_dom_node
+{
+	public $nodetype = HDOM_TYPE_TEXT;
+	public $tag = 'text';
+	public $attr = array();
+	public $children = array();
+	public $nodes = array();
+	public $parent = null;
+	// The "info" array - see HDOM_INFO_... for what each element contains.
+	public $_ = array();
+	public $tag_start = 0;
+	private $dom = null;
+
+	function __construct($dom)
+	{
+		$this->dom = $dom;
+		$dom->nodes[] = $this;
+	}
+
+	function __destruct()
+	{
+		$this->clear();
+	}
+
+	function __toString()
+	{
+		return $this->outertext();
+	}
+
+	// clean up memory due to php5 circular references memory leak...
+	function clear()
+	{
+		$this->dom = null;
+		$this->nodes = null;
+		$this->parent = null;
+		$this->children = null;
+	}
+
+	// dump node's tree
+	function dump($show_attr=true, $deep=0)
+	{
+		$lead = str_repeat('	', $deep);
+
+		echo $lead.$this->tag;
+		if ($show_attr && count($this->attr)>0)
+		{
+			echo '(';
+			foreach ($this->attr as $k=>$v)
+				echo "[$k]=>\"".$this->$k.'", ';
+			echo ')';
+		}
+		echo "\n";
+
+		if ($this->nodes)
+		{
+			foreach ($this->nodes as $c)
+			{
+				$c->dump($show_attr, $deep+1);
+			}
+		}
+	}
+
+
+	// Debugging function to dump a single dom node with a bunch of information about it.
+	function dump_node($echo=true)
+	{
+
+		$string = $this->tag;
+		if (count($this->attr)>0)
+		{
+			$string .= '(';
+			foreach ($this->attr as $k=>$v)
+			{
+				$string .= "[$k]=>\"".$this->$k.'", ';
+			}
+			$string .= ')';
+		}
+		if (count($this->_)>0)
+		{
+			$string .= ' $_ (';
+			foreach ($this->_ as $k=>$v)
+			{
+				if (is_array($v))
+				{
+					$string .= "[$k]=>(";
+					foreach ($v as $k2=>$v2)
+					{
+						$string .= "[$k2]=>\"".$v2.'", ';
+					}
+					$string .= ")";
+				} else {
+					$string .= "[$k]=>\"".$v.'", ';
+				}
+			}
+			$string .= ")";
+		}
+
+		if (isset($this->text))
+		{
+			$string .= " text: (" . $this->text . ")";
+		}
+
+		$string .= " HDOM_INNER_INFO: '";
+		if (isset($node->_[HDOM_INFO_INNER]))
+		{
+			$string .= $node->_[HDOM_INFO_INNER] . "'";
+		}
+		else
+		{
+			$string .= ' NULL ';
+		}
+
+		$string .= " children: " . count($this->children);
+		$string .= " nodes: " . count($this->nodes);
+		$string .= " tag_start: " . $this->tag_start;
+		$string .= "\n";
+
+		if ($echo)
+		{
+			echo $string;
+			return;
+		}
+		else
+		{
+			return $string;
+		}
+	}
+
+	// returns the parent of node
+	// If a node is passed in, it will reset the parent of the current node to that one.
+	function parent($parent=null)
+	{
+		// I am SURE that this doesn't work properly.
+		// It fails to unset the current node from it's current parents nodes or children list first.
+		if ($parent !== null)
+		{
+			$this->parent = $parent;
+			$this->parent->nodes[] = $this;
+			$this->parent->children[] = $this;
+		}
+
+		return $this->parent;
+	}
+
+	// verify that node has children
+	function has_child()
+	{
+		return !empty($this->children);
+	}
+
+	// returns children of node
+	function children($idx=-1)
+	{
+		if ($idx===-1)
+		{
+			return $this->children;
+		}
+		if (isset($this->children[$idx]))
+		{
+			return $this->children[$idx];
+		}
+		return null;
+	}
+
+	// returns the first child of node
+	function first_child()
+	{
+		if (count($this->children)>0)
+		{
+			return $this->children[0];
+		}
+		return null;
+	}
+
+	// returns the last child of node
+	function last_child()
+	{
+		if (($count=count($this->children))>0)
+		{
+			return $this->children[$count-1];
+		}
+		return null;
+	}
+
+	// returns the next sibling of node
+	function next_sibling()
+	{
+		if ($this->parent===null)
+		{
+			return null;
+		}
+
+		$idx = 0;
+		$count = count($this->parent->children);
+		while ($idx<$count && $this!==$this->parent->children[$idx])
+		{
+			++$idx;
+		}
+		if (++$idx>=$count)
+		{
+			return null;
+		}
+		return $this->parent->children[$idx];
+	}
+
+	// returns the previous sibling of node
+	function prev_sibling()
+	{
+		if ($this->parent===null) return null;
+		$idx = 0;
+		$count = count($this->parent->children);
+		while ($idx<$count && $this!==$this->parent->children[$idx])
+			++$idx;
+		if (--$idx<0) return null;
+		return $this->parent->children[$idx];
+	}
+
+	// function to locate a specific ancestor tag in the path to the root.
+	function find_ancestor_tag($tag)
+	{
+		global $debug_object;
+		if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
+
+		// Start by including ourselves in the comparison.
+		$returnDom = $this;
+
+		while (!is_null($returnDom))
+		{
+			if (is_object($debug_object)) { $debug_object->debug_log(2, "Current tag is: " . $returnDom->tag); }
+
+			if ($returnDom->tag == $tag)
+			{
+				break;
+			}
+			$returnDom = $returnDom->parent;
+		}
+		return $returnDom;
+	}
+
+	// get dom node's inner html
+	function innertext()
+	{
+		if (isset($this->_[HDOM_INFO_INNER])) return $this->_[HDOM_INFO_INNER];
+		if (isset($this->_[HDOM_INFO_TEXT])) return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]);
+
+		$ret = '';
+		foreach ($this->nodes as $n)
+			$ret .= $n->outertext();
+		return $ret;
+	}
+
+	// get dom node's outer text (with tag)
+	function outertext()
+	{
+		global $debug_object;
+		if (is_object($debug_object))
+		{
+			$text = '';
+			if ($this->tag == 'text')
+			{
+				if (!empty($this->text))
+				{
+					$text = " with text: " . $this->text;
+				}
+			}
+			$debug_object->debug_log(1, 'Innertext of tag: ' . $this->tag . $text);
+		}
+
+		if ($this->tag==='root') return $this->innertext();
+
+		// trigger callback
+		if ($this->dom && $this->dom->callback!==null)
+		{
+			call_user_func_array($this->dom->callback, array($this));
+		}
+
+		if (isset($this->_[HDOM_INFO_OUTER])) return $this->_[HDOM_INFO_OUTER];
+		if (isset($this->_[HDOM_INFO_TEXT])) return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]);
+
+		// render begin tag
+		if ($this->dom && $this->dom->nodes[$this->_[HDOM_INFO_BEGIN]])
+		{
+			$ret = $this->dom->nodes[$this->_[HDOM_INFO_BEGIN]]->makeup();
+		} else {
+			$ret = "";
+		}
+
+		// render inner text
+		if (isset($this->_[HDOM_INFO_INNER]))
+		{
+			// If it's a br tag...  don't return the HDOM_INNER_INFO that we may or may not have added.
+			if ($this->tag != "br")
+			{
+				$ret .= $this->_[HDOM_INFO_INNER];
+			}
+		} else {
+			if ($this->nodes)
+			{
+				foreach ($this->nodes as $n)
+				{
+					$ret .= $this->convert_text($n->outertext());
+				}
+			}
+		}
+
+		// render end tag
+		if (isset($this->_[HDOM_INFO_END]) && $this->_[HDOM_INFO_END]!=0)
+			$ret .= '</'.$this->tag.'>';
+		return $ret;
+	}
+
+	// get dom node's plain text
+	function text()
+	{
+		if (isset($this->_[HDOM_INFO_INNER])) return $this->_[HDOM_INFO_INNER];
+		switch ($this->nodetype)
+		{
+			case HDOM_TYPE_TEXT: return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]);
+			case HDOM_TYPE_COMMENT: return '';
+			case HDOM_TYPE_UNKNOWN: return '';
+		}
+		if (strcasecmp($this->tag, 'script')===0) return '';
+		if (strcasecmp($this->tag, 'style')===0) return '';
+
+		$ret = '';
+		// In rare cases, (always node type 1 or HDOM_TYPE_ELEMENT - observed for some span tags, and some p tags) $this->nodes is set to NULL.
+		// NOTE: This indicates that there is a problem where it's set to NULL without a clear happening.
+		// WHY is this happening?
+		if (!is_null($this->nodes))
+		{
+			foreach ($this->nodes as $n)
+			{
+				$ret .= $this->convert_text($n->text());
+			}
+
+			// If this node is a span... add a space at the end of it so multiple spans don't run into each other.  This is plaintext after all.
+			if ($this->tag == "span")
+			{
+				$ret .= $this->dom->default_span_text;
+			}
+
+
+		}
+		return $ret;
+	}
+
+	function xmltext()
+	{
+		$ret = $this->innertext();
+		$ret = str_ireplace('<![CDATA[', '', $ret);
+		$ret = str_replace(']]>', '', $ret);
+		return $ret;
+	}
+
+	// build node's text with tag
+	function makeup()
+	{
+		// text, comment, unknown
+		if (isset($this->_[HDOM_INFO_TEXT])) return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]);
+
+		$ret = '<'.$this->tag;
+		$i = -1;
+
+		foreach ($this->attr as $key=>$val)
+		{
+			++$i;
+
+			// skip removed attribute
+			if ($val===null || $val===false)
+				continue;
+
+			$ret .= $this->_[HDOM_INFO_SPACE][$i][0];
+			//no value attr: nowrap, checked selected...
+			if ($val===true)
+				$ret .= $key;
+			else {
+				switch ($this->_[HDOM_INFO_QUOTE][$i])
+				{
+					case HDOM_QUOTE_DOUBLE: $quote = '"'; break;
+					case HDOM_QUOTE_SINGLE: $quote = '\''; break;
+					default: $quote = '';
+				}
+				$ret .= $key.$this->_[HDOM_INFO_SPACE][$i][1].'='.$this->_[HDOM_INFO_SPACE][$i][2].$quote.$val.$quote;
+			}
+		}
+		$ret = $this->dom->restore_noise($ret);
+		return $ret . $this->_[HDOM_INFO_ENDSPACE] . '>';
+	}
+
+	// find elements by css selector
+	//PaperG - added ability for find to lowercase the value of the selector.
+	function find($selector, $idx=null, $lowercase=false)
+	{
+		$selectors = $this->parse_selector($selector);
+		if (($count=count($selectors))===0) return array();
+		$found_keys = array();
+
+		// find each selector
+		for ($c=0; $c<$count; ++$c)
+		{
+			// The change on the below line was documented on the sourceforge code tracker id 2788009
+			// used to be: if (($levle=count($selectors[0]))===0) return array();
+			if (($levle=count($selectors[$c]))===0) return array();
+			if (!isset($this->_[HDOM_INFO_BEGIN])) return array();
+
+			$head = array($this->_[HDOM_INFO_BEGIN]=>1);
+
+			// handle descendant selectors, no recursive!
+			for ($l=0; $l<$levle; ++$l)
+			{
+				$ret = array();
+				foreach ($head as $k=>$v)
+				{
+					$n = ($k===-1) ? $this->dom->root : $this->dom->nodes[$k];
+					//PaperG - Pass this optional parameter on to the seek function.
+					$n->seek($selectors[$c][$l], $ret, $lowercase);
+				}
+				$head = $ret;
+			}
+
+			foreach ($head as $k=>$v)
+			{
+				if (!isset($found_keys[$k]))
+				{
+					$found_keys[$k] = 1;
+				}
+			}
+		}
+
+		// sort keys
+		ksort($found_keys);
+
+		$found = array();
+		foreach ($found_keys as $k=>$v)
+			$found[] = $this->dom->nodes[$k];
+
+		// return nth-element or array
+		if (is_null($idx)) return $found;
+		else if ($idx<0) $idx = count($found) + $idx;
+		return (isset($found[$idx])) ? $found[$idx] : null;
+	}
+
+	// seek for given conditions
+	// PaperG - added parameter to allow for case insensitive testing of the value of a selector.
+	protected function seek($selector, &$ret, $lowercase=false)
+	{
+		global $debug_object;
+		if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
+
+		list($tag, $key, $val, $exp, $no_key) = $selector;
+
+		// xpath index
+		if ($tag && $key && is_numeric($key))
+		{
+			$count = 0;
+			foreach ($this->children as $c)
+			{
+				if ($tag==='*' || $tag===$c->tag) {
+					if (++$count==$key) {
+						$ret[$c->_[HDOM_INFO_BEGIN]] = 1;
+						return;
+					}
+				}
+			}
+			return;
+		}
+
+		$end = (!empty($this->_[HDOM_INFO_END])) ? $this->_[HDOM_INFO_END] : 0;
+		if ($end==0) {
+			$parent = $this->parent;
+			while (!isset($parent->_[HDOM_INFO_END]) && $parent!==null) {
+				$end -= 1;
+				$parent = $parent->parent;
+			}
+			$end += $parent->_[HDOM_INFO_END];
+		}
+
+		for ($i=$this->_[HDOM_INFO_BEGIN]+1; $i<$end; ++$i) {
+			$node = $this->dom->nodes[$i];
+
+			$pass = true;
+
+			if ($tag==='*' && !$key) {
+				if (in_array($node, $this->children, true))
+					$ret[$i] = 1;
+				continue;
+			}
+
+			// compare tag
+			if ($tag && $tag!=$node->tag && $tag!=='*') {$pass=false;}
+			// compare key
+			if ($pass && $key) {
+				if ($no_key) {
+					if (isset($node->attr[$key])) $pass=false;
+				} else {
+					if (($key != "plaintext") && !isset($node->attr[$key])) $pass=false;
+				}
+			}
+			// compare value
+			if ($pass && $key && $val  && $val!=='*') {
+				// If they have told us that this is a "plaintext" search then we want the plaintext of the node - right?
+				if ($key == "plaintext") {
+					// $node->plaintext actually returns $node->text();
+					$nodeKeyValue = $node->text();
+				} else {
+					// this is a normal search, we want the value of that attribute of the tag.
+					$nodeKeyValue = $node->attr[$key];
+				}
+				if (is_object($debug_object)) {$debug_object->debug_log(2, "testing node: " . $node->tag . " for attribute: " . $key . $exp . $val . " where nodes value is: " . $nodeKeyValue);}
+
+				//PaperG - If lowercase is set, do a case insensitive test of the value of the selector.
+				if ($lowercase) {
+					$check = $this->match($exp, strtolower($val), strtolower($nodeKeyValue));
+				} else {
+					$check = $this->match($exp, $val, $nodeKeyValue);
+				}
+				if (is_object($debug_object)) {$debug_object->debug_log(2, "after match: " . ($check ? "true" : "false"));}
+
+				// handle multiple class
+				if (!$check && strcasecmp($key, 'class')===0) {
+					foreach (explode(' ',$node->attr[$key]) as $k) {
+						// Without this, there were cases where leading, trailing, or double spaces lead to our comparing blanks - bad form.
+						if (!empty($k)) {
+							if ($lowercase) {
+								$check = $this->match($exp, strtolower($val), strtolower($k));
+							} else {
+								$check = $this->match($exp, $val, $k);
+							}
+							if ($check) break;
+						}
+					}
+				}
+				if (!$check) $pass = false;
+			}
+			if ($pass) $ret[$i] = 1;
+			unset($node);
+		}
+		// It's passed by reference so this is actually what this function returns.
+		if (is_object($debug_object)) {$debug_object->debug_log(1, "EXIT - ret: ", $ret);}
+	}
+
+	protected function match($exp, $pattern, $value) {
+		global $debug_object;
+		if (is_object($debug_object)) {$debug_object->debug_log_entry(1);}
+
+		switch ($exp) {
+			case '=':
+				return ($value===$pattern);
+			case '!=':
+				return ($value!==$pattern);
+			case '^=':
+				return preg_match("/^".preg_quote($pattern,'/')."/", $value);
+			case '$=':
+				return preg_match("/".preg_quote($pattern,'/')."$/", $value);
+			case '*=':
+				if ($pattern[0]=='/') {
+					return preg_match($pattern, $value);
+				}
+				return preg_match("/".$pattern."/i", $value);
+		}
+		return false;
+	}
+
+	protected function parse_selector($selector_string) {
+		global $debug_object;
+		if (is_object($debug_object)) {$debug_object->debug_log_entry(1);}
+
+		// pattern of CSS selectors, modified from mootools
+		// Paperg: Add the colon to the attrbute, so that it properly finds <tag attr:ibute="something" > like google does.
+		// Note: if you try to look at this attribute, yo MUST use getAttribute since $dom->x:y will fail the php syntax check.
+// Notice the \[ starting the attbute?  and the @? following?  This implies that an attribute can begin with an @ sign that is not captured.
+// This implies that an html attribute specifier may start with an @ sign that is NOT captured by the expression.
+// farther study is required to determine of this should be documented or removed.
+//		$pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";
+		$pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-:]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";
+		preg_match_all($pattern, trim($selector_string).' ', $matches, PREG_SET_ORDER);
+		if (is_object($debug_object)) {$debug_object->debug_log(2, "Matches Array: ", $matches);}
+
+		$selectors = array();
+		$result = array();
+		//print_r($matches);
+
+		foreach ($matches as $m) {
+			$m[0] = trim($m[0]);
+			if ($m[0]==='' || $m[0]==='/' || $m[0]==='//') continue;
+			// for browser generated xpath
+			if ($m[1]==='tbody') continue;
+
+			list($tag, $key, $val, $exp, $no_key) = array($m[1], null, null, '=', false);
+			if (!empty($m[2])) {$key='id'; $val=$m[2];}
+			if (!empty($m[3])) {$key='class'; $val=$m[3];}
+			if (!empty($m[4])) {$key=$m[4];}
+			if (!empty($m[5])) {$exp=$m[5];}
+			if (!empty($m[6])) {$val=$m[6];}
+
+			// convert to lowercase
+			if ($this->dom->lowercase) {$tag=strtolower($tag); $key=strtolower($key);}
+			//elements that do NOT have the specified attribute
+			if (isset($key[0]) && $key[0]==='!') {$key=substr($key, 1); $no_key=true;}
+
+			$result[] = array($tag, $key, $val, $exp, $no_key);
+			if (trim($m[7])===',') {
+				$selectors[] = $result;
+				$result = array();
+			}
+		}
+		if (count($result)>0)
+			$selectors[] = $result;
+		return $selectors;
+	}
+
+	function __get($name)
+	{
+		if (isset($this->attr[$name]))
+		{
+			return $this->convert_text($this->attr[$name]);
+		}
+		switch ($name)
+		{
+			case 'outertext': return $this->outertext();
+			case 'innertext': return $this->innertext();
+			case 'plaintext': return $this->text();
+			case 'xmltext': return $this->xmltext();
+			default: return array_key_exists($name, $this->attr);
+		}
+	}
+
+	function __set($name, $value)
+	{
+		global $debug_object;
+		if (is_object($debug_object)) {$debug_object->debug_log_entry(1);}
+
+		switch ($name)
+		{
+			case 'outertext': return $this->_[HDOM_INFO_OUTER] = $value;
+			case 'innertext':
+				if (isset($this->_[HDOM_INFO_TEXT])) return $this->_[HDOM_INFO_TEXT] = $value;
+				return $this->_[HDOM_INFO_INNER] = $value;
+		}
+		if (!isset($this->attr[$name]))
+		{
+			$this->_[HDOM_INFO_SPACE][] = array(' ', '', '');
+			$this->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_DOUBLE;
+		}
+		$this->attr[$name] = $value;
+	}
+
+	function __isset($name)
+	{
+		switch ($name)
+		{
+			case 'outertext': return true;
+			case 'innertext': return true;
+			case 'plaintext': return true;
+		}
+		//no value attr: nowrap, checked selected...
+		return (array_key_exists($name, $this->attr)) ? true : isset($this->attr[$name]);
+	}
+
+	function __unset($name) {
+		if (isset($this->attr[$name]))
+			unset($this->attr[$name]);
+	}
+
+	// PaperG - Function to convert the text from one character set to another if the two sets are not the same.
+	function convert_text($text)
+	{
+		global $debug_object;
+		if (is_object($debug_object)) {$debug_object->debug_log_entry(1);}
+
+		$converted_text = $text;
+
+		$sourceCharset = "";
+		$targetCharset = "";
+
+		if ($this->dom)
+		{
+			$sourceCharset = strtoupper($this->dom->_charset);
+			$targetCharset = strtoupper($this->dom->_target_charset);
+		}
+		if (is_object($debug_object)) {$debug_object->debug_log(3, "source charset: " . $sourceCharset . " target charaset: " . $targetCharset);}
+
+		if (!empty($sourceCharset) && !empty($targetCharset) && (strcasecmp($sourceCharset, $targetCharset) != 0))
+		{
+			// Check if the reported encoding could have been incorrect and the text is actually already UTF-8
+			if ((strcasecmp($targetCharset, 'UTF-8') == 0) && ($this->is_utf8($text)))
+			{
+				$converted_text = $text;
+			}
+			else
+			{
+				$converted_text = iconv($sourceCharset, $targetCharset, $text);
+			}
+		}
+
+		// Lets make sure that we don't have that silly BOM issue with any of the utf-8 text we output.
+		if ($targetCharset == 'UTF-8')
+		{
+			if (substr($converted_text, 0, 3) == "\xef\xbb\xbf")
+			{
+				$converted_text = substr($converted_text, 3);
+			}
+			if (substr($converted_text, -3) == "\xef\xbb\xbf")
+			{
+				$converted_text = substr($converted_text, 0, -3);
+			}
+		}
+
+		return $converted_text;
+	}
+
+	/**
+	* Returns true if $string is valid UTF-8 and false otherwise.
+	*
+	* @param mixed $str String to be tested
+	* @return boolean
+	*/
+	static function is_utf8($str)
+	{
+		$c=0; $b=0;
+		$bits=0;
+		$len=strlen($str);
+		for($i=0; $i<$len; $i++)
+		{
+			$c=ord($str[$i]);
+			if($c > 128)
+			{
+				if(($c >= 254)) return false;
+				elseif($c >= 252) $bits=6;
+				elseif($c >= 248) $bits=5;
+				elseif($c >= 240) $bits=4;
+				elseif($c >= 224) $bits=3;
+				elseif($c >= 192) $bits=2;
+				else return false;
+				if(($i+$bits) > $len) return false;
+				while($bits > 1)
+				{
+					$i++;
+					$b=ord($str[$i]);
+					if($b < 128 || $b > 191) return false;
+					$bits--;
+				}
+			}
+		}
+		return true;
+	}
+	/*
+	function is_utf8($string)
+	{
+		//this is buggy
+		return (utf8_encode(utf8_decode($string)) == $string);
+	}
+	*/
+
+	/**
+	 * Function to try a few tricks to determine the displayed size of an img on the page.
+	 * NOTE: This will ONLY work on an IMG tag. Returns FALSE on all other tag types.
+	 *
+	 * @author John Schlick
+	 * @version April 19 2012
+	 * @return array an array containing the 'height' and 'width' of the image on the page or -1 if we can't figure it out.
+	 */
+	function get_display_size()
+	{
+		global $debug_object;
+
+		$width = -1;
+		$height = -1;
+
+		if ($this->tag !== 'img')
+		{
+			return false;
+		}
+
+		// See if there is aheight or width attribute in the tag itself.
+		if (isset($this->attr['width']))
+		{
+			$width = $this->attr['width'];
+		}
+
+		if (isset($this->attr['height']))
+		{
+			$height = $this->attr['height'];
+		}
+
+		// Now look for an inline style.
+		if (isset($this->attr['style']))
+		{
+			// Thanks to user gnarf from stackoverflow for this regular expression.
+			$attributes = array();
+			preg_match_all("/([\w-]+)\s*:\s*([^;]+)\s*;?/", $this->attr['style'], $matches, PREG_SET_ORDER);
+			foreach ($matches as $match) {
+			  $attributes[$match[1]] = $match[2];
+			}
+
+			// If there is a width in the style attributes:
+			if (isset($attributes['width']) && $width == -1)
+			{
+				// check that the last two characters are px (pixels)
+				if (strtolower(substr($attributes['width'], -2)) == 'px')
+				{
+					$proposed_width = substr($attributes['width'], 0, -2);
+					// Now make sure that it's an integer and not something stupid.
+					if (filter_var($proposed_width, FILTER_VALIDATE_INT))
+					{
+						$width = $proposed_width;
+					}
+				}
+			}
+
+			// If there is a width in the style attributes:
+			if (isset($attributes['height']) && $height == -1)
+			{
+				// check that the last two characters are px (pixels)
+				if (strtolower(substr($attributes['height'], -2)) == 'px')
+				{
+					$proposed_height = substr($attributes['height'], 0, -2);
+					// Now make sure that it's an integer and not something stupid.
+					if (filter_var($proposed_height, FILTER_VALIDATE_INT))
+					{
+						$height = $proposed_height;
+					}
+				}
+			}
+
+		}
+
+		// Future enhancement:
+		// Look in the tag to see if there is a class or id specified that has a height or width attribute to it.
+
+		// Far future enhancement
+		// Look at all the parent tags of this image to see if they specify a class or id that has an img selector that specifies a height or width
+		// Note that in this case, the class or id will have the img subselector for it to apply to the image.
+
+		// ridiculously far future development
+		// If the class or id is specified in a SEPARATE css file thats not on the page, go get it and do what we were just doing for the ones on the page.
+
+		$result = array('height' => $height,
+						'width' => $width);
+		return $result;
+	}
+
+	// camel naming conventions
+	function getAllAttributes() {return $this->attr;}
+	function getAttribute($name) {return $this->__get($name);}
+	function setAttribute($name, $value) {$this->__set($name, $value);}
+	function hasAttribute($name) {return $this->__isset($name);}
+	function removeAttribute($name) {$this->__set($name, null);}
+	function getElementById($id) {return $this->find("#$id", 0);}
+	function getElementsById($id, $idx=null) {return $this->find("#$id", $idx);}
+	function getElementByTagName($name) {return $this->find($name, 0);}
+	function getElementsByTagName($name, $idx=null) {return $this->find($name, $idx);}
+	function parentNode() {return $this->parent();}
+	function childNodes($idx=-1) {return $this->children($idx);}
+	function firstChild() {return $this->first_child();}
+	function lastChild() {return $this->last_child();}
+	function nextSibling() {return $this->next_sibling();}
+	function previousSibling() {return $this->prev_sibling();}
+	function hasChildNodes() {return $this->has_child();}
+	function nodeName() {return $this->tag;}
+	function appendChild($node) {$node->parent($this); return $node;}
+
+}
+
+/**
+ * simple html dom parser
+ * Paperg - in the find routine: allow us to specify that we want case insensitive testing of the value of the selector.
+ * Paperg - change $size from protected to public so we can easily access it
+ * Paperg - added ForceTagsClosed in the constructor which tells us whether we trust the html or not.  Default is to NOT trust it.
+ *
+ * @package PlaceLocalInclude
+ */
+class simple_html_dom
+{
+	public $root = null;
+	public $nodes = array();
+	public $callback = null;
+	public $lowercase = false;
+	// Used to keep track of how large the text was when we started.
+	public $original_size;
+	public $size;
+	protected $pos;
+	protected $doc;
+	protected $char;
+	protected $cursor;
+	protected $parent;
+	protected $noise = array();
+	protected $token_blank = " \t\r\n";
+	protected $token_equal = ' =/>';
+	protected $token_slash = " />\r\n\t";
+	protected $token_attr = ' >';
+	// Note that this is referenced by a child node, and so it needs to be public for that node to see this information.
+	public $_charset = '';
+	public $_target_charset = '';
+	protected $default_br_text = "";
+	public $default_span_text = "";
+
+	// use isset instead of in_array, performance boost about 30%...
+	protected $self_closing_tags = array('img'=>1, 'br'=>1, 'input'=>1, 'meta'=>1, 'link'=>1, 'hr'=>1, 'base'=>1, 'embed'=>1, 'spacer'=>1);
+	protected $block_tags = array('root'=>1, 'body'=>1, 'form'=>1, 'div'=>1, 'span'=>1, 'table'=>1);
+	// Known sourceforge issue #2977341
+	// B tags that are not closed cause us to return everything to the end of the document.
+	protected $optional_closing_tags = array(
+		'tr'=>array('tr'=>1, 'td'=>1, 'th'=>1),
+		'th'=>array('th'=>1),
+		'td'=>array('td'=>1),
+		'li'=>array('li'=>1),
+		'dt'=>array('dt'=>1, 'dd'=>1),
+		'dd'=>array('dd'=>1, 'dt'=>1),
+		'dl'=>array('dd'=>1, 'dt'=>1),
+		'p'=>array('p'=>1),
+		'nobr'=>array('nobr'=>1),
+		'b'=>array('b'=>1),
+		'option'=>array('option'=>1),
+	);
+
+	function __construct($str=null, $lowercase=true, $forceTagsClosed=true, $target_charset=DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
+	{
+		if ($str)
+		{
+			if (preg_match("/^http:\/\//i",$str) || is_file($str))
+			{
+				$this->load_file($str);
+			}
+			else
+			{
+				$this->load($str, $lowercase, $stripRN, $defaultBRText, $defaultSpanText);
+			}
+		}
+		// Forcing tags to be closed implies that we don't trust the html, but it can lead to parsing errors if we SHOULD trust the html.
+		if (!$forceTagsClosed) {
+			$this->optional_closing_array=array();
+		}
+		$this->_target_charset = $target_charset;
+	}
+
+	function __destruct()
+	{
+		$this->clear();
+	}
+
+	// load html from string
+	function load($str, $lowercase=true, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
+	{
+		global $debug_object;
+
+		// prepare
+		$this->prepare($str, $lowercase, $stripRN, $defaultBRText, $defaultSpanText);
+		// strip out cdata
+		$this->remove_noise("'<!\[CDATA\[(.*?)\]\]>'is", true);
+		// strip out comments
+		$this->remove_noise("'<!--(.*?)-->'is");
+		// Per sourceforge http://sourceforge.net/tracker/?func=detail&aid=2949097&group_id=218559&atid=1044037
+		// Script tags removal now preceeds style tag removal.
+		// strip out <script> tags
+		$this->remove_noise("'<\s*script[^>]*[^/]>(.*?)<\s*/\s*script\s*>'is");
+		$this->remove_noise("'<\s*script\s*>(.*?)<\s*/\s*script\s*>'is");
+		// strip out <style> tags
+		$this->remove_noise("'<\s*style[^>]*[^/]>(.*?)<\s*/\s*style\s*>'is");
+		$this->remove_noise("'<\s*style\s*>(.*?)<\s*/\s*style\s*>'is");
+		// strip out preformatted tags
+		$this->remove_noise("'<\s*(?:code)[^>]*>(.*?)<\s*/\s*(?:code)\s*>'is");
+		// strip out server side scripts
+		$this->remove_noise("'(<\?)(.*?)(\?>)'s", true);
+		// strip smarty scripts
+		$this->remove_noise("'(\{\w)(.*?)(\})'s", true);
+
+		// parsing
+		while ($this->parse());
+		// end
+		$this->root->_[HDOM_INFO_END] = $this->cursor;
+		$this->parse_charset();
+
+		// make load function chainable
+		return $this;
+
+	}
+
+	// load html from file
+	function load_file()
+	{
+		$args = func_get_args();
+		$this->load(call_user_func_array('file_get_contents', $args), true);
+		// Throw an error if we can't properly load the dom.
+		if (($error=error_get_last())!==null) {
+			$this->clear();
+			return false;
+		}
+	}
+
+	// set callback function
+	function set_callback($function_name)
+	{
+		$this->callback = $function_name;
+	}
+
+	// remove callback function
+	function remove_callback()
+	{
+		$this->callback = null;
+	}
+
+	// save dom as string
+	function save($filepath='')
+	{
+		$ret = $this->root->innertext();
+		if ($filepath!=='') file_put_contents($filepath, $ret, LOCK_EX);
+		return $ret;
+	}
+
+	// find dom node by css selector
+	// Paperg - allow us to specify that we want case insensitive testing of the value of the selector.
+	function find($selector, $idx=null, $lowercase=false)
+	{
+		return $this->root->find($selector, $idx, $lowercase);
+	}
+
+	// clean up memory due to php5 circular references memory leak...
+	function clear()
+	{
+		foreach ($this->nodes as $n) {$n->clear(); $n = null;}
+		// This add next line is documented in the sourceforge repository. 2977248 as a fix for ongoing memory leaks that occur even with the use of clear.
+		if (isset($this->children)) foreach ($this->children as $n) {$n->clear(); $n = null;}
+		if (isset($this->parent)) {$this->parent->clear(); unset($this->parent);}
+		if (isset($this->root)) {$this->root->clear(); unset($this->root);}
+		unset($this->doc);
+		unset($this->noise);
+	}
+
+	function dump($show_attr=true)
+	{
+		$this->root->dump($show_attr);
+	}
+
+	// prepare HTML data and init everything
+	protected function prepare($str, $lowercase=true, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
+	{
+		$this->clear();
+
+		// set the length of content before we do anything to it.
+		$this->size = strlen($str);
+		// Save the original size of the html that we got in.  It might be useful to someone.
+		$this->original_size = $this->size;
+
+		//before we save the string as the doc...  strip out the \r \n's if we are told to.
+		if ($stripRN) {
+			$str = str_replace("\r", " ", $str);
+			$str = str_replace("\n", " ", $str);
+
+			// set the length of content since we have changed it.
+			$this->size = strlen($str);
+		}
+
+		$this->doc = $str;
+		$this->pos = 0;
+		$this->cursor = 1;
+		$this->noise = array();
+		$this->nodes = array();
+		$this->lowercase = $lowercase;
+		$this->default_br_text = $defaultBRText;
+		$this->default_span_text = $defaultSpanText;
+		$this->root = new simple_html_dom_node($this);
+		$this->root->tag = 'root';
+		$this->root->_[HDOM_INFO_BEGIN] = -1;
+		$this->root->nodetype = HDOM_TYPE_ROOT;
+		$this->parent = $this->root;
+		if ($this->size>0) $this->char = $this->doc[0];
+	}
+
+	// parse html content
+	protected function parse()
+	{
+		if (($s = $this->copy_until_char('<'))==='')
+		{
+			return $this->read_tag();
+		}
+
+		// text
+		$node = new simple_html_dom_node($this);
+		++$this->cursor;
+		$node->_[HDOM_INFO_TEXT] = $s;
+		$this->link_nodes($node, false);
+		return true;
+	}
+
+	// PAPERG - dkchou - added this to try to identify the character set of the page we have just parsed so we know better how to spit it out later.
+	// NOTE:  IF you provide a routine called get_last_retrieve_url_contents_content_type which returns the CURLINFO_CONTENT_TYPE from the last curl_exec
+	// (or the content_type header from the last transfer), we will parse THAT, and if a charset is specified, we will use it over any other mechanism.
+	protected function parse_charset()
+	{
+		global $debug_object;
+
+		$charset = null;
+
+		if (function_exists('get_last_retrieve_url_contents_content_type'))
+		{
+			$contentTypeHeader = get_last_retrieve_url_contents_content_type();
+			$success = preg_match('/charset=(.+)/', $contentTypeHeader, $matches);
+			if ($success)
+			{
+				$charset = $matches[1];
+				if (is_object($debug_object)) {$debug_object->debug_log(2, 'header content-type found charset of: ' . $charset);}
+			}
+
+		}
+
+		if (empty($charset))
+		{
+			$el = $this->root->find('meta[http-equiv=Content-Type]',0);
+			if (!empty($el))
+			{
+				$fullvalue = $el->content;
+				if (is_object($debug_object)) {$debug_object->debug_log(2, 'meta content-type tag found' . $fullvalue);}
+
+				if (!empty($fullvalue))
+				{
+					$success = preg_match('/charset=(.+)/', $fullvalue, $matches);
+					if ($success)
+					{
+						$charset = $matches[1];
+					}
+					else
+					{
+						// If there is a meta tag, and they don't specify the character set, research says that it's typically ISO-8859-1
+						if (is_object($debug_object)) {$debug_object->debug_log(2, 'meta content-type tag couldn\'t be parsed. using iso-8859 default.');}
+						$charset = 'ISO-8859-1';
+					}
+				}
+			}
+		}
+
+		// If we couldn't find a charset above, then lets try to detect one based on the text we got...
+		if (empty($charset))
+		{
+			// Use this in case mb_detect_charset isn't installed/loaded on this machine.
+			$charset = false;
+			if (function_exists('mb_detect_encoding'))
+			{
+				// Have php try to detect the encoding from the text given to us.
+				$charset = mb_detect_encoding($this->root->plaintext . "ascii", $encoding_list = array( "UTF-8", "CP1252" ) );
+				if (is_object($debug_object)) {$debug_object->debug_log(2, 'mb_detect found: ' . $charset);}
+			}
+
+			// and if this doesn't work...  then we need to just wrongheadedly assume it's UTF-8 so that we can move on - cause this will usually give us most of what we need...
+			if ($charset === false)
+			{
+				if (is_object($debug_object)) {$debug_object->debug_log(2, 'since mb_detect failed - using default of utf-8');}
+				$charset = 'UTF-8';
+			}
+		}
+
+		// Since CP1252 is a superset, if we get one of it's subsets, we want it instead.
+		if ((strtolower($charset) == strtolower('ISO-8859-1')) || (strtolower($charset) == strtolower('Latin1')) || (strtolower($charset) == strtolower('Latin-1')))
+		{
+			if (is_object($debug_object)) {$debug_object->debug_log(2, 'replacing ' . $charset . ' with CP1252 as its a superset');}
+			$charset = 'CP1252';
+		}
+
+		if (is_object($debug_object)) {$debug_object->debug_log(1, 'EXIT - ' . $charset);}
+
+		return $this->_charset = $charset;
+	}
+
+	// read tag info
+	protected function read_tag()
+	{
+		if ($this->char!=='<')
+		{
+			$this->root->_[HDOM_INFO_END] = $this->cursor;
+			return false;
+		}
+		$begin_tag_pos = $this->pos;
+		$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
+
+		// end tag
+		if ($this->char==='/')
+		{
+			$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
+			// This represents the change in the simple_html_dom trunk from revision 180 to 181.
+			// $this->skip($this->token_blank_t);
+			$this->skip($this->token_blank);
+			$tag = $this->copy_until_char('>');
+
+			// skip attributes in end tag
+			if (($pos = strpos($tag, ' '))!==false)
+				$tag = substr($tag, 0, $pos);
+
+			$parent_lower = strtolower($this->parent->tag);
+			$tag_lower = strtolower($tag);
+
+			if ($parent_lower!==$tag_lower)
+			{
+				if (isset($this->optional_closing_tags[$parent_lower]) && isset($this->block_tags[$tag_lower]))
+				{
+					$this->parent->_[HDOM_INFO_END] = 0;
+					$org_parent = $this->parent;
+
+					while (($this->parent->parent) && strtolower($this->parent->tag)!==$tag_lower)
+						$this->parent = $this->parent->parent;
+
+					if (strtolower($this->parent->tag)!==$tag_lower) {
+						$this->parent = $org_parent; // restore origonal parent
+						if ($this->parent->parent) $this->parent = $this->parent->parent;
+						$this->parent->_[HDOM_INFO_END] = $this->cursor;
+						return $this->as_text_node($tag);
+					}
+				}
+				else if (($this->parent->parent) && isset($this->block_tags[$tag_lower]))
+				{
+					$this->parent->_[HDOM_INFO_END] = 0;
+					$org_parent = $this->parent;
+
+					while (($this->parent->parent) && strtolower($this->parent->tag)!==$tag_lower)
+						$this->parent = $this->parent->parent;
+
+					if (strtolower($this->parent->tag)!==$tag_lower)
+					{
+						$this->parent = $org_parent; // restore origonal parent
+						$this->parent->_[HDOM_INFO_END] = $this->cursor;
+						return $this->as_text_node($tag);
+					}
+				}
+				else if (($this->parent->parent) && strtolower($this->parent->parent->tag)===$tag_lower)
+				{
+					$this->parent->_[HDOM_INFO_END] = 0;
+					$this->parent = $this->parent->parent;
+				}
+				else
+					return $this->as_text_node($tag);
+			}
+
+			$this->parent->_[HDOM_INFO_END] = $this->cursor;
+			if ($this->parent->parent) $this->parent = $this->parent->parent;
+
+			$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
+			return true;
+		}
+
+		$node = new simple_html_dom_node($this);
+		$node->_[HDOM_INFO_BEGIN] = $this->cursor;
+		++$this->cursor;
+		$tag = $this->copy_until($this->token_slash);
+		$node->tag_start = $begin_tag_pos;
+
+		// doctype, cdata & comments...
+		if (isset($tag[0]) && $tag[0]==='!') {
+			$node->_[HDOM_INFO_TEXT] = '<' . $tag . $this->copy_until_char('>');
+
+			if (isset($tag[2]) && $tag[1]==='-' && $tag[2]==='-') {
+				$node->nodetype = HDOM_TYPE_COMMENT;
+				$node->tag = 'comment';
+			} else {
+				$node->nodetype = HDOM_TYPE_UNKNOWN;
+				$node->tag = 'unknown';
+			}
+			if ($this->char==='>') $node->_[HDOM_INFO_TEXT].='>';
+			$this->link_nodes($node, true);
+			$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
+			return true;
+		}
+
+		// text
+		if ($pos=strpos($tag, '<')!==false) {
+			$tag = '<' . substr($tag, 0, -1);
+			$node->_[HDOM_INFO_TEXT] = $tag;
+			$this->link_nodes($node, false);
+			$this->char = $this->doc[--$this->pos]; // prev
+			return true;
+		}
+
+		if (!preg_match("/^[\w-:]+$/", $tag)) {
+			$node->_[HDOM_INFO_TEXT] = '<' . $tag . $this->copy_until('<>');
+			if ($this->char==='<') {
+				$this->link_nodes($node, false);
+				return true;
+			}
+
+			if ($this->char==='>') $node->_[HDOM_INFO_TEXT].='>';
+			$this->link_nodes($node, false);
+			$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
+			return true;
+		}
+
+		// begin tag
+		$node->nodetype = HDOM_TYPE_ELEMENT;
+		$tag_lower = strtolower($tag);
+		$node->tag = ($this->lowercase) ? $tag_lower : $tag;
+
+		// handle optional closing tags
+		if (isset($this->optional_closing_tags[$tag_lower]) )
+		{
+			while (isset($this->optional_closing_tags[$tag_lower][strtolower($this->parent->tag)]))
+			{
+				$this->parent->_[HDOM_INFO_END] = 0;
+				$this->parent = $this->parent->parent;
+			}
+			$node->parent = $this->parent;
+		}
+
+		$guard = 0; // prevent infinity loop
+		$space = array($this->copy_skip($this->token_blank), '', '');
+
+		// attributes
+		do
+		{
+			if ($this->char!==null && $space[0]==='')
+			{
+				break;
+			}
+			$name = $this->copy_until($this->token_equal);
+			if ($guard===$this->pos)
+			{
+				$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
+				continue;
+			}
+			$guard = $this->pos;
+
+			// handle endless '<'
+			if ($this->pos>=$this->size-1 && $this->char!=='>') {
+				$node->nodetype = HDOM_TYPE_TEXT;
+				$node->_[HDOM_INFO_END] = 0;
+				$node->_[HDOM_INFO_TEXT] = '<'.$tag . $space[0] . $name;
+				$node->tag = 'text';
+				$this->link_nodes($node, false);
+				return true;
+			}
+
+			// handle mismatch '<'
+			if ($this->doc[$this->pos-1]=='<') {
+				$node->nodetype = HDOM_TYPE_TEXT;
+				$node->tag = 'text';
+				$node->attr = array();
+				$node->_[HDOM_INFO_END] = 0;
+				$node->_[HDOM_INFO_TEXT] = substr($this->doc, $begin_tag_pos, $this->pos-$begin_tag_pos-1);
+				$this->pos -= 2;
+				$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
+				$this->link_nodes($node, false);
+				return true;
+			}
+
+			if ($name!=='/' && $name!=='') {
+				$space[1] = $this->copy_skip($this->token_blank);
+				$name = $this->restore_noise($name);
+				if ($this->lowercase) $name = strtolower($name);
+				if ($this->char==='=') {
+					$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
+					$this->parse_attr($node, $name, $space);
+				}
+				else {
+					//no value attr: nowrap, checked selected...
+					$node->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_NO;
+					$node->attr[$name] = true;
+					if ($this->char!='>') $this->char = $this->doc[--$this->pos]; // prev
+				}
+				$node->_[HDOM_INFO_SPACE][] = $space;
+				$space = array($this->copy_skip($this->token_blank), '', '');
+			}
+			else
+				break;
+		} while ($this->char!=='>' && $this->char!=='/');
+
+		$this->link_nodes($node, true);
+		$node->_[HDOM_INFO_ENDSPACE] = $space[0];
+
+		// check self closing
+		if ($this->copy_until_char_escape('>')==='/')
+		{
+			$node->_[HDOM_INFO_ENDSPACE] .= '/';
+			$node->_[HDOM_INFO_END] = 0;
+		}
+		else
+		{
+			// reset parent
+			if (!isset($this->self_closing_tags[strtolower($node->tag)])) $this->parent = $node;
+		}
+		$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
+
+		// If it's a BR tag, we need to set it's text to the default text.
+		// This way when we see it in plaintext, we can generate formatting that the user wants.
+		// since a br tag never has sub nodes, this works well.
+		if ($node->tag == "br")
+		{
+			$node->_[HDOM_INFO_INNER] = $this->default_br_text;
+		}
+
+		return true;
+	}
+
+	// parse attributes
+	protected function parse_attr($node, $name, &$space)
+	{
+		// Per sourceforge: http://sourceforge.net/tracker/?func=detail&aid=3061408&group_id=218559&atid=1044037
+		// If the attribute is already defined inside a tag, only pay atetntion to the first one as opposed to the last one.
+		if (isset($node->attr[$name]))
+		{
+			return;
+		}
+
+		$space[2] = $this->copy_skip($this->token_blank);
+		switch ($this->char) {
+			case '"':
+				$node->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_DOUBLE;
+				$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
+				$node->attr[$name] = $this->restore_noise($this->copy_until_char_escape('"'));
+				$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
+				break;
+			case '\'':
+				$node->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_SINGLE;
+				$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
+				$node->attr[$name] = $this->restore_noise($this->copy_until_char_escape('\''));
+				$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
+				break;
+			default:
+				$node->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_NO;
+				$node->attr[$name] = $this->restore_noise($this->copy_until($this->token_attr));
+		}
+		// PaperG: Attributes should not have \r or \n in them, that counts as html whitespace.
+		$node->attr[$name] = str_replace("\r", "", $node->attr[$name]);
+		$node->attr[$name] = str_replace("\n", "", $node->attr[$name]);
+		// PaperG: If this is a "class" selector, lets get rid of the preceeding and trailing space since some people leave it in the multi class case.
+		if ($name == "class") {
+			$node->attr[$name] = trim($node->attr[$name]);
+		}
+	}
+
+	// link node's parent
+	protected function link_nodes(&$node, $is_child)
+	{
+		$node->parent = $this->parent;
+		$this->parent->nodes[] = $node;
+		if ($is_child)
+		{
+			$this->parent->children[] = $node;
+		}
+	}
+
+	// as a text node
+	protected function as_text_node($tag)
+	{
+		$node = new simple_html_dom_node($this);
+		++$this->cursor;
+		$node->_[HDOM_INFO_TEXT] = '</' . $tag . '>';
+		$this->link_nodes($node, false);
+		$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
+		return true;
+	}
+
+	protected function skip($chars)
+	{
+		$this->pos += strspn($this->doc, $chars, $this->pos);
+		$this->char = ($this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
+	}
+
+	protected function copy_skip($chars)
+	{
+		$pos = $this->pos;
+		$len = strspn($this->doc, $chars, $pos);
+		$this->pos += $len;
+		$this->char = ($this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
+		if ($len===0) return '';
+		return substr($this->doc, $pos, $len);
+	}
+
+	protected function copy_until($chars)
+	{
+		$pos = $this->pos;
+		$len = strcspn($this->doc, $chars, $pos);
+		$this->pos += $len;
+		$this->char = ($this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
+		return substr($this->doc, $pos, $len);
+	}
+
+	protected function copy_until_char($char)
+	{
+		if ($this->char===null) return '';
+
+		if (($pos = strpos($this->doc, $char, $this->pos))===false) {
+			$ret = substr($this->doc, $this->pos, $this->size-$this->pos);
+			$this->char = null;
+			$this->pos = $this->size;
+			return $ret;
+		}
+
+		if ($pos===$this->pos) return '';
+		$pos_old = $this->pos;
+		$this->char = $this->doc[$pos];
+		$this->pos = $pos;
+		return substr($this->doc, $pos_old, $pos-$pos_old);
+	}
+
+	protected function copy_until_char_escape($char)
+	{
+		if ($this->char===null) return '';
+
+		$start = $this->pos;
+		while (1)
+		{
+			if (($pos = strpos($this->doc, $char, $start))===false)
+			{
+				$ret = substr($this->doc, $this->pos, $this->size-$this->pos);
+				$this->char = null;
+				$this->pos = $this->size;
+				return $ret;
+			}
+
+			if ($pos===$this->pos) return '';
+
+			if ($this->doc[$pos-1]==='\\') {
+				$start = $pos+1;
+				continue;
+			}
+
+			$pos_old = $this->pos;
+			$this->char = $this->doc[$pos];
+			$this->pos = $pos;
+			return substr($this->doc, $pos_old, $pos-$pos_old);
+		}
+	}
+
+	// remove noise from html content
+	// save the noise in the $this->noise array.
+	protected function remove_noise($pattern, $remove_tag=false)
+	{
+		global $debug_object;
+		if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
+
+		$count = preg_match_all($pattern, $this->doc, $matches, PREG_SET_ORDER|PREG_OFFSET_CAPTURE);
+
+		for ($i=$count-1; $i>-1; --$i)
+		{
+			$key = '___noise___'.sprintf('% 5d', count($this->noise)+1000);
+			if (is_object($debug_object)) { $debug_object->debug_log(2, 'key is: ' . $key); }
+			$idx = ($remove_tag) ? 0 : 1;
+			$this->noise[$key] = $matches[$i][$idx][0];
+			$this->doc = substr_replace($this->doc, $key, $matches[$i][$idx][1], strlen($matches[$i][$idx][0]));
+		}
+
+		// reset the length of content
+		$this->size = strlen($this->doc);
+		if ($this->size>0)
+		{
+			$this->char = $this->doc[0];
+		}
+	}
+
+	// restore noise to html content
+	function restore_noise($text)
+	{
+		global $debug_object;
+		if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
+
+		while (($pos=strpos($text, '___noise___'))!==false)
+		{
+			// Sometimes there is a broken piece of markup, and we don't GET the pos+11 etc... token which indicates a problem outside of us...
+			if (strlen($text) > $pos+15)
+			{
+				$key = '___noise___'.$text[$pos+11].$text[$pos+12].$text[$pos+13].$text[$pos+14].$text[$pos+15];
+				if (is_object($debug_object)) { $debug_object->debug_log(2, 'located key of: ' . $key); }
+
+				if (isset($this->noise[$key]))
+				{
+					$text = substr($text, 0, $pos).$this->noise[$key].substr($text, $pos+16);
+				}
+				else
+				{
+					// do this to prevent an infinite loop.
+					$text = substr($text, 0, $pos).'UNDEFINED NOISE FOR KEY: '.$key . substr($text, $pos+16);
+				}
+			}
+			else
+			{
+				// There is no valid key being given back to us... We must get rid of the ___noise___ or we will have a problem.
+				$text = substr($text, 0, $pos).'NO NUMERIC NOISE KEY' . substr($text, $pos+11);
+			}
+		}
+		return $text;
+	}
+
+	// Sometimes we NEED one of the noise elements.
+	function search_noise($text)
+	{
+		global $debug_object;
+		if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
+
+		foreach($this->noise as $noiseElement)
+		{
+			if (strpos($noiseElement, $text)!==false)
+			{
+				return $noiseElement;
+			}
+		}
+	}
+	function __toString()
+	{
+		return $this->root->innertext();
+	}
+
+	function __get($name)
+	{
+		switch ($name)
+		{
+			case 'outertext':
+				return $this->root->innertext();
+			case 'innertext':
+				return $this->root->innertext();
+			case 'plaintext':
+				return $this->root->text();
+			case 'charset':
+				return $this->_charset;
+			case 'target_charset':
+				return $this->_target_charset;
+		}
+	}
+
+	// camel naming conventions
+	function childNodes($idx=-1) {return $this->root->childNodes($idx);}
+	function firstChild() {return $this->root->first_child();}
+	function lastChild() {return $this->root->last_child();}
+	function createElement($name, $value=null) {return @str_get_html("<$name>$value</$name>")->first_child();}
+	function createTextNode($value) {return @end(str_get_html($value)->nodes);}
+	function getElementById($id) {return $this->find("#$id", 0);}
+	function getElementsById($id, $idx=null) {return $this->find("#$id", $idx);}
+	function getElementByTagName($name) {return $this->find($name, 0);}
+	function getElementsByTagName($name, $idx=-1) {return $this->find($name, $idx);}
+	function loadFile() {$args = func_get_args();$this->load_file($args);}
+}
+
+?>
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/third_party_compat/module.third_party_compat.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/third_party_compat/module.third_party_compat.php
new file mode 100644
index 0000000000000000000000000000000000000000..b8552dc77c901dbb508a4e55532d80f436ff9df0
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/third_party_compat/module.third_party_compat.php
@@ -0,0 +1,117 @@
+<?php
+
+/***
+{
+    Module: photocrati-third_party_compat,
+    Depends: {}
+}
+ ***/
+class M_Third_Party_Compat extends C_Base_Module
+{
+    function define()
+    {
+        parent::define(
+            'photocrati-third_party_compat',
+            'Third Party Compatibility',
+            "Adds Third party compatibility hacks, adjustments, and modifications",
+            '0.1',
+            'http://www.nextgen-gallery.com',
+            'Photocrati Media',
+            'http://www.photocrati.com'
+        );
+    }
+
+    function _register_adapters()
+    {
+    }
+
+    function _register_hooks()
+    {
+        add_action('init', array(&$this, 'colorbox'), PHP_INT_MAX);
+        add_action('wp', array(&$this, 'bjlazyload'), PHP_INT_MAX);
+    }
+
+    /**
+     * Colorbox fires a filter (pri=100) to add class attributes to images via a the_content filter. We fire our
+     * shortcodes at PHP_INT_MAX-1 to avoid encoding issues with some themes. Here we move the Colorbox filters
+     * priority to PHP_INT_MAX so that they run after our shortcode text has been replaced with rendered galleries.
+     */
+    function colorbox()
+    {
+        if (!class_exists('JQueryColorboxFrontend'))
+            return;
+
+        global $wp_filter;
+
+        if (empty($wp_filter['the_content'][100]))
+            return;
+
+        foreach ($wp_filter['the_content'][100] as $id => $filter) {
+            if (!strpos($id, 'addColorboxGroupIdToImages'))
+                continue;
+
+            $object = $filter['function'][0];
+
+            if (get_class($object) != 'JQueryColorboxFrontend')
+                continue;
+
+            remove_filter('the_content', array($object, 'addColorboxGroupIdToImages'), 100);
+            remove_filter('the_excerpt', array($object, 'addColorboxGroupIdToImages'), 100);
+            add_filter('the_content', array($object, 'addColorboxGroupIdToImages'), PHP_INT_MAX);
+            add_filter('the_excerpt', array($object, 'addColorboxGroupIdToImages'), PHP_INT_MAX);
+            break;
+        }
+    }
+
+    /**
+     * For the same reasons as Colorbox we move BJ-Lazy-load's filter() method to a later priority so it can access
+     * our rendered galleries.
+     */
+    function bjlazyload()
+    {
+        if (!class_exists('BJLL'))
+            return;
+
+        global $wp_filter;
+
+        if (empty($wp_filter['the_content'][200]))
+            return;
+
+        foreach ($wp_filter['the_content'][200] as $id => $filter) {
+            if (!strpos($id, 'filter'))
+                continue;
+
+            $object = $filter['function'][0];
+
+            if (get_class($object) != 'BJLL')
+                continue;
+
+            remove_filter('the_content', array($object, 'filter'), 200);
+            add_filter('the_content', array($object, 'filter'), PHP_INT_MAX);
+            break;
+        }
+
+        add_filter('the_content', array($this, 'bjlazyload_filter'), PHP_INT_MAX-1);
+    }
+
+    /**
+     * BJ-Lazy-load's regex is lazy and doesn't handle multiline search or instances where <img is immediately followed
+     * by a newline. The following regex replaces newlines and strips unnecessary space. We fire this filter
+     * before BJ-Lazy-Load's to make our galleries compatible with its expectations.
+     *
+     * @param string $content
+     * @return string
+     */
+    function bjlazyload_filter($content)
+    {
+        return trim(preg_replace("/\s\s+/", " ", $content));
+    }
+
+    function get_type_list()
+    {
+        return array(
+        );
+    }
+}
+
+new M_Third_Party_Compat();
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/validation/mixin.validation.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/validation/mixin.validation.php
new file mode 100644
index 0000000000000000000000000000000000000000..a277c94627379e781b65581eb6d9225ce59e802b
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/validation/mixin.validation.php
@@ -0,0 +1,507 @@
+<?php
+
+class Mixin_Validation extends Mixin
+{
+    var $_default_msgs = array(
+       "validates_presence_of"      => "%s should be present",
+       "validates_presence_with"    => "%s should be present with %s",
+       "validates_uniqueness_of"    => "%s should be unique",
+       "validates_confirmation_of"  => "%s should match confirmation",
+       "validates_exclusion_of"     => "%s is reserved",
+       "validates_format_of"        => "%s is invalid",
+       "validates_inclusion_of"     => "%s is not included in the list",
+       "validates_numericality_of"  => "%s is not numeric",
+       "validates_less_than"        => "%s is too small",
+       "validates_greater_than"     => "%s is too large",
+       "validates_equals"           => "%s is invalid",
+    );
+
+    var $_default_patterns = array(
+      'email_address'   =>  "//"
+    );
+
+
+    /**
+     * Clears all errors for the object
+     */
+    function clear_errors()
+    {
+        $this->object->_errors = array();
+    }
+
+	/**
+	 * Returns the errors for a particular property
+	 * @param string $property
+	 * @return array|null
+	 */
+	function errors_for($property)
+	{
+		$errors = $this->object->_errors;
+		if (isset($errors[$property])) return $errors[$property];
+		else return NULL;
+	}
+
+
+    /**
+     * Adds an error for a particular property of the object
+     * @param string $property
+     * @param string $msg
+     */
+    function add_error($msg, $property='*')
+    {
+		$errors = &$this->object->_errors;
+
+        if (!isset($errors[$property])) {
+            $errors[$property] = array();
+        }
+
+		$errors[$property][] = $msg;
+    }
+
+    /**
+     * Returns the default error message for a particular validator.
+     * A hook could override this, or this class could be subclassed
+     * @param string $validator
+     * @return string
+     */
+    function _get_default_error_message_for($validator)
+    {
+        $retval = FALSE;
+
+        // The $validator variable is often set to __METHOD__, and many
+        // forget that __METHOD__ looks like this:
+        // Mixin_Active_Record_Validation::validates_presence_of
+        // So, we fix that
+        if (strpos($validator, '::') !== FALSE) {
+            $parts = explode('::', $validator);
+            $validator = $parts[1];
+        }
+
+        // Ensure that the validator has a default error message
+        if (isset($this->_default_msgs[$validator])) {
+            $retval = $this->_default_msgs[$validator];
+        }
+
+        return $retval;
+    }
+
+
+
+    /**
+     * Returns the default pattern for a formatter, such as an "e-mail address".
+     * @param string $formatter
+     * @return string
+     */
+    function get_default_pattern_for($formatter)
+    {
+        $retval = FALSE;
+
+        if (isset($this->_default_patterns[$formatter])) {
+            $retval = $this->_default_patterns[$formatter];
+        }
+
+        return $retval;
+    }
+
+
+	/**
+	 * Gets all of the errors for the object
+	 * @return type
+	 */
+    function get_errors($property=FALSE)
+    {
+		$retval = $property ? $this->object->errors_for($property) : $this->object->_errors;
+        if (!$retval) $retval = array();
+		return $retval;
+    }
+
+
+	/**
+	 * Determines if an object, or a particular field for that object, has
+	 * errors
+	 * @param string $property
+	 * @return boolean
+	 */
+    function is_valid($property=FALSE)
+    {
+		$valid = TRUE;
+
+		$errors = $this->object->get_errors();
+		if ($property) {
+			if (isset($errors[$property]) && !empty($errors[$property]))
+				$valid = FALSE;
+		}
+		elseif (!empty($errors))
+			$valid = FALSE;
+
+        return $valid;
+    }
+
+	/**
+	 * Determines if the object, or a particular field on the object, has errors
+	 * @param type $property
+	 * @return type
+	 */
+	function is_invalid($property=FALSE)
+	{
+		return !$this->object->is_valid($property);
+	}
+
+
+    /**
+     * Calls the validation method for a record, clearing the previous errors
+     */
+    function validate()
+    {
+        $this->clear_errors();
+        if ($this->object->has_method('validation')) $this->object->validation();
+		return $this->is_valid();
+    }
+
+
+	/**
+	 * Converts the name of a property to a human readable property name
+	 * E.g. how_did_you_hear_about_us to "How did you hear about us"
+	 * @param string $str
+	 * @return string
+	 */
+    function humanize_string($str)
+    {
+        $retval = array();
+        if (is_array($str)) {;
+           foreach ($str as $s) {
+               $retval[] = $this->humanize_string($s);
+           }
+        }
+        else $retval = ucfirst(str_replace('_', ' ', $str));
+
+        return $retval;
+    }
+
+
+    /**
+     * Validates the length of a property's value
+     * @param type $property
+     * @param type $length
+     * @param type $msg
+     */
+    function validates_length_of($property, $length, $comparison_operator='=', $msg=FALSE)
+    {
+		$valid = TRUE;
+        $value = $this->object->$property;
+        $default_msg = $this->_get_default_error_message_for(__METHOD__);
+
+        if (!$this->is_empty($value)) {
+
+            switch ($comparison_operator) {
+                case '=':
+                case '==':
+                    $valid = strlen($value) == $comparison;
+                    $default_msg = $this->_get_default_error_message_for('validates_equals');
+                    break;
+                case '!=':
+                case '!':
+                    $valid = strlen($value) != $comparison;
+                    $default_msg = $this->_get_default_error_message_for('validates_equals');
+                    break;
+                case '<':
+                    $valid = strlen($value) < $comparion;
+                    $default_msg = $this->_get_default_error_message_for('validates_less_than');
+                    break;
+                case '>':
+                    $valid = strlen($value) > $comparison;
+                    $default_msg = $this->_get_default_error_message_for('validates_greater_than');
+                    break;
+                case '<=':
+                    $valid = strlen($value) <= $comparison;
+                    $default_msg = $this->_get_default_error_message_for('validates_less_than');
+                    break;
+                case '>=':
+                    $valid = strlen($value) >= $comparion;
+                    $default_msg = $this->_get_default_error_message_for('validates_greater_than');
+                    break;
+            }
+        }
+		else $valid = FALSE;
+
+		if (!$valid) {
+			if (!$msg) {
+				$error_msg = sprintf($default_msg, $this->humanize_string($property));
+			}
+			else $error_msg = $msg;
+
+			$this->add_error($error_msg, $property);
+		}
+    }
+
+
+    /**
+     * Validates that a property contains a numeric value. May optionally be tested against
+     * other numbers.
+     * @param string $property
+     * @param decimal $comparison
+     * @param string $comparison_operator
+     * @param type $msg
+     */
+    function validates_numericality_of($property, $comparison=FALSE, $comparison_operator=FALSE, $int_only=FALSE, $msg=FALSE)
+    {
+        $properties = is_array($property) ? $property : array($property);
+
+        foreach ($properties as $property) {
+            $value = $this->object->$property;
+            $default_msg = $this->_get_default_error_message_for(__METHOD__);
+
+            if (!$this->is_empty($value)) {
+                $invalid = FALSE;
+                if (is_numeric($value)) {
+                    $value = $value += 0;
+
+                    if ($int_only) {
+                        $invalid = !is_int($value);
+                    }
+
+                    if (!$invalid) {
+                        switch ($comparison_operator) {
+                            case '=':
+                            case '==':
+                                $invalid = ($value == $comparison) ? FALSE : TRUE;
+                                $default_msg = $this->_get_default_error_message_for('validates_equals');
+                                break;
+                            case '!=':
+                            case '!':
+                                $invalid = ($value != $comparison) ? FALSE : TRUE;
+                                $default_msg = $this->_get_default_error_message_for('validates_equals');
+                                break;
+                            case '<':
+                                $invalid = ($value < $comparion) ? FALSE : TRUE;
+                                $default_msg = $this->_get_default_error_message_for('validates_less_than');
+                                break;
+                            case '>':
+                                $invalid = ($value > $comparison) ? FALSE : TRUE;
+                                $default_msg = $this->_get_default_error_message_for('validates_greater_than');
+                                break;
+                            case '<=':
+                                $invalid = ($value <= $comparison) ? FALSE : TRUE;
+                                $default_msg = $this->_get_default_error_message_for('validates_less_than');
+                                break;
+                            case '>=':
+                                $invalid = ($value >= $comparison) ? FALSE : TRUE;
+                                $default_msg = $this->_get_default_error_message_for('validates_greater_than');
+                                break;
+                        }
+                    }
+                }
+                else $invalid = TRUE;
+
+                if ($invalid) {
+                    if (!$msg) {
+                        $error_msg = sprintf($default_msg, $this->humanize_string($property));
+                    }
+                    else $error_msg = $msg;
+
+                    $this->add_error($error_msg, $property);
+                }
+            }
+        }
+    }
+
+
+    /**
+     * Validates that a property includes a particular value
+     * @param string $property
+     * @param array $values
+     * @param string $msg
+     */
+    function validates_inclusion_of($property, $values=array(), $msg=FALSE)
+    {
+        if (!is_array($values)) $values = array($values);
+
+        if (!in_array($this->object->$property, $values)) {
+            if (!$msg) {
+                $msg = $this->_get_default_error_message_for(__METHOD__);
+                $msg = sprintf($msg, $this->humanize_string($property));
+            }
+            $this->add_error($msg, $property);
+        }
+    }
+
+
+    /**
+     * Validates that a property's value matches a particular pattern
+     * @param string|array $property
+     * @param string $pattern
+     * @param string $msg
+     */
+    function validates_format_of($property, $pattern, $msg = FALSE)
+    {
+        if (!is_array($property)) $property = array($property);
+
+        // A pattern could be the name of a default pattern, or a regex pattern
+        $default_pattern = $this->get_default_pattern_for($pattern);
+        if ($default_pattern) $default_pattern = $pattern;
+
+        foreach ($property as $prop) {
+
+            // We do not validate blank values - we rely on "validates_presense_of"
+            // for that
+            if (!$this->is_empty($this->object->$prop)) {
+
+                // If it doesn't match, then it's an error
+                if (!preg_match($pattern, $property)) {
+
+                    // Get default message
+                    if (!$msg) {
+                        $msg = $this->_get_default_error_message_for(__METHOD__);
+                        $msg = sprintf($msg, $this->humanize_string($property));
+                    }
+                    $this->add_error($msg, $property);
+                }
+            }
+        }
+    }
+
+
+    /**
+     * Ensures that a property does NOT have a particular value
+     * @param string $property
+     * @param array $exclusions
+     * @param string $msg
+     */
+    function validates_exclusion_of($property, $exclusions=array(), $msg=FALSE)
+    {
+        $invalid=FALSE;
+
+        if (!is_array($exclusions)) $exclusions = array($exclusions);
+        foreach ($exclusions as $exclusion) {
+            if ($exclusion == $this->object->$property) {
+                $invalid = TRUE;
+                break;
+            }
+        }
+
+        if ($invalid) {
+            if (!$msg) {
+                $msg = $this->_get_default_error_message_for(__METHOD__);
+                $msg = sprintf($msg, $this->humanize_string($property));
+            }
+            $this->add_error($msg, $property);
+        }
+    }
+
+
+    /**
+     * Validates the confirmation of a property
+     * @param string $property
+     * @param string $confirmation
+     * @param string $msg
+     */
+    function validates_confirmation_of($property, $confirmation, $msg=FALSE)
+    {
+        if ($this->object->$property != $this->object->$confirmation) {
+            if (!$msg) {
+                $msg = $this->_get_default_error_message_for(__METHOD__);
+                $msg = sprintf($msg, $this->humanize_string($property));
+            }
+            $this->add_error($msg, $property);
+        }
+    }
+
+
+    /**
+     * Validates the uniqueness of a property
+     * @param string $property
+     * @param array $scope
+     * @param string $msg
+     */
+    function validates_uniqueness_of($property, $scope=array(), $msg=FALSE)
+    {
+		// Get any entities that have the same property
+        $mapper = $this->object->get_mapper();
+		$key = $mapper->get_primary_key_column();
+		$mapper->select($key);
+		$mapper->limit(1);
+		$mapper->where_and(array("{$property} = %s", $this->object->$property));
+		if (!$this->object->is_new()) {
+			$mapper->where_and(array("{$key} != %s", $this->object->id()));
+		}
+		foreach ($scope as $another_property) {
+			$mapper->where_and(array("{$another_property} = %s", $another_property));
+		}
+		$result = $mapper->run_query();
+
+		// If there's a result, it means that the entity is NOT unique
+		if ($result) {
+
+			// Get default msg
+            if (!$msg) {
+                $msg = $this->_get_default_error_message_for(__METHOD__);
+                $msg = sprintf($msg, $this->humanize_string($property));
+            }
+
+            // Add error
+            $this->add_error($msg, $property);
+		}
+    }
+
+
+    /**
+     * Validates the presence of a value for a particular field
+     * @param string $property
+     * @param string $msg
+     */
+    function validates_presence_of($properties, $with=array(), $msg=FALSE)
+    {
+        $missing = array();
+
+        if (!is_array($properties)) $properties = array($properties);
+
+        // Iterate through each property that we're to check, and ensure
+        // a value is present
+        foreach ($properties as $property) {
+            $invalid = TRUE;
+
+            // Is a value present?
+            if (!$this->is_empty($this->object->$property)) {
+                $invalid = FALSE;
+
+                // This property must be present with at least another property
+                if ($with) {
+                    if (!is_array($with)) $with = array($with);
+                    foreach ($with as $other) {
+                        if ($this->is_empty($this->object->$other)) {
+                            $invalid = TRUE;
+                            $missing[] = $other;
+                        }
+                    }
+                }
+            }
+
+            // Add error
+            if ($invalid) {
+                if (!$msg) {
+
+                    // If missing isn't empty, it means that we're to use the
+                    // "with" error message
+                    if ($missing) {
+                        $missing = implode(', ', $this->humanize_string($missing));
+                        $msg = sprintf(
+                            $this->_get_default_error_message_for('validates_presence_with'),
+                            $property,
+                            $missing
+                        );
+                    }
+
+                    // Has no 'with' arguments. Use the default error msg
+                    else {
+                        $msg = sprintf(
+                            $this->_get_default_error_message_for(__METHOD__),
+                            $property
+                        );
+                    }
+                }
+
+                $this->add_error($msg, $property);
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/validation/module.validation.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/validation/module.validation.php
new file mode 100644
index 0000000000000000000000000000000000000000..0eb133432fbe0a66a2bf234ea0a91f04fbd818af
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/validation/module.validation.php
@@ -0,0 +1,32 @@
+<?php
+
+/***
+{
+	Module: photocrati-validation
+}
+***/
+
+class M_Validation extends C_Base_Module
+{
+	function define()
+	{
+		parent::define(
+			'photocrati-validation',
+			'Validation',
+			'Provides validation support for objects',
+			'0.1',
+			'http://www.nextgen-gallery.com',
+			'Photocrati Media',
+			'http://www.photocrati.com'
+		);
+	}
+
+    function get_type_list()
+    {
+        return array(
+            'Mixin_Validation' => 'mixin.validation.php'
+        );
+    }
+}
+
+new M_Validation();
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/class.widget.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/class.widget.php
new file mode 100644
index 0000000000000000000000000000000000000000..819d9f1541f875d5dcc4e69978aae21f5f2f31c2
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/class.widget.php
@@ -0,0 +1,89 @@
+<?php
+
+class C_Widget extends C_MVC_Controller
+{
+    public static $_instances = array();
+
+    function define($context = FALSE)
+    {
+        parent::define($context);
+        $this->add_mixin('Mixin_Widget');
+        $this->implement('I_Widget');
+    }
+
+    public static function get_instance($context = FALSE)
+    {
+        if (!isset(self::$_instances[$context]))
+        {
+            self::$_instances[$context] = new C_Widget($context);
+        }
+        return self::$_instances[$context];
+    }
+}
+
+class Mixin_Widget extends Mixin
+{
+    /**
+     * Function for templates without widget support
+     *
+     * @return echo the widget content
+     */
+    function echo_widget_random($number, $width = '75', $height = '50', $exclude = 'all', $list = '', $show = 'thumbnail')
+    {
+        wp_enqueue_style('nextgen_widgets_style', $this->get_static_url('photocrati-widget#widgets.css'));
+        wp_enqueue_style('nextgen_basic_thumbnails_style', $this->get_static_url('nextgen_basic_thumbnails#nextgen_basic_thumbnails.css'));
+        $options = array(
+            'title'    => FALSE,
+            'items'    => $number,
+            'show'     => $show ,
+            'type'     => 'random',
+            'width'    => $width,
+            'height'   => $height,
+            'exclude'  => $exclude,
+            'list'     => $list,
+            'webslice' => FALSE
+        );
+        $widget = new C_Widget_Gallery();
+        $widget->widget($args = array('widget_id' => 'sidebar_1'), $options);
+    }
+
+    /**
+     * Function for templates without widget support
+     *
+     * @return echo the widget content
+     */
+    function echo_widget_recent($number, $width = '75', $height = '50', $exclude = 'all', $list = '', $show = 'thumbnail')
+    {
+        wp_enqueue_style('nextgen_widgets_style', $this->get_static_url('photocrati-widget#widgets.css'));
+        wp_enqueue_style('nextgen_basic_thumbnails_style', $this->get_static_url('nextgen_basic_thumbnails#nextgen_basic_thumbnails.css'));
+        $options = array(
+            'title'    => FALSE,
+            'items'    => $number,
+            'show'     => $show ,
+            'type'     => 'recent',
+            'width'    => $width,
+            'height'   => $height,
+            'exclude'  => $exclude,
+            'list'     => $list,
+            'webslice' => FALSE
+        );
+        $widget = new C_Widget_Gallery();
+        $widget->widget($args = array('widget_id' => 'sidebar_1'), $options);
+    }
+
+    /**
+     * Function for templates without widget support
+     *
+     * @param integer $galleryID
+     * @param string $width
+     * @param string $height
+     * @return echo the widget content
+     */
+    function echo_widget_slideshow($galleryID, $width = '', $height = '')
+    {
+        wp_enqueue_style('nextgen_widgets_style', $this->get_static_url('widget#widgets.css'));
+        wp_enqueue_style('nextgen_basic_slideshow_style', $this->get_static_url('nextgen_basic_slideshow#nextgen_basic_slideshow.css'));
+        $widget = new C_Widget_Slideshow();
+        $widget->render_slideshow($galleryID, $width, $height);
+    }
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/class.widget_gallery.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/class.widget_gallery.php
new file mode 100644
index 0000000000000000000000000000000000000000..bd82d4894f1695f72bd2080d2d22570ab1d7d766
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/class.widget_gallery.php
@@ -0,0 +1,183 @@
+<?php
+
+class C_Widget_Gallery extends WP_Widget
+{
+    function __construct()
+    {
+        $widget_ops = array('classname' => 'ngg_images', 'description' => __('Add recent or random images from the galleries', 'nggallery'));
+        $this->WP_Widget('ngg-images', __('NextGEN Widget', 'nggallery'), $widget_ops);
+    }
+
+    function form($instance)
+    {
+        // used for rendering utilities
+        $parent = C_Component_Registry::get_instance()->get_utility('I_Widget');
+
+        // defaults
+        $instance = wp_parse_args(
+            (array)$instance,
+            array(
+                'exclude'  => 'all',
+                'height'   => '75',
+                'items'    => '4',
+                'list'     =>  '',
+                'show'     => 'thumbnail',
+                'title'    => 'Gallery',
+                'type'     => 'random',
+                'webslice' => TRUE,
+                'width'    => '100'
+            )
+        );
+
+        $parent->render_partial(
+            'photocrati-widget#form_gallery',
+            array(
+                'self'     => $this,
+                'instance' => $instance,
+                'title'    => esc_attr($instance['title']),
+                'items'    => intval($instance['items']),
+                'height'   => esc_attr($instance['height']),
+                'width'    => esc_attr($instance['width'])
+            )
+        );
+    }
+
+    function update($new_instance, $old_instance)
+    {
+        $instance = $old_instance;
+
+        // do not allow 0 or less
+        if ((int)$new_instance['items'] <= 0)
+            $new_instance['items'] = 4;
+
+        // for clarity: empty the list if we're showing every gallery anyway
+        if ($new_instance['exclude'] == 'all')
+            $new_instance['list'] = '';
+
+        // remove gallery ids that do not exist
+        if (in_array($new_instance['exclude'], array('denied', 'allow')))
+        {
+            // do search
+            $mapper = C_Component_Registry::get_instance()->get_utility('I_Gallery_Mapper');
+            $ids = explode(',', $new_instance['list']);
+            foreach ($ids as $ndx => $id) {
+                if (!$mapper->find($id))
+                    unset($ids[$ndx]);
+            }
+            $new_instance['list'] = implode(',', $ids);
+        }
+
+        // reset to show all galleries IF there are no valid galleries in the list
+        if ($new_instance['exclude'] !== 'all' && empty($new_instance['list']))
+            $new_instance['exclude'] = 'all';
+
+        $instance['title'] = strip_tags($new_instance['title']);
+        $instance['items'] = (int)$new_instance['items'];
+        $instance['type'] = $new_instance['type'];
+        $instance['show'] = $new_instance['show'];
+        $instance['width'] = (int)$new_instance['width'];
+        $instance['height'] = (int)$new_instance['height'];
+        $instance['exclude'] = $new_instance['exclude'];
+        $instance['list'] = $new_instance['list'];
+        $instance['webslice'] = (bool)$new_instance['webslice'];
+        return $instance;
+    }
+
+    function widget($args, $instance)
+    {
+        // these are handled by extract() but I want to silence my IDE warnings that these vars don't exist
+        $before_widget = NULL;
+        $before_title = NULL;
+        $after_widget = NULL;
+        $after_title = NULL;
+        $widget_id = NULL;
+
+        global $wpdb;
+
+        extract($args);
+        $title = apply_filters('widget_title', empty($instance['title']) ? '&nbsp;' : $instance['title'], $instance, $this->id_base);
+
+        $renderer  = C_Component_Registry::get_instance()->get_utility('I_Displayed_Gallery_Renderer');
+        $factory   = C_Component_Registry::get_instance()->get_utility('I_Component_Factory');
+        $mapper    = C_Component_Registry::get_instance()->get_utility('I_Image_Mapper');
+        $view = $factory->create('mvc_view', '');
+
+        // To prevent huge db scans and/or the loading of every image available: we first retrieve X image
+        // ids and then create a gallery using the results for the image_ids parameter
+        $image_ids = array();
+
+        $sql = "SELECT `pid` FROM `{$wpdb->nggpictures}` WHERE `exclude` = 0";
+
+        // possibly filter images not from certain galleries
+        if ($instance['exclude'] == 'allow')
+            $sql .= sprintf(" AND `galleryid` IN (%s)", $instance['list']);
+
+        // possibly filter images from certain galleries
+        if ($instance['exclude'] == 'denied')
+            $sql .= sprintf(" AND `galleryid` NOT IN (%s)", $instance['list']);
+
+        if ($instance['type'] == 'random')
+            $sql .= ' ORDER BY RAND()';
+        else if ($instance['type'] == 'recent')
+            $sql .= ' ORDER BY `imagedate` DESC';
+
+        $sql .= " LIMIT {$instance['items']}";
+
+        foreach ($wpdb->get_results($sql, ARRAY_N) as $res) {
+            $image_ids[] = reset($res);
+        }
+        $image_ids = implode(',', $image_ids);
+
+        if ($instance['type'] == 'random')
+        {
+            $order_by = 'rand()';
+            $order_direction = 'DESC';
+        }
+        else if ($instance['type'] == 'recent')
+        {
+            $order_by = $mapper->get_primary_key_column();
+            $order_direction = 'DESC';
+        }
+
+        // IE8 webslice support if needed
+        if ($instance['webslice'])
+        {
+            $before_widget .= '<div class="hslice" id="ngg-webslice">';
+            $before_title  = str_replace('class="' , 'class="entry-title ', $before_title);
+            $after_widget  = '</div>' . $after_widget;
+        }
+
+        // 'Original' was the value used in 1.9x; so alias original => 'full'
+        if ($instance['show'] == 'original')
+            $show = 'full';
+        else
+            $show = 'thumb';
+
+        echo $renderer->display_images(array(
+            'source' => 'galleries',
+            'order_by' => $order_by,
+            'order_direction' => $order_direction,
+            'image_ids' => $image_ids,
+            'display_type' => NEXTGEN_GALLERY_BASIC_THUMBNAILS,
+            'images_per_page' => $instance['items'],
+            'maximum_entity_count' => $instance['items'],
+            'template' => $view->get_template_abspath('photocrati-widget#display_gallery'),
+            'image_type' => $show,
+            'show_all_in_lightbox' => FALSE,
+            'show_slideshow_link' => FALSE,
+            'disable_pagination' => TRUE,
+            'image_width' => $instance['width'],
+            'image_height' => $instance['height'],
+            'ngg_triggers_display' => 'never',
+            'widget_setting_title'         => $title,
+            'widget_setting_before_widget' => $before_widget,
+            'widget_setting_before_title'  => $before_title,
+            'widget_setting_after_widget'  => $after_widget,
+            'widget_setting_after_title'   => $after_title,
+            'widget_setting_width'         => $instance['width'],
+            'widget_setting_height'        => $instance['height'],
+            'widget_setting_show_setting'  => $instance['show'],
+            'widget_setting_widget_id'     => $widget_id
+        ));
+    }
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/class.widget_mediarss.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/class.widget_mediarss.php
new file mode 100644
index 0000000000000000000000000000000000000000..13c0fc9df0675a342422cf8ef6e28b17a4ebf890
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/class.widget_mediarss.php
@@ -0,0 +1,107 @@
+<?php
+
+class C_Widget_MediaRSS extends WP_Widget
+{
+    var $options;
+
+    function __construct()
+    {
+        $widget_ops = array('classname' => 'ngg_mrssw', 'description' => __('Widget that displays Media RSS links for NextGEN Gallery.', 'nggallery'));
+        $this->WP_Widget('ngg-mrssw', __('NextGEN Media RSS', 'nggallery'), $widget_ops);
+    }
+
+    function form($instance)
+    {
+        // used for rendering utilities
+        $parent = C_Component_Registry::get_instance()->get_utility('I_Widget');
+
+        // defaults
+        $instance = wp_parse_args(
+            (array)$instance,
+            array(
+                'mrss_text' => __('Media RSS', 'nggallery'),
+                'mrss_title' => __('Link to the main image feed', 'nggallery'),
+                'show_global_mrss' => TRUE,
+                'show_icon' => TRUE,
+                'title' => 'Media RSS'
+            )
+        );
+
+        $parent->render_partial(
+            'photocrati-widget#form_mediarss',
+            array(
+                'self'       => $this,
+                'instance'   => $instance,
+                'title'      => esc_attr($instance['title']),
+                'mrss_text'  => esc_attr($instance['mrss_text']),
+                'mrss_title' => esc_attr($instance['mrss_title'])
+            )
+        );
+    }
+
+    function update($new_instance, $old_instance)
+    {
+        $instance = $old_instance;
+        $instance['title'] = strip_tags($new_instance['title']);
+        $instance['show_global_mrss'] = $new_instance['show_global_mrss'];
+        $instance['show_icon'] = $new_instance['show_icon'];
+        $instance['mrss_text'] = $new_instance['mrss_text'];
+        $instance['mrss_title'] = $new_instance['mrss_title'];
+        return $instance;
+    }
+
+    function widget($args, $instance)
+    {
+        // these are handled by extract() but I want to silence my IDE warnings that these vars don't exist
+        $before_widget = NULL;
+        $before_title = NULL;
+        $after_widget = NULL;
+        $after_title = NULL;
+        $widget_id = NULL;
+
+        extract($args);
+
+        $settings = C_NextGen_Settings::get_instance();
+        $parent = C_Component_Registry::get_instance()->get_utility('I_Widget');
+
+        $title = apply_filters('widget_title', empty($instance['title']) ? '&nbsp;' : $instance['title'], $instance, $this->id_base);
+
+        $parent->render_partial(
+            'photocrati-widget#display_mediarss',
+            array(
+                'self'       => $this,
+                'instance'   => $instance,
+                'title'      => $title,
+                'settings'   => $settings,
+                'before_widget' => $before_widget,
+                'before_title'  => $before_title,
+                'after_widget'  => $after_widget,
+                'after_title'   => $after_title,
+                'widget_id'     => $widget_id
+            )
+        );
+    }
+
+    function get_mrss_link($mrss_url, $show_icon = TRUE, $title, $text, $use_piclens)
+    {
+        $out  = '';
+
+        if ($show_icon)
+        {
+            $icon_url = NGGALLERY_URLPATH . 'images/mrss-icon.gif';
+            $out .= "<a href='{$mrss_url}' title='{$title}' class='ngg-media-rss-link'" . ($use_piclens ? ' onclick="PicLensLite.start({feedUrl:\'' . $mrss_url . '\'}); return false;"' : "") . " >";
+            $out .= "<img src='{$icon_url}' alt='MediaRSS Icon' title='" . (!$use_piclens ? $title : __('[View with PicLens]','nggallery')). "' class='ngg-media-rss-icon' />";
+            $out .=  "</a> ";
+        }
+
+        if ($text != '')
+        {
+            $out .= "<a href='{$mrss_url}' title='{$title}' class='ngg-media-rss-link'>";
+            $out .= $text;
+            $out .=  "</a>";
+        }
+
+        return $out;
+    }
+
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/class.widget_slideshow.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/class.widget_slideshow.php
new file mode 100644
index 0000000000000000000000000000000000000000..ac41cbd7d267b3e8ba3395da1cdcb7f05fb4f8b3
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/class.widget_slideshow.php
@@ -0,0 +1,119 @@
+<?php
+
+class C_Widget_Slideshow extends WP_Widget
+{
+    function __construct()
+    {
+        $widget_ops = array('classname' => 'widget_slideshow', 'description' => __('Show a NextGEN Gallery Slideshow', 'nggallery'));
+        $this->WP_Widget('slideshow', __('NextGEN Slideshow', 'nggallery'), $widget_ops);
+    }
+
+    function form($instance)
+    {
+        global $wpdb;
+
+        // used for rendering utilities
+        $parent = C_Component_Registry::get_instance()->get_utility('I_Widget');
+
+        // defaults
+        $instance = wp_parse_args(
+            (array)$instance,
+            array(
+                'galleryid' => '0',
+                'height' => '120',
+                'title' => 'Slideshow',
+                'width' => '160'
+            )
+        );
+
+        $parent->render_partial(
+            'photocrati-widget#form_slideshow',
+            array(
+                'self'     => $this,
+                'instance' => $instance,
+                'title'    => esc_attr($instance['title']),
+                'height'   => esc_attr($instance['height']),
+                'width'    => esc_attr($instance['width']),
+                'tables'   => $wpdb->get_results("SELECT * FROM {$wpdb->nggallery} ORDER BY 'name' ASC")
+            )
+        );
+    }
+
+    function update($new_instance, $old_instance)
+    {
+        $nh = $new_instance['height'];
+        $nw = $new_instance['width'];
+        if (empty($nh) || (int)$nh === 0)
+            $new_instance['height'] = 120;
+        if (empty($nw) || (int)$nw === 0)
+            $new_instance['width'] = 160;
+
+        $instance = $old_instance;
+        $instance['title'] = strip_tags($new_instance['title']);
+        $instance['galleryid'] = (int) $new_instance['galleryid'];
+        $instance['height'] = (int) $new_instance['height'];
+        $instance['width'] = (int) $new_instance['width'];
+        return $instance;
+    }
+
+    function widget($args, $instance)
+    {
+        // these are handled by extract() but I want to silence my IDE warnings that these vars don't exist
+        $before_widget = NULL;
+        $before_title = NULL;
+        $after_widget = NULL;
+        $after_title = NULL;
+        $widget_id = NULL;
+
+        extract($args);
+
+        $parent = C_Component_Registry::get_instance()->get_utility('I_Widget');
+
+        $title = apply_filters('widget_title', empty($instance['title']) ? __('Slideshow', 'nggallery') : $instance['title'], $instance, $this->id_base);
+
+        $out = $this->render_slideshow($instance['galleryid'], $instance['width'], $instance['height']);
+
+        $parent->render_partial(
+            'photocrati-widget#display_slideshow',
+            array(
+                'self'       => $this,
+                'instance'   => $instance,
+                'title'      => $title,
+                'out'        => $out,
+                'before_widget' => $before_widget,
+                'before_title'  => $before_title,
+                'after_widget'  => $after_widget,
+                'after_title'   => $after_title,
+                'widget_id'     => $widget_id
+            )
+        );
+    }
+
+    function render_slideshow($galleryID, $irWidth = '', $irHeight = '')
+    {
+        $registry = C_Component_Registry::get_instance();
+        $renderer = $registry->get_utility('I_Displayed_Gallery_Renderer');
+
+        $params = array(
+            'container_ids'  => $galleryID,
+            'display_type'   => 'photocrati-nextgen_basic_slideshow',
+            'gallery_width'  => $irWidth,
+            'gallery_height' => $irHeight,
+            'source'         => 'galleries',
+            'entity_types'   => array('image'),
+            'show_thumbnail_link' => FALSE,
+            'ngg_triggers_display' => 'never'
+        );
+
+        if (0 === $galleryID)
+        {
+            $params['source'] = 'random_images';
+            unset($params['container_ids']);
+        }
+
+        $retval = $renderer->display_images($params, NULL);
+        $retval = apply_filters('ngg_show_slideshow_widget_content', $retval, $galleryID, $irWidth, $irHeight);
+        return $retval;
+    }
+
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/interface.widget.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/interface.widget.php
new file mode 100644
index 0000000000000000000000000000000000000000..b563dfe4d66b16f094caa1ddfd440bb3391228c2
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/interface.widget.php
@@ -0,0 +1,5 @@
+<?php
+
+interface I_Widget
+{
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/module.widget.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/module.widget.php
new file mode 100644
index 0000000000000000000000000000000000000000..7b2c4165dcca305378de7b7f35755179b1b307eb
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/module.widget.php
@@ -0,0 +1,56 @@
+<?php
+/***
+{
+        Module: photocrati-widget
+}
+***/
+class M_Widget extends C_Base_Module
+{
+    /**
+     * Defines the module name & version
+     */
+    function define()
+    {
+        parent::define(
+            'photocrati-widget',
+            'Widget',
+            'Handles clearing of NextGen Widgets',
+            '0.2',
+            'http://www.nextgen-gallery.com',
+            'Photocrati Media',
+            'http://www.photocrati.com'
+        );
+    }
+
+    /**
+     * Register utilities
+     */
+    function _register_utilities()
+    {
+        $this->get_registry()->add_utility('I_Widget', 'C_Widget');
+    }
+
+    /**
+     * Register hooks
+     */
+    function _register_hooks()
+    {
+         add_action('widgets_init', create_function('', 'return register_widget("C_Widget_Gallery");'));
+         add_action('widgets_init', create_function('', 'return register_widget("C_Widget_MediaRSS");'));
+         add_action('widgets_init', create_function('', 'return register_widget("C_Widget_Slideshow");'));
+    }
+
+    function get_type_list()
+    {
+        return array(
+            'C_Widget' => 'class.widget.php',
+            'C_Widget_Gallery' => 'class.widget_gallery.php',
+            'C_Widget_Mediarss' => 'class.widget_mediarss.php',
+            'C_Widget_Slideshow' => 'class.widget_slideshow.php',
+            'I_Widget' => 'interface.widget.php'
+        );
+    }
+
+}
+
+new M_Widget();
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/static/widgets.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/static/widgets.css
new file mode 100644
index 0000000000000000000000000000000000000000..d203863adc266b6e88e5f9a93045c1f3dc5aeb61
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/static/widgets.css
@@ -0,0 +1,15 @@
+/* ----------- Sidebar widget -------------*/
+
+.ngg-widget,
+.ngg-widget-slideshow {
+    overflow: hidden;
+    margin: 0pt;
+    padding: 5px 0px 0px 0pt;
+    text-align: left;
+}
+
+.ngg-widget img {
+    border: 2px solid #A9A9A9;
+    margin: 0pt 2px 2px 0px;
+    padding: 1px;
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/templates/display_gallery.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/templates/display_gallery.php
new file mode 100644
index 0000000000000000000000000000000000000000..4374dcdf4cfc5c80c40d152ce322756c20d04041
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/templates/display_gallery.php
@@ -0,0 +1,29 @@
+<?php
+$controller = C_Component_Registry::get_instance()->get_utility('I_Display_Type_Controller');
+$storage    = C_Component_Registry::get_instance()->get_utility('I_Gallery_Storage');
+
+$effect_code = $controller->get_effect_code($gallery->displayed_gallery);
+$settings    = $gallery->displayed_gallery->get_entity()->display_settings;
+
+echo $settings['widget_setting_before_widget']
+     . $settings['widget_setting_before_title']
+     . $settings['widget_setting_title']
+     . $settings['widget_setting_after_title'];
+?>
+<?php // keep the following a/img on the same line ?>
+<div class="ngg-widget entry-content">
+    <?php foreach ($images as $image) { ?>
+        <a href="<?php echo esc_attr($storage->get_image_url($image))?>"
+           title="<?php echo esc_attr($image->description)?>"
+           data-image-id='<?php echo esc_attr($image->pid); ?>'
+           <?php echo $effect_code ?>
+           ><img title="<?php echo esc_attr($image->alttext)?>"
+                 alt="<?php echo esc_attr($image->alttext)?>"
+                 src="<?php echo esc_attr($storage->get_image_url($image, $settings['image_type'])); ?>"
+                 width="<?php echo esc_attr($settings['image_width']); ?>"
+                 height="<?php echo esc_attr($settings['image_height']); ?>"
+            /></a>
+    <?php } ?>
+</div>
+
+<?php echo $settings['widget_setting_after_widget']; ?>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/templates/display_mediarss.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/templates/display_mediarss.php
new file mode 100644
index 0000000000000000000000000000000000000000..31dbdac0baa5636d4e2b0eb84f94df8efcee3d37
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/templates/display_mediarss.php
@@ -0,0 +1,13 @@
+<?php echo $before_widget . $before_title . $title . $after_title; ?>
+<ul class='ngg-media-rss-widget'>
+    <?php if ($instance['show_global_mrss']) { ?>
+        <li>
+            <?php echo $self->get_mrss_link(nggMediaRss::get_mrss_url(),
+                                            $instance['show_icon'],
+                                            strip_tags(stripslashes($instance['mrss_title'])),
+                                            stripslashes($instance['mrss_text']),
+                                            $settings->usePicLens); ?>
+        </li>
+    <?php } ?>
+</ul>
+<?php echo $after_widget; ?>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/templates/display_slideshow.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/templates/display_slideshow.php
new file mode 100644
index 0000000000000000000000000000000000000000..42774d9c9c4d15e1ece314458c1de4aad707ec76
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/templates/display_slideshow.php
@@ -0,0 +1,8 @@
+<?php
+echo $before_widget;
+if ($title)
+    echo $before_title . $title . $after_title; ?>
+<div class="ngg_slideshow widget">
+    <?php echo $out; ?>
+</div>
+<?php echo $after_widget; ?>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/templates/form_gallery.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/templates/form_gallery.php
new file mode 100644
index 0000000000000000000000000000000000000000..64e605e892f471ca1ec8c2958d8df6d24638788a
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/templates/form_gallery.php
@@ -0,0 +1,113 @@
+<!-- title -->
+<p>
+    <label for='<?php echo $self->get_field_id('title'); ?>'>
+        <?php _e('Title :', 'nggallery'); ?>
+        <input id='<?php echo $self->get_field_id('title'); ?>'
+               name='<?php echo $self->get_field_name('title');?>'
+               type='text'
+               class='widefat'
+               value='<?php echo $title; ?>'/>
+    </label>
+</p>
+
+<!-- count & source -->
+<p>
+    <?php _e('Show :', 'nggallery'); ?><br/>
+    <label for='<?php echo $self->get_field_id('items'); ?>'>
+        <input style='width: 50px;'
+               id='<?php echo $self->get_field_id('items'); ?>'
+               name='<?php echo $self->get_field_name('items');?>'
+               type='text'
+               value='<?php echo $items; ?>'/>
+    </label>
+    <select id='<?php echo $self->get_field_id('show'); ?>'
+            name='<?php echo $self->get_field_name('show'); ?>'>
+        <option <?php selected('thumbnail', $instance['show']); ?> value='thumbnail'>
+            <?php _e('Thumbnails', 'nggallery'); ?>
+        </option>
+        <option <?php selected('original', $instance['show']); ?> value='original'>
+            <?php _e('Original images', 'nggallery'); ?>
+        </option>
+    </select>
+</p>
+
+<!-- random or recent -->
+<p>
+    <label for='<?php echo $self->get_field_id('type'); ?>_random'>
+        <input id='<?php echo $self->get_field_id('type'); ?>_random'
+               name='<?php echo $self->get_field_name('type'); ?>'
+               type='radio'
+               value='random'
+               <?php checked('random', $instance['type']); ?>/>
+        <?php _e('random', 'nggallery'); ?>
+    </label>
+    <label for='<?php echo $self->get_field_id('type'); ?>_recent'>
+        <input id='<?php echo $self->get_field_id('type'); ?>_recent'
+               name='<?php echo $self->get_field_name('type'); ?>'
+               type='radio'
+               value='recent'
+               <?php checked('recent', $instance['type']); ?>/>
+        <?php _e('recent added ', 'nggallery'); ?>
+    </label>
+</p>
+
+<!-- IE8 web slices -->
+<p>
+    <label for='<?php echo $self->get_field_id('webslice'); ?>'>
+        <input id='<?php echo $self->get_field_id('webslice'); ?>'
+               name='<?php echo $self->get_field_name('webslice'); ?>'
+               type='checkbox'
+               value='1'
+               <?php checked(TRUE, $instance['webslice']); ?>/>
+        <?php _e('Enable IE8 Web Slices', 'nggallery'); ?>
+    </label>
+</p>
+
+<!-- dimensions -->
+<p>
+    <?php _e('Width x Height :', 'nggallery'); ?><br/>
+    <?php
+    $thumbnails_template_height_value = $height;
+    $thumbnails_template_width_value = $width;
+    $thumbnails_template_height_id = $self->get_field_id('height');
+    $thumbnails_template_width_id = $self->get_field_id('width');
+    $thumbnails_template_height_name = $self->get_field_name('height');
+    $thumbnails_template_width_name = $self->get_field_name('width');
+    include(path_join(NGGALLERY_ABSPATH, implode(DIRECTORY_SEPARATOR, array('admin', 'thumbnails-template.php'))));
+    ?>
+</p>
+
+<!-- which galleries -->
+<p>
+    <label for='<?php echo $self->get_field_id('exclude'); ?>'>
+        <?php _e('Select :', 'nggallery'); ?>
+        <select id='<?php echo $self->get_field_id('exclude'); ?>'
+                name='<?php echo $self->get_field_name('exclude'); ?>'
+                class='widefat'>
+            <option <?php selected('all', $instance['exclude']); ?>  value='all'>
+                <?php _e('All galleries', 'nggallery'); ?>
+            </option>
+            <option <?php selected('denied', $instance['exclude']); ?> value='denied'>
+                <?php _e('Only which are not listed', 'nggallery'); ?>
+            </option>
+            <option <?php selected('allow', $instance['exclude']); ?>  value='allow'>
+                <?php _e('Only which are listed', 'nggallery'); ?>
+            </option>
+        </select>
+    </label>
+</p>
+
+<!-- gallery ids -->
+<p>
+    <label for='<?php echo $self->get_field_id('list'); ?>'>
+        <?php _e('Gallery ID :', 'nggallery'); ?>
+        <input id='<?php echo $self->get_field_id('list'); ?>'
+               name='<?php echo $self->get_field_name('list'); ?>'
+               type='text' class='widefat'
+               value='<?php echo $instance['list']; ?>'/>
+        <br/>
+        <small>
+            <?php _e('Gallery IDs, separated by commas.', 'nggallery'); ?>
+        </small>
+    </label>
+</p>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/templates/form_mediarss.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/templates/form_mediarss.php
new file mode 100644
index 0000000000000000000000000000000000000000..8636f6bfb035176718413a4d1f4f73a0cd1f8638
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/templates/form_mediarss.php
@@ -0,0 +1,57 @@
+<p>
+    <label for='<?php echo $self->get_field_id('title'); ?>'>
+        <?php _e('Title :', 'nggallery'); ?>
+        <br/>
+        <input class='widefat'
+               id='<?php echo $self->get_field_id('title'); ?>'
+               name='<?php echo $self->get_field_name('title'); ?>'
+               type='text'
+               value='<?php echo $title; ?>'/>
+    </label>
+</p>
+
+<p>
+    <label for='<?php echo $self->get_field_id('show_icon'); ?>'>
+        <input id='<?php echo $self->get_field_id('show_icon'); ?>'
+               name='<?php echo $self->get_field_name('show_icon'); ?>'
+               type='checkbox'
+               value='1'
+               <?php checked(TRUE, $instance['show_icon']); ?>/>
+        <?php _e('Show Media RSS icon', 'nggallery'); ?>
+    </label>
+</p>
+
+<p>
+    <label for='<?php echo $self->get_field_id('show_global_mrss'); ?>'>
+        <input id='<?php echo $self->get_field_id('show_global_mrss'); ?>'
+               name='<?php echo $self->get_field_name('show_global_mrss'); ?>'
+               type='checkbox'
+               value='1'
+               <?php checked(TRUE, $instance['show_global_mrss']); ?>/>
+        <?php _e('Show the Media RSS link', 'nggallery'); ?>
+    </label>
+</p>
+
+<p>
+    <label for='<?php echo $self->get_field_id('mrss_text'); ?>'>
+        <?php _e('Text for Media RSS link:', 'nggallery'); ?>
+        <br/>
+        <input class='widefat'
+               id='<?php echo $self->get_field_id('mrss_text'); ?>'
+               name='<?php echo $self->get_field_name('mrss_text'); ?>'
+               type='text'
+               value='<?php echo $mrss_text; ?>'/>
+    </label>
+</p>
+
+<p>
+    <label for='<?php echo $self->get_field_id('mrss_title'); ?>'>
+        <?php _e('Tooltip text for Media RSS link:', 'nggallery'); ?>
+        <br/>
+        <input class='widefat'
+               id='<?php echo $self->get_field_id('mrss_title'); ?>'
+               name='<?php echo $self->get_field_name('mrss_title'); ?>'
+               type='text'
+               value='<?php echo $mrss_title; ?>'/>
+    </label>
+</p>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/templates/form_slideshow.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/templates/form_slideshow.php
new file mode 100644
index 0000000000000000000000000000000000000000..f03dac65eeb7cd886ec32658580ccb3ab1db159c
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/templates/form_slideshow.php
@@ -0,0 +1,60 @@
+<p>
+    <label for='<?php echo $self->get_field_id('title'); ?>'>
+        <?php _e('Title:'); ?>
+    </label>
+
+    <input class='widefat'
+           id='<?php echo $self->get_field_id('title'); ?>'
+           name='<?php echo $self->get_field_name('title'); ?>'
+           type='text'
+           value='<?php echo $title; ?>'/>
+</p>
+
+<p>
+    <label for='<?php echo $self->get_field_id('galleryid'); ?>'>
+        <?php _e('Select Gallery:', 'nggallery'); ?>
+    </label>
+
+    <select size='1'
+            name='<?php echo $self->get_field_name('galleryid'); ?>'
+            id='<?php echo $self->get_field_id('galleryid'); ?>'
+            class='widefat'>
+        <option value='0' <?php if (0 == $instance['galleryid']) echo 'selected="selected" '; ?>>
+            <?php _e('All images', 'nggallery'); ?>
+        </option>
+        <?php
+        if ($tables)
+        {
+            foreach($tables as $table) {
+                echo '<option value="' . $table->gid . '" ';
+                if ($table->gid == $instance['galleryid'])
+                    echo 'selected="selected" ';
+                echo '>' . $table->name . '</option>';
+            }
+        } ?>
+    </select>
+</p>
+
+<p>
+    <label for='<?php echo $self->get_field_id('height'); ?>'>
+        <?php _e('Height:', 'nggallery'); ?>
+    </label>
+
+    <input id='<?php echo $self->get_field_id('height'); ?>'
+           name='<?php echo $self->get_field_name('height'); ?>'
+           type='text'
+           style='padding: 3px; width: 45px;'
+           value='<?php echo $height; ?>'/>
+</p>
+
+<p>
+    <label for='<?php echo $self->get_field_id('width'); ?>'>
+        <?php _e('Width:', 'nggallery'); ?>
+    </label>
+
+    <input id='<?php echo $self->get_field_id('width'); ?>'
+           name='<?php echo $self->get_field_name('width'); ?>'
+           type='text'
+           style='padding: 3px; width: 45px;'
+           value='<?php echo $width; ?>'/>
+</p>
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/wordpress_routing/adapter.wordpress_router.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/wordpress_routing/adapter.wordpress_router.php
new file mode 100644
index 0000000000000000000000000000000000000000..76b181614ee0b3e7a8e3347b934eaebc3b9ffd3b
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/wordpress_routing/adapter.wordpress_router.php
@@ -0,0 +1,95 @@
+<?php
+
+class A_WordPress_Router extends Mixin
+{
+	var $_site_url = FALSE;
+    var $_home_url = FALSE;
+
+	function initialize()
+	{
+		// Set context to path if subdirectory install
+		$parts = parse_url($this->object->get_base_url());
+		if (isset($parts['path'])) $this->object->context = $parts['path'];
+
+
+		$this->object->add_post_hook(
+			'get_url',
+			'Construct url for WordPress, considering permalinks',
+			get_class(),
+			'_modify_url_for_wordpress'
+		);
+	}
+
+	function _modify_url_for_wordpress()
+	{
+		// Get the method to be returned
+		$retval = $this->object->get_method_property(
+			$this->method_called,
+			ExtensibleObject::METHOD_PROPERTY_RETURN_VALUE
+		);
+
+		// Determine whether the url is a directory or file on the filesystem
+		// If so, then we do NOT need /index.php as part of the url
+		$base_url = $this->object->get_base_url();
+		$filename = str_replace(
+			$base_url,
+			$this->get_registry()->get_utility('I_Fs')->get_document_root(),
+			$retval
+		);
+
+		if ($retval && @file_exists($filename) && $retval != $base_url) {
+
+			// Remove index.php from the url
+			$retval = $this->object->remove_url_segment('/index.php', $retval);
+
+			// Static urls don't end with a slash
+			$retval = untrailingslashit($retval);
+
+			// Set retval to the new url being returned
+			$this->object->set_method_property(
+				$this->method_called,
+				ExtensibleObject::METHOD_PROPERTY_RETURN_VALUE,
+				$retval
+			);
+		}
+
+		return $retval;
+	}
+
+
+	function get_base_url($site_url = FALSE)
+	{
+        $retval = NULL;
+        if ($site_url)
+        {
+            if (!$this->_site_url) {
+                $this->_site_url = site_url();
+				$pattern = get_option('permalink_structure');
+                if (!$pattern OR strpos($pattern, '/index.php') !== FALSE) {
+                    $this->_site_url = $this->object->join_paths(
+                        $this->_site_url, '/index.php'
+                    );
+                }
+            }
+            $retval = $this->_site_url;
+        }
+        else {
+            if (!$this->_home_url) {
+                $this->_home_url = home_url();
+				$pattern = get_option('permalink_structure');
+				if (!$pattern OR strpos($pattern, '/index.php') !== FALSE) {
+                    $this->_home_url = $this->object->join_paths(
+                        $this->_home_url, '/index.php'
+                    );
+                }
+            }
+            $retval = $this->_home_url;
+        }
+        
+    if ($this->object->is_https()) {
+    	$retval = preg_replace('/^http:\\/\\//i', 'https://', $retval, 1);
+    }
+
+		return $retval;
+	}
+}
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/wordpress_routing/adapter.wordpress_routing_app.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/wordpress_routing/adapter.wordpress_routing_app.php
new file mode 100644
index 0000000000000000000000000000000000000000..26f50c15c8b72a7959997315fccfaef2fa5c52b7
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/wordpress_routing/adapter.wordpress_routing_app.php
@@ -0,0 +1,62 @@
+<?php
+
+class A_WordPress_Routing_App extends Mixin
+{
+    function remove_parameter($key, $id=NULL, $url=FALSE)
+    {
+        $generated_url = $this->call_parent('remove_parameter', $key, $id, $url);
+
+        if ($this->is_postname_required_in_url()) {
+            $generated_url = $this->object->add_post_permalink_to_url($generated_url);
+        }
+
+        return $generated_url;
+    }
+
+    function is_postname_required_in_url()
+    {
+        global $wp_query;
+        return !$wp_query->is_single() && in_the_loop();
+    }
+
+    function parse_url($url)
+    {
+        $parts = parse_url($url);
+        if (!isset($parts['path'])) {
+            $base_parts = parse_url($this->object->get_router()->get_base_url());
+            if (!isset($base_parts['path'])) $base_parts['path'] = '/';
+            $parts['path'] = $base_parts['path'];
+        }
+        if (!isset($parts['query'])) $parts['query'] = '';
+
+        return $parts;
+    }
+
+
+    function add_post_permalink_to_url($generated_url)
+    {
+        $post_parts         = $this->parse_url(get_permalink());
+        $generated_parts    = $this->parse_url($generated_url);
+
+        // Combine querystrings
+        $generated_parts['query'] = $this->object->join_querystrings(
+            $post_parts['query'], $generated_parts['query']
+        );
+
+        // Combine paths
+        $generated_parts['path'] = $this->object->join_paths($post_parts['path'], $generated_parts['path']);
+
+        return $this->object->construct_url_from_parts($generated_parts);
+    }
+
+    function passthru()
+    {
+		$_SERVER['ORIG_REQUEST_URI'] = $this->object->get_router()->get_request_uri();
+        $_SERVER['REQUEST_URI'] = trailingslashit(
+            $this->object->strip_param_segments(
+                $this->object->get_router()->get_request_uri()
+            )
+        );
+    }
+
+}
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/wordpress_routing/module.wordpress_routing.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/wordpress_routing/module.wordpress_routing.php
new file mode 100644
index 0000000000000000000000000000000000000000..46361784da007206a4ce1004402f34b07bd2a847
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/wordpress_routing/module.wordpress_routing.php
@@ -0,0 +1,51 @@
+<?php
+
+/***
+ {
+	Module: photocrati-wordpress_routing,
+	Depends: { photocrati-router }
+ }
+ ***/
+class M_WordPress_Routing extends C_Base_Module
+{
+	function define()
+	{
+		parent::define(
+			'photocrati-wordpress_routing',
+			'WordPress Routing',
+			"Integrates the MVC module's routing implementation with WordPress",
+			'0.2',
+			'http://www.nextgen-gallery.com',
+			'Photocrati Media',
+			'http://www.photocrati.com'
+		);
+	}
+
+	function _register_adapters()
+	{
+		$this->get_registry()->add_adapter('I_Router', 'A_WordPress_Router');
+        $this->get_registry()->add_adapter('I_Routing_App', 'A_WordPress_Routing_App');
+	}
+
+	function _register_hooks()
+	{
+		add_action('template_redirect', array(&$this, 'restore_request_uri'), 1);
+	}
+
+	function restore_request_uri()
+	{
+		if (isset($_SERVER['ORIG_REQUEST_URI'])) {
+			$_SERVER['REQUEST_URI'] = $_SERVER['ORIG_REQUEST_URI'];
+		}
+	}
+
+    function get_type_list()
+    {
+        return array(
+            'A_Wordpress_Router' => 'adapter.wordpress_router.php',
+            'A_Wordpress_Routing_App' => 'adapter.wordpress_routing_app.php'
+        );
+    }
+}
+
+new M_WordPress_Routing();
\ No newline at end of file
diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/product.photocrati_nextgen.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/product.photocrati_nextgen.php
new file mode 100644
index 0000000000000000000000000000000000000000..06c4f3688d07a291fa989fabcbd6c0e8b259159d
--- /dev/null
+++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/product.photocrati_nextgen.php
@@ -0,0 +1,74 @@
+<?php
+
+/***
+	{
+		Product: photocrati-nextgen
+	}
+***/
+
+define('NEXTGEN_GALLERY_CHANGE_OPTIONS_CAP', 'NextGEN Manage gallery');
+
+class P_Photocrati_NextGen extends C_Base_Product
+{
+	static $modules = array(
+		'photocrati-fs',
+		'photocrati-validation',
+		'photocrati-router',
+		'photocrati-wordpress_routing',
+		'photocrati-security',
+		'photocrati-lzw',
+        'photocrati-nextgen_settings',
+		'photocrati-mvc',
+		'photocrati-ajax',
+		'photocrati-dynamic_stylesheet',
+		'photocrati-frame_communication',
+		'photocrati-datamapper',
+		'photocrati-nextgen-legacy',
+		'photocrati-nextgen-data',
+		'photocrati-dynamic_thumbnails',
+		'photocrati-nextgen_admin',
+		'photocrati-nextgen_addgallery_page',
+		'photocrati-nextgen_pagination',
+		'photocrati-nextgen_gallery_display',
+		'photocrati-attach_to_post',
+		'photocrati-nextgen_other_options',
+		'photocrati-nextgen_pro_upgrade',
+		'photocrati-jsconsole',
+		'photocrati-mediarss',
+		'photocrati-cache',
+		'photocrati-lightbox',
+		'photocrati-nextgen_basic_templates',
+		'photocrati-nextgen_basic_gallery',
+		'photocrati-nextgen_basic_imagebrowser',
+		'photocrati-nextgen_basic_singlepic',
+		'photocrati-nextgen_basic_tagcloud',
+		'photocrati-nextgen_basic_album',
+		'photocrati-widget',
+        'photocrati-third_party_compat',
+		'photocrati-nextgen_xmlrpc'
+	);
+
+	function define()
+	{
+		parent::define(
+			'photocrati-nextgen',
+			'Photocrati NextGEN',
+			'Photocrati NextGEN',
+			'2.0.33',
+			'http://www.nextgen-gallery.com',
+			'Photocrati Media',
+			'http://www.photocrati.com'
+		);
+
+		$module_path = path_join(dirname(__FILE__), 'modules');
+		$this->get_registry()->set_product_module_path($this->module_id, $module_path);
+		$this->get_registry()->add_module_path($module_path, TRUE, FALSE);
+
+		foreach (self::$modules as $module_name) $this->_get_registry()->load_module($module_name);
+
+		include_once('class.nextgen_product_installer.php');
+		C_Photocrati_Installer::add_handler($this->module_id, 'C_NextGen_Product_Installer');
+	}
+}
+
+new P_Photocrati_NextGen();
diff --git a/wp-content/plugins/nextgen-gallery/readme.txt b/wp-content/plugins/nextgen-gallery/readme.txt
index d59e36b064677306ca3ee407c5232764647d4607..ef6c4812d70ba6f9ab262afdc15642540181f972 100644
--- a/wp-content/plugins/nextgen-gallery/readme.txt
+++ b/wp-content/plugins/nextgen-gallery/readme.txt
@@ -1,23 +1,29 @@
 === NextGEN Gallery ===
 Contributors: photocrati
 Tags:gallery,image,images,photo,photos,picture,pictures,slideshow,flash,media,thumbnails,photo-albums,nextgen-gallery,nextgen
-Requires at least: 3.5
-Tested up to: 3.5.1
+Requires at least: 3.6
+Tested up to: 3.6
 Stable tag: trunk
 License: GPLv2
 
-The most popular WordPress gallery plugin and one of the most popular plugins of all time with over 6 million downloads.
+The most popular WordPress gallery plugin and one of the most popular plugins of all time with over 7.5 million downloads.
 
 == Description ==
 
 = WordPress Gallery Plugin =
 
-NextGEN Gallery is the most popular **WordPress gallery plugin**, and one of the most popular WordPress plugins of all time, with over 6 million downloads.
+NextGEN Gallery is the most popular **WordPress gallery plugin**, and one of the most popular WordPress plugins of all time, with over 7.5 million downloads.
 
 It provides a powerful engine for uploading and managing galleries of images, with the ability to batch upload, import meta data, add/delete/rearrange/sort images, edit thumbnails, group galleries into albums, and more. It also provides two front-end display styles (slideshows and thumbnail galleries), both of which come with a wide array of options for controlling size, style, timing, transitions, controls, lightbox effects, and more.
 
 *The NextGEN Gallery WordPress gallery plugin is now proudly maintained by <a href='http://www.photocrati.com'>Photocrati Media</a>. Special thanks to Alex Rabe who created and maintained NextGEN from 2007 through 2011.*
 
+**NEXTGEN GALLERY 2.0: MAJOR UPDATE IN JULY 2013.** *We released a major update and overhaul to NextGEN Gallery in July 2013. NextGEN Gallery 2.0 presents a completely reworked interface, both for the central options panel and for adding galleries to pages and posts. It's dramatically more powerful and flexible.*
+
+**INTRODUCING NEXTGEN GALLERY PRO.** *Along with NextGEN 2.0, we're happy to announce a "Pro" upgrade to NextGEN. NextGEN Pro offers 6 new gallery displays, including Pro Masonry, Pro Filmstrip, Pro Film, Pro Thumbnail Grid, Pro Slideshow, and Pro Blogstyle galleries. It also includes a responsive, fullscreen, mobile-friendly Pro Lightbox with commenting and social sharing for individual images within galleries. And it includes premium one-on-one email support for both NextGEN Gallery and NextGEN Pro.* 
+
+**<a href="http://www.nextgen-gallery.com/nextgen-pro">LEARN MORE ABOUT NEXTGEN PRO</a>**
+
 
 = NextGEN WordPress Gallery Plugin Features =
 
@@ -37,7 +43,7 @@ It provides a powerful engine for uploading and managing galleries of images, wi
 
 *Display Galleries*
 
-* Two Gallery Types. Choose between two main display styles: Slideshow and Thumbnail, and allow visitors to toggle between the two.
+* Multiple Gallery Types. Choose between two main display styles: Slideshow and Thumbnail, and allow visitors to toggle between the two. Or display Imagebrowser galleries and Singlepics.
 * Slideshow Galleries. Choose from a vast array of options for slideshows, including slideshow size, transition style, speed, image order, and optional navigation bar.
 * Thumbnail Galleries. Choose from a wide range of options to customize thumbnail galleries, including 5 different lightboxes for individual images, optional thumbnail cropping and editing, thumbnail styles, captions, and more.
 * Single Image Displays. Display and format single images.
@@ -50,8 +56,8 @@ NextGEN has been the dominant WordPress gallery plugin for years. As a result, t
 = NextGEN WordPress Gallery Plugin Resources =
 
 *Visit the NextGEN <a href="http://www.nextgen-gallery.com" target="_blank">WordPress Gallery Plugin</a> official homepage<br>
-*View <a href="http://www.nextgen-gallery.com/nextgen-gallery-demos/" target="_blank">NextGEN Gallery Demos</a><br>
-*See the <a href="http://www.nextgen-gallery.com/nextgen-gallery-extension-plugins/">Complete List of NextGEN Extension Plugins</a><br>
+*Visit the <a href="http://www.nextgen-gallery.com/nextgen-pro" target="_blank">NextGEN Pro official landing page</a><br>
+*See <a href="http://www.nextgen-gallery.com/help/" target="_blank">NextGEN Gallery Documentation</a><br>
 *Get <a href="http://wordpress.org/tags/nextgen-gallery?forum_id=10" target="_blank">NextGEN Support</a> via the WordPress.org forums<br>
 *Get <a href="http://www.nextgen-gallery.com/languages/" target="_blank">Translations</a> for your own language<br>
 *See <a href="http://www.photocrati.com/photography-wordpress-themes" target="_blank">WordPress Photography Themes</a> by the same author<br>
@@ -61,7 +67,7 @@ NextGEN has been the dominant WordPress gallery plugin for years. As a result, t
 == Credits ==
 
 Copyright:<br>
-Photocrati Media 2012<br>
+Photocrati Media 2012-2013<br>
 Alex Rabe 2007-2011
 
 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 2 of the License, or (at your option) any later version.
@@ -72,15 +78,15 @@ You should have received a copy of the GNU General Public License along with thi
 
 ** Please note **
 
-NextGEN Gallery's flash slideshow option is powered by the JW Image Rotator from Long Tail Video. The Image Rotator is provided free as part of our plugin package thanks to a special commercial license with Long Tail Video. It is NOT released under GNU General Public License, and cannot be redistributed. A free version of the Image Rotator was previously available under a Creative Commons License, but it has been discontinued. Over time, we will be moving away from reliance on this file. For more information, see the Long Tail Video website: http://www.longtailvideo.com.
+NextGEN Gallery's flash slideshow option is powered by the JW Image Rotator from Long Tail Video. The Image Rotator is provided free as part of our plugin package thanks to a special arrangement with Long Tail Video. Over time, we will be moving away from reliance on this file. For more information, see the Long Tail Video website: http://www.longtailvideo.com.
 
 == Installation ==
 
-1. 	Download, upload and install .zip under Plugins >> Add New > Upload, and activate the NextGEN Gallery WordPress gallery plugin.
+INSTALLATION: The easiest way to enjoy NextGEN Gallery is to login to you WordPress dashboard, go to Plugins >> Add New, search for NextGEN Gallery, and click to install. You can also download the zip file from this page and upload it from the Plugins >> Add New > Upload page.
 
-2.	From your Wordpress Dashboard, go to Gallery > Add Gallery/Images > Follow the on-screen cues.
+HOW TO USE: Just go to a page or post and click the NextGEN Gallery icon. From our Attach to Post interface, you can create, manage, customize, and display your galleries. You can also manage your galleries and gallery settings from the central options area under the "Gallery" tab on your dashboard menu. 
 
-3. 	Go to a post/page, and select the NextGEN Gallery button from the Kitchen Sink. Follow the on-screen cues to select, adjust, and publish your gallery.
+DOCUMENTATION: See <a href="http://www.nextgen-gallery.com/help/" target="_blank">NextGEN Gallery Documentation</a>.
 
 That's it ... have fun! For more information, feel free to visit the official website for the NextGEN Gallery <a href="http://www.nextgen-gallery.com" target="_blank">WordPress Gallery Plugin</a>.
 
@@ -88,48 +94,38 @@ http://www.youtube.com/watch?v=Le_ZsNSuIvM
 
 == Screenshots ==
 
-1. Screenshot Admin Area
-2. Screenshot Album Selection
-3. Screenshot Shutter Effect
-4. Screenshot Watermark function
-5. Screenshot Flexible template layout
-6. Screenshot Show Exif data
+1. NextGEN Thumbnail Gallery
+2. NextGEN Slideshow Gallery
+3. NextGEN Imagebrowser Gallery
+4. NextGEN Central Gallery Settings Page
+5. NextGEN Other Options Page - Watermarking
+6. NextGEN Manage Gallery Page - Edit Thumbnails
+7. NextGEN Manage Gallery Page - Edit Image Tags
+8. NextGEN Interface for Adding Galleries to a Page or Post
+9. NextGEN NextGEN Placeholder Image When Editing a Page or Post
 
 == Shortcode ==
 
-= Examples =
+NextGEN Gallery 2.0 introduces our new Attach to Post interface, which means you never need to work with shortcodes again if you would prefer not too. 
 
-*Use Image Tags to Create Galleries/Albums* - [ nggtags album=WordPress,Cologne,Ireland ]
+If you do want to work with shortcodes, we've also introduce a new, more powerful, and more flexible shortcode system with NextGEN Gallery 2.0. 
 
-*Display Captions in Thumbnail Galleries* - [ nggallery id=1 template=caption ]
+**<a href="http://www.nextgen-gallery.com/nextgen-gallery-shortcodes">Learn About NextGEN Gallery 2.0 Shortcodes</a>**
 
-*Basic Filmstrip Galleries* - [ nggallery id=2 template=carousel images=7 ]
+Legacy shortcodes? For reference, we're also maintaining documentation on NextGEN Legacy shortcakes used in NextGEN 1.9.x and earlier. <a href="http://www.nextgen-gallery.com/shortcodes">See more on Legacy shortcakes</a>.  
 
-*Display Exif Data* - [ imagebrowser id=28 template=exif ]
-
-*Sort Images in a Gallery Based on Their Tags* - [ nggtags gallery=cologne,wordpress,.. ]
+For more information, feel free to visit the official website for the NextGEN Gallery <a href="http://www.nextgen-gallery.com" target="_blank">WordPress Gallery Plugin</a>.
 
-*Add Tag Clouds* - [ tagcloud]
+== Frequently Asked Questions ==
 
-*Single Pic Options* - [ singlepic id=x w=width h=height mode=web20|watermark float=left|right ]
 
-*Template Engine for Gallery Types*<br>
-[ nggallery id=1 template=sample1 ]<br>
-[ nggallery id=1 template=sample2 ]<br>
-[ nggallery id=1 template=sample3 ]<br>
-[ nggallery id=1 template=sample4 ]<br>
-[ nggallery id=1 template=sample5 ]<br>
-[ nggallery id=1 template=sample6 ]<br>
+= Why are my galleries not opening up in a lightbox after I move my site? =
 
-*Integration with Third Party Plugins*<br>
-[ monoslideshow id=1 w=450 h=350 ]<br>
-[ nggallery id=1 template=galleryview images=0 ]<br>
-[ media id=6 width=320 height=240 plugins=revolt-1 ]<br>
-[ media id=3 width=320 height=240 plugins=rateit-2 ]<br>
+This is often due to the URL paths to the CSS and JavaScript files used by the Lightbox Effects not being changed to relevant addresses based on the new site. This article will help sort out this issue if that is the case: <a href="http://www.nextgen-gallery.com/galleries-opening-lightbox/" target="_blank">Why are my galleries not opening up in a lightbox?</a>. 
 
-For more information, feel free to visit the official website for the NextGEN Gallery <a href="http://www.nextgen-gallery.com" target="_blank">WordPress Gallery Plugin</a>.
+= Do you have documentation or tutorials? =
 
-== Frequently Asked Questions ==
+Yes. See <a href="http://www.nextgen-gallery.com/help/" target="_blank">NextGEN Gallery Documentation</a>.
 
 = Will NextGEN Gallery work with my theme? =
 
@@ -143,7 +139,7 @@ No, NextGEN Gallery uses Javascript (J-Query) based displays to ensure compatibi
 
 = Are the galleries mobile friendly? =
 
-Yes, since we use Javascript rather than flash, NextGEN Gallery is compatible with Android, iOS, and Blackberry.
+Yes, since we use Javascript rather than flash, NextGEN Gallery is compatible with Android, iOS, and Blackberry. As of July 2013, all galleries are responsive. NextGEN Pro also includes a full screen, responsive Pro Lightbox with mobile gesture support. 
 
 
 = What is the difference between a gallery and an album? =
@@ -195,6 +191,7 @@ Since the captions are fully HTML capable, you can add external links and any ot
 
 Yes, the NextGEN Gallery WordPress gallery plugin has been translated into dozens of languages - <a href="http://www.nextgen-gallery.com/languages/" target="_blank">click here to find out more.</a>
 
+
 = More Information =
 
 For more information, feel free to visit the official website for the NextGEN Gallery <a href="http://www.nextgen-gallery.com" target="_blank">WordPress Gallery Plugin</a>.
@@ -202,6 +199,175 @@ For more information, feel free to visit the official website for the NextGEN Ga
 
 == Changelog ==
 
+= V2.0.33 - 10.21.2013 =
+* NEW:     Requests /ngg_tag/[tagname] will create a displayed gallery
+* NEW:     Option added to "Import Gallery" tab to use original images
+* Fixed:   Links are broken on the ngg_tags-sitemap.xml file by WordPress SEO
+* Fixed:   PHP notice: Attempt to assign property of non-object
+* Fixed:   Undefined property warnings when using NextGEN Basic Thumbnails
+* Fixed:   Detect if an applying a transient to a displayed gallery was successful
+* Fixed:   Compatibility issues with BJ-Lazy-Load and Colorbox
+* Fixed:   Pagination conflicts for multiple Imagebrowsers on the same page
+* Fixed:   Ability to display previous exception with debug mode
+* Fixed:   Tagclouds not working in multisite instances
+* Fixed:   Load widgets.css when a widget is being used
+* Fixed:   Installer should remove all instances of the component factory
+* Fixed:   Widget settings interface not intuitive
+* Fixed:   Inability to upload images in some Windows host environments
+* Fixed:   Sorting images/galleries using the Attach To Post interface
+* Fixed:   Fix detection of HTTPS (pull request by Leonhardt Wille)
+* Fixed:   Compilation errors of regular expressions
+* Fixed:   Pro galleries wouldn't display in environments using PHP 5.3.3 or less
+* Fixed:   Scanning of router slug is now limited to the uri, not the url
+* Fixed:   Show slideshow link isn't required for thumbnail/imagebrowser integration
+* Fixed:   WordPress media-upload with 'singlepic' image size
+* Fixed:   Use target=_blank when the link setting is provided for NextGEN Basic Singlepic
+* Fixed:   Only display rendering errors if WP_DEBUG is enabled
+
+= V2.0.31 - 10.03.2013 =
+* NEW:     Restored AJAX pagination for NextGEN Basic ImageBrowser display type
+* Fixed:   Compatibility with WordPress Local SEO by Yoast
+* Fixed:   Inability to upload images if image_slug field was missing in database
+* Fixed:   Integration of NextGEN Basic Thumbnail and NextGEN Basic Slideshow display types
+* Fixed:   Photocrati Resource Manager further adjusted to be third-party friendly
+* Fixed:   Added the ability to find legacy templates in both the child/parent theme directories
+* Fixed:   JavaScript errors in Attach to Post interface
+* Fixed:   Router can handle port numbers in urls
+* Fixed:   Carousel template was linking to NextGEN Basic ImageBrowser view
+* Fixed:   SQL query generated for displayed galleries using tags as source
+* Fixed:   3rd party compat: raise & never lower pcre.backtrack_limit
+
+= V2.0.30 - 09.25.2013 =
+* NEW:     Restored the ability to use imagebrowser display type instead of a lightbox effect
+* Changed: Displayed galleries are no longer rendered in RSS feeds
+* Changed: Removed "Plugin Check" widget from overview page
+* Fixed:   Silence PHP warnings/errors in an output buffer for AJAX actions
+* Fixed:   Compatibility issue with WordPress SEO and broken site maps (and large error_logs)
+* Fixed:   Compatibility issue with AJAX Event Calendar (and possibly others)
+* Fixed:   Adjusted Photocrati Resource Manager to be third-party friendly
+* Fixed:   Fixed empty result set for displayed galleries selecting 'All' tags
+* Fixed:   URL generation for imagebrowser pagination links
+* Fixed:   Ensure that image meta is imported on creation
+* Fixed:   Ensure that transients are removed when an external object cache is used
+* Fixed:   Don't load pluggable.php. This will fix plugin conflicts
+* Fixed:   In Attach to Post interface, galleries created in one tab weren't showing in another
+* Fixed:   Don't output frame events cookie for XML-RPC requests
+
+= V2.0.27 - 09.18.2013 =
+* Fixed:   Reduce performance impact of purging displayed gallery transients
+
+= V2.0.25 - 09.18.2013 =
+* Reverting to the 2.0.21 codebase, due to major performance issues in 2.0.23 and 2.0.24
+
+= V2.0.23 - 09.16.2013 =
+* NEW:     WP-Cron job to periodically clean-up displayed gallery transients
+* NEW:     Added "excluded_container_ids" as parameter for ngg_images shortcode
+* Fixed:   Lightbox effect is honoured by all display types
+* Fixed:   Highslide displays images from the correct displayed galleries
+* Fixed:   Ensure that sub-albums display correctly when the word "album" is part of a slug
+* Fixed:   Ensure that sub-albums display correctly when numerical slugs are used
+* Fixed:   Related images heading only added when Related Images functionality is enabled
+* Fixed:   PHP Warning about undefined index when viewing basic albums
+* Fixed:   AJAX handling is third-party compatible
+* Fixed:   Image date is no longer overwritten when an image is modified
+* Fixed:   Fixed issue with displayed galleries using source='tags'
+* Fixed:   Problem with transient cache not getting flushed properly from Other Options page
+* Fixed:   Use correct gallery/transient ID when ajax pagination is used
+
+= V2.0.21 - 09.09.2013 =
+* NEW:	   Multisite support
+* Changed: Default image quality set to 100 for generated images
+* Changed: Removed dependence on simplehtmldom library
+* Fixed:   Related images functionality works as it did in 1.9.x
+* Fixed:   Don't compress inline JavaScript in post/page content
+* Fixed:   Click-to-advance slideshow behavior for slideshows
+* Fixed:   Security warnings from VaultPress
+* Fixed:   View as Slideshow link works with AJAX pagination
+* Fixed:   Broken links on Overview page
+* Fixed:   Backup images option
+* Fixed:   Stylesheet url generated correctly for Windows hosts
+* Fixed:   Compatibility with NextGen Custom Fields plugin
+* Fixed:   Compatibility with Adsense Explosion plugin
+* Fixed:   Suppress wp_footer notices unless WP_DEBUG is set to TRUE
+
+= V2.0.17 - 08.30.2013 =
+Fixed:     Match legacy behaviour when changing gallery path, i.e. don't move files
+
+= V2.0.14 - 08.27.2013 =
+* NEW:     Added the ability to override thumbnail settings for NextGEN Basic Albums
+* NEW:     Shortcode Manager API, which ensures that shortcodes are outputted as intended
+* Changed: Re-added the ability to select the original image size for widgets
+* Fixed:   Ensure that stylesheet url returned is correct for Windows hosts
+* Fixed:   Broken links and lightbox effects with AJAX pagination
+* Fixed:   Try to ensure that third party plugins don't add content to our dynamic JS
+* Fixed:   Improved reliability of iframely.js
+* Fixed:   Ensure that urls are generated correctly in HTTPs environments
+* Fixed:   Datamapper works correctly in environments where temporary tables aren't supported
+* Fixed:   Fixed an issue with thickbox loading animation when home url differs from site url
+
+= V2.0.11 - 08.19.2013 =
+* NEW:     Added "run_ngg_resource_manager" hook to by-pass our resource manager
+* Changed: Removed "Reset & Uninstall" tab, for now
+* Fixed:   Compatibility with W3 Total Cache. Please flush cache after updating.
+* Fixed:   Conflicts with Photocrati Theme Galleries
+* Fixed:   Blank Attach to Post interface window
+* Fixed:   Fixed ability to change Lightbox Effect settings
+* Fixed:   Implemented techniques to ensure WP_Query variables aren't overwritten
+* Fixed:   Enqueuing AJAX JS libraries twice in wp-admin
+* Fixed:   Encoding issues
+* Fixed:   PHP warnings caused by accessing unserialized data as array
+* Fixed:   Fixed installer issues
+
+= V2.0.7 - 08.09.2013 =
+* NEW:     New resource manager that fixes many plugin and theme incompatibilities
+* NEW:     Styles (custom stylesheets) should reside in wp-content/ngg_styles
+* NEW:     Added option to "Other Options -> Misc" to control maximum images returned
+* Secured: Removed default connector for jQuery FileTree library
+* Changed: Updated the simplehtmldom library to version 1.5
+* Changed: jQuery is now enqueued at the beginning of every request
+* Fixed:   Incompatibilities with BuddyPress
+* Fixed:   Incompatibilities with Events+, bbPress, Custom Permalinks, and many other plugins
+* Fixed:   Incompcatibilities with Member Access, AMember, Magic Fields, and More Fields
+* Fixed:   Incompatibilities with Elegant Themes, Oxygen, Responsive, and many other themes
+* Fixed:   Ensure that gallery images don't have a border by default
+* Fixed:   Conflict between imagebrowser and album urls
+* Fixed:   Reverted default gallerypath to wp-content/gallery/
+* Fixed:   Upgrade-safe way of overriding Styles
+* Fixed:   Generation of AJAX url is now based on slug
+* Fixed:   Restore nggShowGallery and nggShowSlideshow as wrappers to new API
+* Fixed:   Always use domain as specified by WordPress Site URL
+* Fixed:   Use WordPress Home URL over Site URL when appropriate
+* Fixed:   Numerous pagination issues
+* Fixed:   Adjusted our forms to comply with WordPress Firewalls
+* Fixed:   Correct use of select2 DOM selector for maximum compatibility
+* Fixed:   Path and URL calculations for Windows and UNIX environments
+* Fixed:   Ensure that pluggable.php is loaded at the start of every request
+* Fixed:   Fancybox: adjust CSS for further box-sizing protection from themes
+* Fixed:   Use PHP 5.2.1 compatible named pattern matching syntax
+* Fixed:   Remove usage of __DIR__ constant not supported by PHP 5.2.x
+* Fixed:   Removed dependency on mb_string PHP module
+* Fixed:   Allow "No Lightbox" as an option for Lightbox Effects
+* Fixed:   Warning: "Invalid CRT parameters detected" for Windows environments
+
+= V2.0 - 07.30.2013 =
+* NEW:	   Improved user experience throughout the plugin, settings and usage.
+* NEW:     Plupload queue uploader that allows for bulk and zip uploads within the same interface.
+* NEW:     Complete redesign of the NextGEN options panel
+* NEW:     Added new interface for adding galleries from pages and posts.
+* NEW:     Galleries are now mobile friendly and responsive, which is most noticeable with a responsive theme.
+* NEW:     Streamlined functionality for displaying galleries based on tags.
+* NEW:     Architecture based on Pope Framework (http://bitbucket.org/photocrati/pope-framework)
+* NEW:     New shortcode, “ngg_images”, and corresponding Attach to Post interface
+* NEW:     Galleries have now global and instance settings
+* NEW:     Support for FastCGI environments
+* Changed: Replaces shortcodes with placeholder images, however still supports legacy shortcodes.
+* Changed: Introduced new Growl-like notifications
+* Changed: The container and it’s images are centered for slideshows
+* Changed: NextGEN styles now override vs replace default styles
+* Changed: NextGEN legacy templates have been deprecated (but still function)
+* FIXED:   The ability to use NextGEN image as a Featured Image.
+* FIXED:   Many bugs and annoyances, such as PHP warnings, errors, etc.
+
 = V1.9.13 - 06.11.2013 =
 * NEW:     Slideshows are now centered to their content area
 * Secured: Ensure that only logged in users can upload images
@@ -220,7 +386,7 @@ For more information, feel free to visit the official website for the NextGEN Ga
 * Fixed:   Empty drop-down for "Page Link To"
 * Fixed:   Alphabetical image sorting
 * Fixed:   Compatibility with Arjuna X theme
-* Fixed:   “Creating default object from empty value” on album page
+* Fixed:   “Creating default object from empty value” on album page
 * Fixed:   Compatibility issues with PHP 5.4 on album page
 * Fixed:   E_DEPRECATED warning when using get_userdatabylogin() function
 * Fixed:   Removed many E_NOTICE errors
@@ -247,7 +413,7 @@ For more information, feel free to visit the official website for the NextGEN Ga
 
 = V1.9.7 - 11.13.2012 =
 * Secured: Removed bundled version of swfupload; using WordPress-bundled version instead for WordPress 3.2 instances
-* Changed: Using JQuery UI for the image sorting interface (thanks Tomás Soler)
+* Changed: Using JQuery UI for the image sorting interface (thanks Tomás Soler)
 * Bugfix:  Image uploads work in WP 3.2 when using Safari
 * Bugfix:  Adjusted TinyMCE window to use built-in JavaScript libraries
 * Bugfix:  Removed Photocrati acquisition announcement
diff --git a/wp-content/plugins/nextgen-gallery/screenshot-1.png b/wp-content/plugins/nextgen-gallery/screenshot-1.png
new file mode 100644
index 0000000000000000000000000000000000000000..3657a9d085f142e2156f511fc80d45e3f6053bfa
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/screenshot-1.png differ
diff --git a/wp-content/plugins/nextgen-gallery/screenshot-2.png b/wp-content/plugins/nextgen-gallery/screenshot-2.png
new file mode 100644
index 0000000000000000000000000000000000000000..05574998012a36bcb4c82d876015696430fa12e2
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/screenshot-2.png differ
diff --git a/wp-content/plugins/nextgen-gallery/screenshot-3.png b/wp-content/plugins/nextgen-gallery/screenshot-3.png
new file mode 100644
index 0000000000000000000000000000000000000000..ef64950aac61ef29f1944a2df44e3db557c85dba
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/screenshot-3.png differ
diff --git a/wp-content/plugins/nextgen-gallery/screenshot-4.png b/wp-content/plugins/nextgen-gallery/screenshot-4.png
new file mode 100644
index 0000000000000000000000000000000000000000..130699d15bb9eb5c3c45b4954774a838d0dc8ffe
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/screenshot-4.png differ
diff --git a/wp-content/plugins/nextgen-gallery/screenshot-5.png b/wp-content/plugins/nextgen-gallery/screenshot-5.png
new file mode 100644
index 0000000000000000000000000000000000000000..6f72d378ee9e9393f5b2ee69e89e200597dcf773
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/screenshot-5.png differ
diff --git a/wp-content/plugins/nextgen-gallery/screenshot-6.png b/wp-content/plugins/nextgen-gallery/screenshot-6.png
new file mode 100644
index 0000000000000000000000000000000000000000..b309b7971fe41fddc76e089bc21404f0fb0367d2
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/screenshot-6.png differ
diff --git a/wp-content/plugins/nextgen-gallery/screenshot-7.png b/wp-content/plugins/nextgen-gallery/screenshot-7.png
new file mode 100644
index 0000000000000000000000000000000000000000..b9745474686e11b45e28853e882c03f793f132b2
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/screenshot-7.png differ
diff --git a/wp-content/plugins/nextgen-gallery/screenshot-8.png b/wp-content/plugins/nextgen-gallery/screenshot-8.png
new file mode 100644
index 0000000000000000000000000000000000000000..e32f6457dccc68ca51803adba9d3c946e38177fa
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/screenshot-8.png differ
diff --git a/wp-content/plugins/nextgen-gallery/screenshot-9.png b/wp-content/plugins/nextgen-gallery/screenshot-9.png
new file mode 100644
index 0000000000000000000000000000000000000000..debf5f411a8223fd52b8b198ad41e1826b0676b6
Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/screenshot-9.png differ