diff --git a/MIT-license.txt b/MIT-license.txt
new file mode 100644
index 000000000..b82a51d7e
--- /dev/null
+++ b/MIT-license.txt
@@ -0,0 +1,21 @@
+The MIT License
+
+Copyright (C) 2011 by Code Computerlove
+
+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
\ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644
index 000000000..efa62b549
--- /dev/null
+++ b/README.md
@@ -0,0 +1,146 @@
+PhotoSwipe - The ultimate image/photo gallery for your mobile device
+======================================================================
+
+[www.photoswipe.com](http://www.photoswipe.com)
+
+Inspired by the iOS photo viewer and Google images for mobile, PhotoSwipe is a HTML/CSS/JavaScript image viewer specifically targeted mobile device use.
+
+The current version supports mobile handsets running webkit based browsers, i.e. iOS, Android and Blackberry 6. It also works on selected Nokia devices running webkit. At the moment, Windows Phone 7 is not currently supported.
+
+In addition, PhotoSwipe also runs on the desktop and has been tested on Chrome, Firefox and Internet Explorer 8 and above.
+
+
+
+Features
+--------
+
+- Optimised for mobile devices running a webkit browser.
+
+- Runs on modern desktop browsers, including Internet Explorer 8 and above.
+
+- Multiple input options including swipe gestures (both mouse and screen touches), keyboard control and an interactive on screen toolbar.
+
+- Responsive to device orientation changes.
+
+- Automatically scales images to maximise screen size and orientation.
+
+- Works with your markup and semantic structure. Does not enforce any specific markup.
+
+- Supports image captions.
+
+- Slideshow feature to automatically play through images in the gallery.
+
+- Uses hardware acceleration where possible for smoother transitions and effects.
+
+- Comprehensive customisation options:
+
+ - Presentation controlled via CSS
+
+ - Set whether the gallery loops or not i.e. when you reach the end, is the next image the first image, or does the gallery show a bounce effect to indicate that you have reached the end.
+
+ - Hide or show captions and toolbar
+
+ - Change caption and toolbar positions
+
+ - Set the speeds of all animations used, from sliding in to fading.
+
+
+
+Getting Started
+---------------
+
+The library comes with an example site to help you get started.
+
+There are two distributions of the library:
+
+- The default distribution optimised for webkit (mobile and desktop) and Mozilla based browsers. This distribution uses standard DOM querying and manupulation. It also uses CSS3 transformations for animations.
+
+- The jQuery distribution that uses jQuery as it's engine.
+
+It is recommended for webit based mobile devices to use the default distribution. This distribution will run faster. It does not require jQuery (so one less library to download to your mobile device). It also uses CSS3 to achieve animation effects. This is extremely noticable when running on an iOS device as animation will use hardware acceleration and will feel more "native" to the device. The default distribution will also work on desktop Webkit browsers (such as Chrome and Safari) as well as Firefox.
+
+Use the jQuery distibution if you need to support a wider range of browsers such as Internet Explorer etc. By default, this distributionn will not use hardware acceleration for animation on iOS devices so is noticably slower. You can however override the default animation functionality in jQuery by including the excellent [Animate Enhanced](https://github.com/benbarnett/jQuery-Animate-Enhanced) library.
+
+Both default and jQuery distribution come with a jQuery plugin wrapper to bind elements to the gallery. So for the default distribution, if you really needed to, you can still use jQuery to find your images in your HTML document, hook into the jQuery DOM ready event and use the jQuery PhotoSwipe plugin to display the library. The gallery will still be running on the default optimised engine, but you have the convience of jQuery to set things up should you need to.
+
+
+
+Getting Started - Default Distribution
+--------------------------------------
+
+See "examples/index.html".
+
+This example assumes no jQuery at all and is heavily optimised for Webkit and Mozilla browsers.
+
+
+Getting Started - Default Distribution (with jQuery plugin)
+-----------------------------------------------------------
+
+See "examples/jquery-plugin.html".
+
+This example assumes you want to use the convience of jQuery for initiating the gallery, but still the optimised engine for Webkit and Mozilla browsers.
+
+
+Getting Started - Default Distribution (with jQuery engine)
+-----------------------------------------------------------
+
+See "examples/jquery-engine.html".
+
+This example assumes you want to use jQuery for the gallery's engine as well as initiating the gallery. It is not advised to use this approach if you are targetting mobile webkit based devices.
+
+
+Options
+-------
+
+- **fadeSpeed**: The speed of any fading elements in milliseconds. Default "400"
+
+- **slideSpeed**: How fast images slide into view in milliseconds. Default "250"
+
+- **swipeThreshold**: How many pixels your finger has to move across the screen to register a swipe gesture. Default "50"
+
+- **loop**: Whether the gallery auto-loops back to the beginning when you reach the end. Default "true"
+
+- **flipCaptionAndToolbar**: Place the caption at the bottom and the toolbar at the top
+
+- **captionDelay**: How long before the caption is hidden from view in milliseconds. Default "3000"
+
+- **captionOpacity**: The opacity of the caption. Default "0.8"
+
+- **hideCaption**: Whether to hide the caption or not. If an image does not have a caption, the caption will be hidden irrespective. Default "false"
+
+- **showEmptyCaptions**: Shows a blank caption area even if a caption cannot be found for the current image. Default "false"
+
+- **toolbarDelay**: How long before the toolbar is hidden from view in milliseconds. Default "3000"
+
+- **toolbarOpacity**: The opacity of the toolbar. Default "0.8"
+
+- **hideToolbar**: Whether to hide the toolbar or not. Default "false"
+
+- **slideshowDelay**: The delay between showing the next image when in slideshow mode
+
+- **imageScaleMethod**: How images will fit onto the screen. Either "fit" or "zoom". "fit" ensures the image always fits the screen. "zoom" the image will always fill the full screen, this may cause the image to be "zoomed" in and cropped. Default "fit"
+
+- **getImageSource**: Function to specify how the gallery obatins image sources. By default, the gallery assumes you send it a list of images with each image wrapped in an anchor tag. The anchor tag will contain the URL to the full size image. You can change this e.g. if you supply a list of images without an anchor tag, and supply the full size URL on the image's "rel" attribute:
+
+ $('div.gallery a').swipeGallery({
+ getImageSource: function(){
+ return $j(this).attr('rel');
+ }
+ });
+
+- **getImageCaption**: Like "getImageSource", function to specify how the gallery obatins image captions. By default, the gallery looks for an images "alt" tag.
+
+
+
+Keyboard controls for desktop browsers
+--------------------------------------
+
+- **Left cursor**: Previous image
+
+- **Right cursor**: Next image
+
+- **Escape**: Close gallery
+
+- **Space bar**: Show toolbar / caption if they have faded from view. If both are hidden via the configuration, space bar will close the gallery
+
+
diff --git a/artifact/1.0.0/MIT-license.txt b/artifact/1.0.0/MIT-license.txt
new file mode 100644
index 000000000..b82a51d7e
--- /dev/null
+++ b/artifact/1.0.0/MIT-license.txt
@@ -0,0 +1,21 @@
+The MIT License
+
+Copyright (C) 2011 by Code Computerlove
+
+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
\ No newline at end of file
diff --git a/artifact/1.0.0/README.md b/artifact/1.0.0/README.md
new file mode 100644
index 000000000..efa62b549
--- /dev/null
+++ b/artifact/1.0.0/README.md
@@ -0,0 +1,146 @@
+PhotoSwipe - The ultimate image/photo gallery for your mobile device
+======================================================================
+
+[www.photoswipe.com](http://www.photoswipe.com)
+
+Inspired by the iOS photo viewer and Google images for mobile, PhotoSwipe is a HTML/CSS/JavaScript image viewer specifically targeted mobile device use.
+
+The current version supports mobile handsets running webkit based browsers, i.e. iOS, Android and Blackberry 6. It also works on selected Nokia devices running webkit. At the moment, Windows Phone 7 is not currently supported.
+
+In addition, PhotoSwipe also runs on the desktop and has been tested on Chrome, Firefox and Internet Explorer 8 and above.
+
+
+
+Features
+--------
+
+- Optimised for mobile devices running a webkit browser.
+
+- Runs on modern desktop browsers, including Internet Explorer 8 and above.
+
+- Multiple input options including swipe gestures (both mouse and screen touches), keyboard control and an interactive on screen toolbar.
+
+- Responsive to device orientation changes.
+
+- Automatically scales images to maximise screen size and orientation.
+
+- Works with your markup and semantic structure. Does not enforce any specific markup.
+
+- Supports image captions.
+
+- Slideshow feature to automatically play through images in the gallery.
+
+- Uses hardware acceleration where possible for smoother transitions and effects.
+
+- Comprehensive customisation options:
+
+ - Presentation controlled via CSS
+
+ - Set whether the gallery loops or not i.e. when you reach the end, is the next image the first image, or does the gallery show a bounce effect to indicate that you have reached the end.
+
+ - Hide or show captions and toolbar
+
+ - Change caption and toolbar positions
+
+ - Set the speeds of all animations used, from sliding in to fading.
+
+
+
+Getting Started
+---------------
+
+The library comes with an example site to help you get started.
+
+There are two distributions of the library:
+
+- The default distribution optimised for webkit (mobile and desktop) and Mozilla based browsers. This distribution uses standard DOM querying and manupulation. It also uses CSS3 transformations for animations.
+
+- The jQuery distribution that uses jQuery as it's engine.
+
+It is recommended for webit based mobile devices to use the default distribution. This distribution will run faster. It does not require jQuery (so one less library to download to your mobile device). It also uses CSS3 to achieve animation effects. This is extremely noticable when running on an iOS device as animation will use hardware acceleration and will feel more "native" to the device. The default distribution will also work on desktop Webkit browsers (such as Chrome and Safari) as well as Firefox.
+
+Use the jQuery distibution if you need to support a wider range of browsers such as Internet Explorer etc. By default, this distributionn will not use hardware acceleration for animation on iOS devices so is noticably slower. You can however override the default animation functionality in jQuery by including the excellent [Animate Enhanced](https://github.com/benbarnett/jQuery-Animate-Enhanced) library.
+
+Both default and jQuery distribution come with a jQuery plugin wrapper to bind elements to the gallery. So for the default distribution, if you really needed to, you can still use jQuery to find your images in your HTML document, hook into the jQuery DOM ready event and use the jQuery PhotoSwipe plugin to display the library. The gallery will still be running on the default optimised engine, but you have the convience of jQuery to set things up should you need to.
+
+
+
+Getting Started - Default Distribution
+--------------------------------------
+
+See "examples/index.html".
+
+This example assumes no jQuery at all and is heavily optimised for Webkit and Mozilla browsers.
+
+
+Getting Started - Default Distribution (with jQuery plugin)
+-----------------------------------------------------------
+
+See "examples/jquery-plugin.html".
+
+This example assumes you want to use the convience of jQuery for initiating the gallery, but still the optimised engine for Webkit and Mozilla browsers.
+
+
+Getting Started - Default Distribution (with jQuery engine)
+-----------------------------------------------------------
+
+See "examples/jquery-engine.html".
+
+This example assumes you want to use jQuery for the gallery's engine as well as initiating the gallery. It is not advised to use this approach if you are targetting mobile webkit based devices.
+
+
+Options
+-------
+
+- **fadeSpeed**: The speed of any fading elements in milliseconds. Default "400"
+
+- **slideSpeed**: How fast images slide into view in milliseconds. Default "250"
+
+- **swipeThreshold**: How many pixels your finger has to move across the screen to register a swipe gesture. Default "50"
+
+- **loop**: Whether the gallery auto-loops back to the beginning when you reach the end. Default "true"
+
+- **flipCaptionAndToolbar**: Place the caption at the bottom and the toolbar at the top
+
+- **captionDelay**: How long before the caption is hidden from view in milliseconds. Default "3000"
+
+- **captionOpacity**: The opacity of the caption. Default "0.8"
+
+- **hideCaption**: Whether to hide the caption or not. If an image does not have a caption, the caption will be hidden irrespective. Default "false"
+
+- **showEmptyCaptions**: Shows a blank caption area even if a caption cannot be found for the current image. Default "false"
+
+- **toolbarDelay**: How long before the toolbar is hidden from view in milliseconds. Default "3000"
+
+- **toolbarOpacity**: The opacity of the toolbar. Default "0.8"
+
+- **hideToolbar**: Whether to hide the toolbar or not. Default "false"
+
+- **slideshowDelay**: The delay between showing the next image when in slideshow mode
+
+- **imageScaleMethod**: How images will fit onto the screen. Either "fit" or "zoom". "fit" ensures the image always fits the screen. "zoom" the image will always fill the full screen, this may cause the image to be "zoomed" in and cropped. Default "fit"
+
+- **getImageSource**: Function to specify how the gallery obatins image sources. By default, the gallery assumes you send it a list of images with each image wrapped in an anchor tag. The anchor tag will contain the URL to the full size image. You can change this e.g. if you supply a list of images without an anchor tag, and supply the full size URL on the image's "rel" attribute:
+
+ $('div.gallery a').swipeGallery({
+ getImageSource: function(){
+ return $j(this).attr('rel');
+ }
+ });
+
+- **getImageCaption**: Like "getImageSource", function to specify how the gallery obatins image captions. By default, the gallery looks for an images "alt" tag.
+
+
+
+Keyboard controls for desktop browsers
+--------------------------------------
+
+- **Left cursor**: Previous image
+
+- **Right cursor**: Next image
+
+- **Escape**: Close gallery
+
+- **Space bar**: Show toolbar / caption if they have faded from view. If both are hidden via the configuration, space bar will close the gallery
+
+
diff --git a/artifact/1.0.0/change-log.html b/artifact/1.0.0/change-log.html
new file mode 100644
index 000000000..416b31929
--- /dev/null
+++ b/artifact/1.0.0/change-log.html
@@ -0,0 +1,15 @@
+
+
+
+ Changes
+
+
+
+
+ 1.0.0 07.04.11
+
+ Initial release by Ste Brennan
+
+
+
+
diff --git a/artifact/1.0.0/code-photoswipe-1.0.0.js b/artifact/1.0.0/code-photoswipe-1.0.0.js
new file mode 100644
index 000000000..3dd99d538
--- /dev/null
+++ b/artifact/1.0.0/code-photoswipe-1.0.0.js
@@ -0,0 +1,3733 @@
+// PhotoSwipe - http://www.photoswipe.com/
+// Copyright (c) 2011 by Code Computerlove (http://www.codecomputerlove.com)
+// Licensed under the MIT license
+
+(function () {
+
+ // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/bind
+ if (!Function.prototype.bind ) {
+
+ Function.prototype.bind = function( obj ) {
+ var slice = [].slice,
+ args = slice.call(arguments, 1),
+ self = this,
+ nop = function () {},
+ bound = function () {
+ return self.apply( this instanceof nop ? this : ( obj || {} ),
+ args.concat( slice.call(arguments) ) );
+ };
+
+ nop.prototype = self.prototype;
+
+ bound.prototype = new nop();
+
+ return bound;
+ };
+ }
+
+
+ if (typeof Code === "undefined") {
+ Code = {};
+ Code.PhotoSwipe = {};
+ }
+
+
+
+ Code.PhotoSwipe.Util = {
+
+ browser: {
+ version: (navigator.userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [])[1],
+ webkit: /webkit/.test(navigator.userAgent),
+ opera: /opera/.test(navigator.userAgent), // untested
+ msie: /msie/.test(navigator.userAgent) && !/opera/.test(navigator.userAgent),
+ mozilla: /mozilla/.test(navigator.userAgent) && !/(compatible|webkit)/.test(navigator.userAgent),
+ mobileSafari: /Mac OS X.*Mobile.*Safari/.test(navigator.userAgent)
+ },
+
+
+ /*
+ * Function: setElementData
+ */
+ setElementData: function(el, key, value){
+
+ if ( this.isNothing(el.UtilData) ){
+ el.UtilData = { };
+ }
+
+ el.UtilData[key] = value;
+ },
+
+
+ /*
+ * Function: getElementData
+ */
+ getElementData: function(el, key, defaultValue){
+
+ if (typeof defaultValue === "undefined"){
+ defaultValue = null;
+ }
+
+ if ( this.isNothing(el.UtilData) ){
+ return defaultValue;
+ }
+
+ if ( this.isNothing(el.UtilData[key]) ){
+ return defaultValue;
+ }
+
+ return el.UtilData[key];
+
+ },
+
+
+ /*
+ * Function: removeElementData
+ */
+ removeElementData: function(el, key){
+
+ delete el.UtilData[key];
+
+ },
+
+
+ /*
+ * Function: coalesce
+ * Takes any number of arguments and returns the first non Null / Undefined argument.
+ */
+ coalesce: function () {
+ var i;
+ for (i = 0; i < arguments.length; i++) {
+ if (!this.isNothing(arguments[i])) {
+ return arguments[i];
+ }
+ }
+ return null;
+ },
+
+
+
+ /*
+ * Function: registerNamespace
+ */
+ registerNamespace: function () {
+ var args = arguments, obj = null, i, j;
+ for (i = 0; i < args.length; ++i) {
+ var ns = args[i];
+ var nsParts = ns.split(".");
+ var root = nsParts[0];
+ eval('if (typeof ' + root + ' == "undefined"){' + root + ' = {};} obj = ' + root + ';');
+ for (j = 1; j < nsParts.length; ++j) {
+ obj[nsParts[j]] = obj[nsParts[j]] || {};
+ obj = obj[nsParts[j]];
+ }
+ }
+ },
+
+
+
+ /*
+ * Function: extend
+ */
+ extend: function(destination, source, overwriteProperties){
+ if (this.isNothing(overwriteProperties)){
+ overwriteProperties = true;
+ }
+ if (destination && source && this.isObject(source)){
+ for(var prop in source){
+ if (overwriteProperties){
+ destination[prop] = source[prop];
+ }
+ else{
+ if(typeof destination[prop] == "undefined"){
+ destination[prop] = source[prop];
+ }
+ }
+ }
+ }
+ },
+
+
+ /*
+ * Function: swapArrayElements
+ */
+ swapArrayElements: function(arr, i, j){
+
+ var temp = arr[i];
+ arr[i] = arr[j];
+ arr[j] = temp;
+
+ },
+
+
+ /*
+ * Function: isObject
+ */
+ isObject: function(obj){
+ return typeof obj == "object";
+ },
+
+
+
+ /*
+ * Function: isNothing
+ */
+ isNothing: function (obj) {
+ if (typeof obj === "undefined" || obj === null) {
+ return true;
+ }
+ return false;
+ },
+
+
+
+ /*
+ * Function: isFunction
+ */
+ isFunction: function(obj){
+ return typeof obj == "function";
+ },
+
+
+
+ /*
+ * Function: isArray
+ */
+ isArray: function(obj){
+ return obj && Code.PhotoSwipe.Util.isFunction(obj.pop);
+ },
+
+
+
+ /*
+ * Function: isNumber
+ */
+ isNumber: function(obj){
+ return typeof obj == "number";
+ },
+
+
+ /*
+ * Function: isString
+ */
+ isString: function(obj){
+ return typeof obj == "string";
+ },
+
+
+
+ /*
+ * Function: trim
+ */
+ trim: function(val) {
+ var re = new RegExp(/\s+?/);
+ return val.replace(re, '');
+ }
+
+ };
+
+
+})();// PhotoSwipe - http://www.photoswipe.com/
+// Copyright (c) 2011 by Code Computerlove (http://www.codecomputerlove.com)
+// Licensed under the MIT license
+
+(function (Util) {
+
+ Util.extend(Util, {
+
+ DOM: {
+
+ /*
+ * Function: resetTranslate
+ * Required for smoother transition on iOS
+ */
+ resetTranslate: function(el){
+
+ if (Util.browser.mobileSafari){
+ Util.DOM.setStyle(el, '-webkit-transform', 'translate3d(0px,0px,0px)');
+ }
+
+ },
+
+
+ /*
+ * Function: createElement
+ */
+ createElement: function(type, attributes, content){
+
+ var retval = document.createElement(type);
+
+ for(var attribute in attributes) {
+ if(attributes.hasOwnProperty(attribute)){
+ retval.setAttribute(attribute, attributes[attribute]);
+ }
+ }
+
+ retval.innerHTML = content || '';
+
+ return retval;
+
+ },
+
+
+ /*
+ * Function: appendChild
+ */
+ appendChild: function(childEl, parentEl){
+
+ parentEl.appendChild(childEl);
+
+ },
+
+
+ /*
+ * Function: appendText
+ */
+ appendText: function(text, parentEl){
+
+ var textNode = document.createTextNode(text);
+ Util.DOM.appendChild(textNode, parentEl);
+
+ },
+
+
+ /*
+ * Function: appendToBody
+ */
+ appendToBody: function(childEl){
+
+ this.appendChild(childEl, document.body);
+
+ },
+
+
+ /*
+ * Function: removeChild
+ */
+ removeChild: function(childEl, parentEl){
+
+ parentEl.removeChild(childEl);
+
+ },
+
+
+
+ /*
+ * Function: removeChildren
+ */
+ removeChildren: function(parentEl){
+
+ if (parentEl.hasChildNodes()){
+
+ while (parentEl.childNodes.length >= 1){
+ parentEl.removeChild(parentEl.childNodes[parentEl.childNodes.length -1]);
+ }
+
+ }
+
+ },
+
+
+
+ /*
+ * Function: hasAttribute
+ */
+ hasAttribute: function(el, attributeName){
+
+ return el.getAttribute(attributeName);
+
+ },
+
+
+ /*
+ * Function: getAttribute
+ */
+ getAttribute: function(el, attributeName){
+
+ if(!this.hasAttribute(el, attributeName)){
+ return '';
+ }
+
+ return el.getAttribute(attributeName);
+
+ },
+
+
+ /*
+ * Function: el, attributeName
+ */
+ setAttribute: function(el, attributeName, value){
+
+ el.setAttribute(attributeName, value);
+
+ },
+
+
+ /*
+ * Function: removeAttribute
+ */
+ removeAttribute: function(el, attributeName){
+
+ if (this.hasAttribute(el, attributeName)){
+
+ el.removeAttribute(attributeName);
+
+ }
+
+ },
+
+
+ /*
+ * Function: addClass
+ */
+ addClass: function(el, className){
+
+ var currentClassValue = Util.DOM.getAttribute(el, 'class');
+
+ var re = new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)');
+
+ if ( ! re.test(currentClassValue) ){
+ if (currentClassValue != ''){
+ currentClassValue = currentClassValue + ' ';
+ }
+ currentClassValue = currentClassValue + className;
+ Util.DOM.setAttribute(el, 'class', currentClassValue);
+ }
+
+ },
+
+
+ /*
+ * Function: removeClass
+ */
+ removeClass: function(el, className){
+
+ var currentClassValue = Util.DOM.getAttribute(el, 'class');
+
+ var re = new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)');
+
+ if (re.test(currentClassValue)){
+
+ currentClassValue = currentClassValue.replace(re, ' ');
+
+ Util.DOM.setAttribute(el, 'class', currentClassValue);
+ Util.DOM.removeClass(el, className);
+
+ }
+ else{
+ currentClassValue = Util.trim(currentClassValue);
+ if (currentClassValue === ''){
+ Util.DOM.removeAttribute(el, 'class');
+ }
+ else{
+ Util.DOM.setAttribute(el, 'class', currentClassValue);
+ }
+ }
+
+ },
+
+
+ /*
+ * Function: hasClass
+ */
+ hasClass: function(el, className){
+
+ var re = new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)');
+ return re.test(Util.DOM.getAttribute(el, 'class'));
+
+ },
+
+
+ /*
+ * Function: setStyle
+ */
+ setStyle: function(el, style, value){
+
+ if (Util.isObject(style)) {
+ for(var propertyName in style) {
+ if(style.hasOwnProperty(propertyName)){
+ el.style[propertyName] = style[propertyName];
+ }
+ }
+ }
+ else {
+ el.style[style] = value;
+ }
+ },
+
+
+ /*
+ * Function: getStyle
+ */
+ getStyle: function(el, styleName){
+
+ return window.getComputedStyle(el,'').getPropertyValue(styleName);
+
+ },
+
+
+ /*
+ * Function: hide
+ */
+ hide: function(el){
+
+ // Store the current display value if we use show
+ Util.setElementData(el, 'oldDisplayValue', Util.DOM.getStyle(el, 'display'));
+ Util.DOM.setStyle(el, 'display', 'none');
+
+ },
+
+
+ /*
+ * Function: show
+ */
+ show: function(el){
+
+ if (Util.DOM.getStyle(el, 'display') === 'none'){
+ var oldDisplayValue = Util.getElementData(el, 'oldDisplayValue', 'block');
+ if (oldDisplayValue === 'none'){
+ oldDisplayValue = 'block';
+ }
+ Util.DOM.setStyle(el, 'display', oldDisplayValue);
+ }
+
+ },
+
+
+ /*
+ * Function: width
+ * Content width, excludes padding
+ */
+ width: function(el, value){
+
+ if (!Util.isNothing(value)){
+ if (Util.isNumber(value)){
+ value = value + 'px';
+ }
+ el.style.width = value;
+ }
+
+ return window.parseInt(window.getComputedStyle(el,'').getPropertyValue('width'));
+
+ },
+
+
+ /*
+ * Function: outerWidth
+ */
+ outerWidth: function(el){
+
+ return el.offsetWidth;
+
+ },
+
+
+ /*
+ * Function: height
+ * Content height, excludes padding
+ */
+ height: function(el, value){
+
+ if (!Util.isNothing(value)){
+ if (Util.isNumber(value)){
+ value = value + 'px';
+ }
+ el.style.height = value;
+ }
+
+ return window.parseInt(window.getComputedStyle(el,'').getPropertyValue('height'));
+
+ },
+
+
+ /*
+ * Function: outerHeight
+ */
+ outerHeight: function(el){
+
+ return el.offsetHeight;
+
+ },
+
+
+ /*
+ * Function: documentWidth
+ */
+ documentWidth: function(){
+
+ return Util.DOM.width(document.documentElement);
+
+ },
+
+
+ /*
+ * Function: documentHeight
+ */
+ documentHeight: function(){
+
+ return Math.round(Util.DOM.height(document.documentElement));
+
+ },
+
+
+ /*
+ * Function: bodyWidth
+ */
+ bodyWidth: function(){
+
+ return Util.DOM.width(document.body);
+
+ },
+
+
+ /*
+ * Function: bodyHeight
+ */
+ bodyHeight: function(){
+
+ return Util.DOM.height(document.body);
+
+ },
+
+
+ /*
+ * Function: windowWidth
+ */
+ windowWidth: function(){
+
+ return window.innerWidth;
+
+ },
+
+
+ /*
+ * Function: windowHeight
+ */
+ windowHeight: function(){
+
+ return window.innerHeight;
+
+ },
+
+
+ /*
+ * Function: windowScrollLeft
+ */
+ windowScrollLeft: function(){
+
+ return window.pageXOffset;
+
+ },
+
+
+ /*
+ * Function: windowScrollTop
+ */
+ windowScrollTop: function(){
+
+ return window.pageYOffset;
+
+ },
+
+
+ /*
+ * Function: addEventListener
+ */
+ addEventListener: function(el, type, listener){
+
+ el.addEventListener(type, listener, false);
+
+ },
+
+
+ /*
+ * Function: removeEventListener
+ */
+ removeEventListener: function(el, type, listener){
+
+ el.removeEventListener(type, listener, false);
+
+ },
+
+
+ /*
+ * Function: getMousePosition
+ */
+ getMousePosition: function(event){
+
+ var retval = {
+ x: 0,
+ y: 0
+ }
+
+ if (event.pageX) {
+ retval.x = event.pageX;
+ }
+ else if (event.clientX) {
+ retval.x = event.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
+ }
+
+ if (event.pageY) {
+ retval.y = event.pageY;
+ }
+ else if (event.clientY) {
+ retval.y = event.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
+ }
+
+ return retval;
+ },
+
+
+ /*
+ * Function: getTouchEvent
+ */
+ getTouchEvent: function(event){
+
+ return event;
+
+ }
+
+ }
+
+
+ });
+
+
+})(Code.PhotoSwipe.Util);// PhotoSwipe - http://www.photoswipe.com/
+// Copyright (c) 2011 by Code Computerlove (http://www.codecomputerlove.com)
+// Licensed under the MIT license
+
+(function (Util) {
+
+ Util.extend(Util, {
+
+
+ Animation: {
+
+ _applyTransitionDelay: 100,
+
+ /*
+ * Function: _setTransition
+ * Sets animation transitions on the element
+ */
+ _setTransition: function(el, property, duration, timingFunction, delay, callback){
+
+ var
+ transitionPrefix = Util.Animation._getTransitionPrefix(),
+ p = Util.coalesce(property, ''),
+ d = Util.coalesce(duration, ''),
+ t, de, c;
+
+ if (Util.isFunction(timingFunction)){
+ c = timingFunction;
+ t = '';
+ de = '';
+ }
+ else{
+ c = callback;
+ t = Util.coalesce(timingFunction, '');
+ de = Util.coalesce(delay, '');
+ }
+
+ Util.DOM.setStyle(el, transitionPrefix + 'Property', p);
+ Util.DOM.setStyle(el, transitionPrefix + 'Duration', d);
+ Util.DOM.setStyle(el, transitionPrefix + 'TimingFunction', t);
+ Util.DOM.setStyle(el, transitionPrefix + 'Delay', de);
+
+ // Wait for the above transitions to get applied
+ if (Util.isFunction(c)){
+ window.setTimeout(
+ function(){
+ c(el);
+ },
+ Util.Animation._applyTransitionDelay
+ );
+ }
+
+ },
+
+
+ /*
+ * Function: _setTransitionEndEventListener
+ * Sets an event listener on transition end. This will:
+ * - Remove the transitionEnd event hander
+ * - Fire any animation end callback you specified
+ *
+ * The function stores a pointer to the event handler functions
+ * on the element object itself (using Util.setElementData)
+ *
+ * This gives us a reference when removing the event listener
+ */
+ _setTransitionEndEventListener: function(el){
+
+ Util.setElementData(el, 'transitionEndEvent', function(e){
+
+ var el = e.target;
+
+ Util.DOM.removeEventListener(el, Util.Animation._getTransitionEndEventLabel(), Util.getElementData(el, 'transitionEndEvent'));
+ Util.removeElementData(el, 'transitionEndEvent');
+
+ var callback = Util.getElementData(el, 'transitionEndCallback');
+ Util.removeElementData(el, 'transitionEndCallback');
+
+ // Remove the tranistion
+ Util.Animation._removeTransitions(el);
+
+ if (Util.isFunction(callback)){
+
+ window.setTimeout(
+ function(){
+ callback(e);
+ },
+ Util.Animation._applyTransitionDelay
+ );
+
+ }
+
+ });
+
+
+ Util.DOM.addEventListener(el, Util.Animation._getTransitionEndEventLabel(), Util.getElementData(el, 'transitionEndEvent'));
+
+ },
+
+
+ /*
+ * Function: _removeTransitions
+ */
+ _removeTransitions: function(el){
+
+ var transitionPrefix = Util.Animation._getTransitionPrefix();
+
+ Util.DOM.setStyle(el, transitionPrefix + 'Property', '');
+ Util.DOM.setStyle(el, transitionPrefix + 'Duration', '');
+ Util.DOM.setStyle(el, transitionPrefix + 'TimingFunction', '');
+ Util.DOM.setStyle(el, transitionPrefix + 'Delay', '');
+
+ },
+
+
+ /*
+ * Function: _getTransitionEndEventLabel
+ */
+ _getTransitionEndEventLabel: function(){
+
+ return (document.documentElement.style.WebkitTransition !== undefined) ? "webkitTransitionEnd" : "transitionend";
+
+ },
+
+
+ _getTransitionPrefix: function(){
+
+ return (document.documentElement.style.WebkitTransition !== undefined) ? "webkitTransition" : (document.documentElement.style.MozTransition !== undefined) ? "MozTransition" : "transition";
+
+ },
+
+
+ /*
+ * Function: stopFade
+ */
+ stopFade: function(el){
+
+ Util.DOM.removeEventListener(
+ el,
+ Util.Animation._getTransitionEndEventLabel(),
+ Util.getElementData(el, 'transitionEndEvent')
+ );
+
+ var transitionPrefix = Util.Animation._getTransitionPrefix();
+ var currentOpacity = window.getComputedStyle(el,'').getPropertyValue('opacity');
+
+ Util.Animation._removeTransitions(el);
+
+ Util.DOM.setStyle(el, 'opacity', currentOpacity);
+
+ },
+
+
+ /*
+ * Function: fadeIn
+ * Fades an element in.
+ * Make sure the element is displayed before calling
+ */
+ fadeIn: function(el, opacity, duration, callback){
+
+ opacity = Util.coalesce(opacity, 1);
+ duration = Util.coalesce(duration, 500);
+
+ Util.setElementData(el, 'transitionEndCallback', callback);
+
+ Util.Animation._setTransition(el, 'opacity', duration + 'ms', function(el){
+
+ Util.Animation._setTransitionEndEventListener(el);
+ Util.DOM.setStyle(el, 'opacity', opacity);
+
+ });
+
+ },
+
+
+ /*
+ * Function: fadeOut
+ * Fades an element out
+ * Make sure the element is displayed before calling
+ * Does not "hide" the element when animation is over
+ */
+ fadeOut: function(el, duration, callback){
+
+ if (Util.isNothing(duration)){
+ duration = 500;
+ }
+
+ Util.setElementData(el, 'transitionEndCallback', callback);
+
+ Util.Animation._setTransition(el, 'opacity', duration + 'ms', function(el){
+
+ Util.Animation._setTransitionEndEventListener(el);
+ Util.DOM.setStyle(el, 'opacity', 0);
+
+ });
+
+ },
+
+
+
+ /*
+ * Function: slideTo
+ * Slides an element by an x,y position
+ */
+ slideBy: function(el, xPos, yPos, duration, callback){
+
+ if (Util.isNothing(duration)){
+ duration = 500;
+ }
+
+ /* Store some values against the element for later use */
+ Util.setElementData(el, 'transitionEndCallback', Util.Animation._onSlideByEnd);
+ Util.setElementData(el, 'slideByCallback', callback);
+ Util.setElementData(el, 'slideByXPos', xPos);
+ Util.setElementData(el, 'slideByYPos', yPos);
+
+ //ease-in-out
+ Util.Animation._setTransition(el, 'all', duration + 'ms', 'ease-in', 0, function(el){
+
+ Util.Animation._setTransitionEndEventListener(el);
+
+ var
+ xPos = Util.getElementData(el, 'slideByXPos'),
+ yPos = Util.getElementData(el, 'slideByYPos');
+
+ Util.removeElementData(el, 'slideByXPos');
+ Util.removeElementData(el, 'slideByYPos');
+
+ Util.DOM.setStyle(el, {
+ webkitTransform: (Util.isMobileSafari) ? 'translate3d(' + xPos + 'px, ' + yPos + 'px, 0)' : 'translate(' + xPos + 'px, ' + yPos + 'px)',
+ MozTransform: 'translate(' + xPos + 'px, ' + yPos + 'px)',
+ transform: 'translate(' + xPos + 'px, ' + yPos + 'px)'
+ });
+
+ });
+
+ },
+
+
+
+ _onSlideByEnd: function(e){
+
+ // Reset the real css top and left after the transformation
+ var
+ el = e.target,
+
+ callback = Util.getElementData(el, 'slideByCallback'),
+
+ transform = Util.coalesce(el.style.webkitTransform, el.style.MozTransform, el.style.transform),
+
+ transformExploded = transform.match( /\((.*?)\)/ )[1].split(', '),
+
+ transformedX = window.parseInt(transformExploded[0]),
+
+ transformedY = window.parseInt(transformExploded[1]),
+
+ domX = window.parseInt(Util.DOM.getStyle(el, 'left')),
+
+ domY = window.parseInt(Util.DOM.getStyle(el, 'top'));
+
+ Util.DOM.setStyle(el, {
+ webkitTransform: '',
+ MozTransform: '',
+ transform: '',
+ left: (domX + transformedX) + 'px',
+ top: (domY + transformedY) + 'px'
+ });
+
+
+ Util.removeElementData(el, 'slideByCallback');
+ Util.removeElementData(el, 'slideByXPos');
+ Util.removeElementData(el, 'slideByYPos');
+
+ if (Util.isFunction(callback)){
+ window.setTimeout(
+ function(){
+ callback(e);
+ },
+ Util.Animation._applyTransitionDelay
+ );
+ //window.setTimeout(callback, Util.Animation._applyTransitionDelay, e);
+ }
+
+ }
+
+
+ }
+
+
+ });
+
+
+})(Code.PhotoSwipe.Util);// PhotoSwipe - http://www.photoswipe.com/
+// Copyright (c) 2011 by Code Computerlove (http://www.codecomputerlove.com)
+// Licensed under the MIT license
+
+(function () {
+
+ // Based on http://www.javascriptbank.com/how-build-custom-events-javascript.html
+ Code.PhotoSwipe.EventClass = Class.extend({
+
+ _listeners: null,
+
+ init: function(){
+
+ this._listeners = {};
+
+ },
+
+
+ addEventListener: function(type, listener){
+
+ if (typeof this._listeners[type] === 'undefined'){
+ this._listeners[type] = [];
+ }
+ this._listeners[type].push(listener);
+
+ },
+
+
+ dispatchEvent: function(event){
+ if (typeof event == "string"){
+ event = { type: event };
+ }
+ if (!event.target){
+ event.target = this;
+ }
+
+ if (!event.type){
+ throw new Error("Event object missing 'type' property.");
+ }
+
+ if (this._listeners[event.type] instanceof Array){
+ var listeners = this._listeners[event.type];
+ for (var i=0, len=listeners.length; i < len; i++){
+ listeners[i].call(this, event);
+ }
+ }
+ },
+
+
+ removeEventListener: function(type, listener){
+ if (this._listeners[type] instanceof Array){
+ var listeners = this._listeners[type];
+ for (var i=0, len=listeners.length; i < len; i++){
+ if (listeners[i] === listener){
+ listeners.splice(i, 1);
+ break;
+ }
+ }
+ }
+ }
+
+ });
+
+
+})();// PhotoSwipe - http://www.photoswipe.com/
+// Copyright (c) 2011 by Code Computerlove (http://www.codecomputerlove.com)
+// Licensed under the MIT license
+
+(function (Util) {
+
+ /*
+ * Class: Code.PhotoSwipe.ElementClass
+ * Most PhotoSwipe classes inherit from this class
+ * Provides hooks for fading in and out
+ */
+ Code.PhotoSwipe.ElementClass = Code.PhotoSwipe.EventClass.extend({
+
+ el: null,
+ settings: null,
+ isFading: null,
+
+ fadeInHandler: null,
+ fadeOutHandler: null,
+
+
+ /*
+ * Function: init
+ */
+ init: function(options){
+
+ this._super();
+
+ this.settings = {
+ opacity: 1,
+ fadeSpeed: 500
+ };
+
+ Util.extend(this.settings, options);
+
+ this.isFading = false;
+
+ this.fadeInHandler = this.postFadeIn.bind(this);
+ this.fadeOutHandler = this.postFadeOut.bind(this);
+
+ },
+
+
+
+ /*
+ * Function: resetPosition
+ */
+ resetPosition: function(){
+ },
+
+
+
+ /*
+ * Function: show
+ */
+ show: function(){
+
+ if (this.el === null){
+ return;
+ }
+
+ this.stopFade();
+
+ // Set position
+ this.resetPosition();
+
+ // Show
+ Util.DOM.setStyle(this.el, 'opacity', this.settings.opacity);
+ Util.DOM.show(this.el);
+
+ this.postShow();
+
+ },
+
+
+
+ /*
+ * Function: postShow
+ * Overide this
+ */
+ postShow: function(){
+
+ this.addEventListeners();
+ this.dispatchEvent(Code.PhotoSwipe.ElementClass.EventTypes.onShow);
+
+ },
+
+
+
+ /*
+ * Function: fadeIn
+ */
+ fadeIn: function(){
+
+ if (this.el === null){
+ return;
+ }
+
+ Util.DOM.setStyle(this.el, 'opacity', 0);
+
+ this.fadeInFromCurrentOpacity();
+
+ },
+
+
+ /*
+ * Function: fadeInFromCurrentOpacity
+ */
+ fadeInFromCurrentOpacity: function(){
+
+ if (this.el === null){
+ return;
+ }
+
+ this.stopFade();
+
+ this.isFading = true;
+
+ // Set position
+ this.resetPosition();
+
+ // Fade in
+ Util.DOM.show(this.el);
+ Util.Animation.fadeIn(
+ this.el,
+ this.settings.opacity,
+ this.settings.fadeSpeed,
+ this.fadeInHandler
+ );
+
+ },
+
+
+ /*
+ * Function: postFadeIn
+ */
+ postFadeIn: function(e){
+
+ this.isFading = false;
+ this.addEventListeners();
+ this.dispatchEvent(Code.PhotoSwipe.ElementClass.EventTypes.onFadeIn);
+
+ },
+
+
+
+ /*
+ * Function: hide
+ */
+ hide: function(){
+
+ if (this.el === null){
+ return;
+ }
+
+ this.stopFade();
+
+ Util.DOM.hide(this.el);
+
+ this.postHide();
+
+ },
+
+
+ /*
+ * Function: postHide
+ * Overide this
+ */
+ postHide: function(){
+
+ this.removeEventListeners();
+ this.dispatchEvent(Code.PhotoSwipe.ElementClass.EventTypes.onHide);
+
+ },
+
+
+ /*
+ * Fuction: fadeOut
+ */
+ fadeOut: function(){
+
+ this.stopFade();
+
+ this.isFading = true;
+
+ Util.Animation.fadeOut(this.el, this.settings.fadeSpeed, this.fadeOutHandler);
+
+ },
+
+
+ /*
+ * Function: preFadeOut
+ */
+ postFadeOut: function(e){
+
+ this.isFading = false;
+
+ Util.DOM.hide(this.el);
+
+ this.removeEventListeners();
+
+ this.dispatchEvent(Code.PhotoSwipe.ElementClass.EventTypes.onFadeOut);
+
+ },
+
+
+ /*
+ * Function: stopFade
+ */
+ stopFade: function(){
+
+ if (this.el === null){
+ return;
+ }
+
+ Util.Animation.stopFade(this.el);
+ this.isFading = false;
+
+ },
+
+
+ /*
+ * Function: addEventListeners
+ */
+ addEventListeners: function(){
+
+ },
+
+
+ /*
+ * Function: removeEventListeners
+ */
+ removeEventListeners: function(){
+
+ }
+
+
+ });
+
+
+
+ Code.PhotoSwipe.ElementClass.EventTypes = {
+ onShow: 'onShow',
+ onHide: 'onHide',
+ onClick: 'onClick',
+ onFadeIn: 'onFadeIn',
+ onFadeOut: 'onFadeOut'
+ };
+
+
+})(Code.PhotoSwipe.Util);// PhotoSwipe - http://www.photoswipe.com/
+// Copyright (c) 2011 by Code Computerlove (http://www.codecomputerlove.com)
+// Licensed under the MIT license
+
+(function(Util){
+
+
+ /*
+ * Class: Code.PhotoSwipe.FullSizeImageClass
+ */
+ Code.PhotoSwipe.FullSizeImageClass = Code.PhotoSwipe.EventClass.extend({
+
+ el: null,
+ index: null,
+
+ // The naturalWidth and naturalHeight of the image as loaded from the server
+ // This maybe different from the width and height set on the img element
+ // We need this to scale the image correctly
+ naturalWidth: null,
+ naturalHeight: null,
+ src: null,
+ caption: null,
+ scaleMethod: null,
+ isLandscape: null,
+ isLoading: null,
+ hasLoaded: null,
+
+ loadEventHandler: null,
+
+
+ /*
+ * Function: init
+ */
+ init: function(index, scaleMethod, src, caption){
+
+ this._super();
+
+ this.index = index;
+ this.naturalWidth = 0;
+ this.naturalHeight = 0;
+ this.src = src;
+ this.caption = caption;
+ this.isLandscape = false;
+ this.isLoading = false;
+ this.hasLoaded = false;
+ this.scaleMethod = scaleMethod;
+
+ this.loadEventHandler = this.onLoad.bind(this);
+
+ },
+
+
+ /*
+ * Function: load
+ */
+ load: function(){
+
+ // Load in the image
+ this.isLoading = true;
+
+ this.el = new Image();
+ Util.DOM.addClass(this.el, 'ps-full-size-image');
+ this.el.onload = this.loadEventHandler;
+ this.el.src = this.src;
+
+ },
+
+
+ /*
+ * Function: onLoad
+ */
+ onLoad: function(){
+
+ this.naturalWidth = Util.coalesce(this.el.naturalWidth, this.el.width);
+ this.naturalHeight = Util.coalesce(this.el.naturalHeight, this.el.height);
+ this.isLandscape = (this.naturalWidth > this.naturalHeight);
+ this.isLoading = false;
+ this.hasLoaded = true;
+
+ this.dispatchEvent(Code.PhotoSwipe.FullSizeImageClass.EventTypes.onLoad);
+
+ }
+
+
+ });
+
+
+ Code.PhotoSwipe.FullSizeImageClass.EventTypes = {
+ onLoad: 'onLoad'
+ };
+
+
+})(Code.PhotoSwipe.Util);// PhotoSwipe - http://www.photoswipe.com/
+// Copyright (c) 2011 by Code Computerlove (http://www.codecomputerlove.com)
+// Licensed under the MIT license
+
+(function(Util){
+
+ /*
+ * Class: Code.PhotoSwipe.DocumentOverlayClass
+ */
+ Code.PhotoSwipe.DocumentOverlayClass = Code.PhotoSwipe.ElementClass.extend({
+
+ /*
+ * Function: init
+ */
+ init: function(options){
+
+ this._super(options);
+
+ // Create element and append to body
+ this.el = Util.DOM.createElement('div', { 'class': Code.PhotoSwipe.DocumentOverlayClass.CssClasses.documentOverlay }, '');
+ Util.DOM.setStyle(this.el, {
+ left: 0,
+ position: 'absolute',
+ top: 0
+ });
+ Util.DOM.hide(this.el);
+ Util.DOM.appendToBody(this.el);
+
+ },
+
+
+ /*
+ * Function: resetPosition
+ */
+ resetPosition: function(){
+
+ // Set the height and width to fill the document
+ Util.DOM.width(this.el, Util.DOM.bodyWidth());
+ Util.DOM.height(this.el, Util.DOM.bodyHeight());
+
+ }
+
+ });
+
+
+ Code.PhotoSwipe.DocumentOverlayClass.CssClasses = {
+ documentOverlay: 'ps-document-overlay'
+ };
+
+})(Code.PhotoSwipe.Util);// PhotoSwipe - http://www.photoswipe.com/
+// Copyright (c) 2011 by Code Computerlove (http://www.codecomputerlove.com)
+// Licensed under the MIT license
+
+(function(Util){
+
+ /*
+ * Class: Code.PhotoSwipe.ViewportClass
+ */
+ Code.PhotoSwipe.ViewportClass = Code.PhotoSwipe.ElementClass.extend({
+
+ touchStartPoint: null,
+ touchFingerCount: null,
+ touchCancelsMouseEvents: null,
+
+ touchStartHandler: null,
+ touchMoveHandler: null,
+ touchEndHandler: null,
+
+ mouseDownHandler: null,
+ mouseUpHandler: null,
+
+
+ /*
+ * Function: init
+ */
+ init: function(options){
+
+ this.settings = {
+ swipeThreshold: 500
+ };
+
+ Util.extend(this.settings, options);
+
+ this._super(this.settings);
+
+ this.touchFingerCount = 0;
+ this.touchStartPoint = { x: 0, y: 0 };
+ this.touchCancelsMouseEvents = false;
+
+ this.touchStartHandler = this.onTouchStart.bind(this);
+ this.touchMoveHandler = this.onTouchMove.bind(this);
+ this.touchEndHandler = this.onTouchEnd.bind(this);
+
+ this.mouseDownHandler = this.onMouseDown.bind(this);
+ this.mouseUpHandler = this.onMouseUp.bind(this);
+
+ // Create element and append to body
+ this.el = Util.DOM.createElement('div', { 'class': Code.PhotoSwipe.ViewportClass.CssClasses.viewport }, '');
+ Util.DOM.setStyle(this.el, {
+ position: 'absolute',
+ left: 0,
+ overflow: 'hidden'
+ });
+ Util.DOM.hide(this.el);
+ Util.DOM.appendToBody(this.el);
+
+ },
+
+
+ /*
+ * Function: resetPosition
+ */
+ resetPosition: function(){
+
+ // Set the height and width to fill the document
+ Util.DOM.setStyle(this.el, {
+ top: Util.DOM.windowScrollTop() + 'px'
+ });
+
+ Util.DOM.width(this.el, Util.DOM.bodyWidth());
+ Util.DOM.height(this.el, Util.DOM.windowHeight());
+
+ },
+
+
+ /*
+ * Function: addEventListeners
+ */
+ addEventListeners: function(){
+
+ try{
+ Util.DOM.addEventListener(this.el, 'touchstart', this.touchStartHandler);
+ Util.DOM.addEventListener(this.el, 'touchmove', this.touchMoveHandler);
+ Util.DOM.addEventListener(this.el, 'touchend', this.touchEndHandler);
+ }
+ catch (err){ }
+
+ Util.DOM.addEventListener(this.el, 'mousedown', this.mouseDownHandler);
+ Util.DOM.addEventListener(this.el, 'mouseup', this.mouseUpHandler);
+
+ },
+
+
+
+ /*
+ * Function: removeEventListeners
+ */
+ removeEventListeners: function(){
+
+ try{
+ Util.DOM.removeEventListener(this.el, 'touchstart', this.touchStartHandler);
+ Util.DOM.removeEventListener(this.el, 'touchmove', this.touchMoveHandler);
+ Util.DOM.removeEventListener(this.el, 'touchend', this.touchEndHandler);
+ }
+ catch (err){ }
+
+ Util.DOM.removeEventListener(this.el, 'mousedown', this.mouseDownHandler);
+ Util.DOM.removeEventListener(this.el, 'mouseup', this.mouseUpHandler);
+
+ },
+
+
+
+ /*
+ * Function: setCurrentTouchPoint
+ */
+ setCurrentTouchPoint: function(touchPoint, touches){
+
+ this.touchFingerCount = touches.length;
+
+ if (this.touchFingerCount === 1){
+ touchPoint.x = touches[0].pageX;
+ touchPoint.y = touches[0].pageY;
+ }
+ else{
+ this.touchFingerCount = 0;
+ touchPoint.x = 0;
+ touchPoint.y = 0;
+ }
+
+ },
+
+
+
+ /*
+ * Function: onTouch
+ */
+ onTouchStart: function(e){
+
+ e.preventDefault();
+
+ this.setCurrentTouchPoint(this.touchStartPoint, Util.DOM.getTouchEvent(e).touches);
+
+ },
+
+
+
+ /*
+ * Function: onTouchMove
+ * For some reason, even though it's not a requirement,
+ * if we don't listen out for the touchmove event,
+ * we are unable to detect the swipe on Blackberry6
+ */
+ onTouchMove: function(e){
+
+ e.preventDefault();
+
+ },
+
+
+
+ /*
+ * Function: onTouchEnd
+ */
+ onTouchEnd: function(e){
+
+ e.preventDefault();
+
+ var touchEndPoint = { x:0, y:0 };
+
+ var touchEvent = Util.DOM.getTouchEvent(e);
+
+ if (!Util.isNothing(touchEvent.changedTouches)){
+ // http://backtothecode.blogspot.com/2009/10/javascript-touch-and-gesture-events.html
+ // iOS removed the current touch from e.touches on "touchend"
+ // Need to look into e.changedTouches
+ this.setCurrentTouchPoint(touchEndPoint, touchEvent.changedTouches);
+ }
+ else{
+ this.setCurrentTouchPoint(touchEndPoint, touchEvent.touches);
+ }
+
+ if (this.touchFingerCount == 1){
+
+ this.fireTouchEvent(this.touchStartPoint, touchEndPoint);
+
+ }
+
+ },
+
+
+
+ /*
+ * Function: onMouseDown
+ */
+ onMouseDown: function(e){
+
+ e.preventDefault();
+ if (this.touchCancelsMouseEvents){
+ return;
+ }
+
+ this.touchStartPoint = Util.DOM.getMousePosition(e);
+
+ },
+
+
+
+ /*
+ * Function: onMouseUp
+ */
+ onMouseUp: function(e){
+
+ e.preventDefault();
+ if (this.touchCancelsMouseEvents){
+ return;
+ }
+
+ this.fireTouchEvent(this.touchStartPoint, Util.DOM.getMousePosition(e));
+
+ },
+
+
+
+ /*
+ * Function: fireTouchEvent
+ */
+ fireTouchEvent: function(touchStartPoint, touchEndPoint){
+
+ var action;
+
+ var distance = touchEndPoint.x - touchStartPoint.x;
+
+ if (Math.abs(distance) >= this.settings.swipeThreshold){
+
+ if (distance < 0){
+
+ // Swipe left
+ action = Code.PhotoSwipe.ViewportClass.Actions.swipeLeft;
+
+ }
+ else{
+
+ // Swipe right
+ action = Code.PhotoSwipe.ViewportClass.Actions.swipeRight;
+
+ }
+
+ }
+ else{
+
+ // Click
+ action = Code.PhotoSwipe.ViewportClass.Actions.click;
+
+ }
+
+ if (Util.isNothing(action)){
+ return;
+ }
+
+ this.dispatchEvent({
+ type: Code.PhotoSwipe.ViewportClass.EventTypes.onTouch,
+ target: this,
+ action: action
+ });
+
+ }
+
+ });
+
+
+ Code.PhotoSwipe.ViewportClass.CssClasses = {
+ viewport: 'ps-viewport'
+ };
+
+
+ Code.PhotoSwipe.ViewportClass.Actions = {
+ click: 'click',
+ swipeLeft: 'swipeLeft',
+ swipeRight: 'swipeRight'
+ };
+
+ Code.PhotoSwipe.ViewportClass.EventTypes = {
+ onTouch: 'onTouch'
+ };
+
+
+})(Code.PhotoSwipe.Util);
+
+// PhotoSwipe - http://www.photoswipe.com/
+// Copyright (c) 2011 by Code Computerlove (http://www.codecomputerlove.com)
+// Licensed under the MIT license
+
+(function(Util, FullSizeImageClass){
+
+ /*
+ * Class: Code.PhotoSwipe.SliderItemClass
+ */
+ Code.PhotoSwipe.SliderItemClass = Code.PhotoSwipe.EventClass.extend({
+
+ el: null,
+ imageEl: null,
+ parentEl: null,
+ fullSizeImage: null,
+
+ fullSizeImageLoadEventHandler: null,
+
+ /*
+ * Function: init
+ */
+ init: function(parentEl){
+
+ this._super();
+
+ this.parentEl = parentEl;
+
+ this.fullSizeImageLoadEventHandler = this.onFullSizeImageLoad.bind(this);
+
+ // Create element and append to parentEl
+ this.el = Util.DOM.createElement('div', { 'class': Code.PhotoSwipe.SliderItemClass.CssClasses.item + ' ' + Code.PhotoSwipe.SliderItemClass.CssClasses.loading }, '');
+ Util.DOM.setStyle(this.el, {
+ position: 'absolute',
+ top: 0
+ });
+ Util.DOM.resetTranslate(this.el);
+ Util.DOM.appendChild(this.el, this.parentEl);
+
+ // Create image element and append to slider item
+ this.imageEl = new Image();
+ Util.DOM.setStyle(this.imageEl, {
+ display: 'block',
+ position: 'absolute',
+ margin: 0,
+ padding: 0
+ });
+ Util.DOM.hide(this.imageEl);
+ Util.DOM.appendChild(this.imageEl, this.el);
+
+ },
+
+
+
+ /*
+ * Function: resetPosition
+ */
+ resetPosition: function(width, height, xPos){
+
+ Util.DOM.width(this.el, width);
+ Util.DOM.height(this.el, height);
+ Util.DOM.setStyle(this.el, 'left', xPos + 'px');
+
+ this.resetImagePosition();
+
+ },
+
+
+
+ /*
+ * Function: resetImagePosition
+ */
+ resetImagePosition: function(){
+
+ if (Util.isNothing(this.fullSizeImage)){
+ return;
+ }
+
+ var src = Util.DOM.getAttribute(this.imageEl, 'src');
+
+ var
+ scale,
+ newWidth,
+ newHeight,
+ newTop,
+ newLeft,
+ maxWidth = Util.DOM.width(this.el),
+ maxHeight = Util.DOM.height(this.el);
+
+ if (this.fullSizeImage.isLandscape) {
+ // Ensure the width fits the screen
+ scale = maxWidth / this.fullSizeImage.naturalWidth;
+ }
+ else {
+ // Ensure the height fits the screen
+ scale = maxHeight / this.fullSizeImage.naturalHeight;
+ }
+
+ newWidth = Math.round(this.fullSizeImage.naturalWidth * scale);
+ newHeight = Math.round(this.fullSizeImage.naturalHeight * scale);
+
+ if (this.fullSizeImage.scaleMethod === 'fit') {
+ // Rescale again to ensure full image fits into the viewport
+ scale = 1;
+ if (newWidth > maxWidth) {
+ scale = maxWidth / newWidth;
+ }
+ else if (newHeight > maxHeight) {
+ scale = maxHeight / newHeight;
+ }
+ if (scale !== 1) {
+ newWidth = Math.round(newWidth * scale);
+ newHeight = Math.round(newHeight * scale);
+ }
+ }
+
+ newTop = ((maxHeight - newHeight) / 2) + 'px';
+ newLeft = ((maxWidth - newWidth) / 2) + 'px';
+
+ Util.DOM.width(this.imageEl, newWidth);
+ Util.DOM.height(this.imageEl, newHeight);
+ Util.DOM.setStyle(this.imageEl, {
+ top: newTop,
+ left: newLeft
+ });
+
+ Util.DOM.show(this.imageEl);
+
+ },
+
+
+
+ /*
+ * Function: setFullSizeImage
+ */
+ setFullSizeImage: function(fullSizeImage){
+
+ this.fullSizeImage = fullSizeImage;
+
+ Util.DOM.removeClass(this.el, Code.PhotoSwipe.SliderItemClass.CssClasses.loading);
+ Util.DOM.removeClass(this.el, Code.PhotoSwipe.SliderItemClass.CssClasses.imageError);
+
+ // Something is wrong!
+ if (Util.isNothing(this.fullSizeImage)) {
+ this.fullSizeImage = null;
+ Util.DOM.addClass(this.el, Code.PhotoSwipe.SliderItemClass.CssClasses.imageError);
+ this.hideImage();
+ return;
+ }
+
+ // Still loading
+ if (!this.fullSizeImage.hasLoaded) {
+
+ Util.DOM.addClass(this.el, Code.PhotoSwipe.SliderItemClass.CssClasses.loading);
+ this.hideImage();
+
+ if (!this.fullSizeImage.isLoading){
+
+ // Trigger off the load
+ this.fullSizeImage.addEventListener(
+ FullSizeImageClass.EventTypes.onLoad,
+ this.fullSizeImageLoadEventHandler
+ );
+
+
+ this.fullSizeImage.load();
+
+ }
+
+ return;
+
+ }
+
+ // Loaded so show the image
+ Util.DOM.setAttribute(this.imageEl, 'src', this.fullSizeImage.src);
+
+ this.resetImagePosition();
+
+ this.dispatchEvent(Code.PhotoSwipe.SliderItemClass.EventTypes.onFullSizeImageDisplay);
+
+ },
+
+
+ /*
+ * Function: onFullSizeImageLoad
+ */
+ onFullSizeImageLoad: function(e){
+
+ e.target.removeEventListener(FullSizeImageClass.EventTypes.onLoad, this.fullSizeImageLoadEventHandler);
+
+ if (Util.isNothing(this.fullSizeImage) || e.target.index !== this.fullSizeImage.index){
+ // Chances are the user has moved the slider
+ // and the image to display in the item has now changed
+ // from when the item originally called the fullSizeImage
+ // to load. If that's the case, rethrow the event, the
+ // slider will be listening for this and can find a
+ // relevant slideitem for the loaded image
+ this.dispatchEvent({
+ type: Code.PhotoSwipe.SliderItemClass.EventTypes.onFullSizeImageLoadAnomaly,
+ target: this,
+ fullSizeImage: e.target
+ });
+ }
+ else{
+ this.setFullSizeImage(e.target);
+ }
+
+ },
+
+
+ /*
+ * Function: hideImage
+ */
+ hideImage: function(){
+
+ Util.DOM.removeAttribute(this.imageEl, 'src');
+ Util.DOM.hide(this.imageEl);
+
+ }
+
+
+ });
+
+
+ Code.PhotoSwipe.SliderItemClass.CssClasses = {
+ item: 'ps-slider-item',
+ loading: 'ps-slider-item-loading',
+ imageError: 'ps-slider-item-image-error'
+ };
+
+
+ Code.PhotoSwipe.SliderItemClass.EventTypes = {
+ onFullSizeImageDisplay: 'onFullSizeImageDisplay',
+ onFullSizeImageLoadAnomaly: 'onFullSizeImageLoadAnomaly'
+ };
+
+
+})(Code.PhotoSwipe.Util, Code.PhotoSwipe.FullSizeImageClass);// PhotoSwipe - http://www.photoswipe.com/
+// Copyright (c) 2011 by Code Computerlove (http://www.codecomputerlove.com)
+// Licensed under the MIT license
+
+(function(Util, SliderItemClass){
+
+ /*
+ * Class: Code.PhotoSwipe.SliderClass
+ */
+ Code.PhotoSwipe.SliderClass = Code.PhotoSwipe.ElementClass.extend({
+
+ parentEl: null,
+ parentElWidth: null,
+ parentElHeight: null,
+ items: null,
+
+ previousItem: null,
+ currentItem: null,
+ nextItem: null,
+
+ hasBounced: null,
+ lastShowAction: null,
+ bounceSlideBy: null,
+
+ showNextEndEventHandler: null,
+ showPreviousEndEventHandler: null,
+ bounceStepOneEventHandler: null,
+ bounceStepTwoEventHandler: null,
+
+ sliderFullSizeImageLoadAnomalyEventHandler: null,
+
+
+ /*
+ * Function: init
+ */
+ init: function(options, parentEl){
+
+ this.settings = {
+ slideSpeed: 250
+ };
+
+ Util.extend(this.settings, options);
+
+ this._super(this.settings);
+
+ this.parentEl = parentEl;
+
+ this.hasBounced = false;
+
+ this.showNextEndEventHandler = this.onShowNextEnd.bind(this);
+ this.showPreviousEndEventHandler = this.onShowPreviousEnd.bind(this);
+ this.bounceStepOneEventHandler = this.onBounceStepOne.bind(this);
+ this.bounceStepTwoEventHandler = this.onBounceStepTwo.bind(this);
+
+ this.sliderFullSizeImageLoadAnomalyEventHandler = this.onSliderFullSizeImageLoadAnomaly.bind(this);
+
+ // Create element and append to body
+ this.el = Util.DOM.createElement('div', { 'class': Code.PhotoSwipe.SliderClass.CssClasses.slider }, '');
+ Util.DOM.setStyle(this.el, {
+ position: 'absolute',
+ top: 0
+ });
+ Util.DOM.hide(this.el);
+ Util.DOM.appendChild(this.el, parentEl);
+
+ // Create previousItem, currentItem, nextItem
+ this.items = [];
+ this.items.push(new SliderItemClass(this.el));
+ this.items.push(new SliderItemClass(this.el));
+ this.items.push(new SliderItemClass(this.el));
+
+ this.previousItem = this.items[0];
+ this.currentItem = this.items[1];
+ this.nextItem = this.items[2];
+
+ },
+
+
+ /*
+ * Function: addEventListeners
+ */
+ addEventListeners: function(){
+
+ for (var i = 0; i 0){
+
+ this.fadeOutTimeout = window.setTimeout(
+ this.fadeOut.bind(this),
+ this.settings.captionDelay
+ );
+
+ }
+
+ this._super();
+
+ }
+
+ });
+
+
+ Code.PhotoSwipe.CaptionClass.CssClasses = {
+ caption: 'ps-caption',
+ bottom: 'ps-caption-bottom',
+ content: 'ps-caption-content'
+ };
+
+})(Code.PhotoSwipe.Util);// PhotoSwipe - http://www.photoswipe.com/
+// Copyright (c) 2011 by Code Computerlove (http://www.codecomputerlove.com)
+// Licensed under the MIT license
+
+(function(Util){
+
+ /*
+ * Class: Code.PhotoSwipe.ToolbarClass
+ */
+ Code.PhotoSwipe.ToolbarClass = Code.PhotoSwipe.ElementClass.extend({
+
+ closeEl: null,
+ previousEl: null,
+ nextEl: null,
+ playEl: null,
+
+ clickHandler: null,
+
+ fadeOutTimeout: null,
+ isNextActive: null,
+ isPreviousActive: null,
+
+
+ /*
+ * Function: init
+ */
+ init: function(options){
+
+ this.settings = {
+ toolbarDelay: 4000,
+ position: 'bottom'
+ };
+
+ Util.extend(this.settings, options);
+
+ this._super(options);
+
+ this.isNextActive = true;
+ this.isPreviousActive = true;
+
+ this.clickHandler = this.onClick.bind(this);
+
+ // Create element and append to body
+ var cssClass = Code.PhotoSwipe.ToolbarClass.CssClasses.caption;
+ if (this.settings.position === 'top'){
+ cssClass = cssClass + ' ' + Code.PhotoSwipe.ToolbarClass.CssClasses.top;
+ }
+
+ this.el = Util.DOM.createElement('div', { 'class': cssClass }, '');
+ Util.DOM.setStyle(this.el, {
+ left: 0,
+ position: 'absolute',
+ overflow: 'hidden',
+ zIndex: 1001,
+ display: 'table'
+ });
+ Util.DOM.hide(this.el);
+ Util.DOM.appendToBody(this.el);
+
+ // Close
+ this.closeEl = Util.DOM.createElement('div', { 'class': Code.PhotoSwipe.ToolbarClass.CssClasses.close }, '
');
+ Util.DOM.appendChild(this.closeEl, this.el);
+
+ // Play
+ this.playEl = Util.DOM.createElement('div', { 'class': Code.PhotoSwipe.ToolbarClass.CssClasses.play }, '
');
+ Util.DOM.appendChild(this.playEl, this.el);
+
+ // Previous
+ this.previousEl = Util.DOM.createElement('div', { 'class': Code.PhotoSwipe.ToolbarClass.CssClasses.previous }, '
');
+ Util.DOM.appendChild(this.previousEl, this.el);
+
+ // Next
+ this.nextEl = Util.DOM.createElement('div', { 'class': Code.PhotoSwipe.ToolbarClass.CssClasses.next }, '
');
+ Util.DOM.appendChild(this.nextEl, this.el);
+
+ },
+
+
+ /*
+ * Function: addEventListeners
+ */
+ addEventListeners: function(){
+
+ Util.DOM.addEventListener(this.el, 'click', this.clickHandler);
+
+ },
+
+
+ /*
+ * Function: removeEventListeners
+ */
+ removeEventListeners: function(){
+
+ Util.DOM.removeEventListener(this.el, 'click', this.clickHandler);
+
+ },
+
+
+ /*
+ * Function: onClick
+ */
+ onClick: function(e){
+
+ var action;
+
+ switch(e.target.parentNode){
+
+ case this.previousEl:
+ if (this.isPreviousActive){
+ action = Code.PhotoSwipe.ToolbarClass.Actions.previous;
+ }
+ break;
+
+ case this.nextEl:
+ if (this.isNextActive){
+ action = Code.PhotoSwipe.ToolbarClass.Actions.next;
+ }
+ break;
+
+ case this.playEl:
+ action = Code.PhotoSwipe.ToolbarClass.Actions.play;
+ break;
+
+ case this.closeEl:
+ action = Code.PhotoSwipe.ToolbarClass.Actions.close;
+ break;
+ }
+
+ if (Util.isNothing(action)){
+ return;
+ }
+
+ this.dispatchEvent({
+ type: Code.PhotoSwipe.ToolbarClass.EventTypes.onClick,
+ target: this,
+ action: action
+ });
+
+ },
+
+
+
+ /*
+ * Function: resetPosition
+ */
+ resetPosition: function(){
+
+ var top;
+
+ if (this.settings.position === 'bottom') {
+ top = Util.DOM.windowHeight() - Util.DOM.height(this.el) + Util.DOM.windowScrollTop();
+ }
+ else {
+ top = Util.DOM.windowScrollTop();
+ }
+
+ Util.DOM.setStyle(this.el, 'top', top + 'px');
+ Util.DOM.width(this.el, Util.DOM.bodyWidth());
+
+ },
+
+
+
+ /*
+ * Function: stopFade
+ */
+ stopFade: function(){
+
+ window.clearTimeout(this.fadeOutTimeout);
+ this._super();
+
+ },
+
+
+
+ /*
+ * Function: postShow
+ */
+ postShow: function(){
+
+ if (this.settings.toolbarDelay > 0){
+
+ this.fadeOutTimeout = window.setTimeout(
+ this.fadeOut.bind(this),
+ this.settings.toolbarDelay
+ );
+
+ }
+
+ this._super();
+
+ },
+
+
+ /*
+ * Function: setNextState
+ */
+ setNextState: function (disable) {
+
+ if (disable) {
+ Util.DOM.addClass(this.nextEl, Code.PhotoSwipe.ToolbarClass.CssClasses.nextDisabled);
+ this.isNextActive = false;
+ }
+ else {
+ Util.DOM.removeClass(this.nextEl, Code.PhotoSwipe.ToolbarClass.CssClasses.nextDisabled);
+ this.isNextActive = true;
+ }
+
+ },
+
+
+ /*
+ * Function: setPreviousState
+ */
+ setPreviousState: function (disable) {
+
+ if (disable) {
+ Util.DOM.addClass(this.previousEl, Code.PhotoSwipe.ToolbarClass.CssClasses.previousDisabled);
+ this.isPreviousActive = false;
+ }
+ else {
+ Util.DOM.removeClass(this.previousEl, Code.PhotoSwipe.ToolbarClass.CssClasses.previousDisabled);
+ this.isPreviousActive = true;
+ }
+
+ }
+
+ });
+
+
+
+ Code.PhotoSwipe.ToolbarClass.CssClasses = {
+ caption: 'ps-toolbar',
+ top: 'ps-toolbar-top',
+ close: 'ps-toolbar-close',
+ previous: 'ps-toolbar-previous',
+ previousDisabled: 'ps-toolbar-previous-disabled',
+ next: 'ps-toolbar-next',
+ nextDisabled: 'ps-toolbar-next-disabled',
+ play: 'ps-toolbar-play',
+ content: 'ps-toolbar-content'
+ };
+
+
+
+ Code.PhotoSwipe.ToolbarClass.Actions = {
+ close: 'close',
+ previous: 'previous',
+ next: 'next',
+ play: 'play'
+ };
+
+
+ Code.PhotoSwipe.ToolbarClass.EventTypes = {
+ onClick: 'onClick'
+ };
+
+})(Code.PhotoSwipe.Util);
+ // PhotoSwipe - http://www.photoswipe.com/
+// Copyright (c) 2011 by Code Computerlove (http://www.codecomputerlove.com)
+// Licensed under the MIT license
+
+(function(Util, ElementClass, DocumentOverlayClass, FullSizeImageClass, ViewportClass, SliderClass, CaptionClass, ToolbarClass){
+
+ var photoSwipe = Code.PhotoSwipe.EventClass.extend({
+
+ fullSizeImages: null,
+
+ documentOverlay: null,
+ viewport: null,
+ slider: null,
+ caption: null,
+ toolbar: null,
+
+ settings: null,
+ slideShowSettingsSaved: null,
+ currentIndex: null,
+ isBusy: null,
+
+ slideshowTimeout: null,
+
+
+ documentOverlayFadeInEventHandler: null,
+ windowResizeEventHandler: null,
+ windowOrientationChangeEventHandler: null,
+ windowScrollEventHandler: null,
+ keyDownEventHandler: null,
+ viewportTouchEventHandler: null,
+ viewportFadeOutEventHandler: null,
+ sliderDisplayCurrentFullSizeImageEventHandler: null,
+ toolbarClickEventHandler: null,
+
+
+ /*
+ * Function: init
+ */
+ init: function(){
+
+ this._super();
+
+ this.currentIndex = 0;
+ this.isBusy = false;
+
+ this.settings = {
+ getImageSource: Code.PhotoSwipe.GetImageSource,
+ getImageCaption: Code.PhotoSwipe.GetImageCaption,
+ fadeSpeed: 400,
+ slideSpeed: 250,
+ swipeThreshold: 50,
+ loop: true,
+
+ flipCaptionAndToolbar: false,
+
+ captionDelay: 3000,
+ captionOpacity: 0.8,
+ hideCaption: false,
+ showEmptyCaptions: true,
+
+ toolbarDelay: 3000,
+ toolbarOpacity: 0.8,
+ hideToolbar: false,
+
+ slideshowDelay: 3000,
+
+ imageScaleMethod: 'fit' // Either "fit" or "zoom"
+ };
+
+ // Set pointers to event handlers
+ this.documentOverlayFadeInEventHandler = this.onDocumentOverlayFadeIn.bind(this);
+ this.windowResizeEventHandler = this.onWindowResize.bind(this);
+ this.windowOrientationChangeEventHandler = this.onWindowOrientationChange.bind(this);
+ this.windowScrollEventHandler = this.onWindowScroll.bind(this);
+ this.keyDownEventHandler = this.onKeyDown.bind(this);
+ this.viewportTouchEventHandler = this.onViewportTouch.bind(this);
+ this.viewportFadeOutEventHandler = this.onViewportFadeOut.bind(this);
+ this.sliderDisplayCurrentFullSizeImageEventHandler = this.onSliderDisplayCurrentFullSizeImage.bind(this);
+ this.toolbarClickEventHandler = this.onToolbarClick.bind(this);
+
+ },
+
+
+
+ /*
+ * Function: setOptions
+ */
+ setOptions: function(options){
+
+ Util.extend(this.settings, options);
+
+ },
+
+
+
+ /*
+ * Function: setImages
+ * Set images from DOM elements. Could be a list of image
+ * elments or anchors containing image elements etc.
+ * By default the gallery assumes the latter. If you change
+ * this, remember to set your own getImageSource and getImageCaption
+ * methods so the gallery knows what to look for.
+ */
+ setImages: function(thumbEls){
+
+ if (!Util.isArray){
+ throw "thumbEls is not an array";
+ }
+
+ this.currentIndex = 0;
+
+ this.fullSizeImages = [];
+
+ for (var i=0; i= this.fullSizeImages.length){
+ startingIndex = 0;
+ }
+
+ this.currentIndex = startingIndex;
+
+ if (Util.isNothing(this.documentOverlay)){
+ this.build();
+ }
+
+ // Fade in the document overlay,
+ // then show the viewport, slider and toolbar etc
+ this.documentOverlay.addEventListener(
+ ElementClass.EventTypes.onFadeIn,
+ this.documentOverlayFadeInEventHandler
+ );
+
+ this.documentOverlay.fadeIn();
+
+ },
+
+
+
+ /*
+ * Function: build
+ */
+ build: function(){
+
+ // Create the document overlay
+ this.documentOverlay = new DocumentOverlayClass({
+ opacity: 1,
+ fadeSpeed: this.settings.fadeSpeed
+ });
+
+ // Create the viewport
+ this.viewport = new ViewportClass({
+ opacity: 1,
+ fadeSpeed: this.settings.fadeSpeed,
+ swipeThreshold: this.settings.swipeThreshold
+ });
+
+ // Create the slider
+ this.slider = new SliderClass(
+ {
+ opacity: 1,
+ fadeSpeed: this.settings.fadeSpeed,
+ slideSpeed: this.settings.slideSpeed
+ },
+ this.viewport.el
+ );
+
+ // Create the caption bar
+ this.caption = new CaptionClass({
+ opacity: this.settings.captionOpacity,
+ fadeSpeed: this.settings.fadeSpeed,
+ captionDelay: this.settings.captionDelay,
+ position: (this.settings.flipCaptionAndToolbar) ? 'bottom' : 'top'
+ });
+
+
+ // Create the toolbar
+ this.toolbar = new ToolbarClass({
+ opacity: this.settings.toolbarOpacity,
+ fadeSpeed: this.settings.fadeSpeed,
+ toolbarDelay: this.settings.toolbarDelay,
+ position: (this.settings.flipCaptionAndToolbar) ? 'top' : 'bottom'
+ });
+
+ },
+
+
+
+ /*
+ * Function: addEventListeners
+ */
+ addEventListeners: function(){
+
+ // Set window size handlers
+ if (!Util.isNothing(window.orientation)){
+ Util.DOM.addEventListener(window, 'orientationchange', this.windowOrientationChangeEventHandler);
+ }
+ Util.DOM.addEventListener(window, 'resize', this.windowResizeEventHandler);
+
+ Util.DOM.addEventListener(window, 'scroll', this.windowScrollEventHandler);
+
+ // Set keydown event handlers for desktop browsers
+ Util.DOM.addEventListener(document, 'keydown', this.keyDownEventHandler);
+
+ // Set viewport handlers
+ this.viewport.addEventListener(ViewportClass.EventTypes.onTouch, this.viewportTouchEventHandler);
+
+ // Set slider handlers
+ this.slider.addEventListener(SliderClass.EventTypes.onDisplayCurrentFullSizeImage, this.sliderDisplayCurrentFullSizeImageEventHandler);
+
+ // Set toolbar handlers
+ this.toolbar.addEventListener(ToolbarClass.EventTypes.onClick, this.toolbarClickEventHandler);
+
+ },
+
+
+
+ /*
+ * Function: removeEventListeners
+ */
+ removeEventListeners: function(){
+
+ // Remove window size handlers
+ if (!Util.isNothing(window.orientation)){
+ Util.DOM.removeEventListener(window, 'orientationchange', this.windowOrientationChangeEventHandler);
+ }
+
+ Util.DOM.removeEventListener(window, 'resize', this.windowResizeEventHandler);
+
+ Util.DOM.removeEventListener(window, 'scroll', this.windowScrollEventHandler);
+
+ // Remove keydown event handlers for desktop browsers
+ Util.DOM.removeEventListener(document, 'keydown', this.keyDownEventHandler);
+
+ // Remove viewport handlers
+ this.viewport.removeEventListener(ViewportClass.EventTypes.onTouch, this.viewportTouchEventHandler);
+
+ // Remove slider handlers
+ this.slider.removeEventListener(SliderClass.EventTypes.onDisplayCurrentFullSizeImage, this.sliderDisplayCurrentFullSizeImageEventHandler);
+
+ // Remove toolbar handlers
+ this.toolbar.removeEventListener(ToolbarClass.EventTypes.onClick, this.toolbarClickEventHandler);
+
+ },
+
+
+
+ /*
+ * Function: onDocumentOverlayFadeIn
+ */
+ onDocumentOverlayFadeIn: function(e){
+
+ // Remove the ElementClass.EventTypes.onFadeIn
+ // event handler
+ this.documentOverlay.removeEventListener(
+ ElementClass.EventTypes.onFadeIn,
+ this.documentOverlayFadeInEventHandler
+ );
+
+ this.viewport.show();
+
+ this.slider.show();
+
+ this.toolbar.show();
+
+ this.addEventListeners();
+
+ this.slider.setCurrentFullSizeImage(this.fullSizeImages[this.currentIndex]);
+
+ this.isBusy = false;
+
+ },
+
+
+ /*
+ * Function: setSliderPreviousAndNextFullSizeImages
+ */
+ setSliderPreviousAndNextFullSizeImages: function(){
+
+ var
+ lastIndex,
+ previousFullSizeImage = null,
+ nextFullSizeImage = null;
+
+ if (this.fullSizeImages.length > 1) {
+
+ lastIndex = this.fullSizeImages.length - 1;
+
+ // Current image is the last
+ if (this.currentIndex === lastIndex) {
+
+ if (this.settings.loop) {
+ nextFullSizeImage = this.fullSizeImages[0];
+ }
+ previousFullSizeImage = this.fullSizeImages[this.currentIndex - 1];
+
+ }
+
+ // Current image is the first
+ else if (this.currentIndex === 0) {
+
+ nextFullSizeImage = this.fullSizeImages[this.currentIndex + 1];
+ if (this.settings.loop) {
+ previousFullSizeImage = this.fullSizeImages[lastIndex];
+ }
+
+ }
+
+ // Current image is in the middle of the thumbs
+ else {
+
+ nextFullSizeImage = this.fullSizeImages[this.currentIndex + 1];
+ previousFullSizeImage = this.fullSizeImages[this.currentIndex - 1];
+
+ }
+
+ }
+
+ this.slider.setPreviousAndNextFullSizeImages(previousFullSizeImage, nextFullSizeImage);
+
+ },
+
+
+
+ /*
+ * Function: onWindowResize
+ */
+ onWindowResize: function(e){
+
+ this.resetPosition();
+
+ },
+
+
+
+ /*
+ * Function: onKeyDown
+ */
+ onKeyDown: function(e){
+
+ if (e.keyCode === 37) { // Left
+ e.preventDefault();
+ this.showPrevious();
+ }
+ else if (e.keyCode === 39) { // Right
+ e.preventDefault();
+ this.showNext();
+ }
+ else if (e.keyCode === 38 || e.keyCode === 40) { // Up and down
+ e.preventDefault();
+ }
+ else if (e.keyCode === 27) { // Escape
+ e.preventDefault();
+ //this.pause();
+ this.hide();
+ }
+ else if (e.keyCode === 32) { // Spacebar
+ e.preventDefault();
+ }
+
+ },
+
+
+
+ /*
+ * Function: onWindowOrientationChange
+ */
+ onWindowOrientationChange: function(e){
+
+ this.resetPosition();
+
+ },
+
+
+
+ /*
+ * Function: onWindowScroll
+ */
+ onWindowScroll: function(e){
+
+ this.resetPosition();
+
+ },
+
+
+
+ /*
+ * Function: resetPosition
+ */
+ resetPosition: function(){
+
+ if (this.isBusy){
+ return;
+ }
+
+ this.documentOverlay.resetPosition();
+ this.viewport.resetPosition();
+ this.slider.resetPosition();
+ this.caption.resetPosition();
+ this.toolbar.resetPosition();
+
+ },
+
+
+
+ /*
+ * Function: onViewportClick
+ */
+ onViewportTouch: function(e){
+
+ switch(e.action){
+
+ case ViewportClass.Actions.swipeLeft:
+ this.showNext();
+ break;
+
+ case ViewportClass.Actions.swipeRight:
+ this.showPrevious();
+ break;
+
+ default:
+ if (this.isSlideShowActive() || !this.settings.hideToolbar){
+ this.showCaptionAndToolbar();
+ }
+ else{
+ this.hide();
+ }
+ break;
+
+ }
+
+ },
+
+
+
+ /*
+ * Function: onViewportFadeOut
+ */
+ onViewportFadeOut: function(e){
+
+ this.viewport.removeEventListener(ElementClass.EventTypes.onFadeOut, this.viewportFadeOutEventHandler);
+
+ this.isBusy = false;
+
+ },
+
+
+
+ /*
+ * Function: hide
+ */
+ hide: function(){
+
+ if (this.isBusy){
+ return;
+ }
+
+ this.isBusy = true;
+
+ this.removeEventListeners();
+
+ this.documentOverlay.hide();
+ this.caption.hide();
+ this.toolbar.hide();
+ this.slider.hide();
+
+ Util.DOM.removeClass(document.body, Code.PhotoSwipe.CssClasses.activeBody);
+
+ this.viewport.addEventListener(ElementClass.EventTypes.onFadeOut, this.viewportFadeOutEventHandler);
+
+ this.viewport.fadeOut();
+
+ },
+
+
+
+ /*
+ * Function: showNext
+ */
+ showNext: function(){
+
+ if (this.isBusy){
+ return;
+ }
+
+ this.isBusy = true;
+
+ this.caption.setEmptyCaption();
+
+ this.slider.showNext();
+
+ },
+
+
+
+ /*
+ * Function: showPrevious
+ */
+ showPrevious: function(){
+
+ if (this.isBusy){
+ return;
+ }
+
+ this.isBusy = true;
+
+ this.caption.setEmptyCaption();
+
+ this.slider.showPrevious();
+
+ },
+
+
+
+
+ /*
+ * Function: onSliderDisplayCurrentFullSizeImage
+ */
+ onSliderDisplayCurrentFullSizeImage: function(e){
+
+ this.currentIndex = e.fullSizeImage.index;
+
+ // Set the previous and next images for the slider
+ this.setSliderPreviousAndNextFullSizeImages();
+
+ this.isBusy = false;
+
+ if (this.isSlideShowActive()){
+ if (!this.settings.loop && this.currentIndex === this.fullSizeImages.length-1){
+ // Slideshow as reached the end
+ this.slideshowTimeout = window.setTimeout(
+ this.showCaptionAndToolbar.bind(this),
+ this.settings.slideshowDelay
+ );
+ }
+ else{
+ this.fireSlideshowTimeout();
+ }
+ }
+ else{
+ this.showCaptionAndToolbar();
+ }
+
+ },
+
+
+ /*
+ * Function: showCaptionAndToolbar
+ */
+ showCaptionAndToolbar: function(captionValue){
+
+ this.stopSlideshow();
+
+
+ // Caption
+ if (this.settings.hideCaption){
+ this.caption.hide();
+ }
+ else{
+ captionValue = Util.coalesce(captionValue, this.fullSizeImages[this.currentIndex].caption);
+
+ if ( (Util.isNothing(captionValue) || captionValue === '') && !this.settings.showEmptyCaptions ){
+ this.caption.hide();
+ return;
+ }
+
+ this.caption.show(captionValue);
+ }
+
+
+
+ // Toolbar
+ if (this.settings.hideToolbar){
+ this.toolbar.hide();
+ }
+ else{
+ if (this.settings.loop) {
+ this.toolbar.setNextState(false);
+ this.toolbar.setPreviousState(false);
+ }
+ else{
+ if (this.currentIndex >= this.fullSizeImages.length - 1) {
+ this.toolbar.setNextState(true);
+ }
+ else {
+ this.toolbar.setNextState(false);
+ }
+
+ if (this.currentIndex < 1) {
+ this.toolbar.setPreviousState(true);
+ }
+ else {
+ this.toolbar.setPreviousState(false);
+ }
+ }
+
+ this.toolbar.show();
+ }
+
+ },
+
+
+
+ /*
+ * Function: onToolbarClick
+ */
+ onToolbarClick: function(e){
+
+ switch (e.action){
+
+ case ToolbarClass.Actions.previous:
+ this.showPrevious();
+ break;
+
+ case ToolbarClass.Actions.next:
+ this.showNext();
+ break;
+
+ case ToolbarClass.Actions.play:
+ this.startSlideshow();
+ break;
+
+ default:
+ this.hide();
+ break;
+
+ }
+
+ },
+
+
+
+ /*
+ * Function: startSlideshow
+ */
+ startSlideshow: function(){
+
+ if (this.isBusy){
+ return;
+ }
+
+ window.clearTimeout(this.slideshowTimeout);
+
+ this.slideShowSettingsSaved = {
+ hideCaption: this.settings.hideCaption,
+ hideToolbar: this.settings.hideToolbar
+ };
+
+ this.settings.hideCaption = true;
+ this.settings.hideToolbar = true;
+
+ this.caption.fadeOut();
+ this.toolbar.fadeOut();
+
+ this.fireSlideshowTimeout();
+
+ },
+
+
+
+ /*
+ * Function: stopSlideshow
+ */
+ stopSlideshow: function(){
+
+ if (!this.isSlideShowActive()){
+ return;
+ }
+
+ window.clearTimeout(this.slideshowTimeout);
+
+ this.settings.hideCaption = this.slideShowSettingsSaved.hideCaption;
+ this.settings.hideToolbar = this.slideShowSettingsSaved.hideToolbar;
+
+ this.slideShowSettingsSaved = null;
+
+ },
+
+
+ /*
+ * Function: isSlideShowActive
+ */
+ isSlideShowActive: function(){
+
+ return (!Util.isNothing(this.slideShowSettingsSaved));
+
+ },
+
+
+ /*
+ * Function: fireSlideshowTimeout
+ */
+ fireSlideshowTimeout: function(){
+
+ this.slideshowTimeout = window.setTimeout(
+ this.showNext.bind(this),
+ this.settings.slideshowDelay
+ );
+
+ }
+
+
+ });
+
+
+ Code.PhotoSwipe.CssClasses = {
+ activeBody: 'ps-active'
+ };
+
+ /*
+ * Function: Code.PhotoSwipe.GetImageSource
+ * Default method for returning an image's source
+ */
+ Code.PhotoSwipe.GetImageSource = function(el){
+ return el.href;
+ };
+
+
+
+ /*
+ * Function: Code.PhotoSwipe.GetImageCaption
+ * Default method for returning an image's caption
+ * Assumes the el is an anchor and the first child is the
+ * image. The returned value is the "alt" attribute of the
+ * image.
+ */
+ Code.PhotoSwipe.GetImageCaption = function(el){
+ if (el.nodeName === "IMG"){
+ return Util.DOM.getAttribute(el, 'alt');
+ }
+ return Util.DOM.getAttribute(el.firstChild, 'alt');
+ };
+
+
+ Code.PhotoSwipe.Current = new photoSwipe();
+
+
+ Code.photoSwipe = function(thumbEls, containerEl, opts){
+
+ var useEventDelegation = true;
+
+ if (Util.isNothing(thumbEls)){
+ return;
+ }
+
+ /* See if there is a container element, if so we will use event delegation */
+
+ if (Util.isNothing(containerEl)){
+ containerEl = document.documentElement;
+ useEventDelegation = false;
+ }
+
+ if (Util.isString(containerEl)){
+ containerEl = document.documentElement.querySelector(containerEl);
+ }
+
+ if (Util.isNothing(containerEl)){
+ throw 'Unable to find container element';
+ }
+
+ if (Util.isString(thumbEls)){
+ thumbEls = containerEl.querySelectorAll(thumbEls);
+ }
+
+ if (Util.isNothing(thumbEls)){
+ return;
+ }
+
+
+ // Set up the options
+ Code.PhotoSwipe.Current.setOptions(opts);
+
+
+ // Tell PhotoSwipe about the photos
+ Code.PhotoSwipe.Current.setImages(thumbEls);
+
+
+ if (useEventDelegation){
+
+ /*
+ * Use event delegation rather than setting a click event on each
+ * thumb element.
+ */
+ containerEl.addEventListener('click', function(e){
+
+ if (e.target === e.currentTarget){
+ return;
+ }
+
+ e.preventDefault();
+
+ var findNode = function(clickedEl, targetNodeName, stopAtEl){
+
+ if (Util.isNothing(clickedEl) || Util.isNothing(targetNodeName) || Util.isNothing(stopAtEl)){
+ return null;
+ }
+
+ if (clickedEl.nodeName === targetNodeName){
+ return clickedEl;
+ }
+
+ if (clickedEl === stopAtEl){
+ return null;
+ }
+
+ return findNode(clickedEl.parentNode, targetNodeName, stopAtEl)
+ };
+
+
+ var clickedEl = findNode(e.target, thumbEls[0].nodeName, e.currentTarget);
+
+ if (Util.isNothing(clickedEl)){
+ return;
+ }
+
+ showPhotoSwipe(clickedEl);
+
+ }, false);
+
+ }
+ else{
+
+ // Add a click event handler on each element
+ for (var i = 0; i < thumbEls.length; i++){
+
+ var thumbEl = thumbEls[i];
+ thumbEl.addEventListener('click', function(e){
+
+ e.preventDefault();
+
+ showPhotoSwipe(e.currentTarget);
+
+ }, false);
+
+ }
+
+ }
+
+
+ var showPhotoSwipe = function(clickedEl){
+
+ var startingIndex = 0;
+ for (startingIndex; startingIndex < thumbEls.length; startingIndex++){
+ if (thumbEls[startingIndex] === clickedEl){
+ break;
+ }
+ }
+
+ Code.PhotoSwipe.Current.show(startingIndex);
+
+ };
+
+ };
+
+
+
+ /*
+ * jQuery plugin
+ */
+ if (!Util.isNothing(window.jQuery)){
+
+ window.jQuery.fn.photoSwipe = function (opts) {
+
+ var thumbEls = this;
+ Code.PhotoSwipe.Current.setOptions(opts);
+ Code.PhotoSwipe.Current.setImages(thumbEls);
+
+ $(thumbEls).live('click', function(e){
+
+ e.preventDefault();
+
+ var startingIndex = $(thumbEls).index($(e.currentTarget));
+ Code.PhotoSwipe.Current.show(startingIndex);
+
+ });
+
+ };
+
+ }
+
+
+})
+(
+ Code.PhotoSwipe.Util,
+ Code.PhotoSwipe.ElementClass,
+ Code.PhotoSwipe.DocumentOverlayClass,
+ Code.PhotoSwipe.FullSizeImageClass,
+ Code.PhotoSwipe.ViewportClass,
+ Code.PhotoSwipe.SliderClass,
+ Code.PhotoSwipe.CaptionClass,
+ Code.PhotoSwipe.ToolbarClass
+);
\ No newline at end of file
diff --git a/artifact/1.0.0/code-photoswipe-1.0.0.min.js b/artifact/1.0.0/code-photoswipe-1.0.0.min.js
new file mode 100644
index 000000000..6e0f5da3d
--- /dev/null
+++ b/artifact/1.0.0/code-photoswipe-1.0.0.min.js
@@ -0,0 +1,147 @@
+// PhotoSwipe - http://www.photoswipe.com/
+// Copyright (c) 2011 by Code Computerlove (http://www.codecomputerlove.com)
+// Licensed under the MIT license
+// version: 1.0.0.111
+
+(function(){if(!Function.prototype.bind){Function.prototype.bind=function(obj){var slice=[].slice,args=slice.call(arguments,1),self=this,nop=function(){},bound=function(){return self.apply(this instanceof nop?this:(obj||{}),args.concat(slice.call(arguments)));};nop.prototype=self.prototype;bound.prototype=new nop();return bound;};}
+if(typeof Code==="undefined"){Code={};Code.PhotoSwipe={};}
+Code.PhotoSwipe.Util={browser:{version:(navigator.userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],webkit:/webkit/.test(navigator.userAgent),opera:/opera/.test(navigator.userAgent),msie:/msie/.test(navigator.userAgent)&&!/opera/.test(navigator.userAgent),mozilla:/mozilla/.test(navigator.userAgent)&&!/(compatible|webkit)/.test(navigator.userAgent),mobileSafari:/Mac OS X.*Mobile.*Safari/.test(navigator.userAgent)},setElementData:function(el,key,value){if(this.isNothing(el.UtilData)){el.UtilData={};}
+el.UtilData[key]=value;},getElementData:function(el,key,defaultValue){if(typeof defaultValue==="undefined"){defaultValue=null;}
+if(this.isNothing(el.UtilData)){return defaultValue;}
+if(this.isNothing(el.UtilData[key])){return defaultValue;}
+return el.UtilData[key];},removeElementData:function(el,key){delete el.UtilData[key];},coalesce:function(){var i;for(i=0;i=1){parentEl.removeChild(parentEl.childNodes[parentEl.childNodes.length-1]);}}},hasAttribute:function(el,attributeName){return el.getAttribute(attributeName);},getAttribute:function(el,attributeName){if(!this.hasAttribute(el,attributeName)){return'';}
+return el.getAttribute(attributeName);},setAttribute:function(el,attributeName,value){el.setAttribute(attributeName,value);},removeAttribute:function(el,attributeName){if(this.hasAttribute(el,attributeName)){el.removeAttribute(attributeName);}},addClass:function(el,className){var currentClassValue=Util.DOM.getAttribute(el,'class');var re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)');if(!re.test(currentClassValue)){if(currentClassValue!=''){currentClassValue=currentClassValue+' ';}
+currentClassValue=currentClassValue+className;Util.DOM.setAttribute(el,'class',currentClassValue);}},removeClass:function(el,className){var currentClassValue=Util.DOM.getAttribute(el,'class');var re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)');if(re.test(currentClassValue)){currentClassValue=currentClassValue.replace(re,' ');Util.DOM.setAttribute(el,'class',currentClassValue);Util.DOM.removeClass(el,className);}
+else{currentClassValue=Util.trim(currentClassValue);if(currentClassValue===''){Util.DOM.removeAttribute(el,'class');}
+else{Util.DOM.setAttribute(el,'class',currentClassValue);}}},hasClass:function(el,className){var re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)');return re.test(Util.DOM.getAttribute(el,'class'));},setStyle:function(el,style,value){if(Util.isObject(style)){for(var propertyName in style){if(style.hasOwnProperty(propertyName)){el.style[propertyName]=style[propertyName];}}}
+else{el.style[style]=value;}},getStyle:function(el,styleName){return window.getComputedStyle(el,'').getPropertyValue(styleName);},hide:function(el){Util.setElementData(el,'oldDisplayValue',Util.DOM.getStyle(el,'display'));Util.DOM.setStyle(el,'display','none');},show:function(el){if(Util.DOM.getStyle(el,'display')==='none'){var oldDisplayValue=Util.getElementData(el,'oldDisplayValue','block');if(oldDisplayValue==='none'){oldDisplayValue='block';}
+Util.DOM.setStyle(el,'display',oldDisplayValue);}},width:function(el,value){if(!Util.isNothing(value)){if(Util.isNumber(value)){value=value+'px';}
+el.style.width=value;}
+return window.parseInt(window.getComputedStyle(el,'').getPropertyValue('width'));},outerWidth:function(el){return el.offsetWidth;},height:function(el,value){if(!Util.isNothing(value)){if(Util.isNumber(value)){value=value+'px';}
+el.style.height=value;}
+return window.parseInt(window.getComputedStyle(el,'').getPropertyValue('height'));},outerHeight:function(el){return el.offsetHeight;},documentWidth:function(){return Util.DOM.width(document.documentElement);},documentHeight:function(){return Math.round(Util.DOM.height(document.documentElement));},bodyWidth:function(){return Util.DOM.width(document.body);},bodyHeight:function(){return Util.DOM.height(document.body);},windowWidth:function(){return window.innerWidth;},windowHeight:function(){return window.innerHeight;},windowScrollLeft:function(){return window.pageXOffset;},windowScrollTop:function(){return window.pageYOffset;},addEventListener:function(el,type,listener){el.addEventListener(type,listener,false);},removeEventListener:function(el,type,listener){el.removeEventListener(type,listener,false);},getMousePosition:function(event){var retval={x:0,y:0}
+if(event.pageX){retval.x=event.pageX;}
+else if(event.clientX){retval.x=event.clientX+(document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft);}
+if(event.pageY){retval.y=event.pageY;}
+else if(event.clientY){retval.y=event.clientY+(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop);}
+return retval;},getTouchEvent:function(event){return event;}}});})(Code.PhotoSwipe.Util);(function(Util){Util.extend(Util,{Animation:{_applyTransitionDelay:100,_setTransition:function(el,property,duration,timingFunction,delay,callback){var
+transitionPrefix=Util.Animation._getTransitionPrefix(),p=Util.coalesce(property,''),d=Util.coalesce(duration,''),t,de,c;if(Util.isFunction(timingFunction)){c=timingFunction;t='';de='';}
+else{c=callback;t=Util.coalesce(timingFunction,'');de=Util.coalesce(delay,'');}
+Util.DOM.setStyle(el,transitionPrefix+'Property',p);Util.DOM.setStyle(el,transitionPrefix+'Duration',d);Util.DOM.setStyle(el,transitionPrefix+'TimingFunction',t);Util.DOM.setStyle(el,transitionPrefix+'Delay',de);if(Util.isFunction(c)){window.setTimeout(function(){c(el);},Util.Animation._applyTransitionDelay);}},_setTransitionEndEventListener:function(el){Util.setElementData(el,'transitionEndEvent',function(e){var el=e.target;Util.DOM.removeEventListener(el,Util.Animation._getTransitionEndEventLabel(),Util.getElementData(el,'transitionEndEvent'));Util.removeElementData(el,'transitionEndEvent');var callback=Util.getElementData(el,'transitionEndCallback');Util.removeElementData(el,'transitionEndCallback');Util.Animation._removeTransitions(el);if(Util.isFunction(callback)){window.setTimeout(function(){callback(e);},Util.Animation._applyTransitionDelay);}});Util.DOM.addEventListener(el,Util.Animation._getTransitionEndEventLabel(),Util.getElementData(el,'transitionEndEvent'));},_removeTransitions:function(el){var transitionPrefix=Util.Animation._getTransitionPrefix();Util.DOM.setStyle(el,transitionPrefix+'Property','');Util.DOM.setStyle(el,transitionPrefix+'Duration','');Util.DOM.setStyle(el,transitionPrefix+'TimingFunction','');Util.DOM.setStyle(el,transitionPrefix+'Delay','');},_getTransitionEndEventLabel:function(){return(document.documentElement.style.WebkitTransition!==undefined)?"webkitTransitionEnd":"transitionend";},_getTransitionPrefix:function(){return(document.documentElement.style.WebkitTransition!==undefined)?"webkitTransition":(document.documentElement.style.MozTransition!==undefined)?"MozTransition":"transition";},stopFade:function(el){Util.DOM.removeEventListener(el,Util.Animation._getTransitionEndEventLabel(),Util.getElementData(el,'transitionEndEvent'));var transitionPrefix=Util.Animation._getTransitionPrefix();var currentOpacity=window.getComputedStyle(el,'').getPropertyValue('opacity');Util.Animation._removeTransitions(el);Util.DOM.setStyle(el,'opacity',currentOpacity);},fadeIn:function(el,opacity,duration,callback){opacity=Util.coalesce(opacity,1);duration=Util.coalesce(duration,500);Util.setElementData(el,'transitionEndCallback',callback);Util.Animation._setTransition(el,'opacity',duration+'ms',function(el){Util.Animation._setTransitionEndEventListener(el);Util.DOM.setStyle(el,'opacity',opacity);});},fadeOut:function(el,duration,callback){if(Util.isNothing(duration)){duration=500;}
+Util.setElementData(el,'transitionEndCallback',callback);Util.Animation._setTransition(el,'opacity',duration+'ms',function(el){Util.Animation._setTransitionEndEventListener(el);Util.DOM.setStyle(el,'opacity',0);});},slideBy:function(el,xPos,yPos,duration,callback){if(Util.isNothing(duration)){duration=500;}
+Util.setElementData(el,'transitionEndCallback',Util.Animation._onSlideByEnd);Util.setElementData(el,'slideByCallback',callback);Util.setElementData(el,'slideByXPos',xPos);Util.setElementData(el,'slideByYPos',yPos);Util.Animation._setTransition(el,'all',duration+'ms','ease-in',0,function(el){Util.Animation._setTransitionEndEventListener(el);var
+xPos=Util.getElementData(el,'slideByXPos'),yPos=Util.getElementData(el,'slideByYPos');Util.removeElementData(el,'slideByXPos');Util.removeElementData(el,'slideByYPos');Util.DOM.setStyle(el,{webkitTransform:(Util.isMobileSafari)?'translate3d('+xPos+'px, '+yPos+'px, 0)':'translate('+xPos+'px, '+yPos+'px)',MozTransform:'translate('+xPos+'px, '+yPos+'px)',transform:'translate('+xPos+'px, '+yPos+'px)'});});},_onSlideByEnd:function(e){var
+el=e.target,callback=Util.getElementData(el,'slideByCallback'),transform=Util.coalesce(el.style.webkitTransform,el.style.MozTransform,el.style.transform),transformExploded=transform.match(/\((.*?)\)/)[1].split(', '),transformedX=window.parseInt(transformExploded[0]),transformedY=window.parseInt(transformExploded[1]),domX=window.parseInt(Util.DOM.getStyle(el,'left')),domY=window.parseInt(Util.DOM.getStyle(el,'top'));Util.DOM.setStyle(el,{webkitTransform:'',MozTransform:'',transform:'',left:(domX+transformedX)+'px',top:(domY+transformedY)+'px'});Util.removeElementData(el,'slideByCallback');Util.removeElementData(el,'slideByXPos');Util.removeElementData(el,'slideByYPos');if(Util.isFunction(callback)){window.setTimeout(function(){callback(e);},Util.Animation._applyTransitionDelay);}}}});})(Code.PhotoSwipe.Util);(function(){Code.PhotoSwipe.EventClass=Class.extend({_listeners:null,init:function(){this._listeners={};},addEventListener:function(type,listener){if(typeof this._listeners[type]==='undefined'){this._listeners[type]=[];}
+this._listeners[type].push(listener);},dispatchEvent:function(event){if(typeof event=="string"){event={type:event};}
+if(!event.target){event.target=this;}
+if(!event.type){throw new Error("Event object missing 'type' property.");}
+if(this._listeners[event.type]instanceof Array){var listeners=this._listeners[event.type];for(var i=0,len=listeners.length;ithis.naturalHeight);this.isLoading=false;this.hasLoaded=true;this.dispatchEvent(Code.PhotoSwipe.FullSizeImageClass.EventTypes.onLoad);}});Code.PhotoSwipe.FullSizeImageClass.EventTypes={onLoad:'onLoad'};})(Code.PhotoSwipe.Util);(function(Util){Code.PhotoSwipe.DocumentOverlayClass=Code.PhotoSwipe.ElementClass.extend({init:function(options){this._super(options);this.el=Util.DOM.createElement('div',{'class':Code.PhotoSwipe.DocumentOverlayClass.CssClasses.documentOverlay},'');Util.DOM.setStyle(this.el,{left:0,position:'absolute',top:0});Util.DOM.hide(this.el);Util.DOM.appendToBody(this.el);},resetPosition:function(){Util.DOM.width(this.el,Util.DOM.bodyWidth());Util.DOM.height(this.el,Util.DOM.bodyHeight());}});Code.PhotoSwipe.DocumentOverlayClass.CssClasses={documentOverlay:'ps-document-overlay'};})(Code.PhotoSwipe.Util);(function(Util){Code.PhotoSwipe.ViewportClass=Code.PhotoSwipe.ElementClass.extend({touchStartPoint:null,touchFingerCount:null,touchCancelsMouseEvents:null,touchStartHandler:null,touchMoveHandler:null,touchEndHandler:null,mouseDownHandler:null,mouseUpHandler:null,init:function(options){this.settings={swipeThreshold:500};Util.extend(this.settings,options);this._super(this.settings);this.touchFingerCount=0;this.touchStartPoint={x:0,y:0};this.touchCancelsMouseEvents=false;this.touchStartHandler=this.onTouchStart.bind(this);this.touchMoveHandler=this.onTouchMove.bind(this);this.touchEndHandler=this.onTouchEnd.bind(this);this.mouseDownHandler=this.onMouseDown.bind(this);this.mouseUpHandler=this.onMouseUp.bind(this);this.el=Util.DOM.createElement('div',{'class':Code.PhotoSwipe.ViewportClass.CssClasses.viewport},'');Util.DOM.setStyle(this.el,{position:'absolute',left:0,overflow:'hidden'});Util.DOM.hide(this.el);Util.DOM.appendToBody(this.el);},resetPosition:function(){Util.DOM.setStyle(this.el,{top:Util.DOM.windowScrollTop()+'px'});Util.DOM.width(this.el,Util.DOM.bodyWidth());Util.DOM.height(this.el,Util.DOM.windowHeight());},addEventListeners:function(){try{Util.DOM.addEventListener(this.el,'touchstart',this.touchStartHandler);Util.DOM.addEventListener(this.el,'touchmove',this.touchMoveHandler);Util.DOM.addEventListener(this.el,'touchend',this.touchEndHandler);}
+catch(err){}
+Util.DOM.addEventListener(this.el,'mousedown',this.mouseDownHandler);Util.DOM.addEventListener(this.el,'mouseup',this.mouseUpHandler);},removeEventListeners:function(){try{Util.DOM.removeEventListener(this.el,'touchstart',this.touchStartHandler);Util.DOM.removeEventListener(this.el,'touchmove',this.touchMoveHandler);Util.DOM.removeEventListener(this.el,'touchend',this.touchEndHandler);}
+catch(err){}
+Util.DOM.removeEventListener(this.el,'mousedown',this.mouseDownHandler);Util.DOM.removeEventListener(this.el,'mouseup',this.mouseUpHandler);},setCurrentTouchPoint:function(touchPoint,touches){this.touchFingerCount=touches.length;if(this.touchFingerCount===1){touchPoint.x=touches[0].pageX;touchPoint.y=touches[0].pageY;}
+else{this.touchFingerCount=0;touchPoint.x=0;touchPoint.y=0;}},onTouchStart:function(e){e.preventDefault();this.setCurrentTouchPoint(this.touchStartPoint,Util.DOM.getTouchEvent(e).touches);},onTouchMove:function(e){e.preventDefault();},onTouchEnd:function(e){e.preventDefault();var touchEndPoint={x:0,y:0};var touchEvent=Util.DOM.getTouchEvent(e);if(!Util.isNothing(touchEvent.changedTouches)){this.setCurrentTouchPoint(touchEndPoint,touchEvent.changedTouches);}
+else{this.setCurrentTouchPoint(touchEndPoint,touchEvent.touches);}
+if(this.touchFingerCount==1){this.fireTouchEvent(this.touchStartPoint,touchEndPoint);}},onMouseDown:function(e){e.preventDefault();if(this.touchCancelsMouseEvents){return;}
+this.touchStartPoint=Util.DOM.getMousePosition(e);},onMouseUp:function(e){e.preventDefault();if(this.touchCancelsMouseEvents){return;}
+this.fireTouchEvent(this.touchStartPoint,Util.DOM.getMousePosition(e));},fireTouchEvent:function(touchStartPoint,touchEndPoint){var action;var distance=touchEndPoint.x-touchStartPoint.x;if(Math.abs(distance)>=this.settings.swipeThreshold){if(distance<0){action=Code.PhotoSwipe.ViewportClass.Actions.swipeLeft;}
+else{action=Code.PhotoSwipe.ViewportClass.Actions.swipeRight;}}
+else{action=Code.PhotoSwipe.ViewportClass.Actions.click;}
+if(Util.isNothing(action)){return;}
+this.dispatchEvent({type:Code.PhotoSwipe.ViewportClass.EventTypes.onTouch,target:this,action:action});}});Code.PhotoSwipe.ViewportClass.CssClasses={viewport:'ps-viewport'};Code.PhotoSwipe.ViewportClass.Actions={click:'click',swipeLeft:'swipeLeft',swipeRight:'swipeRight'};Code.PhotoSwipe.ViewportClass.EventTypes={onTouch:'onTouch'};})(Code.PhotoSwipe.Util);(function(Util,FullSizeImageClass){Code.PhotoSwipe.SliderItemClass=Code.PhotoSwipe.EventClass.extend({el:null,imageEl:null,parentEl:null,fullSizeImage:null,fullSizeImageLoadEventHandler:null,init:function(parentEl){this._super();this.parentEl=parentEl;this.fullSizeImageLoadEventHandler=this.onFullSizeImageLoad.bind(this);this.el=Util.DOM.createElement('div',{'class':Code.PhotoSwipe.SliderItemClass.CssClasses.item+' '+Code.PhotoSwipe.SliderItemClass.CssClasses.loading},'');Util.DOM.setStyle(this.el,{position:'absolute',top:0});Util.DOM.resetTranslate(this.el);Util.DOM.appendChild(this.el,this.parentEl);this.imageEl=new Image();Util.DOM.setStyle(this.imageEl,{display:'block',position:'absolute',margin:0,padding:0});Util.DOM.hide(this.imageEl);Util.DOM.appendChild(this.imageEl,this.el);},resetPosition:function(width,height,xPos){Util.DOM.width(this.el,width);Util.DOM.height(this.el,height);Util.DOM.setStyle(this.el,'left',xPos+'px');this.resetImagePosition();},resetImagePosition:function(){if(Util.isNothing(this.fullSizeImage)){return;}
+var src=Util.DOM.getAttribute(this.imageEl,'src');var
+scale,newWidth,newHeight,newTop,newLeft,maxWidth=Util.DOM.width(this.el),maxHeight=Util.DOM.height(this.el);if(this.fullSizeImage.isLandscape){scale=maxWidth/this.fullSizeImage.naturalWidth;}
+else{scale=maxHeight/this.fullSizeImage.naturalHeight;}
+newWidth=Math.round(this.fullSizeImage.naturalWidth*scale);newHeight=Math.round(this.fullSizeImage.naturalHeight*scale);if(this.fullSizeImage.scaleMethod==='fit'){scale=1;if(newWidth>maxWidth){scale=maxWidth/newWidth;}
+else if(newHeight>maxHeight){scale=maxHeight/newHeight;}
+if(scale!==1){newWidth=Math.round(newWidth*scale);newHeight=Math.round(newHeight*scale);}}
+newTop=((maxHeight-newHeight)/2)+'px';newLeft=((maxWidth-newWidth)/2)+'px';Util.DOM.width(this.imageEl,newWidth);Util.DOM.height(this.imageEl,newHeight);Util.DOM.setStyle(this.imageEl,{top:newTop,left:newLeft});Util.DOM.show(this.imageEl);},setFullSizeImage:function(fullSizeImage){this.fullSizeImage=fullSizeImage;Util.DOM.removeClass(this.el,Code.PhotoSwipe.SliderItemClass.CssClasses.loading);Util.DOM.removeClass(this.el,Code.PhotoSwipe.SliderItemClass.CssClasses.imageError);if(Util.isNothing(this.fullSizeImage)){this.fullSizeImage=null;Util.DOM.addClass(this.el,Code.PhotoSwipe.SliderItemClass.CssClasses.imageError);this.hideImage();return;}
+if(!this.fullSizeImage.hasLoaded){Util.DOM.addClass(this.el,Code.PhotoSwipe.SliderItemClass.CssClasses.loading);this.hideImage();if(!this.fullSizeImage.isLoading){this.fullSizeImage.addEventListener(FullSizeImageClass.EventTypes.onLoad,this.fullSizeImageLoadEventHandler);this.fullSizeImage.load();}
+return;}
+Util.DOM.setAttribute(this.imageEl,'src',this.fullSizeImage.src);this.resetImagePosition();this.dispatchEvent(Code.PhotoSwipe.SliderItemClass.EventTypes.onFullSizeImageDisplay);},onFullSizeImageLoad:function(e){e.target.removeEventListener(FullSizeImageClass.EventTypes.onLoad,this.fullSizeImageLoadEventHandler);if(Util.isNothing(this.fullSizeImage)||e.target.index!==this.fullSizeImage.index){this.dispatchEvent({type:Code.PhotoSwipe.SliderItemClass.EventTypes.onFullSizeImageLoadAnomaly,target:this,fullSizeImage:e.target});}
+else{this.setFullSizeImage(e.target);}},hideImage:function(){Util.DOM.removeAttribute(this.imageEl,'src');Util.DOM.hide(this.imageEl);}});Code.PhotoSwipe.SliderItemClass.CssClasses={item:'ps-slider-item',loading:'ps-slider-item-loading',imageError:'ps-slider-item-image-error'};Code.PhotoSwipe.SliderItemClass.EventTypes={onFullSizeImageDisplay:'onFullSizeImageDisplay',onFullSizeImageLoadAnomaly:'onFullSizeImageLoadAnomaly'};})(Code.PhotoSwipe.Util,Code.PhotoSwipe.FullSizeImageClass);(function(Util,SliderItemClass){Code.PhotoSwipe.SliderClass=Code.PhotoSwipe.ElementClass.extend({parentEl:null,parentElWidth:null,parentElHeight:null,items:null,previousItem:null,currentItem:null,nextItem:null,hasBounced:null,lastShowAction:null,bounceSlideBy:null,showNextEndEventHandler:null,showPreviousEndEventHandler:null,bounceStepOneEventHandler:null,bounceStepTwoEventHandler:null,sliderFullSizeImageLoadAnomalyEventHandler:null,init:function(options,parentEl){this.settings={slideSpeed:250};Util.extend(this.settings,options);this._super(this.settings);this.parentEl=parentEl;this.hasBounced=false;this.showNextEndEventHandler=this.onShowNextEnd.bind(this);this.showPreviousEndEventHandler=this.onShowPreviousEnd.bind(this);this.bounceStepOneEventHandler=this.onBounceStepOne.bind(this);this.bounceStepTwoEventHandler=this.onBounceStepTwo.bind(this);this.sliderFullSizeImageLoadAnomalyEventHandler=this.onSliderFullSizeImageLoadAnomaly.bind(this);this.el=Util.DOM.createElement('div',{'class':Code.PhotoSwipe.SliderClass.CssClasses.slider},'');Util.DOM.setStyle(this.el,{position:'absolute',top:0});Util.DOM.hide(this.el);Util.DOM.appendChild(this.el,parentEl);this.items=[];this.items.push(new SliderItemClass(this.el));this.items.push(new SliderItemClass(this.el));this.items.push(new SliderItemClass(this.el));this.previousItem=this.items[0];this.currentItem=this.items[1];this.nextItem=this.items[2];},addEventListeners:function(){for(var i=0;i0){this.fadeOutTimeout=window.setTimeout(this.fadeOut.bind(this),this.settings.captionDelay);}
+this._super();}});Code.PhotoSwipe.CaptionClass.CssClasses={caption:'ps-caption',bottom:'ps-caption-bottom',content:'ps-caption-content'};})(Code.PhotoSwipe.Util);(function(Util){Code.PhotoSwipe.ToolbarClass=Code.PhotoSwipe.ElementClass.extend({closeEl:null,previousEl:null,nextEl:null,playEl:null,clickHandler:null,fadeOutTimeout:null,isNextActive:null,isPreviousActive:null,init:function(options){this.settings={toolbarDelay:4000,position:'bottom'};Util.extend(this.settings,options);this._super(options);this.isNextActive=true;this.isPreviousActive=true;this.clickHandler=this.onClick.bind(this);var cssClass=Code.PhotoSwipe.ToolbarClass.CssClasses.caption;if(this.settings.position==='top'){cssClass=cssClass+' '+Code.PhotoSwipe.ToolbarClass.CssClasses.top;}
+this.el=Util.DOM.createElement('div',{'class':cssClass},'');Util.DOM.setStyle(this.el,{left:0,position:'absolute',overflow:'hidden',zIndex:1001,display:'table'});Util.DOM.hide(this.el);Util.DOM.appendToBody(this.el);this.closeEl=Util.DOM.createElement('div',{'class':Code.PhotoSwipe.ToolbarClass.CssClasses.close},'
');Util.DOM.appendChild(this.closeEl,this.el);this.playEl=Util.DOM.createElement('div',{'class':Code.PhotoSwipe.ToolbarClass.CssClasses.play},'
');Util.DOM.appendChild(this.playEl,this.el);this.previousEl=Util.DOM.createElement('div',{'class':Code.PhotoSwipe.ToolbarClass.CssClasses.previous},'
');Util.DOM.appendChild(this.previousEl,this.el);this.nextEl=Util.DOM.createElement('div',{'class':Code.PhotoSwipe.ToolbarClass.CssClasses.next},'
');Util.DOM.appendChild(this.nextEl,this.el);},addEventListeners:function(){Util.DOM.addEventListener(this.el,'click',this.clickHandler);},removeEventListeners:function(){Util.DOM.removeEventListener(this.el,'click',this.clickHandler);},onClick:function(e){var action;switch(e.target.parentNode){case this.previousEl:if(this.isPreviousActive){action=Code.PhotoSwipe.ToolbarClass.Actions.previous;}
+break;case this.nextEl:if(this.isNextActive){action=Code.PhotoSwipe.ToolbarClass.Actions.next;}
+break;case this.playEl:action=Code.PhotoSwipe.ToolbarClass.Actions.play;break;case this.closeEl:action=Code.PhotoSwipe.ToolbarClass.Actions.close;break;}
+if(Util.isNothing(action)){return;}
+this.dispatchEvent({type:Code.PhotoSwipe.ToolbarClass.EventTypes.onClick,target:this,action:action});},resetPosition:function(){var top;if(this.settings.position==='bottom'){top=Util.DOM.windowHeight()-Util.DOM.height(this.el)+Util.DOM.windowScrollTop();}
+else{top=Util.DOM.windowScrollTop();}
+Util.DOM.setStyle(this.el,'top',top+'px');Util.DOM.width(this.el,Util.DOM.bodyWidth());},stopFade:function(){window.clearTimeout(this.fadeOutTimeout);this._super();},postShow:function(){if(this.settings.toolbarDelay>0){this.fadeOutTimeout=window.setTimeout(this.fadeOut.bind(this),this.settings.toolbarDelay);}
+this._super();},setNextState:function(disable){if(disable){Util.DOM.addClass(this.nextEl,Code.PhotoSwipe.ToolbarClass.CssClasses.nextDisabled);this.isNextActive=false;}
+else{Util.DOM.removeClass(this.nextEl,Code.PhotoSwipe.ToolbarClass.CssClasses.nextDisabled);this.isNextActive=true;}},setPreviousState:function(disable){if(disable){Util.DOM.addClass(this.previousEl,Code.PhotoSwipe.ToolbarClass.CssClasses.previousDisabled);this.isPreviousActive=false;}
+else{Util.DOM.removeClass(this.previousEl,Code.PhotoSwipe.ToolbarClass.CssClasses.previousDisabled);this.isPreviousActive=true;}}});Code.PhotoSwipe.ToolbarClass.CssClasses={caption:'ps-toolbar',top:'ps-toolbar-top',close:'ps-toolbar-close',previous:'ps-toolbar-previous',previousDisabled:'ps-toolbar-previous-disabled',next:'ps-toolbar-next',nextDisabled:'ps-toolbar-next-disabled',play:'ps-toolbar-play',content:'ps-toolbar-content'};Code.PhotoSwipe.ToolbarClass.Actions={close:'close',previous:'previous',next:'next',play:'play'};Code.PhotoSwipe.ToolbarClass.EventTypes={onClick:'onClick'};})(Code.PhotoSwipe.Util);(function(Util,ElementClass,DocumentOverlayClass,FullSizeImageClass,ViewportClass,SliderClass,CaptionClass,ToolbarClass){var photoSwipe=Code.PhotoSwipe.EventClass.extend({fullSizeImages:null,documentOverlay:null,viewport:null,slider:null,caption:null,toolbar:null,settings:null,slideShowSettingsSaved:null,currentIndex:null,isBusy:null,slideshowTimeout:null,documentOverlayFadeInEventHandler:null,windowResizeEventHandler:null,windowOrientationChangeEventHandler:null,windowScrollEventHandler:null,keyDownEventHandler:null,viewportTouchEventHandler:null,viewportFadeOutEventHandler:null,sliderDisplayCurrentFullSizeImageEventHandler:null,toolbarClickEventHandler:null,init:function(){this._super();this.currentIndex=0;this.isBusy=false;this.settings={getImageSource:Code.PhotoSwipe.GetImageSource,getImageCaption:Code.PhotoSwipe.GetImageCaption,fadeSpeed:400,slideSpeed:250,swipeThreshold:50,loop:true,flipCaptionAndToolbar:false,captionDelay:3000,captionOpacity:0.8,hideCaption:false,showEmptyCaptions:true,toolbarDelay:3000,toolbarOpacity:0.8,hideToolbar:false,slideshowDelay:3000,imageScaleMethod:'fit'};this.documentOverlayFadeInEventHandler=this.onDocumentOverlayFadeIn.bind(this);this.windowResizeEventHandler=this.onWindowResize.bind(this);this.windowOrientationChangeEventHandler=this.onWindowOrientationChange.bind(this);this.windowScrollEventHandler=this.onWindowScroll.bind(this);this.keyDownEventHandler=this.onKeyDown.bind(this);this.viewportTouchEventHandler=this.onViewportTouch.bind(this);this.viewportFadeOutEventHandler=this.onViewportFadeOut.bind(this);this.sliderDisplayCurrentFullSizeImageEventHandler=this.onSliderDisplayCurrentFullSizeImage.bind(this);this.toolbarClickEventHandler=this.onToolbarClick.bind(this);},setOptions:function(options){Util.extend(this.settings,options);},setImages:function(thumbEls){if(!Util.isArray){throw"thumbEls is not an array";}
+this.currentIndex=0;this.fullSizeImages=[];for(var i=0;i=this.fullSizeImages.length){startingIndex=0;}
+this.currentIndex=startingIndex;if(Util.isNothing(this.documentOverlay)){this.build();}
+this.documentOverlay.addEventListener(ElementClass.EventTypes.onFadeIn,this.documentOverlayFadeInEventHandler);this.documentOverlay.fadeIn();},build:function(){this.documentOverlay=new DocumentOverlayClass({opacity:1,fadeSpeed:this.settings.fadeSpeed});this.viewport=new ViewportClass({opacity:1,fadeSpeed:this.settings.fadeSpeed,swipeThreshold:this.settings.swipeThreshold});this.slider=new SliderClass({opacity:1,fadeSpeed:this.settings.fadeSpeed,slideSpeed:this.settings.slideSpeed},this.viewport.el);this.caption=new CaptionClass({opacity:this.settings.captionOpacity,fadeSpeed:this.settings.fadeSpeed,captionDelay:this.settings.captionDelay,position:(this.settings.flipCaptionAndToolbar)?'bottom':'top'});this.toolbar=new ToolbarClass({opacity:this.settings.toolbarOpacity,fadeSpeed:this.settings.fadeSpeed,toolbarDelay:this.settings.toolbarDelay,position:(this.settings.flipCaptionAndToolbar)?'top':'bottom'});},addEventListeners:function(){if(!Util.isNothing(window.orientation)){Util.DOM.addEventListener(window,'orientationchange',this.windowOrientationChangeEventHandler);}
+Util.DOM.addEventListener(window,'resize',this.windowResizeEventHandler);Util.DOM.addEventListener(window,'scroll',this.windowScrollEventHandler);Util.DOM.addEventListener(document,'keydown',this.keyDownEventHandler);this.viewport.addEventListener(ViewportClass.EventTypes.onTouch,this.viewportTouchEventHandler);this.slider.addEventListener(SliderClass.EventTypes.onDisplayCurrentFullSizeImage,this.sliderDisplayCurrentFullSizeImageEventHandler);this.toolbar.addEventListener(ToolbarClass.EventTypes.onClick,this.toolbarClickEventHandler);},removeEventListeners:function(){if(!Util.isNothing(window.orientation)){Util.DOM.removeEventListener(window,'orientationchange',this.windowOrientationChangeEventHandler);}
+Util.DOM.removeEventListener(window,'resize',this.windowResizeEventHandler);Util.DOM.removeEventListener(window,'scroll',this.windowScrollEventHandler);Util.DOM.removeEventListener(document,'keydown',this.keyDownEventHandler);this.viewport.removeEventListener(ViewportClass.EventTypes.onTouch,this.viewportTouchEventHandler);this.slider.removeEventListener(SliderClass.EventTypes.onDisplayCurrentFullSizeImage,this.sliderDisplayCurrentFullSizeImageEventHandler);this.toolbar.removeEventListener(ToolbarClass.EventTypes.onClick,this.toolbarClickEventHandler);},onDocumentOverlayFadeIn:function(e){this.documentOverlay.removeEventListener(ElementClass.EventTypes.onFadeIn,this.documentOverlayFadeInEventHandler);this.viewport.show();this.slider.show();this.toolbar.show();this.addEventListeners();this.slider.setCurrentFullSizeImage(this.fullSizeImages[this.currentIndex]);this.isBusy=false;},setSliderPreviousAndNextFullSizeImages:function(){var
+lastIndex,previousFullSizeImage=null,nextFullSizeImage=null;if(this.fullSizeImages.length>1){lastIndex=this.fullSizeImages.length-1;if(this.currentIndex===lastIndex){if(this.settings.loop){nextFullSizeImage=this.fullSizeImages[0];}
+previousFullSizeImage=this.fullSizeImages[this.currentIndex-1];}
+else if(this.currentIndex===0){nextFullSizeImage=this.fullSizeImages[this.currentIndex+1];if(this.settings.loop){previousFullSizeImage=this.fullSizeImages[lastIndex];}}
+else{nextFullSizeImage=this.fullSizeImages[this.currentIndex+1];previousFullSizeImage=this.fullSizeImages[this.currentIndex-1];}}
+this.slider.setPreviousAndNextFullSizeImages(previousFullSizeImage,nextFullSizeImage);},onWindowResize:function(e){this.resetPosition();},onKeyDown:function(e){if(e.keyCode===37){e.preventDefault();this.showPrevious();}
+else if(e.keyCode===39){e.preventDefault();this.showNext();}
+else if(e.keyCode===38||e.keyCode===40){e.preventDefault();}
+else if(e.keyCode===27){e.preventDefault();this.hide();}
+else if(e.keyCode===32){e.preventDefault();}},onWindowOrientationChange:function(e){this.resetPosition();},onWindowScroll:function(e){this.resetPosition();},resetPosition:function(){if(this.isBusy){return;}
+this.documentOverlay.resetPosition();this.viewport.resetPosition();this.slider.resetPosition();this.caption.resetPosition();this.toolbar.resetPosition();},onViewportTouch:function(e){switch(e.action){case ViewportClass.Actions.swipeLeft:this.showNext();break;case ViewportClass.Actions.swipeRight:this.showPrevious();break;default:if(this.isSlideShowActive()||!this.settings.hideToolbar){this.showCaptionAndToolbar();}
+else{this.hide();}
+break;}},onViewportFadeOut:function(e){this.viewport.removeEventListener(ElementClass.EventTypes.onFadeOut,this.viewportFadeOutEventHandler);this.isBusy=false;},hide:function(){if(this.isBusy){return;}
+this.isBusy=true;this.removeEventListeners();this.documentOverlay.hide();this.caption.hide();this.toolbar.hide();this.slider.hide();Util.DOM.removeClass(document.body,Code.PhotoSwipe.CssClasses.activeBody);this.viewport.addEventListener(ElementClass.EventTypes.onFadeOut,this.viewportFadeOutEventHandler);this.viewport.fadeOut();},showNext:function(){if(this.isBusy){return;}
+this.isBusy=true;this.caption.setEmptyCaption();this.slider.showNext();},showPrevious:function(){if(this.isBusy){return;}
+this.isBusy=true;this.caption.setEmptyCaption();this.slider.showPrevious();},onSliderDisplayCurrentFullSizeImage:function(e){this.currentIndex=e.fullSizeImage.index;this.setSliderPreviousAndNextFullSizeImages();this.isBusy=false;if(this.isSlideShowActive()){if(!this.settings.loop&&this.currentIndex===this.fullSizeImages.length-1){this.slideshowTimeout=window.setTimeout(this.showCaptionAndToolbar.bind(this),this.settings.slideshowDelay);}
+else{this.fireSlideshowTimeout();}}
+else{this.showCaptionAndToolbar();}},showCaptionAndToolbar:function(captionValue){this.stopSlideshow();if(this.settings.hideCaption){this.caption.hide();}
+else{captionValue=Util.coalesce(captionValue,this.fullSizeImages[this.currentIndex].caption);if((Util.isNothing(captionValue)||captionValue==='')&&!this.settings.showEmptyCaptions){this.caption.hide();return;}
+this.caption.show(captionValue);}
+if(this.settings.hideToolbar){this.toolbar.hide();}
+else{if(this.settings.loop){this.toolbar.setNextState(false);this.toolbar.setPreviousState(false);}
+else{if(this.currentIndex>=this.fullSizeImages.length-1){this.toolbar.setNextState(true);}
+else{this.toolbar.setNextState(false);}
+if(this.currentIndex<1){this.toolbar.setPreviousState(true);}
+else{this.toolbar.setPreviousState(false);}}
+this.toolbar.show();}},onToolbarClick:function(e){switch(e.action){case ToolbarClass.Actions.previous:this.showPrevious();break;case ToolbarClass.Actions.next:this.showNext();break;case ToolbarClass.Actions.play:this.startSlideshow();break;default:this.hide();break;}},startSlideshow:function(){if(this.isBusy){return;}
+window.clearTimeout(this.slideshowTimeout);this.slideShowSettingsSaved={hideCaption:this.settings.hideCaption,hideToolbar:this.settings.hideToolbar};this.settings.hideCaption=true;this.settings.hideToolbar=true;this.caption.fadeOut();this.toolbar.fadeOut();this.fireSlideshowTimeout();},stopSlideshow:function(){if(!this.isSlideShowActive()){return;}
+window.clearTimeout(this.slideshowTimeout);this.settings.hideCaption=this.slideShowSettingsSaved.hideCaption;this.settings.hideToolbar=this.slideShowSettingsSaved.hideToolbar;this.slideShowSettingsSaved=null;},isSlideShowActive:function(){return(!Util.isNothing(this.slideShowSettingsSaved));},fireSlideshowTimeout:function(){this.slideshowTimeout=window.setTimeout(this.showNext.bind(this),this.settings.slideshowDelay);}});Code.PhotoSwipe.CssClasses={activeBody:'ps-active'};Code.PhotoSwipe.GetImageSource=function(el){return el.href;};Code.PhotoSwipe.GetImageCaption=function(el){if(el.nodeName==="IMG"){return Util.DOM.getAttribute(el,'alt');}
+return Util.DOM.getAttribute(el.firstChild,'alt');};Code.PhotoSwipe.Current=new photoSwipe();Code.photoSwipe=function(thumbEls,containerEl,opts){var useEventDelegation=true;if(Util.isNothing(thumbEls)){return;}
+if(Util.isNothing(containerEl)){containerEl=document.documentElement;useEventDelegation=false;}
+if(Util.isString(containerEl)){containerEl=document.documentElement.querySelector(containerEl);}
+if(Util.isNothing(containerEl)){throw'Unable to find container element';}
+if(Util.isString(thumbEls)){thumbEls=containerEl.querySelectorAll(thumbEls);}
+if(Util.isNothing(thumbEls)){return;}
+Code.PhotoSwipe.Current.setOptions(opts);Code.PhotoSwipe.Current.setImages(thumbEls);if(useEventDelegation){containerEl.addEventListener('click',function(e){if(e.target===e.currentTarget){return;}
+e.preventDefault();var findNode=function(clickedEl,targetNodeName,stopAtEl){if(Util.isNothing(clickedEl)||Util.isNothing(targetNodeName)||Util.isNothing(stopAtEl)){return null;}
+if(clickedEl.nodeName===targetNodeName){return clickedEl;}
+if(clickedEl===stopAtEl){return null;}
+return findNode(clickedEl.parentNode,targetNodeName,stopAtEl)};var clickedEl=findNode(e.target,thumbEls[0].nodeName,e.currentTarget);if(Util.isNothing(clickedEl)){return;}
+showPhotoSwipe(clickedEl);},false);}
+else{for(var i=0;i' + type + '>');
+ retval.attr(attributes);
+ retval.append(content);
+
+ return retval[0];
+
+ },
+
+
+ /*
+ * Function: appendChild
+ */
+ appendChild: function(childEl, parentEl){
+
+ $(parentEl).append(childEl);
+
+ },
+
+
+ /*
+ * Function: appendText
+ */
+ appendText: function(text, parentEl){
+
+ $(parentEl).text(text);
+
+ },
+
+
+ /*
+ * Function: appendToBody
+ */
+ appendToBody: function(childEl){
+
+ $('body').append(childEl);
+
+ },
+
+
+ /*
+ * Function: removeChild
+ */
+ removeChild: function(childEl, parentEl){
+
+ $(parentEl).remove(childEl);
+
+ },
+
+
+
+ /*
+ * Function: removeChildren
+ */
+ removeChildren: function(parentEl){
+
+ $(parentEl).empty();
+
+ },
+
+
+
+ /*
+ * Function: hasAttribute
+ */
+ hasAttribute: function(el, attributeName){
+
+ return Util.isNothing( $(el).attr(attributeName) );
+
+ },
+
+
+ /*
+ * Function: getAttribute
+ */
+ getAttribute: function(el, attributeName){
+
+ return $(el).attr(attributeName);
+
+ },
+
+
+ /*
+ * Function: el, attributeName
+ */
+ setAttribute: function(el, attributeName, value){
+
+ $(el).attr(attributeName, value);
+
+ },
+
+
+ /*
+ * Function: removeAttribute
+ */
+ removeAttribute: function(el, attributeName){
+
+ $(el).removeAttr(attributeName);
+
+ },
+
+
+ /*
+ * Function: addClass
+ */
+ addClass: function(el, className){
+
+ $(el).addClass(className);
+
+ },
+
+
+ /*
+ * Function: removeClass
+ */
+ removeClass: function(el, className){
+
+ $(el).removeClass(className);
+
+ },
+
+
+ /*
+ * Function: hasClass
+ */
+ hasClass: function(el, className){
+
+ $(el).hasClass(className);
+
+ },
+
+
+ /*
+ * Function: setStyle
+ */
+ setStyle: function(el, style, value){
+
+ if (Util.isObject(style)) {
+ $(el).css(style);
+ }
+ else {
+ $(el).css(style, value);
+ }
+
+ },
+
+
+ /*
+ * Function: getStyle
+ */
+ getStyle: function(el, styleName){
+
+ return $(el).css(styleName);
+
+ },
+
+
+ /*
+ * Function: hide
+ */
+ hide: function(el){
+
+ $(el).hide();
+
+ },
+
+
+ /*
+ * Function: show
+ */
+ show: function(el){
+
+ $(el).show();
+
+ },
+
+
+ /*
+ * Function: width
+ * Content width, exludes padding
+ */
+ width: function(el, value){
+
+ if (!Util.isNothing(value)){
+ $(el).width(value);
+ }
+
+ return $(el).width();
+
+ },
+
+
+ /*
+ * Function: outerWidth
+ */
+ outerWidth: function(el){
+
+ return $(el).outerWidth();
+
+ },
+
+
+ /*
+ * Function: height
+ * Content height, excludes padding
+ */
+ height: function(el, value){
+
+ if (!Util.isNothing(value)){
+ $(el).height(value);
+ }
+
+ return $(el).height();
+
+ },
+
+
+ /*
+ * Function: outerHeight
+ */
+ outerHeight: function(el){
+
+ return $(el).outerHeight();
+
+ },
+
+
+ /*
+ * Function: documentWidth
+ */
+ documentWidth: function(){
+
+ return $(document.documentElement).width();
+
+ },
+
+
+ /*
+ * Function: documentHeight
+ */
+ documentHeight: function(){
+
+ return $(document.documentElement).height();
+
+ },
+
+
+ /*
+ * Function: bodyWidth
+ */
+ bodyWidth: function(){
+
+ return $(document.body).width();
+
+ },
+
+
+ /*
+ * Function: bodyHeight
+ */
+ bodyHeight: function(){
+
+ return $(document.body).height();
+
+ },
+
+
+ /*
+ * Function: windowWidth
+ */
+ windowWidth: function(){
+
+ return $(window).width();
+
+ },
+
+
+ /*
+ * Function: windowHeight
+ */
+ windowHeight: function(){
+
+ return $(window).height();
+
+ },
+
+
+ /*
+ * Function: windowScrollLeft
+ */
+ windowScrollLeft: function(){
+
+ return $(window).scrollLeft();
+
+ },
+
+
+ /*
+ * Function: windowScrollTop
+ */
+ windowScrollTop: function(){
+
+ return $(window).scrollTop();
+
+ },
+
+
+ /*
+ * Function: addEventListener
+ */
+ addEventListener: function(el, type, listener){
+
+ $(el).bind( type, listener );
+
+ },
+
+
+ /*
+ * Function: removeEventListener
+ */
+ removeEventListener: function(el, type, listener){
+
+ $(el).unbind( type, listener );
+
+ },
+
+
+ /*
+ * Function: getMousePosition
+ */
+ getMousePosition: function(event){
+
+ var retval = {
+ x: event.pageX,
+ y: event.pageY
+ }
+
+ return retval;
+ },
+
+
+ /*
+ * Function: getTouchEvent
+ */
+ getTouchEvent: function(event){
+
+ return event.originalEvent;
+
+ }
+
+ }
+
+
+ });
+
+
+})(Code.PhotoSwipe.Util);// PhotoSwipe - http://www.photoswipe.com/
+// Copyright (c) 2011 by Code Computerlove (http://www.codecomputerlove.com)
+// Licensed under the MIT license
+
+(function (Util) {
+
+ Util.extend(Util, {
+
+
+ Animation: {
+
+
+ /*
+ * Function: stopFade
+ */
+ stopFade: function(el){
+
+ $(el).stop(true, true);
+
+ },
+
+
+ /*
+ * Function: fadeIn
+ * Fades an element in.
+ * Make sure the element is displayed before calling
+ */
+ fadeIn: function(el, opacity, duration, callback){
+
+ opacity = Util.coalesce(opacity, 1);
+ duration = Util.coalesce(duration, 500);
+
+ $(el).fadeTo(duration, opacity, callback);
+
+ },
+
+
+ /*
+ * Function: fadeOut
+ * Fades an element out
+ * Make sure the element is displayed before calling
+ * Does not "hide" the element when animation is over
+ */
+ fadeOut: function(el, duration, callback){
+
+ if (Util.isNothing(duration)){
+ duration = 500;
+ }
+
+ $(el).fadeTo(duration, 0, callback);
+
+ },
+
+
+
+ /*
+ * Function: slideTo
+ * Slides an element by an x,y position
+ */
+ slideBy: function(el, xPos, yPos, duration, callback){
+
+ if (Util.isNothing(duration)){
+ duration = 500;
+ }
+
+
+ $(el).animate(
+ {
+ left: '+=' + xPos + 'px',
+ top: '+=' + yPos + 'px'
+ },
+ duration,
+ callback
+ );
+
+ }
+
+ }
+
+ });
+
+
+})(Code.PhotoSwipe.Util);// PhotoSwipe - http://www.photoswipe.com/
+// Copyright (c) 2011 by Code Computerlove (http://www.codecomputerlove.com)
+// Licensed under the MIT license
+
+(function () {
+
+ // Based on http://www.javascriptbank.com/how-build-custom-events-javascript.html
+ Code.PhotoSwipe.EventClass = Class.extend({
+
+ _listeners: null,
+
+ init: function(){
+
+ this._listeners = {};
+
+ },
+
+
+ addEventListener: function(type, listener){
+
+ if (typeof this._listeners[type] === 'undefined'){
+ this._listeners[type] = [];
+ }
+ this._listeners[type].push(listener);
+
+ },
+
+
+ dispatchEvent: function(event){
+ if (typeof event == "string"){
+ event = { type: event };
+ }
+ if (!event.target){
+ event.target = this;
+ }
+
+ if (!event.type){
+ throw new Error("Event object missing 'type' property.");
+ }
+
+ if (this._listeners[event.type] instanceof Array){
+ var listeners = this._listeners[event.type];
+ for (var i=0, len=listeners.length; i < len; i++){
+ listeners[i].call(this, event);
+ }
+ }
+ },
+
+
+ removeEventListener: function(type, listener){
+ if (this._listeners[type] instanceof Array){
+ var listeners = this._listeners[type];
+ for (var i=0, len=listeners.length; i < len; i++){
+ if (listeners[i] === listener){
+ listeners.splice(i, 1);
+ break;
+ }
+ }
+ }
+ }
+
+ });
+
+
+})();// PhotoSwipe - http://www.photoswipe.com/
+// Copyright (c) 2011 by Code Computerlove (http://www.codecomputerlove.com)
+// Licensed under the MIT license
+
+(function (Util) {
+
+ /*
+ * Class: Code.PhotoSwipe.ElementClass
+ * Most PhotoSwipe classes inherit from this class
+ * Provides hooks for fading in and out
+ */
+ Code.PhotoSwipe.ElementClass = Code.PhotoSwipe.EventClass.extend({
+
+ el: null,
+ settings: null,
+ isFading: null,
+
+ fadeInHandler: null,
+ fadeOutHandler: null,
+
+
+ /*
+ * Function: init
+ */
+ init: function(options){
+
+ this._super();
+
+ this.settings = {
+ opacity: 1,
+ fadeSpeed: 500
+ };
+
+ Util.extend(this.settings, options);
+
+ this.isFading = false;
+
+ this.fadeInHandler = this.postFadeIn.bind(this);
+ this.fadeOutHandler = this.postFadeOut.bind(this);
+
+ },
+
+
+
+ /*
+ * Function: resetPosition
+ */
+ resetPosition: function(){
+ },
+
+
+
+ /*
+ * Function: show
+ */
+ show: function(){
+
+ if (this.el === null){
+ return;
+ }
+
+ this.stopFade();
+
+ // Set position
+ this.resetPosition();
+
+ // Show
+ Util.DOM.setStyle(this.el, 'opacity', this.settings.opacity);
+ Util.DOM.show(this.el);
+
+ this.postShow();
+
+ },
+
+
+
+ /*
+ * Function: postShow
+ * Overide this
+ */
+ postShow: function(){
+
+ this.addEventListeners();
+ this.dispatchEvent(Code.PhotoSwipe.ElementClass.EventTypes.onShow);
+
+ },
+
+
+
+ /*
+ * Function: fadeIn
+ */
+ fadeIn: function(){
+
+ if (this.el === null){
+ return;
+ }
+
+ Util.DOM.setStyle(this.el, 'opacity', 0);
+
+ this.fadeInFromCurrentOpacity();
+
+ },
+
+
+ /*
+ * Function: fadeInFromCurrentOpacity
+ */
+ fadeInFromCurrentOpacity: function(){
+
+ if (this.el === null){
+ return;
+ }
+
+ this.stopFade();
+
+ this.isFading = true;
+
+ // Set position
+ this.resetPosition();
+
+ // Fade in
+ Util.DOM.show(this.el);
+ Util.Animation.fadeIn(
+ this.el,
+ this.settings.opacity,
+ this.settings.fadeSpeed,
+ this.fadeInHandler
+ );
+
+ },
+
+
+ /*
+ * Function: postFadeIn
+ */
+ postFadeIn: function(e){
+
+ this.isFading = false;
+ this.addEventListeners();
+ this.dispatchEvent(Code.PhotoSwipe.ElementClass.EventTypes.onFadeIn);
+
+ },
+
+
+
+ /*
+ * Function: hide
+ */
+ hide: function(){
+
+ if (this.el === null){
+ return;
+ }
+
+ this.stopFade();
+
+ Util.DOM.hide(this.el);
+
+ this.postHide();
+
+ },
+
+
+ /*
+ * Function: postHide
+ * Overide this
+ */
+ postHide: function(){
+
+ this.removeEventListeners();
+ this.dispatchEvent(Code.PhotoSwipe.ElementClass.EventTypes.onHide);
+
+ },
+
+
+ /*
+ * Fuction: fadeOut
+ */
+ fadeOut: function(){
+
+ this.stopFade();
+
+ this.isFading = true;
+
+ Util.Animation.fadeOut(this.el, this.settings.fadeSpeed, this.fadeOutHandler);
+
+ },
+
+
+ /*
+ * Function: preFadeOut
+ */
+ postFadeOut: function(e){
+
+ this.isFading = false;
+
+ Util.DOM.hide(this.el);
+
+ this.removeEventListeners();
+
+ this.dispatchEvent(Code.PhotoSwipe.ElementClass.EventTypes.onFadeOut);
+
+ },
+
+
+ /*
+ * Function: stopFade
+ */
+ stopFade: function(){
+
+ if (this.el === null){
+ return;
+ }
+
+ Util.Animation.stopFade(this.el);
+ this.isFading = false;
+
+ },
+
+
+ /*
+ * Function: addEventListeners
+ */
+ addEventListeners: function(){
+
+ },
+
+
+ /*
+ * Function: removeEventListeners
+ */
+ removeEventListeners: function(){
+
+ }
+
+
+ });
+
+
+
+ Code.PhotoSwipe.ElementClass.EventTypes = {
+ onShow: 'onShow',
+ onHide: 'onHide',
+ onClick: 'onClick',
+ onFadeIn: 'onFadeIn',
+ onFadeOut: 'onFadeOut'
+ };
+
+
+})(Code.PhotoSwipe.Util);// PhotoSwipe - http://www.photoswipe.com/
+// Copyright (c) 2011 by Code Computerlove (http://www.codecomputerlove.com)
+// Licensed under the MIT license
+
+(function(Util){
+
+
+ /*
+ * Class: Code.PhotoSwipe.FullSizeImageClass
+ */
+ Code.PhotoSwipe.FullSizeImageClass = Code.PhotoSwipe.EventClass.extend({
+
+ el: null,
+ index: null,
+
+ // The naturalWidth and naturalHeight of the image as loaded from the server
+ // This maybe different from the width and height set on the img element
+ // We need this to scale the image correctly
+ naturalWidth: null,
+ naturalHeight: null,
+ src: null,
+ caption: null,
+ scaleMethod: null,
+ isLandscape: null,
+ isLoading: null,
+ hasLoaded: null,
+
+ loadEventHandler: null,
+
+
+ /*
+ * Function: init
+ */
+ init: function(index, scaleMethod, src, caption){
+
+ this._super();
+
+ this.index = index;
+ this.naturalWidth = 0;
+ this.naturalHeight = 0;
+ this.src = src;
+ this.caption = caption;
+ this.isLandscape = false;
+ this.isLoading = false;
+ this.hasLoaded = false;
+ this.scaleMethod = scaleMethod;
+
+ this.loadEventHandler = this.onLoad.bind(this);
+
+ },
+
+
+ /*
+ * Function: load
+ */
+ load: function(){
+
+ // Load in the image
+ this.isLoading = true;
+
+ this.el = new Image();
+ Util.DOM.addClass(this.el, 'ps-full-size-image');
+ this.el.onload = this.loadEventHandler;
+ this.el.src = this.src;
+
+ },
+
+
+ /*
+ * Function: onLoad
+ */
+ onLoad: function(){
+
+ this.naturalWidth = Util.coalesce(this.el.naturalWidth, this.el.width);
+ this.naturalHeight = Util.coalesce(this.el.naturalHeight, this.el.height);
+ this.isLandscape = (this.naturalWidth > this.naturalHeight);
+ this.isLoading = false;
+ this.hasLoaded = true;
+
+ this.dispatchEvent(Code.PhotoSwipe.FullSizeImageClass.EventTypes.onLoad);
+
+ }
+
+
+ });
+
+
+ Code.PhotoSwipe.FullSizeImageClass.EventTypes = {
+ onLoad: 'onLoad'
+ };
+
+
+})(Code.PhotoSwipe.Util);// PhotoSwipe - http://www.photoswipe.com/
+// Copyright (c) 2011 by Code Computerlove (http://www.codecomputerlove.com)
+// Licensed under the MIT license
+
+(function(Util){
+
+ /*
+ * Class: Code.PhotoSwipe.DocumentOverlayClass
+ */
+ Code.PhotoSwipe.DocumentOverlayClass = Code.PhotoSwipe.ElementClass.extend({
+
+ /*
+ * Function: init
+ */
+ init: function(options){
+
+ this._super(options);
+
+ // Create element and append to body
+ this.el = Util.DOM.createElement('div', { 'class': Code.PhotoSwipe.DocumentOverlayClass.CssClasses.documentOverlay }, '');
+ Util.DOM.setStyle(this.el, {
+ left: 0,
+ position: 'absolute',
+ top: 0
+ });
+ Util.DOM.hide(this.el);
+ Util.DOM.appendToBody(this.el);
+
+ },
+
+
+ /*
+ * Function: resetPosition
+ */
+ resetPosition: function(){
+
+ // Set the height and width to fill the document
+ Util.DOM.width(this.el, Util.DOM.bodyWidth());
+ Util.DOM.height(this.el, Util.DOM.bodyHeight());
+
+ }
+
+ });
+
+
+ Code.PhotoSwipe.DocumentOverlayClass.CssClasses = {
+ documentOverlay: 'ps-document-overlay'
+ };
+
+})(Code.PhotoSwipe.Util);// PhotoSwipe - http://www.photoswipe.com/
+// Copyright (c) 2011 by Code Computerlove (http://www.codecomputerlove.com)
+// Licensed under the MIT license
+
+(function(Util){
+
+ /*
+ * Class: Code.PhotoSwipe.ViewportClass
+ */
+ Code.PhotoSwipe.ViewportClass = Code.PhotoSwipe.ElementClass.extend({
+
+ touchStartPoint: null,
+ touchFingerCount: null,
+ touchCancelsMouseEvents: null,
+
+ touchStartHandler: null,
+ touchMoveHandler: null,
+ touchEndHandler: null,
+
+ mouseDownHandler: null,
+ mouseUpHandler: null,
+
+
+ /*
+ * Function: init
+ */
+ init: function(options){
+
+ this.settings = {
+ swipeThreshold: 500
+ };
+
+ Util.extend(this.settings, options);
+
+ this._super(this.settings);
+
+ this.touchFingerCount = 0;
+ this.touchStartPoint = { x: 0, y: 0 };
+ this.touchCancelsMouseEvents = false;
+
+ this.touchStartHandler = this.onTouchStart.bind(this);
+ this.touchMoveHandler = this.onTouchMove.bind(this);
+ this.touchEndHandler = this.onTouchEnd.bind(this);
+
+ this.mouseDownHandler = this.onMouseDown.bind(this);
+ this.mouseUpHandler = this.onMouseUp.bind(this);
+
+ // Create element and append to body
+ this.el = Util.DOM.createElement('div', { 'class': Code.PhotoSwipe.ViewportClass.CssClasses.viewport }, '');
+ Util.DOM.setStyle(this.el, {
+ position: 'absolute',
+ left: 0,
+ overflow: 'hidden'
+ });
+ Util.DOM.hide(this.el);
+ Util.DOM.appendToBody(this.el);
+
+ },
+
+
+ /*
+ * Function: resetPosition
+ */
+ resetPosition: function(){
+
+ // Set the height and width to fill the document
+ Util.DOM.setStyle(this.el, {
+ top: Util.DOM.windowScrollTop() + 'px'
+ });
+
+ Util.DOM.width(this.el, Util.DOM.bodyWidth());
+ Util.DOM.height(this.el, Util.DOM.windowHeight());
+
+ },
+
+
+ /*
+ * Function: addEventListeners
+ */
+ addEventListeners: function(){
+
+ try{
+ Util.DOM.addEventListener(this.el, 'touchstart', this.touchStartHandler);
+ Util.DOM.addEventListener(this.el, 'touchmove', this.touchMoveHandler);
+ Util.DOM.addEventListener(this.el, 'touchend', this.touchEndHandler);
+ }
+ catch (err){ }
+
+ Util.DOM.addEventListener(this.el, 'mousedown', this.mouseDownHandler);
+ Util.DOM.addEventListener(this.el, 'mouseup', this.mouseUpHandler);
+
+ },
+
+
+
+ /*
+ * Function: removeEventListeners
+ */
+ removeEventListeners: function(){
+
+ try{
+ Util.DOM.removeEventListener(this.el, 'touchstart', this.touchStartHandler);
+ Util.DOM.removeEventListener(this.el, 'touchmove', this.touchMoveHandler);
+ Util.DOM.removeEventListener(this.el, 'touchend', this.touchEndHandler);
+ }
+ catch (err){ }
+
+ Util.DOM.removeEventListener(this.el, 'mousedown', this.mouseDownHandler);
+ Util.DOM.removeEventListener(this.el, 'mouseup', this.mouseUpHandler);
+
+ },
+
+
+
+ /*
+ * Function: setCurrentTouchPoint
+ */
+ setCurrentTouchPoint: function(touchPoint, touches){
+
+ this.touchFingerCount = touches.length;
+
+ if (this.touchFingerCount === 1){
+ touchPoint.x = touches[0].pageX;
+ touchPoint.y = touches[0].pageY;
+ }
+ else{
+ this.touchFingerCount = 0;
+ touchPoint.x = 0;
+ touchPoint.y = 0;
+ }
+
+ },
+
+
+
+ /*
+ * Function: onTouch
+ */
+ onTouchStart: function(e){
+
+ e.preventDefault();
+
+ this.setCurrentTouchPoint(this.touchStartPoint, Util.DOM.getTouchEvent(e).touches);
+
+ },
+
+
+
+ /*
+ * Function: onTouchMove
+ * For some reason, even though it's not a requirement,
+ * if we don't listen out for the touchmove event,
+ * we are unable to detect the swipe on Blackberry6
+ */
+ onTouchMove: function(e){
+
+ e.preventDefault();
+
+ },
+
+
+
+ /*
+ * Function: onTouchEnd
+ */
+ onTouchEnd: function(e){
+
+ e.preventDefault();
+
+ var touchEndPoint = { x:0, y:0 };
+
+ var touchEvent = Util.DOM.getTouchEvent(e);
+
+ if (!Util.isNothing(touchEvent.changedTouches)){
+ // http://backtothecode.blogspot.com/2009/10/javascript-touch-and-gesture-events.html
+ // iOS removed the current touch from e.touches on "touchend"
+ // Need to look into e.changedTouches
+ this.setCurrentTouchPoint(touchEndPoint, touchEvent.changedTouches);
+ }
+ else{
+ this.setCurrentTouchPoint(touchEndPoint, touchEvent.touches);
+ }
+
+ if (this.touchFingerCount == 1){
+
+ this.fireTouchEvent(this.touchStartPoint, touchEndPoint);
+
+ }
+
+ },
+
+
+
+ /*
+ * Function: onMouseDown
+ */
+ onMouseDown: function(e){
+
+ e.preventDefault();
+ if (this.touchCancelsMouseEvents){
+ return;
+ }
+
+ this.touchStartPoint = Util.DOM.getMousePosition(e);
+
+ },
+
+
+
+ /*
+ * Function: onMouseUp
+ */
+ onMouseUp: function(e){
+
+ e.preventDefault();
+ if (this.touchCancelsMouseEvents){
+ return;
+ }
+
+ this.fireTouchEvent(this.touchStartPoint, Util.DOM.getMousePosition(e));
+
+ },
+
+
+
+ /*
+ * Function: fireTouchEvent
+ */
+ fireTouchEvent: function(touchStartPoint, touchEndPoint){
+
+ var action;
+
+ var distance = touchEndPoint.x - touchStartPoint.x;
+
+ if (Math.abs(distance) >= this.settings.swipeThreshold){
+
+ if (distance < 0){
+
+ // Swipe left
+ action = Code.PhotoSwipe.ViewportClass.Actions.swipeLeft;
+
+ }
+ else{
+
+ // Swipe right
+ action = Code.PhotoSwipe.ViewportClass.Actions.swipeRight;
+
+ }
+
+ }
+ else{
+
+ // Click
+ action = Code.PhotoSwipe.ViewportClass.Actions.click;
+
+ }
+
+ if (Util.isNothing(action)){
+ return;
+ }
+
+ this.dispatchEvent({
+ type: Code.PhotoSwipe.ViewportClass.EventTypes.onTouch,
+ target: this,
+ action: action
+ });
+
+ }
+
+ });
+
+
+ Code.PhotoSwipe.ViewportClass.CssClasses = {
+ viewport: 'ps-viewport'
+ };
+
+
+ Code.PhotoSwipe.ViewportClass.Actions = {
+ click: 'click',
+ swipeLeft: 'swipeLeft',
+ swipeRight: 'swipeRight'
+ };
+
+ Code.PhotoSwipe.ViewportClass.EventTypes = {
+ onTouch: 'onTouch'
+ };
+
+
+})(Code.PhotoSwipe.Util);
+
+// PhotoSwipe - http://www.photoswipe.com/
+// Copyright (c) 2011 by Code Computerlove (http://www.codecomputerlove.com)
+// Licensed under the MIT license
+
+(function(Util, FullSizeImageClass){
+
+ /*
+ * Class: Code.PhotoSwipe.SliderItemClass
+ */
+ Code.PhotoSwipe.SliderItemClass = Code.PhotoSwipe.EventClass.extend({
+
+ el: null,
+ imageEl: null,
+ parentEl: null,
+ fullSizeImage: null,
+
+ fullSizeImageLoadEventHandler: null,
+
+ /*
+ * Function: init
+ */
+ init: function(parentEl){
+
+ this._super();
+
+ this.parentEl = parentEl;
+
+ this.fullSizeImageLoadEventHandler = this.onFullSizeImageLoad.bind(this);
+
+ // Create element and append to parentEl
+ this.el = Util.DOM.createElement('div', { 'class': Code.PhotoSwipe.SliderItemClass.CssClasses.item + ' ' + Code.PhotoSwipe.SliderItemClass.CssClasses.loading }, '');
+ Util.DOM.setStyle(this.el, {
+ position: 'absolute',
+ top: 0
+ });
+ Util.DOM.resetTranslate(this.el);
+ Util.DOM.appendChild(this.el, this.parentEl);
+
+ // Create image element and append to slider item
+ this.imageEl = new Image();
+ Util.DOM.setStyle(this.imageEl, {
+ display: 'block',
+ position: 'absolute',
+ margin: 0,
+ padding: 0
+ });
+ Util.DOM.hide(this.imageEl);
+ Util.DOM.appendChild(this.imageEl, this.el);
+
+ },
+
+
+
+ /*
+ * Function: resetPosition
+ */
+ resetPosition: function(width, height, xPos){
+
+ Util.DOM.width(this.el, width);
+ Util.DOM.height(this.el, height);
+ Util.DOM.setStyle(this.el, 'left', xPos + 'px');
+
+ this.resetImagePosition();
+
+ },
+
+
+
+ /*
+ * Function: resetImagePosition
+ */
+ resetImagePosition: function(){
+
+ if (Util.isNothing(this.fullSizeImage)){
+ return;
+ }
+
+ var src = Util.DOM.getAttribute(this.imageEl, 'src');
+
+ var
+ scale,
+ newWidth,
+ newHeight,
+ newTop,
+ newLeft,
+ maxWidth = Util.DOM.width(this.el),
+ maxHeight = Util.DOM.height(this.el);
+
+ if (this.fullSizeImage.isLandscape) {
+ // Ensure the width fits the screen
+ scale = maxWidth / this.fullSizeImage.naturalWidth;
+ }
+ else {
+ // Ensure the height fits the screen
+ scale = maxHeight / this.fullSizeImage.naturalHeight;
+ }
+
+ newWidth = Math.round(this.fullSizeImage.naturalWidth * scale);
+ newHeight = Math.round(this.fullSizeImage.naturalHeight * scale);
+
+ if (this.fullSizeImage.scaleMethod === 'fit') {
+ // Rescale again to ensure full image fits into the viewport
+ scale = 1;
+ if (newWidth > maxWidth) {
+ scale = maxWidth / newWidth;
+ }
+ else if (newHeight > maxHeight) {
+ scale = maxHeight / newHeight;
+ }
+ if (scale !== 1) {
+ newWidth = Math.round(newWidth * scale);
+ newHeight = Math.round(newHeight * scale);
+ }
+ }
+
+ newTop = ((maxHeight - newHeight) / 2) + 'px';
+ newLeft = ((maxWidth - newWidth) / 2) + 'px';
+
+ Util.DOM.width(this.imageEl, newWidth);
+ Util.DOM.height(this.imageEl, newHeight);
+ Util.DOM.setStyle(this.imageEl, {
+ top: newTop,
+ left: newLeft
+ });
+
+ Util.DOM.show(this.imageEl);
+
+ },
+
+
+
+ /*
+ * Function: setFullSizeImage
+ */
+ setFullSizeImage: function(fullSizeImage){
+
+ this.fullSizeImage = fullSizeImage;
+
+ Util.DOM.removeClass(this.el, Code.PhotoSwipe.SliderItemClass.CssClasses.loading);
+ Util.DOM.removeClass(this.el, Code.PhotoSwipe.SliderItemClass.CssClasses.imageError);
+
+ // Something is wrong!
+ if (Util.isNothing(this.fullSizeImage)) {
+ this.fullSizeImage = null;
+ Util.DOM.addClass(this.el, Code.PhotoSwipe.SliderItemClass.CssClasses.imageError);
+ this.hideImage();
+ return;
+ }
+
+ // Still loading
+ if (!this.fullSizeImage.hasLoaded) {
+
+ Util.DOM.addClass(this.el, Code.PhotoSwipe.SliderItemClass.CssClasses.loading);
+ this.hideImage();
+
+ if (!this.fullSizeImage.isLoading){
+
+ // Trigger off the load
+ this.fullSizeImage.addEventListener(
+ FullSizeImageClass.EventTypes.onLoad,
+ this.fullSizeImageLoadEventHandler
+ );
+
+
+ this.fullSizeImage.load();
+
+ }
+
+ return;
+
+ }
+
+ // Loaded so show the image
+ Util.DOM.setAttribute(this.imageEl, 'src', this.fullSizeImage.src);
+
+ this.resetImagePosition();
+
+ this.dispatchEvent(Code.PhotoSwipe.SliderItemClass.EventTypes.onFullSizeImageDisplay);
+
+ },
+
+
+ /*
+ * Function: onFullSizeImageLoad
+ */
+ onFullSizeImageLoad: function(e){
+
+ e.target.removeEventListener(FullSizeImageClass.EventTypes.onLoad, this.fullSizeImageLoadEventHandler);
+
+ if (Util.isNothing(this.fullSizeImage) || e.target.index !== this.fullSizeImage.index){
+ // Chances are the user has moved the slider
+ // and the image to display in the item has now changed
+ // from when the item originally called the fullSizeImage
+ // to load. If that's the case, rethrow the event, the
+ // slider will be listening for this and can find a
+ // relevant slideitem for the loaded image
+ this.dispatchEvent({
+ type: Code.PhotoSwipe.SliderItemClass.EventTypes.onFullSizeImageLoadAnomaly,
+ target: this,
+ fullSizeImage: e.target
+ });
+ }
+ else{
+ this.setFullSizeImage(e.target);
+ }
+
+ },
+
+
+ /*
+ * Function: hideImage
+ */
+ hideImage: function(){
+
+ Util.DOM.removeAttribute(this.imageEl, 'src');
+ Util.DOM.hide(this.imageEl);
+
+ }
+
+
+ });
+
+
+ Code.PhotoSwipe.SliderItemClass.CssClasses = {
+ item: 'ps-slider-item',
+ loading: 'ps-slider-item-loading',
+ imageError: 'ps-slider-item-image-error'
+ };
+
+
+ Code.PhotoSwipe.SliderItemClass.EventTypes = {
+ onFullSizeImageDisplay: 'onFullSizeImageDisplay',
+ onFullSizeImageLoadAnomaly: 'onFullSizeImageLoadAnomaly'
+ };
+
+
+})(Code.PhotoSwipe.Util, Code.PhotoSwipe.FullSizeImageClass);// PhotoSwipe - http://www.photoswipe.com/
+// Copyright (c) 2011 by Code Computerlove (http://www.codecomputerlove.com)
+// Licensed under the MIT license
+
+(function(Util, SliderItemClass){
+
+ /*
+ * Class: Code.PhotoSwipe.SliderClass
+ */
+ Code.PhotoSwipe.SliderClass = Code.PhotoSwipe.ElementClass.extend({
+
+ parentEl: null,
+ parentElWidth: null,
+ parentElHeight: null,
+ items: null,
+
+ previousItem: null,
+ currentItem: null,
+ nextItem: null,
+
+ hasBounced: null,
+ lastShowAction: null,
+ bounceSlideBy: null,
+
+ showNextEndEventHandler: null,
+ showPreviousEndEventHandler: null,
+ bounceStepOneEventHandler: null,
+ bounceStepTwoEventHandler: null,
+
+ sliderFullSizeImageLoadAnomalyEventHandler: null,
+
+
+ /*
+ * Function: init
+ */
+ init: function(options, parentEl){
+
+ this.settings = {
+ slideSpeed: 250
+ };
+
+ Util.extend(this.settings, options);
+
+ this._super(this.settings);
+
+ this.parentEl = parentEl;
+
+ this.hasBounced = false;
+
+ this.showNextEndEventHandler = this.onShowNextEnd.bind(this);
+ this.showPreviousEndEventHandler = this.onShowPreviousEnd.bind(this);
+ this.bounceStepOneEventHandler = this.onBounceStepOne.bind(this);
+ this.bounceStepTwoEventHandler = this.onBounceStepTwo.bind(this);
+
+ this.sliderFullSizeImageLoadAnomalyEventHandler = this.onSliderFullSizeImageLoadAnomaly.bind(this);
+
+ // Create element and append to body
+ this.el = Util.DOM.createElement('div', { 'class': Code.PhotoSwipe.SliderClass.CssClasses.slider }, '');
+ Util.DOM.setStyle(this.el, {
+ position: 'absolute',
+ top: 0
+ });
+ Util.DOM.hide(this.el);
+ Util.DOM.appendChild(this.el, parentEl);
+
+ // Create previousItem, currentItem, nextItem
+ this.items = [];
+ this.items.push(new SliderItemClass(this.el));
+ this.items.push(new SliderItemClass(this.el));
+ this.items.push(new SliderItemClass(this.el));
+
+ this.previousItem = this.items[0];
+ this.currentItem = this.items[1];
+ this.nextItem = this.items[2];
+
+ },
+
+
+ /*
+ * Function: addEventListeners
+ */
+ addEventListeners: function(){
+
+ for (var i = 0; i 0){
+
+ this.fadeOutTimeout = window.setTimeout(
+ this.fadeOut.bind(this),
+ this.settings.captionDelay
+ );
+
+ }
+
+ this._super();
+
+ }
+
+ });
+
+
+ Code.PhotoSwipe.CaptionClass.CssClasses = {
+ caption: 'ps-caption',
+ bottom: 'ps-caption-bottom',
+ content: 'ps-caption-content'
+ };
+
+})(Code.PhotoSwipe.Util);// PhotoSwipe - http://www.photoswipe.com/
+// Copyright (c) 2011 by Code Computerlove (http://www.codecomputerlove.com)
+// Licensed under the MIT license
+
+(function(Util){
+
+ /*
+ * Class: Code.PhotoSwipe.ToolbarClass
+ */
+ Code.PhotoSwipe.ToolbarClass = Code.PhotoSwipe.ElementClass.extend({
+
+ closeEl: null,
+ previousEl: null,
+ nextEl: null,
+ playEl: null,
+
+ clickHandler: null,
+
+ fadeOutTimeout: null,
+ isNextActive: null,
+ isPreviousActive: null,
+
+
+ /*
+ * Function: init
+ */
+ init: function(options){
+
+ this.settings = {
+ toolbarDelay: 4000,
+ position: 'bottom'
+ };
+
+ Util.extend(this.settings, options);
+
+ this._super(options);
+
+ this.isNextActive = true;
+ this.isPreviousActive = true;
+
+ this.clickHandler = this.onClick.bind(this);
+
+ // Create element and append to body
+ var cssClass = Code.PhotoSwipe.ToolbarClass.CssClasses.caption;
+ if (this.settings.position === 'top'){
+ cssClass = cssClass + ' ' + Code.PhotoSwipe.ToolbarClass.CssClasses.top;
+ }
+
+ this.el = Util.DOM.createElement('div', { 'class': cssClass }, '');
+ Util.DOM.setStyle(this.el, {
+ left: 0,
+ position: 'absolute',
+ overflow: 'hidden',
+ zIndex: 1001,
+ display: 'table'
+ });
+ Util.DOM.hide(this.el);
+ Util.DOM.appendToBody(this.el);
+
+ // Close
+ this.closeEl = Util.DOM.createElement('div', { 'class': Code.PhotoSwipe.ToolbarClass.CssClasses.close }, '
');
+ Util.DOM.appendChild(this.closeEl, this.el);
+
+ // Play
+ this.playEl = Util.DOM.createElement('div', { 'class': Code.PhotoSwipe.ToolbarClass.CssClasses.play }, '
');
+ Util.DOM.appendChild(this.playEl, this.el);
+
+ // Previous
+ this.previousEl = Util.DOM.createElement('div', { 'class': Code.PhotoSwipe.ToolbarClass.CssClasses.previous }, '
');
+ Util.DOM.appendChild(this.previousEl, this.el);
+
+ // Next
+ this.nextEl = Util.DOM.createElement('div', { 'class': Code.PhotoSwipe.ToolbarClass.CssClasses.next }, '
');
+ Util.DOM.appendChild(this.nextEl, this.el);
+
+ },
+
+
+ /*
+ * Function: addEventListeners
+ */
+ addEventListeners: function(){
+
+ Util.DOM.addEventListener(this.el, 'click', this.clickHandler);
+
+ },
+
+
+ /*
+ * Function: removeEventListeners
+ */
+ removeEventListeners: function(){
+
+ Util.DOM.removeEventListener(this.el, 'click', this.clickHandler);
+
+ },
+
+
+ /*
+ * Function: onClick
+ */
+ onClick: function(e){
+
+ var action;
+
+ switch(e.target.parentNode){
+
+ case this.previousEl:
+ if (this.isPreviousActive){
+ action = Code.PhotoSwipe.ToolbarClass.Actions.previous;
+ }
+ break;
+
+ case this.nextEl:
+ if (this.isNextActive){
+ action = Code.PhotoSwipe.ToolbarClass.Actions.next;
+ }
+ break;
+
+ case this.playEl:
+ action = Code.PhotoSwipe.ToolbarClass.Actions.play;
+ break;
+
+ case this.closeEl:
+ action = Code.PhotoSwipe.ToolbarClass.Actions.close;
+ break;
+ }
+
+ if (Util.isNothing(action)){
+ return;
+ }
+
+ this.dispatchEvent({
+ type: Code.PhotoSwipe.ToolbarClass.EventTypes.onClick,
+ target: this,
+ action: action
+ });
+
+ },
+
+
+
+ /*
+ * Function: resetPosition
+ */
+ resetPosition: function(){
+
+ var top;
+
+ if (this.settings.position === 'bottom') {
+ top = Util.DOM.windowHeight() - Util.DOM.height(this.el) + Util.DOM.windowScrollTop();
+ }
+ else {
+ top = Util.DOM.windowScrollTop();
+ }
+
+ Util.DOM.setStyle(this.el, 'top', top + 'px');
+ Util.DOM.width(this.el, Util.DOM.bodyWidth());
+
+ },
+
+
+
+ /*
+ * Function: stopFade
+ */
+ stopFade: function(){
+
+ window.clearTimeout(this.fadeOutTimeout);
+ this._super();
+
+ },
+
+
+
+ /*
+ * Function: postShow
+ */
+ postShow: function(){
+
+ if (this.settings.toolbarDelay > 0){
+
+ this.fadeOutTimeout = window.setTimeout(
+ this.fadeOut.bind(this),
+ this.settings.toolbarDelay
+ );
+
+ }
+
+ this._super();
+
+ },
+
+
+ /*
+ * Function: setNextState
+ */
+ setNextState: function (disable) {
+
+ if (disable) {
+ Util.DOM.addClass(this.nextEl, Code.PhotoSwipe.ToolbarClass.CssClasses.nextDisabled);
+ this.isNextActive = false;
+ }
+ else {
+ Util.DOM.removeClass(this.nextEl, Code.PhotoSwipe.ToolbarClass.CssClasses.nextDisabled);
+ this.isNextActive = true;
+ }
+
+ },
+
+
+ /*
+ * Function: setPreviousState
+ */
+ setPreviousState: function (disable) {
+
+ if (disable) {
+ Util.DOM.addClass(this.previousEl, Code.PhotoSwipe.ToolbarClass.CssClasses.previousDisabled);
+ this.isPreviousActive = false;
+ }
+ else {
+ Util.DOM.removeClass(this.previousEl, Code.PhotoSwipe.ToolbarClass.CssClasses.previousDisabled);
+ this.isPreviousActive = true;
+ }
+
+ }
+
+ });
+
+
+
+ Code.PhotoSwipe.ToolbarClass.CssClasses = {
+ caption: 'ps-toolbar',
+ top: 'ps-toolbar-top',
+ close: 'ps-toolbar-close',
+ previous: 'ps-toolbar-previous',
+ previousDisabled: 'ps-toolbar-previous-disabled',
+ next: 'ps-toolbar-next',
+ nextDisabled: 'ps-toolbar-next-disabled',
+ play: 'ps-toolbar-play',
+ content: 'ps-toolbar-content'
+ };
+
+
+
+ Code.PhotoSwipe.ToolbarClass.Actions = {
+ close: 'close',
+ previous: 'previous',
+ next: 'next',
+ play: 'play'
+ };
+
+
+ Code.PhotoSwipe.ToolbarClass.EventTypes = {
+ onClick: 'onClick'
+ };
+
+})(Code.PhotoSwipe.Util);
+ // PhotoSwipe - http://www.photoswipe.com/
+// Copyright (c) 2011 by Code Computerlove (http://www.codecomputerlove.com)
+// Licensed under the MIT license
+
+(function(Util, ElementClass, DocumentOverlayClass, FullSizeImageClass, ViewportClass, SliderClass, CaptionClass, ToolbarClass){
+
+ var photoSwipe = Code.PhotoSwipe.EventClass.extend({
+
+ fullSizeImages: null,
+
+ documentOverlay: null,
+ viewport: null,
+ slider: null,
+ caption: null,
+ toolbar: null,
+
+ settings: null,
+ slideShowSettingsSaved: null,
+ currentIndex: null,
+ isBusy: null,
+
+ slideshowTimeout: null,
+
+
+ documentOverlayFadeInEventHandler: null,
+ windowResizeEventHandler: null,
+ windowOrientationChangeEventHandler: null,
+ windowScrollEventHandler: null,
+ keyDownEventHandler: null,
+ viewportTouchEventHandler: null,
+ viewportFadeOutEventHandler: null,
+ sliderDisplayCurrentFullSizeImageEventHandler: null,
+ toolbarClickEventHandler: null,
+
+
+ /*
+ * Function: init
+ */
+ init: function(){
+
+ this._super();
+
+ this.currentIndex = 0;
+ this.isBusy = false;
+
+ this.settings = {
+ getImageSource: Code.PhotoSwipe.GetImageSource,
+ getImageCaption: Code.PhotoSwipe.GetImageCaption,
+ fadeSpeed: 400,
+ slideSpeed: 250,
+ swipeThreshold: 50,
+ loop: true,
+
+ flipCaptionAndToolbar: false,
+
+ captionDelay: 3000,
+ captionOpacity: 0.8,
+ hideCaption: false,
+ showEmptyCaptions: true,
+
+ toolbarDelay: 3000,
+ toolbarOpacity: 0.8,
+ hideToolbar: false,
+
+ slideshowDelay: 3000,
+
+ imageScaleMethod: 'fit' // Either "fit" or "zoom"
+ };
+
+ // Set pointers to event handlers
+ this.documentOverlayFadeInEventHandler = this.onDocumentOverlayFadeIn.bind(this);
+ this.windowResizeEventHandler = this.onWindowResize.bind(this);
+ this.windowOrientationChangeEventHandler = this.onWindowOrientationChange.bind(this);
+ this.windowScrollEventHandler = this.onWindowScroll.bind(this);
+ this.keyDownEventHandler = this.onKeyDown.bind(this);
+ this.viewportTouchEventHandler = this.onViewportTouch.bind(this);
+ this.viewportFadeOutEventHandler = this.onViewportFadeOut.bind(this);
+ this.sliderDisplayCurrentFullSizeImageEventHandler = this.onSliderDisplayCurrentFullSizeImage.bind(this);
+ this.toolbarClickEventHandler = this.onToolbarClick.bind(this);
+
+ },
+
+
+
+ /*
+ * Function: setOptions
+ */
+ setOptions: function(options){
+
+ Util.extend(this.settings, options);
+
+ },
+
+
+
+ /*
+ * Function: setImages
+ * Set images from DOM elements. Could be a list of image
+ * elments or anchors containing image elements etc.
+ * By default the gallery assumes the latter. If you change
+ * this, remember to set your own getImageSource and getImageCaption
+ * methods so the gallery knows what to look for.
+ */
+ setImages: function(thumbEls){
+
+ if (!Util.isArray){
+ throw "thumbEls is not an array";
+ }
+
+ this.currentIndex = 0;
+
+ this.fullSizeImages = [];
+
+ for (var i=0; i= this.fullSizeImages.length){
+ startingIndex = 0;
+ }
+
+ this.currentIndex = startingIndex;
+
+ if (Util.isNothing(this.documentOverlay)){
+ this.build();
+ }
+
+ // Fade in the document overlay,
+ // then show the viewport, slider and toolbar etc
+ this.documentOverlay.addEventListener(
+ ElementClass.EventTypes.onFadeIn,
+ this.documentOverlayFadeInEventHandler
+ );
+
+ this.documentOverlay.fadeIn();
+
+ },
+
+
+
+ /*
+ * Function: build
+ */
+ build: function(){
+
+ // Create the document overlay
+ this.documentOverlay = new DocumentOverlayClass({
+ opacity: 1,
+ fadeSpeed: this.settings.fadeSpeed
+ });
+
+ // Create the viewport
+ this.viewport = new ViewportClass({
+ opacity: 1,
+ fadeSpeed: this.settings.fadeSpeed,
+ swipeThreshold: this.settings.swipeThreshold
+ });
+
+ // Create the slider
+ this.slider = new SliderClass(
+ {
+ opacity: 1,
+ fadeSpeed: this.settings.fadeSpeed,
+ slideSpeed: this.settings.slideSpeed
+ },
+ this.viewport.el
+ );
+
+ // Create the caption bar
+ this.caption = new CaptionClass({
+ opacity: this.settings.captionOpacity,
+ fadeSpeed: this.settings.fadeSpeed,
+ captionDelay: this.settings.captionDelay,
+ position: (this.settings.flipCaptionAndToolbar) ? 'bottom' : 'top'
+ });
+
+
+ // Create the toolbar
+ this.toolbar = new ToolbarClass({
+ opacity: this.settings.toolbarOpacity,
+ fadeSpeed: this.settings.fadeSpeed,
+ toolbarDelay: this.settings.toolbarDelay,
+ position: (this.settings.flipCaptionAndToolbar) ? 'top' : 'bottom'
+ });
+
+ },
+
+
+
+ /*
+ * Function: addEventListeners
+ */
+ addEventListeners: function(){
+
+ // Set window size handlers
+ if (!Util.isNothing(window.orientation)){
+ Util.DOM.addEventListener(window, 'orientationchange', this.windowOrientationChangeEventHandler);
+ }
+ Util.DOM.addEventListener(window, 'resize', this.windowResizeEventHandler);
+
+ Util.DOM.addEventListener(window, 'scroll', this.windowScrollEventHandler);
+
+ // Set keydown event handlers for desktop browsers
+ Util.DOM.addEventListener(document, 'keydown', this.keyDownEventHandler);
+
+ // Set viewport handlers
+ this.viewport.addEventListener(ViewportClass.EventTypes.onTouch, this.viewportTouchEventHandler);
+
+ // Set slider handlers
+ this.slider.addEventListener(SliderClass.EventTypes.onDisplayCurrentFullSizeImage, this.sliderDisplayCurrentFullSizeImageEventHandler);
+
+ // Set toolbar handlers
+ this.toolbar.addEventListener(ToolbarClass.EventTypes.onClick, this.toolbarClickEventHandler);
+
+ },
+
+
+
+ /*
+ * Function: removeEventListeners
+ */
+ removeEventListeners: function(){
+
+ // Remove window size handlers
+ if (!Util.isNothing(window.orientation)){
+ Util.DOM.removeEventListener(window, 'orientationchange', this.windowOrientationChangeEventHandler);
+ }
+
+ Util.DOM.removeEventListener(window, 'resize', this.windowResizeEventHandler);
+
+ Util.DOM.removeEventListener(window, 'scroll', this.windowScrollEventHandler);
+
+ // Remove keydown event handlers for desktop browsers
+ Util.DOM.removeEventListener(document, 'keydown', this.keyDownEventHandler);
+
+ // Remove viewport handlers
+ this.viewport.removeEventListener(ViewportClass.EventTypes.onTouch, this.viewportTouchEventHandler);
+
+ // Remove slider handlers
+ this.slider.removeEventListener(SliderClass.EventTypes.onDisplayCurrentFullSizeImage, this.sliderDisplayCurrentFullSizeImageEventHandler);
+
+ // Remove toolbar handlers
+ this.toolbar.removeEventListener(ToolbarClass.EventTypes.onClick, this.toolbarClickEventHandler);
+
+ },
+
+
+
+ /*
+ * Function: onDocumentOverlayFadeIn
+ */
+ onDocumentOverlayFadeIn: function(e){
+
+ // Remove the ElementClass.EventTypes.onFadeIn
+ // event handler
+ this.documentOverlay.removeEventListener(
+ ElementClass.EventTypes.onFadeIn,
+ this.documentOverlayFadeInEventHandler
+ );
+
+ this.viewport.show();
+
+ this.slider.show();
+
+ this.toolbar.show();
+
+ this.addEventListeners();
+
+ this.slider.setCurrentFullSizeImage(this.fullSizeImages[this.currentIndex]);
+
+ this.isBusy = false;
+
+ },
+
+
+ /*
+ * Function: setSliderPreviousAndNextFullSizeImages
+ */
+ setSliderPreviousAndNextFullSizeImages: function(){
+
+ var
+ lastIndex,
+ previousFullSizeImage = null,
+ nextFullSizeImage = null;
+
+ if (this.fullSizeImages.length > 1) {
+
+ lastIndex = this.fullSizeImages.length - 1;
+
+ // Current image is the last
+ if (this.currentIndex === lastIndex) {
+
+ if (this.settings.loop) {
+ nextFullSizeImage = this.fullSizeImages[0];
+ }
+ previousFullSizeImage = this.fullSizeImages[this.currentIndex - 1];
+
+ }
+
+ // Current image is the first
+ else if (this.currentIndex === 0) {
+
+ nextFullSizeImage = this.fullSizeImages[this.currentIndex + 1];
+ if (this.settings.loop) {
+ previousFullSizeImage = this.fullSizeImages[lastIndex];
+ }
+
+ }
+
+ // Current image is in the middle of the thumbs
+ else {
+
+ nextFullSizeImage = this.fullSizeImages[this.currentIndex + 1];
+ previousFullSizeImage = this.fullSizeImages[this.currentIndex - 1];
+
+ }
+
+ }
+
+ this.slider.setPreviousAndNextFullSizeImages(previousFullSizeImage, nextFullSizeImage);
+
+ },
+
+
+
+ /*
+ * Function: onWindowResize
+ */
+ onWindowResize: function(e){
+
+ this.resetPosition();
+
+ },
+
+
+
+ /*
+ * Function: onKeyDown
+ */
+ onKeyDown: function(e){
+
+ if (e.keyCode === 37) { // Left
+ e.preventDefault();
+ this.showPrevious();
+ }
+ else if (e.keyCode === 39) { // Right
+ e.preventDefault();
+ this.showNext();
+ }
+ else if (e.keyCode === 38 || e.keyCode === 40) { // Up and down
+ e.preventDefault();
+ }
+ else if (e.keyCode === 27) { // Escape
+ e.preventDefault();
+ //this.pause();
+ this.hide();
+ }
+ else if (e.keyCode === 32) { // Spacebar
+ e.preventDefault();
+ }
+
+ },
+
+
+
+ /*
+ * Function: onWindowOrientationChange
+ */
+ onWindowOrientationChange: function(e){
+
+ this.resetPosition();
+
+ },
+
+
+
+ /*
+ * Function: onWindowScroll
+ */
+ onWindowScroll: function(e){
+
+ this.resetPosition();
+
+ },
+
+
+
+ /*
+ * Function: resetPosition
+ */
+ resetPosition: function(){
+
+ if (this.isBusy){
+ return;
+ }
+
+ this.documentOverlay.resetPosition();
+ this.viewport.resetPosition();
+ this.slider.resetPosition();
+ this.caption.resetPosition();
+ this.toolbar.resetPosition();
+
+ },
+
+
+
+ /*
+ * Function: onViewportClick
+ */
+ onViewportTouch: function(e){
+
+ switch(e.action){
+
+ case ViewportClass.Actions.swipeLeft:
+ this.showNext();
+ break;
+
+ case ViewportClass.Actions.swipeRight:
+ this.showPrevious();
+ break;
+
+ default:
+ if (this.isSlideShowActive() || !this.settings.hideToolbar){
+ this.showCaptionAndToolbar();
+ }
+ else{
+ this.hide();
+ }
+ break;
+
+ }
+
+ },
+
+
+
+ /*
+ * Function: onViewportFadeOut
+ */
+ onViewportFadeOut: function(e){
+
+ this.viewport.removeEventListener(ElementClass.EventTypes.onFadeOut, this.viewportFadeOutEventHandler);
+
+ this.isBusy = false;
+
+ },
+
+
+
+ /*
+ * Function: hide
+ */
+ hide: function(){
+
+ if (this.isBusy){
+ return;
+ }
+
+ this.isBusy = true;
+
+ this.removeEventListeners();
+
+ this.documentOverlay.hide();
+ this.caption.hide();
+ this.toolbar.hide();
+ this.slider.hide();
+
+ Util.DOM.removeClass(document.body, Code.PhotoSwipe.CssClasses.activeBody);
+
+ this.viewport.addEventListener(ElementClass.EventTypes.onFadeOut, this.viewportFadeOutEventHandler);
+
+ this.viewport.fadeOut();
+
+ },
+
+
+
+ /*
+ * Function: showNext
+ */
+ showNext: function(){
+
+ if (this.isBusy){
+ return;
+ }
+
+ this.isBusy = true;
+
+ this.caption.setEmptyCaption();
+
+ this.slider.showNext();
+
+ },
+
+
+
+ /*
+ * Function: showPrevious
+ */
+ showPrevious: function(){
+
+ if (this.isBusy){
+ return;
+ }
+
+ this.isBusy = true;
+
+ this.caption.setEmptyCaption();
+
+ this.slider.showPrevious();
+
+ },
+
+
+
+
+ /*
+ * Function: onSliderDisplayCurrentFullSizeImage
+ */
+ onSliderDisplayCurrentFullSizeImage: function(e){
+
+ this.currentIndex = e.fullSizeImage.index;
+
+ // Set the previous and next images for the slider
+ this.setSliderPreviousAndNextFullSizeImages();
+
+ this.isBusy = false;
+
+ if (this.isSlideShowActive()){
+ if (!this.settings.loop && this.currentIndex === this.fullSizeImages.length-1){
+ // Slideshow as reached the end
+ this.slideshowTimeout = window.setTimeout(
+ this.showCaptionAndToolbar.bind(this),
+ this.settings.slideshowDelay
+ );
+ }
+ else{
+ this.fireSlideshowTimeout();
+ }
+ }
+ else{
+ this.showCaptionAndToolbar();
+ }
+
+ },
+
+
+ /*
+ * Function: showCaptionAndToolbar
+ */
+ showCaptionAndToolbar: function(captionValue){
+
+ this.stopSlideshow();
+
+
+ // Caption
+ if (this.settings.hideCaption){
+ this.caption.hide();
+ }
+ else{
+ captionValue = Util.coalesce(captionValue, this.fullSizeImages[this.currentIndex].caption);
+
+ if ( (Util.isNothing(captionValue) || captionValue === '') && !this.settings.showEmptyCaptions ){
+ this.caption.hide();
+ return;
+ }
+
+ this.caption.show(captionValue);
+ }
+
+
+
+ // Toolbar
+ if (this.settings.hideToolbar){
+ this.toolbar.hide();
+ }
+ else{
+ if (this.settings.loop) {
+ this.toolbar.setNextState(false);
+ this.toolbar.setPreviousState(false);
+ }
+ else{
+ if (this.currentIndex >= this.fullSizeImages.length - 1) {
+ this.toolbar.setNextState(true);
+ }
+ else {
+ this.toolbar.setNextState(false);
+ }
+
+ if (this.currentIndex < 1) {
+ this.toolbar.setPreviousState(true);
+ }
+ else {
+ this.toolbar.setPreviousState(false);
+ }
+ }
+
+ this.toolbar.show();
+ }
+
+ },
+
+
+
+ /*
+ * Function: onToolbarClick
+ */
+ onToolbarClick: function(e){
+
+ switch (e.action){
+
+ case ToolbarClass.Actions.previous:
+ this.showPrevious();
+ break;
+
+ case ToolbarClass.Actions.next:
+ this.showNext();
+ break;
+
+ case ToolbarClass.Actions.play:
+ this.startSlideshow();
+ break;
+
+ default:
+ this.hide();
+ break;
+
+ }
+
+ },
+
+
+
+ /*
+ * Function: startSlideshow
+ */
+ startSlideshow: function(){
+
+ if (this.isBusy){
+ return;
+ }
+
+ window.clearTimeout(this.slideshowTimeout);
+
+ this.slideShowSettingsSaved = {
+ hideCaption: this.settings.hideCaption,
+ hideToolbar: this.settings.hideToolbar
+ };
+
+ this.settings.hideCaption = true;
+ this.settings.hideToolbar = true;
+
+ this.caption.fadeOut();
+ this.toolbar.fadeOut();
+
+ this.fireSlideshowTimeout();
+
+ },
+
+
+
+ /*
+ * Function: stopSlideshow
+ */
+ stopSlideshow: function(){
+
+ if (!this.isSlideShowActive()){
+ return;
+ }
+
+ window.clearTimeout(this.slideshowTimeout);
+
+ this.settings.hideCaption = this.slideShowSettingsSaved.hideCaption;
+ this.settings.hideToolbar = this.slideShowSettingsSaved.hideToolbar;
+
+ this.slideShowSettingsSaved = null;
+
+ },
+
+
+ /*
+ * Function: isSlideShowActive
+ */
+ isSlideShowActive: function(){
+
+ return (!Util.isNothing(this.slideShowSettingsSaved));
+
+ },
+
+
+ /*
+ * Function: fireSlideshowTimeout
+ */
+ fireSlideshowTimeout: function(){
+
+ this.slideshowTimeout = window.setTimeout(
+ this.showNext.bind(this),
+ this.settings.slideshowDelay
+ );
+
+ }
+
+
+ });
+
+
+ Code.PhotoSwipe.CssClasses = {
+ activeBody: 'ps-active'
+ };
+
+ /*
+ * Function: Code.PhotoSwipe.GetImageSource
+ * Default method for returning an image's source
+ */
+ Code.PhotoSwipe.GetImageSource = function(el){
+ return el.href;
+ };
+
+
+
+ /*
+ * Function: Code.PhotoSwipe.GetImageCaption
+ * Default method for returning an image's caption
+ * Assumes the el is an anchor and the first child is the
+ * image. The returned value is the "alt" attribute of the
+ * image.
+ */
+ Code.PhotoSwipe.GetImageCaption = function(el){
+ if (el.nodeName === "IMG"){
+ return Util.DOM.getAttribute(el, 'alt');
+ }
+ return Util.DOM.getAttribute(el.firstChild, 'alt');
+ };
+
+
+ Code.PhotoSwipe.Current = new photoSwipe();
+
+
+ Code.photoSwipe = function(thumbEls, containerEl, opts){
+
+ var useEventDelegation = true;
+
+ if (Util.isNothing(thumbEls)){
+ return;
+ }
+
+ /* See if there is a container element, if so we will use event delegation */
+
+ if (Util.isNothing(containerEl)){
+ containerEl = document.documentElement;
+ useEventDelegation = false;
+ }
+
+ if (Util.isString(containerEl)){
+ containerEl = document.documentElement.querySelector(containerEl);
+ }
+
+ if (Util.isNothing(containerEl)){
+ throw 'Unable to find container element';
+ }
+
+ if (Util.isString(thumbEls)){
+ thumbEls = containerEl.querySelectorAll(thumbEls);
+ }
+
+ if (Util.isNothing(thumbEls)){
+ return;
+ }
+
+
+ // Set up the options
+ Code.PhotoSwipe.Current.setOptions(opts);
+
+
+ // Tell PhotoSwipe about the photos
+ Code.PhotoSwipe.Current.setImages(thumbEls);
+
+
+ if (useEventDelegation){
+
+ /*
+ * Use event delegation rather than setting a click event on each
+ * thumb element.
+ */
+ containerEl.addEventListener('click', function(e){
+
+ if (e.target === e.currentTarget){
+ return;
+ }
+
+ e.preventDefault();
+
+ var findNode = function(clickedEl, targetNodeName, stopAtEl){
+
+ if (Util.isNothing(clickedEl) || Util.isNothing(targetNodeName) || Util.isNothing(stopAtEl)){
+ return null;
+ }
+
+ if (clickedEl.nodeName === targetNodeName){
+ return clickedEl;
+ }
+
+ if (clickedEl === stopAtEl){
+ return null;
+ }
+
+ return findNode(clickedEl.parentNode, targetNodeName, stopAtEl)
+ };
+
+
+ var clickedEl = findNode(e.target, thumbEls[0].nodeName, e.currentTarget);
+
+ if (Util.isNothing(clickedEl)){
+ return;
+ }
+
+ showPhotoSwipe(clickedEl);
+
+ }, false);
+
+ }
+ else{
+
+ // Add a click event handler on each element
+ for (var i = 0; i < thumbEls.length; i++){
+
+ var thumbEl = thumbEls[i];
+ thumbEl.addEventListener('click', function(e){
+
+ e.preventDefault();
+
+ showPhotoSwipe(e.currentTarget);
+
+ }, false);
+
+ }
+
+ }
+
+
+ var showPhotoSwipe = function(clickedEl){
+
+ var startingIndex = 0;
+ for (startingIndex; startingIndex < thumbEls.length; startingIndex++){
+ if (thumbEls[startingIndex] === clickedEl){
+ break;
+ }
+ }
+
+ Code.PhotoSwipe.Current.show(startingIndex);
+
+ };
+
+ };
+
+
+
+ /*
+ * jQuery plugin
+ */
+ if (!Util.isNothing(window.jQuery)){
+
+ window.jQuery.fn.photoSwipe = function (opts) {
+
+ var thumbEls = this;
+ Code.PhotoSwipe.Current.setOptions(opts);
+ Code.PhotoSwipe.Current.setImages(thumbEls);
+
+ $(thumbEls).live('click', function(e){
+
+ e.preventDefault();
+
+ var startingIndex = $(thumbEls).index($(e.currentTarget));
+ Code.PhotoSwipe.Current.show(startingIndex);
+
+ });
+
+ };
+
+ }
+
+
+})
+(
+ Code.PhotoSwipe.Util,
+ Code.PhotoSwipe.ElementClass,
+ Code.PhotoSwipe.DocumentOverlayClass,
+ Code.PhotoSwipe.FullSizeImageClass,
+ Code.PhotoSwipe.ViewportClass,
+ Code.PhotoSwipe.SliderClass,
+ Code.PhotoSwipe.CaptionClass,
+ Code.PhotoSwipe.ToolbarClass
+);
\ No newline at end of file
diff --git a/artifact/1.0.0/code-photoswipe-jQuery-1.0.0.min.js b/artifact/1.0.0/code-photoswipe-jQuery-1.0.0.min.js
new file mode 100644
index 000000000..689c713fa
--- /dev/null
+++ b/artifact/1.0.0/code-photoswipe-jQuery-1.0.0.min.js
@@ -0,0 +1,130 @@
+// PhotoSwipe - http://www.photoswipe.com/
+// Copyright (c) 2011 by Code Computerlove (http://www.codecomputerlove.com)
+// Licensed under the MIT license
+// version: 1.0.0.111
+
+(function(){if(!Function.prototype.bind){Function.prototype.bind=function(obj){var slice=[].slice,args=slice.call(arguments,1),self=this,nop=function(){},bound=function(){return self.apply(this instanceof nop?this:(obj||{}),args.concat(slice.call(arguments)));};nop.prototype=self.prototype;bound.prototype=new nop();return bound;};}
+if(typeof Code==="undefined"){Code={};Code.PhotoSwipe={};}
+Code.PhotoSwipe.Util={browser:{version:(navigator.userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],webkit:/webkit/.test(navigator.userAgent),opera:/opera/.test(navigator.userAgent),msie:/msie/.test(navigator.userAgent)&&!/opera/.test(navigator.userAgent),mozilla:/mozilla/.test(navigator.userAgent)&&!/(compatible|webkit)/.test(navigator.userAgent),mobileSafari:/Mac OS X.*Mobile.*Safari/.test(navigator.userAgent)},setElementData:function(el,key,value){if(this.isNothing(el.UtilData)){el.UtilData={};}
+el.UtilData[key]=value;},getElementData:function(el,key,defaultValue){if(typeof defaultValue==="undefined"){defaultValue=null;}
+if(this.isNothing(el.UtilData)){return defaultValue;}
+if(this.isNothing(el.UtilData[key])){return defaultValue;}
+return el.UtilData[key];},removeElementData:function(el,key){delete el.UtilData[key];},coalesce:function(){var i;for(i=0;i'+type+'>');retval.attr(attributes);retval.append(content);return retval[0];},appendChild:function(childEl,parentEl){$(parentEl).append(childEl);},appendText:function(text,parentEl){$(parentEl).text(text);},appendToBody:function(childEl){$('body').append(childEl);},removeChild:function(childEl,parentEl){$(parentEl).remove(childEl);},removeChildren:function(parentEl){$(parentEl).empty();},hasAttribute:function(el,attributeName){return Util.isNothing($(el).attr(attributeName));},getAttribute:function(el,attributeName){return $(el).attr(attributeName);},setAttribute:function(el,attributeName,value){$(el).attr(attributeName,value);},removeAttribute:function(el,attributeName){$(el).removeAttr(attributeName);},addClass:function(el,className){$(el).addClass(className);},removeClass:function(el,className){$(el).removeClass(className);},hasClass:function(el,className){$(el).hasClass(className);},setStyle:function(el,style,value){if(Util.isObject(style)){$(el).css(style);}
+else{$(el).css(style,value);}},getStyle:function(el,styleName){return $(el).css(styleName);},hide:function(el){$(el).hide();},show:function(el){$(el).show();},width:function(el,value){if(!Util.isNothing(value)){$(el).width(value);}
+return $(el).width();},outerWidth:function(el){return $(el).outerWidth();},height:function(el,value){if(!Util.isNothing(value)){$(el).height(value);}
+return $(el).height();},outerHeight:function(el){return $(el).outerHeight();},documentWidth:function(){return $(document.documentElement).width();},documentHeight:function(){return $(document.documentElement).height();},bodyWidth:function(){return $(document.body).width();},bodyHeight:function(){return $(document.body).height();},windowWidth:function(){return $(window).width();},windowHeight:function(){return $(window).height();},windowScrollLeft:function(){return $(window).scrollLeft();},windowScrollTop:function(){return $(window).scrollTop();},addEventListener:function(el,type,listener){$(el).bind(type,listener);},removeEventListener:function(el,type,listener){$(el).unbind(type,listener);},getMousePosition:function(event){var retval={x:event.pageX,y:event.pageY}
+return retval;},getTouchEvent:function(event){return event.originalEvent;}}});})(Code.PhotoSwipe.Util);(function(Util){Util.extend(Util,{Animation:{stopFade:function(el){$(el).stop(true,true);},fadeIn:function(el,opacity,duration,callback){opacity=Util.coalesce(opacity,1);duration=Util.coalesce(duration,500);$(el).fadeTo(duration,opacity,callback);},fadeOut:function(el,duration,callback){if(Util.isNothing(duration)){duration=500;}
+$(el).fadeTo(duration,0,callback);},slideBy:function(el,xPos,yPos,duration,callback){if(Util.isNothing(duration)){duration=500;}
+$(el).animate({left:'+='+xPos+'px',top:'+='+yPos+'px'},duration,callback);}}});})(Code.PhotoSwipe.Util);(function(){Code.PhotoSwipe.EventClass=Class.extend({_listeners:null,init:function(){this._listeners={};},addEventListener:function(type,listener){if(typeof this._listeners[type]==='undefined'){this._listeners[type]=[];}
+this._listeners[type].push(listener);},dispatchEvent:function(event){if(typeof event=="string"){event={type:event};}
+if(!event.target){event.target=this;}
+if(!event.type){throw new Error("Event object missing 'type' property.");}
+if(this._listeners[event.type]instanceof Array){var listeners=this._listeners[event.type];for(var i=0,len=listeners.length;ithis.naturalHeight);this.isLoading=false;this.hasLoaded=true;this.dispatchEvent(Code.PhotoSwipe.FullSizeImageClass.EventTypes.onLoad);}});Code.PhotoSwipe.FullSizeImageClass.EventTypes={onLoad:'onLoad'};})(Code.PhotoSwipe.Util);(function(Util){Code.PhotoSwipe.DocumentOverlayClass=Code.PhotoSwipe.ElementClass.extend({init:function(options){this._super(options);this.el=Util.DOM.createElement('div',{'class':Code.PhotoSwipe.DocumentOverlayClass.CssClasses.documentOverlay},'');Util.DOM.setStyle(this.el,{left:0,position:'absolute',top:0});Util.DOM.hide(this.el);Util.DOM.appendToBody(this.el);},resetPosition:function(){Util.DOM.width(this.el,Util.DOM.bodyWidth());Util.DOM.height(this.el,Util.DOM.bodyHeight());}});Code.PhotoSwipe.DocumentOverlayClass.CssClasses={documentOverlay:'ps-document-overlay'};})(Code.PhotoSwipe.Util);(function(Util){Code.PhotoSwipe.ViewportClass=Code.PhotoSwipe.ElementClass.extend({touchStartPoint:null,touchFingerCount:null,touchCancelsMouseEvents:null,touchStartHandler:null,touchMoveHandler:null,touchEndHandler:null,mouseDownHandler:null,mouseUpHandler:null,init:function(options){this.settings={swipeThreshold:500};Util.extend(this.settings,options);this._super(this.settings);this.touchFingerCount=0;this.touchStartPoint={x:0,y:0};this.touchCancelsMouseEvents=false;this.touchStartHandler=this.onTouchStart.bind(this);this.touchMoveHandler=this.onTouchMove.bind(this);this.touchEndHandler=this.onTouchEnd.bind(this);this.mouseDownHandler=this.onMouseDown.bind(this);this.mouseUpHandler=this.onMouseUp.bind(this);this.el=Util.DOM.createElement('div',{'class':Code.PhotoSwipe.ViewportClass.CssClasses.viewport},'');Util.DOM.setStyle(this.el,{position:'absolute',left:0,overflow:'hidden'});Util.DOM.hide(this.el);Util.DOM.appendToBody(this.el);},resetPosition:function(){Util.DOM.setStyle(this.el,{top:Util.DOM.windowScrollTop()+'px'});Util.DOM.width(this.el,Util.DOM.bodyWidth());Util.DOM.height(this.el,Util.DOM.windowHeight());},addEventListeners:function(){try{Util.DOM.addEventListener(this.el,'touchstart',this.touchStartHandler);Util.DOM.addEventListener(this.el,'touchmove',this.touchMoveHandler);Util.DOM.addEventListener(this.el,'touchend',this.touchEndHandler);}
+catch(err){}
+Util.DOM.addEventListener(this.el,'mousedown',this.mouseDownHandler);Util.DOM.addEventListener(this.el,'mouseup',this.mouseUpHandler);},removeEventListeners:function(){try{Util.DOM.removeEventListener(this.el,'touchstart',this.touchStartHandler);Util.DOM.removeEventListener(this.el,'touchmove',this.touchMoveHandler);Util.DOM.removeEventListener(this.el,'touchend',this.touchEndHandler);}
+catch(err){}
+Util.DOM.removeEventListener(this.el,'mousedown',this.mouseDownHandler);Util.DOM.removeEventListener(this.el,'mouseup',this.mouseUpHandler);},setCurrentTouchPoint:function(touchPoint,touches){this.touchFingerCount=touches.length;if(this.touchFingerCount===1){touchPoint.x=touches[0].pageX;touchPoint.y=touches[0].pageY;}
+else{this.touchFingerCount=0;touchPoint.x=0;touchPoint.y=0;}},onTouchStart:function(e){e.preventDefault();this.setCurrentTouchPoint(this.touchStartPoint,Util.DOM.getTouchEvent(e).touches);},onTouchMove:function(e){e.preventDefault();},onTouchEnd:function(e){e.preventDefault();var touchEndPoint={x:0,y:0};var touchEvent=Util.DOM.getTouchEvent(e);if(!Util.isNothing(touchEvent.changedTouches)){this.setCurrentTouchPoint(touchEndPoint,touchEvent.changedTouches);}
+else{this.setCurrentTouchPoint(touchEndPoint,touchEvent.touches);}
+if(this.touchFingerCount==1){this.fireTouchEvent(this.touchStartPoint,touchEndPoint);}},onMouseDown:function(e){e.preventDefault();if(this.touchCancelsMouseEvents){return;}
+this.touchStartPoint=Util.DOM.getMousePosition(e);},onMouseUp:function(e){e.preventDefault();if(this.touchCancelsMouseEvents){return;}
+this.fireTouchEvent(this.touchStartPoint,Util.DOM.getMousePosition(e));},fireTouchEvent:function(touchStartPoint,touchEndPoint){var action;var distance=touchEndPoint.x-touchStartPoint.x;if(Math.abs(distance)>=this.settings.swipeThreshold){if(distance<0){action=Code.PhotoSwipe.ViewportClass.Actions.swipeLeft;}
+else{action=Code.PhotoSwipe.ViewportClass.Actions.swipeRight;}}
+else{action=Code.PhotoSwipe.ViewportClass.Actions.click;}
+if(Util.isNothing(action)){return;}
+this.dispatchEvent({type:Code.PhotoSwipe.ViewportClass.EventTypes.onTouch,target:this,action:action});}});Code.PhotoSwipe.ViewportClass.CssClasses={viewport:'ps-viewport'};Code.PhotoSwipe.ViewportClass.Actions={click:'click',swipeLeft:'swipeLeft',swipeRight:'swipeRight'};Code.PhotoSwipe.ViewportClass.EventTypes={onTouch:'onTouch'};})(Code.PhotoSwipe.Util);(function(Util,FullSizeImageClass){Code.PhotoSwipe.SliderItemClass=Code.PhotoSwipe.EventClass.extend({el:null,imageEl:null,parentEl:null,fullSizeImage:null,fullSizeImageLoadEventHandler:null,init:function(parentEl){this._super();this.parentEl=parentEl;this.fullSizeImageLoadEventHandler=this.onFullSizeImageLoad.bind(this);this.el=Util.DOM.createElement('div',{'class':Code.PhotoSwipe.SliderItemClass.CssClasses.item+' '+Code.PhotoSwipe.SliderItemClass.CssClasses.loading},'');Util.DOM.setStyle(this.el,{position:'absolute',top:0});Util.DOM.resetTranslate(this.el);Util.DOM.appendChild(this.el,this.parentEl);this.imageEl=new Image();Util.DOM.setStyle(this.imageEl,{display:'block',position:'absolute',margin:0,padding:0});Util.DOM.hide(this.imageEl);Util.DOM.appendChild(this.imageEl,this.el);},resetPosition:function(width,height,xPos){Util.DOM.width(this.el,width);Util.DOM.height(this.el,height);Util.DOM.setStyle(this.el,'left',xPos+'px');this.resetImagePosition();},resetImagePosition:function(){if(Util.isNothing(this.fullSizeImage)){return;}
+var src=Util.DOM.getAttribute(this.imageEl,'src');var
+scale,newWidth,newHeight,newTop,newLeft,maxWidth=Util.DOM.width(this.el),maxHeight=Util.DOM.height(this.el);if(this.fullSizeImage.isLandscape){scale=maxWidth/this.fullSizeImage.naturalWidth;}
+else{scale=maxHeight/this.fullSizeImage.naturalHeight;}
+newWidth=Math.round(this.fullSizeImage.naturalWidth*scale);newHeight=Math.round(this.fullSizeImage.naturalHeight*scale);if(this.fullSizeImage.scaleMethod==='fit'){scale=1;if(newWidth>maxWidth){scale=maxWidth/newWidth;}
+else if(newHeight>maxHeight){scale=maxHeight/newHeight;}
+if(scale!==1){newWidth=Math.round(newWidth*scale);newHeight=Math.round(newHeight*scale);}}
+newTop=((maxHeight-newHeight)/2)+'px';newLeft=((maxWidth-newWidth)/2)+'px';Util.DOM.width(this.imageEl,newWidth);Util.DOM.height(this.imageEl,newHeight);Util.DOM.setStyle(this.imageEl,{top:newTop,left:newLeft});Util.DOM.show(this.imageEl);},setFullSizeImage:function(fullSizeImage){this.fullSizeImage=fullSizeImage;Util.DOM.removeClass(this.el,Code.PhotoSwipe.SliderItemClass.CssClasses.loading);Util.DOM.removeClass(this.el,Code.PhotoSwipe.SliderItemClass.CssClasses.imageError);if(Util.isNothing(this.fullSizeImage)){this.fullSizeImage=null;Util.DOM.addClass(this.el,Code.PhotoSwipe.SliderItemClass.CssClasses.imageError);this.hideImage();return;}
+if(!this.fullSizeImage.hasLoaded){Util.DOM.addClass(this.el,Code.PhotoSwipe.SliderItemClass.CssClasses.loading);this.hideImage();if(!this.fullSizeImage.isLoading){this.fullSizeImage.addEventListener(FullSizeImageClass.EventTypes.onLoad,this.fullSizeImageLoadEventHandler);this.fullSizeImage.load();}
+return;}
+Util.DOM.setAttribute(this.imageEl,'src',this.fullSizeImage.src);this.resetImagePosition();this.dispatchEvent(Code.PhotoSwipe.SliderItemClass.EventTypes.onFullSizeImageDisplay);},onFullSizeImageLoad:function(e){e.target.removeEventListener(FullSizeImageClass.EventTypes.onLoad,this.fullSizeImageLoadEventHandler);if(Util.isNothing(this.fullSizeImage)||e.target.index!==this.fullSizeImage.index){this.dispatchEvent({type:Code.PhotoSwipe.SliderItemClass.EventTypes.onFullSizeImageLoadAnomaly,target:this,fullSizeImage:e.target});}
+else{this.setFullSizeImage(e.target);}},hideImage:function(){Util.DOM.removeAttribute(this.imageEl,'src');Util.DOM.hide(this.imageEl);}});Code.PhotoSwipe.SliderItemClass.CssClasses={item:'ps-slider-item',loading:'ps-slider-item-loading',imageError:'ps-slider-item-image-error'};Code.PhotoSwipe.SliderItemClass.EventTypes={onFullSizeImageDisplay:'onFullSizeImageDisplay',onFullSizeImageLoadAnomaly:'onFullSizeImageLoadAnomaly'};})(Code.PhotoSwipe.Util,Code.PhotoSwipe.FullSizeImageClass);(function(Util,SliderItemClass){Code.PhotoSwipe.SliderClass=Code.PhotoSwipe.ElementClass.extend({parentEl:null,parentElWidth:null,parentElHeight:null,items:null,previousItem:null,currentItem:null,nextItem:null,hasBounced:null,lastShowAction:null,bounceSlideBy:null,showNextEndEventHandler:null,showPreviousEndEventHandler:null,bounceStepOneEventHandler:null,bounceStepTwoEventHandler:null,sliderFullSizeImageLoadAnomalyEventHandler:null,init:function(options,parentEl){this.settings={slideSpeed:250};Util.extend(this.settings,options);this._super(this.settings);this.parentEl=parentEl;this.hasBounced=false;this.showNextEndEventHandler=this.onShowNextEnd.bind(this);this.showPreviousEndEventHandler=this.onShowPreviousEnd.bind(this);this.bounceStepOneEventHandler=this.onBounceStepOne.bind(this);this.bounceStepTwoEventHandler=this.onBounceStepTwo.bind(this);this.sliderFullSizeImageLoadAnomalyEventHandler=this.onSliderFullSizeImageLoadAnomaly.bind(this);this.el=Util.DOM.createElement('div',{'class':Code.PhotoSwipe.SliderClass.CssClasses.slider},'');Util.DOM.setStyle(this.el,{position:'absolute',top:0});Util.DOM.hide(this.el);Util.DOM.appendChild(this.el,parentEl);this.items=[];this.items.push(new SliderItemClass(this.el));this.items.push(new SliderItemClass(this.el));this.items.push(new SliderItemClass(this.el));this.previousItem=this.items[0];this.currentItem=this.items[1];this.nextItem=this.items[2];},addEventListeners:function(){for(var i=0;i0){this.fadeOutTimeout=window.setTimeout(this.fadeOut.bind(this),this.settings.captionDelay);}
+this._super();}});Code.PhotoSwipe.CaptionClass.CssClasses={caption:'ps-caption',bottom:'ps-caption-bottom',content:'ps-caption-content'};})(Code.PhotoSwipe.Util);(function(Util){Code.PhotoSwipe.ToolbarClass=Code.PhotoSwipe.ElementClass.extend({closeEl:null,previousEl:null,nextEl:null,playEl:null,clickHandler:null,fadeOutTimeout:null,isNextActive:null,isPreviousActive:null,init:function(options){this.settings={toolbarDelay:4000,position:'bottom'};Util.extend(this.settings,options);this._super(options);this.isNextActive=true;this.isPreviousActive=true;this.clickHandler=this.onClick.bind(this);var cssClass=Code.PhotoSwipe.ToolbarClass.CssClasses.caption;if(this.settings.position==='top'){cssClass=cssClass+' '+Code.PhotoSwipe.ToolbarClass.CssClasses.top;}
+this.el=Util.DOM.createElement('div',{'class':cssClass},'');Util.DOM.setStyle(this.el,{left:0,position:'absolute',overflow:'hidden',zIndex:1001,display:'table'});Util.DOM.hide(this.el);Util.DOM.appendToBody(this.el);this.closeEl=Util.DOM.createElement('div',{'class':Code.PhotoSwipe.ToolbarClass.CssClasses.close},'
');Util.DOM.appendChild(this.closeEl,this.el);this.playEl=Util.DOM.createElement('div',{'class':Code.PhotoSwipe.ToolbarClass.CssClasses.play},'
');Util.DOM.appendChild(this.playEl,this.el);this.previousEl=Util.DOM.createElement('div',{'class':Code.PhotoSwipe.ToolbarClass.CssClasses.previous},'
');Util.DOM.appendChild(this.previousEl,this.el);this.nextEl=Util.DOM.createElement('div',{'class':Code.PhotoSwipe.ToolbarClass.CssClasses.next},'
');Util.DOM.appendChild(this.nextEl,this.el);},addEventListeners:function(){Util.DOM.addEventListener(this.el,'click',this.clickHandler);},removeEventListeners:function(){Util.DOM.removeEventListener(this.el,'click',this.clickHandler);},onClick:function(e){var action;switch(e.target.parentNode){case this.previousEl:if(this.isPreviousActive){action=Code.PhotoSwipe.ToolbarClass.Actions.previous;}
+break;case this.nextEl:if(this.isNextActive){action=Code.PhotoSwipe.ToolbarClass.Actions.next;}
+break;case this.playEl:action=Code.PhotoSwipe.ToolbarClass.Actions.play;break;case this.closeEl:action=Code.PhotoSwipe.ToolbarClass.Actions.close;break;}
+if(Util.isNothing(action)){return;}
+this.dispatchEvent({type:Code.PhotoSwipe.ToolbarClass.EventTypes.onClick,target:this,action:action});},resetPosition:function(){var top;if(this.settings.position==='bottom'){top=Util.DOM.windowHeight()-Util.DOM.height(this.el)+Util.DOM.windowScrollTop();}
+else{top=Util.DOM.windowScrollTop();}
+Util.DOM.setStyle(this.el,'top',top+'px');Util.DOM.width(this.el,Util.DOM.bodyWidth());},stopFade:function(){window.clearTimeout(this.fadeOutTimeout);this._super();},postShow:function(){if(this.settings.toolbarDelay>0){this.fadeOutTimeout=window.setTimeout(this.fadeOut.bind(this),this.settings.toolbarDelay);}
+this._super();},setNextState:function(disable){if(disable){Util.DOM.addClass(this.nextEl,Code.PhotoSwipe.ToolbarClass.CssClasses.nextDisabled);this.isNextActive=false;}
+else{Util.DOM.removeClass(this.nextEl,Code.PhotoSwipe.ToolbarClass.CssClasses.nextDisabled);this.isNextActive=true;}},setPreviousState:function(disable){if(disable){Util.DOM.addClass(this.previousEl,Code.PhotoSwipe.ToolbarClass.CssClasses.previousDisabled);this.isPreviousActive=false;}
+else{Util.DOM.removeClass(this.previousEl,Code.PhotoSwipe.ToolbarClass.CssClasses.previousDisabled);this.isPreviousActive=true;}}});Code.PhotoSwipe.ToolbarClass.CssClasses={caption:'ps-toolbar',top:'ps-toolbar-top',close:'ps-toolbar-close',previous:'ps-toolbar-previous',previousDisabled:'ps-toolbar-previous-disabled',next:'ps-toolbar-next',nextDisabled:'ps-toolbar-next-disabled',play:'ps-toolbar-play',content:'ps-toolbar-content'};Code.PhotoSwipe.ToolbarClass.Actions={close:'close',previous:'previous',next:'next',play:'play'};Code.PhotoSwipe.ToolbarClass.EventTypes={onClick:'onClick'};})(Code.PhotoSwipe.Util);(function(Util,ElementClass,DocumentOverlayClass,FullSizeImageClass,ViewportClass,SliderClass,CaptionClass,ToolbarClass){var photoSwipe=Code.PhotoSwipe.EventClass.extend({fullSizeImages:null,documentOverlay:null,viewport:null,slider:null,caption:null,toolbar:null,settings:null,slideShowSettingsSaved:null,currentIndex:null,isBusy:null,slideshowTimeout:null,documentOverlayFadeInEventHandler:null,windowResizeEventHandler:null,windowOrientationChangeEventHandler:null,windowScrollEventHandler:null,keyDownEventHandler:null,viewportTouchEventHandler:null,viewportFadeOutEventHandler:null,sliderDisplayCurrentFullSizeImageEventHandler:null,toolbarClickEventHandler:null,init:function(){this._super();this.currentIndex=0;this.isBusy=false;this.settings={getImageSource:Code.PhotoSwipe.GetImageSource,getImageCaption:Code.PhotoSwipe.GetImageCaption,fadeSpeed:400,slideSpeed:250,swipeThreshold:50,loop:true,flipCaptionAndToolbar:false,captionDelay:3000,captionOpacity:0.8,hideCaption:false,showEmptyCaptions:true,toolbarDelay:3000,toolbarOpacity:0.8,hideToolbar:false,slideshowDelay:3000,imageScaleMethod:'fit'};this.documentOverlayFadeInEventHandler=this.onDocumentOverlayFadeIn.bind(this);this.windowResizeEventHandler=this.onWindowResize.bind(this);this.windowOrientationChangeEventHandler=this.onWindowOrientationChange.bind(this);this.windowScrollEventHandler=this.onWindowScroll.bind(this);this.keyDownEventHandler=this.onKeyDown.bind(this);this.viewportTouchEventHandler=this.onViewportTouch.bind(this);this.viewportFadeOutEventHandler=this.onViewportFadeOut.bind(this);this.sliderDisplayCurrentFullSizeImageEventHandler=this.onSliderDisplayCurrentFullSizeImage.bind(this);this.toolbarClickEventHandler=this.onToolbarClick.bind(this);},setOptions:function(options){Util.extend(this.settings,options);},setImages:function(thumbEls){if(!Util.isArray){throw"thumbEls is not an array";}
+this.currentIndex=0;this.fullSizeImages=[];for(var i=0;i=this.fullSizeImages.length){startingIndex=0;}
+this.currentIndex=startingIndex;if(Util.isNothing(this.documentOverlay)){this.build();}
+this.documentOverlay.addEventListener(ElementClass.EventTypes.onFadeIn,this.documentOverlayFadeInEventHandler);this.documentOverlay.fadeIn();},build:function(){this.documentOverlay=new DocumentOverlayClass({opacity:1,fadeSpeed:this.settings.fadeSpeed});this.viewport=new ViewportClass({opacity:1,fadeSpeed:this.settings.fadeSpeed,swipeThreshold:this.settings.swipeThreshold});this.slider=new SliderClass({opacity:1,fadeSpeed:this.settings.fadeSpeed,slideSpeed:this.settings.slideSpeed},this.viewport.el);this.caption=new CaptionClass({opacity:this.settings.captionOpacity,fadeSpeed:this.settings.fadeSpeed,captionDelay:this.settings.captionDelay,position:(this.settings.flipCaptionAndToolbar)?'bottom':'top'});this.toolbar=new ToolbarClass({opacity:this.settings.toolbarOpacity,fadeSpeed:this.settings.fadeSpeed,toolbarDelay:this.settings.toolbarDelay,position:(this.settings.flipCaptionAndToolbar)?'top':'bottom'});},addEventListeners:function(){if(!Util.isNothing(window.orientation)){Util.DOM.addEventListener(window,'orientationchange',this.windowOrientationChangeEventHandler);}
+Util.DOM.addEventListener(window,'resize',this.windowResizeEventHandler);Util.DOM.addEventListener(window,'scroll',this.windowScrollEventHandler);Util.DOM.addEventListener(document,'keydown',this.keyDownEventHandler);this.viewport.addEventListener(ViewportClass.EventTypes.onTouch,this.viewportTouchEventHandler);this.slider.addEventListener(SliderClass.EventTypes.onDisplayCurrentFullSizeImage,this.sliderDisplayCurrentFullSizeImageEventHandler);this.toolbar.addEventListener(ToolbarClass.EventTypes.onClick,this.toolbarClickEventHandler);},removeEventListeners:function(){if(!Util.isNothing(window.orientation)){Util.DOM.removeEventListener(window,'orientationchange',this.windowOrientationChangeEventHandler);}
+Util.DOM.removeEventListener(window,'resize',this.windowResizeEventHandler);Util.DOM.removeEventListener(window,'scroll',this.windowScrollEventHandler);Util.DOM.removeEventListener(document,'keydown',this.keyDownEventHandler);this.viewport.removeEventListener(ViewportClass.EventTypes.onTouch,this.viewportTouchEventHandler);this.slider.removeEventListener(SliderClass.EventTypes.onDisplayCurrentFullSizeImage,this.sliderDisplayCurrentFullSizeImageEventHandler);this.toolbar.removeEventListener(ToolbarClass.EventTypes.onClick,this.toolbarClickEventHandler);},onDocumentOverlayFadeIn:function(e){this.documentOverlay.removeEventListener(ElementClass.EventTypes.onFadeIn,this.documentOverlayFadeInEventHandler);this.viewport.show();this.slider.show();this.toolbar.show();this.addEventListeners();this.slider.setCurrentFullSizeImage(this.fullSizeImages[this.currentIndex]);this.isBusy=false;},setSliderPreviousAndNextFullSizeImages:function(){var
+lastIndex,previousFullSizeImage=null,nextFullSizeImage=null;if(this.fullSizeImages.length>1){lastIndex=this.fullSizeImages.length-1;if(this.currentIndex===lastIndex){if(this.settings.loop){nextFullSizeImage=this.fullSizeImages[0];}
+previousFullSizeImage=this.fullSizeImages[this.currentIndex-1];}
+else if(this.currentIndex===0){nextFullSizeImage=this.fullSizeImages[this.currentIndex+1];if(this.settings.loop){previousFullSizeImage=this.fullSizeImages[lastIndex];}}
+else{nextFullSizeImage=this.fullSizeImages[this.currentIndex+1];previousFullSizeImage=this.fullSizeImages[this.currentIndex-1];}}
+this.slider.setPreviousAndNextFullSizeImages(previousFullSizeImage,nextFullSizeImage);},onWindowResize:function(e){this.resetPosition();},onKeyDown:function(e){if(e.keyCode===37){e.preventDefault();this.showPrevious();}
+else if(e.keyCode===39){e.preventDefault();this.showNext();}
+else if(e.keyCode===38||e.keyCode===40){e.preventDefault();}
+else if(e.keyCode===27){e.preventDefault();this.hide();}
+else if(e.keyCode===32){e.preventDefault();}},onWindowOrientationChange:function(e){this.resetPosition();},onWindowScroll:function(e){this.resetPosition();},resetPosition:function(){if(this.isBusy){return;}
+this.documentOverlay.resetPosition();this.viewport.resetPosition();this.slider.resetPosition();this.caption.resetPosition();this.toolbar.resetPosition();},onViewportTouch:function(e){switch(e.action){case ViewportClass.Actions.swipeLeft:this.showNext();break;case ViewportClass.Actions.swipeRight:this.showPrevious();break;default:if(this.isSlideShowActive()||!this.settings.hideToolbar){this.showCaptionAndToolbar();}
+else{this.hide();}
+break;}},onViewportFadeOut:function(e){this.viewport.removeEventListener(ElementClass.EventTypes.onFadeOut,this.viewportFadeOutEventHandler);this.isBusy=false;},hide:function(){if(this.isBusy){return;}
+this.isBusy=true;this.removeEventListeners();this.documentOverlay.hide();this.caption.hide();this.toolbar.hide();this.slider.hide();Util.DOM.removeClass(document.body,Code.PhotoSwipe.CssClasses.activeBody);this.viewport.addEventListener(ElementClass.EventTypes.onFadeOut,this.viewportFadeOutEventHandler);this.viewport.fadeOut();},showNext:function(){if(this.isBusy){return;}
+this.isBusy=true;this.caption.setEmptyCaption();this.slider.showNext();},showPrevious:function(){if(this.isBusy){return;}
+this.isBusy=true;this.caption.setEmptyCaption();this.slider.showPrevious();},onSliderDisplayCurrentFullSizeImage:function(e){this.currentIndex=e.fullSizeImage.index;this.setSliderPreviousAndNextFullSizeImages();this.isBusy=false;if(this.isSlideShowActive()){if(!this.settings.loop&&this.currentIndex===this.fullSizeImages.length-1){this.slideshowTimeout=window.setTimeout(this.showCaptionAndToolbar.bind(this),this.settings.slideshowDelay);}
+else{this.fireSlideshowTimeout();}}
+else{this.showCaptionAndToolbar();}},showCaptionAndToolbar:function(captionValue){this.stopSlideshow();if(this.settings.hideCaption){this.caption.hide();}
+else{captionValue=Util.coalesce(captionValue,this.fullSizeImages[this.currentIndex].caption);if((Util.isNothing(captionValue)||captionValue==='')&&!this.settings.showEmptyCaptions){this.caption.hide();return;}
+this.caption.show(captionValue);}
+if(this.settings.hideToolbar){this.toolbar.hide();}
+else{if(this.settings.loop){this.toolbar.setNextState(false);this.toolbar.setPreviousState(false);}
+else{if(this.currentIndex>=this.fullSizeImages.length-1){this.toolbar.setNextState(true);}
+else{this.toolbar.setNextState(false);}
+if(this.currentIndex<1){this.toolbar.setPreviousState(true);}
+else{this.toolbar.setPreviousState(false);}}
+this.toolbar.show();}},onToolbarClick:function(e){switch(e.action){case ToolbarClass.Actions.previous:this.showPrevious();break;case ToolbarClass.Actions.next:this.showNext();break;case ToolbarClass.Actions.play:this.startSlideshow();break;default:this.hide();break;}},startSlideshow:function(){if(this.isBusy){return;}
+window.clearTimeout(this.slideshowTimeout);this.slideShowSettingsSaved={hideCaption:this.settings.hideCaption,hideToolbar:this.settings.hideToolbar};this.settings.hideCaption=true;this.settings.hideToolbar=true;this.caption.fadeOut();this.toolbar.fadeOut();this.fireSlideshowTimeout();},stopSlideshow:function(){if(!this.isSlideShowActive()){return;}
+window.clearTimeout(this.slideshowTimeout);this.settings.hideCaption=this.slideShowSettingsSaved.hideCaption;this.settings.hideToolbar=this.slideShowSettingsSaved.hideToolbar;this.slideShowSettingsSaved=null;},isSlideShowActive:function(){return(!Util.isNothing(this.slideShowSettingsSaved));},fireSlideshowTimeout:function(){this.slideshowTimeout=window.setTimeout(this.showNext.bind(this),this.settings.slideshowDelay);}});Code.PhotoSwipe.CssClasses={activeBody:'ps-active'};Code.PhotoSwipe.GetImageSource=function(el){return el.href;};Code.PhotoSwipe.GetImageCaption=function(el){if(el.nodeName==="IMG"){return Util.DOM.getAttribute(el,'alt');}
+return Util.DOM.getAttribute(el.firstChild,'alt');};Code.PhotoSwipe.Current=new photoSwipe();Code.photoSwipe=function(thumbEls,containerEl,opts){var useEventDelegation=true;if(Util.isNothing(thumbEls)){return;}
+if(Util.isNothing(containerEl)){containerEl=document.documentElement;useEventDelegation=false;}
+if(Util.isString(containerEl)){containerEl=document.documentElement.querySelector(containerEl);}
+if(Util.isNothing(containerEl)){throw'Unable to find container element';}
+if(Util.isString(thumbEls)){thumbEls=containerEl.querySelectorAll(thumbEls);}
+if(Util.isNothing(thumbEls)){return;}
+Code.PhotoSwipe.Current.setOptions(opts);Code.PhotoSwipe.Current.setImages(thumbEls);if(useEventDelegation){containerEl.addEventListener('click',function(e){if(e.target===e.currentTarget){return;}
+e.preventDefault();var findNode=function(clickedEl,targetNodeName,stopAtEl){if(Util.isNothing(clickedEl)||Util.isNothing(targetNodeName)||Util.isNothing(stopAtEl)){return null;}
+if(clickedEl.nodeName===targetNodeName){return clickedEl;}
+if(clickedEl===stopAtEl){return null;}
+return findNode(clickedEl.parentNode,targetNodeName,stopAtEl)};var clickedEl=findNode(e.target,thumbEls[0].nodeName,e.currentTarget);if(Util.isNothing(clickedEl)){return;}
+showPhotoSwipe(clickedEl);},false);}
+else{for(var i=0;i
+
+ PhotoSwipe
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
PhotoSwipe
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/artifact/1.0.0/examples/images/blogicon.png b/artifact/1.0.0/examples/images/blogicon.png
new file mode 100644
index 000000000..7cb472c3d
Binary files /dev/null and b/artifact/1.0.0/examples/images/blogicon.png differ
diff --git a/artifact/1.0.0/examples/images/codecomputerlovelogo.gif b/artifact/1.0.0/examples/images/codecomputerlovelogo.gif
new file mode 100644
index 000000000..f5a905407
Binary files /dev/null and b/artifact/1.0.0/examples/images/codecomputerlovelogo.gif differ
diff --git a/artifact/1.0.0/examples/images/facebookicon.png b/artifact/1.0.0/examples/images/facebookicon.png
new file mode 100644
index 000000000..e6de15d06
Binary files /dev/null and b/artifact/1.0.0/examples/images/facebookicon.png differ
diff --git a/artifact/1.0.0/examples/images/flickricon.png b/artifact/1.0.0/examples/images/flickricon.png
new file mode 100644
index 000000000..a7474c9f6
Binary files /dev/null and b/artifact/1.0.0/examples/images/flickricon.png differ
diff --git a/artifact/1.0.0/examples/images/full/001.jpg b/artifact/1.0.0/examples/images/full/001.jpg
new file mode 100644
index 000000000..2ab880c20
Binary files /dev/null and b/artifact/1.0.0/examples/images/full/001.jpg differ
diff --git a/artifact/1.0.0/examples/images/full/002.jpg b/artifact/1.0.0/examples/images/full/002.jpg
new file mode 100644
index 000000000..80e9da4c8
Binary files /dev/null and b/artifact/1.0.0/examples/images/full/002.jpg differ
diff --git a/artifact/1.0.0/examples/images/full/003.jpg b/artifact/1.0.0/examples/images/full/003.jpg
new file mode 100644
index 000000000..cf61c3f21
Binary files /dev/null and b/artifact/1.0.0/examples/images/full/003.jpg differ
diff --git a/artifact/1.0.0/examples/images/full/004.jpg b/artifact/1.0.0/examples/images/full/004.jpg
new file mode 100644
index 000000000..fc0c1b790
Binary files /dev/null and b/artifact/1.0.0/examples/images/full/004.jpg differ
diff --git a/artifact/1.0.0/examples/images/full/005.jpg b/artifact/1.0.0/examples/images/full/005.jpg
new file mode 100644
index 000000000..50cc9c304
Binary files /dev/null and b/artifact/1.0.0/examples/images/full/005.jpg differ
diff --git a/artifact/1.0.0/examples/images/full/006.jpg b/artifact/1.0.0/examples/images/full/006.jpg
new file mode 100644
index 000000000..330790e86
Binary files /dev/null and b/artifact/1.0.0/examples/images/full/006.jpg differ
diff --git a/artifact/1.0.0/examples/images/full/007.jpg b/artifact/1.0.0/examples/images/full/007.jpg
new file mode 100644
index 000000000..6244f9dc8
Binary files /dev/null and b/artifact/1.0.0/examples/images/full/007.jpg differ
diff --git a/artifact/1.0.0/examples/images/full/008.jpg b/artifact/1.0.0/examples/images/full/008.jpg
new file mode 100644
index 000000000..fc52e87a3
Binary files /dev/null and b/artifact/1.0.0/examples/images/full/008.jpg differ
diff --git a/artifact/1.0.0/examples/images/full/009.jpg b/artifact/1.0.0/examples/images/full/009.jpg
new file mode 100644
index 000000000..ec81b067c
Binary files /dev/null and b/artifact/1.0.0/examples/images/full/009.jpg differ
diff --git a/artifact/1.0.0/examples/images/full/010.jpg b/artifact/1.0.0/examples/images/full/010.jpg
new file mode 100644
index 000000000..f705ddc9f
Binary files /dev/null and b/artifact/1.0.0/examples/images/full/010.jpg differ
diff --git a/artifact/1.0.0/examples/images/full/011.jpg b/artifact/1.0.0/examples/images/full/011.jpg
new file mode 100644
index 000000000..e41c7ff41
Binary files /dev/null and b/artifact/1.0.0/examples/images/full/011.jpg differ
diff --git a/artifact/1.0.0/examples/images/full/012.jpg b/artifact/1.0.0/examples/images/full/012.jpg
new file mode 100644
index 000000000..4f2de4bd7
Binary files /dev/null and b/artifact/1.0.0/examples/images/full/012.jpg differ
diff --git a/artifact/1.0.0/examples/images/full/013.jpg b/artifact/1.0.0/examples/images/full/013.jpg
new file mode 100644
index 000000000..571a9e487
Binary files /dev/null and b/artifact/1.0.0/examples/images/full/013.jpg differ
diff --git a/artifact/1.0.0/examples/images/full/014.jpg b/artifact/1.0.0/examples/images/full/014.jpg
new file mode 100644
index 000000000..a7b233f2e
Binary files /dev/null and b/artifact/1.0.0/examples/images/full/014.jpg differ
diff --git a/artifact/1.0.0/examples/images/full/015.jpg b/artifact/1.0.0/examples/images/full/015.jpg
new file mode 100644
index 000000000..cd04cbfbd
Binary files /dev/null and b/artifact/1.0.0/examples/images/full/015.jpg differ
diff --git a/artifact/1.0.0/examples/images/thumb/001.jpg b/artifact/1.0.0/examples/images/thumb/001.jpg
new file mode 100644
index 000000000..4ba1b8112
Binary files /dev/null and b/artifact/1.0.0/examples/images/thumb/001.jpg differ
diff --git a/artifact/1.0.0/examples/images/thumb/002.jpg b/artifact/1.0.0/examples/images/thumb/002.jpg
new file mode 100644
index 000000000..09538dfe6
Binary files /dev/null and b/artifact/1.0.0/examples/images/thumb/002.jpg differ
diff --git a/artifact/1.0.0/examples/images/thumb/003.jpg b/artifact/1.0.0/examples/images/thumb/003.jpg
new file mode 100644
index 000000000..e95bc3784
Binary files /dev/null and b/artifact/1.0.0/examples/images/thumb/003.jpg differ
diff --git a/artifact/1.0.0/examples/images/thumb/004.jpg b/artifact/1.0.0/examples/images/thumb/004.jpg
new file mode 100644
index 000000000..86ace941a
Binary files /dev/null and b/artifact/1.0.0/examples/images/thumb/004.jpg differ
diff --git a/artifact/1.0.0/examples/images/thumb/005.jpg b/artifact/1.0.0/examples/images/thumb/005.jpg
new file mode 100644
index 000000000..e9b17f0a0
Binary files /dev/null and b/artifact/1.0.0/examples/images/thumb/005.jpg differ
diff --git a/artifact/1.0.0/examples/images/thumb/006.jpg b/artifact/1.0.0/examples/images/thumb/006.jpg
new file mode 100644
index 000000000..d0757d85d
Binary files /dev/null and b/artifact/1.0.0/examples/images/thumb/006.jpg differ
diff --git a/artifact/1.0.0/examples/images/thumb/007.jpg b/artifact/1.0.0/examples/images/thumb/007.jpg
new file mode 100644
index 000000000..a6a02657e
Binary files /dev/null and b/artifact/1.0.0/examples/images/thumb/007.jpg differ
diff --git a/artifact/1.0.0/examples/images/thumb/008.jpg b/artifact/1.0.0/examples/images/thumb/008.jpg
new file mode 100644
index 000000000..185bce127
Binary files /dev/null and b/artifact/1.0.0/examples/images/thumb/008.jpg differ
diff --git a/artifact/1.0.0/examples/images/thumb/009.jpg b/artifact/1.0.0/examples/images/thumb/009.jpg
new file mode 100644
index 000000000..aac07132e
Binary files /dev/null and b/artifact/1.0.0/examples/images/thumb/009.jpg differ
diff --git a/artifact/1.0.0/examples/images/thumb/010.jpg b/artifact/1.0.0/examples/images/thumb/010.jpg
new file mode 100644
index 000000000..cdae77865
Binary files /dev/null and b/artifact/1.0.0/examples/images/thumb/010.jpg differ
diff --git a/artifact/1.0.0/examples/images/thumb/011.jpg b/artifact/1.0.0/examples/images/thumb/011.jpg
new file mode 100644
index 000000000..a71f66d34
Binary files /dev/null and b/artifact/1.0.0/examples/images/thumb/011.jpg differ
diff --git a/artifact/1.0.0/examples/images/thumb/012.jpg b/artifact/1.0.0/examples/images/thumb/012.jpg
new file mode 100644
index 000000000..27a732e02
Binary files /dev/null and b/artifact/1.0.0/examples/images/thumb/012.jpg differ
diff --git a/artifact/1.0.0/examples/images/thumb/013.jpg b/artifact/1.0.0/examples/images/thumb/013.jpg
new file mode 100644
index 000000000..ae52fe90b
Binary files /dev/null and b/artifact/1.0.0/examples/images/thumb/013.jpg differ
diff --git a/artifact/1.0.0/examples/images/thumb/014.jpg b/artifact/1.0.0/examples/images/thumb/014.jpg
new file mode 100644
index 000000000..919980be8
Binary files /dev/null and b/artifact/1.0.0/examples/images/thumb/014.jpg differ
diff --git a/artifact/1.0.0/examples/images/thumb/015.jpg b/artifact/1.0.0/examples/images/thumb/015.jpg
new file mode 100644
index 000000000..f587b00c2
Binary files /dev/null and b/artifact/1.0.0/examples/images/thumb/015.jpg differ
diff --git a/artifact/1.0.0/examples/images/twittericon.png b/artifact/1.0.0/examples/images/twittericon.png
new file mode 100644
index 000000000..7a588c1e8
Binary files /dev/null and b/artifact/1.0.0/examples/images/twittericon.png differ
diff --git a/artifact/1.0.0/examples/index-jquery-plugin.html b/artifact/1.0.0/examples/index-jquery-plugin.html
new file mode 100644
index 000000000..e62047930
--- /dev/null
+++ b/artifact/1.0.0/examples/index-jquery-plugin.html
@@ -0,0 +1,123 @@
+
+
+ PhotoSwipe
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
PhotoSwipe
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/artifact/1.0.0/examples/index.html b/artifact/1.0.0/examples/index.html
new file mode 100644
index 000000000..28d3b4c69
--- /dev/null
+++ b/artifact/1.0.0/examples/index.html
@@ -0,0 +1,139 @@
+
+
+ PhotoSwipe
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
PhotoSwipe
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/artifact/1.0.0/examples/jquery-engine.html b/artifact/1.0.0/examples/jquery-engine.html
new file mode 100644
index 000000000..a42624606
--- /dev/null
+++ b/artifact/1.0.0/examples/jquery-engine.html
@@ -0,0 +1,127 @@
+
+
+ PhotoSwipe
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
PhotoSwipe
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/artifact/1.0.0/examples/styles.css b/artifact/1.0.0/examples/styles.css
new file mode 100644
index 000000000..38acccd76
--- /dev/null
+++ b/artifact/1.0.0/examples/styles.css
@@ -0,0 +1,20 @@
+body { padding: 0; margin: 0; background: #DFDCD1; font-family: "Lucida Grande", Helvetica, Arial,Verdana, sans-serif; color: #444340; }
+h1 { font-size: 1.3em; padding: 15px 10px; margin: 0; }
+img { border: none; }
+a { color: #444340; }
+
+#Header { background: #EEBF02; height: 61px; padding: 0; border-bottom: 1px solid #3c3c3c; }
+#Header img { display: block; margin: 0 auto 0; }
+
+#MainContent { background: #ffffff; padding-bottom: 30px; }
+
+#Footer { padding: 10px; border-top: none; }
+
+#SocialLinks { padding: 10px 0 0 0; }
+#SocialLinks:after { clear: both; content: "."; display: block; height: 0; visibility: hidden; }
+#SocialLinks a { display: block; float: left; padding-right: 15px; }
+
+div.gallery-row:after { clear: both; content: "."; display: block; height: 0; visibility: hidden; }
+div.gallery-item { float: left; width: 33.33333333%; }
+div.gallery-item a { display: block; margin: 5px; border: 1px solid #3c3c3c; }
+div.gallery-item img { display: block; width: 100%; height: auto; }
\ No newline at end of file
diff --git a/artifact/1.0.0/lib/jquery-1.5.1.min.js b/artifact/1.0.0/lib/jquery-1.5.1.min.js
new file mode 100644
index 000000000..6437874c6
--- /dev/null
+++ b/artifact/1.0.0/lib/jquery-1.5.1.min.js
@@ -0,0 +1,16 @@
+/*!
+ * jQuery JavaScript Library v1.5.1
+ * http://jquery.com/
+ *
+ * Copyright 2011, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ * Copyright 2011, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ *
+ * Date: Wed Feb 23 13:55:29 2011 -0500
+ */
+(function(a,b){function cg(a){return d.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cd(a){if(!bZ[a]){var b=d("<"+a+">").appendTo("body"),c=b.css("display");b.remove();if(c==="none"||c==="")c="block";bZ[a]=c}return bZ[a]}function cc(a,b){var c={};d.each(cb.concat.apply([],cb.slice(0,b)),function(){c[this]=a});return c}function bY(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function bX(){try{return new a.XMLHttpRequest}catch(b){}}function bW(){d(a).unload(function(){for(var a in bU)bU[a](0,1)})}function bQ(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var e=a.dataTypes,f={},g,h,i=e.length,j,k=e[0],l,m,n,o,p;for(g=1;g=0===c})}function N(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function F(a,b){return(a&&a!=="*"?a+".":"")+b.replace(r,"`").replace(s,"&")}function E(a){var b,c,e,f,g,h,i,j,k,l,m,n,o,q=[],r=[],s=d._data(this,"events");if(a.liveFired!==this&&s&&s.live&&!a.target.disabled&&(!a.button||a.type!=="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var t=s.live.slice(0);for(i=0;ic)break;a.currentTarget=f.elem,a.data=f.handleObj.data,a.handleObj=f.handleObj,o=f.handleObj.origHandler.apply(f.elem,arguments);if(o===!1||a.isPropagationStopped()){c=f.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function C(a,c,e){var f=d.extend({},e[0]);f.type=a,f.originalEvent={},f.liveFired=b,d.event.handle.call(c,f),f.isDefaultPrevented()&&e[0].preventDefault()}function w(){return!0}function v(){return!1}function g(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function f(a,c,f){if(f===b&&a.nodeType===1){f=a.getAttribute("data-"+c);if(typeof f==="string"){try{f=f==="true"?!0:f==="false"?!1:f==="null"?null:d.isNaN(f)?e.test(f)?d.parseJSON(f):f:parseFloat(f)}catch(g){}d.data(a,c,f)}else f=b}return f}var c=a.document,d=function(){function I(){if(!d.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(I,1);return}d.ready()}}var d=function(a,b){return new d.fn.init(a,b,g)},e=a.jQuery,f=a.$,g,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,i=/\S/,j=/^\s+/,k=/\s+$/,l=/\d/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=navigator.userAgent,w,x=!1,y,z="then done fail isResolved isRejected promise".split(" "),A,B=Object.prototype.toString,C=Object.prototype.hasOwnProperty,D=Array.prototype.push,E=Array.prototype.slice,F=String.prototype.trim,G=Array.prototype.indexOf,H={};d.fn=d.prototype={constructor:d,init:function(a,e,f){var g,i,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!e&&c.body){this.context=c,this[0]=c.body,this.selector="body",this.length=1;return this}if(typeof a==="string"){g=h.exec(a);if(!g||!g[1]&&e)return!e||e.jquery?(e||f).find(a):this.constructor(e).find(a);if(g[1]){e=e instanceof d?e[0]:e,k=e?e.ownerDocument||e:c,j=m.exec(a),j?d.isPlainObject(e)?(a=[c.createElement(j[1])],d.fn.attr.call(a,e,!0)):a=[k.createElement(j[1])]:(j=d.buildFragment([g[1]],[k]),a=(j.cacheable?d.clone(j.fragment):j.fragment).childNodes);return d.merge(this,a)}i=c.getElementById(g[2]);if(i&&i.parentNode){if(i.id!==g[2])return f.find(a);this.length=1,this[0]=i}this.context=c,this.selector=a;return this}if(d.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return d.makeArray(a,this)},selector:"",jquery:"1.5.1",length:0,size:function(){return this.length},toArray:function(){return E.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var e=this.constructor();d.isArray(a)?D.apply(e,a):d.merge(e,a),e.prevObject=this,e.context=this.context,b==="find"?e.selector=this.selector+(this.selector?" ":"")+c:b&&(e.selector=this.selector+"."+b+"("+c+")");return e},each:function(a,b){return d.each(this,a,b)},ready:function(a){d.bindReady(),y.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(E.apply(this,arguments),"slice",E.call(arguments).join(","))},map:function(a){return this.pushStack(d.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:D,sort:[].sort,splice:[].splice},d.fn.init.prototype=d.fn,d.extend=d.fn.extend=function(){var a,c,e,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i==="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!=="object"&&!d.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;y.resolveWith(c,[d]),d.fn.trigger&&d(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!x){x=!0;if(c.readyState==="complete")return setTimeout(d.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",A,!1),a.addEventListener("load",d.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",A),a.attachEvent("onload",d.ready);var b=!1;try{b=a.frameElement==null}catch(e){}c.documentElement.doScroll&&b&&I()}}},isFunction:function(a){return d.type(a)==="function"},isArray:Array.isArray||function(a){return d.type(a)==="array"},isWindow:function(a){return a&&typeof a==="object"&&"setInterval"in a},isNaN:function(a){return a==null||!l.test(a)||isNaN(a)},type:function(a){return a==null?String(a):H[B.call(a)]||"object"},isPlainObject:function(a){if(!a||d.type(a)!=="object"||a.nodeType||d.isWindow(a))return!1;if(a.constructor&&!C.call(a,"constructor")&&!C.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a){}return c===b||C.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!=="string"||!b)return null;b=d.trim(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return a.JSON&&a.JSON.parse?a.JSON.parse(b):(new Function("return "+b))();d.error("Invalid JSON: "+b)},parseXML:function(b,c,e){a.DOMParser?(e=new DOMParser,c=e.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),e=c.documentElement,(!e||!e.nodeName||e.nodeName==="parsererror")&&d.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(a){if(a&&i.test(a)){var b=c.head||c.getElementsByTagName("head")[0]||c.documentElement,e=c.createElement("script");d.support.scriptEval()?e.appendChild(c.createTextNode(a)):e.text=a,b.insertBefore(e,b.firstChild),b.removeChild(e)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,e){var f,g=0,h=a.length,i=h===b||d.isFunction(a);if(e){if(i){for(f in a)if(c.apply(a[f],e)===!1)break}else for(;g1){var f=E.call(arguments,0),g=b,h=function(a){return function(b){f[a]=arguments.length>1?E.call(arguments,0):b,--g||c.resolveWith(e,f)}};while(b--)a=f[b],a&&d.isFunction(a.promise)?a.promise().then(h(b),c.reject):--g;g||c.resolveWith(e,f)}else c!==a&&c.resolve(a);return e},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}d.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.subclass=this.subclass,a.fn.init=function b(b,c){c&&c instanceof d&&!(c instanceof a)&&(c=a(c));return d.fn.init.call(this,b,c,e)},a.fn.init.prototype=a.fn;var e=a(c);return a},browser:{}}),y=d._Deferred(),d.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){H["[object "+b+"]"]=b.toLowerCase()}),w=d.uaMatch(v),w.browser&&(d.browser[w.browser]=!0,d.browser.version=w.version),d.browser.webkit&&(d.browser.safari=!0),G&&(d.inArray=function(a,b){return G.call(b,a)}),i.test("Â ")&&(j=/^[\s\xA0]+/,k=/[\s\xA0]+$/),g=d(c),c.addEventListener?A=function(){c.removeEventListener("DOMContentLoaded",A,!1),d.ready()}:c.attachEvent&&(A=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",A),d.ready())});return d}();(function(){d.support={};var b=c.createElement("div");b.style.display="none",b.innerHTML=" a ";var e=b.getElementsByTagName("*"),f=b.getElementsByTagName("a")[0],g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=b.getElementsByTagName("input")[0];if(e&&e.length&&f){d.support={leadingWhitespace:b.firstChild.nodeType===3,tbody:!b.getElementsByTagName("tbody").length,htmlSerialize:!!b.getElementsByTagName("link").length,style:/red/.test(f.getAttribute("style")),hrefNormalized:f.getAttribute("href")==="/a",opacity:/^0.55$/.test(f.style.opacity),cssFloat:!!f.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,deleteExpando:!0,optDisabled:!1,checkClone:!1,noCloneEvent:!0,noCloneChecked:!0,boxModel:null,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableHiddenOffsets:!0},i.checked=!0,d.support.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,d.support.optDisabled=!h.disabled;var j=null;d.support.scriptEval=function(){if(j===null){var b=c.documentElement,e=c.createElement("script"),f="script"+d.now();try{e.appendChild(c.createTextNode("window."+f+"=1;"))}catch(g){}b.insertBefore(e,b.firstChild),a[f]?(j=!0,delete a[f]):j=!1,b.removeChild(e),b=e=f=null}return j};try{delete b.test}catch(k){d.support.deleteExpando=!1}!b.addEventListener&&b.attachEvent&&b.fireEvent&&(b.attachEvent("onclick",function l(){d.support.noCloneEvent=!1,b.detachEvent("onclick",l)}),b.cloneNode(!0).fireEvent("onclick")),b=c.createElement("div"),b.innerHTML=" ";var m=c.createDocumentFragment();m.appendChild(b.firstChild),d.support.checkClone=m.cloneNode(!0).cloneNode(!0).lastChild.checked,d(function(){var a=c.createElement("div"),b=c.getElementsByTagName("body")[0];if(b){a.style.width=a.style.paddingLeft="1px",b.appendChild(a),d.boxModel=d.support.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,d.support.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
",d.support.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="";var e=a.getElementsByTagName("td");d.support.reliableHiddenOffsets=e[0].offsetHeight===0,e[0].style.display="",e[1].style.display="none",d.support.reliableHiddenOffsets=d.support.reliableHiddenOffsets&&e[0].offsetHeight===0,a.innerHTML="",b.removeChild(a).style.display="none",a=e=null}});var n=function(a){var b=c.createElement("div");a="on"+a;if(!b.attachEvent)return!0;var d=a in b;d||(b.setAttribute(a,"return;"),d=typeof b[a]==="function"),b=null;return d};d.support.submitBubbles=n("submit"),d.support.changeBubbles=n("change"),b=e=f=null}})();var e=/^(?:\{.*\}|\[.*\])$/;d.extend({cache:{},uuid:0,expando:"jQuery"+(d.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?d.cache[a[d.expando]]:a[d.expando];return!!a&&!g(a)},data:function(a,c,e,f){if(d.acceptData(a)){var g=d.expando,h=typeof c==="string",i,j=a.nodeType,k=j?d.cache:a,l=j?a[d.expando]:a[d.expando]&&d.expando;if((!l||f&&l&&!k[l][g])&&h&&e===b)return;l||(j?a[d.expando]=l=++d.uuid:l=d.expando),k[l]||(k[l]={},j||(k[l].toJSON=d.noop));if(typeof c==="object"||typeof c==="function")f?k[l][g]=d.extend(k[l][g],c):k[l]=d.extend(k[l],c);i=k[l],f&&(i[g]||(i[g]={}),i=i[g]),e!==b&&(i[c]=e);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[c]:i}},removeData:function(b,c,e){if(d.acceptData(b)){var f=d.expando,h=b.nodeType,i=h?d.cache:b,j=h?b[d.expando]:d.expando;if(!i[j])return;if(c){var k=e?i[j][f]:i[j];if(k){delete k[c];if(!g(k))return}}if(e){delete i[j][f];if(!g(i[j]))return}var l=i[j][f];d.support.deleteExpando||i!=a?delete i[j]:i[j]=null,l?(i[j]={},h||(i[j].toJSON=d.noop),i[j][f]=l):h&&(d.support.deleteExpando?delete b[d.expando]:b.removeAttribute?b.removeAttribute(d.expando):b[d.expando]=null)}},_data:function(a,b,c){return d.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=d.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),d.fn.extend({data:function(a,c){var e=null;if(typeof a==="undefined"){if(this.length){e=d.data(this[0]);if(this[0].nodeType===1){var g=this[0].attributes,h;for(var i=0,j=g.length;i-1)return!0;return!1},val:function(a){if(!arguments.length){var c=this[0];if(c){if(d.nodeName(c,"option")){var e=c.attributes.value;return!e||e.specified?c.value:c.text}if(d.nodeName(c,"select")){var f=c.selectedIndex,g=[],h=c.options,i=c.type==="select-one";if(f<0)return null;for(var k=i?f:0,l=i?f+1:h.length;k=0;else if(d.nodeName(this,"select")){var f=d.makeArray(e);d("option",this).each(function(){this.selected=d.inArray(d(this).val(),f)>=0}),f.length||(this.selectedIndex=-1)}else this.value=e}})}}),d.extend({attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,e,f){if(!a||a.nodeType===3||a.nodeType===8||a.nodeType===2)return b;if(f&&c in d.attrFn)return d(a)[c](e);var g=a.nodeType!==1||!d.isXMLDoc(a),h=e!==b;c=g&&d.props[c]||c;if(a.nodeType===1){var i=k.test(c);if(c==="selected"&&!d.support.optSelected){var j=a.parentNode;j&&(j.selectedIndex,j.parentNode&&j.parentNode.selectedIndex)}if((c in a||a[c]!==b)&&g&&!i){h&&(c==="type"&&l.test(a.nodeName)&&a.parentNode&&d.error("type property can't be changed"),e===null?a.nodeType===1&&a.removeAttribute(c):a[c]=e);if(d.nodeName(a,"form")&&a.getAttributeNode(c))return a.getAttributeNode(c).nodeValue;if(c==="tabIndex"){var o=a.getAttributeNode("tabIndex");return o&&o.specified?o.value:m.test(a.nodeName)||n.test(a.nodeName)&&a.href?0:b}return a[c]}if(!d.support.style&&g&&c==="style"){h&&(a.style.cssText=""+e);return a.style.cssText}h&&a.setAttribute(c,""+e);if(!a.attributes[c]&&(a.hasAttribute&&!a.hasAttribute(c)))return b;var p=!d.support.hrefNormalized&&g&&i?a.getAttribute(c,2):a.getAttribute(c);return p===null?b:p}h&&(a[c]=e);return a[c]}});var p=/\.(.*)$/,q=/^(?:textarea|input|select)$/i,r=/\./g,s=/ /g,t=/[^\w\s.|`]/g,u=function(a){return a.replace(t,"\\$&")};d.event={add:function(c,e,f,g){if(c.nodeType!==3&&c.nodeType!==8){try{d.isWindow(c)&&(c!==a&&!c.frameElement)&&(c=a)}catch(h){}if(f===!1)f=v;else if(!f)return;var i,j;f.handler&&(i=f,f=i.handler),f.guid||(f.guid=d.guid++);var k=d._data(c);if(!k)return;var l=k.events,m=k.handle;l||(k.events=l={}),m||(k.handle=m=function(){return typeof d!=="undefined"&&!d.event.triggered?d.event.handle.apply(m.elem,arguments):b}),m.elem=c,e=e.split(" ");var n,o=0,p;while(n=e[o++]){j=i?d.extend({},i):{handler:f,data:g},n.indexOf(".")>-1?(p=n.split("."),n=p.shift(),j.namespace=p.slice(0).sort().join(".")):(p=[],j.namespace=""),j.type=n,j.guid||(j.guid=f.guid);var q=l[n],r=d.event.special[n]||{};if(!q){q=l[n]=[];if(!r.setup||r.setup.call(c,g,p,m)===!1)c.addEventListener?c.addEventListener(n,m,!1):c.attachEvent&&c.attachEvent("on"+n,m)}r.add&&(r.add.call(c,j),j.handler.guid||(j.handler.guid=f.guid)),q.push(j),d.event.global[n]=!0}c=null}},global:{},remove:function(a,c,e,f){if(a.nodeType!==3&&a.nodeType!==8){e===!1&&(e=v);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=d.hasData(a)&&d._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(e=c.handler,c=c.type);if(!c||typeof c==="string"&&c.charAt(0)==="."){c=c||"";for(h in t)d.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+d.map(m.slice(0).sort(),u).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!e){for(j=0;j=0&&(a.type=f=f.slice(0,-1),a.exclusive=!0),e||(a.stopPropagation(),d.event.global[f]&&d.each(d.cache,function(){var b=d.expando,e=this[b];e&&e.events&&e.events[f]&&d.event.trigger(a,c,e.handle.elem)}));if(!e||e.nodeType===3||e.nodeType===8)return b;a.result=b,a.target=e,c=d.makeArray(c),c.unshift(a)}a.currentTarget=e;var h=d._data(e,"handle");h&&h.apply(e,c);var i=e.parentNode||e.ownerDocument;try{e&&e.nodeName&&d.noData[e.nodeName.toLowerCase()]||e["on"+f]&&e["on"+f].apply(e,c)===!1&&(a.result=!1,a.preventDefault())}catch(j){}if(!a.isPropagationStopped()&&i)d.event.trigger(a,c,i,!0);else if(!a.isDefaultPrevented()){var k,l=a.target,m=f.replace(p,""),n=d.nodeName(l,"a")&&m==="click",o=d.event.special[m]||{};if((!o._default||o._default.call(e,a)===!1)&&!n&&!(l&&l.nodeName&&d.noData[l.nodeName.toLowerCase()])){try{l[m]&&(k=l["on"+m],k&&(l["on"+m]=null),d.event.triggered=!0,l[m]())}catch(q){}k&&(l["on"+m]=k),d.event.triggered=!1}}},handle:function(c){var e,f,g,h,i,j=[],k=d.makeArray(arguments);c=k[0]=d.event.fix(c||a.event),c.currentTarget=this,e=c.type.indexOf(".")<0&&!c.exclusive,e||(g=c.type.split("."),c.type=g.shift(),j=g.slice(0).sort(),h=new RegExp("(^|\\.)"+j.join("\\.(?:.*\\.)?")+"(\\.|$)")),c.namespace=c.namespace||j.join("."),i=d._data(this,"events"),f=(i||{})[c.type];if(i&&f){f=f.slice(0);for(var l=0,m=f.length;l-1?d.map(a.options,function(a){return a.selected}).join("-"):"":a.nodeName.toLowerCase()==="select"&&(c=a.selectedIndex);return c},B=function B(a){var c=a.target,e,f;if(q.test(c.nodeName)&&!c.readOnly){e=d._data(c,"_change_data"),f=A(c),(a.type!=="focusout"||c.type!=="radio")&&d._data(c,"_change_data",f);if(e===b||f===e)return;if(e!=null||f)a.type="change",a.liveFired=b,d.event.trigger(a,arguments[1],c)}};d.event.special.change={filters:{focusout:B,beforedeactivate:B,click:function(a){var b=a.target,c=b.type;(c==="radio"||c==="checkbox"||b.nodeName.toLowerCase()==="select")&&B.call(this,a)},keydown:function(a){var b=a.target,c=b.type;(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&B.call(this,a)},beforeactivate:function(a){var b=a.target;d._data(b,"_change_data",A(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in z)d.event.add(this,c+".specialChange",z[c]);return q.test(this.nodeName)},teardown:function(a){d.event.remove(this,".specialChange");return q.test(this.nodeName)}},z=d.event.special.change.filters,z.focus=z.beforeactivate}c.addEventListener&&d.each({focus:"focusin",blur:"focusout"},function(a,b){function c(a){a=d.event.fix(a),a.type=b;return d.event.handle.call(this,a)}d.event.special[b]={setup:function(){this.addEventListener(a,c,!0)},teardown:function(){this.removeEventListener(a,c,!0)}}}),d.each(["bind","one"],function(a,c){d.fn[c]=function(a,e,f){if(typeof a==="object"){for(var g in a)this[c](g,e,a[g],f);return this}if(d.isFunction(e)||e===!1)f=e,e=b;var h=c==="one"?d.proxy(f,function(a){d(this).unbind(a,h);return f.apply(this,arguments)}):f;if(a==="unload"&&c!=="one")this.one(a,e,f);else for(var i=0,j=this.length;i0?this.bind(b,a,c):this.trigger(b)},d.attrFn&&(d.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,e,g){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!=="string")return e;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(f.call(n)==="[object Array]")if(u)if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&e.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&e.push(j[t]);else e.push.apply(e,n);else p(n,e);o&&(k(o,h,e,g),k.uniqueSort(e));return e};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e":function(a,b){var c,d=typeof b==="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){return"text"===a.getAttribute("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||a.nodeName.toLowerCase()==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(f.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length==="number")for(var e=a.length;c ",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!=="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!=="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!=="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML=" ",a.firstChild&&typeof a.firstChild.getAttribute!=="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="
";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector,d=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(e){d=!0}b&&(k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(d||!l.match.PSEUDO.test(c)&&!/!=/.test(c))return b.call(a,c)}catch(e){}return k(c,null,null,[a]).length>0})}(),function(){var a=c.createElement("div");a.innerHTML="
";if(a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!=="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g0)for(var g=c;g0},closest:function(a,b){var c=[],e,f,g=this[0];if(d.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(e=0,f=a.length;e-1:d(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=L.test(a)?d(a,b||this.context):null;for(e=0,f=this.length;e-1:d.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b)break}}c=c.length>1?d.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a==="string")return d.inArray(this[0],a?d(a):this.parent().children());return d.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a==="string"?d(a,b):d.makeArray(a),e=d.merge(this.get(),c);return this.pushStack(N(c[0])||N(e[0])?e:d.unique(e))},andSelf:function(){return this.add(this.prevObject)}}),d.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return d.dir(a,"parentNode")},parentsUntil:function(a,b,c){return d.dir(a,"parentNode",c)},next:function(a){return d.nth(a,2,"nextSibling")},prev:function(a){return d.nth(a,2,"previousSibling")},nextAll:function(a){return d.dir(a,"nextSibling")},prevAll:function(a){return d.dir(a,"previousSibling")},nextUntil:function(a,b,c){return d.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return d.dir(a,"previousSibling",c)},siblings:function(a){return d.sibling(a.parentNode.firstChild,a)},children:function(a){return d.sibling(a.firstChild)},contents:function(a){return d.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:d.makeArray(a.childNodes)}},function(a,b){d.fn[a]=function(c,e){var f=d.map(this,b,c),g=K.call(arguments);G.test(a)||(e=c),e&&typeof e==="string"&&(f=d.filter(e,f)),f=this.length>1&&!M[a]?d.unique(f):f,(this.length>1||I.test(e))&&H.test(a)&&(f=f.reverse());return this.pushStack(f,a,g.join(","))}}),d.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?d.find.matchesSelector(b[0],a)?[b[0]]:[]:d.find.matches(a,b)},dir:function(a,c,e){var f=[],g=a[c];while(g&&g.nodeType!==9&&(e===b||g.nodeType!==1||!d(g).is(e)))g.nodeType===1&&f.push(g),g=g[c];return f},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var P=/ jQuery\d+="(?:\d+|null)"/g,Q=/^\s+/,R=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,S=/<([\w:]+)/,T=/",""],legend:[1,""," "],thead:[1,""],tr:[2,""],td:[3,""],col:[2,""],area:[1,""," "],_default:[0,"",""]};X.optgroup=X.option,X.tbody=X.tfoot=X.colgroup=X.caption=X.thead,X.th=X.td,d.support.htmlSerialize||(X._default=[1,"div","
"]),d.fn.extend({text:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.text(a.call(this,b,c.text()))});if(typeof a!=="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return d.text(this)},wrapAll:function(a){if(d.isFunction(a))return this.each(function(b){d(this).wrapAll(a.call(this,b))});if(this[0]){var b=d(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(d.isFunction(a))return this.each(function(b){d(this).wrapInner(a.call(this,b))});return this.each(function(){var b=d(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){d(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){d.nodeName(this,"body")||d(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=d(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,d(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,e;(e=this[c])!=null;c++)if(!a||d.filter(a,[e]).length)!b&&e.nodeType===1&&(d.cleanData(e.getElementsByTagName("*")),d.cleanData([e])),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&d.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return d.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(P,""):null;if(typeof a!=="string"||V.test(a)||!d.support.leadingWhitespace&&Q.test(a)||X[(S.exec(a)||["",""])[1].toLowerCase()])d.isFunction(a)?this.each(function(b){var c=d(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);else{a=a.replace(R,"<$1>$2>");try{for(var c=0,e=this.length;c1&&l0?this.clone(!0):this).get();d(f[h])[b](j),e=e.concat(j)}return this.pushStack(e,a,f.selector)}}),d.extend({clone:function(a,b,c){var e=a.cloneNode(!0),f,g,h;if((!d.support.noCloneEvent||!d.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!d.isXMLDoc(a)){$(a,e),f=_(a),g=_(e);for(h=0;f[h];++h)$(f[h],g[h])}if(b){Z(a,e);if(c){f=_(a),g=_(e);for(h=0;f[h];++h)Z(f[h],g[h])}}return e},clean:function(a,b,e,f){b=b||c,typeof b.createElement==="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var g=[];for(var h=0,i;(i=a[h])!=null;h++){typeof i==="number"&&(i+="");if(!i)continue;if(typeof i!=="string"||U.test(i)){if(typeof i==="string"){i=i.replace(R,"<$1>$2>");var j=(S.exec(i)||["",""])[1].toLowerCase(),k=X[j]||X._default,l=k[0],m=b.createElement("div");m.innerHTML=k[1]+i+k[2];while(l--)m=m.lastChild;if(!d.support.tbody){var n=T.test(i),o=j==="table"&&!n?m.firstChild&&m.firstChild.childNodes:k[1]===""&&!n?m.childNodes:[];for(var p=o.length-1;p>=0;--p)d.nodeName(o[p],"tbody")&&!o[p].childNodes.length&&o[p].parentNode.removeChild(o[p])}!d.support.leadingWhitespace&&Q.test(i)&&m.insertBefore(b.createTextNode(Q.exec(i)[0]),m.firstChild),i=m.childNodes}}else i=b.createTextNode(i);i.nodeType?g.push(i):g=d.merge(g,i)}if(e)for(h=0;g[h];h++)!f||!d.nodeName(g[h],"script")||g[h].type&&g[h].type.toLowerCase()!=="text/javascript"?(g[h].nodeType===1&&g.splice.apply(g,[h+1,0].concat(d.makeArray(g[h].getElementsByTagName("script")))),e.appendChild(g[h])):f.push(g[h].parentNode?g[h].parentNode.removeChild(g[h]):g[h]);return g},cleanData:function(a){var b,c,e=d.cache,f=d.expando,g=d.event.special,h=d.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&d.noData[j.nodeName.toLowerCase()])continue;c=j[d.expando];if(c){b=e[c]&&e[c][f];if(b&&b.events){for(var k in b.events)g[k]?d.event.remove(j,k):d.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[d.expando]:j.removeAttribute&&j.removeAttribute(d.expando),delete e[c]}}}});var bb=/alpha\([^)]*\)/i,bc=/opacity=([^)]*)/,bd=/-([a-z])/ig,be=/([A-Z])/g,bf=/^-?\d+(?:px)?$/i,bg=/^-?\d/,bh={position:"absolute",visibility:"hidden",display:"block"},bi=["Left","Right"],bj=["Top","Bottom"],bk,bl,bm,bn=function(a,b){return b.toUpperCase()};d.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return d.access(this,a,c,!0,function(a,c,e){return e!==b?d.style(a,c,e):d.css(a,c)})},d.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bk(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{zIndex:!0,fontWeight:!0,opacity:!0,zoom:!0,lineHeight:!0},cssProps:{"float":d.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,e,f){if(a&&a.nodeType!==3&&a.nodeType!==8&&a.style){var g,h=d.camelCase(c),i=a.style,j=d.cssHooks[h];c=d.cssProps[h]||h;if(e===b){if(j&&"get"in j&&(g=j.get(a,!1,f))!==b)return g;return i[c]}if(typeof e==="number"&&isNaN(e)||e==null)return;typeof e==="number"&&!d.cssNumber[h]&&(e+="px");if(!j||!("set"in j)||(e=j.set(a,e))!==b)try{i[c]=e}catch(k){}}},css:function(a,c,e){var f,g=d.camelCase(c),h=d.cssHooks[g];c=d.cssProps[g]||g;if(h&&"get"in h&&(f=h.get(a,!0,e))!==b)return f;if(bk)return bk(a,c,g)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]},camelCase:function(a){return a.replace(bd,bn)}}),d.curCSS=d.css,d.each(["height","width"],function(a,b){d.cssHooks[b]={get:function(a,c,e){var f;if(c){a.offsetWidth!==0?f=bo(a,b,e):d.swap(a,bh,function(){f=bo(a,b,e)});if(f<=0){f=bk(a,b,b),f==="0px"&&bm&&(f=bm(a,b,b));if(f!=null)return f===""||f==="auto"?"0px":f}if(f<0||f==null){f=a.style[b];return f===""||f==="auto"?"0px":f}return typeof f==="string"?f:f+"px"}},set:function(a,b){if(!bf.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),d.support.opacity||(d.cssHooks.opacity={get:function(a,b){return bc.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style;c.zoom=1;var e=d.isNaN(b)?"":"alpha(opacity="+b*100+")",f=c.filter||"";c.filter=bb.test(f)?f.replace(bb,e):c.filter+" "+e}}),c.defaultView&&c.defaultView.getComputedStyle&&(bl=function(a,c,e){var f,g,h;e=e.replace(be,"-$1").toLowerCase();if(!(g=a.ownerDocument.defaultView))return b;if(h=g.getComputedStyle(a,null))f=h.getPropertyValue(e),f===""&&!d.contains(a.ownerDocument.documentElement,a)&&(f=d.style(a,e));return f}),c.documentElement.currentStyle&&(bm=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bf.test(d)&&bg.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bk=bl||bm,d.expr&&d.expr.filters&&(d.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!d.support.reliableHiddenOffsets&&(a.style.display||d.css(a,"display"))==="none"},d.expr.filters.visible=function(a){return!d.expr.filters.hidden(a)});var bp=/%20/g,bq=/\[\]$/,br=/\r?\n/g,bs=/#.*$/,bt=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bu=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bv=/(?:^file|^widget|\-extension):$/,bw=/^(?:GET|HEAD)$/,bx=/^\/\//,by=/\?/,bz=/
+
+
+
+
+
+
+
+
+
+
+
+
+
+
PhotoSwipe
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+